q2-tecton-elements 1.23.0 → 1.24.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/action-sheet-4b366e9a.js +84 -0
- package/dist/cjs/{index-0648c2ec.js → index-e00b4210.js} +28 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-sheet.cjs.entry.js +218 -0
- package/dist/cjs/q2-badge_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-btn_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +1 -1
- package/dist/cjs/q2-card.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-donut.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-icon.cjs.entry.js +1 -1
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +1 -1
- package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup_2.cjs.entry.js +93 -0
- package/dist/cjs/q2-option-list_2.cjs.entry.js +226 -86
- package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
- package/dist/cjs/q2-pill.cjs.entry.js +57 -18
- package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +1 -1
- package/dist/cjs/q2-section.cjs.entry.js +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +148 -409
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +1 -1
- package/dist/cjs/q2-tab-container.cjs.entry.js +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +21 -6
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/q2-action-sheet/index.js +345 -0
- package/dist/collection/components/q2-action-sheet/styles.css +215 -0
- package/dist/collection/components/q2-checkbox/index.js +2 -2
- package/dist/collection/components/q2-dropdown/index.js +1 -1
- package/dist/collection/components/q2-loading/index.js +1 -1
- package/dist/collection/components/q2-optgroup/styles.css +2 -2
- package/dist/collection/components/q2-option/index.js +1 -56
- package/dist/collection/components/q2-option/styles.css +7 -0
- package/dist/collection/components/q2-option-list/index.js +290 -102
- package/dist/collection/components/q2-pill/index.js +79 -18
- package/dist/collection/components/q2-pill/styles.css +1 -2
- package/dist/collection/components/q2-popover/index.js +17 -3
- package/dist/collection/components/q2-popover/styles.css +10 -67
- package/dist/collection/components/q2-radio/index.js +2 -2
- package/dist/collection/components/q2-select/index.js +179 -427
- package/dist/collection/components/q2-select/styles.css +5 -11
- package/dist/collection/components/q2-tag/index.js +38 -5
- package/dist/collection/utils/action-sheet.js +79 -0
- package/dist/collection/utils/index.js +26 -5
- package/dist/components/action-sheet.js +81 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index10.js +1 -1
- package/dist/components/index11.js +42 -353
- package/dist/components/index12.js +44 -99
- package/dist/components/index13.js +495 -583
- package/dist/components/index14.js +137 -0
- package/dist/components/index15.js +626 -0
- package/dist/components/index5.js +1 -1
- package/dist/components/index6.js +1 -1
- package/dist/components/index7.js +1 -1
- package/dist/components/index8.js +1 -1
- package/dist/components/index9.js +2 -2
- package/dist/components/q2-action-sheet.d.ts +11 -0
- package/dist/components/q2-action-sheet.js +282 -0
- package/dist/components/q2-calendar.js +1 -1
- package/dist/components/q2-card.js +1 -1
- package/dist/components/q2-carousel-pane.js +1 -1
- package/dist/components/q2-carousel.js +1 -1
- package/dist/components/q2-chart-area.js +1 -1
- package/dist/components/q2-chart-bar.js +1 -1
- package/dist/components/q2-chart-donut.js +1 -1
- package/dist/components/q2-checkbox-group.js +1 -1
- package/dist/components/q2-checkbox.js +1 -1
- package/dist/components/q2-dropdown.js +2 -2
- package/dist/components/q2-editable-field.js +1 -1
- package/dist/components/q2-loc.js +1 -1
- package/dist/components/q2-month-picker.js +1 -1
- package/dist/components/q2-optgroup.js +1 -70
- package/dist/components/q2-option-list.js +1 -1
- package/dist/components/q2-option.js +1 -76
- package/dist/components/q2-pagination.js +1 -1
- package/dist/components/q2-pill.js +62 -21
- package/dist/components/q2-popover.js +1 -1
- package/dist/components/q2-radio-group.js +1 -1
- package/dist/components/q2-radio.js +3 -3
- package/dist/components/q2-section.js +1 -1
- package/dist/components/q2-select.js +179 -427
- package/dist/components/q2-stepper-pane.js +1 -1
- package/dist/components/q2-stepper-vertical.js +1 -1
- package/dist/components/q2-stepper.js +1 -1
- package/dist/components/q2-tab-container.js +1 -1
- package/dist/components/q2-tag.js +24 -8
- package/dist/components/q2-textarea.js +1 -1
- package/dist/esm/action-sheet-a9597b32.js +81 -0
- package/dist/esm/{index-501fd22e.js → index-ca21e539.js} +27 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-sheet.entry.js +214 -0
- package/dist/esm/q2-badge_2.entry.js +1 -1
- package/dist/esm/q2-btn_2.entry.js +1 -1
- package/dist/esm/q2-calendar.entry.js +1 -1
- package/dist/esm/q2-card.entry.js +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +1 -1
- package/dist/esm/q2-carousel.entry.js +1 -1
- package/dist/esm/q2-chart-area.entry.js +1 -1
- package/dist/esm/q2-chart-bar.entry.js +1 -1
- package/dist/esm/q2-chart-donut.entry.js +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +1 -1
- package/dist/esm/q2-checkbox.entry.js +1 -1
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-icon.entry.js +1 -1
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +1 -1
- package/dist/esm/q2-month-picker.entry.js +1 -1
- package/dist/esm/q2-optgroup_2.entry.js +88 -0
- package/dist/esm/q2-option-list_2.entry.js +226 -86
- package/dist/esm/q2-pagination.entry.js +1 -1
- package/dist/esm/q2-pill.entry.js +57 -18
- package/dist/esm/q2-radio-group.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-section.entry.js +1 -1
- package/dist/esm/q2-select.entry.js +148 -409
- package/dist/esm/q2-stepper-pane.entry.js +1 -1
- package/dist/esm/q2-stepper-vertical.entry.js +1 -1
- package/dist/esm/q2-stepper.entry.js +1 -1
- package/dist/esm/q2-tab-container.entry.js +1 -1
- package/dist/esm/q2-tag.entry.js +21 -6
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/q2-tecton-elements/{p-3e9a30c4.entry.js → p-0473f4f7.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-5b1aba1a.entry.js → p-13a1390b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-ebd7efa5.entry.js → p-13deb3ed.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-45d61789.entry.js → p-1d854203.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-1f71774f.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-6b7e1ebd.entry.js → p-256d3fe6.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-8dea9a0c.entry.js → p-282f0f8c.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-3603fcdc.entry.js → p-30969629.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-30cd888b.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-3fd5d010.entry.js → p-37cf9c97.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-53be87c8.entry.js → p-388349b5.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-5589ae0f.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-604b22a8.entry.js → p-619aed74.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-d68b5eb3.entry.js → p-63b67260.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-ba73ee1f.entry.js → p-63e363ad.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-d7b27803.entry.js → p-6736df05.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-72fe10cc.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-68ef0786.entry.js → p-75b817c6.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-a2add94e.entry.js → p-7a116095.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-d88e4383.entry.js → p-7c94119b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-24f4571d.entry.js → p-90572e43.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-91153c61.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-70b01387.entry.js → p-9792de8a.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-9acfa94e.js +1 -0
- package/dist/q2-tecton-elements/p-a1926e65.js +1 -0
- package/dist/q2-tecton-elements/{p-d27b2caa.entry.js → p-b3a8cdc5.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9b101e22.entry.js → p-ce3f203c.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-bf41e71b.entry.js → p-ce91cd9b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-18629cbf.entry.js → p-cefc9d0b.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-d05beeb7.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-6be86940.entry.js → p-dc7c8371.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-acc77332.entry.js → p-e58581fc.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-38a33baa.entry.js → p-e886c55b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7aa80653.entry.js → p-f94e7043.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-78fac0fa.entry.js → p-fcb7d191.entry.js} +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/helpers.js +3 -2
- package/dist/types/components/q2-action-sheet/index.d.ts +52 -0
- package/dist/types/components/q2-checkbox/index.d.ts +4 -1
- package/dist/types/components/q2-option/index.d.ts +0 -3
- package/dist/types/components/q2-option-list/index.d.ts +16 -8
- package/dist/types/components/q2-pill/index.d.ts +10 -1
- package/dist/types/components/q2-popover/index.d.ts +2 -0
- package/dist/types/components/q2-select/index.d.ts +45 -47
- package/dist/types/components/q2-tag/index.d.ts +3 -2
- package/dist/types/components.d.ts +42 -13
- package/dist/types/global.d.ts +9 -2
- package/dist/types/utils/action-sheet.d.ts +12 -0
- package/dist/types/utils/index.d.ts +3 -1
- package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -1
- package/package.json +3 -2
- package/dist/cjs/q2-optgroup.cjs.entry.js +0 -56
- package/dist/cjs/q2-option.cjs.entry.js +0 -46
- package/dist/esm/q2-optgroup.entry.js +0 -52
- package/dist/esm/q2-option.entry.js +0 -42
- package/dist/q2-tecton-elements/p-2c20fc43.entry.js +0 -1
- package/dist/q2-tecton-elements/p-3813f51d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-a510290a.js +0 -1
- package/dist/q2-tecton-elements/p-ba76ecfd.entry.js +0 -1
- package/dist/q2-tecton-elements/p-bbdae095.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f1d06917.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f6e868c1.entry.js +0 -1
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
1
|
+
import { h, } from '@stencil/core';
|
|
2
2
|
import { isEventFromElement, loc, overrideFocus, resizeIframe } from 'src/utils';
|
|
3
|
+
import { shouldShowActionSheet, showActionSheetList } from 'src/utils/action-sheet';
|
|
3
4
|
export class Q2Pill {
|
|
4
5
|
constructor() {
|
|
6
|
+
var _a;
|
|
5
7
|
this.scheduledAfterRender = [];
|
|
6
8
|
this.activateFirstOption = false;
|
|
7
9
|
/// Helpers ///
|
|
10
|
+
this.updateSelectedOptionElements = async () => {
|
|
11
|
+
var _a;
|
|
12
|
+
const { selectedOptions } = this;
|
|
13
|
+
const selectedValues = selectedOptions.map(option => option.value);
|
|
14
|
+
const options = await ((_a = this.optionList) === null || _a === void 0 ? void 0 : _a.getOptions());
|
|
15
|
+
this.selectedOptionElements = options === null || options === void 0 ? void 0 : options.filter(option => selectedValues.includes(option.value));
|
|
16
|
+
};
|
|
8
17
|
this.determineHasOptions = () => {
|
|
9
18
|
const hasOptions = !!this.hostElement.querySelectorAll('q2-option').length;
|
|
10
19
|
this.hasOptions = hasOptions;
|
|
@@ -24,7 +33,12 @@ export class Q2Pill {
|
|
|
24
33
|
return;
|
|
25
34
|
if (this.hasOptions) {
|
|
26
35
|
this.activateFirstOption = false;
|
|
27
|
-
|
|
36
|
+
if (shouldShowActionSheet(this)) {
|
|
37
|
+
this.executeActionSheet(event);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
await this.popoverElement.toggle();
|
|
41
|
+
}
|
|
28
42
|
}
|
|
29
43
|
else {
|
|
30
44
|
const { value, label } = this;
|
|
@@ -38,23 +52,22 @@ export class Q2Pill {
|
|
|
38
52
|
});
|
|
39
53
|
}
|
|
40
54
|
};
|
|
41
|
-
this.handleKeydown = (event) => {
|
|
55
|
+
this.handleKeydown = async (event) => {
|
|
42
56
|
if (!this.hasOptions || this.disabled)
|
|
43
57
|
return;
|
|
44
|
-
this
|
|
45
|
-
|
|
58
|
+
if (shouldShowActionSheet(this, event)) {
|
|
59
|
+
this.executeActionSheet(event);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this.activateFirstOption = true;
|
|
63
|
+
this.optionList.handleExternalKeydown(event);
|
|
64
|
+
}
|
|
46
65
|
};
|
|
47
66
|
this.handleChange = event => {
|
|
48
67
|
event.stopPropagation();
|
|
49
68
|
if (!this.hasOptions)
|
|
50
69
|
return;
|
|
51
|
-
|
|
52
|
-
const isActive = !!values.length;
|
|
53
|
-
if (!this.hostElement.onchange) {
|
|
54
|
-
this.selectedOptions = values;
|
|
55
|
-
this.active = isActive;
|
|
56
|
-
}
|
|
57
|
-
this.change.emit({ value, values, active: isActive });
|
|
70
|
+
this.handleSelectionChanges(event.detail);
|
|
58
71
|
};
|
|
59
72
|
this.handleWrapperClick = () => {
|
|
60
73
|
this.primaryBtn.focus();
|
|
@@ -67,6 +80,7 @@ export class Q2Pill {
|
|
|
67
80
|
this.popoverElement.open = false;
|
|
68
81
|
}
|
|
69
82
|
};
|
|
83
|
+
this.hoist = !!((_a = window.Tecton) === null || _a === void 0 ? void 0 : _a.useActionSheets);
|
|
70
84
|
this.disabled = undefined;
|
|
71
85
|
this.active = undefined;
|
|
72
86
|
this.open = undefined;
|
|
@@ -79,6 +93,7 @@ export class Q2Pill {
|
|
|
79
93
|
this.popoverMinHeight = 150;
|
|
80
94
|
this.popoverDirection = undefined;
|
|
81
95
|
this.hasOptions = undefined;
|
|
96
|
+
this.selectedOptionElements = [];
|
|
82
97
|
}
|
|
83
98
|
/// LifeCycle Hooks ///
|
|
84
99
|
componentWillLoad() {
|
|
@@ -99,11 +114,11 @@ export class Q2Pill {
|
|
|
99
114
|
}
|
|
100
115
|
/// Getters ///
|
|
101
116
|
get buttonContent() {
|
|
102
|
-
const { label, selectedOptions, hasOptions } = this;
|
|
103
|
-
if (!hasOptions ||
|
|
117
|
+
const { label, selectedOptions, selectedOptionElements, hasOptions } = this;
|
|
118
|
+
if (!hasOptions || selectedOptionElements.length === 0)
|
|
104
119
|
return label;
|
|
105
|
-
else if (
|
|
106
|
-
return
|
|
120
|
+
else if (selectedOptionElements.length === 1)
|
|
121
|
+
return selectedOptionElements[0].display;
|
|
107
122
|
return loc('tecton.element.pill.activeCount', { count: selectedOptions.length });
|
|
108
123
|
}
|
|
109
124
|
get truncatedButtonContent() {
|
|
@@ -113,6 +128,27 @@ export class Q2Pill {
|
|
|
113
128
|
else
|
|
114
129
|
return buttonContent;
|
|
115
130
|
}
|
|
131
|
+
async executeActionSheet(event) {
|
|
132
|
+
const result = await showActionSheetList(this, event);
|
|
133
|
+
this.handleSelectionChanges(result);
|
|
134
|
+
}
|
|
135
|
+
handleSelectionChanges(changeDetails) {
|
|
136
|
+
const { value = '', values = [] } = changeDetails;
|
|
137
|
+
const isActive = !!values.length;
|
|
138
|
+
if (!this.hostElement.onchange) {
|
|
139
|
+
this.selectedOptions = values;
|
|
140
|
+
this.active = isActive;
|
|
141
|
+
}
|
|
142
|
+
this.change.emit({
|
|
143
|
+
value,
|
|
144
|
+
values,
|
|
145
|
+
active: isActive,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/// Watchers ///
|
|
149
|
+
selectedOptionsWatcher() {
|
|
150
|
+
this.updateSelectedOptionElements();
|
|
151
|
+
}
|
|
116
152
|
/// Listeners ///
|
|
117
153
|
delegateFocus(event) {
|
|
118
154
|
if (!isEventFromElement(event, this.hostElement))
|
|
@@ -146,7 +182,7 @@ export class Q2Pill {
|
|
|
146
182
|
wrapperClassNames.push('has-icon');
|
|
147
183
|
if (hasOptions)
|
|
148
184
|
wrapperClassNames.push('has-options');
|
|
149
|
-
return (h("click-elsewhere", { onChange: this.onClickElsewhere }, h("div", { class: wrapperClassNames.join(' ') }, h("div", { class: "btn-height-wrapper", ref: el => (this.primaryBtnWrapper = el), onClick: this.handleWrapperClick, tabIndex: -1 }, h("button", { class: "btn-primary", "test-id": "btn-control", type: "button", ref: el => (this.primaryBtn = el), onClick: this.handleClick, onKeyDown: this.handleKeydown, disabled: this.disabled, "aria-selected": !hasOptions && active ? 'true' : 'false', "aria-roledescription": !hasOptions && 'filter', "aria-controls": hasOptions && 'option-list', "aria-haspopup": hasOptions && 'true', "aria-expanded": (hasOptions && `${!!open}`) || undefined, "aria-label": this.maxLength && this.buttonContent }, this.truncatedButtonContent, !hasOptions && active && h("span", { class: "sr" }, "(", loc('tecton.element.pill.active'), ")"))), this.generateIcon()), this.hasOptions && (h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: this.primaryBtnWrapper, open: this.open, minHeight: this.popoverMinHeight, direction: this.popoverDirection }, h("q2-option-list", { ref: el => (this.optionList = el), id: "option-list", onChange: this.handleChange, multiple: this.multiple, selectedOptions: this.selectedOptions }, h("slot", null))))));
|
|
185
|
+
return (h("click-elsewhere", { onChange: this.onClickElsewhere }, h("div", { class: wrapperClassNames.join(' ') }, h("div", { class: "btn-height-wrapper", ref: el => (this.primaryBtnWrapper = el), onClick: this.handleWrapperClick, tabIndex: -1 }, h("button", { class: "btn-primary", "test-id": "btn-control", type: "button", ref: el => (this.primaryBtn = el), onClick: this.handleClick, onKeyDown: this.handleKeydown, disabled: this.disabled, "aria-selected": !hasOptions && active ? 'true' : 'false', "aria-roledescription": !hasOptions && 'filter', "aria-controls": hasOptions && 'option-list', "aria-haspopup": hasOptions && 'true', "aria-expanded": (hasOptions && `${!!open}`) || undefined, "aria-label": this.maxLength && this.buttonContent }, this.truncatedButtonContent, !hasOptions && active && h("span", { class: "sr" }, "(", loc('tecton.element.pill.active'), ")"))), this.generateIcon()), this.hasOptions && (h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: this.primaryBtnWrapper, open: this.open, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: "right" }, h("q2-option-list", { ref: el => (this.optionList = el), id: "option-list", onChange: this.handleChange, multiple: this.multiple, selectedOptions: this.selectedOptions, onReady: () => this.updateSelectedOptionElements() }, h("slot", null))))));
|
|
150
186
|
}
|
|
151
187
|
static get is() { return "q2-pill"; }
|
|
152
188
|
static get encapsulation() { return "shadow"; }
|
|
@@ -162,6 +198,24 @@ export class Q2Pill {
|
|
|
162
198
|
}
|
|
163
199
|
static get properties() {
|
|
164
200
|
return {
|
|
201
|
+
"hoist": {
|
|
202
|
+
"type": "boolean",
|
|
203
|
+
"mutable": false,
|
|
204
|
+
"complexType": {
|
|
205
|
+
"original": "boolean",
|
|
206
|
+
"resolved": "boolean",
|
|
207
|
+
"references": {}
|
|
208
|
+
},
|
|
209
|
+
"required": false,
|
|
210
|
+
"optional": false,
|
|
211
|
+
"docs": {
|
|
212
|
+
"tags": [],
|
|
213
|
+
"text": ""
|
|
214
|
+
},
|
|
215
|
+
"attribute": "hoist",
|
|
216
|
+
"reflect": false,
|
|
217
|
+
"defaultValue": "!!window.Tecton?.useActionSheets"
|
|
218
|
+
},
|
|
165
219
|
"disabled": {
|
|
166
220
|
"type": "boolean",
|
|
167
221
|
"mutable": false,
|
|
@@ -358,7 +412,8 @@ export class Q2Pill {
|
|
|
358
412
|
}
|
|
359
413
|
static get states() {
|
|
360
414
|
return {
|
|
361
|
-
"hasOptions": {}
|
|
415
|
+
"hasOptions": {},
|
|
416
|
+
"selectedOptionElements": {}
|
|
362
417
|
};
|
|
363
418
|
}
|
|
364
419
|
static get events() {
|
|
@@ -385,6 +440,12 @@ export class Q2Pill {
|
|
|
385
440
|
}];
|
|
386
441
|
}
|
|
387
442
|
static get elementRef() { return "hostElement"; }
|
|
443
|
+
static get watchers() {
|
|
444
|
+
return [{
|
|
445
|
+
"propName": "selectedOptions",
|
|
446
|
+
"methodName": "selectedOptionsWatcher"
|
|
447
|
+
}];
|
|
448
|
+
}
|
|
388
449
|
static get listeners() {
|
|
389
450
|
return [{
|
|
390
451
|
"name": "focus",
|
|
@@ -232,6 +232,5 @@ div.btn-close {
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
q2-popover {
|
|
235
|
-
|
|
236
|
-
top: calc((var(--comp-pill-min-height) - var(--comp-pill-btn-height)) / 2 * -1);
|
|
235
|
+
top: calc(var(--comp-pill-min-height) - (var(--comp-pill-min-height) - var(--comp-pill-btn-height)) / 2);
|
|
237
236
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { h, } from '@stencil/core';
|
|
2
|
+
import { nextPaint, resizeIframe } from 'src/utils';
|
|
2
3
|
export class Q2Popover {
|
|
3
4
|
constructor() {
|
|
4
|
-
this.
|
|
5
|
+
this.scheduledAfterRender = [];
|
|
5
6
|
this.direction = undefined;
|
|
6
7
|
this.align = undefined;
|
|
7
8
|
this.open = undefined;
|
|
8
9
|
this.block = undefined;
|
|
9
10
|
this.minHeight = undefined;
|
|
10
11
|
this.controlElement = undefined;
|
|
12
|
+
this.privateDirection = 'down';
|
|
11
13
|
}
|
|
12
14
|
/// Lifecycle hooks ///
|
|
13
15
|
componentDidLoad() {
|
|
@@ -15,8 +17,14 @@ export class Q2Popover {
|
|
|
15
17
|
this.determinePopDirection();
|
|
16
18
|
}
|
|
17
19
|
componentWillRender() {
|
|
18
|
-
if (this.containerElement && this.
|
|
19
|
-
this.determinePopDirection();
|
|
20
|
+
if (this.containerElement && this.open)
|
|
21
|
+
nextPaint(() => this.determinePopDirection());
|
|
22
|
+
}
|
|
23
|
+
componentDidRender() {
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
this.scheduledAfterRender.forEach(fn => fn());
|
|
26
|
+
this.scheduledAfterRender = [];
|
|
27
|
+
}, 25);
|
|
20
28
|
}
|
|
21
29
|
/// Methods ///
|
|
22
30
|
async toggle() {
|
|
@@ -25,6 +33,7 @@ export class Q2Popover {
|
|
|
25
33
|
/// Watchers ///
|
|
26
34
|
openChanged(open) {
|
|
27
35
|
this.popoverStateChanged.emit({ open });
|
|
36
|
+
this.scheduledAfterRender.push(resizeIframe);
|
|
28
37
|
}
|
|
29
38
|
/// Listeners ///
|
|
30
39
|
popoverStateHandler(event) {
|
|
@@ -208,6 +217,11 @@ export class Q2Popover {
|
|
|
208
217
|
}
|
|
209
218
|
};
|
|
210
219
|
}
|
|
220
|
+
static get states() {
|
|
221
|
+
return {
|
|
222
|
+
"privateDirection": {}
|
|
223
|
+
};
|
|
224
|
+
}
|
|
211
225
|
static get events() {
|
|
212
226
|
return [{
|
|
213
227
|
"method": "popoverStateChanged",
|
|
@@ -65,84 +65,26 @@ button {
|
|
|
65
65
|
visibility: hidden;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
* {
|
|
69
|
-
box-sizing: border-box;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
*:active {
|
|
73
|
-
outline: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
*:focus {
|
|
77
|
-
outline: none;
|
|
78
|
-
box-shadow: var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
68
|
:host {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
::-moz-focus-inner {
|
|
86
|
-
border: none;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
input,
|
|
90
|
-
textarea,
|
|
91
|
-
button {
|
|
92
|
-
font-family: inherit;
|
|
93
|
-
font-size: inherit;
|
|
94
|
-
font-stretch: inherit;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
:host(.sr),
|
|
98
|
-
:host(.sr) button {
|
|
99
|
-
border: 0;
|
|
100
|
-
clip: rect(0 0 0 0);
|
|
101
|
-
height: 1px;
|
|
102
|
-
margin: -1px;
|
|
103
|
-
overflow: hidden;
|
|
104
|
-
padding: 0;
|
|
105
|
-
position: absolute;
|
|
106
|
-
width: 1px;
|
|
107
|
-
white-space: nowrap;
|
|
69
|
+
display: block;
|
|
70
|
+
width: 100%;
|
|
108
71
|
}
|
|
109
72
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
border: 0;
|
|
113
|
-
clip: rect(0 0 0 0);
|
|
114
|
-
height: 1px;
|
|
115
|
-
margin: -1px;
|
|
116
|
-
overflow: hidden;
|
|
117
|
-
padding: 0;
|
|
73
|
+
:host([align=right]) {
|
|
74
|
+
display: block;
|
|
118
75
|
position: absolute;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
.hidden {
|
|
124
|
-
display: none;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
:host([hidden]) {
|
|
128
|
-
display: none;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.invisible {
|
|
132
|
-
visibility: hidden;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
:host {
|
|
136
|
-
display: inline-flex;
|
|
137
|
-
width: 100%;
|
|
76
|
+
right: 0;
|
|
77
|
+
text-align: end;
|
|
78
|
+
left: unset;
|
|
138
79
|
}
|
|
139
80
|
|
|
140
81
|
.container {
|
|
141
|
-
display:
|
|
82
|
+
display: none;
|
|
142
83
|
overflow: hidden;
|
|
143
84
|
opacity: 0;
|
|
144
85
|
height: 0;
|
|
145
86
|
position: absolute;
|
|
87
|
+
top: var(--tct-popover-top, var(--t-popover-top, initial));
|
|
146
88
|
visibility: hidden;
|
|
147
89
|
background-color: var(--tct-popover-background-color, var(--t-popover-background-color, var(--app-white, #ffffff)));
|
|
148
90
|
color: var(--tct-popover-text-color, var(--t-popover-text-color, var(--t-text, #4d4d4d)));
|
|
@@ -178,6 +120,7 @@ button {
|
|
|
178
120
|
left: unset;
|
|
179
121
|
right: unset;
|
|
180
122
|
width: 100%;
|
|
123
|
+
min-width: unset;
|
|
181
124
|
}
|
|
182
125
|
:host([align=right]) .container {
|
|
183
126
|
right: 0;
|
|
@@ -75,7 +75,7 @@ export class Q2Radio {
|
|
|
75
75
|
return {
|
|
76
76
|
"label": {
|
|
77
77
|
"type": "string",
|
|
78
|
-
"mutable":
|
|
78
|
+
"mutable": true,
|
|
79
79
|
"complexType": {
|
|
80
80
|
"original": "string",
|
|
81
81
|
"resolved": "string",
|
|
@@ -179,7 +179,7 @@ export class Q2Radio {
|
|
|
179
179
|
},
|
|
180
180
|
"ariaLabel": {
|
|
181
181
|
"type": "string",
|
|
182
|
-
"mutable":
|
|
182
|
+
"mutable": true,
|
|
183
183
|
"complexType": {
|
|
184
184
|
"original": "string",
|
|
185
185
|
"resolved": "string",
|