@haiilo/catalyst 4.1.2 → 5.0.0
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/catalyst/assets/fonts/Lato-Black.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
- package/dist/catalyst/catalyst.css +6 -27
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/catalyst/p-50855511.entry.js +10 -0
- package/dist/catalyst/p-50855511.entry.js.map +1 -0
- package/dist/catalyst/p-ccfebe33.js.map +1 -1
- package/dist/catalyst/p-d1fb9d96.js +3 -0
- package/dist/catalyst/p-d1fb9d96.js.map +1 -0
- package/dist/catalyst/scss/fonts/_fonts-mixins.scss +0 -10
- package/dist/cjs/cat-alert_24.cjs.entry.js +932 -1132
- package/dist/cjs/cat-alert_24.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +10 -3
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/{index-c4542095.js → index-01312a2e.js} +527 -245
- package/dist/cjs/index-01312a2e.js.map +1 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/cat-alert/cat-alert.js +69 -71
- package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
- package/dist/collection/components/cat-avatar/cat-avatar.js +172 -165
- package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
- package/dist/collection/components/cat-badge/cat-badge.js +102 -111
- package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.js +526 -537
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-card/cat-card.js +12 -8
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +336 -350
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +137 -137
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +58 -40
- package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.js +14 -7
- package/dist/collection/components/cat-form-hint/cat-form-hint.js.map +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +1 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js +1 -1
- package/dist/collection/components/cat-icon/cat-icon.js +85 -79
- package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.css +32 -3
- package/dist/collection/components/cat-input/cat-input.js +662 -660
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-input/input-type.js +1 -1
- package/dist/collection/components/cat-label/cat-label.js +69 -78
- package/dist/collection/components/cat-label/cat-label.js.map +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +192 -226
- package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.js +319 -327
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +173 -165
- package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +200 -208
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.js +555 -590
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-select-demo/cat-select-demo.js +3 -28
- package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +85 -88
- package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.js +52 -50
- package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
- package/dist/collection/components/cat-tab/cat-tab.js +169 -168
- package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js +73 -66
- package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.css +32 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +479 -468
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +319 -326
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.css +7 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +187 -198
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
- package/dist/collection/index.js +1 -1
- package/dist/collection/scss/fonts/_fonts-mixins.scss +0 -10
- package/dist/collection/utils/breakpoints.js +1 -1
- package/dist/collection/utils/breakpoints.js.map +1 -1
- package/dist/collection/utils/coerce.js +11 -0
- package/dist/collection/utils/coerce.js.map +1 -0
- package/dist/collection/utils/first-tabbable.js +1 -1
- package/dist/collection/utils/is-touch-screen.js +1 -1
- package/dist/collection/utils/load-img.js +1 -1
- package/dist/collection/utils/media-matcher.js +1 -1
- package/dist/collection/utils/platform.js +4 -4
- package/dist/collection/utils/setDefault.js +1 -1
- package/dist/components/cat-alert.js +1 -6
- package/dist/components/cat-alert.js.map +1 -1
- package/dist/components/cat-avatar2.js +6 -9
- package/dist/components/cat-avatar2.js.map +1 -1
- package/dist/components/cat-badge.js +0 -15
- package/dist/components/cat-badge.js.map +1 -1
- package/dist/components/cat-button2.js +10 -36
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-checkbox2.js +9 -26
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-dropdown2.js +139 -176
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.js +4 -9
- package/dist/components/cat-form-group.js.map +1 -1
- package/dist/components/cat-form-hint.js +13 -6
- package/dist/components/cat-form-hint.js.map +1 -1
- package/dist/components/cat-icon-registry.js +71 -0
- package/dist/components/cat-icon-registry.js.map +1 -0
- package/dist/components/cat-icon.js +1 -1
- package/dist/components/cat-icon2.js +5 -71
- package/dist/components/cat-icon2.js.map +1 -1
- package/dist/components/cat-input.js +33 -41
- package/dist/components/cat-input.js.map +1 -1
- package/dist/components/cat-label.js +1 -6
- package/dist/components/cat-label.js.map +1 -1
- package/dist/components/cat-pagination.js +0 -30
- package/dist/components/cat-pagination.js.map +1 -1
- package/dist/components/cat-radio-group.js +3 -6
- package/dist/components/cat-radio-group.js.map +1 -1
- package/dist/components/cat-radio.js +9 -23
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-scrollable2.js +1 -12
- package/dist/components/cat-scrollable2.js.map +1 -1
- package/dist/components/cat-select-demo.js +2 -12
- package/dist/components/cat-select-demo.js.map +1 -1
- package/dist/components/cat-select2.js +40 -47
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-skeleton2.js +1 -10
- package/dist/components/cat-skeleton2.js.map +1 -1
- package/dist/components/cat-spinner2.js +1 -3
- package/dist/components/cat-spinner2.js.map +1 -1
- package/dist/components/cat-tab.js +3 -12
- package/dist/components/cat-tab.js.map +1 -1
- package/dist/components/cat-tabs.js +1 -6
- package/dist/components/cat-tabs.js.map +1 -1
- package/dist/components/cat-textarea.js +28 -33
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-toggle.js +9 -23
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/components/cat-tooltip.js +14 -34
- package/dist/components/cat-tooltip.js.map +1 -1
- package/dist/components/first-tabbable.js +51 -113
- package/dist/components/first-tabbable.js.map +1 -1
- package/dist/components/floating-ui.dom.esm.js +577 -441
- package/dist/components/floating-ui.dom.esm.js.map +1 -1
- package/dist/components/index.d.ts +9 -27
- package/dist/components/index.js +2 -26
- package/dist/components/index.js.map +1 -1
- package/dist/esm/cat-alert_24.entry.js +933 -1133
- package/dist/esm/cat-alert_24.entry.js.map +1 -1
- package/dist/esm/catalyst.js +7 -3
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/{index-524906f7.js → index-fc2f91a4.js} +527 -246
- package/dist/esm/index-fc2f91a4.js.map +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +4 -3
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +1 -1
- package/dist/types/components/cat-form-group/cat-form-group.d.ts +4 -0
- package/dist/types/components/cat-form-hint/cat-form-hint.d.ts +5 -0
- package/dist/types/components/cat-input/cat-input.d.ts +6 -1
- package/dist/types/components/cat-input/input-type.d.ts +1 -1
- package/dist/types/components/cat-radio/cat-radio.d.ts +1 -1
- package/dist/types/components/cat-select/cat-select.d.ts +3 -1
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +6 -1
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +1 -1
- package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +3 -0
- package/dist/types/components.d.ts +353 -7
- package/dist/types/stencil-public-runtime.d.ts +91 -19
- package/dist/types/utils/breakpoints.d.ts +1 -1
- package/dist/types/utils/coerce.d.ts +3 -0
- package/dist/types/utils/first-tabbable.d.ts +2 -2
- package/loader/index.d.ts +9 -0
- package/loader/package.json +1 -0
- package/package.json +19 -19
- package/dist/catalyst/assets/fonts/AzeretMono-Regular.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-Bold.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-Italic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-Medium.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-Regular.woff2 +0 -0
- package/dist/catalyst/p-919eea27.js +0 -3
- package/dist/catalyst/p-919eea27.js.map +0 -1
- package/dist/catalyst/p-cd8f8639.entry.js +0 -10
- package/dist/catalyst/p-cd8f8639.entry.js.map +0 -1
- package/dist/catalyst/scss/fonts/_fonts.mixins.azeret.scss +0 -14
- package/dist/catalyst/scss/fonts/_fonts.mixins.dm.scss +0 -53
- package/dist/cjs/index-c4542095.js.map +0 -1
- package/dist/collection/assets/fonts/AzeretMono-Regular.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-Bold.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-Italic.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-Medium.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-Regular.woff2 +0 -0
- package/dist/collection/components/cat-form-hint/cat-form-hint-utils.js +0 -13
- package/dist/collection/components/cat-form-hint/cat-form-hint-utils.js.map +0 -1
- package/dist/collection/scss/fonts/_fonts.mixins.azeret.scss +0 -14
- package/dist/collection/scss/fonts/_fonts.mixins.dm.scss +0 -53
- package/dist/components/cat-form-hint-utils.js +0 -17
- package/dist/components/cat-form-hint-utils.js.map +0 -1
- package/dist/esm/index-524906f7.js.map +0 -1
- package/dist/types/components/cat-form-hint/cat-form-hint-utils.d.ts +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
|
2
2
|
import log from 'loglevel';
|
|
3
3
|
import { CatFormHint } from '../cat-form-hint/cat-form-hint';
|
|
4
4
|
let nextUniqueId = 0;
|
|
@@ -15,36 +15,25 @@ export class CatToggle {
|
|
|
15
15
|
constructor() {
|
|
16
16
|
this._id = `cat-toggle-${nextUniqueId++}`;
|
|
17
17
|
this.hasSlottedLabel = false;
|
|
18
|
-
|
|
19
|
-
* Checked state of the toggle.
|
|
20
|
-
*/
|
|
18
|
+
this.hasSlottedHint = false;
|
|
21
19
|
this.checked = false;
|
|
22
|
-
/**
|
|
23
|
-
* Disabled state of the toggle.
|
|
24
|
-
*/
|
|
25
20
|
this.disabled = false;
|
|
26
|
-
|
|
27
|
-
* The label of the toggle that is visible.
|
|
28
|
-
*/
|
|
21
|
+
this.identifier = undefined;
|
|
29
22
|
this.label = '';
|
|
30
|
-
/**
|
|
31
|
-
* Visually hide the label, but still show it to assistive technologies like screen readers.
|
|
32
|
-
*/
|
|
33
23
|
this.labelHidden = false;
|
|
34
|
-
|
|
35
|
-
* Required state of the toggle.
|
|
36
|
-
*/
|
|
24
|
+
this.name = undefined;
|
|
37
25
|
this.required = false;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*/
|
|
26
|
+
this.value = undefined;
|
|
27
|
+
this.hint = undefined;
|
|
41
28
|
this.labelLeft = false;
|
|
29
|
+
this.nativeAttributes = undefined;
|
|
42
30
|
}
|
|
43
31
|
get id() {
|
|
44
32
|
return this.identifier || this._id;
|
|
45
33
|
}
|
|
46
34
|
componentWillRender() {
|
|
47
35
|
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
36
|
+
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
48
37
|
if (!this.label && !this.hasSlottedLabel) {
|
|
49
38
|
log.warn('[A11y] Missing ARIA label on toggle', this);
|
|
50
39
|
}
|
|
@@ -73,16 +62,7 @@ export class CatToggle {
|
|
|
73
62
|
this.input.click();
|
|
74
63
|
}
|
|
75
64
|
render() {
|
|
76
|
-
return (h(Host, null,
|
|
77
|
-
h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } },
|
|
78
|
-
h("input", Object.assign({}, this.nativeAttributes, { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) })),
|
|
79
|
-
h("span", { class: "toggle", part: "toggle" }),
|
|
80
|
-
h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)),
|
|
81
|
-
this.hintSection));
|
|
82
|
-
}
|
|
83
|
-
get hintSection() {
|
|
84
|
-
const hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
85
|
-
return ((this.hint || hasSlottedHint) && (h(CatFormHint, { hint: this.hint, slottedHint: hasSlottedHint && h("slot", { name: "hint" }) })));
|
|
65
|
+
return (h(Host, null, h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, h("input", Object.assign({}, this.nativeAttributes, { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) })), h("span", { class: "toggle", part: "toggle" }), h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), (this.hint || this.hasSlottedHint) && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) }))));
|
|
86
66
|
}
|
|
87
67
|
onInput(event) {
|
|
88
68
|
this.checked = this.input.checked;
|
|
@@ -99,324 +79,337 @@ export class CatToggle {
|
|
|
99
79
|
}
|
|
100
80
|
static get is() { return "cat-toggle"; }
|
|
101
81
|
static get encapsulation() { return "shadow"; }
|
|
102
|
-
static get originalStyleUrls() {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
"original": "boolean",
|
|
132
|
-
"resolved": "boolean",
|
|
133
|
-
"references": {}
|
|
134
|
-
},
|
|
135
|
-
"required": false,
|
|
136
|
-
"optional": false,
|
|
137
|
-
"docs": {
|
|
138
|
-
"tags": [],
|
|
139
|
-
"text": "Disabled state of the toggle."
|
|
140
|
-
},
|
|
141
|
-
"attribute": "disabled",
|
|
142
|
-
"reflect": false,
|
|
143
|
-
"defaultValue": "false"
|
|
144
|
-
},
|
|
145
|
-
"identifier": {
|
|
146
|
-
"type": "string",
|
|
147
|
-
"mutable": false,
|
|
148
|
-
"complexType": {
|
|
149
|
-
"original": "string",
|
|
150
|
-
"resolved": "string | undefined",
|
|
151
|
-
"references": {}
|
|
152
|
-
},
|
|
153
|
-
"required": false,
|
|
154
|
-
"optional": true,
|
|
155
|
-
"docs": {
|
|
156
|
-
"tags": [],
|
|
157
|
-
"text": "A unique identifier for the input."
|
|
158
|
-
},
|
|
159
|
-
"attribute": "identifier",
|
|
160
|
-
"reflect": false
|
|
161
|
-
},
|
|
162
|
-
"label": {
|
|
163
|
-
"type": "string",
|
|
164
|
-
"mutable": false,
|
|
165
|
-
"complexType": {
|
|
166
|
-
"original": "string",
|
|
167
|
-
"resolved": "string",
|
|
168
|
-
"references": {}
|
|
169
|
-
},
|
|
170
|
-
"required": false,
|
|
171
|
-
"optional": false,
|
|
172
|
-
"docs": {
|
|
173
|
-
"tags": [],
|
|
174
|
-
"text": "The label of the toggle that is visible."
|
|
175
|
-
},
|
|
176
|
-
"attribute": "label",
|
|
177
|
-
"reflect": false,
|
|
178
|
-
"defaultValue": "''"
|
|
179
|
-
},
|
|
180
|
-
"labelHidden": {
|
|
181
|
-
"type": "boolean",
|
|
182
|
-
"mutable": false,
|
|
183
|
-
"complexType": {
|
|
184
|
-
"original": "boolean",
|
|
185
|
-
"resolved": "boolean",
|
|
186
|
-
"references": {}
|
|
187
|
-
},
|
|
188
|
-
"required": false,
|
|
189
|
-
"optional": false,
|
|
190
|
-
"docs": {
|
|
191
|
-
"tags": [],
|
|
192
|
-
"text": "Visually hide the label, but still show it to assistive technologies like screen readers."
|
|
193
|
-
},
|
|
194
|
-
"attribute": "label-hidden",
|
|
195
|
-
"reflect": false,
|
|
196
|
-
"defaultValue": "false"
|
|
197
|
-
},
|
|
198
|
-
"name": {
|
|
199
|
-
"type": "string",
|
|
200
|
-
"mutable": false,
|
|
201
|
-
"complexType": {
|
|
202
|
-
"original": "string",
|
|
203
|
-
"resolved": "string | undefined",
|
|
204
|
-
"references": {}
|
|
205
|
-
},
|
|
206
|
-
"required": false,
|
|
207
|
-
"optional": true,
|
|
208
|
-
"docs": {
|
|
209
|
-
"tags": [],
|
|
210
|
-
"text": "The name of the input"
|
|
211
|
-
},
|
|
212
|
-
"attribute": "name",
|
|
213
|
-
"reflect": false
|
|
214
|
-
},
|
|
215
|
-
"required": {
|
|
216
|
-
"type": "boolean",
|
|
217
|
-
"mutable": false,
|
|
218
|
-
"complexType": {
|
|
219
|
-
"original": "boolean",
|
|
220
|
-
"resolved": "boolean",
|
|
221
|
-
"references": {}
|
|
82
|
+
static get originalStyleUrls() {
|
|
83
|
+
return {
|
|
84
|
+
"$": ["cat-toggle.scss"]
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
static get styleUrls() {
|
|
88
|
+
return {
|
|
89
|
+
"$": ["cat-toggle.css"]
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
static get properties() {
|
|
93
|
+
return {
|
|
94
|
+
"checked": {
|
|
95
|
+
"type": "boolean",
|
|
96
|
+
"mutable": true,
|
|
97
|
+
"complexType": {
|
|
98
|
+
"original": "boolean",
|
|
99
|
+
"resolved": "boolean",
|
|
100
|
+
"references": {}
|
|
101
|
+
},
|
|
102
|
+
"required": false,
|
|
103
|
+
"optional": false,
|
|
104
|
+
"docs": {
|
|
105
|
+
"tags": [],
|
|
106
|
+
"text": "Checked state of the toggle."
|
|
107
|
+
},
|
|
108
|
+
"attribute": "checked",
|
|
109
|
+
"reflect": false,
|
|
110
|
+
"defaultValue": "false"
|
|
222
111
|
},
|
|
223
|
-
"
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
"
|
|
227
|
-
|
|
112
|
+
"disabled": {
|
|
113
|
+
"type": "boolean",
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "boolean",
|
|
117
|
+
"resolved": "boolean",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": false,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": "Disabled state of the toggle."
|
|
125
|
+
},
|
|
126
|
+
"attribute": "disabled",
|
|
127
|
+
"reflect": false,
|
|
128
|
+
"defaultValue": "false"
|
|
228
129
|
},
|
|
229
|
-
"
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
"
|
|
238
|
-
"
|
|
239
|
-
"
|
|
130
|
+
"identifier": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"mutable": false,
|
|
133
|
+
"complexType": {
|
|
134
|
+
"original": "string",
|
|
135
|
+
"resolved": "string | undefined",
|
|
136
|
+
"references": {}
|
|
137
|
+
},
|
|
138
|
+
"required": false,
|
|
139
|
+
"optional": true,
|
|
140
|
+
"docs": {
|
|
141
|
+
"tags": [],
|
|
142
|
+
"text": "A unique identifier for the input."
|
|
143
|
+
},
|
|
144
|
+
"attribute": "identifier",
|
|
145
|
+
"reflect": false
|
|
240
146
|
},
|
|
241
|
-
"
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
"
|
|
245
|
-
|
|
147
|
+
"label": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"mutable": false,
|
|
150
|
+
"complexType": {
|
|
151
|
+
"original": "string",
|
|
152
|
+
"resolved": "string",
|
|
153
|
+
"references": {}
|
|
154
|
+
},
|
|
155
|
+
"required": false,
|
|
156
|
+
"optional": false,
|
|
157
|
+
"docs": {
|
|
158
|
+
"tags": [],
|
|
159
|
+
"text": "The label of the toggle that is visible."
|
|
160
|
+
},
|
|
161
|
+
"attribute": "label",
|
|
162
|
+
"reflect": false,
|
|
163
|
+
"defaultValue": "''"
|
|
246
164
|
},
|
|
247
|
-
"
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
"
|
|
256
|
-
"
|
|
165
|
+
"labelHidden": {
|
|
166
|
+
"type": "boolean",
|
|
167
|
+
"mutable": false,
|
|
168
|
+
"complexType": {
|
|
169
|
+
"original": "boolean",
|
|
170
|
+
"resolved": "boolean",
|
|
171
|
+
"references": {}
|
|
172
|
+
},
|
|
173
|
+
"required": false,
|
|
174
|
+
"optional": false,
|
|
175
|
+
"docs": {
|
|
176
|
+
"tags": [],
|
|
177
|
+
"text": "Visually hide the label, but still show it to assistive technologies like screen readers."
|
|
178
|
+
},
|
|
179
|
+
"attribute": "label-hidden",
|
|
180
|
+
"reflect": false,
|
|
181
|
+
"defaultValue": "false"
|
|
257
182
|
},
|
|
258
|
-
"
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
"
|
|
262
|
-
|
|
183
|
+
"name": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"mutable": false,
|
|
186
|
+
"complexType": {
|
|
187
|
+
"original": "string",
|
|
188
|
+
"resolved": "string | undefined",
|
|
189
|
+
"references": {}
|
|
190
|
+
},
|
|
191
|
+
"required": false,
|
|
192
|
+
"optional": true,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"text": "The name of the input"
|
|
196
|
+
},
|
|
197
|
+
"attribute": "name",
|
|
198
|
+
"reflect": false
|
|
263
199
|
},
|
|
264
|
-
"
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
"
|
|
273
|
-
"
|
|
200
|
+
"required": {
|
|
201
|
+
"type": "boolean",
|
|
202
|
+
"mutable": false,
|
|
203
|
+
"complexType": {
|
|
204
|
+
"original": "boolean",
|
|
205
|
+
"resolved": "boolean",
|
|
206
|
+
"references": {}
|
|
207
|
+
},
|
|
208
|
+
"required": false,
|
|
209
|
+
"optional": false,
|
|
210
|
+
"docs": {
|
|
211
|
+
"tags": [],
|
|
212
|
+
"text": "Required state of the toggle."
|
|
213
|
+
},
|
|
214
|
+
"attribute": "required",
|
|
215
|
+
"reflect": false,
|
|
216
|
+
"defaultValue": "false"
|
|
274
217
|
},
|
|
275
|
-
"
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
"
|
|
279
|
-
|
|
218
|
+
"value": {
|
|
219
|
+
"type": "any",
|
|
220
|
+
"mutable": true,
|
|
221
|
+
"complexType": {
|
|
222
|
+
"original": "string | boolean",
|
|
223
|
+
"resolved": "boolean | string | undefined",
|
|
224
|
+
"references": {}
|
|
225
|
+
},
|
|
226
|
+
"required": false,
|
|
227
|
+
"optional": true,
|
|
228
|
+
"docs": {
|
|
229
|
+
"tags": [],
|
|
230
|
+
"text": "The value of the toggle"
|
|
231
|
+
},
|
|
232
|
+
"attribute": "value",
|
|
233
|
+
"reflect": false
|
|
280
234
|
},
|
|
281
|
-
"
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
"
|
|
290
|
-
"
|
|
291
|
-
"
|
|
235
|
+
"hint": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"mutable": false,
|
|
238
|
+
"complexType": {
|
|
239
|
+
"original": "string | string[]",
|
|
240
|
+
"resolved": "string | string[] | undefined",
|
|
241
|
+
"references": {}
|
|
242
|
+
},
|
|
243
|
+
"required": false,
|
|
244
|
+
"optional": true,
|
|
245
|
+
"docs": {
|
|
246
|
+
"tags": [],
|
|
247
|
+
"text": "Optional hint text(s) to be displayed with the toggle."
|
|
248
|
+
},
|
|
249
|
+
"attribute": "hint",
|
|
250
|
+
"reflect": false
|
|
292
251
|
},
|
|
293
|
-
"
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
"
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
"docs": {
|
|
311
|
-
"tags": [],
|
|
312
|
-
"text": "Emitted when the checked status of the toggle is changed."
|
|
252
|
+
"labelLeft": {
|
|
253
|
+
"type": "boolean",
|
|
254
|
+
"mutable": false,
|
|
255
|
+
"complexType": {
|
|
256
|
+
"original": "boolean",
|
|
257
|
+
"resolved": "boolean",
|
|
258
|
+
"references": {}
|
|
259
|
+
},
|
|
260
|
+
"required": false,
|
|
261
|
+
"optional": false,
|
|
262
|
+
"docs": {
|
|
263
|
+
"tags": [],
|
|
264
|
+
"text": "Whether the label should appear to the left of the toggle."
|
|
265
|
+
},
|
|
266
|
+
"attribute": "label-left",
|
|
267
|
+
"reflect": false,
|
|
268
|
+
"defaultValue": "false"
|
|
313
269
|
},
|
|
314
|
-
"
|
|
315
|
-
"
|
|
316
|
-
"
|
|
317
|
-
"
|
|
270
|
+
"nativeAttributes": {
|
|
271
|
+
"type": "unknown",
|
|
272
|
+
"mutable": false,
|
|
273
|
+
"complexType": {
|
|
274
|
+
"original": "{ [key: string]: string }",
|
|
275
|
+
"resolved": "undefined | { [key: string]: string; }",
|
|
276
|
+
"references": {}
|
|
277
|
+
},
|
|
278
|
+
"required": false,
|
|
279
|
+
"optional": true,
|
|
280
|
+
"docs": {
|
|
281
|
+
"tags": [],
|
|
282
|
+
"text": "Attributes that will be added to the native HTML input element."
|
|
283
|
+
}
|
|
318
284
|
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
"
|
|
324
|
-
"
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
"
|
|
331
|
-
"
|
|
332
|
-
"
|
|
333
|
-
|
|
334
|
-
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
static get states() {
|
|
288
|
+
return {
|
|
289
|
+
"hasSlottedLabel": {},
|
|
290
|
+
"hasSlottedHint": {}
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
static get events() {
|
|
294
|
+
return [{
|
|
295
|
+
"method": "catChange",
|
|
296
|
+
"name": "catChange",
|
|
297
|
+
"bubbles": true,
|
|
298
|
+
"cancelable": true,
|
|
299
|
+
"composed": true,
|
|
300
|
+
"docs": {
|
|
301
|
+
"tags": [],
|
|
302
|
+
"text": "Emitted when the checked status of the toggle is changed."
|
|
303
|
+
},
|
|
304
|
+
"complexType": {
|
|
305
|
+
"original": "any",
|
|
306
|
+
"resolved": "any",
|
|
307
|
+
"references": {}
|
|
308
|
+
}
|
|
309
|
+
}, {
|
|
310
|
+
"method": "catFocus",
|
|
311
|
+
"name": "catFocus",
|
|
312
|
+
"bubbles": true,
|
|
313
|
+
"cancelable": true,
|
|
314
|
+
"composed": true,
|
|
315
|
+
"docs": {
|
|
316
|
+
"tags": [],
|
|
317
|
+
"text": "Emitted when the toggle received focus."
|
|
318
|
+
},
|
|
319
|
+
"complexType": {
|
|
320
|
+
"original": "FocusEvent",
|
|
321
|
+
"resolved": "FocusEvent",
|
|
322
|
+
"references": {
|
|
323
|
+
"FocusEvent": {
|
|
324
|
+
"location": "global"
|
|
325
|
+
}
|
|
335
326
|
}
|
|
336
327
|
}
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
328
|
+
}, {
|
|
329
|
+
"method": "catBlur",
|
|
330
|
+
"name": "catBlur",
|
|
331
|
+
"bubbles": true,
|
|
332
|
+
"cancelable": true,
|
|
333
|
+
"composed": true,
|
|
334
|
+
"docs": {
|
|
335
|
+
"tags": [],
|
|
336
|
+
"text": "Emitted when the toggle loses focus."
|
|
337
|
+
},
|
|
338
|
+
"complexType": {
|
|
339
|
+
"original": "FocusEvent",
|
|
340
|
+
"resolved": "FocusEvent",
|
|
341
|
+
"references": {
|
|
342
|
+
"FocusEvent": {
|
|
343
|
+
"location": "global"
|
|
344
|
+
}
|
|
354
345
|
}
|
|
355
346
|
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
static get methods() {
|
|
359
|
-
|
|
360
|
-
"
|
|
361
|
-
"
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
"
|
|
371
|
-
"
|
|
347
|
+
}];
|
|
348
|
+
}
|
|
349
|
+
static get methods() {
|
|
350
|
+
return {
|
|
351
|
+
"doFocus": {
|
|
352
|
+
"complexType": {
|
|
353
|
+
"signature": "(options?: FocusOptions) => Promise<void>",
|
|
354
|
+
"parameters": [{
|
|
355
|
+
"tags": [{
|
|
356
|
+
"name": "param",
|
|
357
|
+
"text": "options An optional object providing options to control aspects of\nthe focusing process."
|
|
358
|
+
}],
|
|
359
|
+
"text": "An optional object providing options to control aspects of\nthe focusing process."
|
|
360
|
+
}],
|
|
361
|
+
"references": {
|
|
362
|
+
"Promise": {
|
|
363
|
+
"location": "global"
|
|
364
|
+
},
|
|
365
|
+
"FocusOptions": {
|
|
366
|
+
"location": "global"
|
|
367
|
+
}
|
|
372
368
|
},
|
|
373
|
-
"
|
|
374
|
-
"location": "global"
|
|
375
|
-
}
|
|
369
|
+
"return": "Promise<void>"
|
|
376
370
|
},
|
|
377
|
-
"
|
|
371
|
+
"docs": {
|
|
372
|
+
"text": "Programmatically move focus to the toggle. Use this method instead of\n`input.focus()`.",
|
|
373
|
+
"tags": [{
|
|
374
|
+
"name": "param",
|
|
375
|
+
"text": "options An optional object providing options to control aspects of\nthe focusing process."
|
|
376
|
+
}]
|
|
377
|
+
}
|
|
378
378
|
},
|
|
379
|
-
"
|
|
380
|
-
"
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
"signature": "() => Promise<void>",
|
|
390
|
-
"parameters": [],
|
|
391
|
-
"references": {
|
|
392
|
-
"Promise": {
|
|
393
|
-
"location": "global"
|
|
394
|
-
}
|
|
379
|
+
"doBlur": {
|
|
380
|
+
"complexType": {
|
|
381
|
+
"signature": "() => Promise<void>",
|
|
382
|
+
"parameters": [],
|
|
383
|
+
"references": {
|
|
384
|
+
"Promise": {
|
|
385
|
+
"location": "global"
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
"return": "Promise<void>"
|
|
395
389
|
},
|
|
396
|
-
"
|
|
390
|
+
"docs": {
|
|
391
|
+
"text": "Programmatically remove focus from the toggle. Use this method instead of\n`input.blur()`.",
|
|
392
|
+
"tags": []
|
|
393
|
+
}
|
|
397
394
|
},
|
|
398
|
-
"
|
|
399
|
-
"
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
"Promise": {
|
|
409
|
-
"location": "global"
|
|
410
|
-
}
|
|
395
|
+
"doClick": {
|
|
396
|
+
"complexType": {
|
|
397
|
+
"signature": "() => Promise<void>",
|
|
398
|
+
"parameters": [],
|
|
399
|
+
"references": {
|
|
400
|
+
"Promise": {
|
|
401
|
+
"location": "global"
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
"return": "Promise<void>"
|
|
411
405
|
},
|
|
412
|
-
"
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
"tags": []
|
|
406
|
+
"docs": {
|
|
407
|
+
"text": "Programmatically simulate a click on the toggle.",
|
|
408
|
+
"tags": []
|
|
409
|
+
}
|
|
417
410
|
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
411
|
+
};
|
|
412
|
+
}
|
|
420
413
|
static get elementRef() { return "hostElement"; }
|
|
421
414
|
}
|
|
422
|
-
//# sourceMappingURL=cat-toggle.js.map
|
|
415
|
+
//# sourceMappingURL=cat-toggle.js.map
|