@egose/shadcn-theme-ng-tw 0.6.3 → 0.6.4

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.
@@ -77,24 +77,26 @@ Real selectors involved: `eg-form-searchable-multiselect` (this wrapper), `eg-fo
77
77
 
78
78
  ### `eg-form-searchable-multiselect` — `EgFormSearchableMultiselect`
79
79
 
80
- | Input | Type | Default | Description |
81
- | --------------------- | --------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
82
- | `label` | `string \| undefined` | `undefined` | Field label. When set, a `<label hlmLabel>` bound to the control id is rendered. |
83
- | `controlName` | `string` | `''` | **Required.** Name of the control in the parent `FormGroup`; forwarded as `formControlName`. |
84
- | `controlId` | `string \| undefined` | `undefined` | Explicit control id. Falls back to `id`, then to a generated `eg-form-searchable-multiselect-…` id. |
85
- | `id` | `string \| undefined` | `undefined` | Alias for an explicit control id (same fallback chain as `controlId`). |
86
- | `error` | `string \| undefined` | `undefined` | Error text rendered in `<hlm-error>`. |
87
- | `autoError` | `boolean` | `true` | Auto-resolve the message from the control's `ValidationErrors` when `error` is unset. Explicit `error` always wins; `error=""` counts as unset. Global wording via `provideEgFormErrorMessages`. |
88
- | `hint` | `string \| undefined` | `undefined` | Hint text rendered in `<hlm-hint>`. |
89
- | `placeholder` | `string` | `'Start typing to add…'` | Placeholder forwarded to the inner multiselect. |
90
- | `disabled` | `boolean` | `false` | Wrapper-level disable, forwarded as `wrapperDisabled` to the inner multiselect. |
91
- | `required` | `boolean` | `false` | Adds `required` to the inner control and renders a red `*` next to the label. |
92
- | `options` | `SelectOption[]` | `[]` | `{ label: string; value: string }[]` forwarded to the inner multiselect. |
93
- | `class` (`userClass`) | `ClassValue` | `''` | Extra classes for the host (merged over `tw:w-full`). |
94
- | `labelClass` | `string` | `''` | Extra classes for the `<label>` (merged over `tw:mb-1 tw:gap-0`). |
95
- | `controlClass` | `string` | `''` | Extra classes for the inner multiselect (merged over `tw:w-full`). |
96
- | `errorClass` | `string` | `''` | Extra classes for `<hlm-error>` (merged over `tw:mt-0`). |
97
- | `hintClass` | `string` | `''` | Extra classes for `<hlm-hint>` (merged over `tw:mt-0`). |
80
+ | Input | Type | Default | Description |
81
+ | --------------------- | ---------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
82
+ | `label` | `string \| undefined` | `undefined` | Field label. When set, a `<label hlmLabel>` bound to the control id is rendered. |
83
+ | `controlName` | `string` | `''` | **Required.** Name of the control in the parent `FormGroup`; forwarded as `formControlName`. |
84
+ | `controlId` | `string \| undefined` | `undefined` | Explicit control id. Falls back to `id`, then to a generated `eg-form-searchable-multiselect-…` id. |
85
+ | `id` | `string \| undefined` | `undefined` | Alias for an explicit control id (same fallback chain as `controlId`). |
86
+ | `error` | `string \| undefined` | `undefined` | Error text rendered in `<hlm-error>`. |
87
+ | `autoError` | `boolean` | `true` | Auto-resolve the message from the control's `ValidationErrors` when `error` is unset. Explicit `error` always wins; `error=""` counts as unset. Global wording via `provideEgFormErrorMessages`. |
88
+ | `hint` | `string \| undefined` | `undefined` | Hint text rendered in `<hlm-hint>`. |
89
+ | `placeholder` | `string` | `'Start typing to add…'` | Placeholder forwarded to the inner multiselect. |
90
+ | `disabled` | `boolean` | `false` | Wrapper-level disable, forwarded as `wrapperDisabled` to the inner multiselect. |
91
+ | `required` | `boolean` | `false` | Adds `required` to the inner control and renders a red `*` next to the label. |
92
+ | `options` | `SelectOption[]` | `[]` | `{ label: string; value: string }[]` forwarded to the inner multiselect. |
93
+ | `showSelectedChips` | `boolean \| undefined` | `undefined` | Whether the chips row renders; unset defers to the global config, then shown. Forwarded to the inner multiselect. |
94
+ | `showSearch` | `boolean \| undefined` | `undefined` | Whether the popover renders its search field; unset defers to the global config, then shown. Forwarded to the inner multiselect. |
95
+ | `class` (`userClass`) | `ClassValue` | `''` | Extra classes for the host (merged over `tw:w-full`). |
96
+ | `labelClass` | `string` | `''` | Extra classes for the `<label>` (merged over `tw:mb-1 tw:gap-0`). |
97
+ | `controlClass` | `string` | `''` | Extra classes for the inner multiselect (merged over `tw:w-full`). |
98
+ | `errorClass` | `string` | `''` | Extra classes for `<hlm-error>` (merged over `tw:mt-0`). |
99
+ | `hintClass` | `string` | `''` | Extra classes for `<hlm-hint>` (merged over `tw:mt-0`). |
98
100
 
99
101
  No outputs. Readonly computeds/methods (usable via template ref): `effectiveId()`, `errorId()` (`<id>-error`), `hintId()` (`<id>-hint`), `describedBy(): string | null` (returns the error id when the control is invalid + dirty/touched, else the hint id, else `null`).
100
102
 
@@ -111,7 +113,7 @@ Additional copy inputs:
111
113
 
112
114
  Pass the full options list. The inner control trims the query and matches label substrings case-insensitively in source order. Filtering retains hidden selections and their labels, including unresolved IDs written before asynchronous options arrive. Searching/clearing the query never changes or touches the form value. The query persists across closing/reopening and form resets; clearing its text restores all options. Wrapper and reactive-form disabled states disable the search even if the popover is already open.
113
115
 
114
- The search has an associated visible label, no-match feedback uses a polite live region, and each chip remove button has an accessible name. All four copy inputs above are forwarded unchanged. For example, on the wrapper in the complete reactive-form example below, add `searchLabel="Find tags" searchPlaceholder="Type a tag name…" emptyMessage="No tags match"`. Import `SelectOption` from the multiselect subpath to type a localized `[removeLabel]` callback. See the [multiselect usage](../searchable-multiselect/README.md#local-search) for keyboard and async ownership details. This is local label search, with no remote request or virtualization behavior.
116
+ The search has an associated visible label, no-match feedback uses a polite live region, and each chip remove button has an accessible name. All four copy inputs above are forwarded unchanged. The visibility toggles `showSearch` (popover search field) and `showSelectedChips` (chips row above the trigger) are forwarded the same way; leave them unset to defer to the global config, then the library defaults (both shown). For example, on the wrapper in the complete reactive-form example below, add `searchLabel="Find tags" searchPlaceholder="Type a tag name…" emptyMessage="No tags match"`. Import `SelectOption` from the multiselect subpath to type a localized `[removeLabel]` callback. See the [multiselect usage](../searchable-multiselect/README.md#local-search) for keyboard and async ownership details. This is local label search, with no remote request or virtualization behavior.
115
117
 
116
118
  ## Examples
117
119
 
@@ -369,13 +371,20 @@ export class ProgrammaticExample {
369
371
 
370
372
  No component-specific CSS variables; styling flows through the shared theme tokens (`--radius`, `--popover`, `--ring`, …) consumed by the inner popover/checkbox classes. Use `class` / `labelClass` / `controlClass` / `errorClass` / `hintClass` to append utilities.
371
373
 
372
- Global defaults per styling slot via the wrapper config (precedence: library base < global config < per-instance):
374
+ Global defaults per styling slot and visibility toggle via the wrapper config (precedence: library base < global config < per-instance):
373
375
 
374
376
  ```ts
375
377
  import { provideEgFormSearchableMultiselectConfig } from '@egose/shadcn-theme-ng/form-searchable-multiselect';
376
378
 
377
379
  await bootstrapApplication(App, {
378
- providers: [provideEgFormSearchableMultiselectConfig({ controlClass: 'tw:text-sm', labelClass: 'tw:font-medium' })],
380
+ providers: [
381
+ provideEgFormSearchableMultiselectConfig({
382
+ controlClass: 'tw:text-sm',
383
+ labelClass: 'tw:font-medium',
384
+ showSearch: false,
385
+ showSelectedChips: false,
386
+ }),
387
+ ],
379
388
  });
380
389
  ```
381
390
 
@@ -99,6 +99,12 @@ class EgFormSearchableMultiselect {
99
99
  /** Pure accessible chip-remove name formatter; receives the resolved label or raw unresolved ID. */
100
100
  removeLabel = input((option) => `Remove ${option.label}`, /* @ts-ignore */
101
101
  ...(ngDevMode ? [{ debugName: "removeLabel" }] : /* istanbul ignore next */ []));
102
+ /** Whether the selected chips row renders above the trigger; unset defers to the global config, then shown. */
103
+ showSelectedChips = input(undefined, /* @ts-ignore */
104
+ ...(ngDevMode ? [{ debugName: "showSelectedChips" }] : /* istanbul ignore next */ []));
105
+ /** Whether the picker popover renders its search field; unset defers to the global config, then shown. */
106
+ showSearch = input(undefined, /* @ts-ignore */
107
+ ...(ngDevMode ? [{ debugName: "showSearch" }] : /* istanbul ignore next */ []));
102
108
  // Styling classes
103
109
  userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
104
110
  labelClass = input('', /* @ts-ignore */
@@ -120,8 +126,13 @@ class EgFormSearchableMultiselect {
120
126
  ...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
121
127
  $hintClass = computed(() => hlm('tw:mt-0', this._shared.hintClass, this._config.hintClass, this.hintClass()), /* @ts-ignore */
122
128
  ...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
129
+ // Computed visibility flags (library base < global config < per-instance)
130
+ $showSelectedChips = computed(() => this.showSelectedChips() ?? this._config.showSelectedChips ?? true, /* @ts-ignore */
131
+ ...(ngDevMode ? [{ debugName: "$showSelectedChips" }] : /* istanbul ignore next */ []));
132
+ $showSearch = computed(() => this.showSearch() ?? this._config.showSearch ?? true, /* @ts-ignore */
133
+ ...(ngDevMode ? [{ debugName: "$showSearch" }] : /* istanbul ignore next */ []));
123
134
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormSearchableMultiselect, deps: [], target: i0.ɵɵFactoryTarget.Component });
124
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormSearchableMultiselect, isStandalone: true, selector: "eg-form-searchable-multiselect", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, controlId: { classPropertyName: "controlId", publicName: "controlId", isSignal: true, isRequired: false, transformFunction: null }, controlName: { classPropertyName: "controlName", publicName: "controlName", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, autoError: { classPropertyName: "autoError", publicName: "autoError", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", isSignal: true, isRequired: false, transformFunction: null }, controlClass: { classPropertyName: "controlClass", publicName: "controlClass", isSignal: true, isRequired: false, transformFunction: null }, errorClass: { classPropertyName: "errorClass", publicName: "errorClass", isSignal: true, isRequired: false, transformFunction: null }, hintClass: { classPropertyName: "hintClass", publicName: "hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "$userClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
135
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormSearchableMultiselect, isStandalone: true, selector: "eg-form-searchable-multiselect", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, controlId: { classPropertyName: "controlId", publicName: "controlId", isSignal: true, isRequired: false, transformFunction: null }, controlName: { classPropertyName: "controlName", publicName: "controlName", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, autoError: { classPropertyName: "autoError", publicName: "autoError", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null }, showSelectedChips: { classPropertyName: "showSelectedChips", publicName: "showSelectedChips", isSignal: true, isRequired: false, transformFunction: null }, showSearch: { classPropertyName: "showSearch", publicName: "showSearch", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", isSignal: true, isRequired: false, transformFunction: null }, controlClass: { classPropertyName: "controlClass", publicName: "controlClass", isSignal: true, isRequired: false, transformFunction: null }, errorClass: { classPropertyName: "errorClass", publicName: "errorClass", isSignal: true, isRequired: false, transformFunction: null }, hintClass: { classPropertyName: "hintClass", publicName: "hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "$userClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
125
136
  @let lbl = label();
126
137
  @let cnm = controlName();
127
138
  @let hnt = hint();
@@ -145,6 +156,8 @@ class EgFormSearchableMultiselect {
145
156
  [searchPlaceholder]="searchPlaceholder()"
146
157
  [emptyMessage]="emptyMessage()"
147
158
  [removeLabel]="removeLabel()"
159
+ [showSelectedChips]="$showSelectedChips()"
160
+ [showSearch]="$showSearch()"
148
161
  [formControlName]="cnm"
149
162
  [required]="rqrd"
150
163
  [wrapperDisabled]="disabled()"
@@ -164,7 +177,7 @@ class EgFormSearchableMultiselect {
164
177
  </hlm-hint>
165
178
  }
166
179
  </eg-form-field>
167
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: EgFormField, selector: "eg-form-field", inputs: ["class"] }, { kind: "directive", type: HlmError, selector: "hlm-error", inputs: ["class"] }, { kind: "directive", type: HlmHint, selector: "hlm-hint", inputs: ["class"] }, { kind: "directive", type: HlmLabel, selector: "[hlmLabel]", inputs: ["class"] }, { kind: "component", type: EgSearchableMultiselect, selector: "eg-searchable-multiselect", inputs: ["options", "placeholder", "searchLabel", "searchPlaceholder", "emptyMessage", "removeLabel", "id", "disabled", "wrapperDisabled", "ariaLabel", "ariaDescribedby", "class", "value"], outputs: ["valueChange"] }] });
180
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: EgFormField, selector: "eg-form-field", inputs: ["class"] }, { kind: "directive", type: HlmError, selector: "hlm-error", inputs: ["class"] }, { kind: "directive", type: HlmHint, selector: "hlm-hint", inputs: ["class"] }, { kind: "directive", type: HlmLabel, selector: "[hlmLabel]", inputs: ["class"] }, { kind: "component", type: EgSearchableMultiselect, selector: "eg-searchable-multiselect", inputs: ["options", "placeholder", "searchLabel", "searchPlaceholder", "emptyMessage", "removeLabel", "showSelectedChips", "showSearch", "id", "disabled", "wrapperDisabled", "ariaLabel", "ariaDescribedby", "class", "value"], outputs: ["valueChange"] }] });
168
181
  }
169
182
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormSearchableMultiselect, decorators: [{
170
183
  type: Component,
@@ -200,6 +213,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
200
213
  [searchPlaceholder]="searchPlaceholder()"
201
214
  [emptyMessage]="emptyMessage()"
202
215
  [removeLabel]="removeLabel()"
216
+ [showSelectedChips]="$showSelectedChips()"
217
+ [showSearch]="$showSearch()"
203
218
  [formControlName]="cnm"
204
219
  [required]="rqrd"
205
220
  [wrapperDisabled]="disabled()"
@@ -221,7 +236,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
221
236
  </eg-form-field>
222
237
  `,
223
238
  }]
224
- }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], controlId: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlId", required: false }] }], controlName: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlName", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], autoError: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoError", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], searchLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchLabel", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], controlClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlClass", required: false }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
239
+ }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], controlId: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlId", required: false }] }], controlName: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlName", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], autoError: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoError", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], searchLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchLabel", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], showSelectedChips: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSelectedChips", required: false }] }], showSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSearch", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], controlClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlClass", required: false }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
225
240
 
226
241
  /*
227
242
  * Public API Surface of form-searchable-multiselect
@@ -50,6 +50,10 @@ declare class EgFormSearchableMultiselect {
50
50
  emptyMessage: _angular_core.InputSignal<string>;
51
51
  /** Pure accessible chip-remove name formatter; receives the resolved label or raw unresolved ID. */
52
52
  removeLabel: _angular_core.InputSignal<(option: SelectOption) => string>;
53
+ /** Whether the selected chips row renders above the trigger; unset defers to the global config, then shown. */
54
+ showSelectedChips: _angular_core.InputSignal<boolean | undefined>;
55
+ /** Whether the picker popover renders its search field; unset defers to the global config, then shown. */
56
+ showSearch: _angular_core.InputSignal<boolean | undefined>;
53
57
  userClass: _angular_core.InputSignal<ClassValue>;
54
58
  labelClass: _angular_core.InputSignal<string>;
55
59
  controlClass: _angular_core.InputSignal<string>;
@@ -60,8 +64,10 @@ declare class EgFormSearchableMultiselect {
60
64
  $controlClass: _angular_core.Signal<string>;
61
65
  $errorClass: _angular_core.Signal<string>;
62
66
  $hintClass: _angular_core.Signal<string>;
67
+ $showSelectedChips: _angular_core.Signal<boolean>;
68
+ $showSearch: _angular_core.Signal<boolean>;
63
69
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgFormSearchableMultiselect, never>;
64
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormSearchableMultiselect, "eg-form-searchable-multiselect", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "controlId": { "alias": "controlId"; "required": false; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "autoError": { "alias": "autoError"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "searchLabel": { "alias": "searchLabel"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "removeLabel": { "alias": "removeLabel"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "controlClass": { "alias": "controlClass"; "required": false; "isSignal": true; }; "errorClass": { "alias": "errorClass"; "required": false; "isSignal": true; }; "hintClass": { "alias": "hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
70
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormSearchableMultiselect, "eg-form-searchable-multiselect", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "controlId": { "alias": "controlId"; "required": false; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "autoError": { "alias": "autoError"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "searchLabel": { "alias": "searchLabel"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "removeLabel": { "alias": "removeLabel"; "required": false; "isSignal": true; }; "showSelectedChips": { "alias": "showSelectedChips"; "required": false; "isSignal": true; }; "showSearch": { "alias": "showSearch"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "controlClass": { "alias": "controlClass"; "required": false; "isSignal": true; }; "errorClass": { "alias": "errorClass"; "required": false; "isSignal": true; }; "hintClass": { "alias": "hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
65
71
  }
66
72
 
67
73
  interface EgFormSearchableMultiselectConfig {
@@ -74,6 +80,16 @@ interface EgFormSearchableMultiselectConfig {
74
80
  controlClass?: string;
75
81
  errorClass?: string;
76
82
  hintClass?: string;
83
+ /**
84
+ * Global default for whether the picker popover renders its search field.
85
+ * An explicit per-instance `showSearch` input wins over this.
86
+ */
87
+ showSearch?: boolean;
88
+ /**
89
+ * Global default for whether the selected chips row renders above the trigger.
90
+ * An explicit per-instance `showSelectedChips` input wins over this.
91
+ */
92
+ showSelectedChips?: boolean;
77
93
  }
78
94
  declare function provideEgFormSearchableMultiselectConfig(config: Partial<EgFormSearchableMultiselectConfig>): ValueProvider;
79
95
  declare function injectEgFormSearchableMultiselectConfig(): EgFormSearchableMultiselectConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egose/shadcn-theme-ng-tw",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "Angular shadcn UI theme",
5
5
  "author": "Junmin Ahn",
6
6
  "bundles": [
@@ -82,17 +82,19 @@ Real selector: `eg-searchable-multiselect` (element). The `✕` chip buttons and
82
82
 
83
83
  ### EgSearchableMultiselect (component, `ControlValueAccessor`)
84
84
 
85
- | Input | Type | Default | Description |
86
- | --------------------- | --------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------- |
87
- | `options` | `SelectOption[]` | `[]` | Full option list (`{ label, value }`) |
88
- | `value` | `string[]` | `[]` | Standalone selected IDs; pairs with `valueChange` for `[(value)]`. Ignored after the first CVA write. |
89
- | `placeholder` | `string` | `'Start typing to add…'` | Text of the pill shown when nothing is selected |
90
- | `id` | `string` | `''` | `id` placed on the trigger button |
91
- | `disabled` | `boolean` | `false` | Disables chips + trigger + search + checkboxes |
92
- | `wrapperDisabled` | `boolean` | `false` | Second disable flag (e.g. set by wrapper form components); OR-ed with `disabled` |
93
- | `ariaLabel` | `string \| undefined` | `undefined` | `aria-label` for the trigger button |
94
- | `ariaDescribedby` | `string \| null` | `null` | `aria-describedby` for the trigger button |
95
- | `class` (`userClass`) | `ClassValue` | `''` | Extra classes on the host |
85
+ | Input | Type | Default | Description |
86
+ | --------------------- | --------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------- |
87
+ | `options` | `SelectOption[]` | `[]` | Full option list (`{ label, value }`) |
88
+ | `value` | `string[]` | `[]` | Standalone selected IDs; pairs with `valueChange` for `[(value)]`. Ignored after the first CVA write. |
89
+ | `placeholder` | `string` | `'Start typing to add…'` | Text of the pill shown when nothing is selected |
90
+ | `showSelectedChips` | `boolean` | `true` | Renders the selected chips row above the trigger; the `N selected` trigger count stays live when hidden |
91
+ | `showSearch` | `boolean` | `true` | Renders the search field inside the popover; disable for a fixed option list with no filtering |
92
+ | `id` | `string` | `''` | `id` placed on the trigger button |
93
+ | `disabled` | `boolean` | `false` | Disables chips + trigger + search + checkboxes |
94
+ | `wrapperDisabled` | `boolean` | `false` | Second disable flag (e.g. set by wrapper form components); OR-ed with `disabled` |
95
+ | `ariaLabel` | `string \| undefined` | `undefined` | `aria-label` for the trigger button |
96
+ | `ariaDescribedby` | `string \| null` | `null` | `aria-describedby` for the trigger button |
97
+ | `class` (`userClass`) | `ClassValue` | `''` | Extra classes on the host |
96
98
 
97
99
  | Output | Type | Description |
98
100
  | ------------- | ---------- | ---------------------------------------------------------------- |
@@ -115,6 +117,13 @@ Pass the complete `options` list. The native search field trims the query and pe
115
117
 
116
118
  Filtering hides checkbox rows only. All selections, including unresolved IDs, remain selected; chip labels still resolve from the complete options list. Search edits never emit `valueChange`/CVA changes or mark touched. The query persists across close/reopen and external value writes/resets; clear its text to restore all choices. The empty message occupies a persistent polite status region while the popover is open.
117
119
 
120
+ ### Hiding the search field and chips
121
+
122
+ - `showSearch: boolean` (default `true`): renders the popover's search field. Set `false` for a fixed option list; the checkbox list and the empty message still render, and `searchLabel`/`searchPlaceholder` become unused.
123
+ - `showSelectedChips: boolean` (default `true`): renders the chips row above the trigger (placeholder pill when empty). Set `false` to keep only the `N selected` trigger as the visible summary; users then add and remove selections through the popover checkboxes.
124
+
125
+ Both toggles are pure template switches: selection state, form value, and change notifications are identical whether a region is hidden or shown.
126
+
118
127
  ### Selection ownership and asynchronous options
119
128
 
120
129
  - **Standalone:** `[value]` initializes selection, and each new input array replaces it (including `[]` to clear). User edits update the displayed selection immediately and emit `valueChange`; `[(value)]` keeps the parent synchronized. With one-way binding, local edits persist until a new input array arrives.
@@ -9,6 +9,8 @@ import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
9
9
  /**
10
10
  * Chip multiselect with local, case-insensitive label search over the complete options input.
11
11
  * Filtering never changes selected IDs or chip labels. Search edits do not emit or touch the form.
12
+ * The search field and the selected chips row are independently hideable via `showSearch` and
13
+ * `showSelectedChips`; hiding either keeps the trigger count and the form value authoritative.
12
14
  * Import from `@egose/shadcn-theme-ng-tw/searchable-multiselect` (or the `-tw` variant).
13
15
  */
14
16
  class EgSearchableMultiselect {
@@ -29,6 +31,12 @@ class EgSearchableMultiselect {
29
31
  /** Accessible remove name from the current chip label (raw ID when unresolved). Supply a pure formatter. */
30
32
  removeLabel = input((option) => `Remove ${option.label}`, /* @ts-ignore */
31
33
  ...(ngDevMode ? [{ debugName: "removeLabel" }] : /* istanbul ignore next */ []));
34
+ /** Whether the selected chips row renders above the trigger; the trigger count stays live when hidden. */
35
+ showSelectedChips = input(true, /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "showSelectedChips" }] : /* istanbul ignore next */ []));
37
+ /** Whether the picker popover renders its search field; disable for a fixed option list with no filtering. */
38
+ showSearch = input(true, /* @ts-ignore */
39
+ ...(ngDevMode ? [{ debugName: "showSearch" }] : /* istanbul ignore next */ []));
32
40
  id = input('', /* @ts-ignore */
33
41
  ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
34
42
  disabled = input(false, /* @ts-ignore */
@@ -122,7 +130,7 @@ class EgSearchableMultiselect {
122
130
  this.formDisabled.set(isDisabled);
123
131
  }
124
132
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgSearchableMultiselect, deps: [], target: i0.ɵɵFactoryTarget.Component });
125
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgSearchableMultiselect, isStandalone: true, selector: "eg-searchable-multiselect", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, wrapperDisabled: { classPropertyName: "wrapperDisabled", publicName: "wrapperDisabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "ariaDescribedby", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { properties: { "class": "_hostClass()" } }, providers: [
133
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgSearchableMultiselect, isStandalone: true, selector: "eg-searchable-multiselect", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null }, showSelectedChips: { classPropertyName: "showSelectedChips", publicName: "showSelectedChips", isSignal: true, isRequired: false, transformFunction: null }, showSearch: { classPropertyName: "showSearch", publicName: "showSearch", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, wrapperDisabled: { classPropertyName: "wrapperDisabled", publicName: "wrapperDisabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "ariaDescribedby", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { properties: { "class": "_hostClass()" } }, providers: [
126
134
  {
127
135
  provide: NG_VALUE_ACCESSOR,
128
136
  useExisting: forwardRef(() => EgSearchableMultiselect),
@@ -131,35 +139,37 @@ class EgSearchableMultiselect {
131
139
  ], ngImport: i0, template: `
132
140
  <div class="tw:flex tw:flex-col tw:gap-2 tw:w-full">
133
141
  <!-- Selected chips -->
134
- <div class="tw:flex tw:flex-wrap tw:gap-2">
135
- @if (selectedItems().length === 0) {
136
- <span
137
- class="tw:bg-gray-100 tw:text-gray-400 tw:rounded-full
138
- tw:px-2 tw:py-1 tw:inline-flex tw:items-center tw:text-xs"
139
- >
140
- {{ placeholder() }}
141
- </span>
142
- } @else {
143
- @for (item of selectedItems(); track item.value) {
142
+ @if (showSelectedChips()) {
143
+ <div class="tw:flex tw:flex-wrap tw:gap-2">
144
+ @if (selectedItems().length === 0) {
144
145
  <span
145
- class="tw:bg-gray-200 tw:rounded-full tw:px-2 tw:py-1
146
- tw:inline-flex tw:items-center tw:gap-2 tw:text-xs"
146
+ class="tw:bg-gray-100 tw:text-gray-400 tw:rounded-full
147
+ tw:px-2 tw:py-1 tw:inline-flex tw:items-center tw:text-xs"
147
148
  >
148
- {{ item.label }}
149
- <button
150
- type="button"
151
- [disabled]="disabledState()"
152
- [attr.aria-label]="removeLabel()(item)"
153
- (click)="removeItem(item.value)"
154
- class="tw:bg-transparent tw:border-0 tw:text-gray-600
155
- tw:hover:text-red-500 tw:cursor-pointer"
156
- >
157
- ✕
158
- </button>
149
+ {{ placeholder() }}
159
150
  </span>
151
+ } @else {
152
+ @for (item of selectedItems(); track item.value) {
153
+ <span
154
+ class="tw:bg-gray-200 tw:rounded-full tw:px-2 tw:py-1
155
+ tw:inline-flex tw:items-center tw:gap-2 tw:text-xs"
156
+ >
157
+ {{ item.label }}
158
+ <button
159
+ type="button"
160
+ [disabled]="disabledState()"
161
+ [attr.aria-label]="removeLabel()(item)"
162
+ (click)="removeItem(item.value)"
163
+ class="tw:bg-transparent tw:border-0 tw:text-gray-600
164
+ tw:hover:text-red-500 tw:cursor-pointer"
165
+ >
166
+ ✕
167
+ </button>
168
+ </span>
169
+ }
160
170
  }
161
- }
162
- </div>
171
+ </div>
172
+ }
163
173
 
164
174
  <!-- Trigger -->
165
175
  <hlm-popover>
@@ -178,19 +188,21 @@ class EgSearchableMultiselect {
178
188
  </button>
179
189
 
180
190
  <hlm-popover-content class="tw:w-64 tw:p-2" *hlmPopoverPortal="let ctx">
181
- <label class="tw:flex tw:flex-col tw:gap-1 tw:text-sm">
182
- <span>{{ searchLabel() }}</span>
183
- <input
184
- #search
185
- type="search"
186
- [value]="searchQuery()"
187
- [placeholder]="searchPlaceholder()"
188
- [disabled]="disabledState()"
189
- (input)="updateSearch(search.value)"
190
- (keydown.enter)="$event.preventDefault()"
191
- class="tw:w-full tw:rounded-md tw:border tw:border-input tw:bg-transparent tw:px-2 tw:py-1 tw:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:disabled:opacity-50"
192
- />
193
- </label>
191
+ @if (showSearch()) {
192
+ <label class="tw:flex tw:flex-col tw:gap-1 tw:text-sm">
193
+ <span>{{ searchLabel() }}</span>
194
+ <input
195
+ #search
196
+ type="search"
197
+ [value]="searchQuery()"
198
+ [placeholder]="searchPlaceholder()"
199
+ [disabled]="disabledState()"
200
+ (input)="updateSearch(search.value)"
201
+ (keydown.enter)="$event.preventDefault()"
202
+ class="tw:w-full tw:rounded-md tw:border tw:border-input tw:bg-transparent tw:px-2 tw:py-1 tw:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:disabled:opacity-50"
203
+ />
204
+ </label>
205
+ }
194
206
  <div class="tw:max-h-60 tw:overflow-auto tw:flex tw:flex-col tw:gap-1">
195
207
  @for (option of filteredOptions(); track option.value) {
196
208
  <label
@@ -235,35 +247,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
235
247
  template: `
236
248
  <div class="tw:flex tw:flex-col tw:gap-2 tw:w-full">
237
249
  <!-- Selected chips -->
238
- <div class="tw:flex tw:flex-wrap tw:gap-2">
239
- @if (selectedItems().length === 0) {
240
- <span
241
- class="tw:bg-gray-100 tw:text-gray-400 tw:rounded-full
242
- tw:px-2 tw:py-1 tw:inline-flex tw:items-center tw:text-xs"
243
- >
244
- {{ placeholder() }}
245
- </span>
246
- } @else {
247
- @for (item of selectedItems(); track item.value) {
250
+ @if (showSelectedChips()) {
251
+ <div class="tw:flex tw:flex-wrap tw:gap-2">
252
+ @if (selectedItems().length === 0) {
248
253
  <span
249
- class="tw:bg-gray-200 tw:rounded-full tw:px-2 tw:py-1
250
- tw:inline-flex tw:items-center tw:gap-2 tw:text-xs"
254
+ class="tw:bg-gray-100 tw:text-gray-400 tw:rounded-full
255
+ tw:px-2 tw:py-1 tw:inline-flex tw:items-center tw:text-xs"
251
256
  >
252
- {{ item.label }}
253
- <button
254
- type="button"
255
- [disabled]="disabledState()"
256
- [attr.aria-label]="removeLabel()(item)"
257
- (click)="removeItem(item.value)"
258
- class="tw:bg-transparent tw:border-0 tw:text-gray-600
259
- tw:hover:text-red-500 tw:cursor-pointer"
260
- >
261
- ✕
262
- </button>
257
+ {{ placeholder() }}
263
258
  </span>
259
+ } @else {
260
+ @for (item of selectedItems(); track item.value) {
261
+ <span
262
+ class="tw:bg-gray-200 tw:rounded-full tw:px-2 tw:py-1
263
+ tw:inline-flex tw:items-center tw:gap-2 tw:text-xs"
264
+ >
265
+ {{ item.label }}
266
+ <button
267
+ type="button"
268
+ [disabled]="disabledState()"
269
+ [attr.aria-label]="removeLabel()(item)"
270
+ (click)="removeItem(item.value)"
271
+ class="tw:bg-transparent tw:border-0 tw:text-gray-600
272
+ tw:hover:text-red-500 tw:cursor-pointer"
273
+ >
274
+ ✕
275
+ </button>
276
+ </span>
277
+ }
264
278
  }
265
- }
266
- </div>
279
+ </div>
280
+ }
267
281
 
268
282
  <!-- Trigger -->
269
283
  <hlm-popover>
@@ -282,19 +296,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
282
296
  </button>
283
297
 
284
298
  <hlm-popover-content class="tw:w-64 tw:p-2" *hlmPopoverPortal="let ctx">
285
- <label class="tw:flex tw:flex-col tw:gap-1 tw:text-sm">
286
- <span>{{ searchLabel() }}</span>
287
- <input
288
- #search
289
- type="search"
290
- [value]="searchQuery()"
291
- [placeholder]="searchPlaceholder()"
292
- [disabled]="disabledState()"
293
- (input)="updateSearch(search.value)"
294
- (keydown.enter)="$event.preventDefault()"
295
- class="tw:w-full tw:rounded-md tw:border tw:border-input tw:bg-transparent tw:px-2 tw:py-1 tw:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:disabled:opacity-50"
296
- />
297
- </label>
299
+ @if (showSearch()) {
300
+ <label class="tw:flex tw:flex-col tw:gap-1 tw:text-sm">
301
+ <span>{{ searchLabel() }}</span>
302
+ <input
303
+ #search
304
+ type="search"
305
+ [value]="searchQuery()"
306
+ [placeholder]="searchPlaceholder()"
307
+ [disabled]="disabledState()"
308
+ (input)="updateSearch(search.value)"
309
+ (keydown.enter)="$event.preventDefault()"
310
+ class="tw:w-full tw:rounded-md tw:border tw:border-input tw:bg-transparent tw:px-2 tw:py-1 tw:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:disabled:opacity-50"
311
+ />
312
+ </label>
313
+ }
298
314
  <div class="tw:max-h-60 tw:overflow-auto tw:flex tw:flex-col tw:gap-1">
299
315
  @for (option of filteredOptions(); track option.value) {
300
316
  <label
@@ -319,7 +335,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
319
335
  </div>
320
336
  `,
321
337
  }]
322
- }], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], searchLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchLabel", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], wrapperDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrapperDisabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedby", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
338
+ }], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], searchLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchLabel", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], showSelectedChips: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSelectedChips", required: false }] }], showSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSearch", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], wrapperDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrapperDisabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedby", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
323
339
 
324
340
  /*
325
341
  * Public API Surface of searchable-multiselect
@@ -9,6 +9,8 @@ interface SelectOption {
9
9
  /**
10
10
  * Chip multiselect with local, case-insensitive label search over the complete options input.
11
11
  * Filtering never changes selected IDs or chip labels. Search edits do not emit or touch the form.
12
+ * The search field and the selected chips row are independently hideable via `showSearch` and
13
+ * `showSelectedChips`; hiding either keeps the trigger count and the form value authoritative.
12
14
  * Import from `@egose/shadcn-theme-ng-tw/searchable-multiselect` (or the `-tw` variant).
13
15
  */
14
16
  declare class EgSearchableMultiselect implements ControlValueAccessor {
@@ -23,6 +25,10 @@ declare class EgSearchableMultiselect implements ControlValueAccessor {
23
25
  emptyMessage: _angular_core.InputSignal<string>;
24
26
  /** Accessible remove name from the current chip label (raw ID when unresolved). Supply a pure formatter. */
25
27
  removeLabel: _angular_core.InputSignal<(option: SelectOption) => string>;
28
+ /** Whether the selected chips row renders above the trigger; the trigger count stays live when hidden. */
29
+ showSelectedChips: _angular_core.InputSignal<boolean>;
30
+ /** Whether the picker popover renders its search field; disable for a fixed option list with no filtering. */
31
+ showSearch: _angular_core.InputSignal<boolean>;
26
32
  id: _angular_core.InputSignal<string>;
27
33
  disabled: _angular_core.InputSignal<boolean>;
28
34
  wrapperDisabled: _angular_core.InputSignal<boolean>;
@@ -55,7 +61,7 @@ declare class EgSearchableMultiselect implements ControlValueAccessor {
55
61
  registerOnTouched(fn: () => void): void;
56
62
  setDisabledState(isDisabled: boolean): void;
57
63
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgSearchableMultiselect, never>;
58
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgSearchableMultiselect, "eg-searchable-multiselect", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "searchLabel": { "alias": "searchLabel"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "removeLabel": { "alias": "removeLabel"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "wrapperDisabled": { "alias": "wrapperDisabled"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
64
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgSearchableMultiselect, "eg-searchable-multiselect", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "searchLabel": { "alias": "searchLabel"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "removeLabel": { "alias": "removeLabel"; "required": false; "isSignal": true; }; "showSelectedChips": { "alias": "showSelectedChips"; "required": false; "isSignal": true; }; "showSearch": { "alias": "showSearch"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "wrapperDisabled": { "alias": "wrapperDisabled"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
59
65
  }
60
66
 
61
67
  export { EgSearchableMultiselect };