q2-tecton-elements 1.23.0-alpha.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/charting-d02cba1f.js +3127 -0
- package/dist/cjs/{index-3518c78c.js → index-e00b4210.js} +33 -7
- package/dist/cjs/{installCanvasRenderer-b4d10c92.js → installCanvasRenderer-6c4fbcc9.js} +230 -1130
- package/dist/cjs/installLabelLayout-d6b548fe.js +1048 -0
- 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 +2 -2
- package/dist/cjs/q2-calendar.cjs.entry.js +1 -1
- package/dist/cjs/q2-card.cjs.entry.js +2 -2
- 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 +4569 -0
- package/dist/cjs/q2-chart-bar.cjs.entry.js +25 -3133
- package/dist/cjs/q2-chart-donut.cjs.entry.js +9 -8
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox.cjs.entry.js +2 -2
- 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-loading-element.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 +230 -88
- 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 +149 -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 +2 -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-card/index.js +1 -1
- package/dist/collection/components/q2-chart-area/index.js +622 -0
- package/dist/collection/components/q2-chart-area/styles.css +82 -0
- package/dist/collection/components/q2-chart-bar/index.js +4 -4
- package/dist/collection/components/q2-chart-bar/styles.css +3 -6
- package/dist/collection/components/q2-chart-donut/index.js +1 -1
- package/dist/collection/components/q2-checkbox/index.js +2 -2
- package/dist/collection/components/q2-checkbox/styles.css +1 -0
- 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-loading/skeleton/q2-loading-element/styles.css +4 -0
- package/dist/collection/components/q2-loading/styles.css +4 -0
- 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 +21 -5
- 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 +197 -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 +31 -7
- package/dist/components/action-sheet.js +81 -0
- package/dist/components/charting.js +3113 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index10.js +1 -1
- package/dist/components/index11.js +42 -353
- package/dist/components/index12.js +44 -97
- package/dist/components/index13.js +495 -580
- 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 +3 -3
- package/dist/components/installCanvasRenderer.js +188 -1123
- package/dist/components/installLabelLayout.js +1042 -0
- 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 +2 -2
- package/dist/components/q2-carousel-pane.js +1 -1
- package/dist/components/q2-carousel.js +1 -1
- package/dist/components/q2-chart-area.d.ts +11 -0
- package/dist/components/q2-chart-area.js +4604 -0
- package/dist/components/q2-chart-bar.js +11 -3119
- package/dist/components/q2-chart-donut.js +4 -3
- package/dist/components/q2-checkbox-group.js +1 -1
- package/dist/components/q2-checkbox.js +2 -2
- package/dist/components/q2-dropdown.js +2 -2
- package/dist/components/q2-editable-field.js +1 -1
- package/dist/components/q2-loading-element.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 +181 -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/charting-2a73ba8e.js +3113 -0
- package/dist/esm/{index-9c591682.js → index-ca21e539.js} +32 -8
- package/dist/esm/{installCanvasRenderer-0143b52d.js → installCanvasRenderer-4a470516.js} +188 -1123
- package/dist/esm/installLabelLayout-d660eaad.js +1042 -0
- 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 +2 -2
- package/dist/esm/q2-calendar.entry.js +1 -1
- package/dist/esm/q2-card.entry.js +2 -2
- 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 +4565 -0
- package/dist/esm/q2-chart-bar.entry.js +11 -3119
- package/dist/esm/q2-chart-donut.entry.js +4 -3
- package/dist/esm/q2-checkbox-group.entry.js +1 -1
- package/dist/esm/q2-checkbox.entry.js +2 -2
- 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-loading-element.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 +230 -88
- 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 +149 -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-db873db2.entry.js → p-0473f4f7.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-520c40f6.entry.js → p-13a1390b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9ebb283a.entry.js → p-13deb3ed.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-0ba564b1.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-18cc4758.entry.js → p-256d3fe6.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9281adaa.entry.js → p-282f0f8c.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-2d2c5af2.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-fc134a5d.entry.js → p-37cf9c97.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-fb37e67e.entry.js → p-388349b5.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-458b1987.js +1 -0
- package/dist/q2-tecton-elements/p-52063431.js +39 -0
- package/dist/q2-tecton-elements/p-5589ae0f.entry.js +1 -0
- package/dist/q2-tecton-elements/p-619aed74.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-4625184b.entry.js → p-63b67260.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-e4dc9ac0.entry.js → p-63e363ad.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-cbd1289a.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-c4640b55.entry.js → p-75b817c6.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-c3f27fe2.entry.js → p-7a116095.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-7c94119b.entry.js +1 -0
- package/dist/q2-tecton-elements/p-833398d1.js +1 -0
- package/dist/q2-tecton-elements/{p-ce015552.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-9792de8a.entry.js +1 -0
- 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-ffb48ccc.entry.js → p-b3a8cdc5.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-ce3f203c.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-041b3a82.entry.js → p-ce91cd9b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-b8b00394.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-dc7c8371.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-16c11d74.entry.js → p-e58581fc.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-f800fd1e.entry.js → p-e886c55b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-6e6b5b80.entry.js → p-f0ec4d2c.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-97aa8423.entry.js → p-f94e7043.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-c444a60b.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-card/index.d.ts +1 -1
- package/dist/types/components/q2-chart-area/index.d.ts +40 -0
- package/dist/types/components/q2-chart-bar/index.d.ts +2 -2
- package/dist/types/components/q2-chart-donut/index.d.ts +1 -1
- 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 +46 -47
- package/dist/types/components/q2-tag/index.d.ts +3 -2
- package/dist/types/components.d.ts +100 -13
- package/dist/types/global.d.ts +10 -1
- package/dist/types/utils/action-sheet.d.ts +12 -0
- package/dist/types/utils/index.d.ts +3 -1
- package/dist/types/workspace/workspace/{_production_release_1.22.x-alpha → 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-0d8dd75a.entry.js +0 -1
- package/dist/q2-tecton-elements/p-0fad9c5a.entry.js +0 -1
- package/dist/q2-tecton-elements/p-1f85cced.js +0 -39
- package/dist/q2-tecton-elements/p-2c9b1308.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5e374fbd.js +0 -1
- package/dist/q2-tecton-elements/p-6b52a262.entry.js +0 -1
- package/dist/q2-tecton-elements/p-aaf42539.entry.js +0 -1
- package/dist/q2-tecton-elements/p-cf41970f.entry.js +0 -1
- package/dist/q2-tecton-elements/p-de164483.entry.js +0 -1
- package/dist/q2-tecton-elements/p-e6d26f39.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f1d06917.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f35bf6a3.entry.js +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-734296a7.js');
|
|
6
|
-
const index$1 = require('./index-
|
|
6
|
+
const index$1 = require('./index-e00b4210.js');
|
|
7
7
|
|
|
8
8
|
const stylesCss$1 = "*{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{position:relative;width:100%;display:block;line-height:var(--tct-option-list-line-height, var(--t-option-list-line-height, var(--app-line-height, 1.428571429em)))}.content{text-align:start}:host([is-sizeable]) .content{display:block;height:auto}";
|
|
9
9
|
|
|
@@ -12,57 +12,136 @@ const Q2OptionList = class {
|
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
13
|
this.change = index.createEvent(this, "change", 7);
|
|
14
14
|
this.popoverState = index.createEvent(this, "popoverState", 7);
|
|
15
|
+
this.ready = index.createEvent(this, "ready", 3);
|
|
15
16
|
this.scheduledAfterRender = [];
|
|
16
17
|
/// Event Handlers ///
|
|
17
18
|
/* tslint:disable:cyclomatic-complexity */
|
|
18
|
-
this.
|
|
19
|
+
this.externalKeydownHandler = (event) => {
|
|
20
|
+
event.stopPropagation();
|
|
21
|
+
const { activeIndex, customSearch, allOptions } = this;
|
|
22
|
+
const { key } = event;
|
|
23
|
+
let nextIndex;
|
|
24
|
+
switch (key) {
|
|
25
|
+
case ' ':
|
|
26
|
+
if (this.searchString) {
|
|
27
|
+
if (customSearch)
|
|
28
|
+
break;
|
|
29
|
+
this.searchOptions(key, true);
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
this.setDefaultActiveElement();
|
|
33
|
+
break;
|
|
34
|
+
case 'Enter':
|
|
35
|
+
this.setDefaultActiveElement();
|
|
36
|
+
break;
|
|
37
|
+
case 'ArrowUp':
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
this.activeIndex = 0;
|
|
40
|
+
nextIndex = !!this.selectedOptions.length ? this.getDefaultActiveIndex() : this.getNextVisibleIndex(-1);
|
|
41
|
+
if (nextIndex === -1)
|
|
42
|
+
break;
|
|
43
|
+
this.openDropdownWithActiveElement(nextIndex);
|
|
44
|
+
break;
|
|
45
|
+
case 'ArrowDown':
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
this.activeIndex = 0;
|
|
48
|
+
nextIndex = !!this.selectedOptions.length ? this.getDefaultActiveIndex() : this.getNextVisibleIndex(0);
|
|
49
|
+
if (nextIndex === -1)
|
|
50
|
+
break;
|
|
51
|
+
this.openDropdownWithActiveElement(nextIndex);
|
|
52
|
+
break;
|
|
53
|
+
case 'Home':
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
this.openDropdownWithActiveElement(0);
|
|
56
|
+
break;
|
|
57
|
+
case 'End':
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
this.openDropdownWithActiveElement(allOptions.length - 1);
|
|
60
|
+
break;
|
|
61
|
+
case 'PageUp':
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
this.openDropdownWithActiveElement(Math.max((activeIndex || 0) - 10, 0));
|
|
64
|
+
break;
|
|
65
|
+
case 'PageDown':
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
this.openDropdownWithActiveElement(Math.min((activeIndex || 0) + 10, allOptions.length - 1));
|
|
68
|
+
break;
|
|
69
|
+
case 'Tab':
|
|
70
|
+
this.popoverState.emit({ open: false, action: 'close' });
|
|
71
|
+
break;
|
|
72
|
+
case 'Esc':
|
|
73
|
+
case 'Escape':
|
|
74
|
+
if (this.noSelect)
|
|
75
|
+
this.setActiveElement(null);
|
|
76
|
+
this.popoverState.emit({ open: false, action: 'close' });
|
|
77
|
+
break;
|
|
78
|
+
default:
|
|
79
|
+
if (customSearch)
|
|
80
|
+
break;
|
|
81
|
+
if (!key.match(/^[\w]$/))
|
|
82
|
+
break;
|
|
83
|
+
this.searchOptions(key, true);
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
this.internalKeydownHandler = (event) => {
|
|
19
88
|
event.stopPropagation();
|
|
20
89
|
const { activeIndex, customSearch, allOptions } = this;
|
|
21
90
|
const { key, shiftKey } = event;
|
|
22
91
|
let newOption;
|
|
23
92
|
switch (key) {
|
|
24
93
|
case ' ':
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
94
|
+
if (this.searchString) {
|
|
95
|
+
if (customSearch)
|
|
96
|
+
break;
|
|
97
|
+
this.searchOptions(key, false);
|
|
28
98
|
break;
|
|
29
99
|
}
|
|
30
100
|
event.preventDefault();
|
|
31
101
|
newOption = allOptions.find(element => element.active);
|
|
32
102
|
if (!newOption || newOption.disabled)
|
|
33
103
|
break;
|
|
34
|
-
this.selectOption(newOption
|
|
104
|
+
this.selectOption(newOption);
|
|
105
|
+
break;
|
|
106
|
+
case 'Enter':
|
|
107
|
+
event.preventDefault();
|
|
108
|
+
newOption = allOptions.find(element => element.active);
|
|
109
|
+
if (!newOption || newOption.disabled)
|
|
110
|
+
break;
|
|
111
|
+
this.selectOption(newOption);
|
|
35
112
|
break;
|
|
36
113
|
case 'ArrowUp':
|
|
37
114
|
event.preventDefault();
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
115
|
+
const isFirstOptionActive = activeIndex === 0;
|
|
116
|
+
if (isFirstOptionActive)
|
|
40
117
|
break;
|
|
41
118
|
if (activeIndex === undefined) {
|
|
42
119
|
this.setDefaultActiveElement();
|
|
120
|
+
break;
|
|
43
121
|
}
|
|
44
122
|
else {
|
|
45
123
|
const nextIndex = this.getNextVisibleIndex(-1);
|
|
46
124
|
if (nextIndex === -1)
|
|
47
125
|
break;
|
|
48
126
|
this.adjustActiveOptionAndScroll(nextIndex - activeIndex);
|
|
127
|
+
break;
|
|
49
128
|
}
|
|
50
|
-
break;
|
|
51
129
|
case 'ArrowDown':
|
|
52
130
|
event.preventDefault();
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
131
|
+
const isLastOptionActive = activeIndex === allOptions.length - 1;
|
|
132
|
+
if (isLastOptionActive)
|
|
55
133
|
break;
|
|
56
134
|
if (activeIndex === undefined) {
|
|
57
135
|
this.setDefaultActiveElement();
|
|
136
|
+
break;
|
|
58
137
|
}
|
|
59
138
|
else {
|
|
60
139
|
const nextIndex = this.getNextVisibleIndex(1);
|
|
61
140
|
if (nextIndex === -1)
|
|
62
141
|
break;
|
|
63
142
|
this.adjustActiveOptionAndScroll(nextIndex - activeIndex);
|
|
143
|
+
break;
|
|
64
144
|
}
|
|
65
|
-
break;
|
|
66
145
|
case 'Home':
|
|
67
146
|
event.preventDefault();
|
|
68
147
|
this.openDropdownWithActiveElement(0);
|
|
@@ -80,28 +159,25 @@ const Q2OptionList = class {
|
|
|
80
159
|
this.openDropdownWithActiveElement(Math.min(activeIndex + 10, allOptions.length - 1));
|
|
81
160
|
break;
|
|
82
161
|
case 'Tab':
|
|
83
|
-
if (ignoreSelectionEvents)
|
|
84
|
-
break;
|
|
85
162
|
if (shiftKey)
|
|
86
163
|
break;
|
|
87
164
|
newOption = allOptions.find(element => element.active);
|
|
88
165
|
if (!newOption || newOption.disabled)
|
|
89
166
|
return;
|
|
90
|
-
this.selectOption(newOption
|
|
167
|
+
this.selectOption(newOption);
|
|
91
168
|
break;
|
|
92
169
|
case 'Esc':
|
|
93
170
|
case 'Escape':
|
|
94
171
|
if (this.noSelect)
|
|
95
172
|
this.setActiveElement(null);
|
|
96
|
-
this.popoverState.emit({ open: false });
|
|
173
|
+
this.popoverState.emit({ open: false, action: 'close' });
|
|
97
174
|
break;
|
|
98
175
|
default:
|
|
99
176
|
if (customSearch)
|
|
100
177
|
break;
|
|
101
|
-
if (!key.match(/^[
|
|
178
|
+
if (!key.match(/^[\w]$/))
|
|
102
179
|
break;
|
|
103
|
-
|
|
104
|
-
this.searchAndFocus(key);
|
|
180
|
+
this.searchOptions(key, false);
|
|
105
181
|
break;
|
|
106
182
|
}
|
|
107
183
|
};
|
|
@@ -116,19 +192,17 @@ const Q2OptionList = class {
|
|
|
116
192
|
};
|
|
117
193
|
this.clickHandler = (event) => {
|
|
118
194
|
const target = event.target;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
this.selectOption(target.value);
|
|
195
|
+
const option = target.closest('q2-option');
|
|
196
|
+
this.selectOption(option);
|
|
123
197
|
};
|
|
124
198
|
this.role = 'listbox';
|
|
125
|
-
this.direction = 'down';
|
|
126
199
|
this.customSearch = undefined;
|
|
127
200
|
this.noSelect = undefined;
|
|
128
201
|
this.align = undefined;
|
|
129
202
|
this.selectedOptions = [];
|
|
130
203
|
this.multiple = undefined;
|
|
131
204
|
this.disabled = undefined;
|
|
205
|
+
this.showSelected = undefined;
|
|
132
206
|
this.type = undefined;
|
|
133
207
|
this.hasOptions = undefined;
|
|
134
208
|
}
|
|
@@ -140,26 +214,47 @@ const Q2OptionList = class {
|
|
|
140
214
|
index$1.overrideFocus(this.hostElement);
|
|
141
215
|
this.checkOptions();
|
|
142
216
|
this.selectedOptionsUpdated();
|
|
217
|
+
this.ready.emit();
|
|
143
218
|
}
|
|
144
219
|
componentDidRender() {
|
|
145
220
|
this.scheduledAfterRender.forEach(fn => fn());
|
|
146
221
|
this.scheduledAfterRender = [];
|
|
147
222
|
}
|
|
148
223
|
/// Getters ///
|
|
224
|
+
get allContents() {
|
|
225
|
+
const rootSlot = this.getRootSlot(this.hostElement);
|
|
226
|
+
const acceptedTags = ['Q2-OPTGROUP', 'Q2-OPTION'];
|
|
227
|
+
return rootSlot.filter(element => acceptedTags.includes(element.tagName));
|
|
228
|
+
}
|
|
149
229
|
get allOptions() {
|
|
150
|
-
|
|
230
|
+
const contents = this.allContents;
|
|
231
|
+
const extractOptions = (elements) => {
|
|
232
|
+
return elements.reduce((acc, element) => {
|
|
233
|
+
if (element.tagName === 'Q2-OPTGROUP') {
|
|
234
|
+
return [...acc, ...extractOptions(Array.from(element.children))];
|
|
235
|
+
}
|
|
236
|
+
else if (element.tagName === 'Q2-OPTION') {
|
|
237
|
+
return [...acc, element];
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
return acc;
|
|
241
|
+
}
|
|
242
|
+
}, []);
|
|
243
|
+
};
|
|
244
|
+
return extractOptions(contents);
|
|
245
|
+
}
|
|
246
|
+
get allVisibleOptions() {
|
|
247
|
+
return this.allOptions.filter(option => !option.hidden && !option._multiSelectHidden && !option.disabled && !option.disabledGroup);
|
|
151
248
|
}
|
|
152
249
|
/// Helpers ///
|
|
153
|
-
checkOptions() {
|
|
154
|
-
const {
|
|
155
|
-
|
|
250
|
+
async checkOptions() {
|
|
251
|
+
const { type } = this;
|
|
252
|
+
const options = await this.getOptions();
|
|
253
|
+
if (!type)
|
|
156
254
|
return;
|
|
157
255
|
const optionRole = type === 'menu' ? 'menuitem' : 'option';
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
option.noSelect = true;
|
|
161
|
-
if (type)
|
|
162
|
-
option.role = optionRole;
|
|
256
|
+
options.forEach(option => {
|
|
257
|
+
option.role = optionRole;
|
|
163
258
|
});
|
|
164
259
|
}
|
|
165
260
|
getRootSlot(element) {
|
|
@@ -178,20 +273,15 @@ const Q2OptionList = class {
|
|
|
178
273
|
const activeOption = this.allOptions[this.activeIndex];
|
|
179
274
|
activeOption === null || activeOption === void 0 ? void 0 : activeOption.scrollIntoView({ block: 'nearest' });
|
|
180
275
|
}
|
|
181
|
-
resizeIframe() {
|
|
182
|
-
var _a, _b;
|
|
183
|
-
return (_b = (_a = window.TectonElements) === null || _a === void 0 ? void 0 : _a.resizeIframe) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
184
|
-
}
|
|
185
276
|
openDropdownWithActiveElement(activeIndex) {
|
|
186
277
|
if (this.disabled)
|
|
187
278
|
return;
|
|
188
279
|
this.activeIndex = activeIndex;
|
|
189
|
-
this.popoverState.emit({ open: true });
|
|
280
|
+
this.popoverState.emit({ open: true, action: 'open' });
|
|
190
281
|
this.setActiveOption();
|
|
191
282
|
this.setFocusedOption();
|
|
192
|
-
|
|
283
|
+
index$1.nextPaint(() => {
|
|
193
284
|
this.scrollToActiveOption();
|
|
194
|
-
this.resizeIframe();
|
|
195
285
|
});
|
|
196
286
|
}
|
|
197
287
|
getDefaultActiveIndex() {
|
|
@@ -205,16 +295,16 @@ const Q2OptionList = class {
|
|
|
205
295
|
return 0;
|
|
206
296
|
}
|
|
207
297
|
updateSingleOptionAttrs() {
|
|
208
|
-
var _a
|
|
298
|
+
var _a;
|
|
209
299
|
const { allOptions, selectedOptions } = this;
|
|
210
|
-
const
|
|
300
|
+
const selectedValue = ((_a = selectedOptions[0]) === null || _a === void 0 ? void 0 : _a.value) || undefined;
|
|
211
301
|
allOptions.forEach(element => {
|
|
212
|
-
element.selected = element.value ===
|
|
302
|
+
element.selected = element.value === selectedValue;
|
|
213
303
|
});
|
|
214
304
|
}
|
|
215
305
|
updateMultipleOptionAttrs() {
|
|
216
306
|
const { allOptions, selectedOptions } = this;
|
|
217
|
-
const selectedValues = selectedOptions.map(
|
|
307
|
+
const selectedValues = selectedOptions.map(({ value }) => value);
|
|
218
308
|
allOptions.forEach(element => {
|
|
219
309
|
element.selected = selectedValues.includes(element.value);
|
|
220
310
|
});
|
|
@@ -229,38 +319,66 @@ const Q2OptionList = class {
|
|
|
229
319
|
const option = this.allOptions[this.activeIndex];
|
|
230
320
|
if (!option)
|
|
231
321
|
return;
|
|
232
|
-
|
|
322
|
+
const isHostElementVisible = !!this.hostElement.offsetParent;
|
|
323
|
+
if (isHostElementVisible)
|
|
233
324
|
option.focus();
|
|
234
|
-
|
|
325
|
+
else
|
|
326
|
+
index$1.nextPaint(() => option.focus());
|
|
235
327
|
}
|
|
236
328
|
getNextVisibleIndex(direction) {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
index = index + direction;
|
|
329
|
+
const { allVisibleOptions, allOptions, activeIndex } = this;
|
|
330
|
+
const activeOption = allOptions[activeIndex];
|
|
331
|
+
const visibleActiveOptionIndex = allVisibleOptions.indexOf(activeOption);
|
|
332
|
+
let nextVisibleOptionIndex = visibleActiveOptionIndex + direction;
|
|
333
|
+
if (nextVisibleOptionIndex < 0) {
|
|
334
|
+
nextVisibleOptionIndex = allVisibleOptions.length - 1;
|
|
244
335
|
}
|
|
245
|
-
|
|
336
|
+
else if (nextVisibleOptionIndex > allVisibleOptions.length - 1) {
|
|
337
|
+
nextVisibleOptionIndex = 0;
|
|
338
|
+
}
|
|
339
|
+
const nextVisibleOption = allVisibleOptions[nextVisibleOptionIndex];
|
|
340
|
+
return allOptions.indexOf(nextVisibleOption);
|
|
341
|
+
}
|
|
342
|
+
focusSelectedSibling(option) {
|
|
343
|
+
const { allVisibleOptions, allOptions } = this;
|
|
344
|
+
const hasNoSiblings = allVisibleOptions.length < 2;
|
|
345
|
+
if (hasNoSiblings) {
|
|
346
|
+
this.showSelected = false;
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
const selectedOptionVisibleIndex = allVisibleOptions.indexOf(option);
|
|
350
|
+
const nextVisibleSiblingIndex = selectedOptionVisibleIndex
|
|
351
|
+
? selectedOptionVisibleIndex - 1
|
|
352
|
+
: selectedOptionVisibleIndex + 1;
|
|
353
|
+
const nextVisibleSibling = allVisibleOptions[nextVisibleSiblingIndex];
|
|
354
|
+
const nextSiblingIndex = allOptions.indexOf(nextVisibleSibling);
|
|
355
|
+
this.activeIndex = nextSiblingIndex;
|
|
356
|
+
this.setFocusedOption();
|
|
357
|
+
this.scheduledAfterRender.push(() => {
|
|
358
|
+
option._multiSelectHidden = !option.selected;
|
|
359
|
+
});
|
|
246
360
|
}
|
|
247
|
-
selectOption(
|
|
248
|
-
const
|
|
361
|
+
selectOption(selectedOption) {
|
|
362
|
+
const { multiple, noSelect, showSelected } = this;
|
|
363
|
+
if (!selectedOption || selectedOption.disabled || selectedOption.disabledGroup)
|
|
364
|
+
return;
|
|
365
|
+
const selectedValue = selectedOption.value;
|
|
249
366
|
const valueObject = {
|
|
250
367
|
value: selectedValue,
|
|
251
|
-
display:
|
|
368
|
+
display: selectedOption.display || selectedOption.innerText.trim(),
|
|
252
369
|
};
|
|
253
|
-
|
|
254
|
-
let values;
|
|
370
|
+
let values = [];
|
|
255
371
|
if (multiple) {
|
|
256
|
-
const { selectedOptions
|
|
257
|
-
const isAlreadySelected =
|
|
372
|
+
const { selectedOptions } = this;
|
|
373
|
+
const isAlreadySelected = selectedOptions.find(option => option.value === selectedValue);
|
|
258
374
|
if (isAlreadySelected) {
|
|
259
375
|
values = selectedOptions.filter(({ value }) => value !== selectedValue);
|
|
260
376
|
}
|
|
261
377
|
else {
|
|
262
378
|
values = [...selectedOptions, valueObject];
|
|
263
379
|
}
|
|
380
|
+
if (showSelected)
|
|
381
|
+
this.focusSelectedSibling(selectedOption);
|
|
264
382
|
}
|
|
265
383
|
else {
|
|
266
384
|
values = [valueObject];
|
|
@@ -272,7 +390,7 @@ const Q2OptionList = class {
|
|
|
272
390
|
this.change.emit({ value: selectedValue, values });
|
|
273
391
|
if (multiple)
|
|
274
392
|
return;
|
|
275
|
-
this.popoverState.emit({ open: false });
|
|
393
|
+
this.popoverState.emit({ open: false, action: 'select' });
|
|
276
394
|
}
|
|
277
395
|
adjustActiveOptionAndScroll(numToAdd) {
|
|
278
396
|
this.activeIndex += numToAdd;
|
|
@@ -288,18 +406,29 @@ const Q2OptionList = class {
|
|
|
288
406
|
this.searchString = null;
|
|
289
407
|
}, 2000);
|
|
290
408
|
}
|
|
291
|
-
|
|
409
|
+
searchOptions(key, shouldSelect) {
|
|
292
410
|
this.resetTimer();
|
|
293
411
|
let searchString = this.searchString ? `${this.searchString}${key}` : key;
|
|
294
|
-
searchString = searchString.replace(/[
|
|
412
|
+
searchString = searchString.replace(/[^\w\s]/gi, '');
|
|
295
413
|
this.searchString = searchString;
|
|
296
|
-
const searchRegEx = new RegExp(searchString
|
|
297
|
-
const
|
|
414
|
+
const searchRegEx = new RegExp(`^${searchString}`, 'i');
|
|
415
|
+
const { allOptions } = this;
|
|
416
|
+
const foundIndex = allOptions.findIndex(option => option.value === searchString || option.textContent.trim().match(searchRegEx));
|
|
298
417
|
if (foundIndex === -1)
|
|
299
418
|
return;
|
|
300
|
-
|
|
419
|
+
if (shouldSelect)
|
|
420
|
+
this.selectOption(this.allOptions[foundIndex]);
|
|
421
|
+
else
|
|
422
|
+
this.setActiveElement(foundIndex);
|
|
301
423
|
}
|
|
302
424
|
/// Watchers ///
|
|
425
|
+
showSelectedUpdated(showSelected) {
|
|
426
|
+
if (showSelected && this.selectedOptions.length === 0) {
|
|
427
|
+
this.showSelected = false;
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
this.allOptions.forEach(option => (option._multiSelectHidden = showSelected ? !option.selected : false));
|
|
431
|
+
}
|
|
303
432
|
selectedOptionsUpdated() {
|
|
304
433
|
if (this.multiple) {
|
|
305
434
|
this.updateMultipleOptionAttrs();
|
|
@@ -312,8 +441,15 @@ const Q2OptionList = class {
|
|
|
312
441
|
delegateFocus(event) {
|
|
313
442
|
if (!index$1.isEventFromElement(event, this.hostElement))
|
|
314
443
|
return;
|
|
315
|
-
this.popoverState.emit({ open: true });
|
|
316
|
-
this
|
|
444
|
+
this.popoverState.emit({ open: true, action: 'open' });
|
|
445
|
+
const { activeIndex } = this;
|
|
446
|
+
if (typeof activeIndex === 'number' && activeIndex > -1) {
|
|
447
|
+
this.setActiveOption();
|
|
448
|
+
this.setFocusedOption();
|
|
449
|
+
}
|
|
450
|
+
else {
|
|
451
|
+
this.setDefaultActiveElement();
|
|
452
|
+
}
|
|
317
453
|
}
|
|
318
454
|
handleClick(event) {
|
|
319
455
|
event.stopPropagation();
|
|
@@ -330,43 +466,40 @@ const Q2OptionList = class {
|
|
|
330
466
|
this.setFocusedOption();
|
|
331
467
|
}
|
|
332
468
|
async handleExternalKeydown(event) {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
this.setDefaultActiveElement();
|
|
341
|
-
}
|
|
342
|
-
else {
|
|
343
|
-
this.keydownHandler(event, true);
|
|
344
|
-
}
|
|
469
|
+
this.externalKeydownHandler(event);
|
|
470
|
+
}
|
|
471
|
+
async getContents() {
|
|
472
|
+
return this.allContents;
|
|
473
|
+
}
|
|
474
|
+
async getOptions() {
|
|
475
|
+
return this.allOptions;
|
|
345
476
|
}
|
|
346
477
|
/// DOM ///
|
|
347
478
|
render() {
|
|
348
|
-
return (index.h(index.Host, null, index.h("div", { class: "content", ref: el => (this.contentElement = el), onFocusout: this.focusoutHandler }, index.h("div", { class: "options", role: this.type || 'listbox', onKeyDown: this.
|
|
479
|
+
return (index.h(index.Host, null, index.h("div", { class: "content", ref: el => (this.contentElement = el), onFocusout: this.focusoutHandler }, index.h("div", { class: "options", role: this.type || 'listbox', onKeyDown: this.internalKeydownHandler, onClick: this.clickHandler }, index.h("slot", null)))));
|
|
349
480
|
}
|
|
350
481
|
get hostElement() { return index.getElement(this); }
|
|
351
482
|
static get watchers() { return {
|
|
483
|
+
"showSelected": ["showSelectedUpdated"],
|
|
352
484
|
"selectedOptions": ["selectedOptionsUpdated"]
|
|
353
485
|
}; }
|
|
354
486
|
};
|
|
355
487
|
Q2OptionList.style = stylesCss$1;
|
|
356
488
|
|
|
357
|
-
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}
|
|
489
|
+
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;width:100%}:host([align=right]){display:block;position:absolute;right:0;text-align:end;left:unset}.container{display:none;overflow:hidden;opacity:0;height:0;position:absolute;top:var(--tct-popover-top, var(--t-popover-top, initial));visibility:hidden;background-color:var(--tct-popover-background-color, var(--t-popover-background-color, var(--app-white, #ffffff)));color:var(--tct-popover-text-color, var(--t-popover-text-color, var(--t-text, #4d4d4d)));z-index:var(--tct-popover-z-index, var(--t-popover-z-index, 100));width:max-content;min-width:var(--tct-popover-min-width, var(--t-popover-min-width, 135px));box-shadow:var(--tct-popover-box-shadow, var(--t-popover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))));text-align:start;left:0;transition:opacity var(--app-tween-1, 0.2s ease);border-radius:var(--tct-popover-border-radius, var(--t-popover-border-radius, 0));max-height:var(--comp-pop-max-height);--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));--comp-scrollbar-color:var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));scrollbar-width:thin;scrollbar-color:var(--comp-scrollbar-color) transparent}.container::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}.container::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}.container::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}:host([block]) .container{left:unset;right:unset;width:100%;min-width:unset}:host([align=right]) .container{right:0;text-align:end;left:unset}:host([open]) .container{display:block;height:auto;overflow:auto;opacity:1;visibility:visible}.container.up{bottom:var(--comp-pop-offset)}click-elsewhere{position:relative;display:block}.content{height:auto}";
|
|
358
490
|
|
|
359
491
|
const Q2Popover = class {
|
|
360
492
|
constructor(hostRef) {
|
|
361
493
|
index.registerInstance(this, hostRef);
|
|
362
494
|
this.popoverStateChanged = index.createEvent(this, "popoverStateChanged", 7);
|
|
363
|
-
this.
|
|
495
|
+
this.scheduledAfterRender = [];
|
|
364
496
|
this.direction = undefined;
|
|
365
497
|
this.align = undefined;
|
|
366
498
|
this.open = undefined;
|
|
367
499
|
this.block = undefined;
|
|
368
500
|
this.minHeight = undefined;
|
|
369
501
|
this.controlElement = undefined;
|
|
502
|
+
this.privateDirection = 'down';
|
|
370
503
|
}
|
|
371
504
|
/// Lifecycle hooks ///
|
|
372
505
|
componentDidLoad() {
|
|
@@ -374,8 +507,14 @@ const Q2Popover = class {
|
|
|
374
507
|
this.determinePopDirection();
|
|
375
508
|
}
|
|
376
509
|
componentWillRender() {
|
|
377
|
-
if (this.containerElement && this.
|
|
378
|
-
this.determinePopDirection();
|
|
510
|
+
if (this.containerElement && this.open)
|
|
511
|
+
index$1.nextPaint(() => this.determinePopDirection());
|
|
512
|
+
}
|
|
513
|
+
componentDidRender() {
|
|
514
|
+
setTimeout(() => {
|
|
515
|
+
this.scheduledAfterRender.forEach(fn => fn());
|
|
516
|
+
this.scheduledAfterRender = [];
|
|
517
|
+
}, 25);
|
|
379
518
|
}
|
|
380
519
|
/// Methods ///
|
|
381
520
|
async toggle() {
|
|
@@ -384,6 +523,7 @@ const Q2Popover = class {
|
|
|
384
523
|
/// Watchers ///
|
|
385
524
|
openChanged(open) {
|
|
386
525
|
this.popoverStateChanged.emit({ open });
|
|
526
|
+
this.scheduledAfterRender.push(index$1.resizeIframe);
|
|
387
527
|
}
|
|
388
528
|
/// Listeners ///
|
|
389
529
|
popoverStateHandler(event) {
|
|
@@ -395,7 +535,7 @@ const Q2Popover = class {
|
|
|
395
535
|
}
|
|
396
536
|
/// Helpers ///
|
|
397
537
|
determinePopDirection() {
|
|
398
|
-
var _a;
|
|
538
|
+
var _a, _b, _c, _d, _e;
|
|
399
539
|
const { containerElement, contentElement, direction, controlElement } = this;
|
|
400
540
|
if (containerElement)
|
|
401
541
|
containerElement.style.maxHeight = null;
|
|
@@ -407,7 +547,9 @@ const Q2Popover = class {
|
|
|
407
547
|
top: 0,
|
|
408
548
|
height: 0,
|
|
409
549
|
};
|
|
410
|
-
const
|
|
550
|
+
const scrollY = ((_c = (_b = window.Tecton) === null || _b === void 0 ? void 0 : _b.platformDimensions) === null || _c === void 0 ? void 0 : _c.scrollY) || 0;
|
|
551
|
+
const innerHeight = ((_e = (_d = window.Tecton) === null || _d === void 0 ? void 0 : _d.platformDimensions) === null || _e === void 0 ? void 0 : _e.innerHeight) || window.innerHeight;
|
|
552
|
+
const bottomOffset = scrollY + innerHeight - topOffset - height;
|
|
411
553
|
const canShowFullSizeBelow = bottomOffset > contentHeight;
|
|
412
554
|
const canShowFullSizeAbove = contentHeight <= topOffset;
|
|
413
555
|
// Prefer full size above or below
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-734296a7.js');
|
|
6
|
-
const index$1 = require('./index-
|
|
6
|
+
const index$1 = require('./index-e00b4210.js');
|
|
7
7
|
|
|
8
8
|
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{text-align:right;display:block}:host([hidden]){display:none}.container{display:inline-flex;column-gap:var(--tct-pagination-column-gap, var(--t-pagination-column-gap, var(--app-scale-2x, 10px)));align-items:center;height:var(--tct-pagination-height, var(--t-pagination-height, 44px))}.btn-group{display:flex;gap:var(--tct-pagination-btn-gap, var(--t-pagination-btn-gap, 0))}.description,.controls{white-space:nowrap}.controls{display:grid;grid-template-columns:auto 50px auto;align-items:center;gap:var(--tct-pagination-controls-gap, var(--t-pagination-controls-gap, var(--app-scale-1x, 5px)))}.controls[hidden]{display:none}.input-wrapper{height:var(--tct-pagination-height, var(--t-pagination-height, 44px));display:flex;align-items:center}q2-icon{--tct-icon-size:var(--tct-pagination-icon-size, var(--t-pagination-icon-size, 12px));color:var(--tct-pagination-icon-color, var(--t-pagination-icon-color, var(--t-text, #4d4d4d)))}q2-input{--tct-input-margin-top:0;--tct-input-margin-bottom:0;--tct-input-height:var(--tct-pagination-input-height, var(--t-pagination-input-height, 30px));--tct-input-min-height:var(--tct-input-height);--tct-input-align:center}";
|
|
9
9
|
|