Skip to content

Commit

Permalink
feat(legacy): add itemsHidden prop to tui-input-time (#9908)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Dec 6, 2024
1 parent c6c9c38 commit b3db7bc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
9 changes: 9 additions & 0 deletions projects/demo/src/modules/components/input-time/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ <h3>DI-tokens for input-configurations:</h3>
[focusable]="focusable"
[formControl]="control"
[items]="items"
[itemsHidden]="itemsHidden"
[itemSize]="itemSize"
[mode]="mode"
[pseudoFocus]="pseudoFocused"
Expand Down Expand Up @@ -158,6 +159,14 @@ <h3>DI-tokens for input-configurations:</h3>
>
Items to choose
</ng-template>
<ng-template
documentationPropertyMode="input"
documentationPropertyName="itemsHidden"
documentationPropertyType="boolean"
[(documentationPropertyValue)]="itemsHidden"
>
Disable the display of the dropdown list
</ng-template>
<ng-template
documentationPropertyMode="input"
documentationPropertyName="itemSize"
Expand Down
2 changes: 2 additions & 0 deletions projects/demo/src/modules/components/input-time/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export default class PageComponent extends AbstractExampleTuiControl {

protected items = this.itemsVariants[0]!;

protected itemsHidden = false;

protected strict = false;

protected readonly modeVariants: readonly TuiTimeMode[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ export class TuiInputTimeComponent
@Input()
public items: readonly TuiTime[] = [];

@Input()
public itemsHidden = false;

@Input()
public itemSize: TuiInputTimeOptions['itemSize'] = this.options.itemSize;

Expand Down Expand Up @@ -166,7 +169,7 @@ export class TuiInputTimeComponent
}

protected get canOpen(): boolean {
return this.interactive && !!this.filtered.length;
return this.interactive && !!this.filtered.length && !this.itemsHidden;
}

protected get filtered(): readonly TuiTime[] {
Expand Down

0 comments on commit b3db7bc

Please sign in to comment.