q2-tecton-elements 1.23.0 → 1.25.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-dc92e71f.js} +32 -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 +46 -17
- package/dist/cjs/q2-btn_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +2 -4
- 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 -7
- 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-calendar/index.js +2 -4
- 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-input/index.js +46 -17
- 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 +3 -58
- 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 +33 -19
- package/dist/collection/utils/action-sheet.js +79 -0
- package/dist/collection/utils/index.js +29 -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 +629 -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 +46 -17
- 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 +2 -4
- 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 +25 -11
- package/dist/components/q2-textarea.js +1 -1
- package/dist/docs.d.ts +148 -0
- package/dist/docs.json +8755 -0
- package/dist/esm/action-sheet-a9597b32.js +81 -0
- package/dist/esm/{index-501fd22e.js → index-d4a87058.js} +30 -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 +46 -17
- package/dist/esm/q2-btn_2.entry.js +1 -1
- package/dist/esm/q2-calendar.entry.js +2 -4
- 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 +22 -8
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/q2-tecton-elements/p-059065e4.js +1 -0
- package/dist/q2-tecton-elements/{p-9b101e22.entry.js → p-1a744921.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-3fd5d010.entry.js → p-1b95e43f.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-3603fcdc.entry.js → p-1ea4b8bd.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-53be87c8.entry.js → p-1f3eb04c.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-25839309.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-38a33baa.entry.js → p-274ec152.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-6be86940.entry.js → p-2ba9e1a2.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-ebd7efa5.entry.js → p-2c309c54.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-3e9a30c4.entry.js → p-2cc70f49.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-604b22a8.entry.js → p-2ceb41c4.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-2e938b20.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-5b1aba1a.entry.js → p-306a4bc7.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-32f44993.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-d7b27803.entry.js → p-3a9aac19.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-3c73ce3f.entry.js +1 -0
- package/dist/q2-tecton-elements/p-4a95f78e.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-6b7e1ebd.entry.js → p-4b48a49d.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-4b92e44e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-5ecb9c27.entry.js +1 -0
- package/dist/q2-tecton-elements/p-6779270e.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-70b01387.entry.js → p-72fc58e7.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-7ac02ae5.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-78fac0fa.entry.js → p-7c168977.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-d27b2caa.entry.js → p-7c9bf80a.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-83d678c7.entry.js +1 -0
- package/dist/q2-tecton-elements/p-a1926e65.js +1 -0
- package/dist/q2-tecton-elements/{p-24f4571d.entry.js → p-a3a5b57b.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-a6296870.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-45d61789.entry.js → p-a64e7eb1.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-8dea9a0c.entry.js → p-ad83984e.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-bf41e71b.entry.js → p-bf0ed24a.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-a2add94e.entry.js → p-bff85959.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7aa80653.entry.js → p-c4a9ab25.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-ea5383ba.entry.js +1 -0
- 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-input/index.d.ts +5 -0
- package/dist/types/components/q2-option/index.d.ts +1 -4
- 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 -3
- package/dist/types/components.d.ts +44 -17
- 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 +4 -1
- package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -1
- package/package.json +4 -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-18629cbf.entry.js +0 -1
- 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-68ef0786.entry.js +0 -1
- package/dist/q2-tecton-elements/p-a510290a.js +0 -1
- package/dist/q2-tecton-elements/p-acc77332.entry.js +0 -1
- package/dist/q2-tecton-elements/p-ba73ee1f.entry.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-d68b5eb3.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d88e4383.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,383 +1,72 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement,
|
|
2
|
-
import {
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as createGuid, l as loc } from './index15.js';
|
|
3
3
|
|
|
4
|
-
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{
|
|
4
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block}.q2-optgroup-header{--comp-header-padding:var(--tct-scale-1, var(--app-scale-1x, 5px)) var(--tct-scale-2, var(--app-scale-2x, 10px));background:var(--tct-optgroup-header-bg, var(--t-optgroup-header-bg, var(--tct-gray-13, var(--t-gray-13, var(--tct-gray-l2, var(--app-gray-l2, #e6e6e6))))));padding:var(--tct-optgroup-header-padding, var(--t-optgroup-header-padding, var(--comp-header-padding)));font-weight:var(--tct-optgroup-header-font-weight, var(--t-optgroup-header-font-weight, 600));text-transform:var(--tct-optgroup-header-text-transform, var(--t-optgroup-header-text-transform, uppercase));position:sticky;top:calc(var(--comp-multi-select-header-height, 0px) + var(--tct-optgroup-top, var(--t-optgroup-top, 0px)));z-index:5}";
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const Q2Optgroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
8
8
|
super();
|
|
9
9
|
this.__registerHost();
|
|
10
10
|
this.__attachShadow();
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
|
|
14
|
-
/// Event Handlers ///
|
|
15
|
-
/* tslint:disable:cyclomatic-complexity */
|
|
16
|
-
this.keydownHandler = (event, ignoreSelectionEvents) => {
|
|
17
|
-
event.stopPropagation();
|
|
18
|
-
const { activeIndex, customSearch, allOptions } = this;
|
|
19
|
-
const { key, shiftKey } = event;
|
|
20
|
-
let newOption;
|
|
21
|
-
switch (key) {
|
|
22
|
-
case ' ':
|
|
23
|
-
case 'Enter':
|
|
24
|
-
if (ignoreSelectionEvents) {
|
|
25
|
-
this.setDefaultActiveElement();
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
event.preventDefault();
|
|
29
|
-
newOption = allOptions.find(element => element.active);
|
|
30
|
-
if (!newOption || newOption.disabled)
|
|
31
|
-
break;
|
|
32
|
-
this.selectOption(newOption.value);
|
|
33
|
-
break;
|
|
34
|
-
case 'ArrowUp':
|
|
35
|
-
event.preventDefault();
|
|
36
|
-
const isFirstOption = activeIndex === 0;
|
|
37
|
-
if (isFirstOption)
|
|
38
|
-
break;
|
|
39
|
-
if (activeIndex === undefined) {
|
|
40
|
-
this.setDefaultActiveElement();
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
const nextIndex = this.getNextVisibleIndex(-1);
|
|
44
|
-
if (nextIndex === -1)
|
|
45
|
-
break;
|
|
46
|
-
this.adjustActiveOptionAndScroll(nextIndex - activeIndex);
|
|
47
|
-
}
|
|
48
|
-
break;
|
|
49
|
-
case 'ArrowDown':
|
|
50
|
-
event.preventDefault();
|
|
51
|
-
const isLastOption = activeIndex === allOptions.length - 1;
|
|
52
|
-
if (isLastOption)
|
|
53
|
-
break;
|
|
54
|
-
if (activeIndex === undefined) {
|
|
55
|
-
this.setDefaultActiveElement();
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
const nextIndex = this.getNextVisibleIndex(1);
|
|
59
|
-
if (nextIndex === -1)
|
|
60
|
-
break;
|
|
61
|
-
this.adjustActiveOptionAndScroll(nextIndex - activeIndex);
|
|
62
|
-
}
|
|
63
|
-
break;
|
|
64
|
-
case 'Home':
|
|
65
|
-
event.preventDefault();
|
|
66
|
-
this.openDropdownWithActiveElement(0);
|
|
67
|
-
break;
|
|
68
|
-
case 'End':
|
|
69
|
-
event.preventDefault();
|
|
70
|
-
this.openDropdownWithActiveElement(allOptions.length - 1);
|
|
71
|
-
break;
|
|
72
|
-
case 'PageUp':
|
|
73
|
-
event.preventDefault();
|
|
74
|
-
this.openDropdownWithActiveElement(Math.max(activeIndex - 10, 0));
|
|
75
|
-
break;
|
|
76
|
-
case 'PageDown':
|
|
77
|
-
event.preventDefault();
|
|
78
|
-
this.openDropdownWithActiveElement(Math.min(activeIndex + 10, allOptions.length - 1));
|
|
79
|
-
break;
|
|
80
|
-
case 'Tab':
|
|
81
|
-
if (ignoreSelectionEvents)
|
|
82
|
-
break;
|
|
83
|
-
if (shiftKey)
|
|
84
|
-
break;
|
|
85
|
-
newOption = allOptions.find(element => element.active);
|
|
86
|
-
if (!newOption || newOption.disabled)
|
|
87
|
-
return;
|
|
88
|
-
this.selectOption(newOption.value);
|
|
89
|
-
break;
|
|
90
|
-
case 'Esc':
|
|
91
|
-
case 'Escape':
|
|
92
|
-
if (this.noSelect)
|
|
93
|
-
this.setActiveElement(null);
|
|
94
|
-
this.popoverState.emit({ open: false });
|
|
95
|
-
break;
|
|
96
|
-
default:
|
|
97
|
-
if (customSearch)
|
|
98
|
-
break;
|
|
99
|
-
if (!key.match(/^[A-Za-z0-9]$/))
|
|
100
|
-
break;
|
|
101
|
-
// search in non-searchable select: alpha-numeric only
|
|
102
|
-
this.searchAndFocus(key);
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
/* tslint:enable:cyclomatic-complexity */
|
|
107
|
-
this.focusoutHandler = (event) => {
|
|
108
|
-
const { relatedTarget } = event;
|
|
109
|
-
const isInDropdown = this.allOptions.includes(relatedTarget);
|
|
110
|
-
const isInLightDom = !isInDropdown && this.hostElement.contains(relatedTarget);
|
|
111
|
-
if (isInDropdown || isInLightDom) {
|
|
112
|
-
event.stopPropagation();
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
this.clickHandler = (event) => {
|
|
116
|
-
const target = event.target;
|
|
117
|
-
if (target.localName !== 'q2-option' || target.disabled) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
this.selectOption(target.value);
|
|
11
|
+
this.guid = createGuid();
|
|
12
|
+
this.setHidden = () => {
|
|
13
|
+
this.hidden = this.options.every(opt => opt.hidden || opt._multiSelectHidden);
|
|
121
14
|
};
|
|
122
|
-
this.
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
125
|
-
this.noSelect = undefined;
|
|
126
|
-
this.align = undefined;
|
|
127
|
-
this.selectedOptions = [];
|
|
128
|
-
this.multiple = undefined;
|
|
129
|
-
this.disabled = undefined;
|
|
130
|
-
this.type = undefined;
|
|
131
|
-
this.hasOptions = undefined;
|
|
15
|
+
this.disabled = false;
|
|
16
|
+
this.label = undefined;
|
|
17
|
+
this.hidden = false;
|
|
132
18
|
}
|
|
133
|
-
///
|
|
19
|
+
/// LIFECYCLE HOOKS ///
|
|
134
20
|
componentWillLoad() {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
this.
|
|
140
|
-
this.
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
this.
|
|
144
|
-
this.
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
allOptions.forEach(option => {
|
|
157
|
-
if (noSelect)
|
|
158
|
-
option.noSelect = true;
|
|
159
|
-
if (type)
|
|
160
|
-
option.role = optionRole;
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
getRootSlot(element) {
|
|
164
|
-
var _a;
|
|
165
|
-
const slot = element.querySelector('slot');
|
|
166
|
-
const assignedElements = (_a = slot === null || slot === void 0 ? void 0 : slot.assignedElements()) !== null && _a !== void 0 ? _a : Array.from(element.children);
|
|
167
|
-
const hasAnotherSlot = !!assignedElements.length && assignedElements[0].tagName === 'SLOT';
|
|
168
|
-
if (hasAnotherSlot) {
|
|
169
|
-
return this.getRootSlot(assignedElements[0]);
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
return assignedElements;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
scrollToActiveOption() {
|
|
176
|
-
const activeOption = this.allOptions[this.activeIndex];
|
|
177
|
-
activeOption === null || activeOption === void 0 ? void 0 : activeOption.scrollIntoView({ block: 'nearest' });
|
|
178
|
-
}
|
|
179
|
-
resizeIframe() {
|
|
180
|
-
var _a, _b;
|
|
181
|
-
return (_b = (_a = window.TectonElements) === null || _a === void 0 ? void 0 : _a.resizeIframe) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
182
|
-
}
|
|
183
|
-
openDropdownWithActiveElement(activeIndex) {
|
|
184
|
-
if (this.disabled)
|
|
185
|
-
return;
|
|
186
|
-
this.activeIndex = activeIndex;
|
|
187
|
-
this.popoverState.emit({ open: true });
|
|
188
|
-
this.setActiveOption();
|
|
189
|
-
this.setFocusedOption();
|
|
190
|
-
this.scheduledAfterRender.push(() => {
|
|
191
|
-
this.scrollToActiveOption();
|
|
192
|
-
this.resizeIframe();
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
getDefaultActiveIndex() {
|
|
196
|
-
const { allOptions } = this;
|
|
197
|
-
const firstSelected = allOptions.findIndex(element => element.selected);
|
|
198
|
-
if (firstSelected > -1)
|
|
199
|
-
return firstSelected;
|
|
200
|
-
const firstEnabled = allOptions.findIndex(element => !element.hidden);
|
|
201
|
-
if (firstEnabled > -1)
|
|
202
|
-
return firstEnabled;
|
|
203
|
-
return 0;
|
|
204
|
-
}
|
|
205
|
-
updateSingleOptionAttrs() {
|
|
206
|
-
var _a, _b;
|
|
207
|
-
const { allOptions, selectedOptions } = this;
|
|
208
|
-
const singleValue = (_b = (_a = selectedOptions[0]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : undefined;
|
|
209
|
-
allOptions.forEach(element => {
|
|
210
|
-
element.selected = element.value === singleValue;
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
updateMultipleOptionAttrs() {
|
|
214
|
-
const { allOptions, selectedOptions } = this;
|
|
215
|
-
const selectedValues = selectedOptions.map(option => option.value);
|
|
216
|
-
allOptions.forEach(element => {
|
|
217
|
-
element.selected = selectedValues.includes(element.value);
|
|
21
|
+
const observer = new MutationObserver(this.setHidden);
|
|
22
|
+
observer.observe(this.hostElement, { childList: true, attributes: true, subtree: true });
|
|
23
|
+
this.mutationObserver = observer;
|
|
24
|
+
// set initially
|
|
25
|
+
this.setHidden();
|
|
26
|
+
this.disabledWatcher(this.disabled);
|
|
27
|
+
}
|
|
28
|
+
disconnectedCallback() {
|
|
29
|
+
this.mutationObserver.disconnect();
|
|
30
|
+
this.mutationObserver = null;
|
|
31
|
+
}
|
|
32
|
+
get headerId() {
|
|
33
|
+
return `q2-optgroup-header-${this.guid}`;
|
|
34
|
+
}
|
|
35
|
+
get options() {
|
|
36
|
+
return Array.from(this.hostElement.querySelectorAll('q2-option'));
|
|
37
|
+
}
|
|
38
|
+
///// OBSERVERS ///////
|
|
39
|
+
disabledWatcher(disabled) {
|
|
40
|
+
this.options.forEach(opt => {
|
|
41
|
+
opt.disabledGroup = !!disabled;
|
|
218
42
|
});
|
|
219
43
|
}
|
|
220
|
-
setActiveOption() {
|
|
221
|
-
const activeIndex = this.activeIndex;
|
|
222
|
-
this.allOptions.forEach((element, elementIndex) => {
|
|
223
|
-
element.active = activeIndex === elementIndex;
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
setFocusedOption() {
|
|
227
|
-
const option = this.allOptions[this.activeIndex];
|
|
228
|
-
if (!option)
|
|
229
|
-
return;
|
|
230
|
-
setTimeout(() => {
|
|
231
|
-
option.focus();
|
|
232
|
-
}, 25);
|
|
233
|
-
}
|
|
234
|
-
getNextVisibleIndex(direction) {
|
|
235
|
-
let index = this.activeIndex + direction;
|
|
236
|
-
while (index >= 0 && index <= this.allOptions.length - 1) {
|
|
237
|
-
const { display, visibility } = window.getComputedStyle(this.allOptions[index]);
|
|
238
|
-
if (display !== 'none' && visibility !== 'hidden') {
|
|
239
|
-
return index;
|
|
240
|
-
}
|
|
241
|
-
index = index + direction;
|
|
242
|
-
}
|
|
243
|
-
return -1;
|
|
244
|
-
}
|
|
245
|
-
selectOption(selectedValue) {
|
|
246
|
-
const option = this.allOptions.find(({ value }) => value === selectedValue);
|
|
247
|
-
const valueObject = {
|
|
248
|
-
value: selectedValue,
|
|
249
|
-
display: option.display || option.innerText.trim(),
|
|
250
|
-
};
|
|
251
|
-
const { multiple, noSelect } = this;
|
|
252
|
-
let values;
|
|
253
|
-
if (multiple) {
|
|
254
|
-
const { selectedOptions = [] } = this;
|
|
255
|
-
const isAlreadySelected = !!selectedOptions.find(({ value }) => value === selectedValue);
|
|
256
|
-
if (isAlreadySelected) {
|
|
257
|
-
values = selectedOptions.filter(({ value }) => value !== selectedValue);
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
260
|
-
values = [...selectedOptions, valueObject];
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
else {
|
|
264
|
-
values = [valueObject];
|
|
265
|
-
}
|
|
266
|
-
if (noSelect)
|
|
267
|
-
this.setActiveElement(null);
|
|
268
|
-
else
|
|
269
|
-
this.selectedOptions = values;
|
|
270
|
-
this.change.emit({ value: selectedValue, values });
|
|
271
|
-
if (multiple)
|
|
272
|
-
return;
|
|
273
|
-
this.popoverState.emit({ open: false });
|
|
274
|
-
}
|
|
275
|
-
adjustActiveOptionAndScroll(numToAdd) {
|
|
276
|
-
this.activeIndex += numToAdd;
|
|
277
|
-
this.setActiveOption();
|
|
278
|
-
this.setFocusedOption();
|
|
279
|
-
this.scrollToActiveOption();
|
|
280
|
-
}
|
|
281
|
-
resetTimer() {
|
|
282
|
-
if (this.searchStringTimer) {
|
|
283
|
-
clearTimeout(this.searchStringTimer);
|
|
284
|
-
}
|
|
285
|
-
this.searchStringTimer = window.setTimeout(() => {
|
|
286
|
-
this.searchString = null;
|
|
287
|
-
}, 2000);
|
|
288
|
-
}
|
|
289
|
-
searchAndFocus(key) {
|
|
290
|
-
this.resetTimer();
|
|
291
|
-
let searchString = this.searchString ? `${this.searchString}${key}` : key;
|
|
292
|
-
searchString = searchString.replace(/[^0-9a-z]/gi, '');
|
|
293
|
-
this.searchString = searchString;
|
|
294
|
-
const searchRegEx = new RegExp(searchString, 'i');
|
|
295
|
-
const foundIndex = this.allOptions.findIndex(option => option.value === searchString || option.textContent.match(searchRegEx));
|
|
296
|
-
if (foundIndex === -1)
|
|
297
|
-
return;
|
|
298
|
-
this.setActiveElement(foundIndex);
|
|
299
|
-
}
|
|
300
|
-
/// Watchers ///
|
|
301
|
-
selectedOptionsUpdated() {
|
|
302
|
-
if (this.multiple) {
|
|
303
|
-
this.updateMultipleOptionAttrs();
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
this.updateSingleOptionAttrs();
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
/// Listeners ///
|
|
310
|
-
delegateFocus(event) {
|
|
311
|
-
if (!isEventFromElement(event, this.hostElement))
|
|
312
|
-
return;
|
|
313
|
-
this.popoverState.emit({ open: true });
|
|
314
|
-
this.setDefaultActiveElement();
|
|
315
|
-
}
|
|
316
|
-
handleClick(event) {
|
|
317
|
-
event.stopPropagation();
|
|
318
|
-
}
|
|
319
|
-
/// Public Methods ///
|
|
320
|
-
async setDefaultActiveElement() {
|
|
321
|
-
this.activeIndex = this.getDefaultActiveIndex();
|
|
322
|
-
this.setActiveOption();
|
|
323
|
-
this.setFocusedOption();
|
|
324
|
-
}
|
|
325
|
-
async setActiveElement(index) {
|
|
326
|
-
this.activeIndex = index;
|
|
327
|
-
this.setActiveOption();
|
|
328
|
-
this.setFocusedOption();
|
|
329
|
-
}
|
|
330
|
-
async handleExternalKeydown(event) {
|
|
331
|
-
const keysThatTriggerOpen = ['ArrowDown', 'ArrowUp', 'PageDown', 'PageUp', 'Home', 'End'];
|
|
332
|
-
if (keysThatTriggerOpen.includes(event.key)) {
|
|
333
|
-
this.popoverState.emit({ open: true });
|
|
334
|
-
}
|
|
335
|
-
const keysThatTriggerDefault = ['ArrowDown', 'ArrowUp'];
|
|
336
|
-
if (keysThatTriggerDefault.includes(event.key)) {
|
|
337
|
-
event.preventDefault();
|
|
338
|
-
this.setDefaultActiveElement();
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
this.keydownHandler(event, true);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
/// DOM ///
|
|
345
44
|
render() {
|
|
346
|
-
return (h(
|
|
45
|
+
return (h("div", { class: "q2-optgroup-container", hidden: this.hidden, "aria-labelledby": this.headerId, role: "group" }, h("div", { class: "q2-optgroup-header", id: this.headerId }, (this.label && loc(this.label)) || ''), h("div", { class: "q2-optgroup-options" }, h("slot", null))));
|
|
347
46
|
}
|
|
348
47
|
get hostElement() { return this; }
|
|
349
48
|
static get watchers() { return {
|
|
350
|
-
"
|
|
49
|
+
"disabled": ["disabledWatcher"]
|
|
351
50
|
}; }
|
|
352
51
|
static get style() { return stylesCss; }
|
|
353
|
-
}, [1, "q2-
|
|
354
|
-
"role": [513],
|
|
355
|
-
"direction": [513],
|
|
356
|
-
"customSearch": [516, "custom-search"],
|
|
357
|
-
"noSelect": [516, "no-select"],
|
|
358
|
-
"align": [513],
|
|
359
|
-
"selectedOptions": [1040],
|
|
360
|
-
"multiple": [516],
|
|
52
|
+
}, [1, "q2-optgroup", {
|
|
361
53
|
"disabled": [516],
|
|
362
|
-
"
|
|
363
|
-
"
|
|
364
|
-
|
|
365
|
-
"setActiveElement": [64],
|
|
366
|
-
"handleExternalKeydown": [64]
|
|
367
|
-
}, [[0, "focus", "delegateFocus"], [0, "click", "handleClick"]]]);
|
|
54
|
+
"label": [513],
|
|
55
|
+
"hidden": [32]
|
|
56
|
+
}]);
|
|
368
57
|
function defineCustomElement() {
|
|
369
58
|
if (typeof customElements === "undefined") {
|
|
370
59
|
return;
|
|
371
60
|
}
|
|
372
|
-
const components = ["q2-
|
|
61
|
+
const components = ["q2-optgroup"];
|
|
373
62
|
components.forEach(tagName => { switch (tagName) {
|
|
374
|
-
case "q2-
|
|
63
|
+
case "q2-optgroup":
|
|
375
64
|
if (!customElements.get(tagName)) {
|
|
376
|
-
customElements.define(tagName,
|
|
65
|
+
customElements.define(tagName, Q2Optgroup);
|
|
377
66
|
}
|
|
378
67
|
break;
|
|
379
68
|
} });
|
|
380
69
|
}
|
|
381
70
|
defineCustomElement();
|
|
382
71
|
|
|
383
|
-
export {
|
|
72
|
+
export { Q2Optgroup as Q, defineCustomElement as d };
|
|
@@ -1,127 +1,72 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement,
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$1 } from './index7.js';
|
|
2
3
|
|
|
3
|
-
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}
|
|
4
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{--comp-padding:0 var(--app-scale-2x, 10px);--comp-selected-icon-size:var(--tct-option-selected-icon-size, var(--t-option-selected-icon-size, var(--tct-scale-3, var(--app-scale-3x, 15px))));padding:var(--tct-option-padding, var(--t-option-padding, var(--comp-padding)));min-height:44px;align-items:center;cursor:pointer;grid-template-columns:var(--comp-selected-icon-size) 1fr;align-items:center;grid-template-areas:\"icon content\";gap:var(--tct-scale-1, var(--app-scale-1x, 5px))}:host(:focus),:host(:hover),:host([active]){position:relative;z-index:1}:host([multiline]){--comp-padding:var(--app-scale-2, 10px) var(--app-scale-2, 10px);--comp-selected-icon-size:var(--tct-option-selected-icon-size, var(--t-option-selected-icon-size, 26px))}:host([_no-select]){grid-template-columns:1fr;grid-template-areas:\"content\"}:host([aria-disabled]){cursor:not-allowed;opacity:var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4));pointer-events:none}:host([aria-hidden]){display:none}:host(:not([hidden]):not([aria-hidden])){display:grid}:host(:not([aria-disabled]):hover),:host([active]),:host(:focus){background-color:var(--tct-option-active-bg, var(--tct-gray-14, var(--t-gray-14, var(--tct-gray-l3, var(--app-gray-l3, #f2f2f2)))))}:host(:focus){border:1px solid #33b4ff}q2-icon{grid-area:icon;--tct-icon-size:var(--comp-selected-icon-size)}.content{display:block;grid-area:content}:host(:not([multiline])) .content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}";
|
|
4
5
|
|
|
5
|
-
const
|
|
6
|
+
const Q2Option = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
7
|
constructor() {
|
|
7
8
|
super();
|
|
8
9
|
this.__registerHost();
|
|
9
10
|
this.__attachShadow();
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
11
|
+
this.role = 'option';
|
|
12
|
+
this.display = undefined;
|
|
13
|
+
this.value = undefined;
|
|
14
|
+
this.disabled = undefined;
|
|
15
|
+
this.disabledGroup = undefined;
|
|
16
|
+
this.selected = undefined;
|
|
17
|
+
this.hidden = undefined;
|
|
18
|
+
this.multiline = undefined;
|
|
19
|
+
this.active = undefined;
|
|
20
|
+
this._multiSelectHidden = false;
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (this.open)
|
|
22
|
-
this.determinePopDirection();
|
|
22
|
+
componentWillLoad() {
|
|
23
|
+
this.handleDisplay();
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
-
if (this.
|
|
26
|
-
this.determinePopDirection();
|
|
27
|
-
}
|
|
28
|
-
/// Methods ///
|
|
29
|
-
async toggle() {
|
|
30
|
-
this.open = !this.open;
|
|
31
|
-
}
|
|
32
|
-
/// Watchers ///
|
|
33
|
-
openChanged(open) {
|
|
34
|
-
this.popoverStateChanged.emit({ open });
|
|
35
|
-
}
|
|
36
|
-
/// Listeners ///
|
|
37
|
-
popoverStateHandler(event) {
|
|
38
|
-
const { detail: { open }, } = event;
|
|
39
|
-
if (open === this.open)
|
|
25
|
+
handleDisplay() {
|
|
26
|
+
if (this.display || this.multiline)
|
|
40
27
|
return;
|
|
41
|
-
this.
|
|
42
|
-
event.stopPropagation();
|
|
43
|
-
}
|
|
44
|
-
/// Helpers ///
|
|
45
|
-
determinePopDirection() {
|
|
46
|
-
var _a, _b, _c, _d, _e;
|
|
47
|
-
const { containerElement, contentElement, direction, controlElement } = this;
|
|
48
|
-
if (containerElement)
|
|
49
|
-
containerElement.style.maxHeight = null;
|
|
50
|
-
if (direction) {
|
|
51
|
-
return (this.privateDirection = direction);
|
|
52
|
-
}
|
|
53
|
-
const contentHeight = contentElement.clientHeight;
|
|
54
|
-
const { top: topOffset, height } = (_a = controlElement === null || controlElement === void 0 ? void 0 : controlElement.getBoundingClientRect()) !== null && _a !== void 0 ? _a : {
|
|
55
|
-
top: 0,
|
|
56
|
-
height: 0,
|
|
57
|
-
};
|
|
58
|
-
const scrollY = ((_c = (_b = window.Tecton) === null || _b === void 0 ? void 0 : _b.platformDimensions) === null || _c === void 0 ? void 0 : _c.scrollY) || 0;
|
|
59
|
-
const innerHeight = ((_e = (_d = window.Tecton) === null || _d === void 0 ? void 0 : _d.platformDimensions) === null || _e === void 0 ? void 0 : _e.innerHeight) || window.innerHeight;
|
|
60
|
-
const bottomOffset = scrollY + innerHeight - topOffset - height;
|
|
61
|
-
const canShowFullSizeBelow = bottomOffset > contentHeight;
|
|
62
|
-
const canShowFullSizeAbove = contentHeight <= topOffset;
|
|
63
|
-
// Prefer full size above or below
|
|
64
|
-
if (canShowFullSizeBelow) {
|
|
65
|
-
return (this.privateDirection = 'down');
|
|
66
|
-
}
|
|
67
|
-
else if (canShowFullSizeAbove || !this.minHeight) {
|
|
68
|
-
this.determinePopOffset();
|
|
69
|
-
return (this.privateDirection = 'up');
|
|
70
|
-
}
|
|
71
|
-
// If full size will not fit and minHeight is set, then make as tall as possible
|
|
72
|
-
const { minHeight = 150 } = this;
|
|
73
|
-
const displayBuffer = 5;
|
|
74
|
-
const canShowSmallBelow = bottomOffset >= minHeight + displayBuffer;
|
|
75
|
-
if (canShowSmallBelow) {
|
|
76
|
-
const maxBelowHeight = Math.max(bottomOffset - displayBuffer, minHeight);
|
|
77
|
-
containerElement.style.setProperty('--comp-pop-max-height', `${maxBelowHeight}px`);
|
|
78
|
-
return (this.privateDirection = 'down');
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
const maxAboveHeight = Math.max(topOffset, minHeight);
|
|
82
|
-
containerElement.style.setProperty('--comp-pop-max-height', `${maxAboveHeight}px`);
|
|
83
|
-
this.determinePopOffset();
|
|
84
|
-
return (this.privateDirection = 'up');
|
|
85
|
-
}
|
|
28
|
+
this.display = this.hostElement.textContent.trim();
|
|
86
29
|
}
|
|
87
|
-
determinePopOffset() {
|
|
88
|
-
var _a;
|
|
89
|
-
const { controlElement, containerElement } = this;
|
|
90
|
-
const dropdownHeight = (_a = controlElement === null || controlElement === void 0 ? void 0 : controlElement.getBoundingClientRect().height) !== null && _a !== void 0 ? _a : 0;
|
|
91
|
-
containerElement.style.setProperty('--comp-pop-offset', `${dropdownHeight}px`);
|
|
92
|
-
}
|
|
93
|
-
/// DOM ///
|
|
94
30
|
render() {
|
|
95
|
-
const
|
|
96
|
-
|
|
31
|
+
const { disabled, disabledGroup, selected, _multiSelectHidden } = this;
|
|
32
|
+
const isDisabled = disabled || disabledGroup;
|
|
33
|
+
return (h(Host, { tabindex: "-1", "aria-disabled": isDisabled ? 'true' : undefined, "aria-selected": selected ? 'true' : undefined, "aria-hidden": _multiSelectHidden ? 'true' : undefined }, this.selected && h("q2-icon", { type: "checkmark" }), h("div", { class: "content" }, h("slot", null))));
|
|
97
34
|
}
|
|
98
35
|
get hostElement() { return this; }
|
|
99
36
|
static get watchers() { return {
|
|
100
|
-
"
|
|
37
|
+
"display": ["handleDisplay"]
|
|
101
38
|
}; }
|
|
102
39
|
static get style() { return stylesCss; }
|
|
103
|
-
}, [1, "q2-
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
|
|
40
|
+
}, [1, "q2-option", {
|
|
41
|
+
"role": [513],
|
|
42
|
+
"display": [1025],
|
|
43
|
+
"value": [513],
|
|
44
|
+
"disabled": [516],
|
|
45
|
+
"disabledGroup": [516, "disabled-group"],
|
|
46
|
+
"selected": [516],
|
|
47
|
+
"hidden": [516],
|
|
48
|
+
"multiline": [516],
|
|
49
|
+
"active": [516],
|
|
50
|
+
"_multiSelectHidden": [516, "_multiselecthidden"]
|
|
51
|
+
}]);
|
|
112
52
|
function defineCustomElement() {
|
|
113
53
|
if (typeof customElements === "undefined") {
|
|
114
54
|
return;
|
|
115
55
|
}
|
|
116
|
-
const components = ["q2-
|
|
56
|
+
const components = ["q2-option", "q2-icon"];
|
|
117
57
|
components.forEach(tagName => { switch (tagName) {
|
|
118
|
-
case "q2-
|
|
58
|
+
case "q2-option":
|
|
59
|
+
if (!customElements.get(tagName)) {
|
|
60
|
+
customElements.define(tagName, Q2Option);
|
|
61
|
+
}
|
|
62
|
+
break;
|
|
63
|
+
case "q2-icon":
|
|
119
64
|
if (!customElements.get(tagName)) {
|
|
120
|
-
|
|
65
|
+
defineCustomElement$1();
|
|
121
66
|
}
|
|
122
67
|
break;
|
|
123
68
|
} });
|
|
124
69
|
}
|
|
125
70
|
defineCustomElement();
|
|
126
71
|
|
|
127
|
-
export {
|
|
72
|
+
export { Q2Option as Q, defineCustomElement as d };
|