agnosticui-core 2.0.0-alpha.2 → 2.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -33
- package/dist/{VueButton.vue_vue_type_script_setup_true_lang-Bq8IPXqd.js → VueButton.vue_vue_type_script_setup_true_lang-D1jGatE9.js} +17 -15
- package/dist/{VueButtonFx.vue_vue_type_script_setup_true_lang-BUudF-lg.js → VueButtonFx.vue_vue_type_script_setup_true_lang-BRrt6Nxs.js} +1 -0
- package/dist/{VueCheckbox.vue_vue_type_script_setup_true_lang-DERDRO2P.js → VueCheckbox.vue_vue_type_script_setup_true_lang-VtQfJ-6f.js} +9 -10
- package/dist/{VueCombobox.vue_vue_type_script_setup_true_lang-C7gDMrYJ.js → VueCombobox.vue_vue_type_script_setup_true_lang-BSTZGX2X.js} +15 -13
- package/dist/VueIcon.vue_vue_type_script_setup_true_lang-C2Sky3bU.js +22 -0
- package/dist/{VueImage.vue_vue_type_script_setup_true_lang-CUwbK3NF.js → VueImage.vue_vue_type_script_setup_true_lang-SddK93SB.js} +23 -17
- package/dist/{VueInput.vue_vue_type_script_setup_true_lang-Dsxo7DuX.js → VueInput.vue_vue_type_script_setup_true_lang-wYdAqg-i.js} +19 -19
- package/dist/{VueMenu.vue_vue_type_script_setup_true_lang-bnn7ochj.js → VueMenu.vue_vue_type_script_setup_true_lang-BXc7397e.js} +5 -4
- package/dist/{VueRadio.vue_vue_type_script_setup_true_lang-DxNhH12d.js → VueRadio.vue_vue_type_script_setup_true_lang-C7Z-sWpa.js} +10 -12
- package/dist/{VueRating.vue_vue_type_script_setup_true_lang-CICncp71.js → VueRating.vue_vue_type_script_setup_true_lang-Bm2nRrqr.js} +11 -9
- package/dist/VueSelectionButton.vue_vue_type_script_setup_true_lang-DJN-Uk6n.js +24 -0
- package/dist/VueSelectionButtonGroup.vue_vue_type_script_setup_true_lang-DwYrIMVO.js +46 -0
- package/dist/VueSelectionCard.vue_vue_type_script_setup_true_lang-DJiyPsXH.js +24 -0
- package/dist/VueSelectionCardGroup.vue_vue_type_script_setup_true_lang-D5CycLY5.js +40 -0
- package/dist/{VueToggle.vue_vue_type_script_setup_true_lang-BxrvAsse.js → VueToggle.vue_vue_type_script_setup_true_lang-DLPCBOqZ.js} +18 -16
- package/dist/components/Alert/core/_Alert.d.ts.map +1 -1
- package/dist/components/Alert/core/_Alert.js +38 -19
- package/dist/components/Button/core/_Button.d.ts +5 -0
- package/dist/components/Button/core/_Button.d.ts.map +1 -1
- package/dist/components/Button/core/_Button.js +147 -65
- package/dist/components/Button/vue/VueButton.js +1 -1
- package/dist/components/Button/vue/VueButton.vue.d.ts +3 -0
- package/dist/components/Button/vue/VueButton.vue.d.ts.map +1 -1
- package/dist/components/Button/vue/index.js +1 -1
- package/dist/components/ButtonFx/vue/VueButtonFx.js +1 -1
- package/dist/components/ButtonFx/vue/index.js +1 -1
- package/dist/components/Card/core/_Card.d.ts +9 -1
- package/dist/components/Card/core/_Card.d.ts.map +1 -1
- package/dist/components/Card/core/_Card.js +83 -29
- package/dist/components/Card/vue/VueCard.js +29 -16
- package/dist/components/Card/vue/VueCard.vue.d.ts +25 -5
- package/dist/components/Card/vue/VueCard.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/core/_Checkbox.d.ts +37 -11
- package/dist/components/Checkbox/core/_Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/core/_Checkbox.js +73 -42
- package/dist/components/Checkbox/vue/VueCheckbox.js +1 -1
- package/dist/components/Checkbox/vue/VueCheckbox.vue.d.ts +3 -3
- package/dist/components/Checkbox/vue/VueCheckbox.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/vue/index.js +1 -1
- package/dist/components/Combobox/core/_Combobox.d.ts +24 -1
- package/dist/components/Combobox/core/_Combobox.d.ts.map +1 -1
- package/dist/components/Combobox/core/_Combobox.js +141 -92
- package/dist/components/Combobox/vue/VueCombobox.js +1 -1
- package/dist/components/Combobox/vue/index.js +1 -1
- package/dist/components/Fieldset/vue/VueFieldset.vue.d.ts +1 -1
- package/dist/components/Icon/vue/VueIcon.js +1 -1
- package/dist/components/Icon/vue/VueIcon.vue.d.ts.map +1 -1
- package/dist/components/Icon/vue/index.js +1 -1
- package/dist/components/Image/vue/VueImage.js +1 -1
- package/dist/components/Image/vue/VueImage.vue.d.ts.map +1 -1
- package/dist/components/Image/vue/index.js +1 -1
- package/dist/components/Input/core/_Input.d.ts +21 -2
- package/dist/components/Input/core/_Input.d.ts.map +1 -1
- package/dist/components/Input/core/_Input.js +71 -35
- package/dist/components/Input/vue/VueInput.js +1 -1
- package/dist/components/Input/vue/VueInput.vue.d.ts.map +1 -1
- package/dist/components/Input/vue/index.js +1 -1
- package/dist/components/Link/core/_Link.d.ts.map +1 -1
- package/dist/components/Link/core/_Link.js +1 -0
- package/dist/components/Link/vue/VueLink.js +6 -5
- package/dist/components/Link/vue/VueLink.vue.d.ts.map +1 -1
- package/dist/components/Menu/vue/VueMenu.js +1 -1
- package/dist/components/Menu/vue/index.js +1 -1
- package/dist/components/Pagination/core/_Pagination.d.ts +0 -1
- package/dist/components/Pagination/core/_Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/core/_Pagination.js +6 -9
- package/dist/components/Radio/core/_Radio.d.ts +55 -10
- package/dist/components/Radio/core/_Radio.d.ts.map +1 -1
- package/dist/components/Radio/core/_Radio.js +165 -116
- package/dist/components/Radio/vue/VueRadio.js +1 -1
- package/dist/components/Radio/vue/VueRadio.vue.d.ts.map +1 -1
- package/dist/components/Radio/vue/index.js +1 -1
- package/dist/components/Rating/core/_Rating.d.ts +23 -2
- package/dist/components/Rating/core/_Rating.d.ts.map +1 -1
- package/dist/components/Rating/core/_Rating.js +97 -64
- package/dist/components/Rating/vue/VueRating.js +1 -1
- package/dist/components/Rating/vue/VueRating.vue.d.ts +2 -0
- package/dist/components/Rating/vue/VueRating.vue.d.ts.map +1 -1
- package/dist/components/Rating/vue/index.js +1 -1
- package/dist/components/Select/core/_Select.d.ts +20 -2
- package/dist/components/Select/core/_Select.d.ts.map +1 -1
- package/dist/components/Select/core/_Select.js +99 -69
- package/dist/components/SelectionButton/core/SelectionButton.d.ts +9 -0
- package/dist/components/SelectionButton/core/SelectionButton.d.ts.map +1 -0
- package/dist/components/SelectionButton/core/SelectionButton.js +5 -0
- package/dist/components/SelectionButton/core/_SelectionButton.d.ts +47 -0
- package/dist/components/SelectionButton/core/_SelectionButton.d.ts.map +1 -0
- package/dist/components/SelectionButton/core/_SelectionButton.js +474 -0
- package/dist/components/SelectionButton/react/ReactSelectionButton.d.ts +9 -0
- package/dist/components/SelectionButton/react/ReactSelectionButton.d.ts.map +1 -0
- package/dist/components/SelectionButton/react/ReactSelectionButton.js +12 -0
- package/dist/components/SelectionButton/react/index.d.ts +3 -0
- package/dist/components/SelectionButton/react/index.d.ts.map +1 -0
- package/dist/components/SelectionButton/react/index.js +4 -0
- package/dist/components/SelectionButton/vue/VueSelectionButton.js +4 -0
- package/dist/components/SelectionButton/vue/VueSelectionButton.vue.d.ts +55 -0
- package/dist/components/SelectionButton/vue/VueSelectionButton.vue.d.ts.map +1 -0
- package/dist/components/SelectionButton/vue/index.d.ts +6 -0
- package/dist/components/SelectionButton/vue/index.d.ts.map +1 -0
- package/dist/components/SelectionButton/vue/index.js +4 -0
- package/dist/components/SelectionButtonGroup/core/SelectionButtonGroup.d.ts +9 -0
- package/dist/components/SelectionButtonGroup/core/SelectionButtonGroup.d.ts.map +1 -0
- package/dist/components/SelectionButtonGroup/core/SelectionButtonGroup.js +5 -0
- package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.d.ts +87 -0
- package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.d.ts.map +1 -0
- package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.js +235 -0
- package/dist/components/SelectionButtonGroup/react/ReactSelectionButtonGroup.d.ts +13 -0
- package/dist/components/SelectionButtonGroup/react/ReactSelectionButtonGroup.d.ts.map +1 -0
- package/dist/components/SelectionButtonGroup/react/ReactSelectionButtonGroup.js +15 -0
- package/dist/components/SelectionButtonGroup/react/index.d.ts +3 -0
- package/dist/components/SelectionButtonGroup/react/index.d.ts.map +1 -0
- package/dist/components/SelectionButtonGroup/react/index.js +4 -0
- package/dist/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.js +4 -0
- package/dist/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.vue.d.ts +101 -0
- package/dist/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.vue.d.ts.map +1 -0
- package/dist/components/SelectionButtonGroup/vue/index.d.ts +6 -0
- package/dist/components/SelectionButtonGroup/vue/index.d.ts.map +1 -0
- package/dist/components/SelectionButtonGroup/vue/index.js +4 -0
- package/dist/components/SelectionCard/core/SelectionCard.d.ts +9 -0
- package/dist/components/SelectionCard/core/SelectionCard.d.ts.map +1 -0
- package/dist/components/SelectionCard/core/SelectionCard.js +5 -0
- package/dist/components/SelectionCard/core/_SelectionCard.d.ts +39 -0
- package/dist/components/SelectionCard/core/_SelectionCard.d.ts.map +1 -0
- package/dist/components/SelectionCard/core/_SelectionCard.js +318 -0
- package/dist/components/SelectionCard/react/ReactSelectionCard.d.ts +9 -0
- package/dist/components/SelectionCard/react/ReactSelectionCard.d.ts.map +1 -0
- package/dist/components/SelectionCard/react/ReactSelectionCard.js +12 -0
- package/dist/components/SelectionCard/react/index.d.ts +3 -0
- package/dist/components/SelectionCard/react/index.d.ts.map +1 -0
- package/dist/components/SelectionCard/react/index.js +4 -0
- package/dist/components/SelectionCard/vue/VueSelectionCard.js +4 -0
- package/dist/components/SelectionCard/vue/VueSelectionCard.vue.d.ts +55 -0
- package/dist/components/SelectionCard/vue/VueSelectionCard.vue.d.ts.map +1 -0
- package/dist/components/SelectionCard/vue/index.d.ts +6 -0
- package/dist/components/SelectionCard/vue/index.d.ts.map +1 -0
- package/dist/components/SelectionCard/vue/index.js +4 -0
- package/dist/components/SelectionCardGroup/core/SelectionCardGroup.d.ts +9 -0
- package/dist/components/SelectionCardGroup/core/SelectionCardGroup.d.ts.map +1 -0
- package/dist/components/SelectionCardGroup/core/SelectionCardGroup.js +5 -0
- package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.d.ts +69 -0
- package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.d.ts.map +1 -0
- package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.js +220 -0
- package/dist/components/SelectionCardGroup/react/ReactSelectionCardGroup.d.ts +13 -0
- package/dist/components/SelectionCardGroup/react/ReactSelectionCardGroup.d.ts.map +1 -0
- package/dist/components/SelectionCardGroup/react/ReactSelectionCardGroup.js +15 -0
- package/dist/components/SelectionCardGroup/react/index.d.ts +3 -0
- package/dist/components/SelectionCardGroup/react/index.d.ts.map +1 -0
- package/dist/components/SelectionCardGroup/react/index.js +4 -0
- package/dist/components/SelectionCardGroup/vue/VueSelectionCardGroup.js +4 -0
- package/dist/components/SelectionCardGroup/vue/VueSelectionCardGroup.vue.d.ts +86 -0
- package/dist/components/SelectionCardGroup/vue/VueSelectionCardGroup.vue.d.ts.map +1 -0
- package/dist/components/SelectionCardGroup/vue/index.d.ts +6 -0
- package/dist/components/SelectionCardGroup/vue/index.d.ts.map +1 -0
- package/dist/components/SelectionCardGroup/vue/index.js +4 -0
- package/dist/components/Slider/core/_Slider.d.ts +10 -16
- package/dist/components/Slider/core/_Slider.d.ts.map +1 -1
- package/dist/components/Slider/core/_Slider.js +28 -39
- package/dist/components/Timeline/core/_Timeline.d.ts.map +1 -1
- package/dist/components/Timeline/core/_Timeline.js +8 -3
- package/dist/components/Timeline/react/ReactTimeline.d.ts +23 -9
- package/dist/components/Timeline/react/ReactTimeline.d.ts.map +1 -1
- package/dist/components/Timeline/react/ReactTimeline.js +18 -14
- package/dist/components/Toggle/core/_Toggle.d.ts +36 -6
- package/dist/components/Toggle/core/_Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/core/_Toggle.js +117 -77
- package/dist/components/Toggle/vue/VueToggle.js +1 -1
- package/dist/components/Toggle/vue/VueToggle.vue.d.ts.map +1 -1
- package/dist/components/Toggle/vue/index.js +1 -1
- package/dist/shared/face-mixin.d.ts +82 -0
- package/dist/shared/face-mixin.d.ts.map +1 -0
- package/dist/shared/face-mixin.js +86 -0
- package/dist/shared/form-control-styles.js +1 -1
- package/dist/styles/ag-tokens-dark.css +4 -0
- package/dist/styles/ag-tokens.css +18 -13
- package/dist/test-setup.js +340 -255
- package/package.json +51 -13
- package/src/components/Alert/core/_Alert.ts +21 -2
- package/src/components/Button/core/_Button.ts +111 -21
- package/src/components/Button/vue/VueButton.vue +2 -0
- package/src/components/Card/core/_Card.ts +70 -3
- package/src/components/Card/vue/VueCard.vue +19 -3
- package/src/components/Checkbox/core/_Checkbox.ts +78 -18
- package/src/components/Checkbox/vue/VueCheckbox.vue +0 -6
- package/src/components/Combobox/core/_Combobox.ts +84 -2
- package/src/components/Combobox/vue/VueCombobox.vue +1 -0
- package/src/components/Drawer/v1/dialog--drawer-bottom.hbs +48 -0
- package/src/components/Drawer/v1/dialog--drawer-end.hbs +48 -0
- package/src/components/Drawer/v1/dialog--drawer-start.hbs +48 -0
- package/src/components/Drawer/v1/dialog--drawer-top.hbs +48 -0
- package/src/components/Drawer/v1/dialog-demo.css +13 -0
- package/src/components/Drawer/v1/dialog.config.yml +5 -0
- package/src/components/Drawer/v1/dialog.css +99 -0
- package/src/components/Drawer/v1/dialog.hbs +48 -0
- package/src/components/Drawer/v1/drawer-animations.css +52 -0
- package/src/components/Drawer/v1/drawer.css +50 -0
- package/src/components/Icon/vue/VueIcon.vue +2 -5
- package/src/components/Image/vue/VueImage.vue +17 -13
- package/src/components/Input/core/_Input.ts +58 -3
- package/src/components/Input/vue/VueInput.vue +2 -6
- package/src/components/Link/core/_Link.ts +1 -0
- package/src/components/Link/vue/VueLink.vue +1 -0
- package/src/components/Pagination/core/_Pagination.ts +10 -18
- package/src/components/Radio/core/_Radio.ts +131 -41
- package/src/components/Radio/vue/VueRadio.vue +1 -5
- package/src/components/Rating/core/_Rating.ts +62 -5
- package/src/components/Rating/vue/VueRating.vue +3 -0
- package/src/components/Select/core/_Select.ts +55 -6
- package/src/components/SelectionButton/core/SelectionButton.ts +13 -0
- package/src/components/SelectionButton/core/_SelectionButton.ts +551 -0
- package/src/components/SelectionButton/react/ReactSelectionButton.tsx +16 -0
- package/src/components/SelectionButton/react/index.ts +4 -0
- package/src/components/SelectionButton/vue/VueSelectionButton.vue +33 -0
- package/src/components/SelectionButton/vue/index.ts +5 -0
- package/src/components/SelectionButtonGroup/core/SelectionButtonGroup.ts +13 -0
- package/src/components/SelectionButtonGroup/core/_SelectionButtonGroup.ts +423 -0
- package/src/components/SelectionButtonGroup/react/ReactSelectionButtonGroup.tsx +29 -0
- package/src/components/SelectionButtonGroup/react/index.ts +9 -0
- package/src/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.vue +89 -0
- package/src/components/SelectionButtonGroup/vue/index.ts +5 -0
- package/src/components/SelectionCard/core/SelectionCard.ts +13 -0
- package/src/components/SelectionCard/core/_SelectionCard.ts +384 -0
- package/src/components/SelectionCard/react/ReactSelectionCard.tsx +16 -0
- package/src/components/SelectionCard/react/index.ts +4 -0
- package/src/components/SelectionCard/vue/VueSelectionCard.vue +33 -0
- package/src/components/SelectionCard/vue/index.ts +5 -0
- package/src/components/SelectionCardGroup/core/SelectionCardGroup.ts +13 -0
- package/src/components/SelectionCardGroup/core/_SelectionCardGroup.ts +396 -0
- package/src/components/SelectionCardGroup/react/ReactSelectionCardGroup.tsx +29 -0
- package/src/components/SelectionCardGroup/react/index.ts +9 -0
- package/src/components/SelectionCardGroup/vue/VueSelectionCardGroup.vue +71 -0
- package/src/components/SelectionCardGroup/vue/index.ts +5 -0
- package/src/components/Slider/core/_Slider.ts +28 -28
- package/src/components/Timeline/core/_Timeline.ts +5 -0
- package/src/components/Timeline/react/ReactTimeline.tsx +47 -24
- package/src/components/Toggle/core/_Toggle.ts +83 -9
- package/src/components/Toggle/vue/VueToggle.vue +2 -0
- package/src/shared/face-mixin.ts +233 -0
- package/src/shared/form-control-styles.ts +1 -1
- package/src/styles/ag-tokens-dark.css +4 -0
- package/src/styles/ag-tokens.css +18 -13
- package/RTL_IMPLEMENTATION_PLAN.md +0 -295
- package/dist/VueIcon.vue_vue_type_script_setup_true_lang-kC-nzMyu.js +0 -25
- package/dist/components/Input/core/_Input.BACKUP.d.ts +0 -114
- package/dist/components/Input/core/_Input.BACKUP.d.ts.map +0 -1
- package/dist/components/Input/core/_Input.BACKUP.js +0 -511
- package/dist/global.d.js +0 -1
- package/src/components/Input/core/_Input.BACKUP.ts +0 -710
- package/src/global.d.ts +0 -43
|
@@ -1,30 +1,63 @@
|
|
|
1
1
|
import { LitElement as u, css as g, html as n } from "lit";
|
|
2
|
-
import { n as
|
|
3
|
-
import { e as
|
|
4
|
-
import { isHorizontalLabel as
|
|
2
|
+
import { n as i } from "../../../property-CemaeiRl.js";
|
|
3
|
+
import { e as m } from "../../../query-BykXNUlT.js";
|
|
4
|
+
import { isHorizontalLabel as p, createFormControlIds as b, buildAriaDescribedBy as f } from "../../../shared/form-control-utils.js";
|
|
5
5
|
import { formControlStyles as v } from "../../../shared/form-control-styles.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { FaceMixin as y, syncInnerInputValidity as $ } from "../../../shared/face-mixin.js";
|
|
7
|
+
var E = Object.defineProperty, s = (h, e, o, r) => {
|
|
8
|
+
for (var a = void 0, l = h.length - 1, d; l >= 0; l--)
|
|
9
|
+
(d = h[l]) && (a = d(e, o, a) || a);
|
|
10
|
+
return a && E(e, o, a), a;
|
|
10
11
|
};
|
|
11
|
-
const c = class c extends u {
|
|
12
|
+
const c = class c extends y(u) {
|
|
12
13
|
constructor() {
|
|
13
|
-
super(...arguments), this.size = "", this.multiple = !1, this.disabled = !1, this.
|
|
14
|
+
super(...arguments), this.size = "", this.multiple = !1, this.disabled = !1, this.label = "", this.labelPosition = "top", this.labelHidden = !1, this.noLabel = !1, this.required = !1, this.invalid = !1, this.errorMessage = "", this.helpText = "";
|
|
14
15
|
}
|
|
16
|
+
// ─── FACE ─────────────────────────────────────────────────────────────────
|
|
17
|
+
/**
|
|
18
|
+
* FACE lifecycle: called when the parent form is reset.
|
|
19
|
+
* Restores each option to its defaultSelected state (the `selected`
|
|
20
|
+
* attribute from the original HTML), then re-syncs the form value.
|
|
21
|
+
*/
|
|
22
|
+
formResetCallback() {
|
|
23
|
+
this.selectElement && Array.from(this.selectElement.options).forEach((e) => e.selected = e.defaultSelected), this._syncFormValue(), this._internals.setValidity({});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Sync the form value to ElementInternals.
|
|
27
|
+
* Single select: submits the selected value as a string.
|
|
28
|
+
* Multi-select: uses the FormData overload to submit all selected values
|
|
29
|
+
* under the same key (matching native <select multiple> behavior).
|
|
30
|
+
*/
|
|
31
|
+
_syncFormValue() {
|
|
32
|
+
if (this.selectElement)
|
|
33
|
+
if (this.multiple) {
|
|
34
|
+
const e = new FormData();
|
|
35
|
+
Array.from(this.selectElement.selectedOptions).forEach((o) => {
|
|
36
|
+
e.append(this.name, o.value);
|
|
37
|
+
}), this._internals.setFormValue(e);
|
|
38
|
+
} else
|
|
39
|
+
this._internals.setFormValue(this.selectElement.value || "");
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Sync validity to ElementInternals by delegating to the inner <select>.
|
|
43
|
+
*/
|
|
44
|
+
_syncValidity() {
|
|
45
|
+
$(this._internals, this.selectElement);
|
|
46
|
+
}
|
|
47
|
+
// ─── End FACE ─────────────────────────────────────────────────────────────
|
|
15
48
|
firstUpdated() {
|
|
16
49
|
this.handleSlotChange();
|
|
17
50
|
const e = this.shadowRoot?.querySelector("slot");
|
|
18
|
-
e && e.addEventListener("slotchange", () => this.handleSlotChange());
|
|
51
|
+
e && e.addEventListener("slotchange", () => this.handleSlotChange()), this._syncFormValue(), this._syncValidity();
|
|
19
52
|
}
|
|
20
53
|
handleSlotChange() {
|
|
21
54
|
if (!this.selectElement) return;
|
|
22
55
|
const e = this.shadowRoot?.querySelector("slot");
|
|
23
56
|
if (!e) return;
|
|
24
|
-
e.assignedNodes().forEach((
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
27
|
-
(
|
|
57
|
+
e.assignedNodes().forEach((r) => {
|
|
58
|
+
if (r.nodeType === Node.ELEMENT_NODE) {
|
|
59
|
+
const a = r;
|
|
60
|
+
(a.tagName === "OPTION" || a.tagName === "OPTGROUP") && this.selectElement.appendChild(r);
|
|
28
61
|
}
|
|
29
62
|
});
|
|
30
63
|
}
|
|
@@ -44,35 +77,35 @@ const c = class c extends u {
|
|
|
44
77
|
})), this.onBlur && this.onBlur(e);
|
|
45
78
|
}
|
|
46
79
|
handleChange(e) {
|
|
47
|
-
const
|
|
48
|
-
let
|
|
49
|
-
this.multiple ?
|
|
50
|
-
const
|
|
51
|
-
detail: { value:
|
|
80
|
+
const o = e.target;
|
|
81
|
+
let r;
|
|
82
|
+
this.multiple ? r = Array.from(o.selectedOptions).map((l) => l.value) : r = o.value, this._syncFormValue(), this._syncValidity();
|
|
83
|
+
const a = new CustomEvent("change", {
|
|
84
|
+
detail: { value: r },
|
|
52
85
|
bubbles: !0,
|
|
53
86
|
composed: !0
|
|
54
87
|
});
|
|
55
|
-
this.dispatchEvent(
|
|
88
|
+
this.dispatchEvent(a), this.onChange && this.onChange(a);
|
|
56
89
|
}
|
|
57
90
|
renderLabel(e) {
|
|
58
91
|
if (!this.label || this.noLabel) return "";
|
|
59
|
-
const
|
|
60
|
-
return
|
|
92
|
+
const o = [];
|
|
93
|
+
return p(this.labelPosition) ? (o.push("ag-form-control__label--horizontal"), o.push(`ag-form-control__label--${this.labelPosition}`)) : this.labelPosition === "bottom" && o.push(`ag-form-control__label--${this.labelPosition}`), n`
|
|
61
94
|
<label
|
|
62
95
|
for=${e.inputId}
|
|
63
|
-
class="ag-form-control__label ${this.labelHidden ? "ag-form-control__label--hidden" : ""} ${this.required ? "ag-form-control__label--required" : ""} ${
|
|
96
|
+
class="ag-form-control__label ${this.labelHidden ? "ag-form-control__label--hidden" : ""} ${this.required ? "ag-form-control__label--required" : ""} ${o.join(" ")}"
|
|
64
97
|
>
|
|
65
98
|
${this.label}
|
|
66
99
|
</label>
|
|
67
100
|
`;
|
|
68
101
|
}
|
|
69
102
|
render() {
|
|
70
|
-
const e =
|
|
103
|
+
const e = b("select"), o = f({
|
|
71
104
|
helperId: e.helperId,
|
|
72
105
|
errorId: e.errorId,
|
|
73
106
|
hasHelper: !!this.helpText && !this.invalid,
|
|
74
107
|
hasError: !!this.invalid && !!this.errorMessage
|
|
75
|
-
}),
|
|
108
|
+
}), r = p(this.labelPosition), a = n`
|
|
76
109
|
<select
|
|
77
110
|
id=${e.inputId}
|
|
78
111
|
class="select"
|
|
@@ -88,7 +121,7 @@ const c = class c extends u {
|
|
|
88
121
|
@change=${this.handleChange}
|
|
89
122
|
aria-disabled=${this.disabled ? "true" : "false"}
|
|
90
123
|
aria-invalid=${this.invalid ? "true" : "false"}
|
|
91
|
-
aria-describedby=${
|
|
124
|
+
aria-describedby=${o || void 0}
|
|
92
125
|
></select>
|
|
93
126
|
<slot></slot>
|
|
94
127
|
`, l = this.helpText && !this.invalid ? n`<div id=${e.helperId} class="ag-form-control__helper">
|
|
@@ -96,21 +129,21 @@ const c = class c extends u {
|
|
|
96
129
|
</div>` : "", d = this.invalid && this.errorMessage ? n`<div id=${e.errorId} class="ag-form-control__error">
|
|
97
130
|
${this.errorMessage}
|
|
98
131
|
</div>` : "";
|
|
99
|
-
return
|
|
132
|
+
return r ? n`
|
|
100
133
|
<div class="ag-form-control--horizontal">
|
|
101
134
|
${this.renderLabel(e)}
|
|
102
|
-
${
|
|
135
|
+
${a}
|
|
103
136
|
</div>
|
|
104
137
|
${l}
|
|
105
138
|
${d}
|
|
106
139
|
` : this.labelPosition === "bottom" ? n`
|
|
107
|
-
${
|
|
140
|
+
${a}
|
|
108
141
|
${l}
|
|
109
142
|
${d}
|
|
110
143
|
${this.renderLabel(e)}
|
|
111
144
|
` : n`
|
|
112
145
|
${this.renderLabel(e)}
|
|
113
|
-
${
|
|
146
|
+
${a}
|
|
114
147
|
${l}
|
|
115
148
|
${d}
|
|
116
149
|
`;
|
|
@@ -140,7 +173,7 @@ c.styles = [
|
|
|
140
173
|
/* Base styling */
|
|
141
174
|
padding: var(--ag-space-2) var(--ag-space-8) var(--ag-space-2) var(--ag-space-3);
|
|
142
175
|
-moz-padding-start: calc(var(--ag-space-3) - 3px);
|
|
143
|
-
font-size: var(--ag-font-size-
|
|
176
|
+
font-size: var(--ag-font-size-sm);
|
|
144
177
|
font-weight: 400;
|
|
145
178
|
line-height: 1.5;
|
|
146
179
|
font-family: inherit;
|
|
@@ -190,7 +223,7 @@ c.styles = [
|
|
|
190
223
|
padding-block-start: var(--ag-space-1);
|
|
191
224
|
padding-block-end: var(--ag-space-1);
|
|
192
225
|
padding-inline-start: var(--ag-space-2);
|
|
193
|
-
font-size: var(--ag-font-size-
|
|
226
|
+
font-size: var(--ag-font-size-sm);
|
|
194
227
|
}
|
|
195
228
|
|
|
196
229
|
/* Large size variant */
|
|
@@ -211,59 +244,56 @@ c.styles = [
|
|
|
211
244
|
`
|
|
212
245
|
];
|
|
213
246
|
let t = c;
|
|
214
|
-
|
|
215
|
-
|
|
247
|
+
s([
|
|
248
|
+
i({ type: String, reflect: !0 })
|
|
216
249
|
], t.prototype, "size");
|
|
217
|
-
|
|
218
|
-
|
|
250
|
+
s([
|
|
251
|
+
i({ type: Boolean, reflect: !0 })
|
|
219
252
|
], t.prototype, "multiple");
|
|
220
|
-
|
|
221
|
-
|
|
253
|
+
s([
|
|
254
|
+
i({ type: Boolean, reflect: !0 })
|
|
222
255
|
], t.prototype, "disabled");
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
], t.prototype, "name");
|
|
226
|
-
o([
|
|
227
|
-
a({ type: Number, attribute: "multiple-size" })
|
|
256
|
+
s([
|
|
257
|
+
i({ type: Number, attribute: "multiple-size" })
|
|
228
258
|
], t.prototype, "multipleSize");
|
|
229
|
-
|
|
230
|
-
|
|
259
|
+
s([
|
|
260
|
+
i({ type: String })
|
|
231
261
|
], t.prototype, "label");
|
|
232
|
-
|
|
233
|
-
|
|
262
|
+
s([
|
|
263
|
+
i({ type: String, attribute: "label-position" })
|
|
234
264
|
], t.prototype, "labelPosition");
|
|
235
|
-
|
|
236
|
-
|
|
265
|
+
s([
|
|
266
|
+
i({ type: Boolean, attribute: "label-hidden" })
|
|
237
267
|
], t.prototype, "labelHidden");
|
|
238
|
-
|
|
239
|
-
|
|
268
|
+
s([
|
|
269
|
+
i({ type: Boolean, attribute: "no-label" })
|
|
240
270
|
], t.prototype, "noLabel");
|
|
241
|
-
|
|
242
|
-
|
|
271
|
+
s([
|
|
272
|
+
i({ type: Boolean })
|
|
243
273
|
], t.prototype, "required");
|
|
244
|
-
|
|
245
|
-
|
|
274
|
+
s([
|
|
275
|
+
i({ type: Boolean })
|
|
246
276
|
], t.prototype, "invalid");
|
|
247
|
-
|
|
248
|
-
|
|
277
|
+
s([
|
|
278
|
+
i({ type: String, attribute: "error-message" })
|
|
249
279
|
], t.prototype, "errorMessage");
|
|
250
|
-
|
|
251
|
-
|
|
280
|
+
s([
|
|
281
|
+
i({ type: String, attribute: "help-text" })
|
|
252
282
|
], t.prototype, "helpText");
|
|
253
|
-
|
|
254
|
-
|
|
283
|
+
s([
|
|
284
|
+
i({ attribute: !1 })
|
|
255
285
|
], t.prototype, "onClick");
|
|
256
|
-
|
|
257
|
-
|
|
286
|
+
s([
|
|
287
|
+
i({ attribute: !1 })
|
|
258
288
|
], t.prototype, "onFocus");
|
|
259
|
-
|
|
260
|
-
|
|
289
|
+
s([
|
|
290
|
+
i({ attribute: !1 })
|
|
261
291
|
], t.prototype, "onBlur");
|
|
262
|
-
|
|
263
|
-
|
|
292
|
+
s([
|
|
293
|
+
i({ attribute: !1 })
|
|
264
294
|
], t.prototype, "onChange");
|
|
265
|
-
|
|
266
|
-
|
|
295
|
+
s([
|
|
296
|
+
m("select")
|
|
267
297
|
], t.prototype, "selectElement");
|
|
268
298
|
customElements.get("ag-select") || customElements.define("ag-select", t);
|
|
269
299
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionButton.d.ts","sourceRoot":"","sources":["../../../../src/components/SelectionButton/core/SelectionButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAM1D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,iBAAiB,CAAC;KAC1C;CACF;AAED,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
export type SelectionButtonTheme = 'success' | 'info' | 'error' | 'warning' | 'monochrome' | '';
|
|
4
|
+
export type SelectionButtonSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
export type SelectionButtonShape = '' | 'rounded' | 'capsule';
|
|
6
|
+
export interface SelectionButtonProps {
|
|
7
|
+
/** Unique value for this button (required) */
|
|
8
|
+
value: string;
|
|
9
|
+
/** Accessible label for this button (required) */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Whether this button is selected */
|
|
12
|
+
checked?: boolean;
|
|
13
|
+
/** Whether this button is disabled */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface SelectionButtonInternalProps {
|
|
17
|
+
/** Input type (set by parent group) */
|
|
18
|
+
_type?: 'radio' | 'checkbox';
|
|
19
|
+
/** Input name (set by parent group) */
|
|
20
|
+
_name?: string;
|
|
21
|
+
/** Theme (set by parent group) */
|
|
22
|
+
_theme?: SelectionButtonTheme;
|
|
23
|
+
/** Size (set by parent group) */
|
|
24
|
+
_size?: SelectionButtonSize;
|
|
25
|
+
/** Shape (set by parent group) */
|
|
26
|
+
_shape?: SelectionButtonShape;
|
|
27
|
+
}
|
|
28
|
+
export declare class AgSelectionButton extends LitElement implements SelectionButtonProps, SelectionButtonInternalProps {
|
|
29
|
+
static styles: import('lit').CSSResult;
|
|
30
|
+
value: string;
|
|
31
|
+
label: string;
|
|
32
|
+
checked: boolean;
|
|
33
|
+
disabled: boolean;
|
|
34
|
+
_type: 'radio' | 'checkbox';
|
|
35
|
+
_name: string;
|
|
36
|
+
_theme: SelectionButtonTheme;
|
|
37
|
+
_size: SelectionButtonSize;
|
|
38
|
+
_shape: SelectionButtonShape;
|
|
39
|
+
constructor();
|
|
40
|
+
focus(): void;
|
|
41
|
+
private _handleClick;
|
|
42
|
+
private _handleKeyDown;
|
|
43
|
+
private _renderIndicator;
|
|
44
|
+
render(): import('lit').TemplateResult<1>;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=_SelectionButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_SelectionButton.d.ts","sourceRoot":"","sources":["../../../../src/components/SelectionButton/core/_SelectionButton.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAGrD,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,GAAG,EAAE,CAAC;AAChG,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACrD,MAAM,MAAM,oBAAoB,GAAG,EAAE,GAAG,SAAS,GAAG,SAAS,CAAC;AAE9D,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAGD,UAAU,4BAA4B;IACpC,uCAAuC;IACvC,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC7B,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,iCAAiC;IACjC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,kCAAkC;IAClC,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED,qBAAa,iBAAkB,SAAQ,UAAW,YAAW,oBAAoB,EAAE,4BAA4B;IAC7G,OAAgB,MAAM,0BAuWpB;IAGM,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,EAAE,MAAM,CAAC;IAGd,OAAO,EAAE,OAAO,CAAC;IAGjB,QAAQ,EAAE,OAAO,CAAC;IAIlB,KAAK,EAAE,OAAO,GAAG,UAAU,CAAC;IAG5B,KAAK,EAAE,MAAM,CAAC;IAGd,MAAM,EAAE,oBAAoB,CAAC;IAG7B,KAAK,EAAE,mBAAmB,CAAC;IAG3B,MAAM,EAAE,oBAAoB,CAAC;;IAe5B,KAAK;IAKd,OAAO,CAAC,YAAY;IAsBpB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,gBAAgB;IAoBf,MAAM;CA4ChB"}
|