@mintplayer/web-components 2.16.0 → 2.17.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/accordion/index.mjs +5 -5
- package/calendar/index.mjs +1 -1
- package/carousel/index.mjs +57 -143
- package/charts/core/index.mjs +30 -20
- package/charts/core/src/attributes.d.ts +18 -0
- package/charts/core/src/index.d.ts +2 -0
- package/charts/core/src/view-window.d.ts +46 -0
- package/charts/hierarchy/index.mjs +245 -256
- package/charts/hierarchy/src/components/mp-hierarchy-chart.d.ts +1 -3
- package/charts/sparkline/index.mjs +27 -26
- package/charts/trend/index.mjs +21 -20
- package/checkbox/index.mjs +1 -1
- package/checkbox/src/components/mp-checkbox.d.ts +1 -0
- package/chunks/attributes-L3eKsbdy.mjs +16 -0
- package/chunks/color-mode-warning-71FmlzWX.mjs +13 -0
- package/chunks/{form-check.styles-B0pxJ6YC.mjs → form-check.styles-DqvBnspm.mjs} +24 -3
- package/chunks/{mp-calendar.element-CJ8-t-Zn.mjs → mp-calendar.element-BIHS9SZZ.mjs} +11 -6
- package/chunks/{mp-checkbox-CzwS7Y_t.mjs → mp-checkbox-zV83gILn.mjs} +44 -36
- package/chunks/{mp-datatable-B7st6G-I.mjs → mp-datatable-eRpl7-2V.mjs} +173 -173
- package/chunks/{mp-datetime-picker.element-DsWA1AFs.mjs → mp-datetime-picker.element-Cxu5-qRE.mjs} +29 -32
- package/chunks/{mp-pagination-Dea75mD4.mjs → mp-pagination-hGy4dL7p.mjs} +9 -4
- package/chunks/{mp-radio-cL46sUA0.mjs → mp-radio-BhRVNdKp.mjs} +32 -28
- package/chunks/{mp-select-BNrbPwN4.mjs → mp-select-CgqYFvUj.mjs} +41 -26
- package/chunks/{mp-splitter-Ckn1kN4v.mjs → mp-splitter-DLehrw3Y.mjs} +144 -120
- package/chunks/{mp-timepicker.element-CwaAAOcm.mjs → mp-timepicker.element-BiB9lkgc.mjs} +58 -45
- package/chunks/{mp-toggle-button-eo_aTQtu.mjs → mp-toggle-button-CaS9uYLE.mjs} +26 -24
- package/chunks/{mp-treeview-C8iltDbq.mjs → mp-treeview-CaMTDrvY.mjs} +51 -50
- package/chunks/{overlay-controller-DifgO6jT.mjs → overlay-controller-BHDagokg.mjs} +96 -92
- package/chunks/{id-DNZVAnGC.mjs → resource.service--lqLwEqk.mjs} +144 -206
- package/chunks/view-window-DGvFiDnW.mjs +263 -0
- package/code-snippet/index.mjs +70 -66
- package/code-snippet/src/hljs-loaders.generated.d.ts +1 -1
- package/custom-elements.json +65750 -0
- package/datatable/index.mjs +1 -1
- package/datatable/src/components/column-resize.d.ts +11 -0
- package/datatable/src/components/mp-datatable.d.ts +5 -0
- package/datepicker/index.mjs +10 -9
- package/datetime-picker/index.mjs +1 -1
- package/datetime-picker/src/mp-datetime-picker.element.d.ts +3 -0
- package/dock/index.mjs +430 -463
- package/dock/src/components/mint-dock-manager.element.d.ts +25 -2
- package/dock/src/core/resize.d.ts +60 -0
- package/dropdown-menu/index.mjs +4 -2
- package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +6 -1
- package/dropdown-menu/src/index.d.ts +1 -1
- package/dropdown-menu/src/types/dropdown.d.ts +14 -1
- package/dropdown-menu/src/types/index.d.ts +1 -1
- package/file-manager/index.mjs +63 -61
- package/file-manager/src/components/mp-file-manager.d.ts +4 -3
- package/multi-range/index.mjs +56 -50
- package/multi-range/src/mint-multi-range.element.d.ts +4 -10
- package/multi-range/src/pointer-geometry.d.ts +31 -0
- package/navbar/index.mjs +89 -439
- package/overlay/index.mjs +1 -1
- package/overlay/src/overlay-controller.d.ts +0 -14
- package/overlay/src/placement.d.ts +48 -0
- package/package.json +7 -1
- package/pagination/index.mjs +1 -1
- package/phone-input/index.mjs +44 -40
- package/phone-input/src/components/stack.d.ts +8 -0
- package/query-builder/index.mjs +418 -466
- package/query-builder/src/dnd/drag-controller.d.ts +12 -8
- package/query-builder/src/mp-query-builder.element.d.ts +5 -1
- package/query-builder/src/mp-query-condition.element.d.ts +1 -0
- package/radio/index.mjs +1 -1
- package/radio-group/index.mjs +1 -1
- package/ribbon/index.mjs +477 -498
- package/ribbon/src/core/band-text-color.d.ts +10 -0
- package/ribbon/src/core/key-tip-allocator.d.ts +10 -0
- package/ribbon/src/core/plan-reduce-steps.d.ts +62 -0
- package/ribbon/src/mp-ribbon.element.d.ts +0 -27
- package/scheduler/index.mjs +726 -711
- package/scheduler/src/components/mp-scheduler.d.ts +19 -3
- package/scheduler/src/drag/drag-manager.d.ts +1 -9
- package/scheduler/src/input/input-handler.d.ts +12 -2
- package/scheduler/src/utils/geometry.d.ts +39 -0
- package/scheduler/src/views/timeline-view.d.ts +0 -1
- package/scheduler-core/index.mjs +84 -71
- package/scheduler-core/src/services/resource.service.d.ts +0 -12
- package/scheduler-core/src/services/timeline.service.d.ts +0 -9
- package/select/index.mjs +1 -1
- package/select/src/components/mp-select.d.ts +1 -0
- package/signature-pad/index.mjs +21 -23
- package/signature-pad/src/canvas-point.d.ts +26 -0
- package/signature-pad/src/mp-signature-pad.element.d.ts +1 -7
- package/splitter/index.mjs +1 -1
- package/splitter/src/components/mp-splitter.d.ts +16 -0
- package/splitter/src/managers/index.d.ts +1 -0
- package/splitter/src/managers/rescale-panel-sizes.d.ts +14 -0
- package/swiper-core/index.mjs +2 -2
- package/theming/bs-theme-preboot.js +1 -0
- package/theming/color-mode.css +36 -0
- package/theming/index.d.ts +1 -0
- package/theming/index.mjs +327 -0
- package/theming/src/components/mp-theme-toggle.d.ts +71 -0
- package/theming/src/cookie.d.ts +31 -0
- package/theming/src/index.d.ts +5 -0
- package/theming/src/preboot.d.ts +1 -0
- package/theming/src/resolve.d.ts +36 -0
- package/theming/src/store.d.ts +27 -0
- package/theming/src/styles/theme-toggle.styles.d.ts +2 -0
- package/theming/src/testing/fake-broadcast-channel.d.ts +35 -0
- package/theming/src/toggle-modes.d.ts +23 -0
- package/tile-manager/index.mjs +252 -211
- package/tile-manager/src/components/mint-tile-manager.element.d.ts +8 -0
- package/tile-manager/src/utils/grid-geometry.d.ts +49 -0
- package/timeline/index.mjs +156 -164
- package/timeline/src/components/mp-timeline.d.ts +41 -7
- package/timepicker/index.mjs +7 -4
- package/timepicker/src/mp-time-list.element.d.ts +26 -0
- package/timepicker/src/mp-timepicker.element.d.ts +3 -0
- package/toggle-button/index.mjs +1 -1
- package/tree-select/index.mjs +21 -9
- package/treeview/index.mjs +1 -1
- package/treeview/src/components/mp-treeview.d.ts +6 -4
- package/chunks/color-DIeST-IS.mjs +0 -224
- package/query-builder/src/mp-query-condition.element.template.d.ts +0 -2
|
@@ -1,46 +1,84 @@
|
|
|
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 y } from "./focus-restore-DxuP1Oe2.mjs";
|
|
4
|
+
import { F as g, d, c as v } from "./focus-trap-DTOLJ5bb.mjs";
|
|
5
|
+
const f = "mp-overlay-container", w = "mp-overlay-pane", k = 2e3, b = [
|
|
6
6
|
"position: fixed",
|
|
7
7
|
"inset: 0",
|
|
8
8
|
// The container spans the viewport, so it must not intercept anything. Panes
|
|
9
9
|
// opt back in individually.
|
|
10
10
|
"pointer-events: none",
|
|
11
|
-
`z-index: var(--mp-overlay-container-z-index, ${
|
|
11
|
+
`z-index: var(--mp-overlay-container-z-index, ${k})`,
|
|
12
12
|
"display: block"
|
|
13
|
-
].join("; "),
|
|
14
|
-
let
|
|
15
|
-
function
|
|
16
|
-
typeof customElements > "u" || customElements.get(
|
|
13
|
+
].join("; "), T = ["position: fixed", "pointer-events: auto"].join("; ");
|
|
14
|
+
let c = null, h = 0;
|
|
15
|
+
function A() {
|
|
16
|
+
typeof customElements > "u" || customElements.get(f) || customElements.define(f, class extends HTMLElement {
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
return
|
|
19
|
+
function S() {
|
|
20
|
+
if (c?.isConnected) return c;
|
|
21
|
+
A();
|
|
22
|
+
const n = document.createElement(f);
|
|
23
|
+
return n.setAttribute("style", b), document.body.appendChild(n), c = n, n;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function E() {
|
|
26
26
|
if (typeof document > "u" || !document.body) return null;
|
|
27
|
-
const
|
|
28
|
-
t.className =
|
|
27
|
+
const n = S(), t = document.createElement("div");
|
|
28
|
+
t.className = w, t.setAttribute("style", T), n.appendChild(t), h++;
|
|
29
29
|
let e = !1;
|
|
30
30
|
return {
|
|
31
31
|
container: t,
|
|
32
32
|
release() {
|
|
33
|
-
e || (e = !0, t.remove(),
|
|
33
|
+
e || (e = !0, t.remove(), h = Math.max(0, h - 1), h === 0 && c && (c.remove(), c = null));
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function N() {
|
|
38
|
+
return c?.isConnected ? c : null;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
40
|
+
function Y() {
|
|
41
|
+
return h;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
function x(n, t, e) {
|
|
44
|
+
return n === "start" ? e ? t.right : t.left : n === "end" ? e ? t.left : t.right : t.left + t.width / 2;
|
|
45
|
+
}
|
|
46
|
+
function F(n, t) {
|
|
47
|
+
return n === "top" ? t.top : n === "bottom" ? t.bottom : t.top + t.height / 2;
|
|
48
|
+
}
|
|
49
|
+
function P(n, t, e) {
|
|
50
|
+
return n === "start" ? e ? -t : 0 : n === "end" ? e ? 0 : -t : -t / 2;
|
|
51
|
+
}
|
|
52
|
+
function L(n, t) {
|
|
53
|
+
return n === "top" ? 0 : n === "bottom" ? -t : -t / 2;
|
|
54
|
+
}
|
|
55
|
+
function C(n, t, e, o) {
|
|
56
|
+
return {
|
|
57
|
+
left: x(n.originX, t, o) + P(n.overlayX, e.width, o) + (n.offsetX ?? 0),
|
|
58
|
+
top: F(n.originY, t) + L(n.overlayY, e.height) + (n.offsetY ?? 0)
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function R(n, t, e) {
|
|
62
|
+
const { width: o, height: i, margin: s } = e;
|
|
63
|
+
return n.left >= s && n.top >= s && n.left + t.width <= o - s && n.top + t.height <= i - s;
|
|
64
|
+
}
|
|
65
|
+
function m(n, t, e) {
|
|
66
|
+
const { width: o, height: i, margin: s } = e, r = (l, a, u) => Math.max(s, l + a > u - s ? u - a - s : l);
|
|
67
|
+
return {
|
|
68
|
+
left: r(n.left, t.width, o),
|
|
69
|
+
top: r(n.top, t.height, i)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function D(n, t) {
|
|
73
|
+
return n.right < 0 || n.bottom < 0 || n.left > t.width || n.top > t.height;
|
|
74
|
+
}
|
|
75
|
+
function O(n, t, e, o, i) {
|
|
76
|
+
const s = n.flatMap(
|
|
77
|
+
(l, a) => t.map((u) => ({ anchorIndex: a, placed: C(u, l, e, i) }))
|
|
78
|
+
), r = s.find((l) => R(l.placed, e, o)) ?? s[s.length - 1];
|
|
79
|
+
return r ? { anchorIndex: r.anchorIndex, placement: m(r.placed, e, o) } : null;
|
|
80
|
+
}
|
|
81
|
+
const M = [
|
|
44
82
|
{ originX: "start", originY: "bottom", overlayX: "start", overlayY: "top" },
|
|
45
83
|
{ originX: "start", originY: "top", overlayX: "start", overlayY: "bottom" }
|
|
46
84
|
];
|
|
@@ -60,11 +98,11 @@ class p {
|
|
|
60
98
|
o.key === "Escape" && this._open && this.isTopOfStack() && (this.close(), o.preventDefault());
|
|
61
99
|
}, this.onMouseDown = (o) => {
|
|
62
100
|
if (!this._open) return;
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
101
|
+
const i = o.composedPath();
|
|
102
|
+
if (i.includes(this.host)) return;
|
|
65
103
|
const s = this.options.panel();
|
|
66
|
-
s &&
|
|
67
|
-
}, this.host = t, this.options = e, this.focusTrap = new
|
|
104
|
+
s && i.includes(s) || this.close(!1);
|
|
105
|
+
}, this.host = t, this.options = e, this.focusTrap = new g(() => this.options.panel(), {
|
|
68
106
|
initialFocus: "none",
|
|
69
107
|
// open() handles initial focus; the trap only contains Tab
|
|
70
108
|
returnFocus: !1,
|
|
@@ -85,13 +123,13 @@ class p {
|
|
|
85
123
|
* cannot each believe they are top-most and both consume one Escape.
|
|
86
124
|
*/
|
|
87
125
|
static pushFrame() {
|
|
88
|
-
return
|
|
126
|
+
return d.push("overlay-frame-external");
|
|
89
127
|
}
|
|
90
128
|
static releaseFrame(t) {
|
|
91
|
-
|
|
129
|
+
d.release(t);
|
|
92
130
|
}
|
|
93
131
|
static isFrameTop(t) {
|
|
94
|
-
return
|
|
132
|
+
return d.isTop(t);
|
|
95
133
|
}
|
|
96
134
|
hostConnected() {
|
|
97
135
|
document.addEventListener("keydown", this.onKeyDown);
|
|
@@ -131,8 +169,8 @@ class p {
|
|
|
131
169
|
async open() {
|
|
132
170
|
if (this._open) return;
|
|
133
171
|
this._open = !0;
|
|
134
|
-
const t =
|
|
135
|
-
this.restoreTo = t instanceof HTMLElement && t !== t.ownerDocument.body ? t : null, this.stackToken = p.pushFrame(), this.options.portal && (this.portalHandle =
|
|
172
|
+
const t = y();
|
|
173
|
+
this.restoreTo = t instanceof HTMLElement && t !== t.ownerDocument.body ? t : null, this.stackToken = p.pushFrame(), this.options.portal && (this.portalHandle = E()), 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?.();
|
|
136
174
|
}
|
|
137
175
|
close(t = !0) {
|
|
138
176
|
if (!this._open) return;
|
|
@@ -173,7 +211,7 @@ class p {
|
|
|
173
211
|
e.hasAttribute("tabindex") || e.setAttribute("tabindex", "-1"), e.focus({ preventScroll: !0 });
|
|
174
212
|
return;
|
|
175
213
|
}
|
|
176
|
-
const o =
|
|
214
|
+
const o = v(e)[0];
|
|
177
215
|
o ? o.focus({ preventScroll: !0 }) : (e.hasAttribute("tabindex") || e.setAttribute("tabindex", "-1"), e.focus({ preventScroll: !0 }));
|
|
178
216
|
}
|
|
179
217
|
async toggle() {
|
|
@@ -218,29 +256,27 @@ class p {
|
|
|
218
256
|
const t = this.resolveAnchors(), e = this.options.panel();
|
|
219
257
|
if (t.length === 0 || !e) return;
|
|
220
258
|
this.applyPanelWidth(e, t[0]);
|
|
221
|
-
const o =
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
259
|
+
const o = e.getBoundingClientRect(), i = {
|
|
260
|
+
width: window.innerWidth,
|
|
261
|
+
height: window.innerHeight,
|
|
262
|
+
margin: this.options.viewportMargin ?? 8
|
|
263
|
+
}, s = t.map((l) => l.getBoundingClientRect());
|
|
264
|
+
if (this.options.stickyOnAnchorOffscreen && D(s[0], i)) {
|
|
265
|
+
const l = {
|
|
266
|
+
left: parseFloat(e.style.left) || o.left,
|
|
267
|
+
top: parseFloat(e.style.top) || o.top
|
|
268
|
+
}, a = m(l, o, i);
|
|
269
|
+
e.style.left = `${a.left}px`, e.style.top = `${a.top}px`;
|
|
225
270
|
return;
|
|
226
271
|
}
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
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`;
|
|
240
|
-
}
|
|
241
|
-
/** True when the anchor's bounding rect lies entirely outside the viewport. */
|
|
242
|
-
isAnchorOffscreen(t, e, o) {
|
|
243
|
-
return t.right < 0 || t.bottom < 0 || t.left > e || t.top > o;
|
|
272
|
+
const r = O(
|
|
273
|
+
s,
|
|
274
|
+
this.options.positions ?? M,
|
|
275
|
+
o,
|
|
276
|
+
i,
|
|
277
|
+
this.isRtl()
|
|
278
|
+
);
|
|
279
|
+
r && (this.activeAnchor = t[r.anchorIndex], e.style.left = `${r.placement.left}px`, e.style.top = `${r.placement.top}px`);
|
|
244
280
|
}
|
|
245
281
|
/**
|
|
246
282
|
* Apply the configured `panelWidth` strategy to the panel element. Called
|
|
@@ -272,38 +308,6 @@ class p {
|
|
|
272
308
|
isRtl() {
|
|
273
309
|
return getComputedStyle(this.host).direction === "rtl";
|
|
274
310
|
}
|
|
275
|
-
/**
|
|
276
|
-
* Compute the (left, top) at which `panel` should be placed for a single
|
|
277
|
-
* position candidate. The candidate identifies which corner of the anchor
|
|
278
|
-
* to align which corner of the panel to, plus optional pixel offsets.
|
|
279
|
-
*/
|
|
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);
|
|
282
|
-
return {
|
|
283
|
-
left: s + r + (t.offsetX ?? 0),
|
|
284
|
-
top: i + d + (t.offsetY ?? 0)
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
anchorXFor(t, e, o) {
|
|
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;
|
|
290
|
-
}
|
|
291
|
-
anchorYFor(t, e) {
|
|
292
|
-
return t === "top" ? e.top : t === "bottom" ? e.bottom : e.top + e.height / 2;
|
|
293
|
-
}
|
|
294
|
-
panelXOffsetFor(t, e, o) {
|
|
295
|
-
return t === "start" ? o ? -e : 0 : t === "end" ? o ? 0 : -e : -e / 2;
|
|
296
|
-
}
|
|
297
|
-
panelYOffsetFor(t, e) {
|
|
298
|
-
return t === "top" ? 0 : t === "bottom" ? -e : -e / 2;
|
|
299
|
-
}
|
|
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;
|
|
302
|
-
}
|
|
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 };
|
|
306
|
-
}
|
|
307
311
|
/* ---- Scroll + resize tracking ---- */
|
|
308
312
|
currentStrategy() {
|
|
309
313
|
return this.options.scrollStrategy ?? "reposition";
|
|
@@ -347,12 +351,12 @@ class p {
|
|
|
347
351
|
*/
|
|
348
352
|
applyBlockScroll() {
|
|
349
353
|
if (this.blockedScroll) return;
|
|
350
|
-
const t = document.documentElement, e = t.scrollTop || window.scrollY, o = t.scrollLeft || window.scrollX,
|
|
351
|
-
if (this.blockedScroll = { top: e, left: o },
|
|
354
|
+
const t = document.documentElement, e = t.scrollTop || window.scrollY, o = t.scrollLeft || window.scrollX, i = Math.max(0, window.innerWidth - t.clientWidth);
|
|
355
|
+
if (this.blockedScroll = { top: e, left: o }, i > 0) {
|
|
352
356
|
const s = document.body;
|
|
353
357
|
this.blockedBodyPaddingRight = s.style.paddingRight;
|
|
354
|
-
const
|
|
355
|
-
s.style.paddingRight = `${
|
|
358
|
+
const r = parseFloat(getComputedStyle(s).paddingRight) || 0;
|
|
359
|
+
s.style.paddingRight = `${r + i}px`;
|
|
356
360
|
}
|
|
357
361
|
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%";
|
|
358
362
|
}
|
|
@@ -379,7 +383,7 @@ class p {
|
|
|
379
383
|
}
|
|
380
384
|
export {
|
|
381
385
|
p as O,
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
386
|
+
E as a,
|
|
387
|
+
N as c,
|
|
388
|
+
Y as o
|
|
385
389
|
};
|