Skip to content

Commit

Permalink
feat(kit): add itemsHidden prop to tui-input-time
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Dec 4, 2024
1 parent 8579228 commit f890079
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export class ExampleTuiInputTimeComponent extends AbstractExampleTuiControl {

items = this.itemsVariants[0];

itemsHidden = false;

strict = false;

readonly modeVariants: readonly TuiTimeMode[] = ['HH:MM', 'HH:MM:SS', 'HH:MM:SS.MSS'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,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 @@ -155,6 +156,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
5 changes: 4 additions & 1 deletion projects/kit/components/input-time/input-time.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export class TuiInputTimeComponent
@Input()
items: readonly TuiTime[] = [];

@Input()
itemsHidden = false;

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

Expand Down Expand Up @@ -127,7 +130,7 @@ export class TuiInputTimeComponent
}

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

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

0 comments on commit f890079

Please sign in to comment.