@su-labs/select 19.0.0 → 20.0.0

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 CHANGED
@@ -17,10 +17,10 @@ A select for Angular with its own styled list instead of the browser's popup:
17
17
  ## Installation
18
18
 
19
19
  ```bash
20
- npm install @su-labs/select@ng19
20
+ npm install @su-labs/select@ng20
21
21
  ```
22
22
 
23
- This is the Angular 19 version. For the newest Angular, install `@su-labs/select` without a tag.
23
+ This is the Angular 20 version. For the newest Angular, install `@su-labs/select` without a tag.
24
24
 
25
25
  ## Usage
26
26
 
@@ -22,27 +22,27 @@ const MOVES = {
22
22
  */
23
23
  class SuSelectComponent {
24
24
  /** The choices: `{ value, label, disabled?, group? }`; options sharing a `group` should follow one another */
25
- options = input([]);
25
+ options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
26
26
  /** The chosen value, or `null` while nothing is chosen */
27
- value = model(null);
27
+ value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
28
28
  /** Whether the list is open; setting it opens or closes it */
29
- open = model(false);
29
+ open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
30
30
  /** Set once focus has left the select, for forms that show errors after the user moved on */
31
- touched = model(false);
31
+ touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : []));
32
32
  /** A search field at the top of the list that filters the options @default false */
33
- searchable = input(false, { transform: booleanAttribute });
33
+ searchable = input(false, ...(ngDevMode ? [{ debugName: "searchable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
34
34
  /** Can't be opened or focused @default false */
35
- disabled = input(false, { transform: booleanAttribute });
35
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
36
36
  /** Opens with a short fade and slide; off when the user prefers less motion @default true */
37
- animated = input(true, { transform: booleanAttribute });
37
+ animated = input(true, ...(ngDevMode ? [{ debugName: "animated", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
38
38
  /** Shown while nothing is chosen @default labels.placeholder */
39
- placeholder = input();
39
+ placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : []));
40
40
  /** The select's name for screen readers, when no `<label>` wraps it and no `ariaLabelledby` names it */
41
- ariaLabel = input();
41
+ ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : []));
42
42
  /** The id of the element that names the select */
43
- ariaLabelledby = input();
43
+ ariaLabelledby = input(...(ngDevMode ? [undefined, { debugName: "ariaLabelledby" }] : []));
44
44
  /** Texts to replace, e.g. in the page's language */
45
- labels = input({});
45
+ labels = input({}, ...(ngDevMode ? [{ debugName: "labels" }] : []));
46
46
  /** The user chose an option (never emitted for a value set from outside): its value */
47
47
  chosen = output();
48
48
  id = `su-select-${nextSelectId++}`;
@@ -50,23 +50,23 @@ class SuSelectComponent {
50
50
  texts = computed(() => ({
51
51
  ...SU_SELECT_LABELS,
52
52
  ...this.labels(),
53
- }));
53
+ }), ...(ngDevMode ? [{ debugName: "texts" }] : []));
54
54
  controller = new SuSelectController();
55
- state = signal(this.controller.state.get());
56
- groups = computed(() => suSelectGroups(this.state().visible));
55
+ state = signal(this.controller.state.get(), ...(ngDevMode ? [{ debugName: "state" }] : []));
56
+ groups = computed(() => suSelectGroups(this.state().visible), ...(ngDevMode ? [{ debugName: "groups" }] : []));
57
57
  selected = computed(() => {
58
58
  this.state();
59
59
  return this.controller.selected;
60
- });
60
+ }, ...(ngDevMode ? [{ debugName: "selected" }] : []));
61
61
  activeId = computed(() => {
62
62
  const { open, active } = this.state();
63
63
  return open && active >= 0 ? this.optionId(active) : null;
64
- });
64
+ }, ...(ngDevMode ? [{ debugName: "activeId" }] : []));
65
65
  host = inject(ElementRef);
66
66
  document = inject(DOCUMENT);
67
67
  trigger = viewChild.required('trigger');
68
68
  panel = viewChild.required('panel');
69
- search = viewChild('search');
69
+ search = viewChild('search', ...(ngDevMode ? [{ debugName: "search" }] : []));
70
70
  constructor() {
71
71
  let previous = this.controller.state.get();
72
72
  const unsubscribe = this.controller.state.subscribe(state => {
@@ -282,10 +282,10 @@ class SuSelectComponent {
282
282
  panel.style.left = `${position.x}px`;
283
283
  panel.style.top = `${position.y}px`;
284
284
  }
285
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
286
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: SuSelectComponent, isStandalone: true, selector: "su-lib-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, animated: { classPropertyName: "animated", publicName: "animated", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", open: "openChange", touched: "touchedChange", chosen: "chosen" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "class.su-select-open": "open()", "class.su-select-disabled": "disabled()" }, classAttribute: "su-select" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "search", first: true, predicate: ["search"], descendants: true, isSignal: true }], ngImport: i0, template: "<button\n #trigger\n type=\"button\"\n class=\"su-select-trigger\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [id]=\"id\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"state().open\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"searchable() ? null : activeId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\">\n <span class=\"su-select-value\" [class.su-select-placeholder]=\"!selected()\">{{ selected()?.label ?? placeholder() ?? texts().placeholder }}</span>\n <svg class=\"su-select-chevron\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"m6 9 6 6 6-6\" /></svg>\n</button>\n<div #panel popover=\"manual\" class=\"su-select-panel\" [class.su-select-animated]=\"animated()\">\n @if (searchable()) {\n <input\n #search\n type=\"text\"\n class=\"su-select-search\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeId()\"\n [attr.aria-label]=\"texts().search\"\n [placeholder]=\"texts().search\"\n (input)=\"onSearch($event)\"\n (keydown)=\"onKeydown($event)\" />\n }\n <ul class=\"su-select-list\" role=\"listbox\" tabindex=\"-1\" [id]=\"listId\" [attr.aria-label]=\"ariaLabel() ?? null\" [attr.aria-labelledby]=\"ariaLabel() ? null : (ariaLabelledby() ?? id)\" (mousedown)=\"$event.preventDefault()\">\n @for (group of groups(); track $index) {\n <li role=\"presentation\">\n <ul class=\"su-select-group\" [attr.role]=\"group.label ? 'group' : 'presentation'\" [attr.aria-labelledby]=\"group.label ? id + '-group-' + $index : null\">\n @if (group.label) {\n <li role=\"presentation\" class=\"su-select-group-label\" [id]=\"id + '-group-' + $index\">{{ group.label }}</li>\n }\n @for (item of group.options; track item.index) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- the combobox handles the keyboard through aria-activedescendant -->\n <li\n role=\"option\"\n class=\"su-select-option\"\n [id]=\"optionId(item.index)\"\n [class.su-select-active]=\"item.index === state().active\"\n [attr.aria-selected]=\"isSelected(item.option)\"\n [attr.aria-disabled]=\"item.option.disabled ? true : null\"\n (click)=\"choose(item.index)\"\n (pointermove)=\"activate(item.index)\">\n <span class=\"su-select-option-label\">{{ item.option.label }}</span>\n <svg class=\"su-select-check\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M5 12.5l4.5 4.5L19 7.5\" /></svg>\n </li>\n }\n </ul>\n </li>\n } @empty {\n <li role=\"presentation\" class=\"su-select-empty\">{{ texts().empty }}</li>\n }\n </ul>\n</div>\n", styles: [":host{display:inline-block;max-width:100%;vertical-align:middle}.su-select-trigger{align-items:center;background:var(--su-select-background, #fff);border:var(--su-select-border, 1px solid #d1d5db);border-radius:var(--su-select-radius, .375rem);box-sizing:border-box;color:var(--su-select-color, #111827);cursor:pointer;display:inline-flex;font:inherit;font-size:var(--su-select-font-size, .875rem);gap:.5rem;justify-content:space-between;line-height:1.4;max-width:100%;min-height:var(--su-select-height, 2.25rem);min-width:var(--su-select-min-width, 8rem);padding:var(--su-select-padding, .375rem .625rem);text-align:start;transition:border-color .15s,box-shadow .15s;width:100%}.su-select-trigger:hover:not(:disabled){border-color:var(--su-select-hover-border-color, #9ca3af)}.su-select-trigger:focus-visible{box-shadow:var(--su-select-focus-ring, 0 0 0 3px rgba(37, 99, 235, .35));outline:none}.su-select-trigger:disabled{cursor:not-allowed;opacity:var(--su-select-disabled-opacity, .5)}.su-select-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.su-select-placeholder{color:var(--su-select-muted-color, #6b7280)}.su-select-chevron,.su-select-check{fill:none;flex:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.su-select-chevron{block-size:1rem;color:var(--su-select-muted-color, #6b7280);inline-size:1rem;transition:transform .2s}:host(.su-select-open) .su-select-chevron{transform:rotate(180deg)}.su-select-panel{background:var(--su-select-list-background, var(--su-select-background, #fff));border:var(--su-select-list-border, var(--su-select-border, 1px solid #d1d5db));border-radius:var(--su-select-list-radius, .5rem);box-shadow:var(--su-select-list-shadow, 0 10px 30px rgba(0, 0, 0, .12));box-sizing:border-box;color:var(--su-select-color, #111827);display:none;flex-direction:column;font-family:inherit;font-size:var(--su-select-font-size, .875rem);inset:auto;margin:0;max-height:min(var(--su-select-list-max-height, 18rem),100vh - 16px);max-width:calc(100vw - 16px);overflow:hidden;padding:var(--su-select-list-padding, .25rem);position:fixed;z-index:var(--su-select-z-index, 1000)}.su-select-panel.su-select-shown{display:flex}.su-select-panel.su-select-animated.su-select-shown{animation:su-select-in var(--su-select-duration, .16s) cubic-bezier(.16,1,.3,1);transform-origin:top}.su-select-panel.su-select-animated.su-select-shown[data-side=top]{animation-name:su-select-in-above;transform-origin:bottom}.su-select-search{background:transparent;border:0;border-bottom:var(--su-select-search-border, 1px solid #e5e7eb);box-sizing:border-box;color:inherit;flex:none;font:inherit;margin-bottom:.25rem;outline:none;padding:.4rem .5rem;width:100%}.su-select-search::placeholder{color:var(--su-select-muted-color, #6b7280)}.su-select-list,.su-select-group{list-style:none;margin:0;padding:0}.su-select-list{outline:none;overflow-y:auto;overscroll-behavior:contain}.su-select-group-label{color:var(--su-select-muted-color, #6b7280);font-size:.75em;letter-spacing:.04em;padding:.5rem .5rem .2rem;text-transform:uppercase}.su-select-option{align-items:center;border-radius:var(--su-select-option-radius, .3125rem);cursor:pointer;display:flex;gap:1rem;justify-content:space-between;padding:var(--su-select-option-padding, .4rem .5rem);white-space:nowrap}.su-select-option.su-select-active{background:var(--su-select-option-active-background, #f3f4f6)}.su-select-option[aria-selected=true]{color:var(--su-select-option-selected-color, inherit);font-weight:var(--su-select-option-selected-weight, 600)}.su-select-option[aria-disabled=true]{cursor:not-allowed;opacity:var(--su-select-disabled-opacity, .5)}.su-select-check{block-size:1rem;inline-size:1rem;visibility:hidden}[aria-selected=true]>.su-select-check{visibility:visible}.su-select-empty{color:var(--su-select-muted-color, #6b7280);padding:var(--su-select-option-padding, .4rem .5rem)}@keyframes su-select-in{0%{opacity:0;transform:translateY(-4px) scaleY(.96)}}@keyframes su-select-in-above{0%{opacity:0;transform:translateY(4px) scaleY(.96)}}@media(prefers-reduced-motion:reduce){.su-select-panel.su-select-shown,.su-select-panel.su-select-shown[data-side=top]{animation:none}.su-select-chevron{transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
285
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
286
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.35", type: SuSelectComponent, isStandalone: true, selector: "su-lib-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, animated: { classPropertyName: "animated", publicName: "animated", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", open: "openChange", touched: "touchedChange", chosen: "chosen" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "class.su-select-open": "open()", "class.su-select-disabled": "disabled()" }, classAttribute: "su-select" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "search", first: true, predicate: ["search"], descendants: true, isSignal: true }], ngImport: i0, template: "<button\n #trigger\n type=\"button\"\n class=\"su-select-trigger\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [id]=\"id\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"state().open\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"searchable() ? null : activeId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\">\n <span class=\"su-select-value\" [class.su-select-placeholder]=\"!selected()\">{{ selected()?.label ?? placeholder() ?? texts().placeholder }}</span>\n <svg class=\"su-select-chevron\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"m6 9 6 6 6-6\" /></svg>\n</button>\n<div #panel popover=\"manual\" class=\"su-select-panel\" [class.su-select-animated]=\"animated()\">\n @if (searchable()) {\n <input\n #search\n type=\"text\"\n class=\"su-select-search\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeId()\"\n [attr.aria-label]=\"texts().search\"\n [placeholder]=\"texts().search\"\n (input)=\"onSearch($event)\"\n (keydown)=\"onKeydown($event)\" />\n }\n <ul class=\"su-select-list\" role=\"listbox\" tabindex=\"-1\" [id]=\"listId\" [attr.aria-label]=\"ariaLabel() ?? null\" [attr.aria-labelledby]=\"ariaLabel() ? null : (ariaLabelledby() ?? id)\" (mousedown)=\"$event.preventDefault()\">\n @for (group of groups(); track $index) {\n <li role=\"presentation\">\n <ul class=\"su-select-group\" [attr.role]=\"group.label ? 'group' : 'presentation'\" [attr.aria-labelledby]=\"group.label ? id + '-group-' + $index : null\">\n @if (group.label) {\n <li role=\"presentation\" class=\"su-select-group-label\" [id]=\"id + '-group-' + $index\">{{ group.label }}</li>\n }\n @for (item of group.options; track item.index) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- the combobox handles the keyboard through aria-activedescendant -->\n <li\n role=\"option\"\n class=\"su-select-option\"\n [id]=\"optionId(item.index)\"\n [class.su-select-active]=\"item.index === state().active\"\n [attr.aria-selected]=\"isSelected(item.option)\"\n [attr.aria-disabled]=\"item.option.disabled ? true : null\"\n (click)=\"choose(item.index)\"\n (pointermove)=\"activate(item.index)\">\n <span class=\"su-select-option-label\">{{ item.option.label }}</span>\n <svg class=\"su-select-check\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M5 12.5l4.5 4.5L19 7.5\" /></svg>\n </li>\n }\n </ul>\n </li>\n } @empty {\n <li role=\"presentation\" class=\"su-select-empty\">{{ texts().empty }}</li>\n }\n </ul>\n</div>\n", styles: [":host{display:inline-block;max-width:100%;vertical-align:middle}.su-select-trigger{align-items:center;background:var(--su-select-background, #fff);border:var(--su-select-border, 1px solid #d1d5db);border-radius:var(--su-select-radius, .375rem);box-sizing:border-box;color:var(--su-select-color, #111827);cursor:pointer;display:inline-flex;font:inherit;font-size:var(--su-select-font-size, .875rem);gap:.5rem;justify-content:space-between;line-height:1.4;max-width:100%;min-height:var(--su-select-height, 2.25rem);min-width:var(--su-select-min-width, 8rem);padding:var(--su-select-padding, .375rem .625rem);text-align:start;transition:border-color .15s,box-shadow .15s;width:100%}.su-select-trigger:hover:not(:disabled){border-color:var(--su-select-hover-border-color, #9ca3af)}.su-select-trigger:focus-visible{box-shadow:var(--su-select-focus-ring, 0 0 0 3px rgba(37, 99, 235, .35));outline:none}.su-select-trigger:disabled{cursor:not-allowed;opacity:var(--su-select-disabled-opacity, .5)}.su-select-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.su-select-placeholder{color:var(--su-select-muted-color, #6b7280)}.su-select-chevron,.su-select-check{fill:none;flex:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.su-select-chevron{block-size:1rem;color:var(--su-select-muted-color, #6b7280);inline-size:1rem;transition:transform .2s}:host(.su-select-open) .su-select-chevron{transform:rotate(180deg)}.su-select-panel{background:var(--su-select-list-background, var(--su-select-background, #fff));border:var(--su-select-list-border, var(--su-select-border, 1px solid #d1d5db));border-radius:var(--su-select-list-radius, .5rem);box-shadow:var(--su-select-list-shadow, 0 10px 30px rgba(0, 0, 0, .12));box-sizing:border-box;color:var(--su-select-color, #111827);display:none;flex-direction:column;font-family:inherit;font-size:var(--su-select-font-size, .875rem);inset:auto;margin:0;max-height:min(var(--su-select-list-max-height, 18rem),100vh - 16px);max-width:calc(100vw - 16px);overflow:hidden;padding:var(--su-select-list-padding, .25rem);position:fixed;z-index:var(--su-select-z-index, 1000)}.su-select-panel.su-select-shown{display:flex}.su-select-panel.su-select-animated.su-select-shown{animation:su-select-in var(--su-select-duration, .16s) cubic-bezier(.16,1,.3,1);transform-origin:top}.su-select-panel.su-select-animated.su-select-shown[data-side=top]{animation-name:su-select-in-above;transform-origin:bottom}.su-select-search{background:transparent;border:0;border-bottom:var(--su-select-search-border, 1px solid #e5e7eb);box-sizing:border-box;color:inherit;flex:none;font:inherit;margin-bottom:.25rem;outline:none;padding:.4rem .5rem;width:100%}.su-select-search::placeholder{color:var(--su-select-muted-color, #6b7280)}.su-select-list,.su-select-group{list-style:none;margin:0;padding:0}.su-select-list{outline:none;overflow-y:auto;overscroll-behavior:contain}.su-select-group-label{color:var(--su-select-muted-color, #6b7280);font-size:.75em;letter-spacing:.04em;padding:.5rem .5rem .2rem;text-transform:uppercase}.su-select-option{align-items:center;border-radius:var(--su-select-option-radius, .3125rem);cursor:pointer;display:flex;gap:1rem;justify-content:space-between;padding:var(--su-select-option-padding, .4rem .5rem);white-space:nowrap}.su-select-option.su-select-active{background:var(--su-select-option-active-background, #f3f4f6)}.su-select-option[aria-selected=true]{color:var(--su-select-option-selected-color, inherit);font-weight:var(--su-select-option-selected-weight, 600)}.su-select-option[aria-disabled=true]{cursor:not-allowed;opacity:var(--su-select-disabled-opacity, .5)}.su-select-check{block-size:1rem;inline-size:1rem;visibility:hidden}[aria-selected=true]>.su-select-check{visibility:visible}.su-select-empty{color:var(--su-select-muted-color, #6b7280);padding:var(--su-select-option-padding, .4rem .5rem)}@keyframes su-select-in{0%{opacity:0;transform:translateY(-4px) scaleY(.96)}}@keyframes su-select-in-above{0%{opacity:0;transform:translateY(4px) scaleY(.96)}}@media(prefers-reduced-motion:reduce){.su-select-panel.su-select-shown,.su-select-panel.su-select-shown[data-side=top]{animation:none}.su-select-chevron{transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
287
287
  }
288
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuSelectComponent, decorators: [{
288
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuSelectComponent, decorators: [{
289
289
  type: Component,
290
290
  args: [{ selector: 'su-lib-select', changeDetection: ChangeDetectionStrategy.OnPush, host: {
291
291
  class: 'su-select',
@@ -293,7 +293,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
293
293
  '[class.su-select-disabled]': 'disabled()',
294
294
  '(focusout)': 'onFocusOut($event)',
295
295
  }, template: "<button\n #trigger\n type=\"button\"\n class=\"su-select-trigger\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [id]=\"id\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"state().open\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"searchable() ? null : activeId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\">\n <span class=\"su-select-value\" [class.su-select-placeholder]=\"!selected()\">{{ selected()?.label ?? placeholder() ?? texts().placeholder }}</span>\n <svg class=\"su-select-chevron\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"m6 9 6 6 6-6\" /></svg>\n</button>\n<div #panel popover=\"manual\" class=\"su-select-panel\" [class.su-select-animated]=\"animated()\">\n @if (searchable()) {\n <input\n #search\n type=\"text\"\n class=\"su-select-search\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeId()\"\n [attr.aria-label]=\"texts().search\"\n [placeholder]=\"texts().search\"\n (input)=\"onSearch($event)\"\n (keydown)=\"onKeydown($event)\" />\n }\n <ul class=\"su-select-list\" role=\"listbox\" tabindex=\"-1\" [id]=\"listId\" [attr.aria-label]=\"ariaLabel() ?? null\" [attr.aria-labelledby]=\"ariaLabel() ? null : (ariaLabelledby() ?? id)\" (mousedown)=\"$event.preventDefault()\">\n @for (group of groups(); track $index) {\n <li role=\"presentation\">\n <ul class=\"su-select-group\" [attr.role]=\"group.label ? 'group' : 'presentation'\" [attr.aria-labelledby]=\"group.label ? id + '-group-' + $index : null\">\n @if (group.label) {\n <li role=\"presentation\" class=\"su-select-group-label\" [id]=\"id + '-group-' + $index\">{{ group.label }}</li>\n }\n @for (item of group.options; track item.index) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- the combobox handles the keyboard through aria-activedescendant -->\n <li\n role=\"option\"\n class=\"su-select-option\"\n [id]=\"optionId(item.index)\"\n [class.su-select-active]=\"item.index === state().active\"\n [attr.aria-selected]=\"isSelected(item.option)\"\n [attr.aria-disabled]=\"item.option.disabled ? true : null\"\n (click)=\"choose(item.index)\"\n (pointermove)=\"activate(item.index)\">\n <span class=\"su-select-option-label\">{{ item.option.label }}</span>\n <svg class=\"su-select-check\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M5 12.5l4.5 4.5L19 7.5\" /></svg>\n </li>\n }\n </ul>\n </li>\n } @empty {\n <li role=\"presentation\" class=\"su-select-empty\">{{ texts().empty }}</li>\n }\n </ul>\n</div>\n", styles: [":host{display:inline-block;max-width:100%;vertical-align:middle}.su-select-trigger{align-items:center;background:var(--su-select-background, #fff);border:var(--su-select-border, 1px solid #d1d5db);border-radius:var(--su-select-radius, .375rem);box-sizing:border-box;color:var(--su-select-color, #111827);cursor:pointer;display:inline-flex;font:inherit;font-size:var(--su-select-font-size, .875rem);gap:.5rem;justify-content:space-between;line-height:1.4;max-width:100%;min-height:var(--su-select-height, 2.25rem);min-width:var(--su-select-min-width, 8rem);padding:var(--su-select-padding, .375rem .625rem);text-align:start;transition:border-color .15s,box-shadow .15s;width:100%}.su-select-trigger:hover:not(:disabled){border-color:var(--su-select-hover-border-color, #9ca3af)}.su-select-trigger:focus-visible{box-shadow:var(--su-select-focus-ring, 0 0 0 3px rgba(37, 99, 235, .35));outline:none}.su-select-trigger:disabled{cursor:not-allowed;opacity:var(--su-select-disabled-opacity, .5)}.su-select-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.su-select-placeholder{color:var(--su-select-muted-color, #6b7280)}.su-select-chevron,.su-select-check{fill:none;flex:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.su-select-chevron{block-size:1rem;color:var(--su-select-muted-color, #6b7280);inline-size:1rem;transition:transform .2s}:host(.su-select-open) .su-select-chevron{transform:rotate(180deg)}.su-select-panel{background:var(--su-select-list-background, var(--su-select-background, #fff));border:var(--su-select-list-border, var(--su-select-border, 1px solid #d1d5db));border-radius:var(--su-select-list-radius, .5rem);box-shadow:var(--su-select-list-shadow, 0 10px 30px rgba(0, 0, 0, .12));box-sizing:border-box;color:var(--su-select-color, #111827);display:none;flex-direction:column;font-family:inherit;font-size:var(--su-select-font-size, .875rem);inset:auto;margin:0;max-height:min(var(--su-select-list-max-height, 18rem),100vh - 16px);max-width:calc(100vw - 16px);overflow:hidden;padding:var(--su-select-list-padding, .25rem);position:fixed;z-index:var(--su-select-z-index, 1000)}.su-select-panel.su-select-shown{display:flex}.su-select-panel.su-select-animated.su-select-shown{animation:su-select-in var(--su-select-duration, .16s) cubic-bezier(.16,1,.3,1);transform-origin:top}.su-select-panel.su-select-animated.su-select-shown[data-side=top]{animation-name:su-select-in-above;transform-origin:bottom}.su-select-search{background:transparent;border:0;border-bottom:var(--su-select-search-border, 1px solid #e5e7eb);box-sizing:border-box;color:inherit;flex:none;font:inherit;margin-bottom:.25rem;outline:none;padding:.4rem .5rem;width:100%}.su-select-search::placeholder{color:var(--su-select-muted-color, #6b7280)}.su-select-list,.su-select-group{list-style:none;margin:0;padding:0}.su-select-list{outline:none;overflow-y:auto;overscroll-behavior:contain}.su-select-group-label{color:var(--su-select-muted-color, #6b7280);font-size:.75em;letter-spacing:.04em;padding:.5rem .5rem .2rem;text-transform:uppercase}.su-select-option{align-items:center;border-radius:var(--su-select-option-radius, .3125rem);cursor:pointer;display:flex;gap:1rem;justify-content:space-between;padding:var(--su-select-option-padding, .4rem .5rem);white-space:nowrap}.su-select-option.su-select-active{background:var(--su-select-option-active-background, #f3f4f6)}.su-select-option[aria-selected=true]{color:var(--su-select-option-selected-color, inherit);font-weight:var(--su-select-option-selected-weight, 600)}.su-select-option[aria-disabled=true]{cursor:not-allowed;opacity:var(--su-select-disabled-opacity, .5)}.su-select-check{block-size:1rem;inline-size:1rem;visibility:hidden}[aria-selected=true]>.su-select-check{visibility:visible}.su-select-empty{color:var(--su-select-muted-color, #6b7280);padding:var(--su-select-option-padding, .4rem .5rem)}@keyframes su-select-in{0%{opacity:0;transform:translateY(-4px) scaleY(.96)}}@keyframes su-select-in-above{0%{opacity:0;transform:translateY(4px) scaleY(.96)}}@media(prefers-reduced-motion:reduce){.su-select-panel.su-select-shown,.su-select-panel.su-select-shown[data-side=top]{animation:none}.su-select-chevron{transition:none}}\n"] }]
296
- }], ctorParameters: () => [] });
296
+ }], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "animated", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], chosen: [{ type: i0.Output, args: ["chosen"] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], search: [{ type: i0.ViewChild, args: ['search', { isSignal: true }] }] } });
297
297
  function isPrintable(event) {
298
298
  return event.key.length === 1 && event.key !== ' ' && !event.altKey;
299
299
  }
@@ -1 +1 @@
1
- {"version":3,"file":"su-labs-select.mjs","sources":["../../../../compat/angular-19/build/select/src/lib/select/select.component.ts","../../../../compat/angular-19/build/select/src/lib/select/select.component.html","../../../../compat/angular-19/build/select/src/su-labs-select.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { afterRenderEffect, booleanAttribute, ChangeDetectionStrategy, Component, computed, DestroyRef, effect, ElementRef, inject, input, model, output, signal, untracked, viewChild } from '@angular/core';\nimport { SU_SELECT_LABELS, SuSelectController, suSelectGroups, SuSelectLabels, SuSelectMove, SuSelectOption } from '@su-labs/core/select';\nimport { suTooltipPosition } from '@su-labs/core/tooltip';\n\nlet nextSelectId = 0;\n\nconst MOVES: Readonly<Record<string, SuSelectMove>> = {\n ArrowDown: 'next',\n ArrowUp: 'previous',\n Home: 'first',\n End: 'last',\n PageDown: 'last',\n PageUp: 'first',\n};\n\n/**\n * A select over `SuSelectController` from `@su-labs/core/select`, with its own styled list instead of the browser's\n * popup: `<su-lib-select [options]=\"sizes\" [(value)]=\"size\" />`. The trigger is a `combobox` button and the list a\n * `listbox` in the top layer (`popover`), placed below the trigger or above it when there's no room. It follows the\n * WAI-ARIA select-only combobox pattern: arrows, Home and End, type-ahead, Enter or Space to choose, Escape to close\n * and Tab to choose and move on. With `searchable`, a search field at the top of the list filters the options.\n */\n@Component({\n selector: 'su-lib-select',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './select.component.html',\n styleUrl: './select.component.scss',\n host: {\n class: 'su-select',\n '[class.su-select-open]': 'open()',\n '[class.su-select-disabled]': 'disabled()',\n '(focusout)': 'onFocusOut($event)',\n },\n})\nexport class SuSelectComponent<T> {\n /** The choices: `{ value, label, disabled?, group? }`; options sharing a `group` should follow one another */\n readonly options = input<readonly SuSelectOption<T>[]>([]);\n /** The chosen value, or `null` while nothing is chosen */\n readonly value = model<T | null>(null);\n /** Whether the list is open; setting it opens or closes it */\n readonly open = model(false);\n /** Set once focus has left the select, for forms that show errors after the user moved on */\n readonly touched = model(false);\n /** A search field at the top of the list that filters the options @default false */\n readonly searchable = input(false, { transform: booleanAttribute });\n /** Can't be opened or focused @default false */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Opens with a short fade and slide; off when the user prefers less motion @default true */\n readonly animated = input(true, { transform: booleanAttribute });\n /** Shown while nothing is chosen @default labels.placeholder */\n readonly placeholder = input<string>();\n /** The select's name for screen readers, when no `<label>` wraps it and no `ariaLabelledby` names it */\n readonly ariaLabel = input<string>();\n /** The id of the element that names the select */\n readonly ariaLabelledby = input<string>();\n /** Texts to replace, e.g. in the page's language */\n readonly labels = input<Partial<SuSelectLabels>>({});\n /** The user chose an option (never emitted for a value set from outside): its value */\n readonly chosen = output<T>();\n\n protected readonly id = `su-select-${nextSelectId++}`;\n protected readonly listId = `${this.id}-list`;\n protected readonly texts = computed<SuSelectLabels>(() => ({\n ...SU_SELECT_LABELS,\n ...this.labels(),\n }));\n\n private readonly controller = new SuSelectController<T>();\n protected readonly state = signal(this.controller.state.get());\n protected readonly groups = computed(() =>\n suSelectGroups(this.state().visible)\n );\n protected readonly selected = computed(() => {\n this.state();\n return this.controller.selected;\n });\n protected readonly activeId = computed(() => {\n const { open, active } = this.state();\n return open && active >= 0 ? this.optionId(active) : null;\n });\n\n private readonly host: ElementRef<HTMLElement> = inject(ElementRef);\n private readonly document = inject(DOCUMENT);\n private readonly trigger =\n viewChild.required<ElementRef<HTMLButtonElement>>('trigger');\n private readonly panel = viewChild.required<ElementRef<HTMLElement>>('panel');\n private readonly search = viewChild<ElementRef<HTMLInputElement>>('search');\n\n constructor() {\n let previous = this.controller.state.get();\n const unsubscribe = this.controller.state.subscribe(state => {\n this.state.set(state);\n if (state.value !== previous.value) {\n this.value.set(state.value);\n }\n if (state.open !== previous.open) {\n this.open.set(state.open);\n }\n previous = state;\n });\n inject(DestroyRef).onDestroy(unsubscribe);\n\n effect(() => {\n const options = this.options();\n untracked(() => this.controller.setOptions(options));\n });\n\n effect(() => {\n const value = this.value();\n untracked(() => this.controller.setValue(value));\n });\n\n effect(() => {\n const open = this.open() && !this.disabled();\n untracked(() =>\n open ? this.controller.open() : this.controller.close()\n );\n });\n\n effect(onCleanup => {\n if (!this.state().open) {\n return;\n }\n const onPointerDown = (event: PointerEvent) =>\n this.onDocumentPointerDown(event);\n const onMove = () => this.follow();\n const view = this.document.defaultView;\n this.document.addEventListener('pointerdown', onPointerDown);\n view?.addEventListener('scroll', onMove, true);\n view?.addEventListener('resize', onMove);\n onCleanup(() => {\n this.document.removeEventListener('pointerdown', onPointerDown);\n view?.removeEventListener('scroll', onMove, true);\n view?.removeEventListener('resize', onMove);\n });\n });\n\n afterRenderEffect(() => {\n const open = this.state().open;\n untracked(() => (open ? this.reveal() : this.conceal()));\n });\n\n afterRenderEffect(() => {\n const id = this.activeId();\n const option = id ? this.document.getElementById(id) : null;\n if (option && typeof option.scrollIntoView === 'function') {\n option.scrollIntoView({ block: 'nearest' });\n }\n });\n }\n\n /** Moves focus to the trigger */\n focus(): void {\n this.trigger().nativeElement.focus();\n }\n\n protected optionId(index: number): string {\n return `${this.id}-option-${index}`;\n }\n\n protected isSelected(option: SuSelectOption<T>): boolean {\n return option === this.selected();\n }\n\n protected toggle(): void {\n if (!this.disabled()) {\n this.controller.toggle();\n }\n }\n\n protected choose(index: number): void {\n this.byUser(() => this.pick(index));\n }\n\n protected activate(index: number): void {\n if (index !== this.state().active) {\n this.controller.activate(index);\n }\n }\n\n protected onSearch(event: Event): void {\n if (event.target instanceof HTMLInputElement) {\n this.controller.search(event.target.value);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.disabled() || event.ctrlKey || event.metaKey) {\n return;\n }\n this.byUser(() =>\n this.state().open\n ? this.onOpenKeydown(event)\n : this.onClosedKeydown(event)\n );\n }\n\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget;\n if (next instanceof Node && this.host.nativeElement.contains(next)) {\n return;\n }\n this.controller.close();\n this.touched.set(true);\n }\n\n private onClosedKeydown(event: KeyboardEvent): void {\n const move = MOVES[event.key];\n if (move || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.controller.open();\n if (move === 'first' || move === 'last') {\n this.controller.move(move);\n }\n return;\n }\n if (isPrintable(event)) {\n event.preventDefault();\n this.controller.typeAhead(event.key);\n }\n }\n\n private onOpenKeydown(event: KeyboardEvent): void {\n const searching = this.searchable();\n const move = MOVES[event.key];\n if (event.key === 'ArrowUp' && event.altKey) {\n event.preventDefault();\n this.pick(this.state().active);\n } else if (\n move &&\n !(searching && (event.key === 'Home' || event.key === 'End'))\n ) {\n event.preventDefault();\n this.controller.move(move);\n } else if (event.key === 'Enter' || (event.key === ' ' && !searching)) {\n event.preventDefault();\n this.pick(this.state().active);\n } else if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n this.controller.close();\n this.focus();\n } else if (event.key === 'Tab') {\n this.controller.choose();\n this.controller.close();\n } else if (!searching && isPrintable(event)) {\n event.preventDefault();\n this.controller.typeAhead(event.key);\n }\n }\n\n private pick(index: number): void {\n if (this.controller.choose(index)) {\n this.focus();\n }\n }\n\n private byUser(action: () => void): void {\n const before = this.controller.state.get().value;\n action();\n const after = this.controller.state.get().value;\n if (after !== null && after !== before) {\n this.chosen.emit(after);\n }\n }\n\n private onDocumentPointerDown(event: PointerEvent): void {\n const target = event.target;\n if (\n !(target instanceof Node) ||\n !this.host.nativeElement.contains(target)\n ) {\n this.controller.close();\n }\n }\n\n private reveal(): void {\n const panel = this.panel().nativeElement;\n panel.classList.add('su-select-shown');\n if (\n typeof panel.showPopover === 'function' &&\n !panel.matches(':popover-open')\n ) {\n panel.showPopover();\n }\n this.place();\n const search = this.search()?.nativeElement;\n if (search) {\n search.value = '';\n search.focus();\n }\n }\n\n private conceal(): void {\n const panel = this.panel().nativeElement;\n panel.classList.remove('su-select-shown');\n if (\n typeof panel.hidePopover === 'function' &&\n panel.matches(':popover-open')\n ) {\n panel.hidePopover();\n }\n }\n\n private follow(): void {\n const trigger = this.trigger().nativeElement.getBoundingClientRect();\n const height = this.document.defaultView?.innerHeight ?? 0;\n if (trigger.bottom <= 0 || trigger.top >= height) {\n this.controller.close();\n return;\n }\n this.place();\n }\n\n private place(): void {\n if (!this.state().open) {\n return;\n }\n const panel = this.panel().nativeElement;\n const trigger = this.trigger().nativeElement.getBoundingClientRect();\n const view = this.document.defaultView;\n panel.style.minWidth = `${trigger.width}px`;\n const position = suTooltipPosition(\n trigger,\n { width: panel.offsetWidth, height: panel.offsetHeight },\n {\n placement: 'bottom-start',\n offset: 4,\n viewport: {\n width: this.document.documentElement.clientWidth,\n height: view?.innerHeight ?? 0,\n },\n rtl:\n view?.getComputedStyle(this.host.nativeElement).direction === 'rtl',\n }\n );\n panel.dataset['side'] = position.side;\n panel.style.left = `${position.x}px`;\n panel.style.top = `${position.y}px`;\n }\n}\n\nfunction isPrintable(event: KeyboardEvent): boolean {\n return event.key.length === 1 && event.key !== ' ' && !event.altKey;\n}\n","<button\n #trigger\n type=\"button\"\n class=\"su-select-trigger\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [id]=\"id\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"state().open\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"searchable() ? null : activeId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\">\n <span class=\"su-select-value\" [class.su-select-placeholder]=\"!selected()\">{{ selected()?.label ?? placeholder() ?? texts().placeholder }}</span>\n <svg class=\"su-select-chevron\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"m6 9 6 6 6-6\" /></svg>\n</button>\n<div #panel popover=\"manual\" class=\"su-select-panel\" [class.su-select-animated]=\"animated()\">\n @if (searchable()) {\n <input\n #search\n type=\"text\"\n class=\"su-select-search\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeId()\"\n [attr.aria-label]=\"texts().search\"\n [placeholder]=\"texts().search\"\n (input)=\"onSearch($event)\"\n (keydown)=\"onKeydown($event)\" />\n }\n <ul class=\"su-select-list\" role=\"listbox\" tabindex=\"-1\" [id]=\"listId\" [attr.aria-label]=\"ariaLabel() ?? null\" [attr.aria-labelledby]=\"ariaLabel() ? null : (ariaLabelledby() ?? id)\" (mousedown)=\"$event.preventDefault()\">\n @for (group of groups(); track $index) {\n <li role=\"presentation\">\n <ul class=\"su-select-group\" [attr.role]=\"group.label ? 'group' : 'presentation'\" [attr.aria-labelledby]=\"group.label ? id + '-group-' + $index : null\">\n @if (group.label) {\n <li role=\"presentation\" class=\"su-select-group-label\" [id]=\"id + '-group-' + $index\">{{ group.label }}</li>\n }\n @for (item of group.options; track item.index) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- the combobox handles the keyboard through aria-activedescendant -->\n <li\n role=\"option\"\n class=\"su-select-option\"\n [id]=\"optionId(item.index)\"\n [class.su-select-active]=\"item.index === state().active\"\n [attr.aria-selected]=\"isSelected(item.option)\"\n [attr.aria-disabled]=\"item.option.disabled ? true : null\"\n (click)=\"choose(item.index)\"\n (pointermove)=\"activate(item.index)\">\n <span class=\"su-select-option-label\">{{ item.option.label }}</span>\n <svg class=\"su-select-check\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M5 12.5l4.5 4.5L19 7.5\" /></svg>\n </li>\n }\n </ul>\n </li>\n } @empty {\n <li role=\"presentation\" class=\"su-select-empty\">{{ texts().empty }}</li>\n }\n </ul>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAKA,IAAI,YAAY,GAAG,CAAC;AAEpB,MAAM,KAAK,GAA2C;AACpD,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,GAAG,EAAE,MAAM;AACX,IAAA,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,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,kjECnC9B,wkGAiEA,EAAA,MAAA,EAAA,CAAA,uoIAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FD9Ba,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAZ7B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,eAAA,EACR,uBAAuB,CAAC,MAAM,EAAA,IAAA,EAGzC;AACJ,wBAAA,KAAK,EAAE,WAAW;AAClB,wBAAA,wBAAwB,EAAE,QAAQ;AAClC,wBAAA,4BAA4B,EAAE,YAAY;AAC1C,wBAAA,YAAY,EAAE,oBAAoB;AACnC,qBAAA,EAAA,QAAA,EAAA,wkGAAA,EAAA,MAAA,EAAA,CAAA,uoIAAA,CAAA,EAAA;;AAsTH,SAAS,WAAW,CAAC,KAAoB,EAAA;AACvC,IAAA,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM;AACrE;;AEzVA;;AAEG;;;;"}
1
+ {"version":3,"file":"su-labs-select.mjs","sources":["../../../../compat/angular-20/build/select/src/lib/select/select.component.ts","../../../../compat/angular-20/build/select/src/lib/select/select.component.html","../../../../compat/angular-20/build/select/src/su-labs-select.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { afterRenderEffect, booleanAttribute, ChangeDetectionStrategy, Component, computed, DestroyRef, effect, ElementRef, inject, input, model, output, signal, untracked, viewChild } from '@angular/core';\nimport { SU_SELECT_LABELS, SuSelectController, suSelectGroups, SuSelectLabels, SuSelectMove, SuSelectOption } from '@su-labs/core/select';\nimport { suTooltipPosition } from '@su-labs/core/tooltip';\n\nlet nextSelectId = 0;\n\nconst MOVES: Readonly<Record<string, SuSelectMove>> = {\n ArrowDown: 'next',\n ArrowUp: 'previous',\n Home: 'first',\n End: 'last',\n PageDown: 'last',\n PageUp: 'first',\n};\n\n/**\n * A select over `SuSelectController` from `@su-labs/core/select`, with its own styled list instead of the browser's\n * popup: `<su-lib-select [options]=\"sizes\" [(value)]=\"size\" />`. The trigger is a `combobox` button and the list a\n * `listbox` in the top layer (`popover`), placed below the trigger or above it when there's no room. It follows the\n * WAI-ARIA select-only combobox pattern: arrows, Home and End, type-ahead, Enter or Space to choose, Escape to close\n * and Tab to choose and move on. With `searchable`, a search field at the top of the list filters the options.\n */\n@Component({\n selector: 'su-lib-select',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './select.component.html',\n styleUrl: './select.component.scss',\n host: {\n class: 'su-select',\n '[class.su-select-open]': 'open()',\n '[class.su-select-disabled]': 'disabled()',\n '(focusout)': 'onFocusOut($event)',\n },\n})\nexport class SuSelectComponent<T> {\n /** The choices: `{ value, label, disabled?, group? }`; options sharing a `group` should follow one another */\n readonly options = input<readonly SuSelectOption<T>[]>([]);\n /** The chosen value, or `null` while nothing is chosen */\n readonly value = model<T | null>(null);\n /** Whether the list is open; setting it opens or closes it */\n readonly open = model(false);\n /** Set once focus has left the select, for forms that show errors after the user moved on */\n readonly touched = model(false);\n /** A search field at the top of the list that filters the options @default false */\n readonly searchable = input(false, { transform: booleanAttribute });\n /** Can't be opened or focused @default false */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Opens with a short fade and slide; off when the user prefers less motion @default true */\n readonly animated = input(true, { transform: booleanAttribute });\n /** Shown while nothing is chosen @default labels.placeholder */\n readonly placeholder = input<string>();\n /** The select's name for screen readers, when no `<label>` wraps it and no `ariaLabelledby` names it */\n readonly ariaLabel = input<string>();\n /** The id of the element that names the select */\n readonly ariaLabelledby = input<string>();\n /** Texts to replace, e.g. in the page's language */\n readonly labels = input<Partial<SuSelectLabels>>({});\n /** The user chose an option (never emitted for a value set from outside): its value */\n readonly chosen = output<T>();\n\n protected readonly id = `su-select-${nextSelectId++}`;\n protected readonly listId = `${this.id}-list`;\n protected readonly texts = computed<SuSelectLabels>(() => ({\n ...SU_SELECT_LABELS,\n ...this.labels(),\n }));\n\n private readonly controller = new SuSelectController<T>();\n protected readonly state = signal(this.controller.state.get());\n protected readonly groups = computed(() =>\n suSelectGroups(this.state().visible)\n );\n protected readonly selected = computed(() => {\n this.state();\n return this.controller.selected;\n });\n protected readonly activeId = computed(() => {\n const { open, active } = this.state();\n return open && active >= 0 ? this.optionId(active) : null;\n });\n\n private readonly host: ElementRef<HTMLElement> = inject(ElementRef);\n private readonly document = inject(DOCUMENT);\n private readonly trigger =\n viewChild.required<ElementRef<HTMLButtonElement>>('trigger');\n private readonly panel = viewChild.required<ElementRef<HTMLElement>>('panel');\n private readonly search = viewChild<ElementRef<HTMLInputElement>>('search');\n\n constructor() {\n let previous = this.controller.state.get();\n const unsubscribe = this.controller.state.subscribe(state => {\n this.state.set(state);\n if (state.value !== previous.value) {\n this.value.set(state.value);\n }\n if (state.open !== previous.open) {\n this.open.set(state.open);\n }\n previous = state;\n });\n inject(DestroyRef).onDestroy(unsubscribe);\n\n effect(() => {\n const options = this.options();\n untracked(() => this.controller.setOptions(options));\n });\n\n effect(() => {\n const value = this.value();\n untracked(() => this.controller.setValue(value));\n });\n\n effect(() => {\n const open = this.open() && !this.disabled();\n untracked(() =>\n open ? this.controller.open() : this.controller.close()\n );\n });\n\n effect(onCleanup => {\n if (!this.state().open) {\n return;\n }\n const onPointerDown = (event: PointerEvent) =>\n this.onDocumentPointerDown(event);\n const onMove = () => this.follow();\n const view = this.document.defaultView;\n this.document.addEventListener('pointerdown', onPointerDown);\n view?.addEventListener('scroll', onMove, true);\n view?.addEventListener('resize', onMove);\n onCleanup(() => {\n this.document.removeEventListener('pointerdown', onPointerDown);\n view?.removeEventListener('scroll', onMove, true);\n view?.removeEventListener('resize', onMove);\n });\n });\n\n afterRenderEffect(() => {\n const open = this.state().open;\n untracked(() => (open ? this.reveal() : this.conceal()));\n });\n\n afterRenderEffect(() => {\n const id = this.activeId();\n const option = id ? this.document.getElementById(id) : null;\n if (option && typeof option.scrollIntoView === 'function') {\n option.scrollIntoView({ block: 'nearest' });\n }\n });\n }\n\n /** Moves focus to the trigger */\n focus(): void {\n this.trigger().nativeElement.focus();\n }\n\n protected optionId(index: number): string {\n return `${this.id}-option-${index}`;\n }\n\n protected isSelected(option: SuSelectOption<T>): boolean {\n return option === this.selected();\n }\n\n protected toggle(): void {\n if (!this.disabled()) {\n this.controller.toggle();\n }\n }\n\n protected choose(index: number): void {\n this.byUser(() => this.pick(index));\n }\n\n protected activate(index: number): void {\n if (index !== this.state().active) {\n this.controller.activate(index);\n }\n }\n\n protected onSearch(event: Event): void {\n if (event.target instanceof HTMLInputElement) {\n this.controller.search(event.target.value);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.disabled() || event.ctrlKey || event.metaKey) {\n return;\n }\n this.byUser(() =>\n this.state().open\n ? this.onOpenKeydown(event)\n : this.onClosedKeydown(event)\n );\n }\n\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget;\n if (next instanceof Node && this.host.nativeElement.contains(next)) {\n return;\n }\n this.controller.close();\n this.touched.set(true);\n }\n\n private onClosedKeydown(event: KeyboardEvent): void {\n const move = MOVES[event.key];\n if (move || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.controller.open();\n if (move === 'first' || move === 'last') {\n this.controller.move(move);\n }\n return;\n }\n if (isPrintable(event)) {\n event.preventDefault();\n this.controller.typeAhead(event.key);\n }\n }\n\n private onOpenKeydown(event: KeyboardEvent): void {\n const searching = this.searchable();\n const move = MOVES[event.key];\n if (event.key === 'ArrowUp' && event.altKey) {\n event.preventDefault();\n this.pick(this.state().active);\n } else if (\n move &&\n !(searching && (event.key === 'Home' || event.key === 'End'))\n ) {\n event.preventDefault();\n this.controller.move(move);\n } else if (event.key === 'Enter' || (event.key === ' ' && !searching)) {\n event.preventDefault();\n this.pick(this.state().active);\n } else if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n this.controller.close();\n this.focus();\n } else if (event.key === 'Tab') {\n this.controller.choose();\n this.controller.close();\n } else if (!searching && isPrintable(event)) {\n event.preventDefault();\n this.controller.typeAhead(event.key);\n }\n }\n\n private pick(index: number): void {\n if (this.controller.choose(index)) {\n this.focus();\n }\n }\n\n private byUser(action: () => void): void {\n const before = this.controller.state.get().value;\n action();\n const after = this.controller.state.get().value;\n if (after !== null && after !== before) {\n this.chosen.emit(after);\n }\n }\n\n private onDocumentPointerDown(event: PointerEvent): void {\n const target = event.target;\n if (\n !(target instanceof Node) ||\n !this.host.nativeElement.contains(target)\n ) {\n this.controller.close();\n }\n }\n\n private reveal(): void {\n const panel = this.panel().nativeElement;\n panel.classList.add('su-select-shown');\n if (\n typeof panel.showPopover === 'function' &&\n !panel.matches(':popover-open')\n ) {\n panel.showPopover();\n }\n this.place();\n const search = this.search()?.nativeElement;\n if (search) {\n search.value = '';\n search.focus();\n }\n }\n\n private conceal(): void {\n const panel = this.panel().nativeElement;\n panel.classList.remove('su-select-shown');\n if (\n typeof panel.hidePopover === 'function' &&\n panel.matches(':popover-open')\n ) {\n panel.hidePopover();\n }\n }\n\n private follow(): void {\n const trigger = this.trigger().nativeElement.getBoundingClientRect();\n const height = this.document.defaultView?.innerHeight ?? 0;\n if (trigger.bottom <= 0 || trigger.top >= height) {\n this.controller.close();\n return;\n }\n this.place();\n }\n\n private place(): void {\n if (!this.state().open) {\n return;\n }\n const panel = this.panel().nativeElement;\n const trigger = this.trigger().nativeElement.getBoundingClientRect();\n const view = this.document.defaultView;\n panel.style.minWidth = `${trigger.width}px`;\n const position = suTooltipPosition(\n trigger,\n { width: panel.offsetWidth, height: panel.offsetHeight },\n {\n placement: 'bottom-start',\n offset: 4,\n viewport: {\n width: this.document.documentElement.clientWidth,\n height: view?.innerHeight ?? 0,\n },\n rtl:\n view?.getComputedStyle(this.host.nativeElement).direction === 'rtl',\n }\n );\n panel.dataset['side'] = position.side;\n panel.style.left = `${position.x}px`;\n panel.style.top = `${position.y}px`;\n }\n}\n\nfunction isPrintable(event: KeyboardEvent): boolean {\n return event.key.length === 1 && event.key !== ' ' && !event.altKey;\n}\n","<button\n #trigger\n type=\"button\"\n class=\"su-select-trigger\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [id]=\"id\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"state().open\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"searchable() ? null : activeId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\">\n <span class=\"su-select-value\" [class.su-select-placeholder]=\"!selected()\">{{ selected()?.label ?? placeholder() ?? texts().placeholder }}</span>\n <svg class=\"su-select-chevron\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"m6 9 6 6 6-6\" /></svg>\n</button>\n<div #panel popover=\"manual\" class=\"su-select-panel\" [class.su-select-animated]=\"animated()\">\n @if (searchable()) {\n <input\n #search\n type=\"text\"\n class=\"su-select-search\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeId()\"\n [attr.aria-label]=\"texts().search\"\n [placeholder]=\"texts().search\"\n (input)=\"onSearch($event)\"\n (keydown)=\"onKeydown($event)\" />\n }\n <ul class=\"su-select-list\" role=\"listbox\" tabindex=\"-1\" [id]=\"listId\" [attr.aria-label]=\"ariaLabel() ?? null\" [attr.aria-labelledby]=\"ariaLabel() ? null : (ariaLabelledby() ?? id)\" (mousedown)=\"$event.preventDefault()\">\n @for (group of groups(); track $index) {\n <li role=\"presentation\">\n <ul class=\"su-select-group\" [attr.role]=\"group.label ? 'group' : 'presentation'\" [attr.aria-labelledby]=\"group.label ? id + '-group-' + $index : null\">\n @if (group.label) {\n <li role=\"presentation\" class=\"su-select-group-label\" [id]=\"id + '-group-' + $index\">{{ group.label }}</li>\n }\n @for (item of group.options; track item.index) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- the combobox handles the keyboard through aria-activedescendant -->\n <li\n role=\"option\"\n class=\"su-select-option\"\n [id]=\"optionId(item.index)\"\n [class.su-select-active]=\"item.index === state().active\"\n [attr.aria-selected]=\"isSelected(item.option)\"\n [attr.aria-disabled]=\"item.option.disabled ? true : null\"\n (click)=\"choose(item.index)\"\n (pointermove)=\"activate(item.index)\">\n <span class=\"su-select-option-label\">{{ item.option.label }}</span>\n <svg class=\"su-select-check\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M5 12.5l4.5 4.5L19 7.5\" /></svg>\n </li>\n }\n </ul>\n </li>\n } @empty {\n <li role=\"presentation\" class=\"su-select-empty\">{{ texts().empty }}</li>\n }\n </ul>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAKA,IAAI,YAAY,GAAG,CAAC;AAEpB,MAAM,KAAK,GAA2C;AACpD,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,GAAG,EAAE,MAAM;AACX,IAAA,QAAQ,EAAE,MAAM;AAChB,IAAA,MAAM,EAAE,OAAO;CAChB;AAED;;;;;;AAMG;MAaU,iBAAiB,CAAA;;AAEnB,IAAA,OAAO,GAAG,KAAK,CAA+B,EAAE,mDAAC;;AAEjD,IAAA,KAAK,GAAG,KAAK,CAAW,IAAI,iDAAC;;AAE7B,IAAA,IAAI,GAAG,KAAK,CAAC,KAAK,gDAAC;;AAEnB,IAAA,OAAO,GAAG,KAAK,CAAC,KAAK,mDAAC;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AAA,EAAA,CAAA,EAAA,EAAA,CAAA;AAgQ5E,SAAS,WAAW,CAAC,KAAoB,EAAA;AACvC,IAAA,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM;AACrE;;AEzVA;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,5 +1,74 @@
1
+ import * as _su_labs_core_select from '@su-labs/core/select';
2
+ import { SuSelectOption, SuSelectLabels } from '@su-labs/core/select';
3
+ import * as _angular_core from '@angular/core';
4
+
1
5
  /**
2
- * Generated bundle index. Do not edit.
6
+ * A select over `SuSelectController` from `@su-labs/core/select`, with its own styled list instead of the browser's
7
+ * popup: `<su-lib-select [options]="sizes" [(value)]="size" />`. The trigger is a `combobox` button and the list a
8
+ * `listbox` in the top layer (`popover`), placed below the trigger or above it when there's no room. It follows the
9
+ * WAI-ARIA select-only combobox pattern: arrows, Home and End, type-ahead, Enter or Space to choose, Escape to close
10
+ * and Tab to choose and move on. With `searchable`, a search field at the top of the list filters the options.
3
11
  */
4
- /// <amd-module name="@su-labs/select" />
5
- export * from './public-api';
12
+ declare class SuSelectComponent<T> {
13
+ /** The choices: `{ value, label, disabled?, group? }`; options sharing a `group` should follow one another */
14
+ readonly options: _angular_core.InputSignal<readonly SuSelectOption<T>[]>;
15
+ /** The chosen value, or `null` while nothing is chosen */
16
+ readonly value: _angular_core.ModelSignal<T | null>;
17
+ /** Whether the list is open; setting it opens or closes it */
18
+ readonly open: _angular_core.ModelSignal<boolean>;
19
+ /** Set once focus has left the select, for forms that show errors after the user moved on */
20
+ readonly touched: _angular_core.ModelSignal<boolean>;
21
+ /** A search field at the top of the list that filters the options @default false */
22
+ readonly searchable: _angular_core.InputSignalWithTransform<boolean, unknown>;
23
+ /** Can't be opened or focused @default false */
24
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
25
+ /** Opens with a short fade and slide; off when the user prefers less motion @default true */
26
+ readonly animated: _angular_core.InputSignalWithTransform<boolean, unknown>;
27
+ /** Shown while nothing is chosen @default labels.placeholder */
28
+ readonly placeholder: _angular_core.InputSignal<string | undefined>;
29
+ /** The select's name for screen readers, when no `<label>` wraps it and no `ariaLabelledby` names it */
30
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
31
+ /** The id of the element that names the select */
32
+ readonly ariaLabelledby: _angular_core.InputSignal<string | undefined>;
33
+ /** Texts to replace, e.g. in the page's language */
34
+ readonly labels: _angular_core.InputSignal<Partial<SuSelectLabels>>;
35
+ /** The user chose an option (never emitted for a value set from outside): its value */
36
+ readonly chosen: _angular_core.OutputEmitterRef<T>;
37
+ protected readonly id: string;
38
+ protected readonly listId: string;
39
+ protected readonly texts: _angular_core.Signal<SuSelectLabels>;
40
+ private readonly controller;
41
+ protected readonly state: _angular_core.WritableSignal<_su_labs_core_select.SuSelectState<T>>;
42
+ protected readonly groups: _angular_core.Signal<readonly _su_labs_core_select.SuSelectGroup<T>[]>;
43
+ protected readonly selected: _angular_core.Signal<SuSelectOption<T> | undefined>;
44
+ protected readonly activeId: _angular_core.Signal<string | null>;
45
+ private readonly host;
46
+ private readonly document;
47
+ private readonly trigger;
48
+ private readonly panel;
49
+ private readonly search;
50
+ constructor();
51
+ /** Moves focus to the trigger */
52
+ focus(): void;
53
+ protected optionId(index: number): string;
54
+ protected isSelected(option: SuSelectOption<T>): boolean;
55
+ protected toggle(): void;
56
+ protected choose(index: number): void;
57
+ protected activate(index: number): void;
58
+ protected onSearch(event: Event): void;
59
+ protected onKeydown(event: KeyboardEvent): void;
60
+ protected onFocusOut(event: FocusEvent): void;
61
+ private onClosedKeydown;
62
+ private onOpenKeydown;
63
+ private pick;
64
+ private byUser;
65
+ private onDocumentPointerDown;
66
+ private reveal;
67
+ private conceal;
68
+ private follow;
69
+ private place;
70
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SuSelectComponent<any>, never>;
71
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SuSelectComponent<any>, "su-lib-select", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "animated": { "alias": "animated"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "ariaLabelledby"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "open": "openChange"; "touched": "touchedChange"; "chosen": "chosen"; }, never, never, true, never>;
72
+ }
73
+
74
+ export { SuSelectComponent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@su-labs/select",
3
- "version": "19.0.0",
3
+ "version": "20.0.0",
4
4
  "description": "An accessible Angular select with its own styled list instead of the native popup: search, groups, disabled options, full keyboard support and type-ahead, opening in the top layer and flipping above when there is no room, themeable with CSS variables.",
5
5
  "keywords": [
6
6
  "angular",
@@ -30,8 +30,8 @@
30
30
  "url": "https://github.com/Greezaaa/settings-utils-lib/issues"
31
31
  },
32
32
  "peerDependencies": {
33
- "@angular/common": "^19.0.0",
34
- "@angular/core": "^19.0.0"
33
+ "@angular/common": "^20.0.0",
34
+ "@angular/core": "^20.0.0"
35
35
  },
36
36
  "dependencies": {
37
37
  "@su-labs/core": "1.13.0",
@@ -1,70 +0,0 @@
1
- import { SuSelectLabels, SuSelectOption } from '@su-labs/core/select';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * A select over `SuSelectController` from `@su-labs/core/select`, with its own styled list instead of the browser's
5
- * popup: `<su-lib-select [options]="sizes" [(value)]="size" />`. The trigger is a `combobox` button and the list a
6
- * `listbox` in the top layer (`popover`), placed below the trigger or above it when there's no room. It follows the
7
- * WAI-ARIA select-only combobox pattern: arrows, Home and End, type-ahead, Enter or Space to choose, Escape to close
8
- * and Tab to choose and move on. With `searchable`, a search field at the top of the list filters the options.
9
- */
10
- export declare class SuSelectComponent<T> {
11
- /** The choices: `{ value, label, disabled?, group? }`; options sharing a `group` should follow one another */
12
- readonly options: import("@angular/core").InputSignal<readonly SuSelectOption<T>[]>;
13
- /** The chosen value, or `null` while nothing is chosen */
14
- readonly value: import("@angular/core").ModelSignal<T | null>;
15
- /** Whether the list is open; setting it opens or closes it */
16
- readonly open: import("@angular/core").ModelSignal<boolean>;
17
- /** Set once focus has left the select, for forms that show errors after the user moved on */
18
- readonly touched: import("@angular/core").ModelSignal<boolean>;
19
- /** A search field at the top of the list that filters the options @default false */
20
- readonly searchable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
21
- /** Can't be opened or focused @default false */
22
- readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
23
- /** Opens with a short fade and slide; off when the user prefers less motion @default true */
24
- readonly animated: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
25
- /** Shown while nothing is chosen @default labels.placeholder */
26
- readonly placeholder: import("@angular/core").InputSignal<string | undefined>;
27
- /** The select's name for screen readers, when no `<label>` wraps it and no `ariaLabelledby` names it */
28
- readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
29
- /** The id of the element that names the select */
30
- readonly ariaLabelledby: import("@angular/core").InputSignal<string | undefined>;
31
- /** Texts to replace, e.g. in the page's language */
32
- readonly labels: import("@angular/core").InputSignal<Partial<SuSelectLabels>>;
33
- /** The user chose an option (never emitted for a value set from outside): its value */
34
- readonly chosen: import("@angular/core").OutputEmitterRef<T>;
35
- protected readonly id: string;
36
- protected readonly listId: string;
37
- protected readonly texts: import("@angular/core").Signal<SuSelectLabels>;
38
- private readonly controller;
39
- protected readonly state: import("@angular/core").WritableSignal<import("@su-labs/core/select").SuSelectState<T>>;
40
- protected readonly groups: import("@angular/core").Signal<readonly import("@su-labs/core/select").SuSelectGroup<T>[]>;
41
- protected readonly selected: import("@angular/core").Signal<SuSelectOption<T> | undefined>;
42
- protected readonly activeId: import("@angular/core").Signal<string | null>;
43
- private readonly host;
44
- private readonly document;
45
- private readonly trigger;
46
- private readonly panel;
47
- private readonly search;
48
- constructor();
49
- /** Moves focus to the trigger */
50
- focus(): void;
51
- protected optionId(index: number): string;
52
- protected isSelected(option: SuSelectOption<T>): boolean;
53
- protected toggle(): void;
54
- protected choose(index: number): void;
55
- protected activate(index: number): void;
56
- protected onSearch(event: Event): void;
57
- protected onKeydown(event: KeyboardEvent): void;
58
- protected onFocusOut(event: FocusEvent): void;
59
- private onClosedKeydown;
60
- private onOpenKeydown;
61
- private pick;
62
- private byUser;
63
- private onDocumentPointerDown;
64
- private reveal;
65
- private conceal;
66
- private follow;
67
- private place;
68
- static ɵfac: i0.ɵɵFactoryDeclaration<SuSelectComponent<any>, never>;
69
- static ɵcmp: i0.ɵɵComponentDeclaration<SuSelectComponent<any>, "su-lib-select", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "animated": { "alias": "animated"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "ariaLabelledby"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "open": "openChange"; "touched": "touchedChange"; "chosen": "chosen"; }, never, never, true, never>;
70
- }
package/public-api.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './lib/select/select.component';