@eagami/ui 5.85.0 → 5.87.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/fesm2022/eagami-ui.mjs +86 -28
- package/fesm2022/eagami-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/eagami-ui.d.ts +19 -9
package/fesm2022/eagami-ui.mjs
CHANGED
|
@@ -14863,12 +14863,46 @@ function focusOnReveal(isOpen, popover, focus) {
|
|
|
14863
14863
|
pending.set(latestRequest);
|
|
14864
14864
|
};
|
|
14865
14865
|
}
|
|
14866
|
+
const QUERY_RESET_MS = 500;
|
|
14867
|
+
function isTypedCharacter(event) {
|
|
14868
|
+
return event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;
|
|
14869
|
+
}
|
|
14870
|
+
var Typeahead = class {
|
|
14871
|
+
query = "";
|
|
14872
|
+
timer;
|
|
14873
|
+
constructor() {
|
|
14874
|
+
inject(DestroyRef).onDestroy(() => this.reset());
|
|
14875
|
+
}
|
|
14876
|
+
accepts(event) {
|
|
14877
|
+
return isTypedCharacter(event) && (event.key !== " " || this.query !== "");
|
|
14878
|
+
}
|
|
14879
|
+
match(key, labels, current, includeCurrent = false) {
|
|
14880
|
+
clearTimeout(this.timer);
|
|
14881
|
+
this.timer = setTimeout(() => this.query = "", QUERY_RESET_MS);
|
|
14882
|
+
this.query += foldForSearch(key);
|
|
14883
|
+
if (labels.length === 0) return -1;
|
|
14884
|
+
const start = Math.max(current, 0);
|
|
14885
|
+
const firstOffset = this.query.length > 1 || includeCurrent || current < 0 ? 0 : 1;
|
|
14886
|
+
for (let offset = firstOffset; offset <= labels.length; offset++) {
|
|
14887
|
+
const idx = (start + offset) % labels.length;
|
|
14888
|
+
const label = labels[idx];
|
|
14889
|
+
if (label !== null && foldForSearch(label).startsWith(this.query)) return idx;
|
|
14890
|
+
}
|
|
14891
|
+
return -1;
|
|
14892
|
+
}
|
|
14893
|
+
reset() {
|
|
14894
|
+
clearTimeout(this.timer);
|
|
14895
|
+
this.timer = void 0;
|
|
14896
|
+
this.query = "";
|
|
14897
|
+
}
|
|
14898
|
+
};
|
|
14866
14899
|
var MenuComponent = class MenuComponent {
|
|
14867
14900
|
injector = inject(Injector);
|
|
14868
14901
|
i18n = inject(EagamiI18nService);
|
|
14869
14902
|
listEl = viewChild("listEl", ...ngDevMode ? [{ debugName: "listEl" }] : /* istanbul ignore next */ []);
|
|
14870
14903
|
popover = viewChild(PopoverComponent, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
|
|
14871
14904
|
focusFirstItemOnReveal = focusOnReveal(() => this.open(), () => this.popover(), () => this.focusFirstItem());
|
|
14905
|
+
typeahead = new Typeahead();
|
|
14872
14906
|
placement = input("bottom-start", ...ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []);
|
|
14873
14907
|
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
14874
14908
|
maxHeight = input("20rem", ...ngDevMode ? [{ debugName: "maxHeight" }] : /* istanbul ignore next */ []);
|
|
@@ -14891,6 +14925,7 @@ var MenuComponent = class MenuComponent {
|
|
|
14891
14925
|
constructor() {
|
|
14892
14926
|
effect(() => {
|
|
14893
14927
|
if (!this.open()) {
|
|
14928
|
+
this.typeahead.reset();
|
|
14894
14929
|
this.activeItemId.set(null);
|
|
14895
14930
|
this.asContextMenu.set(false);
|
|
14896
14931
|
this.anchorPoint.set(null);
|
|
@@ -14981,6 +15016,12 @@ var MenuComponent = class MenuComponent {
|
|
|
14981
15016
|
case "End":
|
|
14982
15017
|
event.preventDefault();
|
|
14983
15018
|
next = items.length - 1;
|
|
15019
|
+
break;
|
|
15020
|
+
default: if (this.typeahead.accepts(event)) {
|
|
15021
|
+
event.preventDefault();
|
|
15022
|
+
const labels = items.map((item) => item.querySelector(".ea-menu-item__label")?.textContent?.trim() ?? "");
|
|
15023
|
+
next = this.typeahead.match(event.key, labels, current);
|
|
15024
|
+
}
|
|
14984
15025
|
}
|
|
14985
15026
|
if (next >= 0) this.focusItem(items[next]);
|
|
14986
15027
|
}
|
|
@@ -18954,9 +18995,6 @@ const LIST_KEYS = /* @__PURE__ */ new Set([
|
|
|
18954
18995
|
"Enter",
|
|
18955
18996
|
"Escape"
|
|
18956
18997
|
]);
|
|
18957
|
-
function isTypedCharacter(event) {
|
|
18958
|
-
return event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;
|
|
18959
|
-
}
|
|
18960
18998
|
var DropdownComponent = class DropdownComponent extends LabelledFieldControlBase {
|
|
18961
18999
|
elRef = viewChild("triggerEl", ...ngDevMode ? [{ debugName: "elRef" }] : /* istanbul ignore next */ []);
|
|
18962
19000
|
popover = viewChild(PopoverComponent, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
|
|
@@ -18985,13 +19023,11 @@ var DropdownComponent = class DropdownComponent extends LabelledFieldControlBase
|
|
|
18985
19023
|
focusedIndex = signal(-1, ...ngDevMode ? [{ debugName: "focusedIndex" }] : /* istanbul ignore next */ []);
|
|
18986
19024
|
searchTerm = signal("", ...ngDevMode ? [{ debugName: "searchTerm" }] : /* istanbul ignore next */ []);
|
|
18987
19025
|
_formDisabled = signal(false, ...ngDevMode ? [{ debugName: "_formDisabled" }] : /* istanbul ignore next */ []);
|
|
18988
|
-
|
|
18989
|
-
typeaheadTimer;
|
|
19026
|
+
typeahead = new Typeahead();
|
|
18990
19027
|
onChange = () => {};
|
|
18991
19028
|
onTouched = () => {};
|
|
18992
19029
|
constructor() {
|
|
18993
19030
|
super();
|
|
18994
|
-
inject(DestroyRef).onDestroy(() => clearTimeout(this.typeaheadTimer));
|
|
18995
19031
|
afterRenderEffect(() => {
|
|
18996
19032
|
if (this.searchable() && this.popover()?.isPositioned()) untracked(() => this.searchEl()?.nativeElement.focus());
|
|
18997
19033
|
});
|
|
@@ -19074,8 +19110,7 @@ var DropdownComponent = class DropdownComponent extends LabelledFieldControlBase
|
|
|
19074
19110
|
this.isOpen.set(false);
|
|
19075
19111
|
this.focusedIndex.set(-1);
|
|
19076
19112
|
this.searchTerm.set("");
|
|
19077
|
-
this.
|
|
19078
|
-
clearTimeout(this.typeaheadTimer);
|
|
19113
|
+
this.typeahead.reset();
|
|
19079
19114
|
if (searching) this.focus();
|
|
19080
19115
|
}
|
|
19081
19116
|
clear() {
|
|
@@ -19094,7 +19129,7 @@ var DropdownComponent = class DropdownComponent extends LabelledFieldControlBase
|
|
|
19094
19129
|
if (this.isDisabled() || this.readonly()) return;
|
|
19095
19130
|
switch (event.key) {
|
|
19096
19131
|
case " ":
|
|
19097
|
-
if (this.
|
|
19132
|
+
if (this.typeahead.accepts(event)) this.handleTypeahead(event);
|
|
19098
19133
|
else this.selectFocusedOrOpen(event);
|
|
19099
19134
|
break;
|
|
19100
19135
|
case "Enter":
|
|
@@ -19184,25 +19219,13 @@ var DropdownComponent = class DropdownComponent extends LabelledFieldControlBase
|
|
|
19184
19219
|
document.getElementById(`${this.id()}-option-${idx}`)?.scrollIntoView({ block: "nearest" });
|
|
19185
19220
|
}
|
|
19186
19221
|
handleTypeahead(event) {
|
|
19187
|
-
if (!
|
|
19222
|
+
if (!this.typeahead.accepts(event)) return;
|
|
19188
19223
|
event.preventDefault();
|
|
19189
|
-
if (this.typeaheadTimer !== void 0) clearTimeout(this.typeaheadTimer);
|
|
19190
|
-
this.typeaheadTimer = setTimeout(() => this.typeaheadQuery = "", 500);
|
|
19191
|
-
this.typeaheadQuery += foldForSearch(event.key);
|
|
19192
19224
|
const wasOpen = this.isOpen();
|
|
19193
19225
|
if (!wasOpen) this.toggle();
|
|
19194
|
-
const
|
|
19195
|
-
|
|
19196
|
-
|
|
19197
|
-
const firstOffset = this.typeaheadQuery.length > 1 || !wasOpen ? 0 : 1;
|
|
19198
|
-
for (let offset = firstOffset; offset <= opts.length; offset++) {
|
|
19199
|
-
const idx = (start + offset) % opts.length;
|
|
19200
|
-
const opt = opts[idx];
|
|
19201
|
-
if (!opt.disabled && foldForSearch(opt.label).startsWith(this.typeaheadQuery)) {
|
|
19202
|
-
this.setFocusedIndex(idx);
|
|
19203
|
-
return;
|
|
19204
|
-
}
|
|
19205
|
-
}
|
|
19226
|
+
const labels = this.filteredOptions().map((o) => o.disabled ? null : o.label);
|
|
19227
|
+
const idx = this.typeahead.match(event.key, labels, this.focusedIndex(), !wasOpen);
|
|
19228
|
+
if (idx >= 0) this.setFocusedIndex(idx);
|
|
19206
19229
|
}
|
|
19207
19230
|
moveFocus(delta) {
|
|
19208
19231
|
const opts = this.filteredOptions();
|
|
@@ -32343,6 +32366,7 @@ var TransferListComponent = class TransferListComponent {
|
|
|
32343
32366
|
selectedIds = model([], ...ngDevMode ? [{ debugName: "selectedIds" }] : /* istanbul ignore next */ []);
|
|
32344
32367
|
sourceLabel = input(void 0, ...ngDevMode ? [{ debugName: "sourceLabel" }] : /* istanbul ignore next */ []);
|
|
32345
32368
|
targetLabel = input(void 0, ...ngDevMode ? [{ debugName: "targetLabel" }] : /* istanbul ignore next */ []);
|
|
32369
|
+
headingLevel = input("h3", ...ngDevMode ? [{ debugName: "headingLevel" }] : /* istanbul ignore next */ []);
|
|
32346
32370
|
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
32347
32371
|
disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
32348
32372
|
messages = this.i18n.messages;
|
|
@@ -32554,6 +32578,13 @@ var TransferListComponent = class TransferListComponent {
|
|
|
32554
32578
|
isRequired: false,
|
|
32555
32579
|
transformFunction: null
|
|
32556
32580
|
},
|
|
32581
|
+
headingLevel: {
|
|
32582
|
+
classPropertyName: "headingLevel",
|
|
32583
|
+
publicName: "headingLevel",
|
|
32584
|
+
isSignal: true,
|
|
32585
|
+
isRequired: false,
|
|
32586
|
+
transformFunction: null
|
|
32587
|
+
},
|
|
32557
32588
|
size: {
|
|
32558
32589
|
classPropertyName: "size",
|
|
32559
32590
|
publicName: "size",
|
|
@@ -32571,7 +32602,7 @@ var TransferListComponent = class TransferListComponent {
|
|
|
32571
32602
|
},
|
|
32572
32603
|
outputs: { selectedIds: "selectedIdsChange" },
|
|
32573
32604
|
ngImport: i0,
|
|
32574
|
-
template: "<div [class]=\"hostClasses()\">\n <div class=\"ea-transfer-list__pane\">\n @if (resolvedSourceLabel()) {\n <
|
|
32605
|
+
template: "<div [class]=\"hostClasses()\">\n <div class=\"ea-transfer-list__pane\">\n @if (resolvedSourceLabel(); as sourceLabel) {\n <ng-container *ngTemplateOutlet=\"paneLabel; context: { $implicit: sourceLabel }\" />\n }\n <ul\n class=\"ea-transfer-list__list\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"resolvedSourceLabel() || messages().transferList.sourceLabel\"\n [attr.aria-disabled]=\"disabled() || null\">\n @for (item of sourceItems(); track item.id) {\n <li\n class=\"ea-transfer-list__item\"\n role=\"option\"\n [attr.aria-selected]=\"isHighlighted('source', item.id)\"\n [attr.aria-disabled]=\"item.disabled || disabled() || null\"\n [class.ea-transfer-list__item--highlighted]=\"isHighlighted('source', item.id)\"\n [class.ea-transfer-list__item--disabled]=\"item.disabled || disabled()\"\n [attr.tabindex]=\"itemTabindex('source', $index, item)\"\n (click)=\"onItemClick('source', item, $event)\"\n (keydown)=\"onItemKeydown($event, 'source', item)\">\n {{ item.label }}\n </li>\n } @empty {\n <li\n class=\"ea-transfer-list__empty\"\n aria-hidden=\"true\">\n {{ messages().transferList.empty }}\n </li>\n }\n </ul>\n </div>\n\n <div\n class=\"ea-transfer-list__buttons\"\n role=\"group\"\n [attr.aria-label]=\"messages().transferList.controlsLabel\">\n <button\n type=\"button\"\n class=\"ea-transfer-list__button\"\n [attr.aria-label]=\"messages().transferList.moveAllToTarget\"\n [disabled]=\"!canMoveAllRight()\"\n (click)=\"moveAllRight()\">\n <ea-icon-chevrons-right class=\"ea-rtl-flip\" />\n </button>\n <button\n type=\"button\"\n class=\"ea-transfer-list__button\"\n [attr.aria-label]=\"messages().transferList.moveSelectedToTarget\"\n [disabled]=\"!canMoveRight()\"\n (click)=\"moveSelectedRight()\">\n <ea-icon-chevron-right class=\"ea-rtl-flip\" />\n </button>\n <button\n type=\"button\"\n class=\"ea-transfer-list__button\"\n [attr.aria-label]=\"messages().transferList.moveSelectedToSource\"\n [disabled]=\"!canMoveLeft()\"\n (click)=\"moveSelectedLeft()\">\n <ea-icon-chevron-left class=\"ea-rtl-flip\" />\n </button>\n <button\n type=\"button\"\n class=\"ea-transfer-list__button\"\n [attr.aria-label]=\"messages().transferList.moveAllToSource\"\n [disabled]=\"!canMoveAllLeft()\"\n (click)=\"moveAllLeft()\">\n <ea-icon-chevrons-left class=\"ea-rtl-flip\" />\n </button>\n </div>\n\n <div class=\"ea-transfer-list__pane\">\n @if (resolvedTargetLabel(); as targetLabel) {\n <ng-container *ngTemplateOutlet=\"paneLabel; context: { $implicit: targetLabel }\" />\n }\n <ul\n class=\"ea-transfer-list__list\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"resolvedTargetLabel() || messages().transferList.targetLabel\"\n [attr.aria-disabled]=\"disabled() || null\">\n @for (item of targetItems(); track item.id) {\n <li\n class=\"ea-transfer-list__item\"\n role=\"option\"\n [attr.aria-selected]=\"isHighlighted('target', item.id)\"\n [attr.aria-disabled]=\"item.disabled || disabled() || null\"\n [class.ea-transfer-list__item--highlighted]=\"isHighlighted('target', item.id)\"\n [class.ea-transfer-list__item--disabled]=\"item.disabled || disabled()\"\n [attr.tabindex]=\"itemTabindex('target', $index, item)\"\n (click)=\"onItemClick('target', item, $event)\"\n (keydown)=\"onItemKeydown($event, 'target', item)\">\n {{ item.label }}\n </li>\n } @empty {\n <li\n class=\"ea-transfer-list__empty\"\n aria-hidden=\"true\">\n {{ messages().transferList.empty }}\n </li>\n }\n </ul>\n </div>\n\n <p\n class=\"ea-transfer-list__announcement\"\n role=\"status\">\n {{ announcement() }}\n </p>\n</div>\n\n<ng-template\n #paneLabel\n let-text>\n @switch (headingLevel()) {\n @case ('h2') {\n <h2 class=\"ea-transfer-list__pane-label\">{{ text }}</h2>\n }\n @case ('h3') {\n <h3 class=\"ea-transfer-list__pane-label\">{{ text }}</h3>\n }\n @case ('h4') {\n <h4 class=\"ea-transfer-list__pane-label\">{{ text }}</h4>\n }\n @case ('h5') {\n <h5 class=\"ea-transfer-list__pane-label\">{{ text }}</h5>\n }\n @case ('h6') {\n <h6 class=\"ea-transfer-list__pane-label\">{{ text }}</h6>\n }\n @default {\n <h3 class=\"ea-transfer-list__pane-label\">{{ text }}</h3>\n }\n }\n</ng-template>\n",
|
|
32575
32606
|
styles: [":host{display:block}.ea-transfer-list{display:grid;grid-template-columns:1fr auto 1fr;gap:.75em;color:var(--color-text-primary)}.ea-transfer-list__pane{display:flex;flex-direction:column;gap:.5em;min-width:6em}.ea-transfer-list__pane-label{margin:0;font-size:.875em;font-weight:var(--font-weight-medium);color:var(--color-text-secondary)}.ea-transfer-list__list{display:flex;flex:1;flex-direction:column;gap:2px;min-height:10em;padding:.25em;margin:0;overflow-y:auto;border:var(--border-width-thin) solid var(--color-border-default);border-radius:var(--radius-md);background-color:var(--color-bg-base);list-style:none}.ea-transfer-list__list:focus-visible{outline:none}.ea-transfer-list__item{padding:.5em .75em;border-radius:var(--radius-sm);cursor:pointer;transition:var(--transition-colors);-webkit-user-select:none;user-select:none}.ea-transfer-list__item:hover:not(.ea-transfer-list__item--disabled){background-color:var(--color-state-hover)}.ea-transfer-list__item:focus-visible{outline:none;outline:var(--border-width-medium) solid var(--color-border-focus);outline-offset:calc(-2 * var(--border-width-medium))}@media(forced-colors:active){.ea-transfer-list__item:focus-visible{outline-color:Highlight}}.ea-transfer-list__item--highlighted{background-color:var(--color-brand-subtle, var(--color-state-hover));color:var(--color-text-primary)}@media(forced-colors:active){.ea-transfer-list__item--highlighted{background-color:Highlight;color:HighlightText}}.ea-transfer-list__item--disabled{opacity:.5;cursor:default}.ea-transfer-list__empty{padding:.75em;font-size:inherit;text-align:center;color:var(--color-text-tertiary);-webkit-user-select:none;user-select:none}.ea-transfer-list__buttons{display:flex;flex-direction:column;align-self:center;gap:.5em}.ea-transfer-list__button{position:relative;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ea-icon-button-size, 1.75em);height:var(--ea-icon-button-size, 1.75em);padding:0;border:none;border-radius:var(--radius-sm);background:none;color:var(--color-text-secondary);cursor:pointer;transition:var(--transition-colors)}.ea-transfer-list__button>*{font-size:1.25em}.ea-transfer-list__button:after{content:\"\";position:absolute;top:50%;left:50%;width:max(100%,var(--ea-icon-button-target, 24px));height:max(100%,var(--ea-icon-button-target, 24px));transform:translate(-50%,-50%)}.ea-transfer-list__button:hover{background-color:var(--color-state-hover);color:var(--color-text-primary)}.ea-transfer-list__button:focus-visible{outline:none;outline:var(--border-width-medium) solid var(--color-border-focus);outline-offset:2px}@media(forced-colors:active){.ea-transfer-list__button:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-transfer-list__button:disabled{cursor:default;opacity:.5}.ea-transfer-list__button{--ea-icon-button-size: 2em;border:var(--border-width-thin) solid var(--color-border-default);border-radius:var(--radius-md);background-color:var(--color-bg-base);color:var(--color-text-primary)}.ea-transfer-list__button:hover:not(:disabled){border-color:var(--color-border-strong)}.ea-transfer-list--2xs{font-size:var(--font-size-2xs)}.ea-transfer-list--xs{font-size:var(--font-size-xs)}.ea-transfer-list--sm{font-size:var(--font-size-sm)}.ea-transfer-list--md{font-size:var(--font-size-md)}.ea-transfer-list--lg{font-size:var(--font-size-lg)}.ea-transfer-list--xl{font-size:var(--font-size-xl)}.ea-transfer-list--disabled{pointer-events:none;opacity:.6}.ea-transfer-list__announcement{position:absolute;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);width:1px;height:1px;padding:0;margin:-1px;white-space:nowrap;border:0}\n"],
|
|
32576
32607
|
dependencies: [
|
|
32577
32608
|
{
|
|
@@ -32593,6 +32624,16 @@ var TransferListComponent = class TransferListComponent {
|
|
|
32593
32624
|
kind: "component",
|
|
32594
32625
|
type: ChevronsRightIconComponent,
|
|
32595
32626
|
selector: "ea-icon-chevrons-right"
|
|
32627
|
+
},
|
|
32628
|
+
{
|
|
32629
|
+
kind: "directive",
|
|
32630
|
+
type: NgTemplateOutlet,
|
|
32631
|
+
selector: "[ngTemplateOutlet]",
|
|
32632
|
+
inputs: [
|
|
32633
|
+
"ngTemplateOutletContext",
|
|
32634
|
+
"ngTemplateOutlet",
|
|
32635
|
+
"ngTemplateOutletInjector"
|
|
32636
|
+
]
|
|
32596
32637
|
}
|
|
32597
32638
|
],
|
|
32598
32639
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
@@ -32612,9 +32653,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
32612
32653
|
ChevronLeftIconComponent,
|
|
32613
32654
|
ChevronRightIconComponent,
|
|
32614
32655
|
ChevronsLeftIconComponent,
|
|
32615
|
-
ChevronsRightIconComponent
|
|
32656
|
+
ChevronsRightIconComponent,
|
|
32657
|
+
NgTemplateOutlet
|
|
32616
32658
|
],
|
|
32617
|
-
template: "<div [class]=\"hostClasses()\">\n <div class=\"ea-transfer-list__pane\">\n @if (resolvedSourceLabel()) {\n <
|
|
32659
|
+
template: "<div [class]=\"hostClasses()\">\n <div class=\"ea-transfer-list__pane\">\n @if (resolvedSourceLabel(); as sourceLabel) {\n <ng-container *ngTemplateOutlet=\"paneLabel; context: { $implicit: sourceLabel }\" />\n }\n <ul\n class=\"ea-transfer-list__list\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"resolvedSourceLabel() || messages().transferList.sourceLabel\"\n [attr.aria-disabled]=\"disabled() || null\">\n @for (item of sourceItems(); track item.id) {\n <li\n class=\"ea-transfer-list__item\"\n role=\"option\"\n [attr.aria-selected]=\"isHighlighted('source', item.id)\"\n [attr.aria-disabled]=\"item.disabled || disabled() || null\"\n [class.ea-transfer-list__item--highlighted]=\"isHighlighted('source', item.id)\"\n [class.ea-transfer-list__item--disabled]=\"item.disabled || disabled()\"\n [attr.tabindex]=\"itemTabindex('source', $index, item)\"\n (click)=\"onItemClick('source', item, $event)\"\n (keydown)=\"onItemKeydown($event, 'source', item)\">\n {{ item.label }}\n </li>\n } @empty {\n <li\n class=\"ea-transfer-list__empty\"\n aria-hidden=\"true\">\n {{ messages().transferList.empty }}\n </li>\n }\n </ul>\n </div>\n\n <div\n class=\"ea-transfer-list__buttons\"\n role=\"group\"\n [attr.aria-label]=\"messages().transferList.controlsLabel\">\n <button\n type=\"button\"\n class=\"ea-transfer-list__button\"\n [attr.aria-label]=\"messages().transferList.moveAllToTarget\"\n [disabled]=\"!canMoveAllRight()\"\n (click)=\"moveAllRight()\">\n <ea-icon-chevrons-right class=\"ea-rtl-flip\" />\n </button>\n <button\n type=\"button\"\n class=\"ea-transfer-list__button\"\n [attr.aria-label]=\"messages().transferList.moveSelectedToTarget\"\n [disabled]=\"!canMoveRight()\"\n (click)=\"moveSelectedRight()\">\n <ea-icon-chevron-right class=\"ea-rtl-flip\" />\n </button>\n <button\n type=\"button\"\n class=\"ea-transfer-list__button\"\n [attr.aria-label]=\"messages().transferList.moveSelectedToSource\"\n [disabled]=\"!canMoveLeft()\"\n (click)=\"moveSelectedLeft()\">\n <ea-icon-chevron-left class=\"ea-rtl-flip\" />\n </button>\n <button\n type=\"button\"\n class=\"ea-transfer-list__button\"\n [attr.aria-label]=\"messages().transferList.moveAllToSource\"\n [disabled]=\"!canMoveAllLeft()\"\n (click)=\"moveAllLeft()\">\n <ea-icon-chevrons-left class=\"ea-rtl-flip\" />\n </button>\n </div>\n\n <div class=\"ea-transfer-list__pane\">\n @if (resolvedTargetLabel(); as targetLabel) {\n <ng-container *ngTemplateOutlet=\"paneLabel; context: { $implicit: targetLabel }\" />\n }\n <ul\n class=\"ea-transfer-list__list\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"resolvedTargetLabel() || messages().transferList.targetLabel\"\n [attr.aria-disabled]=\"disabled() || null\">\n @for (item of targetItems(); track item.id) {\n <li\n class=\"ea-transfer-list__item\"\n role=\"option\"\n [attr.aria-selected]=\"isHighlighted('target', item.id)\"\n [attr.aria-disabled]=\"item.disabled || disabled() || null\"\n [class.ea-transfer-list__item--highlighted]=\"isHighlighted('target', item.id)\"\n [class.ea-transfer-list__item--disabled]=\"item.disabled || disabled()\"\n [attr.tabindex]=\"itemTabindex('target', $index, item)\"\n (click)=\"onItemClick('target', item, $event)\"\n (keydown)=\"onItemKeydown($event, 'target', item)\">\n {{ item.label }}\n </li>\n } @empty {\n <li\n class=\"ea-transfer-list__empty\"\n aria-hidden=\"true\">\n {{ messages().transferList.empty }}\n </li>\n }\n </ul>\n </div>\n\n <p\n class=\"ea-transfer-list__announcement\"\n role=\"status\">\n {{ announcement() }}\n </p>\n</div>\n\n<ng-template\n #paneLabel\n let-text>\n @switch (headingLevel()) {\n @case ('h2') {\n <h2 class=\"ea-transfer-list__pane-label\">{{ text }}</h2>\n }\n @case ('h3') {\n <h3 class=\"ea-transfer-list__pane-label\">{{ text }}</h3>\n }\n @case ('h4') {\n <h4 class=\"ea-transfer-list__pane-label\">{{ text }}</h4>\n }\n @case ('h5') {\n <h5 class=\"ea-transfer-list__pane-label\">{{ text }}</h5>\n }\n @case ('h6') {\n <h6 class=\"ea-transfer-list__pane-label\">{{ text }}</h6>\n }\n @default {\n <h3 class=\"ea-transfer-list__pane-label\">{{ text }}</h3>\n }\n }\n</ng-template>\n",
|
|
32618
32660
|
styles: [":host{display:block}.ea-transfer-list{display:grid;grid-template-columns:1fr auto 1fr;gap:.75em;color:var(--color-text-primary)}.ea-transfer-list__pane{display:flex;flex-direction:column;gap:.5em;min-width:6em}.ea-transfer-list__pane-label{margin:0;font-size:.875em;font-weight:var(--font-weight-medium);color:var(--color-text-secondary)}.ea-transfer-list__list{display:flex;flex:1;flex-direction:column;gap:2px;min-height:10em;padding:.25em;margin:0;overflow-y:auto;border:var(--border-width-thin) solid var(--color-border-default);border-radius:var(--radius-md);background-color:var(--color-bg-base);list-style:none}.ea-transfer-list__list:focus-visible{outline:none}.ea-transfer-list__item{padding:.5em .75em;border-radius:var(--radius-sm);cursor:pointer;transition:var(--transition-colors);-webkit-user-select:none;user-select:none}.ea-transfer-list__item:hover:not(.ea-transfer-list__item--disabled){background-color:var(--color-state-hover)}.ea-transfer-list__item:focus-visible{outline:none;outline:var(--border-width-medium) solid var(--color-border-focus);outline-offset:calc(-2 * var(--border-width-medium))}@media(forced-colors:active){.ea-transfer-list__item:focus-visible{outline-color:Highlight}}.ea-transfer-list__item--highlighted{background-color:var(--color-brand-subtle, var(--color-state-hover));color:var(--color-text-primary)}@media(forced-colors:active){.ea-transfer-list__item--highlighted{background-color:Highlight;color:HighlightText}}.ea-transfer-list__item--disabled{opacity:.5;cursor:default}.ea-transfer-list__empty{padding:.75em;font-size:inherit;text-align:center;color:var(--color-text-tertiary);-webkit-user-select:none;user-select:none}.ea-transfer-list__buttons{display:flex;flex-direction:column;align-self:center;gap:.5em}.ea-transfer-list__button{position:relative;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ea-icon-button-size, 1.75em);height:var(--ea-icon-button-size, 1.75em);padding:0;border:none;border-radius:var(--radius-sm);background:none;color:var(--color-text-secondary);cursor:pointer;transition:var(--transition-colors)}.ea-transfer-list__button>*{font-size:1.25em}.ea-transfer-list__button:after{content:\"\";position:absolute;top:50%;left:50%;width:max(100%,var(--ea-icon-button-target, 24px));height:max(100%,var(--ea-icon-button-target, 24px));transform:translate(-50%,-50%)}.ea-transfer-list__button:hover{background-color:var(--color-state-hover);color:var(--color-text-primary)}.ea-transfer-list__button:focus-visible{outline:none;outline:var(--border-width-medium) solid var(--color-border-focus);outline-offset:2px}@media(forced-colors:active){.ea-transfer-list__button:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-transfer-list__button:disabled{cursor:default;opacity:.5}.ea-transfer-list__button{--ea-icon-button-size: 2em;border:var(--border-width-thin) solid var(--color-border-default);border-radius:var(--radius-md);background-color:var(--color-bg-base);color:var(--color-text-primary)}.ea-transfer-list__button:hover:not(:disabled){border-color:var(--color-border-strong)}.ea-transfer-list--2xs{font-size:var(--font-size-2xs)}.ea-transfer-list--xs{font-size:var(--font-size-xs)}.ea-transfer-list--sm{font-size:var(--font-size-sm)}.ea-transfer-list--md{font-size:var(--font-size-md)}.ea-transfer-list--lg{font-size:var(--font-size-lg)}.ea-transfer-list--xl{font-size:var(--font-size-xl)}.ea-transfer-list--disabled{pointer-events:none;opacity:.6}.ea-transfer-list__announcement{position:absolute;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);width:1px;height:1px;padding:0;margin:-1px;white-space:nowrap;border:0}\n"]
|
|
32619
32661
|
}]
|
|
32620
32662
|
}],
|
|
@@ -32654,6 +32696,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
32654
32696
|
required: false
|
|
32655
32697
|
}]
|
|
32656
32698
|
}],
|
|
32699
|
+
headingLevel: [{
|
|
32700
|
+
type: i0.Input,
|
|
32701
|
+
args: [{
|
|
32702
|
+
isSignal: true,
|
|
32703
|
+
alias: "headingLevel",
|
|
32704
|
+
required: false
|
|
32705
|
+
}]
|
|
32706
|
+
}],
|
|
32657
32707
|
size: [{
|
|
32658
32708
|
type: i0.Input,
|
|
32659
32709
|
args: [{
|
|
@@ -32944,6 +32994,7 @@ var TreeComponent = class TreeComponent {
|
|
|
32944
32994
|
nodeClick = output();
|
|
32945
32995
|
listEl = viewChild("listEl", ...ngDevMode ? [{ debugName: "listEl" }] : /* istanbul ignore next */ []);
|
|
32946
32996
|
_focusedId = signal(null, ...ngDevMode ? [{ debugName: "_focusedId" }] : /* istanbul ignore next */ []);
|
|
32997
|
+
typeahead = new Typeahead();
|
|
32947
32998
|
expandedSet = computed(() => new Set(this.expandedIds()), ...ngDevMode ? [{ debugName: "expandedSet" }] : /* istanbul ignore next */ []);
|
|
32948
32999
|
focusedId = computed(() => {
|
|
32949
33000
|
const explicit = this._focusedId();
|
|
@@ -32991,6 +33042,13 @@ var TreeComponent = class TreeComponent {
|
|
|
32991
33042
|
if (visible.length === 0) return;
|
|
32992
33043
|
const currentId = this.focusedId();
|
|
32993
33044
|
const currentIdx = currentId ? visible.indexOf(currentId) : -1;
|
|
33045
|
+
if (this.typeahead.accepts(event)) {
|
|
33046
|
+
event.preventDefault();
|
|
33047
|
+
const labels = visible.map((id) => this.findNode(id)?.label ?? null);
|
|
33048
|
+
const idx = this.typeahead.match(event.key, labels, currentIdx);
|
|
33049
|
+
if (idx >= 0) this.focusNode(visible[idx]);
|
|
33050
|
+
return;
|
|
33051
|
+
}
|
|
32994
33052
|
const rtl = isRtl(event.currentTarget);
|
|
32995
33053
|
let key = event.key;
|
|
32996
33054
|
if (rtl && key === "ArrowRight") key = "ArrowLeft";
|