@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,7 +1,7 @@
1
1
  import { unsafeCSS as S, LitElement as A, html as M } from "lit";
2
2
  import "lit/directives/ref.js";
3
3
  import { F as w } from "./focus-restore-DxuP1Oe2.mjs";
4
- var b = /* @__PURE__ */ ((u) => (u.Idle = "idle", u.Resizing = "resizing", u))(b || {});
4
+ var b = /* @__PURE__ */ ((l) => (l.Idle = "idle", l.Resizing = "resizing", l))(b || {});
5
5
  class R {
6
6
  constructor(e) {
7
7
  this.listeners = /* @__PURE__ */ new Set(), this.state = {
@@ -36,8 +36,8 @@ class R {
36
36
  }
37
37
  notifyListeners() {
38
38
  const e = this.getState();
39
- for (const i of this.listeners)
40
- i(e);
39
+ for (const t of this.listeners)
40
+ t(e);
41
41
  }
42
42
  setOrientation(e) {
43
43
  this.state.orientation !== e && (this.state = { ...this.state, orientation: e }, this.notifyListeners());
@@ -79,19 +79,19 @@ class R {
79
79
  return this.state.resizeOperation?.state === b.Resizing;
80
80
  }
81
81
  }
82
- function g(u) {
83
- const e = "touches" in u;
84
- let i, t;
82
+ function g(l) {
83
+ const e = "touches" in l;
84
+ let t, i;
85
85
  if (e) {
86
- const s = u.touches[0] || u.changedTouches[0];
87
- i = s.clientX, t = s.clientY;
86
+ const s = l.touches[0] || l.changedTouches[0];
87
+ t = s.clientX, i = s.clientY;
88
88
  } else
89
- i = u.clientX, t = u.clientY;
89
+ t = l.clientX, i = l.clientY;
90
90
  return {
91
- clientX: i,
92
- clientY: t,
93
- point: { x: i, y: t },
94
- originalEvent: u,
91
+ clientX: t,
92
+ clientY: i,
93
+ point: { x: t, y: i },
94
+ originalEvent: l,
95
95
  isTouch: e
96
96
  };
97
97
  }
@@ -107,14 +107,14 @@ class y {
107
107
  constructor(e) {
108
108
  this.isActive = !1, this.currentDividerIndex = -1, this.currentDividerElement = null, this.callbacks = e, this.boundMouseMove = this.handleMouseMove.bind(this), this.boundMouseUp = this.handleMouseUp.bind(this), this.boundTouchMove = this.handleTouchMove.bind(this), this.boundTouchEnd = this.handleTouchEnd.bind(this);
109
109
  }
110
- attachDividerListeners(e, i) {
111
- e.addEventListener("mousedown", (t) => this.handleMouseDown(t, i, e)), e.addEventListener("touchstart", (t) => this.handleTouchStart(t, i, e), { passive: !1 }), e.addEventListener("keydown", (t) => this.handleKeyDown(t, i, e));
110
+ attachDividerListeners(e, t) {
111
+ e.addEventListener("mousedown", (i) => this.handleMouseDown(i, t, e)), e.addEventListener("touchstart", (i) => this.handleTouchStart(i, t, e), { passive: !1 }), e.addEventListener("keydown", (i) => this.handleKeyDown(i, t, e));
112
112
  }
113
- handleKeyDown(e, i, t) {
114
- this.callbacks.onResizeKey && E.has(e.key) && (e.preventDefault(), this.callbacks.onResizeKey(e.key, e.shiftKey, i, t));
113
+ handleKeyDown(e, t, i) {
114
+ this.callbacks.onResizeKey && E.has(e.key) && (e.preventDefault(), this.callbacks.onResizeKey(e.key, e.shiftKey, t, i));
115
115
  }
116
- handleMouseDown(e, i, t) {
117
- e.preventDefault(), this.startResize(e, i, t), document.addEventListener("mousemove", this.boundMouseMove), document.addEventListener("mouseup", this.boundMouseUp);
116
+ handleMouseDown(e, t, i) {
117
+ e.preventDefault(), this.startResize(e, t, i), document.addEventListener("mousemove", this.boundMouseMove), document.addEventListener("mouseup", this.boundMouseUp);
118
118
  }
119
119
  handleMouseMove(e) {
120
120
  this.isActive && (e.preventDefault(), this.callbacks.onResizeMove(g(e)));
@@ -122,8 +122,8 @@ class y {
122
122
  handleMouseUp(e) {
123
123
  this.isActive && (this.endResize(e), document.removeEventListener("mousemove", this.boundMouseMove), document.removeEventListener("mouseup", this.boundMouseUp));
124
124
  }
125
- handleTouchStart(e, i, t) {
126
- e.preventDefault(), this.startResize(e, i, t), document.addEventListener("touchmove", this.boundTouchMove, { passive: !1 }), document.addEventListener("touchend", this.boundTouchEnd), document.addEventListener("touchcancel", this.boundTouchEnd);
125
+ handleTouchStart(e, t, i) {
126
+ e.preventDefault(), this.startResize(e, t, i), document.addEventListener("touchmove", this.boundTouchMove, { passive: !1 }), document.addEventListener("touchend", this.boundTouchEnd), document.addEventListener("touchcancel", this.boundTouchEnd);
127
127
  }
128
128
  handleTouchMove(e) {
129
129
  this.isActive && (e.preventDefault(), this.callbacks.onResizeMove(g(e)));
@@ -131,8 +131,8 @@ class y {
131
131
  handleTouchEnd(e) {
132
132
  this.isActive && (this.endResize(e), document.removeEventListener("touchmove", this.boundTouchMove), document.removeEventListener("touchend", this.boundTouchEnd), document.removeEventListener("touchcancel", this.boundTouchEnd));
133
133
  }
134
- startResize(e, i, t) {
135
- this.isActive = !0, this.currentDividerIndex = i, this.currentDividerElement = t, this.callbacks.onResizeStart(g(e), i, t);
134
+ startResize(e, t, i) {
135
+ this.isActive = !0, this.currentDividerIndex = t, this.currentDividerElement = i, this.callbacks.onResizeStart(g(e), t, i);
136
136
  }
137
137
  endResize(e) {
138
138
  this.callbacks.onResizeEnd(g(e)), this.isActive = !1, this.currentDividerIndex = -1, this.currentDividerElement = null;
@@ -150,34 +150,34 @@ class P {
150
150
  minPanelSize: e.minPanelSize ?? 50
151
151
  };
152
152
  }
153
- computePanelSizes(e, i) {
154
- return e.map((t) => {
155
- const s = t.getBoundingClientRect();
156
- return i === "horizontal" ? s.width : s.height;
153
+ computePanelSizes(e, t) {
154
+ return e.map((i) => {
155
+ const s = i.getBoundingClientRect();
156
+ return t === "horizontal" ? s.width : s.height;
157
157
  });
158
158
  }
159
- createResizeOperation(e, i, t, s) {
159
+ createResizeOperation(e, t, i, s) {
160
160
  return {
161
161
  state: b.Resizing,
162
162
  startPosition: { ...e },
163
- sizes: [...i],
164
- indexBefore: t,
165
- indexAfter: t + 1,
163
+ sizes: [...t],
164
+ indexBefore: i,
165
+ indexAfter: i + 1,
166
166
  dividerElement: s
167
167
  };
168
168
  }
169
- calculatePreviewSizes(e, i, t) {
170
- const { startPosition: s, sizes: n, indexBefore: a, indexAfter: o } = e, d = t === "horizontal" ? i.x - s.x : i.y - s.y, h = [...n], r = n[a], m = n[o];
171
- let p = r + d, l = m - d;
172
- if (p < this.options.minPanelSize) {
173
- const c = this.options.minPanelSize - p;
174
- p = this.options.minPanelSize, l -= c;
169
+ calculatePreviewSizes(e, t, i) {
170
+ const { startPosition: s, sizes: n, indexBefore: a, indexAfter: o } = e, c = i === "horizontal" ? t.x - s.x : t.y - s.y, h = [...n], r = n[a], p = n[o];
171
+ let u = r + c, d = p - c;
172
+ if (u < this.options.minPanelSize) {
173
+ const z = this.options.minPanelSize - u;
174
+ u = this.options.minPanelSize, d -= z;
175
175
  }
176
- if (l < this.options.minPanelSize) {
177
- const c = this.options.minPanelSize - l;
178
- l = this.options.minPanelSize, p -= c;
176
+ if (d < this.options.minPanelSize) {
177
+ const z = this.options.minPanelSize - d;
178
+ d = this.options.minPanelSize, u -= z;
179
179
  }
180
- return p = Math.max(p, this.options.minPanelSize), l = Math.max(l, this.options.minPanelSize), h[a] = p, h[o] = l, h;
180
+ return u = Math.max(u, this.options.minPanelSize), d = Math.max(d, this.options.minPanelSize), h[a] = u, h[o] = d, h;
181
181
  }
182
182
  setMinPanelSize(e) {
183
183
  this.options.minPanelSize = e;
@@ -186,7 +186,16 @@ class P {
186
186
  return this.options.minPanelSize;
187
187
  }
188
188
  }
189
- const O = S(`:host {
189
+ function O(l, e) {
190
+ if (l.length === 0 || !Number.isFinite(e)) return null;
191
+ const t = l.reduce((n, a) => n + a, 0);
192
+ if (!(t > 0)) return null;
193
+ const i = Math.max(0, e);
194
+ if (Math.abs(i - t) < 1) return null;
195
+ const s = i / t;
196
+ return l.map((n) => n * s);
197
+ }
198
+ const L = S(`:host {
190
199
  display: block;
191
200
  width: 100%;
192
201
  height: 100%;
@@ -328,10 +337,10 @@ const O = S(`:host {
328
337
  transition: none !important;
329
338
  }
330
339
  }`);
331
- let L = 0;
332
- class C extends A {
340
+ let C = 0;
341
+ class k extends A {
333
342
  constructor() {
334
- super(), this.container = null, this.panelWrappers = [], this.dividers = [], this.slotElement = null, this.mutationObserver = null, this.containerResizeObserver = null, this.unsubscribeState = null, this.instanceId = `mp-splitter-${++L}`, this.dividerFocusRestore = new w(() => this.shadowRoot, {
343
+ super(), this.container = null, this.panelWrappers = [], this.dividers = [], this.slotElement = null, this.mutationObserver = null, this.containerResizeObserver = null, this.unsubscribeState = null, this.instanceId = `mp-splitter-${++C}`, this.dividerFocusRestore = new w(() => this.shadowRoot, {
335
344
  selector: ".divider",
336
345
  keyOf: (e) => e.dataset.key ?? null
337
346
  }), this.stateManager = new R(), this.resizeManager = new P(), this.inputHandler = new y({
@@ -342,7 +351,7 @@ class C extends A {
342
351
  });
343
352
  }
344
353
  static {
345
- this.styles = [O];
354
+ this.styles = [L];
346
355
  }
347
356
  static get observedAttributes() {
348
357
  return [
@@ -361,37 +370,54 @@ class C extends A {
361
370
  firstUpdated() {
362
371
  this.container = this.shadowRoot.querySelector(".splitter-container"), this.container.classList.add(this.orientation), this.slotElement = this.shadowRoot.querySelector("slot"), this.slotElement.style.display = "none", this.slotElement.addEventListener("slotchange", () => {
363
372
  this.updatePanelsFromSlot();
364
- }), this.setupMutationObserver(), this.subscribeToState(), this.setupContainerResizeObserver(), requestAnimationFrame(() => {
373
+ }), this.attachObservers();
374
+ }
375
+ connectedCallback() {
376
+ super.connectedCallback(), this.container && this.attachObservers();
377
+ }
378
+ /**
379
+ * Observers + state subscription, plus a deferred panel rebuild so children
380
+ * changed while detached are picked up. Paired with disconnectedCallback.
381
+ */
382
+ attachObservers() {
383
+ this.setupMutationObserver(), this.subscribeToState(), this.setupContainerResizeObserver(), requestAnimationFrame(() => {
365
384
  this.updatePanelsFromSlot();
366
385
  });
367
386
  }
368
387
  disconnectedCallback() {
369
- this.inputHandler.dispose(), this.mutationObserver && (this.mutationObserver.disconnect(), this.mutationObserver = null), this.containerResizeObserver && (this.containerResizeObserver.disconnect(), this.containerResizeObserver = null), this.unsubscribeState && (this.unsubscribeState(), this.unsubscribeState = null), super.disconnectedCallback();
388
+ this.stateManager.isResizing() && this.handleResizeEnd(), this.inputHandler.dispose(), this.mutationObserver && (this.mutationObserver.disconnect(), this.mutationObserver = null), this.containerResizeObserver && (this.containerResizeObserver.disconnect(), this.containerResizeObserver = null), this.unsubscribeState && (this.unsubscribeState(), this.unsubscribeState = null), super.disconnectedCallback();
370
389
  }
371
- attributeChangedCallback(e, i, t) {
372
- if (super.attributeChangedCallback(e, i, t), i !== t)
390
+ attributeChangedCallback(e, t, i) {
391
+ if (super.attributeChangedCallback(e, t, i), t !== i)
373
392
  switch (e) {
374
393
  case "orientation":
375
- this.stateManager.setOrientation(
376
- t || "horizontal"
377
- ), this.updateContainerOrientation();
394
+ this.stateManager.setOrientation(this.orientation), this.updateContainerOrientation();
378
395
  break;
379
396
  case "min-panel-size":
380
- const s = t ? parseInt(t, 10) : 50;
397
+ const s = i ? parseInt(i, 10) : 50;
381
398
  this.resizeManager.setMinPanelSize(isNaN(s) ? 50 : s);
382
399
  break;
383
400
  }
384
401
  }
385
402
  // Public API
403
+ /**
404
+ * Anything but "vertical" is horizontal. The attribute was cast straight to
405
+ * `Direction`, so an unknown value was reported as the orientation and added
406
+ * to the container as a class, matching neither layout rule.
407
+ */
386
408
  get orientation() {
387
- return this.getAttribute("orientation") || "horizontal";
409
+ return this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal";
388
410
  }
389
411
  set orientation(e) {
390
412
  this.setAttribute("orientation", e);
391
413
  }
414
+ /**
415
+ * The minimum panel size the resize maths enforces. Read from the resize
416
+ * manager, the single source of truth, so a non-numeric attribute reads
417
+ * back as the 50 px fallback actually in use rather than NaN.
418
+ */
392
419
  get minPanelSize() {
393
- const e = this.getAttribute("min-panel-size");
394
- return e ? parseInt(e, 10) : 50;
420
+ return this.resizeManager.getMinPanelSize();
395
421
  }
396
422
  set minPanelSize(e) {
397
423
  this.setAttribute("min-panel-size", String(e));
@@ -415,9 +441,9 @@ class C extends A {
415
441
  * (Arrow{Left,Right,Up,Down}, Home, End); `fine` halves the step (matches
416
442
  * Shift modifier on the keyboard path).
417
443
  */
418
- resizeDividerBy(e, i, t = !1) {
444
+ resizeDividerBy(e, t, i = !1) {
419
445
  const s = this.dividers[e];
420
- s && this.handleResizeKey(i, t, e, s);
446
+ s && this.handleResizeKey(t, i, e, s);
421
447
  }
422
448
  setPanelSizes(e) {
423
449
  this.applyPanelSizes(e), this.stateManager.setPanelSizes(e);
@@ -447,18 +473,18 @@ class C extends A {
447
473
  */
448
474
  updateDividerAriaValues() {
449
475
  if (this.dividers.length === 0 || !this.container) return;
450
- const e = this.stateManager.getState(), i = e.previewSizes ?? e.panelSizes;
451
- if (i.length !== this.panelWrappers.length || i.length === 0) return;
452
- const t = this.container.getBoundingClientRect(), s = this.orientation === "horizontal" ? t.width : t.height;
476
+ const e = this.stateManager.getState(), t = e.previewSizes ?? e.panelSizes;
477
+ if (t.length !== this.panelWrappers.length || t.length === 0) return;
478
+ const i = this.container.getBoundingClientRect(), s = this.orientation === "horizontal" ? i.width : i.height;
453
479
  if (s <= 0) return;
454
480
  const n = this.resizeManager.getMinPanelSize();
455
481
  this.dividers.forEach((a, o) => {
456
- const d = i[o], h = i[o + 1];
457
- if (d === void 0 || h === void 0) return;
458
- const r = Math.round(d / s * 100), m = Math.round(n / s * 100), p = d + h, l = Math.round((p - n) / s * 100);
459
- a.setAttribute("aria-valuenow", String(r)), a.setAttribute("aria-valuemin", String(m)), a.setAttribute("aria-valuemax", String(l));
460
- const c = Math.round(h / s * 100);
461
- a.setAttribute("aria-valuetext", r + "% / " + c + "%");
482
+ const c = t[o], h = t[o + 1];
483
+ if (c === void 0 || h === void 0) return;
484
+ const r = Math.round(c / s * 100), p = Math.round(n / s * 100), u = c + h, d = Math.round((u - n) / s * 100);
485
+ a.setAttribute("aria-valuenow", String(r)), a.setAttribute("aria-valuemin", String(p)), a.setAttribute("aria-valuemax", String(d));
486
+ const z = Math.round(h / s * 100);
487
+ a.setAttribute("aria-valuetext", r + "% / " + z + "%");
462
488
  });
463
489
  }
464
490
  updatePanelsFromSlot() {
@@ -468,14 +494,14 @@ class C extends A {
468
494
  );
469
495
  if (e.length === 0) return;
470
496
  this.dividerFocusRestore.capture(), this.container.innerHTML = "", this.panelWrappers = [], this.dividers = [];
471
- const i = e.length, t = this.orientation === "horizontal" ? "vertical" : "horizontal";
497
+ const t = e.length, i = this.orientation === "horizontal" ? "vertical" : "horizontal";
472
498
  e.forEach((n, a) => {
473
499
  const o = document.createElement("div");
474
500
  o.className = "panel-wrapper flex-grow", o.id = `${this.instanceId}-panel-${a}`;
475
- const d = document.createElement("slot"), h = `panel-${a}`;
476
- if (d.name = h, n.slot = h, o.appendChild(d), this.panelWrappers.push(o), this.container.appendChild(o), a < i - 1) {
501
+ const c = document.createElement("slot"), h = `panel-${a}`;
502
+ if (c.name = h, n.slot = h, o.appendChild(c), this.panelWrappers.push(o), this.container.appendChild(o), a < t - 1) {
477
503
  const r = document.createElement("div");
478
- r.className = "divider", r.dataset.key = `divider-${a}`, r.setAttribute("role", "separator"), r.setAttribute("aria-orientation", t), r.setAttribute("tabindex", "0"), r.setAttribute(
504
+ r.className = "divider", r.dataset.key = `divider-${a}`, r.setAttribute("role", "separator"), r.setAttribute("aria-orientation", i), r.setAttribute("tabindex", "0"), r.setAttribute(
479
505
  "aria-controls",
480
506
  `${this.instanceId}-panel-${a} ${this.instanceId}-panel-${a + 1}`
481
507
  ), r.setAttribute(
@@ -507,10 +533,10 @@ class C extends A {
507
533
  */
508
534
  pinSizesFromCurrentLayout() {
509
535
  if (this.panelWrappers.length === 0) return;
510
- const e = this.orientation === "horizontal" ? "width" : "height", i = this.panelWrappers.map(
511
- (t) => t.getBoundingClientRect()[e]
536
+ const e = this.orientation === "horizontal" ? "width" : "height", t = this.panelWrappers.map(
537
+ (i) => i.getBoundingClientRect()[e]
512
538
  );
513
- i.every((t) => t <= 0) || (this.applyPanelSizes(i), this.stateManager.setPanelSizes(i));
539
+ t.every((i) => i <= 0) || (this.applyPanelSizes(t), this.stateManager.setPanelSizes(t));
514
540
  }
515
541
  setupContainerResizeObserver() {
516
542
  !this.container || typeof ResizeObserver > "u" || (this.containerResizeObserver = new ResizeObserver(() => {
@@ -528,38 +554,36 @@ class C extends A {
528
554
  if (!this.container || this.panelWrappers.length === 0 || this.stateManager.isResizing()) return;
529
555
  const e = this.stateManager.getState().panelSizes;
530
556
  if (e.length === 0 || e.length !== this.panelWrappers.length) return;
531
- const i = this.container.getBoundingClientRect(), t = this.orientation === "horizontal" ? i.width : i.height;
532
- if (t <= 0) return;
557
+ const t = this.container.getBoundingClientRect(), i = this.orientation === "horizontal" ? t.width : t.height;
558
+ if (i <= 0) return;
533
559
  const s = this.orientation === "horizontal" ? "width" : "height", n = this.dividers.reduce(
534
- (l, c) => l + c.getBoundingClientRect()[s],
560
+ (r, p) => r + p.getBoundingClientRect()[s],
535
561
  0
536
- ), a = this.orientation === "horizontal" ? "marginLeft" : "marginTop", o = this.orientation === "horizontal" ? "marginRight" : "marginBottom", d = this.panelWrappers.reduce((l, c) => {
537
- const z = getComputedStyle(c);
538
- return l + parseFloat(z[a]) + parseFloat(z[o]);
539
- }, 0), h = Math.max(0, t - n - d), r = e.reduce((l, c) => l + c, 0);
540
- if (r <= 0 || Math.abs(h - r) < 1) return;
541
- const m = h / r, p = e.map((l) => l * m);
542
- this.applyPanelSizes(p), this.stateManager.setPanelSizes(p), this.updateDividerAriaValues();
562
+ ), a = this.orientation === "horizontal" ? "marginLeft" : "marginTop", o = this.orientation === "horizontal" ? "marginRight" : "marginBottom", c = this.panelWrappers.reduce((r, p) => {
563
+ const u = getComputedStyle(p);
564
+ return r + parseFloat(u[a]) + parseFloat(u[o]);
565
+ }, 0), h = O(e, i - n - c);
566
+ h && (this.applyPanelSizes(h), this.stateManager.setPanelSizes(h), this.updateDividerAriaValues());
543
567
  }
544
568
  updateContainerOrientation() {
545
569
  if (!this.container) return;
546
570
  this.container.className = `splitter-container ${this.orientation}`;
547
571
  const e = this.orientation === "horizontal" ? "vertical" : "horizontal";
548
- this.dividers.forEach((i) => {
549
- i.setAttribute("aria-orientation", e);
572
+ this.dividers.forEach((t) => {
573
+ t.setAttribute("aria-orientation", e);
550
574
  });
551
575
  }
552
- handleResizeStart(e, i, t) {
576
+ handleResizeStart(e, t, i) {
553
577
  const s = this.resizeManager.computePanelSizes(
554
578
  this.panelWrappers,
555
579
  this.orientation
556
580
  ), n = this.resizeManager.createResizeOperation(
557
581
  e.point,
558
582
  s,
559
- i,
560
- t
583
+ t,
584
+ i
561
585
  );
562
- this.stateManager.startResize(n), t.classList.add("active"), this.dispatchEvent(
586
+ this.stateManager.startResize(n), i.classList.add("active"), this.dispatchEvent(
563
587
  new CustomEvent("resize-start", {
564
588
  bubbles: !0,
565
589
  detail: {
@@ -570,32 +594,32 @@ class C extends A {
570
594
  );
571
595
  }
572
596
  handleResizeMove(e) {
573
- const i = this.stateManager.getState();
574
- if (!i.resizeOperation) return;
575
- const t = this.resizeManager.calculatePreviewSizes(
576
- i.resizeOperation,
597
+ const t = this.stateManager.getState();
598
+ if (!t.resizeOperation) return;
599
+ const i = this.resizeManager.calculatePreviewSizes(
600
+ t.resizeOperation,
577
601
  e.point,
578
602
  this.orientation
579
603
  );
580
- this.stateManager.updateResize(t), this.applyPanelSizes(t), this.dispatchEvent(
604
+ this.stateManager.updateResize(i), this.applyPanelSizes(i), this.dispatchEvent(
581
605
  new CustomEvent("resizing", {
582
606
  bubbles: !0,
583
607
  detail: {
584
- sizes: t,
608
+ sizes: i,
585
609
  orientation: this.orientation
586
610
  }
587
611
  })
588
612
  );
589
613
  }
590
614
  handleResizeEnd(e) {
591
- const i = this.stateManager.getState();
592
- if (!i.resizeOperation) return;
593
- const t = i.previewSizes || i.resizeOperation.sizes;
594
- i.resizeOperation.dividerElement && i.resizeOperation.dividerElement.classList.remove("active"), this.stateManager.endResize(t), this.dispatchEvent(
615
+ const t = this.stateManager.getState();
616
+ if (!t.resizeOperation) return;
617
+ const i = t.previewSizes || t.resizeOperation.sizes;
618
+ t.resizeOperation.dividerElement && t.resizeOperation.dividerElement.classList.remove("active"), this.stateManager.endResize(i), this.dispatchEvent(
595
619
  new CustomEvent("resize-end", {
596
620
  bubbles: !0,
597
621
  detail: {
598
- sizes: t,
622
+ sizes: i,
599
623
  orientation: this.orientation
600
624
  }
601
625
  })
@@ -607,28 +631,28 @@ class C extends A {
607
631
  * Fires resize-start → resize-end with the new sizes so consumers don't
608
632
  * need to special-case keyboard vs. drag.
609
633
  */
610
- handleResizeKey(e, i, t, s) {
634
+ handleResizeKey(e, t, i, s) {
611
635
  if (!this.container || this.panelWrappers.length === 0) return;
612
636
  const n = [...this.stateManager.getState().panelSizes];
613
637
  if (n.length !== this.panelWrappers.length) return;
614
- const a = n[t], o = n[t + 1];
638
+ const a = n[i], o = n[i + 1];
615
639
  if (a === void 0 || o === void 0) return;
616
- const d = this.container.getBoundingClientRect(), h = this.orientation === "horizontal" ? d.width : d.height;
640
+ const c = this.container.getBoundingClientRect(), h = this.orientation === "horizontal" ? c.width : c.height;
617
641
  if (h <= 0) return;
618
- const r = this.resizeManager.getMinPanelSize(), m = this.orientation === "horizontal", p = m ? "ArrowRight" : "ArrowDown", l = m ? "ArrowLeft" : "ArrowUp";
619
- let c = 0;
620
- e === p ? c = 1 : e === l && (c = -1);
621
- let z, v;
642
+ const r = this.resizeManager.getMinPanelSize(), p = this.orientation === "horizontal", u = p ? "ArrowRight" : "ArrowDown", d = p ? "ArrowLeft" : "ArrowUp";
643
+ let z = 0;
644
+ e === u ? z = 1 : e === d && (z = -1);
645
+ let m, v;
622
646
  if (e === "Home")
623
- z = r, v = a + o - r;
647
+ m = r, v = a + o - r;
624
648
  else if (e === "End")
625
- z = a + o - r, v = r;
626
- else if (c !== 0) {
627
- const f = (i ? 1 : 10) / 100 * h * c;
628
- z = a + f, v = o - f, z < r ? (z = r, v = a + o - r) : v < r && (v = r, z = a + o - r);
649
+ m = a + o - r, v = r;
650
+ else if (z !== 0) {
651
+ const f = (t ? 1 : 10) / 100 * h * z;
652
+ m = a + f, v = o - f, m < r ? (m = r, v = a + o - r) : v < r && (v = r, m = a + o - r);
629
653
  } else
630
654
  return;
631
- z === a && v === o || (n[t] = z, n[t + 1] = v, this.applyPanelSizes(n), this.stateManager.setPanelSizes(n), this.updateDividerAriaValues(), s.classList.add("active"), queueMicrotask(() => s.classList.remove("active")), this.dispatchEvent(
655
+ m === a && v === o || (n[i] = m, n[i + 1] = v, this.applyPanelSizes(n), this.stateManager.setPanelSizes(n), this.updateDividerAriaValues(), s.classList.add("active"), queueMicrotask(() => s.classList.remove("active")), this.dispatchEvent(
632
656
  new CustomEvent("resize-end", {
633
657
  bubbles: !0,
634
658
  detail: { sizes: n, orientation: this.orientation }
@@ -636,19 +660,19 @@ class C extends A {
636
660
  ));
637
661
  }
638
662
  applyPanelSizes(e) {
639
- const i = this.orientation === "horizontal" ? "width" : "height", t = this.orientation === "horizontal" ? "height" : "width";
663
+ const t = this.orientation === "horizontal" ? "width" : "height", i = this.orientation === "horizontal" ? "height" : "width";
640
664
  this.panelWrappers.forEach((s, n) => {
641
- e[n] !== void 0 && (s.style[i] = `${e[n]}px`, s.style[t] = "", s.classList.remove("flex-grow"));
665
+ e[n] !== void 0 && (s.style[t] = `${e[n]}px`, s.style[i] = "", s.classList.remove("flex-grow"));
642
666
  });
643
667
  }
644
668
  }
645
- typeof customElements < "u" && !customElements.get("mp-splitter") && customElements.define("mp-splitter", C);
669
+ typeof customElements < "u" && !customElements.get("mp-splitter") && customElements.define("mp-splitter", k);
646
670
  export {
647
671
  y as I,
648
- C as M,
672
+ k as M,
649
673
  P as R,
650
674
  R as S,
651
675
  b as a,
652
676
  g as n,
653
- O as s
677
+ L as s
654
678
  };