@mintplayer/web-components 2.15.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.
Files changed (126) 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-eRpl7-2V.mjs +2238 -0
  20. package/chunks/{mp-datetime-picker.element-D1CiLbHm.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-COZEUIoE.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-D6agzzOI.mjs → overlay-controller-BHDagokg.mjs} +130 -70
  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 +65750 -0
  34. package/datatable/index.mjs +6 -5
  35. package/datatable/src/components/column-resize.d.ts +11 -0
  36. package/datatable/src/components/mp-datatable.d.ts +206 -1
  37. package/datatable/src/index.d.ts +3 -1
  38. package/datatable/src/types/column-def.d.ts +61 -0
  39. package/datatable/src/types/filter.d.ts +138 -0
  40. package/datatable/src/types/index.d.ts +3 -2
  41. package/datatable/src/types/labels.d.ts +58 -0
  42. package/datepicker/index.mjs +10 -9
  43. package/datetime-picker/index.mjs +1 -1
  44. package/datetime-picker/src/mp-datetime-picker.element.d.ts +3 -0
  45. package/dock/index.mjs +430 -463
  46. package/dock/src/components/mint-dock-manager.element.d.ts +25 -2
  47. package/dock/src/core/resize.d.ts +60 -0
  48. package/dropdown-menu/index.mjs +4 -2
  49. package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +6 -1
  50. package/dropdown-menu/src/index.d.ts +1 -1
  51. package/dropdown-menu/src/types/dropdown.d.ts +14 -1
  52. package/dropdown-menu/src/types/index.d.ts +1 -1
  53. package/file-manager/index.mjs +63 -61
  54. package/file-manager/src/components/mp-file-manager.d.ts +4 -3
  55. package/multi-range/index.mjs +56 -50
  56. package/multi-range/src/mint-multi-range.element.d.ts +4 -10
  57. package/multi-range/src/pointer-geometry.d.ts +31 -0
  58. package/navbar/index.mjs +89 -439
  59. package/overlay/index.mjs +5 -2
  60. package/overlay/src/index.d.ts +2 -0
  61. package/overlay/src/overlay-controller.d.ts +27 -14
  62. package/overlay/src/overlay-portal.d.ts +53 -0
  63. package/overlay/src/placement.d.ts +48 -0
  64. package/package.json +7 -1
  65. package/pagination/index.mjs +1 -1
  66. package/phone-input/index.mjs +44 -40
  67. package/phone-input/src/components/stack.d.ts +8 -0
  68. package/query-builder/index.mjs +418 -466
  69. package/query-builder/src/dnd/drag-controller.d.ts +12 -8
  70. package/query-builder/src/mp-query-builder.element.d.ts +5 -1
  71. package/query-builder/src/mp-query-condition.element.d.ts +1 -0
  72. package/radio/index.mjs +1 -1
  73. package/radio-group/index.mjs +1 -1
  74. package/ribbon/index.mjs +477 -498
  75. package/ribbon/src/core/band-text-color.d.ts +10 -0
  76. package/ribbon/src/core/key-tip-allocator.d.ts +10 -0
  77. package/ribbon/src/core/plan-reduce-steps.d.ts +62 -0
  78. package/ribbon/src/mp-ribbon.element.d.ts +0 -27
  79. package/scheduler/index.mjs +726 -711
  80. package/scheduler/src/components/mp-scheduler.d.ts +19 -3
  81. package/scheduler/src/drag/drag-manager.d.ts +1 -9
  82. package/scheduler/src/input/input-handler.d.ts +12 -2
  83. package/scheduler/src/utils/geometry.d.ts +39 -0
  84. package/scheduler/src/views/timeline-view.d.ts +0 -1
  85. package/scheduler-core/index.mjs +84 -71
  86. package/scheduler-core/src/services/resource.service.d.ts +0 -12
  87. package/scheduler-core/src/services/timeline.service.d.ts +0 -9
  88. package/select/index.mjs +1 -1
  89. package/select/src/components/mp-select.d.ts +1 -0
  90. package/signature-pad/index.mjs +21 -23
  91. package/signature-pad/src/canvas-point.d.ts +26 -0
  92. package/signature-pad/src/mp-signature-pad.element.d.ts +1 -7
  93. package/splitter/index.mjs +1 -1
  94. package/splitter/src/components/mp-splitter.d.ts +16 -0
  95. package/splitter/src/managers/index.d.ts +1 -0
  96. package/splitter/src/managers/rescale-panel-sizes.d.ts +14 -0
  97. package/swiper-core/index.mjs +2 -2
  98. package/theming/bs-theme-preboot.js +1 -0
  99. package/theming/color-mode.css +36 -0
  100. package/theming/index.d.ts +1 -0
  101. package/theming/index.mjs +327 -0
  102. package/theming/src/components/mp-theme-toggle.d.ts +71 -0
  103. package/theming/src/cookie.d.ts +31 -0
  104. package/theming/src/index.d.ts +5 -0
  105. package/theming/src/preboot.d.ts +1 -0
  106. package/theming/src/resolve.d.ts +36 -0
  107. package/theming/src/store.d.ts +27 -0
  108. package/theming/src/styles/theme-toggle.styles.d.ts +2 -0
  109. package/theming/src/testing/fake-broadcast-channel.d.ts +35 -0
  110. package/theming/src/toggle-modes.d.ts +23 -0
  111. package/tile-manager/index.mjs +252 -211
  112. package/tile-manager/src/components/mint-tile-manager.element.d.ts +8 -0
  113. package/tile-manager/src/utils/grid-geometry.d.ts +49 -0
  114. package/timeline/index.mjs +156 -164
  115. package/timeline/src/components/mp-timeline.d.ts +41 -7
  116. package/timepicker/index.mjs +7 -4
  117. package/timepicker/src/mp-time-list.element.d.ts +26 -0
  118. package/timepicker/src/mp-timepicker.element.d.ts +3 -0
  119. package/toggle-button/index.mjs +1 -1
  120. package/tree-select/index.mjs +21 -9
  121. package/treeview/index.mjs +1 -1
  122. package/treeview/src/components/mp-treeview.d.ts +6 -4
  123. package/chunks/color-DIeST-IS.mjs +0 -224
  124. package/chunks/mp-datatable-UJI8E73X.mjs +0 -1400
  125. package/datatable/src/styles/datatable.styles.d.ts +0 -2
  126. package/query-builder/src/mp-query-condition.element.template.d.ts +0 -2
@@ -1,8 +1,8 @@
1
- function p(a) {
2
- return !("children" in a);
1
+ function p(i) {
2
+ return !("children" in i);
3
3
  }
4
- function g(a) {
5
- return "children" in a;
4
+ function f(i) {
5
+ return "children" in i;
6
6
  }
7
7
  const w = {
8
8
  navLabel: "Scheduler navigation",
@@ -99,16 +99,16 @@ const w = {
99
99
  eventInstructionsWithEditor: "Press Enter or M to move or resize the event with the arrow keys. F2 opens the event editor. Delete removes the event. Left and Right arrows move between events.",
100
100
  eventOnResource: "on {resource}"
101
101
  };
102
- function G(a, e) {
103
- return e ? a.replace(
102
+ function A(i, e) {
103
+ return e ? i.replace(
104
104
  /\{(\w+)\}/g,
105
105
  (t, n) => n in e ? String(e[n]) : t
106
- ) : a;
106
+ ) : i;
107
107
  }
108
- function P(a) {
109
- return a ? { ...w, ...a } : w;
108
+ function G(i) {
109
+ return i ? { ...w, ...i } : w;
110
110
  }
111
- const b = [
111
+ const E = [
112
112
  "#3788d8",
113
113
  // Blue
114
114
  "#28a745",
@@ -130,69 +130,69 @@ const b = [
130
130
  "#6c757d"
131
131
  // Gray
132
132
  ];
133
- function A(a) {
134
- return b[a % b.length];
133
+ function P(i) {
134
+ return E[i % E.length];
135
135
  }
136
- function H(a) {
137
- let e = a.replace("#", "");
136
+ function x(i) {
137
+ let e = i.replace("#", "");
138
138
  e.length === 3 && (e = e.split("").map((s) => s + s).join(""));
139
139
  const t = parseInt(e.substring(0, 2), 16), n = parseInt(e.substring(2, 4), 16), r = parseInt(e.substring(4, 6), 16);
140
140
  return (0.299 * t + 0.587 * n + 0.114 * r) / 255 > 0.5 ? "#000000" : "#ffffff";
141
141
  }
142
- function v(a) {
143
- const e = a.trim().replace("#", ""), t = e.length === 3 ? e.split("").map((n) => n + n).join("") : e;
142
+ function v(i) {
143
+ const e = i.trim().replace("#", ""), t = e.length === 3 ? e.split("").map((n) => n + n).join("") : e;
144
144
  return /^[0-9a-f]{6}$/i.test(t) ? {
145
145
  r: parseInt(t.substring(0, 2), 16),
146
146
  g: parseInt(t.substring(2, 4), 16),
147
147
  b: parseInt(t.substring(4, 6), 16)
148
148
  } : null;
149
149
  }
150
- function y({ r: a, g: e, b: t }) {
150
+ function y({ r: i, g: e, b: t }) {
151
151
  const n = (r) => {
152
152
  const o = r / 255;
153
153
  return o <= 0.03928 ? o / 12.92 : Math.pow((o + 0.055) / 1.055, 2.4);
154
154
  };
155
- return 0.2126 * n(a) + 0.7152 * n(e) + 0.0722 * n(t);
155
+ return 0.2126 * n(i) + 0.7152 * n(e) + 0.0722 * n(t);
156
156
  }
157
- function D(a, e) {
158
- const [t, n] = a >= e ? [a, e] : [e, a];
157
+ function D(i, e) {
158
+ const [t, n] = i >= e ? [i, e] : [e, i];
159
159
  return (t + 0.05) / (n + 0.05);
160
160
  }
161
- function $(a) {
162
- const e = v(a);
161
+ function H(i) {
162
+ const e = v(i);
163
163
  if (!e) return null;
164
164
  const t = y(e), n = D(t, 1);
165
165
  return D(t, 0) >= n ? "#000000" : "#ffffff";
166
166
  }
167
- function O(a, e) {
168
- const t = v(a), n = v(e);
167
+ function W(i, e) {
168
+ const t = v(i), n = v(e);
169
169
  return !t || !n ? null : D(y(t), y(n));
170
170
  }
171
- function W(a, e) {
172
- let t = a.replace("#", "");
171
+ function $(i, e) {
172
+ let t = i.replace("#", "");
173
173
  t.length === 3 && (t = t.split("").map((l) => l + l).join(""));
174
- const n = parseInt(t.substring(0, 2), 16), r = parseInt(t.substring(2, 4), 16), o = parseInt(t.substring(4, 6), 16), s = Math.min(255, Math.round(n + (255 - n) * (e / 100))), i = Math.min(255, Math.round(r + (255 - r) * (e / 100))), u = Math.min(255, Math.round(o + (255 - o) * (e / 100)));
175
- return `#${s.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}${u.toString(16).padStart(2, "0")}`;
174
+ const n = parseInt(t.substring(0, 2), 16), r = parseInt(t.substring(2, 4), 16), o = parseInt(t.substring(4, 6), 16), s = Math.min(255, Math.round(n + (255 - n) * (e / 100))), a = Math.min(255, Math.round(r + (255 - r) * (e / 100))), u = Math.min(255, Math.round(o + (255 - o) * (e / 100)));
175
+ return `#${s.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}${u.toString(16).padStart(2, "0")}`;
176
176
  }
177
- function Y(a, e) {
178
- let t = a.replace("#", "");
177
+ function Y(i, e) {
178
+ let t = i.replace("#", "");
179
179
  t.length === 3 && (t = t.split("").map((l) => l + l).join(""));
180
- const n = parseInt(t.substring(0, 2), 16), r = parseInt(t.substring(2, 4), 16), o = parseInt(t.substring(4, 6), 16), s = Math.max(0, Math.round(n * (1 - e / 100))), i = Math.max(0, Math.round(r * (1 - e / 100))), u = Math.max(0, Math.round(o * (1 - e / 100)));
181
- return `#${s.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}${u.toString(16).padStart(2, "0")}`;
180
+ const n = parseInt(t.substring(0, 2), 16), r = parseInt(t.substring(2, 4), 16), o = parseInt(t.substring(4, 6), 16), s = Math.max(0, Math.round(n * (1 - e / 100))), a = Math.max(0, Math.round(r * (1 - e / 100))), u = Math.max(0, Math.round(o * (1 - e / 100)));
181
+ return `#${s.toString(16).padStart(2, "0")}${a.toString(16).padStart(2, "0")}${u.toString(16).padStart(2, "0")}`;
182
182
  }
183
- function U(a, e) {
184
- let t = a.replace("#", "");
183
+ function O(i, e) {
184
+ let t = i.replace("#", "");
185
185
  t.length === 3 && (t = t.split("").map((s) => s + s).join(""));
186
186
  const n = parseInt(t.substring(0, 2), 16), r = parseInt(t.substring(2, 4), 16), o = parseInt(t.substring(4, 6), 16);
187
187
  return `rgba(${n}, ${r}, ${o}, ${e})`;
188
188
  }
189
189
  const k = "#3788d8";
190
- function B(a, e, t = k) {
191
- if (a.color) return a.color;
192
- const n = a.resourceId ? e.get(a.resourceId) : void 0;
190
+ function U(i, e, t = k) {
191
+ if (i.color) return i.color;
192
+ const n = i.resourceId ? e.get(i.resourceId) : void 0;
193
193
  return n?.eventColor ?? n?.color ?? t;
194
194
  }
195
- const z = {
195
+ const B = {
196
196
  initialView: "week",
197
197
  initialDate: /* @__PURE__ */ new Date(),
198
198
  timeZone: "local",
@@ -225,7 +225,7 @@ const z = {
225
225
  dayClickAction: "popover",
226
226
  eventEditor: !0,
227
227
  requireEventResource: !1
228
- }, I = {
228
+ }, R = {
229
229
  createEvent: !0,
230
230
  moveEvent: !0,
231
231
  resizeEvent: !0,
@@ -237,12 +237,12 @@ const z = {
237
237
  deleteResource: !1,
238
238
  createGroup: !1
239
239
  };
240
- function C(a, e) {
241
- if (e.readonly || e.permissions === !1 || !((typeof e.permissions == "object" && e.permissions !== null ? e.permissions : void 0)?.[a] ?? I[a])) return !1;
240
+ function I(i, e) {
241
+ if (e.readonly || e.permissions === !1 || !((typeof e.permissions == "object" && e.permissions !== null ? e.permissions : void 0)?.[i] ?? R[i])) return !1;
242
242
  const r = e.event;
243
243
  if (!r) return !0;
244
244
  if (r.editable === !1) return !1;
245
- switch (a) {
245
+ switch (i) {
246
246
  case "moveEvent":
247
247
  return r.draggable !== !1;
248
248
  case "resizeEvent":
@@ -251,13 +251,13 @@ function C(a, e) {
251
251
  return !0;
252
252
  }
253
253
  }
254
- function N(a, e) {
255
- return C("resizeEvent", e) ? S(e.event?.resizable, a) : !1;
254
+ function z(i, e) {
255
+ return I("resizeEvent", e) ? S(e.event?.resizable, i) : !1;
256
256
  }
257
- function S(a, e) {
258
- return a === !1 ? !1 : a && typeof a == "object" ? a[e] !== !1 : !0;
257
+ function S(i, e) {
258
+ return i === !1 ? !1 : i && typeof i == "object" ? i[e] !== !1 : !0;
259
259
  }
260
- class L {
260
+ class C {
261
261
  constructor() {
262
262
  this.weekStarts = /* @__PURE__ */ new Map(), this.timeFormatters = /* @__PURE__ */ new Map();
263
263
  }
@@ -305,12 +305,12 @@ class L {
305
305
  */
306
306
  getMonthWeeks(e, t = 1) {
307
307
  const n = this.getMonthStart(e), r = this.getMonthEnd(e), o = this.getWeekStart(n, t), s = [];
308
- let i = new Date(o);
308
+ let a = new Date(o);
309
309
  for (let u = 0; u < 6; u++) {
310
310
  const l = [];
311
- for (let d = 0; d < 7; d++)
312
- l.push(new Date(i)), i.setDate(i.getDate() + 1);
313
- if (s.push(l), i > r && s.length >= 4)
311
+ for (let c = 0; c < 7; c++)
312
+ l.push(new Date(a)), a.setDate(a.getDate() + 1);
313
+ if (s.push(l), a > r && s.length >= 4)
314
314
  break;
315
315
  }
316
316
  return s;
@@ -334,10 +334,10 @@ class L {
334
334
  * Get time slots for a day
335
335
  */
336
336
  getTimeSlots(e, t = 1800, n = "00:00:00", r = "24:00:00") {
337
- const o = [], [s, i] = n.split(":").map(Number), [u, l] = r.split(":").map(Number), d = s * 3600 + i * 60, c = u * 3600 + l * 60;
338
- for (let f = d; f < c; f += t) {
337
+ const o = [], [s, a] = n.split(":").map(Number), [u, l] = r.split(":").map(Number), c = s * 3600 + a * 60, d = u * 3600 + l * 60;
338
+ for (let g = c; g < d; g += t) {
339
339
  const h = new Date(e);
340
- h.setHours(0, 0, 0, 0), h.setSeconds(f);
340
+ h.setHours(0, 0, 0, 0), h.setSeconds(g);
341
341
  const m = new Date(h);
342
342
  m.setSeconds(h.getSeconds() + t), o.push({ start: h, end: m });
343
343
  }
@@ -347,24 +347,24 @@ class L {
347
347
  * Generate a scheduler grid for week view
348
348
  */
349
349
  getWeekGrid(e, t = 1, n = 1800, r = "00:00:00", o = "24:00:00", s = "24h") {
350
- const i = this.getWeekDays(e, t), u = [], l = [], d = this.getTimeSlots(i[0], n, r, o);
351
- for (const c of d) {
352
- const f = [];
353
- for (const h of i) {
350
+ const a = this.getWeekDays(e, t), u = [], l = [], c = this.getTimeSlots(a[0], n, r, o);
351
+ for (const d of c) {
352
+ const g = [];
353
+ for (const h of a) {
354
354
  const m = new Date(h);
355
- m.setHours(c.start.getHours(), c.start.getMinutes(), 0, 0);
356
- const T = new Date(h);
357
- T.setHours(c.end.getHours(), c.end.getMinutes(), 0, 0);
358
- const E = { start: m, end: T };
359
- f.push(E), l.push(E);
355
+ m.setHours(d.start.getHours(), d.start.getMinutes(), 0, 0);
356
+ const M = new Date(h);
357
+ M.setHours(d.end.getHours(), d.end.getMinutes(), 0, 0);
358
+ const T = { start: m, end: M };
359
+ g.push(T), l.push(T);
360
360
  }
361
361
  u.push({
362
- time: c.start,
363
- label: this.formatTime(c.start, s),
364
- slots: f
362
+ time: d.start,
363
+ label: this.formatTime(d.start, s),
364
+ slots: g
365
365
  });
366
366
  }
367
- return { columns: i, rows: u, allSlots: l };
367
+ return { columns: a, rows: u, allSlots: l };
368
368
  }
369
369
  /**
370
370
  * Round a date to the nearest slot
@@ -424,7 +424,7 @@ class L {
424
424
  if (r !== void 0) return r;
425
425
  let o = 1;
426
426
  try {
427
- const s = t || (typeof navigator < "u" ? navigator.language : void 0), i = new Intl.Locale(s ?? "en-US"), u = typeof i.getWeekInfo == "function" ? i.getWeekInfo()?.firstDay : i.weekInfo?.firstDay;
427
+ const s = t || (typeof navigator < "u" ? navigator.language : void 0), a = new Intl.Locale(s ?? "en-US"), u = typeof a.getWeekInfo == "function" ? a.getWeekInfo()?.firstDay : a.weekInfo?.firstDay;
428
428
  typeof u == "number" && (o = u % 7);
429
429
  } catch {
430
430
  }
@@ -587,8 +587,8 @@ class L {
587
587
  return Math.round((t.getTime() - e.getTime()) / 1e3);
588
588
  }
589
589
  }
590
- const R = new L();
591
- class F {
590
+ const b = new C();
591
+ class L {
592
592
  /**
593
593
  * Split an event into daily parts
594
594
  * Each part represents one day of a multi-day event
@@ -597,11 +597,11 @@ class F {
597
597
  const t = [];
598
598
  let n = new Date(e.start), r = 0;
599
599
  const o = this.getTotalDays(e.start, e.end);
600
- if (R.isSameDay(e.start, e.end)) {
601
- const s = "id" in e;
600
+ if (b.isSameDay(e.start, e.end)) {
601
+ const a = "id" in e;
602
602
  return t.push({
603
- id: s ? `${e.id}-0` : "preview-0",
604
- event: s ? e : null,
603
+ id: a ? `${e.id}-0` : "preview-0",
604
+ event: a ? e : null,
605
605
  start: e.start,
606
606
  end: e.end,
607
607
  isStart: !0,
@@ -609,30 +609,32 @@ class F {
609
609
  dayIndex: 0,
610
610
  totalDays: 1
611
611
  }), {
612
- event: s ? e : null,
612
+ event: a ? e : null,
613
613
  parts: t
614
614
  };
615
615
  }
616
- for (; !R.isSameDay(n, e.end); ) {
617
- const s = new Date(n);
618
- s.setDate(s.getDate() + 1), s.setHours(0, 0, 0, 0);
619
- const i = "id" in e;
616
+ for (; !b.isSameDay(n, e.end); ) {
617
+ const a = new Date(n);
618
+ a.setDate(a.getDate() + 1), a.setHours(0, 0, 0, 0);
619
+ const u = "id" in e;
620
620
  t.push({
621
- id: i ? `${e.id}-${r}` : `preview-${r}`,
622
- event: i ? e : null,
621
+ id: u ? `${e.id}-${r}` : `preview-${r}`,
622
+ event: u ? e : null,
623
623
  start: new Date(n),
624
- end: s,
624
+ end: a,
625
625
  isStart: r === 0,
626
626
  isEnd: !1,
627
627
  dayIndex: r,
628
628
  totalDays: o
629
- }), n = s, r++;
629
+ }), n = a, r++;
630
630
  }
631
- if (e.end.getHours() !== 0 || e.end.getMinutes() !== 0 || e.end.getSeconds() !== 0) {
632
- const s = "id" in e;
631
+ if (e.end.getHours() === 0 && e.end.getMinutes() === 0 && e.end.getSeconds() === 0)
632
+ t[t.length - 1] = { ...t[t.length - 1], isEnd: !0 };
633
+ else {
634
+ const a = "id" in e;
633
635
  t.push({
634
- id: s ? `${e.id}-${r}` : `preview-${r}`,
635
- event: s ? e : null,
636
+ id: a ? `${e.id}-${r}` : `preview-${r}`,
637
+ event: a ? e : null,
636
638
  start: new Date(n),
637
639
  end: e.end,
638
640
  isStart: !1,
@@ -668,8 +670,8 @@ class F {
668
670
  for (const r of t) {
669
671
  const o = e.filter((s) => s.start.getTime() === r.getTime());
670
672
  for (const s of o) {
671
- const i = n.find((u) => this.isTrackFreeForEvent(u, s));
672
- i ? i.events.push(s) : n.push({
673
+ const a = n.find((u) => this.isTrackFreeForEvent(u, s));
674
+ a ? a.events.push(s) : n.push({
673
675
  index: n.length,
674
676
  events: [s]
675
677
  });
@@ -721,9 +723,9 @@ class F {
721
723
  const n = this.buildOverlapGroups(e);
722
724
  for (const r of n) {
723
725
  const { assignments: o, columnCount: s } = this.assignColumns(r);
724
- for (const i of r) {
725
- const u = o.get(i.id) ?? 0, l = this.computeColspan(i, u, r, o, s);
726
- t.set(i.id, {
726
+ for (const a of r) {
727
+ const u = o.get(a.id) ?? 0, l = this.computeColspan(a, u, r, o, s);
728
+ t.set(a.id, {
727
729
  col: u,
728
730
  colspan: l,
729
731
  columnCount: s
@@ -744,17 +746,17 @@ class F {
744
746
  const t = [], n = /* @__PURE__ */ new Set(), r = [...e].sort((o, s) => o.start.getTime() - s.start.getTime());
745
747
  for (const o of r) {
746
748
  if (n.has(o.id)) continue;
747
- const s = [], i = [o];
749
+ const s = [], a = [o];
748
750
  let u = 0;
749
- for (; u < i.length; ) {
750
- const l = i[u++];
751
+ for (; u < a.length; ) {
752
+ const l = a[u++];
751
753
  if (n.has(l.id)) continue;
752
754
  n.add(l.id), s.push(l);
753
- const d = l.end.getTime();
754
- for (const c of r)
755
- if (!n.has(c.id)) {
756
- if (c.start.getTime() >= d) break;
757
- this.eventsOverlap(l, c) && i.push(c);
755
+ const c = l.end.getTime();
756
+ for (const d of r)
757
+ if (!n.has(d.id)) {
758
+ if (d.start.getTime() >= c) break;
759
+ this.eventsOverlap(l, d) && a.push(d);
758
760
  }
759
761
  }
760
762
  t.push(s);
@@ -772,9 +774,9 @@ class F {
772
774
  ), r = [];
773
775
  for (const o of n) {
774
776
  let s = -1;
775
- for (let i = 0; i < r.length; i++)
776
- if (r[i] <= o.start.getTime()) {
777
- s = i;
777
+ for (let a = 0; a < r.length; a++)
778
+ if (r[a] <= o.start.getTime()) {
779
+ s = a;
778
780
  break;
779
781
  }
780
782
  s === -1 ? (s = r.length, r.push(o.end.getTime())) : r[s] = o.end.getTime(), t.set(o.id, s);
@@ -787,9 +789,9 @@ class F {
787
789
  */
788
790
  computeColspan(e, t, n, r, o) {
789
791
  let s = 1 / 0;
790
- for (const i of n) {
791
- if (i.id === e.id || !this.eventsOverlap(e, i)) continue;
792
- const u = r.get(i.id) ?? 0;
792
+ for (const a of n) {
793
+ if (a.id === e.id || !this.eventsOverlap(e, a)) continue;
794
+ const u = r.get(a.id) ?? 0;
793
795
  u > t && (s = Math.min(s, u));
794
796
  }
795
797
  return s !== 1 / 0 ? s - t : o - t;
@@ -800,23 +802,6 @@ class F {
800
802
  eventsOverlap(e, t) {
801
803
  return e.start < t.end && t.start < e.end;
802
804
  }
803
- /**
804
- * Calculate the relative track position for an event part (legacy method)
805
- * @deprecated Use getColspanLayout instead for better layout
806
- */
807
- getRelativeTrackPosition(e, t, n) {
808
- const r = [];
809
- for (const s of e)
810
- s.events.some(
811
- (u) => u.start < t.end && u.end > t.start
812
- ) && r.push(s.index);
813
- r.sort((s, i) => s - i);
814
- const o = r.indexOf(n);
815
- return {
816
- relativeIndex: o >= 0 ? o : 0,
817
- overlappingCount: Math.max(1, r.length)
818
- };
819
- }
820
805
  /**
821
806
  * Filter events that fall within a date range
822
807
  */
@@ -853,34 +838,25 @@ class F {
853
838
  const r = new Date(t);
854
839
  return r.setHours(23, 59, 59, 999), this.filterByRange(e, n, r);
855
840
  }
856
- /**
857
- * Get event parts for a specific day
858
- */
859
- getPartsForDay(e, t) {
860
- const n = new Date(t);
861
- n.setHours(0, 0, 0, 0);
862
- const r = new Date(t);
863
- return r.setHours(23, 59, 59, 999), this.filterPartsByRange(e, n, r);
864
- }
865
841
  }
866
- const j = new F();
867
- class x {
842
+ const N = new L();
843
+ class F {
868
844
  /**
869
845
  * Flatten a hierarchical resource structure for rendering
870
846
  */
871
847
  flatten(e, t = /* @__PURE__ */ new Set(), n = 0, r, o = !1) {
872
848
  const s = [];
873
- for (const i of e) {
849
+ for (const a of e) {
874
850
  const u = !o;
875
- if (s.push({ item: i, depth: n, visible: u, parentId: r }), g(i)) {
876
- const l = t.has(i.id), d = this.flatten(
877
- i.children,
851
+ if (s.push({ item: a, depth: n, visible: u, parentId: r }), f(a)) {
852
+ const l = t.has(a.id), c = this.flatten(
853
+ a.children,
878
854
  t,
879
855
  n + 1,
880
- i.id,
856
+ a.id,
881
857
  o || l
882
858
  );
883
- s.push(...d);
859
+ s.push(...c);
884
860
  }
885
861
  }
886
862
  return s;
@@ -891,7 +867,7 @@ class x {
891
867
  getAllResources(e) {
892
868
  const t = [];
893
869
  for (const n of e)
894
- p(n) ? t.push(n) : g(n) && t.push(...this.getAllResources(n.children));
870
+ p(n) ? t.push(n) : f(n) && t.push(...this.getAllResources(n.children));
895
871
  return t;
896
872
  }
897
873
  /**
@@ -908,7 +884,7 @@ class x {
908
884
  for (const n of e) {
909
885
  if (p(n) && n.id === t)
910
886
  return n;
911
- if (g(n)) {
887
+ if (f(n)) {
912
888
  const r = this.findResourceById(n.children, t);
913
889
  if (r) return r;
914
890
  }
@@ -919,7 +895,7 @@ class x {
919
895
  */
920
896
  findGroupById(e, t) {
921
897
  for (const n of e)
922
- if (g(n)) {
898
+ if (f(n)) {
923
899
  if (n.id === t) return n;
924
900
  const r = this.findGroupById(n.children, t);
925
901
  if (r) return r;
@@ -971,33 +947,12 @@ class x {
971
947
  setGroupCollapse(e, t, n) {
972
948
  return this.mapGroups(e, (r) => r.id === t ? { ...r, collapsed: n } : r);
973
949
  }
974
- /**
975
- * Collapse all groups
976
- */
977
- collapseAll(e) {
978
- return this.mapGroups(e, (t) => ({ ...t, collapsed: !0 }));
979
- }
980
- /**
981
- * Expand all groups
982
- */
983
- expandAll(e) {
984
- return this.mapGroups(e, (t) => ({ ...t, collapsed: !1 }));
985
- }
986
- /**
987
- * Map over all resources in the hierarchy
988
- */
989
- mapResources(e, t) {
990
- return e.map((n) => p(n) ? t(n) : {
991
- ...n,
992
- children: this.mapResources(n.children, t)
993
- });
994
- }
995
950
  /**
996
951
  * Map over all groups in the hierarchy
997
952
  */
998
953
  mapGroups(e, t) {
999
954
  return e.map((n) => {
1000
- if (g(n)) {
955
+ if (f(n)) {
1001
956
  const r = t(n);
1002
957
  return {
1003
958
  ...r,
@@ -1017,54 +972,37 @@ class x {
1017
972
  * Sort resources by order property
1018
973
  */
1019
974
  sortByOrder(e) {
1020
- return [...e].sort((n, r) => (n.order ?? 0) - (r.order ?? 0)).map((n) => g(n) ? {
975
+ return [...e].sort((n, r) => (n.order ?? 0) - (r.order ?? 0)).map((n) => f(n) ? {
1021
976
  ...n,
1022
977
  children: this.sortByOrder(n.children)
1023
978
  } : n);
1024
979
  }
1025
980
  }
1026
- const q = new x();
1027
- function M(a = "evt") {
1028
- const e = Date.now().toString(36), t = Math.random().toString(36).substring(2, 9);
1029
- return `${a}-${e}-${t}`;
1030
- }
1031
- function V() {
1032
- return M("evt");
1033
- }
1034
- function _() {
1035
- return M("res");
1036
- }
1037
- function J() {
1038
- return M("grp");
1039
- }
981
+ const j = new F();
1040
982
  export {
1041
- z as D,
1042
- x as R,
1043
- F as T,
1044
- b as a,
983
+ B as D,
984
+ F as R,
985
+ L as T,
986
+ E as a,
1045
987
  k as b,
1046
988
  w as c,
1047
- R as d,
1048
- I as e,
1049
- L as f,
1050
- U as g,
1051
- O as h,
989
+ b as d,
990
+ R as e,
991
+ C as f,
992
+ O as g,
993
+ W as h,
1052
994
  Y as i,
1053
- G as j,
1054
- V as k,
1055
- J as l,
1056
- M as m,
1057
- _ as n,
1058
- A as o,
1059
- H as p,
1060
- $ as q,
1061
- p as r,
1062
- g as s,
1063
- W as t,
1064
- C as u,
1065
- B as v,
1066
- P as w,
1067
- N as x,
1068
- q as y,
1069
- j as z
995
+ A as j,
996
+ P as k,
997
+ x as l,
998
+ H as m,
999
+ p as n,
1000
+ f as o,
1001
+ $ as p,
1002
+ U as q,
1003
+ I as r,
1004
+ G as s,
1005
+ z as t,
1006
+ j as u,
1007
+ N as v
1070
1008
  };