q2-tecton-elements 1.17.1 → 1.19.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 +1 -1
- package/dist/cjs/{icons-e2bc9ee9.js → icons-afbdf88a.js} +1 -1
- package/dist/cjs/{index-afc50fbb.js → index-3518c78c.js} +9 -1
- package/dist/cjs/{index-0128397d.js → index-734296a7.js} +476 -271
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/q2-avatar.cjs.entry.js +9 -6
- package/dist/cjs/q2-badge_2.cjs.entry.js +46 -7
- package/dist/cjs/q2-btn_2.cjs.entry.js +31 -5
- package/dist/cjs/q2-calendar.cjs.entry.js +89 -62
- package/dist/cjs/q2-card.cjs.entry.js +17 -6
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +7 -3
- package/dist/cjs/q2-carousel.cjs.entry.js +196 -285
- package/dist/cjs/q2-chart-donut.cjs.entry.js +583 -504
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +9 -7
- package/dist/cjs/q2-checkbox.cjs.entry.js +17 -4
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +9 -3
- package/dist/cjs/q2-dropdown.cjs.entry.js +16 -5
- package/dist/cjs/q2-editable-field.cjs.entry.js +16 -6
- package/dist/cjs/q2-icon.cjs.entry.js +6 -4
- package/dist/cjs/q2-loading-element.cjs.entry.js +6 -2
- package/dist/cjs/q2-loc.cjs.entry.js +5 -3
- package/dist/cjs/q2-message.cjs.entry.js +4 -3
- package/dist/cjs/q2-month-picker.cjs.entry.js +149 -0
- package/dist/cjs/q2-optgroup.cjs.entry.js +6 -5
- package/dist/cjs/{q2-option-list.cjs.entry.js → q2-option-list_2.cjs.entry.js} +120 -23
- package/dist/cjs/q2-option.cjs.entry.js +12 -2
- package/dist/cjs/q2-pagination.cjs.entry.js +18 -4
- package/dist/cjs/q2-pill.cjs.entry.js +40 -20
- package/dist/cjs/q2-radio-group.cjs.entry.js +13 -6
- package/dist/cjs/q2-radio.cjs.entry.js +13 -8
- package/dist/cjs/q2-section.cjs.entry.js +9 -4
- package/dist/cjs/q2-select.cjs.entry.js +28 -21
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +8 -3
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +5 -4
- package/dist/cjs/q2-stepper.cjs.entry.js +9 -7
- package/dist/cjs/q2-tab-container.cjs.entry.js +14 -9
- package/dist/cjs/q2-tab-pane.cjs.entry.js +10 -2
- package/dist/cjs/q2-tag.cjs.entry.js +32 -17
- package/dist/cjs/q2-tecton-elements.cjs.js +3 -3
- package/dist/cjs/q2-textarea.cjs.entry.js +20 -4
- package/dist/cjs/q2-tooltip.cjs.entry.js +70 -14
- package/dist/cjs/{shapes-c1a60d46.js → shapes-aad2b98f.js} +1 -1
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +17 -2
- package/dist/collection/collection-manifest.json +4 -2
- package/dist/collection/components/click-elsewhere/index.js +18 -17
- package/dist/collection/components/q2-avatar/index.js +100 -92
- package/dist/collection/components/q2-avatar/styles.css +1 -1
- package/dist/collection/components/q2-badge/index.js +119 -111
- package/dist/collection/components/q2-badge/styles.css +1 -1
- package/dist/collection/components/q2-btn/index.js +351 -306
- package/dist/collection/components/q2-btn/styles.css +8 -7
- package/dist/collection/components/q2-calendar/index.js +565 -551
- package/dist/collection/components/q2-calendar/q2-month-picker.css +130 -0
- package/dist/collection/components/q2-calendar/q2-month-picker.js +242 -0
- package/dist/collection/components/q2-calendar/styles.css +1 -1
- package/dist/collection/components/q2-card/index.js +262 -244
- package/dist/collection/components/q2-card/styles.css +9 -2
- package/dist/collection/components/q2-carousel/index.js +249 -253
- package/dist/collection/components/q2-carousel/styles.css +1 -1
- package/dist/collection/components/q2-carousel-pane/index.js +108 -96
- package/dist/collection/components/q2-carousel-pane/styles.css +5 -4
- package/dist/collection/components/q2-chart-donut/index.js +350 -334
- package/dist/collection/components/q2-chart-donut/styles.css +3 -3
- package/dist/collection/components/q2-checkbox/index.js +296 -287
- package/dist/collection/components/q2-checkbox/styles.css +2 -2
- package/dist/collection/components/q2-checkbox-group/index.js +156 -152
- package/dist/collection/components/q2-checkbox-group/styles.css +1 -1
- package/dist/collection/components/q2-dropdown/index.js +255 -240
- package/dist/collection/components/q2-dropdown/styles.css +1 -1
- package/dist/collection/components/q2-dropdown-item/index.js +134 -123
- package/dist/collection/components/q2-dropdown-item/styles.css +12 -10
- package/dist/collection/components/q2-editable-field/index.js +300 -293
- package/dist/collection/components/q2-editable-field/styles.css +1 -1
- package/dist/collection/components/q2-icon/icons.js +358 -2158
- package/dist/collection/components/q2-icon/index.js +59 -49
- package/dist/collection/components/q2-icon/styles.css +1 -1
- package/dist/collection/components/q2-input/index.js +729 -705
- package/dist/collection/components/q2-input/styles.css +2 -2
- package/dist/collection/components/q2-loading/index.js +143 -132
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js +85 -74
- package/dist/collection/components/q2-loading/skeleton/shapes.js +23 -36
- package/dist/collection/components/q2-loading/styles.css +1 -1
- package/dist/collection/components/q2-loc/index.js +49 -39
- package/dist/collection/components/q2-loc/styles.css +1 -1
- package/dist/collection/components/q2-message/index.js +101 -92
- package/dist/collection/components/q2-message/styles.css +1 -1
- package/dist/collection/components/q2-optgroup/index.js +64 -56
- package/dist/collection/components/q2-optgroup/styles.css +1 -1
- package/dist/collection/components/q2-option/index.js +244 -229
- package/dist/collection/components/q2-option/styles.css +5 -1
- package/dist/collection/components/q2-option-list/index.js +295 -319
- package/dist/collection/components/q2-option-list/styles.css +2 -50
- package/dist/collection/components/q2-pagination/index.js +183 -173
- package/dist/collection/components/q2-pagination/styles.css +1 -1
- package/dist/collection/components/q2-pill/index.js +276 -221
- package/dist/collection/components/q2-pill/styles.css +12 -7
- package/dist/collection/components/q2-popover/index.js +263 -0
- package/dist/collection/components/q2-popover/styles.css +205 -0
- package/dist/collection/components/q2-radio/index.js +233 -224
- package/dist/collection/components/q2-radio/styles.css +3 -3
- package/dist/collection/components/q2-radio-group/index.js +252 -244
- package/dist/collection/components/q2-radio-group/styles.css +1 -1
- package/dist/collection/components/q2-section/index.js +134 -125
- package/dist/collection/components/q2-section/styles.css +12 -1
- package/dist/collection/components/q2-select/index.js +395 -385
- package/dist/collection/components/q2-select/styles.css +1 -1
- package/dist/collection/components/q2-stepper/index.js +124 -126
- package/dist/collection/components/q2-stepper/styles.css +2 -1
- package/dist/collection/components/q2-stepper-pane/index.js +165 -149
- package/dist/collection/components/q2-stepper-pane/styles.css +1 -1
- package/dist/collection/components/q2-stepper-vertical/index.js +86 -85
- package/dist/collection/components/q2-stepper-vertical/styles.css +1 -1
- package/dist/collection/components/q2-tab-container/index.js +189 -184
- package/dist/collection/components/q2-tab-container/styles.css +1 -1
- package/dist/collection/components/q2-tab-pane/index.js +185 -166
- package/dist/collection/components/q2-tab-pane/styles.css +1 -1
- package/dist/collection/components/q2-tag/index.js +180 -125
- package/dist/collection/components/q2-tag/styles.css +2 -6
- package/dist/collection/components/q2-textarea/index.js +344 -327
- package/dist/collection/components/q2-textarea/styles.css +2 -2
- package/dist/collection/components/q2-tooltip/index.js +207 -104
- package/dist/collection/components/q2-tooltip/styles.css +63 -83
- package/dist/collection/components/tecton-tab-pane/index.js +287 -266
- package/dist/collection/components/tecton-tab-pane/styles.css +1 -1
- package/dist/collection/utils/index.js +9 -6
- package/dist/esm/click-elsewhere.entry.js +1 -1
- package/dist/esm/{icons-ed54e307.js → icons-78da5dd2.js} +1 -1
- package/dist/esm/{index-2ca8c93c.js → index-9c591682.js} +9 -2
- package/dist/esm/{index-6d5ed7cc.js → index-bb1c8c7f.js} +476 -271
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/q2-avatar.entry.js +9 -6
- package/dist/esm/q2-badge_2.entry.js +46 -7
- package/dist/esm/q2-btn_2.entry.js +31 -5
- package/dist/esm/q2-calendar.entry.js +89 -62
- package/dist/esm/q2-card.entry.js +17 -6
- package/dist/esm/q2-carousel-pane.entry.js +7 -3
- package/dist/esm/q2-carousel.entry.js +196 -285
- package/dist/esm/q2-chart-donut.entry.js +583 -504
- package/dist/esm/q2-checkbox-group.entry.js +9 -7
- package/dist/esm/q2-checkbox.entry.js +17 -4
- package/dist/esm/q2-dropdown-item.entry.js +9 -3
- package/dist/esm/q2-dropdown.entry.js +16 -5
- package/dist/esm/q2-editable-field.entry.js +16 -6
- package/dist/esm/q2-icon.entry.js +6 -4
- package/dist/esm/q2-loading-element.entry.js +6 -2
- package/dist/esm/q2-loc.entry.js +5 -3
- package/dist/esm/q2-message.entry.js +4 -3
- package/dist/esm/q2-month-picker.entry.js +145 -0
- package/dist/esm/q2-optgroup.entry.js +6 -5
- package/dist/esm/{q2-option-list.entry.js → q2-option-list_2.entry.js} +120 -24
- package/dist/esm/q2-option.entry.js +12 -2
- package/dist/esm/q2-pagination.entry.js +18 -4
- package/dist/esm/q2-pill.entry.js +40 -20
- package/dist/esm/q2-radio-group.entry.js +13 -6
- package/dist/esm/q2-radio.entry.js +13 -8
- package/dist/esm/q2-section.entry.js +9 -4
- package/dist/esm/q2-select.entry.js +28 -21
- package/dist/esm/q2-stepper-pane.entry.js +8 -3
- package/dist/esm/q2-stepper-vertical.entry.js +5 -4
- package/dist/esm/q2-stepper.entry.js +9 -7
- package/dist/esm/q2-tab-container.entry.js +14 -9
- package/dist/esm/q2-tab-pane.entry.js +10 -2
- package/dist/esm/q2-tag.entry.js +32 -17
- package/dist/esm/q2-tecton-elements.js +3 -3
- package/dist/esm/q2-textarea.entry.js +20 -4
- package/dist/esm/q2-tooltip.entry.js +70 -14
- package/dist/esm/{shapes-c32e3ba2.js → shapes-62b8a431.js} +1 -1
- package/dist/esm/tecton-tab-pane.entry.js +17 -2
- package/dist/loader/package.json +1 -0
- package/dist/q2-tecton-elements/p-0ba564b1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-0fad9c5a.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-73154834.js → p-13a639cf.js} +1 -1
- package/dist/q2-tecton-elements/p-16c11d74.entry.js +1 -0
- package/dist/q2-tecton-elements/p-17e0cbf1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-18e095af.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2c9b1308.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2e832e42.entry.js +1 -0
- package/dist/q2-tecton-elements/p-315fdb74.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-318758d4.entry.js → p-444415b5.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-4d700630.entry.js +1 -0
- package/dist/q2-tecton-elements/p-4f0f45e7.entry.js +1 -0
- package/dist/q2-tecton-elements/p-54e792bd.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-41fcf343.js → p-5e374fbd.js} +1 -1
- package/dist/q2-tecton-elements/p-5f064e1e.entry.js +39 -0
- package/dist/q2-tecton-elements/p-692f2d09.entry.js +1 -0
- package/dist/q2-tecton-elements/p-6e6b5b80.entry.js +1 -0
- package/dist/q2-tecton-elements/p-7e8f43d1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-8e380edf.entry.js +1 -0
- package/dist/q2-tecton-elements/p-926a3e80.js +2 -0
- package/dist/q2-tecton-elements/{p-93c00587.js → p-92e1faf8.js} +1 -1
- package/dist/q2-tecton-elements/p-9772b15f.entry.js +1 -0
- package/dist/q2-tecton-elements/p-97aa8423.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-17cffd7d.entry.js → p-a987402e.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-aaf42539.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ac674c20.entry.js +1 -0
- package/dist/q2-tecton-elements/p-b8b00394.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c444a60b.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c6c489fe.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ce015552.entry.js +1 -0
- package/dist/q2-tecton-elements/p-d464fccc.entry.js +1 -0
- package/dist/q2-tecton-elements/p-de164483.entry.js +1 -0
- package/dist/q2-tecton-elements/p-df91e954.entry.js +1 -0
- package/dist/q2-tecton-elements/p-e6d26f39.entry.js +1 -0
- package/dist/q2-tecton-elements/p-e8e113c2.entry.js +1 -0
- package/dist/q2-tecton-elements/p-f1d06917.entry.js +1 -0
- package/dist/q2-tecton-elements/p-f800fd1e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-fb37e67e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-fc134a5d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-fe88e979.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ffb48ccc.entry.js +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/helpers.js +6 -0
- package/dist/types/components/q2-btn/index.d.ts +1 -0
- package/dist/types/components/q2-calendar/q2-month-picker.d.ts +24 -0
- package/dist/types/components/q2-option-list/index.d.ts +1 -4
- package/dist/types/components/q2-pill/index.d.ts +10 -3
- package/dist/types/components/q2-popover/index.d.ts +26 -0
- package/dist/types/components/q2-tag/index.d.ts +8 -2
- package/dist/types/components/q2-tooltip/index.d.ts +12 -0
- package/dist/types/components.d.ts +203 -38
- package/dist/types/stencil-public-runtime.d.ts +20 -4
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/workspace/workspace/{tecton-production_release_1.17.x → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +2 -0
- package/package.json +6 -6
- package/dist/q2-tecton-elements/p-06865cf5.entry.js +0 -1
- package/dist/q2-tecton-elements/p-0d849ed4.entry.js +0 -1
- package/dist/q2-tecton-elements/p-2a217895.entry.js +0 -1
- package/dist/q2-tecton-elements/p-2b94ae62.entry.js +0 -1
- package/dist/q2-tecton-elements/p-2faed36b.entry.js +0 -1
- package/dist/q2-tecton-elements/p-30a4fdfb.entry.js +0 -1
- package/dist/q2-tecton-elements/p-30f81b22.entry.js +0 -1
- package/dist/q2-tecton-elements/p-31070ab8.entry.js +0 -1
- package/dist/q2-tecton-elements/p-41c22a16.entry.js +0 -1
- package/dist/q2-tecton-elements/p-445e7c45.entry.js +0 -1
- package/dist/q2-tecton-elements/p-44bdaf52.entry.js +0 -1
- package/dist/q2-tecton-elements/p-4c53713d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-4da9b6b6.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5acb7ec6.entry.js +0 -1
- package/dist/q2-tecton-elements/p-64605d17.entry.js +0 -1
- package/dist/q2-tecton-elements/p-64ca8c59.entry.js +0 -1
- package/dist/q2-tecton-elements/p-654fcd6b.entry.js +0 -1
- package/dist/q2-tecton-elements/p-661c2092.entry.js +0 -1
- package/dist/q2-tecton-elements/p-732dafd0.entry.js +0 -1
- package/dist/q2-tecton-elements/p-815c8a7d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-824a1d7c.entry.js +0 -1
- package/dist/q2-tecton-elements/p-8543a0e1.entry.js +0 -1
- package/dist/q2-tecton-elements/p-916fd90b.entry.js +0 -1
- package/dist/q2-tecton-elements/p-94b3c534.entry.js +0 -1
- package/dist/q2-tecton-elements/p-9725d55f.entry.js +0 -1
- package/dist/q2-tecton-elements/p-a45c6b65.entry.js +0 -1
- package/dist/q2-tecton-elements/p-a659d112.entry.js +0 -1
- package/dist/q2-tecton-elements/p-b4b8f85c.entry.js +0 -39
- package/dist/q2-tecton-elements/p-b595b415.entry.js +0 -1
- package/dist/q2-tecton-elements/p-c5691700.js +0 -1
- package/dist/q2-tecton-elements/p-cde0cdff.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d3e4cc5d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d781e2d9.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d8d9e8eb.entry.js +0 -1
- package/dist/q2-tecton-elements/p-fbf23146.entry.js +0 -1
- package/dist/test/elements/q2-tag-test.js +0 -151
- package/dist/types/workspace/workspace/tecton-production_release_1.17.x/packages/q2-tecton-elements/.stencil/test/elements/q2-tag-test.d.ts +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isEventFromElement, loc, overrideFocus } from 'src/utils';
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { isEventFromElement, loc, overrideFocus, resizeIframe } from 'src/utils';
|
|
3
3
|
export class Q2Pill {
|
|
4
4
|
constructor() {
|
|
5
|
-
this.selectedOptions = [];
|
|
6
5
|
this.scheduledAfterRender = [];
|
|
6
|
+
this.activateFirstOption = false;
|
|
7
7
|
/// Helpers ///
|
|
8
8
|
this.determineHasOptions = () => {
|
|
9
9
|
const hasOptions = !!this.hostElement.querySelectorAll('q2-option').length;
|
|
@@ -15,14 +15,16 @@ export class Q2Pill {
|
|
|
15
15
|
this.open = false;
|
|
16
16
|
this.primaryBtn.focus();
|
|
17
17
|
this.change.emit({ value: null, values: [], active: false });
|
|
18
|
+
this.scheduledAfterRender.push(resizeIframe);
|
|
18
19
|
};
|
|
19
20
|
/// Event Handlers ///
|
|
20
|
-
this.handleClick = (event) => {
|
|
21
|
+
this.handleClick = async (event) => {
|
|
21
22
|
event.stopPropagation();
|
|
22
23
|
if (this.disabled)
|
|
23
24
|
return;
|
|
24
25
|
if (this.hasOptions) {
|
|
25
|
-
this.
|
|
26
|
+
this.activateFirstOption = false;
|
|
27
|
+
await this.popoverElement.toggle();
|
|
26
28
|
}
|
|
27
29
|
else {
|
|
28
30
|
const { value, label } = this;
|
|
@@ -39,9 +41,11 @@ export class Q2Pill {
|
|
|
39
41
|
this.handleKeydown = (event) => {
|
|
40
42
|
if (!this.hasOptions || this.disabled)
|
|
41
43
|
return;
|
|
44
|
+
this.activateFirstOption = true;
|
|
42
45
|
this.optionList.handleExternalKeydown(event);
|
|
43
46
|
};
|
|
44
47
|
this.handleChange = event => {
|
|
48
|
+
event.stopPropagation();
|
|
45
49
|
if (!this.hasOptions)
|
|
46
50
|
return;
|
|
47
51
|
const { value, values } = event.detail;
|
|
@@ -52,20 +56,29 @@ export class Q2Pill {
|
|
|
52
56
|
}
|
|
53
57
|
this.change.emit({ value, values, active: isActive });
|
|
54
58
|
};
|
|
55
|
-
this.handleFocusout = (event) => {
|
|
56
|
-
const relatedTarget = event.relatedTarget;
|
|
57
|
-
if (Array.from(this.hostElement.children).includes(relatedTarget))
|
|
58
|
-
return;
|
|
59
|
-
if (relatedTarget && !(event.relatedTarget instanceof HTMLElement))
|
|
60
|
-
return;
|
|
61
|
-
if (relatedTarget && relatedTarget.closest('.btn-height-wrapper'))
|
|
62
|
-
return;
|
|
63
|
-
this.optionList.open = false;
|
|
64
|
-
};
|
|
65
59
|
this.handleWrapperClick = () => {
|
|
66
60
|
this.primaryBtn.focus();
|
|
67
61
|
this.primaryBtn.click();
|
|
68
62
|
};
|
|
63
|
+
this.onClickElsewhere = (event) => {
|
|
64
|
+
const target = event.target;
|
|
65
|
+
if (target.localName === 'click-elsewhere') {
|
|
66
|
+
event.stopPropagation();
|
|
67
|
+
this.popoverElement.open = false;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
this.disabled = undefined;
|
|
71
|
+
this.active = undefined;
|
|
72
|
+
this.open = undefined;
|
|
73
|
+
this.multiple = undefined;
|
|
74
|
+
this.maxLength = undefined;
|
|
75
|
+
this.label = undefined;
|
|
76
|
+
this.value = undefined;
|
|
77
|
+
this.theme = undefined;
|
|
78
|
+
this.selectedOptions = [];
|
|
79
|
+
this.popoverMinHeight = 150;
|
|
80
|
+
this.popoverDirection = undefined;
|
|
81
|
+
this.hasOptions = undefined;
|
|
69
82
|
}
|
|
70
83
|
/// LifeCycle Hooks ///
|
|
71
84
|
componentWillLoad() {
|
|
@@ -106,10 +119,17 @@ export class Q2Pill {
|
|
|
106
119
|
return;
|
|
107
120
|
this.primaryBtn.focus();
|
|
108
121
|
}
|
|
109
|
-
|
|
110
|
-
this.open
|
|
111
|
-
|
|
122
|
+
popoverStateHandler({ detail: { open } }) {
|
|
123
|
+
if (this.open !== open)
|
|
124
|
+
this.open = open;
|
|
125
|
+
if (open && this.activateFirstOption) {
|
|
126
|
+
this.optionList.focus();
|
|
127
|
+
this.activateFirstOption = false;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
this.optionList.setActiveElement(null);
|
|
112
131
|
this.primaryBtn.focus();
|
|
132
|
+
}
|
|
113
133
|
}
|
|
114
134
|
/// DOM ///
|
|
115
135
|
generateIcon() {
|
|
@@ -117,8 +137,7 @@ export class Q2Pill {
|
|
|
117
137
|
const isButton = hasOptions && active;
|
|
118
138
|
const TagName = isButton ? 'button' : 'div';
|
|
119
139
|
const iconName = isButton || !hasOptions ? 'close' : 'chevron-down';
|
|
120
|
-
return (h(TagName, { class: "btn-close", onClick: isButton && this.clearSelectedOptions, disabled: isButton && this.disabled, "aria-label": isButton && loc('tecton.element.pill.clearSelection'), type: isButton && 'button' },
|
|
121
|
-
h("q2-icon", { type: iconName })));
|
|
140
|
+
return (h(TagName, { class: "btn-close", onClick: isButton && this.clearSelectedOptions, disabled: isButton && this.disabled, "aria-label": isButton && loc('tecton.element.pill.clearSelection'), type: isButton && 'button' }, h("q2-icon", { type: iconName })));
|
|
122
141
|
}
|
|
123
142
|
render() {
|
|
124
143
|
const { hasOptions, active, open } = this;
|
|
@@ -127,222 +146,258 @@ export class Q2Pill {
|
|
|
127
146
|
wrapperClassNames.push('has-icon');
|
|
128
147
|
if (hasOptions)
|
|
129
148
|
wrapperClassNames.push('has-options');
|
|
130
|
-
return (h(
|
|
131
|
-
h("div", { class: wrapperClassNames.join(' ') },
|
|
132
|
-
h("div", { class: "btn-height-wrapper", onClick: this.handleWrapperClick, tabIndex: -1 },
|
|
133
|
-
h("button", { class: "btn-primary", type: "button", "test-id": "btn-control", ref: el => (this.primaryBtn = el), onClick: this.handleClick, onKeyDown: this.handleKeydown, disabled: this.disabled, onFocusout: this.handleFocusout, "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 },
|
|
134
|
-
this.truncatedButtonContent,
|
|
135
|
-
!hasOptions && active && h("span", { class: "sr" },
|
|
136
|
-
"(",
|
|
137
|
-
loc('tecton.element.pill.active'),
|
|
138
|
-
")"))),
|
|
139
|
-
this.generateIcon()),
|
|
140
|
-
this.hasOptions && (h("q2-option-list", { id: "option-list", ref: el => (this.optionList = el), open: this.open, onChange: this.handleChange, multiple: this.multiple, onFocusout: this.handleFocusout, selectedOptions: this.selectedOptions },
|
|
141
|
-
h("slot", null)))));
|
|
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))))));
|
|
142
150
|
}
|
|
143
151
|
static get is() { return "q2-pill"; }
|
|
144
152
|
static get encapsulation() { return "shadow"; }
|
|
145
|
-
static get originalStyleUrls() {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
"
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
"original": "boolean",
|
|
174
|
-
"resolved": "boolean",
|
|
175
|
-
"references": {}
|
|
176
|
-
},
|
|
177
|
-
"required": false,
|
|
178
|
-
"optional": false,
|
|
179
|
-
"docs": {
|
|
180
|
-
"tags": [],
|
|
181
|
-
"text": ""
|
|
182
|
-
},
|
|
183
|
-
"attribute": "active",
|
|
184
|
-
"reflect": true
|
|
185
|
-
},
|
|
186
|
-
"open": {
|
|
187
|
-
"type": "boolean",
|
|
188
|
-
"mutable": true,
|
|
189
|
-
"complexType": {
|
|
190
|
-
"original": "boolean",
|
|
191
|
-
"resolved": "boolean",
|
|
192
|
-
"references": {}
|
|
193
|
-
},
|
|
194
|
-
"required": false,
|
|
195
|
-
"optional": false,
|
|
196
|
-
"docs": {
|
|
197
|
-
"tags": [],
|
|
198
|
-
"text": ""
|
|
199
|
-
},
|
|
200
|
-
"attribute": "open",
|
|
201
|
-
"reflect": true
|
|
202
|
-
},
|
|
203
|
-
"multiple": {
|
|
204
|
-
"type": "boolean",
|
|
205
|
-
"mutable": false,
|
|
206
|
-
"complexType": {
|
|
207
|
-
"original": "boolean",
|
|
208
|
-
"resolved": "boolean",
|
|
209
|
-
"references": {}
|
|
210
|
-
},
|
|
211
|
-
"required": false,
|
|
212
|
-
"optional": false,
|
|
213
|
-
"docs": {
|
|
214
|
-
"tags": [],
|
|
215
|
-
"text": ""
|
|
216
|
-
},
|
|
217
|
-
"attribute": "multiple",
|
|
218
|
-
"reflect": true
|
|
219
|
-
},
|
|
220
|
-
"maxLength": {
|
|
221
|
-
"type": "number",
|
|
222
|
-
"mutable": false,
|
|
223
|
-
"complexType": {
|
|
224
|
-
"original": "number",
|
|
225
|
-
"resolved": "number",
|
|
226
|
-
"references": {}
|
|
153
|
+
static get originalStyleUrls() {
|
|
154
|
+
return {
|
|
155
|
+
"$": ["styles.scss"]
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
static get styleUrls() {
|
|
159
|
+
return {
|
|
160
|
+
"$": ["styles.css"]
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
static get properties() {
|
|
164
|
+
return {
|
|
165
|
+
"disabled": {
|
|
166
|
+
"type": "boolean",
|
|
167
|
+
"mutable": false,
|
|
168
|
+
"complexType": {
|
|
169
|
+
"original": "boolean",
|
|
170
|
+
"resolved": "boolean",
|
|
171
|
+
"references": {}
|
|
172
|
+
},
|
|
173
|
+
"required": false,
|
|
174
|
+
"optional": false,
|
|
175
|
+
"docs": {
|
|
176
|
+
"tags": [],
|
|
177
|
+
"text": ""
|
|
178
|
+
},
|
|
179
|
+
"attribute": "disabled",
|
|
180
|
+
"reflect": true
|
|
227
181
|
},
|
|
228
|
-
"
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
"
|
|
232
|
-
|
|
182
|
+
"active": {
|
|
183
|
+
"type": "boolean",
|
|
184
|
+
"mutable": true,
|
|
185
|
+
"complexType": {
|
|
186
|
+
"original": "boolean",
|
|
187
|
+
"resolved": "boolean",
|
|
188
|
+
"references": {}
|
|
189
|
+
},
|
|
190
|
+
"required": false,
|
|
191
|
+
"optional": false,
|
|
192
|
+
"docs": {
|
|
193
|
+
"tags": [],
|
|
194
|
+
"text": ""
|
|
195
|
+
},
|
|
196
|
+
"attribute": "active",
|
|
197
|
+
"reflect": true
|
|
233
198
|
},
|
|
234
|
-
"
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
"
|
|
243
|
-
"
|
|
199
|
+
"open": {
|
|
200
|
+
"type": "boolean",
|
|
201
|
+
"mutable": true,
|
|
202
|
+
"complexType": {
|
|
203
|
+
"original": "boolean",
|
|
204
|
+
"resolved": "boolean",
|
|
205
|
+
"references": {}
|
|
206
|
+
},
|
|
207
|
+
"required": false,
|
|
208
|
+
"optional": false,
|
|
209
|
+
"docs": {
|
|
210
|
+
"tags": [],
|
|
211
|
+
"text": ""
|
|
212
|
+
},
|
|
213
|
+
"attribute": "open",
|
|
214
|
+
"reflect": true
|
|
244
215
|
},
|
|
245
|
-
"
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
"
|
|
249
|
-
|
|
216
|
+
"multiple": {
|
|
217
|
+
"type": "boolean",
|
|
218
|
+
"mutable": false,
|
|
219
|
+
"complexType": {
|
|
220
|
+
"original": "boolean",
|
|
221
|
+
"resolved": "boolean",
|
|
222
|
+
"references": {}
|
|
223
|
+
},
|
|
224
|
+
"required": false,
|
|
225
|
+
"optional": false,
|
|
226
|
+
"docs": {
|
|
227
|
+
"tags": [],
|
|
228
|
+
"text": ""
|
|
229
|
+
},
|
|
230
|
+
"attribute": "multiple",
|
|
231
|
+
"reflect": true
|
|
250
232
|
},
|
|
251
|
-
"
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
"
|
|
260
|
-
"
|
|
233
|
+
"maxLength": {
|
|
234
|
+
"type": "number",
|
|
235
|
+
"mutable": false,
|
|
236
|
+
"complexType": {
|
|
237
|
+
"original": "number",
|
|
238
|
+
"resolved": "number",
|
|
239
|
+
"references": {}
|
|
240
|
+
},
|
|
241
|
+
"required": false,
|
|
242
|
+
"optional": false,
|
|
243
|
+
"docs": {
|
|
244
|
+
"tags": [],
|
|
245
|
+
"text": ""
|
|
246
|
+
},
|
|
247
|
+
"attribute": "max-length",
|
|
248
|
+
"reflect": true
|
|
261
249
|
},
|
|
262
|
-
"
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
"
|
|
266
|
-
|
|
250
|
+
"label": {
|
|
251
|
+
"type": "string",
|
|
252
|
+
"mutable": false,
|
|
253
|
+
"complexType": {
|
|
254
|
+
"original": "string",
|
|
255
|
+
"resolved": "string",
|
|
256
|
+
"references": {}
|
|
257
|
+
},
|
|
258
|
+
"required": false,
|
|
259
|
+
"optional": false,
|
|
260
|
+
"docs": {
|
|
261
|
+
"tags": [],
|
|
262
|
+
"text": ""
|
|
263
|
+
},
|
|
264
|
+
"attribute": "label",
|
|
265
|
+
"reflect": true
|
|
267
266
|
},
|
|
268
|
-
"
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
"
|
|
277
|
-
"
|
|
267
|
+
"value": {
|
|
268
|
+
"type": "string",
|
|
269
|
+
"mutable": false,
|
|
270
|
+
"complexType": {
|
|
271
|
+
"original": "string",
|
|
272
|
+
"resolved": "string",
|
|
273
|
+
"references": {}
|
|
274
|
+
},
|
|
275
|
+
"required": false,
|
|
276
|
+
"optional": false,
|
|
277
|
+
"docs": {
|
|
278
|
+
"tags": [],
|
|
279
|
+
"text": ""
|
|
280
|
+
},
|
|
281
|
+
"attribute": "value",
|
|
282
|
+
"reflect": true
|
|
278
283
|
},
|
|
279
|
-
"
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
"
|
|
283
|
-
|
|
284
|
+
"theme": {
|
|
285
|
+
"type": "string",
|
|
286
|
+
"mutable": false,
|
|
287
|
+
"complexType": {
|
|
288
|
+
"original": "'primary' | 'secondary' | 'tertiary'",
|
|
289
|
+
"resolved": "\"primary\" | \"secondary\" | \"tertiary\"",
|
|
290
|
+
"references": {}
|
|
291
|
+
},
|
|
292
|
+
"required": false,
|
|
293
|
+
"optional": false,
|
|
294
|
+
"docs": {
|
|
295
|
+
"tags": [],
|
|
296
|
+
"text": ""
|
|
297
|
+
},
|
|
298
|
+
"attribute": "theme",
|
|
299
|
+
"reflect": true
|
|
284
300
|
},
|
|
285
|
-
"
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
"location": "import",
|
|
297
|
-
"path": "../q2-option-list"
|
|
301
|
+
"selectedOptions": {
|
|
302
|
+
"type": "unknown",
|
|
303
|
+
"mutable": true,
|
|
304
|
+
"complexType": {
|
|
305
|
+
"original": "IOptionValue[]",
|
|
306
|
+
"resolved": "IOptionValue[]",
|
|
307
|
+
"references": {
|
|
308
|
+
"IOptionValue": {
|
|
309
|
+
"location": "import",
|
|
310
|
+
"path": "../q2-option-list"
|
|
311
|
+
}
|
|
298
312
|
}
|
|
299
|
-
}
|
|
313
|
+
},
|
|
314
|
+
"required": false,
|
|
315
|
+
"optional": false,
|
|
316
|
+
"docs": {
|
|
317
|
+
"tags": [],
|
|
318
|
+
"text": ""
|
|
319
|
+
},
|
|
320
|
+
"defaultValue": "[]"
|
|
300
321
|
},
|
|
301
|
-
"
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
"
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
"composed": true,
|
|
319
|
-
"docs": {
|
|
320
|
-
"tags": [],
|
|
321
|
-
"text": ""
|
|
322
|
+
"popoverMinHeight": {
|
|
323
|
+
"type": "number",
|
|
324
|
+
"mutable": false,
|
|
325
|
+
"complexType": {
|
|
326
|
+
"original": "number",
|
|
327
|
+
"resolved": "number",
|
|
328
|
+
"references": {}
|
|
329
|
+
},
|
|
330
|
+
"required": false,
|
|
331
|
+
"optional": false,
|
|
332
|
+
"docs": {
|
|
333
|
+
"tags": [],
|
|
334
|
+
"text": ""
|
|
335
|
+
},
|
|
336
|
+
"attribute": "popover-min-height",
|
|
337
|
+
"reflect": false,
|
|
338
|
+
"defaultValue": "150"
|
|
322
339
|
},
|
|
323
|
-
"
|
|
324
|
-
"
|
|
325
|
-
"
|
|
326
|
-
"
|
|
327
|
-
"
|
|
328
|
-
|
|
329
|
-
|
|
340
|
+
"popoverDirection": {
|
|
341
|
+
"type": "string",
|
|
342
|
+
"mutable": false,
|
|
343
|
+
"complexType": {
|
|
344
|
+
"original": "'up' | 'down'",
|
|
345
|
+
"resolved": "\"down\" | \"up\"",
|
|
346
|
+
"references": {}
|
|
347
|
+
},
|
|
348
|
+
"required": false,
|
|
349
|
+
"optional": false,
|
|
350
|
+
"docs": {
|
|
351
|
+
"tags": [],
|
|
352
|
+
"text": ""
|
|
353
|
+
},
|
|
354
|
+
"attribute": "popover-direction",
|
|
355
|
+
"reflect": false
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
static get states() {
|
|
360
|
+
return {
|
|
361
|
+
"hasOptions": {}
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
static get events() {
|
|
365
|
+
return [{
|
|
366
|
+
"method": "change",
|
|
367
|
+
"name": "change",
|
|
368
|
+
"bubbles": true,
|
|
369
|
+
"cancelable": true,
|
|
370
|
+
"composed": true,
|
|
371
|
+
"docs": {
|
|
372
|
+
"tags": [],
|
|
373
|
+
"text": ""
|
|
374
|
+
},
|
|
375
|
+
"complexType": {
|
|
376
|
+
"original": "{ value: string; values: IOptionValue[]; active: boolean }",
|
|
377
|
+
"resolved": "{ value: string; values: IOptionValue[]; active: boolean; }",
|
|
378
|
+
"references": {
|
|
379
|
+
"IOptionValue": {
|
|
380
|
+
"location": "import",
|
|
381
|
+
"path": "../q2-option-list"
|
|
382
|
+
}
|
|
330
383
|
}
|
|
331
384
|
}
|
|
332
|
-
}
|
|
333
|
-
|
|
385
|
+
}];
|
|
386
|
+
}
|
|
334
387
|
static get elementRef() { return "hostElement"; }
|
|
335
|
-
static get listeners() {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
388
|
+
static get listeners() {
|
|
389
|
+
return [{
|
|
390
|
+
"name": "focus",
|
|
391
|
+
"method": "delegateFocus",
|
|
392
|
+
"target": undefined,
|
|
393
|
+
"capture": false,
|
|
394
|
+
"passive": false
|
|
395
|
+
}, {
|
|
396
|
+
"name": "popoverStateChanged",
|
|
397
|
+
"method": "popoverStateHandler",
|
|
398
|
+
"target": undefined,
|
|
399
|
+
"capture": false,
|
|
400
|
+
"passive": false
|
|
401
|
+
}];
|
|
402
|
+
}
|
|
348
403
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
*:focus {
|
|
10
10
|
outline: none;
|
|
11
|
-
box-shadow: var(--const-
|
|
11
|
+
box-shadow: var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
:host {
|
|
@@ -68,16 +68,21 @@ button {
|
|
|
68
68
|
:host {
|
|
69
69
|
display: inline-block;
|
|
70
70
|
position: relative;
|
|
71
|
+
line-height: 0;
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
:host(:not(:last-child)) {
|
|
74
75
|
margin-inline-end: var(--tct-pill-margin, var(--t-pill-margin, var(--app-scale-2x, 10px)));
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
q2-popover,
|
|
77
79
|
.btn-wrapper {
|
|
78
80
|
--comp-pill-min-height: var(--tct-pill-min-height, var(--t-pill-min-height, 44px));
|
|
79
|
-
--comp-pill-btn-border-width: var(--tct-pill-btn-border-width, var(--t-pill-btn-border-width, 2px));
|
|
80
81
|
--comp-pill-btn-height: var(--tct-pill-btn-height, var(--t-pill-btn-height, 30px));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.btn-wrapper {
|
|
85
|
+
--comp-pill-btn-border-width: var(--tct-pill-btn-border-width, var(--t-pill-btn-border-width, 2px));
|
|
81
86
|
--comp-close-size: 0px;
|
|
82
87
|
--comp-btn-background: var(--tct-pill-btn-background, var(--t-pill-btn-background, var(--t-base, #ffffff)));
|
|
83
88
|
--compt-hover-btn-background: var(--tct-pill-hover-btn-background, var(--t-pill-hover-btn-background, var(--t-gray-13, #e6e6e6)));
|
|
@@ -118,11 +123,6 @@ button {
|
|
|
118
123
|
--comp-hover-active-btn-border-color: var(--t-tertiary-l3, #eff8fd);
|
|
119
124
|
}
|
|
120
125
|
|
|
121
|
-
q2-option-list {
|
|
122
|
-
position: absolute;
|
|
123
|
-
left: 0;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
126
|
.btn-height-wrapper {
|
|
127
127
|
height: var(--comp-pill-min-height);
|
|
128
128
|
display: flex;
|
|
@@ -228,4 +228,9 @@ div.btn-close {
|
|
|
228
228
|
:host([active]) button.btn-close:focus, :host([active]) button.btn-close:hover {
|
|
229
229
|
background: var(--tct-pill-hover-close-btn-background, var(--t-pill-hover-close-btn-background, var(--t-top-a1, rgba(13, 13, 13, 0.35))));
|
|
230
230
|
border-color: var(--tct-pill-hover-close-btn-border-color, var(--t-pill-hover-close-btn-border-color, var(--t-top-a1, rgba(13, 13, 13, 0.35))));
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
q2-popover {
|
|
234
|
+
position: relative;
|
|
235
|
+
top: calc((var(--comp-pill-min-height) - var(--comp-pill-btn-height)) / 2 * -1);
|
|
231
236
|
}
|