@six-group/ui-library 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{form-control-d369af14.js → form-control-9769b310.js} +10 -7
- package/dist/cjs/form-control-9769b310.js.map +1 -0
- package/dist/cjs/index-900437fc.js +8 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/six-checkbox.cjs.entry.js +6 -3
- package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/six-datepicker.cjs.entry.js +2 -7
- package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/six-error.cjs.entry.js +21 -0
- package/dist/cjs/six-error.cjs.entry.js.map +1 -0
- package/dist/cjs/six-group-label.cjs.entry.js +2 -2
- package/dist/cjs/six-group-label.cjs.entry.js.map +1 -1
- package/dist/cjs/six-input.cjs.entry.js +6 -3
- package/dist/cjs/six-input.cjs.entry.js.map +1 -1
- package/dist/cjs/six-range.cjs.entry.js +6 -3
- package/dist/cjs/six-range.cjs.entry.js.map +1 -1
- package/dist/cjs/six-select.cjs.entry.js +6 -3
- package/dist/cjs/six-select.cjs.entry.js.map +1 -1
- package/dist/cjs/six-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/six-sidebar.cjs.entry.js.map +1 -1
- package/dist/cjs/six-switch.cjs.entry.js +22 -4
- package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tag.cjs.entry.js +23 -1
- package/dist/cjs/six-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/six-textarea.cjs.entry.js +6 -3
- package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/six-timepicker.cjs.entry.js +4 -9
- package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/ui-library.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/six-checkbox/six-checkbox.css +1 -1
- package/dist/collection/components/six-checkbox/six-checkbox.js +25 -4
- package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
- package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js +6 -2
- package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js.map +1 -1
- package/dist/collection/components/six-datepicker/six-datepicker.js +22 -11
- package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
- package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js +1 -1
- package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js.map +1 -1
- package/dist/collection/components/six-dropdown/six-dropdown.css +2 -1
- package/dist/collection/components/six-error/six-error.css +5 -0
- package/dist/collection/components/six-error/six-error.js +25 -0
- package/dist/collection/components/six-error/six-error.js.map +1 -0
- package/dist/collection/components/six-group-label/six-group-label.css +1 -1
- package/dist/collection/components/six-group-label/test/six-group-label.spec.js +3 -1
- package/dist/collection/components/six-group-label/test/six-group-label.spec.js.map +1 -1
- package/dist/collection/components/six-input/six-input.css +1 -1
- package/dist/collection/components/six-input/six-input.js +27 -4
- package/dist/collection/components/six-input/six-input.js.map +1 -1
- package/dist/collection/components/six-input/test/six-input.spec.js +3 -1
- package/dist/collection/components/six-input/test/six-input.spec.js.map +1 -1
- package/dist/collection/components/six-range/six-range.css +1 -1
- package/dist/collection/components/six-range/six-range.js +24 -3
- package/dist/collection/components/six-range/six-range.js.map +1 -1
- package/dist/collection/components/six-range/test/six-range.spec.js +3 -1
- package/dist/collection/components/six-range/test/six-range.spec.js.map +1 -1
- package/dist/collection/components/six-select/six-select.css +1 -1
- package/dist/collection/components/six-select/six-select.js +24 -3
- package/dist/collection/components/six-select/six-select.js.map +1 -1
- package/dist/collection/components/six-select/test/six-select.spec.js +6 -2
- package/dist/collection/components/six-select/test/six-select.spec.js.map +1 -1
- package/dist/collection/components/six-sidebar/six-sidebar.css +1 -0
- package/dist/collection/components/six-switch/six-switch.css +1 -1
- package/dist/collection/components/six-switch/six-switch.js +45 -4
- package/dist/collection/components/six-switch/six-switch.js.map +1 -1
- package/dist/collection/components/six-switch/test/six-switch.spec.js +6 -2
- package/dist/collection/components/six-switch/test/six-switch.spec.js.map +1 -1
- package/dist/collection/components/six-tag/six-tag.js +23 -1
- package/dist/collection/components/six-tag/six-tag.js.map +1 -1
- package/dist/collection/components/six-tag/test/six-tag.spec.js +12 -0
- package/dist/collection/components/six-tag/test/six-tag.spec.js.map +1 -1
- package/dist/collection/components/six-textarea/six-textarea.css +1 -1
- package/dist/collection/components/six-textarea/six-textarea.js +25 -4
- package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
- package/dist/collection/components/six-textarea/test/six-textarea.spec.js +3 -1
- package/dist/collection/components/six-textarea/test/six-textarea.spec.js.map +1 -1
- package/dist/collection/components/six-timepicker/six-timepicker.js +24 -12
- package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
- package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js +15 -15
- package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js.map +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.css +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.js +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -1
- package/dist/collection/functional-components/form-control/form-control.js +8 -6
- package/dist/collection/functional-components/form-control/form-control.js.map +1 -1
- package/dist/components/form-control.js +9 -6
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/six-checkbox.js +14 -3
- package/dist/components/six-checkbox.js.map +1 -1
- package/dist/components/six-datepicker.js +10 -8
- package/dist/components/six-datepicker.js.map +1 -1
- package/dist/components/six-dropdown2.js +8 -2
- package/dist/components/six-dropdown2.js.map +1 -1
- package/dist/components/six-error.d.ts +11 -0
- package/dist/components/six-error.js +8 -0
- package/dist/components/six-error.js.map +1 -0
- package/dist/components/six-error2.js +32 -0
- package/dist/components/six-error2.js.map +1 -0
- package/dist/components/six-group-label.js +8 -2
- package/dist/components/six-group-label.js.map +1 -1
- package/dist/components/six-header.js +8 -2
- package/dist/components/six-header.js.map +1 -1
- package/dist/components/six-input2.js +14 -3
- package/dist/components/six-input2.js.map +1 -1
- package/dist/components/six-range.js +14 -3
- package/dist/components/six-range.js.map +1 -1
- package/dist/components/six-search-field.js +7 -1
- package/dist/components/six-search-field.js.map +1 -1
- package/dist/components/six-select.js +33 -16
- package/dist/components/six-select.js.map +1 -1
- package/dist/components/six-sidebar.js +1 -1
- package/dist/components/six-sidebar.js.map +1 -1
- package/dist/components/six-switch.js +30 -4
- package/dist/components/six-switch.js.map +1 -1
- package/dist/components/six-tag2.js +33 -5
- package/dist/components/six-tag2.js.map +1 -1
- package/dist/components/six-textarea.js +14 -3
- package/dist/components/six-textarea.js.map +1 -1
- package/dist/components/six-timepicker2.js +12 -10
- package/dist/components/six-timepicker2.js.map +1 -1
- package/dist/components/six-tooltip2.js +2 -2
- package/dist/components/six-tooltip2.js.map +1 -1
- package/dist/components.json +419 -48
- package/dist/esm/{form-control-32cb533f.js → form-control-b0febe88.js} +10 -7
- package/dist/esm/form-control-b0febe88.js.map +1 -0
- package/dist/esm/index-8a74f992.js +8 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/six-checkbox.entry.js +6 -3
- package/dist/esm/six-checkbox.entry.js.map +1 -1
- package/dist/esm/six-datepicker.entry.js +2 -7
- package/dist/esm/six-datepicker.entry.js.map +1 -1
- package/dist/esm/six-dropdown_2.entry.js +1 -1
- package/dist/esm/six-dropdown_2.entry.js.map +1 -1
- package/dist/esm/six-error.entry.js +17 -0
- package/dist/esm/six-error.entry.js.map +1 -0
- package/dist/esm/six-group-label.entry.js +2 -2
- package/dist/esm/six-group-label.entry.js.map +1 -1
- package/dist/esm/six-input.entry.js +6 -3
- package/dist/esm/six-input.entry.js.map +1 -1
- package/dist/esm/six-range.entry.js +6 -3
- package/dist/esm/six-range.entry.js.map +1 -1
- package/dist/esm/six-select.entry.js +6 -3
- package/dist/esm/six-select.entry.js.map +1 -1
- package/dist/esm/six-sidebar.entry.js +1 -1
- package/dist/esm/six-sidebar.entry.js.map +1 -1
- package/dist/esm/six-switch.entry.js +22 -4
- package/dist/esm/six-switch.entry.js.map +1 -1
- package/dist/esm/six-tag.entry.js +23 -1
- package/dist/esm/six-tag.entry.js.map +1 -1
- package/dist/esm/six-textarea.entry.js +6 -3
- package/dist/esm/six-textarea.entry.js.map +1 -1
- package/dist/esm/six-timepicker.entry.js +4 -9
- package/dist/esm/six-timepicker.entry.js.map +1 -1
- package/dist/esm/six-tooltip.entry.js +2 -2
- package/dist/esm/six-tooltip.entry.js.map +1 -1
- package/dist/esm/ui-library.js +1 -1
- package/dist/types/components/six-checkbox/six-checkbox.d.ts +4 -1
- package/dist/types/components/six-datepicker/six-datepicker.d.ts +4 -2
- package/dist/types/components/six-error/six-error.d.ts +9 -0
- package/dist/types/components/six-input/six-input.d.ts +7 -2
- package/dist/types/components/six-range/six-range.d.ts +4 -1
- package/dist/types/components/six-select/six-select.d.ts +4 -1
- package/dist/types/components/six-switch/six-switch.d.ts +8 -1
- package/dist/types/components/six-tag/six-tag.d.ts +8 -0
- package/dist/types/components/six-textarea/six-textarea.d.ts +4 -1
- package/dist/types/components/six-timepicker/six-timepicker.d.ts +5 -2
- package/dist/types/components.d.ts +109 -16
- package/dist/types/functional-components/form-control/form-control.d.ts +6 -2
- package/dist/ui-library/{p-ed381ad9.entry.js → p-14c1ec31.entry.js} +2 -2
- package/dist/ui-library/p-14c1ec31.entry.js.map +1 -0
- package/dist/ui-library/p-25bb1752.entry.js +2 -0
- package/dist/ui-library/p-25bb1752.entry.js.map +1 -0
- package/dist/ui-library/p-2a141e10.entry.js +2 -0
- package/dist/ui-library/p-2a141e10.entry.js.map +1 -0
- package/dist/ui-library/p-4435ff73.entry.js +2 -0
- package/dist/ui-library/p-4435ff73.entry.js.map +1 -0
- package/dist/ui-library/p-538f3c50.entry.js +2 -0
- package/dist/ui-library/p-538f3c50.entry.js.map +1 -0
- package/dist/ui-library/p-a457fee8.entry.js +2 -0
- package/dist/ui-library/p-a457fee8.entry.js.map +1 -0
- package/dist/ui-library/p-ab91c2a9.entry.js +2 -0
- package/dist/ui-library/p-ab91c2a9.entry.js.map +1 -0
- package/dist/ui-library/p-b57afbe4.entry.js +2 -0
- package/dist/ui-library/p-b57afbe4.entry.js.map +1 -0
- package/dist/ui-library/p-b6f47c9d.entry.js +2 -0
- package/dist/ui-library/p-b6f47c9d.entry.js.map +1 -0
- package/dist/ui-library/p-db34a6cc.entry.js +2 -0
- package/dist/ui-library/p-db34a6cc.entry.js.map +1 -0
- package/dist/ui-library/p-db936ad7.entry.js +2 -0
- package/dist/ui-library/{p-d367f4f9.entry.js.map → p-db936ad7.entry.js.map} +1 -1
- package/dist/ui-library/p-dc4f41d8.entry.js +2 -0
- package/dist/ui-library/p-dc4f41d8.entry.js.map +1 -0
- package/dist/ui-library/p-e5020f0d.js +2 -0
- package/dist/ui-library/p-e5020f0d.js.map +1 -0
- package/dist/ui-library/p-e775dcb4.entry.js +2 -0
- package/dist/ui-library/p-e775dcb4.entry.js.map +1 -0
- package/dist/ui-library/p-f1dc3a88.entry.js +2 -0
- package/dist/ui-library/p-f1dc3a88.entry.js.map +1 -0
- package/dist/ui-library/ui-library.esm.js +1 -1
- package/dist/ui-library/ui-library.esm.js.map +1 -1
- package/package.json +2 -2
- package/dist/cjs/form-control-d369af14.js.map +0 -1
- package/dist/esm/form-control-32cb533f.js.map +0 -1
- package/dist/ui-library/p-02981b91.entry.js +0 -2
- package/dist/ui-library/p-02981b91.entry.js.map +0 -1
- package/dist/ui-library/p-314b2096.entry.js +0 -2
- package/dist/ui-library/p-314b2096.entry.js.map +0 -1
- package/dist/ui-library/p-330a4988.entry.js +0 -2
- package/dist/ui-library/p-330a4988.entry.js.map +0 -1
- package/dist/ui-library/p-3d9de119.entry.js +0 -2
- package/dist/ui-library/p-3d9de119.entry.js.map +0 -1
- package/dist/ui-library/p-4abed9df.entry.js +0 -2
- package/dist/ui-library/p-4abed9df.entry.js.map +0 -1
- package/dist/ui-library/p-5d6b7353.entry.js +0 -2
- package/dist/ui-library/p-5d6b7353.entry.js.map +0 -1
- package/dist/ui-library/p-72254eef.entry.js +0 -2
- package/dist/ui-library/p-72254eef.entry.js.map +0 -1
- package/dist/ui-library/p-9f0b43f9.entry.js +0 -2
- package/dist/ui-library/p-9f0b43f9.entry.js.map +0 -1
- package/dist/ui-library/p-b550a258.entry.js +0 -2
- package/dist/ui-library/p-b550a258.entry.js.map +0 -1
- package/dist/ui-library/p-bf87464b.entry.js +0 -2
- package/dist/ui-library/p-bf87464b.entry.js.map +0 -1
- package/dist/ui-library/p-d367f4f9.entry.js +0 -2
- package/dist/ui-library/p-d42c2025.js +0 -2
- package/dist/ui-library/p-d42c2025.js.map +0 -1
- package/dist/ui-library/p-ed381ad9.entry.js.map +0 -1
- package/dist/ui-library/p-ff90ffd1.entry.js +0 -2
- package/dist/ui-library/p-ff90ffd1.entry.js.map +0 -1
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
const index = require('./index-900437fc.js');
|
|
4
4
|
|
|
5
5
|
const FormControl = (props, children) => {
|
|
6
|
-
var _a, _b, _c, _d, _e, _f;
|
|
6
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7
|
+
const errorMessages = (Array.isArray(props.errorText) ? props.errorText : [props.errorText]).filter((text) => text != null && text.trim() !== '');
|
|
7
8
|
const hasLabel = props.label != null && props.label.trim() !== '' ? true : (_a = props.hasLabelSlot) !== null && _a !== void 0 ? _a : false;
|
|
8
9
|
const hasHelpText = props.helpText != null && props.helpText.trim() !== '' ? true : (_b = props.hasHelpTextSlot) !== null && _b !== void 0 ? _b : false;
|
|
10
|
+
const hasErrorText = (errorMessages.length > 0 || ((_c = props.hasErrorTextSlot) !== null && _c !== void 0 ? _c : false)) && ((_d = props.displayError) !== null && _d !== void 0 ? _d : false);
|
|
9
11
|
return (index.h("div", { part: "form-control", class: {
|
|
10
12
|
'form-control': true,
|
|
11
13
|
'form-control--small': props.size === 'small',
|
|
@@ -13,21 +15,22 @@ const FormControl = (props, children) => {
|
|
|
13
15
|
'form-control--large': props.size === 'large',
|
|
14
16
|
'form-control--has-label': hasLabel,
|
|
15
17
|
'form-control--has-help-text': hasHelpText,
|
|
16
|
-
'form-control--has-error-text':
|
|
17
|
-
'form-control--disabled': (
|
|
18
|
-
'form-control--invalid': ((
|
|
18
|
+
'form-control--has-error-text': hasErrorText,
|
|
19
|
+
'form-control--disabled': (_e = props.disabled) !== null && _e !== void 0 ? _e : false,
|
|
20
|
+
'form-control--invalid': ((_f = props.displayError) !== null && _f !== void 0 ? _f : false) && !props.disabled,
|
|
19
21
|
} },
|
|
20
22
|
index.h("label", { part: "label", id: props.labelId, class: {
|
|
21
23
|
'form-control__label': true,
|
|
22
|
-
'form-control__label__required': (
|
|
24
|
+
'form-control__label__required': (_g = props.required) !== null && _g !== void 0 ? _g : false,
|
|
23
25
|
}, htmlFor: props.inputId, "aria-hidden": hasLabel ? 'false' : 'true', onClick: props.onLabelClick },
|
|
24
26
|
index.h("slot", { name: "label" }, props.label)),
|
|
25
27
|
index.h("div", { class: "form-control__input" }, children),
|
|
26
|
-
index.h("div", { part: "error-text", id: props.errorTextId, class: "form-control__error-text", "aria-hidden":
|
|
28
|
+
index.h("div", { part: "error-text", id: props.errorTextId, class: "form-control__error-text", "aria-hidden": hasErrorText ? 'false' : 'true' },
|
|
29
|
+
index.h("slot", { name: "error-text" }, errorMessages.slice(0, (_h = props.errorTextCount) !== null && _h !== void 0 ? _h : 1).map((text) => (index.h("six-error", null, text))))),
|
|
27
30
|
index.h("div", { part: "help-text", id: props.helpTextId, class: "form-control__help-text", "aria-hidden": hasHelpText ? 'false' : 'true' },
|
|
28
31
|
index.h("slot", { name: "help-text" }, props.helpText))));
|
|
29
32
|
};
|
|
30
33
|
|
|
31
34
|
exports.FormControl = FormControl;
|
|
32
35
|
|
|
33
|
-
//# sourceMappingURL=form-control-
|
|
36
|
+
//# sourceMappingURL=form-control-9769b310.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"form-control-9769b310.js","mappings":";;;;MAoDM,WAAW,GAAG,CAAC,KAAuB,EAAE,QAAiB;;EAC7D,MAAM,aAAa,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,CACjG,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAC7C,CAAC;EAEF,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,GAAG,MAAA,KAAK,CAAC,YAAY,mCAAI,KAAK,CAAC;EACvG,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,IAAI,IAAI,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,GAAG,MAAA,KAAK,CAAC,eAAe,mCAAI,KAAK,CAAC;EACnH,MAAM,YAAY,GAAG,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,KAAK,MAAA,KAAK,CAAC,gBAAgB,mCAAI,KAAK,CAAC,MAAM,MAAA,KAAK,CAAC,YAAY,mCAAI,KAAK,CAAC,CAAC;EAEtH,QACEA,iBACE,IAAI,EAAC,cAAc,EACnB,KAAK,EAAE;MACL,cAAc,EAAE,IAAI;MACpB,qBAAqB,EAAE,KAAK,CAAC,IAAI,KAAK,OAAO;MAC7C,sBAAsB,EAAE,KAAK,CAAC,IAAI,KAAK,QAAQ;M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,CAC1C,CACF,EACN;AACJ;;;;","names":["h"],"sources":["src/functional-components/form-control/form-control.tsx"],"sourcesContent":["import { h, VNode } from '@stencil/core';\n\nexport interface FormControlProps {\n /** The input id, used to map the input to the label */\n inputId: string;\n\n /** The size of the form control */\n size: 'small' | 'medium' | 'large';\n\n /** The label id, used to map the label to the input */\n labelId?: string;\n\n /** The label text (if the label slot isn't used) */\n label?: string;\n\n /** Whether a label slot has been provided. */\n hasLabelSlot?: boolean;\n\n /** The help text id, used to map the input to the help text */\n helpTextId?: string;\n\n /** The help text (if the help-text slot isn't used) */\n helpText?: string;\n\n /** Whether a help text slot has been provided. */\n hasHelpTextSlot?: boolean;\n\n /** Whether an error text slot has been provided. */\n hasErrorTextSlot?: boolean;\n\n /** The error text id, used to map the input to the help text */\n errorTextId?: string;\n\n /** The error text (if the error-text slot isn't used) */\n errorText?: string | string[];\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n errorTextCount?: number;\n\n /** Set to true to disable the input. */\n disabled?: boolean;\n\n /** Set if the value is required. */\n required?: boolean;\n\n /** Set if the error text is displayed. */\n displayError?: boolean;\n\n /** A function that gets called when the label is clicked. */\n onLabelClick?: (event: MouseEvent) => void;\n}\n\nconst FormControl = (props: FormControlProps, children: VNode[]) => {\n const errorMessages = (Array.isArray(props.errorText) ? props.errorText : [props.errorText]).filter(\n (text) => text != null && text.trim() !== ''\n );\n\n const hasLabel = props.label != null && props.label.trim() !== '' ? true : props.hasLabelSlot ?? false;\n const hasHelpText = props.helpText != null && props.helpText.trim() !== '' ? true : props.hasHelpTextSlot ?? false;\n const hasErrorText = (errorMessages.length > 0 || (props.hasErrorTextSlot ?? false)) && (props.displayError ?? false);\n\n return (\n <div\n part=\"form-control\"\n class={{\n 'form-control': true,\n 'form-control--small': props.size === 'small',\n 'form-control--medium': props.size === 'medium',\n 'form-control--large': props.size === 'large',\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n 'form-control--has-error-text': hasErrorText,\n 'form-control--disabled': props.disabled ?? false,\n 'form-control--invalid': (props.displayError ?? false) && !props.disabled,\n }}\n >\n <label\n part=\"label\"\n id={props.labelId}\n class={{\n 'form-control__label': true,\n 'form-control__label__required': props.required ?? false,\n }}\n htmlFor={props.inputId}\n aria-hidden={hasLabel ? 'false' : 'true'}\n onClick={props.onLabelClick}\n >\n <slot name=\"label\">{props.label}</slot>\n </label>\n\n <div class=\"form-control__input\">{children}</div>\n\n <div\n part=\"error-text\"\n id={props.errorTextId}\n class=\"form-control__error-text\"\n aria-hidden={hasErrorText ? 'false' : 'true'}\n >\n <slot name=\"error-text\">\n {errorMessages.slice(0, props.errorTextCount ?? 1).map((text) => (\n <six-error>{text}</six-error>\n ))}\n </slot>\n </div>\n\n <div\n part=\"help-text\"\n id={props.helpTextId}\n class=\"form-control__help-text\"\n aria-hidden={hasHelpText ? 'false' : 'true'}\n >\n <slot name=\"help-text\">{props.helpText}</slot>\n </div>\n </div>\n );\n};\n\nexport default FormControl;\n"],"version":3}
|
|
@@ -2346,10 +2346,6 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2346
2346
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2347
2347
|
/* webpackMode: "lazy" */
|
|
2348
2348
|
'./six-timepicker.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2349
|
-
case 'six-tooltip.cjs':
|
|
2350
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2351
|
-
/* webpackMode: "lazy" */
|
|
2352
|
-
'./six-tooltip.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2353
2349
|
case 'six-dropdown_2.cjs':
|
|
2354
2350
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2355
2351
|
/* webpackMode: "lazy" */
|
|
@@ -2358,6 +2354,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2358
2354
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2359
2355
|
/* webpackMode: "lazy" */
|
|
2360
2356
|
'./six-item-picker.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2357
|
+
case 'six-tooltip.cjs':
|
|
2358
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2359
|
+
/* webpackMode: "lazy" */
|
|
2360
|
+
'./six-tooltip.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2361
2361
|
case 'six-menu-item.cjs':
|
|
2362
2362
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2363
2363
|
/* webpackMode: "lazy" */
|
|
@@ -2370,6 +2370,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2370
2370
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2371
2371
|
/* webpackMode: "lazy" */
|
|
2372
2372
|
'./six-icon-button.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2373
|
+
case 'six-error.cjs':
|
|
2374
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2375
|
+
/* webpackMode: "lazy" */
|
|
2376
|
+
'./six-error.cjs.entry.js')); }).then(processMod, consoleError);
|
|
2373
2377
|
case 'six-icon.cjs':
|
|
2374
2378
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2375
2379
|
/* webpackMode: "lazy" */
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ const index = require('./index-900437fc.js');
|
|
|
6
6
|
|
|
7
7
|
const defineCustomElements = (win, options) => {
|
|
8
8
|
if (typeof window === 'undefined') return undefined;
|
|
9
|
-
return index.bootstrapLazy(JSON.parse("[[\"six-select.cjs\",[[1,\"six-select\",{\"multiple\":[4],\"maxTagsVisible\":[2,\"max-tags-visible\"],\"disabled\":[4],\"name\":[1],\"placeholder\":[1],\"filterPlaceholder\":[1,\"filter-placeholder\"],\"filterDebounce\":[2,\"filter-debounce\"],\"size\":[1],\"hoist\":[4],\"value\":[1025],\"pill\":[4],\"helpText\":[1,\"help-text\"],\"required\":[4],\"clearable\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"line\":[4],\"filter\":[4],\"asyncFilter\":[4,\"async-filter\"],\"autocomplete\":[4],\"inputDebounce\":[2,\"input-debounce\"],\"options\":[16],\"virtualScroll\":[4,\"virtual-scroll\"],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"isOpen\":[32],\"displayLabel\":[32],\"displayTags\":[32],\"setFocus\":[64]}]]],[\"six-header.cjs\",[[1,\"six-header\",{\"shiftContent\":[4,\"shift-content\"],\"openHamburgerMenu\":[4,\"open-hamburger-menu\"],\"openSearch\":[4,\"open-search\"],\"clickableLogo\":[4,\"clickable-logo\"],\"selectedApp\":[32],\"selectedSection\":[32],\"setSearchOpenState\":[64],\"getIsSearchOpen\":[64]}]]],[\"six-datepicker.cjs\",[[1,\"six-datepicker\",{\"type\":[1],\"locale\":[1],\"open\":[1540],\"inline\":[516],\"readonly\":[4],\"disabled\":[4],\"allowedDates\":[16],\"min\":[16],\"max\":[16],\"closeOnSelect\":[4,\"close-on-select\"],\"placement\":[1],\"size\":[1],\"required\":[4],\"defaultDate\":[1,\"default-date\"],\"placeholder\":[1],\"value\":[1040],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"containingElement\":[16],\"dateFormat\":[1,\"date-format\"],\"debounce\":[2],\"name\":[513],\"clearable\":[4],\"iconPosition\":[1,\"icon-position\"],\"hoist\":[4],\"pointerDate\":[32],\"selectionMode\":[32],\"isDropDownContentUp\":[32],\"setFocus\":[64],\"select\":[64]},[[9,\"resize\",\"resizeHandler\"],[9,\"scroll\",\"scrollHandler\"]]]]],[\"six-root.cjs\",[[1,\"six-root\",{\"breakpoint\":[2],\"padded\":[4],\"stage\":[1],\"version\":[1],\"collapse\":[32]}]]],[\"six-tile.cjs\",[[1,\"six-tile\",{\"label\":[1],\"iconName\":[1,\"icon-name\"],\"closeable\":[4],\"elevated\":[4],\"disableTooltip\":[4,\"disable-tooltip\"],\"disabled\":[516],\"size\":[513],\"visible\":[32],\"hasIconSlot\":[32],\"hasLabelSlot\":[32],\"hide\":[64],\"show\":[64]}]]],[\"six-alert.cjs\",[[1,\"six-alert\",{\"open\":[1540],\"closable\":[516],\"type\":[513],\"duration\":[2],\"isVisible\":[32],\"show\":[64],\"hide\":[64],\"toast\":[64]}]]],[\"six-dialog.cjs\",[[1,\"six-dialog\",{\"open\":[1540],\"label\":[1],\"noHeader\":[4,\"no-header\"],\"hasFooter\":[32],\"isVisible\":[32],\"show\":[64],\"hide\":[64]}]]],[\"six-drawer.cjs\",[[1,\"six-drawer\",{\"open\":[1540],\"label\":[1],\"placement\":[1],\"contained\":[4],\"noHeader\":[4,\"no-header\"],\"hasFooter\":[32],\"isVisible\":[32],\"show\":[64],\"hide\":[64]}]]],[\"six-search-field.cjs\",[[1,\"six-search-field\",{\"placeholder\":[1],\"debounce\":[514],\"disabled\":[516],\"value\":[513],\"clearable\":[4]}]]],[\"six-sidebar-item-group.cjs\",[[1,\"six-sidebar-item-group\",{\"name\":[1],\"icon\":[1],\"value\":[513],\"open\":[516],\"summaryIcon\":[1,\"summary-icon\"],\"hasItems\":[32],\"summaryIconHasContent\":[32]}]]],[\"six-tab.cjs\",[[1,\"six-tab\",{\"panel\":[513],\"active\":[516],\"closable\":[4],\"disabled\":[516],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-tab-group.cjs\",[[1,\"six-tab-group\",{\"placement\":[1],\"noScrollControls\":[4,\"no-scroll-controls\"],\"hasScrollControls\":[32],\"show\":[64]}]]],[\"six-avatar.cjs\",[[1,\"six-avatar\",{\"image\":[1],\"alt\":[1],\"initials\":[1],\"shape\":[1],\"hasError\":[32]}]]],[\"six-button.cjs\",[[1,\"six-button\",{\"type\":[513],\"size\":[513],\"caret\":[4],\"disabled\":[516],\"loading\":[516],\"pill\":[516],\"circle\":[516],\"submit\":[516],\"reset\":[516],\"name\":[1],\"value\":[1],\"href\":[1],\"target\":[1],\"download\":[1],\"hasFocus\":[32],\"hasLabel\":[32],\"hasPrefix\":[32],\"hasSuffix\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-error-page.cjs\",[[1,\"six-error-page\",{\"errorCode\":[2,\"error-code\"],\"language\":[1],\"customTitle\":[1,\"custom-title\"],\"customDescription\":[16],\"customIcon\":[1,\"custom-icon\"]}]]],[\"six-file-list-item.cjs\",[[1,\"six-file-list-item\",{\"identifier\":[513],\"name\":[513],\"date\":[513],\"size\":[514],\"nodownload\":[516],\"nodelete\":[516]}]]],[\"six-file-upload.cjs\",[[2,\"six-file-upload\",{\"compact\":[4],\"label\":[1],\"disabled\":[4],\"accept\":[1],\"multiple\":[4],\"maxFileSize\":[2,\"max-file-size\"],\"isOver\":[32]},[[1,\"dragenter\",\"dragenterHandler\"],[1,\"dragover\",\"dragoverHandler\"],[1,\"dragleave\",\"dragleaveHandler\"],[1,\"drop\",\"dropHandler\"]]]]],[\"six-badge.cjs\",[[1,\"six-badge\",{\"type\":[1],\"pill\":[4],\"pulse\":[4]}]]],[\"six-card.cjs\",[[1,\"six-card\"]]],[\"six-checkbox.cjs\",[[1,\"six-checkbox\",{\"name\":[1],\"value\":[1],\"disabled\":[4],\"required\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"checked\":[1540],\"indeterminate\":[1540],\"hasFocus\":[32],\"hasLabelSlot\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-file-list.cjs\",[[1,\"six-file-list\"]]],[\"six-footer.cjs\",[[1,\"six-footer\"]]],[\"six-group-label.cjs\",[[1,\"six-group-label\",{\"size\":[513],\"label\":[1],\"helpText\":[1,\"help-text\"],\"disabled\":[516],\"required\":[4],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32]}]]],[\"six-language-switcher.cjs\",[[1,\"six-language-switcher\",{\"selected\":[1537],\"languages\":[16]}]]],[\"six-layout-grid.cjs\",[[1,\"six-layout-grid\",{\"columns\":[1026]}]]],[\"six-main-container.cjs\",[[1,\"six-main-container\",{\"padded\":[4]}]]],[\"six-menu-divider.cjs\",[[1,\"six-menu-divider\"]]],[\"six-menu-label.cjs\",[[1,\"six-menu-label\"]]],[\"six-progress-bar.cjs\",[[1,\"six-progress-bar\",{\"percentage\":[2],\"indeterminate\":[4]}]]],[\"six-progress-ring.cjs\",[[1,\"six-progress-ring\",{\"size\":[2],\"strokeWidth\":[2,\"stroke-width\"],\"percentage\":[2]}]]],[\"six-radio.cjs\",[[1,\"six-radio\",{\"name\":[1],\"value\":[513],\"disabled\":[4],\"checked\":[1540],\"invalid\":[516],\"hasFocus\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-range.cjs\",[[1,\"six-range\",{\"name\":[1],\"value\":[1026],\"required\":[4],\"helpText\":[1,\"help-text\"],\"disabled\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"min\":[2],\"max\":[2],\"step\":[2],\"tooltip\":[1],\"tooltipFormatter\":[16],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"hasTooltip\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-sidebar.cjs\",[[1,\"six-sidebar\",{\"position\":[1],\"open\":[1540],\"width\":[1],\"toggled\":[4],\"isVisible\":[32],\"toggle\":[64],\"show\":[64],\"hide\":[64],\"selectItemByIndex\":[64],\"selectItemByName\":[64]}]]],[\"six-sidebar-item.cjs\",[[1,\"six-sidebar-item\",{\"value\":[513],\"selected\":[516],\"disabled\":[516]}]]],[\"six-switch.cjs\",[[1,\"six-switch\",{\"name\":[1],\"value\":[1],\"disabled\":[4],\"required\":[4],\"checked\":[1540],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"hasFocus\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-tab-panel.cjs\",[[1,\"six-tab-panel\",{\"name\":[1],\"active\":[516]}]]],[\"six-textarea.cjs\",[[1,\"six-textarea\",{\"size\":[513],\"name\":[513],\"value\":[1537],\"helpText\":[1,\"help-text\"],\"placeholder\":[1],\"rows\":[2],\"resize\":[1],\"disabled\":[516],\"readonly\":[516],\"minlength\":[514],\"maxlength\":[514],\"required\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"autocapitalize\":[1],\"autocorrect\":[1],\"autocomplete\":[1],\"autofocus\":[4],\"spellcheck\":[4],\"inputmode\":[1],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"select\":[64],\"setSelectionRange\":[64],\"setRangeText\":[64]}]]],[\"six-icon.cjs\",[[1,\"six-icon\",{\"size\":[513],\"filled\":[4]}]]],[\"six-timepicker.cjs\",[[1,\"six-timepicker\",{\"format\":[1],\"separator\":[1],\"value\":[1025],\"open\":[1540],\"inline\":[516],\"readonly\":[4],\"disabled\":[4],\"placement\":[1],\"size\":[1],\"required\":[4],\"placeholder\":[1],\"errorText\":[1,\"error-text\"],\"label\":[1],\"invalid\":[516],\"name\":[513],\"clearable\":[4],\"iconPosition\":[1,\"icon-position\"],\"hoist\":[4],\"timeout\":[2],\"interval\":[2],\"defaultTime\":[1,\"default-time\"],\"debounce\":[2],\"isPopupContentUp\":[32],\"isDropDownContentUp\":[32],\"popupValue\":[32],\"setFocus\":[64]},[[9,\"resize\",\"resizeHandler\"],[9,\"scroll\",\"scrollHandler\"]]]]],[\"six-tag.cjs\",[[1,\"six-tag\",{\"type\":[513],\"size\":[513],\"pill\":[516],\"clearable\":[516]}]]],[\"six-details.cjs\",[[1,\"six-details\",{\"open\":[1540],\"summary\":[1],\"summaryIcon\":[1,\"summary-icon\"],\"summaryIconSize\":[513,\"summary-icon-size\"],\"disabled\":[4],\"inline\":[4],\"selectableEmpty\":[4,\"selectable-empty\"],\"hasContent\":[4,\"has-content\"],\"animateSummaryIcon\":[32],\"show\":[64],\"hide\":[64]}]]],[\"six-picto.cjs\",[[1,\"six-picto\",{\"size\":[1]}]]],[\"six-spinner.cjs\",[[1,\"six-spinner\",{\"six\":[4]}]]],[\"six-tooltip.cjs\",[[1,\"six-tooltip\",{\"content\":[1],\"placement\":[1],\"disabled\":[4],\"distance\":[2],\"open\":[1540],\"skidding\":[2],\"trigger\":[1],\"show\":[64],\"hide\":[64]}]]],[\"set-attributes_2.cjs\",[[1,\"six-stage-indicator\",{\"stage\":[1]}],[4,\"set-attributes\",{\"value\":[16]}]]],[\"six-item-picker.cjs\",[[1,\"six-item-picker\",{\"value\":[1544],\"type\":[1],\"min\":[1544],\"max\":[1544],\"roundtrip\":[516],\"step\":[514],\"items\":[16],\"padded\":[4],\"paddingLength\":[2,\"padding-length\"],\"paddingChar\":[1,\"padding-char\"],\"paddingDirection\":[1,\"padding-direction\"],\"timeout\":[2],\"interval\":[2],\"debounce\":[2],\"_items\":[32],\"_itemIndexes\":[32]}]]],[\"six-menu-item.cjs\",[[1,\"six-menu-item\",{\"checked\":[516],\"value\":[513],\"disabled\":[516],\"hasFocus\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"getTextLabel\":[64]}]]],[\"six-input.cjs\",[[1,\"six-input\",{\"type\":[513],\"size\":[513],\"name\":[513],\"value\":[1537],\"pill\":[516],\"helpText\":[1,\"help-text\"],\"placeholder\":[1],\"disabled\":[516],\"readonly\":[516],\"minlength\":[514],\"maxlength\":[514],\"min\":[514],\"max\":[514],\"step\":[514],\"pattern\":[513],\"required\":[4],\"autocapitalize\":[1],\"autocorrect\":[1],\"autocomplete\":[1],\"autofocus\":[4],\"spellcheck\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"clearable\":[4],\"togglePassword\":[4,\"toggle-password\"],\"inputmode\":[1],\"line\":[4],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"isPasswordVisible\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"select\":[64],\"setSelectionRange\":[64],\"setRangeText\":[64]}]]],[\"six-dropdown_2.cjs\",[[1,\"six-dropdown\",{\"open\":[1540],\"placement\":[1],\"closeOnSelect\":[4,\"close-on-select\"],\"distance\":[2],\"skidding\":[2],\"hoist\":[4],\"containingElement\":[16],\"filter\":[4],\"asyncFilter\":[4,\"async-filter\"],\"filterPlaceholder\":[1,\"filter-placeholder\"],\"autofocusFilter\":[4,\"autofocus-filter\"],\"filterDebounce\":[2,\"filter-debounce\"],\"disableHideOnEnterAndSpace\":[4,\"disable-hide-on-enter-and-space\"],\"options\":[16],\"virtualScroll\":[4,\"virtual-scroll\"],\"filteredOptions\":[32],\"show\":[64],\"hide\":[64],\"reposition\":[64]}],[1,\"six-menu\",{\"removeBoxShadow\":[4,\"remove-box-shadow\"],\"items\":[16],\"itemsShown\":[2,\"items-shown\"],\"virtualScroll\":[4,\"virtual-scroll\"],\"itemSize\":[2,\"item-size\"],\"scrollingDebounce\":[2,\"scrolling-debounce\"],\"scrollingIndex\":[32],\"sixMenuItemHeight\":[32],\"typeToSelect\":[64]}]]],[\"six-icon-button.cjs\",[[1,\"six-icon-button\",{\"name\":[513],\"size\":[513],\"label\":[513],\"disabled\":[516],\"html\":[513]}]]]]"), options);
|
|
9
|
+
return index.bootstrapLazy(JSON.parse("[[\"six-select.cjs\",[[1,\"six-select\",{\"multiple\":[4],\"maxTagsVisible\":[2,\"max-tags-visible\"],\"disabled\":[4],\"name\":[1],\"placeholder\":[1],\"filterPlaceholder\":[1,\"filter-placeholder\"],\"filterDebounce\":[2,\"filter-debounce\"],\"size\":[1],\"hoist\":[4],\"value\":[1025],\"pill\":[4],\"helpText\":[1,\"help-text\"],\"required\":[4],\"clearable\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"errorTextCount\":[2,\"error-text-count\"],\"invalid\":[516],\"line\":[4],\"filter\":[4],\"asyncFilter\":[4,\"async-filter\"],\"autocomplete\":[4],\"inputDebounce\":[2,\"input-debounce\"],\"options\":[16],\"virtualScroll\":[4,\"virtual-scroll\"],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"hasErrorTextSlot\":[32],\"isOpen\":[32],\"displayLabel\":[32],\"displayTags\":[32],\"setFocus\":[64]}]]],[\"six-header.cjs\",[[1,\"six-header\",{\"shiftContent\":[4,\"shift-content\"],\"openHamburgerMenu\":[4,\"open-hamburger-menu\"],\"openSearch\":[4,\"open-search\"],\"clickableLogo\":[4,\"clickable-logo\"],\"selectedApp\":[32],\"selectedSection\":[32],\"setSearchOpenState\":[64],\"getIsSearchOpen\":[64]}]]],[\"six-datepicker.cjs\",[[1,\"six-datepicker\",{\"type\":[1],\"locale\":[1],\"open\":[1540],\"inline\":[516],\"readonly\":[4],\"disabled\":[4],\"allowedDates\":[16],\"min\":[16],\"max\":[16],\"closeOnSelect\":[4,\"close-on-select\"],\"placement\":[1],\"size\":[1],\"required\":[4],\"defaultDate\":[1,\"default-date\"],\"placeholder\":[1],\"value\":[1040],\"label\":[1],\"errorText\":[1,\"error-text\"],\"errorTextCount\":[2,\"error-text-count\"],\"invalid\":[516],\"containingElement\":[16],\"dateFormat\":[1,\"date-format\"],\"debounce\":[2],\"name\":[513],\"clearable\":[4],\"iconPosition\":[1,\"icon-position\"],\"hoist\":[4],\"pointerDate\":[32],\"selectionMode\":[32],\"isDropDownContentUp\":[32],\"setFocus\":[64],\"select\":[64]},[[9,\"resize\",\"resizeHandler\"],[9,\"scroll\",\"scrollHandler\"]]]]],[\"six-root.cjs\",[[1,\"six-root\",{\"breakpoint\":[2],\"padded\":[4],\"stage\":[1],\"version\":[1],\"collapse\":[32]}]]],[\"six-search-field.cjs\",[[1,\"six-search-field\",{\"placeholder\":[1],\"debounce\":[514],\"disabled\":[516],\"value\":[513],\"clearable\":[4]}]]],[\"six-tile.cjs\",[[1,\"six-tile\",{\"label\":[1],\"iconName\":[1,\"icon-name\"],\"closeable\":[4],\"elevated\":[4],\"disableTooltip\":[4,\"disable-tooltip\"],\"disabled\":[516],\"size\":[513],\"visible\":[32],\"hasIconSlot\":[32],\"hasLabelSlot\":[32],\"hide\":[64],\"show\":[64]}]]],[\"six-alert.cjs\",[[1,\"six-alert\",{\"open\":[1540],\"closable\":[516],\"type\":[513],\"duration\":[2],\"isVisible\":[32],\"show\":[64],\"hide\":[64],\"toast\":[64]}]]],[\"six-dialog.cjs\",[[1,\"six-dialog\",{\"open\":[1540],\"label\":[1],\"noHeader\":[4,\"no-header\"],\"hasFooter\":[32],\"isVisible\":[32],\"show\":[64],\"hide\":[64]}]]],[\"six-drawer.cjs\",[[1,\"six-drawer\",{\"open\":[1540],\"label\":[1],\"placement\":[1],\"contained\":[4],\"noHeader\":[4,\"no-header\"],\"hasFooter\":[32],\"isVisible\":[32],\"show\":[64],\"hide\":[64]}]]],[\"six-sidebar-item-group.cjs\",[[1,\"six-sidebar-item-group\",{\"name\":[1],\"icon\":[1],\"value\":[513],\"open\":[516],\"summaryIcon\":[1,\"summary-icon\"],\"hasItems\":[32],\"summaryIconHasContent\":[32]}]]],[\"six-tab.cjs\",[[1,\"six-tab\",{\"panel\":[513],\"active\":[516],\"closable\":[4],\"disabled\":[516],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-tab-group.cjs\",[[1,\"six-tab-group\",{\"placement\":[1],\"noScrollControls\":[4,\"no-scroll-controls\"],\"hasScrollControls\":[32],\"show\":[64]}]]],[\"six-avatar.cjs\",[[1,\"six-avatar\",{\"image\":[1],\"alt\":[1],\"initials\":[1],\"shape\":[1],\"hasError\":[32]}]]],[\"six-button.cjs\",[[1,\"six-button\",{\"type\":[513],\"size\":[513],\"caret\":[4],\"disabled\":[516],\"loading\":[516],\"pill\":[516],\"circle\":[516],\"submit\":[516],\"reset\":[516],\"name\":[1],\"value\":[1],\"href\":[1],\"target\":[1],\"download\":[1],\"hasFocus\":[32],\"hasLabel\":[32],\"hasPrefix\":[32],\"hasSuffix\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-checkbox.cjs\",[[1,\"six-checkbox\",{\"name\":[1],\"value\":[1],\"disabled\":[4],\"required\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"errorTextCount\":[2,\"error-text-count\"],\"invalid\":[516],\"checked\":[1540],\"indeterminate\":[1540],\"hasFocus\":[32],\"hasLabelSlot\":[32],\"hasErrorSlot\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-error-page.cjs\",[[1,\"six-error-page\",{\"errorCode\":[2,\"error-code\"],\"language\":[1],\"customTitle\":[1,\"custom-title\"],\"customDescription\":[16],\"customIcon\":[1,\"custom-icon\"]}]]],[\"six-file-list-item.cjs\",[[1,\"six-file-list-item\",{\"identifier\":[513],\"name\":[513],\"date\":[513],\"size\":[514],\"nodownload\":[516],\"nodelete\":[516]}]]],[\"six-file-upload.cjs\",[[2,\"six-file-upload\",{\"compact\":[4],\"label\":[1],\"disabled\":[4],\"accept\":[1],\"multiple\":[4],\"maxFileSize\":[2,\"max-file-size\"],\"isOver\":[32]},[[1,\"dragenter\",\"dragenterHandler\"],[1,\"dragover\",\"dragoverHandler\"],[1,\"dragleave\",\"dragleaveHandler\"],[1,\"drop\",\"dropHandler\"]]]]],[\"six-group-label.cjs\",[[1,\"six-group-label\",{\"size\":[513],\"label\":[1],\"helpText\":[1,\"help-text\"],\"disabled\":[516],\"required\":[4],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32]}]]],[\"six-range.cjs\",[[1,\"six-range\",{\"name\":[1],\"value\":[1026],\"required\":[4],\"helpText\":[1,\"help-text\"],\"disabled\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"errorTextCount\":[2,\"error-text-count\"],\"invalid\":[516],\"min\":[2],\"max\":[2],\"step\":[2],\"tooltip\":[1],\"tooltipFormatter\":[16],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasErrorTextSlot\":[32],\"hasLabelSlot\":[32],\"hasTooltip\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-switch.cjs\",[[1,\"six-switch\",{\"name\":[1],\"value\":[1],\"disabled\":[4],\"required\":[4],\"checked\":[1540],\"label\":[1],\"errorText\":[1,\"error-text\"],\"errorTextCount\":[2,\"error-text-count\"],\"invalid\":[516],\"hasFocus\":[32],\"hasErrorTextSlot\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-textarea.cjs\",[[1,\"six-textarea\",{\"size\":[513],\"name\":[513],\"value\":[1537],\"helpText\":[1,\"help-text\"],\"placeholder\":[1],\"rows\":[2],\"resize\":[1],\"disabled\":[516],\"readonly\":[516],\"minlength\":[514],\"maxlength\":[514],\"required\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"errorTextCount\":[2,\"error-text-count\"],\"invalid\":[516],\"autocapitalize\":[1],\"autocorrect\":[1],\"autocomplete\":[1],\"autofocus\":[4],\"spellcheck\":[4],\"inputmode\":[1],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"hasErrorTextSlot\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"select\":[64],\"setSelectionRange\":[64],\"setRangeText\":[64]}]]],[\"six-badge.cjs\",[[1,\"six-badge\",{\"type\":[1],\"pill\":[4],\"pulse\":[4]}]]],[\"six-card.cjs\",[[1,\"six-card\"]]],[\"six-file-list.cjs\",[[1,\"six-file-list\"]]],[\"six-footer.cjs\",[[1,\"six-footer\"]]],[\"six-language-switcher.cjs\",[[1,\"six-language-switcher\",{\"selected\":[1537],\"languages\":[16]}]]],[\"six-layout-grid.cjs\",[[1,\"six-layout-grid\",{\"columns\":[1026]}]]],[\"six-main-container.cjs\",[[1,\"six-main-container\",{\"padded\":[4]}]]],[\"six-menu-divider.cjs\",[[1,\"six-menu-divider\"]]],[\"six-menu-label.cjs\",[[1,\"six-menu-label\"]]],[\"six-progress-bar.cjs\",[[1,\"six-progress-bar\",{\"percentage\":[2],\"indeterminate\":[4]}]]],[\"six-progress-ring.cjs\",[[1,\"six-progress-ring\",{\"size\":[2],\"strokeWidth\":[2,\"stroke-width\"],\"percentage\":[2]}]]],[\"six-radio.cjs\",[[1,\"six-radio\",{\"name\":[1],\"value\":[513],\"disabled\":[4],\"checked\":[1540],\"invalid\":[516],\"hasFocus\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-sidebar.cjs\",[[1,\"six-sidebar\",{\"position\":[1],\"open\":[1540],\"width\":[1],\"toggled\":[4],\"isVisible\":[32],\"toggle\":[64],\"show\":[64],\"hide\":[64],\"selectItemByIndex\":[64],\"selectItemByName\":[64]}]]],[\"six-sidebar-item.cjs\",[[1,\"six-sidebar-item\",{\"value\":[513],\"selected\":[516],\"disabled\":[516]}]]],[\"six-tab-panel.cjs\",[[1,\"six-tab-panel\",{\"name\":[1],\"active\":[516]}]]],[\"six-error.cjs\",[[1,\"six-error\"]]],[\"six-icon.cjs\",[[1,\"six-icon\",{\"size\":[513],\"filled\":[4]}]]],[\"six-timepicker.cjs\",[[1,\"six-timepicker\",{\"format\":[1],\"separator\":[1],\"value\":[1025],\"open\":[1540],\"inline\":[516],\"readonly\":[4],\"disabled\":[4],\"placement\":[1],\"size\":[1],\"required\":[4],\"placeholder\":[1],\"errorText\":[1,\"error-text\"],\"errorTextCount\":[2,\"error-text-count\"],\"label\":[1],\"invalid\":[516],\"name\":[513],\"clearable\":[4],\"iconPosition\":[1,\"icon-position\"],\"hoist\":[4],\"timeout\":[2],\"interval\":[2],\"defaultTime\":[1,\"default-time\"],\"debounce\":[2],\"isPopupContentUp\":[32],\"isDropDownContentUp\":[32],\"popupValue\":[32],\"setFocus\":[64]},[[9,\"resize\",\"resizeHandler\"],[9,\"scroll\",\"scrollHandler\"]]]]],[\"six-tag.cjs\",[[1,\"six-tag\",{\"type\":[513],\"size\":[513],\"pill\":[516],\"clearable\":[516]}]]],[\"six-details.cjs\",[[1,\"six-details\",{\"open\":[1540],\"summary\":[1],\"summaryIcon\":[1,\"summary-icon\"],\"summaryIconSize\":[513,\"summary-icon-size\"],\"disabled\":[4],\"inline\":[4],\"selectableEmpty\":[4,\"selectable-empty\"],\"hasContent\":[4,\"has-content\"],\"animateSummaryIcon\":[32],\"show\":[64],\"hide\":[64]}]]],[\"six-picto.cjs\",[[1,\"six-picto\",{\"size\":[1]}]]],[\"six-spinner.cjs\",[[1,\"six-spinner\",{\"six\":[4]}]]],[\"set-attributes_2.cjs\",[[1,\"six-stage-indicator\",{\"stage\":[1]}],[4,\"set-attributes\",{\"value\":[16]}]]],[\"six-item-picker.cjs\",[[1,\"six-item-picker\",{\"value\":[1544],\"type\":[1],\"min\":[1544],\"max\":[1544],\"roundtrip\":[516],\"step\":[514],\"items\":[16],\"padded\":[4],\"paddingLength\":[2,\"padding-length\"],\"paddingChar\":[1,\"padding-char\"],\"paddingDirection\":[1,\"padding-direction\"],\"timeout\":[2],\"interval\":[2],\"debounce\":[2],\"_items\":[32],\"_itemIndexes\":[32]}]]],[\"six-tooltip.cjs\",[[1,\"six-tooltip\",{\"content\":[1],\"placement\":[1],\"disabled\":[4],\"distance\":[2],\"open\":[1540],\"skidding\":[2],\"trigger\":[1],\"show\":[64],\"hide\":[64]}]]],[\"six-menu-item.cjs\",[[1,\"six-menu-item\",{\"checked\":[516],\"value\":[513],\"disabled\":[516],\"hasFocus\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"getTextLabel\":[64]}]]],[\"six-input.cjs\",[[1,\"six-input\",{\"type\":[513],\"size\":[513],\"name\":[513],\"value\":[1537],\"pill\":[516],\"helpText\":[1,\"help-text\"],\"placeholder\":[1],\"disabled\":[516],\"readonly\":[516],\"minlength\":[514],\"maxlength\":[514],\"min\":[514],\"max\":[514],\"step\":[514],\"pattern\":[513],\"required\":[4],\"autocapitalize\":[1],\"autocorrect\":[1],\"autocomplete\":[1],\"autofocus\":[4],\"spellcheck\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"errorTextCount\":[2,\"error-text-count\"],\"invalid\":[516],\"clearable\":[4],\"togglePassword\":[4,\"toggle-password\"],\"inputmode\":[1],\"line\":[4],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"hasErrorSlot\":[32],\"isPasswordVisible\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"select\":[64],\"setSelectionRange\":[64],\"setRangeText\":[64]}]]],[\"six-dropdown_2.cjs\",[[1,\"six-dropdown\",{\"open\":[1540],\"placement\":[1],\"closeOnSelect\":[4,\"close-on-select\"],\"distance\":[2],\"skidding\":[2],\"hoist\":[4],\"containingElement\":[16],\"filter\":[4],\"asyncFilter\":[4,\"async-filter\"],\"filterPlaceholder\":[1,\"filter-placeholder\"],\"autofocusFilter\":[4,\"autofocus-filter\"],\"filterDebounce\":[2,\"filter-debounce\"],\"disableHideOnEnterAndSpace\":[4,\"disable-hide-on-enter-and-space\"],\"options\":[16],\"virtualScroll\":[4,\"virtual-scroll\"],\"filteredOptions\":[32],\"show\":[64],\"hide\":[64],\"reposition\":[64]}],[1,\"six-menu\",{\"removeBoxShadow\":[4,\"remove-box-shadow\"],\"items\":[16],\"itemsShown\":[2,\"items-shown\"],\"virtualScroll\":[4,\"virtual-scroll\"],\"itemSize\":[2,\"item-size\"],\"scrollingDebounce\":[2,\"scrolling-debounce\"],\"scrollingIndex\":[32],\"sixMenuItemHeight\":[32],\"typeToSelect\":[64]}]]],[\"six-icon-button.cjs\",[[1,\"six-icon-button\",{\"name\":[513],\"size\":[513],\"label\":[513],\"disabled\":[516],\"html\":[513]}]]]]"), options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-900437fc.js');
|
|
6
|
-
const formControl = require('./form-control-
|
|
6
|
+
const formControl = require('./form-control-9769b310.js');
|
|
7
7
|
const slot = require('./slot-6e6a400f.js');
|
|
8
8
|
const eventListeners = require('./event-listeners-fdfe838c.js');
|
|
9
9
|
|
|
10
|
-
const sixCheckboxCss = ":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:\"*\"}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;
|
|
10
|
+
const sixCheckboxCss = ":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none;text-align:left}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:\"*\"}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{display:inline-block}.checkbox{display:inline-flex;align-items:center;font-family:var(--six-font-family);font-size:var(--six-input-font-size-medium);font-weight:var(--six-input-font-weight);color:var(--six-input-color);vertical-align:middle;cursor:pointer}.checkbox__control{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--six-selection-control-toggle-size);height:var(--six-selection-control-toggle-size);border:solid var(--six-border-width) var(--six-input-border-color);border-radius:0;background-color:var(--six-input-background-color);color:var(--six-checkbox-color);transition:var(--six-transition-fast) border-color, var(--six-transition-fast) background-color, var(--six-transition-fast) color, var(--six-transition-fast) box-shadow}.checkbox__control input[type=checkbox]{position:absolute;opacity:0;padding:0;margin:0;pointer-events:none}.checkbox__control .checkbox__icon{display:inline-flex;width:var(--six-selection-control-toggle-size);height:var(--six-selection-control-toggle-size)}.checkbox__control .checkbox__icon svg{width:100%;height:100%}.checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover{border-color:var(--six-input-border-color-hover)}.checkbox--checked .checkbox__control,.checkbox--indeterminate .checkbox__control{border-color:var(--six-selection-control-color);background-color:var(--six-selection-control-color)}.checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,.checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover{border-color:var(--six-input-border-color-focus);background-color:var(--six-input-border-color-focus)}.checkbox--disabled{cursor:not-allowed;color:var(--six-input-color-disabled)}.checkbox--disabled .checkbox__control{border-color:var(--six-input-border-color-disabled)}.checkbox--disabled.checkbox--checked .checkbox__control,.checkbox--disabled.checkbox--indeterminate .checkbox__control{background-color:var(--six-selection-control-color-disabled)}.checkbox--invalid:not(.checkbox--disabled) .checkbox__control{border-color:var(--six-input-border-color-danger)}.checkbox__text{line-height:var(--six-selection-control-toggle-size);margin-left:0.5em;user-select:none}";
|
|
11
11
|
|
|
12
12
|
let id = 0;
|
|
13
13
|
const SixCheckbox = class {
|
|
@@ -44,12 +44,14 @@ const SixCheckbox = class {
|
|
|
44
44
|
};
|
|
45
45
|
this.hasFocus = false;
|
|
46
46
|
this.hasLabelSlot = false;
|
|
47
|
+
this.hasErrorSlot = false;
|
|
47
48
|
this.name = '';
|
|
48
49
|
this.value = 'on';
|
|
49
50
|
this.disabled = false;
|
|
50
51
|
this.required = false;
|
|
51
52
|
this.label = '';
|
|
52
53
|
this.errorText = '';
|
|
54
|
+
this.errorTextCount = undefined;
|
|
53
55
|
this.invalid = false;
|
|
54
56
|
this.checked = false;
|
|
55
57
|
this.indeterminate = false;
|
|
@@ -98,9 +100,10 @@ const SixCheckbox = class {
|
|
|
98
100
|
}
|
|
99
101
|
handleSlotChange() {
|
|
100
102
|
this.hasLabelSlot = slot.hasSlot(this.host, 'label');
|
|
103
|
+
this.hasErrorSlot = slot.hasSlot(this.host, 'error-text');
|
|
101
104
|
}
|
|
102
105
|
render() {
|
|
103
|
-
return (index.h(formControl.FormControl, { inputId: this.inputId, label: this.label, labelId: this.labelId, hasLabelSlot: this.hasLabelSlot, errorTextId: this.errorTextId, errorText: this.errorText, size: "medium", disabled: this.disabled, required: this.required, displayError: this.invalid }, index.h("label", { part: "base", class: {
|
|
106
|
+
return (index.h(formControl.FormControl, { inputId: this.inputId, label: this.label, labelId: this.labelId, hasLabelSlot: this.hasLabelSlot, errorTextId: this.errorTextId, hasErrorTextSlot: this.hasErrorSlot, errorText: this.errorText, errorTextCount: this.errorTextCount, size: "medium", disabled: this.disabled, required: this.required, displayError: this.invalid }, index.h("label", { part: "base", class: {
|
|
104
107
|
checkbox: true,
|
|
105
108
|
'checkbox--checked': this.checked,
|
|
106
109
|
'checkbox--disabled': this.disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"six-checkbox.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,cAAc,GAAG,mnJAAmnJ;;ACM1oJ,IAAI,EAAE,GAAG,CAAC,CAAC;MAuBE,WAAW;;;;;;IACd,YAAO,GAAG,YAAY,EAAE,EAAE,EAAE,CAAC;IAC7B,YAAO,GAAG,kBAAkB,EAAE,EAAE,CAAC;IACjC,WAAM,GAAG,iBAAiB,EAAE,EAAE,CAAC;IAC/B,gBAAW,GAAG,oBAAoB,EAAE,EAAE,CAAC;IAEvC,mBAAc,GAAG,IAAIA,6BAAc,EAAE,CAAC;IAsGtC,iBAAY,GAAG;MACrB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;QAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;OACvB;KACF,CAAC;IAEM,eAAU,GAAG;MACnB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;MACtB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAA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,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,UAAU,kBACD,IAAI,CAAC,OAAO,GAAG,MAAM,GAAG,OAAO,qBAC5B,IAAI,CAAC,OAAO,EAC7B,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,OAAO,EAAE,IAAI,CAAC,WAAW,GACzB,CACG,EAEPA,kBAAM,IAAI,EAAC,MAAM,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAC,gBAAgB,IACvDA,qBAAQ,CACH,CACD,CACI,EACd;GACH;;;;;;;;;;;;;","names":["EventListeners","hasSlot","h","FormControl"],"sources":["src/components/six-checkbox/six-checkbox.scss?tag=six-checkbox&encapsulation=shadow","src/components/six-checkbox/six-checkbox.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n display: inline-block;\n}\n\n.checkbox {\n display: inline-flex;\n align-items: center;\n font-family: var(--six-font-family);\n font-size: var(--six-input-font-size-medium);\n font-weight: var(--six-input-font-weight);\n color: var(--six-input-color);\n vertical-align: middle;\n cursor: pointer;\n}\n\n.checkbox__control {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--six-selection-control-toggle-size);\n height: var(--six-selection-control-toggle-size);\n border: solid var(--six-border-width) var(--six-input-border-color);\n border-radius: 0;\n background-color: var(--six-input-background-color);\n color: var(--six-checkbox-color);\n transition: var(--six-transition-fast) border-color, var(--six-transition-fast) background-color,\n var(--six-transition-fast) color, var(--six-transition-fast) box-shadow;\n\n input[type='checkbox'] {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n\n .checkbox__icon {\n display: inline-flex;\n width: var(--six-selection-control-toggle-size);\n height: var(--six-selection-control-toggle-size);\n\n svg {\n width: 100%;\n height: 100%;\n }\n }\n}\n\n// Hover\n.checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover {\n border-color: var(--six-input-border-color-hover);\n}\n\n// Checked/indeterminate\n.checkbox--checked .checkbox__control,\n.checkbox--indeterminate .checkbox__control {\n border-color: var(--six-selection-control-color);\n background-color: var(--six-selection-control-color);\n}\n\n// Checked/indeterminate + hover\n.checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,\n.checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover {\n border-color: var(--six-input-border-color-focus);\n background-color: var(--six-input-border-color-focus);\n}\n\n// Disabled\n.checkbox--disabled {\n cursor: not-allowed;\n color: var(--six-input-color-disabled);\n\n .checkbox__control {\n border-color: var(--six-input-border-color-disabled);\n }\n\n &.checkbox--checked .checkbox__control,\n &.checkbox--indeterminate .checkbox__control {\n background-color: var(--six-selection-control-color-disabled);\n }\n}\n\n// Invalid\n.checkbox--invalid:not(.checkbox--disabled) {\n .checkbox__control {\n border-color: var(--six-input-border-color-danger);\n }\n}\n\n.checkbox__text {\n line-height: var(--six-selection-control-toggle-size);\n margin-left: 0.5em;\n user-select: none;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The checkbox label.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part control - The checkbox control.\n * @part checked-icon - The container the wraps the checked icon.\n * @part indeterminate-icon - The container that wraps the indeterminate icon.\n * @part text - The checkbox text rendered to the right.\n */\n\n@Component({\n tag: 'six-checkbox',\n styleUrl: 'six-checkbox.scss',\n shadow: true,\n})\nexport class SixCheckbox {\n private inputId = `checkbox-${++id}`;\n private labelId = `checkbox-label-${id}`;\n private textId = `checkbox-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private nativeInput?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixCheckboxElement;\n\n @State() hasFocus = false;\n @State() hasLabelSlot = false;\n\n /** The checkbox's name attribute. */\n @Prop() name = '';\n\n /**\n * The value of the checkbox does not mean if it's checked or not, use the `checked`\n * property for that.\n *\n * The value of a checkbox is analogous to the value of an `<input type=\"checkbox\">`,\n * it's only used when the checkbox participates in a native `<form>`.\n */\n @Prop() value = 'on';\n\n /** Set to true to disable the checkbox. */\n @Prop() disabled = false;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Set to true to draw the checkbox in a checked state. */\n @Prop({ mutable: true, reflect: true }) checked = false;\n\n /** Set to true to draw the checkbox in an indeterminate state. */\n @Prop({ mutable: true, reflect: true }) indeterminate = false;\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-checkbox-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control's checked state changes. */\n @Event({ eventName: 'six-checkbox-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-checkbox-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n @Watch('checked')\n @Watch('indeterminate')\n handleCheckedChange() {\n if (this.nativeInput == null) return;\n\n this.nativeInput.checked = this.checked;\n this.checked = this.nativeInput.checked;\n this.nativeInput.indeterminate = this.indeterminate;\n }\n\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-checkbox-change', 'change', this.host);\n this.eventListeners.forward('six-checkbox-blur', 'blur', this.host);\n this.eventListeners.forward('six-checkbox-focus', 'focus', this.host);\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n const nativeInput = this.nativeInput;\n if (nativeInput == null) {\n return;\n }\n\n nativeInput.indeterminate = this.indeterminate;\n }\n\n /** Sets focus on the checkbox. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the checkbox. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n private handleChange = () => {\n if (this.nativeInput != null) {\n this.checked = this.nativeInput.checked;\n this.indeterminate = false;\n this.sixChange.emit();\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleMouseDown = (event: MouseEvent) => {\n // Prevent clicks on the label from briefly blurring the input\n event.preventDefault();\n this.nativeInput?.focus();\n };\n\n private handleSlotChange() {\n this.hasLabelSlot = hasSlot(this.host, 'label');\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n size=\"medium\"\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <label\n part=\"base\"\n class={{\n checkbox: true,\n 'checkbox--checked': this.checked,\n 'checkbox--disabled': this.disabled,\n 'checkbox--focused': this.hasFocus,\n 'checkbox--invalid': this.invalid,\n 'checkbox--indeterminate': this.indeterminate,\n }}\n htmlFor={this.inputId}\n onMouseDown={this.handleMouseDown}\n >\n <span part=\"control\" class=\"checkbox__control\">\n {this.checked && (\n <span part=\"checked-icon\" class=\"checkbox__icon\">\n <svg viewBox=\"0 0 16 16\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\">\n <g stroke=\"currentColor\" stroke-width=\"2\">\n <g transform=\"translate(3.428571, 3.428571)\">\n <path d=\"M0,5.71428571 L3.42857143,9.14285714\"></path>\n <path d=\"M9.14285714,0 L3.42857143,9.14285714\"></path>\n </g>\n </g>\n </g>\n </svg>\n </span>\n )}\n\n {!this.checked && this.indeterminate && (\n <span part=\"indeterminate-icon\" class=\"checkbox__icon\">\n <svg viewBox=\"0 0 16 16\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\">\n <g stroke=\"currentColor\" stroke-width=\"2\">\n <g transform=\"translate(2.285714, 6.857143)\">\n <path d=\"M10.2857143,1.14285714 L1.14285714,1.14285714\"></path>\n </g>\n </g>\n </g>\n </svg>\n </span>\n )}\n\n <input\n ref={(el) => (this.nativeInput = el)}\n id={this.inputId}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n role=\"checkbox\"\n aria-checked={this.checked ? 'true' : 'false'}\n aria-labelledby={this.labelId}\n onChange={this.handleChange}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n />\n </span>\n\n <span part=\"text\" id={this.textId} class=\"checkbox__text\">\n <slot />\n </span>\n </label>\n </FormControl>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"six-checkbox.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,cAAc,GAAG,imJAAimJ;;ACMxnJ,IAAI,EAAE,GAAG,CAAC,CAAC;MAuBE,WAAW;;;;;;IACd,YAAO,GAAG,YAAY,EAAE,EAAE,EAAE,CAAC;IAC7B,YAAO,GAAG,kBAAkB,EAAE,EAAE,CAAC;IACjC,WAAM,GAAG,iBAAiB,EAAE,EAAE,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F,CACA,CACD,CACR,EAEA,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,KAClCA,kBAAM,IAAI,EAAC,oBAAoB,EAAC,KAAK,EAAC,gBAAgB,IACpDA,iBAAK,OAAO,EAAC,WAAW,IACtBA,eAAG,MAAM,EAAC,MAAM,kBAAc,GAAG,EAAC,IAAI,EAAC,MAAM,eAAW,SAAS,oBAAgB,OAAO,IACtFA,eAAG,MAAM,EAAC,cAAc,kBAAc,GAAG,IACvCA,eAAG,SAAS,EAAC,+BAA+B,IAC1CA,kBAAM,CAAC,EAAC,+CAA+C,GAAQ,CAC7D,CACF,CACF,CACA,CACD,CACR,EAEDA,mBACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,EACpC,EAAE,EAAE,IAAI,CAAC,OAAO,EAChB,IAAI,EAAC,UAAU,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,UAAU,kBACD,IAAI,CAAC,OAAO,GAAG,MAAM,GAAG,OAAO,qBAC5B,IAAI,CAAC,OAAO,EAC7B,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,OAAO,EAAE,IAAI,CAAC,WAAW,GACzB,CACG,EAEPA,kBAAM,IAAI,EAAC,MAAM,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAC,gBAAgB,IACvDA,qBAAQ,CACH,CACD,CACI,EACd;GACH;;;;;;;;;;;;;","names":["EventListeners","hasSlot","h","FormControl"],"sources":["src/components/six-checkbox/six-checkbox.scss?tag=six-checkbox&encapsulation=shadow","src/components/six-checkbox/six-checkbox.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n display: inline-block;\n}\n\n.checkbox {\n display: inline-flex;\n align-items: center;\n font-family: var(--six-font-family);\n font-size: var(--six-input-font-size-medium);\n font-weight: var(--six-input-font-weight);\n color: var(--six-input-color);\n vertical-align: middle;\n cursor: pointer;\n}\n\n.checkbox__control {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--six-selection-control-toggle-size);\n height: var(--six-selection-control-toggle-size);\n border: solid var(--six-border-width) var(--six-input-border-color);\n border-radius: 0;\n background-color: var(--six-input-background-color);\n color: var(--six-checkbox-color);\n transition: var(--six-transition-fast) border-color, var(--six-transition-fast) background-color,\n var(--six-transition-fast) color, var(--six-transition-fast) box-shadow;\n\n input[type='checkbox'] {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n\n .checkbox__icon {\n display: inline-flex;\n width: var(--six-selection-control-toggle-size);\n height: var(--six-selection-control-toggle-size);\n\n svg {\n width: 100%;\n height: 100%;\n }\n }\n}\n\n// Hover\n.checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover {\n border-color: var(--six-input-border-color-hover);\n}\n\n// Checked/indeterminate\n.checkbox--checked .checkbox__control,\n.checkbox--indeterminate .checkbox__control {\n border-color: var(--six-selection-control-color);\n background-color: var(--six-selection-control-color);\n}\n\n// Checked/indeterminate + hover\n.checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,\n.checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover {\n border-color: var(--six-input-border-color-focus);\n background-color: var(--six-input-border-color-focus);\n}\n\n// Disabled\n.checkbox--disabled {\n cursor: not-allowed;\n color: var(--six-input-color-disabled);\n\n .checkbox__control {\n border-color: var(--six-input-border-color-disabled);\n }\n\n &.checkbox--checked .checkbox__control,\n &.checkbox--indeterminate .checkbox__control {\n background-color: var(--six-selection-control-color-disabled);\n }\n}\n\n// Invalid\n.checkbox--invalid:not(.checkbox--disabled) {\n .checkbox__control {\n border-color: var(--six-input-border-color-danger);\n }\n}\n\n.checkbox__text {\n line-height: var(--six-selection-control-toggle-size);\n margin-left: 0.5em;\n user-select: none;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The checkbox label.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part control - The checkbox control.\n * @part checked-icon - The container the wraps the checked icon.\n * @part indeterminate-icon - The container that wraps the indeterminate icon.\n * @part text - The checkbox text rendered to the right.\n */\n\n@Component({\n tag: 'six-checkbox',\n styleUrl: 'six-checkbox.scss',\n shadow: true,\n})\nexport class SixCheckbox {\n private inputId = `checkbox-${++id}`;\n private labelId = `checkbox-label-${id}`;\n private textId = `checkbox-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private nativeInput?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixCheckboxElement;\n\n @State() hasFocus = false;\n @State() hasLabelSlot = false;\n @State() hasErrorSlot = false;\n\n /** The checkbox's name attribute. */\n @Prop() name = '';\n\n /**\n * The value of the checkbox does not mean if it's checked or not, use the `checked`\n * property for that.\n *\n * The value of a checkbox is analogous to the value of an `<input type=\"checkbox\">`,\n * it's only used when the checkbox participates in a native `<form>`.\n */\n @Prop() value = 'on';\n\n /** Set to true to disable the checkbox. */\n @Prop() disabled = false;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Set to true to draw the checkbox in a checked state. */\n @Prop({ mutable: true, reflect: true }) checked = false;\n\n /** Set to true to draw the checkbox in an indeterminate state. */\n @Prop({ mutable: true, reflect: true }) indeterminate = false;\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-checkbox-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control's checked state changes. */\n @Event({ eventName: 'six-checkbox-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-checkbox-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n @Watch('checked')\n @Watch('indeterminate')\n handleCheckedChange() {\n if (this.nativeInput == null) return;\n\n this.nativeInput.checked = this.checked;\n this.checked = this.nativeInput.checked;\n this.nativeInput.indeterminate = this.indeterminate;\n }\n\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-checkbox-change', 'change', this.host);\n this.eventListeners.forward('six-checkbox-blur', 'blur', this.host);\n this.eventListeners.forward('six-checkbox-focus', 'focus', this.host);\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n const nativeInput = this.nativeInput;\n if (nativeInput == null) {\n return;\n }\n\n nativeInput.indeterminate = this.indeterminate;\n }\n\n /** Sets focus on the checkbox. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the checkbox. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n private handleChange = () => {\n if (this.nativeInput != null) {\n this.checked = this.nativeInput.checked;\n this.indeterminate = false;\n this.sixChange.emit();\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleMouseDown = (event: MouseEvent) => {\n // Prevent clicks on the label from briefly blurring the input\n event.preventDefault();\n this.nativeInput?.focus();\n };\n\n private handleSlotChange() {\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.hasErrorSlot = hasSlot(this.host, 'error-text');\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n errorTextId={this.errorTextId}\n hasErrorTextSlot={this.hasErrorSlot}\n errorText={this.errorText}\n errorTextCount={this.errorTextCount}\n size=\"medium\"\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <label\n part=\"base\"\n class={{\n checkbox: true,\n 'checkbox--checked': this.checked,\n 'checkbox--disabled': this.disabled,\n 'checkbox--focused': this.hasFocus,\n 'checkbox--invalid': this.invalid,\n 'checkbox--indeterminate': this.indeterminate,\n }}\n htmlFor={this.inputId}\n onMouseDown={this.handleMouseDown}\n >\n <span part=\"control\" class=\"checkbox__control\">\n {this.checked && (\n <span part=\"checked-icon\" class=\"checkbox__icon\">\n <svg viewBox=\"0 0 16 16\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\">\n <g stroke=\"currentColor\" stroke-width=\"2\">\n <g transform=\"translate(3.428571, 3.428571)\">\n <path d=\"M0,5.71428571 L3.42857143,9.14285714\"></path>\n <path d=\"M9.14285714,0 L3.42857143,9.14285714\"></path>\n </g>\n </g>\n </g>\n </svg>\n </span>\n )}\n\n {!this.checked && this.indeterminate && (\n <span part=\"indeterminate-icon\" class=\"checkbox__icon\">\n <svg viewBox=\"0 0 16 16\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\">\n <g stroke=\"currentColor\" stroke-width=\"2\">\n <g transform=\"translate(2.285714, 6.857143)\">\n <path d=\"M10.2857143,1.14285714 L1.14285714,1.14285714\"></path>\n </g>\n </g>\n </g>\n </svg>\n </span>\n )}\n\n <input\n ref={(el) => (this.nativeInput = el)}\n id={this.inputId}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n role=\"checkbox\"\n aria-checked={this.checked ? 'true' : 'false'}\n aria-labelledby={this.labelId}\n onChange={this.handleChange}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n />\n </span>\n\n <span part=\"text\" id={this.textId} class=\"checkbox__text\">\n <slot />\n </span>\n </label>\n </FormControl>\n );\n }\n}\n"],"version":3}
|
|
@@ -741,6 +741,7 @@ const SixDatepicker = class {
|
|
|
741
741
|
this.value = undefined;
|
|
742
742
|
this.label = '';
|
|
743
743
|
this.errorText = '';
|
|
744
|
+
this.errorTextCount = undefined;
|
|
744
745
|
this.invalid = false;
|
|
745
746
|
this.containingElement = undefined;
|
|
746
747
|
this.dateFormat = SixDateFormats.DDMMYYY_DOT;
|
|
@@ -753,11 +754,6 @@ const SixDatepicker = class {
|
|
|
753
754
|
debounceChanged() {
|
|
754
755
|
this.sixSelect = executionControl.debounceEvent(this.sixSelect, this.debounce);
|
|
755
756
|
}
|
|
756
|
-
invalidChanged(invalid) {
|
|
757
|
-
if (this.inputElement) {
|
|
758
|
-
this.inputElement.invalid = invalid;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
757
|
/**
|
|
762
758
|
* Update the native input element when the value changes
|
|
763
759
|
*/
|
|
@@ -986,7 +982,7 @@ const SixDatepicker = class {
|
|
|
986
982
|
render() {
|
|
987
983
|
var _a, _b, _c;
|
|
988
984
|
this.adjustPopupPosition();
|
|
989
|
-
return (index.h("div", { ref: (el) => (this.wrapper = el), class: "datepicker__container" }, index.h("six-input", { part: "base", value: formatDate(this.value, this.dateFormat), ref: (el) => (this.inputElement = el), placeholder: this.placeholder, readonly: this.readonly, disabled: this.disabled, name: this.name, label: this.label, required: this.required,
|
|
985
|
+
return (index.h("div", { ref: (el) => (this.wrapper = el), class: "datepicker__container" }, index.h("six-input", { part: "base", value: formatDate(this.value, this.dateFormat), ref: (el) => (this.inputElement = el), placeholder: this.placeholder, readonly: this.readonly, disabled: this.disabled, name: this.name, label: this.label, required: this.required, errorText: this.errorText, errorTextCount: this.errorTextCount, invalid: this.invalid, onClick: () => this.openCalendar(), size: this.size, class: { 'input--empty': this.value == null } }, this.renderCustomIcon(), this.renderClearable(), slot.hasSlot(this.host, 'label') ? (index.h("span", { slot: "label" }, index.h("slot", { name: "label" }))) : null, slot.hasSlot(this.host, 'error-text') ? (index.h("span", { slot: "error-text" }, index.h("slot", { name: "error-text" }))) : null), this.open && (index.h("div", { part: "popup", ref: (el) => (this.popup = el), class: {
|
|
990
986
|
datepicker__popup: true,
|
|
991
987
|
'datepicker__popup--is-up': this.placement != null ? this.placement === 'top' : this.isDropDownContentUp,
|
|
992
988
|
'datepicker__popup--is-inline': this.inline,
|
|
@@ -1020,7 +1016,6 @@ const SixDatepicker = class {
|
|
|
1020
1016
|
get host() { return index.getElement(this); }
|
|
1021
1017
|
static get watchers() { return {
|
|
1022
1018
|
"debounce": ["debounceChanged"],
|
|
1023
|
-
"invalid": ["invalidChanged"],
|
|
1024
1019
|
"value": ["valueChanged"]
|
|
1025
1020
|
}; }
|
|
1026
1021
|
};
|