@cdevhub/ngx-tw 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -15
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs +16 -5
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs +26 -15
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-badge.mjs +17 -5
- package/fesm2022/cdevhub-ngx-tw-badge.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs +27 -6
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-button.mjs +23 -11
- package/fesm2022/cdevhub-ngx-tw-button.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs +5 -5
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar-testing.mjs +3 -3
- package/fesm2022/cdevhub-ngx-tw-calendar-testing.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs +427 -122
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-card.mjs +21 -11
- package/fesm2022/cdevhub-ngx-tw-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs +215 -96
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs +108 -64
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs +18 -6
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs +55 -30
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-combobox-testing.mjs +218 -0
- package/fesm2022/cdevhub-ngx-tw-combobox-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs +236 -211
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-command-palette-testing.mjs +200 -0
- package/fesm2022/cdevhub-ngx-tw-command-palette-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs +34 -7
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-core.mjs +135 -15
- package/fesm2022/cdevhub-ngx-tw-core.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-picker-testing.mjs +203 -0
- package/fesm2022/cdevhub-ngx-tw-date-picker-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs +160 -102
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-range-picker-testing.mjs +209 -0
- package/fesm2022/cdevhub-ngx-tw-date-range-picker-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs +182 -107
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-dialog-testing.mjs +122 -0
- package/fesm2022/cdevhub-ngx-tw-dialog-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs +11 -2
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs +1 -1
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-file-upload-testing.mjs +149 -0
- package/fesm2022/cdevhub-ngx-tw-file-upload-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs +57 -67
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs +42 -24
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs +114 -21
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-icon.mjs +16 -6
- package/fesm2022/cdevhub-ngx-tw-icon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-input.mjs +52 -61
- package/fesm2022/cdevhub-ngx-tw-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-item.mjs +28 -4
- package/fesm2022/cdevhub-ngx-tw-item.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-menu-testing.mjs +168 -0
- package/fesm2022/cdevhub-ngx-tw-menu-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-menu.mjs +58 -21
- package/fesm2022/cdevhub-ngx-tw-menu.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs +34 -1
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs +95 -45
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-popover.mjs +81 -32
- package/fesm2022/cdevhub-ngx-tw-popover.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs +1 -1
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-radio.mjs +131 -98
- package/fesm2022/cdevhub-ngx-tw-radio.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs +207 -42
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-select-testing.mjs +165 -0
- package/fesm2022/cdevhub-ngx-tw-select-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-select.mjs +386 -210
- package/fesm2022/cdevhub-ngx-tw-select.mjs.map +1 -1
- package/fesm2022/{cdevhub-ngx-tw-sheet-sheet-renderer-ByyNluUd.mjs → cdevhub-ngx-tw-sheet-sheet-renderer-CqVJwgmp.mjs} +3 -3
- package/fesm2022/cdevhub-ngx-tw-sheet-sheet-renderer-CqVJwgmp.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-sheet-testing.mjs +129 -0
- package/fesm2022/cdevhub-ngx-tw-sheet-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs +23 -7
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-slider.mjs +89 -54
- package/fesm2022/cdevhub-ngx-tw-slider.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-sort.mjs +122 -17
- package/fesm2022/cdevhub-ngx-tw-sort.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-split.mjs +72 -19
- package/fesm2022/cdevhub-ngx-tw-split.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stat.mjs +63 -25
- package/fesm2022/cdevhub-ngx-tw-stat.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs +35 -8
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-switch.mjs +54 -48
- package/fesm2022/cdevhub-ngx-tw-switch.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs +12 -15
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-table.mjs +74 -13
- package/fesm2022/cdevhub-ngx-tw-table.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs +84 -30
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tags-input-testing.mjs +172 -0
- package/fesm2022/cdevhub-ngx-tw-tags-input-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs +107 -71
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs +41 -9
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-theme.mjs +257 -45
- package/fesm2022/cdevhub-ngx-tw-theme.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-time-picker-testing.mjs +201 -0
- package/fesm2022/cdevhub-ngx-tw-time-picker-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs +184 -77
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs +110 -27
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs.map +1 -1
- package/fesm2022/{cdevhub-ngx-tw-toast-toast-renderer-DSu4YoTy.mjs → cdevhub-ngx-tw-toast-toast-renderer-BlDxemsU.mjs} +107 -19
- package/fesm2022/cdevhub-ngx-tw-toast-toast-renderer-BlDxemsU.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-toast.mjs +21 -13
- package/fesm2022/cdevhub-ngx-tw-toast.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs +102 -15
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-transfer-testing.mjs +219 -0
- package/fesm2022/cdevhub-ngx-tw-transfer-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs +88 -69
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tree.mjs +68 -19
- package/fesm2022/cdevhub-ngx-tw-tree.mjs.map +1 -1
- package/index.json +1 -1
- package/package.json +63 -2
- package/theme/_base.css +13 -0
- package/theme/_dark.css +111 -36
- package/theme/_high-contrast-dark.css +367 -0
- package/theme/_high-contrast.css +13 -2
- package/theme/_light.css +332 -0
- package/theme/_semantic.css +60 -26
- package/theme/_typography.css +17 -0
- package/theme/index.css +86 -7
- package/types/cdevhub-ngx-tw-accordion.d.ts +12 -4
- package/types/cdevhub-ngx-tw-avatar.d.ts +10 -3
- package/types/cdevhub-ngx-tw-button.d.ts +1 -0
- package/types/cdevhub-ngx-tw-calendar-luxon.d.ts +2 -2
- package/types/cdevhub-ngx-tw-calendar-testing.d.ts +1 -1
- package/types/cdevhub-ngx-tw-calendar.d.ts +179 -73
- package/types/cdevhub-ngx-tw-card.d.ts +11 -3
- package/types/cdevhub-ngx-tw-carousel.d.ts +89 -20
- package/types/cdevhub-ngx-tw-checkbox.d.ts +40 -12
- package/types/cdevhub-ngx-tw-code-block.d.ts +11 -2
- package/types/cdevhub-ngx-tw-collapsible.d.ts +32 -5
- package/types/cdevhub-ngx-tw-combobox-testing.d.ts +157 -0
- package/types/cdevhub-ngx-tw-combobox.d.ts +94 -53
- package/types/cdevhub-ngx-tw-command-palette-testing.d.ts +136 -0
- package/types/cdevhub-ngx-tw-command-palette.d.ts +33 -5
- package/types/cdevhub-ngx-tw-core.d.ts +152 -21
- package/types/cdevhub-ngx-tw-date-picker-testing.d.ts +141 -0
- package/types/cdevhub-ngx-tw-date-picker.d.ts +37 -29
- package/types/cdevhub-ngx-tw-date-range-picker-testing.d.ts +148 -0
- package/types/cdevhub-ngx-tw-date-range-picker.d.ts +36 -29
- package/types/cdevhub-ngx-tw-dialog-testing.d.ts +98 -0
- package/types/cdevhub-ngx-tw-dialog.d.ts +12 -3
- package/types/cdevhub-ngx-tw-file-upload-testing.d.ts +120 -0
- package/types/cdevhub-ngx-tw-file-upload.d.ts +8 -10
- package/types/cdevhub-ngx-tw-flip-card.d.ts +18 -11
- package/types/cdevhub-ngx-tw-form-field.d.ts +19 -2
- package/types/cdevhub-ngx-tw-icon.d.ts +3 -3
- package/types/cdevhub-ngx-tw-input.d.ts +5 -8
- package/types/cdevhub-ngx-tw-item.d.ts +2 -0
- package/types/cdevhub-ngx-tw-menu-testing.d.ts +131 -0
- package/types/cdevhub-ngx-tw-menu.d.ts +2 -2
- package/types/cdevhub-ngx-tw-number-input.d.ts +20 -0
- package/types/cdevhub-ngx-tw-paginator.d.ts +58 -24
- package/types/cdevhub-ngx-tw-popover.d.ts +41 -10
- package/types/cdevhub-ngx-tw-progress-bar.d.ts +1 -1
- package/types/cdevhub-ngx-tw-radio.d.ts +68 -25
- package/types/cdevhub-ngx-tw-segmented-control.d.ts +79 -16
- package/types/cdevhub-ngx-tw-select-testing.d.ts +114 -0
- package/types/cdevhub-ngx-tw-select.d.ts +104 -33
- package/types/cdevhub-ngx-tw-sheet-testing.d.ts +104 -0
- package/types/cdevhub-ngx-tw-sheet.d.ts +19 -3
- package/types/cdevhub-ngx-tw-slider.d.ts +79 -25
- package/types/cdevhub-ngx-tw-sort.d.ts +45 -4
- package/types/cdevhub-ngx-tw-split.d.ts +32 -2
- package/types/cdevhub-ngx-tw-stat.d.ts +14 -4
- package/types/cdevhub-ngx-tw-stepper.d.ts +16 -2
- package/types/cdevhub-ngx-tw-switch.d.ts +35 -13
- package/types/cdevhub-ngx-tw-tab-nav.d.ts +7 -6
- package/types/cdevhub-ngx-tw-table.d.ts +53 -10
- package/types/cdevhub-ngx-tw-tabs.d.ts +41 -10
- package/types/cdevhub-ngx-tw-tags-input-testing.d.ts +135 -0
- package/types/cdevhub-ngx-tw-tags-input.d.ts +26 -11
- package/types/cdevhub-ngx-tw-textarea.d.ts +3 -2
- package/types/cdevhub-ngx-tw-theme.d.ts +245 -39
- package/types/cdevhub-ngx-tw-time-picker-testing.d.ts +129 -0
- package/types/cdevhub-ngx-tw-time-picker.d.ts +76 -19
- package/types/cdevhub-ngx-tw-timeline.d.ts +36 -12
- package/types/cdevhub-ngx-tw-toast.d.ts +20 -6
- package/types/cdevhub-ngx-tw-tooltip.d.ts +28 -6
- package/types/cdevhub-ngx-tw-transfer-testing.d.ts +152 -0
- package/types/cdevhub-ngx-tw-transfer.d.ts +21 -8
- package/types/cdevhub-ngx-tw-tree.d.ts +6 -1
- package/fesm2022/cdevhub-ngx-tw-sheet-sheet-renderer-ByyNluUd.mjs.map +0 -1
- package/fesm2022/cdevhub-ngx-tw-toast-toast-renderer-DSu4YoTy.mjs.map +0 -1
|
@@ -128,79 +128,79 @@ declare class ComboboxSuffixDirective {
|
|
|
128
128
|
* `tw-form-field`.
|
|
129
129
|
*/
|
|
130
130
|
declare class ComboboxComponent<T = unknown> implements ControlValueAccessor, FormFieldControl<T | string | null>, OnInit {
|
|
131
|
-
/** Array of options to render in the popover. Accepts plain records or `TwComboboxOption<T>`. */
|
|
131
|
+
/** Array of options to render in the popover. Accepts plain records or `TwComboboxOption<T>`. Defaults to an empty array. */
|
|
132
132
|
readonly options: _angular_core.InputSignal<readonly unknown[]>;
|
|
133
|
-
/** Accessor returning the visible label for an option. Used by the default filter and the trigger label resolver. */
|
|
133
|
+
/** Accessor returning the visible label for an option. Used by the default filter and the trigger label resolver. Defaults to reading `.label`, falling back to `String(.value)`. */
|
|
134
134
|
readonly optionLabel: _angular_core.InputSignal<(option: unknown) => string>;
|
|
135
|
-
/** Accessor returning the value emitted via `valueCommit` when this option is picked. */
|
|
135
|
+
/** Accessor returning the value emitted via `valueCommit` when this option is picked. Defaults to reading `.value`. */
|
|
136
136
|
readonly optionValue: _angular_core.InputSignal<(option: unknown) => T>;
|
|
137
|
-
/** Accessor returning whether an option is non-interactive. */
|
|
137
|
+
/** Accessor returning whether an option is non-interactive. Defaults to reading `.disabled`. */
|
|
138
138
|
readonly optionDisabled: _angular_core.InputSignal<(option: unknown) => boolean>;
|
|
139
|
-
/** Accessor returning a group label. Options sharing a group render under a labelled `role="group"` region. */
|
|
139
|
+
/** Accessor returning a group label. Options sharing a group render under a labelled `role="group"` region. Defaults to reading `.group`. */
|
|
140
140
|
readonly optionGroup: _angular_core.InputSignal<(option: unknown) => string | undefined>;
|
|
141
|
-
/** Accessor returning an optional secondary description rendered under the label in the default option row. */
|
|
141
|
+
/** Accessor returning an optional secondary description rendered under the label in the default option row. Defaults to reading `.description`. */
|
|
142
142
|
readonly optionDescription: _angular_core.InputSignal<(option: unknown) => string | undefined>;
|
|
143
143
|
/** Filter function applied client-side whenever `inputValue` changes. Pass `null` to disable client filtering (async mode). Defaults to case-insensitive `startsWith` on the label. */
|
|
144
|
-
readonly filterFn: _angular_core.InputSignal<
|
|
145
|
-
/** When `true`, free-text commits are rejected — the input reverts to the last committed label on blur. */
|
|
144
|
+
readonly filterFn: _angular_core.InputSignal<TwComboboxFilterFn | null>;
|
|
145
|
+
/** When `true`, free-text commits are rejected — the input reverts to the last committed label on blur. Defaults to `false`. */
|
|
146
146
|
readonly strict: _angular_core.InputSignal<boolean>;
|
|
147
|
-
/** Placeholder shown when the input is empty. */
|
|
147
|
+
/** Placeholder shown when the input is empty. Defaults to `undefined`. */
|
|
148
148
|
readonly placeholder: _angular_core.InputSignal<string | undefined>;
|
|
149
|
-
/** Disables the input and prevents the popover from opening. */
|
|
149
|
+
/** Disables the input and prevents the popover from opening. Defaults to `false`. Alias: `disabled`. */
|
|
150
150
|
readonly disabledInput: _angular_core.InputSignal<boolean>;
|
|
151
|
-
/** Sets `aria-required="true"` on the input. */
|
|
151
|
+
/** Sets `aria-required="true"` on the input and the `*` marker on a wrapping `tw-form-field`. Also inferred from `Validators.required` on a bound control, so a reactive/template-driven form does not have to state it twice. Defaults to `false`. */
|
|
152
152
|
readonly requiredInput: _angular_core.InputSignal<boolean>;
|
|
153
|
-
/** Controls trigger padding and font size per the inline padding scale. */
|
|
153
|
+
/** Controls trigger padding and font size per the inline padding scale. Defaults to `'md'`. */
|
|
154
154
|
readonly size: _angular_core.InputSignal<TwSize>;
|
|
155
|
-
/** Semantic color for the focus ring. */
|
|
155
|
+
/** Semantic color for the focus ring. Defaults to `'primary'`. */
|
|
156
156
|
readonly color: _angular_core.InputSignal<TwColor>;
|
|
157
|
-
/** Whether the trailing chevron affordance is rendered. */
|
|
157
|
+
/** Whether the trailing chevron affordance is rendered. Defaults to `true` — the chevron signals the dropdown affordance; the special case is an inline search input that opts out. */
|
|
158
158
|
readonly showChevron: _angular_core.InputSignal<boolean>;
|
|
159
|
-
/** Whether the inline clear (×) button appears while `inputValue` is non-empty. */
|
|
159
|
+
/** Whether the inline clear (×) button appears while `inputValue` is non-empty. Defaults to `true` — clearing a typed value is the expected combobox gesture; the special case is a required-only flow. */
|
|
160
160
|
readonly clearable: _angular_core.InputSignal<boolean>;
|
|
161
|
-
/** When `true`, shows an in-popover spinner and an inline spinner in the trigger while the popover is open. */
|
|
161
|
+
/** When `true`, shows an in-popover spinner and an inline spinner in the trigger while the popover is open. Defaults to `false`. */
|
|
162
162
|
readonly loading: _angular_core.InputSignal<boolean>;
|
|
163
|
-
/** Debounce window (ms) before `queryChange` emits. Local filtering is not debounced. */
|
|
163
|
+
/** Debounce window (ms) before `queryChange` emits. Local filtering is not debounced. Defaults to `150`. */
|
|
164
164
|
readonly queryDebounce: _angular_core.InputSignal<number>;
|
|
165
|
-
/** Minimum query length before the popover opens automatically. `0` opens on focus. */
|
|
165
|
+
/** Minimum query length before the popover opens automatically. `0` opens on focus. Defaults to `0`. */
|
|
166
166
|
readonly minQueryLength: _angular_core.InputSignal<number>;
|
|
167
|
-
/** Whether the popover opens automatically when the input receives focus. */
|
|
167
|
+
/** Whether the popover opens automatically when the input receives focus. Defaults to `true` — clicking into a combobox opens the dropdown, matching select-like UX; the special case is a flow that should open only once the user types. */
|
|
168
168
|
readonly openOnFocus: _angular_core.InputSignal<boolean>;
|
|
169
|
-
/** Maximum height (px) of the popover scroll region. */
|
|
169
|
+
/** Maximum height (px) of the popover scroll region. Defaults to `256`. */
|
|
170
170
|
readonly panelMaxHeight: _angular_core.InputSignal<number>;
|
|
171
|
-
/** Overlay width strategy. `'trigger'` matches input width; `'auto'` lets content decide; a number is applied as px; a string is passed as a CSS length. */
|
|
171
|
+
/** Overlay width strategy. `'trigger'` matches input width; `'auto'` lets content decide; a number is applied as px; a string is passed as a CSS length. Defaults to `'trigger'`. */
|
|
172
172
|
readonly panelWidth: _angular_core.InputSignal<string | number>;
|
|
173
|
-
/** Extra class(es) appended to the overlay panel for consumer customization. */
|
|
173
|
+
/** Extra class(es) appended to the overlay panel for consumer customization. Defaults to an empty string. */
|
|
174
174
|
readonly panelClass: _angular_core.InputSignal<string | readonly string[]>;
|
|
175
|
-
/** CDK overlay scroll strategy. */
|
|
175
|
+
/** CDK overlay scroll strategy. Defaults to `'reposition'`. */
|
|
176
176
|
readonly scrollStrategy: _angular_core.InputSignal<"reposition" | "close" | "block">;
|
|
177
|
-
/** Pixel offset between the input and the popover. */
|
|
177
|
+
/** Pixel offset between the input and the popover. Defaults to `4`. */
|
|
178
178
|
readonly offset: _angular_core.InputSignal<number>;
|
|
179
|
-
/** Fallback empty-state message when no `*twComboboxEmpty` template is projected. */
|
|
179
|
+
/** Fallback empty-state message when no `*twComboboxEmpty` template is projected. Defaults to `'No results'`. */
|
|
180
180
|
readonly emptyMessage: _angular_core.InputSignal<string>;
|
|
181
|
-
/** Equality comparator used to reconcile `value` with options during `writeValue`. */
|
|
181
|
+
/** Equality comparator used to reconcile `value` with options during `writeValue`. Defaults to `Object.is`. */
|
|
182
182
|
readonly compareWith: _angular_core.InputSignal<(a: T, b: T) => boolean>;
|
|
183
|
-
/** Accessible name for the combobox input. */
|
|
183
|
+
/** Accessible name for the combobox input. Defaults to `undefined`. Alias: `aria-label`. */
|
|
184
184
|
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
185
|
-
/** ID of an external label element. */
|
|
185
|
+
/** ID of an external label element. Defaults to `undefined`. Alias: `aria-labelledby`. */
|
|
186
186
|
readonly ariaLabelledby: _angular_core.InputSignal<string | undefined>;
|
|
187
|
-
/** ID of an external descriptor element. */
|
|
187
|
+
/** ID of an external descriptor element. Defaults to `undefined`. Alias: `aria-describedby`. */
|
|
188
188
|
readonly ariaDescribedby: _angular_core.InputSignal<string | undefined>;
|
|
189
189
|
/** Per-instance override of the {@link ErrorStateMatcher}. When omitted, the combobox uses the `TW_ERROR_STATE_MATCHER` token's value. */
|
|
190
190
|
readonly errorStateMatcher: _angular_core.InputSignal<ErrorStateMatcher | undefined>;
|
|
191
|
-
/** Two-way bound committed value. May be an option's value (`T`), a typed string (free-text mode), or `null`. */
|
|
191
|
+
/** Two-way bound committed value. May be an option's value (`T`), a typed string (free-text mode), or `null`. Defaults to `null`. */
|
|
192
192
|
readonly value: _angular_core.ModelSignal<string | T | null>;
|
|
193
|
-
/** Two-way bound visible text in the input. Bound separately from `value` so async consumers can drive the query. */
|
|
193
|
+
/** Two-way bound visible text in the input. Bound separately from `value` so async consumers can drive the query. Writes back on every keystroke, on commit, and on clear. Defaults to `''`. */
|
|
194
194
|
readonly inputValue: _angular_core.ModelSignal<string>;
|
|
195
|
-
/** Two-way bound open state of the popover. */
|
|
195
|
+
/** Two-way bound open state of the popover. Defaults to `false`. */
|
|
196
196
|
readonly open: _angular_core.ModelSignal<boolean>;
|
|
197
|
-
/** Fires after the query text changes, debounced by `queryDebounce`. Async-mode consumers subscribe to this to fetch results. */
|
|
197
|
+
/** Fires after the query text changes, debounced by `queryDebounce`. Async-mode consumers subscribe to this to fetch results. Payload is the current input text, untrimmed. */
|
|
198
198
|
readonly queryChange: _angular_core.OutputEmitterRef<string>;
|
|
199
|
-
/** Fires when the user picks an option from the list (not on free-text commit). */
|
|
199
|
+
/** Fires when the user picks an option from the list (not on free-text commit). Payload carries the raw option record plus its resolved `value` and `label`. */
|
|
200
200
|
readonly optionSelected: _angular_core.OutputEmitterRef<TwComboboxOptionSelectedEvent<T>>;
|
|
201
201
|
/** Fires whenever `value` changes, with a `source` discriminator distinguishing option / free-text / reset / programmatic origin. */
|
|
202
202
|
readonly valueCommit: _angular_core.OutputEmitterRef<TwComboboxValueCommitEvent<T>>;
|
|
203
|
-
/** Fires when the popover
|
|
203
|
+
/** Fires when the popover finishes opening or closing. Payload carries the new `open` state and the trigger element the overlay is anchored to. */
|
|
204
204
|
readonly openedChange: _angular_core.OutputEmitterRef<TwComboboxOpenedEvent>;
|
|
205
205
|
/** @internal */
|
|
206
206
|
readonly optionTemplateChild: Signal<ComboboxOptionTemplateDirective<any, any> | undefined>;
|
|
@@ -211,6 +211,7 @@ declare class ComboboxComponent<T = unknown> implements ControlValueAccessor, Fo
|
|
|
211
211
|
private readonly inputRef;
|
|
212
212
|
private readonly triggerSurfaceRef;
|
|
213
213
|
private readonly overlayService;
|
|
214
|
+
private readonly coordinator;
|
|
214
215
|
private readonly elementRef;
|
|
215
216
|
private readonly viewContainerRef;
|
|
216
217
|
private readonly injector;
|
|
@@ -220,9 +221,6 @@ declare class ComboboxComponent<T = unknown> implements ControlValueAccessor, Fo
|
|
|
220
221
|
private readonly platform;
|
|
221
222
|
private readonly formField;
|
|
222
223
|
private readonly ngControl;
|
|
223
|
-
private readonly parentForm;
|
|
224
|
-
private readonly parentFormGroup;
|
|
225
|
-
private readonly defaultMatcher;
|
|
226
224
|
private readonly uid;
|
|
227
225
|
/** @internal */
|
|
228
226
|
readonly hostId: string;
|
|
@@ -237,25 +235,34 @@ declare class ComboboxComponent<T = unknown> implements ControlValueAccessor, Fo
|
|
|
237
235
|
/** @internal */
|
|
238
236
|
readonly focusedSignal: _angular_core.WritableSignal<boolean>;
|
|
239
237
|
private readonly cvaDisabled;
|
|
240
|
-
|
|
241
|
-
private readonly
|
|
238
|
+
/** @internal Shared `errorState` / `required` / `errors` derivation — see `wireErrorState`. */
|
|
239
|
+
private readonly errorWiring;
|
|
242
240
|
private readonly describedByIdsSignal;
|
|
243
241
|
private readonly labelledByIdsSignal;
|
|
244
242
|
/** @internal */
|
|
245
243
|
readonly lastCommittedLabel: _angular_core.WritableSignal<string>;
|
|
246
244
|
private readonly pendingWriteValue;
|
|
247
|
-
private readonly closingSignal;
|
|
248
245
|
/** Re-runs the input handler once after IME composition ends. */
|
|
249
246
|
private composingPendingValue;
|
|
250
247
|
private onChange;
|
|
251
248
|
private onTouched;
|
|
252
|
-
private overlayRef;
|
|
253
|
-
private readonly overlayInstanceSignal;
|
|
254
|
-
private closeTimer;
|
|
255
249
|
private queryDebounceTimer;
|
|
256
250
|
private announceTimer;
|
|
251
|
+
/**
|
|
252
|
+
* Watches the host for size changes so `panelWidth="trigger"` keeps tracking
|
|
253
|
+
* while the panel is up. Minted per open and disconnected on close, because
|
|
254
|
+
* the `OverlayRef` it feeds is disposed on close (see `openOverlay`).
|
|
255
|
+
*/
|
|
257
256
|
private resizeObserver;
|
|
258
|
-
private
|
|
257
|
+
private overlayInstance;
|
|
258
|
+
private closing;
|
|
259
|
+
/**
|
|
260
|
+
* Flips true once the overlay component is attached; the sole trigger for the
|
|
261
|
+
* state-push effect. Load-bearing: the close path leaves `activeIndex` and the
|
|
262
|
+
* rest of the pushed state untouched, so on a reopen no data signal changes and
|
|
263
|
+
* nothing else would wake that effect — the fresh panel would render empty.
|
|
264
|
+
*/
|
|
265
|
+
private readonly isAttached;
|
|
259
266
|
/** @internal */
|
|
260
267
|
readonly isDisabled: Signal<boolean>;
|
|
261
268
|
/** @internal Auto-naked when wrapped in tw-form-field. */
|
|
@@ -307,8 +314,18 @@ declare class ComboboxComponent<T = unknown> implements ControlValueAccessor, Fo
|
|
|
307
314
|
readonly empty: Signal<boolean>;
|
|
308
315
|
/** @internal */
|
|
309
316
|
readonly disabled: Signal<boolean>;
|
|
310
|
-
/**
|
|
317
|
+
/**
|
|
318
|
+
* @internal Resolved required state: the `required` input OR'd with
|
|
319
|
+
* `Validators.required` on a bound `NgControl`. Without the validator arm the
|
|
320
|
+
* form-field `*` marker (`FormFieldComponent.isRequired`) and the input's
|
|
321
|
+
* `aria-required` silently vanish under reactive/template-driven forms, while
|
|
322
|
+
* signal forms shows them — `cvaControlCreate` writes the `required` *input*
|
|
323
|
+
* directly from the field state and never consults validators. The OR keeps
|
|
324
|
+
* both branches true at once.
|
|
325
|
+
*/
|
|
311
326
|
readonly required: Signal<boolean>;
|
|
327
|
+
/** @internal Active validation errors map from the bound `NgControl`. Drives `[twError match="…"]` inside a wrapping `tw-form-field`; without it the form-field's key set is permanently empty and every `match`ed error stays hidden. */
|
|
328
|
+
readonly errors: Signal<Record<string, unknown> | null>;
|
|
312
329
|
/** @internal */
|
|
313
330
|
readonly controlType = "combobox";
|
|
314
331
|
/** @internal */
|
|
@@ -338,7 +355,15 @@ declare class ComboboxComponent<T = unknown> implements ControlValueAccessor, Fo
|
|
|
338
355
|
onKeydown(event: KeyboardEvent): void;
|
|
339
356
|
/** @internal — preventDefault to keep DOM focus on the input. */
|
|
340
357
|
onClearMousedown(event: MouseEvent): void;
|
|
341
|
-
/**
|
|
358
|
+
/**
|
|
359
|
+
* @internal
|
|
360
|
+
*
|
|
361
|
+
* Reached by mouse and — since the button left `tabindex="-1"` — by Enter or
|
|
362
|
+
* Space from the keyboard, both of which a native `<button>` delivers here
|
|
363
|
+
* as a click. Clearing unmounts this button (`showClearButton()` goes
|
|
364
|
+
* false), so focus is handed back to the input rather than falling to
|
|
365
|
+
* `<body>` (SC 2.4.3).
|
|
366
|
+
*/
|
|
342
367
|
onClearClick(event: MouseEvent): void;
|
|
343
368
|
/** Clears the input and committed value, emitting `valueCommit({ source: 'reset' })`. */
|
|
344
369
|
clear(): void;
|
|
@@ -352,24 +377,40 @@ declare class ComboboxComponent<T = unknown> implements ControlValueAccessor, Fo
|
|
|
352
377
|
private scheduleQueryEmit;
|
|
353
378
|
private clearQueryDebounceTimer;
|
|
354
379
|
private clearAnnounceTimer;
|
|
380
|
+
/**
|
|
381
|
+
* Builds and attaches the panel through {@link PickerOverlayCoordinator}.
|
|
382
|
+
*
|
|
383
|
+
* The coordinator disposes the `OverlayRef` on close, so every value read
|
|
384
|
+
* here — `offset`, `scrollStrategy`, `panelClass`, and the position
|
|
385
|
+
* strategy's origin — is re-read on each open rather than frozen at the
|
|
386
|
+
* first one. That replaces the previous `refreshPositionConfig()` /
|
|
387
|
+
* `applyScrollStrategy()` pair, which could only refresh the two inputs it
|
|
388
|
+
* knew about on a reused ref.
|
|
389
|
+
*
|
|
390
|
+
* `focusTrap: false` is load-bearing: this is an `aria-activedescendant`
|
|
391
|
+
* combobox, so DOM focus never leaves the `<input>` and a trap's anchor
|
|
392
|
+
* elements would inject tab stops around a panel with nothing focusable in it.
|
|
393
|
+
*/
|
|
355
394
|
private openOverlay;
|
|
356
395
|
private closeOverlay;
|
|
357
|
-
private ensureOverlay;
|
|
358
396
|
private installResizeObserver;
|
|
359
397
|
private updateOverlaySize;
|
|
360
|
-
private attachOverlayComponent;
|
|
361
|
-
private subscribeBackdrop;
|
|
362
398
|
/**
|
|
363
|
-
*
|
|
399
|
+
* Registers the backdrop-click and Escape listeners for one open.
|
|
400
|
+
*
|
|
401
|
+
* The Escape listener rides the overlay's `keydownEvents()`. Mirrors
|
|
364
402
|
* `SelectComponent` so focus inside the overlay panel (e.g., if the user
|
|
365
403
|
* tabs into projected loading/empty templates) still dismisses cleanly.
|
|
366
404
|
* The combobox's own `<input>` keydown handler already short-circuits
|
|
367
405
|
* Escape when focus is on the input; this layer is the safety net for
|
|
368
406
|
* panel-internal focus.
|
|
407
|
+
*
|
|
408
|
+
* Both streams come from the coordinator, which completes them when the
|
|
409
|
+
* overlay closes — so there is no per-open `Subscription` aggregate to keep
|
|
410
|
+
* and no way for listeners to accumulate across opens.
|
|
369
411
|
*/
|
|
370
|
-
private
|
|
412
|
+
private subscribePerOpen;
|
|
371
413
|
private resolvePanelClass;
|
|
372
|
-
private clearCloseTimer;
|
|
373
414
|
writeValue(value: T | string | null): void;
|
|
374
415
|
registerOnChange(fn: (value: T | string | null) => void): void;
|
|
375
416
|
registerOnTouched(fn: () => void): void;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/** Filters accepted by `CommandPaletteItemHarness.with`. */
|
|
4
|
+
interface CommandPaletteItemHarnessFilters extends BaseHarnessFilters {
|
|
5
|
+
/** Match by the item's visible text, which includes its description when it has one. */
|
|
6
|
+
text?: string | RegExp;
|
|
7
|
+
/** Match the active (`aria-activedescendant`) item. */
|
|
8
|
+
active?: boolean;
|
|
9
|
+
/** Match disabled / enabled items. */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Harness for a single result row in an open `tw-command-palette`.
|
|
14
|
+
*
|
|
15
|
+
* These rows are `role="option"` inside an activedescendant listbox: they never
|
|
16
|
+
* receive DOM focus and have no keyboard handlers of their own. "Active" here
|
|
17
|
+
* therefore means *referenced by the input's `aria-activedescendant`*, which the
|
|
18
|
+
* component mirrors onto each row as `aria-selected`. It does **not** mean
|
|
19
|
+
* `document.activeElement`.
|
|
20
|
+
*/
|
|
21
|
+
declare class CommandPaletteItemHarness extends ComponentHarness {
|
|
22
|
+
static hostSelector: string;
|
|
23
|
+
/** Predicate for `locatorFor` / `locatorForAll`. */
|
|
24
|
+
static with(options?: CommandPaletteItemHarnessFilters): HarnessPredicate<CommandPaletteItemHarness>;
|
|
25
|
+
/** The row's rendered text, trimmed. Includes the description when one is rendered. */
|
|
26
|
+
getText(): Promise<string>;
|
|
27
|
+
/** The row's DOM id, which is what `aria-activedescendant` points at. */
|
|
28
|
+
getId(): Promise<string | null>;
|
|
29
|
+
/**
|
|
30
|
+
* Whether this row is the active descendant. Read from `aria-selected`, which
|
|
31
|
+
* the component binds to the active id — not from DOM focus, which never moves
|
|
32
|
+
* off the search input.
|
|
33
|
+
*/
|
|
34
|
+
isActive(): Promise<boolean>;
|
|
35
|
+
/** Whether the row reports `aria-disabled="true"`. */
|
|
36
|
+
isDisabled(): Promise<boolean>;
|
|
37
|
+
/** Clicks the row, activating the command. */
|
|
38
|
+
click(): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Filters accepted by `CommandPaletteHarness.with`. */
|
|
42
|
+
interface CommandPaletteHarnessFilters extends BaseHarnessFilters {
|
|
43
|
+
/** Match by the palette's accessible label. */
|
|
44
|
+
label?: string | RegExp;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Harness for `tw-command-palette`.
|
|
48
|
+
*
|
|
49
|
+
* The palette renders into the CDK overlay container, outside the
|
|
50
|
+
* `tw-command-palette` host, so this harness resolves the panel through
|
|
51
|
+
* `documentRootLocatorFactory()`. A consumer loads it from the ordinary fixture
|
|
52
|
+
* loader and still reaches the results.
|
|
53
|
+
*
|
|
54
|
+
* The palette is an **activedescendant listbox**: DOM focus stays on the search
|
|
55
|
+
* input and the active row is identified only by `aria-activedescendant`. Every
|
|
56
|
+
* "active" method here resolves that id reference — none of them consults
|
|
57
|
+
* `document.activeElement`, which would always report the input.
|
|
58
|
+
*/
|
|
59
|
+
declare class CommandPaletteHarness extends ComponentHarness {
|
|
60
|
+
static hostSelector: string;
|
|
61
|
+
private readonly panel;
|
|
62
|
+
private readonly input;
|
|
63
|
+
/** Predicate for `locatorFor` / `locatorForAll`. */
|
|
64
|
+
static with(options?: CommandPaletteHarnessFilters): HarnessPredicate<CommandPaletteHarness>;
|
|
65
|
+
/** Whether the palette overlay is currently attached. */
|
|
66
|
+
isOpen(): Promise<boolean>;
|
|
67
|
+
/** The palette's accessible label, or `null` when it is closed. */
|
|
68
|
+
getLabel(): Promise<string | null>;
|
|
69
|
+
/** The current search query. Returns an empty string when the palette is closed. */
|
|
70
|
+
getQuery(): Promise<string>;
|
|
71
|
+
/**
|
|
72
|
+
* Types into the search input, replacing any existing query, then waits for
|
|
73
|
+
* the results to settle.
|
|
74
|
+
*/
|
|
75
|
+
setQuery(query: string): Promise<void>;
|
|
76
|
+
/** Clears the search query. */
|
|
77
|
+
clearQuery(): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Sends Escape to the search input. No-op when the palette is already closed.
|
|
80
|
+
*
|
|
81
|
+
* **The overlay is still attached when this resolves.** The component defers
|
|
82
|
+
* the detach behind a leave animation, so a caller asserting on `isOpen()`
|
|
83
|
+
* immediately afterwards will still see `true`. Wait for the animation before
|
|
84
|
+
* asserting — with a plain timer, not by polling a harness method.
|
|
85
|
+
*
|
|
86
|
+
* That caveat is deliberate rather than hidden behind a poll. An earlier
|
|
87
|
+
* version looped on `isOpen()` until the panel detached, which reads better
|
|
88
|
+
* but is unsound here: every harness call routes through
|
|
89
|
+
* `fixture.whenStable()`, and under zoneless that can wait on a re-scheduled
|
|
90
|
+
* timer and never resolve. A deadline checked *between* awaits cannot bound a
|
|
91
|
+
* single await that never returns, so the loop hung the suite instead of
|
|
92
|
+
* failing it. A harness that can hang is worse than one that makes the caller
|
|
93
|
+
* wait explicitly.
|
|
94
|
+
*
|
|
95
|
+
* **This method is not covered by a spec.** A test driving it hung at the full
|
|
96
|
+
* 15000ms budget in roughly one run in three: the harness calls it makes
|
|
97
|
+
* around a leave animation route through `whenStable()`, which can wait on a
|
|
98
|
+
* re-scheduled timer and never resolve. Escape dismissal itself is covered in
|
|
99
|
+
* `command-palette.spec.ts`, directly against the component.
|
|
100
|
+
*/
|
|
101
|
+
close(): Promise<void>;
|
|
102
|
+
/** Moves the active descendant down one row. */
|
|
103
|
+
pressArrowDown(): Promise<void>;
|
|
104
|
+
/** Moves the active descendant up one row. */
|
|
105
|
+
pressArrowUp(): Promise<void>;
|
|
106
|
+
/** Activates the current active descendant with Enter. */
|
|
107
|
+
pressEnter(): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Every result row currently rendered. Returns an empty array when the palette
|
|
110
|
+
* is closed.
|
|
111
|
+
*/
|
|
112
|
+
getItems(filters?: CommandPaletteItemHarnessFilters): Promise<CommandPaletteItemHarness[]>;
|
|
113
|
+
/**
|
|
114
|
+
* The labels of the rendered group headings, in DOM order. Ungrouped results
|
|
115
|
+
* produce an empty array.
|
|
116
|
+
*/
|
|
117
|
+
getGroupLabels(): Promise<string[]>;
|
|
118
|
+
/**
|
|
119
|
+
* The text of the active row, resolved through the input's
|
|
120
|
+
* `aria-activedescendant`, or `null` when nothing is active.
|
|
121
|
+
*/
|
|
122
|
+
getActiveItemText(): Promise<string | null>;
|
|
123
|
+
/**
|
|
124
|
+
* Clicks the first row whose text matches. Throws when nothing matches, rather
|
|
125
|
+
* than failing silently.
|
|
126
|
+
*/
|
|
127
|
+
selectItem(text: string | RegExp): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* The search input, or a named error when the palette is closed. Every typing
|
|
130
|
+
* and key method needs it, and "cannot read property of null" would not say why.
|
|
131
|
+
*/
|
|
132
|
+
private requireInput;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export { CommandPaletteHarness, CommandPaletteItemHarness };
|
|
136
|
+
export type { CommandPaletteHarnessFilters, CommandPaletteItemHarnessFilters };
|
|
@@ -33,19 +33,45 @@ interface CommandPaletteRef {
|
|
|
33
33
|
setQuery(query: string): void;
|
|
34
34
|
}
|
|
35
35
|
/** Injection token providing a `CommandPaletteRef` to palette overlay content. */
|
|
36
|
+
declare const TW_COMMAND_PALETTE_REF: InjectionToken<CommandPaletteRef>;
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Renamed to {@link TW_COMMAND_PALETTE_REF} for consistency with
|
|
39
|
+
* every other ngx-tw injection token. This is the *same token instance*, not a
|
|
40
|
+
* copy — providing under either name and injecting under the other resolves —
|
|
41
|
+
* so the rename is safe to adopt incrementally. Removed in the next major.
|
|
42
|
+
*/
|
|
36
43
|
declare const COMMAND_PALETTE_REF: InjectionToken<CommandPaletteRef>;
|
|
37
44
|
|
|
38
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* One entry of the palette's resolved item list — the merge of a declarative
|
|
47
|
+
* `*twCommandPaletteItem` directive with a `commands` array entry.
|
|
48
|
+
*
|
|
49
|
+
* Public because it is the element type of {@link CommandPaletteComponent.filteredItems}
|
|
50
|
+
* and the parameter type of `selectItem()` / `setActiveItem()`. Re-exported
|
|
51
|
+
* from the entry point as `CommandPaletteResolvedItem`.
|
|
52
|
+
*/
|
|
39
53
|
interface ResolvedItem {
|
|
54
|
+
/** The underlying item data, whether declared inline or supplied via `commands`. */
|
|
40
55
|
readonly data: CommandPaletteItem;
|
|
56
|
+
/** The declarative directive backing this item, when it came from a template. */
|
|
41
57
|
readonly directive?: CommandPaletteItemDirective;
|
|
58
|
+
/** The custom row template to render instead of the default row, when one was supplied. */
|
|
42
59
|
readonly template?: TemplateRef<unknown>;
|
|
60
|
+
/** The item's shortcut, normalised to a key list. Empty when the item declares none. */
|
|
43
61
|
readonly shortcutKeys: readonly string[];
|
|
44
62
|
}
|
|
45
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* A rendered group in the filtered view.
|
|
65
|
+
*
|
|
66
|
+
* Public because it is the element type of {@link CommandPaletteComponent.grouped}.
|
|
67
|
+
* Re-exported from the entry point as `CommandPaletteResolvedGroup`.
|
|
68
|
+
*/
|
|
46
69
|
interface ResolvedGroup {
|
|
70
|
+
/** Stable DOM id for the group's section element. */
|
|
47
71
|
readonly id: string;
|
|
72
|
+
/** The group header text, or `undefined` for the implicit ungrouped bucket. */
|
|
48
73
|
readonly label?: string;
|
|
74
|
+
/** The group's items, in filtered order. */
|
|
49
75
|
readonly items: readonly ResolvedItem[];
|
|
50
76
|
}
|
|
51
77
|
/** Optional explicit grouping wrapper. Items placed inside inherit its label. */
|
|
@@ -110,7 +136,7 @@ declare class CommandPaletteComponent {
|
|
|
110
136
|
readonly size: _angular_core.InputSignal<TwSize>;
|
|
111
137
|
/** Placeholder text shown inside the search input. Defaults to `'Type a command or search…'`. */
|
|
112
138
|
readonly placeholder: _angular_core.InputSignal<string>;
|
|
113
|
-
/** Two-way bindable search query.
|
|
139
|
+
/** Two-way bindable search query. Writes back on every keystroke in the search input. Opening and closing the palette leave it untouched — reset it yourself if each open should start empty. Defaults to `''`. */
|
|
114
140
|
readonly query: _angular_core.ModelSignal<string>;
|
|
115
141
|
/** Two-way bindable open state. Setting to `true` opens the palette; closing updates it to `false`. Defaults to `false`. */
|
|
116
142
|
readonly open: _angular_core.ModelSignal<boolean>;
|
|
@@ -144,6 +170,8 @@ declare class CommandPaletteComponent {
|
|
|
144
170
|
private readonly destroyRef;
|
|
145
171
|
private readonly focusTrapFactory;
|
|
146
172
|
private readonly announcer;
|
|
173
|
+
private readonly document;
|
|
174
|
+
private readonly isBrowser;
|
|
147
175
|
private readonly declarativeItems;
|
|
148
176
|
private readonly emptyDirective;
|
|
149
177
|
private readonly footerDirective;
|
|
@@ -218,5 +246,5 @@ declare class CommandPaletteComponent {
|
|
|
218
246
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CommandPaletteComponent, "tw-command-palette", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "query": { "alias": "query"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; "commands": { "alias": "commands"; "required": false; "isSignal": true; }; "filterFn": { "alias": "filterFn"; "required": false; "isSignal": true; }; "closeOnSelect": { "alias": "closeOnSelect"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "closeOnBackdropClick": { "alias": "closeOnBackdropClick"; "required": false; "isSignal": true; }; "autoFocus": { "alias": "autoFocus"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "searchAriaLabel": { "alias": "searchAriaLabel"; "required": false; "isSignal": true; }; "panelClass": { "alias": "panelClass"; "required": false; "isSignal": true; }; }, { "query": "queryChange"; "open": "openChange"; "itemSelected": "itemSelected"; "opened": "opened"; "closed": "closed"; }, ["declarativeItems", "emptyDirective", "footerDirective"], ["*"], true, never>;
|
|
219
247
|
}
|
|
220
248
|
|
|
221
|
-
export { COMMAND_PALETTE_REF, CommandPaletteComponent, CommandPaletteEmptyDirective, CommandPaletteFooterDirective, CommandPaletteGroupDirective, CommandPaletteItemDescriptionDirective, CommandPaletteItemDirective, CommandPaletteItemIconDirective };
|
|
222
|
-
export type { CommandPaletteFilterFn, CommandPaletteItem, CommandPaletteRef };
|
|
249
|
+
export { COMMAND_PALETTE_REF, CommandPaletteComponent, CommandPaletteEmptyDirective, CommandPaletteFooterDirective, CommandPaletteGroupDirective, CommandPaletteItemDescriptionDirective, CommandPaletteItemDirective, CommandPaletteItemIconDirective, TW_COMMAND_PALETTE_REF };
|
|
250
|
+
export type { CommandPaletteFilterFn, CommandPaletteItem, CommandPaletteRef, ResolvedGroup as CommandPaletteResolvedGroup, ResolvedItem as CommandPaletteResolvedItem };
|