@eagami/ui 5.26.0 → 5.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/eagami-ui.mjs +54 -54
- package/fesm2022/eagami-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/src/styles/_mixins.scss +16 -10
- package/types/eagami-ui.d.ts +17 -12
package/fesm2022/eagami-ui.mjs
CHANGED
|
@@ -7670,11 +7670,14 @@ class CommandPaletteComponent {
|
|
|
7670
7670
|
/**
|
|
7671
7671
|
* Items bucketed by `group`, then flattened back into display order
|
|
7672
7672
|
* (ungrouped items first, then each named group). The matching
|
|
7673
|
-
* `
|
|
7674
|
-
* one-to-one with what the user sees.
|
|
7673
|
+
* `filteredEntries` array follows this same order so `flatIndex` lines up
|
|
7674
|
+
* one-to-one with what the user sees. Each entry resolves its disabled state
|
|
7675
|
+
* once here, so a consumer's `disabledWhen` runs once per match rather than
|
|
7676
|
+
* on every binding read.
|
|
7675
7677
|
*/
|
|
7676
7678
|
groupedItems = computed(() => {
|
|
7677
7679
|
const q = this.query().trim().toLowerCase();
|
|
7680
|
+
const disabledWhen = this.disabledWhen();
|
|
7678
7681
|
const candidates = this.items().filter(item => {
|
|
7679
7682
|
if (!q) {
|
|
7680
7683
|
return true;
|
|
@@ -7701,7 +7704,11 @@ class CommandPaletteComponent {
|
|
|
7701
7704
|
const pushGroup = (group, items) => {
|
|
7702
7705
|
groups.push({
|
|
7703
7706
|
group,
|
|
7704
|
-
items: items.map(item => ({
|
|
7707
|
+
items: items.map(item => ({
|
|
7708
|
+
item,
|
|
7709
|
+
flatIndex: flatIndex++,
|
|
7710
|
+
disabled: !!item.disabled || !!disabledWhen?.(item),
|
|
7711
|
+
})),
|
|
7705
7712
|
});
|
|
7706
7713
|
};
|
|
7707
7714
|
const ungrouped = buckets.get('');
|
|
@@ -7720,8 +7727,8 @@ class CommandPaletteComponent {
|
|
|
7720
7727
|
* Flat list of matches in display order. Drives keyboard navigation and
|
|
7721
7728
|
* `aria-activedescendant`.
|
|
7722
7729
|
*/
|
|
7723
|
-
|
|
7724
|
-
...(ngDevMode ? [{ debugName: "
|
|
7730
|
+
filteredEntries = computed(() => this.groupedItems().flatMap(group => group.items), /* @ts-ignore */
|
|
7731
|
+
...(ngDevMode ? [{ debugName: "filteredEntries" }] : /* istanbul ignore next */ []));
|
|
7725
7732
|
_activeIndex = signal(0, /* @ts-ignore */
|
|
7726
7733
|
...(ngDevMode ? [{ debugName: "_activeIndex" }] : /* istanbul ignore next */ []));
|
|
7727
7734
|
/**
|
|
@@ -7738,35 +7745,23 @@ class CommandPaletteComponent {
|
|
|
7738
7745
|
interaction = signal('keyboard', /* @ts-ignore */
|
|
7739
7746
|
...(ngDevMode ? [{ debugName: "interaction" }] : /* istanbul ignore next */ []));
|
|
7740
7747
|
activeIndex = computed(() => {
|
|
7741
|
-
const
|
|
7742
|
-
if (
|
|
7748
|
+
const entries = this.filteredEntries();
|
|
7749
|
+
if (entries.length === 0) {
|
|
7743
7750
|
return -1;
|
|
7744
7751
|
}
|
|
7745
7752
|
// Open/filter resets pin the index at 0, which may be a disabled row;
|
|
7746
7753
|
// resolve to the nearest enabled one, preferring the next row down
|
|
7747
|
-
const start = Math.min(this._activeIndex(),
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
}
|
|
7751
|
-
for (let idx = start + 1; idx < items.length; idx++) {
|
|
7752
|
-
if (!this.isItemDisabled(items[idx])) {
|
|
7753
|
-
return idx;
|
|
7754
|
-
}
|
|
7755
|
-
}
|
|
7756
|
-
for (let idx = start - 1; idx >= 0; idx--) {
|
|
7757
|
-
if (!this.isItemDisabled(items[idx])) {
|
|
7758
|
-
return idx;
|
|
7759
|
-
}
|
|
7760
|
-
}
|
|
7761
|
-
return -1;
|
|
7754
|
+
const start = Math.min(this._activeIndex(), entries.length - 1);
|
|
7755
|
+
const forward = this.firstEnabled(start, 1);
|
|
7756
|
+
return forward >= 0 ? forward : this.firstEnabled(start - 1, -1);
|
|
7762
7757
|
}, /* @ts-ignore */
|
|
7763
7758
|
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
7764
7759
|
activeId = computed(() => {
|
|
7765
7760
|
const idx = this.activeIndex();
|
|
7766
7761
|
if (idx < 0) {
|
|
7767
|
-
return
|
|
7762
|
+
return undefined;
|
|
7768
7763
|
}
|
|
7769
|
-
return `ea-command-palette-item-${this.
|
|
7764
|
+
return `ea-command-palette-item-${this.filteredEntries()[idx].item.id}`;
|
|
7770
7765
|
}, /* @ts-ignore */
|
|
7771
7766
|
...(ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []));
|
|
7772
7767
|
constructor() {
|
|
@@ -7796,8 +7791,15 @@ class CommandPaletteComponent {
|
|
|
7796
7791
|
itemDomId(item) {
|
|
7797
7792
|
return `ea-command-palette-item-${item.id}`;
|
|
7798
7793
|
}
|
|
7799
|
-
|
|
7800
|
-
|
|
7794
|
+
/** Index of the first enabled entry from `start`, walking in `step`; -1 when none. */
|
|
7795
|
+
firstEnabled(start, step) {
|
|
7796
|
+
const entries = this.filteredEntries();
|
|
7797
|
+
for (let idx = start; idx >= 0 && idx < entries.length; idx += step) {
|
|
7798
|
+
if (!entries[idx].disabled) {
|
|
7799
|
+
return idx;
|
|
7800
|
+
}
|
|
7801
|
+
}
|
|
7802
|
+
return -1;
|
|
7801
7803
|
}
|
|
7802
7804
|
isActive(flatIndex) {
|
|
7803
7805
|
return this.activeIndex() === flatIndex;
|
|
@@ -7819,7 +7821,12 @@ class CommandPaletteComponent {
|
|
|
7819
7821
|
this.interaction.set('keyboard');
|
|
7820
7822
|
}
|
|
7821
7823
|
onSearchKeydown(event) {
|
|
7822
|
-
|
|
7824
|
+
/* Bound on the field host, which also contains the clear button; keys
|
|
7825
|
+
pressed there must reach the button rather than drive the list. */
|
|
7826
|
+
if (event.target !== this.searchEl()?.inputEl()?.nativeElement) {
|
|
7827
|
+
return;
|
|
7828
|
+
}
|
|
7829
|
+
if (this.filteredEntries().length === 0) {
|
|
7823
7830
|
return;
|
|
7824
7831
|
}
|
|
7825
7832
|
switch (event.key) {
|
|
@@ -7845,9 +7852,9 @@ class CommandPaletteComponent {
|
|
|
7845
7852
|
}
|
|
7846
7853
|
case 'Enter': {
|
|
7847
7854
|
event.preventDefault();
|
|
7848
|
-
const
|
|
7849
|
-
if (
|
|
7850
|
-
this.executeItem(
|
|
7855
|
+
const entry = this.filteredEntries()[this.activeIndex()];
|
|
7856
|
+
if (entry) {
|
|
7857
|
+
this.executeItem(entry);
|
|
7851
7858
|
}
|
|
7852
7859
|
break;
|
|
7853
7860
|
}
|
|
@@ -7855,11 +7862,11 @@ class CommandPaletteComponent {
|
|
|
7855
7862
|
}
|
|
7856
7863
|
/** Wrapping arrow-key move that skips disabled items. */
|
|
7857
7864
|
moveActive(delta) {
|
|
7858
|
-
const
|
|
7865
|
+
const entries = this.filteredEntries();
|
|
7859
7866
|
let idx = this.activeIndex();
|
|
7860
|
-
for (let i = 0; i <
|
|
7861
|
-
idx = (idx + delta +
|
|
7862
|
-
if (!
|
|
7867
|
+
for (let i = 0; i < entries.length; i++) {
|
|
7868
|
+
idx = (idx + delta + entries.length) % entries.length;
|
|
7869
|
+
if (!entries[idx].disabled) {
|
|
7863
7870
|
this.setActiveByKeyboard(idx);
|
|
7864
7871
|
return;
|
|
7865
7872
|
}
|
|
@@ -7867,12 +7874,9 @@ class CommandPaletteComponent {
|
|
|
7867
7874
|
}
|
|
7868
7875
|
/** Home/End move to the first enabled item from the given end. */
|
|
7869
7876
|
edgeActive(direction) {
|
|
7870
|
-
const
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
idx += direction;
|
|
7874
|
-
}
|
|
7875
|
-
if (idx >= 0 && idx < items.length) {
|
|
7877
|
+
const start = direction === 1 ? 0 : this.filteredEntries().length - 1;
|
|
7878
|
+
const idx = this.firstEnabled(start, direction);
|
|
7879
|
+
if (idx >= 0) {
|
|
7876
7880
|
this.setActiveByKeyboard(idx);
|
|
7877
7881
|
}
|
|
7878
7882
|
}
|
|
@@ -7881,18 +7885,14 @@ class CommandPaletteComponent {
|
|
|
7881
7885
|
this.interaction.set('keyboard');
|
|
7882
7886
|
this.scrollActiveIntoView();
|
|
7883
7887
|
}
|
|
7884
|
-
onItemClick(
|
|
7885
|
-
|
|
7886
|
-
return;
|
|
7887
|
-
}
|
|
7888
|
-
this.executeItem(item);
|
|
7888
|
+
onItemClick(entry) {
|
|
7889
|
+
this.executeItem(entry);
|
|
7889
7890
|
}
|
|
7890
|
-
onItemMouseEnter(
|
|
7891
|
-
|
|
7892
|
-
if (!item || this.isItemDisabled(item)) {
|
|
7891
|
+
onItemMouseEnter(entry) {
|
|
7892
|
+
if (entry.disabled) {
|
|
7893
7893
|
return;
|
|
7894
7894
|
}
|
|
7895
|
-
this._activeIndex.set(flatIndex);
|
|
7895
|
+
this._activeIndex.set(entry.flatIndex);
|
|
7896
7896
|
this.interaction.set('mouse');
|
|
7897
7897
|
}
|
|
7898
7898
|
onListMouseLeave() {
|
|
@@ -7917,11 +7917,11 @@ class CommandPaletteComponent {
|
|
|
7917
7917
|
this.open.set(false);
|
|
7918
7918
|
}
|
|
7919
7919
|
}
|
|
7920
|
-
executeItem(
|
|
7921
|
-
if (
|
|
7920
|
+
executeItem(entry) {
|
|
7921
|
+
if (entry.disabled) {
|
|
7922
7922
|
return;
|
|
7923
7923
|
}
|
|
7924
|
-
this.execute.emit(item);
|
|
7924
|
+
this.execute.emit(entry.item);
|
|
7925
7925
|
this.open.set(false);
|
|
7926
7926
|
}
|
|
7927
7927
|
scrollActiveIntoView() {
|
|
@@ -7935,11 +7935,11 @@ class CommandPaletteComponent {
|
|
|
7935
7935
|
});
|
|
7936
7936
|
}
|
|
7937
7937
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CommandPaletteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7938
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: CommandPaletteComponent, isStandalone: true, selector: "ea-command-palette", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, disabledWhen: { classPropertyName: "disabledWhen", publicName: "disabledWhen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", execute: "execute" }, viewQueries: [{ propertyName: "dialogEl", first: true, predicate: ["dialogEl"], descendants: true, isSignal: true }, { propertyName: "searchEl", first: true, predicate: ["searchEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<dialog\n #dialogEl\n class=\"ea-command-palette\"\n [attr.aria-label]=\"messages().commandPalette.dialogLabel\"\n (close)=\"onDialogClose()\"\n (click)=\"onBackdropClick($event)\">\n <div class=\"ea-command-palette__panel\">\n <div class=\"ea-command-palette__search\">\n <ea-input\n #searchEl\n class=\"ea-command-palette__search-input\"\n [icon]=\"searchIcon\"\n [clearable]=\"true\"\n [role]=\"'combobox'\"\n [autocomplete]=\"'off'\"\n [aria-label]=\"resolvedPlaceholder()\"\n [aria-controls]=\"
|
|
7938
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: CommandPaletteComponent, isStandalone: true, selector: "ea-command-palette", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, disabledWhen: { classPropertyName: "disabledWhen", publicName: "disabledWhen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", execute: "execute" }, viewQueries: [{ propertyName: "dialogEl", first: true, predicate: ["dialogEl"], descendants: true, isSignal: true }, { propertyName: "searchEl", first: true, predicate: ["searchEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<dialog\n #dialogEl\n class=\"ea-command-palette\"\n [attr.aria-label]=\"messages().commandPalette.dialogLabel\"\n (close)=\"onDialogClose()\"\n (click)=\"onBackdropClick($event)\">\n <div class=\"ea-command-palette__panel\">\n <div class=\"ea-command-palette__search\">\n <ea-input\n #searchEl\n class=\"ea-command-palette__search-input\"\n [icon]=\"searchIcon\"\n [clearable]=\"true\"\n [role]=\"'combobox'\"\n [autocomplete]=\"'off'\"\n [aria-label]=\"resolvedPlaceholder()\"\n [aria-controls]=\"filteredEntries().length > 0 ? listboxId : undefined\"\n [aria-expanded]=\"filteredEntries().length > 0\"\n [aria-autocomplete]=\"'list'\"\n [aria-activedescendant]=\"activeId()\"\n [placeholder]=\"resolvedPlaceholder()\"\n [value]=\"query()\"\n (valueChange)=\"onQueryChange($event)\"\n (keydown)=\"onSearchKeydown($event)\" />\n </div>\n\n @if (filteredEntries().length === 0) {\n <p\n class=\"ea-command-palette__empty\"\n role=\"status\">\n {{ emptyMessage() || messages().commandPalette.empty }}\n </p>\n } @else {\n <ul\n class=\"ea-command-palette__list\"\n role=\"listbox\"\n [id]=\"listboxId\"\n (mouseleave)=\"onListMouseLeave()\">\n @for (group of groupedItems(); track group.group; let gi = $index) {\n @if (group.group) {\n <li\n class=\"ea-command-palette__section\"\n role=\"presentation\">\n <div\n class=\"ea-command-palette__group\"\n [id]=\"listboxId + '-group-' + gi\">\n {{ group.group }}\n </div>\n <ul\n class=\"ea-command-palette__section-list\"\n role=\"group\"\n [attr.aria-labelledby]=\"listboxId + '-group-' + gi\">\n @for (entry of group.items; track entry.item.id) {\n <ng-container\n *ngTemplateOutlet=\"optionTpl; context: { $implicit: entry }\" />\n }\n </ul>\n </li>\n } @else {\n @for (entry of group.items; track entry.item.id) {\n <ng-container\n *ngTemplateOutlet=\"optionTpl; context: { $implicit: entry }\" />\n }\n }\n }\n </ul>\n }\n </div>\n</dialog>\n\n<ng-template\n #optionTpl\n let-entry>\n <li\n class=\"ea-command-palette__item\"\n role=\"option\"\n [id]=\"itemDomId(entry.item)\"\n [attr.aria-selected]=\"isActive(entry.flatIndex)\"\n [attr.aria-disabled]=\"entry.disabled || null\"\n [class.ea-command-palette__item--active]=\"showActiveHighlight(entry.flatIndex)\"\n [class.ea-command-palette__item--disabled]=\"entry.disabled\"\n (click)=\"onItemClick(entry)\"\n (mouseenter)=\"onItemMouseEnter(entry)\">\n @if (entry.item.icon; as iconClass) {\n <span\n class=\"ea-command-palette__item-icon\"\n aria-hidden=\"true\">\n <ng-container *ngComponentOutlet=\"iconClass\" />\n </span>\n }\n <span class=\"ea-command-palette__item-text\">\n <span class=\"ea-command-palette__item-label\">\n {{ entry.item.label }}\n </span>\n @if (entry.item.description) {\n <span class=\"ea-command-palette__item-description\">\n {{ entry.item.description }}\n </span>\n }\n </span>\n @if (entry.item.shortcut) {\n <kbd class=\"ea-command-palette__item-shortcut\">\n {{ entry.item.shortcut }}\n </kbd>\n }\n </li>\n</ng-template>\n", styles: [".ea-command-palette{position:fixed;top:15vh;left:50%;transform:translate(-50%);width:min(640px,100vw - var(--space-8));max-height:70vh;padding:0;border:none;border-radius:var(--radius-lg);background:transparent;color:var(--color-text-primary)}.ea-command-palette::backdrop{background-color:var(--color-bg-overlay)}.ea-command-palette__panel{display:flex;flex-direction:column;max-height:70vh;overflow:hidden;border:var(--border-width-thin) solid var(--color-border-default);border-radius:var(--radius-lg);box-shadow:var(--shadow-xl);background-color:var(--ea-command-palette-background-color, var(--color-bg-elevated))}@media(forced-colors:active){.ea-command-palette__panel{border:1px solid CanvasText}}.ea-command-palette__search{position:relative;padding:var(--space-3) var(--space-4)}.ea-command-palette__search:after{position:absolute;bottom:0;inset-inline-end:var(--space-1);inset-inline-start:var(--space-1);height:var(--border-width-thin);background-color:var(--color-divider);content:\"\"}.ea-command-palette__search-input{display:block}.ea-command-palette__list{flex:1;padding:var(--space-1);margin:0;overflow-y:auto;list-style:none}.ea-command-palette__section{position:relative;margin-top:var(--space-3)}.ea-command-palette__section:before{position:absolute;top:0;inset-inline-end:0;inset-inline-start:0;height:var(--border-width-thin);background-color:var(--color-divider);content:\"\"}.ea-command-palette__section:first-child{margin-top:0}.ea-command-palette__section:first-child:before{display:none}.ea-command-palette__section-list{padding:0;margin:0;list-style:none}.ea-command-palette__group{padding:var(--space-2) var(--space-3) var(--space-1);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);text-transform:uppercase;letter-spacing:.08em;color:var(--color-text-tertiary);-webkit-user-select:none;user-select:none}.ea-command-palette__item{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);cursor:pointer;transition:var(--transition-colors);-webkit-user-select:none;user-select:none}.ea-command-palette__item:hover:not(.ea-command-palette__item--disabled){background-color:var(--color-state-hover)}.ea-command-palette__item--active{background-color:var(--color-state-active)}@media(forced-colors:active){.ea-command-palette__item--active{background-color:Highlight;color:HighlightText}.ea-command-palette__item--active .ea-command-palette__item-icon,.ea-command-palette__item--active .ea-command-palette__item-description{color:HighlightText}}.ea-command-palette__item--disabled{opacity:.5;cursor:not-allowed}.ea-command-palette__item-icon{display:inline-flex;align-items:center;justify-content:center;width:1em;height:1em;flex-shrink:0;color:var(--color-text-secondary)}.ea-command-palette__item-text{display:flex;flex:1;flex-direction:column;min-width:0}.ea-command-palette__item-label{font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ea-command-palette__item-description{font-size:var(--font-size-xs);color:var(--color-text-secondary);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ea-command-palette__item-shortcut{flex-shrink:0;padding:var(--space-1) var(--space-2);font-size:var(--font-size-xs);font-family:var(--font-family-mono);border:var(--border-width-thin) solid var(--color-border-default);border-radius:var(--radius-sm);background-color:var(--ea-command-palette-background-color, var(--color-bg-elevated));color:var(--color-text-secondary)}.ea-command-palette__empty{padding:var(--space-6) var(--space-4);margin:0;font-size:var(--font-size-sm);text-align:center;color:var(--color-text-tertiary)}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: InputComponent, selector: "ea-input", inputs: ["label", "aria-label", "role", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-autocomplete", "type", "placeholder", "icon", "keepIcon", "size", "hint", "errorMsg", "errorMessages", "disabled", "readonly", "required", "autocomplete", "list", "min", "max", "step", "maxLength", "minLength", "autofocus", "showPasswordToggle", "clearable", "id", "value"], outputs: ["valueChange", "focused", "blurred"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
7939
7939
|
}
|
|
7940
7940
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CommandPaletteComponent, decorators: [{
|
|
7941
7941
|
type: Component,
|
|
7942
|
-
args: [{ selector: 'ea-command-palette', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NgComponentOutlet, NgTemplateOutlet, InputComponent], template: "<dialog\n #dialogEl\n class=\"ea-command-palette\"\n [attr.aria-label]=\"messages().commandPalette.dialogLabel\"\n (close)=\"onDialogClose()\"\n (click)=\"onBackdropClick($event)\">\n <div class=\"ea-command-palette__panel\">\n <div class=\"ea-command-palette__search\">\n <ea-input\n #searchEl\n class=\"ea-command-palette__search-input\"\n [icon]=\"searchIcon\"\n [clearable]=\"true\"\n [role]=\"'combobox'\"\n [autocomplete]=\"'off'\"\n [aria-label]=\"resolvedPlaceholder()\"\n [aria-controls]=\"
|
|
7942
|
+
args: [{ selector: 'ea-command-palette', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NgComponentOutlet, NgTemplateOutlet, InputComponent], template: "<dialog\n #dialogEl\n class=\"ea-command-palette\"\n [attr.aria-label]=\"messages().commandPalette.dialogLabel\"\n (close)=\"onDialogClose()\"\n (click)=\"onBackdropClick($event)\">\n <div class=\"ea-command-palette__panel\">\n <div class=\"ea-command-palette__search\">\n <ea-input\n #searchEl\n class=\"ea-command-palette__search-input\"\n [icon]=\"searchIcon\"\n [clearable]=\"true\"\n [role]=\"'combobox'\"\n [autocomplete]=\"'off'\"\n [aria-label]=\"resolvedPlaceholder()\"\n [aria-controls]=\"filteredEntries().length > 0 ? listboxId : undefined\"\n [aria-expanded]=\"filteredEntries().length > 0\"\n [aria-autocomplete]=\"'list'\"\n [aria-activedescendant]=\"activeId()\"\n [placeholder]=\"resolvedPlaceholder()\"\n [value]=\"query()\"\n (valueChange)=\"onQueryChange($event)\"\n (keydown)=\"onSearchKeydown($event)\" />\n </div>\n\n @if (filteredEntries().length === 0) {\n <p\n class=\"ea-command-palette__empty\"\n role=\"status\">\n {{ emptyMessage() || messages().commandPalette.empty }}\n </p>\n } @else {\n <ul\n class=\"ea-command-palette__list\"\n role=\"listbox\"\n [id]=\"listboxId\"\n (mouseleave)=\"onListMouseLeave()\">\n @for (group of groupedItems(); track group.group; let gi = $index) {\n @if (group.group) {\n <li\n class=\"ea-command-palette__section\"\n role=\"presentation\">\n <div\n class=\"ea-command-palette__group\"\n [id]=\"listboxId + '-group-' + gi\">\n {{ group.group }}\n </div>\n <ul\n class=\"ea-command-palette__section-list\"\n role=\"group\"\n [attr.aria-labelledby]=\"listboxId + '-group-' + gi\">\n @for (entry of group.items; track entry.item.id) {\n <ng-container\n *ngTemplateOutlet=\"optionTpl; context: { $implicit: entry }\" />\n }\n </ul>\n </li>\n } @else {\n @for (entry of group.items; track entry.item.id) {\n <ng-container\n *ngTemplateOutlet=\"optionTpl; context: { $implicit: entry }\" />\n }\n }\n }\n </ul>\n }\n </div>\n</dialog>\n\n<ng-template\n #optionTpl\n let-entry>\n <li\n class=\"ea-command-palette__item\"\n role=\"option\"\n [id]=\"itemDomId(entry.item)\"\n [attr.aria-selected]=\"isActive(entry.flatIndex)\"\n [attr.aria-disabled]=\"entry.disabled || null\"\n [class.ea-command-palette__item--active]=\"showActiveHighlight(entry.flatIndex)\"\n [class.ea-command-palette__item--disabled]=\"entry.disabled\"\n (click)=\"onItemClick(entry)\"\n (mouseenter)=\"onItemMouseEnter(entry)\">\n @if (entry.item.icon; as iconClass) {\n <span\n class=\"ea-command-palette__item-icon\"\n aria-hidden=\"true\">\n <ng-container *ngComponentOutlet=\"iconClass\" />\n </span>\n }\n <span class=\"ea-command-palette__item-text\">\n <span class=\"ea-command-palette__item-label\">\n {{ entry.item.label }}\n </span>\n @if (entry.item.description) {\n <span class=\"ea-command-palette__item-description\">\n {{ entry.item.description }}\n </span>\n }\n </span>\n @if (entry.item.shortcut) {\n <kbd class=\"ea-command-palette__item-shortcut\">\n {{ entry.item.shortcut }}\n </kbd>\n }\n </li>\n</ng-template>\n", styles: [".ea-command-palette{position:fixed;top:15vh;left:50%;transform:translate(-50%);width:min(640px,100vw - var(--space-8));max-height:70vh;padding:0;border:none;border-radius:var(--radius-lg);background:transparent;color:var(--color-text-primary)}.ea-command-palette::backdrop{background-color:var(--color-bg-overlay)}.ea-command-palette__panel{display:flex;flex-direction:column;max-height:70vh;overflow:hidden;border:var(--border-width-thin) solid var(--color-border-default);border-radius:var(--radius-lg);box-shadow:var(--shadow-xl);background-color:var(--ea-command-palette-background-color, var(--color-bg-elevated))}@media(forced-colors:active){.ea-command-palette__panel{border:1px solid CanvasText}}.ea-command-palette__search{position:relative;padding:var(--space-3) var(--space-4)}.ea-command-palette__search:after{position:absolute;bottom:0;inset-inline-end:var(--space-1);inset-inline-start:var(--space-1);height:var(--border-width-thin);background-color:var(--color-divider);content:\"\"}.ea-command-palette__search-input{display:block}.ea-command-palette__list{flex:1;padding:var(--space-1);margin:0;overflow-y:auto;list-style:none}.ea-command-palette__section{position:relative;margin-top:var(--space-3)}.ea-command-palette__section:before{position:absolute;top:0;inset-inline-end:0;inset-inline-start:0;height:var(--border-width-thin);background-color:var(--color-divider);content:\"\"}.ea-command-palette__section:first-child{margin-top:0}.ea-command-palette__section:first-child:before{display:none}.ea-command-palette__section-list{padding:0;margin:0;list-style:none}.ea-command-palette__group{padding:var(--space-2) var(--space-3) var(--space-1);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);text-transform:uppercase;letter-spacing:.08em;color:var(--color-text-tertiary);-webkit-user-select:none;user-select:none}.ea-command-palette__item{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);cursor:pointer;transition:var(--transition-colors);-webkit-user-select:none;user-select:none}.ea-command-palette__item:hover:not(.ea-command-palette__item--disabled){background-color:var(--color-state-hover)}.ea-command-palette__item--active{background-color:var(--color-state-active)}@media(forced-colors:active){.ea-command-palette__item--active{background-color:Highlight;color:HighlightText}.ea-command-palette__item--active .ea-command-palette__item-icon,.ea-command-palette__item--active .ea-command-palette__item-description{color:HighlightText}}.ea-command-palette__item--disabled{opacity:.5;cursor:not-allowed}.ea-command-palette__item-icon{display:inline-flex;align-items:center;justify-content:center;width:1em;height:1em;flex-shrink:0;color:var(--color-text-secondary)}.ea-command-palette__item-text{display:flex;flex:1;flex-direction:column;min-width:0}.ea-command-palette__item-label{font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ea-command-palette__item-description{font-size:var(--font-size-xs);color:var(--color-text-secondary);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ea-command-palette__item-shortcut{flex-shrink:0;padding:var(--space-1) var(--space-2);font-size:var(--font-size-xs);font-family:var(--font-family-mono);border:var(--border-width-thin) solid var(--color-border-default);border-radius:var(--radius-sm);background-color:var(--ea-command-palette-background-color, var(--color-bg-elevated));color:var(--color-text-secondary)}.ea-command-palette__empty{padding:var(--space-6) var(--space-4);margin:0;font-size:var(--font-size-sm);text-align:center;color:var(--color-text-tertiary)}\n"] }]
|
|
7943
7943
|
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], disabledWhen: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledWhen", required: false }] }], execute: [{ type: i0.Output, args: ["execute"] }], dialogEl: [{ type: i0.ViewChild, args: ['dialogEl', { isSignal: true }] }], searchEl: [{ type: i0.ViewChild, args: ['searchEl', { isSignal: true }] }] } });
|
|
7944
7944
|
|
|
7945
7945
|
class DropletIconComponent extends IconComponentBase {
|