@mintplayer/web-components 2.16.0 → 2.18.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.
Files changed (120) hide show
  1. package/accordion/index.mjs +5 -5
  2. package/calendar/index.mjs +1 -1
  3. package/carousel/index.mjs +57 -143
  4. package/charts/core/index.mjs +30 -20
  5. package/charts/core/src/attributes.d.ts +18 -0
  6. package/charts/core/src/index.d.ts +2 -0
  7. package/charts/core/src/view-window.d.ts +46 -0
  8. package/charts/hierarchy/index.mjs +245 -256
  9. package/charts/hierarchy/src/components/mp-hierarchy-chart.d.ts +1 -3
  10. package/charts/sparkline/index.mjs +27 -26
  11. package/charts/trend/index.mjs +21 -20
  12. package/checkbox/index.mjs +1 -1
  13. package/checkbox/src/components/mp-checkbox.d.ts +1 -0
  14. package/chunks/attributes-L3eKsbdy.mjs +16 -0
  15. package/chunks/color-mode-warning-71FmlzWX.mjs +13 -0
  16. package/chunks/{form-check.styles-B0pxJ6YC.mjs → form-check.styles-DqvBnspm.mjs} +24 -3
  17. package/chunks/{mp-calendar.element-CJ8-t-Zn.mjs → mp-calendar.element-BIHS9SZZ.mjs} +11 -6
  18. package/chunks/{mp-checkbox-CzwS7Y_t.mjs → mp-checkbox-zV83gILn.mjs} +44 -36
  19. package/chunks/{mp-datatable-B7st6G-I.mjs → mp-datatable-CEpSxlkd.mjs} +660 -357
  20. package/chunks/{mp-datetime-picker.element-DsWA1AFs.mjs → mp-datetime-picker.element-Cxu5-qRE.mjs} +29 -32
  21. package/chunks/{mp-pagination-Dea75mD4.mjs → mp-pagination-hGy4dL7p.mjs} +9 -4
  22. package/chunks/{mp-radio-cL46sUA0.mjs → mp-radio-BhRVNdKp.mjs} +32 -28
  23. package/chunks/{mp-select-BNrbPwN4.mjs → mp-select-CgqYFvUj.mjs} +41 -26
  24. package/chunks/{mp-splitter-Ckn1kN4v.mjs → mp-splitter-DLehrw3Y.mjs} +144 -120
  25. package/chunks/{mp-timepicker.element-CwaAAOcm.mjs → mp-timepicker.element-BiB9lkgc.mjs} +58 -45
  26. package/chunks/{mp-toggle-button-eo_aTQtu.mjs → mp-toggle-button-CaS9uYLE.mjs} +26 -24
  27. package/chunks/{mp-treeview-C8iltDbq.mjs → mp-treeview-CaMTDrvY.mjs} +51 -50
  28. package/chunks/{overlay-controller-DifgO6jT.mjs → overlay-controller-BHDagokg.mjs} +96 -92
  29. package/chunks/{id-DNZVAnGC.mjs → resource.service--lqLwEqk.mjs} +144 -206
  30. package/chunks/view-window-DGvFiDnW.mjs +263 -0
  31. package/code-snippet/index.mjs +70 -66
  32. package/code-snippet/src/hljs-loaders.generated.d.ts +1 -1
  33. package/custom-elements.json +66193 -0
  34. package/datatable/index.mjs +1 -1
  35. package/datatable/src/components/column-resize.d.ts +11 -0
  36. package/datatable/src/components/index.d.ts +1 -1
  37. package/datatable/src/components/mp-datatable.d.ts +264 -20
  38. package/datatable/src/index.d.ts +1 -1
  39. package/datatable/src/types/labels.d.ts +11 -0
  40. package/datepicker/index.mjs +10 -9
  41. package/datetime-picker/index.mjs +1 -1
  42. package/datetime-picker/src/mp-datetime-picker.element.d.ts +3 -0
  43. package/dock/index.mjs +430 -463
  44. package/dock/src/components/mint-dock-manager.element.d.ts +25 -2
  45. package/dock/src/core/resize.d.ts +60 -0
  46. package/dropdown-menu/index.mjs +4 -2
  47. package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +6 -1
  48. package/dropdown-menu/src/index.d.ts +1 -1
  49. package/dropdown-menu/src/types/dropdown.d.ts +14 -1
  50. package/dropdown-menu/src/types/index.d.ts +1 -1
  51. package/file-manager/index.mjs +63 -61
  52. package/file-manager/src/components/mp-file-manager.d.ts +4 -3
  53. package/multi-range/index.mjs +56 -50
  54. package/multi-range/src/mint-multi-range.element.d.ts +4 -10
  55. package/multi-range/src/pointer-geometry.d.ts +31 -0
  56. package/navbar/index.mjs +89 -439
  57. package/overlay/index.mjs +1 -1
  58. package/overlay/src/overlay-controller.d.ts +0 -14
  59. package/overlay/src/placement.d.ts +48 -0
  60. package/package.json +7 -1
  61. package/pagination/index.mjs +1 -1
  62. package/phone-input/index.mjs +44 -40
  63. package/phone-input/src/components/stack.d.ts +8 -0
  64. package/query-builder/index.mjs +418 -466
  65. package/query-builder/src/dnd/drag-controller.d.ts +12 -8
  66. package/query-builder/src/mp-query-builder.element.d.ts +5 -1
  67. package/query-builder/src/mp-query-condition.element.d.ts +1 -0
  68. package/radio/index.mjs +1 -1
  69. package/radio-group/index.mjs +1 -1
  70. package/ribbon/index.mjs +477 -498
  71. package/ribbon/src/core/band-text-color.d.ts +10 -0
  72. package/ribbon/src/core/key-tip-allocator.d.ts +10 -0
  73. package/ribbon/src/core/plan-reduce-steps.d.ts +62 -0
  74. package/ribbon/src/mp-ribbon.element.d.ts +0 -27
  75. package/scheduler/index.mjs +726 -711
  76. package/scheduler/src/components/mp-scheduler.d.ts +19 -3
  77. package/scheduler/src/drag/drag-manager.d.ts +1 -9
  78. package/scheduler/src/input/input-handler.d.ts +12 -2
  79. package/scheduler/src/utils/geometry.d.ts +39 -0
  80. package/scheduler/src/views/timeline-view.d.ts +0 -1
  81. package/scheduler-core/index.mjs +84 -71
  82. package/scheduler-core/src/services/resource.service.d.ts +0 -12
  83. package/scheduler-core/src/services/timeline.service.d.ts +0 -9
  84. package/select/index.mjs +1 -1
  85. package/select/src/components/mp-select.d.ts +1 -0
  86. package/signature-pad/index.mjs +21 -23
  87. package/signature-pad/src/canvas-point.d.ts +26 -0
  88. package/signature-pad/src/mp-signature-pad.element.d.ts +1 -7
  89. package/splitter/index.mjs +1 -1
  90. package/splitter/src/components/mp-splitter.d.ts +16 -0
  91. package/splitter/src/managers/index.d.ts +1 -0
  92. package/splitter/src/managers/rescale-panel-sizes.d.ts +14 -0
  93. package/swiper-core/index.mjs +2 -2
  94. package/theming/bs-theme-preboot.js +1 -0
  95. package/theming/color-mode.css +36 -0
  96. package/theming/index.d.ts +1 -0
  97. package/theming/index.mjs +327 -0
  98. package/theming/src/components/mp-theme-toggle.d.ts +71 -0
  99. package/theming/src/cookie.d.ts +31 -0
  100. package/theming/src/index.d.ts +5 -0
  101. package/theming/src/preboot.d.ts +1 -0
  102. package/theming/src/resolve.d.ts +36 -0
  103. package/theming/src/store.d.ts +27 -0
  104. package/theming/src/styles/theme-toggle.styles.d.ts +2 -0
  105. package/theming/src/testing/fake-broadcast-channel.d.ts +35 -0
  106. package/theming/src/toggle-modes.d.ts +23 -0
  107. package/tile-manager/index.mjs +252 -211
  108. package/tile-manager/src/components/mint-tile-manager.element.d.ts +8 -0
  109. package/tile-manager/src/utils/grid-geometry.d.ts +49 -0
  110. package/timeline/index.mjs +156 -164
  111. package/timeline/src/components/mp-timeline.d.ts +41 -7
  112. package/timepicker/index.mjs +7 -4
  113. package/timepicker/src/mp-time-list.element.d.ts +26 -0
  114. package/timepicker/src/mp-timepicker.element.d.ts +3 -0
  115. package/toggle-button/index.mjs +1 -1
  116. package/tree-select/index.mjs +21 -9
  117. package/treeview/index.mjs +1 -1
  118. package/treeview/src/components/mp-treeview.d.ts +6 -4
  119. package/chunks/color-DIeST-IS.mjs +0 -224
  120. 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 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 = [
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, ${E})`,
11
+ `z-index: var(--mp-overlay-container-z-index, ${k})`,
12
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 {
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 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;
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 O() {
25
+ function E() {
26
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++;
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(), a = Math.max(0, a - 1), a === 0 && l && (l.remove(), l = null));
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 W() {
38
- return l?.isConnected ? l : null;
37
+ function N() {
38
+ return c?.isConnected ? c : null;
39
39
  }
40
- function $() {
41
- return a;
40
+ function Y() {
41
+ return h;
42
42
  }
43
- const D = [
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 n = o.composedPath();
64
- if (n.includes(this.host)) return;
101
+ const i = o.composedPath();
102
+ if (i.includes(this.host)) return;
65
103
  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(), {
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 v.push("overlay-frame-external");
126
+ return d.push("overlay-frame-external");
89
127
  }
90
128
  static releaseFrame(t) {
91
- v.release(t);
129
+ d.release(t);
92
130
  }
93
131
  static isFrameTop(t) {
94
- return v.isTop(t);
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 = 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?.();
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 = S(e)[0];
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 = 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`;
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 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;
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, n = Math.max(0, window.innerWidth - t.clientWidth);
351
- if (this.blockedScroll = { top: e, left: o }, n > 0) {
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 i = parseFloat(getComputedStyle(s).paddingRight) || 0;
355
- s.style.paddingRight = `${i + n}px`;
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
- O as a,
383
- W as c,
384
- $ as o
386
+ E as a,
387
+ N as c,
388
+ Y as o
385
389
  };