@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
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { i as e } from "./preact.module-BBM36DnO.js";
|
|
2
|
+
import { c as t, i as n, t as r } from "./hooks.module-CG3gN83z.js";
|
|
3
|
+
import { t as i } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
4
|
+
import { Input as a, Select as o } from "../native-control.js";
|
|
5
|
+
import { SegmentedSwitch as s } from "../segmented-switch/index.js";
|
|
6
|
+
import { SingleValueSlider as c } from "../filter/filters/slider/single.js";
|
|
7
|
+
import { n as l } from "./editor-commit-Bq3wSgvr.js";
|
|
8
|
+
import { EditorActions as u } from "../editor-actions.js";
|
|
9
|
+
//#region ../dates/src/duration.ts
|
|
10
|
+
var d = {
|
|
11
|
+
m: "minute",
|
|
12
|
+
min: "minute",
|
|
13
|
+
mins: "minute",
|
|
14
|
+
minute: "minute",
|
|
15
|
+
minutes: "minute",
|
|
16
|
+
h: "hour",
|
|
17
|
+
hr: "hour",
|
|
18
|
+
hrs: "hour",
|
|
19
|
+
hour: "hour",
|
|
20
|
+
hours: "hour",
|
|
21
|
+
d: "day",
|
|
22
|
+
day: "day",
|
|
23
|
+
days: "day",
|
|
24
|
+
w: "week",
|
|
25
|
+
wk: "week",
|
|
26
|
+
wks: "week",
|
|
27
|
+
week: "week",
|
|
28
|
+
weeks: "week",
|
|
29
|
+
mo: "month",
|
|
30
|
+
mon: "month",
|
|
31
|
+
mons: "month",
|
|
32
|
+
month: "month",
|
|
33
|
+
months: "month",
|
|
34
|
+
q: "quarter",
|
|
35
|
+
qr: "quarter",
|
|
36
|
+
qtr: "quarter",
|
|
37
|
+
qtrs: "quarter",
|
|
38
|
+
quarter: "quarter",
|
|
39
|
+
quarters: "quarter",
|
|
40
|
+
y: "year",
|
|
41
|
+
yr: "year",
|
|
42
|
+
yrs: "year",
|
|
43
|
+
year: "year",
|
|
44
|
+
years: "year"
|
|
45
|
+
}, f = {
|
|
46
|
+
minute: ["minute", "minutes"],
|
|
47
|
+
hour: ["hour", "hours"],
|
|
48
|
+
day: ["day", "days"],
|
|
49
|
+
week: ["week", "weeks"],
|
|
50
|
+
month: ["month", "months"],
|
|
51
|
+
quarter: ["quarter", "quarters"],
|
|
52
|
+
year: ["year", "years"]
|
|
53
|
+
};
|
|
54
|
+
function p(e) {
|
|
55
|
+
return typeof e == "number" && Number.isFinite(e) ? Math.min(20, Math.max(0, Math.floor(e))) : 1;
|
|
56
|
+
}
|
|
57
|
+
function m(e, t) {
|
|
58
|
+
let n = t?.defaultUnit ?? "day";
|
|
59
|
+
if (typeof e == "number") return Number.isFinite(e) && e >= 0 ? {
|
|
60
|
+
value: e,
|
|
61
|
+
unit: n,
|
|
62
|
+
elapsed: !1
|
|
63
|
+
} : null;
|
|
64
|
+
if (typeof e != "string") return null;
|
|
65
|
+
let r = e.trim().toLowerCase();
|
|
66
|
+
if (!r) return null;
|
|
67
|
+
let i = r.match(/^([+]?(?:\d+(?:\.\d+)?|\.\d+))\s*(.*)$/);
|
|
68
|
+
if (!i) return null;
|
|
69
|
+
let a = Number(i[1]);
|
|
70
|
+
if (!Number.isFinite(a) || a < 0) return null;
|
|
71
|
+
let o = i[2].trim().replace(/\s+/g, " "), s = !1;
|
|
72
|
+
if (o.startsWith("elapsed ") ? (s = !0, o = o.slice(8).trim()) : o.startsWith("e") && o.length > 1 && d[o.slice(1)] && (s = !0, o = o.slice(1)), s && t?.allowElapsed === !1) return null;
|
|
73
|
+
let c = o ? d[o] : n;
|
|
74
|
+
return c ? {
|
|
75
|
+
value: a,
|
|
76
|
+
unit: c,
|
|
77
|
+
elapsed: s
|
|
78
|
+
} : null;
|
|
79
|
+
}
|
|
80
|
+
function h(e, t) {
|
|
81
|
+
return Number(e.toFixed(p(t)));
|
|
82
|
+
}
|
|
83
|
+
function g(e, t, n) {
|
|
84
|
+
let r = h(e, n?.maximumFractionDigits ?? 1), i = f[t], a = Math.abs(Math.abs(r) - 1) < 1e-9 ? i[0] : i[1];
|
|
85
|
+
return `${r} ${n?.elapsed ? "elapsed " : ""}${a}`;
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region ../dates/src/duration-control.ts
|
|
89
|
+
function _(e, t) {
|
|
90
|
+
if (e == null || typeof e == "string" && !e.trim()) return {
|
|
91
|
+
valid: !t.required,
|
|
92
|
+
value: null
|
|
93
|
+
};
|
|
94
|
+
let n = m(typeof e == "object" && e && "unit" in e && "value" in e ? `${String(e.value)}${"elapsed" in e && e.elapsed ? " elapsed " : " "}${String(e.unit)}` : e, {
|
|
95
|
+
...t,
|
|
96
|
+
allowElapsed: t.allowElapsed ?? !1
|
|
97
|
+
}), r = !!n && (!t.allowedUnits || t.allowedUnits.includes(n.unit)) && (t.min === void 0 || n.value >= t.min) && (t.max === void 0 || n.value <= t.max);
|
|
98
|
+
return {
|
|
99
|
+
valid: r,
|
|
100
|
+
value: r ? n : null
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/duration/controls.tsx
|
|
105
|
+
var v = {
|
|
106
|
+
minute: "min",
|
|
107
|
+
hour: "hour",
|
|
108
|
+
day: "day",
|
|
109
|
+
week: "week",
|
|
110
|
+
month: "month",
|
|
111
|
+
quarter: "qtr",
|
|
112
|
+
year: "year"
|
|
113
|
+
};
|
|
114
|
+
function y(t) {
|
|
115
|
+
let { unit: n, amount: r } = t, a = t.onCommit ?? t.onChange, l = [...new Set(t.allowedUnits ?? Object.keys(v))], u = typeof t.slider == "object" ? t.slider : {}, d = Number.isFinite(t.min) ? Math.max(0, t.min) : 0, f = Math.max(d + 100, r), p = Number.isFinite(t.max) ? t.max : Number.isFinite(u.max) ? u.max : f, m = Number.isFinite(u.step) && u.step > 0 ? u.step : 1;
|
|
116
|
+
return /* @__PURE__ */ i(e, { children: [t.slider && /* @__PURE__ */ i("span", {
|
|
117
|
+
class: "rv-duration-field__slider",
|
|
118
|
+
children: [/* @__PURE__ */ i(c, {
|
|
119
|
+
min: d,
|
|
120
|
+
max: p,
|
|
121
|
+
step: m,
|
|
122
|
+
value: t.amount,
|
|
123
|
+
disabled: t.disabled || p <= d,
|
|
124
|
+
ariaLabel: t.label ?? "Duration",
|
|
125
|
+
ariaValueText: t.draft,
|
|
126
|
+
onChange: (e) => t.onChange(e),
|
|
127
|
+
onCommit: t.onCommit ? (e) => t.onCommit?.(e) : void 0
|
|
128
|
+
}), /* @__PURE__ */ i("span", {
|
|
129
|
+
class: "rv-duration-field__bounds",
|
|
130
|
+
"aria-hidden": "true",
|
|
131
|
+
children: [/* @__PURE__ */ i("span", { children: d }), /* @__PURE__ */ i("span", { children: [
|
|
132
|
+
p,
|
|
133
|
+
" ",
|
|
134
|
+
t.unitLabels?.[n] ?? v[n]
|
|
135
|
+
] })]
|
|
136
|
+
})]
|
|
137
|
+
}), t.unitButtons && /* @__PURE__ */ i("span", {
|
|
138
|
+
class: "rv-duration-field__modes",
|
|
139
|
+
children: [l.length === 0 ? null : l.length > 5 ? /* @__PURE__ */ i(o, {
|
|
140
|
+
"aria-label": t.unitLabel ?? "Duration unit",
|
|
141
|
+
value: n,
|
|
142
|
+
disabled: t.disabled,
|
|
143
|
+
onChange: (e) => a(r, e.currentTarget.value),
|
|
144
|
+
children: l.map((e) => /* @__PURE__ */ i("option", {
|
|
145
|
+
value: e,
|
|
146
|
+
children: t.unitLabels?.[e] ?? v[e]
|
|
147
|
+
}, e))
|
|
148
|
+
}) : /* @__PURE__ */ i(s, {
|
|
149
|
+
role: "radiogroup",
|
|
150
|
+
ariaLabel: t.unitLabel ?? "Duration unit",
|
|
151
|
+
value: n,
|
|
152
|
+
options: l.map((e) => ({
|
|
153
|
+
value: e,
|
|
154
|
+
label: t.unitLabels?.[e] ?? v[e],
|
|
155
|
+
ariaLabel: t.unitLabels?.[e] ?? e
|
|
156
|
+
})),
|
|
157
|
+
disabled: t.disabled,
|
|
158
|
+
onChange: (e) => a(r, e)
|
|
159
|
+
}), t.allowElapsed && /* @__PURE__ */ i(s, {
|
|
160
|
+
role: "radiogroup",
|
|
161
|
+
ariaLabel: t.modeLabel ?? "Duration mode",
|
|
162
|
+
value: t.elapsed ? "elapsed" : "working",
|
|
163
|
+
options: [{
|
|
164
|
+
value: "working",
|
|
165
|
+
label: t.workingLabel ?? "Working"
|
|
166
|
+
}, {
|
|
167
|
+
value: "elapsed",
|
|
168
|
+
label: t.elapsedLabel ?? "Elapsed"
|
|
169
|
+
}],
|
|
170
|
+
disabled: t.disabled,
|
|
171
|
+
onChange: (e) => a(r, n, e === "elapsed")
|
|
172
|
+
})]
|
|
173
|
+
})] });
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/duration/index.tsx
|
|
177
|
+
function b(e) {
|
|
178
|
+
let o = (t) => t && typeof t == "object" ? g(t.value, t.unit, {
|
|
179
|
+
elapsed: t.elapsed,
|
|
180
|
+
maximumFractionDigits: e.maximumFractionDigits ?? 10
|
|
181
|
+
}) : t === null ? "" : String(t), [s, c] = n(() => _(e.value, e).value?.unit ?? e.defaultUnit), [l, u] = n(() => o(e.value)), d = r(e.value);
|
|
182
|
+
t(() => {
|
|
183
|
+
e.value !== d.current && (d.current = e.value, u(o(e.value)), c(_(e.value, e).value?.unit ?? e.defaultUnit));
|
|
184
|
+
}, [e.value]);
|
|
185
|
+
let f = {
|
|
186
|
+
...e,
|
|
187
|
+
defaultUnit: e.unitButtons ? s : e.defaultUnit
|
|
188
|
+
}, p = _(l, f);
|
|
189
|
+
t(() => e.onValidityChange?.(p.valid), [p.valid]);
|
|
190
|
+
let m = e.disabled || e.readOnly, h = p.value, v = h?.unit ?? s, b = h?.value ?? 0, x = (t) => {
|
|
191
|
+
u(t), e.onDraftChange?.(t);
|
|
192
|
+
let n = _(t, f);
|
|
193
|
+
n.valid && (n.value && c(n.value.unit), d.current = n.value, e.onChange(n.value));
|
|
194
|
+
}, S = (t, n = v, r = h?.elapsed ?? !1, i = !1) => {
|
|
195
|
+
if (m) return;
|
|
196
|
+
let a = g(t, n, {
|
|
197
|
+
elapsed: r,
|
|
198
|
+
maximumFractionDigits: e.maximumFractionDigits ?? 10
|
|
199
|
+
});
|
|
200
|
+
x(a);
|
|
201
|
+
let o = _(a, f);
|
|
202
|
+
i && o.valid && e.onCommit?.(o.value);
|
|
203
|
+
};
|
|
204
|
+
return /* @__PURE__ */ i("span", {
|
|
205
|
+
class: `rv-duration-field ${e.className ?? ""}`,
|
|
206
|
+
children: [
|
|
207
|
+
/* @__PURE__ */ i(a, {
|
|
208
|
+
type: "text",
|
|
209
|
+
"aria-label": e.label ?? "Duration",
|
|
210
|
+
"aria-invalid": !p.valid,
|
|
211
|
+
value: l,
|
|
212
|
+
disabled: e.disabled,
|
|
213
|
+
readOnly: e.readOnly,
|
|
214
|
+
placeholder: e.placeholder ?? `2 ${e.unitLabels?.[e.defaultUnit] ?? e.defaultUnit}`,
|
|
215
|
+
onInput: (e) => x(e.currentTarget.value)
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ i(y, {
|
|
218
|
+
...e,
|
|
219
|
+
unit: v,
|
|
220
|
+
amount: b,
|
|
221
|
+
draft: l,
|
|
222
|
+
elapsed: h?.elapsed ?? !1,
|
|
223
|
+
disabled: m || !p.valid && !!l.trim(),
|
|
224
|
+
onChange: S,
|
|
225
|
+
onCommit: (e, t, n) => S(e, t, n, !0)
|
|
226
|
+
}),
|
|
227
|
+
!p.valid && /* @__PURE__ */ i("span", {
|
|
228
|
+
role: "alert",
|
|
229
|
+
class: "rv-editor-error",
|
|
230
|
+
children: e.invalidText ?? "Enter a valid duration within the allowed units and bounds."
|
|
231
|
+
})
|
|
232
|
+
]
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
function x({ value: e, options: t, apply: a, cancel: o }) {
|
|
236
|
+
let [s, c] = n(!1), [d, f] = n(e), [p, m] = n(0), h = t.autoApply !== !1, g = r(!1), v = r(e), y = (e = !1) => {
|
|
237
|
+
let n = _(v.current, t);
|
|
238
|
+
return n.valid ? ((e || !h || g.current) && (g.current = !1, a(n.value)), !0) : !1;
|
|
239
|
+
};
|
|
240
|
+
return l(y, h), /* @__PURE__ */ i("div", {
|
|
241
|
+
onKeyDown: (e) => {
|
|
242
|
+
let t = e.target instanceof HTMLInputElement && e.target.type === "text";
|
|
243
|
+
!e.isComposing && e.key === "Enter" && (h && t || e.ctrlKey || e.metaKey) && (e.preventDefault(), y(!0));
|
|
244
|
+
},
|
|
245
|
+
children: [/* @__PURE__ */ i(b, {
|
|
246
|
+
...t,
|
|
247
|
+
value: d,
|
|
248
|
+
onChange: (e) => {
|
|
249
|
+
g.current = !0, f(e);
|
|
250
|
+
},
|
|
251
|
+
onDraftChange: (e) => {
|
|
252
|
+
g.current = !0, v.current = e;
|
|
253
|
+
},
|
|
254
|
+
onCommit: h ? (e) => {
|
|
255
|
+
g.current = !1, a(e);
|
|
256
|
+
} : void 0,
|
|
257
|
+
onValidityChange: c
|
|
258
|
+
}, p), /* @__PURE__ */ i(u, {
|
|
259
|
+
showConfirm: t.showActions ?? !h,
|
|
260
|
+
text: t.actions,
|
|
261
|
+
disabled: !s,
|
|
262
|
+
apply: () => y(!0),
|
|
263
|
+
cancel: o,
|
|
264
|
+
clear: t.required ? void 0 : () => {
|
|
265
|
+
h ? a(null) : (v.current = null, f(null), m((e) => e + 1));
|
|
266
|
+
}
|
|
267
|
+
})]
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
//#endregion
|
|
271
|
+
export { b as n, x as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { s as e } from "./preact.module-BBM36DnO.js";
|
|
2
|
+
import { r as t, s as n, t as r } from "./hooks.module-CG3gN83z.js";
|
|
3
|
+
//#region src/core/editor-commit.tsx
|
|
4
|
+
var i = e(void 0);
|
|
5
|
+
function a(e, a = !0) {
|
|
6
|
+
let o = n(i), s = r(e);
|
|
7
|
+
s.current = e, t(() => {
|
|
8
|
+
if (a) return o?.(() => s.current());
|
|
9
|
+
}, [o, a]);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { a as n, i as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { calculateAnchoredPopoverPosition as e } from "../core/anchored-popover.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { t } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
+
import { createPreactElement as n, releasePreactElement as r } from "../preact-mount.js";
|
|
4
|
+
import { hideTopLayerPopup as i, showTopLayerPopup as a } from "../core/top-layer-popup.js";
|
|
5
|
+
import { t as o } from "./editor-commit-Bq3wSgvr.js";
|
|
6
6
|
//#region src/core/editor-popup-position.ts
|
|
7
7
|
function s(t, n, r, i = 4, a = 8) {
|
|
8
8
|
let o = Math.max(0, r.height - a - t.bottom - i), s = Math.max(0, t.top - a - i), c = n.height <= o || o >= s ? "below" : "above", l = c === "below" ? o : s, u = Math.min(n.height, l);
|
|
@@ -22,7 +22,7 @@ function l(e, l, u) {
|
|
|
22
22
|
let p = !1, m, h = (e) => (m = e, () => {
|
|
23
23
|
m === e && (m = void 0);
|
|
24
24
|
}), g = () => {
|
|
25
|
-
p || (p = !0, T.disconnect(), w?.disconnect(), d.removeEventListener("pointerdown", v, !0), d.removeEventListener("keydown", y, !0), d.removeEventListener("scroll", b, !0), f.removeEventListener("resize", g),
|
|
25
|
+
p || (p = !0, T.disconnect(), w?.disconnect(), d.removeEventListener("pointerdown", v, !0), d.removeEventListener("keydown", y, !0), d.removeEventListener("scroll", b, !0), f.removeEventListener("resize", g), i(x, S), r(x), x.remove(), c.get(d)?.element === x && c.delete(d), u.onClose?.(), e.isConnected && e.focus({ preventScroll: !0 }));
|
|
26
26
|
}, _ = (e) => e ? x.contains(e) ? !0 : [...x.querySelectorAll("[aria-controls]")].some((t) => t.getAttribute("aria-controls")?.split(" ").some((t) => d.getElementById(t)?.contains(e))) : !1, v = (t) => {
|
|
27
27
|
_(t.target) || e.contains(t.target) || (u.isAvailable && !u.isAvailable() ? g() : m?.() === !1 ? (t.preventDefault(), t.stopPropagation()) : g());
|
|
28
28
|
}, y = (e) => {
|
|
@@ -37,7 +37,7 @@ function l(e, l, u) {
|
|
|
37
37
|
}, b = (t) => {
|
|
38
38
|
let n = t.target;
|
|
39
39
|
_(n) || n && (n.contains(e) || E?.contains(n)) && C();
|
|
40
|
-
}, x =
|
|
40
|
+
}, x = n(d, /* @__PURE__ */ t("div", {
|
|
41
41
|
class: `rv-editor-popup ${u.className ?? ""}`,
|
|
42
42
|
role: "dialog",
|
|
43
43
|
"aria-label": u.label,
|
|
@@ -45,13 +45,13 @@ function l(e, l, u) {
|
|
|
45
45
|
onKeyUp: (e) => e.stopPropagation(),
|
|
46
46
|
onMouseDown: (e) => e.stopPropagation(),
|
|
47
47
|
onClick: (e) => e.stopPropagation(),
|
|
48
|
-
children: /* @__PURE__ */ o
|
|
48
|
+
children: /* @__PURE__ */ t(o.Provider, {
|
|
49
49
|
value: h,
|
|
50
50
|
children: l(g)
|
|
51
51
|
})
|
|
52
52
|
}));
|
|
53
53
|
x.style.direction = f.getComputedStyle(e).direction, (e.closest("dialog, [role=\"dialog\"], [role=\"menu\"]") ?? e.closest("revo-grid") ?? d.body).append(x);
|
|
54
|
-
let S =
|
|
54
|
+
let S = a(x, "block"), C = () => {
|
|
55
55
|
x.style.maxHeight = "";
|
|
56
56
|
let t = s(e.getBoundingClientRect(), x.getBoundingClientRect(), {
|
|
57
57
|
width: f.innerWidth,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { c as e, r as t } from "./preact.module-BBM36DnO.js";
|
|
2
|
+
import { r as n, t as r } from "./hooks.module-CG3gN83z.js";
|
|
3
|
+
import { n as i } from "./component-metadata-BENbgTjU.js";
|
|
4
|
+
//#region src/framework-mount.ts
|
|
5
|
+
function a(i, a) {
|
|
6
|
+
let o = /* @__PURE__ */ new Map(), s = !1, c = 0;
|
|
7
|
+
function l({ content: t, scope: i }) {
|
|
8
|
+
let l = r(null);
|
|
9
|
+
return n(() => {
|
|
10
|
+
let e = l.current;
|
|
11
|
+
if (!e || s) return;
|
|
12
|
+
let n = o.get(e)?.id ?? c++;
|
|
13
|
+
o.set(e, {
|
|
14
|
+
id: n,
|
|
15
|
+
element: e,
|
|
16
|
+
content: t,
|
|
17
|
+
scope: i
|
|
18
|
+
}), a([...o.values()]);
|
|
19
|
+
}, [t, i]), n(() => {
|
|
20
|
+
let e = l.current;
|
|
21
|
+
return () => {
|
|
22
|
+
e && o.delete(e), s || a([...o.values()]);
|
|
23
|
+
};
|
|
24
|
+
}, []), e("span", {
|
|
25
|
+
ref: l,
|
|
26
|
+
style: { display: "contents" },
|
|
27
|
+
"data-rv-framework-content": ""
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
let u = (t, n = {}) => e(l, {
|
|
31
|
+
content: t,
|
|
32
|
+
scope: n
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
render(n, r, a) {
|
|
36
|
+
if (s) throw Error("Cannot update a destroyed UI mount");
|
|
37
|
+
t(e(n, a ? a(r, u) : r), i);
|
|
38
|
+
},
|
|
39
|
+
destroy() {
|
|
40
|
+
s || (s = !0, t(null, i), o.clear());
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function o(e, t, n, r) {
|
|
45
|
+
let a = { ...t }, o = i(e);
|
|
46
|
+
for (let [e, t] of Object.entries(n)) {
|
|
47
|
+
if (t == null) continue;
|
|
48
|
+
let n = o[e];
|
|
49
|
+
n ? a[n.prop] = (...e) => (n.skipFactory && (e = e.slice(1)), r(t, Object.fromEntries(n.args.map((t, n) => [t, e[n]])))) : a[e === "default" ? "children" : e] = r(t);
|
|
50
|
+
}
|
|
51
|
+
return a;
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { o as n, a as t };
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { l as e } from "./preact.module-BBM36DnO.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/hooks/dist/hooks.module.js
|
|
3
|
+
var t, n, r, i, a = 0, o = [], s = e, c = s.__b, l = s.__r, u = s.diffed, d = s.__c, f = s.unmount, p = s.__;
|
|
4
|
+
function m(e, t) {
|
|
5
|
+
s.__h && s.__h(n, e, a || t), a = 0;
|
|
6
|
+
var r = n.__H || (n.__H = {
|
|
7
|
+
__: [],
|
|
8
|
+
__h: []
|
|
9
|
+
});
|
|
10
|
+
return e >= r.__.length && r.__.push({}), r.__[e];
|
|
11
|
+
}
|
|
12
|
+
function h(e) {
|
|
13
|
+
return a = 1, g(A, e);
|
|
14
|
+
}
|
|
15
|
+
function g(e, r, i) {
|
|
16
|
+
var a = m(t++, 2);
|
|
17
|
+
if (a.t = e, !a.__c && (a.__ = [i ? i(r) : A(void 0, r), function(e) {
|
|
18
|
+
var t = a.__N ? a.__N[0] : a.__[0], n = a.t(t, e);
|
|
19
|
+
t !== n && (a.__N = [n, a.__[1]], a.__c.setState({}));
|
|
20
|
+
}], a.__c = n, !n.__f)) {
|
|
21
|
+
var o = function(e, t, n) {
|
|
22
|
+
if (!a.__c.__H) return !0;
|
|
23
|
+
var r = a.__c.__H.__.filter(function(e) {
|
|
24
|
+
return e.__c;
|
|
25
|
+
});
|
|
26
|
+
if (r.every(function(e) {
|
|
27
|
+
return !e.__N;
|
|
28
|
+
})) return !s || s.call(this, e, t, n);
|
|
29
|
+
var i = a.__c.props !== e;
|
|
30
|
+
return r.some(function(e) {
|
|
31
|
+
if (e.__N) {
|
|
32
|
+
var t = e.__[0];
|
|
33
|
+
e.__ = e.__N, e.__N = void 0, t !== e.__[0] && (i = !0);
|
|
34
|
+
}
|
|
35
|
+
}), s && s.call(this, e, t, n) || i;
|
|
36
|
+
};
|
|
37
|
+
n.__f = !0;
|
|
38
|
+
var s = n.shouldComponentUpdate, c = n.componentWillUpdate;
|
|
39
|
+
n.componentWillUpdate = function(e, t, n) {
|
|
40
|
+
if (this.__e) {
|
|
41
|
+
var r = s;
|
|
42
|
+
s = void 0, o(e, t, n), s = r;
|
|
43
|
+
}
|
|
44
|
+
c && c.call(this, e, t, n);
|
|
45
|
+
}, n.shouldComponentUpdate = o;
|
|
46
|
+
}
|
|
47
|
+
return a.__N || a.__;
|
|
48
|
+
}
|
|
49
|
+
function _(e, r) {
|
|
50
|
+
var i = m(t++, 3);
|
|
51
|
+
!s.__s && k(i.__H, r) && (i.__ = e, i.u = r, n.__H.__h.push(i));
|
|
52
|
+
}
|
|
53
|
+
function v(e, r) {
|
|
54
|
+
var i = m(t++, 4);
|
|
55
|
+
!s.__s && k(i.__H, r) && (i.__ = e, i.u = r, n.__h.push(i));
|
|
56
|
+
}
|
|
57
|
+
function y(e) {
|
|
58
|
+
return a = 5, b(function() {
|
|
59
|
+
return { current: e };
|
|
60
|
+
}, []);
|
|
61
|
+
}
|
|
62
|
+
function b(e, n) {
|
|
63
|
+
var r = m(t++, 7);
|
|
64
|
+
return k(r.__H, n) && (r.__ = e(), r.__H = n, r.__h = e), r.__;
|
|
65
|
+
}
|
|
66
|
+
function x(e, t) {
|
|
67
|
+
return a = 8, b(function() {
|
|
68
|
+
return e;
|
|
69
|
+
}, t);
|
|
70
|
+
}
|
|
71
|
+
function S(e) {
|
|
72
|
+
var r = n.context[e.__c], i = m(t++, 9);
|
|
73
|
+
return i.c = e, r ? (i.__ ?? (i.__ = !0, r.sub(n)), r.props.value) : e.__;
|
|
74
|
+
}
|
|
75
|
+
function C() {
|
|
76
|
+
var e = m(t++, 11);
|
|
77
|
+
if (!e.__) {
|
|
78
|
+
for (var r = n.__v; r !== null && !r.__m && r.__ !== null;) r = r.__;
|
|
79
|
+
var i = r.__m || (r.__m = [0, 0]);
|
|
80
|
+
e.__ = "P" + i[0] + "-" + i[1]++;
|
|
81
|
+
}
|
|
82
|
+
return e.__;
|
|
83
|
+
}
|
|
84
|
+
function w() {
|
|
85
|
+
for (var e; e = o.shift();) {
|
|
86
|
+
var t = e.__H;
|
|
87
|
+
if (e.__P && t) try {
|
|
88
|
+
t.__h.some(D), t.__h.some(O), t.__h = [];
|
|
89
|
+
} catch (n) {
|
|
90
|
+
t.__h = [], s.__e(n, e.__v);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
s.__b = function(e) {
|
|
95
|
+
n = null, c && c(e);
|
|
96
|
+
}, s.__ = function(e, t) {
|
|
97
|
+
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), p && p(e, t);
|
|
98
|
+
}, s.__r = function(e) {
|
|
99
|
+
l && l(e), t = 0;
|
|
100
|
+
var i = (n = e.__c).__H;
|
|
101
|
+
i && (r === n ? (i.__h = [], n.__h = [], i.__.some(function(e) {
|
|
102
|
+
e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
|
|
103
|
+
})) : (i.__h.some(D), i.__h.some(O), i.__h = [], t = 0)), r = n;
|
|
104
|
+
}, s.diffed = function(e) {
|
|
105
|
+
u && u(e);
|
|
106
|
+
var t = e.__c;
|
|
107
|
+
t && t.__H && (t.__H.__h.length && (o.push(t) !== 1 && i === s.requestAnimationFrame || ((i = s.requestAnimationFrame) || E)(w)), t.__H.__.some(function(e) {
|
|
108
|
+
e.u && (e.__H = e.u), e.u = void 0;
|
|
109
|
+
})), r = n = null;
|
|
110
|
+
}, s.__c = function(e, t) {
|
|
111
|
+
t.some(function(e) {
|
|
112
|
+
try {
|
|
113
|
+
e.__h.some(D), e.__h = e.__h.filter(function(e) {
|
|
114
|
+
return !e.__ || O(e);
|
|
115
|
+
});
|
|
116
|
+
} catch (n) {
|
|
117
|
+
t.some(function(e) {
|
|
118
|
+
e.__h &&= [];
|
|
119
|
+
}), t = [], s.__e(n, e.__v);
|
|
120
|
+
}
|
|
121
|
+
}), d && d(e, t);
|
|
122
|
+
}, s.unmount = function(e) {
|
|
123
|
+
f && f(e);
|
|
124
|
+
var t, n = e.__c;
|
|
125
|
+
n && n.__H && (n.__H.__.some(function(e) {
|
|
126
|
+
try {
|
|
127
|
+
D(e);
|
|
128
|
+
} catch (e) {
|
|
129
|
+
t = e;
|
|
130
|
+
}
|
|
131
|
+
}), n.__H = void 0, t && s.__e(t, n.__v));
|
|
132
|
+
};
|
|
133
|
+
var T = typeof requestAnimationFrame == "function";
|
|
134
|
+
function E(e) {
|
|
135
|
+
var t, n = function() {
|
|
136
|
+
clearTimeout(r), T && cancelAnimationFrame(t), setTimeout(e);
|
|
137
|
+
}, r = setTimeout(n, 35);
|
|
138
|
+
T && (t = requestAnimationFrame(n));
|
|
139
|
+
}
|
|
140
|
+
function D(e) {
|
|
141
|
+
var t = n, r = e.__c;
|
|
142
|
+
typeof r == "function" && (e.__c = void 0, r()), n = t;
|
|
143
|
+
}
|
|
144
|
+
function O(e) {
|
|
145
|
+
var t = n;
|
|
146
|
+
e.__c = e.__(), n = t;
|
|
147
|
+
}
|
|
148
|
+
function k(e, t) {
|
|
149
|
+
return !e || e.length !== t.length || t.some(function(t, n) {
|
|
150
|
+
return t !== e[n];
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function A(e, t) {
|
|
154
|
+
return typeof t == "function" ? t(e) : t;
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
export { C as a, _ as c, h as i, b as n, x as o, v as r, S as s, y as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { l as e } from "./preact.module-BBM36DnO.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
|
|
3
|
+
var t = 0;
|
|
4
|
+
Array.isArray;
|
|
5
|
+
function n(n, r, i, a, o, s) {
|
|
6
|
+
r ||= {};
|
|
7
|
+
var c, l, u = r;
|
|
8
|
+
if ("ref" in u) for (l in u = {}, r) l == "ref" ? c = r[l] : u[l] = r[l];
|
|
9
|
+
var d = {
|
|
10
|
+
type: n,
|
|
11
|
+
props: u,
|
|
12
|
+
key: i,
|
|
13
|
+
ref: c,
|
|
14
|
+
__k: null,
|
|
15
|
+
__: null,
|
|
16
|
+
__b: 0,
|
|
17
|
+
__e: null,
|
|
18
|
+
__c: null,
|
|
19
|
+
constructor: void 0,
|
|
20
|
+
__v: --t,
|
|
21
|
+
__i: -1,
|
|
22
|
+
__u: 0,
|
|
23
|
+
__source: o,
|
|
24
|
+
__self: s
|
|
25
|
+
};
|
|
26
|
+
if (typeof n == "function" && (c = n.defaultProps)) for (l in c) u[l] === void 0 && (u[l] = c[l]);
|
|
27
|
+
return e.vnode && e.vnode(d), d;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { n as t };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { a as e, i as t, l as n, n as r, o as i, r as a, t as o } from "./request-trail-IdNiFvKH.js";
|
|
2
|
+
import { r as s } from "./preact.module-BBM36DnO.js";
|
|
3
|
+
import { c, i as l, t as u } from "./hooks.module-CG3gN83z.js";
|
|
4
|
+
import { t as d } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
5
|
+
import { n as f } from "./controls-DIum-E66.js";
|
|
6
|
+
//#region src/ai/mount.tsx
|
|
7
|
+
function p(p, m) {
|
|
8
|
+
let h = (e) => n(e, m.translations), g = !1;
|
|
9
|
+
function _({ state: n }) {
|
|
10
|
+
let [s, g] = l(""), _ = u(), v = n.phase === "understanding" || n.phase === "applying", y = n.steps ?? [];
|
|
11
|
+
c(() => {
|
|
12
|
+
if (v || n.phase === "idle" || _.current === void 0) return;
|
|
13
|
+
let e = _.current;
|
|
14
|
+
_.current = void 0, n.phase === "completed" && g((t) => t.trim() === e ? "" : t);
|
|
15
|
+
}, [n]);
|
|
16
|
+
let b = (e) => {
|
|
17
|
+
_.current = e.trim(), m.onSubmit(e);
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ d(a, {
|
|
20
|
+
translations: m.translations,
|
|
21
|
+
label: m.label,
|
|
22
|
+
busy: v,
|
|
23
|
+
footer: m.footer,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ d(i, {
|
|
26
|
+
items: n.suggestions?.length ? n.suggestions : m.suggestions ?? [],
|
|
27
|
+
onSelect: (e) => {
|
|
28
|
+
v || (g(e), b(e));
|
|
29
|
+
},
|
|
30
|
+
disabled: v
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ d(t, {
|
|
33
|
+
...m.prompt,
|
|
34
|
+
value: s,
|
|
35
|
+
onValueChange: g,
|
|
36
|
+
onSubmit: b,
|
|
37
|
+
onStop: m.onStop,
|
|
38
|
+
busy: v,
|
|
39
|
+
hint: y.length ? "" : m.prompt?.hint,
|
|
40
|
+
actions: /* @__PURE__ */ d(o, {
|
|
41
|
+
...m.trail,
|
|
42
|
+
items: y,
|
|
43
|
+
onRemove: (e) => m.onRemoveStep?.(e),
|
|
44
|
+
onClear: m.onReset,
|
|
45
|
+
onEmpty: () => p.querySelector("textarea")?.focus(),
|
|
46
|
+
disabled: v,
|
|
47
|
+
removalsDisabled: !m.onRemoveStep || n.canEditSteps === !1,
|
|
48
|
+
clearDescription: m.trail?.clearDescription ?? "Restore the starting view",
|
|
49
|
+
clearLabel: m.trail?.clearLabel ?? m.resetLabel ?? "Clear all",
|
|
50
|
+
changedMessage: !v && y.length > 0 && n.canEditSteps === !1 ? m.trail?.changedMessage ?? "The view changed manually. Start a new request to continue." : void 0
|
|
51
|
+
})
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ d(r, {
|
|
54
|
+
phase: n.phase,
|
|
55
|
+
message: n.phase === "completed" ? "" : n.message
|
|
56
|
+
}),
|
|
57
|
+
n.phase === "completed" && /* @__PURE__ */ d(e, {
|
|
58
|
+
summary: n.message,
|
|
59
|
+
matchedRows: n.matchedRows,
|
|
60
|
+
countLabel: m.countLabel
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ d("div", {
|
|
63
|
+
class: "rv-ai-result-actions",
|
|
64
|
+
children: [/* @__PURE__ */ d(f, {
|
|
65
|
+
disabled: v || !n.canRestore,
|
|
66
|
+
onClick: m.onRestore,
|
|
67
|
+
size: "compact",
|
|
68
|
+
children: h(m.restoreLabel ?? "Restore previous view")
|
|
69
|
+
}), !y.length && /* @__PURE__ */ d(f, {
|
|
70
|
+
disabled: v,
|
|
71
|
+
onClick: m.onReset,
|
|
72
|
+
size: "compact",
|
|
73
|
+
variant: "ghost",
|
|
74
|
+
children: h(m.resetLabel ?? "Reset view")
|
|
75
|
+
})]
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
update(e) {
|
|
82
|
+
g || s(/* @__PURE__ */ d(_, { state: e }), p);
|
|
83
|
+
},
|
|
84
|
+
destroy() {
|
|
85
|
+
g || (g = !0, s(null, p));
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { p as t };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { c as e } from "./preact.module-BBM36DnO.js";
|
|
2
|
+
import { t } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
+
import { createPreactElement as n } from "../preact-mount.js";
|
|
4
|
+
import { controlClassName as r } from "../control-attributes.js";
|
|
5
|
+
import { renderControl as i } from "../control-presentation.js";
|
|
6
|
+
//#region src/search-input/native.view.tsx
|
|
7
|
+
function a(e, t) {
|
|
8
|
+
let { shortcut: n, hideIcon: a, inputAttributes: o = {} } = t;
|
|
9
|
+
return e("div", {
|
|
10
|
+
class: r("rv-search-input", a && "rv-search-input--no-icon", n === void 0 && "rv-search-input--no-shortcut", t.rootClassName),
|
|
11
|
+
"data-testid": t.testId
|
|
12
|
+
}, !a && e("span", {
|
|
13
|
+
class: r("rv-search-input-icon", t.iconClassName),
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
}, t.icon), t.leading, i(e, "input", {
|
|
16
|
+
type: "search",
|
|
17
|
+
...o,
|
|
18
|
+
class: r(t.inputClassName, o.class)
|
|
19
|
+
}), n !== void 0 && e("span", { class: r("rv-search-input-shortcut", t.shortcutClassName) }, n), t.trailing);
|
|
20
|
+
}
|
|
21
|
+
function o(r, i) {
|
|
22
|
+
let o = n(r, a(e, {
|
|
23
|
+
...i,
|
|
24
|
+
icon: /* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: i.iconSvg } })
|
|
25
|
+
}));
|
|
26
|
+
return {
|
|
27
|
+
root: o,
|
|
28
|
+
input: o.querySelector("input")
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { a as n, o as t };
|