q2-tecton-elements 1.53.2 → 1.53.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/click-elsewhere_2.cjs.entry.js +19 -14
- package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-76f63767.js → index-7aecfed8.js} +33 -1
- package/dist/cjs/index-7aecfed8.js.map +1 -0
- package/dist/cjs/q2-action-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/q2-badge_7.cjs.entry.js +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +1 -1
- package/dist/cjs/q2-card.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-donut.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/q2-data-table.cjs.entry.js +1 -1
- package/dist/cjs/q2-detail.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +4 -2
- package/dist/cjs/q2-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-file-picker.cjs.entry.js +1 -1
- package/dist/cjs/q2-item_3.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.cjs.entry.js +1 -1
- package/dist/cjs/q2-option-list.cjs.entry.js +1 -1
- package/dist/cjs/q2-option.cjs.entry.js +1 -1
- package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
- 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 +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +43 -3
- package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
- 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-tag.cjs.entry.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
- package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +3 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
- package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js +1 -1
- package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-popover/q2-popover.js +19 -14
- package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
- package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js +230 -147
- package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js.map +1 -1
- package/dist/collection/components/q2-select/q2-select.js +42 -2
- package/dist/collection/components/q2-select/q2-select.js.map +1 -1
- package/dist/collection/components/q2-select/test/q2-select-test.spec.js +146 -6
- package/dist/collection/components/q2-select/test/q2-select-test.spec.js.map +1 -1
- package/dist/collection/utils/index.js +37 -0
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/components/index2.js +32 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/q2-dropdown.js +3 -1
- package/dist/components/q2-dropdown.js.map +1 -1
- package/dist/components/q2-popover2.js +19 -14
- package/dist/components/q2-popover2.js.map +1 -1
- package/dist/components/q2-select2.js +43 -3
- package/dist/components/q2-select2.js.map +1 -1
- package/dist/esm/click-elsewhere_2.entry.js +19 -14
- package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
- package/dist/esm/{index-504f1a9e.js → index-99c46474.js} +33 -2
- package/dist/{cjs/index-76f63767.js.map → esm/index-99c46474.js.map} +1 -1
- package/dist/esm/q2-action-group.entry.js +1 -1
- package/dist/esm/q2-action-sheet.entry.js +1 -1
- package/dist/esm/q2-badge_7.entry.js +1 -1
- package/dist/esm/q2-calendar.entry.js +1 -1
- package/dist/esm/q2-card.entry.js +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +1 -1
- package/dist/esm/q2-carousel.entry.js +1 -1
- package/dist/esm/q2-chart-area.entry.js +1 -1
- package/dist/esm/q2-chart-bar.entry.js +1 -1
- package/dist/esm/q2-chart-donut.entry.js +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +1 -1
- package/dist/esm/q2-checkbox.entry.js +1 -1
- package/dist/esm/q2-data-table.entry.js +1 -1
- package/dist/esm/q2-detail.entry.js +1 -1
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +4 -2
- package/dist/esm/q2-dropdown.entry.js.map +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-file-picker.entry.js +1 -1
- package/dist/esm/q2-item_3.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.entry.js +1 -1
- package/dist/esm/q2-option-list.entry.js +1 -1
- package/dist/esm/q2-option.entry.js +1 -1
- package/dist/esm/q2-pagination.entry.js +1 -1
- 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 +1 -1
- package/dist/esm/q2-select.entry.js +43 -3
- package/dist/esm/q2-select.entry.js.map +1 -1
- 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-tag.entry.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/esm/q2-tooltip.entry.js +1 -1
- package/dist/jest.setup.js +11 -0
- package/dist/jest.setup.js.map +1 -1
- package/dist/q2-tecton-elements/click-elsewhere_2.entry.js +139 -134
- package/dist/q2-tecton-elements/click-elsewhere_2.entry.js.map +1 -1
- package/dist/q2-tecton-elements/{index-504f1a9e.js → index-99c46474.js} +76 -51
- package/dist/q2-tecton-elements/index-99c46474.js.map +1 -0
- package/dist/q2-tecton-elements/q2-action-group.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-badge_7.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-calendar.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +78 -78
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-checkbox.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-data-table.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-detail.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +13 -11
- package/dist/q2-tecton-elements/q2-dropdown.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-file-picker.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-item_3.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-loc.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-message.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-option-list.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-option.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-pagination.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-pill.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +5 -5
- package/dist/q2-tecton-elements/q2-radio.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-section.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-select.entry.js +44 -5
- package/dist/q2-tecton-elements/q2-select.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-stepper.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-tag.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-textarea.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-tooltip.entry.js +1 -1
- package/dist/types/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +9 -0
- package/dist/types/components/q2-select/q2-select.d.ts +4 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/package.json +3 -3
- package/dist/esm/index-504f1a9e.js.map +0 -1
- package/dist/q2-tecton-elements/index-504f1a9e.js.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as t, c as o, g as i, h as e } from "./index-7a5365e2.js";
|
|
2
2
|
|
|
3
|
-
import { h as s, w as r } from "./index-
|
|
3
|
+
import { h as s, w as r, x as n, d as p } from "./index-99c46474.js";
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const a = class {
|
|
6
6
|
constructor(i) {
|
|
7
|
-
|
|
8
|
-
this.change =
|
|
7
|
+
t(this, i);
|
|
8
|
+
this.change = o(this, "change", 7);
|
|
9
9
|
// #region Own Properties
|
|
10
10
|
this.isCurrentlyFocused = false;
|
|
11
11
|
/**
|
|
12
12
|
* Listens for mouse and window events that happen outside this click-elsewhere element so we can close popovers when users click outside them
|
|
13
13
|
*/ this.mouseEventList = [ "mousedown", "dragstart", "touchstart" ];
|
|
14
|
-
this.mouseHandler =
|
|
15
|
-
const
|
|
16
|
-
const i = this.shadowContains(this.shadowEventTarget(
|
|
17
|
-
if (!i && (this.isCurrentlyFocused ||
|
|
14
|
+
this.mouseHandler = t => {
|
|
15
|
+
const o = this.shadowContains(this.findActiveElement());
|
|
16
|
+
const i = this.shadowContains(this.shadowEventTarget(t)) || this.originatesInSlots(t.target);
|
|
17
|
+
if (!i && (this.isCurrentlyFocused || o)) {
|
|
18
18
|
this.isCurrentlyFocused = false;
|
|
19
19
|
this.change.emit();
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
this.isCurrentlyFocused = i ||
|
|
22
|
+
this.isCurrentlyFocused = i || o;
|
|
23
23
|
};
|
|
24
24
|
this.windowBlurHandler = () => {
|
|
25
25
|
this.isCurrentlyFocused = false;
|
|
@@ -30,14 +30,14 @@ const n = class {
|
|
|
30
30
|
// #region Component Lifecycle Events
|
|
31
31
|
/* tslint:enable:no-empty */
|
|
32
32
|
connectedCallback() {
|
|
33
|
-
this.mouseEventList.forEach((
|
|
34
|
-
document.addEventListener(
|
|
33
|
+
this.mouseEventList.forEach((t => {
|
|
34
|
+
document.addEventListener(t, this.mouseHandler);
|
|
35
35
|
}));
|
|
36
36
|
window.addEventListener("blur", this.windowBlurHandler);
|
|
37
37
|
}
|
|
38
38
|
disconnectedCallback() {
|
|
39
|
-
this.mouseEventList.forEach((
|
|
40
|
-
document.removeEventListener(
|
|
39
|
+
this.mouseEventList.forEach((t => {
|
|
40
|
+
document.removeEventListener(t, this.mouseHandler);
|
|
41
41
|
}));
|
|
42
42
|
window.removeEventListener("blur", this.windowBlurHandler);
|
|
43
43
|
}
|
|
@@ -46,56 +46,56 @@ const n = class {
|
|
|
46
46
|
// #endregion
|
|
47
47
|
// #region Local Methods
|
|
48
48
|
findActiveElement() {
|
|
49
|
-
let
|
|
49
|
+
let t = document.activeElement;
|
|
50
50
|
while (true) {
|
|
51
|
-
if (!
|
|
52
|
-
return
|
|
51
|
+
if (!t || !t.shadowRoot) {
|
|
52
|
+
return t;
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
t = t.shadowRoot.activeElement;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
originatesInSlots(
|
|
58
|
-
const
|
|
59
|
-
for (const i of Array.from(
|
|
60
|
-
const
|
|
61
|
-
for (const i of Array.from(
|
|
62
|
-
if (i.contains(
|
|
57
|
+
originatesInSlots(t) {
|
|
58
|
+
const o = this.hostElement.querySelectorAll("slot");
|
|
59
|
+
for (const i of Array.from(o)) {
|
|
60
|
+
const o = i && i.assignedNodes && i.assignedNodes() || this.hostElement.childNodes;
|
|
61
|
+
for (const i of Array.from(o)) {
|
|
62
|
+
if (i.contains(t)) {
|
|
63
63
|
return true;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
return false;
|
|
68
68
|
}
|
|
69
|
-
shadowContains(
|
|
69
|
+
shadowContains(t) {
|
|
70
70
|
/**
|
|
71
71
|
* shadow-dom enabled version of Node.contains()
|
|
72
72
|
*/
|
|
73
73
|
while (true) {
|
|
74
|
-
if (
|
|
74
|
+
if (t === this.hostElement) {
|
|
75
75
|
return true;
|
|
76
76
|
}
|
|
77
|
-
if (!
|
|
77
|
+
if (!t) {
|
|
78
78
|
return false;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
t = t.parentNode || t.host;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
shadowEventTarget(
|
|
84
|
-
return
|
|
83
|
+
shadowEventTarget(t) {
|
|
84
|
+
return t.composedPath()[0] || t.target;
|
|
85
85
|
}
|
|
86
86
|
get hostElement() {
|
|
87
87
|
return i(this);
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
const
|
|
91
|
+
const c = "*{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 #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)}:popover-open,.show{position:absolute;margin:0;padding:0;overflow:auto;background:var(--tct-popover-background, var(--app-white, #ffffff));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-1, 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.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::-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}";
|
|
92
92
|
|
|
93
|
-
const
|
|
93
|
+
const h = c;
|
|
94
94
|
|
|
95
|
-
const
|
|
95
|
+
const l = class {
|
|
96
96
|
constructor(i) {
|
|
97
|
-
|
|
98
|
-
this.popoverStateChanged =
|
|
97
|
+
t(this, i);
|
|
98
|
+
this.popoverStateChanged = o(this, "popoverStateChanged", 7);
|
|
99
99
|
/**
|
|
100
100
|
* The number of pixels to leave between the popover and the edge of the viewport
|
|
101
101
|
*/ this.displayBuffer = 10;
|
|
@@ -105,68 +105,68 @@ const c = class {
|
|
|
105
105
|
s(this, "minHeight", "prop");
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
this.handlePopoverToggleEvent =
|
|
108
|
+
this.handlePopoverToggleEvent = t => {
|
|
109
109
|
this.popoverStateChanged.emit({
|
|
110
|
-
open:
|
|
110
|
+
open: t.newState === "open"
|
|
111
111
|
});
|
|
112
112
|
};
|
|
113
113
|
this.setAbsoluteCSSProperties = async () => {
|
|
114
|
-
const {controlElement:
|
|
114
|
+
const {controlElement: t, containerElement: o, currentDirection: i, align: e} = this;
|
|
115
115
|
if (e === "right") {
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
o.style.setProperty("--comp-pop-right", "0");
|
|
117
|
+
o.style.setProperty("--comp-pop-left", "unset");
|
|
118
118
|
} else {
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
o.style.setProperty("--comp-pop-left", "0");
|
|
120
|
+
o.style.setProperty("--comp-pop-right", "unset");
|
|
121
121
|
}
|
|
122
122
|
if (this.block) {
|
|
123
|
-
|
|
123
|
+
o.style.setProperty("--comp-pop-width", "100%");
|
|
124
124
|
}
|
|
125
125
|
if (i === "up") {
|
|
126
|
-
const i = getComputedStyle(
|
|
126
|
+
const i = getComputedStyle(t);
|
|
127
127
|
const e = parseInt(i.height || "0") + parseInt(i.borderTopWidth || "0") + parseInt(i.borderBottomWidth || "0");
|
|
128
|
-
|
|
128
|
+
o.style.setProperty("--comp-pop-bottom", `${e}px`);
|
|
129
129
|
}
|
|
130
130
|
// Wait for one paint to prevent layout thrashing
|
|
131
131
|
await r();
|
|
132
|
-
|
|
132
|
+
o.style.setProperty("--comp-pop-opacity", "1");
|
|
133
133
|
};
|
|
134
134
|
this.setPopoverAPICSSProperties = async () => {
|
|
135
|
-
var
|
|
136
|
-
const {controlElement:
|
|
137
|
-
const {top:
|
|
135
|
+
var t, o, i;
|
|
136
|
+
const {controlElement: e, containerElement: s, currentDirection: n, isModule: p, align: a} = this;
|
|
137
|
+
const {top: c, bottom: h, left: l, right: d} = (o = (t = e === null || e === void 0 ? void 0 : e.getBoundingClientRect) === null || t === void 0 ? void 0 : t.call(e)) !== null && o !== void 0 ? o : {
|
|
138
138
|
top: 0,
|
|
139
139
|
bottom: 0,
|
|
140
140
|
left: 0,
|
|
141
141
|
right: 0
|
|
142
142
|
};
|
|
143
|
-
const
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
146
|
-
|
|
147
|
-
|
|
143
|
+
const u = l;
|
|
144
|
+
const v = ((i = window === null || window === void 0 ? void 0 : window.visualViewport) === null || i === void 0 ? void 0 : i.width) - d;
|
|
145
|
+
if (a === "right") {
|
|
146
|
+
s.style.setProperty("--comp-pop-right", `${v - window.scrollX}px`);
|
|
147
|
+
s.style.setProperty("--comp-pop-left", "unset");
|
|
148
148
|
} else {
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
s.style.setProperty("--comp-pop-left", `${u + window.scrollX}px`);
|
|
150
|
+
s.style.setProperty("--comp-pop-right", "unset");
|
|
151
151
|
}
|
|
152
|
-
if (this.block)
|
|
153
|
-
if (
|
|
154
|
-
if (
|
|
155
|
-
|
|
152
|
+
if (this.block) s.style.setProperty("--comp-pop-width", `${(e === null || e === void 0 ? void 0 : e.offsetWidth) || 0}px`);
|
|
153
|
+
if (n === "up") {
|
|
154
|
+
if (p) {
|
|
155
|
+
s.style.setProperty("--comp-pop-bottom", `${window.innerHeight - c}px`);
|
|
156
156
|
} else {
|
|
157
|
-
|
|
157
|
+
s.style.setProperty("--comp-pop-bottom", `${window.innerHeight - c - window.scrollY}px`);
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
if (
|
|
161
|
-
if (
|
|
162
|
-
|
|
160
|
+
if (n === "down") {
|
|
161
|
+
if (p) {
|
|
162
|
+
s.style.setProperty("--comp-pop-top", `${h}px`);
|
|
163
163
|
} else {
|
|
164
|
-
|
|
164
|
+
s.style.setProperty("--comp-pop-top", `${h + window.scrollY}px`);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
// Wait for one paint to prevent layout thrashing
|
|
168
168
|
await r();
|
|
169
|
-
|
|
169
|
+
s.style.setProperty("--comp-pop-opacity", "1");
|
|
170
170
|
};
|
|
171
171
|
this.viewPortChanged = () => {
|
|
172
172
|
if (!this.open) return;
|
|
@@ -209,16 +209,16 @@ const c = class {
|
|
|
209
209
|
}
|
|
210
210
|
// #endregion
|
|
211
211
|
// #region Listeners
|
|
212
|
-
popoverStateHandler(
|
|
213
|
-
const {detail: {open:
|
|
214
|
-
if (
|
|
215
|
-
this.open =
|
|
216
|
-
|
|
212
|
+
popoverStateHandler(t) {
|
|
213
|
+
const {detail: {open: o}} = t;
|
|
214
|
+
if (o === this.open) return;
|
|
215
|
+
this.open = o;
|
|
216
|
+
t.stopPropagation();
|
|
217
217
|
}
|
|
218
218
|
// #endregion
|
|
219
219
|
// #region Public Methods API
|
|
220
|
-
async scrollContainerTo(
|
|
221
|
-
this.containerElement.scrollTo(
|
|
220
|
+
async scrollContainerTo(t) {
|
|
221
|
+
this.containerElement.scrollTo(t);
|
|
222
222
|
}
|
|
223
223
|
async toggle() {
|
|
224
224
|
this.open = !this.open;
|
|
@@ -228,11 +228,11 @@ const c = class {
|
|
|
228
228
|
minHeightProvided() {
|
|
229
229
|
this.handleMinHeight();
|
|
230
230
|
}
|
|
231
|
-
async openChanged(
|
|
231
|
+
async openChanged(t) {
|
|
232
232
|
this.popoverStateChanged.emit({
|
|
233
|
-
open:
|
|
233
|
+
open: t
|
|
234
234
|
});
|
|
235
|
-
if (
|
|
235
|
+
if (t) {
|
|
236
236
|
this.addViewportListeners();
|
|
237
237
|
this.determinePopDirection();
|
|
238
238
|
} else {
|
|
@@ -250,17 +250,17 @@ const c = class {
|
|
|
250
250
|
// #endregion
|
|
251
251
|
// #region Local Methods
|
|
252
252
|
get isModule() {
|
|
253
|
-
var
|
|
253
|
+
var t, o;
|
|
254
254
|
const i = window !== window.top;
|
|
255
|
-
const e = Object.keys((
|
|
255
|
+
const e = Object.keys((o = (t = window.Tecton) === null || t === void 0 ? void 0 : t.platformDimensions) !== null && o !== void 0 ? o : {}).length > 0;
|
|
256
256
|
return i && e;
|
|
257
257
|
}
|
|
258
258
|
get providedDirection() {
|
|
259
|
-
const {direction:
|
|
260
|
-
switch (
|
|
259
|
+
const {direction: t} = this;
|
|
260
|
+
switch (t) {
|
|
261
261
|
case "up":
|
|
262
262
|
case "down":
|
|
263
|
-
return
|
|
263
|
+
return t;
|
|
264
264
|
|
|
265
265
|
default:
|
|
266
266
|
return undefined;
|
|
@@ -270,18 +270,20 @@ const c = class {
|
|
|
270
270
|
return Object.hasOwn(HTMLElement.prototype, "popover");
|
|
271
271
|
}
|
|
272
272
|
get validatedMaxHeight() {
|
|
273
|
-
const {maxHeight:
|
|
274
|
-
return isNaN(
|
|
273
|
+
const {maxHeight: t} = this;
|
|
274
|
+
return isNaN(t) ? undefined : t;
|
|
275
275
|
}
|
|
276
276
|
addViewportListeners() {
|
|
277
|
-
var
|
|
277
|
+
var t;
|
|
278
278
|
window.addEventListener("resize", this.viewPortOrientationChanged);
|
|
279
279
|
visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.addEventListener("resize", this.viewPortChanged);
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
280
|
+
if (n(this.hostElement) && !p()) {
|
|
281
|
+
window.addEventListener("scroll", this.viewPortChanged, {
|
|
282
|
+
passive: true,
|
|
283
|
+
capture: true
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
(t = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || t === void 0 ? void 0 : t.addEventListener("orientationchange", this.viewPortOrientationChanged);
|
|
285
287
|
window.addEventListener("orientationchange", this.viewPortOrientationChanged);
|
|
286
288
|
}
|
|
287
289
|
clearCSSProperties() {
|
|
@@ -294,75 +296,78 @@ const c = class {
|
|
|
294
296
|
this.containerElement.style.removeProperty("--comp-pop-opacity");
|
|
295
297
|
}
|
|
296
298
|
async determinePopDirection() {
|
|
297
|
-
var
|
|
299
|
+
var t, o, i;
|
|
298
300
|
const {containerElement: e, controlElement: s, providedDirection: n, displayBuffer: p} = this;
|
|
299
301
|
if (e) e.style.maxHeight = null;
|
|
300
302
|
await r();
|
|
301
303
|
const {isModule: a} = this;
|
|
302
|
-
const {top: c, bottom:
|
|
304
|
+
const {top: c, bottom: h} = (o = (t = s === null || s === void 0 ? void 0 : s.getBoundingClientRect) === null || t === void 0 ? void 0 : t.call(s)) !== null && o !== void 0 ? o : {
|
|
303
305
|
top: 0,
|
|
304
306
|
bottom: 0
|
|
305
307
|
};
|
|
306
|
-
let
|
|
308
|
+
let l;
|
|
307
309
|
let d;
|
|
308
310
|
let u;
|
|
309
311
|
if (a) {
|
|
310
|
-
const {outletOffset:
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
//
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
312
|
+
const {outletOffset: t = 0, innerHeight: o = window.innerHeight, top: e = 0, bottom: s = 0} = ((i = window.Tecton) === null || i === void 0 ? void 0 : i.platformDimensions) || {};
|
|
313
|
+
const r = window.innerHeight - h;
|
|
314
|
+
// controlElement position visually on the page
|
|
315
|
+
const n = t > 0 ? c : c + t - e;
|
|
316
|
+
const a = t + h - e;
|
|
317
|
+
// visual space around the controlElement
|
|
318
|
+
const l = n;
|
|
319
|
+
const v = o - s - a;
|
|
320
|
+
// calculate space above and below controlElement
|
|
321
|
+
const w = r < v;
|
|
322
|
+
d = l - p;
|
|
323
|
+
u = w ? r - p : v - p;
|
|
319
324
|
} else {
|
|
320
|
-
|
|
325
|
+
l = window.innerHeight;
|
|
321
326
|
d = c - p;
|
|
322
|
-
u =
|
|
327
|
+
u = l - h - p;
|
|
323
328
|
}
|
|
324
|
-
const
|
|
329
|
+
const v = d > u ? "up" : "down";
|
|
325
330
|
// We do not want to update the max height once the popover is open unless the page orientation shifts (resize or mobile use cases)
|
|
326
|
-
const
|
|
331
|
+
const w = !e.style.getPropertyValue("--comp-pop-max-height") || this.orientationChanged;
|
|
327
332
|
// we do not want to constantly update the max-height after an orientation change, so we switch this back to false
|
|
328
333
|
this.orientationChanged = false;
|
|
329
|
-
const
|
|
330
|
-
switch (
|
|
334
|
+
const f = this.currentDirection || n || v;
|
|
335
|
+
switch (f) {
|
|
331
336
|
case "up":
|
|
332
|
-
if (
|
|
333
|
-
const
|
|
334
|
-
const
|
|
335
|
-
e.style.setProperty("--comp-pop-max-height", `${
|
|
337
|
+
if (w) {
|
|
338
|
+
const t = this.validatedMaxHeight || d;
|
|
339
|
+
const o = Math.min(d, t);
|
|
340
|
+
e.style.setProperty("--comp-pop-max-height", `${o}px`);
|
|
336
341
|
}
|
|
337
342
|
this.setDirectionAndShow("up");
|
|
338
343
|
break;
|
|
339
344
|
|
|
340
345
|
case "down":
|
|
341
|
-
if (
|
|
342
|
-
const
|
|
343
|
-
const
|
|
344
|
-
e.style.setProperty("--comp-pop-max-height", `${
|
|
346
|
+
if (w) {
|
|
347
|
+
const t = this.validatedMaxHeight || u;
|
|
348
|
+
const o = Math.min(u, t);
|
|
349
|
+
e.style.setProperty("--comp-pop-max-height", `${o}px`);
|
|
345
350
|
}
|
|
346
351
|
this.setDirectionAndShow("down");
|
|
347
352
|
break;
|
|
348
353
|
}
|
|
349
354
|
}
|
|
350
355
|
removeViewportListeners() {
|
|
351
|
-
var
|
|
356
|
+
var t;
|
|
352
357
|
window.removeEventListener("resize", this.viewPortOrientationChanged);
|
|
353
358
|
visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.removeEventListener("resize", this.viewPortChanged);
|
|
354
359
|
window.removeEventListener("scroll", this.viewPortChanged, {
|
|
355
360
|
capture: true
|
|
356
361
|
});
|
|
357
|
-
(
|
|
362
|
+
(t = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || t === void 0 ? void 0 : t.removeEventListener("orientationchange", this.viewPortOrientationChanged);
|
|
358
363
|
window.removeEventListener("orientationchange", this.viewPortOrientationChanged);
|
|
359
364
|
}
|
|
360
|
-
setDirectionAndShow(
|
|
365
|
+
setDirectionAndShow(t) {
|
|
361
366
|
// Due to some runtime inconsistency across devices/browsers we need to add one more check here because the
|
|
362
367
|
// popover can be closed between the time the popover is opened and the time the direction is determined
|
|
363
|
-
const
|
|
364
|
-
if (!
|
|
365
|
-
this.currentDirection =
|
|
368
|
+
const o = this.open;
|
|
369
|
+
if (!o) return;
|
|
370
|
+
this.currentDirection = t;
|
|
366
371
|
if (this.mode === "legacy" || !this.supportsPopoverAPI) {
|
|
367
372
|
this.show = true;
|
|
368
373
|
this.setAbsoluteCSSProperties();
|
|
@@ -374,23 +379,23 @@ const c = class {
|
|
|
374
379
|
// #endregion
|
|
375
380
|
// #region Render Methods
|
|
376
381
|
render() {
|
|
377
|
-
const
|
|
378
|
-
if (this.show)
|
|
379
|
-
if (this.block)
|
|
380
|
-
if (this.mode === "legacy")
|
|
382
|
+
const t = [ "container", this.currentDirection, this.align ];
|
|
383
|
+
if (this.show) t.push("show");
|
|
384
|
+
if (this.block) t.push("block");
|
|
385
|
+
if (this.mode === "legacy") t.push("legacy");
|
|
381
386
|
return e("div", {
|
|
382
|
-
key: "
|
|
383
|
-
ref:
|
|
384
|
-
class:
|
|
387
|
+
key: "4cd26a6c090a6fb5b56d2fa6464143f74998c215",
|
|
388
|
+
ref: t => this.containerElement = t,
|
|
389
|
+
class: t.join(" "),
|
|
385
390
|
"test-id": "outerContainer",
|
|
386
391
|
tabIndex: -1,
|
|
387
|
-
popover: "
|
|
392
|
+
popover: "manual"
|
|
388
393
|
}, e("div", {
|
|
389
|
-
key: "
|
|
390
|
-
ref:
|
|
394
|
+
key: "545c376ca96c14e129a8f60fadac3a3264b916cf",
|
|
395
|
+
ref: t => this.contentElement = t,
|
|
391
396
|
class: "content"
|
|
392
397
|
}, e("slot", {
|
|
393
|
-
key: "
|
|
398
|
+
key: "9a2824ab9023f34a2b3a56a76ace4df6a91b5ec6"
|
|
394
399
|
})));
|
|
395
400
|
}
|
|
396
401
|
get hostElement() {
|
|
@@ -404,7 +409,7 @@ const c = class {
|
|
|
404
409
|
}
|
|
405
410
|
};
|
|
406
411
|
|
|
407
|
-
|
|
412
|
+
l.style = h;
|
|
408
413
|
|
|
409
|
-
export {
|
|
414
|
+
export { a as click_elsewhere, l as q2_popover };
|
|
410
415
|
//# sourceMappingURL=click-elsewhere_2.entry.js.map
|