Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(legacy): add itemsHidden prop to tui-input-time #9908

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
splincode marked this conversation as resolved.
Show resolved Hide resolved
</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
Loading