agnosticui-core 2.0.0-alpha.21 → 2.0.0-alpha.23
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/components/Checkbox/core/_Checkbox.d.ts +6 -0
- package/dist/components/Checkbox/core/_Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/core/_Checkbox.js +44 -36
- package/dist/components/Combobox/core/_Combobox.d.ts +19 -0
- package/dist/components/Combobox/core/_Combobox.d.ts.map +1 -1
- package/dist/components/Combobox/core/_Combobox.js +154 -122
- package/dist/components/Combobox/vue/VueCombobox.vue.d.ts +1 -1
- package/dist/components/Dialog/core/_dialog.d.ts.map +1 -1
- package/dist/components/Dialog/core/_dialog.js +176 -166
- package/dist/components/Dialog/react/ReactDialog.d.ts +27 -8
- package/dist/components/Dialog/react/ReactDialog.d.ts.map +1 -1
- package/dist/components/Dialog/react/ReactDialog.js +32 -10
- package/dist/components/Drawer/react/ReactDrawer.d.ts +27 -8
- package/dist/components/Drawer/react/ReactDrawer.d.ts.map +1 -1
- package/dist/components/Drawer/react/ReactDrawer.js +31 -9
- package/dist/components/Input/core/_Input.d.ts +19 -0
- package/dist/components/Input/core/_Input.d.ts.map +1 -1
- package/dist/components/Input/core/_Input.js +34 -9
- package/dist/components/Radio/core/_Radio.d.ts +5 -0
- package/dist/components/Radio/core/_Radio.d.ts.map +1 -1
- package/dist/components/Radio/core/_Radio.js +38 -31
- package/dist/components/Rating/core/_Rating.d.ts +18 -0
- package/dist/components/Rating/core/_Rating.d.ts.map +1 -1
- package/dist/components/Rating/core/_Rating.js +90 -68
- package/dist/components/Select/core/_Select.d.ts +19 -0
- package/dist/components/Select/core/_Select.d.ts.map +1 -1
- package/dist/components/Select/core/_Select.js +102 -65
- package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.d.ts +18 -0
- package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.d.ts.map +1 -1
- package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.js +54 -32
- package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.d.ts +18 -0
- package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.d.ts.map +1 -1
- package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.js +61 -39
- package/dist/components/Slider/core/_Slider.d.ts +20 -0
- package/dist/components/Slider/core/_Slider.d.ts.map +1 -1
- package/dist/components/Slider/core/_Slider.js +132 -104
- package/dist/components/Toggle/core/_Toggle.d.ts +6 -0
- package/dist/components/Toggle/core/_Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/core/_Toggle.js +94 -86
- package/dist/shared/face-mixin.d.ts +5 -0
- package/dist/shared/face-mixin.d.ts.map +1 -1
- package/dist/shared/face-mixin.js +39 -25
- package/package.json +1 -1
- package/src/components/Checkbox/core/_Checkbox.ts +16 -0
- package/src/components/Combobox/core/_Combobox.ts +53 -0
- package/src/components/Dialog/core/_dialog.ts +19 -2
- package/src/components/Dialog/react/ReactDialog.tsx +60 -3
- package/src/components/Drawer/react/ReactDrawer.tsx +60 -3
- package/src/components/Input/core/_Input.ts +47 -0
- package/src/components/Radio/core/_Radio.ts +14 -0
- package/src/components/Rating/core/_Rating.ts +42 -0
- package/src/components/Select/core/_Select.ts +57 -0
- package/src/components/SelectionButtonGroup/core/_SelectionButtonGroup.ts +48 -0
- package/src/components/SelectionCardGroup/core/_SelectionCardGroup.ts +48 -0
- package/src/components/Slider/core/_Slider.ts +53 -0
- package/src/components/Toggle/core/_Toggle.ts +15 -0
- package/src/shared/face-mixin.ts +48 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement as f, css as x, nothing as
|
|
1
|
+
import { LitElement as f, css as x, nothing as p, html as l } from "lit";
|
|
2
2
|
import { n as a } from "../../../property-CemaeiRl.js";
|
|
3
3
|
import { r as b } from "../../../state-CovhUvdr.js";
|
|
4
4
|
import { e as u } from "../../../query-BykXNUlT.js";
|
|
@@ -8,10 +8,10 @@ import { formControlStyles as I } from "../../../shared/form-control-styles.js";
|
|
|
8
8
|
import "../../shared/CloseButton/CloseButton.js";
|
|
9
9
|
import "../../Checkbox/core/Checkbox.js";
|
|
10
10
|
import "../../Tag/core/Tag.js";
|
|
11
|
-
var k = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, s = (m, e, t,
|
|
12
|
-
for (var
|
|
13
|
-
(c = m[
|
|
14
|
-
return
|
|
11
|
+
var k = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, s = (m, e, t, i) => {
|
|
12
|
+
for (var n = i > 1 ? void 0 : i ? $(e, t) : e, r = m.length - 1, c; r >= 0; r--)
|
|
13
|
+
(c = m[r]) && (n = (i ? c(e, t, n) : c(n)) || n);
|
|
14
|
+
return i && n && k(e, t, n), n;
|
|
15
15
|
};
|
|
16
16
|
const g = class g extends y(f) {
|
|
17
17
|
constructor() {
|
|
@@ -38,17 +38,17 @@ const g = class g extends y(f) {
|
|
|
38
38
|
willUpdate(e) {
|
|
39
39
|
if (super.willUpdate(e), !this._isDefaultValueInitialized && this.defaultValue && this.options.length > 0) {
|
|
40
40
|
const t = Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue];
|
|
41
|
-
this._selectedOptions = this.options.filter((
|
|
41
|
+
this._selectedOptions = this.options.filter((i) => t.includes(i.value)), this._selectionChanged(), this._isDefaultValueInitialized = !0;
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
if (e.has("value") && (this._isDefaultValueInitialized || !this.defaultValue)) {
|
|
45
|
-
const t = this.value,
|
|
46
|
-
this._selectedOptions = this.options.filter((
|
|
45
|
+
const t = this.value, i = Array.isArray(t) ? t : t ? [t] : [];
|
|
46
|
+
this._selectedOptions = this.options.filter((n) => i.includes(n.value)), this._selectionChanged();
|
|
47
47
|
}
|
|
48
48
|
e.has("errorMessage") && (this.invalid = !!this.errorMessage);
|
|
49
49
|
}
|
|
50
50
|
updated(e) {
|
|
51
|
-
super.updated(e), e.has("value") && (this._syncFormValue(), this._syncValidity());
|
|
51
|
+
super.updated(e), e.has("value") && (this._syncFormValue(), this._syncValidity()), (e.has("disabled") || e.has("readonly") || e.has("required") || e.has("value")) && this._syncStates();
|
|
52
52
|
}
|
|
53
53
|
// Public methods
|
|
54
54
|
focus() {
|
|
@@ -71,9 +71,9 @@ const g = class g extends y(f) {
|
|
|
71
71
|
if (!this._open) return;
|
|
72
72
|
if (this._open = !1, this._activeIndex = -1, this.multiple)
|
|
73
73
|
this._searchTerm = this._displayLabel;
|
|
74
|
-
else if (!this.options.some((
|
|
75
|
-
const
|
|
76
|
-
|
|
74
|
+
else if (!this.options.some((i) => i.label === this._searchTerm)) {
|
|
75
|
+
const i = this._selectedOptions[0];
|
|
76
|
+
i ? this._searchTerm = i.label : this._searchTerm = "";
|
|
77
77
|
}
|
|
78
78
|
this.removeAttribute("open");
|
|
79
79
|
const e = new CustomEvent("close", {
|
|
@@ -89,12 +89,12 @@ const g = class g extends y(f) {
|
|
|
89
89
|
selectOption(e) {
|
|
90
90
|
let t;
|
|
91
91
|
if (typeof e == "string") {
|
|
92
|
-
if (t = this.options.find((
|
|
92
|
+
if (t = this.options.find((r) => r.value === e), !t) return;
|
|
93
93
|
} else
|
|
94
94
|
t = e;
|
|
95
95
|
if (t.disabled) return;
|
|
96
96
|
this.multiple ? (this._selectedOptions.findIndex((c) => c.value === t.value) > -1 ? this._selectedOptions = this._selectedOptions.filter((c) => c.value !== t.value) : this._selectedOptions = [...this._selectedOptions, t], this._selectionChanged()) : (this._selectedOptions = [t], this._selectionChanged(), this.closeOnSelect && this.close()), this._inputElement && (this._inputElement.value = this._searchTerm);
|
|
97
|
-
const
|
|
97
|
+
const i = new CustomEvent("select", {
|
|
98
98
|
detail: {
|
|
99
99
|
option: t,
|
|
100
100
|
value: t.value
|
|
@@ -102,8 +102,8 @@ const g = class g extends y(f) {
|
|
|
102
102
|
bubbles: !0,
|
|
103
103
|
composed: !0
|
|
104
104
|
});
|
|
105
|
-
this.dispatchEvent(
|
|
106
|
-
const
|
|
105
|
+
this.dispatchEvent(i), this.onSelect?.(i), this._syncFormValue(), this._syncValidity();
|
|
106
|
+
const n = new CustomEvent("change", {
|
|
107
107
|
detail: {
|
|
108
108
|
value: this.value,
|
|
109
109
|
// Use the updated value
|
|
@@ -112,11 +112,11 @@ const g = class g extends y(f) {
|
|
|
112
112
|
bubbles: !0,
|
|
113
113
|
composed: !0
|
|
114
114
|
});
|
|
115
|
-
this.dispatchEvent(
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const c =
|
|
119
|
-
|
|
115
|
+
this.dispatchEvent(n), this.onChange?.(n), this._justSelected = !0, this._inputElement?.focus(), requestAnimationFrame(() => {
|
|
116
|
+
const r = this._inputElement;
|
|
117
|
+
if (r) {
|
|
118
|
+
const c = r.value.length;
|
|
119
|
+
r.setSelectionRange(c, c);
|
|
120
120
|
}
|
|
121
121
|
}), setTimeout(() => {
|
|
122
122
|
this._justSelected = !1;
|
|
@@ -148,7 +148,7 @@ const g = class g extends y(f) {
|
|
|
148
148
|
this._internals.setFormValue(null);
|
|
149
149
|
else {
|
|
150
150
|
const t = new FormData();
|
|
151
|
-
e.forEach((
|
|
151
|
+
e.forEach((i) => t.append(this.name, i)), this._internals.setFormValue(t);
|
|
152
152
|
}
|
|
153
153
|
} else {
|
|
154
154
|
const e = typeof this.value == "string" ? this.value : "";
|
|
@@ -166,14 +166,46 @@ const g = class g extends y(f) {
|
|
|
166
166
|
) : this._internals.setValidity({});
|
|
167
167
|
}
|
|
168
168
|
firstUpdated() {
|
|
169
|
-
this._syncFormValue(), this._syncValidity();
|
|
169
|
+
this._syncFormValue(), this._syncValidity(), this._syncStates();
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* FACE lifecycle: called when the parent form is reset.
|
|
173
173
|
* Clears selection and re-syncs form value.
|
|
174
174
|
*/
|
|
175
175
|
formResetCallback() {
|
|
176
|
-
this._selectedOptions = [], this._selectionChanged(), this._internals.setFormValue(null), this._internals.setValidity({});
|
|
176
|
+
this._selectedOptions = [], this._selectionChanged(), this._internals.setFormValue(null), this._internals.setValidity({}), this._syncStates();
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* FACE lifecycle: called on session restore or browser autofill.
|
|
180
|
+
* Restores the selected option(s) by matching saved values against this.options.
|
|
181
|
+
* Single: state is a string. Multiple: state is FormData.
|
|
182
|
+
*/
|
|
183
|
+
formStateRestoreCallback(e, t) {
|
|
184
|
+
if (e === null)
|
|
185
|
+
this._selectedOptions = [];
|
|
186
|
+
else if (e instanceof FormData) {
|
|
187
|
+
const i = new Set(Array.from(e.getAll(this.name)));
|
|
188
|
+
this._selectedOptions = this.options.filter((n) => i.has(n.value));
|
|
189
|
+
} else if (typeof e == "string") {
|
|
190
|
+
const i = this.options.find((n) => n.value === e);
|
|
191
|
+
this._selectedOptions = i ? [i] : [];
|
|
192
|
+
}
|
|
193
|
+
this._selectionChanged(), this._syncFormValue(), this._syncValidity(), this._syncStates();
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Sync CustomStateSet states so :state() pseudo-classes work from external CSS.
|
|
197
|
+
*
|
|
198
|
+
* Must be called AFTER _syncValidity() so that :state(invalid) reads the
|
|
199
|
+
* freshly-updated _internals.validity.valid value.
|
|
200
|
+
*
|
|
201
|
+
* Exposed states:
|
|
202
|
+
* :state(disabled) — combobox is disabled
|
|
203
|
+
* :state(readonly) — combobox is read-only
|
|
204
|
+
* :state(required) — combobox is required
|
|
205
|
+
* :state(invalid) — FACE constraint validation is failing
|
|
206
|
+
*/
|
|
207
|
+
_syncStates() {
|
|
208
|
+
this._setState("disabled", this.disabled), this._setState("readonly", this.readonly), this._setState("required", this.required), this._setState("invalid", !this._internals.validity.valid);
|
|
177
209
|
}
|
|
178
210
|
// ─── End FACE ─────────────────────────────────────────────────────────────
|
|
179
211
|
// Private methods
|
|
@@ -187,22 +219,22 @@ const g = class g extends y(f) {
|
|
|
187
219
|
}
|
|
188
220
|
_renderSelectedTags() {
|
|
189
221
|
if (!this.multiple || this._selectedOptions.length === 0)
|
|
190
|
-
return
|
|
222
|
+
return p;
|
|
191
223
|
const e = this._selectedOptions.slice(0, this.maxOptionsVisible), t = this._selectedOptions.length - this.maxOptionsVisible;
|
|
192
224
|
return l`
|
|
193
225
|
<div class="combobox-tags-wrapper" part="ag-combobox-tags-wrapper">
|
|
194
|
-
${e.map((
|
|
226
|
+
${e.map((i) => l`
|
|
195
227
|
<ag-tag
|
|
196
228
|
removable
|
|
197
|
-
.value=${
|
|
198
|
-
@tag-remove=${() => this._handleTagRemove(
|
|
229
|
+
.value=${i.value}
|
|
230
|
+
@tag-remove=${() => this._handleTagRemove(i)}
|
|
199
231
|
>
|
|
200
|
-
${
|
|
232
|
+
${i.label}
|
|
201
233
|
</ag-tag>
|
|
202
234
|
`)}
|
|
203
235
|
${t > 0 ? l`
|
|
204
236
|
<ag-tag>+${t}</ag-tag>
|
|
205
|
-
` :
|
|
237
|
+
` : p}
|
|
206
238
|
</div>
|
|
207
239
|
`;
|
|
208
240
|
}
|
|
@@ -212,7 +244,7 @@ const g = class g extends y(f) {
|
|
|
212
244
|
_filterOptions() {
|
|
213
245
|
const e = this._searchTerm.trim();
|
|
214
246
|
if (!this.multiple && this._selectedOptions.length > 0 && e === this._selectedOptions[0].label) {
|
|
215
|
-
this._filteredOptions = this.options.slice(0, this.maxVisibleOptions), this._activeIndex !== -1 && (this._activeIndex = this.options.findIndex((
|
|
247
|
+
this._filteredOptions = this.options.slice(0, this.maxVisibleOptions), this._activeIndex !== -1 && (this._activeIndex = this.options.findIndex((n) => n.value === this._selectedOptions[0]?.value));
|
|
216
248
|
return;
|
|
217
249
|
}
|
|
218
250
|
if (!e || this.filterMode === "none") {
|
|
@@ -231,20 +263,20 @@ const g = class g extends y(f) {
|
|
|
231
263
|
t = this.options;
|
|
232
264
|
}
|
|
233
265
|
this._filteredOptions = t.slice(0, this.maxVisibleOptions), this._filteredOptions.length > 0 ? (this._activeIndex = 0, this._updateAriaActivedescendant(), this._announceOption(this._filteredOptions[0])) : (this._activeIndex = -1, this._announceNoResults());
|
|
234
|
-
const
|
|
266
|
+
const i = new CustomEvent("search", {
|
|
235
267
|
detail: { searchTerm: e },
|
|
236
268
|
bubbles: !0,
|
|
237
269
|
composed: !0
|
|
238
270
|
});
|
|
239
|
-
this.dispatchEvent(
|
|
271
|
+
this.dispatchEvent(i), this.onSearch?.(i);
|
|
240
272
|
}
|
|
241
273
|
_filterStartsWith(e, t) {
|
|
242
|
-
const
|
|
243
|
-
return e.filter((
|
|
274
|
+
const i = t.toLowerCase();
|
|
275
|
+
return e.filter((n) => n.label.toLowerCase().startsWith(i));
|
|
244
276
|
}
|
|
245
277
|
_filterContains(e, t) {
|
|
246
|
-
const
|
|
247
|
-
return e.filter((
|
|
278
|
+
const i = t.toLowerCase();
|
|
279
|
+
return e.filter((n) => n.label.toLowerCase().includes(i));
|
|
248
280
|
}
|
|
249
281
|
_handleInputChange(e) {
|
|
250
282
|
const t = e.target.value;
|
|
@@ -269,7 +301,7 @@ const g = class g extends y(f) {
|
|
|
269
301
|
e.preventDefault();
|
|
270
302
|
const t = this._selectedOptions[this._selectedOptions.length - 1];
|
|
271
303
|
this._selectedOptions = this._selectedOptions.slice(0, -1), this._selectionChanged();
|
|
272
|
-
const
|
|
304
|
+
const i = new CustomEvent("change", {
|
|
273
305
|
detail: {
|
|
274
306
|
value: this.value,
|
|
275
307
|
option: t
|
|
@@ -277,7 +309,7 @@ const g = class g extends y(f) {
|
|
|
277
309
|
bubbles: !0,
|
|
278
310
|
composed: !0
|
|
279
311
|
});
|
|
280
|
-
this.dispatchEvent(
|
|
312
|
+
this.dispatchEvent(i), this.onChange?.(i);
|
|
281
313
|
}
|
|
282
314
|
break;
|
|
283
315
|
case "Tab":
|
|
@@ -319,11 +351,11 @@ const g = class g extends y(f) {
|
|
|
319
351
|
}
|
|
320
352
|
_updateActiveIndex(e) {
|
|
321
353
|
if (this._filteredOptions.length === 0) return;
|
|
322
|
-
let t = this._activeIndex + e,
|
|
323
|
-
const
|
|
324
|
-
for (;
|
|
325
|
-
t += e,
|
|
326
|
-
|
|
354
|
+
let t = this._activeIndex + e, i = 0;
|
|
355
|
+
const n = this._filteredOptions.length;
|
|
356
|
+
for (; i < n && (t < 0 ? t = this._filteredOptions.length - 1 : t >= this._filteredOptions.length && (t = 0), !!this._filteredOptions[t].disabled); )
|
|
357
|
+
t += e, i++;
|
|
358
|
+
i < n && !this._filteredOptions[t].disabled && (this._activeIndex = t, this._updateAriaActivedescendant(), this._scrollOptionIntoView(t), this._announceOption(this._filteredOptions[t]));
|
|
327
359
|
}
|
|
328
360
|
_updateAriaActivedescendant() {
|
|
329
361
|
if (this._activeIndex >= 0 && this._activeIndex < this._filteredOptions.length) {
|
|
@@ -334,16 +366,16 @@ const g = class g extends y(f) {
|
|
|
334
366
|
}
|
|
335
367
|
_scrollOptionIntoView(e) {
|
|
336
368
|
e < 0 || e >= this._filteredOptions.length || requestAnimationFrame(() => {
|
|
337
|
-
const t = this._getOptionId(e),
|
|
338
|
-
if (
|
|
339
|
-
const
|
|
340
|
-
|
|
369
|
+
const t = this._getOptionId(e), i = this.shadowRoot?.getElementById(t);
|
|
370
|
+
if (i && this._listboxElement) {
|
|
371
|
+
const n = this._listboxElement.getBoundingClientRect(), r = i.getBoundingClientRect();
|
|
372
|
+
r.bottom > n.bottom ? i.scrollIntoView({ block: "nearest", behavior: "smooth" }) : r.top < n.top && i.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
341
373
|
}
|
|
342
374
|
});
|
|
343
375
|
}
|
|
344
376
|
_announceOption(e) {
|
|
345
|
-
const t = this._filteredOptions.indexOf(e),
|
|
346
|
-
this._srAnnouncer && (this._srAnnouncer.textContent =
|
|
377
|
+
const t = this._filteredOptions.indexOf(e), i = this._filteredOptions.length, n = `${e.label}, ${t + 1} of ${i}`;
|
|
378
|
+
this._srAnnouncer && (this._srAnnouncer.textContent = n);
|
|
347
379
|
}
|
|
348
380
|
_announceNoResults() {
|
|
349
381
|
this._srAnnouncer && (this._srAnnouncer.textContent = this.noResultsText);
|
|
@@ -374,14 +406,14 @@ const g = class g extends y(f) {
|
|
|
374
406
|
`;
|
|
375
407
|
}
|
|
376
408
|
render() {
|
|
377
|
-
const e = !this.noLabel && this.label, t = this._getDescribedBy(),
|
|
409
|
+
const e = !this.noLabel && this.label, t = this._getDescribedBy(), i = _(this.labelPosition), n = l`
|
|
378
410
|
|
|
379
411
|
<div
|
|
380
412
|
class="combobox-input-wrapper"
|
|
381
413
|
part="ag-combobox-input-wrapper"
|
|
382
414
|
@click=${() => this._inputElement?.focus()}
|
|
383
415
|
>
|
|
384
|
-
${this.multiple ? this._renderSelectedTags() :
|
|
416
|
+
${this.multiple ? this._renderSelectedTags() : p}
|
|
385
417
|
<input
|
|
386
418
|
id=${this._comboboxId}
|
|
387
419
|
class="combobox-input"
|
|
@@ -392,10 +424,10 @@ const g = class g extends y(f) {
|
|
|
392
424
|
aria-controls=${this._listboxId}
|
|
393
425
|
aria-expanded=${this._open ? "true" : "false"}
|
|
394
426
|
aria-haspopup="listbox"
|
|
395
|
-
aria-disabled=${this.disabled ? "true" :
|
|
396
|
-
aria-labelledby=${e ? this._labelId :
|
|
397
|
-
aria-label=${this.ariaLabel ||
|
|
398
|
-
aria-describedby=${t ||
|
|
427
|
+
aria-disabled=${this.disabled ? "true" : p}
|
|
428
|
+
aria-labelledby=${e ? this._labelId : p}
|
|
429
|
+
aria-label=${this.ariaLabel || p}
|
|
430
|
+
aria-describedby=${t || p}
|
|
399
431
|
aria-invalid=${this.invalid ? "true" : "false"}
|
|
400
432
|
aria-required=${this.required ? "true" : "false"}
|
|
401
433
|
.value=${this._searchTerm}
|
|
@@ -419,7 +451,7 @@ const g = class g extends y(f) {
|
|
|
419
451
|
@close-button-click=${this._handleClearClick}
|
|
420
452
|
></ag-close-button>
|
|
421
453
|
</div>
|
|
422
|
-
` :
|
|
454
|
+
` : p}
|
|
423
455
|
|
|
424
456
|
<button
|
|
425
457
|
type="button"
|
|
@@ -462,31 +494,31 @@ const g = class g extends y(f) {
|
|
|
462
494
|
${this.noResultsText}
|
|
463
495
|
</div>
|
|
464
496
|
` : l`
|
|
465
|
-
${this._filteredOptions.map((
|
|
497
|
+
${this._filteredOptions.map((h, v) => l`
|
|
466
498
|
<div
|
|
467
499
|
id=${this._getOptionId(v)}
|
|
468
500
|
class="combobox-option ${v === this._activeIndex ? "option-active" : ""}"
|
|
469
501
|
part="ag-combobox-option"
|
|
470
502
|
role="option"
|
|
471
|
-
aria-selected=${this._selectedOptions.some((d) => d.value ===
|
|
472
|
-
aria-disabled=${
|
|
473
|
-
@click=${(d) => this._handleOptionClick(
|
|
503
|
+
aria-selected=${this._selectedOptions.some((d) => d.value === h.value) ? "true" : "false"}
|
|
504
|
+
aria-disabled=${h.disabled ? "true" : "false"}
|
|
505
|
+
@click=${(d) => this._handleOptionClick(h, d)}
|
|
474
506
|
>
|
|
475
507
|
${this.multiple ? l`
|
|
476
508
|
<ag-checkbox
|
|
477
|
-
.checked=${this._selectedOptions.some((d) => d.value ===
|
|
509
|
+
.checked=${this._selectedOptions.some((d) => d.value === h.value)}
|
|
478
510
|
.size=${this.size === "default" ? "medium" : this.size}
|
|
479
|
-
.value=${
|
|
511
|
+
.value=${h.value}
|
|
480
512
|
.name=${this._comboboxId}
|
|
481
|
-
.disabled=${
|
|
513
|
+
.disabled=${h.disabled}
|
|
482
514
|
@change=${(d) => {
|
|
483
|
-
d.stopPropagation(), this._handleOptionClick(
|
|
515
|
+
d.stopPropagation(), this._handleOptionClick(h, d);
|
|
484
516
|
}}
|
|
485
517
|
>
|
|
486
|
-
${
|
|
518
|
+
${h.label}
|
|
487
519
|
</ag-checkbox>
|
|
488
520
|
` : l`
|
|
489
|
-
${
|
|
521
|
+
${h.label}
|
|
490
522
|
`}
|
|
491
523
|
</div>
|
|
492
524
|
`)}
|
|
@@ -499,33 +531,33 @@ const g = class g extends y(f) {
|
|
|
499
531
|
aria-live="polite"
|
|
500
532
|
aria-atomic="true"
|
|
501
533
|
></div>
|
|
502
|
-
`,
|
|
534
|
+
`, r = this.helpText && !this.invalid ? l`<div id=${this._helpTextId} class="ag-form-control__helper">
|
|
503
535
|
${this.helpText}
|
|
504
536
|
</div>` : "", c = this.invalid && this.errorMessage ? l`<div id=${this._errorTextId} class="ag-form-control__error">
|
|
505
537
|
${this.errorMessage}
|
|
506
538
|
</div>` : "";
|
|
507
|
-
return
|
|
539
|
+
return i ? l`
|
|
508
540
|
<div class="ag-form-control--horizontal">
|
|
509
541
|
${this.renderLabel()}
|
|
510
542
|
<div class="combobox-wrapper" part="ag-combobox-wrapper">
|
|
511
|
-
${
|
|
543
|
+
${n}
|
|
512
544
|
</div>
|
|
513
545
|
</div>
|
|
514
|
-
${
|
|
546
|
+
${r}
|
|
515
547
|
${c}
|
|
516
548
|
` : this.labelPosition === "bottom" ? l`
|
|
517
549
|
<div class="combobox-wrapper" part="ag-combobox-wrapper">
|
|
518
|
-
${
|
|
550
|
+
${n}
|
|
519
551
|
</div>
|
|
520
|
-
${
|
|
552
|
+
${r}
|
|
521
553
|
${c}
|
|
522
554
|
${this.renderLabel()}
|
|
523
555
|
` : l`
|
|
524
556
|
${this.renderLabel()}
|
|
525
557
|
<div class="combobox-wrapper" part="ag-combobox-wrapper">
|
|
526
|
-
${
|
|
558
|
+
${n}
|
|
527
559
|
</div>
|
|
528
|
-
${
|
|
560
|
+
${r}
|
|
529
561
|
${c}
|
|
530
562
|
`;
|
|
531
563
|
}
|
|
@@ -884,142 +916,142 @@ g.styles = [
|
|
|
884
916
|
}
|
|
885
917
|
`
|
|
886
918
|
];
|
|
887
|
-
let
|
|
919
|
+
let o = g;
|
|
888
920
|
s([
|
|
889
921
|
a({ type: Array })
|
|
890
|
-
],
|
|
922
|
+
], o.prototype, "options", 2);
|
|
891
923
|
s([
|
|
892
924
|
a({ type: [String, Array] })
|
|
893
|
-
],
|
|
925
|
+
], o.prototype, "value", 1);
|
|
894
926
|
s([
|
|
895
927
|
a({ type: [String, Array], attribute: "default-value" })
|
|
896
|
-
],
|
|
928
|
+
], o.prototype, "defaultValue", 2);
|
|
897
929
|
s([
|
|
898
930
|
a({ type: String })
|
|
899
|
-
],
|
|
931
|
+
], o.prototype, "placeholder", 2);
|
|
900
932
|
s([
|
|
901
933
|
a({ type: String })
|
|
902
|
-
],
|
|
934
|
+
], o.prototype, "label", 2);
|
|
903
935
|
s([
|
|
904
936
|
a({ type: String, attribute: "label-position" })
|
|
905
|
-
],
|
|
937
|
+
], o.prototype, "labelPosition", 2);
|
|
906
938
|
s([
|
|
907
939
|
a({ type: Boolean, attribute: "label-hidden" })
|
|
908
|
-
],
|
|
940
|
+
], o.prototype, "labelHidden", 2);
|
|
909
941
|
s([
|
|
910
942
|
a({ type: Boolean, attribute: "no-label" })
|
|
911
|
-
],
|
|
943
|
+
], o.prototype, "noLabel", 2);
|
|
912
944
|
s([
|
|
913
945
|
a({ type: String, attribute: "aria-label" })
|
|
914
|
-
],
|
|
946
|
+
], o.prototype, "ariaLabel", 2);
|
|
915
947
|
s([
|
|
916
948
|
a({ type: String, attribute: "help-text" })
|
|
917
|
-
],
|
|
949
|
+
], o.prototype, "helpText", 2);
|
|
918
950
|
s([
|
|
919
951
|
a({ type: String, attribute: "error-message" })
|
|
920
|
-
],
|
|
952
|
+
], o.prototype, "errorMessage", 2);
|
|
921
953
|
s([
|
|
922
954
|
a({ type: String })
|
|
923
|
-
],
|
|
955
|
+
], o.prototype, "id", 2);
|
|
924
956
|
s([
|
|
925
957
|
a({ type: String })
|
|
926
|
-
],
|
|
958
|
+
], o.prototype, "autocomplete", 2);
|
|
927
959
|
s([
|
|
928
960
|
a({ type: String, attribute: "filter-mode" })
|
|
929
|
-
],
|
|
961
|
+
], o.prototype, "filterMode", 2);
|
|
930
962
|
s([
|
|
931
963
|
a({ type: Boolean })
|
|
932
|
-
],
|
|
964
|
+
], o.prototype, "clearable", 2);
|
|
933
965
|
s([
|
|
934
966
|
a({ type: Boolean, reflect: !0 })
|
|
935
|
-
],
|
|
967
|
+
], o.prototype, "disabled", 2);
|
|
936
968
|
s([
|
|
937
969
|
a({ type: Boolean })
|
|
938
|
-
],
|
|
970
|
+
], o.prototype, "readonly", 2);
|
|
939
971
|
s([
|
|
940
972
|
a({ type: Boolean })
|
|
941
|
-
],
|
|
973
|
+
], o.prototype, "required", 2);
|
|
942
974
|
s([
|
|
943
975
|
a({ type: Boolean, reflect: !0 })
|
|
944
|
-
],
|
|
976
|
+
], o.prototype, "invalid", 2);
|
|
945
977
|
s([
|
|
946
978
|
a({ type: String, reflect: !0 })
|
|
947
|
-
],
|
|
979
|
+
], o.prototype, "size", 2);
|
|
948
980
|
s([
|
|
949
981
|
a({ type: String, reflect: !0 })
|
|
950
|
-
],
|
|
982
|
+
], o.prototype, "variant", 2);
|
|
951
983
|
s([
|
|
952
984
|
a({ type: Number, attribute: "max-visible-options" })
|
|
953
|
-
],
|
|
985
|
+
], o.prototype, "maxVisibleOptions", 2);
|
|
954
986
|
s([
|
|
955
987
|
a({ type: Boolean })
|
|
956
|
-
],
|
|
988
|
+
], o.prototype, "closeOnSelect", 2);
|
|
957
989
|
s([
|
|
958
990
|
a({ type: Boolean })
|
|
959
|
-
],
|
|
991
|
+
], o.prototype, "multiple", 2);
|
|
960
992
|
s([
|
|
961
993
|
a({ type: Number, attribute: "max-options-visible" })
|
|
962
|
-
],
|
|
994
|
+
], o.prototype, "maxOptionsVisible", 2);
|
|
963
995
|
s([
|
|
964
996
|
a({ type: Boolean })
|
|
965
|
-
],
|
|
997
|
+
], o.prototype, "loading", 2);
|
|
966
998
|
s([
|
|
967
999
|
a({ type: String, attribute: "loading-text" })
|
|
968
|
-
],
|
|
1000
|
+
], o.prototype, "loadingText", 2);
|
|
969
1001
|
s([
|
|
970
1002
|
a({ type: String, attribute: "no-results-text" })
|
|
971
|
-
],
|
|
1003
|
+
], o.prototype, "noResultsText", 2);
|
|
972
1004
|
s([
|
|
973
1005
|
a({ attribute: !1 })
|
|
974
|
-
],
|
|
1006
|
+
], o.prototype, "onChange", 2);
|
|
975
1007
|
s([
|
|
976
1008
|
a({ attribute: !1 })
|
|
977
|
-
],
|
|
1009
|
+
], o.prototype, "onSelect", 2);
|
|
978
1010
|
s([
|
|
979
1011
|
a({ attribute: !1 })
|
|
980
|
-
],
|
|
1012
|
+
], o.prototype, "onSearch", 2);
|
|
981
1013
|
s([
|
|
982
1014
|
a({ attribute: !1 })
|
|
983
|
-
],
|
|
1015
|
+
], o.prototype, "onOpen", 2);
|
|
984
1016
|
s([
|
|
985
1017
|
a({ attribute: !1 })
|
|
986
|
-
],
|
|
1018
|
+
], o.prototype, "onClose", 2);
|
|
987
1019
|
s([
|
|
988
1020
|
a({ attribute: !1 })
|
|
989
|
-
],
|
|
1021
|
+
], o.prototype, "onFocus", 2);
|
|
990
1022
|
s([
|
|
991
1023
|
a({ attribute: !1 })
|
|
992
|
-
],
|
|
1024
|
+
], o.prototype, "onBlur", 2);
|
|
993
1025
|
s([
|
|
994
1026
|
a({ attribute: !1 })
|
|
995
|
-
],
|
|
1027
|
+
], o.prototype, "validationMessages", 2);
|
|
996
1028
|
s([
|
|
997
1029
|
b()
|
|
998
|
-
],
|
|
1030
|
+
], o.prototype, "_open", 2);
|
|
999
1031
|
s([
|
|
1000
1032
|
b()
|
|
1001
|
-
],
|
|
1033
|
+
], o.prototype, "_searchTerm", 2);
|
|
1002
1034
|
s([
|
|
1003
1035
|
b()
|
|
1004
|
-
],
|
|
1036
|
+
], o.prototype, "_filteredOptions", 2);
|
|
1005
1037
|
s([
|
|
1006
1038
|
b()
|
|
1007
|
-
],
|
|
1039
|
+
], o.prototype, "_activeIndex", 2);
|
|
1008
1040
|
s([
|
|
1009
1041
|
b()
|
|
1010
|
-
],
|
|
1042
|
+
], o.prototype, "_selectedOptions", 2);
|
|
1011
1043
|
s([
|
|
1012
1044
|
b()
|
|
1013
|
-
],
|
|
1045
|
+
], o.prototype, "_displayLabel", 2);
|
|
1014
1046
|
s([
|
|
1015
1047
|
u(".combobox-input")
|
|
1016
|
-
],
|
|
1048
|
+
], o.prototype, "_inputElement", 2);
|
|
1017
1049
|
s([
|
|
1018
1050
|
u(".combobox-listbox")
|
|
1019
|
-
],
|
|
1051
|
+
], o.prototype, "_listboxElement", 2);
|
|
1020
1052
|
s([
|
|
1021
1053
|
u(".combobox-sr-announcer")
|
|
1022
|
-
],
|
|
1054
|
+
], o.prototype, "_srAnnouncer", 2);
|
|
1023
1055
|
export {
|
|
1024
|
-
|
|
1056
|
+
o as AgCombobox
|
|
1025
1057
|
};
|
|
@@ -121,6 +121,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
121
121
|
ariaLabel: string | null;
|
|
122
122
|
label: string;
|
|
123
123
|
options: ComboboxOption[];
|
|
124
|
+
autocomplete: "list" | "none";
|
|
124
125
|
labelPosition: import('../../../shared/form-control-utils').LabelPosition;
|
|
125
126
|
labelHidden: boolean;
|
|
126
127
|
noLabel: boolean;
|
|
@@ -135,7 +136,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
135
136
|
loading: boolean;
|
|
136
137
|
placeholder: string;
|
|
137
138
|
defaultValue: string | string[];
|
|
138
|
-
autocomplete: "list" | "none";
|
|
139
139
|
filterMode: "startsWith" | "contains" | "none";
|
|
140
140
|
clearable: boolean;
|
|
141
141
|
closeOnSelect: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/core/_dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAKrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,sCAAsC,CAAC;AAG9C,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;AAChD,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;AACjD,M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