@mintplayer/web-components 1.0.0 → 1.1.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/a11y/index.mjs +2 -56
- package/calendar/index.mjs +2 -363
- package/checkbox/index.mjs +4 -0
- package/checkbox/src/components/index.d.ts +2 -0
- package/checkbox/src/components/mp-checkbox.d.ts +69 -0
- package/checkbox/src/index.d.ts +2 -0
- package/chunks/color-C4VT0EL7.mjs +847 -0
- package/chunks/form-check.styles-jBlHetYX.mjs +151 -0
- package/chunks/live-announcer-CZDTKulf.mjs +58 -0
- package/chunks/mp-calendar.element-UC68iDbi.mjs +365 -0
- package/chunks/mp-checkbox-BokLL7BS.mjs +211 -0
- package/chunks/mp-datatable-CpAu8JJD.mjs +750 -0
- package/chunks/mp-pagination-BGxsawFL.mjs +326 -0
- package/chunks/mp-select-BDS1-YGn.mjs +254 -0
- package/chunks/mp-splitter-C8cGCmac.mjs +633 -0
- package/chunks/mp-tab-page-D1b4x-y2.mjs +414 -0
- package/chunks/mp-timepicker.element-BwEiwX92.mjs +428 -0
- package/chunks/mp-toggle-button-dLZNDUVz.mjs +534 -0
- package/chunks/mp-treeview-Bfq4_IVW.mjs +474 -0
- package/code-snippet/index.mjs +16 -13
- package/datatable/index.mjs +7 -0
- package/datatable/src/components/index.d.ts +2 -0
- package/datatable/src/components/mp-datatable.d.ts +156 -0
- package/datatable/src/index.d.ts +6 -0
- package/datatable/src/sort/compute-next-sort.d.ts +18 -0
- package/datatable/src/sort/index.d.ts +3 -0
- package/datatable/src/sort/sort-rows.d.ts +6 -0
- package/datatable/src/styles/datatable.styles.d.ts +2 -0
- package/datatable/src/styles/index.d.ts +1 -0
- package/datatable/src/types/column-def.d.ts +30 -0
- package/datatable/src/types/index.d.ts +1 -0
- package/datepicker/index.mjs +240 -0
- package/datepicker/src/index.d.ts +1 -0
- package/datepicker/src/mp-datepicker.element.d.ts +94 -0
- package/datepicker/src/mp-datepicker.element.template.d.ts +2 -0
- package/datetime-picker/index.mjs +427 -0
- package/datetime-picker/src/index.d.ts +1 -0
- package/datetime-picker/src/mp-datetime-picker.element.d.ts +174 -0
- package/datetime-picker/src/mp-datetime-picker.element.template.d.ts +2 -0
- package/dock/index.mjs +2402 -0
- package/dock/src/components/index.d.ts +1 -0
- package/dock/src/components/mint-dock-manager.element.d.ts +313 -0
- package/dock/src/components/mint-dock-manager.element.template.d.ts +2 -0
- package/dock/src/index.d.ts +2 -0
- package/dock/src/types/dock-layout.d.ts +65 -0
- package/dock/src/types/index.d.ts +1 -0
- package/file-manager/index.mjs +1263 -0
- package/file-manager/src/components/index.d.ts +2 -0
- package/file-manager/src/components/mp-file-manager.d.ts +320 -0
- package/file-manager/src/index.d.ts +5 -0
- package/file-manager/src/styles/file-manager.styles.d.ts +2 -0
- package/file-manager/src/styles/index.d.ts +1 -0
- package/file-manager/src/types/file-system-node.d.ts +24 -0
- package/file-manager/src/types/index.d.ts +3 -0
- package/file-manager/src/types/messages.d.ts +43 -0
- package/multi-range/index.mjs +407 -0
- package/multi-range/src/index.d.ts +2 -0
- package/multi-range/src/mint-multi-range.element.d.ts +124 -0
- package/multi-range/src/mint-multi-range.element.template.d.ts +2 -0
- package/multi-range/src/types/multi-range-orientation.d.ts +1 -0
- package/otp-input/index.mjs +362 -0
- package/otp-input/src/index.d.ts +4 -0
- package/otp-input/src/mint-otp-input.element.d.ts +134 -0
- package/otp-input/src/mint-otp-input.element.template.d.ts +2 -0
- package/otp-input/src/types/otp-input-case.d.ts +1 -0
- package/otp-input/src/types/otp-input-size.d.ts +1 -0
- package/otp-input/src/types/otp-input-type.d.ts +1 -0
- package/overlay/index.mjs +260 -0
- package/overlay/src/index.d.ts +2 -0
- package/overlay/src/overlay-controller.d.ts +205 -0
- package/package.json +1 -1
- package/pagination/index.mjs +5 -0
- package/pagination/src/components/index.d.ts +2 -0
- package/pagination/src/components/mp-pagination.d.ts +95 -0
- package/pagination/src/index.d.ts +2 -0
- package/pagination/src/styles/index.d.ts +1 -0
- package/pagination/src/styles/pagination.styles.d.ts +2 -0
- package/query-builder/index.mjs +3720 -0
- package/query-builder/src/context.d.ts +14 -0
- package/query-builder/src/dnd/drag-controller.d.ts +69 -0
- package/query-builder/src/index.d.ts +23 -0
- package/query-builder/src/model/default-tree.d.ts +7 -0
- package/query-builder/src/model/editor.d.ts +15 -0
- package/query-builder/src/model/errors.d.ts +6 -0
- package/query-builder/src/model/expression.d.ts +22 -0
- package/query-builder/src/model/field-def.d.ts +17 -0
- package/query-builder/src/model/messages.d.ts +17 -0
- package/query-builder/src/model/operator-overrides.d.ts +21 -0
- package/query-builder/src/model/operators.d.ts +8 -0
- package/query-builder/src/model/saved-query.d.ts +6 -0
- package/query-builder/src/model/sort.d.ts +9 -0
- package/query-builder/src/model/tree-ops.d.ts +56 -0
- package/query-builder/src/mp-query-builder.element.d.ts +158 -0
- package/query-builder/src/mp-query-builder.element.template.d.ts +2 -0
- package/query-builder/src/mp-query-condition.element.d.ts +44 -0
- package/query-builder/src/mp-query-condition.element.template.d.ts +2 -0
- package/query-builder/src/mp-query-group.element.d.ts +52 -0
- package/query-builder/src/mp-query-group.element.template.d.ts +2 -0
- package/query-builder/src/mp-query-subquery.element.d.ts +37 -0
- package/query-builder/src/mp-query-subquery.element.template.d.ts +2 -0
- package/query-builder/src/preview/render-expression.d.ts +23 -0
- package/query-builder/src/value-editors/builtin-editors.d.ts +6 -0
- package/query-builder/src/visitor/visit-tree.d.ts +29 -0
- package/query-builder/src/visitor/visitor-types.d.ts +15 -0
- package/radio/index.mjs +162 -0
- package/radio/src/components/index.d.ts +2 -0
- package/radio/src/components/mp-radio.d.ts +63 -0
- package/radio/src/index.d.ts +2 -0
- package/ribbon/index.mjs +3151 -0
- package/ribbon/src/index.d.ts +10 -0
- package/ribbon/src/items/index.d.ts +15 -0
- package/ribbon/src/items/mp-ribbon-button.element.d.ts +10 -0
- package/ribbon/src/items/mp-ribbon-checkbox.element.d.ts +11 -0
- package/ribbon/src/items/mp-ribbon-color-picker.element.d.ts +12 -0
- package/ribbon/src/items/mp-ribbon-combobox.element.d.ts +19 -0
- package/ribbon/src/items/mp-ribbon-dropdown-button.element.d.ts +16 -0
- package/ribbon/src/items/mp-ribbon-gallery-item.element.d.ts +15 -0
- package/ribbon/src/items/mp-ribbon-gallery.element.d.ts +11 -0
- package/ribbon/src/items/mp-ribbon-group-button.element.d.ts +18 -0
- package/ribbon/src/items/mp-ribbon-item-base.d.ts +68 -0
- package/ribbon/src/items/mp-ribbon-menu-item.element.d.ts +13 -0
- package/ribbon/src/items/mp-ribbon-menu-separator.element.d.ts +6 -0
- package/ribbon/src/items/mp-ribbon-split-button.element.d.ts +23 -0
- package/ribbon/src/items/mp-ribbon-template-item.element.d.ts +12 -0
- package/ribbon/src/items/mp-ribbon-toggle-button.element.d.ts +12 -0
- package/ribbon/src/mp-quick-access-toolbar.element.d.ts +35 -0
- package/ribbon/src/mp-ribbon-contextual-tab-set.element.d.ts +18 -0
- package/ribbon/src/mp-ribbon-group.element.d.ts +59 -0
- package/ribbon/src/mp-ribbon-tab.element.d.ts +72 -0
- package/ribbon/src/mp-ribbon.element.d.ts +211 -0
- package/ribbon/src/types/ribbon.types.d.ts +4 -0
- package/scheduler/index.mjs +3567 -0
- package/scheduler/src/components/mp-scheduler.d.ts +238 -0
- package/scheduler/src/drag/drag-manager.d.ts +90 -0
- package/scheduler/src/drag/drag-preview.d.ts +42 -0
- package/scheduler/src/drag/drag-state-machine.d.ts +102 -0
- package/scheduler/src/drag/drag-types.d.ts +104 -0
- package/scheduler/src/drag/index.d.ts +4 -0
- package/scheduler/src/events/event-types.d.ts +58 -0
- package/scheduler/src/events/index.d.ts +2 -0
- package/scheduler/src/events/scheduler-event-emitter.d.ts +52 -0
- package/scheduler/src/index.d.ts +6 -0
- package/scheduler/src/input/index.d.ts +2 -0
- package/scheduler/src/input/input-handler.d.ts +105 -0
- package/scheduler/src/input/pointer-event.d.ts +39 -0
- package/scheduler/src/state/scheduler-state.d.ts +189 -0
- package/scheduler/src/styles/scheduler.styles.d.ts +2 -0
- package/scheduler/src/views/base-view.d.ts +87 -0
- package/scheduler/src/views/day-view.d.ts +25 -0
- package/scheduler/src/views/index.d.ts +6 -0
- package/scheduler/src/views/month-view.d.ts +27 -0
- package/scheduler/src/views/timeline-view.d.ts +23 -0
- package/scheduler/src/views/week-view.d.ts +28 -0
- package/scheduler/src/views/year-view.d.ts +25 -0
- package/scheduler-core/index.mjs +174 -0
- package/scheduler-core/src/index.d.ts +3 -0
- package/scheduler-core/src/models/drag-state.d.ts +43 -0
- package/scheduler-core/src/models/event.d.ts +111 -0
- package/scheduler-core/src/models/events.d.ts +108 -0
- package/scheduler-core/src/models/index.d.ts +7 -0
- package/scheduler-core/src/models/options.d.ts +88 -0
- package/scheduler-core/src/models/resource.d.ts +58 -0
- package/scheduler-core/src/models/time-slot.d.ts +31 -0
- package/scheduler-core/src/models/types.d.ts +20 -0
- package/scheduler-core/src/services/date.service.d.ts +140 -0
- package/scheduler-core/src/services/index.d.ts +4 -0
- package/scheduler-core/src/services/position.service.d.ts +35 -0
- package/scheduler-core/src/services/resource.service.d.ts +83 -0
- package/scheduler-core/src/services/timeline.service.d.ts +103 -0
- package/scheduler-core/src/utils/color.d.ts +24 -0
- package/scheduler-core/src/utils/dom.d.ts +54 -0
- package/scheduler-core/src/utils/id.d.ts +16 -0
- package/scheduler-core/src/utils/index.d.ts +3 -0
- package/select/index.mjs +4 -0
- package/select/src/components/index.d.ts +2 -0
- package/select/src/components/mp-select.d.ts +82 -0
- package/select/src/index.d.ts +2 -0
- package/splitter/index.mjs +10 -0
- package/splitter/src/components/index.d.ts +2 -0
- package/splitter/src/components/mp-splitter.d.ts +109 -0
- package/splitter/src/index.d.ts +11 -0
- package/splitter/src/input/index.d.ts +4 -0
- package/splitter/src/input/input-handler.d.ts +36 -0
- package/splitter/src/input/pointer-event.d.ts +9 -0
- package/splitter/src/managers/index.d.ts +2 -0
- package/splitter/src/managers/resize-manager.d.ts +13 -0
- package/splitter/src/state/index.d.ts +2 -0
- package/splitter/src/state/splitter-state.d.ts +24 -0
- package/splitter/src/styles/index.d.ts +1 -0
- package/splitter/src/styles/splitter.styles.d.ts +2 -0
- package/splitter/src/types/direction.d.ts +1 -0
- package/splitter/src/types/index.d.ts +5 -0
- package/splitter/src/types/panel-info.d.ts +6 -0
- package/splitter/src/types/point.d.ts +4 -0
- package/splitter/src/types/resize-operation.d.ts +13 -0
- package/tab-control/index.mjs +6 -0
- package/tab-control/src/components/index.d.ts +3 -0
- package/tab-control/src/components/mp-tab-control.d.ts +50 -0
- package/tab-control/src/components/mp-tab-page.d.ts +35 -0
- package/tab-control/src/index.d.ts +4 -0
- package/tab-control/src/styles/index.d.ts +1 -0
- package/tab-control/src/styles/tab-control.styles.d.ts +2 -0
- package/tab-control/src/types/index.d.ts +1 -0
- package/tab-control/src/types/tabs-position.d.ts +1 -0
- package/tile-manager/index.mjs +867 -0
- package/tile-manager/src/components/index.d.ts +2 -0
- package/tile-manager/src/components/mint-tile-manager.element.d.ts +204 -0
- package/tile-manager/src/components/mint-tile-manager.element.template.d.ts +2 -0
- package/tile-manager/src/index.d.ts +4 -0
- package/tile-manager/src/types/grid-rect.d.ts +12 -0
- package/tile-manager/src/types/index.d.ts +3 -0
- package/tile-manager/src/types/tile-layout-snapshot.d.ts +15 -0
- package/tile-manager/src/types/tile-position.d.ts +10 -0
- package/tile-manager/src/utils/index.d.ts +1 -0
- package/tile-manager/src/utils/pack.d.ts +24 -0
- package/timepicker/index.mjs +5 -0
- package/timepicker/src/index.d.ts +2 -0
- package/timepicker/src/mp-time-list.element.d.ts +76 -0
- package/timepicker/src/mp-time-list.element.template.d.ts +2 -0
- package/timepicker/src/mp-timepicker.element.d.ts +87 -0
- package/timepicker/src/mp-timepicker.element.template.d.ts +2 -0
- package/toggle-button/index.mjs +5 -0
- package/toggle-button/src/components/index.d.ts +2 -0
- package/toggle-button/src/components/mp-toggle-button.d.ts +50 -0
- package/toggle-button/src/index.d.ts +3 -0
- package/toggle-button/src/styles/index.d.ts +1 -0
- package/toggle-button/src/styles/toggle-button.styles.d.ts +2 -0
- package/treeview/index.mjs +5 -0
- package/treeview/src/components/index.d.ts +2 -0
- package/treeview/src/components/mp-treeview.d.ts +113 -0
- package/treeview/src/index.d.ts +4 -0
- package/treeview/src/styles/index.d.ts +1 -0
- package/treeview/src/styles/treeview.styles.d.ts +2 -0
- package/treeview/src/types/index.d.ts +1 -0
- package/treeview/src/types/tree-node.d.ts +14 -0
- package/custom-elements.json +0 -1774
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { a as T, e as C } from "../chunks/color-C4VT0EL7.mjs";
|
|
2
|
+
import { D as N, b as X, R as Y, T as G, c as U, d as _, g as q, f as J, h as K, i as Q, j as Z, k as tt, l as et, m as ot, n as nt, r as st, t as ct } from "../chunks/color-C4VT0EL7.mjs";
|
|
3
|
+
class x {
|
|
4
|
+
/**
|
|
5
|
+
* Calculate position for an event part in week/day view
|
|
6
|
+
*/
|
|
7
|
+
calculateWeekPosition(t, e, n, s, c, l = {}) {
|
|
8
|
+
const i = { ...T, ...l };
|
|
9
|
+
new Date(t.start).setHours(0, 0, 0, 0);
|
|
10
|
+
const a = C.getSecondsFromMidnight(t.start), u = C.getSecondsFromMidnight(t.end) - a, [d] = i.slotMinTime.split(":").map(Number), [f] = i.slotMaxTime.split(":").map(Number), g = (f - d) * 3600, m = (a - d * 3600) / g * 100, R = u / g * 100, S = 10, p = (100 - S) / c, $ = p / n, w = S + s * p + e * $;
|
|
11
|
+
return {
|
|
12
|
+
top: m,
|
|
13
|
+
left: w,
|
|
14
|
+
width: $,
|
|
15
|
+
height: R,
|
|
16
|
+
zIndex: e + 1
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Calculate position for an event in timeline view
|
|
21
|
+
*/
|
|
22
|
+
calculateTimelinePosition(t, e, n, s, c, l = {}) {
|
|
23
|
+
({ ...T, ...l });
|
|
24
|
+
const i = c.getTime() - s.getTime(), r = Math.max(t.start.getTime(), s.getTime()), a = Math.min(t.end.getTime(), c.getTime()), h = r - s.getTime(), u = a - r, d = h / i * 100, f = u / i * 100, g = 100 / n;
|
|
25
|
+
return {
|
|
26
|
+
top: e * g,
|
|
27
|
+
left: d,
|
|
28
|
+
width: f,
|
|
29
|
+
height: g,
|
|
30
|
+
zIndex: 1
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Calculate position for an all-day event in month view
|
|
35
|
+
*/
|
|
36
|
+
calculateMonthEventPosition(t, e, n, s, c, l = 7) {
|
|
37
|
+
const i = 100 / l, r = 100 / n, a = s * i, h = (c - s + 1) * i;
|
|
38
|
+
return {
|
|
39
|
+
top: e * r,
|
|
40
|
+
left: a,
|
|
41
|
+
width: h,
|
|
42
|
+
height: r,
|
|
43
|
+
zIndex: e + 1
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Convert percentage-based position to pixel-based
|
|
48
|
+
*/
|
|
49
|
+
toPixelPosition(t, e, n) {
|
|
50
|
+
return {
|
|
51
|
+
top: t.top / 100 * n,
|
|
52
|
+
left: t.left / 100 * e,
|
|
53
|
+
width: t.width / 100 * e,
|
|
54
|
+
height: t.height / 100 * n,
|
|
55
|
+
zIndex: t.zIndex
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Generate CSS styles from position
|
|
60
|
+
*/
|
|
61
|
+
toStyleString(t, e = "%") {
|
|
62
|
+
return `
|
|
63
|
+
position: absolute;
|
|
64
|
+
top: ${t.top}${e};
|
|
65
|
+
left: ${t.left}${e};
|
|
66
|
+
width: ${t.width}${e};
|
|
67
|
+
height: ${t.height}${e};
|
|
68
|
+
z-index: ${t.zIndex};
|
|
69
|
+
`.trim().replace(/\s+/g, " ");
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Generate CSS object from position
|
|
73
|
+
*/
|
|
74
|
+
toStyleObject(t, e = "%") {
|
|
75
|
+
return {
|
|
76
|
+
position: "absolute",
|
|
77
|
+
top: `${t.top}${e}`,
|
|
78
|
+
left: `${t.left}${e}`,
|
|
79
|
+
width: `${t.width}${e}`,
|
|
80
|
+
height: `${t.height}${e}`,
|
|
81
|
+
zIndex: String(t.zIndex)
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const P = new x();
|
|
86
|
+
function z(o, t) {
|
|
87
|
+
const e = Object.entries(t).map(([n, s]) => `[data-${n}="${s}"]`).join("");
|
|
88
|
+
return o.querySelector(e);
|
|
89
|
+
}
|
|
90
|
+
function B(o) {
|
|
91
|
+
const t = o.dataset, e = {};
|
|
92
|
+
for (const n in t) {
|
|
93
|
+
const s = t[n];
|
|
94
|
+
s !== void 0 && (e[n] = s);
|
|
95
|
+
}
|
|
96
|
+
return e;
|
|
97
|
+
}
|
|
98
|
+
function D(o, t) {
|
|
99
|
+
return o.closest(`[data-${t}]`);
|
|
100
|
+
}
|
|
101
|
+
function W(o) {
|
|
102
|
+
return {
|
|
103
|
+
top: o.scrollTop,
|
|
104
|
+
left: o.scrollLeft
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function L(o, t, e = "smooth") {
|
|
108
|
+
const n = o.getBoundingClientRect(), c = t.getBoundingClientRect().top - n.top + o.scrollTop;
|
|
109
|
+
o.scrollTo({
|
|
110
|
+
top: c,
|
|
111
|
+
behavior: e
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function M(o, t) {
|
|
115
|
+
const e = o.getBoundingClientRect(), n = t ? t.getBoundingClientRect() : { top: 0, left: 0, bottom: window.innerHeight, right: window.innerWidth };
|
|
116
|
+
return e.top >= n.top && e.left >= n.left && e.bottom <= n.bottom && e.right <= n.right;
|
|
117
|
+
}
|
|
118
|
+
function O(o, t) {
|
|
119
|
+
const e = t.getBoundingClientRect(), n = "touches" in o ? o.touches[0].clientX : o.clientX, s = "touches" in o ? o.touches[0].clientY : o.clientY;
|
|
120
|
+
return {
|
|
121
|
+
x: n - e.left,
|
|
122
|
+
y: s - e.top
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function k(o, t, e) {
|
|
126
|
+
o.style.setProperty(`--${t}`, e);
|
|
127
|
+
}
|
|
128
|
+
function E(o, t) {
|
|
129
|
+
return getComputedStyle(o).getPropertyValue(`--${t}`).trim();
|
|
130
|
+
}
|
|
131
|
+
function H(o, ...t) {
|
|
132
|
+
o.classList.add(...t.filter(Boolean));
|
|
133
|
+
}
|
|
134
|
+
function j(o, ...t) {
|
|
135
|
+
o.classList.remove(...t.filter(Boolean));
|
|
136
|
+
}
|
|
137
|
+
function A(o, t, e) {
|
|
138
|
+
o.classList.toggle(t, e);
|
|
139
|
+
}
|
|
140
|
+
export {
|
|
141
|
+
N as DEFAULT_COLORS,
|
|
142
|
+
T as DEFAULT_OPTIONS,
|
|
143
|
+
X as DateService,
|
|
144
|
+
x as PositionService,
|
|
145
|
+
Y as ResourceService,
|
|
146
|
+
G as TimelineService,
|
|
147
|
+
U as addAlpha,
|
|
148
|
+
H as addClasses,
|
|
149
|
+
_ as darkenColor,
|
|
150
|
+
C as dateService,
|
|
151
|
+
D as findClosestWithData,
|
|
152
|
+
q as generateEventId,
|
|
153
|
+
J as generateGroupId,
|
|
154
|
+
K as generateId,
|
|
155
|
+
Q as generateResourceId,
|
|
156
|
+
E as getCSSVariable,
|
|
157
|
+
Z as getColorByIndex,
|
|
158
|
+
tt as getContrastColor,
|
|
159
|
+
B as getDataAttributes,
|
|
160
|
+
z as getElementByData,
|
|
161
|
+
O as getRelativePosition,
|
|
162
|
+
W as getScrollPosition,
|
|
163
|
+
M as isInViewport,
|
|
164
|
+
et as isResource,
|
|
165
|
+
ot as isResourceGroup,
|
|
166
|
+
nt as lightenColor,
|
|
167
|
+
P as positionService,
|
|
168
|
+
j as removeClasses,
|
|
169
|
+
st as resourceService,
|
|
170
|
+
L as scrollToTime,
|
|
171
|
+
k as setCSSVariable,
|
|
172
|
+
ct as timelineService,
|
|
173
|
+
A as toggleClass
|
|
174
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SchedulerEvent, PreviewEvent } from './event';
|
|
2
|
+
import { Resource } from './resource';
|
|
3
|
+
import { TimeSlot } from './time-slot';
|
|
4
|
+
import { DragOperationType } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* State of a drag operation
|
|
7
|
+
*/
|
|
8
|
+
export interface DragState {
|
|
9
|
+
/** Type of drag operation */
|
|
10
|
+
type: DragOperationType;
|
|
11
|
+
/** Event being dragged (null for create operations) */
|
|
12
|
+
event: SchedulerEvent | null;
|
|
13
|
+
/** Starting time slot */
|
|
14
|
+
startSlot: TimeSlot;
|
|
15
|
+
/** Current time slot (updated during drag) */
|
|
16
|
+
currentSlot: TimeSlot;
|
|
17
|
+
/** Preview event showing where the event will be placed */
|
|
18
|
+
preview: PreviewEvent;
|
|
19
|
+
/** Resource being dragged to (for resource views) */
|
|
20
|
+
resource?: Resource;
|
|
21
|
+
/** Original event data (for reverting on cancel) */
|
|
22
|
+
originalEvent?: SchedulerEvent;
|
|
23
|
+
/** Metadata for the drag operation */
|
|
24
|
+
meta?: {
|
|
25
|
+
/** For resize: which end is being resized */
|
|
26
|
+
resizeHandle?: 'start' | 'end';
|
|
27
|
+
/** Offset from event start when drag began */
|
|
28
|
+
offsetMs?: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Result of a completed drag operation
|
|
33
|
+
*/
|
|
34
|
+
export interface DragResult {
|
|
35
|
+
/** Type of operation that was completed */
|
|
36
|
+
type: DragOperationType;
|
|
37
|
+
/** The event that was created or modified */
|
|
38
|
+
event: SchedulerEvent;
|
|
39
|
+
/** The previous event state (for move/resize) */
|
|
40
|
+
previousEvent?: SchedulerEvent;
|
|
41
|
+
/** Whether the operation was cancelled */
|
|
42
|
+
cancelled: boolean;
|
|
43
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a scheduler event
|
|
3
|
+
*/
|
|
4
|
+
export interface SchedulerEvent {
|
|
5
|
+
/** Unique identifier for the event */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Event title displayed in the calendar */
|
|
8
|
+
title: string;
|
|
9
|
+
/** Start date and time */
|
|
10
|
+
start: Date;
|
|
11
|
+
/** End date and time */
|
|
12
|
+
end: Date;
|
|
13
|
+
/** Whether this is an all-day event */
|
|
14
|
+
allDay?: boolean;
|
|
15
|
+
/** Background color of the event */
|
|
16
|
+
color?: string;
|
|
17
|
+
/** Text color of the event */
|
|
18
|
+
textColor?: string;
|
|
19
|
+
/** ID of the resource this event belongs to */
|
|
20
|
+
resourceId?: string;
|
|
21
|
+
/** Whether the event can be edited */
|
|
22
|
+
editable?: boolean;
|
|
23
|
+
/** Whether the event can be dragged */
|
|
24
|
+
draggable?: boolean;
|
|
25
|
+
/** Whether the event can be resized */
|
|
26
|
+
resizable?: boolean | {
|
|
27
|
+
start: boolean;
|
|
28
|
+
end: boolean;
|
|
29
|
+
};
|
|
30
|
+
/** Additional CSS class names */
|
|
31
|
+
classNames?: string[];
|
|
32
|
+
/** Custom properties for extending event data */
|
|
33
|
+
extendedProps?: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Represents a part of an event that spans multiple days
|
|
37
|
+
*/
|
|
38
|
+
export interface SchedulerEventPart {
|
|
39
|
+
/** Unique identifier for this part */
|
|
40
|
+
id: string;
|
|
41
|
+
/** Reference to the parent event */
|
|
42
|
+
event: SchedulerEvent;
|
|
43
|
+
/** Start of this part (may differ from event.start for multi-day events) */
|
|
44
|
+
start: Date;
|
|
45
|
+
/** End of this part (may be midnight for multi-day events) */
|
|
46
|
+
end: Date;
|
|
47
|
+
/** Whether this is the first day of the event */
|
|
48
|
+
isStart: boolean;
|
|
49
|
+
/** Whether this is the last day of the event */
|
|
50
|
+
isEnd: boolean;
|
|
51
|
+
/** Which day in the sequence (0-based) */
|
|
52
|
+
dayIndex: number;
|
|
53
|
+
/** Total number of days this event spans */
|
|
54
|
+
totalDays: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* An event with its daily parts
|
|
58
|
+
*/
|
|
59
|
+
export interface SchedulerEventWithParts {
|
|
60
|
+
/** The original event */
|
|
61
|
+
event: SchedulerEvent;
|
|
62
|
+
/** Array of daily parts */
|
|
63
|
+
parts: SchedulerEventPart[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A preview event shown during drag operations
|
|
67
|
+
*/
|
|
68
|
+
export interface PreviewEvent {
|
|
69
|
+
/** Start of the preview */
|
|
70
|
+
start: Date;
|
|
71
|
+
/** End of the preview */
|
|
72
|
+
end: Date;
|
|
73
|
+
/** Optional resource ID for resource-based views */
|
|
74
|
+
resourceId?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A track/rail containing non-overlapping events
|
|
78
|
+
*/
|
|
79
|
+
export interface TimelineTrack {
|
|
80
|
+
/** Track index (0 = first/leftmost track) */
|
|
81
|
+
index: number;
|
|
82
|
+
/** Events in this track (guaranteed non-overlapping) */
|
|
83
|
+
events: SchedulerEvent[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Position information for rendering an event
|
|
87
|
+
*/
|
|
88
|
+
export interface EventPosition {
|
|
89
|
+
/** Top position in pixels or percentage */
|
|
90
|
+
top: number;
|
|
91
|
+
/** Left position in pixels or percentage */
|
|
92
|
+
left: number;
|
|
93
|
+
/** Width in pixels or percentage */
|
|
94
|
+
width: number;
|
|
95
|
+
/** Height in pixels or percentage */
|
|
96
|
+
height: number;
|
|
97
|
+
/** Z-index for stacking */
|
|
98
|
+
zIndex: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Layout information for an event within its overlap group
|
|
102
|
+
* Used for colspan-based positioning algorithm
|
|
103
|
+
*/
|
|
104
|
+
export interface EventLayoutInfo {
|
|
105
|
+
/** Column index within the overlap group (0-based) */
|
|
106
|
+
col: number;
|
|
107
|
+
/** Number of columns this event can span */
|
|
108
|
+
colspan: number;
|
|
109
|
+
/** Total number of columns in the overlap group */
|
|
110
|
+
columnCount: number;
|
|
111
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { SchedulerEvent } from './event';
|
|
2
|
+
import { Resource } from './resource';
|
|
3
|
+
import { ViewType } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Base event detail interface
|
|
6
|
+
*/
|
|
7
|
+
export interface BaseEventDetail {
|
|
8
|
+
/** Original DOM event */
|
|
9
|
+
originalEvent?: Event;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Event-selected event detail. Fires on mouse click and on keyboard Tab
|
|
13
|
+
* landing on an event (PRD scheduler-keyboard-grid-nav D3 — renamed from
|
|
14
|
+
* `EventClickDetail` because keyboard Tab now triggers the same event).
|
|
15
|
+
*/
|
|
16
|
+
export interface EventSelectedDetail extends BaseEventDetail {
|
|
17
|
+
/** The selected event */
|
|
18
|
+
event: SchedulerEvent;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Event create *request* detail. Per PRD scheduler-controlled-selection,
|
|
22
|
+
* the scheduler does not construct or store the event itself — the consumer
|
|
23
|
+
* receives the range and decides whether to add an event for it.
|
|
24
|
+
*/
|
|
25
|
+
export interface EventCreateDetail extends BaseEventDetail {
|
|
26
|
+
/** The selected time range. */
|
|
27
|
+
range: {
|
|
28
|
+
start: Date;
|
|
29
|
+
end: Date;
|
|
30
|
+
};
|
|
31
|
+
/** Resource the request targets (timeline view only). */
|
|
32
|
+
resourceId?: string;
|
|
33
|
+
/** View that produced the request. */
|
|
34
|
+
view: ViewType;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Selection-change detail. Fires on every transition — including the
|
|
38
|
+
* transition to an empty selection. `selectedEvent` and `range` are
|
|
39
|
+
* independent dimensions of the selection state.
|
|
40
|
+
*/
|
|
41
|
+
export interface SelectionChangeDetail {
|
|
42
|
+
selectedEvent: SchedulerEvent | null;
|
|
43
|
+
range: {
|
|
44
|
+
start: Date;
|
|
45
|
+
end: Date;
|
|
46
|
+
} | null;
|
|
47
|
+
view: ViewType;
|
|
48
|
+
resourceId?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Event update event detail
|
|
52
|
+
*/
|
|
53
|
+
export interface EventUpdateDetail extends BaseEventDetail {
|
|
54
|
+
/** The updated event */
|
|
55
|
+
event: SchedulerEvent;
|
|
56
|
+
/** The event before the update */
|
|
57
|
+
oldEvent: SchedulerEvent;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Event delete event detail
|
|
61
|
+
*/
|
|
62
|
+
export interface EventDeleteDetail extends BaseEventDetail {
|
|
63
|
+
/** The deleted event */
|
|
64
|
+
event: SchedulerEvent;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Date click event detail
|
|
68
|
+
*/
|
|
69
|
+
export interface DateClickDetail extends BaseEventDetail {
|
|
70
|
+
/** The clicked date */
|
|
71
|
+
date: Date;
|
|
72
|
+
/** Resource at the clicked location (if applicable) */
|
|
73
|
+
resource?: Resource;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Date select event detail
|
|
77
|
+
*/
|
|
78
|
+
export interface DateSelectDetail extends BaseEventDetail {
|
|
79
|
+
/** Start of the selected range */
|
|
80
|
+
start: Date;
|
|
81
|
+
/** End of the selected range */
|
|
82
|
+
end: Date;
|
|
83
|
+
/** Resource at the selected location (if applicable) */
|
|
84
|
+
resource?: Resource;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* View change event detail
|
|
88
|
+
*/
|
|
89
|
+
export interface ViewChangeDetail {
|
|
90
|
+
/** The new view */
|
|
91
|
+
view: ViewType;
|
|
92
|
+
/** The current date in the new view */
|
|
93
|
+
date: Date;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Custom event map for the scheduler web component
|
|
97
|
+
*/
|
|
98
|
+
export interface SchedulerEventMap {
|
|
99
|
+
'event-selected': CustomEvent<EventSelectedDetail>;
|
|
100
|
+
'event-dblclick': CustomEvent<EventSelectedDetail>;
|
|
101
|
+
'event-create': CustomEvent<EventCreateDetail>;
|
|
102
|
+
'event-update': CustomEvent<EventUpdateDetail>;
|
|
103
|
+
'event-delete': CustomEvent<EventDeleteDetail>;
|
|
104
|
+
'date-click': CustomEvent<DateClickDetail>;
|
|
105
|
+
'date-select': CustomEvent<DateSelectDetail>;
|
|
106
|
+
'view-change': CustomEvent<ViewChangeDetail>;
|
|
107
|
+
'selection-change': CustomEvent<SelectionChangeDetail>;
|
|
108
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { DayOfWeek, TimeFormat, ViewType } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Business hours configuration
|
|
4
|
+
*/
|
|
5
|
+
export interface BusinessHours {
|
|
6
|
+
/** Days of the week when business hours apply (0 = Sunday) */
|
|
7
|
+
daysOfWeek: DayOfWeek[];
|
|
8
|
+
/** Start time in HH:mm format */
|
|
9
|
+
startTime: string;
|
|
10
|
+
/** End time in HH:mm format */
|
|
11
|
+
endTime: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Header toolbar configuration
|
|
15
|
+
*/
|
|
16
|
+
export interface HeaderToolbar {
|
|
17
|
+
/** Left section content */
|
|
18
|
+
start?: string;
|
|
19
|
+
/** Center section content */
|
|
20
|
+
center?: string;
|
|
21
|
+
/** Right section content */
|
|
22
|
+
end?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Configuration options for the scheduler
|
|
26
|
+
*/
|
|
27
|
+
export interface SchedulerOptions {
|
|
28
|
+
/** Initial view to display */
|
|
29
|
+
initialView?: ViewType;
|
|
30
|
+
/** Initial date to display */
|
|
31
|
+
initialDate?: Date;
|
|
32
|
+
/** Locale for date formatting (e.g., 'en-US') */
|
|
33
|
+
locale?: string;
|
|
34
|
+
/** First day of the week (0 = Sunday, 1 = Monday) */
|
|
35
|
+
firstDayOfWeek?: DayOfWeek;
|
|
36
|
+
/** Timezone identifier (e.g., 'America/New_York') */
|
|
37
|
+
timeZone?: string;
|
|
38
|
+
/** Duration of each time slot in seconds (default: 1800 = 30 minutes) */
|
|
39
|
+
slotDuration?: number;
|
|
40
|
+
/** Interval between slot labels in seconds */
|
|
41
|
+
slotLabelInterval?: number;
|
|
42
|
+
/** Minimum time to display (e.g., '00:00:00') */
|
|
43
|
+
slotMinTime?: string;
|
|
44
|
+
/** Maximum time to display (e.g., '24:00:00') */
|
|
45
|
+
slotMaxTime?: string;
|
|
46
|
+
/** Time format (12h or 24h) */
|
|
47
|
+
timeFormat?: TimeFormat;
|
|
48
|
+
/** Business hours configuration */
|
|
49
|
+
businessHours?: BusinessHours;
|
|
50
|
+
/** Height of the scheduler ('auto', number in px, or CSS value) */
|
|
51
|
+
height?: 'auto' | number | string;
|
|
52
|
+
/** Height of the content area */
|
|
53
|
+
contentHeight?: 'auto' | number;
|
|
54
|
+
/** Aspect ratio for auto-sizing */
|
|
55
|
+
aspectRatio?: number;
|
|
56
|
+
/** Whether to expand rows to fill available space */
|
|
57
|
+
expandRows?: boolean;
|
|
58
|
+
/** Header toolbar configuration */
|
|
59
|
+
headerToolbar?: HeaderToolbar;
|
|
60
|
+
/** Whether events can be edited */
|
|
61
|
+
editable?: boolean;
|
|
62
|
+
/** Whether date ranges can be selected */
|
|
63
|
+
selectable?: boolean;
|
|
64
|
+
/** Whether to show a mirror element during selection */
|
|
65
|
+
selectMirror?: boolean;
|
|
66
|
+
/** Whether event duration can be changed */
|
|
67
|
+
eventDurationEditable?: boolean;
|
|
68
|
+
/** Whether event start time can be changed */
|
|
69
|
+
eventStartEditable?: boolean;
|
|
70
|
+
/** Duration of revert animation in ms */
|
|
71
|
+
dragRevertDuration?: number;
|
|
72
|
+
/** Whether to scroll during drag */
|
|
73
|
+
dragScroll?: boolean;
|
|
74
|
+
/** Snap duration in seconds */
|
|
75
|
+
snapDuration?: number;
|
|
76
|
+
/** Whether to show current time indicator */
|
|
77
|
+
nowIndicator?: boolean;
|
|
78
|
+
/** Whether to show week numbers */
|
|
79
|
+
weekNumbers?: boolean;
|
|
80
|
+
/** Text to display before week number */
|
|
81
|
+
weekText?: string;
|
|
82
|
+
/** Maximum events to show per day (true = show "+X more" link) */
|
|
83
|
+
dayMaxEvents?: boolean | number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Default options for the scheduler
|
|
87
|
+
*/
|
|
88
|
+
export declare const DEFAULT_OPTIONS: Required<SchedulerOptions>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { SchedulerEvent } from './event';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a resource (e.g., a room, employee, machine)
|
|
4
|
+
*/
|
|
5
|
+
export interface Resource {
|
|
6
|
+
/** Unique identifier for the resource */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Display title of the resource */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Events assigned to this resource */
|
|
11
|
+
events?: SchedulerEvent[];
|
|
12
|
+
/** Background color for this resource's events */
|
|
13
|
+
color?: string;
|
|
14
|
+
/** Default event color for this resource */
|
|
15
|
+
eventColor?: string;
|
|
16
|
+
/** Sort order */
|
|
17
|
+
order?: number;
|
|
18
|
+
/** Custom properties for extending resource data */
|
|
19
|
+
extendedProps?: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Represents a group of resources (e.g., a department, category)
|
|
23
|
+
*/
|
|
24
|
+
export interface ResourceGroup {
|
|
25
|
+
/** Unique identifier for the group */
|
|
26
|
+
id: string;
|
|
27
|
+
/** Display title of the group */
|
|
28
|
+
title: string;
|
|
29
|
+
/** Child resources or nested groups */
|
|
30
|
+
children: (Resource | ResourceGroup)[];
|
|
31
|
+
/** Whether the group is collapsed in the UI */
|
|
32
|
+
collapsed?: boolean;
|
|
33
|
+
/** Background color for the group header */
|
|
34
|
+
color?: string;
|
|
35
|
+
/** Sort order */
|
|
36
|
+
order?: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Type guard to check if an item is a Resource
|
|
40
|
+
*/
|
|
41
|
+
export declare function isResource(item: Resource | ResourceGroup): item is Resource;
|
|
42
|
+
/**
|
|
43
|
+
* Type guard to check if an item is a ResourceGroup
|
|
44
|
+
*/
|
|
45
|
+
export declare function isResourceGroup(item: Resource | ResourceGroup): item is ResourceGroup;
|
|
46
|
+
/**
|
|
47
|
+
* Flattened resource with depth information for rendering
|
|
48
|
+
*/
|
|
49
|
+
export interface FlattenedResource {
|
|
50
|
+
/** The resource or group */
|
|
51
|
+
item: Resource | ResourceGroup;
|
|
52
|
+
/** Nesting depth (0 = top level) */
|
|
53
|
+
depth: number;
|
|
54
|
+
/** Whether this item is visible (not in a collapsed group) */
|
|
55
|
+
visible: boolean;
|
|
56
|
+
/** Parent group ID if any */
|
|
57
|
+
parentId?: string;
|
|
58
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a time slot in the scheduler grid
|
|
3
|
+
*/
|
|
4
|
+
export interface TimeSlot {
|
|
5
|
+
/** Start of the time slot */
|
|
6
|
+
start: Date;
|
|
7
|
+
/** End of the time slot */
|
|
8
|
+
end: Date;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A row of time slots with associated metadata
|
|
12
|
+
*/
|
|
13
|
+
export interface TimeSlotRow {
|
|
14
|
+
/** The time stamp for this row (e.g., 09:00) */
|
|
15
|
+
time: Date;
|
|
16
|
+
/** Label to display (e.g., "9:00 AM") */
|
|
17
|
+
label: string;
|
|
18
|
+
/** Individual slots for each column (day) */
|
|
19
|
+
slots: TimeSlot[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Grid structure for the scheduler
|
|
23
|
+
*/
|
|
24
|
+
export interface SchedulerGrid {
|
|
25
|
+
/** Column headers (days) */
|
|
26
|
+
columns: Date[];
|
|
27
|
+
/** Row headers (times) */
|
|
28
|
+
rows: TimeSlotRow[];
|
|
29
|
+
/** All time slots flattened */
|
|
30
|
+
allSlots: TimeSlot[];
|
|
31
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* View types for the scheduler
|
|
3
|
+
*/
|
|
4
|
+
export type ViewType = 'year' | 'month' | 'week' | 'day' | 'timeline';
|
|
5
|
+
/**
|
|
6
|
+
* Display mode for events
|
|
7
|
+
*/
|
|
8
|
+
export type DisplayMode = 'grid' | 'timeline';
|
|
9
|
+
/**
|
|
10
|
+
* Time format options
|
|
11
|
+
*/
|
|
12
|
+
export type TimeFormat = '12h' | '24h';
|
|
13
|
+
/**
|
|
14
|
+
* Days of the week (0 = Sunday, 1 = Monday, etc.)
|
|
15
|
+
*/
|
|
16
|
+
export type DayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
17
|
+
/**
|
|
18
|
+
* Drag operation types
|
|
19
|
+
*/
|
|
20
|
+
export type DragOperationType = 'create' | 'move' | 'resize-start' | 'resize-end';
|