@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.
- 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-CEpSxlkd.mjs} +660 -357
- 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 +66193 -0
- package/datatable/index.mjs +1 -1
- package/datatable/src/components/column-resize.d.ts +11 -0
- package/datatable/src/components/index.d.ts +1 -1
- package/datatable/src/components/mp-datatable.d.ts +264 -20
- package/datatable/src/index.d.ts +1 -1
- package/datatable/src/types/labels.d.ts +11 -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,8 +1,8 @@
|
|
|
1
|
-
function p(
|
|
2
|
-
return !("children" in
|
|
1
|
+
function p(i) {
|
|
2
|
+
return !("children" in i);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return "children" in
|
|
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
|
|
103
|
-
return e ?
|
|
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
|
-
) :
|
|
106
|
+
) : i;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
return
|
|
108
|
+
function G(i) {
|
|
109
|
+
return i ? { ...w, ...i } : w;
|
|
110
110
|
}
|
|
111
|
-
const
|
|
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
|
|
134
|
-
return
|
|
133
|
+
function P(i) {
|
|
134
|
+
return E[i % E.length];
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
let e =
|
|
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(
|
|
143
|
-
const 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:
|
|
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(
|
|
155
|
+
return 0.2126 * n(i) + 0.7152 * n(e) + 0.0722 * n(t);
|
|
156
156
|
}
|
|
157
|
-
function D(
|
|
158
|
-
const [t, n] =
|
|
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
|
|
162
|
-
const e = v(
|
|
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
|
|
168
|
-
const t = v(
|
|
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
|
|
172
|
-
let t =
|
|
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))),
|
|
175
|
-
return `#${s.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(
|
|
178
|
-
let t =
|
|
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))),
|
|
181
|
-
return `#${s.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
|
|
184
|
-
let t =
|
|
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
|
|
191
|
-
if (
|
|
192
|
-
const n =
|
|
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
|
|
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
|
-
},
|
|
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
|
|
241
|
-
if (e.readonly || e.permissions === !1 || !((typeof e.permissions == "object" && e.permissions !== null ? e.permissions : void 0)?.[
|
|
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 (
|
|
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
|
|
255
|
-
return
|
|
254
|
+
function z(i, e) {
|
|
255
|
+
return I("resizeEvent", e) ? S(e.event?.resizable, i) : !1;
|
|
256
256
|
}
|
|
257
|
-
function S(
|
|
258
|
-
return
|
|
257
|
+
function S(i, e) {
|
|
258
|
+
return i === !1 ? !1 : i && typeof i == "object" ? i[e] !== !1 : !0;
|
|
259
259
|
}
|
|
260
|
-
class
|
|
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
|
|
308
|
+
let a = new Date(o);
|
|
309
309
|
for (let u = 0; u < 6; u++) {
|
|
310
310
|
const l = [];
|
|
311
|
-
for (let
|
|
312
|
-
l.push(new Date(
|
|
313
|
-
if (s.push(l),
|
|
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,
|
|
338
|
-
for (let
|
|
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(
|
|
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
|
|
351
|
-
for (const
|
|
352
|
-
const
|
|
353
|
-
for (const h of
|
|
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(
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
const
|
|
359
|
-
|
|
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:
|
|
363
|
-
label: this.formatTime(
|
|
364
|
-
slots:
|
|
362
|
+
time: d.start,
|
|
363
|
+
label: this.formatTime(d.start, s),
|
|
364
|
+
slots: g
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
|
-
return { columns:
|
|
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),
|
|
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
|
|
591
|
-
class
|
|
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 (
|
|
601
|
-
const
|
|
600
|
+
if (b.isSameDay(e.start, e.end)) {
|
|
601
|
+
const a = "id" in e;
|
|
602
602
|
return t.push({
|
|
603
|
-
id:
|
|
604
|
-
event:
|
|
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:
|
|
612
|
+
event: a ? e : null,
|
|
613
613
|
parts: t
|
|
614
614
|
};
|
|
615
615
|
}
|
|
616
|
-
for (; !
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
const
|
|
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:
|
|
622
|
-
event:
|
|
621
|
+
id: u ? `${e.id}-${r}` : `preview-${r}`,
|
|
622
|
+
event: u ? e : null,
|
|
623
623
|
start: new Date(n),
|
|
624
|
-
end:
|
|
624
|
+
end: a,
|
|
625
625
|
isStart: r === 0,
|
|
626
626
|
isEnd: !1,
|
|
627
627
|
dayIndex: r,
|
|
628
628
|
totalDays: o
|
|
629
|
-
}), n =
|
|
629
|
+
}), n = a, r++;
|
|
630
630
|
}
|
|
631
|
-
if (e.end.getHours()
|
|
632
|
-
|
|
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:
|
|
635
|
-
event:
|
|
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
|
|
672
|
-
|
|
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
|
|
725
|
-
const u = o.get(
|
|
726
|
-
t.set(
|
|
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 = [],
|
|
749
|
+
const s = [], a = [o];
|
|
748
750
|
let u = 0;
|
|
749
|
-
for (; u <
|
|
750
|
-
const l =
|
|
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
|
|
754
|
-
for (const
|
|
755
|
-
if (!n.has(
|
|
756
|
-
if (
|
|
757
|
-
this.eventsOverlap(l,
|
|
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
|
|
776
|
-
if (r[
|
|
777
|
-
s =
|
|
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
|
|
791
|
-
if (
|
|
792
|
-
const u = r.get(
|
|
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
|
|
867
|
-
class
|
|
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
|
|
849
|
+
for (const a of e) {
|
|
874
850
|
const u = !o;
|
|
875
|
-
if (s.push({ item:
|
|
876
|
-
const l = t.has(
|
|
877
|
-
|
|
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
|
-
|
|
856
|
+
a.id,
|
|
881
857
|
o || l
|
|
882
858
|
);
|
|
883
|
-
s.push(...
|
|
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) :
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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) =>
|
|
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
|
|
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
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
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
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
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
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
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
|
};
|