@revolist/ui 4.0.1-rc → 4.0.2-rc
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/README.md +6 -5
- package/_chunks/calendar-CpaUK7w1.js +248 -0
- package/_chunks/chart-frame-BC99KjGa.js +127 -0
- package/_chunks/choice-chips-Cs4D-3nH.js +110 -0
- package/_chunks/{color-palette-BmZ7kH9R.js → color-palette-BBMFmUNA.js} +41 -41
- package/_chunks/color-picker-D90Jg-M8.js +138 -0
- package/_chunks/compat.module-DDB2pm9O.js +229 -0
- package/_chunks/component-YDcfoOLz.js +859 -0
- package/_chunks/{control-tooltip-BCNzQCXE.js → control-tooltip-ztgmsG7H.js} +29 -29
- package/_chunks/{controller-CmLo-Ajc.js → controller-hRBm_Lfz.js} +15 -15
- package/_chunks/{controls-NEL5tDaz.js → controls-DIum-E66.js} +192 -192
- package/_chunks/{date-control-CYCkb1aQ.js → date-control-BJSzu79z.js} +21 -21
- package/_chunks/date-time-BxPJusp9.js +770 -0
- package/_chunks/{delete-button-DnpmDNEJ.js → delete-button-Bblyah10.js} +1 -1
- package/_chunks/dialog.parts-DBqo3Qwb.js +134 -0
- package/_chunks/{dropdown-CkGQBm1Q.js → dropdown-voWqmwAe.js} +102 -102
- package/_chunks/duration-87U2EoMS.js +271 -0
- package/_chunks/editor-commit-Bq3wSgvr.js +12 -0
- package/_chunks/{editor-popup-B7fu_A_T.js → editor-popup-D3JdS8l3.js} +8 -8
- package/_chunks/framework-mount-C-Zwm44H.js +54 -0
- package/_chunks/hooks.module-CG3gN83z.js +157 -0
- package/_chunks/jsxRuntime.module-F6UFnpT-.js +30 -0
- package/_chunks/mount-DZe_6VtR.js +90 -0
- package/_chunks/native.view-ByyZ1CT5.js +32 -0
- package/_chunks/{number-input-NnH57J4j.js → number-input-BeIadZuL.js} +89 -89
- package/_chunks/picker-DpP7iQLA.js +122 -0
- package/_chunks/preact.module-BBM36DnO.js +290 -0
- package/_chunks/{rating-choice-CWAsNQNS.js → rating-choice-Ca8ZBty3.js} +10 -10
- package/_chunks/reorder-list-Cc3KmfAN.js +59 -0
- package/_chunks/request-trail-IdNiFvKH.js +347 -0
- package/_chunks/{rich-text-2Rla349o.js → rich-text-BzI1DyfF.js} +167 -167
- package/_vendor/preact/LICENSE +21 -0
- package/_vendor/preact/compat/src/index.d.ts +353 -0
- package/_vendor/preact/compat/src/suspense-list.d.ts +16 -0
- package/_vendor/preact/compat/src/suspense.d.ts +19 -0
- package/_vendor/preact/hooks/src/index.d.ts +145 -0
- package/_vendor/preact/src/dom.d.ts +2548 -0
- package/_vendor/preact/src/index.d.ts +373 -0
- package/_vendor/preact/src/jsx.d.ts +2958 -0
- package/activity-message.d.ts +1 -1
- package/activity-message.js +16 -16
- package/ai/components.d.ts +1 -1
- package/ai/index.js +2 -2
- package/ai/request-trail.d.ts +1 -1
- package/ai/translation-context.d.ts +1 -1
- package/alert.d.ts +2 -2
- package/assignee/field.d.ts +2 -2
- package/assignee/index.js +87 -87
- package/assignee/layout.d.ts +2 -2
- package/assignee/picker.d.ts +1 -1
- package/avatar/index.js +25 -25
- package/avatar/index.view.d.ts +1 -1
- package/brush-range/component.d.ts +1 -1
- package/brush-range/component.js +30 -30
- package/buttons/delete-button.js +1 -1
- package/buttons/remove-button.d.ts +1 -1
- package/buttons/remove-button.js +3 -3
- package/buttons/svg-button.d.ts +1 -1
- package/buttons/svg-button.js +35 -35
- package/calendar/calendar.d.ts +1 -1
- package/calendar/calendar.js +1 -1
- package/calendar/caption.d.ts +1 -1
- package/calendar/day.d.ts +1 -1
- package/calendar/day.js +4 -4
- package/calendar/header.d.ts +1 -1
- package/calendar/header.js +35 -35
- package/calendar/index.js +2 -2
- package/calendar/month-grid.d.ts +1 -1
- package/calendar/month-grid.js +37 -37
- package/calendar/picker.d.ts +1 -1
- package/calendar/types.d.ts +1 -1
- package/calendar/year-grid.d.ts +1 -1
- package/calendar/year-grid.js +12 -12
- package/checkbox/index.d.ts +2 -2
- package/checkbox/index.js +9 -9
- package/choice-chips/index.d.ts +1 -1
- package/choice-chips/index.js +1 -1
- package/color-palette/color-palette.d.ts +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-picker.d.ts +1 -1
- package/color-palette/color-picker.js +2 -2
- package/component-catalog.d.ts +19 -19
- package/control-presentation.js +18 -18
- package/controls.d.ts +4 -4
- package/controls.js +1 -1
- package/core/editor-commit.d.ts +1 -1
- package/core/editor-popup.d.ts +1 -1
- package/core/editor-popup.js +1 -1
- package/date-time/date-control.d.ts +1 -1
- package/date-time/field.d.ts +2 -2
- package/date-time/index.js +1 -1
- package/date-time/picker.d.ts +1 -1
- package/date-time/time-control.d.ts +1 -1
- package/date-time/time-selection.d.ts +1 -1
- package/date-time/types.d.ts +1 -1
- package/dialog/dialog-action-footer.view.d.ts +1 -1
- package/dialog/dialog.dom.js +52 -52
- package/dialog/dialog.parts.d.ts +18 -18
- package/dialog/dialog.parts.js +1 -1
- package/dialog/dialog.preact.d.ts +1 -1
- package/dialog/dialog.preact.js +6 -6
- package/distribution-chart/area-chart.d.ts +1 -1
- package/distribution-chart/area-chart.js +25 -25
- package/distribution-chart/bar-chart.d.ts +1 -1
- package/distribution-chart/bar-chart.js +6 -6
- package/distribution-chart/chart-frame.d.ts +1 -1
- package/distribution-chart/index.d.ts +1 -1
- package/distribution-chart/index.js +6 -6
- package/distribution-chart/line-chart.d.ts +1 -1
- package/distribution-chart/line-chart.js +9 -9
- package/distribution-chart/types.d.ts +1 -1
- package/dropdown/content.d.ts +1 -1
- package/dropdown/content.js +83 -82
- package/dropdown/dropdown.service.d.ts +1 -1
- package/dropdown/dropdown.service.js +9 -9
- package/dropdown/index.js +1 -1
- package/dropdown/lookup-field.d.ts +1 -1
- package/dropdown/lookup-field.js +41 -41
- package/dropdown/popup.d.ts +1 -1
- package/dropdown/popup.js +17 -16
- package/duration/controls.d.ts +1 -1
- package/duration/index.d.ts +2 -2
- package/duration/index.js +1 -1
- package/editor-actions.d.ts +1 -1
- package/editor-actions.js +21 -20
- package/editor-layout/index.d.ts +1 -1
- package/editor-layout/index.js +27 -27
- package/field-configurator.d.ts +1 -1
- package/field-configurator.js +93 -93
- package/field-reorder.hook.js +32 -32
- package/filter/filters/slider/preact.js +3 -3
- package/filter/filters/slider/single.d.ts +1 -1
- package/filter/filters/slider/single.js +23 -23
- package/filter-badge.d.ts +1 -1
- package/filter-badge.js +23 -22
- package/filter-controls.d.ts +1 -1
- package/filter-controls.js +31 -31
- package/form-controls/index.js +20 -20
- package/form-controls/presentation.d.ts +1 -1
- package/form-controls/presentation.js +44 -44
- package/formatting/comparison-preview.d.ts +1 -1
- package/formatting/control-tooltip.d.ts +1 -1
- package/formatting/icon-controls.d.ts +1 -1
- package/formatting/index.js +99 -98
- package/formatting/inspector-section.d.ts +1 -1
- package/formatting/typography-controls.d.ts +1 -1
- package/framework-mount.d.ts +1 -1
- package/framework.js +19 -19
- package/icons/icon.d.ts +1 -1
- package/icons/icon.js +1 -1
- package/legend.d.ts +1 -1
- package/legend.js +12 -12
- package/masked-input/index.d.ts +1 -1
- package/masked-input/index.js +109 -109
- package/native-control.d.ts +11 -11
- package/native-control.js +12 -12
- package/native.js +39 -39
- package/number-input/index.d.ts +1 -1
- package/number-input/index.js +1 -1
- package/package.json +1 -2
- package/pdf-viewer/component.d.ts +1 -1
- package/pdf-viewer/controller.js +1 -1
- package/pdf-viewer/header.d.ts +1 -1
- package/pdf-viewer/index.js +13 -13
- package/pdf-viewer/search-bar.d.ts +1 -1
- package/pdf-viewer/status.d.ts +1 -1
- package/pdf-viewer/toolbar.d.ts +1 -1
- package/pickers.d.ts +1 -1
- package/preact-mount.d.ts +1 -1
- package/preact-mount.js +1 -1
- package/preact.js +14 -14
- package/rating-choice.d.ts +1 -1
- package/rating-choice.js +1 -1
- package/react-adapter.d.ts +1 -1
- package/react.js +19 -19
- package/reorder-list.d.ts +1 -1
- package/reorder-list.js +1 -1
- package/resource-picker/resource-picker-avatar.d.ts +1 -1
- package/resource-picker/resource-picker-avatar.js +14 -14
- package/resource-picker/resource-picker-option.d.ts +1 -1
- package/resource-picker/resource-picker-option.js +28 -28
- package/resource-picker/resource-picker-popup.d.ts +1 -1
- package/resource-picker/resource-picker-popup.js +3 -3
- package/resource-picker/resource-picker.d.ts +1 -1
- package/resource-picker/resource-picker.js +88 -88
- package/rich-text/index.d.ts +1 -1
- package/rich-text/index.js +1 -1
- package/rich-text/toolbar.d.ts +1 -1
- package/search-input/index.js +12 -12
- package/segmented-switch/index.d.ts +1 -1
- package/segmented-switch/index.js +1 -1
- package/status-feedback/render.d.ts +2 -2
- package/status-feedback/render.js +13 -13
- package/surfaces.js +34 -34
- package/svelte.js +2 -2
- package/switch/index.js +15 -15
- package/time-grid.d.ts +1 -1
- package/time-grid.js +58 -58
- package/timeline-track/component.d.ts +1 -1
- package/timeline-track/index.js +75 -75
- package/vue-adapter.d.ts +1 -1
- package/vue.d.ts +116 -116
- package/vue.js +121 -121
- package/_chunks/calendar-BsDxCYhI.js +0 -248
- package/_chunks/chart-frame-BvxbmEU9.js +0 -126
- package/_chunks/choice-chips-0HfOnK_4.js +0 -110
- package/_chunks/color-picker-BRv-__AM.js +0 -138
- package/_chunks/component-D4PH5UZT.js +0 -859
- package/_chunks/date-time-DjucJmbc.js +0 -769
- package/_chunks/dialog.parts-Dt3KinUz.js +0 -134
- package/_chunks/duration-BCaktcvz.js +0 -270
- package/_chunks/editor-commit-D6Rf5rGz.js +0 -12
- package/_chunks/framework-mount-BKIOsvY-.js +0 -54
- package/_chunks/mount-0-8opf1j.js +0 -90
- package/_chunks/native.view-8q_nwQ7x.js +0 -32
- package/_chunks/picker-oazJ7sO_.js +0 -121
- package/_chunks/reorder-list-BV3kZXso.js +0 -59
- package/_chunks/request-trail-D0oVzdRd.js +0 -347
package/switch/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as e } from "../_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
2
2
|
//#region src/switch/index.tsx
|
|
3
|
-
function
|
|
4
|
-
let
|
|
3
|
+
function t({ checked: t, onChange: n, label: r, ariaLabel: i, className: a = "", disabled: o = !1, labelPosition: s = "before", title: c, testId: l }) {
|
|
4
|
+
let u = /* @__PURE__ */ e("span", {
|
|
5
5
|
class: "rv-switch-label",
|
|
6
|
-
children:
|
|
7
|
-
}),
|
|
6
|
+
children: r
|
|
7
|
+
}), d = /* @__PURE__ */ e("span", {
|
|
8
8
|
class: "rv-switch-track",
|
|
9
9
|
"aria-hidden": "true",
|
|
10
10
|
children: /* @__PURE__ */ e("span", { class: "rv-switch-thumb" })
|
|
11
11
|
});
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ e("button", {
|
|
13
13
|
type: "button",
|
|
14
|
-
class: `rv-switch ${
|
|
14
|
+
class: `rv-switch ${a}`.trim(),
|
|
15
15
|
role: "switch",
|
|
16
|
-
"aria-checked":
|
|
17
|
-
"aria-label":
|
|
18
|
-
disabled:
|
|
19
|
-
title:
|
|
20
|
-
"data-testid":
|
|
21
|
-
onClick: () =>
|
|
22
|
-
children: [
|
|
16
|
+
"aria-checked": t,
|
|
17
|
+
"aria-label": i ?? (typeof r == "string" ? r : void 0),
|
|
18
|
+
disabled: o,
|
|
19
|
+
title: c,
|
|
20
|
+
"data-testid": l,
|
|
21
|
+
onClick: () => n(!t),
|
|
22
|
+
children: [s === "before" ? u : d, s === "before" ? d : u]
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
|
-
export {
|
|
26
|
+
export { t as Switch };
|
package/time-grid.d.ts
CHANGED
package/time-grid.js
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { r as e, t } from "./_chunks/hooks.module-CG3gN83z.js";
|
|
2
|
+
import { t as n } from "./_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
+
import { ButtonControl as r } from "./native-control.js";
|
|
4
4
|
//#region src/time-grid.tsx
|
|
5
|
-
var
|
|
6
|
-
function
|
|
5
|
+
var i = (e, t) => `${e}:${t}`;
|
|
6
|
+
function a(e) {
|
|
7
7
|
return [
|
|
8
8
|
"rv-time-grid__cell",
|
|
9
9
|
e.weekend && "is-weekend",
|
|
10
10
|
e.outsideWorkHours && "is-outside-work-hours"
|
|
11
11
|
].filter(Boolean).join(" ");
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
let
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
class:
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
-
class:
|
|
13
|
+
function o(e) {
|
|
14
|
+
let t = (t) => `rv-time-grid__${t}${e.legacyClassPrefix ? ` ${e.legacyClassPrefix}__${t}` : ""}`, o = Array.from({ length: 12 }, (e, t) => t * 2);
|
|
15
|
+
return /* @__PURE__ */ n("div", {
|
|
16
|
+
class: t("schedule"),
|
|
17
|
+
children: [/* @__PURE__ */ n("div", {
|
|
18
|
+
class: t("hours"),
|
|
19
19
|
"aria-hidden": "true",
|
|
20
|
-
children: [/* @__PURE__ */
|
|
21
|
-
class:
|
|
22
|
-
children:
|
|
23
|
-
},
|
|
24
|
-
}), /* @__PURE__ */
|
|
25
|
-
ref:
|
|
26
|
-
class:
|
|
20
|
+
children: [/* @__PURE__ */ n("span", {}), o.map((r) => /* @__PURE__ */ n("span", {
|
|
21
|
+
class: t("hour"),
|
|
22
|
+
children: e.hourLabel(r)
|
|
23
|
+
}, r))]
|
|
24
|
+
}), /* @__PURE__ */ n("div", {
|
|
25
|
+
ref: e.matrixRef,
|
|
26
|
+
class: t("matrix"),
|
|
27
27
|
role: "grid",
|
|
28
|
-
"aria-label":
|
|
29
|
-
"aria-rowcount":
|
|
28
|
+
"aria-label": e.gridLabel,
|
|
29
|
+
"aria-rowcount": e.days.length,
|
|
30
30
|
"aria-colcount": 12,
|
|
31
|
-
children:
|
|
32
|
-
let { weekday:
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
class: `${
|
|
31
|
+
children: e.days.map((s) => {
|
|
32
|
+
let { weekday: c, short: l, long: u } = s, d = e.weekendDays.includes(c);
|
|
33
|
+
return /* @__PURE__ */ n("div", {
|
|
34
|
+
class: `${t("row")}${d ? " is-weekend" : ""}`,
|
|
35
35
|
role: "row",
|
|
36
|
-
children: [/* @__PURE__ */
|
|
37
|
-
class:
|
|
36
|
+
children: [/* @__PURE__ */ n("span", {
|
|
37
|
+
class: t("weekday"),
|
|
38
38
|
role: "rowheader",
|
|
39
|
-
title:
|
|
40
|
-
children:
|
|
41
|
-
}),
|
|
42
|
-
let
|
|
43
|
-
return /* @__PURE__ */ r
|
|
39
|
+
title: u,
|
|
40
|
+
children: l
|
|
41
|
+
}), o.map((t) => {
|
|
42
|
+
let o = i(c, t), l = e.cells.has(o) || e.cells.has(i(c, t + 1)), u = e.workingHours ? t < e.workingHours.startHour || t + 2 > e.workingHours.endHour : !1;
|
|
43
|
+
return /* @__PURE__ */ n(r, {
|
|
44
44
|
type: "button",
|
|
45
|
-
disabled:
|
|
45
|
+
disabled: e.disabled,
|
|
46
46
|
role: "gridcell",
|
|
47
|
-
"data-time-cell":
|
|
48
|
-
class: `${
|
|
49
|
-
weekend:
|
|
47
|
+
"data-time-cell": o,
|
|
48
|
+
class: `${a({
|
|
49
|
+
weekend: d,
|
|
50
50
|
outsideWorkHours: u
|
|
51
|
-
})} ${
|
|
52
|
-
"aria-selected":
|
|
53
|
-
"aria-label":
|
|
54
|
-
tabIndex:
|
|
55
|
-
onFocus: () =>
|
|
56
|
-
onKeyDown: (
|
|
57
|
-
onClick: (
|
|
58
|
-
onPointerDown: (
|
|
59
|
-
onPointerEnter: () =>
|
|
60
|
-
},
|
|
51
|
+
})} ${e.legacyClassPrefix ? `${e.legacyClassPrefix}__cell` : ""}`,
|
|
52
|
+
"aria-selected": l,
|
|
53
|
+
"aria-label": e.cellLabel(s, e.hourLabel(t), e.hourLabel(t + 2), l),
|
|
54
|
+
tabIndex: e.focused === o ? 0 : -1,
|
|
55
|
+
onFocus: () => e.onFocus(o),
|
|
56
|
+
onKeyDown: (n) => e.onKeyDown(n, c, t),
|
|
57
|
+
onClick: (n) => e.onClick(n, c, t, l),
|
|
58
|
+
onPointerDown: (n) => e.onPointerDown(n, c, t, l),
|
|
59
|
+
onPointerEnter: () => e.onPointerEnter(c, t)
|
|
60
|
+
}, o);
|
|
61
61
|
})]
|
|
62
|
-
},
|
|
62
|
+
}, c);
|
|
63
63
|
})
|
|
64
64
|
})]
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
let r = n
|
|
69
|
-
r.current =
|
|
70
|
-
let
|
|
67
|
+
function s(n) {
|
|
68
|
+
let r = t(n);
|
|
69
|
+
r.current = n;
|
|
70
|
+
let a = t(), o = t(), s = t(), c = () => {
|
|
71
71
|
o.current?.(), o.current = void 0;
|
|
72
72
|
};
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
e(() => () => {
|
|
74
|
+
a.current = void 0, c(), s.current !== void 0 && cancelAnimationFrame(s.current);
|
|
75
75
|
}, []);
|
|
76
76
|
let l = (e, t) => {
|
|
77
|
-
let n =
|
|
77
|
+
let n = i(e, t);
|
|
78
78
|
r.current.onFocus(n), s.current !== void 0 && cancelAnimationFrame(s.current), s.current = requestAnimationFrame(() => r.current.matrixRef.current?.querySelector(`[data-time-cell="${n}"]`)?.focus());
|
|
79
79
|
};
|
|
80
80
|
return {
|
|
@@ -97,18 +97,18 @@ function c(e) {
|
|
|
97
97
|
},
|
|
98
98
|
onPointerDown: (e, t, n, s) => {
|
|
99
99
|
if (r.current.disabled || e.button !== 0) return;
|
|
100
|
-
e.preventDefault(), c(),
|
|
100
|
+
e.preventDefault(), c(), a.current = { selected: !s };
|
|
101
101
|
let l = e.currentTarget.ownerDocument, u = () => {
|
|
102
|
-
|
|
102
|
+
a.current && (a.current = void 0, c(), r.current.onCommit());
|
|
103
103
|
};
|
|
104
104
|
l.addEventListener("pointerup", u), l.addEventListener("pointercancel", u), o.current = () => {
|
|
105
105
|
l.removeEventListener("pointerup", u), l.removeEventListener("pointercancel", u);
|
|
106
|
-
}, r.current.onPaint(t, n, !s), r.current.onFocus(
|
|
106
|
+
}, r.current.onPaint(t, n, !s), r.current.onFocus(i(t, n));
|
|
107
107
|
},
|
|
108
108
|
onPointerEnter: (e, t) => {
|
|
109
|
-
|
|
109
|
+
a.current && !r.current.disabled && r.current.onPaint(e, t, a.current.selected);
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
//#endregion
|
|
114
|
-
export {
|
|
114
|
+
export { o as TimeGrid, i as timeGridCellKey, s as useTimeGridInteraction };
|
|
@@ -20,4 +20,4 @@ export interface TimelineTrackProps<T extends TimelineTrackEvent> {
|
|
|
20
20
|
readonly onEventChange: (id: string | number, event: T) => void;
|
|
21
21
|
}
|
|
22
22
|
/** Controlled numeric timeline. Changes preserve event metadata; consumers own commits. */
|
|
23
|
-
export declare function TimelineTrack<T extends TimelineTrackEvent>({ rows, selected, range, labels, onSelect, onEventChange, }: TimelineTrackProps<T>): import("preact").JSX.Element;
|
|
23
|
+
export declare function TimelineTrack<T extends TimelineTrackEvent>({ rows, selected, range, labels, onSelect, onEventChange, }: TimelineTrackProps<T>): import("../_vendor/preact/src/index").JSX.Element;
|
package/timeline-track/index.js
CHANGED
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as e } from "../_chunks/hooks.module-CG3gN83z.js";
|
|
2
|
+
import { t } from "../_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
+
import { ButtonControl as n } from "../native-control.js";
|
|
4
|
+
import { eventOutsideRange as r, moveTimelineEvent as i, niceTimelineStep as a, resizeTimelineEvent as o, timelineGeometry as s } from "./model.js";
|
|
5
5
|
//#region src/timeline-track/component.tsx
|
|
6
|
-
var
|
|
6
|
+
var c = {
|
|
7
7
|
preview: "Timeline preview",
|
|
8
8
|
moveEvent: (e) => `Move event ${e}`,
|
|
9
9
|
resizeStart: (e) => `Resize start of ${e}`,
|
|
10
10
|
resizeEnd: (e) => `Resize end of ${e}`
|
|
11
11
|
};
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
...
|
|
15
|
-
...
|
|
16
|
-
},
|
|
12
|
+
function l({ rows: l, selected: u, range: d, labels: f, onSelect: p, onEventChange: m }) {
|
|
13
|
+
let h = {
|
|
14
|
+
...c,
|
|
15
|
+
...f
|
|
16
|
+
}, g = e(), _ = (e, t, n) => {
|
|
17
17
|
let r = e.currentTarget.closest(".rv-timeline-control__track");
|
|
18
|
-
r && (e.preventDefault(), e.currentTarget.setPointerCapture?.(e.pointerId),
|
|
18
|
+
r && (e.preventDefault(), e.currentTarget.setPointerCapture?.(e.pointerId), g.current = {
|
|
19
19
|
id: t.id,
|
|
20
20
|
mode: n,
|
|
21
21
|
clientX: e.clientX,
|
|
22
22
|
event: t.event,
|
|
23
23
|
width: r.getBoundingClientRect().width
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
let t =
|
|
24
|
+
}, p(t.id));
|
|
25
|
+
}, v = (e) => {
|
|
26
|
+
let t = g.current;
|
|
27
27
|
if (!t) return;
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
},
|
|
28
|
+
let n = a(d), r = (e.clientX - t.clientX) / Math.max(1, t.width) * (d.end - d.start), s = Math.round(r / n) * n, c = t.mode === "move" ? i(t.event, s, d) : o(t.event, t.mode, s, d);
|
|
29
|
+
m(t.id, c);
|
|
30
|
+
}, y = () => {
|
|
31
|
+
g.current = void 0;
|
|
32
|
+
}, b = (e, t, n) => {
|
|
33
33
|
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
34
34
|
e.preventDefault();
|
|
35
|
-
let
|
|
36
|
-
|
|
35
|
+
let r = a(d) * (e.key === "ArrowLeft" ? -1 : 1);
|
|
36
|
+
m(t.id, n === "move" ? i(t.event, r, d) : o(t.event, n, r, d));
|
|
37
37
|
};
|
|
38
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ t("div", {
|
|
39
39
|
class: "rv-timeline-editor__track rv-timeline-control__track",
|
|
40
40
|
role: "group",
|
|
41
|
-
"aria-label":
|
|
41
|
+
"aria-label": h.preview,
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ t("span", {
|
|
44
44
|
class: "rv-timeline-editor__range rv-timeline-editor__range--start rv-timeline-control__range rv-timeline-control__range--start",
|
|
45
|
-
children:
|
|
45
|
+
children: d.start
|
|
46
46
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ t("span", {
|
|
48
48
|
class: "rv-timeline-editor__range rv-timeline-editor__range--end rv-timeline-control__range rv-timeline-control__range--end",
|
|
49
|
-
children:
|
|
49
|
+
children: d.end
|
|
50
50
|
}),
|
|
51
|
-
|
|
51
|
+
l.map((e, t) => ({
|
|
52
52
|
row: e,
|
|
53
53
|
index: t
|
|
54
|
-
})).filter(({ row: e }) => Number.isFinite(e.event.start) && Number.isFinite(e.event.end) && e.event.end >= e.event.start).map(({ row:
|
|
55
|
-
let
|
|
56
|
-
return /* @__PURE__ */
|
|
54
|
+
})).filter(({ row: e }) => Number.isFinite(e.event.start) && Number.isFinite(e.event.end) && e.event.end >= e.event.start).map(({ row: e, index: i }) => {
|
|
55
|
+
let a = s(e.event, d), o = r(e.event, d), c = e.event.label || h.moveEvent(i + 1);
|
|
56
|
+
return /* @__PURE__ */ t("div", {
|
|
57
57
|
class: [
|
|
58
58
|
"rv-timeline-editor__bar rv-timeline-control__bar",
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
u === e.id ? "rv-timeline-editor__bar--selected rv-timeline-control__bar--selected" : "",
|
|
60
|
+
e.event.start === e.event.end ? "rv-timeline-editor__bar--milestone rv-timeline-control__bar--milestone" : "",
|
|
61
61
|
o ? "rv-timeline-editor__bar--outside rv-timeline-control__bar--outside" : ""
|
|
62
62
|
].filter(Boolean).join(" "),
|
|
63
63
|
style: {
|
|
64
|
-
left: `${
|
|
65
|
-
width: `${
|
|
64
|
+
left: `${a.left}%`,
|
|
65
|
+
width: `${a.width}%`
|
|
66
66
|
},
|
|
67
67
|
role: "group",
|
|
68
|
-
"aria-label":
|
|
68
|
+
"aria-label": c,
|
|
69
69
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ t(n, {
|
|
71
71
|
unstyled: !0,
|
|
72
72
|
type: "button",
|
|
73
73
|
class: "rv-timeline-editor__bar-move rv-timeline-control__bar-move",
|
|
74
|
-
"data-autofocus":
|
|
75
|
-
"aria-label":
|
|
74
|
+
"data-autofocus": i === 0 ? "" : void 0,
|
|
75
|
+
"aria-label": e.event.label ? `${h.moveEvent(i + 1)}: ${e.event.label}` : h.moveEvent(i + 1),
|
|
76
76
|
"aria-keyshortcuts": "ArrowLeft ArrowRight",
|
|
77
|
-
onFocus: () =>
|
|
78
|
-
onPointerDown: (
|
|
79
|
-
onPointerMove:
|
|
80
|
-
onPointerUp:
|
|
81
|
-
onPointerCancel:
|
|
82
|
-
onKeyDown: (
|
|
83
|
-
children: /* @__PURE__ */
|
|
77
|
+
onFocus: () => p(e.id),
|
|
78
|
+
onPointerDown: (t) => _(t, e, "move"),
|
|
79
|
+
onPointerMove: v,
|
|
80
|
+
onPointerUp: y,
|
|
81
|
+
onPointerCancel: y,
|
|
82
|
+
onKeyDown: (t) => b(t, e, "move"),
|
|
83
|
+
children: /* @__PURE__ */ t("span", {
|
|
84
84
|
class: "rv-timeline-editor__bar-label rv-timeline-control__bar-label",
|
|
85
|
-
children:
|
|
85
|
+
children: e.event.label
|
|
86
86
|
})
|
|
87
87
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ t(n, {
|
|
89
89
|
unstyled: !0,
|
|
90
90
|
type: "button",
|
|
91
91
|
class: "rv-timeline-editor__handle rv-timeline-editor__handle--start rv-timeline-control__handle rv-timeline-control__handle--start",
|
|
92
92
|
role: "slider",
|
|
93
93
|
"aria-orientation": "horizontal",
|
|
94
|
-
"aria-label":
|
|
95
|
-
"aria-valuemin": Math.min(
|
|
96
|
-
"aria-valuemax":
|
|
97
|
-
"aria-valuenow":
|
|
94
|
+
"aria-label": h.resizeStart(c),
|
|
95
|
+
"aria-valuemin": Math.min(d.start, e.event.start),
|
|
96
|
+
"aria-valuemax": e.event.end,
|
|
97
|
+
"aria-valuenow": e.event.start,
|
|
98
98
|
"aria-keyshortcuts": "ArrowLeft ArrowRight",
|
|
99
|
-
onFocus: () =>
|
|
100
|
-
onPointerDown: (
|
|
101
|
-
|
|
99
|
+
onFocus: () => p(e.id),
|
|
100
|
+
onPointerDown: (t) => {
|
|
101
|
+
t.stopPropagation(), _(t, e, "start");
|
|
102
102
|
},
|
|
103
|
-
onPointerMove:
|
|
104
|
-
onPointerUp:
|
|
105
|
-
onPointerCancel:
|
|
106
|
-
onKeyDown: (
|
|
107
|
-
|
|
103
|
+
onPointerMove: v,
|
|
104
|
+
onPointerUp: y,
|
|
105
|
+
onPointerCancel: y,
|
|
106
|
+
onKeyDown: (t) => {
|
|
107
|
+
t.stopPropagation(), b(t, e, "start");
|
|
108
108
|
}
|
|
109
109
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ t(n, {
|
|
111
111
|
unstyled: !0,
|
|
112
112
|
type: "button",
|
|
113
113
|
class: "rv-timeline-editor__handle rv-timeline-editor__handle--end rv-timeline-control__handle rv-timeline-control__handle--end",
|
|
114
114
|
role: "slider",
|
|
115
115
|
"aria-orientation": "horizontal",
|
|
116
|
-
"aria-label":
|
|
117
|
-
"aria-valuemin":
|
|
118
|
-
"aria-valuemax": Math.max(
|
|
119
|
-
"aria-valuenow":
|
|
116
|
+
"aria-label": h.resizeEnd(c),
|
|
117
|
+
"aria-valuemin": e.event.start,
|
|
118
|
+
"aria-valuemax": Math.max(d.end, e.event.end),
|
|
119
|
+
"aria-valuenow": e.event.end,
|
|
120
120
|
"aria-keyshortcuts": "ArrowLeft ArrowRight",
|
|
121
|
-
onFocus: () =>
|
|
122
|
-
onPointerDown: (
|
|
123
|
-
|
|
121
|
+
onFocus: () => p(e.id),
|
|
122
|
+
onPointerDown: (t) => {
|
|
123
|
+
t.stopPropagation(), _(t, e, "end");
|
|
124
124
|
},
|
|
125
|
-
onPointerMove:
|
|
126
|
-
onPointerUp:
|
|
127
|
-
onPointerCancel:
|
|
128
|
-
onKeyDown: (
|
|
129
|
-
|
|
125
|
+
onPointerMove: v,
|
|
126
|
+
onPointerUp: y,
|
|
127
|
+
onPointerCancel: y,
|
|
128
|
+
onKeyDown: (t) => {
|
|
129
|
+
t.stopPropagation(), b(t, e, "end");
|
|
130
130
|
}
|
|
131
131
|
})
|
|
132
132
|
]
|
|
133
|
-
},
|
|
133
|
+
}, e.id);
|
|
134
134
|
})
|
|
135
135
|
]
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
//#endregion
|
|
139
|
-
export {
|
|
139
|
+
export { l as TimelineTrack, r as eventOutsideRange, i as moveTimelineEvent, a as niceTimelineStep, o as resizeTimelineEvent, s as timelineGeometry };
|
package/vue-adapter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps, ComponentType } from 'preact';
|
|
1
|
+
import { ComponentProps, ComponentType } from './_vendor/preact/src/index';
|
|
2
2
|
import { DefineComponent } from 'vue';
|
|
3
3
|
export interface VueAdapterOptions {
|
|
4
4
|
/** Maps Vue's default v-model to the existing controlled component contract. */
|