@ship-ui/core 0.19.5 → 0.22.2
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 +3 -0
- package/assets/mcp/components.json +66 -4243
- package/bin/mcp/index.js +6027 -273
- package/bin/ship-fg-scanner +0 -0
- package/bin/ship-fg.mjs +14 -12
- package/bin/src/subset.ts +3 -1
- package/fesm2022/ship-ui-core-sh-form-field-experimental.mjs +42 -0
- package/fesm2022/ship-ui-core-sh-form-field-experimental.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-accordion.mjs +127 -0
- package/fesm2022/ship-ui-core-ship-accordion.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-alert.mjs +305 -0
- package/fesm2022/ship-ui-core-ship-alert.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-blueprint.mjs +1156 -0
- package/fesm2022/ship-ui-core-ship-blueprint.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-button-group.mjs +41 -0
- package/fesm2022/ship-ui-core-ship-button-group.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-button.mjs +38 -0
- package/fesm2022/ship-ui-core-ship-button.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-card.mjs +35 -0
- package/fesm2022/ship-ui-core-ship-card.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-checkbox.mjs +113 -0
- package/fesm2022/ship-ui-core-ship-checkbox.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-chip.mjs +44 -0
- package/fesm2022/ship-ui-core-ship-chip.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-color-picker.mjs +947 -0
- package/fesm2022/ship-ui-core-ship-color-picker.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-datepicker.mjs +951 -0
- package/fesm2022/ship-ui-core-ship-datepicker.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-dialog.mjs +263 -0
- package/fesm2022/ship-ui-core-ship-dialog.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-divider.mjs +22 -0
- package/fesm2022/ship-ui-core-ship-divider.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-event-card.mjs +50 -0
- package/fesm2022/ship-ui-core-ship-event-card.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-file-upload.mjs +112 -0
- package/fesm2022/ship-ui-core-ship-file-upload.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-form-field.mjs +310 -0
- package/fesm2022/ship-ui-core-ship-form-field.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-icon.mjs +81 -0
- package/fesm2022/ship-ui-core-ship-icon.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-list.mjs +22 -0
- package/fesm2022/ship-ui-core-ship-list.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-menu.mjs +545 -0
- package/fesm2022/ship-ui-core-ship-menu.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-popover.mjs +286 -0
- package/fesm2022/ship-ui-core-ship-popover.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-progress-bar.mjs +37 -0
- package/fesm2022/ship-ui-core-ship-progress-bar.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-radio.mjs +102 -0
- package/fesm2022/ship-ui-core-ship-radio.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-range-slider.mjs +277 -0
- package/fesm2022/ship-ui-core-ship-range-slider.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-select.mjs +971 -0
- package/fesm2022/ship-ui-core-ship-select.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-sidenav.mjs +248 -0
- package/fesm2022/ship-ui-core-ship-sidenav.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-sortable.mjs +485 -0
- package/fesm2022/ship-ui-core-ship-sortable.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-spinner.mjs +28 -0
- package/fesm2022/ship-ui-core-ship-spinner.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-stepper.mjs +76 -0
- package/fesm2022/ship-ui-core-ship-stepper.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-table-filter-bar.mjs +28 -0
- package/fesm2022/ship-ui-core-ship-table-filter-bar.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-table.mjs +442 -0
- package/fesm2022/ship-ui-core-ship-table.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-tabs.mjs +38 -0
- package/fesm2022/ship-ui-core-ship-tabs.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-theme-toggle.mjs +119 -0
- package/fesm2022/ship-ui-core-ship-theme-toggle.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-toggle-card.mjs +75 -0
- package/fesm2022/ship-ui-core-ship-toggle-card.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-toggle.mjs +105 -0
- package/fesm2022/ship-ui-core-ship-toggle.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-virtual-scroll.mjs +186 -0
- package/fesm2022/ship-ui-core-ship-virtual-scroll.mjs.map +1 -0
- package/fesm2022/ship-ui-core.mjs +880 -8782
- package/fesm2022/ship-ui-core.mjs.map +1 -1
- package/package.json +147 -3
- package/styles/core.scss +43 -0
- package/styles/helpers.scss +2 -0
- package/styles/index.scss +12 -123
- package/types/ship-ui-core-sh-form-field-experimental.d.ts +11 -0
- package/types/ship-ui-core-ship-accordion.d.ts +19 -0
- package/types/ship-ui-core-ship-alert.d.ts +68 -0
- package/types/ship-ui-core-ship-blueprint.d.ts +112 -0
- package/types/ship-ui-core-ship-button-group.d.ts +15 -0
- package/types/ship-ui-core-ship-button.d.ts +13 -0
- package/types/ship-ui-core-ship-card.d.ts +11 -0
- package/types/ship-ui-core-ship-checkbox.d.ts +22 -0
- package/types/ship-ui-core-ship-chip.d.ts +15 -0
- package/types/ship-ui-core-ship-color-picker.d.ts +105 -0
- package/types/ship-ui-core-ship-datepicker.d.ts +96 -0
- package/types/ship-ui-core-ship-dialog.d.ts +76 -0
- package/types/ship-ui-core-ship-divider.d.ts +8 -0
- package/types/ship-ui-core-ship-event-card.d.ts +11 -0
- package/types/ship-ui-core-ship-file-upload.d.ts +20 -0
- package/types/ship-ui-core-ship-form-field.d.ts +32 -0
- package/types/ship-ui-core-ship-icon.d.ts +18 -0
- package/types/ship-ui-core-ship-list.d.ts +8 -0
- package/types/ship-ui-core-ship-menu.d.ts +49 -0
- package/types/ship-ui-core-ship-popover.d.ts +40 -0
- package/types/ship-ui-core-ship-progress-bar.d.ts +14 -0
- package/types/ship-ui-core-ship-radio.d.ts +22 -0
- package/types/ship-ui-core-ship-range-slider.d.ts +31 -0
- package/types/ship-ui-core-ship-select.d.ts +81 -0
- package/types/ship-ui-core-ship-sidenav.d.ts +36 -0
- package/types/ship-ui-core-ship-sortable.d.ts +72 -0
- package/types/ship-ui-core-ship-spinner.d.ts +10 -0
- package/types/ship-ui-core-ship-stepper.d.ts +13 -0
- package/types/ship-ui-core-ship-table-filter-bar.d.ts +8 -0
- package/types/ship-ui-core-ship-table.d.ts +69 -0
- package/types/ship-ui-core-ship-tabs.d.ts +14 -0
- package/types/ship-ui-core-ship-theme-toggle.d.ts +28 -0
- package/types/ship-ui-core-ship-toggle-card.d.ts +15 -0
- package/types/ship-ui-core-ship-toggle.d.ts +21 -0
- package/types/ship-ui-core-ship-virtual-scroll.d.ts +22 -0
- package/types/ship-ui-core.d.ts +88 -1070
- package/styles/components/ship-accordion.scss +0 -113
- package/styles/components/ship-alert-container.scss +0 -49
- package/styles/components/ship-alert.scss +0 -177
- package/styles/components/ship-blueprint.scss +0 -242
- package/styles/components/ship-button-group.scss +0 -165
- package/styles/components/ship-button.scss +0 -141
- package/styles/components/ship-card.scss +0 -57
- package/styles/components/ship-checkbox.scss +0 -116
- package/styles/components/ship-chip.scss +0 -104
- package/styles/components/ship-color-picker.scss +0 -150
- package/styles/components/ship-datepicker.scss +0 -317
- package/styles/components/ship-dialog.scss +0 -152
- package/styles/components/ship-divider.scss +0 -27
- package/styles/components/ship-event-card.scss +0 -51
- package/styles/components/ship-file-upload.scss +0 -47
- package/styles/components/ship-form-field.scss +0 -408
- package/styles/components/ship-icon.scss +0 -54
- package/styles/components/ship-list.scss +0 -165
- package/styles/components/ship-menu.scss +0 -237
- package/styles/components/ship-popover.scss +0 -205
- package/styles/components/ship-progress-bar.scss +0 -173
- package/styles/components/ship-radio.scss +0 -113
- package/styles/components/ship-range-slider.scss +0 -421
- package/styles/components/ship-select.scss +0 -153
- package/styles/components/ship-sidenav.scss +0 -195
- package/styles/components/ship-sortable.scss +0 -45
- package/styles/components/ship-spinner.scss +0 -53
- package/styles/components/ship-stepper.scss +0 -158
- package/styles/components/ship-table.scss +0 -443
- package/styles/components/ship-tabs.scss +0 -125
- package/styles/components/ship-theme-toggle.scss +0 -41
- package/styles/components/ship-toggle-card.scss +0 -69
- package/styles/components/ship-toggle.scss +0 -255
- package/styles/components/ship-tooltip.scss +0 -151
- package/styles/components/ship-virtual-scroll.scss +0 -12
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, DOCUMENT, Renderer2, computed, input, model, output, signal, viewChild, effect, HostListener, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { ShipFormField } from '@ship-ui/core/ship-form-field';
|
|
4
|
+
import { ShipIcon } from '@ship-ui/core/ship-icon';
|
|
5
|
+
import { ShipPopover } from '@ship-ui/core/ship-popover';
|
|
6
|
+
import { observeChildren, createFormInputSignal, generateUniqueId } from '@ship-ui/core';
|
|
7
|
+
|
|
8
|
+
class ShipMenu {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.#document = inject(DOCUMENT);
|
|
11
|
+
this.#renderer = inject(Renderer2);
|
|
12
|
+
this.parentMenu = inject(ShipMenu, { optional: true, skipSelf: true });
|
|
13
|
+
this.isSubmenu = computed(() => this.parentMenu !== null, /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "isSubmenu" }] : /* istanbul ignore next */ []));
|
|
15
|
+
this.asMultiLayer = input(false, /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "asMultiLayer" }] : /* istanbul ignore next */ []));
|
|
17
|
+
this.openIndicator = input(false, /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "openIndicator" }] : /* istanbul ignore next */ []));
|
|
19
|
+
this.disabled = input(false, /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
21
|
+
this.customOptionElementSelectors = input(['button'], /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "customOptionElementSelectors" }] : /* istanbul ignore next */ []));
|
|
23
|
+
this.keepClickedOptionActive = input(false, /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "keepClickedOptionActive" }] : /* istanbul ignore next */ []));
|
|
25
|
+
this.closeOnClick = input(true, /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "closeOnClick" }] : /* istanbul ignore next */ []));
|
|
27
|
+
this.isOpen = model(false, /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
29
|
+
this.closed = output();
|
|
30
|
+
this.searchable = input(false, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
|
|
32
|
+
this.activeOptionIndex = signal(-1, /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "activeOptionIndex" }] : /* istanbul ignore next */ []));
|
|
34
|
+
this.inputRef = viewChild('inputRef', /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []));
|
|
36
|
+
this.optionsRef = viewChild('optionsRef', /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "optionsRef" }] : /* istanbul ignore next */ []));
|
|
38
|
+
this.openMenusEffect = effect((onCleanup) => {
|
|
39
|
+
if (this.isOpen()) {
|
|
40
|
+
ShipMenu.openMenus.push(this);
|
|
41
|
+
}
|
|
42
|
+
onCleanup(() => {
|
|
43
|
+
const index = ShipMenu.openMenus.indexOf(this);
|
|
44
|
+
if (index > -1) {
|
|
45
|
+
ShipMenu.openMenus.splice(index, 1);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}, /* @ts-ignore */
|
|
49
|
+
...(ngDevMode ? [{ debugName: "openMenusEffect" }] : /* istanbul ignore next */ []));
|
|
50
|
+
this.options = observeChildren(this.optionsRef, this.customOptionElementSelectors);
|
|
51
|
+
this.optionsEl = computed(() => {
|
|
52
|
+
const optionsContainer = this.optionsRef()?.nativeElement;
|
|
53
|
+
if (!optionsContainer)
|
|
54
|
+
return [];
|
|
55
|
+
return this.options.signal().filter((x) => {
|
|
56
|
+
if (x.disabled)
|
|
57
|
+
return false;
|
|
58
|
+
return x.closest('.options') === optionsContainer;
|
|
59
|
+
});
|
|
60
|
+
}, /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "optionsEl" }] : /* istanbul ignore next */ []));
|
|
62
|
+
this.inputValue = createFormInputSignal(this.inputRef);
|
|
63
|
+
this.optionsId = generateUniqueId();
|
|
64
|
+
this.activeOptionId = signal(undefined, /* @ts-ignore */
|
|
65
|
+
...(ngDevMode ? [{ debugName: "activeOptionId" }] : /* istanbul ignore next */ []));
|
|
66
|
+
this.abortController = null;
|
|
67
|
+
this.optionsEffect = effect(() => {
|
|
68
|
+
if (this.abortController !== null) {
|
|
69
|
+
this.abortController.abort();
|
|
70
|
+
this.abortController = null;
|
|
71
|
+
}
|
|
72
|
+
if (!this.isOpen())
|
|
73
|
+
return;
|
|
74
|
+
this.abortController = new AbortController();
|
|
75
|
+
const searchable = this.searchable();
|
|
76
|
+
if (!searchable) {
|
|
77
|
+
this.#document.documentElement.addEventListener('keydown', this.keyDownEventListener, {
|
|
78
|
+
signal: this.abortController.signal,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
const inputEl = this.inputRef()?.nativeElement;
|
|
83
|
+
if (inputEl) {
|
|
84
|
+
inputEl.addEventListener('keydown', this.keyDownEventListener, {
|
|
85
|
+
signal: this.abortController.signal,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const inputEl = this.inputRef()?.nativeElement;
|
|
90
|
+
if (!inputEl)
|
|
91
|
+
return;
|
|
92
|
+
queueMicrotask(() => inputEl.focus());
|
|
93
|
+
if (!this.closeOnClick()) {
|
|
94
|
+
const optionRef = this.optionsRef()?.nativeElement;
|
|
95
|
+
optionRef?.addEventListener('click', (e) => {
|
|
96
|
+
const optionEl = e.target;
|
|
97
|
+
let optionElements = this.activeElements();
|
|
98
|
+
if (!optionElements.length) {
|
|
99
|
+
const newOptionElements = this.optionsEl();
|
|
100
|
+
this.activeElements.set(newOptionElements);
|
|
101
|
+
optionElements = newOptionElements;
|
|
102
|
+
}
|
|
103
|
+
const clickedOptionIndex = optionElements.findIndex((x) => x === optionEl);
|
|
104
|
+
if (clickedOptionIndex > -1) {
|
|
105
|
+
this.activeOptionIndex.set(clickedOptionIndex);
|
|
106
|
+
inputEl.focus();
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}, /* @ts-ignore */
|
|
111
|
+
...(ngDevMode ? [{ debugName: "optionsEffect" }] : /* istanbul ignore next */ []));
|
|
112
|
+
this.keyDownEventListener = (e) => {
|
|
113
|
+
// Only handle events if this is the most recently opened menu
|
|
114
|
+
if (ShipMenu.openMenus.at(-1) !== this)
|
|
115
|
+
return;
|
|
116
|
+
const activeOptionIndex = this.activeOptionIndex();
|
|
117
|
+
if (e.key === 'ArrowDown') {
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
this.activeOptionIndex.set(this.nextActiveIndex(activeOptionIndex));
|
|
120
|
+
}
|
|
121
|
+
else if (e.key === 'ArrowUp') {
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
this.activeOptionIndex.set(this.prevActiveIndex(activeOptionIndex));
|
|
124
|
+
}
|
|
125
|
+
else if (e.key === 'ArrowRight') {
|
|
126
|
+
if (activeOptionIndex > -1) {
|
|
127
|
+
const el = this.activeElements()[activeOptionIndex];
|
|
128
|
+
const parent = el.parentElement;
|
|
129
|
+
// For nested menu's
|
|
130
|
+
if (parent?.hasAttribute('trigger')) {
|
|
131
|
+
e.preventDefault();
|
|
132
|
+
const event = new CustomEvent('ship-menu-open', {
|
|
133
|
+
bubbles: true,
|
|
134
|
+
cancelable: true,
|
|
135
|
+
detail: { keyboard: true },
|
|
136
|
+
});
|
|
137
|
+
el.dispatchEvent(event);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else if (e.key === 'ArrowLeft') {
|
|
142
|
+
if (this.isSubmenu()) {
|
|
143
|
+
e.preventDefault();
|
|
144
|
+
this.close('closed');
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else if (e.key === 'Enter') {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
if (activeOptionIndex > -1) {
|
|
150
|
+
const el = this.activeElements()[activeOptionIndex];
|
|
151
|
+
const parent = el.parentElement;
|
|
152
|
+
// For nested menu's
|
|
153
|
+
if (parent?.hasAttribute('trigger')) {
|
|
154
|
+
const event = new CustomEvent('ship-menu-open', {
|
|
155
|
+
bubbles: true,
|
|
156
|
+
cancelable: true,
|
|
157
|
+
detail: { keyboard: true },
|
|
158
|
+
});
|
|
159
|
+
el.dispatchEvent(event);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
el.click();
|
|
163
|
+
if (!el.querySelector('sh-checkbox')) {
|
|
164
|
+
queueMicrotask(() => this.close('active'));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
else if (e.key === 'Tab') {
|
|
170
|
+
let optionElements = this.activeElements();
|
|
171
|
+
if (!optionElements.length) {
|
|
172
|
+
const newOptionElements = this.optionsEl();
|
|
173
|
+
this.activeElements.set(newOptionElements);
|
|
174
|
+
optionElements = newOptionElements;
|
|
175
|
+
}
|
|
176
|
+
if (e.shiftKey) {
|
|
177
|
+
if (activeOptionIndex <= 0) {
|
|
178
|
+
e.preventDefault();
|
|
179
|
+
this.close('closed');
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
e.preventDefault();
|
|
183
|
+
this.activeOptionIndex.set(this.prevActiveIndex(activeOptionIndex));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
if (activeOptionIndex >= optionElements.length - 1) {
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
this.close('closed');
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
e.preventDefault();
|
|
193
|
+
this.activeOptionIndex.set(this.nextActiveIndex(activeOptionIndex));
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
this._lastElementList = [];
|
|
199
|
+
this.activeElements = signal([], /* @ts-ignore */
|
|
200
|
+
...(ngDevMode ? [{ debugName: "activeElements" }] : /* istanbul ignore next */ []));
|
|
201
|
+
this.lastInputValue = '';
|
|
202
|
+
this.inputValueEffect = effect(() => {
|
|
203
|
+
const searchable = this.searchable();
|
|
204
|
+
if (!searchable) {
|
|
205
|
+
this.activeElements.set(this.optionsEl());
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
const inputValue = (this.inputValue() ?? '').toLowerCase();
|
|
209
|
+
this.#resetActiveOption();
|
|
210
|
+
if (!inputValue || inputValue === '') {
|
|
211
|
+
const allOptions = this.optionsEl();
|
|
212
|
+
this.activeElements.set(allOptions);
|
|
213
|
+
this._lastElementList = allOptions;
|
|
214
|
+
for (let i = 0; i < allOptions.length; i++) {
|
|
215
|
+
this.#renderer.removeStyle(allOptions[i], 'order');
|
|
216
|
+
if (!allOptions[i].id) {
|
|
217
|
+
allOptions[i].id = `${this.optionsId}-option-${i}`;
|
|
218
|
+
}
|
|
219
|
+
allOptions[i].setAttribute('role', 'option');
|
|
220
|
+
}
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (!inputValue || inputValue === '')
|
|
224
|
+
return;
|
|
225
|
+
let optionElements = this._lastElementList.length && inputValue.length > this.lastInputValue.length
|
|
226
|
+
? this._lastElementList
|
|
227
|
+
: this.optionsEl();
|
|
228
|
+
this.lastInputValue = inputValue;
|
|
229
|
+
for (let i = 0; i < optionElements.length; i++) {
|
|
230
|
+
const el = optionElements[i];
|
|
231
|
+
const textContent = el.textContent?.toLowerCase() || '';
|
|
232
|
+
const score = this.#calculateMatchScore(textContent, inputValue);
|
|
233
|
+
el.value = score;
|
|
234
|
+
}
|
|
235
|
+
optionElements = optionElements
|
|
236
|
+
.filter((x) => x.value > 0)
|
|
237
|
+
.sort((a, b) => b.value - a.value);
|
|
238
|
+
for (let i = 0; i < optionElements.length; i++) {
|
|
239
|
+
this.#renderer.setStyle(optionElements[i], 'order', i);
|
|
240
|
+
}
|
|
241
|
+
this.activeElements.set(optionElements);
|
|
242
|
+
this._lastElementList = optionElements;
|
|
243
|
+
// Assign IDs to options for ARIA support
|
|
244
|
+
for (let i = 0; i < optionElements.length; i++) {
|
|
245
|
+
if (!optionElements[i].id) {
|
|
246
|
+
optionElements[i].id = `${this.optionsId}-option-${i}`;
|
|
247
|
+
}
|
|
248
|
+
optionElements[i].setAttribute('role', 'option');
|
|
249
|
+
}
|
|
250
|
+
}, /* @ts-ignore */
|
|
251
|
+
...(ngDevMode ? [{ debugName: "inputValueEffect" }] : /* istanbul ignore next */ []));
|
|
252
|
+
this.activeOptionIndexEffect = effect(() => {
|
|
253
|
+
const optionElements = this.activeElements();
|
|
254
|
+
const activeOptionIndex = this.activeOptionIndex();
|
|
255
|
+
for (let index = 0; index < optionElements.length; index++) {
|
|
256
|
+
optionElements[index].classList.remove('active');
|
|
257
|
+
optionElements[index].removeAttribute('aria-selected');
|
|
258
|
+
}
|
|
259
|
+
if (activeOptionIndex > -1) {
|
|
260
|
+
const activeOption = optionElements[activeOptionIndex];
|
|
261
|
+
activeOption.scrollIntoView({ block: 'center' });
|
|
262
|
+
activeOption.classList.add('active');
|
|
263
|
+
activeOption.setAttribute('aria-selected', 'true');
|
|
264
|
+
this.activeOptionId.set(activeOption.id);
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
this.activeOptionId.set(undefined);
|
|
268
|
+
}
|
|
269
|
+
}, /* @ts-ignore */
|
|
270
|
+
...(ngDevMode ? [{ debugName: "activeOptionIndexEffect" }] : /* istanbul ignore next */ []));
|
|
271
|
+
}
|
|
272
|
+
#document;
|
|
273
|
+
#renderer;
|
|
274
|
+
static { this.openMenus = []; }
|
|
275
|
+
toggleIsOpen(event) {
|
|
276
|
+
event.preventDefault();
|
|
277
|
+
event.stopPropagation();
|
|
278
|
+
if (this.disabled())
|
|
279
|
+
return;
|
|
280
|
+
if (this.isOpen()) {
|
|
281
|
+
this.close('fromPopover');
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
this.open();
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
open() {
|
|
288
|
+
if (this.disabled())
|
|
289
|
+
return;
|
|
290
|
+
this.isOpen.set(true);
|
|
291
|
+
if (this.searchable()) {
|
|
292
|
+
setTimeout(() => this.inputRef()?.nativeElement.focus());
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
onShipMenuOpen(event) {
|
|
296
|
+
event.preventDefault();
|
|
297
|
+
event.stopPropagation();
|
|
298
|
+
this.open();
|
|
299
|
+
const customEvent = event;
|
|
300
|
+
if (customEvent.detail?.keyboard) {
|
|
301
|
+
setTimeout(() => {
|
|
302
|
+
this.activeOptionIndex.set(0);
|
|
303
|
+
}, 50);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
#calculateMatchScore(option, input) {
|
|
307
|
+
if (!input)
|
|
308
|
+
return 0;
|
|
309
|
+
let score = 0;
|
|
310
|
+
let lastIndex = -1;
|
|
311
|
+
let matchCount = 0;
|
|
312
|
+
let inSequence = true;
|
|
313
|
+
for (let i = 0; i < input.length; i++) {
|
|
314
|
+
const char = input[i];
|
|
315
|
+
if (option.length > lastIndex + 1 && option[lastIndex + 1] === char) {
|
|
316
|
+
score += i === 0 ? 100 : 150;
|
|
317
|
+
lastIndex++;
|
|
318
|
+
matchCount++;
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
const charIndex = option.indexOf(char, lastIndex + 1);
|
|
322
|
+
if (i > 0) {
|
|
323
|
+
inSequence = false;
|
|
324
|
+
}
|
|
325
|
+
if (charIndex === -1) {
|
|
326
|
+
return 0;
|
|
327
|
+
}
|
|
328
|
+
score += 100;
|
|
329
|
+
lastIndex = charIndex;
|
|
330
|
+
matchCount++;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
if (inSequence && input.length === matchCount) {
|
|
334
|
+
score += 1000;
|
|
335
|
+
}
|
|
336
|
+
score += matchCount * 20;
|
|
337
|
+
return score;
|
|
338
|
+
}
|
|
339
|
+
nextActiveIndex(activeIndex) {
|
|
340
|
+
let optionElements = this.activeElements();
|
|
341
|
+
if (!optionElements.length) {
|
|
342
|
+
const newOptionElements = this.optionsEl();
|
|
343
|
+
this.activeElements.set(newOptionElements);
|
|
344
|
+
optionElements = newOptionElements;
|
|
345
|
+
}
|
|
346
|
+
if (activeIndex === -1) {
|
|
347
|
+
return 0;
|
|
348
|
+
}
|
|
349
|
+
if (activeIndex === optionElements.length - 1) {
|
|
350
|
+
return 0;
|
|
351
|
+
}
|
|
352
|
+
const nextIndex = activeIndex + 1;
|
|
353
|
+
if (optionElements[nextIndex].disabled) {
|
|
354
|
+
return this.nextActiveIndex(nextIndex);
|
|
355
|
+
}
|
|
356
|
+
return nextIndex;
|
|
357
|
+
}
|
|
358
|
+
prevActiveIndex(activeIndex) {
|
|
359
|
+
let optionElements = this.activeElements();
|
|
360
|
+
if (!optionElements.length) {
|
|
361
|
+
const newOptionElements = this.optionsEl();
|
|
362
|
+
this.activeElements.set(newOptionElements);
|
|
363
|
+
optionElements = newOptionElements;
|
|
364
|
+
}
|
|
365
|
+
if (activeIndex === 0) {
|
|
366
|
+
return optionElements.length - 1;
|
|
367
|
+
}
|
|
368
|
+
if (activeIndex === -1) {
|
|
369
|
+
return optionElements.length - 1;
|
|
370
|
+
}
|
|
371
|
+
const prevIndex = activeIndex - 1;
|
|
372
|
+
if (optionElements[prevIndex].disabled) {
|
|
373
|
+
return this.prevActiveIndex(prevIndex);
|
|
374
|
+
}
|
|
375
|
+
return prevIndex;
|
|
376
|
+
}
|
|
377
|
+
close(action = 'closed', event) {
|
|
378
|
+
this.inputValue.set('');
|
|
379
|
+
const inputEl = this.inputRef()?.nativeElement;
|
|
380
|
+
if (inputEl) {
|
|
381
|
+
inputEl.value = '';
|
|
382
|
+
}
|
|
383
|
+
if (this.closeOnClick()) {
|
|
384
|
+
(!this.keepClickedOptionActive() || action === 'closed') && this.#resetActiveOption();
|
|
385
|
+
this.isOpen.set(false);
|
|
386
|
+
this.closed.emit(action === 'active');
|
|
387
|
+
if (this.isSubmenu()) {
|
|
388
|
+
const parentInput = this.parentMenu?.inputRef()?.nativeElement;
|
|
389
|
+
if (parentInput) {
|
|
390
|
+
queueMicrotask(() => parentInput.focus());
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
#resetActiveOption() {
|
|
396
|
+
this.activeOptionIndex.set(-1);
|
|
397
|
+
const optionElements = this.optionsEl();
|
|
398
|
+
for (let index = 0; index < optionElements.length; index++) {
|
|
399
|
+
optionElements[index].classList.remove('active');
|
|
400
|
+
optionElements[index].removeAttribute('aria-selected');
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
ngOnDestroy() {
|
|
404
|
+
if (this.abortController) {
|
|
405
|
+
this.abortController.abort();
|
|
406
|
+
this.abortController = null;
|
|
407
|
+
}
|
|
408
|
+
const index = ShipMenu.openMenus.indexOf(this);
|
|
409
|
+
if (index > -1) {
|
|
410
|
+
ShipMenu.openMenus.splice(index, 1);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ShipMenu, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
414
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: ShipMenu, isStandalone: true, selector: "sh-menu", inputs: { asMultiLayer: { classPropertyName: "asMultiLayer", publicName: "asMultiLayer", isSignal: true, isRequired: false, transformFunction: null }, openIndicator: { classPropertyName: "openIndicator", publicName: "openIndicator", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, customOptionElementSelectors: { classPropertyName: "customOptionElementSelectors", publicName: "customOptionElementSelectors", isSignal: true, isRequired: false, transformFunction: null }, keepClickedOptionActive: { classPropertyName: "keepClickedOptionActive", publicName: "keepClickedOptionActive", isSignal: true, isRequired: false, transformFunction: null }, closeOnClick: { classPropertyName: "closeOnClick", publicName: "closeOnClick", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", closed: "closed" }, host: { listeners: { "ship-menu-open": "onShipMenuOpen($event)" }, properties: { "class.disabled": "disabled()", "class.has-search": "searchable()", "class.multi-layer": "asMultiLayer()" } }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true, isSignal: true }, { propertyName: "optionsRef", first: true, predicate: ["optionsRef"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
415
|
+
<sh-popover
|
|
416
|
+
#formFieldWrapper
|
|
417
|
+
[(isOpen)]="isOpen"
|
|
418
|
+
[disableOpenByClick]="true"
|
|
419
|
+
(closed)="close('fromPopover')"
|
|
420
|
+
[asMultiLayer]="asMultiLayer()"
|
|
421
|
+
[options]="{
|
|
422
|
+
closeOnButton: false,
|
|
423
|
+
closeOnEsc: true,
|
|
424
|
+
}">
|
|
425
|
+
<div
|
|
426
|
+
trigger
|
|
427
|
+
[class.is-open]="isOpen()"
|
|
428
|
+
(click)="toggleIsOpen($event)"
|
|
429
|
+
role="combobox"
|
|
430
|
+
[attr.aria-expanded]="isOpen()"
|
|
431
|
+
aria-haspopup="listbox"
|
|
432
|
+
[attr.aria-controls]="optionsId"
|
|
433
|
+
[attr.aria-activedescendant]="activeOptionId()">
|
|
434
|
+
<ng-content />
|
|
435
|
+
|
|
436
|
+
@if (openIndicator()) {
|
|
437
|
+
<sh-icon class="open-indicator">caret-down</sh-icon>
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
@if (isSubmenu()) {
|
|
441
|
+
<sh-icon class="submenu-indicator">caret-right</sh-icon>
|
|
442
|
+
}
|
|
443
|
+
</div>
|
|
444
|
+
|
|
445
|
+
<div class="form-field-wrap">
|
|
446
|
+
<sh-form-field class="small stretch" [class.hidden]="searchable() === false">
|
|
447
|
+
<input
|
|
448
|
+
type="text"
|
|
449
|
+
#inputRef
|
|
450
|
+
placeholder="Search"
|
|
451
|
+
role="combobox"
|
|
452
|
+
[attr.aria-expanded]="isOpen()"
|
|
453
|
+
[attr.aria-controls]="optionsId"
|
|
454
|
+
[attr.aria-activedescendant]="activeOptionId()"
|
|
455
|
+
aria-autocomplete="list" />
|
|
456
|
+
</sh-form-field>
|
|
457
|
+
</div>
|
|
458
|
+
|
|
459
|
+
<div
|
|
460
|
+
class="options"
|
|
461
|
+
#optionsRef
|
|
462
|
+
(click)="close('active')"
|
|
463
|
+
[class.searching]="searchable() && inputValue() !== ''"
|
|
464
|
+
role="listbox"
|
|
465
|
+
[id]="optionsId"
|
|
466
|
+
[attr.aria-activedescendant]="activeOptionId()">
|
|
467
|
+
<ng-content select="[menu]" />
|
|
468
|
+
</div>
|
|
469
|
+
</sh-popover>
|
|
470
|
+
`, isInline: true, styles: ["sh-menu{--menu-mh: 20rem;display:inline-flex;position:relative}sh-menu.disabled{opacity:.5;pointer-events:none}sh-menu.stretch{width:100%}sh-menu.stretch [trigger]>*{width:100%}sh-menu.has-search sh-popover .options [title]{position:sticky;border-bottom:var(--border-10)}sh-menu.has-search .form-field-wrap{margin:.5rem .5rem 0}sh-menu.has-search .options{margin:.25rem 0 0}sh-menu.multi-layer [trigger]:has(sh-icon.open-indicator).is-open .open-indicator{transform:translateY(-50%) rotate(-90deg)}sh-menu.multi-layer [trigger]:has(sh-icon.open-indicator){display:flex}sh-menu.multi-layer [trigger]:has(sh-icon.open-indicator) .open-indicator{right:1rem}sh-menu.multi-layer [trigger] button:first-child{margin-top:0}sh-menu [trigger]:has(sh-icon.open-indicator){position:relative}sh-menu [trigger]:has(sh-icon.open-indicator)>:first-child{padding-right:2rem}sh-menu [trigger]:has(sh-icon.open-indicator) .open-indicator{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);color:var(--base-8);font-size:1rem;font-weight:inherit;pointer-events:none;transition:transform 75ms ease-in-out}sh-menu [trigger]:has(sh-icon.open-indicator).is-open .open-indicator{transform:translateY(-50%) rotate(-180deg)}sh-menu [trigger]:has(sh-icon.submenu-indicator){position:relative}sh-menu [trigger]:has(sh-icon.submenu-indicator)>:first-child{padding-right:2rem!important}sh-menu [trigger]:has(sh-icon.submenu-indicator) .submenu-indicator{position:absolute;right:1rem;top:50%;transform:translateY(-50%);color:var(--base-8);font-size:1rem;font-weight:inherit;pointer-events:none;transition:transform 75ms ease-in-out}sh-menu [trigger]:has(sh-icon.submenu-indicator).is-open .submenu-indicator{transform:translateY(-50%) rotate(90deg)}sh-menu sh-popover{flex:1 0}sh-menu sh-popover .popover{padding:0}sh-menu sh-popover .popover-content{overflow:hidden}sh-menu sh-popover .form-field-wrap sh-form-field{z-index:10;background-color:var(--base-1)}sh-menu sh-popover .form-field-wrap sh-form-field.hidden{opacity:0;height:0;width:0;min-width:0;min-height:0;margin:0}sh-menu sh-popover .options{z-index:2;position:relative;display:flex;flex-direction:column;gap:.25rem;padding:0;margin:0;max-height:var(--menu-mh);overflow:auto}sh-menu sh-popover .options sh-menu:first-child,sh-menu sh-popover .options button:first-child{margin-top:.5rem}sh-menu sh-popover .options.searching button[disabled]{display:none}sh-menu sh-popover .options.searching button[value=\"0\"]{display:none}sh-menu sh-popover .options.searching>*:not(button){display:none}sh-menu sh-popover .options:after{content:\"\";display:block;width:100%;min-height:.25rem;order:9999999}sh-menu sh-popover .options [title]{font:var(--paragraph-30);color:var(--base-8);padding:.5rem .75rem;margin:0;-webkit-user-select:none;user-select:none;position:relative;top:0;z-index:10;background-color:var(--base-1)}sh-menu sh-popover .options button{display:flex;justify-content:flex-start;align-items:center;text-align:left;height:auto;margin:0 .5rem;padding:.25rem .5rem;gap:0 .5rem;width:calc(100% - 1rem);border-radius:var(--shape-2);appearance:none;background-color:transparent;border:0;cursor:pointer;color:var(--base-12);transition:transform 125ms linear;transform:scale(1)}sh-menu sh-popover .options button:before{content:\"\";min-height:1.5rem;display:inline-block;width:0;margin-right:-.5rem}sh-menu sh-popover .options button:active{transform:scale(.98)}sh-menu sh-popover .options button[disabled]{opacity:.3;cursor:initial}sh-menu sh-popover .options button[disabled]:hover{background-color:transparent}sh-menu sh-popover .options button [suffix]{order:999;color:var(--base-8);font:var(--paragraph-30);justify-self:flex-end;display:inline-flex;flex:1 0;justify-content:flex-end}sh-menu sh-popover .options button sh-icon{font-size:1rem}sh-menu sh-popover .options button.active,sh-menu sh-popover .options button:hover{background-color:var(--base-2);color:var(--base-12)}sh-menu sh-popover .options button.focused{background-color:var(--primary-2);color:var(--base-12)}sh-menu sh-popover .options button.focused:hover{background-color:var(--primary-3)}\n"], dependencies: [{ kind: "component", type: ShipPopover, selector: "sh-popover", inputs: ["asMultiLayer", "asSheetOnMobile", "disableOpenByClick", "isOpen", "options"], outputs: ["isOpenChange", "closed"] }, { kind: "component", type: ShipFormField, selector: "sh-form-field", inputs: ["color", "variant", "size", "readonly"] }, { kind: "component", type: ShipIcon, selector: "sh-icon", inputs: ["color", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
471
|
+
}
|
|
472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ShipMenu, decorators: [{
|
|
473
|
+
type: Component,
|
|
474
|
+
args: [{ selector: 'sh-menu', encapsulation: ViewEncapsulation.None, imports: [ShipPopover, ShipFormField, ShipIcon], template: `
|
|
475
|
+
<sh-popover
|
|
476
|
+
#formFieldWrapper
|
|
477
|
+
[(isOpen)]="isOpen"
|
|
478
|
+
[disableOpenByClick]="true"
|
|
479
|
+
(closed)="close('fromPopover')"
|
|
480
|
+
[asMultiLayer]="asMultiLayer()"
|
|
481
|
+
[options]="{
|
|
482
|
+
closeOnButton: false,
|
|
483
|
+
closeOnEsc: true,
|
|
484
|
+
}">
|
|
485
|
+
<div
|
|
486
|
+
trigger
|
|
487
|
+
[class.is-open]="isOpen()"
|
|
488
|
+
(click)="toggleIsOpen($event)"
|
|
489
|
+
role="combobox"
|
|
490
|
+
[attr.aria-expanded]="isOpen()"
|
|
491
|
+
aria-haspopup="listbox"
|
|
492
|
+
[attr.aria-controls]="optionsId"
|
|
493
|
+
[attr.aria-activedescendant]="activeOptionId()">
|
|
494
|
+
<ng-content />
|
|
495
|
+
|
|
496
|
+
@if (openIndicator()) {
|
|
497
|
+
<sh-icon class="open-indicator">caret-down</sh-icon>
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
@if (isSubmenu()) {
|
|
501
|
+
<sh-icon class="submenu-indicator">caret-right</sh-icon>
|
|
502
|
+
}
|
|
503
|
+
</div>
|
|
504
|
+
|
|
505
|
+
<div class="form-field-wrap">
|
|
506
|
+
<sh-form-field class="small stretch" [class.hidden]="searchable() === false">
|
|
507
|
+
<input
|
|
508
|
+
type="text"
|
|
509
|
+
#inputRef
|
|
510
|
+
placeholder="Search"
|
|
511
|
+
role="combobox"
|
|
512
|
+
[attr.aria-expanded]="isOpen()"
|
|
513
|
+
[attr.aria-controls]="optionsId"
|
|
514
|
+
[attr.aria-activedescendant]="activeOptionId()"
|
|
515
|
+
aria-autocomplete="list" />
|
|
516
|
+
</sh-form-field>
|
|
517
|
+
</div>
|
|
518
|
+
|
|
519
|
+
<div
|
|
520
|
+
class="options"
|
|
521
|
+
#optionsRef
|
|
522
|
+
(click)="close('active')"
|
|
523
|
+
[class.searching]="searchable() && inputValue() !== ''"
|
|
524
|
+
role="listbox"
|
|
525
|
+
[id]="optionsId"
|
|
526
|
+
[attr.aria-activedescendant]="activeOptionId()">
|
|
527
|
+
<ng-content select="[menu]" />
|
|
528
|
+
</div>
|
|
529
|
+
</sh-popover>
|
|
530
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
531
|
+
'[class.disabled]': 'disabled()',
|
|
532
|
+
'[class.has-search]': 'searchable()',
|
|
533
|
+
'[class.multi-layer]': 'asMultiLayer()',
|
|
534
|
+
}, styles: ["sh-menu{--menu-mh: 20rem;display:inline-flex;position:relative}sh-menu.disabled{opacity:.5;pointer-events:none}sh-menu.stretch{width:100%}sh-menu.stretch [trigger]>*{width:100%}sh-menu.has-search sh-popover .options [title]{position:sticky;border-bottom:var(--border-10)}sh-menu.has-search .form-field-wrap{margin:.5rem .5rem 0}sh-menu.has-search .options{margin:.25rem 0 0}sh-menu.multi-layer [trigger]:has(sh-icon.open-indicator).is-open .open-indicator{transform:translateY(-50%) rotate(-90deg)}sh-menu.multi-layer [trigger]:has(sh-icon.open-indicator){display:flex}sh-menu.multi-layer [trigger]:has(sh-icon.open-indicator) .open-indicator{right:1rem}sh-menu.multi-layer [trigger] button:first-child{margin-top:0}sh-menu [trigger]:has(sh-icon.open-indicator){position:relative}sh-menu [trigger]:has(sh-icon.open-indicator)>:first-child{padding-right:2rem}sh-menu [trigger]:has(sh-icon.open-indicator) .open-indicator{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);color:var(--base-8);font-size:1rem;font-weight:inherit;pointer-events:none;transition:transform 75ms ease-in-out}sh-menu [trigger]:has(sh-icon.open-indicator).is-open .open-indicator{transform:translateY(-50%) rotate(-180deg)}sh-menu [trigger]:has(sh-icon.submenu-indicator){position:relative}sh-menu [trigger]:has(sh-icon.submenu-indicator)>:first-child{padding-right:2rem!important}sh-menu [trigger]:has(sh-icon.submenu-indicator) .submenu-indicator{position:absolute;right:1rem;top:50%;transform:translateY(-50%);color:var(--base-8);font-size:1rem;font-weight:inherit;pointer-events:none;transition:transform 75ms ease-in-out}sh-menu [trigger]:has(sh-icon.submenu-indicator).is-open .submenu-indicator{transform:translateY(-50%) rotate(90deg)}sh-menu sh-popover{flex:1 0}sh-menu sh-popover .popover{padding:0}sh-menu sh-popover .popover-content{overflow:hidden}sh-menu sh-popover .form-field-wrap sh-form-field{z-index:10;background-color:var(--base-1)}sh-menu sh-popover .form-field-wrap sh-form-field.hidden{opacity:0;height:0;width:0;min-width:0;min-height:0;margin:0}sh-menu sh-popover .options{z-index:2;position:relative;display:flex;flex-direction:column;gap:.25rem;padding:0;margin:0;max-height:var(--menu-mh);overflow:auto}sh-menu sh-popover .options sh-menu:first-child,sh-menu sh-popover .options button:first-child{margin-top:.5rem}sh-menu sh-popover .options.searching button[disabled]{display:none}sh-menu sh-popover .options.searching button[value=\"0\"]{display:none}sh-menu sh-popover .options.searching>*:not(button){display:none}sh-menu sh-popover .options:after{content:\"\";display:block;width:100%;min-height:.25rem;order:9999999}sh-menu sh-popover .options [title]{font:var(--paragraph-30);color:var(--base-8);padding:.5rem .75rem;margin:0;-webkit-user-select:none;user-select:none;position:relative;top:0;z-index:10;background-color:var(--base-1)}sh-menu sh-popover .options button{display:flex;justify-content:flex-start;align-items:center;text-align:left;height:auto;margin:0 .5rem;padding:.25rem .5rem;gap:0 .5rem;width:calc(100% - 1rem);border-radius:var(--shape-2);appearance:none;background-color:transparent;border:0;cursor:pointer;color:var(--base-12);transition:transform 125ms linear;transform:scale(1)}sh-menu sh-popover .options button:before{content:\"\";min-height:1.5rem;display:inline-block;width:0;margin-right:-.5rem}sh-menu sh-popover .options button:active{transform:scale(.98)}sh-menu sh-popover .options button[disabled]{opacity:.3;cursor:initial}sh-menu sh-popover .options button[disabled]:hover{background-color:transparent}sh-menu sh-popover .options button [suffix]{order:999;color:var(--base-8);font:var(--paragraph-30);justify-self:flex-end;display:inline-flex;flex:1 0;justify-content:flex-end}sh-menu sh-popover .options button sh-icon{font-size:1rem}sh-menu sh-popover .options button.active,sh-menu sh-popover .options button:hover{background-color:var(--base-2);color:var(--base-12)}sh-menu sh-popover .options button.focused{background-color:var(--primary-2);color:var(--base-12)}sh-menu sh-popover .options button.focused:hover{background-color:var(--primary-3)}\n"] }]
|
|
535
|
+
}], propDecorators: { asMultiLayer: [{ type: i0.Input, args: [{ isSignal: true, alias: "asMultiLayer", required: false }] }], openIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "openIndicator", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], customOptionElementSelectors: [{ type: i0.Input, args: [{ isSignal: true, alias: "customOptionElementSelectors", required: false }] }], keepClickedOptionActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepClickedOptionActive", required: false }] }], closeOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnClick", required: false }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }, { type: i0.Output, args: ["isOpenChange"] }], closed: [{ type: i0.Output, args: ["closed"] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], inputRef: [{ type: i0.ViewChild, args: ['inputRef', { isSignal: true }] }], optionsRef: [{ type: i0.ViewChild, args: ['optionsRef', { isSignal: true }] }], onShipMenuOpen: [{
|
|
536
|
+
type: HostListener,
|
|
537
|
+
args: ['ship-menu-open', ['$event']]
|
|
538
|
+
}] } });
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Generated bundle index. Do not edit.
|
|
542
|
+
*/
|
|
543
|
+
|
|
544
|
+
export { ShipMenu };
|
|
545
|
+
//# sourceMappingURL=ship-ui-core-ship-menu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ship-ui-core-ship-menu.mjs","sources":["../../../projects/ship-ui/ship-menu/ship-menu.ts","../../../projects/ship-ui/ship-menu/ship-ui-core-ship-menu.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, DOCUMENT, effect, ElementRef, HostListener, inject, input, model, output, Renderer2, signal, viewChild, ViewEncapsulation } from '@angular/core';\nimport { ShipFormField } from '@ship-ui/core/ship-form-field';\nimport { ShipIcon } from '@ship-ui/core/ship-icon';\nimport { ShipPopover } from '@ship-ui/core/ship-popover';\nimport { createFormInputSignal } from '@ship-ui/core';\nimport { observeChildren } from '@ship-ui/core';\nimport { generateUniqueId } from '@ship-ui/core';\n\n@Component({\n selector: 'sh-menu',\n styleUrl: './ship-menu.scss',\n encapsulation: ViewEncapsulation.None,\n imports: [ShipPopover, ShipFormField, ShipIcon],\n template: `\n <sh-popover\n #formFieldWrapper\n [(isOpen)]=\"isOpen\"\n [disableOpenByClick]=\"true\"\n (closed)=\"close('fromPopover')\"\n [asMultiLayer]=\"asMultiLayer()\"\n [options]=\"{\n closeOnButton: false,\n closeOnEsc: true,\n }\">\n <div\n trigger\n [class.is-open]=\"isOpen()\"\n (click)=\"toggleIsOpen($event)\"\n role=\"combobox\"\n [attr.aria-expanded]=\"isOpen()\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"optionsId\"\n [attr.aria-activedescendant]=\"activeOptionId()\">\n <ng-content />\n\n @if (openIndicator()) {\n <sh-icon class=\"open-indicator\">caret-down</sh-icon>\n }\n\n @if (isSubmenu()) {\n <sh-icon class=\"submenu-indicator\">caret-right</sh-icon>\n }\n </div>\n\n <div class=\"form-field-wrap\">\n <sh-form-field class=\"small stretch\" [class.hidden]=\"searchable() === false\">\n <input\n type=\"text\"\n #inputRef\n placeholder=\"Search\"\n role=\"combobox\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"optionsId\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n aria-autocomplete=\"list\" />\n </sh-form-field>\n </div>\n\n <div\n class=\"options\"\n #optionsRef\n (click)=\"close('active')\"\n [class.searching]=\"searchable() && inputValue() !== ''\"\n role=\"listbox\"\n [id]=\"optionsId\"\n [attr.aria-activedescendant]=\"activeOptionId()\">\n <ng-content select=\"[menu]\" />\n </div>\n </sh-popover>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.disabled]': 'disabled()',\n '[class.has-search]': 'searchable()',\n '[class.multi-layer]': 'asMultiLayer()',\n },\n})\nexport class ShipMenu {\n #document = inject(DOCUMENT);\n #renderer = inject(Renderer2);\n parentMenu = inject(ShipMenu, { optional: true, skipSelf: true });\n isSubmenu = computed(() => this.parentMenu !== null);\n asMultiLayer = input<boolean>(false);\n openIndicator = input(false);\n disabled = input<boolean>(false);\n customOptionElementSelectors = input<string[]>(['button']);\n keepClickedOptionActive = input<boolean>(false);\n closeOnClick = input<boolean>(true);\n isOpen = model<boolean>(false);\n closed = output<boolean>();\n\n searchable = input<boolean>(false);\n activeOptionIndex = signal<number>(-1);\n inputRef = viewChild<ElementRef<HTMLInputElement>>('inputRef');\n optionsRef = viewChild<ElementRef<HTMLDivElement>>('optionsRef');\n\n private static openMenus: ShipMenu[] = [];\n\n openMenusEffect = effect((onCleanup) => {\n if (this.isOpen()) {\n ShipMenu.openMenus.push(this);\n }\n\n onCleanup(() => {\n const index = ShipMenu.openMenus.indexOf(this);\n if (index > -1) {\n ShipMenu.openMenus.splice(index, 1);\n }\n });\n });\n\n options = observeChildren<HTMLButtonElement>(this.optionsRef, this.customOptionElementSelectors);\n optionsEl = computed(() => {\n const optionsContainer = this.optionsRef()?.nativeElement;\n if (!optionsContainer) return [];\n return this.options.signal().filter((x) => {\n if (x.disabled) return false;\n return x.closest('.options') === optionsContainer;\n });\n });\n inputValue = createFormInputSignal(this.inputRef);\n\n readonly optionsId = generateUniqueId();\n activeOptionId = signal<string | undefined>(undefined);\n\n abortController: AbortController | null = null;\n optionsEffect = effect(() => {\n if (this.abortController !== null) {\n this.abortController.abort();\n this.abortController = null;\n }\n\n if (!this.isOpen()) return;\n\n this.abortController = new AbortController();\n\n const searchable = this.searchable();\n\n if (!searchable) {\n this.#document.documentElement.addEventListener('keydown', this.keyDownEventListener, {\n signal: this.abortController.signal,\n });\n } else {\n const inputEl = this.inputRef()?.nativeElement;\n if (inputEl) {\n inputEl.addEventListener('keydown', this.keyDownEventListener, {\n signal: this.abortController.signal,\n });\n }\n }\n\n const inputEl = this.inputRef()?.nativeElement;\n\n if (!inputEl) return;\n\n queueMicrotask(() => inputEl.focus());\n\n if (!this.closeOnClick()) {\n const optionRef = this.optionsRef()?.nativeElement;\n\n optionRef?.addEventListener('click', (e: MouseEvent) => {\n const optionEl = e.target as HTMLButtonElement;\n\n let optionElements = this.activeElements();\n\n if (!optionElements.length) {\n const newOptionElements = this.optionsEl();\n this.activeElements.set(newOptionElements);\n optionElements = newOptionElements;\n }\n\n const clickedOptionIndex = optionElements.findIndex((x) => x === optionEl);\n\n if (clickedOptionIndex > -1) {\n this.activeOptionIndex.set(clickedOptionIndex);\n inputEl.focus();\n }\n });\n }\n });\n\n keyDownEventListener = (e: KeyboardEvent) => {\n // Only handle events if this is the most recently opened menu\n if (ShipMenu.openMenus.at(-1) !== this) return;\n\n const activeOptionIndex = this.activeOptionIndex();\n\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n this.activeOptionIndex.set(this.nextActiveIndex(activeOptionIndex));\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n this.activeOptionIndex.set(this.prevActiveIndex(activeOptionIndex));\n } else if (e.key === 'ArrowRight') {\n if (activeOptionIndex > -1) {\n const el = this.activeElements()[activeOptionIndex as number];\n const parent = el.parentElement;\n\n // For nested menu's\n if (parent?.hasAttribute('trigger')) {\n e.preventDefault();\n const event = new CustomEvent('ship-menu-open', {\n bubbles: true,\n cancelable: true,\n detail: { keyboard: true },\n });\n\n el.dispatchEvent(event);\n }\n }\n } else if (e.key === 'ArrowLeft') {\n if (this.isSubmenu()) {\n e.preventDefault();\n this.close('closed');\n }\n } else if (e.key === 'Enter') {\n e.preventDefault();\n if (activeOptionIndex > -1) {\n const el = this.activeElements()[activeOptionIndex as number];\n const parent = el.parentElement;\n\n // For nested menu's\n if (parent?.hasAttribute('trigger')) {\n const event = new CustomEvent('ship-menu-open', {\n bubbles: true,\n cancelable: true,\n detail: { keyboard: true },\n });\n\n el.dispatchEvent(event);\n } else {\n el.click();\n if (!el.querySelector('sh-checkbox')) {\n queueMicrotask(() => this.close('active'));\n }\n }\n }\n } else if (e.key === 'Tab') {\n let optionElements = this.activeElements();\n if (!optionElements.length) {\n const newOptionElements = this.optionsEl();\n this.activeElements.set(newOptionElements);\n optionElements = newOptionElements;\n }\n\n if (e.shiftKey) {\n if (activeOptionIndex <= 0) {\n e.preventDefault();\n this.close('closed');\n } else {\n e.preventDefault();\n this.activeOptionIndex.set(this.prevActiveIndex(activeOptionIndex));\n }\n } else {\n if (activeOptionIndex >= optionElements.length - 1) {\n e.preventDefault();\n this.close('closed');\n } else {\n e.preventDefault();\n this.activeOptionIndex.set(this.nextActiveIndex(activeOptionIndex));\n }\n }\n }\n };\n\n _lastElementList: HTMLButtonElement[] = [];\n activeElements = signal<HTMLButtonElement[]>([]);\n lastInputValue = '';\n inputValueEffect = effect(() => {\n const searchable = this.searchable();\n\n if (!searchable) {\n this.activeElements.set(this.optionsEl());\n return;\n }\n\n const inputValue = (this.inputValue() ?? '').toLowerCase();\n\n this.#resetActiveOption();\n\n if (!inputValue || inputValue === '') {\n const allOptions = this.optionsEl();\n\n this.activeElements.set(allOptions);\n this._lastElementList = allOptions;\n\n for (let i = 0; i < allOptions.length; i++) {\n this.#renderer.removeStyle(allOptions[i], 'order');\n if (!allOptions[i].id) {\n allOptions[i].id = `${this.optionsId}-option-${i}`;\n }\n allOptions[i].setAttribute('role', 'option');\n }\n\n return;\n }\n\n if (!inputValue || inputValue === '') return;\n\n let optionElements =\n this._lastElementList.length && inputValue.length > this.lastInputValue.length\n ? this._lastElementList\n : this.optionsEl();\n\n this.lastInputValue = inputValue;\n\n for (let i = 0; i < optionElements.length; i++) {\n const el = optionElements[i];\n const textContent = el.textContent?.toLowerCase() || '';\n const score = this.#calculateMatchScore(textContent, inputValue);\n\n (el.value as any) = score;\n }\n\n optionElements = optionElements\n .filter((x) => (x.value as any) > 0)\n .sort((a, b) => (b.value as any) - (a.value as any));\n\n for (let i = 0; i < optionElements.length; i++) {\n this.#renderer.setStyle(optionElements[i], 'order', i);\n }\n\n this.activeElements.set(optionElements);\n this._lastElementList = optionElements;\n\n // Assign IDs to options for ARIA support\n for (let i = 0; i < optionElements.length; i++) {\n if (!optionElements[i].id) {\n optionElements[i].id = `${this.optionsId}-option-${i}`;\n }\n optionElements[i].setAttribute('role', 'option');\n }\n });\n\n toggleIsOpen(event: MouseEvent) {\n event.preventDefault();\n event.stopPropagation();\n\n if (this.disabled()) return;\n\n if (this.isOpen()) {\n this.close('fromPopover');\n } else {\n this.open();\n }\n }\n\n open() {\n if (this.disabled()) return;\n this.isOpen.set(true);\n\n if (this.searchable()) {\n setTimeout(() => this.inputRef()?.nativeElement.focus());\n }\n }\n\n @HostListener('ship-menu-open', ['$event'])\n onShipMenuOpen(event: Event) {\n event.preventDefault();\n event.stopPropagation();\n this.open();\n\n const customEvent = event as CustomEvent;\n if (customEvent.detail?.keyboard) {\n setTimeout(() => {\n this.activeOptionIndex.set(0);\n }, 50);\n }\n }\n\n #calculateMatchScore(option: string, input: string): number {\n if (!input) return 0;\n\n let score = 0;\n let lastIndex = -1;\n let matchCount = 0;\n let inSequence = true;\n\n for (let i = 0; i < input.length; i++) {\n const char = input[i];\n if (option.length > lastIndex + 1 && option[lastIndex + 1] === char) {\n score += i === 0 ? 100 : 150;\n lastIndex++;\n matchCount++;\n } else {\n const charIndex = option.indexOf(char, lastIndex + 1);\n\n if (i > 0) {\n inSequence = false;\n }\n\n if (charIndex === -1) {\n return 0;\n }\n\n score += 100;\n\n lastIndex = charIndex;\n matchCount++;\n }\n }\n\n if (inSequence && input.length === matchCount) {\n score += 1000;\n }\n\n score += matchCount * 20;\n\n return score;\n }\n\n activeOptionIndexEffect = effect(() => {\n const optionElements = this.activeElements();\n const activeOptionIndex = this.activeOptionIndex();\n\n for (let index = 0; index < optionElements.length; index++) {\n optionElements[index].classList.remove('active');\n optionElements[index].removeAttribute('aria-selected');\n }\n\n if (activeOptionIndex > -1) {\n const activeOption = optionElements[activeOptionIndex];\n activeOption.scrollIntoView({ block: 'center' });\n activeOption.classList.add('active');\n activeOption.setAttribute('aria-selected', 'true');\n this.activeOptionId.set(activeOption.id);\n } else {\n this.activeOptionId.set(undefined);\n }\n });\n\n nextActiveIndex(activeIndex: number): number {\n let optionElements = this.activeElements();\n\n if (!optionElements.length) {\n const newOptionElements = this.optionsEl();\n this.activeElements.set(newOptionElements);\n optionElements = newOptionElements;\n }\n\n if (activeIndex === -1) {\n return 0;\n }\n\n if (activeIndex === optionElements.length - 1) {\n return 0;\n }\n\n const nextIndex = activeIndex + 1;\n\n if (optionElements[nextIndex].disabled) {\n return this.nextActiveIndex(nextIndex);\n }\n\n return nextIndex;\n }\n\n prevActiveIndex(activeIndex: number): number {\n let optionElements = this.activeElements();\n\n if (!optionElements.length) {\n const newOptionElements = this.optionsEl();\n this.activeElements.set(newOptionElements);\n optionElements = newOptionElements;\n }\n\n if (activeIndex === 0) {\n return optionElements.length - 1;\n }\n\n if (activeIndex === -1) {\n return optionElements.length - 1;\n }\n\n const prevIndex = activeIndex - 1;\n\n if (optionElements[prevIndex].disabled) {\n return this.prevActiveIndex(prevIndex);\n }\n\n return prevIndex;\n }\n\n close(action: 'fromPopover' | 'closed' | 'active' = 'closed', event?: MouseEvent) {\n this.inputValue.set('');\n\n const inputEl = this.inputRef()?.nativeElement;\n if (inputEl) {\n inputEl.value = '';\n }\n\n if (this.closeOnClick()) {\n (!this.keepClickedOptionActive() || action === 'closed') && this.#resetActiveOption();\n\n this.isOpen.set(false);\n this.closed.emit(action === 'active');\n\n if (this.isSubmenu()) {\n const parentInput = this.parentMenu?.inputRef()?.nativeElement;\n if (parentInput) {\n queueMicrotask(() => parentInput.focus());\n }\n }\n }\n }\n\n #resetActiveOption() {\n this.activeOptionIndex.set(-1);\n\n const optionElements = this.optionsEl();\n\n for (let index = 0; index < optionElements.length; index++) {\n optionElements[index].classList.remove('active');\n optionElements[index].removeAttribute('aria-selected');\n }\n }\n\n ngOnDestroy() {\n if (this.abortController) {\n this.abortController.abort();\n this.abortController = null;\n }\n const index = ShipMenu.openMenus.indexOf(this);\n if (index > -1) {\n ShipMenu.openMenus.splice(index, 1);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MA6Ea,QAAQ,CAAA;AArErB,IAAA,WAAA,GAAA;AAsEE,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5B,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACjE,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,UAAU,KAAK,IAAI;sFAAC;QACpD,IAAA,CAAA,YAAY,GAAG,KAAK,CAAU,KAAK;yFAAC;QACpC,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,KAAK;0F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