@revolist/ui 4.0.2-rc → 4.0.3-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/LICENSE +21 -0
- package/README.md +345 -263
- package/_chunks/{calendar-CpaUK7w1.js → calendar-xpZ0v3xf.js} +39 -29
- package/_chunks/{chart-frame-BC99KjGa.js → chart-frame-Cmc7xU1i.js} +16 -13
- package/_chunks/{choice-chips-Cs4D-3nH.js → choice-chips-CHQTUdLs.js} +10 -10
- package/_chunks/clock-BOhPNlW3.js +4 -0
- package/_chunks/{color-palette-BBMFmUNA.js → color-palette-D8vyPfld.js} +1 -1
- package/_chunks/{color-picker-D90Jg-M8.js → color-picker-CudqPYZo.js} +10 -10
- package/_chunks/{component-YDcfoOLz.js → component-C_T2VN5u.js} +182 -178
- package/_chunks/{component-metadata-BENbgTjU.js → component-metadata-BMOOmqx5.js} +0 -4
- package/_chunks/control-AHKXD5Eu.js +93 -0
- package/_chunks/{control-tooltip-ztgmsG7H.js → control-tooltip-uscKfAnV.js} +15 -15
- package/_chunks/{controls-DIum-E66.js → controls-DsNi8V8I.js} +144 -129
- package/_chunks/{date-control-BJSzu79z.js → date-control-DrVFX13g.js} +1 -1
- package/_chunks/{date-time-BxPJusp9.js → date-time-qIhp5vaX.js} +143 -145
- package/_chunks/{delete-button-Bblyah10.js → delete-button-CW9vjLnk.js} +6 -6
- package/_chunks/{dialog.parts-DBqo3Qwb.js → dialog.parts-CKGkC5zP.js} +20 -20
- package/_chunks/{duration-87U2EoMS.js → duration-CL68Em0o.js} +16 -15
- package/_chunks/{editor-popup-D3JdS8l3.js → editor-popup-WDdtVDNA.js} +5 -5
- package/_chunks/field-context-D57PnBbH.js +5 -0
- package/_chunks/{framework-mount-C-Zwm44H.js → framework-mount--RTLIqE-.js} +1 -1
- package/_chunks/history-controls-B3u3INEK.js +27 -0
- package/_chunks/mount-DQ1cpppK.js +257 -0
- package/_chunks/native-control-C_yok8_-.js +605 -0
- package/_chunks/{number-input-BeIadZuL.js → number-input-BKwA5FnM.js} +2 -2
- package/_chunks/{picker-DpP7iQLA.js → picker-h1P5RUgp.js} +2 -2
- package/_chunks/popup-CT2uD3go.js +367 -0
- package/_chunks/{rating-choice-Ca8ZBty3.js → rating-choice-DZgmaic0.js} +1 -1
- package/_chunks/render-m5eMMwFR.js +83 -0
- package/_chunks/{reorder-list-Cc3KmfAN.js → reorder-list-CSlqAGHw.js} +1 -1
- package/_chunks/request-trail-DSlFix6i.js +618 -0
- package/_chunks/rich-text-CH7gIqOS.js +636 -0
- package/_chunks/rotate-right-Iha5ScJ1.js +4 -0
- package/_form.scss +1 -1
- package/ai/_chat.scss +195 -0
- package/ai/_style.scss +105 -34
- package/ai/chat.d.ts +63 -0
- package/ai/components.d.ts +19 -3
- package/ai/index.d.ts +2 -0
- package/ai/index.js +3 -3
- package/ai/mount.d.ts +30 -1
- package/ai/prompt-history.d.ts +13 -0
- package/ai/transcript.d.ts +25 -0
- package/ai/translations.d.ts +1 -1
- package/angular/angular.js +0 -3
- package/assignee/index.js +34 -35
- package/buttons/delete-button.d.ts +2 -1
- package/buttons/delete-button.js +1 -1
- package/buttons/remove-button.js +1 -1
- package/buttons/svg-button.d.ts +1 -0
- package/buttons/svg-button.js +5 -5
- package/calendar/_calendar.scss +7 -2
- package/calendar/calendar.js +1 -1
- package/calendar/index.js +2 -2
- package/choice-chips/index.js +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-picker.js +2 -2
- package/component-catalog.d.ts +16 -5
- package/control-attributes.js +7 -7
- package/controls.d.ts +8 -6
- package/controls.js +3 -3
- package/core/editor-popup.js +1 -1
- package/date-time/index.js +1 -1
- package/date-time/style.scss +4 -4
- package/dialog/dialog.dom.js +8 -8
- package/dialog/dialog.parts.js +1 -1
- package/distribution-chart/area-chart.js +1 -1
- package/distribution-chart/bar-chart.d.ts +5 -2
- package/distribution-chart/bar-chart.js +7 -3
- package/distribution-chart/chart-frame.d.ts +2 -1
- package/distribution-chart/line-chart.js +1 -1
- package/dropdown/content.d.ts +2 -1
- package/dropdown/content.js +1 -142
- package/dropdown/control.d.ts +14 -0
- package/dropdown/control.js +1 -0
- package/dropdown/control.view.d.ts +6 -0
- package/dropdown/dropdown.types.d.ts +4 -0
- package/dropdown/editor-dropdown.style.scss +37 -9
- package/dropdown/index.d.ts +1 -1
- package/dropdown/index.js +3 -4
- package/dropdown/lookup-field.js +1 -1
- package/dropdown/popup.js +1 -141
- package/duration/index.js +1 -1
- package/duration/style.scss +1 -1
- package/editor-actions.js +1 -1
- package/field-configurator.js +6 -6
- package/fieldset.d.ts +3 -0
- package/filter/filters/slider/single.js +1 -1
- package/filter-badge.js +1 -1
- package/filter-controls.js +7 -7
- package/form-controls/field-context.d.ts +5 -0
- package/form-controls/index.js +7 -12
- package/form-controls/index.view.d.ts +2 -4
- package/form-controls/presentation.js +51 -43
- package/formatting/index.js +25 -21
- package/framework.js +215 -207
- package/history-controls.d.ts +14 -0
- package/history-controls.js +1 -0
- package/masked-input/index.js +1 -1
- package/native-control.d.ts +6 -4
- package/native-control.js +3 -26
- package/native-styles.css +1 -1
- package/native.js +31 -30
- package/number-input/index.js +1 -1
- package/package.json +18 -13
- package/pagination.d.ts +3 -0
- package/pagination.js +43 -33
- package/pdf-viewer/index.js +1 -1
- package/pdf-viewer/style.scss +3 -4
- package/preact.d.ts +2 -0
- package/preact.js +62 -62
- package/rating-choice.js +1 -1
- package/react-control.d.ts +0 -1
- package/react-control.js +2 -2
- package/react.d.ts +13 -3
- package/react.js +71 -88
- package/reorder-list.js +1 -1
- package/resource-picker/resource-picker-popup.js +1 -1
- package/resource-picker/resource-picker.js +4 -4
- package/resource-picker/resource-picker.scss +6 -3
- package/rich-text/engine.d.ts +16 -19
- package/rich-text/index.d.ts +7 -7
- package/rich-text/index.js +1 -1
- package/rich-text/model.d.ts +4 -3
- package/rich-text/render-model.d.ts +4 -5
- package/rich-text/style.scss +3 -12
- package/rich-text/toolbar.d.ts +6 -6
- package/rich-text/translations.d.ts +3 -15
- package/select.d.ts +20 -0
- package/select.js +1 -0
- package/status-feedback/exit-snapshot.js +4 -4
- package/status-feedback/index.js +2 -2
- package/status-feedback/popover.js +10 -10
- package/status-feedback/render.js +3 -44
- package/status-feedback/status-feedback.scss +7 -0
- package/status-feedback/types.d.ts +4 -0
- package/status-feedback/use-auto-dismiss.d.ts +3 -0
- package/styles/_compositions.scss +3 -1
- package/styles/_control.scss +12 -4
- package/styles/_primitives.scss +9 -8
- package/styles.css +1 -1
- package/surfaces.js +45 -45
- package/svelte/UiComponent.server.js +1 -48
- package/svelte/UiComponent.svelte +0 -21
- package/svelte.js +33 -68
- package/time-grid.js +1 -1
- package/timeline-track/component.d.ts +5 -1
- package/timeline-track/index.js +71 -54
- package/timeline-track/model.d.ts +9 -0
- package/timeline-track/model.js +10 -1
- package/ui.css +1 -1
- package/vue.d.ts +24 -5
- package/vue.js +140 -164
- package/_chunks/compat.module-DDB2pm9O.js +0 -229
- package/_chunks/dropdown-voWqmwAe.js +0 -357
- package/_chunks/mount-DZe_6VtR.js +0 -90
- package/_chunks/request-trail-IdNiFvKH.js +0 -347
- package/_chunks/rich-text-BzI1DyfF.js +0 -477
- package/react-native-select.d.ts +0 -6
- package/rich-text/syntax.d.ts +0 -2
- package/vue-native-select.d.ts +0 -9
package/surfaces.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { calculateAnchoredPopoverPosition as e } from "./core/anchored-popover.js";
|
|
2
2
|
import { t } from "./_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { inheritUiMotion as n } from "./core/motion.js";
|
|
4
|
+
import { hideTopLayerPopup as r, showTopLayerPopup as i } from "./core/top-layer-popup.js";
|
|
5
|
+
import { createPreactElement as a, releasePreactElement as o } from "./preact-mount.js";
|
|
6
|
+
import { createControlId as s } from "./core/control-id.js";
|
|
7
7
|
import { createDialogElements as c, getDialogFocusableElements as l, trapDialogFocus as u } from "./dialog/dialog.dom.js";
|
|
8
8
|
import { attachDialogDrag as d } from "./dialog/dialog.drag.js";
|
|
9
9
|
//#region src/surfaces.view.tsx
|
|
@@ -19,23 +19,23 @@ var f = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), m = cl
|
|
|
19
19
|
}
|
|
20
20
|
open(e) {
|
|
21
21
|
this.close();
|
|
22
|
-
let t = this.document,
|
|
22
|
+
let t = this.document, r = t.activeElement, i = !1, a, s, f = p.get(t) ?? [];
|
|
23
23
|
p.set(t, f);
|
|
24
24
|
let m = () => {
|
|
25
25
|
if (i) return;
|
|
26
|
-
i = !0, a?.(),
|
|
27
|
-
let t = f.indexOf(h.root),
|
|
26
|
+
i = !0, a?.(), s?.(), o(h.root);
|
|
27
|
+
let t = f.indexOf(h.root), n = t === f.length - 1;
|
|
28
28
|
t !== -1 && f.splice(t, 1), this.active?.root === h.root && (this.active = void 0);
|
|
29
29
|
try {
|
|
30
30
|
e.onClose?.();
|
|
31
31
|
} finally {
|
|
32
|
-
|
|
32
|
+
n && (this.environment.restoreFocus ? this.environment.restoreFocus(e.returnFocus, r ?? void 0) : [e.returnFocus, r].find((e) => e?.isConnected)?.focus?.({ preventScroll: !0 }));
|
|
33
33
|
}
|
|
34
34
|
}, h = c(t, e, m), g = {
|
|
35
35
|
...h,
|
|
36
36
|
close: m
|
|
37
37
|
};
|
|
38
|
-
return this.environment.beforeMount?.(h.root),
|
|
38
|
+
return this.environment.beforeMount?.(h.root), s = n(e.returnFocus ?? r, h.root), h.root.addEventListener("mousedown", (e) => {
|
|
39
39
|
e.target === h.root && f.at(-1) === h.root && m();
|
|
40
40
|
}), h.root.addEventListener("keydown", (e) => {
|
|
41
41
|
f.at(-1) === h.root && (e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), m()) : e.key === "Tab" && u(h.root, e));
|
|
@@ -59,44 +59,44 @@ var f = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), m = cl
|
|
|
59
59
|
}
|
|
60
60
|
open(t) {
|
|
61
61
|
this.close(!1);
|
|
62
|
-
let { anchor:
|
|
63
|
-
f.set(
|
|
64
|
-
let u =
|
|
65
|
-
if (!
|
|
62
|
+
let { anchor: a, content: o } = t, s = a.ownerDocument, c = s.defaultView, l = f.get(s) ?? [];
|
|
63
|
+
f.set(s, l);
|
|
64
|
+
let u = o.parentNode, d = o.nextSibling, p = o.hidden, m = o.getAttribute("style"), h = o.getAttribute("popover"), g = n(a, o), _ = () => {
|
|
65
|
+
if (!a.isConnected) {
|
|
66
66
|
b(!1);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
let t = e(
|
|
70
|
-
width:
|
|
71
|
-
height:
|
|
69
|
+
let t = e(a.getBoundingClientRect(), o.getBoundingClientRect(), {
|
|
70
|
+
width: s.documentElement.clientWidth || c?.innerWidth || 0,
|
|
71
|
+
height: s.documentElement.clientHeight || c?.innerHeight || 0
|
|
72
72
|
});
|
|
73
|
-
Object.assign(
|
|
73
|
+
Object.assign(o.style, {
|
|
74
74
|
left: `${t.left}px`,
|
|
75
75
|
top: `${t.top}px`
|
|
76
76
|
});
|
|
77
77
|
}, v, y = !1, b = (e = t.restoreFocus !== !1) => {
|
|
78
78
|
if (y) return;
|
|
79
|
-
y = !0,
|
|
80
|
-
let
|
|
81
|
-
|
|
79
|
+
y = !0, s.removeEventListener("pointerdown", x, !0), o.removeEventListener("keydown", S), s.removeEventListener("keydown", S), c?.removeEventListener("resize", _), s.removeEventListener("scroll", _, !0), C?.disconnect();
|
|
80
|
+
let n = l.indexOf(o);
|
|
81
|
+
n !== -1 && l.splice(n, 1), r(o, v), g(), u?.isConnected ? u.insertBefore(o, d?.parentNode === u ? d : null) : o.remove(), m === null ? o.removeAttribute("style") : o.setAttribute("style", m), o.hidden = p, h === null ? o.removeAttribute("popover") : o.setAttribute("popover", h), this.active?.content === o && (this.active = void 0), e && a.isConnected && a.focus({ preventScroll: !0 }), t.onClose?.();
|
|
82
82
|
}, x = (e) => {
|
|
83
|
-
if (l.at(-1) !==
|
|
84
|
-
let
|
|
85
|
-
t.closeOnOutside !== !1 && !
|
|
83
|
+
if (l.at(-1) !== o) return;
|
|
84
|
+
let n = e.composedPath();
|
|
85
|
+
t.closeOnOutside !== !1 && !n.includes(a) && !n.includes(o) && b(!1);
|
|
86
86
|
}, S = (e) => {
|
|
87
|
-
l.at(-1) ===
|
|
87
|
+
l.at(-1) === o && e.key === "Escape" && t.closeOnEscape !== !1 && !e.defaultPrevented && (e.preventDefault(), e.stopPropagation(), b());
|
|
88
88
|
};
|
|
89
|
-
(t.appendTo ??
|
|
89
|
+
(t.appendTo ?? s.body).append(o), o.hidden = !1, Object.assign(o.style, {
|
|
90
90
|
position: "fixed",
|
|
91
91
|
inset: "auto",
|
|
92
92
|
margin: "0"
|
|
93
|
-
}), v = o
|
|
93
|
+
}), v = i(o, t.display ?? "block");
|
|
94
94
|
let C = c?.ResizeObserver ? new c.ResizeObserver(_) : void 0;
|
|
95
|
-
return C?.observe(
|
|
96
|
-
content:
|
|
95
|
+
return C?.observe(a), C?.observe(o), this.active = {
|
|
96
|
+
content: o,
|
|
97
97
|
close: b,
|
|
98
98
|
position: _
|
|
99
|
-
}, l.push(
|
|
99
|
+
}, l.push(o), s.addEventListener("pointerdown", x, !0), o.addEventListener("keydown", S), s.addEventListener("keydown", S), c?.addEventListener("resize", _), s.addEventListener("scroll", _, !0), _(), {
|
|
100
100
|
close: b,
|
|
101
101
|
refresh: _
|
|
102
102
|
};
|
|
@@ -111,10 +111,10 @@ var f = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), m = cl
|
|
|
111
111
|
this.close(!1);
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
|
-
function g(e,
|
|
115
|
-
return
|
|
116
|
-
id:
|
|
117
|
-
class:
|
|
114
|
+
function g(e, n = "grid-tooltip") {
|
|
115
|
+
return a(e, /* @__PURE__ */ t("div", {
|
|
116
|
+
id: s("rv-tooltip"),
|
|
117
|
+
class: n,
|
|
118
118
|
role: "tooltip",
|
|
119
119
|
hidden: !0
|
|
120
120
|
}));
|
|
@@ -124,26 +124,26 @@ var _ = /* @__PURE__ */ new WeakMap(), v = class {
|
|
|
124
124
|
release;
|
|
125
125
|
bind(e, t, n = {}) {
|
|
126
126
|
this.destroy();
|
|
127
|
-
let
|
|
128
|
-
|
|
129
|
-
let
|
|
130
|
-
_.get(e.ownerDocument) ===
|
|
131
|
-
},
|
|
132
|
-
|
|
127
|
+
let r = g(e.ownerDocument, "rv-tooltip");
|
|
128
|
+
r.textContent = t;
|
|
129
|
+
let i = () => {
|
|
130
|
+
_.get(e.ownerDocument) === a && _.delete(e.ownerDocument);
|
|
131
|
+
}, a = () => {
|
|
132
|
+
i(), this.popover.close(!1), r.hidden = !0, e.setAttribute("aria-describedby", s ?? ""), s === null && e.removeAttribute("aria-describedby");
|
|
133
133
|
}, s = e.getAttribute("aria-describedby"), c = n.trigger === "click", l = e.getAttribute("aria-expanded");
|
|
134
134
|
c && e.setAttribute("aria-expanded", "false");
|
|
135
135
|
let u = () => {
|
|
136
|
-
this.popover.isOpen || (_.get(e.ownerDocument)?.(), _.set(e.ownerDocument,
|
|
136
|
+
this.popover.isOpen || (_.get(e.ownerDocument)?.(), _.set(e.ownerDocument, a), r.hidden = !1, c && e.setAttribute("aria-expanded", "true"), e.setAttribute("aria-describedby", [s, r.id].filter(Boolean).join(" ")), this.popover.open({
|
|
137
137
|
anchor: e,
|
|
138
|
-
content:
|
|
138
|
+
content: r,
|
|
139
139
|
restoreFocus: !1,
|
|
140
140
|
onClose: () => {
|
|
141
|
-
|
|
141
|
+
i(), r.hidden = !0, c && e.setAttribute("aria-expanded", "false"), s === null ? e.removeAttribute("aria-describedby") : e.setAttribute("aria-describedby", s);
|
|
142
142
|
}
|
|
143
143
|
}));
|
|
144
|
-
}, d = () => this.popover.isOpen ?
|
|
145
|
-
return c ? e.addEventListener("click", d) : (e.addEventListener("pointerenter", u), e.addEventListener("pointerleave",
|
|
146
|
-
|
|
144
|
+
}, d = () => this.popover.isOpen ? a() : u();
|
|
145
|
+
return c ? e.addEventListener("click", d) : (e.addEventListener("pointerenter", u), e.addEventListener("pointerleave", a), e.addEventListener("focus", u), e.addEventListener("blur", a)), this.release = () => {
|
|
146
|
+
a(), e.removeEventListener("click", d), c && (l === null ? e.removeAttribute("aria-expanded") : e.setAttribute("aria-expanded", l)), e.removeEventListener("pointerenter", u), e.removeEventListener("pointerleave", a), e.removeEventListener("focus", u), e.removeEventListener("blur", a), o(r);
|
|
147
147
|
}, () => this.destroy();
|
|
148
148
|
}
|
|
149
149
|
destroy() {
|
|
@@ -8,8 +8,6 @@ import {
|
|
|
8
8
|
withFrameworkContent
|
|
9
9
|
} from '../framework.js';
|
|
10
10
|
|
|
11
|
-
import { controlAttributes } from '../control-attributes.js';
|
|
12
|
-
|
|
13
11
|
export default function UiComponent($$renderer, $$props) {
|
|
14
12
|
$$renderer.component(($$renderer) => {
|
|
15
13
|
let {
|
|
@@ -47,52 +45,7 @@ export default function UiComponent($$renderer, $$props) {
|
|
|
47
45
|
};
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
|
|
51
|
-
props.onChange?.(event);
|
|
52
|
-
|
|
53
|
-
if (event.defaultPrevented) return;
|
|
54
|
-
|
|
55
|
-
const value = event.currentTarget.value;
|
|
56
|
-
|
|
57
|
-
props.onValueChange?.(value);
|
|
58
|
-
onValueChange?.(value);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
let selectProps = $.derived(() => {
|
|
62
|
-
const { onChange, onValueChange, ...rest } = props;
|
|
63
|
-
|
|
64
|
-
return controlAttributes('select', rest);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
$$renderer.push(`<span style="display: contents"${$.attr('data-rv-svelte-host', component)}></span> `);
|
|
68
|
-
|
|
69
|
-
if (component === 'NativeSelect') {
|
|
70
|
-
$$renderer.push('<!--[0-->');
|
|
71
|
-
|
|
72
|
-
$$renderer.select(
|
|
73
|
-
{ ...selectProps(), onchange: nativeChange },
|
|
74
|
-
($$renderer) => {
|
|
75
|
-
if (children) {
|
|
76
|
-
$$renderer.push('<!--[0-->');
|
|
77
|
-
children($$renderer, {});
|
|
78
|
-
$$renderer.push(`<!---->`);
|
|
79
|
-
} else {
|
|
80
|
-
$$renderer.push('<!--[-1-->');
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
$$renderer.push(`<!--]-->`);
|
|
84
|
-
},
|
|
85
|
-
void 0,
|
|
86
|
-
void 0,
|
|
87
|
-
void 0,
|
|
88
|
-
void 0,
|
|
89
|
-
true
|
|
90
|
-
);
|
|
91
|
-
} else {
|
|
92
|
-
$$renderer.push('<!--[-1-->');
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
$$renderer.push(`<!--]--> <!--[-->`);
|
|
48
|
+
$$renderer.push(`<span style="display: contents"${$.attr('data-rv-svelte-host', component)}></span> <!--[-->`);
|
|
96
49
|
|
|
97
50
|
const each_array = $.ensure_array_like(targets);
|
|
98
51
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount, untrack, type Snippet } from 'svelte';
|
|
3
3
|
import { uiComponents, componentModels, createFrameworkMount, withFrameworkContent, type UiContentTarget, type UiFrameworkMount } from '../framework';
|
|
4
|
-
import { controlAttributes } from '../control-attributes';
|
|
5
4
|
import type { SvelteUiProps } from '../svelte-props';
|
|
6
5
|
|
|
7
6
|
let { component, props = {}, children, slots = {}, onValueChange, onUiEvent }: SvelteUiProps = $props();
|
|
@@ -21,10 +20,6 @@
|
|
|
21
20
|
const change = onValueChange;
|
|
22
21
|
const event = onUiEvent;
|
|
23
22
|
const renderer = mount;
|
|
24
|
-
if (name === 'NativeSelect') {
|
|
25
|
-
untrack(() => { renderer?.render(() => null, {}); });
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
23
|
const model = componentModels[name];
|
|
29
24
|
const callbacks = new Set([...Object.keys(next).filter(key => /^on[A-Z]/.test(key)),
|
|
30
25
|
'onClose', ...(model ? [model.callback] : [])]);
|
|
@@ -44,25 +39,9 @@
|
|
|
44
39
|
target.appendChild(node);
|
|
45
40
|
return { update(next: HTMLElement) { next.appendChild(node); } };
|
|
46
41
|
}
|
|
47
|
-
function nativeChange(event: Event) {
|
|
48
|
-
props.onChange?.(event);
|
|
49
|
-
if (event.defaultPrevented) return;
|
|
50
|
-
const value = (event.currentTarget as HTMLSelectElement).value;
|
|
51
|
-
props.onValueChange?.(value);
|
|
52
|
-
onValueChange?.(value);
|
|
53
|
-
}
|
|
54
|
-
let selectProps = $derived.by(() => {
|
|
55
|
-
const { onChange, onValueChange, ...rest } = props;
|
|
56
|
-
return controlAttributes('select', rest);
|
|
57
|
-
});
|
|
58
42
|
</script>
|
|
59
43
|
|
|
60
44
|
<span bind:this={host} style="display: contents" data-rv-svelte-host={component}></span>
|
|
61
|
-
{#if component === 'NativeSelect'}
|
|
62
|
-
<select {...selectProps} onchange={nativeChange}>
|
|
63
|
-
{#if children}{@render children({})}{/if}
|
|
64
|
-
</select>
|
|
65
|
-
{/if}
|
|
66
45
|
{#each targets as target (target.id)}
|
|
67
46
|
<span use:portal={target.element} style="display: contents" data-rv-svelte-content>
|
|
68
47
|
{@render target.content(target.scope)}
|
package/svelte.js
CHANGED
|
@@ -1,93 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { uiComponents as a } from "./framework.js";
|
|
1
|
+
import { i as e } from "./_chunks/component-C_T2VN5u.js";
|
|
2
|
+
import { t } from "./_chunks/component-metadata-BMOOmqx5.js";
|
|
3
|
+
import { n, t as r } from "./_chunks/framework-mount--RTLIqE-.js";
|
|
4
|
+
import { uiComponents as i } from "./framework.js";
|
|
6
5
|
import "svelte/internal/disclose-version";
|
|
7
|
-
import * as
|
|
8
|
-
import { onMount as
|
|
6
|
+
import * as a from "svelte/internal/client";
|
|
7
|
+
import { onMount as o, untrack as s } from "svelte";
|
|
9
8
|
//#region src/svelte/UiComponent.svelte
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
let e =
|
|
16
|
-
|
|
9
|
+
var c = a.from_html("<span style=\"display: contents\" data-rv-svelte-content=\"\"><!></span>"), l = a.from_html("<span style=\"display: contents\"></span> <!>", 1);
|
|
10
|
+
function u(e, u) {
|
|
11
|
+
a.push(u, !0);
|
|
12
|
+
let d = a.prop(u, "props", 19, () => ({})), f = a.prop(u, "slots", 19, () => ({})), p, m = a.state([]), h = a.state(void 0);
|
|
13
|
+
o(() => {
|
|
14
|
+
let e = r(p, (e) => {
|
|
15
|
+
a.set(m, e);
|
|
17
16
|
});
|
|
18
|
-
return
|
|
17
|
+
return a.set(h, e), () => {
|
|
19
18
|
e.destroy();
|
|
20
19
|
};
|
|
21
|
-
}),
|
|
22
|
-
let e = { ...
|
|
23
|
-
...
|
|
24
|
-
...
|
|
25
|
-
},
|
|
26
|
-
if (t === "NativeSelect") {
|
|
27
|
-
c(() => {
|
|
28
|
-
u?.render(() => null, {});
|
|
29
|
-
});
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
let d = n[t], f = /* @__PURE__ */ new Set([
|
|
20
|
+
}), a.user_effect(() => {
|
|
21
|
+
let e = { ...d() }, r = u.component, o = {
|
|
22
|
+
...f(),
|
|
23
|
+
...u.children ? { default: u.children } : {}
|
|
24
|
+
}, c = u.onValueChange, l = u.onUiEvent, p = a.get(h), m = t[r], g = /* @__PURE__ */ new Set([
|
|
33
25
|
...Object.keys(e).filter((e) => /^on[A-Z]/.test(e)),
|
|
34
26
|
"onClose",
|
|
35
|
-
...
|
|
27
|
+
...m ? [m.callback] : []
|
|
36
28
|
]);
|
|
37
|
-
for (let t of
|
|
29
|
+
for (let t of g) {
|
|
38
30
|
let n = e[t];
|
|
39
31
|
e[t] = (...e) => {
|
|
40
32
|
let r = n?.(...e);
|
|
41
|
-
return t ===
|
|
33
|
+
return t === m?.callback && c?.(e[0]), l?.({
|
|
42
34
|
name: t,
|
|
43
35
|
args: e
|
|
44
36
|
}), r;
|
|
45
37
|
};
|
|
46
38
|
}
|
|
47
|
-
|
|
39
|
+
s(() => p?.render(i[r], e, (e, t) => n(r, e, o, t)));
|
|
48
40
|
});
|
|
49
|
-
function
|
|
41
|
+
function g(e, t) {
|
|
50
42
|
return t.appendChild(e), { update(t) {
|
|
51
43
|
t.appendChild(e);
|
|
52
44
|
} };
|
|
53
45
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return e("select", r);
|
|
62
|
-
});
|
|
63
|
-
var S = f(), C = o.first_child(S);
|
|
64
|
-
o.bind_this(C, (e) => g = e, () => g);
|
|
65
|
-
var w = o.sibling(C, 2), T = (e) => {
|
|
66
|
-
var t = u();
|
|
67
|
-
o.attribute_effect(t, () => ({
|
|
68
|
-
...o.get(x),
|
|
69
|
-
onchange: b
|
|
70
|
-
})), o.customizable_select(t, () => {
|
|
71
|
-
var e = o.child(t), n = l(), r = o.first_child(n), i = (e) => {
|
|
72
|
-
var t = o.comment(), n = o.first_child(t);
|
|
73
|
-
o.snippet(n, () => p.children, () => ({})), o.append(e, t);
|
|
74
|
-
};
|
|
75
|
-
o.if(r, (e) => {
|
|
76
|
-
p.children && e(i);
|
|
77
|
-
}), o.append(e, n);
|
|
78
|
-
}), o.append(e, t);
|
|
79
|
-
};
|
|
80
|
-
o.if(w, (e) => {
|
|
81
|
-
p.component === "NativeSelect" && e(T);
|
|
82
|
-
});
|
|
83
|
-
var E = o.sibling(w, 2);
|
|
84
|
-
o.each(E, 17, () => o.get(_), (e) => e.id, (e, t) => {
|
|
85
|
-
var n = d(), r = o.child(n);
|
|
86
|
-
o.snippet(r, () => o.get(t).content, () => o.get(t).scope), o.reset(n), o.action(n, (e, t) => y?.(e, t), () => o.get(t).element), o.append(e, n);
|
|
87
|
-
}), o.template_effect(() => o.set_attribute(C, "data-rv-svelte-host", p.component)), o.append(t, S), o.pop();
|
|
46
|
+
var _ = l(), v = a.first_child(_);
|
|
47
|
+
a.bind_this(v, (e) => p = e, () => p);
|
|
48
|
+
var y = a.sibling(v, 2);
|
|
49
|
+
a.each(y, 17, () => a.get(m), (e) => e.id, (e, t) => {
|
|
50
|
+
var n = c(), r = a.child(n);
|
|
51
|
+
a.snippet(r, () => a.get(t).content, () => a.get(t).scope), a.reset(n), a.action(n, (e, t) => g?.(e, t), () => a.get(t).element), a.append(e, n);
|
|
52
|
+
}), a.template_effect(() => a.set_attribute(v, "data-rv-svelte-host", u.component)), a.append(e, _), a.pop();
|
|
88
53
|
}
|
|
89
54
|
//#endregion
|
|
90
55
|
//#region src/svelte.ts
|
|
91
|
-
var
|
|
56
|
+
var d = u;
|
|
92
57
|
//#endregion
|
|
93
|
-
export {
|
|
58
|
+
export { d as UiComponent, e as defaultPdfViewerText };
|
package/time-grid.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as e, t } from "./_chunks/hooks.module-CG3gN83z.js";
|
|
2
2
|
import { t as n } from "./_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
-
import {
|
|
3
|
+
import { t as r } from "./_chunks/native-control-C_yok8_-.js";
|
|
4
4
|
//#region src/time-grid.tsx
|
|
5
5
|
var i = (e, t) => `${e}:${t}`;
|
|
6
6
|
function a(e) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JSX } from '../_vendor/preact/src/index';
|
|
1
2
|
import { TimelineTrackEvent, TimelineTrackRange } from './model';
|
|
2
3
|
export type TimelineTrackPointerMode = 'move' | 'start' | 'end';
|
|
3
4
|
export interface TimelineTrackItem<T extends TimelineTrackEvent> {
|
|
@@ -12,6 +13,9 @@ export interface TimelineTrackLabels {
|
|
|
12
13
|
}
|
|
13
14
|
export interface TimelineTrackProps<T extends TimelineTrackEvent> {
|
|
14
15
|
readonly rows: readonly TimelineTrackItem<T>[];
|
|
16
|
+
readonly tooltip?: boolean;
|
|
17
|
+
readonly formatValue?: (value: number) => string;
|
|
18
|
+
readonly getTooltip?: (event: T) => string;
|
|
15
19
|
readonly selected?: string | number;
|
|
16
20
|
/** Finite bounds with end greater than start. */
|
|
17
21
|
readonly range: TimelineTrackRange;
|
|
@@ -20,4 +24,4 @@ export interface TimelineTrackProps<T extends TimelineTrackEvent> {
|
|
|
20
24
|
readonly onEventChange: (id: string | number, event: T) => void;
|
|
21
25
|
}
|
|
22
26
|
/** 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>):
|
|
27
|
+
export declare function TimelineTrack<T extends TimelineTrackEvent>({ rows, tooltip, formatValue, getTooltip, selected, range, labels, onSelect, onEventChange, }: TimelineTrackProps<T>): JSX.Element;
|
package/timeline-track/index.js
CHANGED
|
@@ -1,85 +1,91 @@
|
|
|
1
1
|
import { t as e } from "../_chunks/hooks.module-CG3gN83z.js";
|
|
2
2
|
import { t } from "../_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { t as n } from "../_chunks/native-control-C_yok8_-.js";
|
|
4
|
+
import { n as r } from "../_chunks/control-tooltip-uscKfAnV.js";
|
|
5
|
+
import { eventOutsideRange as i, moveTimelineEvent as a, niceTimelineStep as o, resizeTimelineEvent as s, timelineEventBackground as c, timelineGeometry as l } from "./model.js";
|
|
5
6
|
//#region src/timeline-track/component.tsx
|
|
6
|
-
var
|
|
7
|
+
var u = {
|
|
7
8
|
preview: "Timeline preview",
|
|
8
9
|
moveEvent: (e) => `Move event ${e}`,
|
|
9
10
|
resizeStart: (e) => `Resize start of ${e}`,
|
|
10
11
|
resizeEnd: (e) => `Resize end of ${e}`
|
|
11
12
|
};
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
...
|
|
15
|
-
...
|
|
16
|
-
},
|
|
13
|
+
function d({ rows: r, tooltip: d = !0, formatValue: p = String, getTooltip: m, selected: h, range: g, labels: _, onSelect: v, onEventChange: y }) {
|
|
14
|
+
let b = {
|
|
15
|
+
...u,
|
|
16
|
+
..._
|
|
17
|
+
}, x = e(), S = (e, t, n) => {
|
|
17
18
|
let r = e.currentTarget.closest(".rv-timeline-control__track");
|
|
18
|
-
r && (e.preventDefault(), e.currentTarget.setPointerCapture?.(e.pointerId),
|
|
19
|
+
r && (e.preventDefault(), e.currentTarget.setPointerCapture?.(e.pointerId), x.current = {
|
|
19
20
|
id: t.id,
|
|
20
21
|
mode: n,
|
|
21
22
|
clientX: e.clientX,
|
|
22
23
|
event: t.event,
|
|
23
24
|
width: r.getBoundingClientRect().width
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
let t =
|
|
25
|
+
}, v(t.id));
|
|
26
|
+
}, C = (e) => {
|
|
27
|
+
let t = x.current;
|
|
27
28
|
if (!t) return;
|
|
28
|
-
let n =
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
},
|
|
29
|
+
let n = o(g), r = (e.clientX - t.clientX) / Math.max(1, t.width) * (g.end - g.start), i = Math.round(r / n) * n, c = t.mode === "move" ? a(t.event, i, g) : s(t.event, t.mode, i, g);
|
|
30
|
+
y(t.id, c);
|
|
31
|
+
}, w = () => {
|
|
32
|
+
x.current = void 0;
|
|
33
|
+
}, T = (e, t, n) => {
|
|
33
34
|
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
34
35
|
e.preventDefault();
|
|
35
|
-
let r =
|
|
36
|
-
|
|
36
|
+
let r = o(g) * (e.key === "ArrowLeft" ? -1 : 1);
|
|
37
|
+
y(t.id, n === "move" ? a(t.event, r, g) : s(t.event, n, r, g));
|
|
37
38
|
};
|
|
38
39
|
return /* @__PURE__ */ t("div", {
|
|
39
40
|
class: "rv-timeline-editor__track rv-timeline-control__track",
|
|
40
41
|
role: "group",
|
|
41
|
-
"aria-label":
|
|
42
|
+
"aria-label": b.preview,
|
|
42
43
|
children: [
|
|
43
44
|
/* @__PURE__ */ t("span", {
|
|
44
45
|
class: "rv-timeline-editor__range rv-timeline-editor__range--start rv-timeline-control__range rv-timeline-control__range--start",
|
|
45
|
-
children:
|
|
46
|
+
children: g.start
|
|
46
47
|
}),
|
|
47
48
|
/* @__PURE__ */ t("span", {
|
|
48
49
|
class: "rv-timeline-editor__range rv-timeline-editor__range--end rv-timeline-control__range rv-timeline-control__range--end",
|
|
49
|
-
children:
|
|
50
|
+
children: g.end
|
|
50
51
|
}),
|
|
51
|
-
|
|
52
|
+
r.map((e, t) => ({
|
|
52
53
|
row: e,
|
|
53
54
|
index: t
|
|
54
|
-
})).filter(({ row: e }) => Number.isFinite(e.event.start) && Number.isFinite(e.event.end) && e.event.end >= e.event.start).map(({ row: e, index:
|
|
55
|
-
let a =
|
|
56
|
-
return /* @__PURE__ */ t(
|
|
55
|
+
})).filter(({ row: e }) => Number.isFinite(e.event.start) && Number.isFinite(e.event.end) && e.event.end >= e.event.start).map(({ row: e, index: r }) => {
|
|
56
|
+
let a = l(e.event, g), o = i(e.event, g), s = e.event.label || b.moveEvent(r + 1);
|
|
57
|
+
return /* @__PURE__ */ t(f, {
|
|
58
|
+
tooltipText: d ? m?.(e.event) ?? `${s}: ${p(e.event.start)} – ${p(e.event.end)}` : void 0,
|
|
57
59
|
class: [
|
|
58
60
|
"rv-timeline-editor__bar rv-timeline-control__bar",
|
|
59
|
-
|
|
61
|
+
h === e.id ? "rv-timeline-editor__bar--selected rv-timeline-control__bar--selected" : "",
|
|
60
62
|
e.event.start === e.event.end ? "rv-timeline-editor__bar--milestone rv-timeline-control__bar--milestone" : "",
|
|
61
63
|
o ? "rv-timeline-editor__bar--outside rv-timeline-control__bar--outside" : ""
|
|
62
64
|
].filter(Boolean).join(" "),
|
|
63
65
|
style: {
|
|
64
66
|
left: `${a.left}%`,
|
|
65
|
-
width: `${a.width}
|
|
67
|
+
width: `${a.width}%`,
|
|
68
|
+
background: c(e.event),
|
|
69
|
+
color: e.event.textColor,
|
|
70
|
+
"--timeline-event-color": e.event.color,
|
|
71
|
+
"--timeline-event-color-end": e.event.color
|
|
66
72
|
},
|
|
67
73
|
role: "group",
|
|
68
|
-
"aria-label":
|
|
74
|
+
"aria-label": s,
|
|
69
75
|
children: [
|
|
70
76
|
/* @__PURE__ */ t(n, {
|
|
71
77
|
unstyled: !0,
|
|
72
78
|
type: "button",
|
|
73
79
|
class: "rv-timeline-editor__bar-move rv-timeline-control__bar-move",
|
|
74
|
-
"data-autofocus":
|
|
75
|
-
"aria-label": e.event.label ? `${
|
|
80
|
+
"data-autofocus": r === 0 ? "" : void 0,
|
|
81
|
+
"aria-label": e.event.label ? `${b.moveEvent(r + 1)}: ${e.event.label}` : b.moveEvent(r + 1),
|
|
76
82
|
"aria-keyshortcuts": "ArrowLeft ArrowRight",
|
|
77
|
-
onFocus: () =>
|
|
78
|
-
onPointerDown: (t) =>
|
|
79
|
-
onPointerMove:
|
|
80
|
-
onPointerUp:
|
|
81
|
-
onPointerCancel:
|
|
82
|
-
onKeyDown: (t) =>
|
|
83
|
+
onFocus: () => v(e.id),
|
|
84
|
+
onPointerDown: (t) => S(t, e, "move"),
|
|
85
|
+
onPointerMove: C,
|
|
86
|
+
onPointerUp: w,
|
|
87
|
+
onPointerCancel: w,
|
|
88
|
+
onKeyDown: (t) => T(t, e, "move"),
|
|
83
89
|
children: /* @__PURE__ */ t("span", {
|
|
84
90
|
class: "rv-timeline-editor__bar-label rv-timeline-control__bar-label",
|
|
85
91
|
children: e.event.label
|
|
@@ -91,20 +97,20 @@ function l({ rows: l, selected: u, range: d, labels: f, onSelect: p, onEventChan
|
|
|
91
97
|
class: "rv-timeline-editor__handle rv-timeline-editor__handle--start rv-timeline-control__handle rv-timeline-control__handle--start",
|
|
92
98
|
role: "slider",
|
|
93
99
|
"aria-orientation": "horizontal",
|
|
94
|
-
"aria-label":
|
|
95
|
-
"aria-valuemin": Math.min(
|
|
100
|
+
"aria-label": b.resizeStart(s),
|
|
101
|
+
"aria-valuemin": Math.min(g.start, e.event.start),
|
|
96
102
|
"aria-valuemax": e.event.end,
|
|
97
103
|
"aria-valuenow": e.event.start,
|
|
98
104
|
"aria-keyshortcuts": "ArrowLeft ArrowRight",
|
|
99
|
-
onFocus: () =>
|
|
105
|
+
onFocus: () => v(e.id),
|
|
100
106
|
onPointerDown: (t) => {
|
|
101
|
-
t.stopPropagation(),
|
|
107
|
+
t.stopPropagation(), S(t, e, "start");
|
|
102
108
|
},
|
|
103
|
-
onPointerMove:
|
|
104
|
-
onPointerUp:
|
|
105
|
-
onPointerCancel:
|
|
109
|
+
onPointerMove: C,
|
|
110
|
+
onPointerUp: w,
|
|
111
|
+
onPointerCancel: w,
|
|
106
112
|
onKeyDown: (t) => {
|
|
107
|
-
t.stopPropagation(),
|
|
113
|
+
t.stopPropagation(), T(t, e, "start");
|
|
108
114
|
}
|
|
109
115
|
}),
|
|
110
116
|
/* @__PURE__ */ t(n, {
|
|
@@ -113,20 +119,20 @@ function l({ rows: l, selected: u, range: d, labels: f, onSelect: p, onEventChan
|
|
|
113
119
|
class: "rv-timeline-editor__handle rv-timeline-editor__handle--end rv-timeline-control__handle rv-timeline-control__handle--end",
|
|
114
120
|
role: "slider",
|
|
115
121
|
"aria-orientation": "horizontal",
|
|
116
|
-
"aria-label":
|
|
122
|
+
"aria-label": b.resizeEnd(s),
|
|
117
123
|
"aria-valuemin": e.event.start,
|
|
118
|
-
"aria-valuemax": Math.max(
|
|
124
|
+
"aria-valuemax": Math.max(g.end, e.event.end),
|
|
119
125
|
"aria-valuenow": e.event.end,
|
|
120
126
|
"aria-keyshortcuts": "ArrowLeft ArrowRight",
|
|
121
|
-
onFocus: () =>
|
|
127
|
+
onFocus: () => v(e.id),
|
|
122
128
|
onPointerDown: (t) => {
|
|
123
|
-
t.stopPropagation(),
|
|
129
|
+
t.stopPropagation(), S(t, e, "end");
|
|
124
130
|
},
|
|
125
|
-
onPointerMove:
|
|
126
|
-
onPointerUp:
|
|
127
|
-
onPointerCancel:
|
|
131
|
+
onPointerMove: C,
|
|
132
|
+
onPointerUp: w,
|
|
133
|
+
onPointerCancel: w,
|
|
128
134
|
onKeyDown: (t) => {
|
|
129
|
-
t.stopPropagation(),
|
|
135
|
+
t.stopPropagation(), T(t, e, "end");
|
|
130
136
|
}
|
|
131
137
|
})
|
|
132
138
|
]
|
|
@@ -135,5 +141,16 @@ function l({ rows: l, selected: u, range: d, labels: f, onSelect: p, onEventChan
|
|
|
135
141
|
]
|
|
136
142
|
});
|
|
137
143
|
}
|
|
144
|
+
function f({ tooltipText: e, children: n, ...i }) {
|
|
145
|
+
let a = r(e ?? "", !0, {
|
|
146
|
+
className: "rv-control-tooltip",
|
|
147
|
+
placement: "above"
|
|
148
|
+
});
|
|
149
|
+
return /* @__PURE__ */ t("div", {
|
|
150
|
+
...i,
|
|
151
|
+
...e ? a.triggerProps : {},
|
|
152
|
+
children: [n, e && a.tooltip]
|
|
153
|
+
});
|
|
154
|
+
}
|
|
138
155
|
//#endregion
|
|
139
|
-
export {
|
|
156
|
+
export { d as TimelineTrack, i as eventOutsideRange, a as moveTimelineEvent, o as niceTimelineStep, s as resizeTimelineEvent, c as timelineEventBackground, l as timelineGeometry };
|