@mintplayer/web-components 2.14.0 → 2.16.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/README.md +15 -0
- package/badge/src/styles/badge.styles.d.ts +2 -0
- package/chunks/install-light-styles-DbCAGFOC.mjs +209 -0
- package/chunks/mp-datatable-B7st6G-I.mjs +2238 -0
- package/chunks/{mp-datetime-picker.element-D1CiLbHm.mjs → mp-datetime-picker.element-DsWA1AFs.mjs} +2 -2
- package/chunks/{mp-timepicker.element-COZEUIoE.mjs → mp-timepicker.element-CwaAAOcm.mjs} +1 -1
- package/chunks/{mp-treeview-tkWu28iF.mjs → mp-treeview-C8iltDbq.mjs} +61 -63
- package/chunks/{overlay-controller-D6agzzOI.mjs → overlay-controller-DifgO6jT.mjs} +103 -47
- package/datatable/index.mjs +6 -5
- package/datatable/src/components/mp-datatable.d.ts +210 -2
- package/datatable/src/index.d.ts +4 -2
- package/datatable/src/styles/datatable.light.styles.d.ts +2 -0
- package/datatable/src/styles/index.d.ts +1 -1
- package/datatable/src/types/column-def.d.ts +61 -0
- package/datatable/src/types/filter.d.ts +138 -0
- package/datatable/src/types/index.d.ts +3 -2
- package/datatable/src/types/labels.d.ts +58 -0
- package/datepicker/index.mjs +1 -1
- package/datetime-picker/index.mjs +1 -1
- package/dock/index.mjs +477 -492
- package/dock/src/components/mint-dock-manager.element.d.ts +10 -8
- package/dock/src/core/index.d.ts +1 -0
- package/dock/src/core/intersection-sizing.d.ts +83 -0
- package/dock/src/core/layout-tree.d.ts +23 -2
- package/dock/src/core/types.d.ts +14 -0
- package/file-manager/index.mjs +30 -29
- package/file-manager/src/components/mp-file-manager.d.ts +2 -0
- package/light-dom/index.d.ts +1 -0
- package/light-dom/index.mjs +11 -0
- package/light-dom/src/index.d.ts +2 -0
- package/light-dom/src/install-light-styles.d.ts +25 -0
- package/light-dom/src/scoped-html.d.ts +26 -0
- package/navbar/index.mjs +1 -1
- package/overlay/index.mjs +5 -2
- package/overlay/src/index.d.ts +2 -0
- package/overlay/src/overlay-controller.d.ts +27 -0
- package/overlay/src/overlay-portal.d.ts +53 -0
- package/package.json +5 -1
- package/query-builder/index.mjs +1472 -2651
- package/query-builder/src/index.d.ts +4 -0
- package/query-builder/src/mp-query-builder.element.d.ts +1 -1
- package/query-builder/src/mp-query-builder.light.styles.d.ts +2 -0
- package/query-builder/src/mp-query-condition.element.d.ts +1 -1
- package/query-builder/src/mp-query-condition.light.styles.d.ts +2 -0
- package/query-builder/src/mp-query-group.element.d.ts +1 -1
- package/query-builder/src/mp-query-group.light.styles.d.ts +2 -0
- package/query-builder/src/mp-query-subquery.element.d.ts +1 -1
- package/query-builder/src/mp-query-subquery.light.styles.d.ts +2 -0
- package/ribbon/index.mjs +1 -1
- package/scheduler/index.mjs +2 -2
- package/timepicker/index.mjs +1 -1
- package/tree-select/index.mjs +60 -58
- package/tree-select/src/components/mp-tree-select.d.ts +1 -1
- package/tree-select/src/index.d.ts +1 -1
- package/tree-select/src/styles/index.d.ts +1 -1
- package/tree-select/src/styles/tree-select.light.styles.d.ts +2 -0
- package/treeview/index.mjs +3 -3
- package/treeview/src/components/mp-treeview.d.ts +1 -1
- package/treeview/src/index.d.ts +1 -1
- package/treeview/src/styles/index.d.ts +1 -1
- package/treeview/src/styles/treeview.light.styles.d.ts +2 -0
- package/chunks/mp-datatable-GmKqaN8y.mjs +0 -1392
- package/datatable/src/styles/datatable.styles.d.ts +0 -2
package/chunks/{mp-datetime-picker.element-D1CiLbHm.mjs → mp-datetime-picker.element-DsWA1AFs.mjs}
RENAMED
|
@@ -2,9 +2,9 @@ import { html as c, unsafeCSS as v, LitElement as y, nothing as b } from "lit";
|
|
|
2
2
|
import { query as n } from "lit/decorators.js";
|
|
3
3
|
import { L as w } from "./live-announcer-Bi0orG4n.mjs";
|
|
4
4
|
import { e as D } from "./error-text-B45eDAt1.mjs";
|
|
5
|
-
import { O as g } from "./overlay-controller-
|
|
5
|
+
import { O as g } from "./overlay-controller-DifgO6jT.mjs";
|
|
6
6
|
import "./mp-calendar.element-CJ8-t-Zn.mjs";
|
|
7
|
-
import { m as p } from "./mp-timepicker.element-
|
|
7
|
+
import { m as p } from "./mp-timepicker.element-CwaAAOcm.mjs";
|
|
8
8
|
import { i as $ } from "./invalid-feedback.styles-he0JYrJm.mjs";
|
|
9
9
|
c`<!-- Rendered dynamically by render(). Codegen-wc emits styles from the
|
|
10
10
|
sibling .scss; the template export is intentionally unused. -->`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html as l, unsafeCSS as p, LitElement as m, nothing as c } from "lit";
|
|
2
2
|
import { query as u } from "lit/decorators.js";
|
|
3
|
-
import { O as f } from "./overlay-controller-
|
|
3
|
+
import { O as f } from "./overlay-controller-DifgO6jT.mjs";
|
|
4
4
|
import "lit/directives/ref.js";
|
|
5
5
|
import { H as g } from "./host-aria-WSGs7SPQ.mjs";
|
|
6
6
|
import { R as y } from "./roving-focus-CrL9982a.mjs";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { unsafeCSS as I, LitElement as y, nothing as d
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { unsafeCSS as I, LitElement as y, nothing as d } from "lit";
|
|
2
|
+
import { s as $, i as C } from "./install-light-styles-DbCAGFOC.mjs";
|
|
3
|
+
import { L as S } from "./live-announcer-Bi0orG4n.mjs";
|
|
4
|
+
import { repeat as E } from "lit/directives/repeat.js";
|
|
5
|
+
import { unsafeHTML as g } from "lit/directives/unsafe-html.js";
|
|
6
|
+
const R = I(`mp-treeview {
|
|
6
7
|
display: block;
|
|
7
8
|
width: 100%;
|
|
8
9
|
--mp-treeview-indent: 20px;
|
|
@@ -16,28 +17,28 @@ const S = I(`:host {
|
|
|
16
17
|
--mp-treeview-border-color: var(--bs-list-group-border-color, var(--bs-border-color, rgba(0, 0, 0, 0.125)));
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
[data-mps=treeview] {
|
|
20
21
|
box-sizing: border-box;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
ul {
|
|
24
|
+
ul[data-mps=treeview] {
|
|
24
25
|
list-style: none;
|
|
25
26
|
margin: 0;
|
|
26
27
|
padding: 0;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
.treeview-root {
|
|
30
|
+
.treeview-root[data-mps=treeview] {
|
|
30
31
|
border: 1px solid var(--mp-treeview-border-color);
|
|
31
32
|
border-radius: var(--bs-list-group-border-radius, 0.375rem);
|
|
32
33
|
overflow: hidden;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
mp-treeview[hide-borders] .treeview-root[data-mps=treeview] {
|
|
36
37
|
border: 0;
|
|
37
38
|
border-radius: 0;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
.treeview-row {
|
|
41
|
+
.treeview-row[data-mps=treeview] {
|
|
41
42
|
display: flex;
|
|
42
43
|
align-items: center;
|
|
43
44
|
gap: 0.5rem;
|
|
@@ -49,33 +50,33 @@ ul {
|
|
|
49
50
|
color: inherit;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
mp-treeview[hide-borders] .treeview-row[data-mps=treeview] {
|
|
53
54
|
border-top: 0;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
.treeview-row:first-child {
|
|
57
|
+
.treeview-row:first-child[data-mps=treeview] {
|
|
57
58
|
border-top: 0;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
.treeview-row:hover {
|
|
61
|
+
.treeview-row:hover[data-mps=treeview] {
|
|
61
62
|
background-color: var(--mp-treeview-row-hover-bg);
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
.treeview-row[data-selected=true] {
|
|
65
|
+
.treeview-row[data-selected=true][data-mps=treeview] {
|
|
65
66
|
background-color: var(--mp-treeview-row-selected-bg);
|
|
66
67
|
color: var(--mp-treeview-row-selected-color);
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
.treeview-row:focus {
|
|
70
|
+
.treeview-row:focus[data-mps=treeview] {
|
|
70
71
|
outline: none;
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
.treeview-row:focus-visible {
|
|
74
|
+
.treeview-row:focus-visible[data-mps=treeview] {
|
|
74
75
|
outline: var(--mp-treeview-row-focus-outline);
|
|
75
76
|
outline-offset: -2px;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
.treeview-chevron {
|
|
79
|
+
.treeview-chevron[data-mps=treeview] {
|
|
79
80
|
display: inline-flex;
|
|
80
81
|
align-items: center;
|
|
81
82
|
justify-content: center;
|
|
@@ -86,24 +87,22 @@ ul {
|
|
|
86
87
|
transition: transform 0.15s ease-in-out;
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
.treeview-chevron[data-expanded=true] {
|
|
90
|
+
.treeview-chevron[data-expanded=true][data-mps=treeview] {
|
|
90
91
|
transform: rotate(90deg);
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
.treeview-chevron.invisible {
|
|
94
|
+
.treeview-chevron.invisible[data-mps=treeview] {
|
|
94
95
|
visibility: hidden;
|
|
95
96
|
}
|
|
96
|
-
|
|
97
|
-
.treeview-chevron svg {
|
|
97
|
+
.treeview-chevron[data-mps=treeview] svg {
|
|
98
98
|
width: 0.75rem;
|
|
99
99
|
height: 0.75rem;
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
.treeview-chevron.loading svg {
|
|
101
|
+
.treeview-chevron.loading[data-mps=treeview] svg {
|
|
103
102
|
display: none;
|
|
104
103
|
}
|
|
105
104
|
|
|
106
|
-
.treeview-spinner {
|
|
105
|
+
.treeview-spinner[data-mps=treeview] {
|
|
107
106
|
display: inline-block;
|
|
108
107
|
width: 0.75rem;
|
|
109
108
|
height: 0.75rem;
|
|
@@ -118,13 +117,13 @@ ul {
|
|
|
118
117
|
transform: rotate(360deg);
|
|
119
118
|
}
|
|
120
119
|
}
|
|
121
|
-
.treeview-row[data-error=true] .treeview-chevron::after {
|
|
120
|
+
.treeview-row[data-error=true][data-mps=treeview] .treeview-chevron[data-mps=treeview]::after {
|
|
122
121
|
content: "!";
|
|
123
122
|
color: var(--bs-danger, #dc3545);
|
|
124
123
|
margin-left: 0.25rem;
|
|
125
124
|
}
|
|
126
125
|
|
|
127
|
-
.treeview-icon {
|
|
126
|
+
.treeview-icon[data-mps=treeview] {
|
|
128
127
|
display: inline-flex;
|
|
129
128
|
align-items: center;
|
|
130
129
|
justify-content: center;
|
|
@@ -132,36 +131,34 @@ ul {
|
|
|
132
131
|
height: 1rem;
|
|
133
132
|
flex: 0 0 auto;
|
|
134
133
|
}
|
|
135
|
-
|
|
136
|
-
.treeview-icon svg {
|
|
134
|
+
.treeview-icon[data-mps=treeview] svg {
|
|
137
135
|
width: 1rem;
|
|
138
136
|
height: 1rem;
|
|
139
137
|
}
|
|
140
|
-
|
|
141
|
-
.treeview-label {
|
|
138
|
+
.treeview-row[data-mps=treeview] .treeview-label {
|
|
142
139
|
flex: 1 1 auto;
|
|
143
140
|
white-space: nowrap;
|
|
144
141
|
overflow: hidden;
|
|
145
142
|
text-overflow: ellipsis;
|
|
146
143
|
}
|
|
147
144
|
|
|
148
|
-
.treeview-body {
|
|
145
|
+
.treeview-body[data-mps=treeview] {
|
|
149
146
|
flex: 1 1 auto;
|
|
150
147
|
min-width: 0;
|
|
151
148
|
}
|
|
152
149
|
|
|
153
150
|
@media (prefers-reduced-motion: reduce) {
|
|
154
|
-
.treeview-chevron {
|
|
151
|
+
.treeview-chevron[data-mps=treeview] {
|
|
155
152
|
transition: none !important;
|
|
156
153
|
}
|
|
157
|
-
}`),
|
|
158
|
-
let
|
|
159
|
-
class
|
|
154
|
+
}`), n = $("treeview"), U = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/></svg>';
|
|
155
|
+
let q = 0;
|
|
156
|
+
class L extends y {
|
|
160
157
|
constructor() {
|
|
161
|
-
super(...arguments), this.instanceId = `mp-treeview-${++
|
|
158
|
+
super(...arguments), this.instanceId = `mp-treeview-${++q}`, this._items = [], this._expandedIds = /* @__PURE__ */ new Set(), this._selectedIds = /* @__PURE__ */ new Set(), this._selectionMode = "single", this._hideBorders = !1, this._loadingIds = /* @__PURE__ */ new Set(), this._errorIds = /* @__PURE__ */ new Map(), this.liveAnnouncer = new S(this, { omitRole: !0 }), this._focusedId = null, this._visibleOrder = [], this._byId = /* @__PURE__ */ new Map(), this._parentById = /* @__PURE__ */ new Map(), this._inputLabel = null;
|
|
162
159
|
}
|
|
163
|
-
|
|
164
|
-
this
|
|
160
|
+
createRenderRoot() {
|
|
161
|
+
return this;
|
|
165
162
|
}
|
|
166
163
|
static get observedAttributes() {
|
|
167
164
|
return [
|
|
@@ -283,7 +280,7 @@ class U extends y {
|
|
|
283
280
|
}
|
|
284
281
|
renderNodes(e, t) {
|
|
285
282
|
return n`
|
|
286
|
-
${
|
|
283
|
+
${E(
|
|
287
284
|
e,
|
|
288
285
|
(s) => s.id,
|
|
289
286
|
(s, i) => this.renderNode(s, t, i, e.length)
|
|
@@ -291,44 +288,44 @@ class U extends y {
|
|
|
291
288
|
`;
|
|
292
289
|
}
|
|
293
290
|
renderNode(e, t, s, i) {
|
|
294
|
-
const r = !!(e.children && e.children.length > 0),
|
|
291
|
+
const r = !!(e.children && e.children.length > 0), p = !!e.lazy && !r, u = r || p, o = this._loadingIds.has(e.id), l = this._errorIds.get(e.id), h = this._expandedIds.has(e.id), v = this._selectedIds.has(e.id), m = this._focusedId === e.id, _ = m ? 0 : -1, f = e.iconKey && this._iconResolver ? this._iconResolver(e.iconKey, e) : void 0, x = (t - 1) * 20, w = `${this.instanceId}-row-${e.id}`, b = this._nodeRenderer ? this._nodeRenderer(e, {
|
|
295
292
|
level: t,
|
|
296
293
|
expanded: h,
|
|
297
294
|
selected: v,
|
|
298
|
-
focused:
|
|
299
|
-
hasChildren:
|
|
295
|
+
focused: m,
|
|
296
|
+
hasChildren: u
|
|
300
297
|
}) : void 0;
|
|
301
298
|
return n`
|
|
302
299
|
<li role="none">
|
|
303
300
|
<div
|
|
304
|
-
id=${
|
|
301
|
+
id=${w}
|
|
305
302
|
class="treeview-row"
|
|
306
303
|
role="treeitem"
|
|
307
304
|
data-node-id=${e.id}
|
|
308
305
|
data-selected=${v ? "true" : "false"}
|
|
309
|
-
data-loading=${
|
|
310
|
-
data-error=${
|
|
306
|
+
data-loading=${o ? "true" : "false"}
|
|
307
|
+
data-error=${l ? "true" : "false"}
|
|
311
308
|
aria-level=${t}
|
|
312
309
|
aria-setsize=${i}
|
|
313
310
|
aria-posinset=${s + 1}
|
|
314
|
-
aria-expanded=${
|
|
315
|
-
aria-busy=${
|
|
311
|
+
aria-expanded=${u ? h ? "true" : "false" : d}
|
|
312
|
+
aria-busy=${o ? "true" : d}
|
|
316
313
|
aria-selected=${this._selectionMode !== "none" ? v ? "true" : "false" : d}
|
|
317
|
-
tabindex=${
|
|
314
|
+
tabindex=${_}
|
|
318
315
|
style=${`padding-left:${x + 12}px`}
|
|
319
|
-
@click=${(
|
|
320
|
-
@keydown=${(
|
|
321
|
-
aria-describedby=${
|
|
316
|
+
@click=${(a) => this.onRowClick(e, a)}
|
|
317
|
+
@keydown=${(a) => this.onRowKeydown(e, a)}
|
|
318
|
+
aria-describedby=${l ? `${w}-error` : d}
|
|
322
319
|
>
|
|
323
|
-
${
|
|
320
|
+
${l ? n`<span id="${w}-error" class="treeview-load-error">${l}</span>` : d}
|
|
324
321
|
<span
|
|
325
|
-
class=${`treeview-chevron${
|
|
322
|
+
class=${`treeview-chevron${u ? "" : " invisible"}${o ? " loading" : ""}`}
|
|
326
323
|
data-expanded=${h ? "true" : "false"}
|
|
327
|
-
@click=${(
|
|
324
|
+
@click=${(a) => this.onChevronClick(e, a)}
|
|
328
325
|
aria-hidden="true"
|
|
329
|
-
>${
|
|
330
|
-
${
|
|
331
|
-
${
|
|
326
|
+
>${o ? n`<span class="treeview-spinner" aria-hidden="true"></span>` : g(U)}</span>
|
|
327
|
+
${b ? n`<span class="treeview-body">${b}</span>` : n`
|
|
328
|
+
${f ? n`<span class="treeview-icon" aria-hidden="true">${g(f)}</span>` : d}
|
|
332
329
|
<span class="treeview-label">${e.label}</span>
|
|
333
330
|
`}
|
|
334
331
|
</div>
|
|
@@ -406,14 +403,14 @@ class U extends y {
|
|
|
406
403
|
}
|
|
407
404
|
}
|
|
408
405
|
focusRelative(e, t) {
|
|
409
|
-
const s = this._visibleOrder, i = s.findIndex((
|
|
406
|
+
const s = this._visibleOrder, i = s.findIndex((p) => p.id === e.id);
|
|
410
407
|
if (i === -1) return;
|
|
411
408
|
const r = Math.max(0, Math.min(s.length - 1, i + t));
|
|
412
409
|
r !== i && this.focusNode(s[r].id);
|
|
413
410
|
}
|
|
414
411
|
focusNode(e) {
|
|
415
412
|
this._focusedId = e, this.requestUpdate(), requestAnimationFrame(() => {
|
|
416
|
-
this.
|
|
413
|
+
this.renderRoot?.querySelector(`[data-node-id="${M(e)}"]`)?.focus({ preventScroll: !1 });
|
|
417
414
|
});
|
|
418
415
|
}
|
|
419
416
|
toggleSelection(e, t) {
|
|
@@ -488,11 +485,12 @@ class U extends y {
|
|
|
488
485
|
);
|
|
489
486
|
}
|
|
490
487
|
}
|
|
491
|
-
function
|
|
488
|
+
function M(c) {
|
|
492
489
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(c) : c.replace(/["\\]/g, "\\$&");
|
|
493
490
|
}
|
|
494
|
-
|
|
491
|
+
C("treeview", R);
|
|
492
|
+
typeof customElements < "u" && !customElements.get("mp-treeview") && customElements.define("mp-treeview", L);
|
|
495
493
|
export {
|
|
496
|
-
|
|
497
|
-
|
|
494
|
+
L as M,
|
|
495
|
+
R as t
|
|
498
496
|
};
|
|
@@ -1,14 +1,52 @@
|
|
|
1
1
|
import "lit";
|
|
2
2
|
import "lit/directives/ref.js";
|
|
3
|
-
import { d as
|
|
4
|
-
import { F as
|
|
5
|
-
const
|
|
3
|
+
import { d as b } from "./focus-restore-DxuP1Oe2.mjs";
|
|
4
|
+
import { F as A, d as v, c as S } from "./focus-trap-DTOLJ5bb.mjs";
|
|
5
|
+
const w = "mp-overlay-container", F = "mp-overlay-pane", E = 2e3, x = [
|
|
6
|
+
"position: fixed",
|
|
7
|
+
"inset: 0",
|
|
8
|
+
// The container spans the viewport, so it must not intercept anything. Panes
|
|
9
|
+
// opt back in individually.
|
|
10
|
+
"pointer-events: none",
|
|
11
|
+
`z-index: var(--mp-overlay-container-z-index, ${E})`,
|
|
12
|
+
"display: block"
|
|
13
|
+
].join("; "), L = ["position: fixed", "pointer-events: auto"].join("; ");
|
|
14
|
+
let l = null, a = 0;
|
|
15
|
+
function P() {
|
|
16
|
+
typeof customElements > "u" || customElements.get(w) || customElements.define(w, class extends HTMLElement {
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function C() {
|
|
20
|
+
if (l?.isConnected) return l;
|
|
21
|
+
P();
|
|
22
|
+
const c = document.createElement(w);
|
|
23
|
+
return c.setAttribute("style", x), document.body.appendChild(c), l = c, c;
|
|
24
|
+
}
|
|
25
|
+
function O() {
|
|
26
|
+
if (typeof document > "u" || !document.body) return null;
|
|
27
|
+
const c = C(), t = document.createElement("div");
|
|
28
|
+
t.className = F, t.setAttribute("style", L), c.appendChild(t), a++;
|
|
29
|
+
let e = !1;
|
|
30
|
+
return {
|
|
31
|
+
container: t,
|
|
32
|
+
release() {
|
|
33
|
+
e || (e = !0, t.remove(), a = Math.max(0, a - 1), a === 0 && l && (l.remove(), l = null));
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function W() {
|
|
38
|
+
return l?.isConnected ? l : null;
|
|
39
|
+
}
|
|
40
|
+
function $() {
|
|
41
|
+
return a;
|
|
42
|
+
}
|
|
43
|
+
const D = [
|
|
6
44
|
{ originX: "start", originY: "bottom", overlayX: "start", overlayY: "top" },
|
|
7
45
|
{ originX: "start", originY: "top", overlayX: "start", overlayY: "bottom" }
|
|
8
46
|
];
|
|
9
|
-
class
|
|
47
|
+
class p {
|
|
10
48
|
constructor(t, e) {
|
|
11
|
-
this._open = !1, this.mouseDownAttached = !1, this.stackToken = null, this.activeAnchor = null, this.restoreTo = null, this.positionFrame = 0, this.scrollListenersAttached = !1, this.blockedScroll = null, this.blockedBodyPaddingRight = null, this.onScroll = () => {
|
|
49
|
+
this._open = !1, this.mouseDownAttached = !1, this.stackToken = null, this.activeAnchor = null, this.restoreTo = null, this.positionFrame = 0, this.scrollListenersAttached = !1, this.blockedScroll = null, this.blockedBodyPaddingRight = null, this.portalHandle = null, this.onScroll = () => {
|
|
12
50
|
if (!this._open) return;
|
|
13
51
|
const o = this.currentStrategy();
|
|
14
52
|
if (o === "close") {
|
|
@@ -21,8 +59,12 @@ class c {
|
|
|
21
59
|
}, this.onKeyDown = (o) => {
|
|
22
60
|
o.key === "Escape" && this._open && this.isTopOfStack() && (this.close(), o.preventDefault());
|
|
23
61
|
}, this.onMouseDown = (o) => {
|
|
24
|
-
|
|
25
|
-
|
|
62
|
+
if (!this._open) return;
|
|
63
|
+
const n = o.composedPath();
|
|
64
|
+
if (n.includes(this.host)) return;
|
|
65
|
+
const s = this.options.panel();
|
|
66
|
+
s && n.includes(s) || this.close(!1);
|
|
67
|
+
}, this.host = t, this.options = e, this.focusTrap = new A(() => this.options.panel(), {
|
|
26
68
|
initialFocus: "none",
|
|
27
69
|
// open() handles initial focus; the trap only contains Tab
|
|
28
70
|
returnFocus: !1,
|
|
@@ -43,23 +85,34 @@ class c {
|
|
|
43
85
|
* cannot each believe they are top-most and both consume one Escape.
|
|
44
86
|
*/
|
|
45
87
|
static pushFrame() {
|
|
46
|
-
return
|
|
88
|
+
return v.push("overlay-frame-external");
|
|
47
89
|
}
|
|
48
90
|
static releaseFrame(t) {
|
|
49
|
-
|
|
91
|
+
v.release(t);
|
|
50
92
|
}
|
|
51
93
|
static isFrameTop(t) {
|
|
52
|
-
return
|
|
94
|
+
return v.isTop(t);
|
|
53
95
|
}
|
|
54
96
|
hostConnected() {
|
|
55
97
|
document.addEventListener("keydown", this.onKeyDown);
|
|
56
98
|
}
|
|
57
99
|
hostDisconnected() {
|
|
58
|
-
document.removeEventListener("keydown", this.onKeyDown), this.detachMouseDown(), this.stackToken && this.releaseStackToken();
|
|
100
|
+
document.removeEventListener("keydown", this.onKeyDown), this.detachMouseDown(), this.stackToken && this.releaseStackToken(), this.releasePortal();
|
|
59
101
|
}
|
|
60
102
|
get isOpen() {
|
|
61
103
|
return this._open;
|
|
62
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* The document-root pane to render the panel into, or `null` when this
|
|
107
|
+
* overlay is closed or not portalled. Read it from the host's update so the
|
|
108
|
+
* panel exists by the time the controller positions it.
|
|
109
|
+
*/
|
|
110
|
+
get portalContainer() {
|
|
111
|
+
return this.portalHandle?.container ?? null;
|
|
112
|
+
}
|
|
113
|
+
releasePortal() {
|
|
114
|
+
this.portalHandle?.release(), this.portalHandle = null;
|
|
115
|
+
}
|
|
63
116
|
/**
|
|
64
117
|
* Whether this overlay is the top-most dismissible layer — i.e. whether an
|
|
65
118
|
* Escape belongs to IT rather than to something opened on top of it.
|
|
@@ -78,14 +131,14 @@ class c {
|
|
|
78
131
|
async open() {
|
|
79
132
|
if (this._open) return;
|
|
80
133
|
this._open = !0;
|
|
81
|
-
const t =
|
|
82
|
-
this.restoreTo = t instanceof HTMLElement && t !== t.ownerDocument.body ? t : null, this.stackToken =
|
|
134
|
+
const t = b();
|
|
135
|
+
this.restoreTo = t instanceof HTMLElement && t !== t.ownerDocument.body ? t : null, this.stackToken = p.pushFrame(), this.options.portal && (this.portalHandle = O()), this.host.setAttribute("data-menu-open", ""), this.host.requestUpdate(), await this.host.updateComplete, this.position(), this.attachScrollListeners(), this.moveFocusIn(), this.options.modal && this.focusTrap.activate(), setTimeout(() => this.attachMouseDown(), 0), this.options.onOpen?.();
|
|
83
136
|
}
|
|
84
137
|
close(t = !0) {
|
|
85
138
|
if (!this._open) return;
|
|
86
139
|
this._open = !1, this.releaseStackToken(), this.focusTrap.isActive && this.focusTrap.deactivate();
|
|
87
140
|
const e = this.resolveReturnTarget();
|
|
88
|
-
this.host.removeAttribute("data-menu-open"), this.host.requestUpdate(), this.detachMouseDown(), this.detachScrollListeners(), this.positionFrame && (cancelAnimationFrame(this.positionFrame), this.positionFrame = 0), t && e?.focus({ preventScroll: !0 }), this.restoreTo = null, this.activeAnchor = null, this.options.onClose?.();
|
|
141
|
+
this.host.removeAttribute("data-menu-open"), this.host.requestUpdate(), this.detachMouseDown(), this.detachScrollListeners(), this.positionFrame && (cancelAnimationFrame(this.positionFrame), this.positionFrame = 0), t && e?.focus({ preventScroll: !0 }), this.releasePortal(), this.restoreTo = null, this.activeAnchor = null, this.options.onClose?.();
|
|
89
142
|
}
|
|
90
143
|
/**
|
|
91
144
|
* Focus-return target, in order of preference: whatever had focus when this
|
|
@@ -120,7 +173,7 @@ class c {
|
|
|
120
173
|
e.hasAttribute("tabindex") || e.setAttribute("tabindex", "-1"), e.focus({ preventScroll: !0 });
|
|
121
174
|
return;
|
|
122
175
|
}
|
|
123
|
-
const o =
|
|
176
|
+
const o = S(e)[0];
|
|
124
177
|
o ? o.focus({ preventScroll: !0 }) : (e.hasAttribute("tabindex") || e.setAttribute("tabindex", "-1"), e.focus({ preventScroll: !0 }));
|
|
125
178
|
}
|
|
126
179
|
async toggle() {
|
|
@@ -165,25 +218,25 @@ class c {
|
|
|
165
218
|
const t = this.resolveAnchors(), e = this.options.panel();
|
|
166
219
|
if (t.length === 0 || !e) return;
|
|
167
220
|
this.applyPanelWidth(e, t[0]);
|
|
168
|
-
const o = this.options.viewportMargin ?? 8,
|
|
169
|
-
if (this.options.stickyOnAnchorOffscreen && this.isAnchorOffscreen(r, s,
|
|
170
|
-
const
|
|
171
|
-
e.style.left = `${
|
|
221
|
+
const o = this.options.viewportMargin ?? 8, n = e.getBoundingClientRect(), s = window.innerWidth, i = window.innerHeight, r = t[0].getBoundingClientRect();
|
|
222
|
+
if (this.options.stickyOnAnchorOffscreen && this.isAnchorOffscreen(r, s, i)) {
|
|
223
|
+
const h = parseFloat(e.style.left) || n.left, y = parseFloat(e.style.top) || n.top, u = this.clampToViewport({ left: h, top: y }, n, s, i, o);
|
|
224
|
+
e.style.left = `${u.left}px`, e.style.top = `${u.top}px`;
|
|
172
225
|
return;
|
|
173
226
|
}
|
|
174
|
-
const
|
|
175
|
-
let
|
|
176
|
-
t: for (const
|
|
177
|
-
const
|
|
178
|
-
for (const
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
227
|
+
const d = this.options.positions ?? D, T = this.isRtl();
|
|
228
|
+
let f = null, m = null;
|
|
229
|
+
t: for (const h of t) {
|
|
230
|
+
const y = h.getBoundingClientRect();
|
|
231
|
+
for (const u of d) {
|
|
232
|
+
const g = this.placeFor(u, y, n, T);
|
|
233
|
+
if (f = h, m = g, this.fitsInViewport(g, n, s, i, o)) break t;
|
|
181
234
|
}
|
|
182
235
|
}
|
|
183
|
-
if (!
|
|
184
|
-
this.activeAnchor =
|
|
185
|
-
const
|
|
186
|
-
e.style.left = `${
|
|
236
|
+
if (!m || !f) return;
|
|
237
|
+
this.activeAnchor = f;
|
|
238
|
+
const k = this.clampToViewport(m, n, s, i, o);
|
|
239
|
+
e.style.left = `${k.left}px`, e.style.top = `${k.top}px`;
|
|
187
240
|
}
|
|
188
241
|
/** True when the anchor's bounding rect lies entirely outside the viewport. */
|
|
189
242
|
isAnchorOffscreen(t, e, o) {
|
|
@@ -224,16 +277,16 @@ class c {
|
|
|
224
277
|
* position candidate. The candidate identifies which corner of the anchor
|
|
225
278
|
* to align which corner of the panel to, plus optional pixel offsets.
|
|
226
279
|
*/
|
|
227
|
-
placeFor(t, e, o,
|
|
228
|
-
const s = this.anchorXFor(t.originX, e,
|
|
280
|
+
placeFor(t, e, o, n) {
|
|
281
|
+
const s = this.anchorXFor(t.originX, e, n), i = this.anchorYFor(t.originY, e), r = this.panelXOffsetFor(t.overlayX, o.width, n), d = this.panelYOffsetFor(t.overlayY, o.height);
|
|
229
282
|
return {
|
|
230
283
|
left: s + r + (t.offsetX ?? 0),
|
|
231
|
-
top:
|
|
284
|
+
top: i + d + (t.offsetY ?? 0)
|
|
232
285
|
};
|
|
233
286
|
}
|
|
234
287
|
anchorXFor(t, e, o) {
|
|
235
|
-
const
|
|
236
|
-
return t === "start" ?
|
|
288
|
+
const n = o ? e.right : e.left, s = o ? e.left : e.right;
|
|
289
|
+
return t === "start" ? n : t === "end" ? s : e.left + e.width / 2;
|
|
237
290
|
}
|
|
238
291
|
anchorYFor(t, e) {
|
|
239
292
|
return t === "top" ? e.top : t === "bottom" ? e.bottom : e.top + e.height / 2;
|
|
@@ -244,12 +297,12 @@ class c {
|
|
|
244
297
|
panelYOffsetFor(t, e) {
|
|
245
298
|
return t === "top" ? 0 : t === "bottom" ? -e : -e / 2;
|
|
246
299
|
}
|
|
247
|
-
fitsInViewport(t, e, o,
|
|
248
|
-
return t.left >= s && t.top >= s && t.left + e.width <= o - s && t.top + e.height <=
|
|
300
|
+
fitsInViewport(t, e, o, n, s) {
|
|
301
|
+
return t.left >= s && t.top >= s && t.left + e.width <= o - s && t.top + e.height <= n - s;
|
|
249
302
|
}
|
|
250
|
-
clampToViewport(t, e, o,
|
|
251
|
-
let { left:
|
|
252
|
-
return
|
|
303
|
+
clampToViewport(t, e, o, n, s) {
|
|
304
|
+
let { left: i, top: r } = t;
|
|
305
|
+
return i + e.width > o - s && (i = o - e.width - s), i < s && (i = s), r + e.height > n - s && (r = n - e.height - s), r < s && (r = s), { left: i, top: r };
|
|
253
306
|
}
|
|
254
307
|
/* ---- Scroll + resize tracking ---- */
|
|
255
308
|
currentStrategy() {
|
|
@@ -294,12 +347,12 @@ class c {
|
|
|
294
347
|
*/
|
|
295
348
|
applyBlockScroll() {
|
|
296
349
|
if (this.blockedScroll) return;
|
|
297
|
-
const t = document.documentElement, e = t.scrollTop || window.scrollY, o = t.scrollLeft || window.scrollX,
|
|
298
|
-
if (this.blockedScroll = { top: e, left: o },
|
|
350
|
+
const t = document.documentElement, e = t.scrollTop || window.scrollY, o = t.scrollLeft || window.scrollX, n = Math.max(0, window.innerWidth - t.clientWidth);
|
|
351
|
+
if (this.blockedScroll = { top: e, left: o }, n > 0) {
|
|
299
352
|
const s = document.body;
|
|
300
353
|
this.blockedBodyPaddingRight = s.style.paddingRight;
|
|
301
|
-
const
|
|
302
|
-
s.style.paddingRight = `${
|
|
354
|
+
const i = parseFloat(getComputedStyle(s).paddingRight) || 0;
|
|
355
|
+
s.style.paddingRight = `${i + n}px`;
|
|
303
356
|
}
|
|
304
357
|
t.style.setProperty("--overlay-blocked-top", `-${e}px`), t.style.setProperty("--overlay-blocked-left", `-${o}px`), t.style.position = "fixed", t.style.top = `-${e}px`, t.style.left = `-${o}px`, t.style.width = "100%";
|
|
305
358
|
}
|
|
@@ -312,10 +365,10 @@ class c {
|
|
|
312
365
|
}
|
|
313
366
|
/* ---- Esc-stack ---- */
|
|
314
367
|
releaseStackToken() {
|
|
315
|
-
this.stackToken && (
|
|
368
|
+
this.stackToken && (p.releaseFrame(this.stackToken), this.stackToken = null);
|
|
316
369
|
}
|
|
317
370
|
isTopOfStack() {
|
|
318
|
-
return this.stackToken !== null &&
|
|
371
|
+
return this.stackToken !== null && p.isFrameTop(this.stackToken);
|
|
319
372
|
}
|
|
320
373
|
attachMouseDown() {
|
|
321
374
|
this.mouseDownAttached || (document.addEventListener("mousedown", this.onMouseDown, !0), this.mouseDownAttached = !0);
|
|
@@ -325,5 +378,8 @@ class c {
|
|
|
325
378
|
}
|
|
326
379
|
}
|
|
327
380
|
export {
|
|
328
|
-
|
|
381
|
+
p as O,
|
|
382
|
+
O as a,
|
|
383
|
+
W as c,
|
|
384
|
+
$ as o
|
|
329
385
|
};
|
package/datatable/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as s, M as e, c as o, d as A, s as L } from "../chunks/mp-datatable-B7st6G-I.mjs";
|
|
2
2
|
export {
|
|
3
|
-
s as
|
|
4
|
-
e as
|
|
5
|
-
o as
|
|
6
|
-
|
|
3
|
+
s as DEFAULT_DATATABLE_LABELS,
|
|
4
|
+
e as MpDatatable,
|
|
5
|
+
o as computeNextSort,
|
|
6
|
+
A as datatableLightStyles,
|
|
7
|
+
L as sortRows
|
|
7
8
|
};
|