q2-tecton-elements 1.12.0-alpha.0 → 1.13.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/click-elsewhere.cjs.entry.js +5 -7
- package/dist/cjs/{icons-4595ee47.js → icons-08ffe5c9.js} +394 -384
- package/dist/cjs/{index-c2e53804.js → index-7febb200.js} +112 -65
- package/dist/cjs/{index-a55d3c34.js → index-dd823ee6.js} +27 -14
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/q2-avatar.cjs.entry.js +2 -2
- package/dist/cjs/q2-badge.cjs.entry.js +43 -0
- package/dist/cjs/q2-btn_2.cjs.entry.js +13 -13
- package/dist/cjs/q2-calendar.cjs.entry.js +53 -59
- package/dist/cjs/q2-card.cjs.entry.js +127 -0
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +5 -5
- package/dist/cjs/q2-carousel.cjs.entry.js +318 -106
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +6 -3
- package/dist/cjs/q2-checkbox.cjs.entry.js +18 -10
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +7 -7
- package/dist/cjs/q2-dropdown.cjs.entry.js +8 -17
- package/dist/cjs/q2-editable-field.cjs.entry.js +5 -8
- package/dist/cjs/q2-icon.cjs.entry.js +3 -3
- package/dist/cjs/q2-input.cjs.entry.js +439 -437
- package/dist/cjs/q2-loading-element.cjs.entry.js +3 -3
- package/dist/cjs/q2-loc.cjs.entry.js +2 -2
- package/dist/cjs/q2-message.cjs.entry.js +5 -5
- package/dist/cjs/q2-optgroup.cjs.entry.js +3 -3
- package/dist/cjs/q2-option-list.cjs.entry.js +359 -0
- package/dist/cjs/q2-option.cjs.entry.js +3 -11
- package/dist/cjs/q2-pagination.cjs.entry.js +116 -0
- package/dist/cjs/q2-pill.cjs.entry.js +137 -0
- package/dist/cjs/q2-radio-group.cjs.entry.js +43 -18
- package/dist/cjs/q2-radio.cjs.entry.js +21 -4
- package/dist/cjs/q2-section.cjs.entry.js +5 -7
- package/dist/cjs/q2-select.cjs.entry.js +23 -26
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +42 -4
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +278 -0
- package/dist/cjs/q2-stepper.cjs.entry.js +10 -12
- package/dist/cjs/q2-tab-container.cjs.entry.js +12 -8
- package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +94 -0
- package/dist/cjs/q2-tecton-elements.cjs.js +3 -3
- package/dist/cjs/q2-textarea.cjs.entry.js +8 -8
- package/dist/cjs/{shapes-086c0365.js → shapes-305746b5.js} +9 -16
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -5
- package/dist/collection/collection-manifest.json +10 -3
- package/dist/collection/components/click-elsewhere/index.js +4 -6
- package/dist/collection/components/q2-badge/index.js +148 -0
- package/dist/collection/components/q2-badge/styles.css +134 -0
- package/dist/collection/components/q2-btn/index.js +14 -14
- package/dist/collection/components/q2-btn/styles.css +1 -1
- package/dist/collection/components/q2-calendar/helpers.js +22 -20
- package/dist/collection/components/q2-calendar/index.js +44 -37
- package/dist/collection/components/q2-calendar/validation.js +4 -2
- package/dist/collection/components/q2-card/index.js +347 -0
- package/dist/collection/components/q2-card/styles.css +177 -0
- package/dist/collection/components/q2-carousel/index.js +11 -16
- package/dist/collection/components/q2-carousel/styles.css +3 -3
- package/dist/collection/components/q2-carousel-pane/index.js +2 -2
- package/dist/collection/components/q2-carousel-pane/styles.css +8 -3
- package/dist/collection/components/q2-checkbox/index.js +37 -12
- package/dist/collection/components/q2-checkbox-group/index.js +22 -1
- package/dist/collection/components/q2-dropdown/index.js +6 -15
- package/dist/collection/components/q2-dropdown-item/index.js +5 -5
- package/dist/collection/components/q2-editable-field/index.js +3 -6
- package/dist/collection/components/q2-icon/icons.js +393 -383
- package/dist/collection/components/q2-input/formatting/credit-card.js +15 -13
- package/dist/collection/components/q2-input/formatting/currency.js +162 -162
- package/dist/collection/components/q2-input/formatting/date.js +1 -1
- package/dist/collection/components/q2-input/formatting/generic.js +7 -8
- package/dist/collection/components/q2-input/formatting/number.js +6 -9
- package/dist/collection/components/q2-input/formatting/numeric.js +5 -5
- package/dist/collection/components/q2-input/formatting/phone.js +215 -215
- package/dist/collection/components/q2-input/formatting/postal.js +1 -1
- package/dist/collection/components/q2-input/index.js +81 -25
- package/dist/collection/components/q2-input/styles.css +19 -14
- package/dist/collection/components/q2-loading/index.js +4 -4
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js +1 -1
- package/dist/collection/components/q2-loading/skeleton/shapes.js +8 -15
- package/dist/collection/components/q2-message/index.js +3 -3
- package/dist/collection/components/q2-optgroup/index.js +1 -1
- package/dist/collection/components/q2-option/index.js +19 -25
- package/dist/collection/components/q2-option/styles.css +5 -0
- package/dist/collection/components/q2-option-list/index.js +648 -0
- package/dist/collection/components/q2-option-list/styles.css +128 -0
- package/dist/collection/components/q2-pagination/index.js +275 -0
- package/dist/collection/components/q2-pagination/styles.css +120 -0
- package/dist/collection/components/q2-pill/index.js +324 -0
- package/dist/collection/components/q2-pill/styles.css +229 -0
- package/dist/collection/components/q2-radio/index.js +38 -1
- package/dist/collection/components/q2-radio-group/index.js +66 -24
- package/dist/collection/components/q2-section/index.js +5 -7
- package/dist/collection/components/q2-select/index.js +40 -25
- package/dist/collection/components/q2-stepper/index.js +8 -10
- package/dist/collection/components/q2-stepper/styles.css +5 -5
- package/dist/collection/components/q2-stepper-pane/index.js +133 -5
- package/dist/collection/components/q2-stepper-vertical/index.js +346 -0
- package/dist/collection/components/q2-stepper-vertical/styles.css +273 -0
- package/dist/collection/components/q2-tab-container/index.js +11 -7
- package/dist/collection/components/q2-tag/index.js +200 -0
- package/dist/collection/components/q2-tag/styles.css +141 -0
- package/dist/collection/components/q2-textarea/index.js +6 -6
- package/dist/collection/components/tecton-tab-pane/index.js +3 -10
- package/dist/collection/utils/index.js +25 -13
- package/dist/esm/click-elsewhere.entry.js +5 -7
- package/dist/esm/{icons-3ee662ea.js → icons-b1e11526.js} +394 -384
- package/dist/esm/{index-ec6660af.js → index-0ff8de52.js} +27 -15
- package/dist/esm/{index-be8376c0.js → index-dbfb3ecc.js} +112 -65
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/q2-avatar.entry.js +2 -2
- package/dist/esm/q2-badge.entry.js +39 -0
- package/dist/esm/q2-btn_2.entry.js +13 -13
- package/dist/esm/q2-calendar.entry.js +53 -59
- package/dist/esm/q2-card.entry.js +123 -0
- package/dist/esm/q2-carousel-pane.entry.js +5 -5
- package/dist/esm/q2-carousel.entry.js +318 -106
- package/dist/esm/q2-checkbox-group.entry.js +6 -3
- package/dist/esm/q2-checkbox.entry.js +18 -10
- package/dist/esm/q2-dropdown-item.entry.js +7 -7
- package/dist/esm/q2-dropdown.entry.js +8 -17
- package/dist/esm/q2-editable-field.entry.js +5 -8
- package/dist/esm/q2-icon.entry.js +3 -3
- package/dist/esm/q2-input.entry.js +439 -437
- package/dist/esm/q2-loading-element.entry.js +3 -3
- package/dist/esm/q2-loc.entry.js +2 -2
- package/dist/esm/q2-message.entry.js +5 -5
- package/dist/esm/q2-optgroup.entry.js +3 -3
- package/dist/esm/q2-option-list.entry.js +355 -0
- package/dist/esm/q2-option.entry.js +3 -11
- package/dist/esm/q2-pagination.entry.js +112 -0
- package/dist/esm/q2-pill.entry.js +133 -0
- package/dist/esm/q2-radio-group.entry.js +43 -18
- package/dist/esm/q2-radio.entry.js +21 -4
- package/dist/esm/q2-section.entry.js +5 -7
- package/dist/esm/q2-select.entry.js +23 -26
- package/dist/esm/q2-stepper-pane.entry.js +42 -4
- package/dist/esm/q2-stepper-vertical.entry.js +274 -0
- package/dist/esm/q2-stepper.entry.js +10 -12
- package/dist/esm/q2-tab-container.entry.js +12 -8
- package/dist/esm/q2-tab-pane.entry.js +1 -1
- package/dist/esm/q2-tag.entry.js +90 -0
- package/dist/esm/q2-tecton-elements.js +3 -3
- package/dist/esm/q2-textarea.entry.js +8 -8
- package/dist/esm/{shapes-81c11dfe.js → shapes-cff4e1f0.js} +9 -16
- package/dist/esm/tecton-tab-pane.entry.js +2 -5
- package/dist/loader/index.d.ts +0 -1
- package/dist/q2-tecton-elements/{p-75e87cca.entry.js → p-00e8f782.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-0900bec1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-10264ecb.entry.js +1 -0
- package/dist/q2-tecton-elements/p-123cdfb9.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-fbf7c5e6.entry.js → p-1305ec5f.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-148391d6.entry.js +1 -0
- package/dist/q2-tecton-elements/p-1dfaee64.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-32ad664c.entry.js → p-221abbf6.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-c90a6016.js → p-255b2b4c.js} +1 -1
- package/dist/q2-tecton-elements/p-27736b6b.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2846ab94.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2bc1de01.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-8ea2c4f7.entry.js → p-2c15414c.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-2caa89fd.js +1 -0
- package/dist/q2-tecton-elements/p-327cca41.entry.js +1 -0
- package/dist/q2-tecton-elements/p-3a420dbf.entry.js +1 -0
- package/dist/q2-tecton-elements/p-3abcb09d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-3fe98e3e.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-bb2e110a.entry.js → p-430a979b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7e6fc65d.entry.js → p-45eb7739.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-750bcd33.entry.js → p-49b2abc4.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9b50c3c3.entry.js → p-4ab30466.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-50e218c7.entry.js +1 -0
- package/dist/q2-tecton-elements/p-5bbf2bfe.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-ac859fcc.entry.js → p-6fec9235.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-824aebd9.js +1 -0
- package/dist/q2-tecton-elements/p-a4ae89cc.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-50967020.entry.js → p-a5562aaa.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-ae4fed23.entry.js +1 -0
- package/dist/q2-tecton-elements/p-b2302cd3.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c20cbb2d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ca7a3380.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-a6f8d09a.entry.js → p-d33e152c.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9024859f.entry.js → p-d5218cd6.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-d52b435e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-dd02cf8d.js +1 -0
- package/dist/q2-tecton-elements/{p-07a5d703.entry.js → p-e0e7ae8b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7e030e92.entry.js → p-ede12fc1.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-df182f61.entry.js → p-fdfbe75b.entry.js} +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/elements/q2-tag-test.js +151 -0
- package/dist/test/helpers.js +20 -9
- package/dist/types/components/q2-badge/index.d.ts +13 -0
- package/dist/types/components/q2-btn/index.d.ts +3 -3
- package/dist/types/components/q2-calendar/helpers.d.ts +1 -0
- package/dist/types/components/q2-calendar/index.d.ts +2 -1
- package/dist/types/components/q2-calendar/validation.d.ts +1 -1
- package/dist/types/components/q2-card/index.d.ts +35 -0
- package/dist/types/components/q2-checkbox/index.d.ts +3 -1
- package/dist/types/components/q2-checkbox-group/index.d.ts +1 -0
- package/dist/types/components/q2-dropdown/index.d.ts +1 -1
- package/dist/types/components/q2-editable-field/index.d.ts +1 -1
- package/dist/types/components/q2-input/formatting/credit-card.d.ts +1 -3
- package/dist/types/components/q2-input/index.d.ts +5 -2
- package/dist/types/components/q2-option/index.d.ts +2 -3
- package/dist/types/components/q2-option-list/index.d.ts +62 -0
- package/dist/types/components/q2-pagination/index.d.ts +30 -0
- package/dist/types/components/q2-pill/index.d.ts +39 -0
- package/dist/types/components/q2-radio/index.d.ts +4 -1
- package/dist/types/components/q2-radio-group/index.d.ts +5 -1
- package/dist/types/components/q2-select/index.d.ts +2 -1
- package/dist/types/components/q2-stepper/index.d.ts +1 -1
- package/dist/types/components/q2-stepper-pane/index.d.ts +16 -1
- package/dist/types/components/q2-stepper-vertical/index.d.ts +52 -0
- package/dist/types/components/q2-tab-container/index.d.ts +1 -1
- package/dist/types/components/q2-tag/index.d.ts +28 -0
- package/dist/types/components/tecton-tab-pane/index.d.ts +2 -2
- package/dist/types/components.d.ts +235 -11
- package/dist/types/global.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/dist/types/util.d.ts +2 -10
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/elements/q2-tag-test.d.ts +1 -0
- package/dist/types/workspace/workspace/{_production_release_1.11.0-alpha → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +6 -3
- package/package.json +13 -13
- package/dist/q2-tecton-elements/p-06fff43d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-080839ed.js +0 -1
- package/dist/q2-tecton-elements/p-29a37091.entry.js +0 -1
- package/dist/q2-tecton-elements/p-37aba2a4.js +0 -1
- package/dist/q2-tecton-elements/p-4cd00f1a.js +0 -1
- package/dist/q2-tecton-elements/p-6702eb4d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-768e3a5d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-843b1ee9.entry.js +0 -1
- package/dist/q2-tecton-elements/p-943c7745.entry.js +0 -1
- package/dist/q2-tecton-elements/p-95a73559.entry.js +0 -1
- package/dist/q2-tecton-elements/p-9a977ee6.entry.js +0 -1
- package/dist/q2-tecton-elements/p-b281c349.entry.js +0 -1
- package/dist/q2-tecton-elements/p-c5e55b9f.entry.js +0 -1
- package/dist/q2-tecton-elements/p-ccbe9158.entry.js +0 -1
- package/dist/q2-tecton-elements/p-db6f90ac.entry.js +0 -1
- package/dist/q2-tecton-elements/p-fa6eea5c.entry.js +0 -1
|
@@ -5,22 +5,30 @@ export class Q2Checkbox {
|
|
|
5
5
|
this.checked = false;
|
|
6
6
|
this.id = `checkbox-${createGuid()}`;
|
|
7
7
|
///// Actions ////////
|
|
8
|
-
this.
|
|
8
|
+
this.onInputClick = (event) => {
|
|
9
9
|
event.stopPropagation();
|
|
10
|
-
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
if (this.disabled || this.readonly)
|
|
11
12
|
return;
|
|
12
13
|
if (!(event.target instanceof HTMLInputElement))
|
|
13
14
|
return;
|
|
14
15
|
this.change.emit({
|
|
15
16
|
value: event.target.value,
|
|
16
|
-
checked: event.target.checked
|
|
17
|
+
checked: event.target.checked,
|
|
17
18
|
});
|
|
18
19
|
this.inputElement.focus();
|
|
19
20
|
};
|
|
20
21
|
this.onControlClick = (event) => {
|
|
21
22
|
event.stopPropagation();
|
|
23
|
+
if (this.readonly)
|
|
24
|
+
return;
|
|
22
25
|
this.inputElement.click();
|
|
23
26
|
};
|
|
27
|
+
this.onKeyDown = (event) => {
|
|
28
|
+
if (this.readonly && event.code === 'Space') {
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
24
32
|
}
|
|
25
33
|
////////// LIFECYCLE HOOKS ////////
|
|
26
34
|
componentWillLoad() {
|
|
@@ -31,7 +39,7 @@ export class Q2Checkbox {
|
|
|
31
39
|
}
|
|
32
40
|
//////// Host Element Events ////////
|
|
33
41
|
defaultChangeHandler(event) {
|
|
34
|
-
if (event.target === this.hostElement && !this.hostElement.onchange && !!event.detail) {
|
|
42
|
+
if (!this.readonly && event.target === this.hostElement && !this.hostElement.onchange && !!event.detail) {
|
|
35
43
|
this.checked = event.detail.checked;
|
|
36
44
|
}
|
|
37
45
|
}
|
|
@@ -47,8 +55,8 @@ export class Q2Checkbox {
|
|
|
47
55
|
/////// View Methods ///////
|
|
48
56
|
render() {
|
|
49
57
|
return (h("div", { class: "checkbox-container" },
|
|
50
|
-
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-label": this.label && this.hideLabel ? loc(this.label) : undefined, "test-id": "q2CheckboxInnerCheckBox",
|
|
51
|
-
h("label", { "test-id": "checkboxButton" },
|
|
58
|
+
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-label": this.label && this.hideLabel ? loc(this.label) : undefined, "test-id": "q2CheckboxInnerCheckBox", onKeyDown: this.onKeyDown, onClick: this.onInputClick }),
|
|
59
|
+
h("label", { htmlFor: this.id, "test-id": "checkboxButton" },
|
|
52
60
|
this.generateCheckboxSVG(),
|
|
53
61
|
!this.hideLabel && (h("div", { class: "q2-checkbox-label-content" },
|
|
54
62
|
h("span", { class: "label-text", onClick: this.onControlClick }, loc(this.label)),
|
|
@@ -56,7 +64,7 @@ export class Q2Checkbox {
|
|
|
56
64
|
}
|
|
57
65
|
generateCheckboxSVG() {
|
|
58
66
|
if (this.type === 'favorite') {
|
|
59
|
-
return h("q2-icon", { type: "star", class: "checkbox-icon", onClick: this.onControlClick });
|
|
67
|
+
return (h("q2-icon", { type: "star", class: "checkbox-icon", onClick: this.onControlClick }));
|
|
60
68
|
}
|
|
61
69
|
if (this.type === 'toggle') {
|
|
62
70
|
return this.generateToggleSVG();
|
|
@@ -67,9 +75,9 @@ export class Q2Checkbox {
|
|
|
67
75
|
}
|
|
68
76
|
generateCheckBoxSVGFill() {
|
|
69
77
|
if (this.indeterminate) {
|
|
70
|
-
return h("line", { class: "checkbox-fill indeterminate-fill", x1: "4", y1: "10", x2: "16", y2: "10" });
|
|
78
|
+
return (h("line", { class: "checkbox-fill indeterminate-fill", x1: "4", y1: "10", x2: "16", y2: "10" }));
|
|
71
79
|
}
|
|
72
|
-
return h("polyline", { class: "checkbox-fill checked-fill", points: "5 11 8.5 14.5 15 6" });
|
|
80
|
+
return (h("polyline", { class: "checkbox-fill checked-fill", points: "5 11 8.5 14.5 15 6" }));
|
|
73
81
|
}
|
|
74
82
|
generateToggleSVG() {
|
|
75
83
|
return (h("div", { class: "toggle-svg", onClick: this.onControlClick },
|
|
@@ -127,7 +135,7 @@ export class Q2Checkbox {
|
|
|
127
135
|
},
|
|
128
136
|
"label": {
|
|
129
137
|
"type": "string",
|
|
130
|
-
"mutable":
|
|
138
|
+
"mutable": true,
|
|
131
139
|
"complexType": {
|
|
132
140
|
"original": "string",
|
|
133
141
|
"resolved": "string",
|
|
@@ -144,7 +152,7 @@ export class Q2Checkbox {
|
|
|
144
152
|
},
|
|
145
153
|
"hideLabel": {
|
|
146
154
|
"type": "boolean",
|
|
147
|
-
"mutable":
|
|
155
|
+
"mutable": true,
|
|
148
156
|
"complexType": {
|
|
149
157
|
"original": "boolean",
|
|
150
158
|
"resolved": "boolean",
|
|
@@ -161,7 +169,7 @@ export class Q2Checkbox {
|
|
|
161
169
|
},
|
|
162
170
|
"ariaLabel": {
|
|
163
171
|
"type": "string",
|
|
164
|
-
"mutable":
|
|
172
|
+
"mutable": true,
|
|
165
173
|
"complexType": {
|
|
166
174
|
"original": "string",
|
|
167
175
|
"resolved": "string",
|
|
@@ -210,6 +218,23 @@ export class Q2Checkbox {
|
|
|
210
218
|
"attribute": "disabled",
|
|
211
219
|
"reflect": true
|
|
212
220
|
},
|
|
221
|
+
"readonly": {
|
|
222
|
+
"type": "boolean",
|
|
223
|
+
"mutable": false,
|
|
224
|
+
"complexType": {
|
|
225
|
+
"original": "boolean",
|
|
226
|
+
"resolved": "boolean",
|
|
227
|
+
"references": {}
|
|
228
|
+
},
|
|
229
|
+
"required": false,
|
|
230
|
+
"optional": false,
|
|
231
|
+
"docs": {
|
|
232
|
+
"tags": [],
|
|
233
|
+
"text": ""
|
|
234
|
+
},
|
|
235
|
+
"attribute": "readonly",
|
|
236
|
+
"reflect": true
|
|
237
|
+
},
|
|
213
238
|
"value": {
|
|
214
239
|
"type": "string",
|
|
215
240
|
"mutable": false,
|
|
@@ -3,6 +3,7 @@ import { createGuid, loc } from 'src/utils';
|
|
|
3
3
|
export class Q2CheckboxGroup {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.disabled = false;
|
|
6
|
+
this.readonly = false;
|
|
6
7
|
this.optional = false;
|
|
7
8
|
this.hasError = false;
|
|
8
9
|
this.id = `checkbox-group-${createGuid()}`;
|
|
@@ -39,6 +40,8 @@ export class Q2CheckboxGroup {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
valueUpdated() {
|
|
43
|
+
if (this.readonly)
|
|
44
|
+
return;
|
|
42
45
|
this.checkboxElements.forEach(check => {
|
|
43
46
|
if (this.protectedValue.hasOwnProperty(check.value)) {
|
|
44
47
|
check.checked = this.value[check.value];
|
|
@@ -59,7 +62,7 @@ export class Q2CheckboxGroup {
|
|
|
59
62
|
return (h("div", null,
|
|
60
63
|
this.label || this.optional ? (h("div", { class: "group-legend" },
|
|
61
64
|
this.label && loc(this.label),
|
|
62
|
-
this.optional ?
|
|
65
|
+
this.optional ? h("span", { class: "optional-tag" }, loc('tecton.element.input.optional')) : '')) : (''),
|
|
63
66
|
h("fieldset", { class: `q2-checkbox-fieldset ${this.hasError ? 'has-error' : ''}`, onChange: this.onInnerCheckboxChange, "aria-required": `${!this.optional}` },
|
|
64
67
|
this.label || this.optional ? (h("legend", { class: "sr-only" },
|
|
65
68
|
this.label && loc(this.label),
|
|
@@ -130,6 +133,24 @@ export class Q2CheckboxGroup {
|
|
|
130
133
|
"reflect": true,
|
|
131
134
|
"defaultValue": "false"
|
|
132
135
|
},
|
|
136
|
+
"readonly": {
|
|
137
|
+
"type": "boolean",
|
|
138
|
+
"mutable": false,
|
|
139
|
+
"complexType": {
|
|
140
|
+
"original": "boolean",
|
|
141
|
+
"resolved": "boolean",
|
|
142
|
+
"references": {}
|
|
143
|
+
},
|
|
144
|
+
"required": false,
|
|
145
|
+
"optional": false,
|
|
146
|
+
"docs": {
|
|
147
|
+
"tags": [],
|
|
148
|
+
"text": ""
|
|
149
|
+
},
|
|
150
|
+
"attribute": "readonly",
|
|
151
|
+
"reflect": true,
|
|
152
|
+
"defaultValue": "false"
|
|
153
|
+
},
|
|
133
154
|
"optional": {
|
|
134
155
|
"type": "boolean",
|
|
135
156
|
"mutable": false,
|
|
@@ -95,9 +95,7 @@ export class Q2Dropdown {
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
resizeIframe() {
|
|
98
|
-
return
|
|
99
|
-
window.TectonElements.resizeIframe &&
|
|
100
|
-
window.TectonElements.resizeIframe());
|
|
98
|
+
return window.TectonElements && window.TectonElements.resizeIframe && window.TectonElements.resizeIframe();
|
|
101
99
|
}
|
|
102
100
|
resolveMenu() {
|
|
103
101
|
return (this.name &&
|
|
@@ -153,12 +151,10 @@ export class Q2Dropdown {
|
|
|
153
151
|
});
|
|
154
152
|
}
|
|
155
153
|
navigateTo(featureName, moduleName, queryParams) {
|
|
156
|
-
return
|
|
157
|
-
window.TectonElements.navigateTo(featureName, moduleName, queryParams));
|
|
154
|
+
return window.TectonElements && window.TectonElements.navigateTo(featureName, moduleName, queryParams);
|
|
158
155
|
}
|
|
159
156
|
showOverpanel(overpanelPath, params) {
|
|
160
|
-
return
|
|
161
|
-
window.TectonElements.showOverpanel(overpanelPath, params, undefined, true));
|
|
157
|
+
return window.TectonElements && window.TectonElements.showOverpanel(overpanelPath, params, undefined, true);
|
|
162
158
|
}
|
|
163
159
|
get hasCustomButton() {
|
|
164
160
|
return !!this.hostElement.querySelector('[slot=custom-dropdown-button]');
|
|
@@ -186,7 +182,7 @@ export class Q2Dropdown {
|
|
|
186
182
|
disabled,
|
|
187
183
|
ariaExpanded,
|
|
188
184
|
className,
|
|
189
|
-
custom
|
|
185
|
+
custom,
|
|
190
186
|
};
|
|
191
187
|
}
|
|
192
188
|
//////// Observers //////////
|
|
@@ -240,12 +236,7 @@ export class Q2Dropdown {
|
|
|
240
236
|
}
|
|
241
237
|
let targetIndex = 0;
|
|
242
238
|
if (direction === 'next') {
|
|
243
|
-
|
|
244
|
-
targetIndex = activeIndex + 1;
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
targetIndex = 0;
|
|
248
|
-
}
|
|
239
|
+
targetIndex = activeIndex < dropdownItems.length - 1 ? activeIndex + 1 : 0;
|
|
249
240
|
}
|
|
250
241
|
else if (direction === 'prev') {
|
|
251
242
|
if (activeIndex > 0) {
|
|
@@ -261,7 +252,7 @@ export class Q2Dropdown {
|
|
|
261
252
|
render() {
|
|
262
253
|
const btnProps = this.toggleButtonProps;
|
|
263
254
|
return (h("click-elsewhere", { class: `dropdown-container${this.dropdownOpen ? ' dropdown-open' : ''}`, onChange: this.onClickElsewhere },
|
|
264
|
-
h("q2-btn", { ref: el => (this.controlElement = el), class: btnProps.className, onClick: this.onToggleClick, onKeyDown: this.onToggleKeydown, fab: btnProps.fab, intent: btnProps.intent, active: btnProps.active, disabled: btnProps.disabled, ariaExpanded: btnProps.ariaExpanded
|
|
255
|
+
h("q2-btn", { ref: el => (this.controlElement = el), class: btnProps.className, onClick: this.onToggleClick, onKeyDown: this.onToggleKeydown, fab: btnProps.fab, intent: btnProps.intent, active: btnProps.active, disabled: btnProps.disabled, ariaExpanded: `${!!btnProps.ariaExpanded}`, label: this.hideLabel && this.label ? loc(this.label) : undefined, hideLabel: this.hideLabel, ariaHasPopup: "menu", "test-id": "dropdownButton" }, this.hasCustomButton ? (h("div", { "test-id": "dropdownCustom", class: btnProps.custom ? '' : 'hidden' },
|
|
265
256
|
h("slot", { name: "custom-dropdown-button" }))) : (h(Fragment, null,
|
|
266
257
|
this.icon ? h("q2-icon", { type: this.icon }) : ' ',
|
|
267
258
|
this.label && !this.hideLabel && (h("span", { class: "dropdown-button-text" }, loc(this.label)))))),
|
|
@@ -7,9 +7,9 @@ export class Q2DropdownItem {
|
|
|
7
7
|
this.hostElement.dispatchEvent(new CustomEvent('click', {
|
|
8
8
|
detail: {
|
|
9
9
|
type: 'select',
|
|
10
|
-
value: this.value || ''
|
|
10
|
+
value: this.value || '',
|
|
11
11
|
},
|
|
12
|
-
bubbles: true
|
|
12
|
+
bubbles: true,
|
|
13
13
|
}));
|
|
14
14
|
};
|
|
15
15
|
this.onItemKeydown = (event) => {
|
|
@@ -25,9 +25,9 @@ export class Q2DropdownItem {
|
|
|
25
25
|
this.hostElement.dispatchEvent(new CustomEvent('click', {
|
|
26
26
|
detail: {
|
|
27
27
|
type: 'remove',
|
|
28
|
-
value: this.value || ''
|
|
28
|
+
value: this.value || '',
|
|
29
29
|
},
|
|
30
|
-
bubbles: true
|
|
30
|
+
bubbles: true,
|
|
31
31
|
}));
|
|
32
32
|
};
|
|
33
33
|
this.onRemoveBtnKeydown = (event) => {
|
|
@@ -79,7 +79,7 @@ export class Q2DropdownItem {
|
|
|
79
79
|
return this.itemDOM();
|
|
80
80
|
}
|
|
81
81
|
separatorDOM() {
|
|
82
|
-
return h("div", { class: "dropdown-separator", role: "separator", "test-id": "dropdownItemSeparator" });
|
|
82
|
+
return (h("div", { class: "dropdown-separator", role: "separator", "test-id": "dropdownItemSeparator" }));
|
|
83
83
|
}
|
|
84
84
|
itemDOM() {
|
|
85
85
|
return (h("div", { class: "dropdown-item-wrapper" },
|
|
@@ -40,7 +40,7 @@ export class Q2EditableField {
|
|
|
40
40
|
editing: false,
|
|
41
41
|
name: 'save',
|
|
42
42
|
value: this.innerValue || valueFromInputProp,
|
|
43
|
-
formattedValue: this.formattedValue || valueFromInputProp
|
|
43
|
+
formattedValue: this.formattedValue || valueFromInputProp,
|
|
44
44
|
});
|
|
45
45
|
setTimeout(() => {
|
|
46
46
|
const { errors = [] } = this;
|
|
@@ -112,9 +112,7 @@ export class Q2EditableField {
|
|
|
112
112
|
delegateFocus(event) {
|
|
113
113
|
if (!isEventFromElement(event, this.hostElement))
|
|
114
114
|
return;
|
|
115
|
-
this.hostElement.shadowRoot
|
|
116
|
-
.querySelector(this.editing ? 'q2-input' : 'q2-btn.begin-edit')
|
|
117
|
-
.focus();
|
|
115
|
+
this.hostElement.shadowRoot.querySelector(this.editing ? 'q2-input' : 'q2-btn.begin-edit').focus();
|
|
118
116
|
}
|
|
119
117
|
render() {
|
|
120
118
|
return (h("div", null,
|
|
@@ -123,8 +121,7 @@ export class Q2EditableField {
|
|
|
123
121
|
}
|
|
124
122
|
generateEditStateDOM() {
|
|
125
123
|
return (h("div", { class: this.wrapperClass, hidden: !this.editing },
|
|
126
|
-
h("q2-input", { ref: el => (this.q2InputElement = el), label: this.locLabel, hideLabel: this.hideLabel, value: this.value, hints: (Array.isArray(this.hints) && this.hints.map(str => loc(str))) || undefined, errors: (Array.isArray(this.errors) && this.errors.map(str => loc(str))) ||
|
|
127
|
-
undefined, type: this.type, formatModifier: this.formatModifier, maxlength: this.maxlength, "test-id": "editableInput", onInput: this.inputInput, onChange: this.inputChange, onKeyDown: this.inputKeyDown, onClick: this.inputClick }),
|
|
124
|
+
h("q2-input", { ref: el => (this.q2InputElement = el), label: this.locLabel, hideLabel: this.hideLabel, value: this.value, hints: (Array.isArray(this.hints) && this.hints.map(str => loc(str))) || undefined, errors: (Array.isArray(this.errors) && this.errors.map(str => loc(str))) || undefined, type: this.type, formatModifier: this.formatModifier, maxlength: this.maxlength, "test-id": "editableInput", onInput: this.inputInput, onChange: this.inputChange, onKeyDown: this.inputKeyDown, onClick: this.inputClick }),
|
|
128
125
|
h("q2-btn", { class: "cancel-edit", label: `${loc('tecton.element.editableField.cancel')} ${this.locLabel}`, "hide-label": true, "test-id": "cancelButton", onClick: this.cancelClick },
|
|
129
126
|
h("q2-icon", { type: "close" })),
|
|
130
127
|
h("q2-btn", { class: "save-edit", label: `${loc('tecton.element.editableField.save')} ${this.locLabel}`, "hide-label": true, "test-id": "saveButton", onClick: this.saveClick },
|