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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-bb1c8c7f.js';
|
|
2
|
-
import { o as overrideFocus, i as isEventFromElement } from './index-
|
|
2
|
+
import { o as overrideFocus, n as nextPaint, i as isEventFromElement, r as resizeIframe } from './index-ca21e539.js';
|
|
3
3
|
|
|
4
4
|
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}";
|
|
5
5
|
|
|
@@ -8,57 +8,136 @@ const Q2OptionList = class {
|
|
|
8
8
|
registerInstance(this, hostRef);
|
|
9
9
|
this.change = createEvent(this, "change", 7);
|
|
10
10
|
this.popoverState = createEvent(this, "popoverState", 7);
|
|
11
|
+
this.ready = createEvent(this, "ready", 3);
|
|
11
12
|
this.scheduledAfterRender = [];
|
|
12
13
|
/// Event Handlers ///
|
|
13
14
|
/* tslint:disable:cyclomatic-complexity */
|
|
14
|
-
this.
|
|
15
|
+
this.externalKeydownHandler = (event) => {
|
|
16
|
+
event.stopPropagation();
|
|
17
|
+
const { activeIndex, customSearch, allOptions } = this;
|
|
18
|
+
const { key } = event;
|
|
19
|
+
let nextIndex;
|
|
20
|
+
switch (key) {
|
|
21
|
+
case ' ':
|
|
22
|
+
if (this.searchString) {
|
|
23
|
+
if (customSearch)
|
|
24
|
+
break;
|
|
25
|
+
this.searchOptions(key, true);
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
this.setDefaultActiveElement();
|
|
29
|
+
break;
|
|
30
|
+
case 'Enter':
|
|
31
|
+
this.setDefaultActiveElement();
|
|
32
|
+
break;
|
|
33
|
+
case 'ArrowUp':
|
|
34
|
+
event.preventDefault();
|
|
35
|
+
this.activeIndex = 0;
|
|
36
|
+
nextIndex = !!this.selectedOptions.length ? this.getDefaultActiveIndex() : this.getNextVisibleIndex(-1);
|
|
37
|
+
if (nextIndex === -1)
|
|
38
|
+
break;
|
|
39
|
+
this.openDropdownWithActiveElement(nextIndex);
|
|
40
|
+
break;
|
|
41
|
+
case 'ArrowDown':
|
|
42
|
+
event.preventDefault();
|
|
43
|
+
this.activeIndex = 0;
|
|
44
|
+
nextIndex = !!this.selectedOptions.length ? this.getDefaultActiveIndex() : this.getNextVisibleIndex(0);
|
|
45
|
+
if (nextIndex === -1)
|
|
46
|
+
break;
|
|
47
|
+
this.openDropdownWithActiveElement(nextIndex);
|
|
48
|
+
break;
|
|
49
|
+
case 'Home':
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
this.openDropdownWithActiveElement(0);
|
|
52
|
+
break;
|
|
53
|
+
case 'End':
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
this.openDropdownWithActiveElement(allOptions.length - 1);
|
|
56
|
+
break;
|
|
57
|
+
case 'PageUp':
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
this.openDropdownWithActiveElement(Math.max((activeIndex || 0) - 10, 0));
|
|
60
|
+
break;
|
|
61
|
+
case 'PageDown':
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
this.openDropdownWithActiveElement(Math.min((activeIndex || 0) + 10, allOptions.length - 1));
|
|
64
|
+
break;
|
|
65
|
+
case 'Tab':
|
|
66
|
+
this.popoverState.emit({ open: false, action: 'close' });
|
|
67
|
+
break;
|
|
68
|
+
case 'Esc':
|
|
69
|
+
case 'Escape':
|
|
70
|
+
if (this.noSelect)
|
|
71
|
+
this.setActiveElement(null);
|
|
72
|
+
this.popoverState.emit({ open: false, action: 'close' });
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
if (customSearch)
|
|
76
|
+
break;
|
|
77
|
+
if (!key.match(/^[\w]$/))
|
|
78
|
+
break;
|
|
79
|
+
this.searchOptions(key, true);
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
this.internalKeydownHandler = (event) => {
|
|
15
84
|
event.stopPropagation();
|
|
16
85
|
const { activeIndex, customSearch, allOptions } = this;
|
|
17
86
|
const { key, shiftKey } = event;
|
|
18
87
|
let newOption;
|
|
19
88
|
switch (key) {
|
|
20
89
|
case ' ':
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
90
|
+
if (this.searchString) {
|
|
91
|
+
if (customSearch)
|
|
92
|
+
break;
|
|
93
|
+
this.searchOptions(key, false);
|
|
24
94
|
break;
|
|
25
95
|
}
|
|
26
96
|
event.preventDefault();
|
|
27
97
|
newOption = allOptions.find(element => element.active);
|
|
28
98
|
if (!newOption || newOption.disabled)
|
|
29
99
|
break;
|
|
30
|
-
this.selectOption(newOption
|
|
100
|
+
this.selectOption(newOption);
|
|
101
|
+
break;
|
|
102
|
+
case 'Enter':
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
newOption = allOptions.find(element => element.active);
|
|
105
|
+
if (!newOption || newOption.disabled)
|
|
106
|
+
break;
|
|
107
|
+
this.selectOption(newOption);
|
|
31
108
|
break;
|
|
32
109
|
case 'ArrowUp':
|
|
33
110
|
event.preventDefault();
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
111
|
+
const isFirstOptionActive = activeIndex === 0;
|
|
112
|
+
if (isFirstOptionActive)
|
|
36
113
|
break;
|
|
37
114
|
if (activeIndex === undefined) {
|
|
38
115
|
this.setDefaultActiveElement();
|
|
116
|
+
break;
|
|
39
117
|
}
|
|
40
118
|
else {
|
|
41
119
|
const nextIndex = this.getNextVisibleIndex(-1);
|
|
42
120
|
if (nextIndex === -1)
|
|
43
121
|
break;
|
|
44
122
|
this.adjustActiveOptionAndScroll(nextIndex - activeIndex);
|
|
123
|
+
break;
|
|
45
124
|
}
|
|
46
|
-
break;
|
|
47
125
|
case 'ArrowDown':
|
|
48
126
|
event.preventDefault();
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
127
|
+
const isLastOptionActive = activeIndex === allOptions.length - 1;
|
|
128
|
+
if (isLastOptionActive)
|
|
51
129
|
break;
|
|
52
130
|
if (activeIndex === undefined) {
|
|
53
131
|
this.setDefaultActiveElement();
|
|
132
|
+
break;
|
|
54
133
|
}
|
|
55
134
|
else {
|
|
56
135
|
const nextIndex = this.getNextVisibleIndex(1);
|
|
57
136
|
if (nextIndex === -1)
|
|
58
137
|
break;
|
|
59
138
|
this.adjustActiveOptionAndScroll(nextIndex - activeIndex);
|
|
139
|
+
break;
|
|
60
140
|
}
|
|
61
|
-
break;
|
|
62
141
|
case 'Home':
|
|
63
142
|
event.preventDefault();
|
|
64
143
|
this.openDropdownWithActiveElement(0);
|
|
@@ -76,28 +155,25 @@ const Q2OptionList = class {
|
|
|
76
155
|
this.openDropdownWithActiveElement(Math.min(activeIndex + 10, allOptions.length - 1));
|
|
77
156
|
break;
|
|
78
157
|
case 'Tab':
|
|
79
|
-
if (ignoreSelectionEvents)
|
|
80
|
-
break;
|
|
81
158
|
if (shiftKey)
|
|
82
159
|
break;
|
|
83
160
|
newOption = allOptions.find(element => element.active);
|
|
84
161
|
if (!newOption || newOption.disabled)
|
|
85
162
|
return;
|
|
86
|
-
this.selectOption(newOption
|
|
163
|
+
this.selectOption(newOption);
|
|
87
164
|
break;
|
|
88
165
|
case 'Esc':
|
|
89
166
|
case 'Escape':
|
|
90
167
|
if (this.noSelect)
|
|
91
168
|
this.setActiveElement(null);
|
|
92
|
-
this.popoverState.emit({ open: false });
|
|
169
|
+
this.popoverState.emit({ open: false, action: 'close' });
|
|
93
170
|
break;
|
|
94
171
|
default:
|
|
95
172
|
if (customSearch)
|
|
96
173
|
break;
|
|
97
|
-
if (!key.match(/^[
|
|
174
|
+
if (!key.match(/^[\w]$/))
|
|
98
175
|
break;
|
|
99
|
-
|
|
100
|
-
this.searchAndFocus(key);
|
|
176
|
+
this.searchOptions(key, false);
|
|
101
177
|
break;
|
|
102
178
|
}
|
|
103
179
|
};
|
|
@@ -112,19 +188,17 @@ const Q2OptionList = class {
|
|
|
112
188
|
};
|
|
113
189
|
this.clickHandler = (event) => {
|
|
114
190
|
const target = event.target;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
this.selectOption(target.value);
|
|
191
|
+
const option = target.closest('q2-option');
|
|
192
|
+
this.selectOption(option);
|
|
119
193
|
};
|
|
120
194
|
this.role = 'listbox';
|
|
121
|
-
this.direction = 'down';
|
|
122
195
|
this.customSearch = undefined;
|
|
123
196
|
this.noSelect = undefined;
|
|
124
197
|
this.align = undefined;
|
|
125
198
|
this.selectedOptions = [];
|
|
126
199
|
this.multiple = undefined;
|
|
127
200
|
this.disabled = undefined;
|
|
201
|
+
this.showSelected = undefined;
|
|
128
202
|
this.type = undefined;
|
|
129
203
|
this.hasOptions = undefined;
|
|
130
204
|
}
|
|
@@ -136,26 +210,47 @@ const Q2OptionList = class {
|
|
|
136
210
|
overrideFocus(this.hostElement);
|
|
137
211
|
this.checkOptions();
|
|
138
212
|
this.selectedOptionsUpdated();
|
|
213
|
+
this.ready.emit();
|
|
139
214
|
}
|
|
140
215
|
componentDidRender() {
|
|
141
216
|
this.scheduledAfterRender.forEach(fn => fn());
|
|
142
217
|
this.scheduledAfterRender = [];
|
|
143
218
|
}
|
|
144
219
|
/// Getters ///
|
|
220
|
+
get allContents() {
|
|
221
|
+
const rootSlot = this.getRootSlot(this.hostElement);
|
|
222
|
+
const acceptedTags = ['Q2-OPTGROUP', 'Q2-OPTION'];
|
|
223
|
+
return rootSlot.filter(element => acceptedTags.includes(element.tagName));
|
|
224
|
+
}
|
|
145
225
|
get allOptions() {
|
|
146
|
-
|
|
226
|
+
const contents = this.allContents;
|
|
227
|
+
const extractOptions = (elements) => {
|
|
228
|
+
return elements.reduce((acc, element) => {
|
|
229
|
+
if (element.tagName === 'Q2-OPTGROUP') {
|
|
230
|
+
return [...acc, ...extractOptions(Array.from(element.children))];
|
|
231
|
+
}
|
|
232
|
+
else if (element.tagName === 'Q2-OPTION') {
|
|
233
|
+
return [...acc, element];
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
return acc;
|
|
237
|
+
}
|
|
238
|
+
}, []);
|
|
239
|
+
};
|
|
240
|
+
return extractOptions(contents);
|
|
241
|
+
}
|
|
242
|
+
get allVisibleOptions() {
|
|
243
|
+
return this.allOptions.filter(option => !option.hidden && !option._multiSelectHidden && !option.disabled && !option.disabledGroup);
|
|
147
244
|
}
|
|
148
245
|
/// Helpers ///
|
|
149
|
-
checkOptions() {
|
|
150
|
-
const {
|
|
151
|
-
|
|
246
|
+
async checkOptions() {
|
|
247
|
+
const { type } = this;
|
|
248
|
+
const options = await this.getOptions();
|
|
249
|
+
if (!type)
|
|
152
250
|
return;
|
|
153
251
|
const optionRole = type === 'menu' ? 'menuitem' : 'option';
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
option.noSelect = true;
|
|
157
|
-
if (type)
|
|
158
|
-
option.role = optionRole;
|
|
252
|
+
options.forEach(option => {
|
|
253
|
+
option.role = optionRole;
|
|
159
254
|
});
|
|
160
255
|
}
|
|
161
256
|
getRootSlot(element) {
|
|
@@ -174,20 +269,15 @@ const Q2OptionList = class {
|
|
|
174
269
|
const activeOption = this.allOptions[this.activeIndex];
|
|
175
270
|
activeOption === null || activeOption === void 0 ? void 0 : activeOption.scrollIntoView({ block: 'nearest' });
|
|
176
271
|
}
|
|
177
|
-
resizeIframe() {
|
|
178
|
-
var _a, _b;
|
|
179
|
-
return (_b = (_a = window.TectonElements) === null || _a === void 0 ? void 0 : _a.resizeIframe) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
180
|
-
}
|
|
181
272
|
openDropdownWithActiveElement(activeIndex) {
|
|
182
273
|
if (this.disabled)
|
|
183
274
|
return;
|
|
184
275
|
this.activeIndex = activeIndex;
|
|
185
|
-
this.popoverState.emit({ open: true });
|
|
276
|
+
this.popoverState.emit({ open: true, action: 'open' });
|
|
186
277
|
this.setActiveOption();
|
|
187
278
|
this.setFocusedOption();
|
|
188
|
-
|
|
279
|
+
nextPaint(() => {
|
|
189
280
|
this.scrollToActiveOption();
|
|
190
|
-
this.resizeIframe();
|
|
191
281
|
});
|
|
192
282
|
}
|
|
193
283
|
getDefaultActiveIndex() {
|
|
@@ -201,16 +291,16 @@ const Q2OptionList = class {
|
|
|
201
291
|
return 0;
|
|
202
292
|
}
|
|
203
293
|
updateSingleOptionAttrs() {
|
|
204
|
-
var _a
|
|
294
|
+
var _a;
|
|
205
295
|
const { allOptions, selectedOptions } = this;
|
|
206
|
-
const
|
|
296
|
+
const selectedValue = ((_a = selectedOptions[0]) === null || _a === void 0 ? void 0 : _a.value) || undefined;
|
|
207
297
|
allOptions.forEach(element => {
|
|
208
|
-
element.selected = element.value ===
|
|
298
|
+
element.selected = element.value === selectedValue;
|
|
209
299
|
});
|
|
210
300
|
}
|
|
211
301
|
updateMultipleOptionAttrs() {
|
|
212
302
|
const { allOptions, selectedOptions } = this;
|
|
213
|
-
const selectedValues = selectedOptions.map(
|
|
303
|
+
const selectedValues = selectedOptions.map(({ value }) => value);
|
|
214
304
|
allOptions.forEach(element => {
|
|
215
305
|
element.selected = selectedValues.includes(element.value);
|
|
216
306
|
});
|
|
@@ -225,38 +315,66 @@ const Q2OptionList = class {
|
|
|
225
315
|
const option = this.allOptions[this.activeIndex];
|
|
226
316
|
if (!option)
|
|
227
317
|
return;
|
|
228
|
-
|
|
318
|
+
const isHostElementVisible = !!this.hostElement.offsetParent;
|
|
319
|
+
if (isHostElementVisible)
|
|
229
320
|
option.focus();
|
|
230
|
-
|
|
321
|
+
else
|
|
322
|
+
nextPaint(() => option.focus());
|
|
231
323
|
}
|
|
232
324
|
getNextVisibleIndex(direction) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
index = index + direction;
|
|
325
|
+
const { allVisibleOptions, allOptions, activeIndex } = this;
|
|
326
|
+
const activeOption = allOptions[activeIndex];
|
|
327
|
+
const visibleActiveOptionIndex = allVisibleOptions.indexOf(activeOption);
|
|
328
|
+
let nextVisibleOptionIndex = visibleActiveOptionIndex + direction;
|
|
329
|
+
if (nextVisibleOptionIndex < 0) {
|
|
330
|
+
nextVisibleOptionIndex = allVisibleOptions.length - 1;
|
|
240
331
|
}
|
|
241
|
-
|
|
332
|
+
else if (nextVisibleOptionIndex > allVisibleOptions.length - 1) {
|
|
333
|
+
nextVisibleOptionIndex = 0;
|
|
334
|
+
}
|
|
335
|
+
const nextVisibleOption = allVisibleOptions[nextVisibleOptionIndex];
|
|
336
|
+
return allOptions.indexOf(nextVisibleOption);
|
|
337
|
+
}
|
|
338
|
+
focusSelectedSibling(option) {
|
|
339
|
+
const { allVisibleOptions, allOptions } = this;
|
|
340
|
+
const hasNoSiblings = allVisibleOptions.length < 2;
|
|
341
|
+
if (hasNoSiblings) {
|
|
342
|
+
this.showSelected = false;
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
const selectedOptionVisibleIndex = allVisibleOptions.indexOf(option);
|
|
346
|
+
const nextVisibleSiblingIndex = selectedOptionVisibleIndex
|
|
347
|
+
? selectedOptionVisibleIndex - 1
|
|
348
|
+
: selectedOptionVisibleIndex + 1;
|
|
349
|
+
const nextVisibleSibling = allVisibleOptions[nextVisibleSiblingIndex];
|
|
350
|
+
const nextSiblingIndex = allOptions.indexOf(nextVisibleSibling);
|
|
351
|
+
this.activeIndex = nextSiblingIndex;
|
|
352
|
+
this.setFocusedOption();
|
|
353
|
+
this.scheduledAfterRender.push(() => {
|
|
354
|
+
option._multiSelectHidden = !option.selected;
|
|
355
|
+
});
|
|
242
356
|
}
|
|
243
|
-
selectOption(
|
|
244
|
-
const
|
|
357
|
+
selectOption(selectedOption) {
|
|
358
|
+
const { multiple, noSelect, showSelected } = this;
|
|
359
|
+
if (!selectedOption || selectedOption.disabled || selectedOption.disabledGroup)
|
|
360
|
+
return;
|
|
361
|
+
const selectedValue = selectedOption.value;
|
|
245
362
|
const valueObject = {
|
|
246
363
|
value: selectedValue,
|
|
247
|
-
display:
|
|
364
|
+
display: selectedOption.display || selectedOption.innerText.trim(),
|
|
248
365
|
};
|
|
249
|
-
|
|
250
|
-
let values;
|
|
366
|
+
let values = [];
|
|
251
367
|
if (multiple) {
|
|
252
|
-
const { selectedOptions
|
|
253
|
-
const isAlreadySelected =
|
|
368
|
+
const { selectedOptions } = this;
|
|
369
|
+
const isAlreadySelected = selectedOptions.find(option => option.value === selectedValue);
|
|
254
370
|
if (isAlreadySelected) {
|
|
255
371
|
values = selectedOptions.filter(({ value }) => value !== selectedValue);
|
|
256
372
|
}
|
|
257
373
|
else {
|
|
258
374
|
values = [...selectedOptions, valueObject];
|
|
259
375
|
}
|
|
376
|
+
if (showSelected)
|
|
377
|
+
this.focusSelectedSibling(selectedOption);
|
|
260
378
|
}
|
|
261
379
|
else {
|
|
262
380
|
values = [valueObject];
|
|
@@ -268,7 +386,7 @@ const Q2OptionList = class {
|
|
|
268
386
|
this.change.emit({ value: selectedValue, values });
|
|
269
387
|
if (multiple)
|
|
270
388
|
return;
|
|
271
|
-
this.popoverState.emit({ open: false });
|
|
389
|
+
this.popoverState.emit({ open: false, action: 'select' });
|
|
272
390
|
}
|
|
273
391
|
adjustActiveOptionAndScroll(numToAdd) {
|
|
274
392
|
this.activeIndex += numToAdd;
|
|
@@ -284,18 +402,29 @@ const Q2OptionList = class {
|
|
|
284
402
|
this.searchString = null;
|
|
285
403
|
}, 2000);
|
|
286
404
|
}
|
|
287
|
-
|
|
405
|
+
searchOptions(key, shouldSelect) {
|
|
288
406
|
this.resetTimer();
|
|
289
407
|
let searchString = this.searchString ? `${this.searchString}${key}` : key;
|
|
290
|
-
searchString = searchString.replace(/[
|
|
408
|
+
searchString = searchString.replace(/[^\w\s]/gi, '');
|
|
291
409
|
this.searchString = searchString;
|
|
292
|
-
const searchRegEx = new RegExp(searchString
|
|
293
|
-
const
|
|
410
|
+
const searchRegEx = new RegExp(`^${searchString}`, 'i');
|
|
411
|
+
const { allOptions } = this;
|
|
412
|
+
const foundIndex = allOptions.findIndex(option => option.value === searchString || option.textContent.trim().match(searchRegEx));
|
|
294
413
|
if (foundIndex === -1)
|
|
295
414
|
return;
|
|
296
|
-
|
|
415
|
+
if (shouldSelect)
|
|
416
|
+
this.selectOption(this.allOptions[foundIndex]);
|
|
417
|
+
else
|
|
418
|
+
this.setActiveElement(foundIndex);
|
|
297
419
|
}
|
|
298
420
|
/// Watchers ///
|
|
421
|
+
showSelectedUpdated(showSelected) {
|
|
422
|
+
if (showSelected && this.selectedOptions.length === 0) {
|
|
423
|
+
this.showSelected = false;
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
this.allOptions.forEach(option => (option._multiSelectHidden = showSelected ? !option.selected : false));
|
|
427
|
+
}
|
|
299
428
|
selectedOptionsUpdated() {
|
|
300
429
|
if (this.multiple) {
|
|
301
430
|
this.updateMultipleOptionAttrs();
|
|
@@ -308,8 +437,15 @@ const Q2OptionList = class {
|
|
|
308
437
|
delegateFocus(event) {
|
|
309
438
|
if (!isEventFromElement(event, this.hostElement))
|
|
310
439
|
return;
|
|
311
|
-
this.popoverState.emit({ open: true });
|
|
312
|
-
this
|
|
440
|
+
this.popoverState.emit({ open: true, action: 'open' });
|
|
441
|
+
const { activeIndex } = this;
|
|
442
|
+
if (typeof activeIndex === 'number' && activeIndex > -1) {
|
|
443
|
+
this.setActiveOption();
|
|
444
|
+
this.setFocusedOption();
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
this.setDefaultActiveElement();
|
|
448
|
+
}
|
|
313
449
|
}
|
|
314
450
|
handleClick(event) {
|
|
315
451
|
event.stopPropagation();
|
|
@@ -326,43 +462,40 @@ const Q2OptionList = class {
|
|
|
326
462
|
this.setFocusedOption();
|
|
327
463
|
}
|
|
328
464
|
async handleExternalKeydown(event) {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
this.setDefaultActiveElement();
|
|
337
|
-
}
|
|
338
|
-
else {
|
|
339
|
-
this.keydownHandler(event, true);
|
|
340
|
-
}
|
|
465
|
+
this.externalKeydownHandler(event);
|
|
466
|
+
}
|
|
467
|
+
async getContents() {
|
|
468
|
+
return this.allContents;
|
|
469
|
+
}
|
|
470
|
+
async getOptions() {
|
|
471
|
+
return this.allOptions;
|
|
341
472
|
}
|
|
342
473
|
/// DOM ///
|
|
343
474
|
render() {
|
|
344
|
-
return (h(Host, null, h("div", { class: "content", ref: el => (this.contentElement = el), onFocusout: this.focusoutHandler }, h("div", { class: "options", role: this.type || 'listbox', onKeyDown: this.
|
|
475
|
+
return (h(Host, null, h("div", { class: "content", ref: el => (this.contentElement = el), onFocusout: this.focusoutHandler }, h("div", { class: "options", role: this.type || 'listbox', onKeyDown: this.internalKeydownHandler, onClick: this.clickHandler }, h("slot", null)))));
|
|
345
476
|
}
|
|
346
477
|
get hostElement() { return getElement(this); }
|
|
347
478
|
static get watchers() { return {
|
|
479
|
+
"showSelected": ["showSelectedUpdated"],
|
|
348
480
|
"selectedOptions": ["selectedOptionsUpdated"]
|
|
349
481
|
}; }
|
|
350
482
|
};
|
|
351
483
|
Q2OptionList.style = stylesCss$1;
|
|
352
484
|
|
|
353
|
-
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}
|
|
485
|
+
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}";
|
|
354
486
|
|
|
355
487
|
const Q2Popover = class {
|
|
356
488
|
constructor(hostRef) {
|
|
357
489
|
registerInstance(this, hostRef);
|
|
358
490
|
this.popoverStateChanged = createEvent(this, "popoverStateChanged", 7);
|
|
359
|
-
this.
|
|
491
|
+
this.scheduledAfterRender = [];
|
|
360
492
|
this.direction = undefined;
|
|
361
493
|
this.align = undefined;
|
|
362
494
|
this.open = undefined;
|
|
363
495
|
this.block = undefined;
|
|
364
496
|
this.minHeight = undefined;
|
|
365
497
|
this.controlElement = undefined;
|
|
498
|
+
this.privateDirection = 'down';
|
|
366
499
|
}
|
|
367
500
|
/// Lifecycle hooks ///
|
|
368
501
|
componentDidLoad() {
|
|
@@ -370,8 +503,14 @@ const Q2Popover = class {
|
|
|
370
503
|
this.determinePopDirection();
|
|
371
504
|
}
|
|
372
505
|
componentWillRender() {
|
|
373
|
-
if (this.containerElement && this.
|
|
374
|
-
this.determinePopDirection();
|
|
506
|
+
if (this.containerElement && this.open)
|
|
507
|
+
nextPaint(() => this.determinePopDirection());
|
|
508
|
+
}
|
|
509
|
+
componentDidRender() {
|
|
510
|
+
setTimeout(() => {
|
|
511
|
+
this.scheduledAfterRender.forEach(fn => fn());
|
|
512
|
+
this.scheduledAfterRender = [];
|
|
513
|
+
}, 25);
|
|
375
514
|
}
|
|
376
515
|
/// Methods ///
|
|
377
516
|
async toggle() {
|
|
@@ -380,6 +519,7 @@ const Q2Popover = class {
|
|
|
380
519
|
/// Watchers ///
|
|
381
520
|
openChanged(open) {
|
|
382
521
|
this.popoverStateChanged.emit({ open });
|
|
522
|
+
this.scheduledAfterRender.push(resizeIframe);
|
|
383
523
|
}
|
|
384
524
|
/// Listeners ///
|
|
385
525
|
popoverStateHandler(event) {
|
|
@@ -391,7 +531,7 @@ const Q2Popover = class {
|
|
|
391
531
|
}
|
|
392
532
|
/// Helpers ///
|
|
393
533
|
determinePopDirection() {
|
|
394
|
-
var _a;
|
|
534
|
+
var _a, _b, _c, _d, _e;
|
|
395
535
|
const { containerElement, contentElement, direction, controlElement } = this;
|
|
396
536
|
if (containerElement)
|
|
397
537
|
containerElement.style.maxHeight = null;
|
|
@@ -403,7 +543,9 @@ const Q2Popover = class {
|
|
|
403
543
|
top: 0,
|
|
404
544
|
height: 0,
|
|
405
545
|
};
|
|
406
|
-
const
|
|
546
|
+
const scrollY = ((_c = (_b = window.Tecton) === null || _b === void 0 ? void 0 : _b.platformDimensions) === null || _c === void 0 ? void 0 : _c.scrollY) || 0;
|
|
547
|
+
const innerHeight = ((_e = (_d = window.Tecton) === null || _d === void 0 ? void 0 : _d.platformDimensions) === null || _e === void 0 ? void 0 : _e.innerHeight) || window.innerHeight;
|
|
548
|
+
const bottomOffset = scrollY + innerHeight - topOffset - height;
|
|
407
549
|
const canShowFullSizeBelow = bottomOffset > contentHeight;
|
|
408
550
|
const canShowFullSizeAbove = contentHeight <= topOffset;
|
|
409
551
|
// Prefer full size above or below
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-bb1c8c7f.js';
|
|
2
|
-
import { o as overrideFocus, i as isEventFromElement, l as loc, n as nextPaint } from './index-
|
|
2
|
+
import { o as overrideFocus, i as isEventFromElement, l as loc, n as nextPaint } from './index-ca21e539.js';
|
|
3
3
|
|
|
4
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{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}";
|
|
5
5
|
|