q2-tecton-elements 1.60.0 → 1.60.2
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/bundle-report.json +911 -870
- package/dist/cjs/click-elsewhere.cjs.entry.js +1 -1
- package/dist/cjs/{index-JnAD7tEB.js → index-BYXz4owL.js} +5 -2
- package/dist/cjs/index-BYXz4owL.js.map +1 -0
- package/dist/cjs/{index-B6mUspT0.js → index-BuXzB2ML.js} +3 -3
- package/dist/cjs/{index-B6mUspT0.js.map → index-BuXzB2ML.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/q2-action-group_2.cjs.entry.js +2 -2
- package/dist/cjs/q2-action-sheet.cjs.entry.js +2 -2
- package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
- package/dist/cjs/q2-badge.q2-btn.q2-icon.q2-input.q2-loading.q2-tab-container.q2-tab-pane.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-badge_7.cjs.entry.js +171 -27
- package/dist/cjs/q2-badge_7.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +2 -2
- package/dist/cjs/q2-card.cjs.entry.js +2 -2
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +2 -2
- package/dist/cjs/q2-carousel.cjs.entry.js +2 -2
- package/dist/cjs/q2-chart-area.cjs.entry.js +2 -2
- package/dist/cjs/q2-chart-bar.cjs.entry.js +2 -2
- package/dist/cjs/q2-chart-donut.cjs.entry.js +2 -2
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/q2-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-checkbox.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-context.cjs.entry.js +2 -2
- package/dist/cjs/q2-currency.cjs.entry.js +1 -1
- package/dist/cjs/q2-data-table.cjs.entry.js +2 -2
- package/dist/cjs/q2-detail.cjs.entry.js +2 -2
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +2 -2
- package/dist/cjs/q2-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/q2-editable-field.cjs.entry.js +2 -2
- package/dist/cjs/q2-example.cjs.entry.js +1 -1
- package/dist/cjs/q2-file-picker.cjs.entry.js +2 -2
- package/dist/cjs/q2-form.cjs.entry.js +1 -1
- package/dist/cjs/q2-formatted-text.cjs.entry.js +1 -1
- package/dist/cjs/q2-grid-area.cjs.entry.js +1 -1
- package/dist/cjs/q2-grid.cjs.entry.js +1 -1
- package/dist/cjs/q2-item.cjs.entry.js +2 -2
- package/dist/cjs/q2-legend.cjs.entry.js +1 -1
- package/dist/cjs/q2-link_2.cjs.entry.js +2 -2
- package/dist/cjs/q2-loading-element.cjs.entry.js +2 -2
- package/dist/cjs/q2-loc.cjs.entry.js +2 -2
- package/dist/cjs/q2-message.cjs.entry.js +2 -2
- package/dist/cjs/q2-modal.cjs.entry.js +2 -2
- package/dist/cjs/q2-month-picker.cjs.entry.js +2 -2
- package/dist/cjs/q2-optgroup.cjs.entry.js +2 -2
- package/dist/cjs/q2-option-list_2.cjs.entry.js +2 -2
- package/dist/cjs/q2-option.cjs.entry.js +2 -2
- package/dist/cjs/q2-pagination.cjs.entry.js +2 -2
- package/dist/cjs/q2-pill.cjs.entry.js +2 -2
- package/dist/cjs/q2-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-radio.cjs.entry.js +2 -2
- package/dist/cjs/q2-relative-time.cjs.entry.js +2 -2
- package/dist/cjs/q2-section.cjs.entry.js +2 -2
- package/dist/cjs/q2-select.cjs.entry.js +2 -2
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +2 -2
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
- package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
- package/dist/cjs/q2-tag.cjs.entry.js +2 -2
- package/dist/cjs/q2-tecton-elements.cjs.js +2 -2
- package/dist/cjs/q2-textarea.cjs.entry.js +2 -2
- package/dist/cjs/q2-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/{shapes-CmBHp0YP.js → shapes-AGx9jMFH.js} +3 -3
- package/dist/cjs/{shapes-CmBHp0YP.js.map → shapes-AGx9jMFH.js.map} +1 -1
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +1 -1
- package/dist/collection/components/q2-checkbox/q2-checkbox.css +1 -0
- package/dist/collection/components/q2-data-table/q2-data-table.js +7 -7
- package/dist/collection/components/q2-file-picker/q2-file-picker.js +3 -3
- package/dist/collection/components/q2-grid/q2-grid.js +30 -30
- package/dist/collection/components/q2-grid-area/q2-grid-area.js +42 -42
- package/dist/collection/components/q2-icon/q2-icon.js +5 -20
- package/dist/collection/components/q2-icon/q2-icon.js.map +1 -1
- package/dist/collection/components/q2-input/q2-input.js +1 -1
- package/dist/collection/components/q2-loading/q2-loading.css +8 -0
- package/dist/collection/components/q2-loading/q2-loading.js +168 -5
- package/dist/collection/components/q2-loading/q2-loading.js.map +1 -1
- package/dist/collection/components/q2-option-list/q2-option-list.js +4 -4
- package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +2 -2
- package/dist/collection/utils/sprites.js +16 -0
- package/dist/collection/utils/sprites.js.map +1 -0
- package/dist/components/q2-checkbox2.js +1 -1
- package/dist/components/q2-checkbox2.js.map +1 -1
- package/dist/components/q2-icon2.js +5 -20
- package/dist/components/q2-icon2.js.map +1 -1
- package/dist/components/q2-loading2.js +154 -5
- package/dist/components/q2-loading2.js.map +1 -1
- package/dist/components/sprites.js +20 -0
- package/dist/components/sprites.js.map +1 -0
- package/dist/esm/click-elsewhere.entry.js +1 -1
- package/dist/esm/{index-COzomxjJ.js → index-CGkHOjh1.js} +5 -2
- package/dist/esm/index-CGkHOjh1.js.map +1 -0
- package/dist/esm/{index-CkXFIBxL.js → index-xCuy-dFb.js} +3 -3
- package/dist/{q2-tecton-elements/index-CkXFIBxL.js.map → esm/index-xCuy-dFb.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/q2-action-group_2.entry.js +2 -2
- package/dist/esm/q2-action-sheet.entry.js +2 -2
- package/dist/esm/q2-avatar.entry.js +1 -1
- package/dist/esm/q2-badge.q2-btn.q2-icon.q2-input.q2-loading.q2-tab-container.q2-tab-pane.entry.js.map +1 -1
- package/dist/esm/q2-badge_7.entry.js +171 -27
- package/dist/esm/q2-badge_7.entry.js.map +1 -1
- package/dist/esm/q2-calendar.entry.js +2 -2
- package/dist/esm/q2-card.entry.js +2 -2
- package/dist/esm/q2-carousel-pane.entry.js +2 -2
- package/dist/esm/q2-carousel.entry.js +2 -2
- package/dist/esm/q2-chart-area.entry.js +2 -2
- package/dist/esm/q2-chart-bar.entry.js +2 -2
- package/dist/esm/q2-chart-donut.entry.js +2 -2
- package/dist/esm/q2-checkbox-group.entry.js +2 -2
- package/dist/esm/q2-checkbox.entry.js +3 -3
- package/dist/esm/q2-checkbox.entry.js.map +1 -1
- package/dist/esm/q2-context.entry.js +2 -2
- package/dist/esm/q2-currency.entry.js +1 -1
- package/dist/esm/q2-data-table.entry.js +2 -2
- package/dist/esm/q2-detail.entry.js +2 -2
- package/dist/esm/q2-dropdown-item.entry.js +2 -2
- package/dist/esm/q2-dropdown.entry.js +2 -2
- package/dist/esm/q2-editable-field.entry.js +2 -2
- package/dist/esm/q2-example.entry.js +1 -1
- package/dist/esm/q2-file-picker.entry.js +2 -2
- package/dist/esm/q2-form.entry.js +1 -1
- package/dist/esm/q2-formatted-text.entry.js +1 -1
- package/dist/esm/q2-grid-area.entry.js +1 -1
- package/dist/esm/q2-grid.entry.js +1 -1
- package/dist/esm/q2-item.entry.js +2 -2
- package/dist/esm/q2-legend.entry.js +1 -1
- package/dist/esm/q2-link_2.entry.js +2 -2
- package/dist/esm/q2-loading-element.entry.js +2 -2
- package/dist/esm/q2-loc.entry.js +2 -2
- package/dist/esm/q2-message.entry.js +2 -2
- package/dist/esm/q2-modal.entry.js +2 -2
- package/dist/esm/q2-month-picker.entry.js +2 -2
- package/dist/esm/q2-optgroup.entry.js +2 -2
- package/dist/esm/q2-option-list_2.entry.js +2 -2
- package/dist/esm/q2-option.entry.js +2 -2
- package/dist/esm/q2-pagination.entry.js +2 -2
- package/dist/esm/q2-pill.entry.js +2 -2
- package/dist/esm/q2-radio-group.entry.js +2 -2
- package/dist/esm/q2-radio.entry.js +2 -2
- package/dist/esm/q2-relative-time.entry.js +2 -2
- package/dist/esm/q2-section.entry.js +2 -2
- package/dist/esm/q2-select.entry.js +2 -2
- package/dist/esm/q2-stepper-pane.entry.js +2 -2
- package/dist/esm/q2-stepper-vertical.entry.js +2 -2
- package/dist/esm/q2-stepper.entry.js +2 -2
- package/dist/esm/q2-tag.entry.js +2 -2
- package/dist/esm/q2-tecton-elements.js +3 -3
- package/dist/esm/q2-textarea.entry.js +2 -2
- package/dist/esm/q2-tooltip.entry.js +2 -2
- package/dist/esm/{shapes-ElQYMSyu.js → shapes-B6iI6sMH.js} +3 -3
- package/dist/esm/{shapes-ElQYMSyu.js.map → shapes-B6iI6sMH.js.map} +1 -1
- package/dist/esm/tecton-tab-pane.entry.js +1 -1
- package/dist/q2-tecton-elements/click-elsewhere.entry.js +1 -1
- package/dist/q2-tecton-elements/{index-COzomxjJ.js → index-CGkHOjh1.js} +5 -2
- package/dist/q2-tecton-elements/index-CGkHOjh1.js.map +1 -0
- package/dist/q2-tecton-elements/{index-CkXFIBxL.js → index-xCuy-dFb.js} +3 -3
- package/dist/{esm/index-CkXFIBxL.js.map → q2-tecton-elements/index-xCuy-dFb.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-action-group_2.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-avatar.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-badge.q2-btn.q2-icon.q2-input.q2-loading.q2-tab-container.q2-tab-pane.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-badge_7.entry.js +259 -121
- package/dist/q2-tecton-elements/q2-badge_7.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-calendar.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-card.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-carousel.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-checkbox.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-checkbox.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-checkbox.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-context.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-currency.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-data-table.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-detail.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +9 -9
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-example.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-file-picker.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-form.entry.js +5 -5
- package/dist/q2-tecton-elements/q2-formatted-text.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-grid-area.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-grid.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-item.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-legend.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-link_2.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-loading-element.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-loc.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-message.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-modal.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-option-list_2.entry.js +16 -16
- package/dist/q2-tecton-elements/q2-option.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-pagination.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-pill.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +12 -12
- package/dist/q2-tecton-elements/q2-radio.entry.js +5 -5
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-section.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-select.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-stepper.entry.js +8 -8
- package/dist/q2-tecton-elements/q2-tag.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +3 -3
- package/dist/q2-tecton-elements/q2-textarea.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-tooltip.entry.js +2 -2
- package/dist/q2-tecton-elements/{shapes-ElQYMSyu.js → shapes-B6iI6sMH.js} +3 -3
- package/dist/q2-tecton-elements/{shapes-ElQYMSyu.js.map → shapes-B6iI6sMH.js.map} +1 -1
- package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +4 -4
- package/dist/types/components/q2-icon/q2-icon.d.ts +0 -5
- package/dist/types/components/q2-loading/q2-loading.d.ts +16 -2
- package/dist/types/components.d.ts +2 -2
- package/dist/types/utils/sprites.d.ts +5 -0
- package/package.json +3 -3
- package/dist/cjs/index-JnAD7tEB.js.map +0 -1
- package/dist/esm/index-COzomxjJ.js.map +0 -1
- package/dist/q2-tecton-elements/index-COzomxjJ.js.map +0 -1
- /package/dist/types/{home/gitlab-runner/builds → builds}/q2e/development/tecton/tecton/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +0 -0
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { handleAriaLabel, loc } from "../../utils/index";
|
|
3
3
|
import skeletonShapes from "./skeleton/shapes";
|
|
4
|
+
import { getOrCreateSpriteContainer } from "../../utils/sprites";
|
|
4
5
|
export class Q2Loading {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.dontUpdateScreenReaderLabel = false;
|
|
7
8
|
this.liveRegionChangeIndicatorToggle = false;
|
|
9
|
+
this.customLoaderClass = 'tct-loading-custom-loader';
|
|
10
|
+
this.hasCustomLoader = false;
|
|
8
11
|
/** Hides the loading element from screen readers. */
|
|
9
12
|
this.hideFromScreenReaders = false;
|
|
10
13
|
// #endregion
|
|
@@ -12,6 +15,9 @@ export class Q2Loading {
|
|
|
12
15
|
this.renderHalfCircleSpinner = () => {
|
|
13
16
|
return (h("div", { class: "q2-loading-animation half-circle-spinner", "aria-hidden": this.hideFromScreenReaders ? 'true' : undefined, "aria-live": !this.hideFromScreenReaders ? 'polite' : undefined, role: !this.hideFromScreenReaders ? 'status' : undefined }, h("div", { class: "circle circle-1" }), h("div", { class: "circle circle-2" }), !this.hideFromScreenReaders && (h("div", { class: "sr", ref: el => (this.screenReaderElement = el) }))));
|
|
14
17
|
};
|
|
18
|
+
this.renderCustomLoaderContainer = () => {
|
|
19
|
+
return (h("div", { id: "custom-loader-container", "aria-hidden": this.hideFromScreenReaders ? 'true' : undefined, "aria-live": !this.hideFromScreenReaders ? 'polite' : undefined, role: !this.hideFromScreenReaders ? 'status' : undefined }, !this.hideFromScreenReaders && (h("div", { class: "sr", ref: el => (this.screenReaderElement = el) }))));
|
|
20
|
+
};
|
|
15
21
|
this.renderSkeletonLoader = () => {
|
|
16
22
|
return (h("div", { class: "q2-loading-skeleton", "aria-hidden": this.hideFromScreenReaders ? 'true' : undefined, "aria-live": !this.hideFromScreenReaders ? 'polite' : undefined, role: !this.hideFromScreenReaders ? 'status' : undefined }, this.shape === 'custom' ? h("slot", null) : this.skeletonShape, h("div", { class: "q2-loading-skeleton-shimmer" }), !this.hideFromScreenReaders && (h("div", { class: "sr", ref: el => (this.screenReaderElement = el) }))));
|
|
17
23
|
};
|
|
@@ -26,6 +32,7 @@ export class Q2Loading {
|
|
|
26
32
|
}
|
|
27
33
|
componentWillLoad() {
|
|
28
34
|
handleAriaLabel(this);
|
|
35
|
+
this.handleType();
|
|
29
36
|
}
|
|
30
37
|
componentDidLoad() {
|
|
31
38
|
this.setupLiveRegionDelay();
|
|
@@ -33,8 +40,105 @@ export class Q2Loading {
|
|
|
33
40
|
componentDidUpdate() {
|
|
34
41
|
this.updateScreenReaderLabel();
|
|
35
42
|
}
|
|
43
|
+
componentDidRender() {
|
|
44
|
+
var _a;
|
|
45
|
+
if (!this.loaderClone)
|
|
46
|
+
return;
|
|
47
|
+
if (!this.hasCustomLoader)
|
|
48
|
+
return;
|
|
49
|
+
const customLoaderContainer = this.hostElement.shadowRoot.querySelector('#custom-loader-container');
|
|
50
|
+
(_a = customLoaderContainer.querySelector(`svg.${this.customLoaderClass}`)) === null || _a === void 0 ? void 0 : _a.remove();
|
|
51
|
+
customLoaderContainer.appendChild(this.loaderClone);
|
|
52
|
+
}
|
|
53
|
+
// #endregion
|
|
54
|
+
// #region Listeners
|
|
55
|
+
onUpdateLoaders() {
|
|
56
|
+
const { customLoaderURL } = this;
|
|
57
|
+
this.hasCustomLoader = !!customLoaderURL;
|
|
58
|
+
this.fetchLoader();
|
|
59
|
+
}
|
|
60
|
+
// #endregion
|
|
61
|
+
// #region Watchers
|
|
62
|
+
handleType() {
|
|
63
|
+
this.fetchLoader();
|
|
64
|
+
}
|
|
65
|
+
async fetchLoader() {
|
|
66
|
+
const { isSkeletonType, customLoaderURL } = this;
|
|
67
|
+
this.hasCustomLoader = false;
|
|
68
|
+
if (isSkeletonType) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (!customLoaderURL)
|
|
72
|
+
return;
|
|
73
|
+
this.hasCustomLoader = true;
|
|
74
|
+
let { customLoaderElement } = this;
|
|
75
|
+
const loaderExists = this.checkForLoader();
|
|
76
|
+
if (loaderExists)
|
|
77
|
+
return;
|
|
78
|
+
try {
|
|
79
|
+
const response = await fetch(customLoaderURL);
|
|
80
|
+
// Check for HTTP errors (including CORS issues that return error status)
|
|
81
|
+
if (!response.ok) {
|
|
82
|
+
throw new Error(`HTTP ${response.status}: Failed to fetch SVG. ` +
|
|
83
|
+
`This may be due to incorrect URL, server error, or CORS restrictions.`);
|
|
84
|
+
}
|
|
85
|
+
const svgText = await response.text();
|
|
86
|
+
const parser = new DOMParser();
|
|
87
|
+
const svgDoc = parser.parseFromString(svgText, 'image/svg+xml');
|
|
88
|
+
const svg = svgDoc.querySelector('svg');
|
|
89
|
+
if (!svg)
|
|
90
|
+
throw new Error('No SVG found in the loaded content');
|
|
91
|
+
svg.dataset.loaded = '';
|
|
92
|
+
svg.dataset.url = customLoaderURL;
|
|
93
|
+
svg.classList.add(this.customLoaderClass);
|
|
94
|
+
customLoaderElement = this.customLoaderElement;
|
|
95
|
+
if (!customLoaderElement)
|
|
96
|
+
return;
|
|
97
|
+
if (typeof customLoaderElement.replaceWith === 'function') {
|
|
98
|
+
customLoaderElement.replaceWith(svg);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
customLoaderElement.parentNode.replaceChild(svg, customLoaderElement);
|
|
102
|
+
}
|
|
103
|
+
svg.dispatchEvent(new CustomEvent(this.loaderEventName, { bubbles: true }));
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
// Provide more specific error messaging for common issues
|
|
107
|
+
if (error instanceof TypeError && error.message === 'Failed to fetch') {
|
|
108
|
+
console.error(`Failed to load custom loader from ${customLoaderURL}. ` +
|
|
109
|
+
`This is likely due to a CORS (Cross-Origin Resource Sharing) error. ` +
|
|
110
|
+
`Ensure the server hosting the SVG includes proper CORS headers ` +
|
|
111
|
+
`(Access-Control-Allow-Origin) or host the SVG on the same domain.`, error);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
console.error(`Failed to load custom loader SVG from ${customLoaderURL}:`, error);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
36
118
|
// #endregion
|
|
37
119
|
// #region Local Methods
|
|
120
|
+
get customLoaderURL() {
|
|
121
|
+
const hostComputedStyles = window.getComputedStyle(this.hostElement);
|
|
122
|
+
const loadingVariableURL = hostComputedStyles.getPropertyValue(`--tct-loading-custom-${this.type || 'spinner'}-url`);
|
|
123
|
+
if (!loadingVariableURL)
|
|
124
|
+
return;
|
|
125
|
+
return loadingVariableURL.trim().replace(/^url\(['"]?|['"]?\)$/g, '');
|
|
126
|
+
}
|
|
127
|
+
get isSkeletonType() {
|
|
128
|
+
return this.type === 'skeleton';
|
|
129
|
+
}
|
|
130
|
+
get loaderEventName() {
|
|
131
|
+
const { type = 'spinner', isSkeletonType } = this;
|
|
132
|
+
if (isSkeletonType)
|
|
133
|
+
return;
|
|
134
|
+
return `tct-loaded-${type}`;
|
|
135
|
+
}
|
|
136
|
+
get customLoaderElement() {
|
|
137
|
+
const { customLoaderURL, customLoaderClass } = this;
|
|
138
|
+
if (!customLoaderURL)
|
|
139
|
+
return;
|
|
140
|
+
return document.querySelector(`.${customLoaderClass}[data-url="${customLoaderURL}"]`);
|
|
141
|
+
}
|
|
38
142
|
get countsArray() {
|
|
39
143
|
if (this.type !== 'skeleton' || !this.counts) {
|
|
40
144
|
return undefined;
|
|
@@ -54,6 +158,35 @@ export class Q2Loading {
|
|
|
54
158
|
var _a, _b;
|
|
55
159
|
return (_b = (_a = skeletonShapes[this.shape]) === null || _a === void 0 ? void 0 : _a.call(skeletonShapes, this.countsArray, this.modifiersSet)) !== null && _b !== void 0 ? _b : '';
|
|
56
160
|
}
|
|
161
|
+
checkForLoader() {
|
|
162
|
+
const { loaderEventName, customLoaderClass } = this;
|
|
163
|
+
const spriteContainer = getOrCreateSpriteContainer();
|
|
164
|
+
let { customLoaderElement } = this;
|
|
165
|
+
// If the loading element exists and has the `data-loaded` attribute, we know we have everything we need
|
|
166
|
+
if (customLoaderElement === null || customLoaderElement === void 0 ? void 0 : customLoaderElement.hasAttribute('data-loaded')) {
|
|
167
|
+
this.cloneLoaderNode();
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
// If the loading element exists but does not have the `data-loaded` attribute, we know it's being loaded
|
|
171
|
+
// We'll listen for the event that will be dispatched when the element is loaded
|
|
172
|
+
spriteContainer.addEventListener(loaderEventName, () => {
|
|
173
|
+
this.cloneLoaderNode();
|
|
174
|
+
}, { once: true });
|
|
175
|
+
// If the loading element exists, we know it's being loaded and will be handled by the event listener
|
|
176
|
+
if (customLoaderElement)
|
|
177
|
+
return true;
|
|
178
|
+
// If loading element does not exist, create a placeholder
|
|
179
|
+
// This will let other icons know the element is being loaded and prevent multiple fetches
|
|
180
|
+
customLoaderElement = document.createElement('div');
|
|
181
|
+
customLoaderElement.classList.add(customLoaderClass);
|
|
182
|
+
customLoaderElement.dataset.url = this.customLoaderURL;
|
|
183
|
+
spriteContainer.appendChild(customLoaderElement);
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
cloneLoaderNode() {
|
|
187
|
+
const { customLoaderElement } = this;
|
|
188
|
+
this.loaderClone = customLoaderElement ? customLoaderElement.cloneNode(true) : undefined;
|
|
189
|
+
}
|
|
57
190
|
cleanupLiveRegionDelay() {
|
|
58
191
|
if (this.hideFromScreenReaders)
|
|
59
192
|
return;
|
|
@@ -77,14 +210,18 @@ export class Q2Loading {
|
|
|
77
210
|
if (entry.isIntersecting) {
|
|
78
211
|
clearTimeout(this.ariaLiveTimer);
|
|
79
212
|
this.ariaLiveTimer = setTimeout(() => {
|
|
80
|
-
this.screenReaderElement
|
|
213
|
+
if (this.screenReaderElement) {
|
|
214
|
+
this.screenReaderElement.textContent = `${this.localizedLabel}${this.liveRegionChangeIndicatorToggle ? '.' : ''}`;
|
|
215
|
+
}
|
|
81
216
|
this.liveRegionChangeIndicatorToggle = !this.liveRegionChangeIndicatorToggle;
|
|
82
217
|
this.dontUpdateScreenReaderLabel = false;
|
|
83
218
|
}, 2000);
|
|
84
219
|
}
|
|
85
220
|
else {
|
|
86
221
|
clearTimeout(this.ariaLiveTimer);
|
|
87
|
-
this.screenReaderElement
|
|
222
|
+
if (this.screenReaderElement) {
|
|
223
|
+
this.screenReaderElement.textContent = '';
|
|
224
|
+
}
|
|
88
225
|
this.dontUpdateScreenReaderLabel = true;
|
|
89
226
|
}
|
|
90
227
|
});
|
|
@@ -94,6 +231,8 @@ export class Q2Loading {
|
|
|
94
231
|
updateScreenReaderLabel() {
|
|
95
232
|
if (this.dontUpdateScreenReaderLabel)
|
|
96
233
|
return;
|
|
234
|
+
if (!this.screenReaderElement)
|
|
235
|
+
return;
|
|
97
236
|
this.screenReaderElement.textContent = this.localizedLabel;
|
|
98
237
|
}
|
|
99
238
|
get renderLoader() {
|
|
@@ -101,8 +240,11 @@ export class Q2Loading {
|
|
|
101
240
|
default: this.renderSpinner,
|
|
102
241
|
spinner: this.renderSpinner,
|
|
103
242
|
skeleton: this.renderSkeletonLoader,
|
|
243
|
+
custom: this.renderCustomLoaderContainer,
|
|
104
244
|
};
|
|
105
|
-
|
|
245
|
+
const { type, hasCustomLoader } = this;
|
|
246
|
+
const loaderMapKey = hasCustomLoader ? 'custom' : type;
|
|
247
|
+
return loaderMap[loaderMapKey] || loaderMap.default;
|
|
106
248
|
}
|
|
107
249
|
render() {
|
|
108
250
|
return this.renderLoader();
|
|
@@ -269,8 +411,8 @@ export class Q2Loading {
|
|
|
269
411
|
"attribute": "type",
|
|
270
412
|
"mutable": false,
|
|
271
413
|
"complexType": {
|
|
272
|
-
"original": "'spinner' | 'skeleton'",
|
|
273
|
-
"resolved": "\"skeleton\" | \"spinner\"",
|
|
414
|
+
"original": "'brand' | 'spinner' | 'skeleton'",
|
|
415
|
+
"resolved": "\"brand\" | \"skeleton\" | \"spinner\"",
|
|
274
416
|
"references": {}
|
|
275
417
|
},
|
|
276
418
|
"required": false,
|
|
@@ -285,6 +427,27 @@ export class Q2Loading {
|
|
|
285
427
|
}
|
|
286
428
|
};
|
|
287
429
|
}
|
|
430
|
+
static get states() {
|
|
431
|
+
return {
|
|
432
|
+
"loaderClone": {},
|
|
433
|
+
"hasCustomLoader": {}
|
|
434
|
+
};
|
|
435
|
+
}
|
|
288
436
|
static get elementRef() { return "hostElement"; }
|
|
437
|
+
static get watchers() {
|
|
438
|
+
return [{
|
|
439
|
+
"propName": "type",
|
|
440
|
+
"methodName": "handleType"
|
|
441
|
+
}];
|
|
442
|
+
}
|
|
443
|
+
static get listeners() {
|
|
444
|
+
return [{
|
|
445
|
+
"name": "tctUpdateLoaders",
|
|
446
|
+
"method": "onUpdateLoaders",
|
|
447
|
+
"target": "document",
|
|
448
|
+
"capture": false,
|
|
449
|
+
"passive": false
|
|
450
|
+
}];
|
|
451
|
+
}
|
|
289
452
|
}
|
|
290
453
|
//# sourceMappingURL=q2-loading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"q2-loading.js","sourceRoot":"","sources":["../../../../src/components/q2-loading/q2-loading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAsB,OAAO,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAG/C,MAAM,OAAO,SAAS;IADtB;QAKI,gCAA2B,GAAG,KAAK,CAAC;QAGpC,oCAA+B,GAAG,KAAK,CAAC;QAqDxC,qDAAqD;QAErD,0BAAqB,GAAY,KAAK,CAAC;QA0GvC,aAAa;QACb,yBAAyB;QAEzB,4BAAuB,GAAG,GAAG,EAAE;YAC3B,OAAO,CACH,WACI,KAAK,EAAC,0CAA0C,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,CAAC;IAC5C,CAAC;IAED,uBAAuB;QACnB,IAAI,IAAI,CAAC,2BAA2B;YAAE,OAAO;QAC7C,IAAI,CAAC,mBAAmB,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC;IAC/D,CAAC;IAyBD,IAAI,YAAY;QACZ,MAAM,SAAS,GAAG;YACd,OAAO,EAAE,IAAI,CAAC,aAAa;YAC3B,OAAO,EAAE,IAAI,CAAC,aAAa;YAC3B,QAAQ,EAAE,IAAI,CAAC,oBAAoB;SACtC,CAAC;QAEF,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC;IACrD,CAAC;IA0BD,MAAM;QACF,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;IAC/B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGJ","sourcesContent":["import { Component, Prop, h, ComponentInterface, Element } from '@stencil/core';\nimport { handleAriaLabel, loc } from 'src/utils';\nimport skeletonShapes from './skeleton/shapes';\n\n@Component({ tag: 'q2-loading', shadow: true, styleUrl: 'q2-loading.scss' })\nexport class Q2Loading implements ComponentInterface {\n // #region Own Properties\n\n ariaLiveTimer;\n dontUpdateScreenReaderLabel = false;\n observer: IntersectionObserver;\n screenReaderElement: HTMLElement;\n liveRegionChangeIndicatorToggle = false;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n ariaLabel: string;\n\n /**\n * Numeric adjustments are available for specific `type` and `shape` combinations.\n * These may impact the number of items, columns, and/or rows that display.\n *\n * When `shape=\"text\"`, `shape=\"detailed-item\"`, or `shape=\"label-value\"`, the `counts` attribute determines the number of rows to display.\n *\n * When `shape=\"table\"`, the `counts` attribute can be used in two ways:\n *\n * 1. `counts=\"CxR\"` = Provides a skeleton table of `C` columns and `R` rows. The default value is `\"5x5\"\n * 2. `counts=\"N\"` - Provides a skeleton table of `N` columns and 5 rows.\n *\n * When `shape=\"form\"`, the `counts` attribute can be used in two ways:\n *\n * 1. `counts=\"CxR\" - Provides a skeleton form of `C` columns and `R` rows of fields. The default value is `\"1x1\"`.\n * 2. `counts=\"N\"` - Provides a skeleton form of `N` fields stacked in single columns.\n */\n @Prop({ reflect: true })\n counts: string;\n\n /** Styles the component to have a `height` and `width` of `1em`, making it easy to place alongside text. */\n @Prop({ reflect: true })\n inline: boolean;\n\n /**\n * The label that is associated with the component. This is not displayed visually but is presented by screen readers.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n label: string;\n\n /**\n * Visual adjustments available to specific type and shape combinations, written as a hyphen (`-`) separated string.\n *\n * Supported values depend on the type and shape selected, and are listed in detail in the shape sections above.\n */\n @Prop({ reflect: true })\n modifiers: string;\n\n /** Hides the loading element from screen readers. */\n @Prop({ reflect: true })\n hideFromScreenReaders: boolean = false;\n\n /**\n * The specific visual presentation of a loading element `type`.\n * @snippet\n * // when type=\"spinner\"\n * type ShapeValues = \"half-circle\";\n * // when type=\"skeleton\"\n * type ShapeValues = \"circle | \"rectangle\" | \"text\" | \"table\" | \"field\" | \"form\" | \"detailed-item\" | \"label-value\";\n */\n @Prop({ reflect: true })\n shape: string;\n\n /** The type of loading element to display. */\n @Prop({ reflect: true })\n type: 'spinner' | 'skeleton';\n\n // #endregion\n // #region Component Lifecycle Events\n\n disconnectedCallback(): void {\n this.cleanupLiveRegionDelay();\n }\n\n componentWillLoad() {\n handleAriaLabel(this);\n }\n\n componentDidLoad(): void {\n this.setupLiveRegionDelay();\n }\n\n componentDidUpdate(): void {\n this.updateScreenReaderLabel();\n }\n\n // #endregion\n // #region Local Methods\n\n get countsArray(): number[] {\n if (this.type !== 'skeleton' || !this.counts) {\n return undefined;\n }\n\n return this.counts.split('x').map(Number);\n }\n\n get localizedLabel() {\n return loc(this.label || this.ariaLabel || 'tecton.element.loading.ariaLabel');\n }\n\n get modifiersSet(): Set<string> {\n if (this.type !== 'skeleton' || !this.modifiers) {\n return undefined;\n }\n\n return new Set(this.modifiers.split('-'));\n }\n\n get skeletonShape() {\n return skeletonShapes[this.shape]?.(this.countsArray, this.modifiersSet) ?? '';\n }\n\n cleanupLiveRegionDelay() {\n if (this.hideFromScreenReaders) return;\n\n clearTimeout(this.ariaLiveTimer);\n this.observer.disconnect();\n this.observer = null;\n }\n\n setupLiveRegionDelay() {\n if (this.hideFromScreenReaders) return;\n\n // The screen reader element starts out empty and is then populated by the\n // label text after a delay to ensure that it is announced by screen\n // readers.\n const options = {\n root: null,\n rootMargin: '0px',\n threshold: [1],\n };\n this.observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n clearTimeout(this.ariaLiveTimer);\n this.ariaLiveTimer = setTimeout(() => {\n this.screenReaderElement.textContent = `${this.localizedLabel}${this.liveRegionChangeIndicatorToggle ? '.' : ''}`;\n this.liveRegionChangeIndicatorToggle = !this.liveRegionChangeIndicatorToggle;\n this.dontUpdateScreenReaderLabel = false;\n }, 2000);\n } else {\n clearTimeout(this.ariaLiveTimer);\n this.screenReaderElement.textContent = '';\n this.dontUpdateScreenReaderLabel = true;\n }\n });\n }, options);\n this.observer.observe(this.hostElement);\n }\n\n updateScreenReaderLabel() {\n if (this.dontUpdateScreenReaderLabel) return;\n this.screenReaderElement.textContent = this.localizedLabel;\n }\n\n // #endregion\n // #region Render Methods\n\n renderHalfCircleSpinner = () => {\n return (\n <div\n class=\"q2-loading-animation half-circle-spinner\"\n aria-hidden={this.hideFromScreenReaders ? 'true' : undefined}\n aria-live={!this.hideFromScreenReaders ? 'polite' : undefined}\n role={!this.hideFromScreenReaders ? 'status' : undefined}\n >\n <div class=\"circle circle-1\"></div>\n <div class=\"circle circle-2\"></div>\n {!this.hideFromScreenReaders && (\n <div\n class=\"sr\"\n ref={el => (this.screenReaderElement = el)}\n ></div>\n )}\n </div>\n );\n };\n\n get renderLoader() {\n const loaderMap = {\n default: this.renderSpinner,\n spinner: this.renderSpinner,\n skeleton: this.renderSkeletonLoader,\n };\n\n return loaderMap[this.type] || loaderMap.default;\n }\n\n renderSkeletonLoader = () => {\n return (\n <div\n class=\"q2-loading-skeleton\"\n aria-hidden={this.hideFromScreenReaders ? 'true' : undefined}\n aria-live={!this.hideFromScreenReaders ? 'polite' : undefined}\n role={!this.hideFromScreenReaders ? 'status' : undefined}\n >\n {this.shape === 'custom' ? <slot /> : this.skeletonShape}\n <div class=\"q2-loading-skeleton-shimmer\"></div>\n {!this.hideFromScreenReaders && (\n <div\n class=\"sr\"\n ref={el => (this.screenReaderElement = el)}\n ></div>\n )}\n </div>\n );\n };\n\n renderSpinner = () => {\n return this.renderHalfCircleSpinner();\n };\n\n render() {\n return this.renderLoader();\n }\n\n // #endregion\n}\n"]}
|
|
1
|
+
{"version":3,"file":"q2-loading.js","sourceRoot":"","sources":["../../../../src/components/q2-loading/q2-loading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAsB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAG7D,MAAM,OAAO,SAAS;IADtB;QAKI,gCAA2B,GAAG,KAAK,CAAC;QAGpC,oCAA+B,GAAG,KAAK,CAAC;QACxC,sBAAiB,GAAG,2BAA2B,CAAC;QAehD,oBAAe,GAAY,KAAK,CAAC;QA+CjC,qDAAqD;QAErD,0BAAqB,GAAY,KAAK,CAAC;Q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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGJ","sourcesContent":["import { Component, Prop, h, ComponentInterface, Listen, Element, Watch, State } from '@stencil/core';\nimport { handleAriaLabel, loc } from 'src/utils';\nimport skeletonShapes from './skeleton/shapes';\nimport { getOrCreateSpriteContainer } from '@/utils/sprites';\n\n@Component({ tag: 'q2-loading', shadow: true, styleUrl: 'q2-loading.scss' })\nexport class Q2Loading implements ComponentInterface {\n // #region Own Properties\n\n ariaLiveTimer;\n dontUpdateScreenReaderLabel = false;\n observer: IntersectionObserver;\n screenReaderElement: HTMLElement;\n liveRegionChangeIndicatorToggle = false;\n customLoaderClass = 'tct-loading-custom-loader';\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n loaderClone: SVGElement;\n\n @State()\n hasCustomLoader: boolean = false;\n\n // #endregion\n // #region Public Property API\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n ariaLabel: string;\n\n /**\n * Numeric adjustments are available for specific `type` and `shape` combinations.\n * These may impact the number of items, columns, and/or rows that display.\n *\n * When `shape=\"text\"`, `shape=\"detailed-item\"`, or `shape=\"label-value\"`, the `counts` attribute determines the number of rows to display.\n *\n * When `shape=\"table\"`, the `counts` attribute can be used in two ways:\n *\n * 1. `counts=\"CxR\"` = Provides a skeleton table of `C` columns and `R` rows. The default value is `\"5x5\"\n * 2. `counts=\"N\"` - Provides a skeleton table of `N` columns and 5 rows.\n *\n * When `shape=\"form\"`, the `counts` attribute can be used in two ways:\n *\n * 1. `counts=\"CxR\" - Provides a skeleton form of `C` columns and `R` rows of fields. The default value is `\"1x1\"`.\n * 2. `counts=\"N\"` - Provides a skeleton form of `N` fields stacked in single columns.\n */\n @Prop({ reflect: true })\n counts: string;\n\n /** Styles the component to have a `height` and `width` of `1em`, making it easy to place alongside text. */\n @Prop({ reflect: true })\n inline: boolean;\n\n /**\n * The label that is associated with the component. This is not displayed visually but is presented by screen readers.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n label: string;\n\n /**\n * Visual adjustments available to specific type and shape combinations, written as a hyphen (`-`) separated string.\n *\n * Supported values depend on the type and shape selected, and are listed in detail in the shape sections above.\n */\n @Prop({ reflect: true })\n modifiers: string;\n\n /** Hides the loading element from screen readers. */\n @Prop({ reflect: true })\n hideFromScreenReaders: boolean = false;\n\n /**\n * The specific visual presentation of a loading element `type`.\n * @snippet\n * // when type=\"spinner\"\n * type ShapeValues = \"half-circle\";\n * // when type=\"skeleton\"\n * type ShapeValues = \"circle | \"rectangle\" | \"text\" | \"table\" | \"field\" | \"form\" | \"detailed-item\" | \"label-value\";\n */\n @Prop({ reflect: true })\n shape: string;\n\n /** The type of loading element to display. */\n @Prop({ reflect: true })\n type: 'brand' | 'spinner' | 'skeleton';\n\n // #endregion\n // #region Component Lifecycle Events\n\n disconnectedCallback(): void {\n this.cleanupLiveRegionDelay();\n }\n\n componentWillLoad() {\n handleAriaLabel(this);\n this.handleType();\n }\n\n componentDidLoad(): void {\n this.setupLiveRegionDelay();\n }\n\n componentDidUpdate(): void {\n this.updateScreenReaderLabel();\n }\n\n componentDidRender(): void {\n if (!this.loaderClone) return;\n if (!this.hasCustomLoader) return;\n const customLoaderContainer = this.hostElement.shadowRoot.querySelector('#custom-loader-container');\n customLoaderContainer.querySelector(`svg.${this.customLoaderClass}`)?.remove();\n customLoaderContainer.appendChild(this.loaderClone);\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('tctUpdateLoaders', { target: 'document' })\n onUpdateLoaders() {\n const { customLoaderURL } = this;\n this.hasCustomLoader = !!customLoaderURL;\n this.fetchLoader();\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('type')\n handleType() {\n this.fetchLoader();\n }\n\n async fetchLoader() {\n const { isSkeletonType, customLoaderURL } = this;\n this.hasCustomLoader = false;\n if (isSkeletonType) {\n return;\n }\n\n if (!customLoaderURL) return;\n this.hasCustomLoader = true;\n\n let { customLoaderElement } = this;\n const loaderExists = this.checkForLoader();\n\n if (loaderExists) return;\n\n try {\n const response = await fetch(customLoaderURL);\n\n // Check for HTTP errors (including CORS issues that return error status)\n if (!response.ok) {\n throw new Error(\n `HTTP ${response.status}: Failed to fetch SVG. ` +\n `This may be due to incorrect URL, server error, or CORS restrictions.`\n );\n }\n\n const svgText = await response.text();\n const parser = new DOMParser();\n const svgDoc = parser.parseFromString(svgText, 'image/svg+xml');\n const svg = svgDoc.querySelector('svg');\n\n if (!svg) throw new Error('No SVG found in the loaded content');\n\n svg.dataset.loaded = '';\n svg.dataset.url = customLoaderURL;\n svg.classList.add(this.customLoaderClass);\n\n customLoaderElement = this.customLoaderElement;\n if (!customLoaderElement) return;\n if (typeof customLoaderElement.replaceWith === 'function') {\n customLoaderElement.replaceWith(svg);\n } else {\n customLoaderElement.parentNode.replaceChild(svg, customLoaderElement);\n }\n\n svg.dispatchEvent(new CustomEvent(this.loaderEventName, { bubbles: true }));\n } catch (error) {\n // Provide more specific error messaging for common issues\n if (error instanceof TypeError && error.message === 'Failed to fetch') {\n console.error(\n `Failed to load custom loader from ${customLoaderURL}. ` +\n `This is likely due to a CORS (Cross-Origin Resource Sharing) error. ` +\n `Ensure the server hosting the SVG includes proper CORS headers ` +\n `(Access-Control-Allow-Origin) or host the SVG on the same domain.`,\n error\n );\n } else {\n console.error(`Failed to load custom loader SVG from ${customLoaderURL}:`, error);\n }\n }\n }\n // #endregion\n // #region Local Methods\n\n get customLoaderURL() {\n const hostComputedStyles = window.getComputedStyle(this.hostElement);\n const loadingVariableURL = hostComputedStyles.getPropertyValue(\n `--tct-loading-custom-${this.type || 'spinner'}-url`\n );\n if (!loadingVariableURL) return;\n\n return loadingVariableURL.trim().replace(/^url\\(['\"]?|['\"]?\\)$/g, '');\n }\n\n get isSkeletonType() {\n return this.type === 'skeleton';\n }\n\n get loaderEventName() {\n const { type = 'spinner', isSkeletonType } = this;\n if (isSkeletonType) return;\n return `tct-loaded-${type}`;\n }\n\n get customLoaderElement() {\n const { customLoaderURL, customLoaderClass } = this;\n if (!customLoaderURL) return;\n return document.querySelector<HTMLElement>(`.${customLoaderClass}[data-url=\"${customLoaderURL}\"]`);\n }\n\n get countsArray(): number[] {\n if (this.type !== 'skeleton' || !this.counts) {\n return undefined;\n }\n\n return this.counts.split('x').map(Number);\n }\n\n get localizedLabel() {\n return loc(this.label || this.ariaLabel || 'tecton.element.loading.ariaLabel');\n }\n\n get modifiersSet(): Set<string> {\n if (this.type !== 'skeleton' || !this.modifiers) {\n return undefined;\n }\n\n return new Set(this.modifiers.split('-'));\n }\n\n get skeletonShape() {\n return skeletonShapes[this.shape]?.(this.countsArray, this.modifiersSet) ?? '';\n }\n\n checkForLoader() {\n const { loaderEventName, customLoaderClass } = this;\n const spriteContainer = getOrCreateSpriteContainer();\n let { customLoaderElement } = this;\n\n // If the loading element exists and has the `data-loaded` attribute, we know we have everything we need\n if (customLoaderElement?.hasAttribute('data-loaded')) {\n this.cloneLoaderNode();\n return true;\n }\n\n // If the loading element exists but does not have the `data-loaded` attribute, we know it's being loaded\n // We'll listen for the event that will be dispatched when the element is loaded\n spriteContainer.addEventListener(\n loaderEventName,\n () => {\n this.cloneLoaderNode();\n },\n { once: true }\n );\n\n // If the loading element exists, we know it's being loaded and will be handled by the event listener\n if (customLoaderElement) return true;\n\n // If loading element does not exist, create a placeholder\n // This will let other icons know the element is being loaded and prevent multiple fetches\n customLoaderElement = document.createElement('div');\n customLoaderElement.classList.add(customLoaderClass);\n customLoaderElement.dataset.url = this.customLoaderURL;\n spriteContainer.appendChild(customLoaderElement);\n return false;\n }\n\n cloneLoaderNode() {\n const { customLoaderElement } = this;\n this.loaderClone = customLoaderElement ? (customLoaderElement.cloneNode(true) as SVGElement) : undefined;\n }\n\n cleanupLiveRegionDelay() {\n if (this.hideFromScreenReaders) return;\n\n clearTimeout(this.ariaLiveTimer);\n this.observer.disconnect();\n this.observer = null;\n }\n\n setupLiveRegionDelay() {\n if (this.hideFromScreenReaders) return;\n\n // The screen reader element starts out empty and is then populated by the\n // label text after a delay to ensure that it is announced by screen\n // readers.\n const options = {\n root: null,\n rootMargin: '0px',\n threshold: [1],\n };\n this.observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n clearTimeout(this.ariaLiveTimer);\n this.ariaLiveTimer = setTimeout(() => {\n if (this.screenReaderElement) {\n this.screenReaderElement.textContent = `${this.localizedLabel}${this.liveRegionChangeIndicatorToggle ? '.' : ''}`;\n }\n this.liveRegionChangeIndicatorToggle = !this.liveRegionChangeIndicatorToggle;\n this.dontUpdateScreenReaderLabel = false;\n }, 2000);\n } else {\n clearTimeout(this.ariaLiveTimer);\n if (this.screenReaderElement) {\n this.screenReaderElement.textContent = '';\n }\n this.dontUpdateScreenReaderLabel = true;\n }\n });\n }, options);\n this.observer.observe(this.hostElement);\n }\n\n updateScreenReaderLabel() {\n if (this.dontUpdateScreenReaderLabel) return;\n if (!this.screenReaderElement) return;\n this.screenReaderElement.textContent = this.localizedLabel;\n }\n\n // #endregion\n // #region Render Methods\n\n renderHalfCircleSpinner = () => {\n return (\n <div\n class=\"q2-loading-animation half-circle-spinner\"\n aria-hidden={this.hideFromScreenReaders ? 'true' : undefined}\n aria-live={!this.hideFromScreenReaders ? 'polite' : undefined}\n role={!this.hideFromScreenReaders ? 'status' : undefined}\n >\n <div class=\"circle circle-1\"></div>\n <div class=\"circle circle-2\"></div>\n {!this.hideFromScreenReaders && (\n <div\n class=\"sr\"\n ref={el => (this.screenReaderElement = el)}\n ></div>\n )}\n </div>\n );\n };\n\n get renderLoader() {\n const loaderMap = {\n default: this.renderSpinner,\n spinner: this.renderSpinner,\n skeleton: this.renderSkeletonLoader,\n custom: this.renderCustomLoaderContainer,\n };\n const { type, hasCustomLoader } = this;\n const loaderMapKey = hasCustomLoader ? 'custom' : type;\n\n return loaderMap[loaderMapKey] || loaderMap.default;\n }\n\n renderCustomLoaderContainer = () => {\n return (\n <div\n id=\"custom-loader-container\"\n aria-hidden={this.hideFromScreenReaders ? 'true' : undefined}\n aria-live={!this.hideFromScreenReaders ? 'polite' : undefined}\n role={!this.hideFromScreenReaders ? 'status' : undefined}\n >\n {!this.hideFromScreenReaders && (\n <div\n class=\"sr\"\n ref={el => (this.screenReaderElement = el)}\n ></div>\n )}\n </div>\n );\n };\n\n renderSkeletonLoader = () => {\n return (\n <div\n class=\"q2-loading-skeleton\"\n aria-hidden={this.hideFromScreenReaders ? 'true' : undefined}\n aria-live={!this.hideFromScreenReaders ? 'polite' : undefined}\n role={!this.hideFromScreenReaders ? 'status' : undefined}\n >\n {this.shape === 'custom' ? <slot /> : this.skeletonShape}\n <div class=\"q2-loading-skeleton-shimmer\"></div>\n {!this.hideFromScreenReaders && (\n <div\n class=\"sr\"\n ref={el => (this.screenReaderElement = el)}\n ></div>\n )}\n </div>\n );\n };\n\n renderSpinner = () => {\n return this.renderHalfCircleSpinner();\n };\n\n render() {\n return this.renderLoader();\n }\n\n // #endregion\n}\n"]}
|
|
@@ -702,7 +702,7 @@ export class Q2OptionList {
|
|
|
702
702
|
"references": {
|
|
703
703
|
"IOptionValue": {
|
|
704
704
|
"location": "local",
|
|
705
|
-
"path": "/
|
|
705
|
+
"path": "/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/src/components/q2-option-list/q2-option-list.tsx",
|
|
706
706
|
"id": "src/components/q2-option-list/q2-option-list.tsx::IOptionValue"
|
|
707
707
|
}
|
|
708
708
|
}
|
|
@@ -780,7 +780,7 @@ export class Q2OptionList {
|
|
|
780
780
|
"references": {
|
|
781
781
|
"IOptionValue": {
|
|
782
782
|
"location": "local",
|
|
783
|
-
"path": "/
|
|
783
|
+
"path": "/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/src/components/q2-option-list/q2-option-list.tsx",
|
|
784
784
|
"id": "src/components/q2-option-list/q2-option-list.tsx::IOptionValue"
|
|
785
785
|
}
|
|
786
786
|
}
|
|
@@ -840,7 +840,7 @@ export class Q2OptionList {
|
|
|
840
840
|
},
|
|
841
841
|
"ValidOptionElements": {
|
|
842
842
|
"location": "local",
|
|
843
|
-
"path": "/
|
|
843
|
+
"path": "/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/src/components/q2-option-list/q2-option-list.tsx",
|
|
844
844
|
"id": "src/components/q2-option-list/q2-option-list.tsx::ValidOptionElements"
|
|
845
845
|
}
|
|
846
846
|
},
|
|
@@ -862,7 +862,7 @@ export class Q2OptionList {
|
|
|
862
862
|
},
|
|
863
863
|
"ValidOptionElements": {
|
|
864
864
|
"location": "local",
|
|
865
|
-
"path": "/
|
|
865
|
+
"path": "/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/src/components/q2-option-list/q2-option-list.tsx",
|
|
866
866
|
"id": "src/components/q2-option-list/q2-option-list.tsx::ValidOptionElements"
|
|
867
867
|
}
|
|
868
868
|
},
|
|
@@ -214,7 +214,7 @@ export class Q2StepperPane {
|
|
|
214
214
|
"references": {
|
|
215
215
|
"IStepperPaneEvent": {
|
|
216
216
|
"location": "local",
|
|
217
|
-
"path": "/
|
|
217
|
+
"path": "/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/src/components/q2-stepper-pane/q2-stepper-pane.tsx",
|
|
218
218
|
"id": "src/components/q2-stepper-pane/q2-stepper-pane.tsx::IStepperPaneEvent"
|
|
219
219
|
}
|
|
220
220
|
}
|
|
@@ -253,7 +253,7 @@ export class Q2StepperPane {
|
|
|
253
253
|
"references": {
|
|
254
254
|
"IStepperPaneEvent": {
|
|
255
255
|
"location": "local",
|
|
256
|
-
"path": "/
|
|
256
|
+
"path": "/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/src/components/q2-stepper-pane/q2-stepper-pane.tsx",
|
|
257
257
|
"id": "src/components/q2-stepper-pane/q2-stepper-pane.tsx::IStepperPaneEvent"
|
|
258
258
|
}
|
|
259
259
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks for the sprite container element in the global DOM
|
|
3
|
+
* If it does not exist, it creates and appends it to the body, and returns it
|
|
4
|
+
*/
|
|
5
|
+
export function getOrCreateSpriteContainer() {
|
|
6
|
+
const spriteContainerId = 'tecton-sprites';
|
|
7
|
+
let spriteContainer = document.querySelector(`#${spriteContainerId}`);
|
|
8
|
+
if (spriteContainer)
|
|
9
|
+
return spriteContainer;
|
|
10
|
+
spriteContainer = document.createElement('div');
|
|
11
|
+
spriteContainer.id = spriteContainerId;
|
|
12
|
+
spriteContainer.style.display = 'none';
|
|
13
|
+
document.body.appendChild(spriteContainer);
|
|
14
|
+
return spriteContainer;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=sprites.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sprites.js","sourceRoot":"","sources":["../../../src/utils/sprites.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,0BAA0B;IACtC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;IAC3C,IAAI,eAAe,GAAmB,QAAQ,CAAC,aAAa,CAAC,IAAI,iBAAiB,EAAE,CAAC,CAAC;IAEtF,IAAI,eAAe;QAAE,OAAO,eAAe,CAAC;IAC5C,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAChD,eAAe,CAAC,EAAE,GAAG,iBAAiB,CAAC;IACvC,eAAe,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IACvC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAC3C,OAAO,eAAe,CAAC;AAC3B,CAAC","sourcesContent":["/**\n * Checks for the sprite container element in the global DOM\n * If it does not exist, it creates and appends it to the body, and returns it\n */\nexport function getOrCreateSpriteContainer() {\n const spriteContainerId = 'tecton-sprites';\n let spriteContainer: HTMLDivElement = document.querySelector(`#${spriteContainerId}`);\n\n if (spriteContainer) return spriteContainer;\n spriteContainer = document.createElement('div');\n spriteContainer.id = spriteContainerId;\n spriteContainer.style.display = 'none';\n document.body.appendChild(spriteContainer);\n return spriteContainer;\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
|
|
|
2
2
|
import { c as createGuid, h as handleAriaLabel, o as overrideFocus, i as isEventFromElement, l as loc } from './index2.js';
|
|
3
3
|
import { d as defineCustomElement$1 } from './q2-icon2.js';
|
|
4
4
|
|
|
5
|
-
const q2CheckboxCss = "*{box-sizing:border-box}*:active{outline:none}*:focus-visible{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{--comp-checkbox-padding:var(--tct-checkbox-padding, var(--tct-checkbox-vertical-padding, var(--t-checkbox-vertical-padding, 8px)) 0);display:block;position:relative;padding:var(--comp-checkbox-padding);--comp-default-checkbox-margin:var(--tct-checkbox-margin-top, var(--t-checkbox-margin-top, 0px)) 0 var(--tct-checkbox-margin-bottom, var(--t-checkbox-margin-bottom, 0px));margin:var(--tct-checkbox-margin, var(--comp-default-checkbox-margin))}.container{--comp-checkbox-size:var(--tct-checkbox-size, var(--t-checkbox-size, 24px));--comp-checkbox-default-column-gap:var(--app-scale-2x, 10px);--comp-checkbox-default-row-gap:0;--comp-checkbox-default-gap:var(--comp-checkbox-default-row-gap) var(--comp-checkbox-default-column-gap);--comp-checkbox-tween:var(--tct-tween-1, var(--app-tween-1, 0.2s ease));--comp-checkbox-toggle-width:var(--tct-checkbox-toggle-width, var(--t-checkbox-toggle-width, 38px));--comp-checkbox-toggle-error-color:var(--tct-checkbox-toggle-error-color, var(--comp-checkbox-error-color));--comp-checkbox-toggle-color:var(--tct-checkbox-toggle-color, var(--t-gray-8, #808080));--comp-checkbox-gap:var(--tct-checkbox-gap, var(--t-checkbox-gap, var(--comp-checkbox-default-gap)));--comp-checkbox-outer-stroke-color:var(--tct-checkbox-outer-stroke-color, var(--t-checkbox-outer-stroke-color, var(--t-a11y-gray-color-AA, #949494)));--comp-checkbox-outer-fill-color:var(--tct-checkbox-outer-fill-color, var(--t-checkbox-outer-fill-color, var(--tct-white, var(--app-white, #ffffff))));--comp-checkbox-checked-color:var(--tct-checkbox-check-stroke-color, var(--t-checkbox-check-stroke-color, var(--t-checkbox-fill, var(--t-a11y-active-gray-color-AA, #404040))));--comp-control-width:var(--comp-checkbox-size);--comp-checkbox-error-color:var(--tct-stoplight-error, var(--const-stoplight-alert, #d20a0a));--comp-checkbox-bold-fallback-stroke-width:var(--tct-checkbox-bold-fallback-stroke-width, 0.7px);--comp-checkbox-stroke-width:var(--tct-checkbox-stroke-width, unset);--comp-checkbox-checked-stroke-width:var(--tct-checkbox-checked-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));--comp-checkbox-hover-stroke-width:var(--tct-checkbox-hover-stroke-width, unset);--comp-checkbox-focused-stroke-width:var(--tct-checkbox-focused-stroke-width, unset);--comp-checkbox-checked-hover-stroke-width:var(--tct-checkbox-checked-hover-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));--comp-checkbox-checked-focused-stroke-width:var(--tct-checkbox-checked-focused-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));--comp-checkbox-description-stroke-width:var(--tct-checkbox-description-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));--comp-checkbox-description-focused-stroke-width:var(--tct-checkbox-description-focused-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));--comp-checkbox-description-hover-stroke-width:var(--tct-checkbox-description-hover-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));display:grid;grid-template-areas:\"svg label\" \"svg description\";align-items:center;gap:var(--comp-checkbox-gap);grid-template-columns:var(--comp-control-width) calc(100% - var(--comp-control-width) - var(--comp-checkbox-default-column-gap))}:host([type=favorite]) .container{--comp-checkbox-favorite-stroke-color:var(--tct-checkbox-favorite-stroke-color, var(--t-checkbox-favorite-stroke-color, var(--t-a11y-gray-color-AA, #949494)));--comp-checkbox-favorite-fill-color:var(--tct-checkbox-favorite-fill-color, var(--t-checkbox-favorite-fill-color, #db7d24))}:host([hide-label]:not([hide-label=false])) .container{grid-template-areas:\"svg\";grid-template-columns:var(--comp-control-width)}:host([type=toggle]) .container{--comp-control-width:var(--comp-checkbox-toggle-width)}:host([alignment=right]) .container,:host([type=toggle]:not([alignment])) .container{grid-template-areas:\"label svg\" \"description svg\";grid-template-columns:calc(100% - var(--comp-control-width) - var(--comp-checkbox-default-column-gap)) var(--comp-control-width)}.label-control{align-items:center;display:flex}.label-text{grid-area:label}:host([description]) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-description-stroke-width);text-stroke-width:var(--comp-checkbox-description-stroke-width)}:host([checked]:not([checked=false])) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-checked-stroke-width);text-stroke-width:var(--comp-checkbox-checked-stroke-width)}:host(:hover) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-hover-stroke-width);text-stroke-width:var(--comp-checkbox-hover-stroke-width)}:host(:focus-within) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-focused-stroke-width);text-stroke-width:var(--comp-checkbox-focused-stroke-width)}:host([description]:hover) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-description-hover-stroke-width);text-stroke-width:var(--comp-checkbox-description-hover-stroke-width)}:host([checked]:not([checked=false]):hover) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-checked-hover-stroke-width);text-stroke-width:var(--comp-checkbox-checked-hover-stroke-width)}:host([description]:focus-within) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-description-focused-stroke-width);text-stroke-width:var(--comp-checkbox-description-focused-stroke-width)}:host([checked]:not([checked=false]):focus-within) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-checked-focused-stroke-width);text-stroke-width:var(--comp-checkbox-checked-focused-stroke-width)}.label-text label{line-height:var(--tct-checkbox-label-line-height, 24px)}.description-text{grid-area:description;font-weight:var(--tct-checkbox-description-font-weight, var(--t-checkbox-description-font-weight, 400))}:host(:hover) .description-text{font-weight:var(--tct-checkbox-hover-description-font-weight, var(--tct-checkbox-description-font-weight, var(--t-checkbox-description-font-weight, 400)))}label{color:var(--tct-checkbox-label-color);cursor:pointer;hyphens:var(--tct-checkbox-label-hyphens, auto);word-break:var(--tct-checkbox-label-word-break, break-word);word-wrap:var(--tct-checkbox-label-word-wrap, break-word)}.checkbox-icon{width:var(--comp-checkbox-size);height:var(--comp-checkbox-size);border-radius:var(--tct-checkbox-outer-border-radius, var(--t-checkbox-outer-border-radius, var(--tct-border-radius-1, var(--app-border-radius-1, 4px))));stroke:var(--comp-checkbox-outer-stroke-color);fill:var(--comp-checkbox-outer-fill-color);stroke-width:var(--tct-checkbox-outer-stroke-width, var(--t-checkbox-outer-stroke-width, 2));flex-shrink:0;box-shadow:var(--tct-checkbox-box-shadow)}.checkbox-icon rect{transition:fill var(--tct-checkbox-tween, var(--app-tween-2, 0.4s ease))}:host([checked]:not([checked=false]):not([type=favorite])) .checkbox-icon{stroke:var(--tct-checkbox-checked-outer-stroke-color, var(--t-checkbox-checked-outer-stroke-color, var(--comp-checkbox-outer-stroke-color)))}:host([checked]:not([checked=false]):not([type=favorite])) .checkbox-icon rect{fill:var(--tct-checkbox-checked-outer-fill-color, var(--t-checkbox-checked-outer-fill-color, var(--comp-checkbox-outer-fill-color)))}:host([has-error]:not([has-error=false]):not([type=favorite])) .checkbox-icon{stroke:var(--tct-checkbox-error-outer-stroke-color, var(--comp-checkbox-error-color));box-shadow:var(--tct-checkbox-error-box-shadow, var(--tct-checkbox-box-shadow))}:host([has-error]:not([has-error=false]):not([type=favorite])) .checkbox-icon rect{fill:var(--tct-checkbox-error-outer-fill-color, var(--comp-checkbox-outer-fill-color))}:host(:hover:not([type=favorite])) .checkbox-icon{stroke:var(--tct-checkbox-hover-outer-stroke-color, var(--comp-checkbox-outer-stroke-color));box-shadow:var(--tct-checkbox-hover-box-shadow, var(--tct-checkbox-box-shadow))}:host(:hover:not([type=favorite])) .checkbox-icon rect{fill:var(--tct-checkbox-hover-outer-fill-color, var(--comp-checkbox-outer-fill-color))}:host(:hover[has-error]:not([has-error=false]):not([type=favorite])) .checkbox-icon{stroke:var(--tct-checkbox-error-hover-outer-stroke-color, var(--tct-checkbox-error-outer-stroke-color, var(--comp-checkbox-error-color)));box-shadow:var(--tct-checkbox-error-hover-box-shadow, var(--tct-checkbox-error-box-shadow, var(--tct-checkbox-hover-box-shadow, var(--tct-checkbox-box-shadow))))}:host(:hover[has-error]:not([has-error=false]):not([type=favorite])) .checkbox-icon rect{fill:var(--tct-checkbox-error-hover-outer-fill-color, var(--tct-checkbox-error-outer-fill-color, var(--comp-checkbox-outer-fill-color)))}:host(:focus-within:not([type=favorite])) .checkbox-icon{--comp-checkbox-focused-box-shadow:var(--const-double-focus-ring), var(--tct-global-focus, 0 0 0 2px #33b4ff);stroke:var(--tct-checkbox-focused-outer-stroke-color, var(--t-checkbox-focused-outer-stroke-color, var(--comp-checkbox-checked-color)));fill:var(--tct-checkbox-focused-outer-fill-color, var(--comp-checkbox-outer-fill-color));box-shadow:var(--tct-checkbox-focused-box-shadow, var(--tct-checkbox-box-shadow, var(--comp-checkbox-focused-box-shadow)))}:host(:focus-within[has-error]:not([has-error=false]):not([type=favorite])) .checkbox-icon{stroke:var(--tct-checkbox-error-focused-outer-stroke-color, var(--tct-checkbox-error-outer-stroke-color, var(--comp-checkbox-error-color)));fill:var(--tct-checkbox-error-focused-outer-fill-color, var(--tct-checkbox-error-outer-fill-color, var(--comp-checkbox-outer-fill-color)));box-shadow:var(--tct-checkbox-error-focused-box-shadow, var(--tct-checkbox-error-box-shadow, var(--tct-checkbox-box-shadow, var(--comp-checkbox-focused-box-shadow))))}:host([type=favorite]) .checkbox-icon{--tct-icon-stroke-width:var(--tct-checkbox-favorite-stroke-width, var(--t-checkbox-favorite-stroke-width, 1));--tct-icon-stroke-primary:var(--comp-checkbox-favorite-stroke-color);transition:fill var(--comp-checkbox-tween), color var(--comp-checkbox-tween), stroke var(--comp-checkbox-tween)}:host(:hover[type=favorite]) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-hover-stroke-color, var(--comp-checkbox-favorite-fill-color));--tct-icon-stroke-width:var(--tct-checkbox-favorite-hover-stroke-width, var(--t-checkbox-favorite-hover-stroke-width, 2))}:host([type=favorite]:focus-within) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-focused-stroke-color, var(--comp-checkbox-favorite-fill-color));--tct-icon-stroke-width:var(--tct-checkbox-favorite-hover-stroke-width, var(--t-checkbox-favorite-hover-stroke-width, 2))}:host([checked]:not([checked=false])[type=favorite]) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-checked-stroke-color, var(--tct-checkbox-favorite-stroke-color, var(--comp-checkbox-favorite-fill-color)));fill:var(--tct-checkbox-favorite-checked-fill-color, var(--comp-checkbox-favorite-fill-color));transition:fill var(--comp-checkbox-tween), color var(--comp-checkbox-tween), stroke var(--comp-checkbox-tween)}:host([checked]:not([checked=false])[type=favorite]:hover) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-checked-hover-stroke-color, var(--tct-checkbox-favorite-hover-stroke-color, var(--comp-checkbox-favorite-stroke-color)));--tct-icon-fill-primary:var(--tct-checkbox-favorite-checked-fill-color, var(--comp-checkbox-favorite-fill-color));--tct-icon-stroke-width:var(--tct-checkbox-favorite-hover-stroke-width, var(--t-checkbox-favorite-hover-stroke-width, 2))}:host([checked]:not([checked=false])[type=favorite]:focus-within) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-checked-focused-stroke-color, var(--tct-checkbox-favorite-focused-stroke-color, var(--comp-checkbox-favorite-stroke-color)));--tct-icon-stroke-width:var(--tct-checkbox-favorite-hover-stroke-width, var(--t-checkbox-favorite-hover-stroke-width, 2))}:host([has-error]:not([has-error=false])[type=favorite]) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-error-stroke-color, var(--comp-checkbox-error-color))}:host([has-error]:not([has-error=false])[type=favorite][checked]:not([checked=false])) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-error-stroke-color, var(--comp-checkbox-error-color))}.checkbox-fill{stroke:var(--tct-checkbox-checkmark-stroke-color, var(--comp-checkbox-checked-color));stroke-width:var(--tct-checkbox-check-stroke-width, var(--t-checkbox-check-stroke-width, 2.5));stroke-linecap:round;stroke-linejoin:round}.indeterminate-fill{stroke-width:var(--tct-checkbox-indeterminate-stroke-width, var(--t-checkbox-indeterminate-stroke-width, 3.5))}.toggle-svg-container{height:30px;width:var(--comp-checkbox-toggle-width);position:relative;text-align:initial}.toggle-indicator,.toggle-track{position:absolute;top:50%;transform:translateY(-50%)}.toggle-indicator{transition:left var(--comp-checkbox-tween), height var(--comp-checkbox-tween), width var(--comp-checkbox-tween);height:16px;width:16px;left:4px;border-radius:50%}.toggle-track{--comp-default-track-box-shadow:inset 0 0 0 1px var(--comp-checkbox-toggle-color);height:24px;width:38px;fill:var(--tct-checkbox-toggle-track-color, transparent);border-radius:var(--app-border-radius-3, 12px);box-shadow:var(--tct-checkbox-toggle-track-box-shadow, var(--comp-default-track-box-shadow));transition:fill var(--comp-checkbox-tween), box-shadow var(--comp-checkbox-tween)}.toggle-circle{mask:url(#xMask);fill:var(--comp-checkbox-toggle-color);transition:fill var(--comp-checkbox-tween)}.toggle-icon{stroke-linecap:round;stroke-linejoin:round;stroke-width:var(--tct-checkbox-toggle-icon-stroke-width, 2);stroke:black}:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-track,:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-track{--comp-default-hover-track-box-shadow:inset 0 0 0 2px var(--comp-checkbox-toggle-color);box-shadow:var(--tct-checkbox-toggle-hover-track-box-shadow, var(--comp-default-hover-track-box-shadow))}:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-indicator,:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-indicator{height:18px;width:18px}:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-circle,:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-circle{fill:var(--tct-checkbox-toggle-hover-circle-color, var(--t-primary-d1, var(--t-gray-6, #4d4d4d)))}:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :active .toggle-circle{fill:var(--tct-checkbox-toggle-active-color, var(--t-primary-l1, #7755af))}:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])) .toggle-track{box-shadow:inset 0 0 0 1px var(--comp-checkbox-toggle-error-color)}:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])) .toggle-circle{fill:var(--comp-checkbox-toggle-error-color)}:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-track,:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-track{box-shadow:inset 0 0 0 2px var(--comp-checkbox-toggle-error-color)}:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-circle,:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-circle{fill:var(--tct-checkbox-toggle-error-hover-color, var(--comp-checkbox-toggle-error-color))}:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :active .toggle-circle{fill:var(--tct-checkbox-toggle-error-active-color, var(--comp-checkbox-toggle-error-color))}:host([checked]:not([checked=false])) .toggle-indicator{left:18px}:host([checked]:not([checked=false])) .toggle-track{fill:var(--tct-checkbox-toggle-checked-track-color, var(--t-primary, #6a4a9e));border:none}:host([checked]:not([checked=false])) .toggle-circle{mask:url(#checkMask);fill:var(--tct-checkbox-toggle-checked-circle-color, var(--t-base, #ffffff))}:host([checked]:not([checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-track,:host([checked]:not([checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-track{fill:var(--tct-checkbox-toggle-checked-hover-track-color, var(--t-primary-d1, #5f438e))}:host([checked]:not([checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-indicator,:host([checked]:not([checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-indicator{height:18px;width:18px}:host([checked]:not([checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :active .toggle-track{fill:var(--tct-checkbox-toggle-checked-active-track-color, var(--t-primary-l1, #7755af))}:host([checked]:not([checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :active .toggle-indicator{height:18px;width:18px}:host([checked]:not([checked=false])):host([has-error]:not([has-error=false])) .toggle-track{fill:var(--tct-checkbox-toggle-checked-error-track-color, var(--comp-checkbox-toggle-error-color))}:host([checked]:not([checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-track,:host([checked]:not([checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-track{fill:var(--tct-checkbox-toggle-checked-error-hover-track-color, var(--comp-checkbox-toggle-error-color))}:host([checked]:not([checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :active .toggle-track{fill:var(--tct-checkbox-toggle-checked-error-active-track-color, var(--comp-checkbox-toggle-error-color))}:host(:is([disabled]:not([disabled=false]),[group-disabled]:not([group-disabled=false]))){cursor:not-allowed;opacity:var(--tct-checkbox-disabled-opacity, var(--t-checkbox-disabled-opacity, var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4))))}:host(:is([disabled]:not([disabled=false]),[group-disabled]:not([group-disabled=false]))) label{cursor:not-allowed}";
|
|
5
|
+
const q2CheckboxCss = "*{box-sizing:border-box}*:active{outline:none}*:focus-visible{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{--comp-checkbox-padding:var(--tct-checkbox-padding, var(--tct-checkbox-vertical-padding, var(--t-checkbox-vertical-padding, 8px)) 0);display:block;position:relative;padding:var(--comp-checkbox-padding);--comp-default-checkbox-margin:var(--tct-checkbox-margin-top, var(--t-checkbox-margin-top, 0px)) 0 var(--tct-checkbox-margin-bottom, var(--t-checkbox-margin-bottom, 0px));margin:var(--tct-checkbox-margin, var(--comp-default-checkbox-margin))}.container{--comp-checkbox-size:var(--tct-checkbox-size, var(--t-checkbox-size, 24px));--comp-checkbox-default-column-gap:var(--app-scale-2x, 10px);--comp-checkbox-default-row-gap:0;--comp-checkbox-default-gap:var(--comp-checkbox-default-row-gap) var(--comp-checkbox-default-column-gap);--comp-checkbox-tween:var(--tct-tween-1, var(--app-tween-1, 0.2s ease));--comp-checkbox-toggle-width:var(--tct-checkbox-toggle-width, var(--t-checkbox-toggle-width, 38px));--comp-checkbox-toggle-error-color:var(--tct-checkbox-toggle-error-color, var(--comp-checkbox-error-color));--comp-checkbox-toggle-color:var(--tct-checkbox-toggle-color, var(--t-gray-8, #808080));--comp-checkbox-gap:var(--tct-checkbox-gap, var(--t-checkbox-gap, var(--comp-checkbox-default-gap)));--comp-checkbox-outer-stroke-color:var(--tct-checkbox-outer-stroke-color, var(--t-checkbox-outer-stroke-color, var(--t-a11y-gray-color-AA, #949494)));--comp-checkbox-outer-fill-color:var(--tct-checkbox-outer-fill-color, var(--t-checkbox-outer-fill-color, var(--tct-white, var(--app-white, #ffffff))));--comp-checkbox-checked-color:var(--tct-checkbox-check-stroke-color, var(--t-checkbox-check-stroke-color, var(--t-checkbox-fill, var(--t-a11y-active-gray-color-AA, #404040))));--comp-control-width:var(--comp-checkbox-size);--comp-checkbox-error-color:var(--tct-stoplight-error, var(--const-stoplight-alert, #d20a0a));--comp-checkbox-bold-fallback-stroke-width:var(--tct-checkbox-bold-fallback-stroke-width, 0.7px);--comp-checkbox-stroke-width:var(--tct-checkbox-stroke-width, unset);--comp-checkbox-checked-stroke-width:var(--tct-checkbox-checked-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));--comp-checkbox-hover-stroke-width:var(--tct-checkbox-hover-stroke-width, unset);--comp-checkbox-focused-stroke-width:var(--tct-checkbox-focused-stroke-width, unset);--comp-checkbox-checked-hover-stroke-width:var(--tct-checkbox-checked-hover-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));--comp-checkbox-checked-focused-stroke-width:var(--tct-checkbox-checked-focused-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));--comp-checkbox-description-stroke-width:var(--tct-checkbox-description-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));--comp-checkbox-description-focused-stroke-width:var(--tct-checkbox-description-focused-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));--comp-checkbox-description-hover-stroke-width:var(--tct-checkbox-description-hover-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));display:grid;grid-template-areas:\"svg label\" \"svg description\";align-items:center;gap:var(--comp-checkbox-gap);grid-template-columns:var(--comp-control-width) calc(100% - var(--comp-control-width) - var(--comp-checkbox-default-column-gap))}:host([type=favorite]) .container{--comp-checkbox-favorite-stroke-color:var(--tct-checkbox-favorite-stroke-color, var(--t-checkbox-favorite-stroke-color, var(--t-a11y-gray-color-AA, #949494)));--comp-checkbox-favorite-fill-color:var(--tct-checkbox-favorite-fill-color, var(--t-checkbox-favorite-fill-color, #db7d24))}:host([hide-label]:not([hide-label=false])) .container{grid-template-areas:\"svg\";grid-template-columns:var(--comp-control-width)}:host([type=toggle]) .container{--comp-control-width:var(--comp-checkbox-toggle-width)}:host([alignment=right]) .container,:host([type=toggle]:not([alignment])) .container{grid-template-areas:\"label svg\" \"description svg\";grid-template-columns:calc(100% - var(--comp-control-width) - var(--comp-checkbox-default-column-gap)) var(--comp-control-width)}.label-control{align-items:center;display:flex}.label-text{grid-area:label}:host([description]) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-description-stroke-width);text-stroke-width:var(--comp-checkbox-description-stroke-width)}:host([checked]:not([checked=false])) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-checked-stroke-width);text-stroke-width:var(--comp-checkbox-checked-stroke-width)}:host(:hover) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-hover-stroke-width);text-stroke-width:var(--comp-checkbox-hover-stroke-width)}:host(:focus-within) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-focused-stroke-width);text-stroke-width:var(--comp-checkbox-focused-stroke-width)}:host([description]:hover) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-description-hover-stroke-width);text-stroke-width:var(--comp-checkbox-description-hover-stroke-width)}:host([checked]:not([checked=false]):hover) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-checked-hover-stroke-width);text-stroke-width:var(--comp-checkbox-checked-hover-stroke-width)}:host([description]:focus-within) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-description-focused-stroke-width);text-stroke-width:var(--comp-checkbox-description-focused-stroke-width)}:host([checked]:not([checked=false]):focus-within) .label-text{-webkit-text-stroke-width:var(--comp-checkbox-checked-focused-stroke-width);text-stroke-width:var(--comp-checkbox-checked-focused-stroke-width)}.label-text label{line-height:var(--tct-checkbox-label-line-height, 24px)}.description-text{grid-area:description;font-weight:var(--tct-checkbox-description-font-weight, var(--t-checkbox-description-font-weight, 400))}:host(:hover) .description-text{font-weight:var(--tct-checkbox-hover-description-font-weight, var(--tct-checkbox-description-font-weight, var(--t-checkbox-description-font-weight, 400)))}label{color:var(--tct-checkbox-label-color);cursor:pointer;hyphens:var(--tct-checkbox-label-hyphens, auto);word-break:var(--tct-checkbox-label-word-break, break-word);word-wrap:var(--tct-checkbox-label-word-wrap, break-word)}.checkbox-icon{width:var(--comp-checkbox-size);height:var(--comp-checkbox-size);border-radius:var(--tct-checkbox-outer-border-radius, var(--t-checkbox-outer-border-radius, var(--tct-border-radius-1, var(--app-border-radius-1, 4px))));stroke:var(--comp-checkbox-outer-stroke-color);fill:var(--comp-checkbox-outer-fill-color);stroke-width:var(--tct-checkbox-outer-stroke-width, var(--t-checkbox-outer-stroke-width, 2));flex-shrink:0;box-shadow:var(--tct-checkbox-box-shadow)}.checkbox-icon rect{transition:fill var(--tct-checkbox-tween, var(--app-tween-2, 0.4s ease))}:host([checked]:not([checked=false]):not([type=favorite])) .checkbox-icon{stroke:var(--tct-checkbox-checked-outer-stroke-color, var(--t-checkbox-checked-outer-stroke-color, var(--comp-checkbox-outer-stroke-color)))}:host([checked]:not([checked=false]):not([type=favorite])) .checkbox-icon rect{fill:var(--tct-checkbox-checked-outer-fill-color, var(--t-checkbox-checked-outer-fill-color, var(--comp-checkbox-outer-fill-color)))}:host([has-error]:not([has-error=false]):not([type=favorite])) .checkbox-icon{stroke:var(--tct-checkbox-error-outer-stroke-color, var(--comp-checkbox-error-color));box-shadow:var(--tct-checkbox-error-box-shadow, var(--tct-checkbox-box-shadow))}:host([has-error]:not([has-error=false]):not([type=favorite])) .checkbox-icon rect{fill:var(--tct-checkbox-error-outer-fill-color, var(--comp-checkbox-outer-fill-color))}:host(:hover:not([type=favorite])) .checkbox-icon{stroke:var(--tct-checkbox-hover-outer-stroke-color, var(--comp-checkbox-outer-stroke-color));box-shadow:var(--tct-checkbox-hover-box-shadow, var(--tct-checkbox-box-shadow))}:host(:hover:not([type=favorite])) .checkbox-icon rect{fill:var(--tct-checkbox-hover-outer-fill-color, var(--comp-checkbox-outer-fill-color))}:host(:hover[has-error]:not([has-error=false]):not([type=favorite])) .checkbox-icon{stroke:var(--tct-checkbox-error-hover-outer-stroke-color, var(--tct-checkbox-error-outer-stroke-color, var(--comp-checkbox-error-color)));box-shadow:var(--tct-checkbox-error-hover-box-shadow, var(--tct-checkbox-error-box-shadow, var(--tct-checkbox-hover-box-shadow, var(--tct-checkbox-box-shadow))))}:host(:hover[has-error]:not([has-error=false]):not([type=favorite])) .checkbox-icon rect{fill:var(--tct-checkbox-error-hover-outer-fill-color, var(--tct-checkbox-error-outer-fill-color, var(--comp-checkbox-outer-fill-color)))}:host(:focus-within:not([type=favorite])) .checkbox-icon{--comp-checkbox-focused-box-shadow:var(--const-double-focus-ring), var(--tct-global-focus, 0 0 0 2px #33b4ff);stroke:var(--tct-checkbox-focused-outer-stroke-color, var(--t-checkbox-focused-outer-stroke-color, var(--comp-checkbox-checked-color)));fill:var(--tct-checkbox-focused-outer-fill-color, var(--comp-checkbox-outer-fill-color));box-shadow:var(--tct-checkbox-focused-box-shadow, var(--tct-checkbox-box-shadow, var(--comp-checkbox-focused-box-shadow)))}:host(:focus-within[has-error]:not([has-error=false]):not([type=favorite])) .checkbox-icon{stroke:var(--tct-checkbox-error-focused-outer-stroke-color, var(--tct-checkbox-error-outer-stroke-color, var(--comp-checkbox-error-color)));fill:var(--tct-checkbox-error-focused-outer-fill-color, var(--tct-checkbox-error-outer-fill-color, var(--comp-checkbox-outer-fill-color)));box-shadow:var(--tct-checkbox-error-focused-box-shadow, var(--tct-checkbox-error-box-shadow, var(--tct-checkbox-box-shadow, var(--comp-checkbox-focused-box-shadow))))}:host([type=favorite]) .checkbox-icon{--tct-icon-stroke-width:var(--tct-checkbox-favorite-stroke-width, var(--t-checkbox-favorite-stroke-width, 1));--tct-icon-stroke-primary:var(--comp-checkbox-favorite-stroke-color);transition:fill var(--comp-checkbox-tween), color var(--comp-checkbox-tween), stroke var(--comp-checkbox-tween)}:host(:hover[type=favorite]) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-hover-stroke-color, var(--comp-checkbox-favorite-fill-color));--tct-icon-stroke-width:var(--tct-checkbox-favorite-hover-stroke-width, var(--t-checkbox-favorite-hover-stroke-width, 2))}:host([type=favorite]:focus-within) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-focused-stroke-color, var(--comp-checkbox-favorite-fill-color));--tct-icon-stroke-width:var(--tct-checkbox-favorite-hover-stroke-width, var(--t-checkbox-favorite-hover-stroke-width, 2))}:host([checked]:not([checked=false])[type=favorite]) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-checked-stroke-color, var(--tct-checkbox-favorite-stroke-color, var(--comp-checkbox-favorite-fill-color)));fill:var(--tct-checkbox-favorite-checked-fill-color, var(--comp-checkbox-favorite-fill-color));transition:fill var(--comp-checkbox-tween), color var(--comp-checkbox-tween), stroke var(--comp-checkbox-tween)}:host([checked]:not([checked=false])[type=favorite]:hover) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-checked-hover-stroke-color, var(--tct-checkbox-favorite-hover-stroke-color, var(--comp-checkbox-favorite-stroke-color)));--tct-icon-fill-primary:var(--tct-checkbox-favorite-checked-fill-color, var(--comp-checkbox-favorite-fill-color));--tct-icon-stroke-width:var(--tct-checkbox-favorite-hover-stroke-width, var(--t-checkbox-favorite-hover-stroke-width, 2))}:host([checked]:not([checked=false])[type=favorite]:focus-within) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-checked-focused-stroke-color, var(--tct-checkbox-favorite-focused-stroke-color, var(--comp-checkbox-favorite-stroke-color)));--tct-icon-stroke-width:var(--tct-checkbox-favorite-hover-stroke-width, var(--t-checkbox-favorite-hover-stroke-width, 2))}:host([has-error]:not([has-error=false])[type=favorite]) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-error-stroke-color, var(--comp-checkbox-error-color))}:host([has-error]:not([has-error=false])[type=favorite][checked]:not([checked=false])) .checkbox-icon{--tct-icon-stroke-primary:var(--tct-checkbox-favorite-error-stroke-color, var(--comp-checkbox-error-color))}.checkbox-fill{fill:none;stroke:var(--tct-checkbox-checkmark-stroke-color, var(--comp-checkbox-checked-color));stroke-width:var(--tct-checkbox-check-stroke-width, var(--t-checkbox-check-stroke-width, 2.5));stroke-linecap:round;stroke-linejoin:round}.indeterminate-fill{stroke-width:var(--tct-checkbox-indeterminate-stroke-width, var(--t-checkbox-indeterminate-stroke-width, 3.5))}.toggle-svg-container{height:30px;width:var(--comp-checkbox-toggle-width);position:relative;text-align:initial}.toggle-indicator,.toggle-track{position:absolute;top:50%;transform:translateY(-50%)}.toggle-indicator{transition:left var(--comp-checkbox-tween), height var(--comp-checkbox-tween), width var(--comp-checkbox-tween);height:16px;width:16px;left:4px;border-radius:50%}.toggle-track{--comp-default-track-box-shadow:inset 0 0 0 1px var(--comp-checkbox-toggle-color);height:24px;width:38px;fill:var(--tct-checkbox-toggle-track-color, transparent);border-radius:var(--app-border-radius-3, 12px);box-shadow:var(--tct-checkbox-toggle-track-box-shadow, var(--comp-default-track-box-shadow));transition:fill var(--comp-checkbox-tween), box-shadow var(--comp-checkbox-tween)}.toggle-circle{mask:url(#xMask);fill:var(--comp-checkbox-toggle-color);transition:fill var(--comp-checkbox-tween)}.toggle-icon{stroke-linecap:round;stroke-linejoin:round;stroke-width:var(--tct-checkbox-toggle-icon-stroke-width, 2);stroke:black}:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-track,:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-track{--comp-default-hover-track-box-shadow:inset 0 0 0 2px var(--comp-checkbox-toggle-color);box-shadow:var(--tct-checkbox-toggle-hover-track-box-shadow, var(--comp-default-hover-track-box-shadow))}:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-indicator,:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-indicator{height:18px;width:18px}:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-circle,:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-circle{fill:var(--tct-checkbox-toggle-hover-circle-color, var(--t-primary-d1, var(--t-gray-6, #4d4d4d)))}:host(:is(:not([checked]),[checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :active .toggle-circle{fill:var(--tct-checkbox-toggle-active-color, var(--t-primary-l1, #7755af))}:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])) .toggle-track{box-shadow:inset 0 0 0 1px var(--comp-checkbox-toggle-error-color)}:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])) .toggle-circle{fill:var(--comp-checkbox-toggle-error-color)}:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-track,:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-track{box-shadow:inset 0 0 0 2px var(--comp-checkbox-toggle-error-color)}:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-circle,:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-circle{fill:var(--tct-checkbox-toggle-error-hover-color, var(--comp-checkbox-toggle-error-color))}:host(:is(:not([checked]),[checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :active .toggle-circle{fill:var(--tct-checkbox-toggle-error-active-color, var(--comp-checkbox-toggle-error-color))}:host([checked]:not([checked=false])) .toggle-indicator{left:18px}:host([checked]:not([checked=false])) .toggle-track{fill:var(--tct-checkbox-toggle-checked-track-color, var(--t-primary, #6a4a9e));border:none}:host([checked]:not([checked=false])) .toggle-circle{mask:url(#checkMask);fill:var(--tct-checkbox-toggle-checked-circle-color, var(--t-base, #ffffff))}:host([checked]:not([checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-track,:host([checked]:not([checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-track{fill:var(--tct-checkbox-toggle-checked-hover-track-color, var(--t-primary-d1, #5f438e))}:host([checked]:not([checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-indicator,:host([checked]:not([checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-indicator{height:18px;width:18px}:host([checked]:not([checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :active .toggle-track{fill:var(--tct-checkbox-toggle-checked-active-track-color, var(--t-primary-l1, #7755af))}:host([checked]:not([checked=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :active .toggle-indicator{height:18px;width:18px}:host([checked]:not([checked=false])):host([has-error]:not([has-error=false])) .toggle-track{fill:var(--tct-checkbox-toggle-checked-error-track-color, var(--comp-checkbox-toggle-error-color))}:host([checked]:not([checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :hover .toggle-track,:host([checked]:not([checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :focus-within .toggle-track{fill:var(--tct-checkbox-toggle-checked-error-hover-track-color, var(--comp-checkbox-toggle-error-color))}:host([checked]:not([checked=false])):host([has-error]:not([has-error=false])):host(:is(:not([disabled]),[disabled=false]):is(:not([group-disabled]),[group-disabled=false])) :active .toggle-track{fill:var(--tct-checkbox-toggle-checked-error-active-track-color, var(--comp-checkbox-toggle-error-color))}:host(:is([disabled]:not([disabled=false]),[group-disabled]:not([group-disabled=false]))){cursor:not-allowed;opacity:var(--tct-checkbox-disabled-opacity, var(--t-checkbox-disabled-opacity, var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4))))}:host(:is([disabled]:not([disabled=false]),[group-disabled]:not([group-disabled=false]))) label{cursor:not-allowed}";
|
|
6
6
|
|
|
7
7
|
const Q2Checkbox = /*@__PURE__*/ proxyCustomElement(class Q2Checkbox extends HTMLElement {
|
|
8
8
|
constructor() {
|