q2-tecton-elements 1.21.2 → 1.22.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/cjs/installCanvasRenderer-b4d10c92.js +38433 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-badge_2.cjs.entry.js +5 -3
- package/dist/cjs/q2-calendar.cjs.entry.js +75 -55
- package/dist/cjs/q2-carousel.cjs.entry.js +3 -3
- package/dist/cjs/q2-chart-bar.cjs.entry.js +4679 -0
- package/dist/cjs/q2-chart-donut.cjs.entry.js +357 -35592
- package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/q2-calendar/index.js +43 -2
- package/dist/collection/components/q2-chart-bar/index.js +466 -0
- package/dist/collection/components/q2-chart-bar/styles.css +85 -0
- package/dist/collection/components/q2-chart-donut/index.js +3 -3
- package/dist/collection/components/q2-checkbox/styles.css +5 -1
- package/dist/collection/components/q2-editable-field/styles.css +1 -1
- package/dist/collection/components/q2-input/formatting/phone.js +2 -2
- package/dist/collection/components/q2-input/index.js +21 -0
- package/dist/collection/components/q2-input/styles.css +2 -2
- package/dist/collection/components/q2-radio/styles.css +1 -1
- package/dist/collection/utils/charting.js +182 -0
- package/dist/components/click-elsewhere.d.ts +11 -0
- package/dist/components/click-elsewhere.js +6 -0
- package/dist/components/index.d.ts +62 -0
- package/dist/components/index.js +42 -0
- package/dist/components/index10.js +84 -0
- package/dist/components/index11.js +383 -0
- package/dist/components/index12.js +125 -0
- package/dist/components/index13.js +602 -0
- package/dist/components/index2.js +100 -0
- package/dist/components/index3.js +90 -0
- package/dist/components/index4.js +62 -0
- package/dist/components/index5.js +146 -0
- package/dist/components/index6.js +145 -0
- package/dist/components/index7.js +2960 -0
- package/dist/components/index8.js +3356 -0
- package/dist/components/index9.js +101 -0
- package/dist/components/installCanvasRenderer.js +38282 -0
- package/dist/components/q2-avatar.d.ts +11 -0
- package/dist/components/q2-avatar.js +6 -0
- package/dist/components/q2-badge.d.ts +11 -0
- package/dist/components/q2-badge.js +6 -0
- package/dist/components/q2-btn.d.ts +11 -0
- package/dist/components/q2-btn.js +6 -0
- package/dist/components/q2-calendar.d.ts +11 -0
- package/dist/components/q2-calendar.js +3755 -0
- package/dist/components/q2-card.d.ts +11 -0
- package/dist/components/q2-card.js +187 -0
- package/dist/components/q2-carousel-pane.d.ts +11 -0
- package/dist/components/q2-carousel-pane.js +97 -0
- package/dist/components/q2-carousel.d.ts +11 -0
- package/dist/components/q2-carousel.js +5379 -0
- package/dist/components/q2-chart-bar.d.ts +11 -0
- package/dist/components/q2-chart-bar.js +4710 -0
- package/dist/components/q2-chart-donut.d.ts +11 -0
- package/dist/components/q2-chart-donut.js +4887 -0
- package/dist/components/q2-checkbox-group.d.ts +11 -0
- package/dist/components/q2-checkbox-group.js +114 -0
- package/dist/components/q2-checkbox.d.ts +11 -0
- package/dist/components/q2-checkbox.js +138 -0
- package/dist/components/q2-dropdown-item.d.ts +11 -0
- package/dist/components/q2-dropdown-item.js +6 -0
- package/dist/components/q2-dropdown.d.ts +11 -0
- package/dist/components/q2-dropdown.js +345 -0
- package/dist/components/q2-editable-field.d.ts +11 -0
- package/dist/components/q2-editable-field.js +220 -0
- package/dist/components/q2-icon.d.ts +11 -0
- package/dist/components/q2-icon.js +6 -0
- package/dist/components/q2-input.d.ts +11 -0
- package/dist/components/q2-input.js +6 -0
- package/dist/components/q2-loading-element.d.ts +11 -0
- package/dist/components/q2-loading-element.js +52 -0
- package/dist/components/q2-loading.d.ts +11 -0
- package/dist/components/q2-loading.js +6 -0
- package/dist/components/q2-loc.d.ts +11 -0
- package/dist/components/q2-loc.js +40 -0
- package/dist/components/q2-message.d.ts +11 -0
- package/dist/components/q2-message.js +6 -0
- package/dist/components/q2-month-picker.d.ts +11 -0
- package/dist/components/q2-month-picker.js +189 -0
- package/dist/components/q2-optgroup.d.ts +11 -0
- package/dist/components/q2-optgroup.js +75 -0
- package/dist/components/q2-option-list.d.ts +11 -0
- package/dist/components/q2-option-list.js +6 -0
- package/dist/components/q2-option.d.ts +11 -0
- package/dist/components/q2-option.js +81 -0
- package/dist/components/q2-pagination.d.ts +11 -0
- package/dist/components/q2-pagination.js +184 -0
- package/dist/components/q2-pill.d.ts +11 -0
- package/dist/components/q2-pill.js +216 -0
- package/dist/components/q2-popover.d.ts +11 -0
- package/dist/components/q2-popover.js +6 -0
- package/dist/components/q2-radio-group.d.ts +11 -0
- package/dist/components/q2-radio-group.js +191 -0
- package/dist/components/q2-radio.d.ts +11 -0
- package/dist/components/q2-radio.js +105 -0
- package/dist/components/q2-section.d.ts +11 -0
- package/dist/components/q2-section.js +218 -0
- package/dist/components/q2-select.d.ts +11 -0
- package/dist/components/q2-select.js +817 -0
- package/dist/components/q2-stepper-pane.d.ts +11 -0
- package/dist/components/q2-stepper-pane.js +92 -0
- package/dist/components/q2-stepper-vertical.d.ts +11 -0
- package/dist/components/q2-stepper-vertical.js +311 -0
- package/dist/components/q2-stepper.d.ts +11 -0
- package/dist/components/q2-stepper.js +252 -0
- package/dist/components/q2-tab-container.d.ts +11 -0
- package/dist/components/q2-tab-container.js +288 -0
- package/dist/components/q2-tab-pane.d.ts +11 -0
- package/dist/components/q2-tab-pane.js +58 -0
- package/dist/components/q2-tag.d.ts +11 -0
- package/dist/components/q2-tag.js +156 -0
- package/dist/components/q2-textarea.d.ts +11 -0
- package/dist/components/q2-textarea.js +265 -0
- package/dist/components/q2-tooltip.d.ts +11 -0
- package/dist/components/q2-tooltip.js +112 -0
- package/dist/components/shapes.js +91 -0
- package/dist/components/tecton-tab-pane.d.ts +11 -0
- package/dist/components/tecton-tab-pane.js +111 -0
- package/dist/esm/installCanvasRenderer-0143b52d.js +38282 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-badge_2.entry.js +5 -3
- package/dist/esm/q2-calendar.entry.js +75 -55
- package/dist/esm/q2-carousel.entry.js +3 -3
- package/dist/esm/q2-chart-bar.entry.js +4675 -0
- package/dist/esm/q2-chart-donut.entry.js +171 -35406
- package/dist/esm/q2-checkbox.entry.js +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/q2-tecton-elements/p-1f85cced.js +39 -0
- package/dist/q2-tecton-elements/{p-89608314.entry.js → p-4625184b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9772b15f.entry.js → p-520c40f6.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-6b52a262.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c4640b55.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-7e8f43d1.entry.js → p-cf41970f.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-e4dc9ac0.entry.js +1 -0
- package/dist/q2-tecton-elements/p-f35bf6a3.entry.js +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/types/components/q2-calendar/index.d.ts +3 -0
- package/dist/types/components/q2-chart-bar/index.d.ts +40 -0
- package/dist/types/components/q2-chart-donut/index.d.ts +7 -10
- package/dist/types/components/q2-input/index.d.ts +1 -0
- package/dist/types/components.d.ts +50 -3
- package/dist/types/utils/charting.d.ts +14 -0
- package/package.json +5 -2
- package/dist/q2-tecton-elements/p-0766a694.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5f064e1e.entry.js +0 -39
- package/dist/q2-tecton-elements/p-8d25ec52.entry.js +0 -1
- /package/dist/types/workspace/workspace/{tecton-production_release_1.21.x → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2CheckboxGroup extends Components.Q2CheckboxGroup, HTMLElement {}
|
|
4
|
+
export const Q2CheckboxGroup: {
|
|
5
|
+
prototype: Q2CheckboxGroup;
|
|
6
|
+
new (): Q2CheckboxGroup;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as createGuid, l as loc } from './index13.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './index7.js';
|
|
4
|
+
|
|
5
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}: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{margin-top:var(--tct-scale-2, var(--app-scale-2x, 10px))}fieldset{padding:var(--tct-input-error-padding, 0);margin:0;border:0}fieldset.has-error{border-color:var(--tct-input-error-border-color, var(--const-stoplight-alert, #c30000));border-width:1px;border-style:solid;border-radius:var(--tct-border-radius-1, var(--app-border-radius-1, 2px));position:relative}fieldset.has-error .error-icon-container{top:8px;right:8px;position:absolute;width:40%;text-align:right;background:linear-gradient(to right, var(--tct-checkbox-group-error-gradient-start, var(--t-base-a0, rgba(255, 255, 255, 0))), var(--tct-checkbox-group-error-gradient-end, var(--t-base, white)))}fieldset.has-error legend+div.error-icon-container.no-label{top:28px}.group-legend{font-weight:600}legend.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0}.optional-tag{margin-left:var(--tct-input-label-optional-margin-left, var(--tct-scale-1, var(--app-scale-1x, 5px)));color:var(--tct-input-label-optional-font-color, var(--tct-a11y-color, var(--t-a11y-gray-color, var(--tct-gray-7, var(--t-gray-7, var(--tct-gray-d1, var(--app-gray-d1, #666666)))))));font-size:var(--tct-input-label-optional-font-size, 12px);font-weight:var(--tct-input-label-optional-font-weight, 400)}.flexed{margin:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:center}.flexed.left{justify-content:left}";
|
|
6
|
+
|
|
7
|
+
const Q2CheckboxGroup$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.change = createEvent(this, "change", 7);
|
|
13
|
+
this.id = `checkbox-group-${createGuid()}`;
|
|
14
|
+
this.onMutationObserved = () => {
|
|
15
|
+
this.valueUpdated();
|
|
16
|
+
this.disabledUpdated();
|
|
17
|
+
};
|
|
18
|
+
this.onInnerCheckboxChange = (event) => {
|
|
19
|
+
event.stopImmediatePropagation();
|
|
20
|
+
const groupValue = {};
|
|
21
|
+
this.checkboxElements.forEach(check => {
|
|
22
|
+
groupValue[check.value] = !!check.checked;
|
|
23
|
+
});
|
|
24
|
+
this.change.emit(groupValue);
|
|
25
|
+
};
|
|
26
|
+
this.label = undefined;
|
|
27
|
+
this.value = undefined;
|
|
28
|
+
this.disabled = false;
|
|
29
|
+
this.readonly = false;
|
|
30
|
+
this.optional = false;
|
|
31
|
+
this.hasError = false;
|
|
32
|
+
}
|
|
33
|
+
get checkboxElements() {
|
|
34
|
+
return Array.from(this.hostElement.querySelectorAll('q2-checkbox'));
|
|
35
|
+
}
|
|
36
|
+
get protectedValue() {
|
|
37
|
+
return this.value || {};
|
|
38
|
+
}
|
|
39
|
+
///// LIFECYCLE HOOK ///////
|
|
40
|
+
componentDidLoad() {
|
|
41
|
+
const observer = new MutationObserver(this.onMutationObserved);
|
|
42
|
+
observer.observe(this.hostElement, { childList: true });
|
|
43
|
+
this.mutationObserver = observer;
|
|
44
|
+
this.onMutationObserved();
|
|
45
|
+
}
|
|
46
|
+
disconnectedCallback() {
|
|
47
|
+
if (this.mutationObserver) {
|
|
48
|
+
this.mutationObserver.disconnect();
|
|
49
|
+
this.mutationObserver = null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
valueUpdated() {
|
|
53
|
+
if (this.readonly)
|
|
54
|
+
return;
|
|
55
|
+
this.checkboxElements.forEach(check => {
|
|
56
|
+
if (this.protectedValue.hasOwnProperty(check.value)) {
|
|
57
|
+
check.checked = this.value[check.value];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
disabledUpdated() {
|
|
62
|
+
this.checkboxElements.forEach(checkbox => {
|
|
63
|
+
checkbox.groupDisabled = this.disabled;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
onHostElementChange(event) {
|
|
67
|
+
if (event.target === this.hostElement && !this.hostElement.onchange) {
|
|
68
|
+
this.value = event.detail;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
return (h("div", null, this.label || this.optional ? (h("div", { class: "group-legend" }, this.label && loc(this.label), this.optional ? h("span", { class: "optional-tag" }, loc('tecton.element.input.optional')) : '')) : (''), h("fieldset", { class: `q2-checkbox-fieldset ${this.hasError ? 'has-error' : ''}`, onChange: this.onInnerCheckboxChange, "aria-required": `${!this.optional}` }, this.label || this.optional ? (h("legend", { class: "sr-only" }, this.label && loc(this.label), this.optional ? (h("span", { class: "optional-tag" }, loc('tecton.element.input.optional'))) : (''))) : (''), this.hasError ? (h("div", { class: `error-icon-container ${this.label || this.optional ? '' : 'no-label'}` }, h("q2-icon", { class: "h(4) w(4) mrg-b(2)", type: "error" }))) : (''), this.inputDom())));
|
|
73
|
+
}
|
|
74
|
+
inputDom() {
|
|
75
|
+
return h("slot", null);
|
|
76
|
+
}
|
|
77
|
+
get hostElement() { return this; }
|
|
78
|
+
static get watchers() { return {
|
|
79
|
+
"value": ["valueUpdated"],
|
|
80
|
+
"disabled": ["disabledUpdated"]
|
|
81
|
+
}; }
|
|
82
|
+
static get style() { return stylesCss; }
|
|
83
|
+
}, [1, "q2-checkbox-group", {
|
|
84
|
+
"label": [513],
|
|
85
|
+
"value": [1040],
|
|
86
|
+
"disabled": [516],
|
|
87
|
+
"readonly": [516],
|
|
88
|
+
"optional": [516],
|
|
89
|
+
"hasError": [516, "has-error"]
|
|
90
|
+
}, [[0, "change", "onHostElementChange"]]]);
|
|
91
|
+
function defineCustomElement$1() {
|
|
92
|
+
if (typeof customElements === "undefined") {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const components = ["q2-checkbox-group", "q2-icon"];
|
|
96
|
+
components.forEach(tagName => { switch (tagName) {
|
|
97
|
+
case "q2-checkbox-group":
|
|
98
|
+
if (!customElements.get(tagName)) {
|
|
99
|
+
customElements.define(tagName, Q2CheckboxGroup$1);
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
case "q2-icon":
|
|
103
|
+
if (!customElements.get(tagName)) {
|
|
104
|
+
defineCustomElement$2();
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
} });
|
|
108
|
+
}
|
|
109
|
+
defineCustomElement$1();
|
|
110
|
+
|
|
111
|
+
const Q2CheckboxGroup = Q2CheckboxGroup$1;
|
|
112
|
+
const defineCustomElement = defineCustomElement$1;
|
|
113
|
+
|
|
114
|
+
export { Q2CheckboxGroup, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2Checkbox extends Components.Q2Checkbox, HTMLElement {}
|
|
4
|
+
export const Q2Checkbox: {
|
|
5
|
+
prototype: Q2Checkbox;
|
|
6
|
+
new (): Q2Checkbox;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as createGuid, h as handleAriaLabel, o as overrideFocus, i as isEventFromElement, l as loc } from './index13.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './index7.js';
|
|
4
|
+
|
|
5
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}: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{display:block;position:relative;padding:var(--tct-checkbox-vertical-padding, var(--t-checkbox-vertical-padding, var(--tct-scale-2, var(--app-scale-2x, 10px)))) 0}.container{--comp-checkbox-size:var(--tct-checkbox-size, var(--t-checkbox-size, 20px));--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, 46px));--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);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([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{font-weight:var(--tct-checkbox-label-font-weight, var(--t-checkbox-label-font-weight, 600))}:host([checked]) .label-text{font-weight:var(--tct-checkbox-checked-label-font-weight, var(--t-checkbox-checked-label-font-weight, 600))}.description-text{grid-area:description;font-weight:var(--tct-checkbox-description-font-weight, var(--t-checkbox-description-font-weight, 400))}label{cursor:pointer}:host([disabled]:not([disabled=false])),:host([group-disabled]){opacity:var(--tct-checkbox-disabled-opacity, var(--t-checkbox-disabled-opacity, var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4))))}:host([disabled]:not([disabled=false])) label,:host([group-disabled]) label{cursor:not-allowed}.checkbox-icon{--t-icon-stroke-primary:var(--comp-checkbox-outer-stroke-color);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, 3px))));stroke:var(--comp-checkbox-outer-stroke-color);color:var(--comp-checkbox-outer-stroke-color);stroke-width:var(--tct-checkbox-outer-stroke-width, var(--t-checkbox-outer-stroke-width, 2));fill:var(--comp-checkbox-outer-fill-color);flex-shrink:0}:host([checked]) .checkbox-icon{fill:var(--tct-checkbox-checked-outer-fill-color, var(--t-checkbox-checked-outer-fill-color, var(--comp-checkbox-outer-fill-color)));stroke:var(--tct-checkbox-checked-outer-stroke-color, var(--t-checkbox-checked-outer-stroke-color, var(--comp-checkbox-outer-stroke-color)))}:host(:focus-within) .checkbox-icon{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)))}: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([type=favorite]:focus-within) .checkbox-icon,:host([type=favorite]:hover) .checkbox-icon{--tct-icon-stroke-primary: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][type=favorite]) .checkbox-icon{--tct-icon-stroke-primary:var(--comp-checkbox-favorite-fill-color);fill:var(--comp-checkbox-favorite-fill-color);transition:fill var(--comp-checkbox-tween), color var(--comp-checkbox-tween), stroke var(--comp-checkbox-tween)}:host([checked][type=favorite]:focus-within) .checkbox-icon,:host([checked][type=favorite]:hover) .checkbox-icon{--tct-icon-stroke-primary:var(--comp-checkbox-favorite-stroke-color);--tct-icon-fill-primary: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))}.checkbox-fill{stroke:var(--comp-checkbox-checked-color)}.checked-fill{stroke-width:var(--tct-checkbox-check-stroke-width, var(--t-checkbox-check-stroke-width, 2.5));stroke-linecap:round;stroke-linejoin:round}:host([type=toggle]) .checked-fill{stroke:var(--tct-checkbox-toggle-icon-stroke, var(--t-checkbox-toggle-icon-stroke, var(--tct-white, var(--app-white, #ffffff))));transition:opacity var(--comp-checkbox-tween)}:host([type=toggle][checked]) .checked-fill{stroke:var(--tct-checkbox-toggle-checked-icon-stroke, var(--t-checkbox-toggle-checked-icon-stroke, var(--t-checkbox-text, var(--tct-white, var(--app-white, #ffffff)))))}.indeterminate-fill{stroke-width:var(--tct-checkbox-indeterminate-stroke-width, var(--t-checkbox-indeterminate-stroke-width, 3.5))}.toggle-svg{height:30px;width:var(--comp-checkbox-toggle-width);position:relative}.toggle-track,.toggle-indicator{position:absolute;top:50%;transform:translateY(-50%)}.toggle-track{fill:var(--tct-checkbox-toggle-track-color, var(--t-checkbox-toggle-track-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc))))));height:14px;width:46px}:host([checked]) .toggle-track{fill:var(--tct-checkbox-toggle-checked-color, var(--t-checkbox-toggle-checked-color, var(--comp-checkbox-checked-color)));opacity:0.5}.toggle-indicator{transition:left var(--comp-checkbox-tween);height:30px;width:30px;left:0;border-radius:50%}:host([checked]) .toggle-indicator{left:21px}.toggle-circle{fill:var(--tct-checkbox-toggle-circle-color, var(--t-checkbox-toggle-circle-color, var(--t-a11y-gray-color-AA, #949494)))}:host([checked]) .toggle-circle{fill:var(--tct-checkbox-toggle-checked-color, var(--t-checkbox-toggle-checked-color, var(--comp-checkbox-checked-color)))}:host(:focus-within) .toggle-circle{stroke:var(--tct-checkbox-toggle-checked-color, var(--t-checkbox-toggle-checked-color, var(--comp-checkbox-checked-color)));stroke-width:10px;stroke-opacity:0.5}:host(:not([checked]):focus-within) .toggle-circle{stroke:var(--tct-checkbox-toggle-circle-color, var(--t-checkbox-toggle-circle-color, var(--t-a11y-gray-color-AA, #949494)))}:host([checked]) .off,:host(:not([checked])) .on{opacity:0}";
|
|
6
|
+
|
|
7
|
+
const Q2Checkbox$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.change = createEvent(this, "change", 7);
|
|
13
|
+
this.id = `checkbox-${createGuid()}`;
|
|
14
|
+
///// Actions ////////
|
|
15
|
+
this.onInputClick = (event) => {
|
|
16
|
+
const hasCustomHandler = !!this.hostElement.onchange;
|
|
17
|
+
const isNotInteractive = this.disabled || this.readonly;
|
|
18
|
+
if (isNotInteractive || hasCustomHandler)
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
if (isNotInteractive)
|
|
21
|
+
return;
|
|
22
|
+
if (!(event.target instanceof HTMLInputElement))
|
|
23
|
+
return;
|
|
24
|
+
const { value, checked } = event.target;
|
|
25
|
+
this.change.emit({
|
|
26
|
+
value,
|
|
27
|
+
checked,
|
|
28
|
+
});
|
|
29
|
+
this.inputElement.focus();
|
|
30
|
+
};
|
|
31
|
+
this.checked = false;
|
|
32
|
+
this.type = undefined;
|
|
33
|
+
this.label = undefined;
|
|
34
|
+
this.hideLabel = undefined;
|
|
35
|
+
this.ariaLabel = undefined;
|
|
36
|
+
this.indeterminate = undefined;
|
|
37
|
+
this.disabled = undefined;
|
|
38
|
+
this.readonly = undefined;
|
|
39
|
+
this.value = undefined;
|
|
40
|
+
this.name = undefined;
|
|
41
|
+
this.hasError = undefined;
|
|
42
|
+
this.groupDisabled = undefined;
|
|
43
|
+
this.alignment = undefined;
|
|
44
|
+
this.description = undefined;
|
|
45
|
+
}
|
|
46
|
+
////////// LIFECYCLE HOOKS ////////
|
|
47
|
+
componentWillLoad() {
|
|
48
|
+
handleAriaLabel(this);
|
|
49
|
+
}
|
|
50
|
+
componentDidLoad() {
|
|
51
|
+
overrideFocus(this.hostElement);
|
|
52
|
+
this.hostElement.click = () => this.inputElement.click();
|
|
53
|
+
}
|
|
54
|
+
//////// Host Element Events ////////
|
|
55
|
+
defaultChangeHandler(event) {
|
|
56
|
+
if (!this.readonly && event.target === this.hostElement && !this.hostElement.onchange && !!event.detail) {
|
|
57
|
+
this.checked = event.detail.checked;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
delegateFocus(event) {
|
|
61
|
+
if (!isEventFromElement(event, this.hostElement))
|
|
62
|
+
return;
|
|
63
|
+
this.hostElement.shadowRoot.querySelector('input').focus();
|
|
64
|
+
}
|
|
65
|
+
////////// OBSERVERS //////////
|
|
66
|
+
ariaLabelObserver() {
|
|
67
|
+
handleAriaLabel(this);
|
|
68
|
+
}
|
|
69
|
+
/////// View Methods ///////
|
|
70
|
+
render() {
|
|
71
|
+
const textLabelClasses = ['label-text'];
|
|
72
|
+
if (this.hideLabel)
|
|
73
|
+
textLabelClasses.push('sr');
|
|
74
|
+
return (h("div", { class: "container" }, h("input", { ref: el => (this.inputElement = el), id: this.id, type: "checkbox", checked: this.indeterminate || this.checked || false, disabled: !!this.disabled || !!this.groupDisabled, class: "sr", value: this.value, name: this.name || this.id, "aria-describedby": this.description ? 'description' : undefined, "test-id": "q2CheckboxInnerCheckBox", onClick: this.onInputClick }), h("label", { htmlFor: this.id, class: "label-control", "test-id": "checkboxButton" }, this.generateCheckboxSVG()), h("div", { class: textLabelClasses.join(' ') }, h("label", { "test-id": "checkboxLabel", htmlFor: this.id }, loc(this.label), h("slot", null))), this.description && (h("div", { class: "description-text", "test-id": "checkboxDescription", id: "description" }, loc(this.description)))));
|
|
75
|
+
}
|
|
76
|
+
generateCheckboxSVG() {
|
|
77
|
+
if (this.type === 'favorite') {
|
|
78
|
+
return (h("q2-icon", { type: "star", class: "checkbox-icon" }));
|
|
79
|
+
}
|
|
80
|
+
if (this.type === 'toggle') {
|
|
81
|
+
return this.generateToggleSVG();
|
|
82
|
+
}
|
|
83
|
+
return (h("svg", { "aria-hidden": "true", width: "20", height: "20", viewBox: "0 0 20 20", class: "checkbox-icon", focusable: "false" }, h("rect", { x: "1", y: "1", width: "18", height: "18", rx: "3" }), (this.checked || this.indeterminate) && this.generateCheckBoxSVGFill()));
|
|
84
|
+
}
|
|
85
|
+
generateCheckBoxSVGFill() {
|
|
86
|
+
if (this.indeterminate) {
|
|
87
|
+
return (h("line", { class: "checkbox-fill indeterminate-fill", x1: "4", y1: "10", x2: "16", y2: "10" }));
|
|
88
|
+
}
|
|
89
|
+
return (h("polyline", { class: "checkbox-fill checked-fill", points: "5 11 8.5 14.5 15 6" }));
|
|
90
|
+
}
|
|
91
|
+
generateToggleSVG() {
|
|
92
|
+
return (h("div", { class: "toggle-svg" }, h("svg", { "aria-hidden": "true", focusable: "false", viewBox: "0 0 46 14", class: "toggle-track" }, h("rect", { width: "36", height: "14", rx: "7", x: "5" })), h("svg", { "aria-hidden": "true", focusable: "false", viewBox: "0 0 30 30", class: "toggle-indicator" }, h("circle", { class: "toggle-circle", width: "20", height: "20", cx: "15", cy: "15", r: "10" }), h("line", { class: "off checked-fill", x1: "12", y1: "18", x2: "18", y2: "12" }), h("line", { class: "off checked-fill", x1: "12", y1: "12", x2: "18", y2: "18" }), h("polyline", { class: "on checked-fill", points: "11,16 14,19 18,12 14,19" }))));
|
|
93
|
+
}
|
|
94
|
+
get hostElement() { return this; }
|
|
95
|
+
static get watchers() { return {
|
|
96
|
+
"ariaLabel": ["ariaLabelObserver"]
|
|
97
|
+
}; }
|
|
98
|
+
static get style() { return stylesCss; }
|
|
99
|
+
}, [1, "q2-checkbox", {
|
|
100
|
+
"checked": [1540],
|
|
101
|
+
"type": [513],
|
|
102
|
+
"label": [1537],
|
|
103
|
+
"hideLabel": [1540, "hide-label"],
|
|
104
|
+
"ariaLabel": [1537, "aria-label"],
|
|
105
|
+
"indeterminate": [516],
|
|
106
|
+
"disabled": [516],
|
|
107
|
+
"readonly": [516],
|
|
108
|
+
"value": [513],
|
|
109
|
+
"name": [513],
|
|
110
|
+
"hasError": [516, "has-error"],
|
|
111
|
+
"groupDisabled": [516, "group-disabled"],
|
|
112
|
+
"alignment": [513],
|
|
113
|
+
"description": [513]
|
|
114
|
+
}, [[0, "change", "defaultChangeHandler"], [0, "focus", "delegateFocus"]]]);
|
|
115
|
+
function defineCustomElement$1() {
|
|
116
|
+
if (typeof customElements === "undefined") {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const components = ["q2-checkbox", "q2-icon"];
|
|
120
|
+
components.forEach(tagName => { switch (tagName) {
|
|
121
|
+
case "q2-checkbox":
|
|
122
|
+
if (!customElements.get(tagName)) {
|
|
123
|
+
customElements.define(tagName, Q2Checkbox$1);
|
|
124
|
+
}
|
|
125
|
+
break;
|
|
126
|
+
case "q2-icon":
|
|
127
|
+
if (!customElements.get(tagName)) {
|
|
128
|
+
defineCustomElement$2();
|
|
129
|
+
}
|
|
130
|
+
break;
|
|
131
|
+
} });
|
|
132
|
+
}
|
|
133
|
+
defineCustomElement$1();
|
|
134
|
+
|
|
135
|
+
const Q2Checkbox = Q2Checkbox$1;
|
|
136
|
+
const defineCustomElement = defineCustomElement$1;
|
|
137
|
+
|
|
138
|
+
export { Q2Checkbox, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2DropdownItem extends Components.Q2DropdownItem, HTMLElement {}
|
|
4
|
+
export const Q2DropdownItem: {
|
|
5
|
+
prototype: Q2DropdownItem;
|
|
6
|
+
new (): Q2DropdownItem;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2Dropdown extends Components.Q2Dropdown, HTMLElement {}
|
|
4
|
+
export const Q2Dropdown: {
|
|
5
|
+
prototype: Q2Dropdown;
|
|
6
|
+
new (): Q2Dropdown;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|