aeico-components 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alert.cjs +6 -0
- package/dist/alert.cjs.map +1 -0
- package/dist/alert.js +6 -0
- package/dist/alert.js.map +1 -0
- package/dist/badge.cjs +6 -0
- package/dist/badge.cjs.map +1 -0
- package/dist/badge.js +6 -0
- package/dist/badge.js.map +1 -0
- package/dist/breadcrumb.cjs +7 -0
- package/dist/breadcrumb.cjs.map +1 -0
- package/dist/breadcrumb.js +7 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/button-group.cjs +6 -0
- package/dist/button-group.cjs.map +1 -0
- package/dist/button-group.js +6 -0
- package/dist/button-group.js.map +1 -0
- package/dist/button.cjs +6 -0
- package/dist/button.cjs.map +1 -0
- package/dist/button.js +6 -0
- package/dist/button.js.map +1 -0
- package/dist/card.cjs +6 -0
- package/dist/card.cjs.map +1 -0
- package/dist/card.js +6 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.cjs +6 -0
- package/dist/checkbox.cjs.map +1 -0
- package/dist/checkbox.js +6 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chunks/aeico-component.cjs +17 -0
- package/dist/chunks/aeico-component.cjs.map +1 -0
- package/dist/chunks/aeico-component.js +18 -0
- package/dist/chunks/aeico-component.js.map +1 -0
- package/dist/chunks/aeico-field.cjs +179 -0
- package/dist/chunks/aeico-field.cjs.map +1 -0
- package/dist/chunks/aeico-field.js +180 -0
- package/dist/chunks/aeico-field.js.map +1 -0
- package/dist/chunks/alert.cjs +170 -0
- package/dist/chunks/alert.cjs.map +1 -0
- package/dist/chunks/alert.js +171 -0
- package/dist/chunks/alert.js.map +1 -0
- package/dist/chunks/badge.cjs +85 -0
- package/dist/chunks/badge.cjs.map +1 -0
- package/dist/chunks/badge.js +86 -0
- package/dist/chunks/badge.js.map +1 -0
- package/dist/chunks/breadcrumb-item.cjs +261 -0
- package/dist/chunks/breadcrumb-item.cjs.map +1 -0
- package/dist/chunks/breadcrumb-item.js +262 -0
- package/dist/chunks/breadcrumb-item.js.map +1 -0
- package/dist/chunks/button-group.cjs +79 -0
- package/dist/chunks/button-group.cjs.map +1 -0
- package/dist/chunks/button-group.js +80 -0
- package/dist/chunks/button-group.js.map +1 -0
- package/dist/chunks/button.cjs +351 -0
- package/dist/chunks/button.cjs.map +1 -0
- package/dist/chunks/button.js +352 -0
- package/dist/chunks/button.js.map +1 -0
- package/dist/chunks/card.cjs +93 -0
- package/dist/chunks/card.cjs.map +1 -0
- package/dist/chunks/card.js +94 -0
- package/dist/chunks/card.js.map +1 -0
- package/dist/chunks/checkbox.cjs +73 -0
- package/dist/chunks/checkbox.cjs.map +1 -0
- package/dist/chunks/checkbox.js +74 -0
- package/dist/chunks/checkbox.js.map +1 -0
- package/dist/chunks/color.cjs +4 -0
- package/dist/chunks/color.cjs.map +1 -0
- package/dist/chunks/color.js +5 -0
- package/dist/chunks/color.js.map +1 -0
- package/dist/chunks/detail.cjs +143 -0
- package/dist/chunks/detail.cjs.map +1 -0
- package/dist/chunks/detail.js +144 -0
- package/dist/chunks/detail.js.map +1 -0
- package/dist/chunks/dialog.cjs +117 -0
- package/dist/chunks/dialog.cjs.map +1 -0
- package/dist/chunks/dialog.js +118 -0
- package/dist/chunks/dialog.js.map +1 -0
- package/dist/chunks/divider.cjs +80 -0
- package/dist/chunks/divider.cjs.map +1 -0
- package/dist/chunks/divider.js +81 -0
- package/dist/chunks/divider.js.map +1 -0
- package/dist/chunks/dropdown-button.cjs +534 -0
- package/dist/chunks/dropdown-button.cjs.map +1 -0
- package/dist/chunks/dropdown-button.js +535 -0
- package/dist/chunks/dropdown-button.js.map +1 -0
- package/dist/chunks/icon-button.cjs +35 -0
- package/dist/chunks/icon-button.cjs.map +1 -0
- package/dist/chunks/icon-button.js +36 -0
- package/dist/chunks/icon-button.js.map +1 -0
- package/dist/chunks/icon.cjs +78 -0
- package/dist/chunks/icon.cjs.map +1 -0
- package/dist/chunks/icon.js +79 -0
- package/dist/chunks/icon.js.map +1 -0
- package/dist/chunks/navbar.cjs +143 -0
- package/dist/chunks/navbar.cjs.map +1 -0
- package/dist/chunks/navbar.js +144 -0
- package/dist/chunks/navbar.js.map +1 -0
- package/dist/chunks/radio.cjs +181 -0
- package/dist/chunks/radio.cjs.map +1 -0
- package/dist/chunks/radio.js +182 -0
- package/dist/chunks/radio.js.map +1 -0
- package/dist/chunks/select.cjs +350 -0
- package/dist/chunks/select.cjs.map +1 -0
- package/dist/chunks/select.js +351 -0
- package/dist/chunks/select.js.map +1 -0
- package/dist/chunks/size.cjs +4 -0
- package/dist/chunks/size.cjs.map +1 -0
- package/dist/chunks/size.js +5 -0
- package/dist/chunks/size.js.map +1 -0
- package/dist/chunks/slider.cjs +648 -0
- package/dist/chunks/slider.cjs.map +1 -0
- package/dist/chunks/slider.js +649 -0
- package/dist/chunks/slider.js.map +1 -0
- package/dist/chunks/switch.cjs +73 -0
- package/dist/chunks/switch.cjs.map +1 -0
- package/dist/chunks/switch.js +74 -0
- package/dist/chunks/switch.js.map +1 -0
- package/dist/chunks/tab-panel.cjs +166 -0
- package/dist/chunks/tab-panel.cjs.map +1 -0
- package/dist/chunks/tab-panel.js +167 -0
- package/dist/chunks/tab-panel.js.map +1 -0
- package/dist/chunks/tag.cjs +108 -0
- package/dist/chunks/tag.cjs.map +1 -0
- package/dist/chunks/tag.js +109 -0
- package/dist/chunks/tag.js.map +1 -0
- package/dist/chunks/text-input.cjs +59 -0
- package/dist/chunks/text-input.cjs.map +1 -0
- package/dist/chunks/text-input.js +60 -0
- package/dist/chunks/text-input.js.map +1 -0
- package/dist/chunks/variables.cjs +372 -0
- package/dist/chunks/variables.cjs.map +1 -0
- package/dist/chunks/variables.js +373 -0
- package/dist/chunks/variables.js.map +1 -0
- package/dist/detail.cjs +6 -0
- package/dist/detail.cjs.map +1 -0
- package/dist/detail.js +6 -0
- package/dist/detail.js.map +1 -0
- package/dist/dialog.cjs +6 -0
- package/dist/dialog.cjs.map +1 -0
- package/dist/dialog.js +6 -0
- package/dist/dialog.js.map +1 -0
- package/dist/divider.cjs +6 -0
- package/dist/divider.cjs.map +1 -0
- package/dist/divider.js +6 -0
- package/dist/divider.js.map +1 -0
- package/dist/dropdown.cjs +7 -0
- package/dist/dropdown.cjs.map +1 -0
- package/dist/dropdown.js +7 -0
- package/dist/dropdown.js.map +1 -0
- package/dist/icon-button.cjs +6 -0
- package/dist/icon-button.cjs.map +1 -0
- package/dist/icon-button.js +6 -0
- package/dist/icon-button.js.map +1 -0
- package/dist/icon.cjs +6 -0
- package/dist/icon.cjs.map +1 -0
- package/dist/icon.js +6 -0
- package/dist/icon.js.map +1 -0
- package/dist/index.cjs +49 -4223
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +49 -4223
- package/dist/index.js.map +1 -1
- package/dist/navbar.cjs +6 -0
- package/dist/navbar.cjs.map +1 -0
- package/dist/navbar.js +6 -0
- package/dist/navbar.js.map +1 -0
- package/dist/radio-group.cjs +7 -0
- package/dist/radio-group.cjs.map +1 -0
- package/dist/radio-group.js +7 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/select.cjs +99 -0
- package/dist/select.cjs.map +1 -0
- package/dist/select.js +99 -0
- package/dist/select.js.map +1 -0
- package/dist/slider.cjs +6 -0
- package/dist/slider.cjs.map +1 -0
- package/dist/slider.js +6 -0
- package/dist/slider.js.map +1 -0
- package/dist/switch.cjs +6 -0
- package/dist/switch.cjs.map +1 -0
- package/dist/switch.js +6 -0
- package/dist/switch.js.map +1 -0
- package/dist/tabs.cjs +8 -0
- package/dist/tabs.cjs.map +1 -0
- package/dist/tabs.js +8 -0
- package/dist/tabs.js.map +1 -0
- package/dist/tag.cjs +5 -0
- package/dist/tag.cjs.map +1 -0
- package/dist/tag.js +5 -0
- package/dist/tag.js.map +1 -0
- package/dist/text-input.cjs +6 -0
- package/dist/text-input.cjs.map +1 -0
- package/dist/text-input.js +6 -0
- package/dist/text-input.js.map +1 -0
- package/package.json +15 -3
- package/src/utils.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -1,4226 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* The underlying form control element (input, select, etc.)
|
|
23
|
-
* Subclasses should set this to their specific element
|
|
24
|
-
*/
|
|
25
|
-
__publicField(this, "fieldElement", null);
|
|
26
|
-
__publicField(this, "resetBtn", null);
|
|
27
|
-
__publicField(this, "clearBtn", null);
|
|
28
|
-
__publicField(this, "boundOnChange", () => this.setValue(this.getValue(), { silent: false, action: "change" }));
|
|
29
|
-
__publicField(this, "boundOnReset", () => this.onReset());
|
|
30
|
-
__publicField(this, "boundOnClear", () => this.onClear());
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Lifecycle: Component connected to DOM
|
|
34
|
-
*/
|
|
35
|
-
connectedCallback() {
|
|
36
|
-
super.connectedCallback();
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Lifecycle: Component disconnected from DOM
|
|
40
|
-
*/
|
|
41
|
-
disconnectedCallback() {
|
|
42
|
-
super.disconnectedCallback();
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Render action buttons (clear/reset) using this.builder.
|
|
46
|
-
* Must be called from within a build() callback.
|
|
47
|
-
*/
|
|
48
|
-
renderActionButtons(force = false) {
|
|
49
|
-
this.renderClearButton(force);
|
|
50
|
-
this.renderResetButton(force);
|
|
51
|
-
}
|
|
52
|
-
renderResetButton(force = false) {
|
|
53
|
-
const { button } = tags;
|
|
54
|
-
if (force || this.resettable) {
|
|
55
|
-
this.resetBtn = button({
|
|
56
|
-
className: "reset-btn",
|
|
57
|
-
textContent: this.resetText || "↺",
|
|
58
|
-
title: t("buttons.reset", "↺"),
|
|
59
|
-
"@click": this.boundOnReset
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
renderClearButton(force = false) {
|
|
64
|
-
const { button } = tags;
|
|
65
|
-
if (force || this.clearable) {
|
|
66
|
-
this.clearBtn = button({
|
|
67
|
-
className: "clear-btn",
|
|
68
|
-
textContent: this.clearText || "✕",
|
|
69
|
-
title: t("buttons.clear", "✕"),
|
|
70
|
-
"@click": this.boundOnClear
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Watcher for disabled property
|
|
76
|
-
*/
|
|
77
|
-
onDisabledChanged(newValue) {
|
|
78
|
-
if (this.fieldElement) {
|
|
79
|
-
this.fieldElement.disabled = Boolean(newValue);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Render the field component
|
|
84
|
-
* Override in subclass to provide custom rendering
|
|
85
|
-
*/
|
|
86
|
-
render() {
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Get current value from the field element
|
|
90
|
-
* Default implementation returns the value property of fieldElement
|
|
91
|
-
* Override in subclasses if needed (e.g., checkbox uses checked instead of value)
|
|
92
|
-
*
|
|
93
|
-
* @returns Current field value
|
|
94
|
-
*/
|
|
95
|
-
getValue() {
|
|
96
|
-
var _a2;
|
|
97
|
-
return ((_a2 = this.fieldElement) == null ? void 0 : _a2.value) || "";
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Write value to the underlying UI element and sync props
|
|
101
|
-
* Subclasses must override this to update their specific UI element
|
|
102
|
-
*
|
|
103
|
-
* @param _value New value to write to the element
|
|
104
|
-
*/
|
|
105
|
-
writeValue(_value2) {
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Get event payload for change events
|
|
109
|
-
* Override in subclasses to customize event data (e.g., { checked, oldChecked } for checkbox)
|
|
110
|
-
*
|
|
111
|
-
* @param value New value
|
|
112
|
-
* @param oldValue Previous value
|
|
113
|
-
* @param action Action type
|
|
114
|
-
* @returns Event payload object
|
|
115
|
-
*/
|
|
116
|
-
getEventPayload(value, oldValue, action) {
|
|
117
|
-
return { value, oldValue, action };
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Update field value programmatically (internal method)
|
|
121
|
-
* Subclasses should provide type-safe public wrappers (e.g., change() method)
|
|
122
|
-
*
|
|
123
|
-
* @param value New value
|
|
124
|
-
* @param options.silent If true, won't emit change event (default: true)
|
|
125
|
-
* @param options.action Action type for the event (default: 'change')
|
|
126
|
-
*/
|
|
127
|
-
setValue(value, options) {
|
|
128
|
-
const oldValue = this.getValue();
|
|
129
|
-
this.value = value;
|
|
130
|
-
this.writeValue(value);
|
|
131
|
-
if ((options == null ? void 0 : options.silent) === false) {
|
|
132
|
-
const payload = this.getEventPayload(value, oldValue, options.action || "change");
|
|
133
|
-
this.emit("change", { detail: payload });
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Reset field to specified value or default value
|
|
138
|
-
*
|
|
139
|
-
* @param value Value to reset to, defaults to defaultValue prop
|
|
140
|
-
* @param options.silent If false, will emit reset event (default: true)
|
|
141
|
-
*/
|
|
142
|
-
reset(value, options) {
|
|
143
|
-
const resetValue = value !== void 0 ? value : this.defaultValue;
|
|
144
|
-
this.setValue(resetValue, { ...options, action: "reset" });
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Clear the field value
|
|
148
|
-
*
|
|
149
|
-
* @param options.silent If false, will emit clear event (default: true)
|
|
150
|
-
*/
|
|
151
|
-
clear(options) {
|
|
152
|
-
this.setValue("", { ...options, action: "clear" });
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Handle clear button click
|
|
156
|
-
* Clears the field and dispatches event
|
|
157
|
-
*/
|
|
158
|
-
onClear() {
|
|
159
|
-
this.clear({ silent: false });
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Handle reset button click
|
|
163
|
-
* Resets to default value and dispatches event
|
|
164
|
-
*/
|
|
165
|
-
onReset() {
|
|
166
|
-
this.reset(void 0, { silent: false });
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Define base field properties (extends AeicoElement properties)
|
|
171
|
-
*/
|
|
172
|
-
__publicField(AeicoField, "props", {
|
|
173
|
-
value: { type: String },
|
|
174
|
-
defaultValue: { type: String },
|
|
175
|
-
resettable: { type: Boolean },
|
|
176
|
-
resetText: { type: String },
|
|
177
|
-
clearable: { type: Boolean },
|
|
178
|
-
clearText: { type: String },
|
|
179
|
-
size: { type: String },
|
|
180
|
-
disabled: { type: Boolean }
|
|
181
|
-
});
|
|
182
|
-
/**
|
|
183
|
-
* Property watchers
|
|
184
|
-
*/
|
|
185
|
-
__publicField(AeicoField, "watchers", {
|
|
186
|
-
disabled: "onDisabledChanged"
|
|
187
|
-
});
|
|
188
|
-
const styleVariables = `:root,
|
|
189
|
-
:host {
|
|
190
|
-
--ae-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
|
|
191
|
-
"Noto Sans", "Liberation Sans", Arial, sans-serif,
|
|
192
|
-
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
193
|
-
--ae-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas,
|
|
194
|
-
"Liberation Mono", "Courier New", monospace;
|
|
195
|
-
font-family: var(--ae-font-sans-serif);
|
|
196
|
-
--blue: #0e639c;
|
|
197
|
-
--green: #28a745;
|
|
198
|
-
--red: #dc3545;
|
|
199
|
-
--yellow: #ffc107;
|
|
200
|
-
--cyan: #17a2b8;
|
|
201
|
-
--gray: #6e6e6e;
|
|
202
|
-
--slate: #64748b;
|
|
203
|
-
--dark: #343a40;
|
|
204
|
-
--light: #f8f9fa;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
:root,
|
|
208
|
-
:host {
|
|
209
|
-
/* Blue */
|
|
210
|
-
--blue-100: color-mix(in srgb, var(--blue) 20%, white);
|
|
211
|
-
--blue-200: color-mix(in srgb, var(--blue) 40%, white);
|
|
212
|
-
--blue-300: color-mix(in srgb, var(--blue) 60%, white);
|
|
213
|
-
--blue-400: color-mix(in srgb, var(--blue) 80%, white);
|
|
214
|
-
--blue-500: var(--blue);
|
|
215
|
-
--blue-600: color-mix(in srgb, var(--blue) 80%, black);
|
|
216
|
-
--blue-700: color-mix(in srgb, var(--blue) 60%, black);
|
|
217
|
-
--blue-800: color-mix(in srgb, var(--blue) 40%, black);
|
|
218
|
-
--blue-900: color-mix(in srgb, var(--blue) 20%, black);
|
|
219
|
-
|
|
220
|
-
/* Green */
|
|
221
|
-
--green-100: color-mix(in srgb, var(--green) 20%, white);
|
|
222
|
-
--green-200: color-mix(in srgb, var(--green) 40%, white);
|
|
223
|
-
--green-300: color-mix(in srgb, var(--green) 60%, white);
|
|
224
|
-
--green-400: color-mix(in srgb, var(--green) 80%, white);
|
|
225
|
-
--green-500: var(--green);
|
|
226
|
-
--green-600: color-mix(in srgb, var(--green) 80%, black);
|
|
227
|
-
--green-700: color-mix(in srgb, var(--green) 60%, black);
|
|
228
|
-
--green-800: color-mix(in srgb, var(--green) 40%, black);
|
|
229
|
-
--green-900: color-mix(in srgb, var(--green) 20%, black);
|
|
230
|
-
|
|
231
|
-
/* Red */
|
|
232
|
-
--red-100: color-mix(in srgb, var(--red) 20%, white);
|
|
233
|
-
--red-200: color-mix(in srgb, var(--red) 40%, white);
|
|
234
|
-
--red-300: color-mix(in srgb, var(--red) 60%, white);
|
|
235
|
-
--red-400: color-mix(in srgb, var(--red) 80%, white);
|
|
236
|
-
--red-500: var(--red);
|
|
237
|
-
--red-600: color-mix(in srgb, var(--red) 80%, black);
|
|
238
|
-
--red-700: color-mix(in srgb, var(--red) 60%, black);
|
|
239
|
-
--red-800: color-mix(in srgb, var(--red) 40%, black);
|
|
240
|
-
--red-900: color-mix(in srgb, var(--red) 20%, black);
|
|
241
|
-
|
|
242
|
-
/* Yellow */
|
|
243
|
-
--yellow-100: color-mix(in srgb, var(--yellow) 20%, white);
|
|
244
|
-
--yellow-200: color-mix(in srgb, var(--yellow) 40%, white);
|
|
245
|
-
--yellow-300: color-mix(in srgb, var(--yellow) 60%, white);
|
|
246
|
-
--yellow-400: color-mix(in srgb, var(--yellow) 80%, white);
|
|
247
|
-
--yellow-500: var(--yellow);
|
|
248
|
-
--yellow-600: color-mix(in srgb, var(--yellow) 80%, black);
|
|
249
|
-
--yellow-700: color-mix(in srgb, var(--yellow) 60%, black);
|
|
250
|
-
--yellow-800: color-mix(in srgb, var(--yellow) 40%, black);
|
|
251
|
-
--yellow-900: color-mix(in srgb, var(--yellow) 20%, black);
|
|
252
|
-
|
|
253
|
-
/* Cyan */
|
|
254
|
-
--cyan-100: color-mix(in srgb, var(--cyan) 20%, white);
|
|
255
|
-
--cyan-200: color-mix(in srgb, var(--cyan) 40%, white);
|
|
256
|
-
--cyan-300: color-mix(in srgb, var(--cyan) 60%, white);
|
|
257
|
-
--cyan-400: color-mix(in srgb, var(--cyan) 80%, white);
|
|
258
|
-
--cyan-500: var(--cyan);
|
|
259
|
-
--cyan-600: color-mix(in srgb, var(--cyan) 80%, black);
|
|
260
|
-
--cyan-700: color-mix(in srgb, var(--cyan) 60%, black);
|
|
261
|
-
--cyan-800: color-mix(in srgb, var(--cyan) 40%, black);
|
|
262
|
-
--cyan-900: color-mix(in srgb, var(--cyan) 20%, black);
|
|
263
|
-
|
|
264
|
-
/* Gray (neutral — base #6e6e6e) */
|
|
265
|
-
--gray-100: color-mix(in srgb, var(--gray) 20%, white);
|
|
266
|
-
--gray-200: color-mix(in srgb, var(--gray) 40%, white);
|
|
267
|
-
--gray-300: color-mix(in srgb, var(--gray) 60%, white);
|
|
268
|
-
--gray-400: color-mix(in srgb, var(--gray) 80%, white);
|
|
269
|
-
--gray-500: var(--gray);
|
|
270
|
-
--gray-600: color-mix(in srgb, var(--gray) 80%, black);
|
|
271
|
-
--gray-700: color-mix(in srgb, var(--gray) 60%, black);
|
|
272
|
-
--gray-800: color-mix(in srgb, var(--gray) 40%, black);
|
|
273
|
-
--gray-900: color-mix(in srgb, var(--gray) 20%, black);
|
|
274
|
-
|
|
275
|
-
/* Slate (blue-gray — base #64748b, used for 'secondary') */
|
|
276
|
-
--slate-100: color-mix(in srgb, var(--slate) 20%, white);
|
|
277
|
-
--slate-200: color-mix(in srgb, var(--slate) 40%, white);
|
|
278
|
-
--slate-300: color-mix(in srgb, var(--slate) 60%, white);
|
|
279
|
-
--slate-400: color-mix(in srgb, var(--slate) 80%, white);
|
|
280
|
-
--slate-500: var(--slate);
|
|
281
|
-
--slate-600: color-mix(in srgb, var(--slate) 80%, black);
|
|
282
|
-
--slate-700: color-mix(in srgb, var(--slate) 60%, black);
|
|
283
|
-
--slate-800: color-mix(in srgb, var(--slate) 40%, black);
|
|
284
|
-
--slate-900: color-mix(in srgb, var(--slate) 20%, black);
|
|
285
|
-
|
|
286
|
-
/* Dark (base #343a40) */
|
|
287
|
-
--dark-100: color-mix(in srgb, var(--dark) 20%, white);
|
|
288
|
-
--dark-200: color-mix(in srgb, var(--dark) 40%, white);
|
|
289
|
-
--dark-300: color-mix(in srgb, var(--dark) 60%, white);
|
|
290
|
-
--dark-400: color-mix(in srgb, var(--dark) 80%, white);
|
|
291
|
-
--dark-500: var(--dark);
|
|
292
|
-
--dark-600: color-mix(in srgb, var(--dark) 80%, black);
|
|
293
|
-
--dark-700: color-mix(in srgb, var(--dark) 60%, black);
|
|
294
|
-
--dark-800: color-mix(in srgb, var(--dark) 40%, black);
|
|
295
|
-
--dark-900: color-mix(in srgb, var(--dark) 20%, black);
|
|
296
|
-
|
|
297
|
-
/* Light (base #f8f9fa) */
|
|
298
|
-
--light-100: color-mix(in srgb, var(--light) 20%, white);
|
|
299
|
-
--light-200: color-mix(in srgb, var(--light) 40%, white);
|
|
300
|
-
--light-300: color-mix(in srgb, var(--light) 60%, white);
|
|
301
|
-
--light-400: color-mix(in srgb, var(--light) 80%, white);
|
|
302
|
-
--light-500: var(--light);
|
|
303
|
-
--light-600: color-mix(in srgb, var(--light) 80%, black);
|
|
304
|
-
--light-700: color-mix(in srgb, var(--light) 60%, black);
|
|
305
|
-
--light-800: color-mix(in srgb, var(--light) 40%, black);
|
|
306
|
-
--light-900: color-mix(in srgb, var(--light) 20%, black);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
:root,
|
|
310
|
-
:host {
|
|
311
|
-
/* Hover / active mix (light default — overridden in § 6 dark) */
|
|
312
|
-
--color-mix-hover: black 10%;
|
|
313
|
-
--color-mix-active: black 20%;
|
|
314
|
-
|
|
315
|
-
/* Primary (Blue) */
|
|
316
|
-
--color-primary: var(--blue-500);
|
|
317
|
-
--color-primary-hover: color-mix(in srgb, var(--color-primary), var(--color-mix-hover));
|
|
318
|
-
--color-primary-active: color-mix(in srgb, var(--color-primary), var(--color-mix-active));
|
|
319
|
-
--color-primary-disabled: color-mix(in srgb, var(--blue) 50%, var(--gray-500));
|
|
320
|
-
|
|
321
|
-
/* Success (Green) */
|
|
322
|
-
--color-success: var(--green-500);
|
|
323
|
-
--color-success-hover: color-mix(in srgb, var(--color-success), var(--color-mix-hover));
|
|
324
|
-
--color-success-active: color-mix(in srgb, var(--color-success), var(--color-mix-active));
|
|
325
|
-
--color-success-disabled: color-mix(in srgb, var(--green) 50%, var(--gray-500));
|
|
326
|
-
|
|
327
|
-
/* Danger (Red) */
|
|
328
|
-
--color-danger: var(--red-500);
|
|
329
|
-
--color-danger-hover: color-mix(in srgb, var(--color-danger), var(--color-mix-hover));
|
|
330
|
-
--color-danger-active: color-mix(in srgb, var(--color-danger), var(--color-mix-active));
|
|
331
|
-
--color-danger-disabled: color-mix(in srgb, var(--red) 50%, var(--gray-500));
|
|
332
|
-
|
|
333
|
-
/* Warning (Yellow) */
|
|
334
|
-
--color-warning: var(--yellow-500);
|
|
335
|
-
--color-warning-hover: color-mix(in srgb, var(--color-warning), var(--color-mix-hover));
|
|
336
|
-
--color-warning-active: color-mix(in srgb, var(--color-warning), var(--color-mix-active));
|
|
337
|
-
--color-warning-disabled: color-mix(in srgb, var(--yellow) 50%, var(--gray-500));
|
|
338
|
-
|
|
339
|
-
/* Info (Cyan) */
|
|
340
|
-
--color-info: var(--cyan-500);
|
|
341
|
-
--color-info-hover: color-mix(in srgb, var(--color-info), var(--color-mix-hover));
|
|
342
|
-
--color-info-active: color-mix(in srgb, var(--color-info), var(--color-mix-active));
|
|
343
|
-
--color-info-disabled: color-mix(in srgb, var(--cyan) 50%, var(--gray-500));
|
|
344
|
-
|
|
345
|
-
/* Secondary (Slate) — base differs per theme, overridden in § 6 dark */
|
|
346
|
-
--color-secondary: var(--slate-500);
|
|
347
|
-
--color-secondary-hover: color-mix(in srgb, var(--color-secondary), var(--color-mix-hover));
|
|
348
|
-
--color-secondary-active: color-mix(in srgb, var(--color-secondary), var(--color-mix-active));
|
|
349
|
-
--color-secondary-text: var(--slate-700);
|
|
350
|
-
|
|
351
|
-
/* On-solid — text color on filled (saturated) backgrounds.
|
|
352
|
-
Fixed white: blue/green/red/cyan buttons always have white text.
|
|
353
|
-
Does NOT follow --color-text-main. */
|
|
354
|
-
--color-on-solid: white;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
.theme-light,
|
|
359
|
-
:root[theme="light"],
|
|
360
|
-
:host([theme="light"]),
|
|
361
|
-
:host-context([theme="light"]),
|
|
362
|
-
:where(:root),
|
|
363
|
-
:host {
|
|
364
|
-
color-scheme: light;
|
|
365
|
-
|
|
366
|
-
/* Gray UI aliases — lighter palette steps for elements on white background */
|
|
367
|
-
--color-gray-dark: var(--gray-400);
|
|
368
|
-
--color-gray: var(--gray-300);
|
|
369
|
-
--color-gray-light: var(--gray-200);
|
|
370
|
-
--color-gray-lighter: var(--gray-100);
|
|
371
|
-
--color-gray-lightest: color-mix(in srgb, var(--gray) 10%, white);
|
|
372
|
-
|
|
373
|
-
/* Text */
|
|
374
|
-
--color-text-main: var(--dark-700);
|
|
375
|
-
--color-text-muted: var(--gray-600);
|
|
376
|
-
--color-text-disabled: var(--gray-300);
|
|
377
|
-
--color-text-link: var(--blue-500);
|
|
378
|
-
--color-text-link-hover: var(--blue-700);
|
|
379
|
-
|
|
380
|
-
/* Surfaces */
|
|
381
|
-
--surface-sunken: var(--light-500);
|
|
382
|
-
--surface-base: white;
|
|
383
|
-
--surface-raised: var(--light-500);
|
|
384
|
-
--surface-overlay: white;
|
|
385
|
-
--color-overlay: rgba(0, 0, 0, 0.4);
|
|
386
|
-
|
|
387
|
-
/* Borders */
|
|
388
|
-
--border-subtle: rgba(0, 0, 0, 0.08);
|
|
389
|
-
--border-default: rgba(0, 0, 0, 0.15);
|
|
390
|
-
--border-hover: rgba(0, 0, 0, 0.25);
|
|
391
|
-
--border-focus: var(--color-primary);
|
|
392
|
-
--border-disabled: rgba(0, 0, 0, 0.06);
|
|
393
|
-
|
|
394
|
-
/* Focus ring */
|
|
395
|
-
--focus-ring: rgb(from var(--blue) r g b / 0.30);
|
|
396
|
-
--focus-ring-sm: rgb(from var(--blue) r g b / 0.15);
|
|
397
|
-
|
|
398
|
-
/* Subtle intent tokens — light context */
|
|
399
|
-
--color-primary-bg-subtle: rgb(from var(--blue) r g b / 0.08);
|
|
400
|
-
--color-primary-border-subtle: rgb(from var(--blue) r g b / 0.40);
|
|
401
|
-
--color-primary-text-emphasis: var(--blue-700);
|
|
402
|
-
|
|
403
|
-
--color-success-bg-subtle: rgb(from var(--green) r g b / 0.08);
|
|
404
|
-
--color-success-border-subtle: rgb(from var(--green) r g b / 0.40);
|
|
405
|
-
--color-success-text-emphasis: var(--green-700);
|
|
406
|
-
|
|
407
|
-
--color-danger-bg-subtle: rgb(from var(--red) r g b / 0.08);
|
|
408
|
-
--color-danger-border-subtle: rgb(from var(--red) r g b / 0.40);
|
|
409
|
-
--color-danger-text-emphasis: var(--red-700);
|
|
410
|
-
|
|
411
|
-
--color-warning-bg-subtle: rgb(from var(--yellow) r g b / 0.08);
|
|
412
|
-
--color-warning-border-subtle: rgb(from var(--yellow) r g b / 0.40);
|
|
413
|
-
--color-warning-text-emphasis: var(--yellow-700);
|
|
414
|
-
|
|
415
|
-
--color-info-bg-subtle: rgb(from var(--cyan) r g b / 0.08);
|
|
416
|
-
--color-info-border-subtle: rgb(from var(--cyan) r g b / 0.40);
|
|
417
|
-
--color-info-text-emphasis: var(--cyan-700);
|
|
418
|
-
|
|
419
|
-
--color-secondary-bg-subtle: rgb(from var(--slate) r g b / 0.08);
|
|
420
|
-
--color-secondary-border-subtle: rgb(from var(--slate) r g b / 0.40);
|
|
421
|
-
--color-secondary-text-emphasis: var(--slate-700);
|
|
422
|
-
|
|
423
|
-
--color-light-bg-subtle: var(--gray-100); /* opaque on white: ~#e2e2e2 */
|
|
424
|
-
--color-light-border-subtle: var(--gray-200); /* opaque on white: ~#c4c4c4 */
|
|
425
|
-
|
|
426
|
-
--color-dark-bg-subtle: var(--dark-100); /* opaque on white: ~#d6d8d9 */
|
|
427
|
-
--color-dark-border-subtle: var(--dark-300); /* opaque on white: ~#85898c */
|
|
428
|
-
|
|
429
|
-
/* Component tokens — light defaults */
|
|
430
|
-
--action-btn-bg: var(--gray-200);
|
|
431
|
-
--action-btn-bg-hover: var(--color-primary);
|
|
432
|
-
--action-btn-color: var(--gray-600);
|
|
433
|
-
--action-btn-color-hover: white;
|
|
434
|
-
|
|
435
|
-
--clear-btn-bg-hover: var(--color-danger);
|
|
436
|
-
--clear-btn-color-hover: white;
|
|
437
|
-
|
|
438
|
-
--reset-btn-border-radius: 2px;
|
|
439
|
-
--reset-btn-bg: var(--action-btn-bg);
|
|
440
|
-
--reset-btn-bg-hover: var(--action-btn-bg-hover);
|
|
441
|
-
--reset-btn-color: var(--action-btn-color);
|
|
442
|
-
--reset-btn-color-hover: var(--action-btn-color-hover);
|
|
443
|
-
--reset-btn-transition: all 0.12s;
|
|
444
|
-
|
|
445
|
-
--clear-btn-border-radius: 2px;
|
|
446
|
-
--clear-btn-bg: var(--action-btn-bg);
|
|
447
|
-
--clear-btn-color: var(--action-btn-color);
|
|
448
|
-
--clear-btn-transition: all 0.12s;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
:root,
|
|
452
|
-
:host {
|
|
453
|
-
--size-scale: 1;
|
|
454
|
-
--size-base: calc(1rem * var(--size-scale)); /* 16px */
|
|
455
|
-
--size-xl: round(calc(var(--size-l) * 1.125), 1px); /* 23px */
|
|
456
|
-
--size-l: round(calc(var(--size-m) * 1.125 * 1.125), 1px); /* 20px */
|
|
457
|
-
--size-m: var(--size-base); /* 16px */
|
|
458
|
-
--size-s: round(calc(var(--size-m) / 1.125), 1px); /* 14px */
|
|
459
|
-
--size-xs: round(calc(var(--size-s) / 1.125), 1px); /* 12px */
|
|
460
|
-
--size-2xs: round(calc(var(--size-xs) / 1.125), 1px); /* 11px */
|
|
461
|
-
--size-3xs: round(calc(var(--size-2xs) / 1.125), 1px); /* 10px */
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
/* Layout tokens — defined on :root so all light DOM elements can use them */
|
|
465
|
-
:root,
|
|
466
|
-
:host {
|
|
467
|
-
--container-max-width: 1280px;
|
|
468
|
-
--container-padding-x: 1.5rem;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
.theme-dark,
|
|
472
|
-
:root[theme="dark"],
|
|
473
|
-
:host([theme="dark"]),
|
|
474
|
-
:host-context([theme="dark"]) {
|
|
475
|
-
color-scheme: dark;
|
|
476
|
-
|
|
477
|
-
/* Hover / active — slightly gentler on dark backgrounds */
|
|
478
|
-
--color-mix-hover: black 8%;
|
|
479
|
-
--color-mix-active: black 16%;
|
|
480
|
-
|
|
481
|
-
/* Gray UI aliases — darker palette steps for elements on dark background */
|
|
482
|
-
--color-gray-dark: var(--gray-800);
|
|
483
|
-
--color-gray: var(--gray-700);
|
|
484
|
-
--color-gray-light: var(--gray-600);
|
|
485
|
-
--color-gray-lighter: var(--gray-500);
|
|
486
|
-
--color-gray-lightest: var(--gray-400);
|
|
487
|
-
|
|
488
|
-
/* Secondary — deeper base on dark background */
|
|
489
|
-
--color-secondary: var(--slate-700);
|
|
490
|
-
--color-secondary-text: var(--slate-300);
|
|
491
|
-
|
|
492
|
-
/* Text */
|
|
493
|
-
--color-text-main: white;
|
|
494
|
-
--color-text-muted: var(--gray-200);
|
|
495
|
-
--color-text-disabled: var(--gray-500);
|
|
496
|
-
--color-text-link: var(--blue-300);
|
|
497
|
-
--color-text-link-hover: var(--blue-200);
|
|
498
|
-
|
|
499
|
-
/* Surfaces */
|
|
500
|
-
--surface-sunken: var(--gray-900);
|
|
501
|
-
--surface-base: color-mix(in srgb, var(--gray) 27%, black);
|
|
502
|
-
--surface-raised: color-mix(in srgb, var(--gray) 34%, black);
|
|
503
|
-
--surface-overlay: color-mix(in srgb, var(--gray) 38%, black);
|
|
504
|
-
--color-overlay: rgba(0, 0, 0, 0.6);
|
|
505
|
-
|
|
506
|
-
/* Borders */
|
|
507
|
-
--border-subtle: rgba(255, 255, 255, 0.08);
|
|
508
|
-
--border-default: rgba(255, 255, 255, 0.12);
|
|
509
|
-
--border-hover: rgba(255, 255, 255, 0.20);
|
|
510
|
-
--border-focus: var(--color-primary);
|
|
511
|
-
--border-disabled: rgba(255, 255, 255, 0.06);
|
|
512
|
-
|
|
513
|
-
/* Focus ring */
|
|
514
|
-
--focus-ring: rgb(from var(--blue) r g b / 0.25);
|
|
515
|
-
--focus-ring-sm: rgb(from var(--blue) r g b / 0.10);
|
|
516
|
-
|
|
517
|
-
/* Subtle intent tokens — dark context (more alpha, lighter text-emphasis) */
|
|
518
|
-
--color-primary-bg-subtle: rgb(from var(--blue) r g b / 0.10);
|
|
519
|
-
--color-primary-border-subtle: rgb(from var(--blue) r g b / 0.30);
|
|
520
|
-
--color-primary-text-emphasis: var(--blue-300);
|
|
521
|
-
|
|
522
|
-
--color-success-bg-subtle: rgb(from var(--green) r g b / 0.10);
|
|
523
|
-
--color-success-border-subtle: rgb(from var(--green) r g b / 0.30);
|
|
524
|
-
--color-success-text-emphasis: var(--green-300);
|
|
525
|
-
|
|
526
|
-
--color-danger-bg-subtle: rgb(from var(--red) r g b / 0.10);
|
|
527
|
-
--color-danger-border-subtle: rgb(from var(--red) r g b / 0.30);
|
|
528
|
-
--color-danger-text-emphasis: var(--red-300);
|
|
529
|
-
|
|
530
|
-
--color-warning-bg-subtle: rgb(from var(--yellow) r g b / 0.10);
|
|
531
|
-
--color-warning-border-subtle: rgb(from var(--yellow) r g b / 0.30);
|
|
532
|
-
--color-warning-text-emphasis: var(--yellow-300);
|
|
533
|
-
|
|
534
|
-
--color-info-bg-subtle: rgb(from var(--cyan) r g b / 0.10);
|
|
535
|
-
--color-info-border-subtle: rgb(from var(--cyan) r g b / 0.30);
|
|
536
|
-
--color-info-text-emphasis: var(--cyan-300);
|
|
537
|
-
|
|
538
|
-
--color-secondary-bg-subtle: rgb(from var(--slate) r g b / 0.10);
|
|
539
|
-
--color-secondary-border-subtle: rgb(from var(--slate) r g b / 0.30);
|
|
540
|
-
--color-secondary-text-emphasis: var(--slate-300);
|
|
541
|
-
|
|
542
|
-
--color-light-bg-subtle: rgb(from var(--light) r g b / 0.20);
|
|
543
|
-
--color-light-border-subtle: rgb(from var(--light) r g b / 0.25);
|
|
544
|
-
|
|
545
|
-
--color-dark-bg-subtle: rgb(from var(--dark) r g b / 0.30);
|
|
546
|
-
--color-dark-border-subtle: rgb(from var(--dark) r g b / 0.50);
|
|
547
|
-
|
|
548
|
-
/* Component tokens — dark overrides */
|
|
549
|
-
--action-btn-bg: var(--color-gray);
|
|
550
|
-
--action-btn-bg-hover: color-mix(in srgb, var(--blue) 25%, var(--gray-800));
|
|
551
|
-
--action-btn-color: var(--gray-400);
|
|
552
|
-
--action-btn-color-hover: var(--cyan-300);
|
|
553
|
-
--clear-btn-bg-hover: color-mix(in srgb, var(--red) 25%, var(--gray-800));
|
|
554
|
-
--clear-btn-color-hover: var(--red-300);
|
|
555
|
-
}
|
|
556
|
-
`;
|
|
557
|
-
const sizeCSS = ':host([size="xs"]) { font-size: var(--size-xs); }\n:host([size="sm"]) { font-size: var(--size-s); }\n:host([size="md"]) { font-size: var(--size-m); }\n:host([size="lg"]) { font-size: var(--size-l); }\n:host([size="xl"]) { font-size: var(--size-xl); }\n:host([size="3xs"]) { font-size: var(--size-3xs); }\n:host([size="2xs"]) { font-size: var(--size-2xs); }\n';
|
|
558
|
-
const style$a = ":host {\n display: block;\n flex: 1;\n min-width: 0;\n font-size: var(--size-base);\n\n /* Layout variables */\n --input-field-gap: 4px;\n \n /* Input element variables */\n --input-font-size: 1em;\n --input-padding: 0.333em 0.583em;\n --input-border-width: 1px;\n --input-border-radius: 2px;\n --input-border-color: var(--border-subtle);\n --input-border-color-hover: var(--border-default);\n --input-border-color-focus: var(--border-focus);\n --input-bg: var(--surface-base);\n --input-bg-hover: var(--surface-raised);\n --input-bg-focus: var(--surface-raised);\n --input-color: var(--color-text-muted);\n --input-placeholder-color: var(--color-text-disabled);\n --input-transition: border-color 0.12s, background 0.12s;\n}\n\n.input-container {\n display: flex;\n align-items: center;\n gap: var(--input-field-gap);\n width: 100%;\n}\n\ninput {\n flex: 1;\n min-width: 0;\n font-size: var(--input-font-size);\n padding: var(--input-padding);\n border: var(--input-border-width) solid var(--input-border-color);\n border-radius: var(--input-border-radius);\n background: var(--input-bg);\n color: var(--input-color);\n transition: var(--input-transition);\n}\n\ninput::placeholder {\n color: var(--input-placeholder-color);\n}\n\ninput:focus {\n outline: none;\n border-color: var(--input-border-color-focus);\n background: var(--input-bg-focus);\n}\n\ninput:hover:not(:focus) {\n border-color: var(--input-border-color-hover);\n background: var(--input-bg-hover);\n}\n\ninput:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Clear button styles */\n.clear-btn {\n width: 1.333em;\n height: 1.333em;\n border: none;\n border-radius: var(--clear-btn-border-radius);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--clear-btn-bg);\n color: var(--clear-btn-color);\n transition: var(--clear-btn-transition);\n flex-shrink: 0;\n line-height: 1;\n}\n\n.clear-btn:hover {\n background: var(--clear-btn-bg-hover);\n color: var(--clear-btn-color-hover);\n}\n\n/* Reset button styles */\n.reset-btn {\n width: 1.333em;\n height: 1.333em;\n border: none;\n border-radius: var(--reset-btn-border-radius);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--reset-btn-bg);\n color: var(--reset-btn-color);\n transition: var(--reset-btn-transition);\n flex-shrink: 0;\n line-height: 1;\n}\n\n.reset-btn:hover {\n background: var(--reset-btn-bg-hover);\n color: var(--reset-btn-color-hover);\n}\n\n\n\n";
|
|
559
|
-
class TextInput extends AeicoField {
|
|
560
|
-
constructor() {
|
|
561
|
-
super(...arguments);
|
|
562
|
-
__publicField(this, "fieldElement", null);
|
|
563
|
-
}
|
|
564
|
-
render() {
|
|
565
|
-
return html(({ div, input }) => {
|
|
566
|
-
div({ className: "input-container" }, () => {
|
|
567
|
-
this.fieldElement = input({
|
|
568
|
-
type: this.type || "text",
|
|
569
|
-
placeholder: this.placeholder || "",
|
|
570
|
-
"@input": this.boundOnChange
|
|
571
|
-
});
|
|
572
|
-
this.renderActionButtons();
|
|
573
|
-
});
|
|
574
|
-
if (this.fieldElement && this.value != null) {
|
|
575
|
-
this.fieldElement.value = String(this.value);
|
|
576
|
-
}
|
|
577
|
-
this.updateClearButtonVisibility();
|
|
578
|
-
});
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* Update clear button visibility based on input value
|
|
582
|
-
*/
|
|
583
|
-
updateClearButtonVisibility() {
|
|
584
|
-
if (this.clearBtn && this.fieldElement) {
|
|
585
|
-
const hasValue = this.fieldElement.value.length > 0;
|
|
586
|
-
this.clearBtn.style.display = hasValue ? "" : "none";
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* Write value to the input element (DOM only)
|
|
591
|
-
*/
|
|
592
|
-
writeValue(value) {
|
|
593
|
-
const strValue = String(value || "");
|
|
594
|
-
if (this.fieldElement) {
|
|
595
|
-
this.fieldElement.value = strValue;
|
|
596
|
-
}
|
|
597
|
-
this.updateClearButtonVisibility();
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
__publicField(TextInput, "tagName", "text-input");
|
|
601
|
-
__publicField(TextInput, "props", {
|
|
602
|
-
placeholder: { type: String },
|
|
603
|
-
type: { type: String }
|
|
604
|
-
});
|
|
605
|
-
__publicField(TextInput, "styles", [styleVariables, sizeCSS, style$a]);
|
|
606
|
-
TextInput.register();
|
|
607
|
-
const style$9 = ":host {\n display: block;\n flex: 1;\n min-width: 0;\n font-size: var(--size-base);\n\n /* Layout variables */\n --select-field-gap: 2px;\n\n /* Trigger variables */\n --select-font-size: 1em;\n --select-padding: 0.333em 0.583em;\n --select-border-width: 1px;\n --select-border-radius: 2px;\n --select-border-color: var(--border-subtle);\n --select-border-color-hover: var(--border-default);\n --select-border-color-focus: var(--border-focus);\n --select-bg: var(--surface-base);\n --select-bg-hover: var(--surface-raised);\n --select-bg-focus: var(--surface-raised);\n --select-color: var(--color-text-muted);\n --select-transition: border-color 0.12s, background 0.12s;\n\n /* Arrow */\n --select-arrow-color: var(--color-text-muted);\n --select-arrow-size: 0.75em;\n\n /* Dropdown */\n --select-dropdown-bg: var(--surface-overlay);\n --select-dropdown-border: var(--border-default);\n --select-dropdown-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n --select-dropdown-border-radius: 2px;\n --select-dropdown-max-height: 240px;\n --select-dropdown-z-index: 1000;\n}\n\n.container {\n display: flex;\n align-items: center;\n gap: var(--select-field-gap);\n width: 100%;\n position: relative;\n}\n\n.trigger {\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 0.333em;\n font-size: var(--select-font-size);\n padding: var(--select-padding);\n border: var(--select-border-width) solid var(--select-border-color);\n border-radius: var(--select-border-radius);\n background: var(--select-bg);\n color: var(--select-color);\n cursor: pointer;\n transition: var(--select-transition);\n user-select: none;\n outline: none;\n box-sizing: border-box;\n}\n\n.trigger:hover:not(.disabled) {\n border-color: var(--select-border-color-hover);\n background: var(--select-bg-hover);\n}\n\n.trigger.open {\n border-color: var(--select-border-color-focus);\n background: var(--select-bg-focus);\n}\n\n.trigger.disabled {\n opacity: 0.5;\n cursor: default;\n pointer-events: none;\n}\n\n.value {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.placeholder {\n color: var(--color-text-disabled);\n}\n\n.selected-list {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n align-items: center;\n padding: 2px 0;\n}\n\n/* Non-expandable (default): single-row, clip overflow */\n.trigger:has(.selected-list--clipped) {\n flex-wrap: nowrap;\n}\n\n.selected-list--clipped {\n flex-wrap: nowrap;\n overflow: hidden;\n}\n\n.overflow-indicator {\n flex-shrink: 0;\n align-self: center;\n padding: 1px 6px;\n background: color-mix(in srgb, var(--color-primary) 12%, transparent);\n color: var(--color-primary);\n border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);\n border-radius: 3px;\n font-size: 0.82em;\n line-height: 1.6;\n cursor: default;\n user-select: none;\n}\n\n.arrow {\n flex-shrink: 0;\n align-self: center;\n font-size: var(--select-arrow-size);\n color: var(--select-arrow-color);\n transition: transform 0.12s;\n pointer-events: none;\n line-height: 1;\n}\n\n.trigger.open .arrow {\n transform: rotate(180deg);\n}\n\n.dropdown {\n display: none;\n position: absolute;\n z-index: var(--select-dropdown-z-index);\n background: var(--select-dropdown-bg);\n border: 1px solid var(--select-dropdown-border);\n border-radius: var(--select-dropdown-border-radius);\n box-shadow: var(--select-dropdown-shadow);\n max-height: var(--select-dropdown-max-height);\n overflow-y: auto;\n min-width: 100%;\n box-sizing: border-box;\n}\n\n.dropdown.open {\n display: block;\n}\n\n.dropdown.position-bottom {\n top: 100%;\n left: 0;\n margin-top: 2px;\n}\n\n.dropdown.position-top {\n bottom: 100%;\n left: 0;\n margin-bottom: 2px;\n}\n\n.dropdown.position-left {\n right: 100%;\n top: 0;\n margin-right: 2px;\n}\n\n.dropdown.position-right {\n left: 100%;\n top: 0;\n margin-left: 2px;\n}\n\n.clear-btn {\n width: 1.333em;\n height: 1.333em;\n border: none;\n border-radius: var(--clear-btn-border-radius);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--clear-btn-bg);\n color: var(--clear-btn-color);\n transition: var(--clear-btn-transition);\n flex-shrink: 0;\n line-height: 1;\n}\n\n.clear-btn:hover {\n background: var(--clear-btn-bg-hover);\n color: var(--clear-btn-color-hover);\n}\n\n.reset-btn {\n width: 1.333em;\n height: 1.333em;\n border: none;\n border-radius: var(--reset-btn-border-radius);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--reset-btn-bg);\n color: var(--reset-btn-color);\n transition: var(--reset-btn-transition);\n flex-shrink: 0;\n}\n\n.reset-btn:hover {\n background: var(--reset-btn-bg-hover);\n color: var(--reset-btn-color-hover);\n}\n";
|
|
608
|
-
const colorCSS = ':host {\n --color-solid: var(--color-gray);\n --color-solid-hover: color-mix(in srgb, var(--color-solid), var(--color-mix-hover));\n --color-solid-active: color-mix(in srgb, var(--color-solid), var(--color-mix-active));\n --color-on-solid: var(--color-text-main);\n --color-border: var(--color-gray);\n --color-border-hover: color-mix(in srgb, var(--color-border), var(--color-mix-hover));\n --color-accent: var(--color-text-muted);\n --color-accent-hover: var(--color-text-main);\n --color-subtle: var(--border-subtle);\n --color-subtle-hover: var(--border-default);\n --color-bg-subtle: var(--border-subtle);\n --color-text-subtle: var(--color-text-muted);\n --color-border-subtle: var(--border-default);\n}\n\n:host([color="primary"]) {\n --color-solid: var(--color-primary);\n --color-on-solid: white;\n --color-border: var(--color-primary);\n --color-accent: var(--color-text-link);\n --color-accent-hover: var(--color-text-link-hover);\n --color-subtle: var(--color-primary-bg-subtle);\n --color-subtle-hover: rgb(from var(--blue) r g b / 0.15);\n --color-bg-subtle: var(--color-primary-bg-subtle);\n --color-text-subtle: var(--color-primary-text-emphasis);\n --color-border-subtle: var(--color-primary-border-subtle);\n}\n\n:host([color="secondary"]) {\n --color-solid: var(--color-secondary);\n --color-on-solid: white;\n --color-border: var(--color-secondary-hover);\n --color-accent: var(--color-secondary-text-emphasis);\n --color-accent-hover: var(--color-text-main);\n --color-subtle: rgb(from var(--slate) r g b / 0.06);\n --color-subtle-hover: rgb(from var(--slate) r g b / 0.12);\n --color-bg-subtle: var(--color-secondary-bg-subtle);\n --color-text-subtle: var(--color-secondary-text-emphasis);\n --color-border-subtle: var(--color-secondary-border-subtle);\n}\n\n:host([color="success"]) {\n --color-solid: var(--color-success);\n --color-on-solid: white;\n --color-border: var(--color-success);\n --color-accent: var(--color-success-text-emphasis);\n --color-accent-hover: var(--color-success-hover);\n --color-subtle: var(--color-success-bg-subtle);\n --color-subtle-hover: rgb(from var(--green) r g b / 0.15);\n --color-bg-subtle: var(--color-success-bg-subtle);\n --color-text-subtle: var(--color-success-text-emphasis);\n --color-border-subtle: var(--color-success-border-subtle);\n}\n\n:host([color="danger"]) {\n --color-solid: var(--color-danger);\n --color-on-solid: white;\n --color-border: var(--color-danger);\n --color-accent: var(--color-danger-text-emphasis);\n --color-accent-hover: var(--color-danger-hover);\n --color-subtle: var(--color-danger-bg-subtle);\n --color-subtle-hover: rgb(from var(--red) r g b / 0.15);\n --color-bg-subtle: var(--color-danger-bg-subtle);\n --color-text-subtle: var(--color-danger-text-emphasis);\n --color-border-subtle: var(--color-danger-border-subtle);\n}\n\n:host([color="warning"]) {\n --color-solid: var(--color-warning);\n --color-on-solid: var(--gray-900);\n --color-border: var(--color-warning);\n --color-accent: var(--color-warning-text-emphasis);\n --color-accent-hover: var(--color-warning-hover);\n --color-subtle: var(--color-warning-bg-subtle);\n --color-subtle-hover: rgb(from var(--yellow) r g b / 0.15);\n --color-bg-subtle: var(--color-warning-bg-subtle);\n --color-text-subtle: var(--color-warning-text-emphasis);\n --color-border-subtle: var(--color-warning-border-subtle);\n}\n\n:host([color="info"]) {\n --color-solid: var(--color-info);\n --color-on-solid: white;\n --color-border: var(--color-info);\n --color-accent: var(--color-info-text-emphasis);\n --color-accent-hover: var(--color-info-hover);\n --color-subtle: var(--color-info-bg-subtle);\n --color-subtle-hover: rgb(from var(--cyan) r g b / 0.15);\n --color-bg-subtle: var(--color-info-bg-subtle);\n --color-text-subtle: var(--color-info-text-emphasis);\n --color-border-subtle: var(--color-info-border-subtle);\n}\n\n:host([color="light"]) {\n --color-solid: var(--light);\n --color-on-solid: var(--gray-900);\n --color-border: var(--border-hover);\n --color-subtle: var(--color-light-bg-subtle);\n --color-subtle-hover: var(--color-light-border-subtle);\n --color-bg-subtle: var(--color-light-bg-subtle);\n --color-text-subtle: var(--color-text-muted);\n --color-border-subtle: var(--color-light-border-subtle);\n}\n\n:host([color="dark"]) {\n --color-solid: var(--dark-500);\n --color-on-solid: white;\n --color-border: var(--dark-500);\n --color-accent: var(--color-text-main);\n --color-accent-hover: var(--color-text-main);\n --color-subtle: var(--color-dark-bg-subtle);\n --color-subtle-hover: var(--color-dark-border-subtle);\n --color-bg-subtle: var(--color-dark-bg-subtle);\n --color-text-subtle: var(--color-text-main);\n --color-border-subtle: var(--color-dark-border-subtle);\n}\n';
|
|
609
|
-
const tagStyle = ':host {\n display: inline-flex;\n align-items: center;\n --tag-solid-bg: var(--color-solid);\n --tag-solid-color: var(--color-on-solid);\n --tag-border: var(--color-border);\n --tag-accent: var(--color-accent);\n --tag-subtle-bg: var(--color-bg-subtle);\n --tag-subtle-color: var(--color-text-subtle);\n --tag-subtle-border: var(--color-border-subtle);\n}\n\n.tag {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n font-family: inherit;\n font-weight: 500;\n white-space: nowrap;\n vertical-align: middle;\n line-height: 1.2;\n font-size: 1em;\n padding: 0.15em 0.5em 0.15em 0.6em;\n border-radius: 4px;\n border: 1px solid var(--tag-solid-bg);\n background: var(--tag-solid-bg);\n color: var(--tag-solid-color);\n max-width: 160px;\n min-width: 0;\n}\n\n:host([variant="outlined"]) .tag {\n background: transparent;\n border-color: var(--tag-border);\n color: var(--tag-accent);\n}\n\n:host([variant="faint"]) .tag {\n background: var(--tag-subtle-bg);\n border-color: var(--tag-subtle-border);\n color: var(--tag-subtle-color);\n}\n\n:host([variant="subtle"]) .tag {\n background: var(--tag-subtle-bg);\n border-color: transparent;\n color: var(--tag-subtle-color);\n}\n\n:host([variant="text"]) .tag {\n background: transparent;\n border-color: transparent;\n color: var(--tag-accent);\n padding-left: 0;\n padding-right: 0;\n}\n\n\n:host([pill]) .tag { border-radius: 999px; }\n\n.tag-content {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n::slotted(ae-icon) { font-size: 1.1em; }\n\n.tag-dismiss {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n opacity: 0.55;\n line-height: 1;\n font-size: 1em;\n padding: 0 1px;\n border-radius: 2px;\n background: transparent;\n border: none;\n color: inherit;\n font-family: inherit;\n transition: opacity 0.1s, background 0.1s;\n}\n\n:host([dismissible]) .tag-dismiss {\n display: inline-flex;\n}\n\n.tag-dismiss:hover {\n opacity: 1;\n background: color-mix(in srgb, currentColor 15%, transparent);\n}\n\n/* disabled: button remains visible but is inert */\n:host([disabled]) .tag-dismiss {\n opacity: 0.4;\n pointer-events: none;\n cursor: default;\n}\n\n:host([disabled]) .tag {\n opacity: 0.6;\n}\n';
|
|
610
|
-
var __create$d = Object.create;
|
|
611
|
-
var __defProp$d = Object.defineProperty;
|
|
612
|
-
var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
|
|
613
|
-
var __knownSymbol$d = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
614
|
-
var __typeError$d = (msg) => {
|
|
615
|
-
throw TypeError(msg);
|
|
616
|
-
};
|
|
617
|
-
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
618
|
-
var __decoratorStart$d = (base) => [, , , __create$d((base == null ? void 0 : base[__knownSymbol$d("metadata")]) ?? null)];
|
|
619
|
-
var __decoratorStrings$d = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
620
|
-
var __expectFn$d = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$d("Function expected") : fn;
|
|
621
|
-
var __decoratorContext$d = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$d[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$d("Already initialized") : fns.push(__expectFn$d(fn || null)) });
|
|
622
|
-
var __decoratorMetadata$d = (array, target) => __defNormalProp$d(target, __knownSymbol$d("metadata"), array[3]);
|
|
623
|
-
var __runInitializers$d = (array, flags, self, value) => {
|
|
624
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
625
|
-
return value;
|
|
626
|
-
};
|
|
627
|
-
var __decorateElement$d = (array, flags, name, decorators, target, extra) => {
|
|
628
|
-
var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
|
|
629
|
-
var j = array.length + 1, key = __decoratorStrings$d[k + 5];
|
|
630
|
-
var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
|
|
631
|
-
var desc = (target = target.prototype, __getOwnPropDesc$c({ get [name]() {
|
|
632
|
-
return __privateGet$c(this, extra);
|
|
633
|
-
}, set [name](x) {
|
|
634
|
-
return __privateSet$c(this, extra, x);
|
|
635
|
-
} }, name));
|
|
636
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
637
|
-
ctx = __decoratorContext$d(k, name, done = {}, array[3], extraInitializers);
|
|
638
|
-
{
|
|
639
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
|
|
640
|
-
access.get = (x) => x[name];
|
|
641
|
-
access.set = (x, y) => x[name] = y;
|
|
642
|
-
}
|
|
643
|
-
it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
|
|
644
|
-
if (it === void 0) __expectFn$d(it) && (desc[key] = it);
|
|
645
|
-
else if (typeof it !== "object" || it === null) __typeError$d("Object expected");
|
|
646
|
-
else __expectFn$d(fn = it.get) && (desc.get = fn), __expectFn$d(fn = it.set) && (desc.set = fn), __expectFn$d(fn = it.init) && initializers.unshift(fn);
|
|
647
|
-
}
|
|
648
|
-
return desc && __defProp$d(target, name, desc), target;
|
|
649
|
-
};
|
|
650
|
-
var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, key + "", value);
|
|
651
|
-
var __accessCheck$c = (obj, member, msg) => member.has(obj) || __typeError$d("Cannot " + msg);
|
|
652
|
-
var __privateGet$c = (obj, member, getter) => (__accessCheck$c(obj, member, "read from private field"), member.get(obj));
|
|
653
|
-
var __privateAdd$c = (obj, member, value) => member.has(obj) ? __typeError$d("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
654
|
-
var __privateSet$c = (obj, member, value, setter) => (__accessCheck$c(obj, member, "write to private field"), member.set(obj, value), value);
|
|
655
|
-
var _pill_dec$1, _disabled_dec$5, _dismissible_dec, _size_dec$3, _variant_dec$5, _color_dec$8, _a$d, _init$d, _color$7, _variant$4, _size$2, _dismissible, _disabled$4, _pill$1;
|
|
656
|
-
class Tag extends (_a$d = AeicoComponent, _color_dec$8 = [prop({ type: String })], _variant_dec$5 = [prop({ type: String })], _size_dec$3 = [prop({ type: String })], _dismissible_dec = [prop({ type: Boolean })], _disabled_dec$5 = [prop({ type: Boolean })], _pill_dec$1 = [prop({ type: Boolean })], _a$d) {
|
|
657
|
-
constructor() {
|
|
658
|
-
super(...arguments);
|
|
659
|
-
__privateAdd$c(this, _color$7, __runInitializers$d(_init$d, 8, this)), __runInitializers$d(_init$d, 11, this);
|
|
660
|
-
__privateAdd$c(this, _variant$4, __runInitializers$d(_init$d, 12, this)), __runInitializers$d(_init$d, 15, this);
|
|
661
|
-
__privateAdd$c(this, _size$2, __runInitializers$d(_init$d, 16, this)), __runInitializers$d(_init$d, 19, this);
|
|
662
|
-
__privateAdd$c(this, _dismissible, __runInitializers$d(_init$d, 20, this, false)), __runInitializers$d(_init$d, 23, this);
|
|
663
|
-
__privateAdd$c(this, _disabled$4, __runInitializers$d(_init$d, 24, this, false)), __runInitializers$d(_init$d, 27, this);
|
|
664
|
-
__privateAdd$c(this, _pill$1, __runInitializers$d(_init$d, 28, this, false)), __runInitializers$d(_init$d, 31, this);
|
|
665
|
-
}
|
|
666
|
-
render() {
|
|
667
|
-
return html(({ span, button, slot }) => {
|
|
668
|
-
span({ part: "tag", className: "tag" }, () => {
|
|
669
|
-
slot({ name: "start" });
|
|
670
|
-
span({ className: "tag-content" }, () => {
|
|
671
|
-
slot();
|
|
672
|
-
});
|
|
673
|
-
slot({ name: "end" });
|
|
674
|
-
button(
|
|
675
|
-
{
|
|
676
|
-
type: "button",
|
|
677
|
-
className: "tag-dismiss",
|
|
678
|
-
"aria-label": "dismiss",
|
|
679
|
-
"@click": (e) => {
|
|
680
|
-
e.stopPropagation();
|
|
681
|
-
if (this.disabled) return;
|
|
682
|
-
this.emit("dismiss");
|
|
683
|
-
}
|
|
684
|
-
},
|
|
685
|
-
() => {
|
|
686
|
-
span({ textContent: "×" });
|
|
687
|
-
}
|
|
688
|
-
);
|
|
689
|
-
});
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
_init$d = __decoratorStart$d(_a$d);
|
|
694
|
-
_color$7 = /* @__PURE__ */ new WeakMap();
|
|
695
|
-
_variant$4 = /* @__PURE__ */ new WeakMap();
|
|
696
|
-
_size$2 = /* @__PURE__ */ new WeakMap();
|
|
697
|
-
_dismissible = /* @__PURE__ */ new WeakMap();
|
|
698
|
-
_disabled$4 = /* @__PURE__ */ new WeakMap();
|
|
699
|
-
_pill$1 = /* @__PURE__ */ new WeakMap();
|
|
700
|
-
__decorateElement$d(_init$d, 4, "color", _color_dec$8, Tag, _color$7);
|
|
701
|
-
__decorateElement$d(_init$d, 4, "variant", _variant_dec$5, Tag, _variant$4);
|
|
702
|
-
__decorateElement$d(_init$d, 4, "size", _size_dec$3, Tag, _size$2);
|
|
703
|
-
__decorateElement$d(_init$d, 4, "dismissible", _dismissible_dec, Tag, _dismissible);
|
|
704
|
-
__decorateElement$d(_init$d, 4, "disabled", _disabled_dec$5, Tag, _disabled$4);
|
|
705
|
-
__decorateElement$d(_init$d, 4, "pill", _pill_dec$1, Tag, _pill$1);
|
|
706
|
-
__decoratorMetadata$d(_init$d, Tag);
|
|
707
|
-
__publicField$d(Tag, "styles", [styleVariables, sizeCSS, colorCSS, tagStyle]);
|
|
708
|
-
Tag.register();
|
|
709
|
-
var __create$c = Object.create;
|
|
710
|
-
var __defProp$c = Object.defineProperty;
|
|
711
|
-
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
712
|
-
var __knownSymbol$c = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
713
|
-
var __typeError$c = (msg) => {
|
|
714
|
-
throw TypeError(msg);
|
|
715
|
-
};
|
|
716
|
-
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
717
|
-
var __name = (target, value) => __defProp$c(target, "name", { value, configurable: true });
|
|
718
|
-
var __decoratorStart$c = (base) => [, , , __create$c((base == null ? void 0 : base[__knownSymbol$c("metadata")]) ?? null)];
|
|
719
|
-
var __decoratorStrings$c = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
720
|
-
var __expectFn$c = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$c("Function expected") : fn;
|
|
721
|
-
var __decoratorContext$c = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$c[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$c("Already initialized") : fns.push(__expectFn$c(fn || null)) });
|
|
722
|
-
var __decoratorMetadata$c = (array, target) => __defNormalProp$c(target, __knownSymbol$c("metadata"), array[3]);
|
|
723
|
-
var __runInitializers$c = (array, flags, self, value) => {
|
|
724
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
725
|
-
return value;
|
|
726
|
-
};
|
|
727
|
-
var __decorateElement$c = (array, flags, name, decorators, target, extra) => {
|
|
728
|
-
var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
|
|
729
|
-
var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings$c[k + 5];
|
|
730
|
-
var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
|
|
731
|
-
var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc$b(k < 4 ? target : { get [name]() {
|
|
732
|
-
return __privateGet$b(this, extra);
|
|
733
|
-
}, set [name](x) {
|
|
734
|
-
return __privateSet$b(this, extra, x);
|
|
735
|
-
} }, name));
|
|
736
|
-
k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
|
|
737
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
738
|
-
ctx = __decoratorContext$c(k, name, done = {}, array[3], extraInitializers);
|
|
739
|
-
if (k) {
|
|
740
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
|
|
741
|
-
if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet$b : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
|
|
742
|
-
if (k > 2) access.set = p ? (x, y) => __privateSet$b(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
|
|
743
|
-
}
|
|
744
|
-
it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
|
|
745
|
-
if (k ^ 4 || it === void 0) __expectFn$c(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
|
|
746
|
-
else if (typeof it !== "object" || it === null) __typeError$c("Object expected");
|
|
747
|
-
else __expectFn$c(fn = it.get) && (desc.get = fn), __expectFn$c(fn = it.set) && (desc.set = fn), __expectFn$c(fn = it.init) && initializers.unshift(fn);
|
|
748
|
-
}
|
|
749
|
-
return k || __decoratorMetadata$c(array, target), desc && __defProp$c(target, name, desc), p ? k ^ 4 ? extra : desc : target;
|
|
750
|
-
};
|
|
751
|
-
var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
752
|
-
var __accessCheck$b = (obj, member, msg) => member.has(obj) || __typeError$c("Cannot " + msg);
|
|
753
|
-
var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError$c('Cannot use the "in" operator on this value') : member.has(obj);
|
|
754
|
-
var __privateGet$b = (obj, member, getter) => (__accessCheck$b(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
755
|
-
var __privateAdd$b = (obj, member, value) => member.has(obj) ? __typeError$c("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
756
|
-
var __privateSet$b = (obj, member, value, setter) => (__accessCheck$b(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
757
|
-
var __privateMethod = (obj, member, method) => (__accessCheck$b(obj, member, "access private method"), method);
|
|
758
|
-
var _defaultValue_dec, _value_dec$1, _expandable_dec, _multiple_dec, _placeholder_dec, _position_dec, _options_dec$1, __expanded_dec, _a$c, _init$c, __expanded, _options$1, _position, _placeholder, _multiple, _expandable;
|
|
759
|
-
class Select extends (_a$c = AeicoField, __expanded_dec = [prop({ type: Boolean, observe: false, reflect: false })], _options_dec$1 = [prop({ type: Array })], _position_dec = [prop({ type: String })], _placeholder_dec = [prop({ type: String })], _multiple_dec = [prop({ type: Boolean })], _expandable_dec = [prop({ type: Boolean })], _value_dec$1 = [prop({
|
|
760
|
-
type: String,
|
|
761
|
-
parser: (v) => {
|
|
762
|
-
if (v === null || v === void 0) return void 0;
|
|
763
|
-
try {
|
|
764
|
-
return JSON.parse(v);
|
|
765
|
-
} catch {
|
|
766
|
-
return v;
|
|
767
|
-
}
|
|
768
|
-
},
|
|
769
|
-
formatter: (v) => {
|
|
770
|
-
if (v === null || v === void 0) return "";
|
|
771
|
-
if (Array.isArray(v)) return JSON.stringify(v);
|
|
772
|
-
return String(v);
|
|
773
|
-
}
|
|
774
|
-
})], _defaultValue_dec = [prop({
|
|
775
|
-
type: String,
|
|
776
|
-
parser: (v) => {
|
|
777
|
-
if (v === null || v === void 0) return void 0;
|
|
778
|
-
try {
|
|
779
|
-
return JSON.parse(v);
|
|
780
|
-
} catch {
|
|
781
|
-
return v;
|
|
782
|
-
}
|
|
783
|
-
},
|
|
784
|
-
formatter: (v) => {
|
|
785
|
-
if (v === null || v === void 0) return "";
|
|
786
|
-
if (Array.isArray(v)) return JSON.stringify(v);
|
|
787
|
-
return String(v);
|
|
788
|
-
}
|
|
789
|
-
})], _a$c) {
|
|
790
|
-
constructor() {
|
|
791
|
-
super(...arguments);
|
|
792
|
-
__publicField$c(this, "fieldElement", null);
|
|
793
|
-
__publicField$c(this, "_isOpen", false);
|
|
794
|
-
__publicField$c(this, "_triggerEl", null);
|
|
795
|
-
__publicField$c(this, "_dropdownEl", null);
|
|
796
|
-
__publicField$c(this, "_slotEl", null);
|
|
797
|
-
__publicField$c(this, "_slotOptionData", []);
|
|
798
|
-
__publicField$c(this, "_selectedListEl", null);
|
|
799
|
-
__privateAdd$b(this, __expanded, __runInitializers$c(_init$c, 8, this, false)), __runInitializers$c(_init$c, 11, this);
|
|
800
|
-
__privateAdd$b(this, _options$1, __runInitializers$c(_init$c, 12, this)), __runInitializers$c(_init$c, 15, this);
|
|
801
|
-
__privateAdd$b(this, _position, __runInitializers$c(_init$c, 16, this)), __runInitializers$c(_init$c, 19, this);
|
|
802
|
-
__privateAdd$b(this, _placeholder, __runInitializers$c(_init$c, 20, this)), __runInitializers$c(_init$c, 23, this);
|
|
803
|
-
__privateAdd$b(this, _multiple, __runInitializers$c(_init$c, 24, this, false)), __runInitializers$c(_init$c, 27, this);
|
|
804
|
-
__privateAdd$b(this, _expandable, __runInitializers$c(_init$c, 28, this, false)), __runInitializers$c(_init$c, 31, this);
|
|
805
|
-
__publicField$c(this, "value", __runInitializers$c(_init$c, 32, this)), __runInitializers$c(_init$c, 35, this);
|
|
806
|
-
__publicField$c(this, "defaultValue", __runInitializers$c(_init$c, 36, this)), __runInitializers$c(_init$c, 39, this);
|
|
807
|
-
__publicField$c(this, "_handleOutsideClick", (e) => {
|
|
808
|
-
if (!e.composedPath().includes(this)) {
|
|
809
|
-
this._closeDropdown();
|
|
810
|
-
}
|
|
811
|
-
});
|
|
812
|
-
__publicField$c(this, "_handleOptionSelect", (e) => {
|
|
813
|
-
const { value, label } = e.detail;
|
|
814
|
-
if (!this._slotOptionData.find((o) => o.value === value)) {
|
|
815
|
-
this._slotOptionData = [
|
|
816
|
-
...this._slotOptionData.filter((o) => o.value !== value),
|
|
817
|
-
{ value, label }
|
|
818
|
-
];
|
|
819
|
-
}
|
|
820
|
-
if (this.multiple) {
|
|
821
|
-
const current = this._getMultiValues();
|
|
822
|
-
const idx = current.findIndex((v) => String(v) === value);
|
|
823
|
-
const next = idx >= 0 ? current.filter((_, i) => i !== idx) : [...current, value];
|
|
824
|
-
this.setValue(next, { silent: false, action: "change" });
|
|
825
|
-
} else {
|
|
826
|
-
this.setValue(value, { silent: false, action: "change" });
|
|
827
|
-
this._closeDropdown();
|
|
828
|
-
}
|
|
829
|
-
});
|
|
830
|
-
}
|
|
831
|
-
writeValue(_value2) {
|
|
832
|
-
}
|
|
833
|
-
getValue() {
|
|
834
|
-
if (this.multiple) return this._getMultiValues();
|
|
835
|
-
return this.value || "";
|
|
836
|
-
}
|
|
837
|
-
_getMultiValues() {
|
|
838
|
-
if (Array.isArray(this.value)) return this.value;
|
|
839
|
-
if (this.value != null && this.value !== "") return [this.value];
|
|
840
|
-
return [];
|
|
841
|
-
}
|
|
842
|
-
onDisabledChanged(_newValue) {
|
|
843
|
-
}
|
|
844
|
-
onUpdated(_changedProps) {
|
|
845
|
-
if (!this.multiple || this.expandable) {
|
|
846
|
-
if (this._expanded) this._expanded = false;
|
|
847
|
-
return;
|
|
848
|
-
}
|
|
849
|
-
const list = this._selectedListEl;
|
|
850
|
-
if (!list) return;
|
|
851
|
-
const overflowing = list.scrollWidth > list.clientWidth + 1;
|
|
852
|
-
if (overflowing !== this._expanded) this._expanded = overflowing;
|
|
853
|
-
}
|
|
854
|
-
_findLabel(value) {
|
|
855
|
-
const strVal = String(value);
|
|
856
|
-
if (Array.isArray(this.options)) {
|
|
857
|
-
for (const opt of this.options) {
|
|
858
|
-
if (this._isSelectOption(opt)) {
|
|
859
|
-
if (String(opt.value) === strVal) return t(opt.label, opt.label);
|
|
860
|
-
} else {
|
|
861
|
-
if (String(opt) === strVal) return strVal;
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
for (const opt of this._slotOptionData) {
|
|
866
|
-
if (opt.value === strVal) return opt.label;
|
|
867
|
-
}
|
|
868
|
-
return strVal;
|
|
869
|
-
}
|
|
870
|
-
_onSlotChange() {
|
|
871
|
-
var _a2;
|
|
872
|
-
if (!this._slotEl) return;
|
|
873
|
-
const data = [];
|
|
874
|
-
for (const el of this._slotEl.assignedElements({ flatten: true })) {
|
|
875
|
-
if (el.tagName.toLowerCase() !== "ae-select-option") continue;
|
|
876
|
-
const optEl = el;
|
|
877
|
-
data.push({
|
|
878
|
-
value: optEl.value ?? el.getAttribute("value") ?? "",
|
|
879
|
-
label: optEl.label || ((_a2 = el.textContent) == null ? void 0 : _a2.trim()) || ""
|
|
880
|
-
});
|
|
881
|
-
}
|
|
882
|
-
this._slotOptionData = data;
|
|
883
|
-
this.update();
|
|
884
|
-
}
|
|
885
|
-
_toggleDropdown() {
|
|
886
|
-
if (this._isOpen) {
|
|
887
|
-
this._closeDropdown();
|
|
888
|
-
} else {
|
|
889
|
-
this._openDropdown();
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
_openDropdown() {
|
|
893
|
-
this._isOpen = true;
|
|
894
|
-
this._syncOpenState();
|
|
895
|
-
}
|
|
896
|
-
_closeDropdown() {
|
|
897
|
-
this._isOpen = false;
|
|
898
|
-
this._syncOpenState();
|
|
899
|
-
}
|
|
900
|
-
_syncOpenState() {
|
|
901
|
-
var _a2, _b;
|
|
902
|
-
(_a2 = this._triggerEl) == null ? void 0 : _a2.classList.toggle("open", this._isOpen);
|
|
903
|
-
(_b = this._dropdownEl) == null ? void 0 : _b.classList.toggle("open", this._isOpen);
|
|
904
|
-
}
|
|
905
|
-
connectedCallback() {
|
|
906
|
-
super.connectedCallback();
|
|
907
|
-
document.addEventListener("click", this._handleOutsideClick);
|
|
908
|
-
this.addEventListener("selectoption", this._handleOptionSelect);
|
|
909
|
-
}
|
|
910
|
-
disconnectedCallback() {
|
|
911
|
-
super.disconnectedCallback();
|
|
912
|
-
document.removeEventListener("click", this._handleOutsideClick);
|
|
913
|
-
this.removeEventListener("selectoption", this._handleOptionSelect);
|
|
914
|
-
}
|
|
915
|
-
_syncSlotOptionsSelected() {
|
|
916
|
-
if (!this._slotEl) return;
|
|
917
|
-
const multiValues = this._getMultiValues();
|
|
918
|
-
for (const el of this._slotEl.assignedElements({ flatten: true })) {
|
|
919
|
-
if (el.tagName.toLowerCase() !== "ae-select-option") continue;
|
|
920
|
-
const optEl = el;
|
|
921
|
-
const optVal = optEl.value ?? el.getAttribute("value") ?? "";
|
|
922
|
-
const isSelected = this.multiple ? multiValues.some((v) => String(v) === optVal) : this.value != null && this.value !== "" && String(this.value) === optVal;
|
|
923
|
-
optEl.selected = isSelected ? true : void 0;
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
render() {
|
|
927
|
-
const position = this.position || "bottom";
|
|
928
|
-
const multiValues = this.multiple ? this._getMultiValues() : [];
|
|
929
|
-
const hasMultiSelection = this.multiple && multiValues.length > 0;
|
|
930
|
-
const selectedLabel = !this.multiple && this.value != null && this.value !== "" ? this._findLabel(this.value) : "";
|
|
931
|
-
const isDisabled = Boolean(this.disabled);
|
|
932
|
-
this._selectedListEl = null;
|
|
933
|
-
this._syncSlotOptionsSelected();
|
|
934
|
-
return html(({ div, span, slot }) => {
|
|
935
|
-
div({ className: "container" }, () => {
|
|
936
|
-
this._triggerEl = div(
|
|
937
|
-
{
|
|
938
|
-
className: `trigger${this._isOpen ? " open" : ""}${isDisabled ? " disabled" : ""}`,
|
|
939
|
-
"@click": () => {
|
|
940
|
-
if (isDisabled) return;
|
|
941
|
-
this._toggleDropdown();
|
|
942
|
-
}
|
|
943
|
-
},
|
|
944
|
-
() => {
|
|
945
|
-
if (this.multiple) {
|
|
946
|
-
if (hasMultiSelection) {
|
|
947
|
-
this._selectedListEl = div(
|
|
948
|
-
{
|
|
949
|
-
className: `selected-list${!this.expandable ? " selected-list--clipped" : ""}`
|
|
950
|
-
},
|
|
951
|
-
() => {
|
|
952
|
-
for (const v of multiValues) {
|
|
953
|
-
const lbl = this._findLabel(v);
|
|
954
|
-
tags.aeTag({
|
|
955
|
-
key: `sel-${v}`,
|
|
956
|
-
color: "default",
|
|
957
|
-
variant: "faint",
|
|
958
|
-
dismissible: true,
|
|
959
|
-
disabled: isDisabled,
|
|
960
|
-
textContent: lbl,
|
|
961
|
-
"@dismiss": (e) => {
|
|
962
|
-
e.stopPropagation();
|
|
963
|
-
if (isDisabled) return;
|
|
964
|
-
const next = multiValues.filter((item) => String(item) !== String(v));
|
|
965
|
-
this.setValue(next, { silent: false, action: "change" });
|
|
966
|
-
}
|
|
967
|
-
});
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
);
|
|
971
|
-
if (!this.expandable && this._expanded) {
|
|
972
|
-
span({ className: "overflow-indicator", textContent: "…" });
|
|
973
|
-
}
|
|
974
|
-
} else {
|
|
975
|
-
span({ className: "value placeholder", textContent: this.placeholder || "" });
|
|
976
|
-
}
|
|
977
|
-
} else {
|
|
978
|
-
if (selectedLabel) {
|
|
979
|
-
span({ className: "value", textContent: selectedLabel });
|
|
980
|
-
} else {
|
|
981
|
-
span({ className: "value placeholder", textContent: this.placeholder || "" });
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
span({ className: "arrow", textContent: "▾" });
|
|
985
|
-
}
|
|
986
|
-
);
|
|
987
|
-
this._dropdownEl = div(
|
|
988
|
-
{
|
|
989
|
-
className: `dropdown position-${position}${this._isOpen ? " open" : ""}`
|
|
990
|
-
},
|
|
991
|
-
() => {
|
|
992
|
-
this._renderProgrammaticOptions();
|
|
993
|
-
this._slotEl = slot({
|
|
994
|
-
"@slotchange": () => this._onSlotChange()
|
|
995
|
-
});
|
|
996
|
-
}
|
|
997
|
-
);
|
|
998
|
-
this.renderActionButtons();
|
|
999
|
-
});
|
|
1000
|
-
});
|
|
1001
|
-
}
|
|
1002
|
-
_renderProgrammaticOptions() {
|
|
1003
|
-
if (!Array.isArray(this.options)) return;
|
|
1004
|
-
const { aeSelectOption } = tags;
|
|
1005
|
-
const multiValues = this.multiple ? this._getMultiValues() : [];
|
|
1006
|
-
for (const opt of this.options) {
|
|
1007
|
-
if (this._isSelectOption(opt)) {
|
|
1008
|
-
const isSelected = this.multiple ? multiValues.some((v) => String(v) === String(opt.value)) : this.value != null && String(opt.value) === String(this.value);
|
|
1009
|
-
aeSelectOption({
|
|
1010
|
-
key: `opt-${opt.value}`,
|
|
1011
|
-
value: String(opt.value),
|
|
1012
|
-
label: opt.label,
|
|
1013
|
-
textContent: t(opt.label, opt.label),
|
|
1014
|
-
selected: isSelected ? true : void 0
|
|
1015
|
-
});
|
|
1016
|
-
} else {
|
|
1017
|
-
const isSelected = this.multiple ? multiValues.some((v) => String(v) === String(opt)) : this.value != null && String(opt) === String(this.value);
|
|
1018
|
-
aeSelectOption({
|
|
1019
|
-
key: `opt-${opt}`,
|
|
1020
|
-
value: String(opt),
|
|
1021
|
-
textContent: String(opt),
|
|
1022
|
-
selected: isSelected ? true : void 0
|
|
1023
|
-
});
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
_isSelectOption(option) {
|
|
1028
|
-
return option !== null && typeof option === "object" && typeof option.label === "string" && (typeof option.value === "string" || typeof option.value === "number");
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
_init$c = __decoratorStart$c(_a$c);
|
|
1032
|
-
__expanded = /* @__PURE__ */ new WeakMap();
|
|
1033
|
-
_options$1 = /* @__PURE__ */ new WeakMap();
|
|
1034
|
-
_position = /* @__PURE__ */ new WeakMap();
|
|
1035
|
-
_placeholder = /* @__PURE__ */ new WeakMap();
|
|
1036
|
-
_multiple = /* @__PURE__ */ new WeakMap();
|
|
1037
|
-
_expandable = /* @__PURE__ */ new WeakMap();
|
|
1038
|
-
__decorateElement$c(_init$c, 4, "_expanded", __expanded_dec, Select, __expanded);
|
|
1039
|
-
__decorateElement$c(_init$c, 4, "options", _options_dec$1, Select, _options$1);
|
|
1040
|
-
__decorateElement$c(_init$c, 4, "position", _position_dec, Select, _position);
|
|
1041
|
-
__decorateElement$c(_init$c, 4, "placeholder", _placeholder_dec, Select, _placeholder);
|
|
1042
|
-
__decorateElement$c(_init$c, 4, "multiple", _multiple_dec, Select, _multiple);
|
|
1043
|
-
__decorateElement$c(_init$c, 4, "expandable", _expandable_dec, Select, _expandable);
|
|
1044
|
-
__decorateElement$c(_init$c, 5, "value", _value_dec$1, Select);
|
|
1045
|
-
__decorateElement$c(_init$c, 5, "defaultValue", _defaultValue_dec, Select);
|
|
1046
|
-
__decoratorMetadata$c(_init$c, Select);
|
|
1047
|
-
__publicField$c(Select, "tagName", "select");
|
|
1048
|
-
__publicField$c(Select, "styles", [styleVariables, sizeCSS, style$9]);
|
|
1049
|
-
Select.register();
|
|
1050
|
-
const style$8 = `:host {
|
|
1051
|
-
display: block;
|
|
1052
|
-
flex: 1;
|
|
1053
|
-
min-width: 0;
|
|
1054
|
-
font-size: var(--size-base);
|
|
1055
|
-
|
|
1056
|
-
/* Default color when no [color] attribute — overridden by color.css :host([color=...]) */
|
|
1057
|
-
--color-solid: var(--color-primary);
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
.range-container {
|
|
1061
|
-
display: flex;
|
|
1062
|
-
align-items: center;
|
|
1063
|
-
gap: 6px;
|
|
1064
|
-
width: 100%;
|
|
1065
|
-
height: 26px;
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
input[type="range"] {
|
|
1069
|
-
flex: 1;
|
|
1070
|
-
margin: 0;
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
.input-range,
|
|
1074
|
-
.slider-input,
|
|
1075
|
-
input[type="range"] {
|
|
1076
|
-
-webkit-appearance: none;
|
|
1077
|
-
appearance: none;
|
|
1078
|
-
width: 100%;
|
|
1079
|
-
height: 0.333em;
|
|
1080
|
-
border-radius: 2px;
|
|
1081
|
-
background: var(--border-subtle);
|
|
1082
|
-
outline: none;
|
|
1083
|
-
cursor: pointer;
|
|
1084
|
-
margin: 0;
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
.input-range {
|
|
1088
|
-
margin: 10px 0;
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
.input-range::-webkit-slider-thumb,
|
|
1092
|
-
.slider-input::-webkit-slider-thumb,
|
|
1093
|
-
input[type="range"]::-webkit-slider-thumb {
|
|
1094
|
-
-webkit-appearance: none;
|
|
1095
|
-
appearance: none;
|
|
1096
|
-
width: 1.167em;
|
|
1097
|
-
height: 1.167em;
|
|
1098
|
-
border-radius: 50%;
|
|
1099
|
-
background: var(--color-solid);
|
|
1100
|
-
cursor: pointer;
|
|
1101
|
-
transition: background 0.12s, transform 0.12s;
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
.input-range::-webkit-slider-thumb:hover,
|
|
1105
|
-
.slider-input::-webkit-slider-thumb:hover,
|
|
1106
|
-
input[type="range"]:hover::-webkit-slider-thumb {
|
|
1107
|
-
background: var(--color-solid-hover);
|
|
1108
|
-
transform: scale(1.1);
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
.input-range::-webkit-slider-thumb:active,
|
|
1112
|
-
.slider-input::-webkit-slider-thumb:active,
|
|
1113
|
-
input[type="range"]:active::-webkit-slider-thumb {
|
|
1114
|
-
background: var(--color-solid-hover);
|
|
1115
|
-
transform: scale(1.2);
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
.input-range:focus::-webkit-slider-thumb,
|
|
1119
|
-
.slider-input:focus::-webkit-slider-thumb,
|
|
1120
|
-
input[type="range"]:focus::-webkit-slider-thumb {
|
|
1121
|
-
background: var(--color-solid);
|
|
1122
|
-
outline: none;
|
|
1123
|
-
box-shadow: none;
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
.input-range:focus:hover::-webkit-slider-thumb,
|
|
1127
|
-
.slider-input:focus:hover::-webkit-slider-thumb,
|
|
1128
|
-
input[type="range"]:focus:hover::-webkit-slider-thumb {
|
|
1129
|
-
background: var(--color-solid-hover);
|
|
1130
|
-
outline: none;
|
|
1131
|
-
box-shadow: none;
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
.input-range:focus:active::-webkit-slider-thumb,
|
|
1135
|
-
.slider-input:focus:active::-webkit-slider-thumb,
|
|
1136
|
-
input[type="range"]:focus:active::-webkit-slider-thumb {
|
|
1137
|
-
background: var(--color-solid-hover);
|
|
1138
|
-
outline: none;
|
|
1139
|
-
box-shadow: none;
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
.input-range::-moz-range-thumb,
|
|
1143
|
-
.slider-input::-moz-range-thumb,
|
|
1144
|
-
input[type="range"]::-moz-range-thumb {
|
|
1145
|
-
width: 1.167em;
|
|
1146
|
-
height: 1.167em;
|
|
1147
|
-
border: none;
|
|
1148
|
-
border-radius: 50%;
|
|
1149
|
-
background: var(--color-solid);
|
|
1150
|
-
cursor: pointer;
|
|
1151
|
-
transition: background 0.12s, transform 0.12s;
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
|
-
.input-range::-moz-range-thumb:hover,
|
|
1155
|
-
.slider-input::-moz-range-thumb:hover,
|
|
1156
|
-
input[type="range"]:hover::-moz-range-thumb {
|
|
1157
|
-
background: var(--color-solid-hover);
|
|
1158
|
-
transform: scale(1.1);
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
.input-range::-moz-range-thumb:active,
|
|
1162
|
-
.slider-input::-moz-range-thumb:active,
|
|
1163
|
-
input[type="range"]:active::-moz-range-thumb {
|
|
1164
|
-
background: var(--color-solid-hover);
|
|
1165
|
-
transform: scale(1.2);
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
.input-range:focus::-moz-range-thumb,
|
|
1169
|
-
.slider-input:focus::-moz-range-thumb,
|
|
1170
|
-
input[type="range"]:focus::-moz-range-thumb {
|
|
1171
|
-
background: var(--color-solid);
|
|
1172
|
-
outline: none;
|
|
1173
|
-
box-shadow: none;
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
.input-range:focus:hover::-moz-range-thumb,
|
|
1177
|
-
.slider-input:focus:hover::-moz-range-thumb,
|
|
1178
|
-
input[type="range"]:focus:hover::-moz-range-thumb {
|
|
1179
|
-
background: var(--color-solid-hover);
|
|
1180
|
-
outline: none;
|
|
1181
|
-
box-shadow: none;
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
.input-range:focus:active::-moz-range-thumb,
|
|
1185
|
-
.slider-input:focus:active::-moz-range-thumb,
|
|
1186
|
-
input[type="range"]:focus:active::-moz-range-thumb {
|
|
1187
|
-
background: var(--color-solid-hover);
|
|
1188
|
-
outline: none;
|
|
1189
|
-
box-shadow: none;
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
.input-range:disabled,
|
|
1193
|
-
.slider-input:disabled,
|
|
1194
|
-
input[type="range"]:disabled {
|
|
1195
|
-
opacity: 0.5;
|
|
1196
|
-
cursor: not-allowed;
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
.input-range:disabled::-webkit-slider-thumb,
|
|
1200
|
-
.slider-input:disabled::-webkit-slider-thumb,
|
|
1201
|
-
input[type="range"]:disabled::-webkit-slider-thumb {
|
|
1202
|
-
cursor: not-allowed;
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1205
|
-
.input-range:disabled::-moz-range-thumb,
|
|
1206
|
-
.slider-input:disabled::-moz-range-thumb,
|
|
1207
|
-
input[type="range"]:disabled::-moz-range-thumb {
|
|
1208
|
-
cursor: not-allowed;
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
|
-
.value-label {
|
|
1212
|
-
min-width: 14px;
|
|
1213
|
-
text-align: center;
|
|
1214
|
-
font-size: 12px;
|
|
1215
|
-
color: var(--color-text-muted);
|
|
1216
|
-
font-weight: 500;
|
|
1217
|
-
font-variant-numeric: tabular-nums;
|
|
1218
|
-
pointer-events: none;
|
|
1219
|
-
user-select: none;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
.reset-btn {
|
|
1223
|
-
width: 1.333em;
|
|
1224
|
-
height: 1.333em;
|
|
1225
|
-
border: none;
|
|
1226
|
-
border-radius: var(--reset-btn-border-radius);
|
|
1227
|
-
cursor: pointer;
|
|
1228
|
-
display: flex;
|
|
1229
|
-
align-items: center;
|
|
1230
|
-
justify-content: center;
|
|
1231
|
-
background: var(--reset-btn-bg);
|
|
1232
|
-
color: var(--reset-btn-color);
|
|
1233
|
-
transition: var(--reset-btn-transition);
|
|
1234
|
-
flex-shrink: 0;
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
.reset-btn:hover {
|
|
1238
|
-
background: var(--reset-btn-bg-hover);
|
|
1239
|
-
color: var(--reset-btn-color-hover);
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
.clear-btn {
|
|
1243
|
-
width: 1.333em;
|
|
1244
|
-
height: 1.333em;
|
|
1245
|
-
border: none;
|
|
1246
|
-
border-radius: var(--clear-btn-border-radius);
|
|
1247
|
-
cursor: pointer;
|
|
1248
|
-
display: flex;
|
|
1249
|
-
align-items: center;
|
|
1250
|
-
justify-content: center;
|
|
1251
|
-
background: var(--clear-btn-bg);
|
|
1252
|
-
color: var(--clear-btn-color);
|
|
1253
|
-
transition: var(--clear-btn-transition);
|
|
1254
|
-
flex-shrink: 0;
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
|
-
.clear-btn:hover {
|
|
1258
|
-
background: var(--clear-btn-bg-hover);
|
|
1259
|
-
color: var(--clear-btn-color-hover);
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
.input-range,
|
|
1265
|
-
.slider-input,
|
|
1266
|
-
input[type="range"] {
|
|
1267
|
-
height: 0.333em;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
.input-range::-webkit-slider-thumb,
|
|
1271
|
-
.slider-input::-webkit-slider-thumb,
|
|
1272
|
-
input[type="range"]::-webkit-slider-thumb {
|
|
1273
|
-
width: 1.167em;
|
|
1274
|
-
height: 1.167em;
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
.input-range::-moz-range-thumb,
|
|
1278
|
-
.slider-input::-moz-range-thumb,
|
|
1279
|
-
input[type="range"]::-moz-range-thumb {
|
|
1280
|
-
width: 1.167em;
|
|
1281
|
-
height: 1.167em;
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
.value-label {
|
|
1285
|
-
font-size: 1em;
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1288
|
-
.value-input {
|
|
1289
|
-
width: 56px;
|
|
1290
|
-
padding: 0 4px;
|
|
1291
|
-
height: 22px;
|
|
1292
|
-
border: 1px solid var(--border-subtle);
|
|
1293
|
-
border-radius: 4px;
|
|
1294
|
-
background: transparent;
|
|
1295
|
-
color: var(--color-text);
|
|
1296
|
-
font-size: 12px;
|
|
1297
|
-
text-align: center;
|
|
1298
|
-
outline: none;
|
|
1299
|
-
flex-shrink: 0;
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
.value-input:focus {
|
|
1303
|
-
border-color: var(--color-solid);
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
.value-input:disabled {
|
|
1307
|
-
opacity: 0.4;
|
|
1308
|
-
cursor: not-allowed;
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
:host([tracked]) .input-range,
|
|
1312
|
-
:host([tracked]) .slider-input,
|
|
1313
|
-
:host([tracked]) input[type="range"] {
|
|
1314
|
-
background: linear-gradient(
|
|
1315
|
-
to right,
|
|
1316
|
-
var(--color-solid) var(--fill-pct, 0%),
|
|
1317
|
-
var(--border-subtle) var(--fill-pct, 0%)
|
|
1318
|
-
);
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
.range-wrapper {
|
|
1322
|
-
flex: 1;
|
|
1323
|
-
min-width: 0;
|
|
1324
|
-
display: flex;
|
|
1325
|
-
flex-direction: column;
|
|
1326
|
-
position: relative; /* marks-container positions against this */
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
.range-wrapper input[type="range"] {
|
|
1330
|
-
width: 100%;
|
|
1331
|
-
flex: none;
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
/* Marks are absolutely positioned so they don't affect range-wrapper's layout height */
|
|
1335
|
-
.marks-container {
|
|
1336
|
-
position: absolute;
|
|
1337
|
-
top: 100%;
|
|
1338
|
-
left: 7px; /* inset by half thumb so 0%/100% align with track ends */
|
|
1339
|
-
right: 7px;
|
|
1340
|
-
height: 18px;
|
|
1341
|
-
margin-top: 2px;
|
|
1342
|
-
overflow: visible;
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
.mark {
|
|
1346
|
-
position: absolute;
|
|
1347
|
-
transform: translateX(-50%);
|
|
1348
|
-
display: flex;
|
|
1349
|
-
flex-direction: column;
|
|
1350
|
-
align-items: center;
|
|
1351
|
-
gap: 2px;
|
|
1352
|
-
pointer-events: none;
|
|
1353
|
-
user-select: none;
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
|
-
.mark::before {
|
|
1357
|
-
content: '';
|
|
1358
|
-
display: block;
|
|
1359
|
-
width: 1px;
|
|
1360
|
-
height: 4px;
|
|
1361
|
-
background: var(--border-default, var(--border-subtle));
|
|
1362
|
-
border-radius: 1px;
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
|
-
.mark-label {
|
|
1366
|
-
font-size: 10px;
|
|
1367
|
-
color: var(--color-text-muted);
|
|
1368
|
-
white-space: nowrap;
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
/* When marks are active, add padding-bottom to make room for the absolute-positioned marks */
|
|
1372
|
-
:host([marks]) .range-container {
|
|
1373
|
-
padding-bottom: 24px; /* marks-container height (18px) + margin-top (2px) + extra (4px) */
|
|
1374
|
-
height: auto;
|
|
1375
|
-
}
|
|
1376
|
-
`;
|
|
1377
|
-
var __create$b = Object.create;
|
|
1378
|
-
var __defProp$b = Object.defineProperty;
|
|
1379
|
-
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
1380
|
-
var __knownSymbol$b = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
1381
|
-
var __typeError$b = (msg) => {
|
|
1382
|
-
throw TypeError(msg);
|
|
1383
|
-
};
|
|
1384
|
-
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1385
|
-
var __decoratorStart$b = (base) => [, , , __create$b((base == null ? void 0 : base[__knownSymbol$b("metadata")]) ?? null)];
|
|
1386
|
-
var __decoratorStrings$b = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
1387
|
-
var __expectFn$b = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$b("Function expected") : fn;
|
|
1388
|
-
var __decoratorContext$b = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$b[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$b("Already initialized") : fns.push(__expectFn$b(fn || null)) });
|
|
1389
|
-
var __decoratorMetadata$b = (array, target) => __defNormalProp$b(target, __knownSymbol$b("metadata"), array[3]);
|
|
1390
|
-
var __runInitializers$b = (array, flags, self, value) => {
|
|
1391
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
1392
|
-
return value;
|
|
1393
|
-
};
|
|
1394
|
-
var __decorateElement$b = (array, flags, name, decorators, target, extra) => {
|
|
1395
|
-
var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
|
|
1396
|
-
var j = array.length + 1, key = __decoratorStrings$b[k + 5];
|
|
1397
|
-
var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
|
|
1398
|
-
var desc = (target = target.prototype, __getOwnPropDesc$a({ get [name]() {
|
|
1399
|
-
return __privateGet$a(this, extra);
|
|
1400
|
-
}, set [name](x) {
|
|
1401
|
-
return __privateSet$a(this, extra, x);
|
|
1402
|
-
} }, name));
|
|
1403
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
1404
|
-
ctx = __decoratorContext$b(k, name, done = {}, array[3], extraInitializers);
|
|
1405
|
-
{
|
|
1406
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
|
|
1407
|
-
access.get = (x) => x[name];
|
|
1408
|
-
access.set = (x, y) => x[name] = y;
|
|
1409
|
-
}
|
|
1410
|
-
it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
|
|
1411
|
-
if (it === void 0) __expectFn$b(it) && (desc[key] = it);
|
|
1412
|
-
else if (typeof it !== "object" || it === null) __typeError$b("Object expected");
|
|
1413
|
-
else __expectFn$b(fn = it.get) && (desc.get = fn), __expectFn$b(fn = it.set) && (desc.set = fn), __expectFn$b(fn = it.init) && initializers.unshift(fn);
|
|
1414
|
-
}
|
|
1415
|
-
return desc && __defProp$b(target, name, desc), target;
|
|
1416
|
-
};
|
|
1417
|
-
var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1418
|
-
var __accessCheck$a = (obj, member, msg) => member.has(obj) || __typeError$b("Cannot " + msg);
|
|
1419
|
-
var __privateGet$a = (obj, member, getter) => (__accessCheck$a(obj, member, "read from private field"), member.get(obj));
|
|
1420
|
-
var __privateAdd$a = (obj, member, value) => member.has(obj) ? __typeError$b("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1421
|
-
var __privateSet$a = (obj, member, value, setter) => (__accessCheck$a(obj, member, "write to private field"), member.set(obj, value), value);
|
|
1422
|
-
var _marks_dec, _tracked_dec, _editable_dec, _step_dec, _max_dec, _min_dec, _percentage_dec, _options_dec, _a$b, _init$b, _options, _percentage, _min, _max, _step, _editable, _tracked, _marks;
|
|
1423
|
-
class Slider extends (_a$b = AeicoField, _options_dec = [prop({ type: Array })], _percentage_dec = [prop({ type: Boolean })], _min_dec = [prop({ type: Number })], _max_dec = [prop({ type: Number })], _step_dec = [prop({ type: Number })], _editable_dec = [prop({ type: Boolean })], _tracked_dec = [prop({ type: Boolean })], _marks_dec = [prop({
|
|
1424
|
-
type: Array,
|
|
1425
|
-
// bare attribute (<ae-slider marks>) → true; JSON array → MarkItem[]
|
|
1426
|
-
parser: (value) => {
|
|
1427
|
-
if (value === null) return void 0;
|
|
1428
|
-
if (value === "" || value === "true") return true;
|
|
1429
|
-
if (value === "false") return false;
|
|
1430
|
-
try {
|
|
1431
|
-
return JSON.parse(value);
|
|
1432
|
-
} catch {
|
|
1433
|
-
return true;
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
})], _a$b) {
|
|
1437
|
-
constructor() {
|
|
1438
|
-
super();
|
|
1439
|
-
__publicField$b(this, "fieldElement", null);
|
|
1440
|
-
__publicField$b(this, "_valueLabel", null);
|
|
1441
|
-
__publicField$b(this, "_numberInput", null);
|
|
1442
|
-
__publicField$b(this, "_boundOnRangeInput");
|
|
1443
|
-
__publicField$b(this, "_boundOnNumberInput");
|
|
1444
|
-
__privateAdd$a(this, _options, __runInitializers$b(_init$b, 8, this, [])), __runInitializers$b(_init$b, 11, this);
|
|
1445
|
-
__privateAdd$a(this, _percentage, __runInitializers$b(_init$b, 12, this, false)), __runInitializers$b(_init$b, 15, this);
|
|
1446
|
-
__privateAdd$a(this, _min, __runInitializers$b(_init$b, 16, this, 0)), __runInitializers$b(_init$b, 19, this);
|
|
1447
|
-
__privateAdd$a(this, _max, __runInitializers$b(_init$b, 20, this, 100)), __runInitializers$b(_init$b, 23, this);
|
|
1448
|
-
__privateAdd$a(this, _step, __runInitializers$b(_init$b, 24, this, 1)), __runInitializers$b(_init$b, 27, this);
|
|
1449
|
-
__privateAdd$a(this, _editable, __runInitializers$b(_init$b, 28, this, false)), __runInitializers$b(_init$b, 31, this);
|
|
1450
|
-
__privateAdd$a(this, _tracked, __runInitializers$b(_init$b, 32, this, false)), __runInitializers$b(_init$b, 35, this);
|
|
1451
|
-
__privateAdd$a(this, _marks, __runInitializers$b(_init$b, 36, this)), __runInitializers$b(_init$b, 39, this);
|
|
1452
|
-
this._boundOnRangeInput = this._onRangeInput.bind(this);
|
|
1453
|
-
this._boundOnNumberInput = this._onNumberInput.bind(this);
|
|
1454
|
-
}
|
|
1455
|
-
_normalizeOptions() {
|
|
1456
|
-
if (!Array.isArray(this.options) || this.options.length === 0) return null;
|
|
1457
|
-
const opts = this.options.map(
|
|
1458
|
-
(opt) => this._isSliderOption(opt) ? { label: opt.label, value: String(opt.value) } : { label: String(opt), value: String(opt) }
|
|
1459
|
-
);
|
|
1460
|
-
const allNumeric = opts.every((o) => o.value !== "" && !isNaN(Number(o.value)));
|
|
1461
|
-
if (allNumeric) {
|
|
1462
|
-
return [...opts].sort((a, b) => Number(a.value) - Number(b.value)).map((o) => ({ ...o, rangeValue: Number(o.value) }));
|
|
1463
|
-
} else {
|
|
1464
|
-
return opts.map((o, i) => ({ ...o, rangeValue: i }));
|
|
1465
|
-
}
|
|
1466
|
-
}
|
|
1467
|
-
_getRangeAttrs(normalized) {
|
|
1468
|
-
if (normalized && normalized.length >= 1) {
|
|
1469
|
-
const vals = normalized.map((o) => o.rangeValue);
|
|
1470
|
-
const min = Math.min(...vals);
|
|
1471
|
-
const max = Math.max(...vals);
|
|
1472
|
-
const sorted = [...vals].sort((a, b) => a - b);
|
|
1473
|
-
let minGap = Infinity;
|
|
1474
|
-
for (let i = 1; i < sorted.length; i++) {
|
|
1475
|
-
const d = sorted[i] - sorted[i - 1];
|
|
1476
|
-
if (d > 0 && d < minGap) minGap = d;
|
|
1477
|
-
}
|
|
1478
|
-
return {
|
|
1479
|
-
min: String(min),
|
|
1480
|
-
max: String(max),
|
|
1481
|
-
step: minGap === Infinity ? "1" : String(minGap),
|
|
1482
|
-
inOptionsMode: true
|
|
1483
|
-
};
|
|
1484
|
-
}
|
|
1485
|
-
return {
|
|
1486
|
-
min: String(this.min),
|
|
1487
|
-
max: String(this.max),
|
|
1488
|
-
step: String(this.step),
|
|
1489
|
-
inOptionsMode: false
|
|
1490
|
-
};
|
|
1491
|
-
}
|
|
1492
|
-
_toRangeValue(value, normalized) {
|
|
1493
|
-
if (value == null || value === "") return "";
|
|
1494
|
-
if (normalized) {
|
|
1495
|
-
const found = normalized.find((o) => o.value === value);
|
|
1496
|
-
return found !== void 0 ? String(found.rangeValue) : "";
|
|
1497
|
-
}
|
|
1498
|
-
return value;
|
|
1499
|
-
}
|
|
1500
|
-
_fromRangeValue(rv, normalized) {
|
|
1501
|
-
var _a2, _b;
|
|
1502
|
-
if (normalized) {
|
|
1503
|
-
const n = Number(rv);
|
|
1504
|
-
return ((_a2 = normalized.find((o) => o.rangeValue === n)) == null ? void 0 : _a2.value) ?? ((_b = normalized[0]) == null ? void 0 : _b.value) ?? rv;
|
|
1505
|
-
}
|
|
1506
|
-
return rv;
|
|
1507
|
-
}
|
|
1508
|
-
_displayLabel(value, normalized) {
|
|
1509
|
-
var _a2;
|
|
1510
|
-
if (value == null || value === "") return "";
|
|
1511
|
-
const label = normalized ? ((_a2 = normalized.find((o) => o.value === value)) == null ? void 0 : _a2.label) ?? value : value;
|
|
1512
|
-
return this.percentage ? `${label}%` : label;
|
|
1513
|
-
}
|
|
1514
|
-
_maxValueLabelWidth(normalized, attrs) {
|
|
1515
|
-
const candidates = normalized ? normalized.map((o) => this._displayLabel(o.value, normalized)) : [this._displayLabel(attrs.min, null), this._displayLabel(attrs.max, null)];
|
|
1516
|
-
const maxLen = Math.max(...candidates.map((l) => l.length), 1);
|
|
1517
|
-
return `${maxLen}ch`;
|
|
1518
|
-
}
|
|
1519
|
-
_updateTrackFill() {
|
|
1520
|
-
if (!this.tracked || !this.fieldElement) return;
|
|
1521
|
-
const min = Number(this.fieldElement.min);
|
|
1522
|
-
const max = Number(this.fieldElement.max);
|
|
1523
|
-
const val = Number(this.fieldElement.value);
|
|
1524
|
-
const range = max - min || 1;
|
|
1525
|
-
const pct = Math.max(0, Math.min(100, (val - min) / range * 100));
|
|
1526
|
-
this.style.setProperty("--fill-pct", `${pct}%`);
|
|
1527
|
-
}
|
|
1528
|
-
_getMarksData(normalized, attrs) {
|
|
1529
|
-
const minVal = Number(attrs.min);
|
|
1530
|
-
const maxVal = Number(attrs.max);
|
|
1531
|
-
const range = maxVal - minVal || 1;
|
|
1532
|
-
const marks = this.marks;
|
|
1533
|
-
if (Array.isArray(marks)) {
|
|
1534
|
-
const result = [];
|
|
1535
|
-
for (const m of marks) {
|
|
1536
|
-
const isObj = m !== null && typeof m === "object";
|
|
1537
|
-
const numVal = isObj ? m.value : m;
|
|
1538
|
-
if (numVal < minVal || numVal > maxVal) continue;
|
|
1539
|
-
const rawLabel = isObj ? m.label ?? String(numVal) : String(numVal);
|
|
1540
|
-
result.push({
|
|
1541
|
-
value: String(numVal),
|
|
1542
|
-
label: this.percentage ? `${rawLabel}%` : rawLabel,
|
|
1543
|
-
pct: (numVal - minVal) / range * 100
|
|
1544
|
-
});
|
|
1545
|
-
}
|
|
1546
|
-
return result;
|
|
1547
|
-
}
|
|
1548
|
-
if (normalized) {
|
|
1549
|
-
return normalized.map((o) => ({
|
|
1550
|
-
value: o.value,
|
|
1551
|
-
label: this.percentage ? `${o.label}%` : o.label,
|
|
1552
|
-
pct: (o.rangeValue - minVal) / range * 100
|
|
1553
|
-
}));
|
|
1554
|
-
}
|
|
1555
|
-
return [
|
|
1556
|
-
{ value: attrs.min, label: this.percentage ? `${minVal}%` : String(minVal), pct: 0 },
|
|
1557
|
-
{ value: attrs.max, label: this.percentage ? `${maxVal}%` : String(maxVal), pct: 100 }
|
|
1558
|
-
];
|
|
1559
|
-
}
|
|
1560
|
-
writeValue(value) {
|
|
1561
|
-
const normalized = this._normalizeOptions();
|
|
1562
|
-
const rv = this._toRangeValue(value, normalized);
|
|
1563
|
-
if (this.fieldElement && rv !== "" && this.fieldElement.value !== rv) {
|
|
1564
|
-
this.fieldElement.value = rv;
|
|
1565
|
-
}
|
|
1566
|
-
if (this._valueLabel) {
|
|
1567
|
-
this._valueLabel.textContent = this._displayLabel(value, normalized);
|
|
1568
|
-
}
|
|
1569
|
-
if (this._numberInput && !normalized && this._numberInput.value !== rv) {
|
|
1570
|
-
this._numberInput.value = rv;
|
|
1571
|
-
}
|
|
1572
|
-
this._updateTrackFill();
|
|
1573
|
-
}
|
|
1574
|
-
getValue() {
|
|
1575
|
-
if (!this.fieldElement) return "";
|
|
1576
|
-
return this._fromRangeValue(this.fieldElement.value, this._normalizeOptions());
|
|
1577
|
-
}
|
|
1578
|
-
render() {
|
|
1579
|
-
const normalized = this._normalizeOptions();
|
|
1580
|
-
const attrs = this._getRangeAttrs(normalized);
|
|
1581
|
-
return html(({ div, input, span }) => {
|
|
1582
|
-
div({ className: "range-container" }, () => {
|
|
1583
|
-
div({ key: "range-wrapper", className: "range-wrapper" }, () => {
|
|
1584
|
-
this.fieldElement = input({
|
|
1585
|
-
key: "range",
|
|
1586
|
-
type: "range",
|
|
1587
|
-
min: attrs.min,
|
|
1588
|
-
max: attrs.max,
|
|
1589
|
-
step: attrs.step,
|
|
1590
|
-
"@input": this._boundOnRangeInput,
|
|
1591
|
-
"@change": this.boundOnChange
|
|
1592
|
-
});
|
|
1593
|
-
if (this.marks) {
|
|
1594
|
-
const marksData = this._getMarksData(normalized, attrs);
|
|
1595
|
-
div({ key: "marks", className: "marks-container" }, () => {
|
|
1596
|
-
for (const m of marksData) {
|
|
1597
|
-
tags.span(
|
|
1598
|
-
{
|
|
1599
|
-
key: `mark-${m.value}`,
|
|
1600
|
-
className: "mark",
|
|
1601
|
-
style: { left: `${m.pct}%` }
|
|
1602
|
-
},
|
|
1603
|
-
() => {
|
|
1604
|
-
tags.span({ className: "mark-label", textContent: m.label });
|
|
1605
|
-
}
|
|
1606
|
-
);
|
|
1607
|
-
}
|
|
1608
|
-
});
|
|
1609
|
-
}
|
|
1610
|
-
});
|
|
1611
|
-
this._valueLabel = span({
|
|
1612
|
-
key: "label",
|
|
1613
|
-
className: "value-label",
|
|
1614
|
-
style: { minWidth: this._maxValueLabelWidth(normalized, attrs) },
|
|
1615
|
-
textContent: this._displayLabel(this.value, normalized)
|
|
1616
|
-
});
|
|
1617
|
-
this.renderActionButtons();
|
|
1618
|
-
if (this.editable) {
|
|
1619
|
-
this._numberInput = input({
|
|
1620
|
-
key: "number",
|
|
1621
|
-
type: "number",
|
|
1622
|
-
className: "value-input",
|
|
1623
|
-
min: attrs.min,
|
|
1624
|
-
max: attrs.max,
|
|
1625
|
-
step: attrs.step,
|
|
1626
|
-
// Disabled in options mode: valid values are discrete, free text makes no sense
|
|
1627
|
-
disabled: attrs.inOptionsMode,
|
|
1628
|
-
"@input": this._boundOnNumberInput
|
|
1629
|
-
});
|
|
1630
|
-
} else {
|
|
1631
|
-
this._numberInput = null;
|
|
1632
|
-
}
|
|
1633
|
-
});
|
|
1634
|
-
if (this.value != null) this.writeValue(this.value);
|
|
1635
|
-
});
|
|
1636
|
-
}
|
|
1637
|
-
_onRangeInput() {
|
|
1638
|
-
if (!this.fieldElement) return;
|
|
1639
|
-
const normalized = this._normalizeOptions();
|
|
1640
|
-
const actualValue = this._fromRangeValue(this.fieldElement.value, normalized);
|
|
1641
|
-
if (this._valueLabel) {
|
|
1642
|
-
this._valueLabel.textContent = this._displayLabel(actualValue, normalized);
|
|
1643
|
-
}
|
|
1644
|
-
if (this._numberInput && !normalized) {
|
|
1645
|
-
this._numberInput.value = this.fieldElement.value;
|
|
1646
|
-
}
|
|
1647
|
-
this._updateTrackFill();
|
|
1648
|
-
}
|
|
1649
|
-
_onNumberInput() {
|
|
1650
|
-
if (!this._numberInput || !this.fieldElement) return;
|
|
1651
|
-
const v = this._numberInput.value;
|
|
1652
|
-
if (this.fieldElement.value === v) return;
|
|
1653
|
-
this.fieldElement.value = v;
|
|
1654
|
-
if (this._valueLabel) {
|
|
1655
|
-
this._valueLabel.textContent = this._displayLabel(v, null);
|
|
1656
|
-
}
|
|
1657
|
-
}
|
|
1658
|
-
clear(options) {
|
|
1659
|
-
var _a2, _b;
|
|
1660
|
-
const normalized = this._normalizeOptions();
|
|
1661
|
-
const attrs = this._getRangeAttrs(normalized);
|
|
1662
|
-
const clearTo = normalized ? ((_a2 = normalized.find((o) => String(o.rangeValue) === attrs.min)) == null ? void 0 : _a2.value) ?? ((_b = normalized[0]) == null ? void 0 : _b.value) ?? attrs.min : attrs.min;
|
|
1663
|
-
this.setValue(clearTo, { ...options, action: "clear" });
|
|
1664
|
-
}
|
|
1665
|
-
_isSliderOption(opt) {
|
|
1666
|
-
return opt !== null && typeof opt === "object" && "label" in opt && "value" in opt;
|
|
1667
|
-
}
|
|
1668
|
-
}
|
|
1669
|
-
_init$b = __decoratorStart$b(_a$b);
|
|
1670
|
-
_options = /* @__PURE__ */ new WeakMap();
|
|
1671
|
-
_percentage = /* @__PURE__ */ new WeakMap();
|
|
1672
|
-
_min = /* @__PURE__ */ new WeakMap();
|
|
1673
|
-
_max = /* @__PURE__ */ new WeakMap();
|
|
1674
|
-
_step = /* @__PURE__ */ new WeakMap();
|
|
1675
|
-
_editable = /* @__PURE__ */ new WeakMap();
|
|
1676
|
-
_tracked = /* @__PURE__ */ new WeakMap();
|
|
1677
|
-
_marks = /* @__PURE__ */ new WeakMap();
|
|
1678
|
-
__decorateElement$b(_init$b, 4, "options", _options_dec, Slider, _options);
|
|
1679
|
-
__decorateElement$b(_init$b, 4, "percentage", _percentage_dec, Slider, _percentage);
|
|
1680
|
-
__decorateElement$b(_init$b, 4, "min", _min_dec, Slider, _min);
|
|
1681
|
-
__decorateElement$b(_init$b, 4, "max", _max_dec, Slider, _max);
|
|
1682
|
-
__decorateElement$b(_init$b, 4, "step", _step_dec, Slider, _step);
|
|
1683
|
-
__decorateElement$b(_init$b, 4, "editable", _editable_dec, Slider, _editable);
|
|
1684
|
-
__decorateElement$b(_init$b, 4, "tracked", _tracked_dec, Slider, _tracked);
|
|
1685
|
-
__decorateElement$b(_init$b, 4, "marks", _marks_dec, Slider, _marks);
|
|
1686
|
-
__decoratorMetadata$b(_init$b, Slider);
|
|
1687
|
-
__publicField$b(Slider, "tagName", "slider");
|
|
1688
|
-
__publicField$b(Slider, "styles", [styleVariables, sizeCSS, colorCSS, style$8]);
|
|
1689
|
-
Slider.register();
|
|
1690
|
-
const styles$1 = ":host {\n display: block;\n flex: 1;\n min-width: 0;\n font-size: var(--size-base);\n\n /* Layout */\n --checkbox-field-gap: 4px;\n\n /* Checkbox */\n --checkbox-size: 1.167em;\n --checkbox-border-width: 1px;\n --checkbox-border-radius: 2px;\n --checkbox-border-color: var(--border-subtle);\n --checkbox-bg: var(--surface-base);\n --checkbox-accent-color: var(--color-solid);\n\n /* Default color when no [color] attribute — overridden by color.css :host([color=...]) */\n --color-solid: var(--color-primary);\n}\n\n.checkbox-container {\n display: flex;\n align-items: center;\n gap: var(--checkbox-field-gap);\n width: 100%;\n}\n\n.checkbox-wrapper {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.field-input {\n width: var(--checkbox-size);\n height: var(--checkbox-size);\n cursor: pointer;\n border: var(--checkbox-border-width) solid var(--checkbox-border-color);\n border-radius: var(--checkbox-border-radius);\n background: var(--checkbox-bg);\n accent-color: var(--checkbox-accent-color);\n margin: 0;\n flex-shrink: 0;\n}\n\n.field-input:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* action buttons */\n.reset-btn,\n.clear-btn {\n width: 1.333em;\n height: 1.333em;\n border: none;\n border-radius: var(--reset-btn-border-radius);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--reset-btn-bg);\n color: var(--reset-btn-color);\n transition: var(--reset-btn-transition);\n flex-shrink: 0;\n line-height: 1;\n}\n\n.reset-btn:hover {\n background: var(--reset-btn-bg-hover);\n color: var(--reset-btn-color-hover);\n}\n\n.clear-btn:hover {\n background: var(--clear-btn-bg-hover);\n color: var(--clear-btn-color-hover);\n}\n";
|
|
1691
|
-
class Checkbox extends AeicoField {
|
|
1692
|
-
constructor() {
|
|
1693
|
-
super(...arguments);
|
|
1694
|
-
__publicField(this, "fieldElement", null);
|
|
1695
|
-
}
|
|
1696
|
-
getValue() {
|
|
1697
|
-
var _a2;
|
|
1698
|
-
return ((_a2 = this.fieldElement) == null ? void 0 : _a2.checked) ?? false;
|
|
1699
|
-
}
|
|
1700
|
-
writeValue(checked) {
|
|
1701
|
-
if (this.fieldElement) {
|
|
1702
|
-
this.fieldElement.checked = Boolean(checked);
|
|
1703
|
-
}
|
|
1704
|
-
}
|
|
1705
|
-
getEventPayload(checked, oldChecked, action) {
|
|
1706
|
-
return { checked, oldChecked, action };
|
|
1707
|
-
}
|
|
1708
|
-
setValue(checked, options) {
|
|
1709
|
-
const oldChecked = this.getValue();
|
|
1710
|
-
this.checked = checked;
|
|
1711
|
-
this.writeValue(checked);
|
|
1712
|
-
if ((options == null ? void 0 : options.silent) === false) {
|
|
1713
|
-
this.emit("change", {
|
|
1714
|
-
detail: this.getEventPayload(checked, oldChecked, options.action || "change")
|
|
1715
|
-
});
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
reset(checked, options) {
|
|
1719
|
-
this.setValue(checked !== void 0 ? checked : this.defaultChecked ?? false, {
|
|
1720
|
-
...options,
|
|
1721
|
-
action: "reset"
|
|
1722
|
-
});
|
|
1723
|
-
}
|
|
1724
|
-
clear(options) {
|
|
1725
|
-
this.setValue(false, { ...options, action: "clear" });
|
|
1726
|
-
}
|
|
1727
|
-
render() {
|
|
1728
|
-
return html(({ div, input }) => {
|
|
1729
|
-
div({ className: "checkbox-container", variant: this.variant }, () => {
|
|
1730
|
-
div({ className: "checkbox-wrapper" }, () => {
|
|
1731
|
-
this.fieldElement = input({
|
|
1732
|
-
type: "checkbox",
|
|
1733
|
-
className: "field-input",
|
|
1734
|
-
checked: Boolean(this.checked),
|
|
1735
|
-
disabled: Boolean(this.disabled),
|
|
1736
|
-
"@change": this.boundOnChange
|
|
1737
|
-
});
|
|
1738
|
-
});
|
|
1739
|
-
this.renderActionButtons();
|
|
1740
|
-
});
|
|
1741
|
-
});
|
|
1742
|
-
}
|
|
1743
|
-
}
|
|
1744
|
-
__publicField(Checkbox, "tagName", "checkbox");
|
|
1745
|
-
__publicField(Checkbox, "props", {
|
|
1746
|
-
checked: { type: Boolean },
|
|
1747
|
-
defaultChecked: { type: Boolean },
|
|
1748
|
-
variant: { type: String }
|
|
1749
|
-
});
|
|
1750
|
-
__publicField(Checkbox, "styles", [styleVariables, sizeCSS, colorCSS, styles$1]);
|
|
1751
|
-
Checkbox.register();
|
|
1752
|
-
const style$7 = ':host {\n display: inline-flex;\n align-items: center;\n gap: var(--rg-gap, 0.286em);\n font-size: var(--size-m);\n --rg-solid-bg: var(--color-solid);\n --rg-solid-bg-hover: var(--color-solid-hover);\n --rg-solid-bg-active: var(--color-solid-active);\n --rg-solid-color: var(--color-on-solid);\n --rg-solid-color-hover: var(--color-on-solid-hover, var(--color-on-solid));\n --rg-border: var(--color-border);\n --rg-border-hover: var(--color-border-hover);\n --rg-accent: var(--color-accent);\n --rg-accent-hover: var(--color-accent-hover);\n --rg-subtle-bg: var(--color-subtle);\n --rg-subtle-bg-hover: var(--color-subtle-hover);\n\n --rg-font-size: 1em;\n --rg-height: 2.286em;\n --rg-padding: 0.429em 1.071em;\n --rg-min-width: 4.571em;\n --rg-radius: 4px;\n --rg-font-weight: 400;\n\n --color-unselected: var(--surface-base);\n --color-unselected-hover: var(--color-gray-lighter);\n}\n\n:host([size="xs"]) { --rg-radius: 3px; }\n:host([size="sm"]) { --rg-radius: 3px; }\n\n.rg-container {\n display: inline-flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 6px;\n}\n\nslot {\n display: none;\n}\n\n.rg-radio-option {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n cursor: pointer;\n font-size: var(--rg-font-size);\n color: var(--color-text-main);\n user-select: none;\n}\n\n.rg-radio-input {\n width: 14px;\n height: 14px;\n accent-color: var(--rg-solid-bg, var(--color-primary));\n cursor: pointer;\n margin: 0;\n flex-shrink: 0;\n}\n\n.rg-radio-label {\n line-height: 1.5;\n}\n\n.rg-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-family: inherit;\n font-size: var(--rg-font-size);\n font-weight: 400;\n height: var(--rg-height);\n padding: var(--rg-padding);\n min-width: var(--rg-min-width);\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;\n outline: none;\n border-radius: var(--rg-radius);\n\n background: var(--color-unselected);\n border: 1px solid var(--color-gray-light);\n color: var(--color-text-muted);\n}\n\n.rg-btn:hover:not(:disabled):not(.selected) {\n background: var(--color-unselected-hover);\n border-color: var(--color-gray-light);\n color: var(--color-text-main);\n}\n\n.rg-btn.selected {\n background: var(--rg-solid-bg);\n border-color: var(--rg-solid-bg);\n color: var(--rg-solid-color);\n font-weight: 500;\n box-shadow: 0 1px 4px rgb(from black r g b / 0.22);\n}\n\n.rg-btn.selected:hover:not(:disabled) {\n background: var(--rg-solid-bg-hover);\n border-color: var(--rg-solid-bg-hover);\n}\n\n.rg-btn:active:not(:disabled):not(.selected) {\n background: var(--rg-subtle-bg-hover);\n transform: translateY(1px);\n}\n\n.rg-btn:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n:host([variant="outlined"]) .rg-btn {\n background: transparent;\n border-color: var(--rg-border);\n color: var(--rg-accent);\n}\n:host([variant="outlined"]) .rg-btn:hover:not(:disabled):not(.selected) {\n background: var(--rg-subtle-bg);\n border-color: var(--rg-accent);\n color: var(--rg-accent-hover);\n}\n:host([variant="outlined"]) .rg-btn.selected {\n background: var(--rg-solid-bg);\n border-color: var(--rg-solid-bg);\n color: var(--rg-solid-color);\n}\n\n:host([variant="subtle"]) .rg-btn {\n background: transparent;\n border-color: transparent;\n color: var(--rg-accent);\n}\n:host([variant="subtle"]) .rg-btn:hover:not(:disabled):not(.selected) {\n background: var(--rg-subtle-bg);\n border-color: transparent;\n color: var(--rg-accent-hover);\n}\n:host([variant="subtle"]) .rg-btn.selected {\n background: var(--rg-subtle-bg-hover);\n border-color: transparent;\n color: var(--rg-accent-hover);\n font-weight: 600;\n box-shadow: none;\n}\n\n:host([variant="filled"]) .rg-btn:not(.selected) {\n background: var(--surface-base);\n border-color: var(--border-default);\n color: var(--color-text-muted);\n}\n\n:host([variant="filled"]) .rg-btn:hover:not(:disabled):not(.selected) {\n background: var(--surface-raised);\n border-color: var(--border-hover);\n color: var(--color-text-main);\n}\n\n:host([mode="button"]) .rg-container {\n gap: 6px;\n}\n\n:host([mode="button-group"]) .rg-container {\n gap: 0;\n}\n\n:host([mode="button-group"]) .rg-btn:not(.first):not(.only) {\n margin-left: -1px;\n}\n\n:host([mode="button-group"]) .rg-btn.first {\n border-radius: var(--rg-radius) 0 0 var(--rg-radius);\n}\n:host([mode="button-group"]) .rg-btn.inner {\n border-radius: 0;\n}\n:host([mode="button-group"]) .rg-btn.last {\n border-radius: 0 var(--rg-radius) var(--rg-radius) 0;\n}\n:host([mode="button-group"]) .rg-btn.only {\n border-radius: var(--rg-radius);\n}\n\n:host([mode="button-group"]) .rg-btn:hover:not(:disabled),\n:host([mode="button-group"]) .rg-btn.selected {\n position: relative;\n z-index: 1;\n}\n\n:host([mode="segmented"]) .rg-container {\n gap: 2px;\n background: var(--surface-raised);\n border: 1px solid var(--border-subtle);\n border-radius: calc(var(--rg-radius) + 2px);\n padding: 2px;\n flex-wrap: nowrap;\n}\n\n:host([mode="segmented"]) .rg-btn {\n background: transparent;\n border-color: transparent;\n color: var(--color-text-muted);\n border-radius: var(--rg-radius);\n min-width: var(--rg-min-width);\n box-shadow: none;\n font-weight: 400;\n}\n\n:host([mode="segmented"]) .rg-btn:hover:not(:disabled):not(.selected) {\n background: var(--rg-subtle-bg);\n border-color: transparent;\n color: var(--color-text-secondary, var(--color-text-main));\n}\n\n:host([mode="segmented"]) .rg-btn.selected {\n background: var(--rg-solid-bg);\n border-color: transparent;\n color: var(--rg-solid-color);\n font-weight: 500;\n box-shadow: 0 1px 4px rgb(from black r g b / 0.35);\n}\n\n:host([mode="segmented"]) .rg-btn.selected:hover:not(:disabled) {\n background: var(--rg-solid-bg-hover);\n}\n\n:host([mode="segmented"]:not([color])) .rg-btn.selected {\n background: var(--color-gray-lighter);\n color: var(--color-text-main);\n}\n\n:host([mode="segmented"][variant="outlined"]) .rg-container {\n border-color: var(--rg-border);\n}\n:host([mode="segmented"][variant="outlined"]) .rg-btn.selected {\n background: var(--rg-solid-bg);\n border-color: transparent;\n color: var(--rg-solid-color);\n}\n\n.reset-btn,\n.clear-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: var(--reset-btn-transition);\n flex-shrink: 0;\n line-height: 1;\n font-family: inherit;\n padding: 0;\n\n width: 1.333em;\n height: 1.333em;\n border-radius: var(--reset-btn-border-radius);\n border: none;\n background: var(--reset-btn-bg);\n color: var(--reset-btn-color);\n}\n\n.reset-btn:hover { background: var(--reset-btn-bg-hover); color: var(--reset-btn-color-hover); }\n.clear-btn:hover { background: var(--clear-btn-bg-hover); color: var(--clear-btn-color-hover); }\n\n:host([mode="button"]) .reset-btn,\n:host([mode="button"]) .clear-btn,\n:host([mode="button-group"]) .reset-btn,\n:host([mode="button-group"]) .clear-btn,\n:host([mode="segmented"]) .reset-btn,\n:host([mode="segmented"]) .clear-btn {\n height: var(--rg-height);\n width: var(--rg-height);\n border-radius: var(--rg-radius);\n font-size: var(--rg-font-size);\n}\n\n:host([mode="button"]) .reset-btn,\n:host([mode="button"]) .clear-btn,\n:host([mode="button-group"]) .reset-btn,\n:host([mode="button-group"]) .clear-btn,\n:host([mode="segmented"]) .reset-btn,\n:host([mode="segmented"]) .clear-btn {\n background: transparent;\n border: 1px solid var(--color-gray-light);\n color: var(--color-text-muted);\n}\n\n:host([mode="button"]) .reset-btn:hover,\n:host([mode="button-group"]) .reset-btn:hover,\n:host([mode="segmented"]) .reset-btn:hover {\n background: var(--border-subtle);\n border-color: var(--color-gray-lighter);\n color: var(--color-text-main);\n}\n\n:host([mode="button"]) .clear-btn:hover,\n:host([mode="button-group"]) .clear-btn:hover,\n:host([mode="segmented"]) .clear-btn:hover {\n background: rgb(from var(--red) r g b / 0.10);\n border-color: var(--color-gray-lighter);\n color: var(--color-danger);\n}\n\n:host([variant="outlined"][mode="button"]) .reset-btn,\n:host([variant="outlined"][mode="button"]) .clear-btn,\n:host([variant="outlined"][mode="button-group"]) .reset-btn,\n:host([variant="outlined"][mode="button-group"]) .clear-btn,\n:host([variant="outlined"][mode="segmented"]) .reset-btn,\n:host([variant="outlined"][mode="segmented"]) .clear-btn {\n background: transparent;\n border-color: var(--rg-border);\n color: var(--rg-accent);\n}\n\n:host([variant="outlined"][mode="button"]) .reset-btn:hover,\n:host([variant="outlined"][mode="button-group"]) .reset-btn:hover,\n:host([variant="outlined"][mode="segmented"]) .reset-btn:hover {\n background: var(--border-subtle);\n border-color: var(--rg-border-hover);\n color: var(--rg-accent-hover);\n}\n\n:host([variant="outlined"][mode="button"]) .clear-btn:hover,\n:host([variant="outlined"][mode="button-group"]) .clear-btn:hover,\n:host([variant="outlined"][mode="segmented"]) .clear-btn:hover {\n background: rgb(from var(--red) r g b / 0.10);\n border-color: var(--rg-border-hover);\n color: var(--color-danger);\n}\n\n:host([variant="subtle"][mode="button"]) .reset-btn,\n:host([variant="subtle"][mode="button"]) .clear-btn,\n:host([variant="subtle"][mode="button-group"]) .reset-btn,\n:host([variant="subtle"][mode="button-group"]) .clear-btn,\n:host([variant="subtle"][mode="segmented"]) .reset-btn,\n:host([variant="subtle"][mode="segmented"]) .clear-btn {\n background: transparent;\n border-color: transparent;\n color: var(--rg-accent);\n}\n\n:host([variant="subtle"][mode="button"]) .reset-btn:hover,\n:host([variant="subtle"][mode="button-group"]) .reset-btn:hover,\n:host([variant="subtle"][mode="segmented"]) .reset-btn:hover {\n background: var(--border-subtle);\n border-color: transparent;\n color: var(--rg-accent-hover);\n}\n\n:host([variant="subtle"][mode="button"]) .clear-btn:hover,\n:host([variant="subtle"][mode="button-group"]) .clear-btn:hover,\n:host([variant="subtle"][mode="segmented"]) .clear-btn:hover {\n background: rgb(from var(--red) r g b / 0.10);\n border-color: transparent;\n color: var(--color-danger);\n}\n';
|
|
1753
|
-
const _RadioGroup = class _RadioGroup extends AeicoField {
|
|
1754
|
-
constructor() {
|
|
1755
|
-
super();
|
|
1756
|
-
__publicField(this, "fieldElement", null);
|
|
1757
|
-
__publicField(this, "_slotEl", null);
|
|
1758
|
-
__publicField(this, "_slotOptions", []);
|
|
1759
|
-
__publicField(this, "_groupName");
|
|
1760
|
-
// Single handler for radio inputs — handles both select and deselect.
|
|
1761
|
-
// Only uses `click` (not `change`) because `change` fires before `click`;
|
|
1762
|
-
// if we set value in `change`, the `click` handler would see the updated
|
|
1763
|
-
// value and immediately deselect.
|
|
1764
|
-
__publicField(this, "_boundOnRadioClick", (e) => {
|
|
1765
|
-
const input = e.target;
|
|
1766
|
-
const current = this.value ?? "";
|
|
1767
|
-
if (input.value === current) {
|
|
1768
|
-
if (this.allowEmpty) {
|
|
1769
|
-
input.checked = false;
|
|
1770
|
-
this.setValue("", { silent: false, action: "change" });
|
|
1771
|
-
}
|
|
1772
|
-
} else {
|
|
1773
|
-
this.setValue(input.value, { silent: false, action: "change" });
|
|
1774
|
-
}
|
|
1775
|
-
});
|
|
1776
|
-
__publicField(this, "_boundOnButtonClick", (e) => {
|
|
1777
|
-
const btn = e.currentTarget;
|
|
1778
|
-
const val = btn.dataset.value ?? "";
|
|
1779
|
-
const current = this.value ?? "";
|
|
1780
|
-
if (val === current) {
|
|
1781
|
-
if (this.allowEmpty) {
|
|
1782
|
-
this.setValue("", { silent: false, action: "change" });
|
|
1783
|
-
}
|
|
1784
|
-
} else {
|
|
1785
|
-
this.setValue(val, { silent: false, action: "change" });
|
|
1786
|
-
}
|
|
1787
|
-
});
|
|
1788
|
-
this._groupName = `rg-${++_RadioGroup._instanceCount}`;
|
|
1789
|
-
}
|
|
1790
|
-
_optLabel(opt) {
|
|
1791
|
-
if (opt !== null && typeof opt === "object") {
|
|
1792
|
-
return t(String(opt.label), String(opt.label));
|
|
1793
|
-
}
|
|
1794
|
-
return String(opt);
|
|
1795
|
-
}
|
|
1796
|
-
_optValue(opt) {
|
|
1797
|
-
if (opt !== null && typeof opt === "object") return String(opt.value);
|
|
1798
|
-
return String(opt);
|
|
1799
|
-
}
|
|
1800
|
-
_allOptions() {
|
|
1801
|
-
const from_props = (Array.isArray(this.options) ? this.options : []).map((o) => ({
|
|
1802
|
-
label: this._optLabel(o),
|
|
1803
|
-
value: this._optValue(o)
|
|
1804
|
-
}));
|
|
1805
|
-
const from_slot = this._slotOptions.map((el) => {
|
|
1806
|
-
var _a2;
|
|
1807
|
-
return {
|
|
1808
|
-
label: ((_a2 = el.textContent) == null ? void 0 : _a2.trim()) || el.value,
|
|
1809
|
-
value: el.value,
|
|
1810
|
-
disabled: el.disabled
|
|
1811
|
-
};
|
|
1812
|
-
});
|
|
1813
|
-
return [...from_props, ...from_slot];
|
|
1814
|
-
}
|
|
1815
|
-
_onSlotChange() {
|
|
1816
|
-
if (!this._slotEl) return;
|
|
1817
|
-
this._slotOptions = this._slotEl.assignedElements({ flatten: true }).filter(
|
|
1818
|
-
(el) => el.tagName.toLowerCase() === "ae-radio"
|
|
1819
|
-
);
|
|
1820
|
-
this.update();
|
|
1821
|
-
}
|
|
1822
|
-
getValue() {
|
|
1823
|
-
return this.value ?? "";
|
|
1824
|
-
}
|
|
1825
|
-
writeValue(_value2) {
|
|
1826
|
-
}
|
|
1827
|
-
onReset() {
|
|
1828
|
-
this.setValue(this.defaultValue ?? "", { silent: false, action: "reset" });
|
|
1829
|
-
}
|
|
1830
|
-
onClear() {
|
|
1831
|
-
this.setValue("", { silent: false, action: "clear" });
|
|
1832
|
-
}
|
|
1833
|
-
render() {
|
|
1834
|
-
const mode = this.mode || "default";
|
|
1835
|
-
const opts = this._allOptions();
|
|
1836
|
-
const current = this.value ?? "";
|
|
1837
|
-
return html(({ div, slot }) => {
|
|
1838
|
-
div({ className: "rg-container" }, () => {
|
|
1839
|
-
if (mode === "default") {
|
|
1840
|
-
this._renderRadio(opts, current);
|
|
1841
|
-
} else {
|
|
1842
|
-
this._renderButtons(opts, current, mode);
|
|
1843
|
-
}
|
|
1844
|
-
});
|
|
1845
|
-
if (this.allowEmpty) this.renderClearButton();
|
|
1846
|
-
this.renderResetButton();
|
|
1847
|
-
this._slotEl = slot({
|
|
1848
|
-
style: { display: "none" },
|
|
1849
|
-
"@slotchange": () => this._onSlotChange()
|
|
1850
|
-
});
|
|
1851
|
-
});
|
|
1852
|
-
}
|
|
1853
|
-
_renderRadio(opts, current) {
|
|
1854
|
-
const { label, input, span } = tags;
|
|
1855
|
-
for (const opt of opts) {
|
|
1856
|
-
const isChecked = opt.value === current;
|
|
1857
|
-
label({ key: `opt-${opt.value}`, className: "rg-radio-option" }, () => {
|
|
1858
|
-
const el = input({
|
|
1859
|
-
type: "radio",
|
|
1860
|
-
className: "rg-radio-input",
|
|
1861
|
-
name: this._groupName,
|
|
1862
|
-
value: opt.value,
|
|
1863
|
-
disabled: Boolean(this.disabled) || Boolean(opt.disabled),
|
|
1864
|
-
"@click": this._boundOnRadioClick
|
|
1865
|
-
});
|
|
1866
|
-
el.checked = isChecked;
|
|
1867
|
-
if (!this.fieldElement) this.fieldElement = el;
|
|
1868
|
-
span({ className: "rg-radio-label", textContent: opt.label });
|
|
1869
|
-
});
|
|
1870
|
-
}
|
|
1871
|
-
}
|
|
1872
|
-
_renderButtons(opts, current, mode) {
|
|
1873
|
-
const { button } = tags;
|
|
1874
|
-
const count = opts.length;
|
|
1875
|
-
for (let i = 0; i < count; i++) {
|
|
1876
|
-
const opt = opts[i];
|
|
1877
|
-
const isSelected = opt.value === current;
|
|
1878
|
-
let posClass = "";
|
|
1879
|
-
if (mode === "button-group") {
|
|
1880
|
-
if (count === 1) posClass = " only";
|
|
1881
|
-
else if (i === 0) posClass = " first";
|
|
1882
|
-
else if (i === count - 1) posClass = " last";
|
|
1883
|
-
else posClass = " inner";
|
|
1884
|
-
}
|
|
1885
|
-
button({
|
|
1886
|
-
key: `opt-${opt.value}`,
|
|
1887
|
-
className: `rg-btn${isSelected ? " selected" : ""}${posClass}`,
|
|
1888
|
-
textContent: opt.label,
|
|
1889
|
-
disabled: Boolean(this.disabled) || Boolean(opt.disabled),
|
|
1890
|
-
"data-value": opt.value,
|
|
1891
|
-
"@click": this._boundOnButtonClick
|
|
1892
|
-
});
|
|
1893
|
-
}
|
|
1894
|
-
}
|
|
1895
|
-
};
|
|
1896
|
-
__publicField(_RadioGroup, "_instanceCount", 0);
|
|
1897
|
-
__publicField(_RadioGroup, "tagName", "radio-group");
|
|
1898
|
-
__publicField(_RadioGroup, "props", {
|
|
1899
|
-
options: { type: Array },
|
|
1900
|
-
mode: { type: String },
|
|
1901
|
-
color: { type: String },
|
|
1902
|
-
variant: { type: String },
|
|
1903
|
-
size: { type: String },
|
|
1904
|
-
allowEmpty: { type: Boolean }
|
|
1905
|
-
});
|
|
1906
|
-
__publicField(_RadioGroup, "styles", [styleVariables, sizeCSS, colorCSS, style$7]);
|
|
1907
|
-
let RadioGroup = _RadioGroup;
|
|
1908
|
-
RadioGroup.register();
|
|
1909
|
-
class Radio extends AeicoComponent {
|
|
1910
|
-
}
|
|
1911
|
-
__publicField(Radio, "tagName", "radio");
|
|
1912
|
-
/** No shadow DOM — this element is a transparent data/content carrier. */
|
|
1913
|
-
__publicField(Radio, "useShadowDOM", false);
|
|
1914
|
-
__publicField(Radio, "props", {
|
|
1915
|
-
value: { type: String },
|
|
1916
|
-
disabled: { type: Boolean }
|
|
1917
|
-
});
|
|
1918
|
-
Radio.register();
|
|
1919
|
-
const styles = ":host {\n display: block;\n font-size: var(--size-base);\n\n --switch-field-gap: 4px;\n\n --toggle-width: 2.667em;\n --toggle-height: 1.333em;\n --toggle-slider-size: 1em;\n --toggle-gap: calc((var(--toggle-height) - var(--toggle-slider-size)) / 2);\n --toggle-border-radius: calc(var(--toggle-height) / 2);\n --toggle-bg: var(--color-gray);\n --toggle-bg-checked: var(--color-solid);\n --toggle-slider-bg: white;\n --toggle-transition: 0.2s;\n\n /* Default color when no [color] attribute — overridden by color.css :host([color=...]) */\n --color-solid: var(--color-primary);\n}\n\n.switch-container {\n display: flex;\n align-items: center;\n gap: var(--switch-field-gap);\n}\n\n.switch-wrapper {\n position: relative;\n display: inline-flex;\n align-items: center;\n width: var(--toggle-width);\n height: var(--toggle-height);\n flex-shrink: 0;\n}\n\n.field-input {\n position: absolute;\n opacity: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n margin: 0;\n z-index: 1;\n border: none;\n border-radius: 0;\n background: none;\n accent-color: unset;\n}\n\n.field-input:disabled {\n cursor: not-allowed;\n}\n\n.toggle-slider {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: var(--toggle-bg);\n border-radius: var(--toggle-border-radius);\n transition: var(--toggle-transition);\n pointer-events: none;\n}\n\n.toggle-slider::before {\n content: '';\n position: absolute;\n height: var(--toggle-slider-size);\n width: var(--toggle-slider-size);\n left: var(--toggle-gap);\n top: var(--toggle-gap);\n background: var(--toggle-slider-bg);\n border-radius: 50%;\n transition: var(--toggle-transition);\n}\n\n.field-input:checked + .toggle-slider {\n background: var(--toggle-bg-checked);\n}\n\n.field-input:checked + .toggle-slider::before {\n transform: translateX(calc(var(--toggle-width) - var(--toggle-height)));\n}\n\n.field-input:disabled + .toggle-slider {\n opacity: 0.5;\n pointer-events: auto;\n}\n\n/* action buttons */\n.reset-btn,\n.clear-btn {\n width: 1.333em;\n height: 1.333em;\n border: none;\n border-radius: var(--reset-btn-border-radius);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--reset-btn-bg);\n color: var(--reset-btn-color);\n transition: var(--reset-btn-transition);\n flex-shrink: 0;\n line-height: 1;\n}\n\n.reset-btn:hover {\n background: var(--reset-btn-bg-hover);\n color: var(--reset-btn-color-hover);\n}\n\n.clear-btn:hover {\n background: var(--clear-btn-bg-hover);\n color: var(--clear-btn-color-hover);\n}\n";
|
|
1920
|
-
class Switch extends AeicoField {
|
|
1921
|
-
constructor() {
|
|
1922
|
-
super(...arguments);
|
|
1923
|
-
__publicField(this, "fieldElement", null);
|
|
1924
|
-
}
|
|
1925
|
-
getValue() {
|
|
1926
|
-
var _a2;
|
|
1927
|
-
return ((_a2 = this.fieldElement) == null ? void 0 : _a2.checked) ?? false;
|
|
1928
|
-
}
|
|
1929
|
-
writeValue(checked) {
|
|
1930
|
-
if (this.fieldElement) {
|
|
1931
|
-
this.fieldElement.checked = Boolean(checked);
|
|
1932
|
-
}
|
|
1933
|
-
}
|
|
1934
|
-
getEventPayload(checked, oldChecked, action) {
|
|
1935
|
-
return { checked, oldChecked, action };
|
|
1936
|
-
}
|
|
1937
|
-
setValue(checked, options) {
|
|
1938
|
-
const oldChecked = this.getValue();
|
|
1939
|
-
this.checked = checked;
|
|
1940
|
-
this.writeValue(checked);
|
|
1941
|
-
if ((options == null ? void 0 : options.silent) === false) {
|
|
1942
|
-
this.emit("change", {
|
|
1943
|
-
detail: this.getEventPayload(checked, oldChecked, options.action || "change")
|
|
1944
|
-
});
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
reset(checked, options) {
|
|
1948
|
-
this.setValue(checked !== void 0 ? checked : this.defaultChecked ?? false, {
|
|
1949
|
-
...options,
|
|
1950
|
-
action: "reset"
|
|
1951
|
-
});
|
|
1952
|
-
}
|
|
1953
|
-
clear(options) {
|
|
1954
|
-
this.setValue(false, { ...options, action: "clear" });
|
|
1955
|
-
}
|
|
1956
|
-
render() {
|
|
1957
|
-
return html(({ div, input, span }) => {
|
|
1958
|
-
div({ className: "switch-container" }, () => {
|
|
1959
|
-
div({ className: "switch-wrapper" }, () => {
|
|
1960
|
-
this.fieldElement = input({
|
|
1961
|
-
type: "checkbox",
|
|
1962
|
-
className: "field-input",
|
|
1963
|
-
checked: Boolean(this.checked),
|
|
1964
|
-
disabled: Boolean(this.disabled),
|
|
1965
|
-
"@change": this.boundOnChange
|
|
1966
|
-
});
|
|
1967
|
-
span({ className: "toggle-slider" });
|
|
1968
|
-
});
|
|
1969
|
-
this.renderActionButtons();
|
|
1970
|
-
});
|
|
1971
|
-
});
|
|
1972
|
-
}
|
|
1973
|
-
}
|
|
1974
|
-
__publicField(Switch, "tagName", "switch");
|
|
1975
|
-
__publicField(Switch, "props", {
|
|
1976
|
-
checked: { type: Boolean },
|
|
1977
|
-
defaultChecked: { type: Boolean }
|
|
1978
|
-
});
|
|
1979
|
-
__publicField(Switch, "styles", [styleVariables, sizeCSS, colorCSS, styles]);
|
|
1980
|
-
Switch.register();
|
|
1981
|
-
const style$6 = ":host {\n display: block;\n}\n\n/* Hide the separator template slot visually */\n.sep-template {\n display: none !important;\n}\n\n.list {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n list-style: none;\n margin: 0;\n padding: 0;\n font-size: inherit;\n line-height: 1.5;\n}\n";
|
|
1982
|
-
var __create$a = Object.create;
|
|
1983
|
-
var __defProp$a = Object.defineProperty;
|
|
1984
|
-
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
1985
|
-
var __knownSymbol$a = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
1986
|
-
var __typeError$a = (msg) => {
|
|
1987
|
-
throw TypeError(msg);
|
|
1988
|
-
};
|
|
1989
|
-
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1990
|
-
var __decoratorStart$a = (base) => [, , , __create$a((base == null ? void 0 : base[__knownSymbol$a("metadata")]) ?? null)];
|
|
1991
|
-
var __decoratorStrings$a = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
1992
|
-
var __expectFn$a = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$a("Function expected") : fn;
|
|
1993
|
-
var __decoratorContext$a = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$a[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$a("Already initialized") : fns.push(__expectFn$a(fn || null)) });
|
|
1994
|
-
var __decoratorMetadata$a = (array, target) => __defNormalProp$a(target, __knownSymbol$a("metadata"), array[3]);
|
|
1995
|
-
var __runInitializers$a = (array, flags, self, value) => {
|
|
1996
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
1997
|
-
return value;
|
|
1998
|
-
};
|
|
1999
|
-
var __decorateElement$a = (array, flags, name, decorators, target, extra) => {
|
|
2000
|
-
var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
|
|
2001
|
-
var j = array.length + 1, key = __decoratorStrings$a[k + 5];
|
|
2002
|
-
var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
|
|
2003
|
-
var desc = (target = target.prototype, __getOwnPropDesc$9({ get [name]() {
|
|
2004
|
-
return __privateGet$9(this, extra);
|
|
2005
|
-
}, set [name](x) {
|
|
2006
|
-
return __privateSet$9(this, extra, x);
|
|
2007
|
-
} }, name));
|
|
2008
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
2009
|
-
ctx = __decoratorContext$a(k, name, done = {}, array[3], extraInitializers);
|
|
2010
|
-
{
|
|
2011
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
|
|
2012
|
-
access.get = (x) => x[name];
|
|
2013
|
-
access.set = (x, y) => x[name] = y;
|
|
2014
|
-
}
|
|
2015
|
-
it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
|
|
2016
|
-
if (it === void 0) __expectFn$a(it) && (desc[key] = it);
|
|
2017
|
-
else if (typeof it !== "object" || it === null) __typeError$a("Object expected");
|
|
2018
|
-
else __expectFn$a(fn = it.get) && (desc.get = fn), __expectFn$a(fn = it.set) && (desc.set = fn), __expectFn$a(fn = it.init) && initializers.unshift(fn);
|
|
2019
|
-
}
|
|
2020
|
-
return desc && __defProp$a(target, name, desc), target;
|
|
2021
|
-
};
|
|
2022
|
-
var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2023
|
-
var __accessCheck$9 = (obj, member, msg) => member.has(obj) || __typeError$a("Cannot " + msg);
|
|
2024
|
-
var __privateGet$9 = (obj, member, getter) => (__accessCheck$9(obj, member, "read from private field"), member.get(obj));
|
|
2025
|
-
var __privateAdd$9 = (obj, member, value) => member.has(obj) ? __typeError$a("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2026
|
-
var __privateSet$9 = (obj, member, value, setter) => (__accessCheck$9(obj, member, "write to private field"), member.set(obj, value), value);
|
|
2027
|
-
var _color_dec$7, _separator_dec, _a$a, _init$a, _separator, _color$6;
|
|
2028
|
-
class Breadcrumb extends (_a$a = AeicoComponent, _separator_dec = [prop({ type: String })], _color_dec$7 = [prop({ type: String })], _a$a) {
|
|
2029
|
-
constructor() {
|
|
2030
|
-
super(...arguments);
|
|
2031
|
-
__privateAdd$9(this, _separator, __runInitializers$a(_init$a, 8, this, "/")), __runInitializers$a(_init$a, 11, this);
|
|
2032
|
-
__privateAdd$9(this, _color$6, __runInitializers$a(_init$a, 12, this)), __runInitializers$a(_init$a, 15, this);
|
|
2033
|
-
__publicField$a(this, "_itemsSlot", null);
|
|
2034
|
-
__publicField$a(this, "_sepSlot", null);
|
|
2035
|
-
__publicField$a(this, "_syncSeparators", () => {
|
|
2036
|
-
const items = this._getItems();
|
|
2037
|
-
const sepEl = this._getSepElement();
|
|
2038
|
-
items.forEach((item, i) => {
|
|
2039
|
-
item.querySelectorAll("[data-ae-sep]").forEach((n) => n.remove());
|
|
2040
|
-
const isLast = i === items.length - 1;
|
|
2041
|
-
if (isLast) {
|
|
2042
|
-
item.setAttribute("aria-current", "page");
|
|
2043
|
-
} else {
|
|
2044
|
-
item.removeAttribute("aria-current");
|
|
2045
|
-
}
|
|
2046
|
-
if (i === 0) return;
|
|
2047
|
-
const wrapper = document.createElement("span");
|
|
2048
|
-
wrapper.setAttribute("slot", "separator");
|
|
2049
|
-
wrapper.setAttribute("data-ae-sep", "");
|
|
2050
|
-
wrapper.setAttribute("aria-hidden", "true");
|
|
2051
|
-
if (sepEl) {
|
|
2052
|
-
wrapper.appendChild(sepEl.cloneNode(true));
|
|
2053
|
-
} else {
|
|
2054
|
-
wrapper.textContent = this.separator;
|
|
2055
|
-
}
|
|
2056
|
-
item.prepend(wrapper);
|
|
2057
|
-
});
|
|
2058
|
-
});
|
|
2059
|
-
}
|
|
2060
|
-
render() {
|
|
2061
|
-
return html(({ nav, ol, slot }) => {
|
|
2062
|
-
nav({ "aria-label": "breadcrumb", part: "nav" }, () => {
|
|
2063
|
-
ol({ part: "list", className: "list" }, () => {
|
|
2064
|
-
this._itemsSlot = slot({
|
|
2065
|
-
"@slotchange": () => this._syncSeparators()
|
|
2066
|
-
});
|
|
2067
|
-
});
|
|
2068
|
-
});
|
|
2069
|
-
this._sepSlot = slot({
|
|
2070
|
-
name: "separator",
|
|
2071
|
-
className: "sep-template",
|
|
2072
|
-
"@slotchange": () => this._syncSeparators()
|
|
2073
|
-
});
|
|
2074
|
-
});
|
|
2075
|
-
}
|
|
2076
|
-
onUpdated() {
|
|
2077
|
-
this._syncSeparators();
|
|
2078
|
-
}
|
|
2079
|
-
_getItems() {
|
|
2080
|
-
var _a2;
|
|
2081
|
-
return ((_a2 = this._itemsSlot) == null ? void 0 : _a2.assignedElements()) ?? [];
|
|
2082
|
-
}
|
|
2083
|
-
_getSepElement() {
|
|
2084
|
-
var _a2;
|
|
2085
|
-
return ((_a2 = this._sepSlot) == null ? void 0 : _a2.assignedElements()[0]) ?? null;
|
|
2086
|
-
}
|
|
2087
|
-
}
|
|
2088
|
-
_init$a = __decoratorStart$a(_a$a);
|
|
2089
|
-
_separator = /* @__PURE__ */ new WeakMap();
|
|
2090
|
-
_color$6 = /* @__PURE__ */ new WeakMap();
|
|
2091
|
-
__decorateElement$a(_init$a, 4, "separator", _separator_dec, Breadcrumb, _separator);
|
|
2092
|
-
__decorateElement$a(_init$a, 4, "color", _color_dec$7, Breadcrumb, _color$6);
|
|
2093
|
-
__decoratorMetadata$a(_init$a, Breadcrumb);
|
|
2094
|
-
__publicField$a(Breadcrumb, "tagName", "breadcrumb");
|
|
2095
|
-
__publicField$a(Breadcrumb, "styles", [styleVariables, colorCSS, style$6]);
|
|
2096
|
-
Breadcrumb.register();
|
|
2097
|
-
const style$5 = `:host {
|
|
2098
|
-
display: contents;
|
|
2099
|
-
}
|
|
2100
|
-
|
|
2101
|
-
.item {
|
|
2102
|
-
display: inline-flex;
|
|
2103
|
-
align-items: center;
|
|
2104
|
-
list-style: none;
|
|
2105
|
-
white-space: nowrap;
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
/* Separator — uses a fixed muted color that does NOT follow the breadcrumb's color prop */
|
|
2109
|
-
.sep {
|
|
2110
|
-
display: inline-flex;
|
|
2111
|
-
align-items: center;
|
|
2112
|
-
color: var(--color-text-muted);
|
|
2113
|
-
padding: 0 0.35em;
|
|
2114
|
-
user-select: none;
|
|
2115
|
-
pointer-events: none;
|
|
2116
|
-
flex-shrink: 0;
|
|
2117
|
-
font-size: 0.85em;
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
|
-
/* Hide separator on the first item */
|
|
2121
|
-
:host(:first-child) .sep,
|
|
2122
|
-
:host(:first-of-type) .sep {
|
|
2123
|
-
display: none;
|
|
2124
|
-
}
|
|
2125
|
-
|
|
2126
|
-
.label {
|
|
2127
|
-
display: inline-flex;
|
|
2128
|
-
align-items: center;
|
|
2129
|
-
color: var(--color-text-muted);
|
|
2130
|
-
}
|
|
2131
|
-
|
|
2132
|
-
/* Current page — last item */
|
|
2133
|
-
:host([aria-current="page"]) .label {
|
|
2134
|
-
color: var(--color-text-main);
|
|
2135
|
-
font-weight: 500;
|
|
2136
|
-
cursor: default;
|
|
2137
|
-
}
|
|
2138
|
-
|
|
2139
|
-
/* Link items */
|
|
2140
|
-
.label a {
|
|
2141
|
-
color: var(--color-accent, var(--color-text-link));
|
|
2142
|
-
text-decoration: none;
|
|
2143
|
-
outline: none;
|
|
2144
|
-
}
|
|
2145
|
-
|
|
2146
|
-
.label a:hover {
|
|
2147
|
-
color: var(--color-accent-hover, var(--color-text-link-hover));
|
|
2148
|
-
text-decoration: underline;
|
|
2149
|
-
}
|
|
2150
|
-
|
|
2151
|
-
.label a:focus-visible {
|
|
2152
|
-
outline: 2px solid var(--color-accent, var(--focus-ring-color));
|
|
2153
|
-
outline-offset: 2px;
|
|
2154
|
-
border-radius: 2px;
|
|
2155
|
-
}
|
|
2156
|
-
`;
|
|
2157
|
-
var __create$9 = Object.create;
|
|
2158
|
-
var __defProp$9 = Object.defineProperty;
|
|
2159
|
-
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
2160
|
-
var __knownSymbol$9 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
2161
|
-
var __typeError$9 = (msg) => {
|
|
2162
|
-
throw TypeError(msg);
|
|
2163
|
-
};
|
|
2164
|
-
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2165
|
-
var __decoratorStart$9 = (base) => [, , , __create$9((base == null ? void 0 : base[__knownSymbol$9("metadata")]) ?? null)];
|
|
2166
|
-
var __decoratorStrings$9 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
2167
|
-
var __expectFn$9 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$9("Function expected") : fn;
|
|
2168
|
-
var __decoratorContext$9 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$9[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$9("Already initialized") : fns.push(__expectFn$9(fn || null)) });
|
|
2169
|
-
var __decoratorMetadata$9 = (array, target) => __defNormalProp$9(target, __knownSymbol$9("metadata"), array[3]);
|
|
2170
|
-
var __runInitializers$9 = (array, flags, self, value) => {
|
|
2171
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
2172
|
-
return value;
|
|
2173
|
-
};
|
|
2174
|
-
var __decorateElement$9 = (array, flags, name, decorators, target, extra) => {
|
|
2175
|
-
var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
|
|
2176
|
-
var j = array.length + 1, key = __decoratorStrings$9[k + 5];
|
|
2177
|
-
var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
|
|
2178
|
-
var desc = (target = target.prototype, __getOwnPropDesc$8({ get [name]() {
|
|
2179
|
-
return __privateGet$8(this, extra);
|
|
2180
|
-
}, set [name](x) {
|
|
2181
|
-
return __privateSet$8(this, extra, x);
|
|
2182
|
-
} }, name));
|
|
2183
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
2184
|
-
ctx = __decoratorContext$9(k, name, done = {}, array[3], extraInitializers);
|
|
2185
|
-
{
|
|
2186
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
|
|
2187
|
-
access.get = (x) => x[name];
|
|
2188
|
-
access.set = (x, y) => x[name] = y;
|
|
2189
|
-
}
|
|
2190
|
-
it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
|
|
2191
|
-
if (it === void 0) __expectFn$9(it) && (desc[key] = it);
|
|
2192
|
-
else if (typeof it !== "object" || it === null) __typeError$9("Object expected");
|
|
2193
|
-
else __expectFn$9(fn = it.get) && (desc.get = fn), __expectFn$9(fn = it.set) && (desc.set = fn), __expectFn$9(fn = it.init) && initializers.unshift(fn);
|
|
2194
|
-
}
|
|
2195
|
-
return desc && __defProp$9(target, name, desc), target;
|
|
2196
|
-
};
|
|
2197
|
-
var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2198
|
-
var __accessCheck$8 = (obj, member, msg) => member.has(obj) || __typeError$9("Cannot " + msg);
|
|
2199
|
-
var __privateGet$8 = (obj, member, getter) => (__accessCheck$8(obj, member, "read from private field"), member.get(obj));
|
|
2200
|
-
var __privateAdd$8 = (obj, member, value) => member.has(obj) ? __typeError$9("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2201
|
-
var __privateSet$8 = (obj, member, value, setter) => (__accessCheck$8(obj, member, "write to private field"), member.set(obj, value), value);
|
|
2202
|
-
var _href_dec$1, _a$9, _init$9, _href$1;
|
|
2203
|
-
class BreadcrumbItem extends (_a$9 = AeicoComponent, _href_dec$1 = [prop({ type: String })], _a$9) {
|
|
2204
|
-
constructor() {
|
|
2205
|
-
super(...arguments);
|
|
2206
|
-
__privateAdd$8(this, _href$1, __runInitializers$9(_init$9, 8, this)), __runInitializers$9(_init$9, 11, this);
|
|
2207
|
-
}
|
|
2208
|
-
render() {
|
|
2209
|
-
return html(({ li, span, slot, a }) => {
|
|
2210
|
-
li({ part: "item", className: "item" }, () => {
|
|
2211
|
-
span({ part: "separator", className: "sep", "aria-hidden": "true" }, () => {
|
|
2212
|
-
slot({ name: "separator" });
|
|
2213
|
-
});
|
|
2214
|
-
span({ part: "label", className: "label" }, () => {
|
|
2215
|
-
if (this.href) {
|
|
2216
|
-
a({ href: this.href, part: "link" }, () => {
|
|
2217
|
-
slot();
|
|
2218
|
-
});
|
|
2219
|
-
} else {
|
|
2220
|
-
slot();
|
|
2221
|
-
}
|
|
2222
|
-
});
|
|
2223
|
-
});
|
|
2224
|
-
});
|
|
2225
|
-
}
|
|
2226
|
-
}
|
|
2227
|
-
_init$9 = __decoratorStart$9(_a$9);
|
|
2228
|
-
_href$1 = /* @__PURE__ */ new WeakMap();
|
|
2229
|
-
__decorateElement$9(_init$9, 4, "href", _href_dec$1, BreadcrumbItem, _href$1);
|
|
2230
|
-
__decoratorMetadata$9(_init$9, BreadcrumbItem);
|
|
2231
|
-
__publicField$9(BreadcrumbItem, "tagName", "breadcrumb-item");
|
|
2232
|
-
__publicField$9(BreadcrumbItem, "styles", [styleVariables, style$5]);
|
|
2233
|
-
BreadcrumbItem.register();
|
|
2234
|
-
const buttonStyle = `:host {
|
|
2235
|
-
display: inline-block;
|
|
2236
|
-
--btn-solid-bg: var(--color-solid);
|
|
2237
|
-
--btn-solid-bg-hover: var(--color-solid-hover);
|
|
2238
|
-
--btn-solid-bg-active: var(--color-solid-active);
|
|
2239
|
-
--btn-solid-color: var(--color-on-solid);
|
|
2240
|
-
--btn-solid-color-hover: var(--color-on-solid-hover);
|
|
2241
|
-
--btn-border: var(--color-border);
|
|
2242
|
-
--btn-border-hover: var(--color-border-hover);
|
|
2243
|
-
--btn-accent: var(--color-accent);
|
|
2244
|
-
--btn-accent-hover: var(--color-accent-hover);
|
|
2245
|
-
--btn-subtle-bg: var(--color-subtle);
|
|
2246
|
-
--btn-subtle-bg-hover: var(--color-subtle-hover);
|
|
2247
|
-
}
|
|
2248
|
-
|
|
2249
|
-
button {
|
|
2250
|
-
display: inline-flex;
|
|
2251
|
-
align-items: center;
|
|
2252
|
-
justify-content: center;
|
|
2253
|
-
gap: 6px;
|
|
2254
|
-
font-family: inherit;
|
|
2255
|
-
font-weight: 400;
|
|
2256
|
-
text-align: center;
|
|
2257
|
-
white-space: nowrap;
|
|
2258
|
-
vertical-align: middle;
|
|
2259
|
-
user-select: none;
|
|
2260
|
-
cursor: pointer;
|
|
2261
|
-
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
2262
|
-
outline: none;
|
|
2263
|
-
position: relative;
|
|
2264
|
-
padding: 0.429em 1.071em;
|
|
2265
|
-
font-size: 1em;
|
|
2266
|
-
line-height: 1.5;
|
|
2267
|
-
border-radius: var(--_btn-r-tl, 4px) var(--_btn-r-tr, 4px) var(--_btn-r-br, 4px) var(--_btn-r-bl, 4px);
|
|
2268
|
-
min-width: 4.571em;
|
|
2269
|
-
height: 2.286em;
|
|
2270
|
-
width: 100%;
|
|
2271
|
-
|
|
2272
|
-
background: var(--btn-solid-bg);
|
|
2273
|
-
border: 1px solid var(--btn-solid-bg);
|
|
2274
|
-
color: var(--btn-solid-color);
|
|
2275
|
-
}
|
|
2276
|
-
|
|
2277
|
-
button:focus { outline: none; }
|
|
2278
|
-
button:active { transform: translateY(1px); }
|
|
2279
|
-
|
|
2280
|
-
button:hover:not(:disabled) {
|
|
2281
|
-
background: var(--btn-solid-bg-hover);
|
|
2282
|
-
border-color: var(--btn-border-hover);
|
|
2283
|
-
color: var(--btn-solid-color-hover, var(--btn-solid-color));
|
|
2284
|
-
}
|
|
2285
|
-
|
|
2286
|
-
button:active:not(:disabled) { background: var(--btn-solid-bg-active); }
|
|
2287
|
-
|
|
2288
|
-
button:disabled {
|
|
2289
|
-
opacity: 0.5;
|
|
2290
|
-
cursor: not-allowed;
|
|
2291
|
-
}
|
|
2292
|
-
|
|
2293
|
-
:host([size="xs"]) button { border-radius: var(--_btn-r-tl, 3px) var(--_btn-r-tr, 3px) var(--_btn-r-br, 3px) var(--_btn-r-bl, 3px); }
|
|
2294
|
-
:host([size="sm"]) button { border-radius: var(--_btn-r-tl, 3px) var(--_btn-r-tr, 3px) var(--_btn-r-br, 3px) var(--_btn-r-bl, 3px); }
|
|
2295
|
-
|
|
2296
|
-
/* --- Variants --- */
|
|
2297
|
-
|
|
2298
|
-
:host([variant="outlined"]) button {
|
|
2299
|
-
background: transparent;
|
|
2300
|
-
border-color: var(--btn-border);
|
|
2301
|
-
color: var(--btn-accent);
|
|
2302
|
-
}
|
|
2303
|
-
|
|
2304
|
-
:host([variant="outlined"]) button:hover:not(:disabled) {
|
|
2305
|
-
background: var(--btn-subtle-bg);
|
|
2306
|
-
border-color: var(--btn-border-hover);
|
|
2307
|
-
color: var(--btn-accent-hover);
|
|
2308
|
-
}
|
|
2309
|
-
|
|
2310
|
-
:host([variant="outlined"]) button:active:not(:disabled) {
|
|
2311
|
-
background: var(--btn-subtle-bg-hover);
|
|
2312
|
-
}
|
|
2313
|
-
|
|
2314
|
-
:host([variant="subtle"]) button {
|
|
2315
|
-
background: var(--btn-subtle-bg);
|
|
2316
|
-
border-color: transparent;
|
|
2317
|
-
color: var(--btn-accent);
|
|
2318
|
-
}
|
|
2319
|
-
|
|
2320
|
-
:host([variant="subtle"]) button:hover:not(:disabled) {
|
|
2321
|
-
background: var(--btn-subtle-bg-hover);
|
|
2322
|
-
color: var(--btn-accent-hover);
|
|
2323
|
-
}
|
|
2324
|
-
|
|
2325
|
-
:host([variant="subtle"]) button:active:not(:disabled) {
|
|
2326
|
-
background: var(--btn-subtle-bg-hover);
|
|
2327
|
-
}
|
|
2328
|
-
|
|
2329
|
-
:host([variant="faint"]) button {
|
|
2330
|
-
background: var(--btn-subtle-bg);
|
|
2331
|
-
border-color: var(--btn-border);
|
|
2332
|
-
color: var(--btn-accent);
|
|
2333
|
-
}
|
|
2334
|
-
|
|
2335
|
-
:host([variant="faint"]) button:hover:not(:disabled) {
|
|
2336
|
-
background: var(--btn-subtle-bg-hover);
|
|
2337
|
-
border-color: var(--btn-border-hover);
|
|
2338
|
-
color: var(--btn-accent-hover);
|
|
2339
|
-
}
|
|
2340
|
-
|
|
2341
|
-
:host([variant="faint"]) button:active:not(:disabled) {
|
|
2342
|
-
background: var(--btn-subtle-bg-hover);
|
|
2343
|
-
}
|
|
2344
|
-
|
|
2345
|
-
:host([variant="text"]) button {
|
|
2346
|
-
background: transparent;
|
|
2347
|
-
border-color: transparent;
|
|
2348
|
-
color: var(--btn-accent);
|
|
2349
|
-
min-width: auto;
|
|
2350
|
-
padding-left: 4px;
|
|
2351
|
-
padding-right: 4px;
|
|
2352
|
-
}
|
|
2353
|
-
|
|
2354
|
-
:host([variant="text"]) button:hover:not(:disabled) {
|
|
2355
|
-
background: var(--btn-subtle-bg);
|
|
2356
|
-
color: var(--btn-accent-hover);
|
|
2357
|
-
}
|
|
2358
|
-
|
|
2359
|
-
:host([variant="text"]) button:active:not(:disabled) {
|
|
2360
|
-
background: var(--btn-subtle-bg-hover);
|
|
2361
|
-
}
|
|
2362
|
-
|
|
2363
|
-
/* Icon-only: single ae-icon child → square compact layout */
|
|
2364
|
-
:host([icon-only]) {
|
|
2365
|
-
display: inline-flex;
|
|
2366
|
-
}
|
|
2367
|
-
|
|
2368
|
-
:host([icon-only]:not([size])) {
|
|
2369
|
-
font-size: var(--size-m);
|
|
2370
|
-
}
|
|
2371
|
-
|
|
2372
|
-
:host([icon-only]) button {
|
|
2373
|
-
padding: 0;
|
|
2374
|
-
min-width: auto;
|
|
2375
|
-
width: 2.286em;
|
|
2376
|
-
height: 2.286em;
|
|
2377
|
-
line-height: 1;
|
|
2378
|
-
}
|
|
2379
|
-
|
|
2380
|
-
:host([icon-only]) ::slotted(ae-icon) {
|
|
2381
|
-
font-size: 1.5em;
|
|
2382
|
-
}
|
|
2383
|
-
|
|
2384
|
-
:host([active]) button {
|
|
2385
|
-
background: var(--btn-solid-bg-active);
|
|
2386
|
-
border-color: var(--btn-border-hover);
|
|
2387
|
-
color: var(--btn-solid-color-hover, var(--btn-solid-color));
|
|
2388
|
-
}
|
|
2389
|
-
|
|
2390
|
-
.btn-icon {
|
|
2391
|
-
padding: 0;
|
|
2392
|
-
min-width: auto;
|
|
2393
|
-
width: 2.286em;
|
|
2394
|
-
height: 2.286em;
|
|
2395
|
-
display: inline-flex;
|
|
2396
|
-
align-items: center;
|
|
2397
|
-
justify-content: center;
|
|
2398
|
-
border-radius: 4px;
|
|
2399
|
-
}
|
|
2400
|
-
|
|
2401
|
-
.btn-icon.btn-lg {
|
|
2402
|
-
width: 2.857em;
|
|
2403
|
-
height: 2.857em;
|
|
2404
|
-
}
|
|
2405
|
-
|
|
2406
|
-
.btn-circle {
|
|
2407
|
-
border-radius: 50%;
|
|
2408
|
-
}
|
|
2409
|
-
|
|
2410
|
-
:host([block]) {
|
|
2411
|
-
display: block;
|
|
2412
|
-
}
|
|
2413
|
-
|
|
2414
|
-
button.btn-loading {
|
|
2415
|
-
position: relative;
|
|
2416
|
-
pointer-events: none;
|
|
2417
|
-
color: transparent;
|
|
2418
|
-
}
|
|
2419
|
-
|
|
2420
|
-
button.btn-loading::before {
|
|
2421
|
-
content: '';
|
|
2422
|
-
position: absolute;
|
|
2423
|
-
width: 1em;
|
|
2424
|
-
height: 1em;
|
|
2425
|
-
border: 2px solid currentColor;
|
|
2426
|
-
border-top-color: transparent;
|
|
2427
|
-
border-radius: 50%;
|
|
2428
|
-
animation: btn-spin 0.6s linear infinite;
|
|
2429
|
-
color: currentColor;
|
|
2430
|
-
opacity: 0.8;
|
|
2431
|
-
}
|
|
2432
|
-
|
|
2433
|
-
@keyframes btn-spin {
|
|
2434
|
-
to {
|
|
2435
|
-
transform: rotate(360deg);
|
|
2436
|
-
}
|
|
2437
|
-
}
|
|
2438
|
-
|
|
2439
|
-
.btn-icon-left {
|
|
2440
|
-
margin-right: -2px;
|
|
2441
|
-
}
|
|
2442
|
-
|
|
2443
|
-
.btn-icon-right {
|
|
2444
|
-
margin-left: -2px;
|
|
2445
|
-
}
|
|
2446
|
-
|
|
2447
|
-
`;
|
|
2448
|
-
var __create$8 = Object.create;
|
|
2449
|
-
var __defProp$8 = Object.defineProperty;
|
|
2450
|
-
var __knownSymbol$8 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
2451
|
-
var __typeError$8 = (msg) => {
|
|
2452
|
-
throw TypeError(msg);
|
|
2453
|
-
};
|
|
2454
|
-
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2455
|
-
var __decoratorStart$8 = (base) => [, , , __create$8((base == null ? void 0 : base[__knownSymbol$8("metadata")]) ?? null)];
|
|
2456
|
-
var __decoratorStrings$8 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
2457
|
-
var __expectFn$8 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$8("Function expected") : fn;
|
|
2458
|
-
var __decoratorContext$8 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$8[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$8("Already initialized") : fns.push(__expectFn$8(fn || null)) });
|
|
2459
|
-
var __decoratorMetadata$8 = (array, target) => __defNormalProp$8(target, __knownSymbol$8("metadata"), array[3]);
|
|
2460
|
-
var __runInitializers$8 = (array, flags, self, value) => {
|
|
2461
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
2462
|
-
return value;
|
|
2463
|
-
};
|
|
2464
|
-
var __decorateElement$8 = (array, flags, name, decorators, target, extra) => {
|
|
2465
|
-
var it, done, ctx, access, k = flags & 7, s = false, p = false;
|
|
2466
|
-
var j = array.length + 1;
|
|
2467
|
-
var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
|
|
2468
|
-
target = target.prototype, k < 5;
|
|
2469
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
2470
|
-
ctx = __decoratorContext$8(k, name, done = {}, array[3], extraInitializers);
|
|
2471
|
-
{
|
|
2472
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
|
|
2473
|
-
access.get = (x) => x[name];
|
|
2474
|
-
access.set = (x, y) => x[name] = y;
|
|
2475
|
-
}
|
|
2476
|
-
it = (0, decorators[i])(void 0, ctx), done._ = 1;
|
|
2477
|
-
__expectFn$8(it) && initializers.unshift(it);
|
|
2478
|
-
}
|
|
2479
|
-
return target;
|
|
2480
|
-
};
|
|
2481
|
-
var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2482
|
-
var _block_dec, _active_dec$1, _type_dec$1, _disabled_dec$4, _size_dec$2, _variant_dec$4, _color_dec$6, _a$8, _init$8;
|
|
2483
|
-
class Button extends (_a$8 = AeicoComponent, _color_dec$6 = [prop({ type: String })], _variant_dec$4 = [prop({ type: String })], _size_dec$2 = [prop({ type: String })], _disabled_dec$4 = [prop({ type: Boolean })], _type_dec$1 = [prop({ type: String })], _active_dec$1 = [prop({ type: Boolean })], _block_dec = [prop({ type: Boolean })], _a$8) {
|
|
2484
|
-
constructor() {
|
|
2485
|
-
super(...arguments);
|
|
2486
|
-
__publicField$8(this, "color", __runInitializers$8(_init$8, 8, this)), __runInitializers$8(_init$8, 11, this);
|
|
2487
|
-
__publicField$8(this, "variant", __runInitializers$8(_init$8, 12, this)), __runInitializers$8(_init$8, 15, this);
|
|
2488
|
-
__publicField$8(this, "size", __runInitializers$8(_init$8, 16, this)), __runInitializers$8(_init$8, 19, this);
|
|
2489
|
-
__publicField$8(this, "disabled", __runInitializers$8(_init$8, 20, this)), __runInitializers$8(_init$8, 23, this);
|
|
2490
|
-
__publicField$8(this, "type", __runInitializers$8(_init$8, 24, this)), __runInitializers$8(_init$8, 27, this);
|
|
2491
|
-
__publicField$8(this, "active", __runInitializers$8(_init$8, 28, this)), __runInitializers$8(_init$8, 31, this);
|
|
2492
|
-
__publicField$8(this, "block", __runInitializers$8(_init$8, 32, this)), __runInitializers$8(_init$8, 35, this);
|
|
2493
|
-
__publicField$8(this, "buttonElement", null);
|
|
2494
|
-
__publicField$8(this, "_autoAriaLabel", false);
|
|
2495
|
-
__publicField$8(this, "_handleSlotChange", () => {
|
|
2496
|
-
var _a2;
|
|
2497
|
-
const slot = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("slot:not([name])");
|
|
2498
|
-
const nodes = (slot == null ? void 0 : slot.assignedNodes()) ?? [];
|
|
2499
|
-
const elements = nodes.filter((n) => n.nodeType === Node.ELEMENT_NODE);
|
|
2500
|
-
const hasText = nodes.some(
|
|
2501
|
-
(n) => n.nodeType === Node.TEXT_NODE && n.textContent.trim() !== ""
|
|
2502
|
-
);
|
|
2503
|
-
const isIconOnly = !hasText && elements.length === 1 && elements[0].tagName.toLowerCase() === "ae-icon";
|
|
2504
|
-
if (isIconOnly) {
|
|
2505
|
-
this.setAttribute("icon-only", "");
|
|
2506
|
-
if (!this.hasAttribute("aria-label") || this._autoAriaLabel) {
|
|
2507
|
-
this.setAttribute("aria-label", elements[0].getAttribute("name") ?? "");
|
|
2508
|
-
this._autoAriaLabel = true;
|
|
2509
|
-
}
|
|
2510
|
-
} else {
|
|
2511
|
-
this.removeAttribute("icon-only");
|
|
2512
|
-
if (this._autoAriaLabel) {
|
|
2513
|
-
this.removeAttribute("aria-label");
|
|
2514
|
-
this._autoAriaLabel = false;
|
|
2515
|
-
}
|
|
2516
|
-
}
|
|
2517
|
-
});
|
|
2518
|
-
}
|
|
2519
|
-
onMounted() {
|
|
2520
|
-
var _a2;
|
|
2521
|
-
const slot = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("slot:not([name])");
|
|
2522
|
-
if (slot) this.listen(slot, "slotchange", this._handleSlotChange);
|
|
2523
|
-
this._handleSlotChange();
|
|
2524
|
-
}
|
|
2525
|
-
render() {
|
|
2526
|
-
return html(({ button, slot }) => {
|
|
2527
|
-
this.buttonElement = button(
|
|
2528
|
-
{
|
|
2529
|
-
type: this.type || "button",
|
|
2530
|
-
disabled: this.disabled,
|
|
2531
|
-
part: "button",
|
|
2532
|
-
"aria-pressed": this.active,
|
|
2533
|
-
"aria-disabled": this.disabled
|
|
2534
|
-
},
|
|
2535
|
-
() => {
|
|
2536
|
-
slot();
|
|
2537
|
-
}
|
|
2538
|
-
);
|
|
2539
|
-
});
|
|
2540
|
-
}
|
|
2541
|
-
/**
|
|
2542
|
-
* Programmatically click the button
|
|
2543
|
-
*/
|
|
2544
|
-
click() {
|
|
2545
|
-
if (!this.disabled && this.buttonElement) {
|
|
2546
|
-
this.buttonElement.click();
|
|
2547
|
-
}
|
|
2548
|
-
}
|
|
2549
|
-
/**
|
|
2550
|
-
* Focus the button
|
|
2551
|
-
*/
|
|
2552
|
-
focus() {
|
|
2553
|
-
if (this.buttonElement) {
|
|
2554
|
-
this.buttonElement.focus();
|
|
2555
|
-
}
|
|
2556
|
-
}
|
|
2557
|
-
/**
|
|
2558
|
-
* Blur the button
|
|
2559
|
-
*/
|
|
2560
|
-
blur() {
|
|
2561
|
-
if (this.buttonElement) {
|
|
2562
|
-
this.buttonElement.blur();
|
|
2563
|
-
}
|
|
2564
|
-
}
|
|
2565
|
-
}
|
|
2566
|
-
_init$8 = __decoratorStart$8(_a$8);
|
|
2567
|
-
__decorateElement$8(_init$8, 5, "color", _color_dec$6, Button);
|
|
2568
|
-
__decorateElement$8(_init$8, 5, "variant", _variant_dec$4, Button);
|
|
2569
|
-
__decorateElement$8(_init$8, 5, "size", _size_dec$2, Button);
|
|
2570
|
-
__decorateElement$8(_init$8, 5, "disabled", _disabled_dec$4, Button);
|
|
2571
|
-
__decorateElement$8(_init$8, 5, "type", _type_dec$1, Button);
|
|
2572
|
-
__decorateElement$8(_init$8, 5, "active", _active_dec$1, Button);
|
|
2573
|
-
__decorateElement$8(_init$8, 5, "block", _block_dec, Button);
|
|
2574
|
-
__decoratorMetadata$8(_init$8, Button);
|
|
2575
|
-
__publicField$8(Button, "styles", [styleVariables, sizeCSS, colorCSS, buttonStyle]);
|
|
2576
|
-
Button.register();
|
|
2577
|
-
const style$4 = ":host {\n display: inline-block;\n position: relative;\n\n --dropdown-z-index: 1000;\n --dropdown-bg: var(--surface-overlay, #fff);\n --dropdown-border: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));\n --dropdown-border-radius: var(--ae-radius-md, 6px);\n --dropdown-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n --dropdown-min-width: 10rem;\n --dropdown-padding: 0.25rem 0;\n}\n\n.trigger-wrapper {\n display: flex;\n align-items: stretch;\n height: 100%;\n}\n\n/* Internal trigger rendered when `label` prop is set.\n Uses --dropdown-trigger-* variables. Context components (e.g. ae-navbar)\n map their own tokens to these variables via ::slotted(ae-dropdown). */\n.trigger-label {\n display: inline-flex;\n align-items: center;\n height: var(--dropdown-trigger-height, auto);\n padding: 0 var(--dropdown-trigger-padding-x, 0.75rem);\n color: var(--dropdown-trigger-color, inherit);\n background: var(--dropdown-trigger-bg, none);\n border: none;\n border-radius: var(--dropdown-trigger-radius, 0);\n -webkit-appearance: none;\n appearance: none;\n cursor: pointer;\n font: inherit;\n font-size: var(--dropdown-trigger-font-size, inherit);\n white-space: nowrap;\n transition: color 0.15s ease, background-color 0.15s ease;\n outline-offset: 2px;\n}\n\n.trigger-label:hover {\n color: var(--dropdown-trigger-hover-color, inherit);\n background-color: var(--dropdown-trigger-hover-bg, transparent);\n}\n\n:host([disabled]) .trigger-label {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n/* Bootstrap-style CSS border caret — shadow DOM only, no global injection needed */\n.ae-dropdown-arrow {\n display: inline-block;\n width: 0;\n height: 0;\n margin-left: 0.3em;\n vertical-align: 0.2em;\n flex-shrink: 0;\n}\n.ae-dropdown-arrow--bottom {\n border-top: 0.35em solid;\n border-right: 0.35em solid transparent;\n border-left: 0.35em solid transparent;\n}\n.ae-dropdown-arrow--top {\n border-bottom: 0.35em solid;\n border-right: 0.35em solid transparent;\n border-left: 0.35em solid transparent;\n}\n.ae-dropdown-arrow--right {\n border-left: 0.35em solid;\n border-top: 0.35em solid transparent;\n border-bottom: 0.35em solid transparent;\n}\n.ae-dropdown-arrow--left {\n border-right: 0.35em solid;\n border-top: 0.35em solid transparent;\n border-bottom: 0.35em solid transparent;\n}\n\n.panel {\n display: none;\n position: absolute;\n z-index: var(--dropdown-z-index);\n background: var(--dropdown-bg);\n border: var(--dropdown-border);\n border-radius: var(--dropdown-border-radius);\n box-shadow: var(--dropdown-shadow);\n min-width: var(--dropdown-min-width);\n padding: var(--dropdown-padding);\n box-sizing: border-box;\n /* Prevent panel from being wider than viewport */\n max-width: calc(100vw - 16px);\n}\n\n.panel.open {\n display: block;\n}\n\n/* placement variants */\n.panel.placement-bottom-start {\n top: 100%;\n left: 0;\n margin-top: 4px;\n}\n\n.panel.placement-bottom-end {\n top: 100%;\n right: 0;\n margin-top: 4px;\n}\n\n.panel.placement-bottom {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: 4px;\n}\n\n.panel.placement-top-start {\n bottom: 100%;\n left: 0;\n margin-bottom: 4px;\n}\n\n.panel.placement-top-end {\n bottom: 100%;\n right: 0;\n margin-bottom: 4px;\n}\n\n.panel.placement-top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: 4px;\n}\n\n/* right placements */\n.panel.placement-right-start {\n top: 0;\n left: 100%;\n margin-left: 4px;\n}\n\n.panel.placement-right-end {\n bottom: 0;\n left: 100%;\n margin-left: 4px;\n}\n\n.panel.placement-right {\n top: 50%;\n left: 100%;\n transform: translateY(-50%);\n margin-left: 4px;\n}\n\n/* left placements */\n.panel.placement-left-start {\n top: 0;\n right: 100%;\n margin-right: 4px;\n}\n\n.panel.placement-left-end {\n bottom: 0;\n right: 100%;\n margin-right: 4px;\n}\n\n.panel.placement-left {\n top: 50%;\n right: 100%;\n transform: translateY(-50%);\n margin-right: 4px;\n}\n";
|
|
2578
|
-
const style$3 = `:host {
|
|
2579
|
-
display: block;
|
|
2580
|
-
|
|
2581
|
-
--dropdown-item-padding: 0.5rem 0.875rem;
|
|
2582
|
-
--dropdown-item-bg: transparent;
|
|
2583
|
-
--dropdown-item-bg-hover: var(--surface-raised, rgba(0, 0, 0, 0.05));
|
|
2584
|
-
--dropdown-item-bg-active: var(--surface-raised-active, rgba(0, 0, 0, 0.1));
|
|
2585
|
-
--dropdown-item-color: var(--color-text-main, inherit);
|
|
2586
|
-
--dropdown-item-color-disabled: var(--color-text-disabled, rgba(0, 0, 0, 0.35));
|
|
2587
|
-
--dropdown-item-font-size: 0.9375rem;
|
|
2588
|
-
--dropdown-item-gap: 0.5rem;
|
|
2589
|
-
--dropdown-item-transition: background 0.1s;
|
|
2590
|
-
--dropdown-item-border-radius: var(--ae-radius-sm, 4px);
|
|
2591
|
-
}
|
|
2592
|
-
|
|
2593
|
-
.item {
|
|
2594
|
-
display: flex;
|
|
2595
|
-
align-items: center;
|
|
2596
|
-
gap: var(--dropdown-item-gap);
|
|
2597
|
-
width: 100%;
|
|
2598
|
-
padding: var(--dropdown-item-padding);
|
|
2599
|
-
font-size: var(--dropdown-item-font-size);
|
|
2600
|
-
font-family: inherit;
|
|
2601
|
-
color: var(--dropdown-item-color);
|
|
2602
|
-
background: var(--dropdown-item-bg);
|
|
2603
|
-
border: none;
|
|
2604
|
-
border-radius: var(--dropdown-item-border-radius);
|
|
2605
|
-
text-align: left;
|
|
2606
|
-
text-decoration: none;
|
|
2607
|
-
cursor: pointer;
|
|
2608
|
-
user-select: none;
|
|
2609
|
-
white-space: nowrap;
|
|
2610
|
-
box-sizing: border-box;
|
|
2611
|
-
transition: var(--dropdown-item-transition);
|
|
2612
|
-
outline: none;
|
|
2613
|
-
}
|
|
2614
|
-
|
|
2615
|
-
.item:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
2616
|
-
background: var(--dropdown-item-bg-hover);
|
|
2617
|
-
}
|
|
2618
|
-
|
|
2619
|
-
.item:active:not(:disabled):not([aria-disabled="true"]) {
|
|
2620
|
-
background: var(--dropdown-item-bg-active);
|
|
2621
|
-
}
|
|
2622
|
-
|
|
2623
|
-
.item:focus-visible {
|
|
2624
|
-
background: var(--dropdown-item-bg-hover);
|
|
2625
|
-
outline: 2px solid var(--color-primary, #0e639c);
|
|
2626
|
-
outline-offset: -2px;
|
|
2627
|
-
}
|
|
2628
|
-
|
|
2629
|
-
/* disabled */
|
|
2630
|
-
:host([disabled]) .item,
|
|
2631
|
-
.item:disabled {
|
|
2632
|
-
color: var(--dropdown-item-color-disabled);
|
|
2633
|
-
cursor: default;
|
|
2634
|
-
pointer-events: none;
|
|
2635
|
-
}
|
|
2636
|
-
|
|
2637
|
-
/* Active item — current selection, current route, etc. */
|
|
2638
|
-
:host([active]) .item {
|
|
2639
|
-
background: var(--dropdown-item-bg-selected, rgba(0, 0, 0, 0.06));
|
|
2640
|
-
color: var(--dropdown-item-color-active, var(--color-primary, #0e639c));
|
|
2641
|
-
font-weight: 500;
|
|
2642
|
-
}
|
|
2643
|
-
|
|
2644
|
-
/* Checkbox mode — fixed-width indicator column */
|
|
2645
|
-
.check-indicator {
|
|
2646
|
-
display: inline-flex;
|
|
2647
|
-
align-items: center;
|
|
2648
|
-
justify-content: center;
|
|
2649
|
-
width: 1em;
|
|
2650
|
-
flex-shrink: 0;
|
|
2651
|
-
}
|
|
2652
|
-
|
|
2653
|
-
/* CSS-drawn checkmark (border trick) */
|
|
2654
|
-
.check-indicator::after {
|
|
2655
|
-
content: '';
|
|
2656
|
-
display: block;
|
|
2657
|
-
width: 0.3em;
|
|
2658
|
-
height: 0.55em;
|
|
2659
|
-
border-right: 0.125em solid currentColor;
|
|
2660
|
-
border-bottom: 0.125em solid currentColor;
|
|
2661
|
-
transform: rotate(45deg) translateY(-0.1em);
|
|
2662
|
-
opacity: 0;
|
|
2663
|
-
transition: opacity 0.1s;
|
|
2664
|
-
}
|
|
2665
|
-
|
|
2666
|
-
:host([checked]) .check-indicator::after {
|
|
2667
|
-
opacity: 1;
|
|
2668
|
-
}
|
|
2669
|
-
`;
|
|
2670
|
-
const style$2 = ":host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n width: 1em;\n height: 1em;\n color: inherit;\n flex-shrink: 0;\n line-height: 0;\n vertical-align: middle;\n}\n\n:host([color]) {\n color: var(--color-solid);\n}\n\n.icon-svg {\n display: block;\n width: 100%;\n height: 100%;\n fill: var(--icon-fill, currentColor);\n stroke: var(--icon-stroke, none);\n stroke-width: var(--icon-stroke-width, 2);\n stroke-linecap: var(--icon-stroke-linecap, round);\n stroke-linejoin: var(--icon-stroke-linejoin, round);\n pointer-events: none;\n overflow: visible;\n}\n";
|
|
2671
|
-
const defaultViewBox = "0 0 24 24";
|
|
2672
|
-
class IconRegistry {
|
|
2673
|
-
static add(icons) {
|
|
2674
|
-
for (const [name, data] of Object.entries(icons)) {
|
|
2675
|
-
if (typeof data === "string") {
|
|
2676
|
-
this._icons.set(name, { path: data, viewBox: defaultViewBox });
|
|
2677
|
-
} else {
|
|
2678
|
-
this._icons.set(name, data);
|
|
2679
|
-
}
|
|
2680
|
-
}
|
|
2681
|
-
}
|
|
2682
|
-
static get(name) {
|
|
2683
|
-
return this._icons.get(name);
|
|
2684
|
-
}
|
|
2685
|
-
static has(name) {
|
|
2686
|
-
return this._icons.has(name);
|
|
2687
|
-
}
|
|
2688
|
-
}
|
|
2689
|
-
__publicField(IconRegistry, "_icons", /* @__PURE__ */ new Map());
|
|
2690
|
-
class Icon extends AeicoComponent {
|
|
2691
|
-
render() {
|
|
2692
|
-
const def = this.name ? IconRegistry.get(this.name) : void 0;
|
|
2693
|
-
const numericSize = Number(this.size);
|
|
2694
|
-
if (this.size !== void 0 && !isNaN(numericSize) && numericSize > 0) {
|
|
2695
|
-
this.style.setProperty("font-size", `${numericSize}px`);
|
|
2696
|
-
} else {
|
|
2697
|
-
this.style.removeProperty("font-size");
|
|
2698
|
-
}
|
|
2699
|
-
const useStroke = this.stroke ?? (def == null ? void 0 : def.stroke) ?? false;
|
|
2700
|
-
const useStrokeWidth = this.strokeWidth ?? (def == null ? void 0 : def.strokeWidth) ?? 2;
|
|
2701
|
-
if (useStroke) {
|
|
2702
|
-
this.style.setProperty("--icon-fill", "none");
|
|
2703
|
-
this.style.setProperty("--icon-stroke", "currentColor");
|
|
2704
|
-
this.style.setProperty("--icon-stroke-width", String(useStrokeWidth));
|
|
2705
|
-
} else {
|
|
2706
|
-
this.style.removeProperty("--icon-fill");
|
|
2707
|
-
this.style.removeProperty("--icon-stroke");
|
|
2708
|
-
this.style.removeProperty("--icon-stroke-width");
|
|
2709
|
-
}
|
|
2710
|
-
if (!def) return;
|
|
2711
|
-
return html(({ svg, path }) => {
|
|
2712
|
-
svg(
|
|
2713
|
-
{
|
|
2714
|
-
className: "icon-svg",
|
|
2715
|
-
viewBox: def.viewBox ?? defaultViewBox,
|
|
2716
|
-
"aria-hidden": "true",
|
|
2717
|
-
xmlns: SVG_NS
|
|
2718
|
-
},
|
|
2719
|
-
() => {
|
|
2720
|
-
path({ d: def.path });
|
|
2721
|
-
}
|
|
2722
|
-
);
|
|
2723
|
-
});
|
|
2724
|
-
}
|
|
2725
|
-
}
|
|
2726
|
-
__publicField(Icon, "tagName", "icon");
|
|
2727
|
-
__publicField(Icon, "props", {
|
|
2728
|
-
name: { type: String },
|
|
2729
|
-
size: { type: String },
|
|
2730
|
-
color: { type: String },
|
|
2731
|
-
stroke: { type: Boolean },
|
|
2732
|
-
strokeWidth: { type: Number }
|
|
2733
|
-
});
|
|
2734
|
-
__publicField(Icon, "styles", [styleVariables, sizeCSS, colorCSS, style$2]);
|
|
2735
|
-
Icon.register();
|
|
2736
|
-
var __create$7 = Object.create;
|
|
2737
|
-
var __defProp$7 = Object.defineProperty;
|
|
2738
|
-
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
2739
|
-
var __knownSymbol$7 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
2740
|
-
var __typeError$7 = (msg) => {
|
|
2741
|
-
throw TypeError(msg);
|
|
2742
|
-
};
|
|
2743
|
-
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2744
|
-
var __decoratorStart$7 = (base) => [, , , __create$7((base == null ? void 0 : base[__knownSymbol$7("metadata")]) ?? null)];
|
|
2745
|
-
var __decoratorStrings$7 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
2746
|
-
var __expectFn$7 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$7("Function expected") : fn;
|
|
2747
|
-
var __decoratorContext$7 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$7[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$7("Already initialized") : fns.push(__expectFn$7(fn || null)) });
|
|
2748
|
-
var __decoratorMetadata$7 = (array, target) => __defNormalProp$7(target, __knownSymbol$7("metadata"), array[3]);
|
|
2749
|
-
var __runInitializers$7 = (array, flags, self, value) => {
|
|
2750
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
2751
|
-
return value;
|
|
2752
|
-
};
|
|
2753
|
-
var __decorateElement$7 = (array, flags, name, decorators, target, extra) => {
|
|
2754
|
-
var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
|
|
2755
|
-
var j = array.length + 1, key = __decoratorStrings$7[k + 5];
|
|
2756
|
-
var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
|
|
2757
|
-
var desc = (target = target.prototype, __getOwnPropDesc$7({ get [name]() {
|
|
2758
|
-
return __privateGet$7(this, extra);
|
|
2759
|
-
}, set [name](x) {
|
|
2760
|
-
return __privateSet$7(this, extra, x);
|
|
2761
|
-
} }, name));
|
|
2762
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
2763
|
-
ctx = __decoratorContext$7(k, name, done = {}, array[3], extraInitializers);
|
|
2764
|
-
{
|
|
2765
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
|
|
2766
|
-
access.get = (x) => x[name];
|
|
2767
|
-
access.set = (x, y) => x[name] = y;
|
|
2768
|
-
}
|
|
2769
|
-
it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
|
|
2770
|
-
if (it === void 0) __expectFn$7(it) && (desc[key] = it);
|
|
2771
|
-
else if (typeof it !== "object" || it === null) __typeError$7("Object expected");
|
|
2772
|
-
else __expectFn$7(fn = it.get) && (desc.get = fn), __expectFn$7(fn = it.set) && (desc.set = fn), __expectFn$7(fn = it.init) && initializers.unshift(fn);
|
|
2773
|
-
}
|
|
2774
|
-
return desc && __defProp$7(target, name, desc), target;
|
|
2775
|
-
};
|
|
2776
|
-
var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2777
|
-
var __accessCheck$7 = (obj, member, msg) => member.has(obj) || __typeError$7("Cannot " + msg);
|
|
2778
|
-
var __privateGet$7 = (obj, member, getter) => (__accessCheck$7(obj, member, "read from private field"), member.get(obj));
|
|
2779
|
-
var __privateAdd$7 = (obj, member, value) => member.has(obj) ? __typeError$7("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2780
|
-
var __privateSet$7 = (obj, member, value, setter) => (__accessCheck$7(obj, member, "write to private field"), member.set(obj, value), value);
|
|
2781
|
-
var _active_dec, _checked_dec, _type_dec, _href_dec, _disabled_dec$3, _value_dec, _a$7, _init$7, _value, _disabled$3, _href, _type, _checked, _active;
|
|
2782
|
-
class DropdownItem extends (_a$7 = AeicoComponent, _value_dec = [prop({ type: String })], _disabled_dec$3 = [prop({ type: Boolean })], _href_dec = [prop({ type: String })], _type_dec = [prop({ type: String })], _checked_dec = [prop({ type: Boolean })], _active_dec = [prop({ type: Boolean })], _a$7) {
|
|
2783
|
-
constructor() {
|
|
2784
|
-
super(...arguments);
|
|
2785
|
-
__privateAdd$7(this, _value, __runInitializers$7(_init$7, 8, this)), __runInitializers$7(_init$7, 11, this);
|
|
2786
|
-
__privateAdd$7(this, _disabled$3, __runInitializers$7(_init$7, 12, this, false)), __runInitializers$7(_init$7, 15, this);
|
|
2787
|
-
__privateAdd$7(this, _href, __runInitializers$7(_init$7, 16, this)), __runInitializers$7(_init$7, 19, this);
|
|
2788
|
-
__privateAdd$7(this, _type, __runInitializers$7(_init$7, 20, this)), __runInitializers$7(_init$7, 23, this);
|
|
2789
|
-
__privateAdd$7(this, _checked, __runInitializers$7(_init$7, 24, this, false)), __runInitializers$7(_init$7, 27, this);
|
|
2790
|
-
__privateAdd$7(this, _active, __runInitializers$7(_init$7, 28, this, false)), __runInitializers$7(_init$7, 31, this);
|
|
2791
|
-
__publicField$7(this, "_handleClick", (e) => {
|
|
2792
|
-
var _a2;
|
|
2793
|
-
if (this.disabled) {
|
|
2794
|
-
e.preventDefault();
|
|
2795
|
-
e.stopPropagation();
|
|
2796
|
-
return;
|
|
2797
|
-
}
|
|
2798
|
-
if (this.type === "checkbox") {
|
|
2799
|
-
this.checked = !this.checked;
|
|
2800
|
-
}
|
|
2801
|
-
const label = ((_a2 = this.textContent) == null ? void 0 : _a2.trim()) ?? "";
|
|
2802
|
-
this.dispatchEvent(
|
|
2803
|
-
new CustomEvent("_item-select", {
|
|
2804
|
-
bubbles: true,
|
|
2805
|
-
composed: true,
|
|
2806
|
-
detail: { value: this.value ?? "", label, checked: this.checked }
|
|
2807
|
-
})
|
|
2808
|
-
);
|
|
2809
|
-
});
|
|
2810
|
-
}
|
|
2811
|
-
connectedCallback() {
|
|
2812
|
-
super.connectedCallback();
|
|
2813
|
-
this.listen("click", this._handleClick);
|
|
2814
|
-
this.setAttribute("role", "menuitem");
|
|
2815
|
-
}
|
|
2816
|
-
render() {
|
|
2817
|
-
const isCheckbox = this.type === "checkbox";
|
|
2818
|
-
const sharedProps = {
|
|
2819
|
-
part: "item",
|
|
2820
|
-
className: "item",
|
|
2821
|
-
"aria-checked": isCheckbox ? String(this.checked) : void 0
|
|
2822
|
-
};
|
|
2823
|
-
return html(({ button, a, span, slot }) => {
|
|
2824
|
-
const children = () => {
|
|
2825
|
-
if (isCheckbox) span({ className: "check-indicator", "aria-hidden": "true" });
|
|
2826
|
-
slot();
|
|
2827
|
-
};
|
|
2828
|
-
if (this.href) {
|
|
2829
|
-
a(
|
|
2830
|
-
{
|
|
2831
|
-
...sharedProps,
|
|
2832
|
-
href: this.disabled ? void 0 : this.href,
|
|
2833
|
-
"aria-disabled": this.disabled || void 0
|
|
2834
|
-
},
|
|
2835
|
-
children
|
|
2836
|
-
);
|
|
2837
|
-
} else {
|
|
2838
|
-
button(
|
|
2839
|
-
{
|
|
2840
|
-
...sharedProps,
|
|
2841
|
-
type: "button",
|
|
2842
|
-
disabled: this.disabled
|
|
2843
|
-
},
|
|
2844
|
-
children
|
|
2845
|
-
);
|
|
2846
|
-
}
|
|
2847
|
-
});
|
|
2848
|
-
}
|
|
2849
|
-
}
|
|
2850
|
-
_init$7 = __decoratorStart$7(_a$7);
|
|
2851
|
-
_value = /* @__PURE__ */ new WeakMap();
|
|
2852
|
-
_disabled$3 = /* @__PURE__ */ new WeakMap();
|
|
2853
|
-
_href = /* @__PURE__ */ new WeakMap();
|
|
2854
|
-
_type = /* @__PURE__ */ new WeakMap();
|
|
2855
|
-
_checked = /* @__PURE__ */ new WeakMap();
|
|
2856
|
-
_active = /* @__PURE__ */ new WeakMap();
|
|
2857
|
-
__decorateElement$7(_init$7, 4, "value", _value_dec, DropdownItem, _value);
|
|
2858
|
-
__decorateElement$7(_init$7, 4, "disabled", _disabled_dec$3, DropdownItem, _disabled$3);
|
|
2859
|
-
__decorateElement$7(_init$7, 4, "href", _href_dec, DropdownItem, _href);
|
|
2860
|
-
__decorateElement$7(_init$7, 4, "type", _type_dec, DropdownItem, _type);
|
|
2861
|
-
__decorateElement$7(_init$7, 4, "checked", _checked_dec, DropdownItem, _checked);
|
|
2862
|
-
__decorateElement$7(_init$7, 4, "active", _active_dec, DropdownItem, _active);
|
|
2863
|
-
__decoratorMetadata$7(_init$7, DropdownItem);
|
|
2864
|
-
__publicField$7(DropdownItem, "tagName", "dropdown-item");
|
|
2865
|
-
__publicField$7(DropdownItem, "styles", [styleVariables, style$3]);
|
|
2866
|
-
DropdownItem.register();
|
|
2867
|
-
var __create$6 = Object.create;
|
|
2868
|
-
var __defProp$6 = Object.defineProperty;
|
|
2869
|
-
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
2870
|
-
var __knownSymbol$6 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
2871
|
-
var __typeError$6 = (msg) => {
|
|
2872
|
-
throw TypeError(msg);
|
|
2873
|
-
};
|
|
2874
|
-
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2875
|
-
var __decoratorStart$6 = (base) => [, , , __create$6((base == null ? void 0 : base[__knownSymbol$6("metadata")]) ?? null)];
|
|
2876
|
-
var __decoratorStrings$6 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
2877
|
-
var __expectFn$6 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$6("Function expected") : fn;
|
|
2878
|
-
var __decoratorContext$6 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$6[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$6("Already initialized") : fns.push(__expectFn$6(fn || null)) });
|
|
2879
|
-
var __decoratorMetadata$6 = (array, target) => __defNormalProp$6(target, __knownSymbol$6("metadata"), array[3]);
|
|
2880
|
-
var __runInitializers$6 = (array, flags, self, value) => {
|
|
2881
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
2882
|
-
return value;
|
|
2883
|
-
};
|
|
2884
|
-
var __decorateElement$6 = (array, flags, name, decorators, target, extra) => {
|
|
2885
|
-
var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
|
|
2886
|
-
var j = array.length + 1, key = __decoratorStrings$6[k + 5];
|
|
2887
|
-
var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
|
|
2888
|
-
var desc = (target = target.prototype, __getOwnPropDesc$6({ get [name]() {
|
|
2889
|
-
return __privateGet$6(this, extra);
|
|
2890
|
-
}, set [name](x) {
|
|
2891
|
-
return __privateSet$6(this, extra, x);
|
|
2892
|
-
} }, name));
|
|
2893
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
2894
|
-
ctx = __decoratorContext$6(k, name, done = {}, array[3], extraInitializers);
|
|
2895
|
-
{
|
|
2896
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
|
|
2897
|
-
access.get = (x) => x[name];
|
|
2898
|
-
access.set = (x, y) => x[name] = y;
|
|
2899
|
-
}
|
|
2900
|
-
it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
|
|
2901
|
-
if (it === void 0) __expectFn$6(it) && (desc[key] = it);
|
|
2902
|
-
else if (typeof it !== "object" || it === null) __typeError$6("Object expected");
|
|
2903
|
-
else __expectFn$6(fn = it.get) && (desc.get = fn), __expectFn$6(fn = it.set) && (desc.set = fn), __expectFn$6(fn = it.init) && initializers.unshift(fn);
|
|
2904
|
-
}
|
|
2905
|
-
return desc && __defProp$6(target, name, desc), target;
|
|
2906
|
-
};
|
|
2907
|
-
var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2908
|
-
var __accessCheck$6 = (obj, member, msg) => member.has(obj) || __typeError$6("Cannot " + msg);
|
|
2909
|
-
var __privateGet$6 = (obj, member, getter) => (__accessCheck$6(obj, member, "read from private field"), member.get(obj));
|
|
2910
|
-
var __privateAdd$6 = (obj, member, value) => member.has(obj) ? __typeError$6("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2911
|
-
var __privateSet$6 = (obj, member, value, setter) => (__accessCheck$6(obj, member, "write to private field"), member.set(obj, value), value);
|
|
2912
|
-
var _label_dec, _disabled_dec$2, _closeOnSelect_dec$1, _open_dec$1, _placement_dec$1, _a$6, _init$6, _placement$1, _open$1, _closeOnSelect$1, _disabled$2, _label;
|
|
2913
|
-
class Dropdown extends (_a$6 = AeicoComponent, _placement_dec$1 = [prop({ type: String })], _open_dec$1 = [prop({ type: Boolean })], _closeOnSelect_dec$1 = [prop({ type: Boolean })], _disabled_dec$2 = [prop({ type: Boolean })], _label_dec = [prop({ type: String })], _a$6) {
|
|
2914
|
-
constructor() {
|
|
2915
|
-
super(...arguments);
|
|
2916
|
-
__privateAdd$6(this, _placement$1, __runInitializers$6(_init$6, 8, this, "bottom-start")), __runInitializers$6(_init$6, 11, this);
|
|
2917
|
-
__privateAdd$6(this, _open$1, __runInitializers$6(_init$6, 12, this, false)), __runInitializers$6(_init$6, 15, this);
|
|
2918
|
-
__privateAdd$6(this, _closeOnSelect$1, __runInitializers$6(_init$6, 16, this, true)), __runInitializers$6(_init$6, 19, this);
|
|
2919
|
-
__privateAdd$6(this, _disabled$2, __runInitializers$6(_init$6, 20, this, false)), __runInitializers$6(_init$6, 23, this);
|
|
2920
|
-
__privateAdd$6(this, _label, __runInitializers$6(_init$6, 24, this, "")), __runInitializers$6(_init$6, 27, this);
|
|
2921
|
-
__publicField$6(this, "_outsideClickHandler", null);
|
|
2922
|
-
__publicField$6(this, "_handleTriggerClick", () => {
|
|
2923
|
-
this.toggle();
|
|
2924
|
-
});
|
|
2925
|
-
__publicField$6(this, "_handleItemSelect", (e) => {
|
|
2926
|
-
this.emit("select", { detail: e.detail });
|
|
2927
|
-
if (this.closeOnSelect) {
|
|
2928
|
-
this._closePanel();
|
|
2929
|
-
}
|
|
2930
|
-
});
|
|
2931
|
-
__publicField$6(this, "_handleKeydown", (e) => {
|
|
2932
|
-
if (e.key === "Escape" && this.open) {
|
|
2933
|
-
e.stopPropagation();
|
|
2934
|
-
this._closePanel();
|
|
2935
|
-
}
|
|
2936
|
-
});
|
|
2937
|
-
}
|
|
2938
|
-
connectedCallback() {
|
|
2939
|
-
super.connectedCallback();
|
|
2940
|
-
this.listen("_item-select", this._handleItemSelect);
|
|
2941
|
-
this.listen("keydown", this._handleKeydown);
|
|
2942
|
-
this._outsideClickHandler = (e) => {
|
|
2943
|
-
if (!this.open) return;
|
|
2944
|
-
const path = e.composedPath();
|
|
2945
|
-
if (!path.includes(this)) {
|
|
2946
|
-
this._closePanel();
|
|
2947
|
-
}
|
|
2948
|
-
};
|
|
2949
|
-
document.addEventListener("click", this._outsideClickHandler);
|
|
2950
|
-
}
|
|
2951
|
-
disconnectedCallback() {
|
|
2952
|
-
super.disconnectedCallback();
|
|
2953
|
-
if (this._outsideClickHandler) {
|
|
2954
|
-
document.removeEventListener("click", this._outsideClickHandler);
|
|
2955
|
-
this._outsideClickHandler = null;
|
|
2956
|
-
}
|
|
2957
|
-
}
|
|
2958
|
-
/** Opens the dropdown panel. */
|
|
2959
|
-
show() {
|
|
2960
|
-
if (this.disabled || this.open) return;
|
|
2961
|
-
this.open = true;
|
|
2962
|
-
this.emit("open");
|
|
2963
|
-
}
|
|
2964
|
-
/** Closes the dropdown panel. */
|
|
2965
|
-
hide() {
|
|
2966
|
-
if (!this.open) return;
|
|
2967
|
-
this.open = false;
|
|
2968
|
-
this.emit("close");
|
|
2969
|
-
}
|
|
2970
|
-
/** Toggles the dropdown panel open/closed. */
|
|
2971
|
-
toggle() {
|
|
2972
|
-
if (this.open) {
|
|
2973
|
-
this.hide();
|
|
2974
|
-
} else {
|
|
2975
|
-
this.show();
|
|
2976
|
-
}
|
|
2977
|
-
}
|
|
2978
|
-
_closePanel() {
|
|
2979
|
-
if (this.open) this.hide();
|
|
2980
|
-
}
|
|
2981
|
-
render() {
|
|
2982
|
-
const placementClass = `placement-${this.placement}`;
|
|
2983
|
-
const hasLabel = !!this.label;
|
|
2984
|
-
const dir = this.placement.split("-")[0];
|
|
2985
|
-
return html(({ div, slot, button, span }) => {
|
|
2986
|
-
div(
|
|
2987
|
-
{
|
|
2988
|
-
className: "trigger-wrapper",
|
|
2989
|
-
"aria-haspopup": "menu",
|
|
2990
|
-
"aria-expanded": String(this.open),
|
|
2991
|
-
"@click": this.disabled ? void 0 : this._handleTriggerClick
|
|
2992
|
-
},
|
|
2993
|
-
() => {
|
|
2994
|
-
if (hasLabel) {
|
|
2995
|
-
button(
|
|
2996
|
-
{
|
|
2997
|
-
className: "trigger-label",
|
|
2998
|
-
type: "button",
|
|
2999
|
-
disabled: this.disabled || void 0
|
|
3000
|
-
},
|
|
3001
|
-
() => {
|
|
3002
|
-
span({ text: this.label });
|
|
3003
|
-
span({
|
|
3004
|
-
className: `ae-dropdown-arrow ae-dropdown-arrow--${dir}`,
|
|
3005
|
-
"aria-hidden": "true"
|
|
3006
|
-
});
|
|
3007
|
-
}
|
|
3008
|
-
);
|
|
3009
|
-
} else {
|
|
3010
|
-
slot({ name: "trigger" });
|
|
3011
|
-
}
|
|
3012
|
-
}
|
|
3013
|
-
);
|
|
3014
|
-
div(
|
|
3015
|
-
{
|
|
3016
|
-
part: "panel",
|
|
3017
|
-
className: { panel: true, open: this.open, [placementClass]: true },
|
|
3018
|
-
role: "menu"
|
|
3019
|
-
},
|
|
3020
|
-
() => {
|
|
3021
|
-
slot();
|
|
3022
|
-
}
|
|
3023
|
-
);
|
|
3024
|
-
});
|
|
3025
|
-
}
|
|
3026
|
-
}
|
|
3027
|
-
_init$6 = __decoratorStart$6(_a$6);
|
|
3028
|
-
_placement$1 = /* @__PURE__ */ new WeakMap();
|
|
3029
|
-
_open$1 = /* @__PURE__ */ new WeakMap();
|
|
3030
|
-
_closeOnSelect$1 = /* @__PURE__ */ new WeakMap();
|
|
3031
|
-
_disabled$2 = /* @__PURE__ */ new WeakMap();
|
|
3032
|
-
_label = /* @__PURE__ */ new WeakMap();
|
|
3033
|
-
__decorateElement$6(_init$6, 4, "placement", _placement_dec$1, Dropdown, _placement$1);
|
|
3034
|
-
__decorateElement$6(_init$6, 4, "open", _open_dec$1, Dropdown, _open$1);
|
|
3035
|
-
__decorateElement$6(_init$6, 4, "closeOnSelect", _closeOnSelect_dec$1, Dropdown, _closeOnSelect$1);
|
|
3036
|
-
__decorateElement$6(_init$6, 4, "disabled", _disabled_dec$2, Dropdown, _disabled$2);
|
|
3037
|
-
__decorateElement$6(_init$6, 4, "label", _label_dec, Dropdown, _label);
|
|
3038
|
-
__decoratorMetadata$6(_init$6, Dropdown);
|
|
3039
|
-
__publicField$6(Dropdown, "tagName", "dropdown");
|
|
3040
|
-
__publicField$6(Dropdown, "styles", [styleVariables, style$4]);
|
|
3041
|
-
Dropdown.register();
|
|
3042
|
-
var __create$5 = Object.create;
|
|
3043
|
-
var __defProp$5 = Object.defineProperty;
|
|
3044
|
-
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
3045
|
-
var __knownSymbol$5 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
3046
|
-
var __typeError$5 = (msg) => {
|
|
3047
|
-
throw TypeError(msg);
|
|
3048
|
-
};
|
|
3049
|
-
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3050
|
-
var __decoratorStart$5 = (base) => [, , , __create$5((base == null ? void 0 : base[__knownSymbol$5("metadata")]) ?? null)];
|
|
3051
|
-
var __decoratorStrings$5 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
3052
|
-
var __expectFn$5 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$5("Function expected") : fn;
|
|
3053
|
-
var __decoratorContext$5 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$5[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$5("Already initialized") : fns.push(__expectFn$5(fn || null)) });
|
|
3054
|
-
var __decoratorMetadata$5 = (array, target) => __defNormalProp$5(target, __knownSymbol$5("metadata"), array[3]);
|
|
3055
|
-
var __runInitializers$5 = (array, flags, self, value) => {
|
|
3056
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
3057
|
-
return value;
|
|
3058
|
-
};
|
|
3059
|
-
var __decorateElement$5 = (array, flags, name, decorators, target, extra) => {
|
|
3060
|
-
var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
|
|
3061
|
-
var j = array.length + 1, key = __decoratorStrings$5[k + 5];
|
|
3062
|
-
var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
|
|
3063
|
-
var desc = (target = target.prototype, __getOwnPropDesc$5({ get [name]() {
|
|
3064
|
-
return __privateGet$5(this, extra);
|
|
3065
|
-
}, set [name](x) {
|
|
3066
|
-
return __privateSet$5(this, extra, x);
|
|
3067
|
-
} }, name));
|
|
3068
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
3069
|
-
ctx = __decoratorContext$5(k, name, done = {}, array[3], extraInitializers);
|
|
3070
|
-
{
|
|
3071
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
|
|
3072
|
-
access.get = (x) => x[name];
|
|
3073
|
-
access.set = (x, y) => x[name] = y;
|
|
3074
|
-
}
|
|
3075
|
-
it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
|
|
3076
|
-
if (it === void 0) __expectFn$5(it) && (desc[key] = it);
|
|
3077
|
-
else if (typeof it !== "object" || it === null) __typeError$5("Object expected");
|
|
3078
|
-
else __expectFn$5(fn = it.get) && (desc.get = fn), __expectFn$5(fn = it.set) && (desc.set = fn), __expectFn$5(fn = it.init) && initializers.unshift(fn);
|
|
3079
|
-
}
|
|
3080
|
-
return desc && __defProp$5(target, name, desc), target;
|
|
3081
|
-
};
|
|
3082
|
-
var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3083
|
-
var __accessCheck$5 = (obj, member, msg) => member.has(obj) || __typeError$5("Cannot " + msg);
|
|
3084
|
-
var __privateGet$5 = (obj, member, getter) => (__accessCheck$5(obj, member, "read from private field"), member.get(obj));
|
|
3085
|
-
var __privateAdd$5 = (obj, member, value) => member.has(obj) ? __typeError$5("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
3086
|
-
var __privateSet$5 = (obj, member, value, setter) => (__accessCheck$5(obj, member, "write to private field"), member.set(obj, value), value);
|
|
3087
|
-
var _closeOnSelect_dec, _placement_dec, _disabled_dec$1, _size_dec$1, _color_dec$5, _variant_dec$3, _a$5, _init$5, _variant$3, _color$5, _size$1, _disabled$1, _placement, _closeOnSelect;
|
|
3088
|
-
class DropdownButton extends (_a$5 = AeicoComponent, _variant_dec$3 = [prop({ type: String })], _color_dec$5 = [prop({ type: String })], _size_dec$1 = [prop({ type: String })], _disabled_dec$1 = [prop({ type: Boolean })], _placement_dec = [prop({ type: String })], _closeOnSelect_dec = [prop({ type: Boolean })], _a$5) {
|
|
3089
|
-
constructor() {
|
|
3090
|
-
super(...arguments);
|
|
3091
|
-
__privateAdd$5(this, _variant$3, __runInitializers$5(_init$5, 8, this, "filled")), __runInitializers$5(_init$5, 11, this);
|
|
3092
|
-
__privateAdd$5(this, _color$5, __runInitializers$5(_init$5, 12, this, "default")), __runInitializers$5(_init$5, 15, this);
|
|
3093
|
-
__privateAdd$5(this, _size$1, __runInitializers$5(_init$5, 16, this, "md")), __runInitializers$5(_init$5, 19, this);
|
|
3094
|
-
__privateAdd$5(this, _disabled$1, __runInitializers$5(_init$5, 20, this, false)), __runInitializers$5(_init$5, 23, this);
|
|
3095
|
-
__privateAdd$5(this, _placement, __runInitializers$5(_init$5, 24, this, "bottom-start")), __runInitializers$5(_init$5, 27, this);
|
|
3096
|
-
__privateAdd$5(this, _closeOnSelect, __runInitializers$5(_init$5, 28, this, true)), __runInitializers$5(_init$5, 31, this);
|
|
3097
|
-
__publicField$5(this, "_dropdownEl", null);
|
|
3098
|
-
}
|
|
3099
|
-
show() {
|
|
3100
|
-
var _a2;
|
|
3101
|
-
if (this.disabled) return;
|
|
3102
|
-
(_a2 = this._dropdownEl) == null ? void 0 : _a2.show();
|
|
3103
|
-
}
|
|
3104
|
-
hide() {
|
|
3105
|
-
var _a2;
|
|
3106
|
-
(_a2 = this._dropdownEl) == null ? void 0 : _a2.hide();
|
|
3107
|
-
}
|
|
3108
|
-
toggle() {
|
|
3109
|
-
var _a2;
|
|
3110
|
-
if (this.disabled) return;
|
|
3111
|
-
(_a2 = this._dropdownEl) == null ? void 0 : _a2.toggle();
|
|
3112
|
-
}
|
|
3113
|
-
get open() {
|
|
3114
|
-
var _a2;
|
|
3115
|
-
return ((_a2 = this._dropdownEl) == null ? void 0 : _a2.open) ?? false;
|
|
3116
|
-
}
|
|
3117
|
-
render() {
|
|
3118
|
-
const dir = this.placement.split("-")[0];
|
|
3119
|
-
return html(({ aeDropdown, aeButton, slot, span }) => {
|
|
3120
|
-
this._dropdownEl = aeDropdown(
|
|
3121
|
-
{
|
|
3122
|
-
placement: this.placement,
|
|
3123
|
-
"close-on-select": this.closeOnSelect
|
|
3124
|
-
},
|
|
3125
|
-
() => {
|
|
3126
|
-
aeButton(
|
|
3127
|
-
{
|
|
3128
|
-
slot: "trigger",
|
|
3129
|
-
variant: this.variant,
|
|
3130
|
-
color: this.color,
|
|
3131
|
-
size: this.size,
|
|
3132
|
-
disabled: this.disabled || void 0
|
|
3133
|
-
},
|
|
3134
|
-
() => {
|
|
3135
|
-
slot({ name: "label" });
|
|
3136
|
-
span({ className: `caret caret--${dir}`, "aria-hidden": "true" });
|
|
3137
|
-
}
|
|
3138
|
-
);
|
|
3139
|
-
slot();
|
|
3140
|
-
}
|
|
3141
|
-
);
|
|
3142
|
-
});
|
|
3143
|
-
}
|
|
3144
|
-
}
|
|
3145
|
-
_init$5 = __decoratorStart$5(_a$5);
|
|
3146
|
-
_variant$3 = /* @__PURE__ */ new WeakMap();
|
|
3147
|
-
_color$5 = /* @__PURE__ */ new WeakMap();
|
|
3148
|
-
_size$1 = /* @__PURE__ */ new WeakMap();
|
|
3149
|
-
_disabled$1 = /* @__PURE__ */ new WeakMap();
|
|
3150
|
-
_placement = /* @__PURE__ */ new WeakMap();
|
|
3151
|
-
_closeOnSelect = /* @__PURE__ */ new WeakMap();
|
|
3152
|
-
__decorateElement$5(_init$5, 4, "variant", _variant_dec$3, DropdownButton, _variant$3);
|
|
3153
|
-
__decorateElement$5(_init$5, 4, "color", _color_dec$5, DropdownButton, _color$5);
|
|
3154
|
-
__decorateElement$5(_init$5, 4, "size", _size_dec$1, DropdownButton, _size$1);
|
|
3155
|
-
__decorateElement$5(_init$5, 4, "disabled", _disabled_dec$1, DropdownButton, _disabled$1);
|
|
3156
|
-
__decorateElement$5(_init$5, 4, "placement", _placement_dec, DropdownButton, _placement);
|
|
3157
|
-
__decorateElement$5(_init$5, 4, "closeOnSelect", _closeOnSelect_dec, DropdownButton, _closeOnSelect);
|
|
3158
|
-
__decoratorMetadata$5(_init$5, DropdownButton);
|
|
3159
|
-
__publicField$5(DropdownButton, "tagName", "dropdown-button");
|
|
3160
|
-
__publicField$5(DropdownButton, "styles", [
|
|
3161
|
-
":host { display: inline-block; }",
|
|
3162
|
-
".caret { display: inline-block; width: 0; height: 0; margin-left: 0.3em; vertical-align: 0.2em; flex-shrink: 0; }",
|
|
3163
|
-
".caret--bottom { border-top: 0.35em solid; border-right: 0.35em solid transparent; border-left: 0.35em solid transparent; }",
|
|
3164
|
-
".caret--top { border-bottom: 0.35em solid; border-right: 0.35em solid transparent; border-left: 0.35em solid transparent; }",
|
|
3165
|
-
".caret--right { border-left: 0.35em solid; border-top: 0.35em solid transparent; border-bottom: 0.35em solid transparent; }",
|
|
3166
|
-
".caret--left { border-right: 0.35em solid; border-top: 0.35em solid transparent; border-bottom: 0.35em solid transparent; }"
|
|
3167
|
-
]);
|
|
3168
|
-
DropdownButton.register();
|
|
3169
|
-
const buttonGroupStyle = ":host {\n display: inline-flex;\n align-items: stretch;\n gap: 8px;\n}\n\n:host([block]) {\n display: flex;\n width: 100%;\n}\n\n:host([block]) ::slotted(ae-button) {\n flex: 1;\n}\n\n:host([compact]) {\n gap: 0;\n}\n\n/* Raise hovered/focused button so its border shows above neighbours */\n:host([compact]) ::slotted(ae-button:hover),\n:host([compact]) ::slotted(ae-button:focus-within) {\n position: relative;\n z-index: 1;\n}\n";
|
|
3170
|
-
class ButtonGroup extends AeicoComponent {
|
|
3171
|
-
constructor() {
|
|
3172
|
-
super(...arguments);
|
|
3173
|
-
__publicField(this, "slotEl", null);
|
|
3174
|
-
}
|
|
3175
|
-
connectedCallback() {
|
|
3176
|
-
super.connectedCallback();
|
|
3177
|
-
if (this.variant === void 0) this.variant = "filled";
|
|
3178
|
-
if (this.color === void 0) this.color = "default";
|
|
3179
|
-
if (this.size === void 0) this.size = "md";
|
|
3180
|
-
}
|
|
3181
|
-
render() {
|
|
3182
|
-
return html(({ slot }) => {
|
|
3183
|
-
this.slotEl = slot({
|
|
3184
|
-
"@slotchange": () => this._syncChildren()
|
|
3185
|
-
});
|
|
3186
|
-
this._syncChildren();
|
|
3187
|
-
});
|
|
3188
|
-
}
|
|
3189
|
-
_getButtons() {
|
|
3190
|
-
if (!this.slotEl) return [];
|
|
3191
|
-
return this.slotEl.assignedElements({ flatten: true }).filter((el) => {
|
|
3192
|
-
const tag = el.tagName.toLowerCase();
|
|
3193
|
-
return tag === "ae-button" || tag === "ae-dropdown-button";
|
|
3194
|
-
});
|
|
3195
|
-
}
|
|
3196
|
-
_syncChildren() {
|
|
3197
|
-
const buttons = this._getButtons();
|
|
3198
|
-
const r = this.size === "xs" || this.size === "sm" ? 3 : 4;
|
|
3199
|
-
buttons.forEach((btn, i) => {
|
|
3200
|
-
btn.variant = this.variant;
|
|
3201
|
-
btn.color = this.color;
|
|
3202
|
-
btn.size = this.size;
|
|
3203
|
-
if (this.disabled) {
|
|
3204
|
-
btn.disabled = true;
|
|
3205
|
-
} else {
|
|
3206
|
-
btn.disabled = false;
|
|
3207
|
-
}
|
|
3208
|
-
if (this.compact) {
|
|
3209
|
-
const isFirst = i === 0;
|
|
3210
|
-
const isLast = i === buttons.length - 1;
|
|
3211
|
-
btn.style.marginLeft = isFirst ? "" : "-1px";
|
|
3212
|
-
btn.style.setProperty("--_btn-r-tl", isFirst ? `${r}px` : "0");
|
|
3213
|
-
btn.style.setProperty("--_btn-r-bl", isFirst ? `${r}px` : "0");
|
|
3214
|
-
btn.style.setProperty("--_btn-r-tr", isLast ? `${r}px` : "0");
|
|
3215
|
-
btn.style.setProperty("--_btn-r-br", isLast ? `${r}px` : "0");
|
|
3216
|
-
} else {
|
|
3217
|
-
btn.style.marginLeft = "";
|
|
3218
|
-
this._clearRadius(btn);
|
|
3219
|
-
}
|
|
3220
|
-
});
|
|
3221
|
-
}
|
|
3222
|
-
_clearRadius(btn) {
|
|
3223
|
-
btn.style.removeProperty("--_btn-r-tl");
|
|
3224
|
-
btn.style.removeProperty("--_btn-r-tr");
|
|
3225
|
-
btn.style.removeProperty("--_btn-r-br");
|
|
3226
|
-
btn.style.removeProperty("--_btn-r-bl");
|
|
3227
|
-
}
|
|
3228
|
-
}
|
|
3229
|
-
__publicField(ButtonGroup, "props", {
|
|
3230
|
-
variant: { type: String },
|
|
3231
|
-
color: { type: String },
|
|
3232
|
-
size: { type: String },
|
|
3233
|
-
compact: { type: Boolean },
|
|
3234
|
-
block: { type: Boolean },
|
|
3235
|
-
disabled: { type: Boolean }
|
|
3236
|
-
});
|
|
3237
|
-
__publicField(ButtonGroup, "styles", [styleVariables, buttonGroupStyle]);
|
|
3238
|
-
ButtonGroup.register();
|
|
3239
|
-
const badgeStyle = ':host {\n display: inline-flex;\n align-items: center;\n --badge-solid-bg: var(--color-solid);\n --badge-solid-color: var(--color-on-solid);\n --badge-border: var(--color-border);\n --badge-accent: var(--color-accent);\n --badge-subtle-bg: var(--color-bg-subtle);\n --badge-subtle-color: var(--color-text-subtle);\n --badge-subtle-border: var(--color-border-subtle);\n}\n\n.badge {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n font-family: inherit;\n font-weight: 500;\n white-space: nowrap;\n vertical-align: middle;\n line-height: 1.2;\n font-size: 1em;\n padding: 0.15em 0.6em;\n border-radius: 4px;\n border: 1px solid var(--badge-solid-bg);\n background: var(--badge-solid-bg);\n color: var(--badge-solid-color);\n}\n\n/* Default (no [variant]) = filled */\n\n/* --- Variants --- */\n\n:host([variant="outlined"]) .badge {\n background: transparent;\n border-color: var(--badge-border);\n color: var(--badge-accent);\n}\n\n:host([variant="faint"]) .badge {\n background: var(--badge-subtle-bg);\n border-color: var(--badge-subtle-border);\n color: var(--badge-subtle-color);\n}\n\n:host([variant="subtle"]) .badge {\n background: var(--badge-subtle-bg);\n border-color: transparent;\n color: var(--badge-subtle-color);\n}\n\n:host([variant="text"]) .badge {\n background: transparent;\n border-color: transparent;\n color: var(--badge-accent);\n padding-left: 0;\n padding-right: 0;\n}\n\n:host([pill]) .badge {\n border-radius: 999px;\n}\n\n/* Icon slots */\n::slotted(ae-icon) {\n font-size: 1.1em;\n}\n';
|
|
3240
|
-
var __create$4 = Object.create;
|
|
3241
|
-
var __defProp$4 = Object.defineProperty;
|
|
3242
|
-
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
3243
|
-
var __knownSymbol$4 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
3244
|
-
var __typeError$4 = (msg) => {
|
|
3245
|
-
throw TypeError(msg);
|
|
3246
|
-
};
|
|
3247
|
-
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3248
|
-
var __decoratorStart$4 = (base) => [, , , __create$4((base == null ? void 0 : base[__knownSymbol$4("metadata")]) ?? null)];
|
|
3249
|
-
var __decoratorStrings$4 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
3250
|
-
var __expectFn$4 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$4("Function expected") : fn;
|
|
3251
|
-
var __decoratorContext$4 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$4[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$4("Already initialized") : fns.push(__expectFn$4(fn || null)) });
|
|
3252
|
-
var __decoratorMetadata$4 = (array, target) => __defNormalProp$4(target, __knownSymbol$4("metadata"), array[3]);
|
|
3253
|
-
var __runInitializers$4 = (array, flags, self, value) => {
|
|
3254
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
3255
|
-
return value;
|
|
3256
|
-
};
|
|
3257
|
-
var __decorateElement$4 = (array, flags, name, decorators, target, extra) => {
|
|
3258
|
-
var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
|
|
3259
|
-
var j = array.length + 1, key = __decoratorStrings$4[k + 5];
|
|
3260
|
-
var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
|
|
3261
|
-
var desc = (target = target.prototype, __getOwnPropDesc$4({ get [name]() {
|
|
3262
|
-
return __privateGet$4(this, extra);
|
|
3263
|
-
}, set [name](x) {
|
|
3264
|
-
return __privateSet$4(this, extra, x);
|
|
3265
|
-
} }, name));
|
|
3266
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
3267
|
-
ctx = __decoratorContext$4(k, name, done = {}, array[3], extraInitializers);
|
|
3268
|
-
{
|
|
3269
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
|
|
3270
|
-
access.get = (x) => x[name];
|
|
3271
|
-
access.set = (x, y) => x[name] = y;
|
|
3272
|
-
}
|
|
3273
|
-
it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
|
|
3274
|
-
if (it === void 0) __expectFn$4(it) && (desc[key] = it);
|
|
3275
|
-
else if (typeof it !== "object" || it === null) __typeError$4("Object expected");
|
|
3276
|
-
else __expectFn$4(fn = it.get) && (desc.get = fn), __expectFn$4(fn = it.set) && (desc.set = fn), __expectFn$4(fn = it.init) && initializers.unshift(fn);
|
|
3277
|
-
}
|
|
3278
|
-
return desc && __defProp$4(target, name, desc), target;
|
|
3279
|
-
};
|
|
3280
|
-
var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, key + "", value);
|
|
3281
|
-
var __accessCheck$4 = (obj, member, msg) => member.has(obj) || __typeError$4("Cannot " + msg);
|
|
3282
|
-
var __privateGet$4 = (obj, member, getter) => (__accessCheck$4(obj, member, "read from private field"), member.get(obj));
|
|
3283
|
-
var __privateAdd$4 = (obj, member, value) => member.has(obj) ? __typeError$4("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
3284
|
-
var __privateSet$4 = (obj, member, value, setter) => (__accessCheck$4(obj, member, "write to private field"), member.set(obj, value), value);
|
|
3285
|
-
var _pill_dec, _size_dec, _variant_dec$2, _color_dec$4, _a$4, _init$4, _color$4, _variant$2, _size, _pill;
|
|
3286
|
-
class Badge extends (_a$4 = AeicoComponent, _color_dec$4 = [prop({ type: String })], _variant_dec$2 = [prop({ type: String })], _size_dec = [prop({ type: String })], _pill_dec = [prop({ type: Boolean })], _a$4) {
|
|
3287
|
-
constructor() {
|
|
3288
|
-
super(...arguments);
|
|
3289
|
-
__privateAdd$4(this, _color$4, __runInitializers$4(_init$4, 8, this, "default")), __runInitializers$4(_init$4, 11, this);
|
|
3290
|
-
__privateAdd$4(this, _variant$2, __runInitializers$4(_init$4, 12, this, "filled")), __runInitializers$4(_init$4, 15, this);
|
|
3291
|
-
__privateAdd$4(this, _size, __runInitializers$4(_init$4, 16, this, "md")), __runInitializers$4(_init$4, 19, this);
|
|
3292
|
-
__privateAdd$4(this, _pill, __runInitializers$4(_init$4, 20, this, false)), __runInitializers$4(_init$4, 23, this);
|
|
3293
|
-
}
|
|
3294
|
-
render() {
|
|
3295
|
-
return html(({ span, slot }) => {
|
|
3296
|
-
span({ part: "badge", className: "badge" }, () => {
|
|
3297
|
-
slot({ name: "start" });
|
|
3298
|
-
slot();
|
|
3299
|
-
slot({ name: "end" });
|
|
3300
|
-
});
|
|
3301
|
-
});
|
|
3302
|
-
}
|
|
3303
|
-
}
|
|
3304
|
-
_init$4 = __decoratorStart$4(_a$4);
|
|
3305
|
-
_color$4 = /* @__PURE__ */ new WeakMap();
|
|
3306
|
-
_variant$2 = /* @__PURE__ */ new WeakMap();
|
|
3307
|
-
_size = /* @__PURE__ */ new WeakMap();
|
|
3308
|
-
_pill = /* @__PURE__ */ new WeakMap();
|
|
3309
|
-
__decorateElement$4(_init$4, 4, "color", _color_dec$4, Badge, _color$4);
|
|
3310
|
-
__decorateElement$4(_init$4, 4, "variant", _variant_dec$2, Badge, _variant$2);
|
|
3311
|
-
__decorateElement$4(_init$4, 4, "size", _size_dec, Badge, _size);
|
|
3312
|
-
__decorateElement$4(_init$4, 4, "pill", _pill_dec, Badge, _pill);
|
|
3313
|
-
__decoratorMetadata$4(_init$4, Badge);
|
|
3314
|
-
__publicField$4(Badge, "styles", [styleVariables, sizeCSS, colorCSS, badgeStyle]);
|
|
3315
|
-
Badge.register();
|
|
3316
|
-
const alertStyle = `.alert {
|
|
3317
|
-
position: relative;
|
|
3318
|
-
padding: 12px 16px;
|
|
3319
|
-
margin-bottom: 12px;
|
|
3320
|
-
border-radius: 4px;
|
|
3321
|
-
font-size: 12px;
|
|
3322
|
-
line-height: 1.6;
|
|
3323
|
-
background-color: var(--alert-solid-bg);
|
|
3324
|
-
color: var(--alert-solid-color);
|
|
3325
|
-
border: 1px solid var(--alert-solid-bg);
|
|
3326
|
-
}
|
|
3327
|
-
|
|
3328
|
-
.alert:last-child {
|
|
3329
|
-
margin-bottom: 0;
|
|
3330
|
-
}
|
|
3331
|
-
|
|
3332
|
-
:host {
|
|
3333
|
-
--color-solid: var(--color-primary);
|
|
3334
|
-
--color-on-solid: var(--color-text-main);
|
|
3335
|
-
--color-border: var(--color-primary);
|
|
3336
|
-
--color-bg-subtle: var(--color-primary-bg-subtle);
|
|
3337
|
-
--color-text-subtle: var(--color-primary-text-emphasis);
|
|
3338
|
-
--color-border-subtle: var(--color-primary-border-subtle);
|
|
3339
|
-
|
|
3340
|
-
--alert-solid-bg: var(--color-solid);
|
|
3341
|
-
--alert-solid-color: var(--color-on-solid);
|
|
3342
|
-
--alert-border: var(--color-border);
|
|
3343
|
-
--alert-subtle-bg: var(--color-bg-subtle);
|
|
3344
|
-
--alert-subtle-color: var(--color-text-subtle);
|
|
3345
|
-
--alert-subtle-border:var(--color-border-subtle);
|
|
3346
|
-
}
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
:host([variant="faint"]) .alert {
|
|
3350
|
-
background-color: var(--alert-subtle-bg);
|
|
3351
|
-
color: var(--alert-subtle-color);
|
|
3352
|
-
border-color: var(--alert-subtle-border);
|
|
3353
|
-
}
|
|
3354
|
-
|
|
3355
|
-
:host([variant="subtle"]) .alert {
|
|
3356
|
-
background-color: var(--alert-subtle-bg);
|
|
3357
|
-
color: var(--alert-subtle-color);
|
|
3358
|
-
border-color: transparent;
|
|
3359
|
-
}
|
|
3360
|
-
|
|
3361
|
-
:host([variant="filled"]) .alert {
|
|
3362
|
-
background-color: var(--alert-solid-bg);
|
|
3363
|
-
color: var(--alert-solid-color);
|
|
3364
|
-
border-color: var(--alert-solid-bg);
|
|
3365
|
-
}
|
|
3366
|
-
|
|
3367
|
-
:host([variant="outlined"]) .alert {
|
|
3368
|
-
background-color: transparent;
|
|
3369
|
-
color: var(--alert-subtle-color);
|
|
3370
|
-
border-color: var(--alert-border);
|
|
3371
|
-
}
|
|
3372
|
-
|
|
3373
|
-
:host([dismissible]) .alert {
|
|
3374
|
-
padding-right: 40px;
|
|
3375
|
-
}
|
|
3376
|
-
|
|
3377
|
-
:host([icon]) .alert {
|
|
3378
|
-
display: flex;
|
|
3379
|
-
align-items: flex-start;
|
|
3380
|
-
gap: 10px;
|
|
3381
|
-
}
|
|
3382
|
-
|
|
3383
|
-
:host([icon]) .alert::before {
|
|
3384
|
-
content: '';
|
|
3385
|
-
flex-shrink: 0;
|
|
3386
|
-
width: 16px;
|
|
3387
|
-
height: 16px;
|
|
3388
|
-
margin-top: 2px;
|
|
3389
|
-
}
|
|
3390
|
-
|
|
3391
|
-
.alert-close {
|
|
3392
|
-
position: absolute;
|
|
3393
|
-
top: 50%;
|
|
3394
|
-
right: 12px;
|
|
3395
|
-
transform: translateY(-50%);
|
|
3396
|
-
background: transparent;
|
|
3397
|
-
border: none;
|
|
3398
|
-
color: inherit;
|
|
3399
|
-
opacity: 0.6;
|
|
3400
|
-
cursor: pointer;
|
|
3401
|
-
padding: 4px;
|
|
3402
|
-
font-size: 18px;
|
|
3403
|
-
line-height: 1;
|
|
3404
|
-
transition: opacity 0.15s;
|
|
3405
|
-
}
|
|
3406
|
-
|
|
3407
|
-
.alert-close:hover {
|
|
3408
|
-
opacity: 1;
|
|
3409
|
-
}
|
|
3410
|
-
|
|
3411
|
-
:host([size="sm"]) .alert {
|
|
3412
|
-
padding: 8px 12px;
|
|
3413
|
-
font-size: 11px;
|
|
3414
|
-
}
|
|
3415
|
-
|
|
3416
|
-
:host([size="lg"]) .alert {
|
|
3417
|
-
padding: 16px 20px;
|
|
3418
|
-
font-size: 13px;
|
|
3419
|
-
}
|
|
3420
|
-
`;
|
|
3421
|
-
class Alert extends AeicoComponent {
|
|
3422
|
-
constructor() {
|
|
3423
|
-
super(...arguments);
|
|
3424
|
-
__publicField(this, "_handleClose", () => {
|
|
3425
|
-
this.emit("alert-close", { detail: { target: this } });
|
|
3426
|
-
this.remove();
|
|
3427
|
-
});
|
|
3428
|
-
}
|
|
3429
|
-
render() {
|
|
3430
|
-
return html(({ div, slot, button, span }) => {
|
|
3431
|
-
div(
|
|
3432
|
-
{
|
|
3433
|
-
className: "alert",
|
|
3434
|
-
role: "alert",
|
|
3435
|
-
part: "alert",
|
|
3436
|
-
style: { display: this.invisible ? "none" : "" }
|
|
3437
|
-
},
|
|
3438
|
-
() => {
|
|
3439
|
-
slot();
|
|
3440
|
-
if (this.dismissible) {
|
|
3441
|
-
button(
|
|
3442
|
-
{
|
|
3443
|
-
className: "alert-close",
|
|
3444
|
-
"@click": () => this._handleClose(),
|
|
3445
|
-
title: t("alert.close", "Close alert")
|
|
3446
|
-
},
|
|
3447
|
-
() => {
|
|
3448
|
-
span({ "aria-hidden": "true", textContent: "×" });
|
|
3449
|
-
}
|
|
3450
|
-
);
|
|
3451
|
-
}
|
|
3452
|
-
}
|
|
3453
|
-
);
|
|
3454
|
-
});
|
|
3455
|
-
}
|
|
3456
|
-
show() {
|
|
3457
|
-
if (this.invisible) {
|
|
3458
|
-
this.invisible = false;
|
|
3459
|
-
}
|
|
3460
|
-
}
|
|
3461
|
-
hide() {
|
|
3462
|
-
this.invisible = true;
|
|
3463
|
-
}
|
|
3464
|
-
}
|
|
3465
|
-
__publicField(Alert, "props", {
|
|
3466
|
-
color: { type: String },
|
|
3467
|
-
variant: { type: String },
|
|
3468
|
-
size: { type: String },
|
|
3469
|
-
dismissible: { type: Boolean },
|
|
3470
|
-
invisible: { type: Boolean }
|
|
3471
|
-
});
|
|
3472
|
-
__publicField(Alert, "useStyles", ["alert"]);
|
|
3473
|
-
__publicField(Alert, "styles", [styleVariables, colorCSS, alertStyle]);
|
|
3474
|
-
Alert.register();
|
|
3475
|
-
const style$1 = ":host {\n display: contents;\n}\n\ndialog {\n display: none;\n flex-direction: column;\n border: none;\n border-radius: 8px;\n padding: 0;\n max-width: min(90vw, 600px);\n max-height: 90vh;\n background: var(--surface-overlay);\n color: var(--color-text-main);\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);\n overflow: hidden;\n}\n\ndialog[open] {\n display: flex;\n animation: dialog-slide-in 0.2s ease;\n}\n\ndialog::backdrop {\n background: var(--color-overlay);\n animation: dialog-backdrop-in 0.2s ease;\n}\n\n@keyframes dialog-backdrop-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes dialog-slide-in {\n from {\n opacity: 0;\n transform: scale(0.96) translateY(-8px);\n }\n to {\n opacity: 1;\n transform: scale(1) translateY(0);\n }\n}\n\nheader {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 16px 20px;\n border-bottom: 1px solid var(--border-subtle);\n flex-shrink: 0;\n}\n\n.label {\n flex: 1;\n font-size: var(--size-m, 1rem);\n font-weight: 500;\n margin: 0;\n color: var(--color-text-main);\n}\n\n.close-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 28px;\n height: 28px;\n padding: 0;\n border: none;\n border-radius: 4px;\n background: transparent;\n color: var(--color-text-muted);\n font-size: 18px;\n line-height: 1;\n cursor: pointer;\n transition: background 0.15s, color 0.15s;\n}\n\n.close-btn:hover {\n background: var(--border-subtle);\n color: var(--color-text-main);\n}\n\n.body {\n flex: 1;\n overflow-y: auto;\n padding: 20px;\n}\n\nfooter {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n padding: 12px 20px;\n border-top: 1px solid var(--border-subtle);\n flex-shrink: 0;\n}\n\n::slotted([data-align-left]) {\n margin-right: auto;\n}\n";
|
|
3476
|
-
class Dialog extends AeicoComponent {
|
|
3477
|
-
constructor() {
|
|
3478
|
-
super(...arguments);
|
|
3479
|
-
__publicField(this, "_dialogEl", null);
|
|
3480
|
-
__publicField(this, "_hasFooter", false);
|
|
3481
|
-
__publicField(this, "_handleDialogClick", (e) => {
|
|
3482
|
-
const mouseEvent = e;
|
|
3483
|
-
const path = mouseEvent.composedPath();
|
|
3484
|
-
for (const el of path) {
|
|
3485
|
-
if (el instanceof Element && el.hasAttribute("data-close")) {
|
|
3486
|
-
this.close();
|
|
3487
|
-
return;
|
|
3488
|
-
}
|
|
3489
|
-
if (el === this._dialogEl) break;
|
|
3490
|
-
}
|
|
3491
|
-
if (this.modal !== false && this.closeOnOverlayClick !== false) {
|
|
3492
|
-
if (mouseEvent.target === this._dialogEl) {
|
|
3493
|
-
const rect = this._dialogEl.getBoundingClientRect();
|
|
3494
|
-
const outside = mouseEvent.clientX < rect.left || mouseEvent.clientX > rect.right || mouseEvent.clientY < rect.top || mouseEvent.clientY > rect.bottom;
|
|
3495
|
-
if (outside) {
|
|
3496
|
-
this.close();
|
|
3497
|
-
}
|
|
3498
|
-
}
|
|
3499
|
-
}
|
|
3500
|
-
});
|
|
3501
|
-
__publicField(this, "_handleNativeClose", () => {
|
|
3502
|
-
this.emit("close", { detail: { target: this } });
|
|
3503
|
-
});
|
|
3504
|
-
__publicField(this, "_handleFooterSlotChange", (e) => {
|
|
3505
|
-
const slotEl = e.target;
|
|
3506
|
-
const hasContent = slotEl.assignedElements().length > 0;
|
|
3507
|
-
if (hasContent !== this._hasFooter) {
|
|
3508
|
-
this._hasFooter = hasContent;
|
|
3509
|
-
this.update();
|
|
3510
|
-
}
|
|
3511
|
-
});
|
|
3512
|
-
}
|
|
3513
|
-
render() {
|
|
3514
|
-
return html(({ dialog, div, header, footer, span, button, slot }) => {
|
|
3515
|
-
this._dialogEl = dialog(
|
|
3516
|
-
{
|
|
3517
|
-
"@click": this._handleDialogClick,
|
|
3518
|
-
"@close": this._handleNativeClose,
|
|
3519
|
-
style: {
|
|
3520
|
-
width: this.width || "",
|
|
3521
|
-
height: this.height || ""
|
|
3522
|
-
}
|
|
3523
|
-
},
|
|
3524
|
-
() => {
|
|
3525
|
-
if (this.header !== false) {
|
|
3526
|
-
header({}, () => {
|
|
3527
|
-
slot({ name: "header" }, () => {
|
|
3528
|
-
span({ className: "label", textContent: this.label || "" });
|
|
3529
|
-
});
|
|
3530
|
-
if (this.closable !== false) {
|
|
3531
|
-
button({
|
|
3532
|
-
className: "close-btn",
|
|
3533
|
-
textContent: "×",
|
|
3534
|
-
"@click": () => this.close()
|
|
3535
|
-
});
|
|
3536
|
-
}
|
|
3537
|
-
});
|
|
3538
|
-
}
|
|
3539
|
-
div({ className: "body" }, () => {
|
|
3540
|
-
slot();
|
|
3541
|
-
});
|
|
3542
|
-
footer(
|
|
3543
|
-
{
|
|
3544
|
-
style: { display: this._hasFooter ? "" : "none" }
|
|
3545
|
-
},
|
|
3546
|
-
() => {
|
|
3547
|
-
slot({ name: "footer", "@slotchange": this._handleFooterSlotChange });
|
|
3548
|
-
}
|
|
3549
|
-
);
|
|
3550
|
-
}
|
|
3551
|
-
);
|
|
3552
|
-
});
|
|
3553
|
-
}
|
|
3554
|
-
open() {
|
|
3555
|
-
if (!this._dialogEl) return;
|
|
3556
|
-
if (this.modal !== false) {
|
|
3557
|
-
this._dialogEl.showModal();
|
|
3558
|
-
} else {
|
|
3559
|
-
this._dialogEl.show();
|
|
3560
|
-
}
|
|
3561
|
-
this.emit("open", { detail: { target: this } });
|
|
3562
|
-
}
|
|
3563
|
-
close() {
|
|
3564
|
-
var _a2;
|
|
3565
|
-
(_a2 = this._dialogEl) == null ? void 0 : _a2.close();
|
|
3566
|
-
}
|
|
3567
|
-
isOpen() {
|
|
3568
|
-
var _a2;
|
|
3569
|
-
return ((_a2 = this._dialogEl) == null ? void 0 : _a2.open) ?? false;
|
|
3570
|
-
}
|
|
3571
|
-
}
|
|
3572
|
-
__publicField(Dialog, "props", {
|
|
3573
|
-
label: { type: String },
|
|
3574
|
-
width: { type: String },
|
|
3575
|
-
height: { type: String },
|
|
3576
|
-
modal: { type: Boolean },
|
|
3577
|
-
closable: { type: Boolean },
|
|
3578
|
-
header: { type: Boolean },
|
|
3579
|
-
closeOnOverlayClick: { type: Boolean }
|
|
3580
|
-
});
|
|
3581
|
-
__publicField(Dialog, "styles", [styleVariables, style$1]);
|
|
3582
|
-
Dialog.register();
|
|
3583
|
-
class IconButton extends AeicoComponent {
|
|
3584
|
-
render() {
|
|
3585
|
-
return html(({ aeButton, aeIcon }) => {
|
|
3586
|
-
aeButton(
|
|
3587
|
-
{
|
|
3588
|
-
color: this.color,
|
|
3589
|
-
variant: this.variant,
|
|
3590
|
-
size: this.size,
|
|
3591
|
-
disabled: this.disabled
|
|
3592
|
-
},
|
|
3593
|
-
() => {
|
|
3594
|
-
aeIcon({ name: this.icon });
|
|
3595
|
-
}
|
|
3596
|
-
);
|
|
3597
|
-
});
|
|
3598
|
-
}
|
|
3599
|
-
}
|
|
3600
|
-
__publicField(IconButton, "tagName", "icon-button");
|
|
3601
|
-
__publicField(IconButton, "props", {
|
|
3602
|
-
icon: { type: String },
|
|
3603
|
-
size: { type: String },
|
|
3604
|
-
color: { type: String },
|
|
3605
|
-
variant: { type: String },
|
|
3606
|
-
disabled: { type: Boolean }
|
|
3607
|
-
});
|
|
3608
|
-
__publicField(IconButton, "styles", [":host { display: contents; }"]);
|
|
3609
|
-
IconButton.register();
|
|
3610
|
-
const tabsStyle = ':host {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n[part="tab-nav"] {\n display: flex;\n flex-shrink: 0;\n border-bottom: 1px solid var(--ae-tabs-border-color, var(--border-default));\n}\n\n[part="panels"] {\n flex: 1;\n overflow: auto;\n}\n';
|
|
3611
|
-
class Tabs extends AeicoComponent {
|
|
3612
|
-
constructor() {
|
|
3613
|
-
super(...arguments);
|
|
3614
|
-
__publicField(this, "_observer", null);
|
|
3615
|
-
__publicField(this, "_handleTabClick", (e) => {
|
|
3616
|
-
const pairs = this._getPairs();
|
|
3617
|
-
const target = e.target;
|
|
3618
|
-
const index = pairs.findIndex(([tab]) => tab === target);
|
|
3619
|
-
if (index !== -1) this.selectTab(index);
|
|
3620
|
-
});
|
|
3621
|
-
}
|
|
3622
|
-
get _tabs() {
|
|
3623
|
-
return [...this.children].filter(
|
|
3624
|
-
(el) => el.tagName.toLowerCase() === "ae-tab"
|
|
3625
|
-
);
|
|
3626
|
-
}
|
|
3627
|
-
get _panels() {
|
|
3628
|
-
return [...this.children].filter(
|
|
3629
|
-
(el) => el.tagName.toLowerCase() === "ae-tab-panel"
|
|
3630
|
-
);
|
|
3631
|
-
}
|
|
3632
|
-
_getPairs() {
|
|
3633
|
-
const tabs = this._tabs;
|
|
3634
|
-
const panels = this._panels;
|
|
3635
|
-
const idMap = /* @__PURE__ */ new Map();
|
|
3636
|
-
for (const panel of panels) {
|
|
3637
|
-
const id = panel.id;
|
|
3638
|
-
if (id) idMap.set(id, panel);
|
|
3639
|
-
}
|
|
3640
|
-
const usedPanels = /* @__PURE__ */ new Set();
|
|
3641
|
-
const pairs = [];
|
|
3642
|
-
for (const tab of tabs) {
|
|
3643
|
-
const panelId = tab.panel;
|
|
3644
|
-
if (panelId) {
|
|
3645
|
-
const panel = idMap.get(panelId) ?? null;
|
|
3646
|
-
if (panel) usedPanels.add(panel);
|
|
3647
|
-
pairs.push([tab, panel]);
|
|
3648
|
-
}
|
|
3649
|
-
}
|
|
3650
|
-
const unmatchedPanels = panels.filter((p) => !usedPanels.has(p));
|
|
3651
|
-
let posIndex = 0;
|
|
3652
|
-
for (const tab of tabs) {
|
|
3653
|
-
if (!tab.panel) {
|
|
3654
|
-
pairs.push([tab, unmatchedPanels[posIndex] ?? null]);
|
|
3655
|
-
posIndex++;
|
|
3656
|
-
}
|
|
3657
|
-
}
|
|
3658
|
-
return pairs;
|
|
3659
|
-
}
|
|
3660
|
-
connectedCallback() {
|
|
3661
|
-
super.connectedCallback();
|
|
3662
|
-
this.listen("_tab-click", this._handleTabClick);
|
|
3663
|
-
this._observer = new MutationObserver(() => this.update());
|
|
3664
|
-
this._observer.observe(this, { childList: true });
|
|
3665
|
-
}
|
|
3666
|
-
disconnectedCallback() {
|
|
3667
|
-
var _a2;
|
|
3668
|
-
super.disconnectedCallback();
|
|
3669
|
-
(_a2 = this._observer) == null ? void 0 : _a2.disconnect();
|
|
3670
|
-
this._observer = null;
|
|
3671
|
-
}
|
|
3672
|
-
onUpdated() {
|
|
3673
|
-
this._syncActive();
|
|
3674
|
-
}
|
|
3675
|
-
_syncActive() {
|
|
3676
|
-
const activeIndex = this.activeIndex ?? 0;
|
|
3677
|
-
const pairs = this._getPairs();
|
|
3678
|
-
pairs.forEach(([tab, panel], i) => {
|
|
3679
|
-
const isActive = i === activeIndex;
|
|
3680
|
-
if (isActive) {
|
|
3681
|
-
tab.setAttribute("active", "");
|
|
3682
|
-
panel == null ? void 0 : panel.setAttribute("active", "");
|
|
3683
|
-
} else {
|
|
3684
|
-
tab.removeAttribute("active");
|
|
3685
|
-
panel == null ? void 0 : panel.removeAttribute("active");
|
|
3686
|
-
}
|
|
3687
|
-
});
|
|
3688
|
-
}
|
|
3689
|
-
selectTab(index) {
|
|
3690
|
-
const pairs = this._getPairs();
|
|
3691
|
-
if (index === (this.activeIndex ?? 0) || index >= pairs.length) return;
|
|
3692
|
-
this.activeIndex = index;
|
|
3693
|
-
this.emit("change", { detail: { index } });
|
|
3694
|
-
}
|
|
3695
|
-
render() {
|
|
3696
|
-
return html(({ nav, div, slot }) => {
|
|
3697
|
-
nav({ part: "tab-nav", role: "tablist" }, () => {
|
|
3698
|
-
slot({ name: "tab" });
|
|
3699
|
-
});
|
|
3700
|
-
div({ part: "panels" }, () => {
|
|
3701
|
-
slot();
|
|
3702
|
-
});
|
|
3703
|
-
});
|
|
3704
|
-
}
|
|
3705
|
-
}
|
|
3706
|
-
__publicField(Tabs, "props", {
|
|
3707
|
-
activeIndex: { type: Number }
|
|
3708
|
-
});
|
|
3709
|
-
__publicField(Tabs, "styles", [styleVariables, tabsStyle]);
|
|
3710
|
-
Tabs.register();
|
|
3711
|
-
const tabStyle = ":host {\n display: inline-flex;\n cursor: pointer;\n margin-bottom: -1px;\n}\n\nbutton {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 8px 16px;\n background: none;\n border: none;\n border-bottom: 2px solid transparent;\n cursor: pointer;\n font-size: inherit;\n font-family: inherit;\n color: var(--ae-tab-color, #909090);\n font-size: var(--ae-tab-font-size, inherit);\n transition: color 0.15s, border-color 0.15s;\n outline: none;\n white-space: nowrap;\n user-select: none;\n}\n\nbutton:hover {\n color: var(--ae-tab-hover-color, var(--color-primary));\n}\n\nbutton:focus-visible {\n outline: 2px solid var(--color-primary);\n outline-offset: -2px;\n}\n\n:host([active]) button {\n color: var(--ae-tab-active-color, var(--color-primary));\n border-bottom-color: var(--ae-tab-active-color, var(--color-primary));\n}\n\n:host([disabled]) button {\n opacity: 0.4;\n cursor: not-allowed;\n pointer-events: none;\n}\n";
|
|
3712
|
-
class Tab extends AeicoComponent {
|
|
3713
|
-
constructor() {
|
|
3714
|
-
super(...arguments);
|
|
3715
|
-
__publicField(this, "_handleClick", () => {
|
|
3716
|
-
if (this.disabled) return;
|
|
3717
|
-
this.dispatchEvent(
|
|
3718
|
-
new CustomEvent("_tab-click", {
|
|
3719
|
-
bubbles: true,
|
|
3720
|
-
composed: true
|
|
3721
|
-
})
|
|
3722
|
-
);
|
|
3723
|
-
});
|
|
3724
|
-
}
|
|
3725
|
-
connectedCallback() {
|
|
3726
|
-
this.setAttribute("slot", "tab");
|
|
3727
|
-
super.connectedCallback();
|
|
3728
|
-
this.listen("click", this._handleClick);
|
|
3729
|
-
}
|
|
3730
|
-
render() {
|
|
3731
|
-
return html(({ button, slot }) => {
|
|
3732
|
-
button(
|
|
3733
|
-
{
|
|
3734
|
-
part: "tab",
|
|
3735
|
-
type: "button",
|
|
3736
|
-
role: "tab",
|
|
3737
|
-
"aria-selected": this.active,
|
|
3738
|
-
"aria-disabled": this.disabled,
|
|
3739
|
-
disabled: this.disabled
|
|
3740
|
-
},
|
|
3741
|
-
() => {
|
|
3742
|
-
slot();
|
|
3743
|
-
}
|
|
3744
|
-
);
|
|
3745
|
-
});
|
|
3746
|
-
}
|
|
3747
|
-
}
|
|
3748
|
-
__publicField(Tab, "props", {
|
|
3749
|
-
active: { type: Boolean },
|
|
3750
|
-
disabled: { type: Boolean },
|
|
3751
|
-
panel: { type: String }
|
|
3752
|
-
});
|
|
3753
|
-
__publicField(Tab, "styles", [tabStyle]);
|
|
3754
|
-
Tab.register();
|
|
3755
|
-
const tabPanelStyle = ":host {\n display: none;\n padding: 16px 0;\n}\n\n:host([active]) {\n display: block;\n}\n";
|
|
3756
|
-
class TabPanel extends AeicoComponent {
|
|
3757
|
-
render() {
|
|
3758
|
-
return html(({ slot }) => {
|
|
3759
|
-
slot();
|
|
3760
|
-
});
|
|
3761
|
-
}
|
|
3762
|
-
}
|
|
3763
|
-
__publicField(TabPanel, "styles", [tabPanelStyle]);
|
|
3764
|
-
TabPanel.register();
|
|
3765
|
-
const style = ":host {\n display: block;\n width: 100%;\n height: var(--thickness, 1px);\n flex-shrink: 0;\n\n /* Override colorCSS default --color-border from gray to the subtle border token */\n --color-border: var(--border-default);\n\n background: var(--color-border);\n}\n\n:host([vertical]) {\n display: inline-block;\n width: var(--thickness, 1px);\n height: 1lh;\n vertical-align: middle;\n}\n";
|
|
3766
|
-
var __create$3 = Object.create;
|
|
3767
|
-
var __defProp$3 = Object.defineProperty;
|
|
3768
|
-
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
3769
|
-
var __knownSymbol$3 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
3770
|
-
var __typeError$3 = (msg) => {
|
|
3771
|
-
throw TypeError(msg);
|
|
3772
|
-
};
|
|
3773
|
-
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3774
|
-
var __decoratorStart$3 = (base) => [, , , __create$3((base == null ? void 0 : base[__knownSymbol$3("metadata")]) ?? null)];
|
|
3775
|
-
var __decoratorStrings$3 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
3776
|
-
var __expectFn$3 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$3("Function expected") : fn;
|
|
3777
|
-
var __decoratorContext$3 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$3[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$3("Already initialized") : fns.push(__expectFn$3(fn || null)) });
|
|
3778
|
-
var __decoratorMetadata$3 = (array, target) => __defNormalProp$3(target, __knownSymbol$3("metadata"), array[3]);
|
|
3779
|
-
var __runInitializers$3 = (array, flags, self, value) => {
|
|
3780
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
3781
|
-
return value;
|
|
3782
|
-
};
|
|
3783
|
-
var __decorateElement$3 = (array, flags, name, decorators, target, extra) => {
|
|
3784
|
-
var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
|
|
3785
|
-
var j = array.length + 1, key = __decoratorStrings$3[k + 5];
|
|
3786
|
-
var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
|
|
3787
|
-
var desc = (target = target.prototype, __getOwnPropDesc$3({ get [name]() {
|
|
3788
|
-
return __privateGet$3(this, extra);
|
|
3789
|
-
}, set [name](x) {
|
|
3790
|
-
return __privateSet$3(this, extra, x);
|
|
3791
|
-
} }, name));
|
|
3792
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
3793
|
-
ctx = __decoratorContext$3(k, name, done = {}, array[3], extraInitializers);
|
|
3794
|
-
{
|
|
3795
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
|
|
3796
|
-
access.get = (x) => x[name];
|
|
3797
|
-
access.set = (x, y) => x[name] = y;
|
|
3798
|
-
}
|
|
3799
|
-
it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
|
|
3800
|
-
if (it === void 0) __expectFn$3(it) && (desc[key] = it);
|
|
3801
|
-
else if (typeof it !== "object" || it === null) __typeError$3("Object expected");
|
|
3802
|
-
else __expectFn$3(fn = it.get) && (desc.get = fn), __expectFn$3(fn = it.set) && (desc.set = fn), __expectFn$3(fn = it.init) && initializers.unshift(fn);
|
|
3803
|
-
}
|
|
3804
|
-
return desc && __defProp$3(target, name, desc), target;
|
|
3805
|
-
};
|
|
3806
|
-
var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3807
|
-
var __accessCheck$3 = (obj, member, msg) => member.has(obj) || __typeError$3("Cannot " + msg);
|
|
3808
|
-
var __privateGet$3 = (obj, member, getter) => (__accessCheck$3(obj, member, "read from private field"), member.get(obj));
|
|
3809
|
-
var __privateAdd$3 = (obj, member, value) => member.has(obj) ? __typeError$3("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
3810
|
-
var __privateSet$3 = (obj, member, value, setter) => (__accessCheck$3(obj, member, "write to private field"), member.set(obj, value), value);
|
|
3811
|
-
var _color_dec$3, _thickness_dec, _vertical_dec, _a$3, _init$3, _vertical, _thickness, _color$3;
|
|
3812
|
-
class Divider extends (_a$3 = AeicoComponent, _vertical_dec = [prop({ type: Boolean })], _thickness_dec = [prop({ type: String })], _color_dec$3 = [prop({ type: String })], _a$3) {
|
|
3813
|
-
constructor() {
|
|
3814
|
-
super(...arguments);
|
|
3815
|
-
__privateAdd$3(this, _vertical, __runInitializers$3(_init$3, 8, this, false)), __runInitializers$3(_init$3, 11, this);
|
|
3816
|
-
__privateAdd$3(this, _thickness, __runInitializers$3(_init$3, 12, this)), __runInitializers$3(_init$3, 15, this);
|
|
3817
|
-
__privateAdd$3(this, _color$3, __runInitializers$3(_init$3, 16, this)), __runInitializers$3(_init$3, 19, this);
|
|
3818
|
-
}
|
|
3819
|
-
render() {
|
|
3820
|
-
if (this.thickness) {
|
|
3821
|
-
this.style.setProperty("--thickness", this.thickness);
|
|
3822
|
-
} else {
|
|
3823
|
-
this.style.removeProperty("--thickness");
|
|
3824
|
-
}
|
|
3825
|
-
}
|
|
3826
|
-
}
|
|
3827
|
-
_init$3 = __decoratorStart$3(_a$3);
|
|
3828
|
-
_vertical = /* @__PURE__ */ new WeakMap();
|
|
3829
|
-
_thickness = /* @__PURE__ */ new WeakMap();
|
|
3830
|
-
_color$3 = /* @__PURE__ */ new WeakMap();
|
|
3831
|
-
__decorateElement$3(_init$3, 4, "vertical", _vertical_dec, Divider, _vertical);
|
|
3832
|
-
__decorateElement$3(_init$3, 4, "thickness", _thickness_dec, Divider, _thickness);
|
|
3833
|
-
__decorateElement$3(_init$3, 4, "color", _color_dec$3, Divider, _color$3);
|
|
3834
|
-
__decoratorMetadata$3(_init$3, Divider);
|
|
3835
|
-
__publicField$3(Divider, "tagName", "divider");
|
|
3836
|
-
__publicField$3(Divider, "styles", [styleVariables, colorCSS, style]);
|
|
3837
|
-
Divider.register();
|
|
3838
|
-
const cardStyle = ':host {\n display: block;\n\n --card-bg: var(--color-bg-subtle);\n --card-color: var(--color-text-subtle);\n --card-border: var(--color-border-subtle);\n --card-divider: var(--color-border-subtle);\n}\n\n:host([variant="faint"]) {\n --card-bg: var(--color-bg-subtle);\n --card-color: var(--color-text-subtle);\n --card-border: var(--color-border-subtle);\n --card-divider: var(--color-border-subtle);\n}\n\n:host([variant="subtle"]) {\n --card-border: transparent;\n --card-divider: transparent;\n}\n\n:host([variant="filled"]) {\n --card-bg: var(--color-solid);\n --card-color: var(--color-on-solid);\n --card-border: var(--color-solid);\n --card-divider: color-mix(in srgb, var(--color-solid), black 15%);\n}\n\n:host([variant="outlined"]) {\n --card-bg: transparent;\n --card-color: var(--color-text-subtle);\n --card-border: var(--color-border);\n --card-divider: var(--color-border-subtle);\n}\n\n.card {\n border: 1px solid var(--card-border);\n border-radius: 8px;\n background: var(--card-bg);\n color: var(--card-color);\n overflow: hidden;\n}\n\n.header,\n.footer {\n display: none;\n padding: 10px 16px;\n font-size: 14px;\n font-weight: 500;\n}\n\n:host([has-header]) .header {\n display: block;\n border-bottom: 1px solid var(--card-divider);\n}\n\n:host([has-footer]) .footer {\n display: block;\n border-top: 1px solid var(--card-divider);\n}\n\n.body {\n padding: 16px;\n}\n';
|
|
3839
|
-
var __create$2 = Object.create;
|
|
3840
|
-
var __defProp$2 = Object.defineProperty;
|
|
3841
|
-
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
3842
|
-
var __knownSymbol$2 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
3843
|
-
var __typeError$2 = (msg) => {
|
|
3844
|
-
throw TypeError(msg);
|
|
3845
|
-
};
|
|
3846
|
-
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3847
|
-
var __decoratorStart$2 = (base) => [, , , __create$2((base == null ? void 0 : base[__knownSymbol$2("metadata")]) ?? null)];
|
|
3848
|
-
var __decoratorStrings$2 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
3849
|
-
var __expectFn$2 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$2("Function expected") : fn;
|
|
3850
|
-
var __decoratorContext$2 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$2[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$2("Already initialized") : fns.push(__expectFn$2(fn || null)) });
|
|
3851
|
-
var __decoratorMetadata$2 = (array, target) => __defNormalProp$2(target, __knownSymbol$2("metadata"), array[3]);
|
|
3852
|
-
var __runInitializers$2 = (array, flags, self, value) => {
|
|
3853
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
3854
|
-
return value;
|
|
3855
|
-
};
|
|
3856
|
-
var __decorateElement$2 = (array, flags, name, decorators, target, extra) => {
|
|
3857
|
-
var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
|
|
3858
|
-
var j = array.length + 1, key = __decoratorStrings$2[k + 5];
|
|
3859
|
-
var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
|
|
3860
|
-
var desc = (target = target.prototype, __getOwnPropDesc$2({ get [name]() {
|
|
3861
|
-
return __privateGet$2(this, extra);
|
|
3862
|
-
}, set [name](x) {
|
|
3863
|
-
return __privateSet$2(this, extra, x);
|
|
3864
|
-
} }, name));
|
|
3865
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
3866
|
-
ctx = __decoratorContext$2(k, name, done = {}, array[3], extraInitializers);
|
|
3867
|
-
{
|
|
3868
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
|
|
3869
|
-
access.get = (x) => x[name];
|
|
3870
|
-
access.set = (x, y) => x[name] = y;
|
|
3871
|
-
}
|
|
3872
|
-
it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
|
|
3873
|
-
if (it === void 0) __expectFn$2(it) && (desc[key] = it);
|
|
3874
|
-
else if (typeof it !== "object" || it === null) __typeError$2("Object expected");
|
|
3875
|
-
else __expectFn$2(fn = it.get) && (desc.get = fn), __expectFn$2(fn = it.set) && (desc.set = fn), __expectFn$2(fn = it.init) && initializers.unshift(fn);
|
|
3876
|
-
}
|
|
3877
|
-
return desc && __defProp$2(target, name, desc), target;
|
|
3878
|
-
};
|
|
3879
|
-
var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3880
|
-
var __accessCheck$2 = (obj, member, msg) => member.has(obj) || __typeError$2("Cannot " + msg);
|
|
3881
|
-
var __privateGet$2 = (obj, member, getter) => (__accessCheck$2(obj, member, "read from private field"), member.get(obj));
|
|
3882
|
-
var __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
3883
|
-
var __privateSet$2 = (obj, member, value, setter) => (__accessCheck$2(obj, member, "write to private field"), member.set(obj, value), value);
|
|
3884
|
-
var _variant_dec$1, _color_dec$2, _a$2, _init$2, _color$2, _variant$1;
|
|
3885
|
-
class Card extends (_a$2 = AeicoComponent, _color_dec$2 = [prop({ type: String })], _variant_dec$1 = [prop({ type: String })], _a$2) {
|
|
3886
|
-
constructor() {
|
|
3887
|
-
super(...arguments);
|
|
3888
|
-
__privateAdd$2(this, _color$2, __runInitializers$2(_init$2, 8, this, "default")), __runInitializers$2(_init$2, 11, this);
|
|
3889
|
-
__privateAdd$2(this, _variant$1, __runInitializers$2(_init$2, 12, this, "filled")), __runInitializers$2(_init$2, 15, this);
|
|
3890
|
-
}
|
|
3891
|
-
render() {
|
|
3892
|
-
return html(({ div, header, footer, slot }) => {
|
|
3893
|
-
div({ className: "card", part: "card" }, () => {
|
|
3894
|
-
header({ className: "header", part: "header" }, () => {
|
|
3895
|
-
slot({ name: "header", "@slotchange": (e) => this._onHeaderSlotChange(e) });
|
|
3896
|
-
});
|
|
3897
|
-
div({ className: "body", part: "body" }, () => {
|
|
3898
|
-
slot();
|
|
3899
|
-
});
|
|
3900
|
-
footer({ className: "footer", part: "footer" }, () => {
|
|
3901
|
-
slot({ name: "footer", "@slotchange": (e) => this._onFooterSlotChange(e) });
|
|
3902
|
-
});
|
|
3903
|
-
});
|
|
3904
|
-
});
|
|
3905
|
-
}
|
|
3906
|
-
_onHeaderSlotChange(e) {
|
|
3907
|
-
const slot = e.target;
|
|
3908
|
-
this.toggleAttribute("has-header", slot.assignedNodes({ flatten: true }).length > 0);
|
|
3909
|
-
}
|
|
3910
|
-
_onFooterSlotChange(e) {
|
|
3911
|
-
const slot = e.target;
|
|
3912
|
-
this.toggleAttribute("has-footer", slot.assignedNodes({ flatten: true }).length > 0);
|
|
3913
|
-
}
|
|
3914
|
-
}
|
|
3915
|
-
_init$2 = __decoratorStart$2(_a$2);
|
|
3916
|
-
_color$2 = /* @__PURE__ */ new WeakMap();
|
|
3917
|
-
_variant$1 = /* @__PURE__ */ new WeakMap();
|
|
3918
|
-
__decorateElement$2(_init$2, 4, "color", _color_dec$2, Card, _color$2);
|
|
3919
|
-
__decorateElement$2(_init$2, 4, "variant", _variant_dec$1, Card, _variant$1);
|
|
3920
|
-
__decoratorMetadata$2(_init$2, Card);
|
|
3921
|
-
__publicField$2(Card, "tagName", "card");
|
|
3922
|
-
__publicField$2(Card, "styles", [styleVariables, colorCSS, cardStyle]);
|
|
3923
|
-
Card.register();
|
|
3924
|
-
const navbarStyle = ':host {\n /* layout — padding lives in .inner so document * { padding:0 } cannot override it */\n display: block;\n position: static;\n top: auto;\n z-index: var(--ae-navbar-z-index, 100);\n box-sizing: border-box;\n height: var(--ae-navbar-height, 3.25rem);\n border-radius: var(--ae-navbar-radius, 0);\n\n /* color */\n background: var(--ae-navbar-bg, var(--surface-base));\n color: var(--ae-navbar-color, var(--color-text-main));\n border-bottom: var(--ae-navbar-border-width, 1px) solid var(--ae-navbar-border-color, var(--border-default));\n box-shadow: var(--ae-navbar-shadow, none);\n\n /* layout tokens — declared here so they are clearly part of the public API */\n --ae-navbar-radius: 0;\n /* Default padding-x references the global layout token so ae-navbar content\n automatically aligns with .container / .container-fluid in light DOM.\n Override with --ae-navbar-padding-x to decouple if needed. */\n --ae-navbar-padding-x: var(--container-padding-x, 1.5rem);\n --ae-navbar-gap: 0.5rem;\n\n /* link style tokens — text mode defaults.\n CSS custom properties inherit into slotted content, so\n ::slotted(a[slot="start"]) can reference --ae-navbar-height. */\n --ae-navbar-link-color: inherit;\n --ae-navbar-link-font-size: inherit;\n --ae-navbar-link-padding-x: 0.75rem; /* horizontal padding only; height fills vertically */\n --ae-navbar-link-radius: 0;\n --ae-navbar-link-hover-color: var(--color-text-link-hover);\n --ae-navbar-link-hover-bg: transparent;\n --ae-navbar-link-active-color: var(--color-text-link);\n --ae-navbar-link-active-font-weight: 600;\n}\n\n:host([sticky]) {\n position: sticky;\n top: 0;\n}\n\n:host([color]) {\n --ae-navbar-bg: var(--color-solid);\n --ae-navbar-color: var(--color-on-solid);\n --ae-navbar-border-color: transparent;\n --ae-navbar-link-hover-color: var(--color-on-solid);\n --ae-navbar-link-active-color: var(--color-on-solid);\n}\n\n/* block preset: hover shows a subtle filled block */\n:host([appearance="block"]) {\n --ae-navbar-link-hover-bg: var(--color-bg-subtle);\n --ae-navbar-link-hover-color: inherit;\n}\n\n/* block preset on colored navbar: use semi-transparent white */\n:host([color][appearance="block"]) {\n --ae-navbar-link-hover-bg: rgba(255, 255, 255, 0.15);\n --ae-navbar-link-hover-color: var(--color-on-solid);\n}\n\n.inner {\n display: flex;\n align-items: center;\n height: 100%;\n padding: 0 var(--ae-navbar-padding-x);\n gap: var(--ae-navbar-gap);\n box-sizing: border-box;\n}\n\n[part="brand"] {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n}\n\n/* nav wraps start + end; takes all remaining space */\n[part="nav"] {\n flex: 1 1 auto;\n display: flex;\n align-self: stretch; /* stretch to host height so children can fill it */\n align-items: stretch;\n min-width: 0;\n}\n\n[part="start"],\n[part="end"] {\n flex: 0 0 auto;\n display: flex;\n align-self: stretch;\n}\n\n[part="start"] {\n align-items: stretch; /* slotted <a> will stretch to full height */\n gap: var(--ae-navbar-start-gap, 0);\n}\n\n[part="end"] {\n align-items: center; /* buttons / avatars stay vertically centred */\n gap: var(--ae-navbar-end-gap, 0.5rem);\n margin-left: auto;\n}\n\n/* hamburger — hidden on desktop */\n[part="hamburger"] {\n display: none;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n flex-shrink: 0;\n width: var(--ae-navbar-hamburger-size, 2rem);\n height: var(--ae-navbar-hamburger-size, 2rem);\n margin-left: auto;\n padding: 0;\n background: none;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n color: var(--ae-navbar-hamburger-color, inherit);\n}\n\n[part="hamburger"]:hover {\n background: color-mix(in srgb, currentColor 10%, transparent);\n}\n\n[part="hamburger"] span {\n display: block;\n width: 18px;\n height: 2px;\n background: currentColor;\n border-radius: 1px;\n transition: transform 0.2s ease, opacity 0.2s ease;\n}\n\n/* Brand link — sensible defaults, no full-height stretch */\n::slotted(a[slot="brand"]) {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-weight: 700;\n font-size: 1.05rem;\n text-decoration: none;\n white-space: nowrap;\n}\n\n/* Nav links (start / end slots) — fill full navbar height for block hover effect */\n::slotted(a[slot="start"]),\n::slotted(a[slot="end"]) {\n display: inline-flex;\n align-items: center;\n height: var(--ae-navbar-height, 3.25rem); /* full-height hover area */\n /* !important overrides document-level * { padding: 0 } reset */\n padding: 0 var(--ae-navbar-link-padding-x) !important;\n border-radius: var(--ae-navbar-link-radius);\n color: var(--ae-navbar-link-color);\n font-size: var(--ae-navbar-link-font-size);\n text-decoration: none;\n white-space: nowrap;\n transition: color 0.15s ease, background-color 0.15s ease;\n outline-offset: 2px;\n}\n\n::slotted(a[slot="start"]:hover),\n::slotted(a[slot="end"]:hover) {\n color: var(--ae-navbar-link-hover-color);\n background-color: var(--ae-navbar-link-hover-bg);\n}\n\n::slotted(a[slot="start"][aria-current="page"]),\n::slotted(a[slot="end"][aria-current="page"]) {\n color: var(--ae-navbar-link-active-color);\n font-weight: var(--ae-navbar-link-active-font-weight);\n}\n\n/* ae-dropdown inside navbar — map navbar tokens to dropdown trigger API */\n::slotted(ae-dropdown) {\n align-self: stretch;\n --dropdown-trigger-height: 100%;\n --dropdown-trigger-padding-x: var(--ae-navbar-link-padding-x);\n --dropdown-trigger-color: var(--ae-navbar-link-color);\n --dropdown-trigger-bg: none;\n --dropdown-trigger-radius: var(--ae-navbar-link-radius);\n --dropdown-trigger-font-size: var(--ae-navbar-link-font-size);\n --dropdown-trigger-hover-color: var(--ae-navbar-link-hover-color);\n --dropdown-trigger-hover-bg: var(--ae-navbar-link-hover-bg);\n}\n\n@media (max-width: 768px) {\n /* collapse the nav container */\n [part="nav"] {\n display: none;\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n flex-direction: column;\n align-items: stretch;\n gap: 0;\n padding: 0.5rem 0;\n background: var(--ae-navbar-mobile-bg, var(--ae-navbar-bg, var(--surface-base)));\n border-bottom: 1px solid var(--ae-navbar-border-color, var(--border-default));\n box-shadow: var(--ae-navbar-mobile-shadow, 0 4px 12px rgba(0, 0, 0, 0.1));\n z-index: 1;\n }\n\n :host([open]) [part="nav"] {\n display: flex;\n }\n\n /* stack start/end vertically inside the panel */\n [part="start"],\n [part="end"] {\n flex-direction: column;\n align-items: flex-start;\n align-self: auto;\n gap: 0;\n margin-left: 0;\n width: 100%;\n }\n\n /* Mobile: links revert to auto height and add vertical padding */\n ::slotted(a[slot="start"]),\n ::slotted(a[slot="end"]) {\n height: auto;\n width: 100%;\n padding: 0.75rem var(--ae-navbar-link-padding-x);\n border-radius: 0;\n }\n\n /* show hamburger */\n [part="hamburger"] {\n display: flex;\n }\n\n /* hamburger → × animation */\n :host([open]) [part="hamburger"] span:nth-child(1) {\n transform: translateY(7px) rotate(45deg);\n }\n\n :host([open]) [part="hamburger"] span:nth-child(2) {\n opacity: 0;\n transform: scaleX(0);\n }\n\n :host([open]) [part="hamburger"] span:nth-child(3) {\n transform: translateY(-7px) rotate(-45deg);\n }\n}\n';
|
|
3925
|
-
var __create$1 = Object.create;
|
|
3926
|
-
var __defProp$1 = Object.defineProperty;
|
|
3927
|
-
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
3928
|
-
var __knownSymbol$1 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
3929
|
-
var __typeError$1 = (msg) => {
|
|
3930
|
-
throw TypeError(msg);
|
|
3931
|
-
};
|
|
3932
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3933
|
-
var __decoratorStart$1 = (base) => [, , , __create$1((base == null ? void 0 : base[__knownSymbol$1("metadata")]) ?? null)];
|
|
3934
|
-
var __decoratorStrings$1 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
3935
|
-
var __expectFn$1 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$1("Function expected") : fn;
|
|
3936
|
-
var __decoratorContext$1 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$1[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$1("Already initialized") : fns.push(__expectFn$1(fn || null)) });
|
|
3937
|
-
var __decoratorMetadata$1 = (array, target) => __defNormalProp$1(target, __knownSymbol$1("metadata"), array[3]);
|
|
3938
|
-
var __runInitializers$1 = (array, flags, self, value) => {
|
|
3939
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
3940
|
-
return value;
|
|
3941
|
-
};
|
|
3942
|
-
var __decorateElement$1 = (array, flags, name, decorators, target, extra) => {
|
|
3943
|
-
var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
|
|
3944
|
-
var j = array.length + 1, key = __decoratorStrings$1[k + 5];
|
|
3945
|
-
var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
|
|
3946
|
-
var desc = (target = target.prototype, __getOwnPropDesc$1({ get [name]() {
|
|
3947
|
-
return __privateGet$1(this, extra);
|
|
3948
|
-
}, set [name](x) {
|
|
3949
|
-
return __privateSet$1(this, extra, x);
|
|
3950
|
-
} }, name));
|
|
3951
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
3952
|
-
ctx = __decoratorContext$1(k, name, done = {}, array[3], extraInitializers);
|
|
3953
|
-
{
|
|
3954
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
|
|
3955
|
-
access.get = (x) => x[name];
|
|
3956
|
-
access.set = (x, y) => x[name] = y;
|
|
3957
|
-
}
|
|
3958
|
-
it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
|
|
3959
|
-
if (it === void 0) __expectFn$1(it) && (desc[key] = it);
|
|
3960
|
-
else if (typeof it !== "object" || it === null) __typeError$1("Object expected");
|
|
3961
|
-
else __expectFn$1(fn = it.get) && (desc.get = fn), __expectFn$1(fn = it.set) && (desc.set = fn), __expectFn$1(fn = it.init) && initializers.unshift(fn);
|
|
3962
|
-
}
|
|
3963
|
-
return desc && __defProp$1(target, name, desc), target;
|
|
3964
|
-
};
|
|
3965
|
-
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3966
|
-
var __accessCheck$1 = (obj, member, msg) => member.has(obj) || __typeError$1("Cannot " + msg);
|
|
3967
|
-
var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "read from private field"), member.get(obj));
|
|
3968
|
-
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
3969
|
-
var __privateSet$1 = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
3970
|
-
var _open_dec, _appearance_dec, _sticky_dec, _color_dec$1, _a$1, _init$1, _color$1, _sticky, _appearance, _open;
|
|
3971
|
-
class Navbar extends (_a$1 = AeicoComponent, _color_dec$1 = [prop({ type: String })], _sticky_dec = [prop({ type: Boolean })], _appearance_dec = [prop({ type: String })], _open_dec = [prop({ type: Boolean })], _a$1) {
|
|
3972
|
-
constructor() {
|
|
3973
|
-
super(...arguments);
|
|
3974
|
-
__privateAdd$1(this, _color$1, __runInitializers$1(_init$1, 8, this)), __runInitializers$1(_init$1, 11, this);
|
|
3975
|
-
__privateAdd$1(this, _sticky, __runInitializers$1(_init$1, 12, this, false)), __runInitializers$1(_init$1, 15, this);
|
|
3976
|
-
__privateAdd$1(this, _appearance, __runInitializers$1(_init$1, 16, this, "text")), __runInitializers$1(_init$1, 19, this);
|
|
3977
|
-
__privateAdd$1(this, _open, __runInitializers$1(_init$1, 20, this, false)), __runInitializers$1(_init$1, 23, this);
|
|
3978
|
-
__publicField$1(this, "_outsideClickHandler", null);
|
|
3979
|
-
__publicField$1(this, "_handleInnerClick", (e) => {
|
|
3980
|
-
if (!this.open) return;
|
|
3981
|
-
const path = e.composedPath();
|
|
3982
|
-
if (path.some((el) => el.tagName === "A")) {
|
|
3983
|
-
this._closeMenu();
|
|
3984
|
-
}
|
|
3985
|
-
});
|
|
3986
|
-
__publicField$1(this, "_toggleMenu", () => {
|
|
3987
|
-
this.open = !this.open;
|
|
3988
|
-
});
|
|
3989
|
-
__publicField$1(this, "_closeMenu", () => {
|
|
3990
|
-
if (this.open) this.open = false;
|
|
3991
|
-
});
|
|
3992
|
-
}
|
|
3993
|
-
connectedCallback() {
|
|
3994
|
-
super.connectedCallback();
|
|
3995
|
-
this.listen("click", this._handleInnerClick);
|
|
3996
|
-
this._outsideClickHandler = (e) => {
|
|
3997
|
-
var _a2;
|
|
3998
|
-
if (!this.contains(e.target) && !((_a2 = this.shadowRoot) == null ? void 0 : _a2.contains(e.target))) {
|
|
3999
|
-
this._closeMenu();
|
|
4000
|
-
}
|
|
4001
|
-
};
|
|
4002
|
-
document.addEventListener("click", this._outsideClickHandler);
|
|
4003
|
-
}
|
|
4004
|
-
disconnectedCallback() {
|
|
4005
|
-
super.disconnectedCallback();
|
|
4006
|
-
if (this._outsideClickHandler) {
|
|
4007
|
-
document.removeEventListener("click", this._outsideClickHandler);
|
|
4008
|
-
this._outsideClickHandler = null;
|
|
4009
|
-
}
|
|
4010
|
-
}
|
|
4011
|
-
/** Toggle the mobile menu open/closed. */
|
|
4012
|
-
toggleMenu() {
|
|
4013
|
-
this.open = !this.open;
|
|
4014
|
-
}
|
|
4015
|
-
render() {
|
|
4016
|
-
return html(({ div, nav, button, span, slot }) => {
|
|
4017
|
-
div({ class: "inner" }, () => {
|
|
4018
|
-
div({ part: "brand" }, () => {
|
|
4019
|
-
slot({ name: "brand" });
|
|
4020
|
-
});
|
|
4021
|
-
nav({ part: "nav", "aria-label": "Main navigation" }, () => {
|
|
4022
|
-
div({ part: "start" }, () => {
|
|
4023
|
-
slot({ name: "start" });
|
|
4024
|
-
});
|
|
4025
|
-
div({ part: "end" }, () => {
|
|
4026
|
-
slot({ name: "end" });
|
|
4027
|
-
});
|
|
4028
|
-
});
|
|
4029
|
-
button(
|
|
4030
|
-
{
|
|
4031
|
-
part: "hamburger",
|
|
4032
|
-
type: "button",
|
|
4033
|
-
"aria-expanded": String(this.open),
|
|
4034
|
-
"aria-label": "Toggle navigation",
|
|
4035
|
-
"@click": this._toggleMenu
|
|
4036
|
-
},
|
|
4037
|
-
() => {
|
|
4038
|
-
span({ "aria-hidden": "true" });
|
|
4039
|
-
span({ "aria-hidden": "true" });
|
|
4040
|
-
span({ "aria-hidden": "true" });
|
|
4041
|
-
}
|
|
4042
|
-
);
|
|
4043
|
-
});
|
|
4044
|
-
});
|
|
4045
|
-
}
|
|
4046
|
-
}
|
|
4047
|
-
_init$1 = __decoratorStart$1(_a$1);
|
|
4048
|
-
_color$1 = /* @__PURE__ */ new WeakMap();
|
|
4049
|
-
_sticky = /* @__PURE__ */ new WeakMap();
|
|
4050
|
-
_appearance = /* @__PURE__ */ new WeakMap();
|
|
4051
|
-
_open = /* @__PURE__ */ new WeakMap();
|
|
4052
|
-
__decorateElement$1(_init$1, 4, "color", _color_dec$1, Navbar, _color$1);
|
|
4053
|
-
__decorateElement$1(_init$1, 4, "sticky", _sticky_dec, Navbar, _sticky);
|
|
4054
|
-
__decorateElement$1(_init$1, 4, "appearance", _appearance_dec, Navbar, _appearance);
|
|
4055
|
-
__decorateElement$1(_init$1, 4, "open", _open_dec, Navbar, _open);
|
|
4056
|
-
__decoratorMetadata$1(_init$1, Navbar);
|
|
4057
|
-
__publicField$1(Navbar, "tagName", "navbar");
|
|
4058
|
-
__publicField$1(Navbar, "styles", [styleVariables, colorCSS, navbarStyle]);
|
|
4059
|
-
Navbar.register();
|
|
4060
|
-
const detailStyle = ':host {\n display: block;\n\n --detail-bg: var(--color-solid);\n --detail-color: var(--color-on-solid);\n --detail-border: var(--color-solid);\n --detail-header-bg: color-mix(in srgb, var(--color-solid), black 10%);\n --detail-radius: 6px;\n}\n\n:host([variant="faint"]) {\n --detail-bg: var(--color-bg-subtle);\n --detail-color: var(--color-text-subtle);\n --detail-border: var(--color-border-subtle);\n --detail-header-bg: var(--color-bg-subtle);\n}\n\n:host([variant="subtle"]) {\n --detail-bg: transparent;\n --detail-color: var(--color-text-main);\n --detail-border: transparent;\n --detail-header-bg: transparent;\n}\n\n:host([variant="filled"]) {\n --detail-bg: var(--color-solid);\n --detail-color: var(--color-on-solid);\n --detail-border: var(--color-solid);\n --detail-header-bg: color-mix(in srgb, var(--color-solid), black 10%);\n}\n\n:host([variant="outlined"]) {\n --detail-bg: transparent;\n --detail-color: var(--color-text-subtle);\n --detail-border: var(--color-border);\n --detail-header-bg: transparent;\n}\n\n:host([disabled]) {\n opacity: 0.5;\n pointer-events: none;\n}\n\n.detail {\n border: 1px solid var(--detail-border);\n border-radius: var(--detail-radius);\n color: var(--detail-color);\n background: var(--detail-bg);\n overflow: hidden;\n}\n\n.summary {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 10px 14px;\n background: var(--detail-header-bg);\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n font-weight: 500;\n border: none;\n cursor: pointer;\n text-align: left;\n outline-offset: -2px;\n user-select: none;\n}\n\n.summary:hover {\n filter: brightness(0.93);\n}\n\n.summary:focus-visible {\n outline: 2px solid var(--color-border);\n}\n\nslot[name="summary"] {\n display: flex;\n align-items: center;\n flex: 1;\n min-width: 0;\n}\n\n.label {\n flex: 1;\n}\n\nslot[name="expand"],\nslot[name="collapse"] {\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n}\n\nslot[name="collapse"] {\n display: none;\n}\n\n:host([open]) slot[name="expand"] {\n display: none;\n}\n\n:host([open]) slot[name="collapse"] {\n display: inline-flex;\n}\n\n.content-outer {\n display: grid;\n grid-template-rows: 0fr;\n transition: grid-template-rows 0.25s ease;\n}\n\n:host([open]) .content-outer {\n grid-template-rows: 1fr;\n}\n\n.content {\n overflow: hidden;\n padding: 0 14px;\n transition: padding 0.25s ease;\n}\n\n:host([open]) .content {\n padding: 12px 14px;\n}\n\n';
|
|
4061
|
-
var __create = Object.create;
|
|
4062
|
-
var __defProp2 = Object.defineProperty;
|
|
4063
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4064
|
-
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
4065
|
-
var __typeError = (msg) => {
|
|
4066
|
-
throw TypeError(msg);
|
|
4067
|
-
};
|
|
4068
|
-
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4069
|
-
var __decoratorStart = (base) => [, , , __create((base == null ? void 0 : base[__knownSymbol("metadata")]) ?? null)];
|
|
4070
|
-
var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
4071
|
-
var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
|
|
4072
|
-
var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
|
|
4073
|
-
var __decoratorMetadata = (array, target) => __defNormalProp2(target, __knownSymbol("metadata"), array[3]);
|
|
4074
|
-
var __runInitializers = (array, flags, self, value) => {
|
|
4075
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
4076
|
-
return value;
|
|
4077
|
-
};
|
|
4078
|
-
var __decorateElement = (array, flags, name, decorators, target, extra) => {
|
|
4079
|
-
var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
|
|
4080
|
-
var j = array.length + 1, key = __decoratorStrings[k + 5];
|
|
4081
|
-
var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
|
|
4082
|
-
var desc = (target = target.prototype, __getOwnPropDesc({ get [name]() {
|
|
4083
|
-
return __privateGet(this, extra);
|
|
4084
|
-
}, set [name](x) {
|
|
4085
|
-
return __privateSet(this, extra, x);
|
|
4086
|
-
} }, name));
|
|
4087
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
4088
|
-
ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
|
|
4089
|
-
{
|
|
4090
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
|
|
4091
|
-
access.get = (x) => x[name];
|
|
4092
|
-
access.set = (x, y) => x[name] = y;
|
|
4093
|
-
}
|
|
4094
|
-
it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
|
|
4095
|
-
if (it === void 0) __expectFn(it) && (desc[key] = it);
|
|
4096
|
-
else if (typeof it !== "object" || it === null) __typeError("Object expected");
|
|
4097
|
-
else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
|
|
4098
|
-
}
|
|
4099
|
-
return desc && __defProp2(target, name, desc), target;
|
|
4100
|
-
};
|
|
4101
|
-
var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4102
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
4103
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), member.get(obj));
|
|
4104
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
4105
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
4106
|
-
var _disabled_dec, _color_dec, _variant_dec, _summary_dec, _a, _init, _summary, _variant, _color, _disabled;
|
|
4107
|
-
class Detail extends (_a = AeicoComponent, _summary_dec = [prop({ type: String })], _variant_dec = [prop({ type: String })], _color_dec = [prop({ type: String })], _disabled_dec = [prop({ type: Boolean })], _a) {
|
|
4108
|
-
constructor() {
|
|
4109
|
-
super(...arguments);
|
|
4110
|
-
__privateAdd(this, _summary, __runInitializers(_init, 8, this, "")), __runInitializers(_init, 11, this);
|
|
4111
|
-
__privateAdd(this, _variant, __runInitializers(_init, 12, this, "filled")), __runInitializers(_init, 15, this);
|
|
4112
|
-
__privateAdd(this, _color, __runInitializers(_init, 16, this, "default")), __runInitializers(_init, 19, this);
|
|
4113
|
-
__privateAdd(this, _disabled, __runInitializers(_init, 20, this, false)), __runInitializers(_init, 23, this);
|
|
4114
|
-
__publicField2(this, "_open", false);
|
|
4115
|
-
__publicField2(this, "_handleSummaryClick", () => {
|
|
4116
|
-
this.toggle();
|
|
4117
|
-
});
|
|
4118
|
-
}
|
|
4119
|
-
/** Opens the detail panel. */
|
|
4120
|
-
open() {
|
|
4121
|
-
if (this.disabled || this._open) return;
|
|
4122
|
-
this._open = true;
|
|
4123
|
-
this.toggleAttribute("open", true);
|
|
4124
|
-
this.update();
|
|
4125
|
-
this.emit("open");
|
|
4126
|
-
}
|
|
4127
|
-
/** Closes the detail panel. */
|
|
4128
|
-
close() {
|
|
4129
|
-
if (!this._open) return;
|
|
4130
|
-
this._open = false;
|
|
4131
|
-
this.toggleAttribute("open", false);
|
|
4132
|
-
this.update();
|
|
4133
|
-
this.emit("close");
|
|
4134
|
-
}
|
|
4135
|
-
/** Toggles the detail panel open/closed. */
|
|
4136
|
-
toggle() {
|
|
4137
|
-
if (this._open) {
|
|
4138
|
-
this.close();
|
|
4139
|
-
} else {
|
|
4140
|
-
this.open();
|
|
4141
|
-
}
|
|
4142
|
-
}
|
|
4143
|
-
/** Returns whether the detail panel is currently open. */
|
|
4144
|
-
isOpen() {
|
|
4145
|
-
return this._open;
|
|
4146
|
-
}
|
|
4147
|
-
render() {
|
|
4148
|
-
return html(({ div, button, span, slot }) => {
|
|
4149
|
-
div({ className: "detail", part: "detail" }, () => {
|
|
4150
|
-
button(
|
|
4151
|
-
{
|
|
4152
|
-
className: "summary",
|
|
4153
|
-
part: "summary",
|
|
4154
|
-
type: "button",
|
|
4155
|
-
"aria-expanded": String(this._open),
|
|
4156
|
-
disabled: this.disabled || void 0,
|
|
4157
|
-
"@click": this._handleSummaryClick
|
|
4158
|
-
},
|
|
4159
|
-
() => {
|
|
4160
|
-
slot({ name: "summary" }, () => {
|
|
4161
|
-
span({ className: "label", textContent: this.summary });
|
|
4162
|
-
});
|
|
4163
|
-
slot({ name: "expand" });
|
|
4164
|
-
slot({ name: "collapse" });
|
|
4165
|
-
}
|
|
4166
|
-
);
|
|
4167
|
-
div({ className: "content-outer" }, () => {
|
|
4168
|
-
div(
|
|
4169
|
-
{
|
|
4170
|
-
className: "content",
|
|
4171
|
-
part: "content",
|
|
4172
|
-
role: "region"
|
|
4173
|
-
},
|
|
4174
|
-
() => {
|
|
4175
|
-
slot();
|
|
4176
|
-
}
|
|
4177
|
-
);
|
|
4178
|
-
});
|
|
4179
|
-
});
|
|
4180
|
-
});
|
|
4181
|
-
}
|
|
4182
|
-
}
|
|
4183
|
-
_init = __decoratorStart(_a);
|
|
4184
|
-
_summary = /* @__PURE__ */ new WeakMap();
|
|
4185
|
-
_variant = /* @__PURE__ */ new WeakMap();
|
|
4186
|
-
_color = /* @__PURE__ */ new WeakMap();
|
|
4187
|
-
_disabled = /* @__PURE__ */ new WeakMap();
|
|
4188
|
-
__decorateElement(_init, 4, "summary", _summary_dec, Detail, _summary);
|
|
4189
|
-
__decorateElement(_init, 4, "variant", _variant_dec, Detail, _variant);
|
|
4190
|
-
__decorateElement(_init, 4, "color", _color_dec, Detail, _color);
|
|
4191
|
-
__decorateElement(_init, 4, "disabled", _disabled_dec, Detail, _disabled);
|
|
4192
|
-
__decoratorMetadata(_init, Detail);
|
|
4193
|
-
__publicField2(Detail, "tagName", "detail");
|
|
4194
|
-
__publicField2(Detail, "styles", [styleVariables, colorCSS, detailStyle]);
|
|
4195
|
-
Detail.register();
|
|
1
|
+
import { T } from "./chunks/text-input.js";
|
|
2
|
+
import { S } from "./chunks/select.js";
|
|
3
|
+
import { S as S2 } from "./chunks/slider.js";
|
|
4
|
+
import { C } from "./chunks/checkbox.js";
|
|
5
|
+
import { R, a } from "./chunks/radio.js";
|
|
6
|
+
import { S as S3 } from "./chunks/switch.js";
|
|
7
|
+
import { B, a as a2 } from "./chunks/breadcrumb-item.js";
|
|
8
|
+
import { B as B2 } from "./chunks/button.js";
|
|
9
|
+
import { D, a as a3, b } from "./chunks/dropdown-button.js";
|
|
10
|
+
import { B as B3 } from "./chunks/button-group.js";
|
|
11
|
+
import { B as B4 } from "./chunks/badge.js";
|
|
12
|
+
import { T as T2 } from "./chunks/tag.js";
|
|
13
|
+
import { A } from "./chunks/alert.js";
|
|
14
|
+
import { D as D2 } from "./chunks/dialog.js";
|
|
15
|
+
import { I, a as a4 } from "./chunks/icon.js";
|
|
16
|
+
import { I as I2 } from "./chunks/icon-button.js";
|
|
17
|
+
import { T as T3, a as a5, b as b2 } from "./chunks/tab-panel.js";
|
|
18
|
+
import { D as D3 } from "./chunks/divider.js";
|
|
19
|
+
import { C as C2 } from "./chunks/card.js";
|
|
20
|
+
import { N } from "./chunks/navbar.js";
|
|
21
|
+
import { D as D4 } from "./chunks/detail.js";
|
|
4196
22
|
export {
|
|
4197
|
-
Alert,
|
|
4198
|
-
Badge,
|
|
4199
|
-
Breadcrumb,
|
|
4200
|
-
BreadcrumbItem,
|
|
4201
|
-
Button,
|
|
4202
|
-
ButtonGroup,
|
|
4203
|
-
Card,
|
|
4204
|
-
Checkbox,
|
|
4205
|
-
Detail,
|
|
4206
|
-
Dialog,
|
|
4207
|
-
Divider,
|
|
4208
|
-
Dropdown,
|
|
4209
|
-
DropdownButton,
|
|
4210
|
-
DropdownItem,
|
|
4211
|
-
Icon,
|
|
4212
|
-
IconButton,
|
|
4213
|
-
IconRegistry,
|
|
4214
|
-
Navbar,
|
|
4215
|
-
Radio,
|
|
4216
|
-
RadioGroup,
|
|
4217
|
-
Select,
|
|
4218
|
-
Slider,
|
|
4219
|
-
Switch,
|
|
4220
|
-
Tab,
|
|
4221
|
-
TabPanel,
|
|
4222
|
-
Tabs,
|
|
4223
|
-
Tag,
|
|
4224
|
-
TextInput
|
|
23
|
+
A as Alert,
|
|
24
|
+
B4 as Badge,
|
|
25
|
+
B as Breadcrumb,
|
|
26
|
+
a2 as BreadcrumbItem,
|
|
27
|
+
B2 as Button,
|
|
28
|
+
B3 as ButtonGroup,
|
|
29
|
+
C2 as Card,
|
|
30
|
+
C as Checkbox,
|
|
31
|
+
D4 as Detail,
|
|
32
|
+
D2 as Dialog,
|
|
33
|
+
D3 as Divider,
|
|
34
|
+
D as Dropdown,
|
|
35
|
+
a3 as DropdownButton,
|
|
36
|
+
b as DropdownItem,
|
|
37
|
+
I as Icon,
|
|
38
|
+
I2 as IconButton,
|
|
39
|
+
a4 as IconRegistry,
|
|
40
|
+
N as Navbar,
|
|
41
|
+
R as Radio,
|
|
42
|
+
a as RadioGroup,
|
|
43
|
+
S as Select,
|
|
44
|
+
S2 as Slider,
|
|
45
|
+
S3 as Switch,
|
|
46
|
+
T3 as Tab,
|
|
47
|
+
a5 as TabPanel,
|
|
48
|
+
b2 as Tabs,
|
|
49
|
+
T2 as Tag,
|
|
50
|
+
T as TextInput
|
|
4225
51
|
};
|
|
4226
52
|
//# sourceMappingURL=index.js.map
|