q2-tecton-elements 1.67.0 → 1.67.1
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/bundle-report.json +431 -431
- package/dist/cjs/click-elsewhere.q2-option-list.q2-popover.entry.cjs.js.map +1 -1
- package/dist/cjs/click-elsewhere_3.cjs.entry.js +41 -14
- package/dist/cjs/click-elsewhere_3.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-action-group_2.cjs.entry.js +2 -2
- package/dist/cjs/q2-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
- package/dist/cjs/q2-btn.q2-loading.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-btn_2.cjs.entry.js +4 -2
- package/dist/cjs/q2-btn_2.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +1 -1
- package/dist/cjs/q2-card-image.cjs.entry.js +2 -2
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +2 -2
- 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_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-context.cjs.entry.js +1 -1
- package/dist/cjs/q2-currency.cjs.entry.js +1 -1
- package/dist/cjs/q2-data-table.cjs.entry.js +1 -1
- package/dist/cjs/q2-detail.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-example.cjs.entry.js +1 -1
- package/dist/cjs/q2-form.cjs.entry.js +1 -1
- package/dist/cjs/q2-formatted-text.cjs.entry.js +1 -1
- package/dist/cjs/q2-grid-area.cjs.entry.js +1 -1
- package/dist/cjs/q2-grid.cjs.entry.js +1 -1
- package/dist/cjs/q2-input.cjs.entry.js +1 -1
- package/dist/cjs/q2-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-legend.cjs.entry.js +1 -1
- package/dist/cjs/q2-link_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +1 -1
- package/dist/cjs/q2-meter.cjs.entry.js +1 -1
- package/dist/cjs/q2-modal.cjs.entry.js +1 -1
- package/dist/cjs/q2-month-picker.cjs.entry.js +2 -2
- package/dist/cjs/q2-mutation-observer.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
- package/dist/cjs/q2-pagination.cjs.entry.js +3 -3
- package/dist/cjs/q2-pill.cjs.entry.js +1 -1
- 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-relative-time.cjs.entry.js +1 -1
- package/dist/cjs/q2-section.cjs.entry.js +2 -2
- package/dist/cjs/q2-select.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/q2-action-group/q2-action-group.js +1 -1
- package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +1 -1
- package/dist/collection/components/q2-avatar/q2-avatar.js +1 -1
- package/dist/collection/components/q2-btn/q2-btn.js +4 -2
- package/dist/collection/components/q2-btn/q2-btn.js.map +1 -1
- package/dist/collection/components/q2-calendar/q2-calendar.js +1 -1
- package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
- package/dist/collection/components/q2-card-image/q2-card-image.js +2 -2
- package/dist/collection/components/q2-carousel/q2-carousel.js +1 -1
- package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
- package/dist/collection/components/q2-chart-area/q2-chart-area.js +1 -1
- package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +1 -1
- package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +1 -1
- package/dist/collection/components/q2-checkbox/q2-checkbox.js +1 -1
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js +1 -1
- package/dist/collection/components/q2-context/q2-context.js +1 -1
- package/dist/collection/components/q2-currency/q2-currency.js +1 -1
- package/dist/collection/components/q2-data-table/q2-data-table.js +1 -1
- package/dist/collection/components/q2-detail/q2-detail.js +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +1 -1
- package/dist/collection/components/q2-editable-field/q2-editable-field.js +2 -2
- package/dist/collection/components/q2-example/q2-example.js +1 -1
- package/dist/collection/components/q2-form/q2-form.js +1 -1
- package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
- package/dist/collection/components/q2-grid/q2-grid.js +31 -31
- package/dist/collection/components/q2-grid-area/q2-grid-area.js +43 -43
- package/dist/collection/components/q2-input/q2-input.js +3 -3
- package/dist/collection/components/q2-item/q2-item.js +1 -1
- package/dist/collection/components/q2-legend/q2-legend.js +1 -1
- package/dist/collection/components/q2-list/q2-list.js +1 -1
- package/dist/collection/components/q2-message/q2-message.js +1 -1
- package/dist/collection/components/q2-meter/q2-meter.js +1 -1
- package/dist/collection/components/q2-modal/q2-modal.js +1 -1
- package/dist/collection/components/q2-mutation-observer/q2-mutation-observer.js +1 -1
- package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
- package/dist/collection/components/q2-option-list/q2-option-list.js +6 -6
- package/dist/collection/components/q2-pagination/q2-pagination.js +3 -3
- package/dist/collection/components/q2-pill/q2-pill.js +1 -1
- package/dist/collection/components/q2-popover/q2-popover.js +40 -13
- package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
- package/dist/collection/components/q2-radio/q2-radio.js +1 -1
- package/dist/collection/components/q2-radio-group/q2-radio-group.js +1 -1
- package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
- package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
- package/dist/collection/components/q2-section/q2-section.js +2 -2
- package/dist/collection/components/q2-select/q2-select.js +1 -1
- package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
- package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +1 -1
- package/dist/collection/components/q2-textarea/q2-textarea.js +1 -1
- package/dist/components/q2-action-group2.js +1 -1
- package/dist/components/q2-action-sheet.js +1 -1
- package/dist/components/q2-avatar2.js +1 -1
- package/dist/components/q2-btn2.js +4 -2
- package/dist/components/q2-btn2.js.map +1 -1
- package/dist/components/q2-calendar.js +1 -1
- package/dist/components/q2-card-image.js +2 -2
- package/dist/components/q2-carousel-pane.js +2 -2
- 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-checkbox2.js +1 -1
- package/dist/components/q2-context.js +1 -1
- package/dist/components/q2-currency.js +1 -1
- package/dist/components/q2-data-table.js +1 -1
- package/dist/components/q2-detail.js +1 -1
- package/dist/components/q2-dropdown.js +1 -1
- package/dist/components/q2-editable-field.js +1 -1
- package/dist/components/q2-example.js +1 -1
- package/dist/components/q2-form.js +1 -1
- package/dist/components/q2-formatted-text.js +1 -1
- package/dist/components/q2-grid-area.js +1 -1
- package/dist/components/q2-grid.js +1 -1
- package/dist/components/q2-input2.js +1 -1
- package/dist/components/q2-item2.js +1 -1
- package/dist/components/q2-legend2.js +1 -1
- package/dist/components/q2-list2.js +1 -1
- package/dist/components/q2-message2.js +1 -1
- package/dist/components/q2-meter.js +1 -1
- package/dist/components/q2-modal.js +1 -1
- package/dist/components/q2-month-picker.js +2 -2
- package/dist/components/q2-mutation-observer.js +1 -1
- package/dist/components/q2-optgroup2.js +1 -1
- package/dist/components/q2-option-list2.js +1 -1
- package/dist/components/q2-pagination.js +3 -3
- package/dist/components/q2-pill.js +1 -1
- package/dist/components/q2-popover2.js +40 -13
- package/dist/components/q2-popover2.js.map +1 -1
- package/dist/components/q2-radio-group.js +1 -1
- package/dist/components/q2-radio.js +1 -1
- package/dist/components/q2-relative-time.js +1 -1
- package/dist/components/q2-resize-observer2.js +1 -1
- package/dist/components/q2-section.js +2 -2
- package/dist/components/q2-select2.js +1 -1
- package/dist/components/q2-stepper-pane.js +1 -1
- package/dist/components/q2-stepper.js +1 -1
- package/dist/components/q2-textarea.js +1 -1
- package/dist/esm/click-elsewhere.q2-option-list.q2-popover.entry.js.map +1 -1
- package/dist/esm/click-elsewhere_3.entry.js +41 -14
- package/dist/esm/click-elsewhere_3.entry.js.map +1 -1
- package/dist/esm/q2-action-group_2.entry.js +2 -2
- package/dist/esm/q2-action-sheet.entry.js +1 -1
- package/dist/esm/q2-avatar.entry.js +1 -1
- package/dist/esm/q2-btn.q2-loading.entry.js.map +1 -1
- package/dist/esm/q2-btn_2.entry.js +4 -2
- package/dist/esm/q2-btn_2.entry.js.map +1 -1
- package/dist/esm/q2-calendar.entry.js +1 -1
- package/dist/esm/q2-card-image.entry.js +2 -2
- package/dist/esm/q2-carousel-pane.entry.js +2 -2
- 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_2.entry.js +1 -1
- package/dist/esm/q2-context.entry.js +1 -1
- package/dist/esm/q2-currency.entry.js +1 -1
- package/dist/esm/q2-data-table.entry.js +1 -1
- package/dist/esm/q2-detail.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-example.entry.js +1 -1
- package/dist/esm/q2-form.entry.js +1 -1
- package/dist/esm/q2-formatted-text.entry.js +1 -1
- package/dist/esm/q2-grid-area.entry.js +1 -1
- package/dist/esm/q2-grid.entry.js +1 -1
- package/dist/esm/q2-input.entry.js +1 -1
- package/dist/esm/q2-item.entry.js +1 -1
- package/dist/esm/q2-legend.entry.js +1 -1
- package/dist/esm/q2-link_2.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +1 -1
- package/dist/esm/q2-meter.entry.js +1 -1
- package/dist/esm/q2-modal.entry.js +1 -1
- package/dist/esm/q2-month-picker.entry.js +2 -2
- package/dist/esm/q2-mutation-observer.entry.js +1 -1
- package/dist/esm/q2-optgroup.entry.js +1 -1
- package/dist/esm/q2-pagination.entry.js +3 -3
- package/dist/esm/q2-pill.entry.js +1 -1
- package/dist/esm/q2-radio-group.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-relative-time.entry.js +1 -1
- package/dist/esm/q2-section.entry.js +2 -2
- package/dist/esm/q2-select.entry.js +1 -1
- package/dist/esm/q2-stepper-pane.entry.js +1 -1
- package/dist/esm/q2-stepper.entry.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/q2-tecton-elements/click-elsewhere.q2-option-list.q2-popover.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/click-elsewhere_3.entry.js +212 -193
- package/dist/q2-tecton-elements/click-elsewhere_3.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-action-group_2.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +8 -8
- package/dist/q2-tecton-elements/q2-avatar.entry.js +8 -8
- package/dist/q2-tecton-elements/q2-btn.q2-loading.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-btn_2.entry.js +4 -2
- package/dist/q2-tecton-elements/q2-btn_2.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-calendar.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-card-image.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-carousel.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +14 -14
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-checkbox_2.entry.js +8 -8
- package/dist/q2-tecton-elements/q2-context.entry.js +15 -15
- package/dist/q2-tecton-elements/q2-currency.entry.js +11 -11
- package/dist/q2-tecton-elements/q2-data-table.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-detail.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +79 -79
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-example.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-form.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-formatted-text.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-grid-area.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-grid.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-input.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-item.entry.js +21 -21
- package/dist/q2-tecton-elements/q2-legend.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-link_2.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-message.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-meter.entry.js +7 -7
- package/dist/q2-tecton-elements/q2-modal.entry.js +50 -50
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +66 -66
- package/dist/q2-tecton-elements/q2-mutation-observer.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-pagination.entry.js +19 -19
- package/dist/q2-tecton-elements/q2-pill.entry.js +36 -36
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-radio.entry.js +8 -8
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-section.entry.js +22 -22
- package/dist/q2-tecton-elements/q2-select.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +11 -11
- package/dist/q2-tecton-elements/q2-stepper.entry.js +25 -25
- package/dist/q2-tecton-elements/q2-textarea.entry.js +2 -2
- package/dist/types/components/q2-popover/q2-popover.d.ts +1 -0
- package/dist/types/components/q2-stepper-vertical/q2-stepper-vertical.d.ts +1 -1
- package/package.json +71 -69
- /package/dist/types/{Users/kvanhouten/Documents/Work/tecton_extra → builds/q2e/development/tecton/tecton}/packages/q2-tecton-elements/.stencil/jest.e2e-coverage.d.ts +0 -0
- /package/dist/types/{Users/kvanhouten/Documents/Work/tecton_extra → builds/q2e/development/tecton/tecton}/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +0 -0
- /package/dist/types/{Users/kvanhouten/Documents/Work/tecton_extra → builds/q2e/development/tecton/tecton}/packages/q2-tecton-elements/.stencil/scripts/docs-generator/index.d.ts +0 -0
- /package/dist/types/{Users/kvanhouten/Documents/Work/tecton_extra → builds/q2e/development/tecton/tecton}/packages/q2-tecton-elements/.stencil/scripts/docs-generator/markdown-generator.d.ts +0 -0
- /package/dist/types/{Users/kvanhouten/Documents/Work/tecton_extra → builds/q2e/development/tecton/tecton}/packages/q2-tecton-elements/.stencil/scripts/docs-generator/tag-handlers.d.ts +0 -0
- /package/dist/types/{Users/kvanhouten/Documents/Work/tecton_extra → builds/q2e/development/tecton/tecton}/packages/q2-tecton-elements/.stencil/scripts/docs-generator/types.d.ts +0 -0
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { r as t, c as
|
|
1
|
+
import { r as t, c as i, g as e, h as o, H as s } from "./index-CGkHOjh1.js";
|
|
2
2
|
|
|
3
3
|
import { m as n } from "./mirror-emit-DUjY_ucm.js";
|
|
4
4
|
|
|
5
5
|
import { b as r } from "./component-DVxzK3WH.js";
|
|
6
6
|
|
|
7
|
-
import { l as a, n as h, o as c, i as
|
|
7
|
+
import { l as a, n as h, o as c, i as l, w as p, v as d, q as u, x as f, g as m } from "./index-C4PILj1_.js";
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
constructor(
|
|
11
|
-
t(this,
|
|
12
|
-
this.change =
|
|
13
|
-
this.tctChange =
|
|
9
|
+
const v = class {
|
|
10
|
+
constructor(e) {
|
|
11
|
+
t(this, e);
|
|
12
|
+
this.change = i(this, "change", 7);
|
|
13
|
+
this.tctChange = i(this, "tctChange", 7);
|
|
14
14
|
// #region Own Properties
|
|
15
15
|
this.isCurrentlyFocused = false;
|
|
16
16
|
/**
|
|
17
17
|
* Listens for mouse and window events that happen outside this click-elsewhere element so we can close popovers when users click outside them
|
|
18
18
|
*/ this.mouseEventList = [ "mousedown", "dragstart", "touchstart" ];
|
|
19
19
|
this.mouseHandler = t => {
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
20
|
+
const i = this.shadowContains(this.findActiveElement());
|
|
21
|
+
const e = this.shadowContains(this.shadowEventTarget(t)) || this.originatesInSlots(t.target);
|
|
22
|
+
if (!e && (this.isCurrentlyFocused || i)) {
|
|
23
23
|
this.isCurrentlyFocused = false;
|
|
24
24
|
n(this, [ "change", "tctChange" ]);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
this.isCurrentlyFocused =
|
|
27
|
+
this.isCurrentlyFocused = e || i;
|
|
28
28
|
};
|
|
29
29
|
this.windowBlurHandler = () => {
|
|
30
30
|
this.isCurrentlyFocused = false;
|
|
@@ -60,11 +60,11 @@ const b = class {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
originatesInSlots(t) {
|
|
63
|
-
const
|
|
64
|
-
for (const
|
|
65
|
-
const
|
|
66
|
-
for (const
|
|
67
|
-
if (
|
|
63
|
+
const i = this.hostElement.querySelectorAll("slot");
|
|
64
|
+
for (const e of Array.from(i)) {
|
|
65
|
+
const i = e && e.assignedNodes && e.assignedNodes() || this.hostElement.childNodes;
|
|
66
|
+
for (const e of Array.from(i)) {
|
|
67
|
+
if (e.contains(t)) {
|
|
68
68
|
return true;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -89,7 +89,7 @@ const b = class {
|
|
|
89
89
|
return t.composedPath()[0] || t.target;
|
|
90
90
|
}
|
|
91
91
|
get hostElement() {
|
|
92
|
-
return
|
|
92
|
+
return e(this);
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
|
|
@@ -97,15 +97,15 @@ function sanitizeRegexString(t) {
|
|
|
97
97
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
const
|
|
100
|
+
const b = "*{box-sizing:border-box}*:active{outline:none}*:focus-visible{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}: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}";
|
|
101
101
|
|
|
102
102
|
const w = class {
|
|
103
|
-
constructor(
|
|
104
|
-
t(this,
|
|
105
|
-
this.change =
|
|
106
|
-
this.popoverState =
|
|
107
|
-
this.ready =
|
|
108
|
-
this.tctChange =
|
|
103
|
+
constructor(e) {
|
|
104
|
+
t(this, e);
|
|
105
|
+
this.change = i(this, "change", 7);
|
|
106
|
+
this.popoverState = i(this, "popoverState", 7);
|
|
107
|
+
this.ready = i(this, "ready", 3);
|
|
108
|
+
this.tctChange = i(this, "tctChange", 7);
|
|
109
109
|
this.keyStore = {
|
|
110
110
|
queue: [],
|
|
111
111
|
lastPressedAt: new Date
|
|
@@ -115,9 +115,9 @@ const w = class {
|
|
|
115
115
|
/** A list of the selected options on the element. */ this.selectedOptions = [];
|
|
116
116
|
/** Translates to the role of the option list */ this.type = "listbox";
|
|
117
117
|
this.clickHandler = t => {
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
this.selectOption(
|
|
118
|
+
const i = t.target;
|
|
119
|
+
const e = i.closest("q2-option:not([separator]):not([separator=true]), q2-dropdown-item:not([separator]):not([separator=true])");
|
|
120
|
+
this.selectOption(e);
|
|
121
121
|
if (this.multiple) return;
|
|
122
122
|
this.popoverState.emit({
|
|
123
123
|
open: false,
|
|
@@ -125,18 +125,18 @@ const w = class {
|
|
|
125
125
|
});
|
|
126
126
|
};
|
|
127
127
|
/* tslint:disable:cyclomatic-complexity */ this.externalKeydownHandler = t => {
|
|
128
|
-
const {key:
|
|
128
|
+
const {key: i} = t;
|
|
129
129
|
// Allow modifier-only keys to propagate without being handled
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
130
|
+
const e = [ "Shift", "Control", "Alt", "Meta" ];
|
|
131
|
+
if (e.includes(i)) return;
|
|
132
132
|
t.stopPropagation();
|
|
133
133
|
const {activeIndex: o, customSearch: s, allOptions: n} = this;
|
|
134
134
|
let r;
|
|
135
|
-
switch (
|
|
135
|
+
switch (i) {
|
|
136
136
|
case " ":
|
|
137
137
|
if (this.searchString) {
|
|
138
138
|
if (s) break;
|
|
139
|
-
this.searchOptions(
|
|
139
|
+
this.searchOptions(i, true);
|
|
140
140
|
break;
|
|
141
141
|
} else if (this.type === "menu") {
|
|
142
142
|
this.activeIndex = 0;
|
|
@@ -215,28 +215,28 @@ const w = class {
|
|
|
215
215
|
|
|
216
216
|
default:
|
|
217
217
|
if (s) break;
|
|
218
|
-
if (!
|
|
219
|
-
this.searchOptions(
|
|
218
|
+
if (!i.match(/^[\w]$/)) break;
|
|
219
|
+
this.searchOptions(i, true);
|
|
220
220
|
break;
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
223
|
/* tslint:enable:cyclomatic-complexity */ this.focusoutHandler = t => {
|
|
224
|
-
const {relatedTarget:
|
|
225
|
-
const
|
|
226
|
-
const o = !
|
|
227
|
-
if (
|
|
224
|
+
const {relatedTarget: i} = t;
|
|
225
|
+
const e = this.allOptions.includes(i);
|
|
226
|
+
const o = !e && this.hostElement.contains(i);
|
|
227
|
+
if (e || o) {
|
|
228
228
|
t.stopPropagation();
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
231
|
this.internalKeydownHandler = t => {
|
|
232
232
|
t.stopPropagation();
|
|
233
|
-
const {activeIndex:
|
|
233
|
+
const {activeIndex: i, customSearch: e, allOptions: o, allVisibleOptions: s, multiple: n} = this;
|
|
234
234
|
const {key: r, shiftKey: a} = t;
|
|
235
235
|
let h;
|
|
236
236
|
switch (r) {
|
|
237
237
|
case " ":
|
|
238
238
|
if (this.searchString && !this.multiple) {
|
|
239
|
-
if (
|
|
239
|
+
if (e) break;
|
|
240
240
|
this.searchOptions(r, false);
|
|
241
241
|
break;
|
|
242
242
|
}
|
|
@@ -272,30 +272,30 @@ const w = class {
|
|
|
272
272
|
case "ArrowUp":
|
|
273
273
|
t.preventDefault();
|
|
274
274
|
const c = s[0];
|
|
275
|
-
const
|
|
276
|
-
if (
|
|
277
|
-
if (
|
|
275
|
+
const l = c.active;
|
|
276
|
+
if (l) break;
|
|
277
|
+
if (i === undefined) {
|
|
278
278
|
this.setDefaultActiveElement();
|
|
279
279
|
break;
|
|
280
280
|
} else {
|
|
281
281
|
const t = this.getNextVisibleIndex(-1);
|
|
282
282
|
if (t === -1) break;
|
|
283
|
-
this.adjustActiveOptionAndScroll(t -
|
|
283
|
+
this.adjustActiveOptionAndScroll(t - i);
|
|
284
284
|
break;
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
case "ArrowDown":
|
|
288
288
|
t.preventDefault();
|
|
289
|
-
const
|
|
290
|
-
const d =
|
|
289
|
+
const p = s[s.length - 1];
|
|
290
|
+
const d = p.active;
|
|
291
291
|
if (d) break;
|
|
292
|
-
if (
|
|
292
|
+
if (i === undefined) {
|
|
293
293
|
this.setDefaultActiveElement();
|
|
294
294
|
break;
|
|
295
295
|
} else {
|
|
296
296
|
const t = this.getNextVisibleIndex(1);
|
|
297
297
|
if (t === -1) break;
|
|
298
|
-
this.adjustActiveOptionAndScroll(t -
|
|
298
|
+
this.adjustActiveOptionAndScroll(t - i);
|
|
299
299
|
break;
|
|
300
300
|
}
|
|
301
301
|
|
|
@@ -311,12 +311,12 @@ const w = class {
|
|
|
311
311
|
|
|
312
312
|
case "PageUp":
|
|
313
313
|
t.preventDefault();
|
|
314
|
-
this.openDropdownWithActiveElement(Math.max(
|
|
314
|
+
this.openDropdownWithActiveElement(Math.max(i - 10, 0));
|
|
315
315
|
break;
|
|
316
316
|
|
|
317
317
|
case "PageDown":
|
|
318
318
|
t.preventDefault();
|
|
319
|
-
this.openDropdownWithActiveElement(Math.min(
|
|
319
|
+
this.openDropdownWithActiveElement(Math.min(i + 10, o.length - 1));
|
|
320
320
|
break;
|
|
321
321
|
|
|
322
322
|
case "Tab":
|
|
@@ -344,37 +344,37 @@ const w = class {
|
|
|
344
344
|
break;
|
|
345
345
|
|
|
346
346
|
default:
|
|
347
|
-
if (
|
|
347
|
+
if (e) break;
|
|
348
348
|
if (!r.match(/^[\w]$/)) break;
|
|
349
349
|
this.searchOptions(r, false);
|
|
350
350
|
break;
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
this.searchAndFocus = (t,
|
|
353
|
+
this.searchAndFocus = (t, i) => {
|
|
354
354
|
// pseudo search in non-searchable select
|
|
355
355
|
const reorder = () => {
|
|
356
356
|
this.pivotIndex = this.pivotIndex === undefined ? 0 : (this.activeIndex || 0) + 1;
|
|
357
|
-
const t = this.allOptions.map(((t,
|
|
357
|
+
const t = this.allOptions.map(((t, i) => ({
|
|
358
358
|
element: t,
|
|
359
|
-
index:
|
|
359
|
+
index: i
|
|
360
360
|
})));
|
|
361
361
|
return [ ...t.slice(this.pivotIndex), ...t.slice(0, this.pivotIndex) ];
|
|
362
362
|
};
|
|
363
363
|
const buildQueue = () => {
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
364
|
+
const i = new Date;
|
|
365
|
+
if (i.getTime() - this.keyStore.lastPressedAt.getTime() > 1e3) {
|
|
366
366
|
// empty stored keys if delay > 1s
|
|
367
367
|
this.keyStore.queue.length = 0;
|
|
368
368
|
}
|
|
369
369
|
if (this.keyStore.queue.length !== 1 || this.keyStore.queue[0] !== t) {
|
|
370
370
|
this.keyStore.queue.push(t);
|
|
371
371
|
}
|
|
372
|
-
this.keyStore.lastPressedAt =
|
|
372
|
+
this.keyStore.lastPressedAt = i;
|
|
373
373
|
};
|
|
374
374
|
const searchIndex = t => {
|
|
375
|
-
const
|
|
376
|
-
const
|
|
377
|
-
return t.find((t => !t.element.disabled && t.element.display && (t.element.display.match(new RegExp(`^${
|
|
375
|
+
const i = this.keyStore.queue.join("");
|
|
376
|
+
const e = sanitizeRegexString(i);
|
|
377
|
+
return t.find((t => !t.element.disabled && t.element.display && (t.element.display.match(new RegExp(`^${e}`, "i")) || t.element.display.replace(/\s/g, "").match(new RegExp(`^${e}`, "i")))));
|
|
378
378
|
};
|
|
379
379
|
const setFocus = ({index: t}) => {
|
|
380
380
|
if (this.multiple) {
|
|
@@ -382,7 +382,7 @@ const w = class {
|
|
|
382
382
|
this.openDropdownWithActiveElement(t);
|
|
383
383
|
} else {
|
|
384
384
|
this.activeIndex = t;
|
|
385
|
-
if (
|
|
385
|
+
if (i) {
|
|
386
386
|
this.selectOption(this.allOptions[t]);
|
|
387
387
|
this.popoverState.emit({
|
|
388
388
|
open: false,
|
|
@@ -392,9 +392,9 @@ const w = class {
|
|
|
392
392
|
}
|
|
393
393
|
};
|
|
394
394
|
buildQueue();
|
|
395
|
-
const
|
|
396
|
-
if (
|
|
397
|
-
setFocus(
|
|
395
|
+
const e = searchIndex(reorder());
|
|
396
|
+
if (e) {
|
|
397
|
+
setFocus(e);
|
|
398
398
|
}
|
|
399
399
|
};
|
|
400
400
|
}
|
|
@@ -420,13 +420,13 @@ const w = class {
|
|
|
420
420
|
t.stopPropagation();
|
|
421
421
|
}
|
|
422
422
|
delegateFocus(t) {
|
|
423
|
-
if (!
|
|
423
|
+
if (!l(t, this.hostElement)) return;
|
|
424
424
|
this.popoverState.emit({
|
|
425
425
|
open: true,
|
|
426
426
|
action: "open"
|
|
427
427
|
});
|
|
428
|
-
const {activeIndex:
|
|
429
|
-
if (typeof
|
|
428
|
+
const {activeIndex: i} = this;
|
|
429
|
+
if (typeof i === "number" && i > -1) {
|
|
430
430
|
this.setActiveOption();
|
|
431
431
|
this.setFocusedOption();
|
|
432
432
|
} else {
|
|
@@ -468,25 +468,25 @@ const w = class {
|
|
|
468
468
|
this.showSelected = false;
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
471
|
-
this.allOptions.forEach((
|
|
472
|
-
if (!("_multiSelectHidden" in
|
|
473
|
-
|
|
471
|
+
this.allOptions.forEach((i => {
|
|
472
|
+
if (!("_multiSelectHidden" in i)) return;
|
|
473
|
+
i._multiSelectHidden = t ? !i.selected : false;
|
|
474
474
|
}));
|
|
475
475
|
}
|
|
476
476
|
// #endregion
|
|
477
477
|
// #region Local Methods
|
|
478
478
|
get allContents() {
|
|
479
479
|
const t = this.getRootSlot(this.hostElement);
|
|
480
|
-
const
|
|
481
|
-
return t.filter((t =>
|
|
480
|
+
const i = new Set([ "Q2-OPTGROUP", "Q2-OPTION", "Q2-DROPDOWN-ITEM" ]);
|
|
481
|
+
return t.filter((t => i.has(t.tagName)));
|
|
482
482
|
}
|
|
483
483
|
get allOptions() {
|
|
484
484
|
const t = this.allContents;
|
|
485
|
-
const extractOptions = t => t.reduce(((t,
|
|
486
|
-
if (
|
|
487
|
-
return
|
|
488
|
-
} else if (
|
|
489
|
-
return [ ...t, ...extractOptions(Array.from(
|
|
485
|
+
const extractOptions = t => t.reduce(((t, i) => {
|
|
486
|
+
if (i.tagName === "Q2-OPTION" || i.tagName === "Q2-DROPDOWN-ITEM") {
|
|
487
|
+
return i.separator ? t : [ ...t, i ];
|
|
488
|
+
} else if (i.tagName === "Q2-OPTGROUP") {
|
|
489
|
+
return [ ...t, ...extractOptions(Array.from(i.children)) ];
|
|
490
490
|
} else {
|
|
491
491
|
return t;
|
|
492
492
|
}
|
|
@@ -505,22 +505,22 @@ const w = class {
|
|
|
505
505
|
checkOptions() {
|
|
506
506
|
const {type: t} = this;
|
|
507
507
|
if (!t) return;
|
|
508
|
-
const
|
|
508
|
+
const i = t === "menu" ? "menuitem" : "option";
|
|
509
509
|
this.allOptions.forEach((t => {
|
|
510
|
-
t.role =
|
|
510
|
+
t.role = i;
|
|
511
511
|
}));
|
|
512
512
|
}
|
|
513
513
|
focusSelectedSibling(t) {
|
|
514
|
-
const {allVisibleOptions:
|
|
515
|
-
const o =
|
|
514
|
+
const {allVisibleOptions: i, allOptions: e} = this;
|
|
515
|
+
const o = i.length < 2;
|
|
516
516
|
if (o) {
|
|
517
517
|
this.showSelected = false;
|
|
518
518
|
return;
|
|
519
519
|
}
|
|
520
|
-
const s =
|
|
520
|
+
const s = i.indexOf(t);
|
|
521
521
|
const n = s ? s - 1 : s + 1;
|
|
522
|
-
const r =
|
|
523
|
-
const a =
|
|
522
|
+
const r = i[n];
|
|
523
|
+
const a = e.indexOf(r);
|
|
524
524
|
this.activeIndex = a;
|
|
525
525
|
this.setFocusedOption();
|
|
526
526
|
this.scheduledAfterRender.push((() => {
|
|
@@ -530,29 +530,29 @@ const w = class {
|
|
|
530
530
|
}
|
|
531
531
|
getDefaultActiveIndex() {
|
|
532
532
|
const {allOptions: t} = this;
|
|
533
|
-
const
|
|
534
|
-
if (e > -1) return e;
|
|
535
|
-
const i = t.findIndex((t => !t.hidden));
|
|
533
|
+
const i = t.findIndex((t => "selected" in t && t.selected));
|
|
536
534
|
if (i > -1) return i;
|
|
535
|
+
const e = t.findIndex((t => !t.hidden));
|
|
536
|
+
if (e > -1) return e;
|
|
537
537
|
return 0;
|
|
538
538
|
}
|
|
539
539
|
getNextVisibleIndex(t) {
|
|
540
|
-
const {allVisibleOptions:
|
|
541
|
-
const s =
|
|
542
|
-
const n =
|
|
540
|
+
const {allVisibleOptions: i, allOptions: e, activeIndex: o} = this;
|
|
541
|
+
const s = e[o];
|
|
542
|
+
const n = i.indexOf(s);
|
|
543
543
|
let r = n + t;
|
|
544
544
|
if (r < 0) {
|
|
545
|
-
r =
|
|
546
|
-
} else if (r >
|
|
545
|
+
r = i.length - 1;
|
|
546
|
+
} else if (r > i.length - 1) {
|
|
547
547
|
r = 0;
|
|
548
548
|
}
|
|
549
|
-
const a =
|
|
550
|
-
return
|
|
549
|
+
const a = i[r];
|
|
550
|
+
return e.indexOf(a);
|
|
551
551
|
}
|
|
552
552
|
getRootSlot(t) {
|
|
553
|
-
var
|
|
554
|
-
const
|
|
555
|
-
const o = (
|
|
553
|
+
var i;
|
|
554
|
+
const e = t.querySelector("slot");
|
|
555
|
+
const o = (i = e === null || e === void 0 ? void 0 : e.assignedElements()) !== null && i !== void 0 ? i : Array.from(t.children);
|
|
556
556
|
const s = !!o.length && o[0].tagName === "SLOT";
|
|
557
557
|
if (s) {
|
|
558
558
|
return this.getRootSlot(o[0]);
|
|
@@ -566,7 +566,7 @@ const w = class {
|
|
|
566
566
|
open: true,
|
|
567
567
|
action: "open"
|
|
568
568
|
});
|
|
569
|
-
await
|
|
569
|
+
await p();
|
|
570
570
|
this.activeIndex = t;
|
|
571
571
|
this.setActiveOption();
|
|
572
572
|
this.setFocusedOption();
|
|
@@ -583,18 +583,18 @@ const w = class {
|
|
|
583
583
|
scrollToActiveOption() {
|
|
584
584
|
const t = this.allOptions[this.activeIndex];
|
|
585
585
|
if (!t) return;
|
|
586
|
-
const {scrollX:
|
|
586
|
+
const {scrollX: i, scrollY: e} = window;
|
|
587
587
|
t.scrollIntoView({
|
|
588
588
|
block: "center"
|
|
589
589
|
});
|
|
590
|
-
window.scrollTo(
|
|
590
|
+
window.scrollTo(i, e);
|
|
591
591
|
}
|
|
592
|
-
searchOptions(t,
|
|
592
|
+
searchOptions(t, i) {
|
|
593
593
|
this.searchString = t;
|
|
594
|
-
this.searchAndFocus(t,
|
|
594
|
+
this.searchAndFocus(t, i);
|
|
595
595
|
}
|
|
596
596
|
selectOption(t) {
|
|
597
|
-
const {multiple:
|
|
597
|
+
const {multiple: i, noSelect: e, showSelected: o} = this;
|
|
598
598
|
if (!t || t.disabled || "disabledGroup" in t && t.disabledGroup) return;
|
|
599
599
|
const s = t.value;
|
|
600
600
|
const r = "display" in t && t.display ? t.display : t.innerText.trim();
|
|
@@ -603,19 +603,19 @@ const w = class {
|
|
|
603
603
|
display: r
|
|
604
604
|
};
|
|
605
605
|
let h = [];
|
|
606
|
-
if (
|
|
607
|
-
const {selectedOptions:
|
|
608
|
-
const
|
|
609
|
-
if (
|
|
610
|
-
h =
|
|
606
|
+
if (i) {
|
|
607
|
+
const {selectedOptions: i} = this;
|
|
608
|
+
const e = i.find((t => t.value === s));
|
|
609
|
+
if (e) {
|
|
610
|
+
h = i.filter((({value: t}) => t !== s));
|
|
611
611
|
} else {
|
|
612
|
-
h = [ ...
|
|
612
|
+
h = [ ...i, a ];
|
|
613
613
|
}
|
|
614
614
|
if (o) this.focusSelectedSibling(t);
|
|
615
615
|
} else {
|
|
616
616
|
h = [ a ];
|
|
617
617
|
}
|
|
618
|
-
if (
|
|
618
|
+
if (e) this.setActiveElement(null); else this.selectedOptions = h;
|
|
619
619
|
n(this, [ "change", "tctChange" ], {
|
|
620
620
|
value: s,
|
|
621
621
|
values: h
|
|
@@ -623,35 +623,35 @@ const w = class {
|
|
|
623
623
|
}
|
|
624
624
|
setActiveOption() {
|
|
625
625
|
const t = this.activeIndex;
|
|
626
|
-
this.allOptions.forEach(((
|
|
627
|
-
|
|
626
|
+
this.allOptions.forEach(((i, e) => {
|
|
627
|
+
i.active = t === e;
|
|
628
628
|
}));
|
|
629
629
|
}
|
|
630
630
|
setFocusedOption() {
|
|
631
631
|
const t = this.allOptions[this.activeIndex];
|
|
632
632
|
if (!t) return;
|
|
633
|
-
const
|
|
634
|
-
if (
|
|
633
|
+
const i = d(t);
|
|
634
|
+
if (i) t.focus({
|
|
635
635
|
preventScroll: true
|
|
636
636
|
}); else h((() => t.focus({
|
|
637
637
|
preventScroll: true
|
|
638
638
|
})));
|
|
639
639
|
}
|
|
640
640
|
updateMultipleOptionAttrs() {
|
|
641
|
-
const {allOptions: t, selectedOptions:
|
|
642
|
-
const
|
|
641
|
+
const {allOptions: t, selectedOptions: i} = this;
|
|
642
|
+
const e = i.map((({value: t}) => t));
|
|
643
643
|
if (this.noSelect) return;
|
|
644
644
|
t.forEach((t => {
|
|
645
645
|
if (!("selected" in t)) return;
|
|
646
|
-
t.selected =
|
|
646
|
+
t.selected = e.includes(t.value);
|
|
647
647
|
}));
|
|
648
648
|
}
|
|
649
649
|
updateSingleOptionAttrs() {
|
|
650
650
|
var t;
|
|
651
|
-
const {allOptions:
|
|
652
|
-
const o = ((t =
|
|
651
|
+
const {allOptions: i, selectedOptions: e} = this;
|
|
652
|
+
const o = ((t = e[0]) === null || t === void 0 ? void 0 : t.value) || undefined;
|
|
653
653
|
if (this.noSelect) return;
|
|
654
|
-
|
|
654
|
+
i.forEach((t => {
|
|
655
655
|
if (!("selected" in t)) return;
|
|
656
656
|
t.selected = t.value === o;
|
|
657
657
|
}));
|
|
@@ -660,14 +660,14 @@ const w = class {
|
|
|
660
660
|
// #region Render Methods
|
|
661
661
|
render() {
|
|
662
662
|
return o(s, {
|
|
663
|
-
key: "
|
|
663
|
+
key: "99c8a52ef8c6adbd138bdd4ff40340fabe670903"
|
|
664
664
|
}, o("div", {
|
|
665
|
-
key: "
|
|
665
|
+
key: "632777fab876b3ef838e8658de35df410fc1d3b7",
|
|
666
666
|
class: "content",
|
|
667
667
|
ref: t => this.contentElement = t,
|
|
668
668
|
onFocusout: this.focusoutHandler
|
|
669
669
|
}, o("div", {
|
|
670
|
-
key: "
|
|
670
|
+
key: "97079fcb63d10e57ae3e3f1fcbc0a4c307dcda3c",
|
|
671
671
|
class: "options",
|
|
672
672
|
"aria-label": a("tecton.element.optionList.label", [ this.label ]),
|
|
673
673
|
"aria-multiselectable": this.type === "menu" ? undefined : `${!!this.multiple}`,
|
|
@@ -675,11 +675,11 @@ const w = class {
|
|
|
675
675
|
onKeyDown: this.internalKeydownHandler,
|
|
676
676
|
onClick: this.clickHandler
|
|
677
677
|
}, o("slot", {
|
|
678
|
-
key: "
|
|
678
|
+
key: "07f07e638defb8427f320db9bf3cfb87f6711f9e"
|
|
679
679
|
}))));
|
|
680
680
|
}
|
|
681
681
|
get hostElement() {
|
|
682
|
-
return
|
|
682
|
+
return e(this);
|
|
683
683
|
}
|
|
684
684
|
static get watchers() {
|
|
685
685
|
return {
|
|
@@ -689,19 +689,20 @@ const w = class {
|
|
|
689
689
|
}
|
|
690
690
|
};
|
|
691
691
|
|
|
692
|
-
w.style =
|
|
692
|
+
w.style = b;
|
|
693
693
|
|
|
694
694
|
const g = "*{box-sizing:border-box}*:active{outline:none}*:focus-visible{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}: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}.legacy.container{display:none}.legacy.show{display:block;z-index:var(--tct-popover-z-index, 50)}@keyframes popoverOpen{from{opacity:0;transform:scale(0.95)}to{opacity:1;transform:scale(1)}}@keyframes popoverClose{from{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(0.95)}}:popover-open,.show{position:absolute;margin:0;padding:var(--tct-popover-padding, 0);overflow:auto;background:var(--tct-popover-background, var(--app-white, #ffffff));backdrop-filter:var(--tct-popover-backdrop-filter, none);color:var(--tct-popover-font-color, var(--t-text, #4d4d4d));min-width:var(--tct-popover-min-width, 135px);margin-block:var(--tct-popover-margin-block, 0);box-shadow:var(--tct-popover-box-shadow, var(--app-shadow-3, 0px 0px 2px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.14)));border-width:var(--tct-popover-border-width, 0);border-style:solid;border-color:var(--tct-popover-border-color, transparent);border-radius:var(--tct-popover-border-radius, 0);max-height:var(--comp-pop-max-height);left:var(--comp-pop-left);opacity:var(--comp-pop-opacity, 0);--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, 4px)));--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}:popover-open.animating-open,.show.animating-open{animation-name:popoverOpen;animation-duration:var(--tct-popover-open-animation-duration, var(--t-tween-time-in-1, 150ms));animation-timing-function:var(--tct-popover-open-animation-timing-function, ease-out);animation-fill-mode:var(--tct-popover-open-animation-fill-mode, forwards)}:popover-open.animating-close,.show.animating-close{animation-name:popoverClose;animation-duration:var(--tct-popover-close-animation-duration, var(--t-tween-time-out-1, 100ms));animation-timing-function:var(--tct-popover-close-animation-timing-function, ease-in);animation-fill-mode:var(--tct-popover-close-animation-fill-mode, forwards)}@media (prefers-reduced-motion: reduce){:popover-open.animating-open,:popover-open.animating-close,.show.animating-open,.show.animating-close{animation:none}}:popover-open.block,.show.block{right:unset;width:var(--comp-pop-width);min-width:var(--tct-popover-min-width, unset)}:popover-open.left,.show.left{left:var(--comp-pop-left);right:unset}:popover-open.right,.show.right{right:var(--comp-pop-right);left:unset}:popover-open.down,.show.down{top:var(--tct-popover-top, var(--comp-pop-top));bottom:unset}:popover-open.up,.show.up{top:unset;bottom:var(--comp-pop-bottom)}:popover-open.down.left:not(.mobile),.show.down.left:not(.mobile){transform-origin:top left}:popover-open.down.right:not(.mobile),.show.down.right:not(.mobile){transform-origin:top right}:popover-open.up.left:not(.mobile),.show.up.left:not(.mobile){transform-origin:bottom left}:popover-open.up.right:not(.mobile),.show.up.right:not(.mobile){transform-origin:bottom right}:popover-open.mobile.down,.show.mobile.down{transform-origin:center top}:popover-open.mobile.up,.show.mobile.up{transform-origin:center bottom}:popover-open::-webkit-scrollbar,.show::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}:popover-open::-webkit-scrollbar-thumb,.show::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}:popover-open::-webkit-scrollbar-track,.show::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}click-elsewhere{position:relative;display:block}";
|
|
695
695
|
|
|
696
696
|
const k = class {
|
|
697
|
-
constructor(
|
|
698
|
-
t(this,
|
|
699
|
-
this.popoverStateChanged =
|
|
700
|
-
this.tctPopoverStateChanged =
|
|
697
|
+
constructor(e) {
|
|
698
|
+
t(this, e);
|
|
699
|
+
this.popoverStateChanged = i(this, "popoverStateChanged", 7);
|
|
700
|
+
this.tctPopoverStateChanged = i(this, "tctPopoverStateChanged", 7);
|
|
701
701
|
/**
|
|
702
702
|
* The number of pixels to leave between the popover and the edge of the viewport
|
|
703
703
|
*/ this.displayBuffer = 10;
|
|
704
704
|
this.orientationChanged = false;
|
|
705
|
+
this.pendingAnimationResolve = null;
|
|
705
706
|
// #endregion
|
|
706
707
|
// #region State Properties
|
|
707
708
|
this.animationState = "idle";
|
|
@@ -728,37 +729,39 @@ const k = class {
|
|
|
728
729
|
});
|
|
729
730
|
};
|
|
730
731
|
this.setAbsoluteCSSProperties = async () => {
|
|
731
|
-
const {controlElement: t, containerElement:
|
|
732
|
+
const {controlElement: t, containerElement: i, currentDirection: e, align: o} = this;
|
|
733
|
+
if (!i) return;
|
|
732
734
|
if (o === "right") {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
+
i.style.setProperty("--comp-pop-right", "0");
|
|
736
|
+
i.style.setProperty("--comp-pop-left", "unset");
|
|
735
737
|
} else {
|
|
736
|
-
|
|
737
|
-
|
|
738
|
+
i.style.setProperty("--comp-pop-left", "0");
|
|
739
|
+
i.style.setProperty("--comp-pop-right", "unset");
|
|
738
740
|
}
|
|
739
741
|
if (this.block) {
|
|
740
|
-
|
|
742
|
+
i.style.setProperty("--comp-pop-width", "100%");
|
|
741
743
|
}
|
|
742
|
-
if (
|
|
743
|
-
const
|
|
744
|
-
const o = parseInt(
|
|
745
|
-
|
|
744
|
+
if (e === "up") {
|
|
745
|
+
const e = getComputedStyle(t);
|
|
746
|
+
const o = parseInt(e.height || "0") + parseInt(e.borderTopWidth || "0") + parseInt(e.borderBottomWidth || "0");
|
|
747
|
+
i.style.setProperty("--comp-pop-bottom", `${o}px`);
|
|
746
748
|
}
|
|
747
749
|
// Wait for one paint to prevent layout thrashing
|
|
748
|
-
await
|
|
749
|
-
|
|
750
|
+
await p();
|
|
751
|
+
if (this.containerElement) i.style.setProperty("--comp-pop-opacity", "1");
|
|
750
752
|
};
|
|
751
753
|
this.setPopoverAPICSSProperties = async () => {
|
|
752
|
-
var t,
|
|
754
|
+
var t, i, e;
|
|
753
755
|
const {controlElement: o, containerElement: s, currentDirection: n, isModule: r, align: a} = this;
|
|
754
|
-
|
|
756
|
+
if (!s) return;
|
|
757
|
+
const {top: h, bottom: c, left: l, right: d} = (i = (t = o === null || o === void 0 ? void 0 : o.getBoundingClientRect) === null || t === void 0 ? void 0 : t.call(o)) !== null && i !== void 0 ? i : {
|
|
755
758
|
top: 0,
|
|
756
759
|
bottom: 0,
|
|
757
760
|
left: 0,
|
|
758
761
|
right: 0
|
|
759
762
|
};
|
|
760
|
-
const u =
|
|
761
|
-
const m = ((
|
|
763
|
+
const u = l;
|
|
764
|
+
const m = ((e = window === null || window === void 0 ? void 0 : window.visualViewport) === null || e === void 0 ? void 0 : e.width) - d;
|
|
762
765
|
if (a === "right") {
|
|
763
766
|
s.style.setProperty("--comp-pop-right", `${m - window.scrollX}px`);
|
|
764
767
|
s.style.setProperty("--comp-pop-left", "unset");
|
|
@@ -767,24 +770,24 @@ const k = class {
|
|
|
767
770
|
s.style.setProperty("--comp-pop-right", "unset");
|
|
768
771
|
}
|
|
769
772
|
if (this.block) s.style.setProperty("--comp-pop-width", `${(o === null || o === void 0 ? void 0 : o.offsetWidth) || 0}px`);
|
|
770
|
-
const
|
|
773
|
+
const v = r && f(this.hostElement);
|
|
771
774
|
if (n === "up") {
|
|
772
|
-
if (r && !
|
|
775
|
+
if (r && !v) {
|
|
773
776
|
s.style.setProperty("--comp-pop-bottom", `${window.innerHeight - h}px`);
|
|
774
777
|
} else {
|
|
775
778
|
s.style.setProperty("--comp-pop-bottom", `${window.innerHeight - h - window.scrollY}px`);
|
|
776
779
|
}
|
|
777
780
|
}
|
|
778
781
|
if (n === "down") {
|
|
779
|
-
if (r && !
|
|
782
|
+
if (r && !v) {
|
|
780
783
|
s.style.setProperty("--comp-pop-top", `${c}px`);
|
|
781
784
|
} else {
|
|
782
785
|
s.style.setProperty("--comp-pop-top", `${c + window.scrollY}px`);
|
|
783
786
|
}
|
|
784
787
|
}
|
|
785
788
|
// Wait for one paint to prevent layout thrashing
|
|
786
|
-
await
|
|
787
|
-
s.style.setProperty("--comp-pop-opacity", "1");
|
|
789
|
+
await p();
|
|
790
|
+
if (this.containerElement) s.style.setProperty("--comp-pop-opacity", "1");
|
|
788
791
|
};
|
|
789
792
|
this.viewPortChanged = () => {
|
|
790
793
|
if (!this.open) return;
|
|
@@ -798,8 +801,13 @@ const k = class {
|
|
|
798
801
|
// #endregion
|
|
799
802
|
// #region Component Lifecycle Events
|
|
800
803
|
disconnectedCallback() {
|
|
804
|
+
var t;
|
|
801
805
|
this.removeViewportListeners();
|
|
802
|
-
|
|
806
|
+
if (this.pendingAnimationResolve) {
|
|
807
|
+
this.pendingAnimationResolve();
|
|
808
|
+
this.pendingAnimationResolve = null;
|
|
809
|
+
}
|
|
810
|
+
(t = this.containerElement) === null || t === void 0 ? void 0 : t.removeEventListener("toggle", this.handlePopoverToggleEvent);
|
|
803
811
|
this.containerElement = null;
|
|
804
812
|
this.contentElement = null;
|
|
805
813
|
this.controlElement = null;
|
|
@@ -811,22 +819,24 @@ const k = class {
|
|
|
811
819
|
}
|
|
812
820
|
}
|
|
813
821
|
componentDidLoad() {
|
|
822
|
+
var t;
|
|
814
823
|
this.handleMinHeight();
|
|
815
|
-
if (this.supportsPopoverAPI) this.containerElement.addEventListener("toggle", this.handlePopoverToggleEvent);
|
|
824
|
+
if (this.supportsPopoverAPI) (t = this.containerElement) === null || t === void 0 ? void 0 : t.addEventListener("toggle", this.handlePopoverToggleEvent);
|
|
816
825
|
if (this.open) this.determinePopDirection();
|
|
817
826
|
}
|
|
818
827
|
// #endregion
|
|
819
828
|
// #region Listeners
|
|
820
829
|
popoverStateHandler(t) {
|
|
821
|
-
const {detail: {open:
|
|
822
|
-
if (
|
|
823
|
-
this.open =
|
|
830
|
+
const {detail: {open: i}} = t;
|
|
831
|
+
if (i === this.open) return;
|
|
832
|
+
this.open = i;
|
|
824
833
|
t.stopPropagation();
|
|
825
834
|
}
|
|
826
835
|
// #endregion
|
|
827
836
|
// #region Public Methods API
|
|
828
837
|
async scrollContainerTo(t) {
|
|
829
|
-
|
|
838
|
+
var i;
|
|
839
|
+
(i = this.containerElement) === null || i === void 0 ? void 0 : i.scrollTo(t);
|
|
830
840
|
}
|
|
831
841
|
async toggle() {
|
|
832
842
|
this.open = !this.open;
|
|
@@ -850,16 +860,22 @@ const k = class {
|
|
|
850
860
|
// Wait for close animation to complete
|
|
851
861
|
if (this.animated) {
|
|
852
862
|
await new Promise((t => {
|
|
863
|
+
var i;
|
|
853
864
|
const handleAnimationEnd = () => {
|
|
854
|
-
|
|
865
|
+
var i;
|
|
866
|
+
this.pendingAnimationResolve = null;
|
|
867
|
+
(i = this.containerElement) === null || i === void 0 ? void 0 : i.removeEventListener("animationend", handleAnimationEnd);
|
|
855
868
|
t();
|
|
856
869
|
};
|
|
857
|
-
this.
|
|
870
|
+
this.pendingAnimationResolve = handleAnimationEnd;
|
|
871
|
+
(i = this.containerElement) === null || i === void 0 ? void 0 : i.addEventListener("animationend", handleAnimationEnd);
|
|
872
|
+
if (!this.containerElement) t();
|
|
858
873
|
}));
|
|
859
874
|
} else {
|
|
860
875
|
// No animation, proceed immediately
|
|
861
|
-
await
|
|
876
|
+
await p();
|
|
862
877
|
}
|
|
878
|
+
if (!this.containerElement) return;
|
|
863
879
|
this.currentDirection = undefined;
|
|
864
880
|
this.animationState = "idle";
|
|
865
881
|
if (this.mode === "legacy" || !this.supportsPopoverAPI) {
|
|
@@ -867,17 +883,17 @@ const k = class {
|
|
|
867
883
|
} else {
|
|
868
884
|
this.containerElement.hidePopover();
|
|
869
885
|
}
|
|
870
|
-
await
|
|
886
|
+
await p();
|
|
871
887
|
this.clearCSSProperties();
|
|
872
888
|
}
|
|
873
889
|
}
|
|
874
890
|
// #endregion
|
|
875
891
|
// #region Local Methods
|
|
876
892
|
get isModule() {
|
|
877
|
-
var t,
|
|
878
|
-
const
|
|
879
|
-
const o = Object.keys((
|
|
880
|
-
return
|
|
893
|
+
var t, i;
|
|
894
|
+
const e = window !== window.top;
|
|
895
|
+
const o = Object.keys((i = (t = window.Tecton) === null || t === void 0 ? void 0 : t.platformDimensions) !== null && i !== void 0 ? i : {}).length > 0;
|
|
896
|
+
return e && o;
|
|
881
897
|
}
|
|
882
898
|
get providedDirection() {
|
|
883
899
|
const {direction: t} = this;
|
|
@@ -911,6 +927,7 @@ const k = class {
|
|
|
911
927
|
window.addEventListener("orientationchange", this.viewPortOrientationChanged);
|
|
912
928
|
}
|
|
913
929
|
clearCSSProperties() {
|
|
930
|
+
if (!this.containerElement) return;
|
|
914
931
|
this.containerElement.style.removeProperty("--comp-pop-max-height");
|
|
915
932
|
this.containerElement.style.removeProperty("--comp-pop-top");
|
|
916
933
|
this.containerElement.style.removeProperty("--comp-pop-bottom");
|
|
@@ -920,58 +937,59 @@ const k = class {
|
|
|
920
937
|
this.containerElement.style.removeProperty("--comp-pop-opacity");
|
|
921
938
|
}
|
|
922
939
|
async determinePopDirection() {
|
|
923
|
-
var t,
|
|
940
|
+
var t, i, e;
|
|
924
941
|
const {containerElement: o, controlElement: s, providedDirection: n, displayBuffer: r} = this;
|
|
925
942
|
if (o) o.style.maxHeight = null;
|
|
926
|
-
await
|
|
943
|
+
await p();
|
|
944
|
+
if (!this.containerElement) return;
|
|
927
945
|
const {isModule: a} = this;
|
|
928
|
-
const {top: h, bottom: c} = (
|
|
946
|
+
const {top: h, bottom: c} = (i = (t = s === null || s === void 0 ? void 0 : s.getBoundingClientRect) === null || t === void 0 ? void 0 : t.call(s)) !== null && i !== void 0 ? i : {
|
|
929
947
|
top: 0,
|
|
930
948
|
bottom: 0
|
|
931
949
|
};
|
|
932
|
-
let
|
|
950
|
+
let l;
|
|
933
951
|
let d;
|
|
934
952
|
let u;
|
|
935
953
|
const m = a && f(this.hostElement);
|
|
936
954
|
if (a && !m) {
|
|
937
|
-
const {outletOffset: t = 0, innerHeight:
|
|
955
|
+
const {outletOffset: t = 0, innerHeight: i = window.innerHeight, top: o = 0, bottom: s = 0} = ((e = window.Tecton) === null || e === void 0 ? void 0 : e.platformDimensions) || {};
|
|
938
956
|
const n = window.innerHeight - c;
|
|
939
957
|
// controlElement position visually on the page
|
|
940
958
|
const a = t > 0 ? h : h + t - o;
|
|
941
|
-
const
|
|
959
|
+
const l = t + c - o;
|
|
942
960
|
// visual space around the controlElement
|
|
943
|
-
const
|
|
944
|
-
const f =
|
|
961
|
+
const p = a;
|
|
962
|
+
const f = i - s - l;
|
|
945
963
|
// calculate space above and below controlElement
|
|
946
964
|
const m = n < f;
|
|
947
|
-
d =
|
|
965
|
+
d = p - r;
|
|
948
966
|
u = m ? n - r : f - r;
|
|
949
967
|
} else {
|
|
950
|
-
|
|
968
|
+
l = window.innerHeight;
|
|
951
969
|
d = h - r;
|
|
952
|
-
u =
|
|
970
|
+
u = l - c - r;
|
|
953
971
|
}
|
|
954
|
-
const
|
|
972
|
+
const v = d > u ? "up" : "down";
|
|
955
973
|
// We do not want to update the max height once the popover is open unless the page orientation shifts (resize or mobile use cases)
|
|
956
|
-
const
|
|
974
|
+
const b = !(o === null || o === void 0 ? void 0 : o.style.getPropertyValue("--comp-pop-max-height")) || this.orientationChanged;
|
|
957
975
|
// we do not want to constantly update the max-height after an orientation change, so we switch this back to false
|
|
958
976
|
this.orientationChanged = false;
|
|
959
|
-
const w = this.currentDirection || n ||
|
|
977
|
+
const w = this.currentDirection || n || v;
|
|
960
978
|
switch (w) {
|
|
961
979
|
case "up":
|
|
962
|
-
if (
|
|
980
|
+
if (b && o) {
|
|
963
981
|
const t = this.validatedMaxHeight || d;
|
|
964
|
-
const
|
|
965
|
-
o.style.setProperty("--comp-pop-max-height", `${
|
|
982
|
+
const i = Math.min(d, t);
|
|
983
|
+
o.style.setProperty("--comp-pop-max-height", `${i}px`);
|
|
966
984
|
}
|
|
967
985
|
this.setDirectionAndShow("up");
|
|
968
986
|
break;
|
|
969
987
|
|
|
970
988
|
case "down":
|
|
971
|
-
if (
|
|
989
|
+
if (b && o) {
|
|
972
990
|
const t = this.validatedMaxHeight || u;
|
|
973
|
-
const
|
|
974
|
-
o.style.setProperty("--comp-pop-max-height", `${
|
|
991
|
+
const i = Math.min(u, t);
|
|
992
|
+
o.style.setProperty("--comp-pop-max-height", `${i}px`);
|
|
975
993
|
}
|
|
976
994
|
this.setDirectionAndShow("down");
|
|
977
995
|
break;
|
|
@@ -988,17 +1006,18 @@ const k = class {
|
|
|
988
1006
|
window.removeEventListener("orientationchange", this.viewPortOrientationChanged);
|
|
989
1007
|
}
|
|
990
1008
|
setDirectionAndShow(t) {
|
|
1009
|
+
var i;
|
|
991
1010
|
// Due to some runtime inconsistency across devices/browsers we need to add one more check here because the
|
|
992
1011
|
// popover can be closed between the time the popover is opened and the time the direction is determined
|
|
993
|
-
|
|
994
|
-
if (!e) return;
|
|
1012
|
+
const e = this.open;
|
|
1013
|
+
if (!e || !this.containerElement) return;
|
|
995
1014
|
this.currentDirection = t;
|
|
996
1015
|
if (this.mode === "legacy" || !this.supportsPopoverAPI) {
|
|
997
1016
|
this.show = true;
|
|
998
1017
|
this.setAbsoluteCSSProperties();
|
|
999
1018
|
} else {
|
|
1000
1019
|
this.setPopoverAPICSSProperties();
|
|
1001
|
-
this.containerElement.showPopover();
|
|
1020
|
+
(i = this.containerElement) === null || i === void 0 ? void 0 : i.showPopover();
|
|
1002
1021
|
}
|
|
1003
1022
|
}
|
|
1004
1023
|
// #endregion
|
|
@@ -1012,22 +1031,22 @@ const k = class {
|
|
|
1012
1031
|
if (this.animated && this.animationState === "opening") t.push("animating-open");
|
|
1013
1032
|
if (this.animated && this.animationState === "closing") t.push("animating-close");
|
|
1014
1033
|
return o("div", {
|
|
1015
|
-
key: "
|
|
1034
|
+
key: "779d18b2765abec3eff0f19ca297b01356a06a7d",
|
|
1016
1035
|
ref: t => this.containerElement = t,
|
|
1017
1036
|
class: t.join(" "),
|
|
1018
1037
|
"test-id": "outerContainer",
|
|
1019
1038
|
tabIndex: -1,
|
|
1020
1039
|
popover: "manual"
|
|
1021
1040
|
}, o("div", {
|
|
1022
|
-
key: "
|
|
1041
|
+
key: "47eb4c1420bbc63f821333c03804c1843363f946",
|
|
1023
1042
|
ref: t => this.contentElement = t,
|
|
1024
1043
|
class: "content"
|
|
1025
1044
|
}, o("slot", {
|
|
1026
|
-
key: "
|
|
1045
|
+
key: "8554a334fd61f07cf712e2bdbe797f7835878469"
|
|
1027
1046
|
})));
|
|
1028
1047
|
}
|
|
1029
1048
|
get hostElement() {
|
|
1030
|
-
return
|
|
1049
|
+
return e(this);
|
|
1031
1050
|
}
|
|
1032
1051
|
static get watchers() {
|
|
1033
1052
|
return {
|
|
@@ -1039,6 +1058,6 @@ const k = class {
|
|
|
1039
1058
|
|
|
1040
1059
|
k.style = g;
|
|
1041
1060
|
|
|
1042
|
-
export {
|
|
1061
|
+
export { v as click_elsewhere, w as q2_option_list, k as q2_popover };
|
|
1043
1062
|
//# sourceMappingURL=click-elsewhere.q2-option-list.q2-popover.entry.esm.js.map
|
|
1044
1063
|
//# sourceMappingURL=click-elsewhere_3.entry.js.map
|