treege 3.0.0-beta.73 → 3.0.0-beta.74
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/dist/{DefaultSubmitButton-VU_Lwicd.js → DefaultSubmitButton-BT4AxAnR.js} +521 -500
- package/dist/{ThemeContext-CmyrtNyt.js → ThemeContext-CSH4Fupd.js} +61 -61
- package/dist/{editor-DLXwqtbI.js → editor-alr_fxTU.js} +926 -892
- package/dist/editor.js +2 -2
- package/dist/main.js +6 -6
- package/dist/renderer-D9Yaxr2H.js +255 -0
- package/dist/renderer-native.js +979 -989
- package/dist/renderer.js +5 -5
- package/dist/shared/locales/ar.json.d.ts +2 -0
- package/dist/shared/locales/de.json.d.ts +2 -0
- package/dist/shared/locales/en.json.d.ts +2 -0
- package/dist/shared/locales/es.json.d.ts +2 -0
- package/dist/shared/locales/fr.json.d.ts +2 -0
- package/dist/shared/locales/it.json.d.ts +2 -0
- package/dist/shared/locales/pt.json.d.ts +2 -0
- package/dist/shared/types/node.d.ts +7 -0
- package/dist/shared/utils/normalizeLabel.d.ts +21 -0
- package/dist/{useRenderNode-D1d8JGbe.js → useRenderNode-GobhZp-Y.js} +110 -110
- package/package.json +1 -1
- package/dist/renderer-pYP47xsl.js +0 -255
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { Check as
|
|
6
|
-
import { Slot as
|
|
1
|
+
import { A as e, C as t, D as n, F as r, N as i, O as a, S as o, T as s, _ as c, b as l, h as u, j as d, k as f, m as p, s as m, v as h, w as g, x as _ } from "./ThemeContext-CSH4Fupd.js";
|
|
2
|
+
import * as v from "react";
|
|
3
|
+
import { createContext as y, forwardRef as b, useCallback as ee, useContext as x, useEffect as S, useMemo as C, useRef as w, useState as T } from "react";
|
|
4
|
+
import { Fragment as te, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
5
|
+
import { Check as ne, CheckIcon as re, ChevronDownIcon as O, ChevronLeftIcon as k, ChevronRightIcon as ie, ChevronUpIcon as A, ChevronsUpDown as ae, CircleIcon as oe, Loader2 as j, MapPin as M, SearchIcon as N, X as se, XIcon as P } from "lucide-react";
|
|
6
|
+
import { Slot as ce } from "@radix-ui/react-slot";
|
|
7
7
|
import { cva as F } from "class-variance-authority";
|
|
8
8
|
import { clsx as I } from "clsx";
|
|
9
|
-
import { extendTailwindMerge as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
9
|
+
import { extendTailwindMerge as L } from "tailwind-merge";
|
|
10
|
+
import * as le from "@radix-ui/react-checkbox";
|
|
11
|
+
import * as ue from "@radix-ui/react-label";
|
|
12
12
|
import * as R from "@radix-ui/react-popover";
|
|
13
13
|
import * as z from "@radix-ui/react-select";
|
|
14
14
|
import * as B from "@radix-ui/react-tooltip";
|
|
15
|
-
import * as
|
|
15
|
+
import * as de from "@radix-ui/react-separator";
|
|
16
16
|
import { Command as V } from "cmdk";
|
|
17
17
|
import * as H from "@radix-ui/react-dialog";
|
|
18
|
-
import { DayPicker as
|
|
18
|
+
import { DayPicker as fe, getDefaultClassNames as U } from "react-day-picker";
|
|
19
19
|
import * as W from "@radix-ui/react-radio-group";
|
|
20
|
-
import * as
|
|
20
|
+
import * as pe from "@radix-ui/react-switch";
|
|
21
21
|
//#region src/shared/lib/utils.ts
|
|
22
|
-
var
|
|
22
|
+
var me = L({ prefix: "tg" });
|
|
23
23
|
function G(...e) {
|
|
24
|
-
return
|
|
24
|
+
return me(I(e));
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/shared/components/ui/button.tsx
|
|
28
|
-
var
|
|
28
|
+
var he = F("tg:inline-flex tg:items-center tg:justify-center tg:gap-2 tg:whitespace-nowrap tg:rounded-md tg:text-sm tg:font-medium tg:transition-all tg:disabled:pointer-events-none tg:disabled:opacity-50 tg:[&_svg]:pointer-events-none tg:[&_svg:not([class*='size-'])]:size-4 tg:shrink-0 tg:[&_svg]:shrink-0 tg:outline-none tg:focus-visible:border-ring tg:focus-visible:ring-ring/50 tg:focus-visible:ring-[3px] tg:aria-invalid:ring-destructive/20 tg:dark:aria-invalid:ring-destructive/40 tg:aria-invalid:border-destructive", {
|
|
29
29
|
defaultVariants: {
|
|
30
30
|
size: "default",
|
|
31
31
|
variant: "default"
|
|
@@ -52,9 +52,9 @@ var pe = F("tg:inline-flex tg:items-center tg:justify-center tg:gap-2 tg:whitesp
|
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
function K({ className: e, variant: t, size: n, asChild: r = !1, ...i }) {
|
|
55
|
-
return /* @__PURE__ */ E(r ?
|
|
55
|
+
return /* @__PURE__ */ E(r ? ce : "button", {
|
|
56
56
|
"data-slot": "button",
|
|
57
|
-
className: G(
|
|
57
|
+
className: G(he({
|
|
58
58
|
className: e,
|
|
59
59
|
size: n,
|
|
60
60
|
variant: t
|
|
@@ -64,15 +64,15 @@ function K({ className: e, variant: t, size: n, asChild: r = !1, ...i }) {
|
|
|
64
64
|
}
|
|
65
65
|
//#endregion
|
|
66
66
|
//#region src/shared/components/ui/checkbox.tsx
|
|
67
|
-
function
|
|
68
|
-
return /* @__PURE__ */ E(
|
|
67
|
+
function ge({ className: e, ...t }) {
|
|
68
|
+
return /* @__PURE__ */ E(le.Root, {
|
|
69
69
|
"data-slot": "checkbox",
|
|
70
70
|
className: G("tg:peer tg:size-4 tg:shrink-0 tg:rounded-[4px] tg:border tg:border-input tg:shadow-xs tg:outline-none tg:transition-shadow tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:data-[state=checked]:border-primary tg:data-[state=checked]:bg-primary tg:data-[state=checked]:text-primary-foreground tg:dark:bg-input/30 tg:dark:data-[state=checked]:bg-primary tg:dark:aria-invalid:ring-destructive/40", e),
|
|
71
71
|
...t,
|
|
72
|
-
children: /* @__PURE__ */ E(
|
|
72
|
+
children: /* @__PURE__ */ E(le.Indicator, {
|
|
73
73
|
"data-slot": "checkbox-indicator",
|
|
74
74
|
className: "tg:grid tg:place-content-center tg:text-current tg:transition-none",
|
|
75
|
-
children: /* @__PURE__ */ E(
|
|
75
|
+
children: /* @__PURE__ */ E(re, { className: "tg:size-3.5" })
|
|
76
76
|
})
|
|
77
77
|
});
|
|
78
78
|
}
|
|
@@ -111,30 +111,30 @@ function X({ className: e, type: t, ...n }) {
|
|
|
111
111
|
}
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region src/shared/components/ui/label.tsx
|
|
114
|
-
var Z = ({ className: e, ...t }) => /* @__PURE__ */ E(
|
|
114
|
+
var Z = ({ className: e, ...t }) => /* @__PURE__ */ E(ue.Root, {
|
|
115
115
|
"data-slot": "label",
|
|
116
116
|
className: G("tg:flex tg:select-none tg:items-center tg:gap-2 tg:font-medium tg:text-muted-foreground tg:text-sm tg:leading-none tg:peer-disabled:cursor-not-allowed tg:peer-disabled:opacity-50 tg:group-data-[disabled=true]:pointer-events-none tg:group-data-[disabled=true]:opacity-50", e),
|
|
117
117
|
...t
|
|
118
|
-
}),
|
|
118
|
+
}), Q = y(null), _e = () => x(Q), ve = ({ container: e, children: t }) => /* @__PURE__ */ E(Q.Provider, {
|
|
119
119
|
value: e,
|
|
120
120
|
children: t
|
|
121
121
|
});
|
|
122
122
|
//#endregion
|
|
123
123
|
//#region src/shared/components/ui/popover.tsx
|
|
124
|
-
function
|
|
124
|
+
function ye({ ...e }) {
|
|
125
125
|
return /* @__PURE__ */ E(R.Root, {
|
|
126
126
|
"data-slot": "popover",
|
|
127
127
|
...e
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function be({ ...e }) {
|
|
131
131
|
return /* @__PURE__ */ E(R.Trigger, {
|
|
132
132
|
"data-slot": "popover-trigger",
|
|
133
133
|
...e
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
let o =
|
|
136
|
+
function xe({ className: e, align: t = "center", sideOffset: n = 4, disablePortal: r = !1, container: i, ...a }) {
|
|
137
|
+
let o = _e(), s = i ?? o, c = /* @__PURE__ */ E(R.Content, {
|
|
138
138
|
"data-slot": "popover-content",
|
|
139
139
|
align: t,
|
|
140
140
|
sideOffset: n,
|
|
@@ -148,16 +148,16 @@ function ye({ className: e, align: t = "center", sideOffset: n = 4, disablePorta
|
|
|
148
148
|
}
|
|
149
149
|
//#endregion
|
|
150
150
|
//#region src/shared/components/ui/select.tsx
|
|
151
|
-
var
|
|
151
|
+
var Se = ({ ...e }) => /* @__PURE__ */ E(z.Root, {
|
|
152
152
|
"data-slot": "select",
|
|
153
153
|
...e
|
|
154
|
-
}),
|
|
154
|
+
}), Ce = ({ ...e }) => /* @__PURE__ */ E(z.Group, {
|
|
155
155
|
"data-slot": "select-group",
|
|
156
156
|
...e
|
|
157
|
-
}),
|
|
157
|
+
}), we = ({ ...e }) => /* @__PURE__ */ E(z.Value, {
|
|
158
158
|
"data-slot": "select-value",
|
|
159
159
|
...e
|
|
160
|
-
}),
|
|
160
|
+
}), Te = ({ className: e, size: t = "default", children: n, ...r }) => /* @__PURE__ */ D(z.Trigger, {
|
|
161
161
|
"data-slot": "select-trigger",
|
|
162
162
|
"data-size": t,
|
|
163
163
|
className: G("tg:flex tg:w-fit tg:items-center tg:justify-between tg:gap-2 tg:whitespace-nowrap tg:rounded-md tg:border tg:border-input tg:bg-transparent tg:px-3 tg:py-2 tg:text-sm tg:shadow-xs tg:outline-none tg:transition-[color,box-shadow] tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:data-[size=default]:h-9 tg:data-[size=sm]:h-8 tg:data-[placeholder]:text-muted-foreground tg:*:data-[slot=select-value]:line-clamp-1 tg:*:data-[slot=select-value]:flex tg:*:data-[slot=select-value]:items-center tg:*:data-[slot=select-value]:gap-2 tg:dark:bg-input/30 tg:dark:aria-invalid:ring-destructive/40 tg:dark:hover:bg-input/50 tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg:not([class*='text-'])]:text-muted-foreground tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0", e),
|
|
@@ -166,15 +166,15 @@ var be = ({ ...e }) => /* @__PURE__ */ E(z.Root, {
|
|
|
166
166
|
asChild: !0,
|
|
167
167
|
children: /* @__PURE__ */ E(O, { className: "tg:size-4 tg:opacity-50" })
|
|
168
168
|
})]
|
|
169
|
-
}),
|
|
170
|
-
container:
|
|
169
|
+
}), Ee = ({ className: e, children: t, position: n = "popper", ...r }) => /* @__PURE__ */ E(z.Portal, {
|
|
170
|
+
container: _e() ?? void 0,
|
|
171
171
|
children: /* @__PURE__ */ D(z.Content, {
|
|
172
172
|
"data-slot": "select-content",
|
|
173
173
|
className: G("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:data-[state=closed]:zoom-out-95 tg:data-[state=open]:zoom-in-95 tg:data-[side=bottom]:slide-in-from-top-2 tg:data-[side=left]:slide-in-from-right-2 tg:data-[side=right]:slide-in-from-left-2 tg:data-[side=top]:slide-in-from-bottom-2 tg:relative tg:z-[2000] tg:max-h-(--radix-select-content-available-height) tg:min-w-[8rem] tg:origin-(--radix-select-content-transform-origin) tg:overflow-y-auto tg:overflow-x-hidden tg:rounded-md tg:border tg:bg-popover tg:text-popover-foreground tg:shadow-md tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in", n === "popper" && "tg:data-[side=left]:-translate-x-1 tg:data-[side=top]:-translate-y-1 tg:data-[side=right]:translate-x-1 tg:data-[side=bottom]:translate-y-1", e),
|
|
174
174
|
position: n,
|
|
175
175
|
...r,
|
|
176
176
|
children: [
|
|
177
|
-
/* @__PURE__ */ E(
|
|
177
|
+
/* @__PURE__ */ E(Ae, {}),
|
|
178
178
|
/* @__PURE__ */ E(z.Viewport, {
|
|
179
179
|
className: G("tg:p-1", n === "popper" && "tg:h-[var(--radix-select-trigger-height)] tg:w-full tg:min-w-[var(--radix-select-trigger-width)] tg:scroll-my-1"),
|
|
180
180
|
children: t
|
|
@@ -182,7 +182,7 @@ var be = ({ ...e }) => /* @__PURE__ */ E(z.Root, {
|
|
|
182
182
|
/* @__PURE__ */ E($, {})
|
|
183
183
|
]
|
|
184
184
|
})
|
|
185
|
-
}),
|
|
185
|
+
}), De = ({ className: e, htmlFor: t, children: n, ...r }) => /* @__PURE__ */ E(z.Label, {
|
|
186
186
|
"data-slot": "select-label",
|
|
187
187
|
className: G("tg:pb-1.5 tg:font-medium tg:text-muted-foreground tg:text-sm", e),
|
|
188
188
|
...r,
|
|
@@ -190,23 +190,23 @@ var be = ({ ...e }) => /* @__PURE__ */ E(z.Root, {
|
|
|
190
190
|
htmlFor: t,
|
|
191
191
|
children: n
|
|
192
192
|
})
|
|
193
|
-
}),
|
|
193
|
+
}), Oe = ({ className: e, children: t, ...n }) => /* @__PURE__ */ D(z.Item, {
|
|
194
194
|
"data-slot": "select-item",
|
|
195
195
|
className: G("tg:relative tg:flex tg:w-full tg:cursor-pointer tg:select-none tg:items-center tg:gap-2 tg:rounded-sm tg:py-1.5 tg:pr-8 tg:pl-2 tg:text-sm tg:outline-hidden tg:focus:bg-accent tg:focus:text-accent-foreground tg:data-[disabled]:pointer-events-none tg:data-[disabled]:opacity-50 tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg:not([class*='text-'])]:text-muted-foreground tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0 tg:*:[span]:last:flex tg:*:[span]:last:items-center tg:*:[span]:last:gap-2", e),
|
|
196
196
|
...n,
|
|
197
197
|
children: [/* @__PURE__ */ E("span", {
|
|
198
198
|
className: "tg:absolute tg:right-2 tg:flex tg:size-3.5 tg:items-center tg:justify-center",
|
|
199
|
-
children: /* @__PURE__ */ E(z.ItemIndicator, { children: /* @__PURE__ */ E(
|
|
199
|
+
children: /* @__PURE__ */ E(z.ItemIndicator, { children: /* @__PURE__ */ E(re, { className: "tg:size-4" }) })
|
|
200
200
|
}), /* @__PURE__ */ E(z.ItemText, { children: t })]
|
|
201
|
-
}),
|
|
201
|
+
}), ke = ({ className: e, ...t }) => /* @__PURE__ */ E(z.Separator, {
|
|
202
202
|
"data-slot": "select-separator",
|
|
203
203
|
className: G("tg:-mx-1 tg:pointer-events-none tg:my-1 tg:h-px tg:bg-border", e),
|
|
204
204
|
...t
|
|
205
|
-
}),
|
|
205
|
+
}), Ae = ({ className: e, ...t }) => /* @__PURE__ */ E(z.ScrollUpButton, {
|
|
206
206
|
"data-slot": "select-scroll-up-button",
|
|
207
207
|
className: G("tg:flex tg:cursor-default tg:items-center tg:justify-center tg:py-1", e),
|
|
208
208
|
...t,
|
|
209
|
-
children: /* @__PURE__ */ E(
|
|
209
|
+
children: /* @__PURE__ */ E(A, { className: "tg:size-4" })
|
|
210
210
|
}), $ = ({ className: e, ...t }) => /* @__PURE__ */ E(z.ScrollDownButton, {
|
|
211
211
|
"data-slot": "select-scroll-down-button",
|
|
212
212
|
className: G("tg:flex tg:cursor-default tg:items-center tg:justify-center tg:py-1", e),
|
|
@@ -215,28 +215,28 @@ var be = ({ ...e }) => /* @__PURE__ */ E(z.Root, {
|
|
|
215
215
|
});
|
|
216
216
|
//#endregion
|
|
217
217
|
//#region src/shared/components/ui/tooltip.tsx
|
|
218
|
-
function
|
|
218
|
+
function je({ delayDuration: e = 0, ...t }) {
|
|
219
219
|
return /* @__PURE__ */ E(B.Provider, {
|
|
220
220
|
"data-slot": "tooltip-provider",
|
|
221
221
|
delayDuration: e,
|
|
222
222
|
...t
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
return /* @__PURE__ */ E(
|
|
225
|
+
function Me({ ...e }) {
|
|
226
|
+
return /* @__PURE__ */ E(je, { children: /* @__PURE__ */ E(B.Root, {
|
|
227
227
|
"data-slot": "tooltip",
|
|
228
228
|
...e
|
|
229
229
|
}) });
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function Ne({ ...e }) {
|
|
232
232
|
return /* @__PURE__ */ E(B.Trigger, {
|
|
233
233
|
"data-slot": "tooltip-trigger",
|
|
234
234
|
...e
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function Pe({ className: e, sideOffset: t = 0, children: n, ...r }) {
|
|
238
238
|
return /* @__PURE__ */ E(B.Portal, {
|
|
239
|
-
container:
|
|
239
|
+
container: _e() ?? void 0,
|
|
240
240
|
children: /* @__PURE__ */ D(B.Content, {
|
|
241
241
|
"data-slot": "tooltip-content",
|
|
242
242
|
sideOffset: t,
|
|
@@ -248,8 +248,8 @@ function Me({ className: e, sideOffset: t = 0, children: n, ...r }) {
|
|
|
248
248
|
}
|
|
249
249
|
//#endregion
|
|
250
250
|
//#region src/shared/components/ui/separator.tsx
|
|
251
|
-
function
|
|
252
|
-
return /* @__PURE__ */ E(
|
|
251
|
+
function Fe({ className: e, orientation: t = "horizontal", decorative: n = !0, ...r }) {
|
|
252
|
+
return /* @__PURE__ */ E(de.Root, {
|
|
253
253
|
"data-slot": "separator",
|
|
254
254
|
decorative: n,
|
|
255
255
|
orientation: t,
|
|
@@ -259,46 +259,46 @@ function Ne({ className: e, orientation: t = "horizontal", decorative: n = !0, .
|
|
|
259
259
|
}
|
|
260
260
|
//#endregion
|
|
261
261
|
//#region src/shared/components/ui/dialog.tsx
|
|
262
|
-
function
|
|
262
|
+
function Ie({ ...e }) {
|
|
263
263
|
return /* @__PURE__ */ E(H.Root, {
|
|
264
264
|
"data-slot": "dialog",
|
|
265
265
|
...e
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function Le({ ...e }) {
|
|
269
269
|
return /* @__PURE__ */ E(H.Trigger, {
|
|
270
270
|
"data-slot": "dialog-trigger",
|
|
271
271
|
...e
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function Re({ ...e }) {
|
|
275
275
|
return /* @__PURE__ */ E(H.Portal, {
|
|
276
276
|
"data-slot": "dialog-portal",
|
|
277
277
|
...e
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function ze({ className: e, ...t }) {
|
|
281
281
|
return /* @__PURE__ */ E(H.Overlay, {
|
|
282
282
|
"data-slot": "dialog-overlay",
|
|
283
283
|
className: G("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:fixed tg:inset-0 tg:z-[2000] tg:bg-black/50 tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in", e),
|
|
284
284
|
...t
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
let [i, a] =
|
|
289
|
-
return /* @__PURE__ */ D(
|
|
287
|
+
function Be({ className: e, children: t, showCloseButton: n = !0, ...r }) {
|
|
288
|
+
let [i, a] = v.useState(null);
|
|
289
|
+
return /* @__PURE__ */ D(Re, {
|
|
290
290
|
"data-slot": "dialog-portal",
|
|
291
|
-
children: [/* @__PURE__ */ E(
|
|
291
|
+
children: [/* @__PURE__ */ E(ze, {}), /* @__PURE__ */ E(H.Content, {
|
|
292
292
|
ref: a,
|
|
293
293
|
"data-slot": "dialog-content",
|
|
294
294
|
className: G("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:data-[state=closed]:zoom-out-95 tg:data-[state=open]:zoom-in-95 tg:fixed tg:top-[50%] tg:left-[50%] tg:z-[2000] tg:grid tg:w-full tg:max-w-[calc(100%-2rem)] tg:translate-x-[-50%] tg:translate-y-[-50%] tg:gap-4 tg:rounded-lg tg:border tg:bg-background tg:p-6 tg:shadow-lg tg:duration-200 tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in tg:sm:max-w-lg", e),
|
|
295
295
|
...r,
|
|
296
|
-
children: /* @__PURE__ */ D(
|
|
296
|
+
children: /* @__PURE__ */ D(ve, {
|
|
297
297
|
container: i,
|
|
298
298
|
children: [t, n && /* @__PURE__ */ D(H.Close, {
|
|
299
299
|
"data-slot": "dialog-close",
|
|
300
300
|
className: "tg:absolute tg:top-4 tg:right-4 tg:rounded-xs tg:opacity-70 tg:ring-offset-background tg:transition-opacity tg:hover:opacity-100 tg:focus:outline-hidden tg:focus:ring-2 tg:focus:ring-ring tg:focus:ring-offset-2 tg:disabled:pointer-events-none tg:data-[state=open]:bg-accent tg:data-[state=open]:text-muted-foreground tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0",
|
|
301
|
-
children: [/* @__PURE__ */ E(
|
|
301
|
+
children: [/* @__PURE__ */ E(P, {}), /* @__PURE__ */ E("span", {
|
|
302
302
|
className: "tg:sr-only",
|
|
303
303
|
children: "Close"
|
|
304
304
|
})]
|
|
@@ -307,28 +307,28 @@ function Re({ className: e, children: t, showCloseButton: n = !0, ...r }) {
|
|
|
307
307
|
})]
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function Ve({ className: e, ...t }) {
|
|
311
311
|
return /* @__PURE__ */ E("div", {
|
|
312
312
|
"data-slot": "dialog-header",
|
|
313
313
|
className: G("tg:flex tg:flex-col tg:gap-2 tg:text-center tg:sm:text-left", e),
|
|
314
314
|
...t
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function He({ className: e, ...t }) {
|
|
318
318
|
return /* @__PURE__ */ E("div", {
|
|
319
319
|
"data-slot": "dialog-footer",
|
|
320
320
|
className: G("tg:flex tg:flex-col-reverse tg:gap-2 tg:sm:flex-row tg:sm:justify-end", e),
|
|
321
321
|
...t
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Ue({ className: e, ...t }) {
|
|
325
325
|
return /* @__PURE__ */ E(H.Title, {
|
|
326
326
|
"data-slot": "dialog-title",
|
|
327
327
|
className: G("tg:font-semibold tg:text-lg tg:leading-none", e),
|
|
328
328
|
...t
|
|
329
329
|
});
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function We({ className: e, ...t }) {
|
|
332
332
|
return /* @__PURE__ */ E(H.Description, {
|
|
333
333
|
"data-slot": "dialog-description",
|
|
334
334
|
className: G("tg:text-muted-foreground tg:text-sm", e),
|
|
@@ -337,46 +337,46 @@ function He({ className: e, ...t }) {
|
|
|
337
337
|
}
|
|
338
338
|
//#endregion
|
|
339
339
|
//#region src/shared/components/ui/command.tsx
|
|
340
|
-
function
|
|
340
|
+
function Ge({ className: e, ...t }) {
|
|
341
341
|
return /* @__PURE__ */ E(V, {
|
|
342
342
|
"data-slot": "command",
|
|
343
343
|
className: G("tg:flex tg:h-full tg:w-full tg:flex-col tg:overflow-hidden tg:rounded-md tg:bg-popover tg:text-popover-foreground", e),
|
|
344
344
|
...t
|
|
345
345
|
});
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function Ke({ className: e, ...t }) {
|
|
348
348
|
return /* @__PURE__ */ D("div", {
|
|
349
349
|
"data-slot": "command-input-wrapper",
|
|
350
350
|
className: "tg:flex tg:h-9 tg:items-center tg:gap-2 tg:border-b tg:px-3",
|
|
351
|
-
children: [/* @__PURE__ */ E(
|
|
351
|
+
children: [/* @__PURE__ */ E(N, { className: "tg:size-4 tg:shrink-0 tg:opacity-50" }), /* @__PURE__ */ E(V.Input, {
|
|
352
352
|
"data-slot": "command-input",
|
|
353
353
|
className: G("tg:flex tg:h-10 tg:w-full tg:rounded-md tg:bg-transparent tg:py-3 tg:text-sm tg:outline-hidden tg:placeholder:text-muted-foreground tg:disabled:cursor-not-allowed tg:disabled:opacity-50", e),
|
|
354
354
|
...t
|
|
355
355
|
})]
|
|
356
356
|
});
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function qe({ className: e, ...t }) {
|
|
359
359
|
return /* @__PURE__ */ E(V.List, {
|
|
360
360
|
"data-slot": "command-list",
|
|
361
361
|
className: G("tg:max-h-[300px] tg:scroll-py-1 tg:overflow-y-auto tg:overflow-x-hidden", e),
|
|
362
362
|
...t
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function Je({ ...e }) {
|
|
366
366
|
return /* @__PURE__ */ E(V.Empty, {
|
|
367
367
|
"data-slot": "command-empty",
|
|
368
368
|
className: "tg:py-6 tg:text-center tg:text-sm",
|
|
369
369
|
...e
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function Ye({ className: e, ...t }) {
|
|
373
373
|
return /* @__PURE__ */ E(V.Group, {
|
|
374
374
|
"data-slot": "command-group",
|
|
375
375
|
className: G("tg:overflow-hidden tg:p-1 tg:text-foreground tg:[&_[cmdk-group-heading]]:px-2 tg:[&_[cmdk-group-heading]]:py-1.5 tg:[&_[cmdk-group-heading]]:font-medium tg:[&_[cmdk-group-heading]]:text-muted-foreground tg:[&_[cmdk-group-heading]]:text-xs", e),
|
|
376
376
|
...t
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Xe({ className: e, ...t }) {
|
|
380
380
|
return /* @__PURE__ */ E(V.Item, {
|
|
381
381
|
"data-slot": "command-item",
|
|
382
382
|
className: G("tg:relative tg:flex tg:cursor-default tg:select-none tg:items-center tg:gap-2 tg:rounded-sm tg:px-2 tg:py-1.5 tg:text-sm tg:outline-hidden tg:data-[disabled=true]:pointer-events-none tg:data-[selected=true]:bg-accent tg:data-[selected=true]:text-accent-foreground tg:data-[disabled=true]:opacity-50 tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg:not([class*='text-'])]:text-muted-foreground tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0", e),
|
|
@@ -385,7 +385,7 @@ function Je({ className: e, ...t }) {
|
|
|
385
385
|
}
|
|
386
386
|
//#endregion
|
|
387
387
|
//#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.tsx
|
|
388
|
-
var
|
|
388
|
+
var Ze = async (e, t) => {
|
|
389
389
|
if (!e || e.trim().length < 3) return [];
|
|
390
390
|
try {
|
|
391
391
|
let n = await fetch(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&format=jsonv2&addressdetails=1&limit=5`, { headers: {
|
|
@@ -400,7 +400,7 @@ var Ye = async (e, t) => {
|
|
|
400
400
|
} catch (e) {
|
|
401
401
|
return console.error("Nominatim fetch error:", e), [];
|
|
402
402
|
}
|
|
403
|
-
},
|
|
403
|
+
}, Qe = (e) => !e || e.trim().length < 3 ? Promise.resolve([]) : new Promise((t) => {
|
|
404
404
|
if (!window.google?.maps?.places) {
|
|
405
405
|
console.warn("Google Places SDK not loaded yet"), t([]);
|
|
406
406
|
return;
|
|
@@ -415,28 +415,28 @@ var Ye = async (e, t) => {
|
|
|
415
415
|
value: e.description
|
|
416
416
|
})));
|
|
417
417
|
});
|
|
418
|
-
}),
|
|
419
|
-
let [n, i] =
|
|
418
|
+
}), $e = ({ field: e, extra: t }) => {
|
|
419
|
+
let [n, i] = T(""), [a, o] = T([]), [s, c] = T(!1), { id: l, name: u, value: f, placeholder: p } = e, { node: m, setValue: h, error: g, label: _, helperText: v } = t, { googleApiKey: y, language: b } = r(), x = d(), C = ee((e) => {
|
|
420
420
|
h(e.value), i(e.value), c(!1);
|
|
421
|
-
}, [h]),
|
|
421
|
+
}, [h]), w = ee((e) => {
|
|
422
422
|
h(e), i(e), e.length >= 3 && c(!0);
|
|
423
423
|
}, [h]);
|
|
424
|
-
return
|
|
424
|
+
return S(() => {
|
|
425
425
|
if (!n || n.trim().length < 3) {
|
|
426
426
|
o([]);
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
429
|
let e = setTimeout(async () => {
|
|
430
|
-
o(
|
|
430
|
+
o(y ? await Qe(n) : await Ze(n, b));
|
|
431
431
|
}, 300);
|
|
432
432
|
return () => clearTimeout(e);
|
|
433
433
|
}, [
|
|
434
434
|
n,
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
]), /* @__PURE__ */ D(
|
|
435
|
+
y,
|
|
436
|
+
b
|
|
437
|
+
]), /* @__PURE__ */ D(te, { children: [y && /* @__PURE__ */ E("script", {
|
|
438
438
|
async: !0,
|
|
439
|
-
src: `https://maps.googleapis.com/maps/api/js?key=${
|
|
439
|
+
src: `https://maps.googleapis.com/maps/api/js?key=${y}&libraries=places`
|
|
440
440
|
}), /* @__PURE__ */ D(q, {
|
|
441
441
|
className: "tg:mb-4",
|
|
442
442
|
children: [
|
|
@@ -453,24 +453,24 @@ var Ye = async (e, t) => {
|
|
|
453
453
|
/* @__PURE__ */ E(X, {
|
|
454
454
|
type: "text",
|
|
455
455
|
id: l,
|
|
456
|
-
name:
|
|
456
|
+
name: u,
|
|
457
457
|
value: f || "",
|
|
458
|
-
onChange: (e) =>
|
|
458
|
+
onChange: (e) => w(e.target.value),
|
|
459
459
|
onFocus: () => {
|
|
460
460
|
a.length > 0 && c(!0);
|
|
461
461
|
},
|
|
462
|
-
placeholder: p ||
|
|
462
|
+
placeholder: p || x("renderer.defaultAddressInput.enterAddress"),
|
|
463
463
|
className: "tg:pr-10",
|
|
464
464
|
autoComplete: "off"
|
|
465
465
|
}),
|
|
466
|
-
/* @__PURE__ */ E(
|
|
466
|
+
/* @__PURE__ */ E(M, { className: "tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-3 tg:h-4 tg:w-4 tg:-translate-y-1/2 tg:text-muted-foreground" }),
|
|
467
467
|
s && /* @__PURE__ */ E("div", {
|
|
468
468
|
className: "tg:absolute tg:z-50 tg:mt-1 tg:w-full tg:rounded-md tg:border tg:bg-popover tg:shadow-md",
|
|
469
|
-
children: /* @__PURE__ */ E(
|
|
469
|
+
children: /* @__PURE__ */ E(Ge, { children: /* @__PURE__ */ D(qe, { children: [/* @__PURE__ */ E(Je, { children: x("renderer.defaultAddressInput.noAddressesFound") }), /* @__PURE__ */ E(Ye, { children: a.map((e, t) => /* @__PURE__ */ D(Xe, {
|
|
470
470
|
value: e.value,
|
|
471
|
-
onSelect: () =>
|
|
471
|
+
onSelect: () => C(e),
|
|
472
472
|
onMouseDown: (e) => e.preventDefault(),
|
|
473
|
-
children: [/* @__PURE__ */ E(
|
|
473
|
+
children: [/* @__PURE__ */ E(M, { className: "tg:mr-2 tg:h-4 tg:w-4" }), e.label]
|
|
474
474
|
}, t)) })] }) })
|
|
475
475
|
})
|
|
476
476
|
]
|
|
@@ -479,21 +479,21 @@ var Ye = async (e, t) => {
|
|
|
479
479
|
v && !g && /* @__PURE__ */ E(J, { children: v })
|
|
480
480
|
]
|
|
481
481
|
})] });
|
|
482
|
-
},
|
|
482
|
+
}, et = ({ missing: e }) => /* @__PURE__ */ D(te, { children: [/* @__PURE__ */ E("p", {
|
|
483
483
|
className: "tg:font-medium",
|
|
484
|
-
children:
|
|
484
|
+
children: d()("renderer.dependencyHint.title")
|
|
485
485
|
}), /* @__PURE__ */ E("ul", {
|
|
486
486
|
className: "tg:mt-1 tg:list-disc tg:pl-4",
|
|
487
487
|
children: e.map((e) => /* @__PURE__ */ E("li", { children: e.label }, e.id))
|
|
488
|
-
})] }),
|
|
488
|
+
})] }), tt = ({ missing: e, children: t }) => e.length === 0 ? /* @__PURE__ */ E(te, { children: t }) : /* @__PURE__ */ E(je, { children: /* @__PURE__ */ D(Me, { children: [/* @__PURE__ */ E(Ne, {
|
|
489
489
|
asChild: !0,
|
|
490
490
|
children: /* @__PURE__ */ E("div", {
|
|
491
491
|
className: "tg:w-full",
|
|
492
492
|
children: t
|
|
493
493
|
})
|
|
494
|
-
}), /* @__PURE__ */ E(
|
|
494
|
+
}), /* @__PURE__ */ E(Pe, { children: /* @__PURE__ */ E(et, { missing: e }) })] }) }), nt = ({ missing: e }) => e.length === 0 ? null : /* @__PURE__ */ E("div", {
|
|
495
495
|
className: "tg:text-muted-foreground tg:text-sm",
|
|
496
|
-
children: /* @__PURE__ */ E(
|
|
496
|
+
children: /* @__PURE__ */ E(et, { missing: e })
|
|
497
497
|
});
|
|
498
498
|
F("tg:group/item tg:flex tg:flex-wrap tg:items-center tg:rounded-md tg:border tg:border-transparent tg:text-sm tg:outline-none tg:transition-colors tg:duration-100 tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:[a]:transition-colors tg:[a]:hover:bg-accent/50", {
|
|
499
499
|
defaultVariants: {
|
|
@@ -512,7 +512,7 @@ F("tg:group/item tg:flex tg:flex-wrap tg:items-center tg:rounded-md tg:border tg
|
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
514
|
});
|
|
515
|
-
var
|
|
515
|
+
var rt = F("tg:flex tg:shrink-0 tg:items-center tg:justify-center tg:gap-2 tg:group-has-[[data-slot=item-description]]/item:translate-y-0.5 tg:group-has-[[data-slot=item-description]]/item:self-start tg:[&_svg]:pointer-events-none", {
|
|
516
516
|
defaultVariants: { variant: "default" },
|
|
517
517
|
variants: { variant: {
|
|
518
518
|
default: "tg:bg-transparent",
|
|
@@ -520,32 +520,32 @@ var tt = F("tg:flex tg:shrink-0 tg:items-center tg:justify-center tg:gap-2 tg:gr
|
|
|
520
520
|
image: "tg:size-10 tg:overflow-hidden tg:rounded-sm tg:[&_img]:size-full tg:[&_img]:object-cover"
|
|
521
521
|
} }
|
|
522
522
|
});
|
|
523
|
-
function
|
|
523
|
+
function it({ className: e, variant: t = "default", ...n }) {
|
|
524
524
|
return /* @__PURE__ */ E("div", {
|
|
525
525
|
"data-slot": "item-media",
|
|
526
526
|
"data-variant": t,
|
|
527
|
-
className: G(
|
|
527
|
+
className: G(rt({
|
|
528
528
|
className: e,
|
|
529
529
|
variant: t
|
|
530
530
|
})),
|
|
531
531
|
...n
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function at({ className: e, ...t }) {
|
|
535
535
|
return /* @__PURE__ */ E("div", {
|
|
536
536
|
"data-slot": "item-content",
|
|
537
537
|
className: G("tg:flex tg:flex-1 tg:flex-col tg:gap-1 tg:[&+[data-slot=item-content]]:flex-none", e),
|
|
538
538
|
...t
|
|
539
539
|
});
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function ot({ className: e, ...t }) {
|
|
542
542
|
return /* @__PURE__ */ E("div", {
|
|
543
543
|
"data-slot": "item-title",
|
|
544
544
|
className: G("tg:flex tg:w-fit tg:items-center tg:gap-2 tg:font-medium tg:text-sm tg:leading-snug", e),
|
|
545
545
|
...t
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function st({ className: e, ...t }) {
|
|
549
549
|
return /* @__PURE__ */ E("p", {
|
|
550
550
|
"data-slot": "item-description",
|
|
551
551
|
className: G("tg:line-clamp-2 tg:text-balance tg:font-normal tg:text-muted-foreground tg:text-sm tg:leading-normal", "tg:[&>a]:underline tg:[&>a]:underline-offset-4 tg:[&>a:hover]:text-primary", e),
|
|
@@ -554,67 +554,67 @@ function at({ className: e, ...t }) {
|
|
|
554
554
|
}
|
|
555
555
|
//#endregion
|
|
556
556
|
//#region src/renderer/features/TreegeRenderer/web/components/OptionItemContent.tsx
|
|
557
|
-
var
|
|
557
|
+
var ct = ({ label: e, description: t, image: n }) => /* @__PURE__ */ D(te, { children: [n && /* @__PURE__ */ E(it, {
|
|
558
558
|
variant: "image",
|
|
559
559
|
children: /* @__PURE__ */ E("img", {
|
|
560
560
|
src: n,
|
|
561
561
|
alt: ""
|
|
562
562
|
})
|
|
563
|
-
}), /* @__PURE__ */ D(
|
|
563
|
+
}), /* @__PURE__ */ D(at, {
|
|
564
564
|
className: "tg:min-w-0 tg:gap-0",
|
|
565
|
-
children: [/* @__PURE__ */ E(
|
|
565
|
+
children: [/* @__PURE__ */ E(ot, {
|
|
566
566
|
className: "tg:block tg:w-full tg:truncate tg:font-normal",
|
|
567
567
|
children: e
|
|
568
|
-
}), t && /* @__PURE__ */ E(
|
|
568
|
+
}), t && /* @__PURE__ */ E(st, {
|
|
569
569
|
className: "tg:line-clamp-1",
|
|
570
570
|
children: t
|
|
571
571
|
})]
|
|
572
|
-
})] }),
|
|
573
|
-
let [
|
|
572
|
+
})] }), lt = /\{\{([\w-]+)}}/g, ut = (e) => {
|
|
573
|
+
let [t, i] = T({
|
|
574
574
|
error: null,
|
|
575
575
|
fetched: null,
|
|
576
576
|
isLoading: !1
|
|
577
|
-
}), { baseUrl:
|
|
578
|
-
if (!(
|
|
579
|
-
let t =
|
|
577
|
+
}), { baseUrl: c, formValues: u, headers: d } = r(), p = e.data.optionsSource, m = e.data.options, _ = C(() => {
|
|
578
|
+
if (!(p?.url && p.mapping?.valueField && p.mapping?.labelField) || !Array.from(p.url.matchAll(lt), (e) => e[1]).every((e) => {
|
|
579
|
+
let t = u[e];
|
|
580
580
|
return t != null && t !== "";
|
|
581
581
|
})) return null;
|
|
582
|
-
let
|
|
582
|
+
let e = p.method ?? "GET", t = {
|
|
583
583
|
body: [
|
|
584
584
|
"POST",
|
|
585
585
|
"PUT",
|
|
586
586
|
"PATCH"
|
|
587
|
-
].includes(
|
|
588
|
-
headers:
|
|
589
|
-
mapping:
|
|
590
|
-
method:
|
|
591
|
-
queryParams:
|
|
592
|
-
responsePath:
|
|
593
|
-
url:
|
|
587
|
+
].includes(e) ? l(p.body, u, []) : void 0,
|
|
588
|
+
headers: s(a(d, u), a(p.headers, u)),
|
|
589
|
+
mapping: p.mapping,
|
|
590
|
+
method: e,
|
|
591
|
+
queryParams: a(p.queryParams, u) ?? {},
|
|
592
|
+
responsePath: p.responsePath,
|
|
593
|
+
url: f(n(p.url, u, { encode: !0 }), c)
|
|
594
594
|
};
|
|
595
|
-
return JSON.stringify(
|
|
595
|
+
return JSON.stringify(t);
|
|
596
596
|
}, [
|
|
597
|
+
c,
|
|
598
|
+
p,
|
|
597
599
|
u,
|
|
598
|
-
|
|
599
|
-
d,
|
|
600
|
-
f
|
|
600
|
+
d
|
|
601
601
|
]);
|
|
602
|
-
|
|
603
|
-
if (!
|
|
604
|
-
|
|
602
|
+
S(() => {
|
|
603
|
+
if (!_) {
|
|
604
|
+
i({
|
|
605
605
|
error: null,
|
|
606
606
|
fetched: null,
|
|
607
607
|
isLoading: !1
|
|
608
608
|
});
|
|
609
609
|
return;
|
|
610
610
|
}
|
|
611
|
-
let e = JSON.parse(
|
|
612
|
-
return
|
|
611
|
+
let e = JSON.parse(_), t = new AbortController();
|
|
612
|
+
return i((e) => ({
|
|
613
613
|
...e,
|
|
614
614
|
error: null,
|
|
615
615
|
isLoading: !0
|
|
616
616
|
})), (async () => {
|
|
617
|
-
let n = await
|
|
617
|
+
let n = await g({
|
|
618
618
|
body: e.body,
|
|
619
619
|
headers: e.headers,
|
|
620
620
|
method: e.method,
|
|
@@ -624,85 +624,96 @@ var ot = ({ label: e, description: t, image: n }) => /* @__PURE__ */ D(T, { chil
|
|
|
624
624
|
});
|
|
625
625
|
if (!t.signal.aborted) {
|
|
626
626
|
if (!n.success) {
|
|
627
|
-
|
|
627
|
+
i({
|
|
628
628
|
error: n.error ?? "Fetch failed",
|
|
629
629
|
fetched: null,
|
|
630
630
|
isLoading: !1
|
|
631
631
|
});
|
|
632
632
|
return;
|
|
633
633
|
}
|
|
634
|
-
|
|
634
|
+
i({
|
|
635
635
|
error: null,
|
|
636
|
-
fetched:
|
|
636
|
+
fetched: o(n.data, e.responsePath, e.mapping),
|
|
637
637
|
isLoading: !1
|
|
638
638
|
});
|
|
639
639
|
}
|
|
640
640
|
})(), () => t.abort();
|
|
641
|
-
}, [
|
|
642
|
-
let
|
|
641
|
+
}, [_]);
|
|
642
|
+
let v = e.data.normalizeOptionLabels !== !1, y = C(() => t.fetched ? v ? t.fetched.map((e) => ({
|
|
643
|
+
...e,
|
|
644
|
+
label: h(e.label)
|
|
645
|
+
})) : t.fetched : m ?? [], [
|
|
646
|
+
t.fetched,
|
|
647
|
+
m,
|
|
648
|
+
v
|
|
649
|
+
]);
|
|
643
650
|
return {
|
|
644
|
-
error:
|
|
645
|
-
isLoading:
|
|
646
|
-
options:
|
|
651
|
+
error: t.error,
|
|
652
|
+
isLoading: t.isLoading,
|
|
653
|
+
options: y
|
|
647
654
|
};
|
|
648
|
-
},
|
|
649
|
-
let [n, r] =
|
|
655
|
+
}, dt = ({ field: e, extra: t }) => {
|
|
656
|
+
let [n, r] = T(!1), { id: i, value: a, placeholder: o } = e, { node: s, setValue: c, error: l, label: u, helperText: f, missingDependencies: p } = t, { options: m, isLoading: h, error: g } = ut(s), _ = d(), v = `${i}-trigger`, y = `${i}-error`, b = m.find((e) => e.value === a);
|
|
650
657
|
return /* @__PURE__ */ D(q, {
|
|
651
658
|
className: "tg:mb-4",
|
|
652
659
|
children: [
|
|
653
660
|
/* @__PURE__ */ D(Z, {
|
|
654
661
|
htmlFor: v,
|
|
655
|
-
children: [
|
|
662
|
+
children: [u || s.data.name, s.data.required && /* @__PURE__ */ E("span", {
|
|
656
663
|
className: "tg:text-red-500",
|
|
657
664
|
children: "*"
|
|
658
665
|
})]
|
|
659
666
|
}),
|
|
660
|
-
/* @__PURE__ */ E(
|
|
667
|
+
/* @__PURE__ */ E(tt, {
|
|
661
668
|
missing: p,
|
|
662
669
|
children: /* @__PURE__ */ D("div", {
|
|
663
670
|
className: "tg:relative",
|
|
664
|
-
children: [
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
"
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
671
|
+
children: [
|
|
672
|
+
/* @__PURE__ */ D(ye, {
|
|
673
|
+
open: n,
|
|
674
|
+
onOpenChange: r,
|
|
675
|
+
children: [/* @__PURE__ */ E(be, {
|
|
676
|
+
asChild: !0,
|
|
677
|
+
children: /* @__PURE__ */ D(K, {
|
|
678
|
+
id: v,
|
|
679
|
+
variant: "outline",
|
|
680
|
+
role: "combobox",
|
|
681
|
+
"aria-expanded": n,
|
|
682
|
+
"aria-invalid": !!l || void 0,
|
|
683
|
+
"aria-describedby": l ? y : void 0,
|
|
684
|
+
disabled: h || p.length > 0,
|
|
685
|
+
className: G("tg:w-full tg:justify-between tg:font-normal", (a || h) && "tg:pr-14"),
|
|
686
|
+
children: [/* @__PURE__ */ E("span", {
|
|
687
|
+
className: "tg:flex tg:items-center tg:gap-2 tg:truncate",
|
|
688
|
+
children: a ? b?.label ? _(b.label) : a : o || _("renderer.defaultAutocompleteInput.selectOption")
|
|
689
|
+
}), /* @__PURE__ */ E(ae, { className: "tg:ml-2 tg:size-4 tg:shrink-0 tg:opacity-50" })]
|
|
690
|
+
})
|
|
691
|
+
}), /* @__PURE__ */ E(xe, {
|
|
692
|
+
className: "tg:w-(--radix-popover-trigger-width) tg:p-0",
|
|
693
|
+
align: "start",
|
|
694
|
+
children: /* @__PURE__ */ D(Ge, { children: [/* @__PURE__ */ E(Ke, { placeholder: o || _("renderer.defaultAutocompleteInput.search") }), /* @__PURE__ */ D(qe, { children: [/* @__PURE__ */ E(Je, { children: _("renderer.defaultAutocompleteInput.noResults") }), /* @__PURE__ */ E(Ye, { children: m.map((e) => /* @__PURE__ */ D(Xe, {
|
|
695
|
+
value: e.value,
|
|
696
|
+
disabled: e.disabled,
|
|
697
|
+
onSelect: () => {
|
|
698
|
+
c(e.value === a ? "" : e.value), r(!1);
|
|
699
|
+
},
|
|
700
|
+
children: [/* @__PURE__ */ E(ne, { className: G("tg:mr-2 tg:size-4", a === e.value ? "tg:opacity-100" : "tg:opacity-0") }), /* @__PURE__ */ E(ct, {
|
|
701
|
+
label: _(e.label) || e.value,
|
|
702
|
+
description: _(e.description),
|
|
703
|
+
image: e.image
|
|
704
|
+
})]
|
|
705
|
+
}, e.value)) })] })] })
|
|
706
|
+
})]
|
|
707
|
+
}),
|
|
708
|
+
h && /* @__PURE__ */ E(j, { className: "tg:-translate-y-1/2 tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-8 tg:size-4 tg:animate-spin tg:text-muted-foreground" }),
|
|
709
|
+
a && !h && p.length === 0 && /* @__PURE__ */ E("button", {
|
|
710
|
+
type: "button",
|
|
711
|
+
"aria-label": _("common.clear"),
|
|
712
|
+
onClick: () => c(""),
|
|
713
|
+
className: "tg:-translate-y-1/2 tg:absolute tg:top-1/2 tg:right-8 tg:rounded-sm tg:p-0.5 tg:text-muted-foreground tg:opacity-70 tg:transition-opacity tg:hover:opacity-100",
|
|
714
|
+
children: /* @__PURE__ */ E(se, { className: "tg:size-4" })
|
|
715
|
+
})
|
|
716
|
+
]
|
|
706
717
|
})
|
|
707
718
|
}),
|
|
708
719
|
l && /* @__PURE__ */ E(Y, {
|
|
@@ -713,10 +724,10 @@ var ot = ({ label: e, description: t, image: n }) => /* @__PURE__ */ D(T, { chil
|
|
|
713
724
|
f && !l && !g && /* @__PURE__ */ E(J, { children: f })
|
|
714
725
|
]
|
|
715
726
|
});
|
|
716
|
-
},
|
|
717
|
-
let { id: n, name: i, value: a } = e, { node: o, setValue: s, error: c, label: l, helperText:
|
|
727
|
+
}, ft = ({ field: e, extra: t }) => {
|
|
728
|
+
let { id: n, name: i, value: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u, renderOptionExtras: f, compactOptions: p, missingDependencies: m } = t, { options: h, isLoading: g, error: _ } = ut(o), { optionsDisplayLimit: v } = r(), y = d();
|
|
718
729
|
if (h.length > 0 || o.data.optionsSource) {
|
|
719
|
-
let e = `${n}-label`, t = Array.isArray(a) ? a.map(String) : [], r = v ? h.slice(0, v) : h,
|
|
730
|
+
let e = `${n}-label`, t = Array.isArray(a) ? a.map(String) : [], r = v ? h.slice(0, v) : h, d = h.length - r.length, b = (e, n) => {
|
|
720
731
|
s(n ? [...t, e] : t.filter((t) => t !== e));
|
|
721
732
|
};
|
|
722
733
|
return /* @__PURE__ */ D(q, {
|
|
@@ -730,7 +741,7 @@ var ot = ({ label: e, description: t, image: n }) => /* @__PURE__ */ D(T, { chil
|
|
|
730
741
|
children: "*"
|
|
731
742
|
})]
|
|
732
743
|
}),
|
|
733
|
-
/* @__PURE__ */ E(
|
|
744
|
+
/* @__PURE__ */ E(nt, { missing: m }),
|
|
734
745
|
g && /* @__PURE__ */ D("div", {
|
|
735
746
|
className: "tg:flex tg:items-center tg:gap-2 tg:py-2 tg:text-muted-foreground tg:text-sm",
|
|
736
747
|
children: [/* @__PURE__ */ E(j, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ E("span", { children: y("renderer.defaultCheckboxInput.loadingOptions") })]
|
|
@@ -744,7 +755,7 @@ var ot = ({ label: e, description: t, image: n }) => /* @__PURE__ */ D(T, { chil
|
|
|
744
755
|
return /* @__PURE__ */ D("div", {
|
|
745
756
|
className: G("tg:group/option tg:pointer-events-auto tg:relative tg:flex tg:items-start tg:gap-3", p && "tg:pr-22"),
|
|
746
757
|
children: [
|
|
747
|
-
/* @__PURE__ */ E(
|
|
758
|
+
/* @__PURE__ */ E(ge, {
|
|
748
759
|
id: `${n}-${e.value}`,
|
|
749
760
|
name: i,
|
|
750
761
|
checked: t.includes(String(e.value)),
|
|
@@ -774,14 +785,14 @@ var ot = ({ label: e, description: t, image: n }) => /* @__PURE__ */ D(T, { chil
|
|
|
774
785
|
})
|
|
775
786
|
]
|
|
776
787
|
}, e.value + r);
|
|
777
|
-
}),
|
|
788
|
+
}), d > 0 && /* @__PURE__ */ E("div", {
|
|
778
789
|
className: "tg:px-2 tg:text-muted-foreground tg:text-xs",
|
|
779
790
|
children: "…"
|
|
780
791
|
})]
|
|
781
792
|
}),
|
|
782
793
|
c && /* @__PURE__ */ E(Y, { children: c }),
|
|
783
794
|
_ && !c && /* @__PURE__ */ E(Y, { children: _ }),
|
|
784
|
-
|
|
795
|
+
u && !c && !_ && /* @__PURE__ */ E(J, { children: u })
|
|
785
796
|
]
|
|
786
797
|
});
|
|
787
798
|
}
|
|
@@ -789,7 +800,7 @@ var ot = ({ label: e, description: t, image: n }) => /* @__PURE__ */ D(T, { chil
|
|
|
789
800
|
className: "tg:mb-4",
|
|
790
801
|
children: [/* @__PURE__ */ D("div", {
|
|
791
802
|
className: "tg:flex tg:items-center tg:gap-3",
|
|
792
|
-
children: [/* @__PURE__ */ E(
|
|
803
|
+
children: [/* @__PURE__ */ E(ge, {
|
|
793
804
|
id: n,
|
|
794
805
|
name: i,
|
|
795
806
|
checked: typeof a == "boolean" ? a : !1,
|
|
@@ -801,15 +812,15 @@ var ot = ({ label: e, description: t, image: n }) => /* @__PURE__ */ D(T, { chil
|
|
|
801
812
|
className: "tg:text-red-500",
|
|
802
813
|
children: "*"
|
|
803
814
|
})]
|
|
804
|
-
}),
|
|
815
|
+
}), u && !c && /* @__PURE__ */ E(J, { children: u })] })]
|
|
805
816
|
}), c && /* @__PURE__ */ E(Y, { children: c })]
|
|
806
817
|
});
|
|
807
818
|
};
|
|
808
819
|
//#endregion
|
|
809
820
|
//#region src/shared/components/ui/calendar.tsx
|
|
810
|
-
function
|
|
811
|
-
let c =
|
|
812
|
-
return /* @__PURE__ */ E(
|
|
821
|
+
function pt({ className: e, classNames: t, showOutsideDays: n = !0, captionLayout: r = "label", buttonVariant: i = "ghost", formatters: a, components: o, ...s }) {
|
|
822
|
+
let c = U();
|
|
823
|
+
return /* @__PURE__ */ E(fe, {
|
|
813
824
|
showOutsideDays: n,
|
|
814
825
|
className: G("tg:group/calendar tg:bg-background tg:p-3 tg:[--cell-size:--spacing(8)] tg:[[data-slot=card-content]_&]:bg-transparent tg:[[data-slot=popover-content]_&]:bg-transparent", String.raw`tg:rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`tg:rtl:**:[.rdp-button\_previous>svg]:rotate-180`, e),
|
|
815
826
|
captionLayout: r,
|
|
@@ -818,8 +829,8 @@ function dt({ className: e, classNames: t, showOutsideDays: n = !0, captionLayou
|
|
|
818
829
|
...a
|
|
819
830
|
},
|
|
820
831
|
classNames: {
|
|
821
|
-
button_next: G(
|
|
822
|
-
button_previous: G(
|
|
832
|
+
button_next: G(he({ variant: i }), "tg:size-(--cell-size) tg:aria-disabled:opacity-50 tg:p-0 tg:select-none", c.button_next),
|
|
833
|
+
button_previous: G(he({ variant: i }), "tg:size-(--cell-size) tg:aria-disabled:opacity-50 tg:p-0 tg:select-none", c.button_previous),
|
|
823
834
|
caption_label: G("tg:select-none tg:font-medium", r === "label" ? "tg:text-sm" : "tg:rounded-md tg:pl-2 tg:pr-1 tg:flex tg:items-center tg:gap-1 tg:text-sm tg:h-8 tg:[&>svg]:text-muted-foreground tg:[&>svg]:size-3.5", c.caption_label),
|
|
824
835
|
day: G("tg:relative tg:w-full tg:h-full tg:p-0 tg:text-center tg:[&:first-child[data-selected=true]_button]:rounded-l-md tg:[&:last-child[data-selected=true]_button]:rounded-r-md tg:group/day tg:aspect-square tg:select-none", c.day),
|
|
825
836
|
disabled: G("tg:text-muted-foreground tg:opacity-50", c.disabled),
|
|
@@ -846,11 +857,11 @@ function dt({ className: e, classNames: t, showOutsideDays: n = !0, captionLayou
|
|
|
846
857
|
...t
|
|
847
858
|
},
|
|
848
859
|
components: {
|
|
849
|
-
Chevron: ({ className: e, orientation: t, ...n }) => E(t === "left" ?
|
|
860
|
+
Chevron: ({ className: e, orientation: t, ...n }) => E(t === "left" ? k : t === "right" ? ie : O, {
|
|
850
861
|
className: G("tg:size-4", e),
|
|
851
862
|
...n
|
|
852
863
|
}),
|
|
853
|
-
DayButton:
|
|
864
|
+
DayButton: mt,
|
|
854
865
|
Root: ({ className: e, rootRef: t, ...n }) => /* @__PURE__ */ E("div", {
|
|
855
866
|
"data-slot": "calendar",
|
|
856
867
|
ref: t,
|
|
@@ -869,9 +880,9 @@ function dt({ className: e, classNames: t, showOutsideDays: n = !0, captionLayou
|
|
|
869
880
|
...s
|
|
870
881
|
});
|
|
871
882
|
}
|
|
872
|
-
function
|
|
873
|
-
let i =
|
|
874
|
-
return
|
|
883
|
+
function mt({ className: e, day: t, modifiers: n, ...r }) {
|
|
884
|
+
let i = U(), a = v.useRef(null);
|
|
885
|
+
return v.useEffect(() => {
|
|
875
886
|
n.focused && a.current?.focus();
|
|
876
887
|
}, [n.focused]), /* @__PURE__ */ E(K, {
|
|
877
888
|
ref: a,
|
|
@@ -888,8 +899,8 @@ function ft({ className: e, day: t, modifiers: n, ...r }) {
|
|
|
888
899
|
}
|
|
889
900
|
//#endregion
|
|
890
901
|
//#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.tsx
|
|
891
|
-
var
|
|
892
|
-
let [n, r] =
|
|
902
|
+
var ht = ({ field: e, extra: t }) => {
|
|
903
|
+
let [n, r] = T(!1), { id: i, name: a, value: o, placeholder: s } = e, { node: c, setValue: l, error: u, label: f, helperText: p } = t, m = d(), h = o ? new Date(o) : void 0;
|
|
893
904
|
return /* @__PURE__ */ D(q, {
|
|
894
905
|
className: "tg:mb-4",
|
|
895
906
|
children: [
|
|
@@ -900,10 +911,10 @@ var pt = ({ field: e, extra: t }) => {
|
|
|
900
911
|
children: "*"
|
|
901
912
|
})]
|
|
902
913
|
}),
|
|
903
|
-
/* @__PURE__ */ D(
|
|
914
|
+
/* @__PURE__ */ D(ye, {
|
|
904
915
|
open: n,
|
|
905
916
|
onOpenChange: r,
|
|
906
|
-
children: [/* @__PURE__ */ E(
|
|
917
|
+
children: [/* @__PURE__ */ E(be, {
|
|
907
918
|
asChild: !0,
|
|
908
919
|
children: /* @__PURE__ */ D(K, {
|
|
909
920
|
variant: "outline",
|
|
@@ -912,10 +923,10 @@ var pt = ({ field: e, extra: t }) => {
|
|
|
912
923
|
className: "tg:w-full tg:justify-between tg:font-normal",
|
|
913
924
|
children: [h ? h.toLocaleDateString() : s || m("renderer.defaultInputs.selectDate"), /* @__PURE__ */ E(O, { className: "tg:size-4" })]
|
|
914
925
|
})
|
|
915
|
-
}), /* @__PURE__ */ E(
|
|
926
|
+
}), /* @__PURE__ */ E(xe, {
|
|
916
927
|
className: "tg:w-auto tg:overflow-hidden tg:p-0",
|
|
917
928
|
align: "start",
|
|
918
|
-
children: /* @__PURE__ */ E(
|
|
929
|
+
children: /* @__PURE__ */ E(pt, {
|
|
919
930
|
mode: "single",
|
|
920
931
|
selected: h,
|
|
921
932
|
captionLayout: "dropdown",
|
|
@@ -932,12 +943,12 @@ var pt = ({ field: e, extra: t }) => {
|
|
|
932
943
|
})
|
|
933
944
|
})]
|
|
934
945
|
}),
|
|
935
|
-
|
|
936
|
-
p && !
|
|
946
|
+
u && /* @__PURE__ */ E(Y, { children: u }),
|
|
947
|
+
p && !u && /* @__PURE__ */ E(J, { children: p })
|
|
937
948
|
]
|
|
938
949
|
});
|
|
939
|
-
},
|
|
940
|
-
let [n, r] =
|
|
950
|
+
}, gt = ({ field: e, extra: t }) => {
|
|
951
|
+
let [n, r] = T(!1), { id: i, value: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u } = t, f = d(), p = Array.isArray(a) ? a : [], m = p[0] ? new Date(p[0]) : void 0, h = p[1] ? new Date(p[1]) : void 0;
|
|
941
952
|
return /* @__PURE__ */ D(q, {
|
|
942
953
|
className: "tg:mb-4",
|
|
943
954
|
children: [
|
|
@@ -948,10 +959,10 @@ var pt = ({ field: e, extra: t }) => {
|
|
|
948
959
|
children: "*"
|
|
949
960
|
})]
|
|
950
961
|
}),
|
|
951
|
-
/* @__PURE__ */ D(
|
|
962
|
+
/* @__PURE__ */ D(ye, {
|
|
952
963
|
open: n,
|
|
953
964
|
onOpenChange: r,
|
|
954
|
-
children: [/* @__PURE__ */ E(
|
|
965
|
+
children: [/* @__PURE__ */ E(be, {
|
|
955
966
|
asChild: !0,
|
|
956
967
|
children: /* @__PURE__ */ D(K, {
|
|
957
968
|
id: i,
|
|
@@ -959,10 +970,10 @@ var pt = ({ field: e, extra: t }) => {
|
|
|
959
970
|
className: "tg:w-full tg:justify-between tg:font-normal",
|
|
960
971
|
children: [m && h ? `${m.toLocaleDateString()} - ${h.toLocaleDateString()}` : m ? m.toLocaleDateString() : f("renderer.defaultInputs.selectDateRange"), /* @__PURE__ */ E(O, { className: "tg:size-4" })]
|
|
961
972
|
})
|
|
962
|
-
}), /* @__PURE__ */ E(
|
|
973
|
+
}), /* @__PURE__ */ E(xe, {
|
|
963
974
|
className: "tg:w-auto tg:overflow-hidden tg:p-0",
|
|
964
975
|
align: "start",
|
|
965
|
-
children: /* @__PURE__ */ E(
|
|
976
|
+
children: /* @__PURE__ */ E(pt, {
|
|
966
977
|
mode: "range",
|
|
967
978
|
selected: {
|
|
968
979
|
from: m,
|
|
@@ -984,17 +995,17 @@ var pt = ({ field: e, extra: t }) => {
|
|
|
984
995
|
})]
|
|
985
996
|
}),
|
|
986
997
|
c && /* @__PURE__ */ E(Y, { children: c }),
|
|
987
|
-
|
|
998
|
+
u && !c && /* @__PURE__ */ E(J, { children: u })
|
|
988
999
|
]
|
|
989
1000
|
});
|
|
990
|
-
},
|
|
991
|
-
let { id: n, name: r, placeholder: i } = e, { node: a, setValue: o, error: s, label:
|
|
1001
|
+
}, _t = ({ field: e, extra: t }) => {
|
|
1002
|
+
let { id: n, name: r, placeholder: i } = e, { node: a, setValue: o, error: s, label: c, helperText: l } = t;
|
|
992
1003
|
return /* @__PURE__ */ D(q, {
|
|
993
1004
|
className: "tg:mb-4",
|
|
994
1005
|
children: [
|
|
995
1006
|
/* @__PURE__ */ D(Z, {
|
|
996
1007
|
htmlFor: n,
|
|
997
|
-
children: [
|
|
1008
|
+
children: [c || a.data.name, a.data.required && /* @__PURE__ */ E("span", {
|
|
998
1009
|
className: "tg:text-red-500",
|
|
999
1010
|
children: "*"
|
|
1000
1011
|
})]
|
|
@@ -1010,19 +1021,19 @@ var pt = ({ field: e, extra: t }) => {
|
|
|
1010
1021
|
return;
|
|
1011
1022
|
}
|
|
1012
1023
|
if (a.data.multiple) {
|
|
1013
|
-
o(await
|
|
1024
|
+
o(await u(Array.from(t)));
|
|
1014
1025
|
return;
|
|
1015
1026
|
}
|
|
1016
|
-
o(await
|
|
1027
|
+
o(await p(t[0]));
|
|
1017
1028
|
},
|
|
1018
1029
|
multiple: a.data.multiple,
|
|
1019
1030
|
placeholder: i
|
|
1020
1031
|
}),
|
|
1021
1032
|
s && /* @__PURE__ */ E(Y, { children: s }),
|
|
1022
|
-
|
|
1033
|
+
l && !s && /* @__PURE__ */ E(J, { children: l })
|
|
1023
1034
|
]
|
|
1024
1035
|
});
|
|
1025
|
-
},
|
|
1036
|
+
}, vt = ({ field: e }) => {
|
|
1026
1037
|
let { id: t, name: n, value: r } = e;
|
|
1027
1038
|
return /* @__PURE__ */ E(X, {
|
|
1028
1039
|
type: "hidden",
|
|
@@ -1030,271 +1041,277 @@ var pt = ({ field: e, extra: t }) => {
|
|
|
1030
1041
|
name: n,
|
|
1031
1042
|
value: r ?? ""
|
|
1032
1043
|
});
|
|
1033
|
-
},
|
|
1044
|
+
}, yt = (e) => {
|
|
1034
1045
|
let t = e.matchAll(/{{([\w-]+)}}/g);
|
|
1035
1046
|
return Array.from(t, (e) => e[1]);
|
|
1036
|
-
},
|
|
1047
|
+
}, bt = (e, t) => yt(e).every((e) => {
|
|
1037
1048
|
let n = t[e];
|
|
1038
1049
|
return n != null && n !== "";
|
|
1039
|
-
}),
|
|
1050
|
+
}), xt = (e, t, n = !1) => e.replace(/{{([\w-]+)}}/g, (e, r) => {
|
|
1040
1051
|
let i = t[r], a = i == null ? "" : String(i);
|
|
1041
1052
|
return n ? encodeURIComponent(a) : a;
|
|
1042
|
-
}),
|
|
1043
|
-
let [
|
|
1044
|
-
|
|
1045
|
-
|
|
1053
|
+
}), St = ({ field: n, extra: o }) => {
|
|
1054
|
+
let [u, p] = T(!1), [h, g] = T(null), [v, y] = T([]), [b, x] = T(""), [re, O] = T(!1), { id: k, name: ie, value: A, placeholder: oe } = n, { node: M, setValue: N, error: P, label: ce, helperText: F, missingDependencies: I } = o, { formValues: L, inputNodes: le, headers: ue, baseUrl: R } = r(), { httpConfig: z } = M.data, B = w(!1), de = w(!1), V = w(""), H = d(), fe = w(z), U = w(L), W = w(le), pe = w(ue), me = w(R), he = w(N), ge = w(null), Q = w(null), _e = w(M.data.normalizeOptionLabels !== !1), ve = C(() => z?.url ? yt(z.url) : [], [z?.url]), De = ve.length > 0, ke = C(() => ve.map((e) => `${e}:${String(L[e] ?? "")}`).join("|"), [ve, L]), Ae = C(() => z?.url ? De ? bt(z.url, L) : !0 : !1, [
|
|
1055
|
+
z?.url,
|
|
1056
|
+
De,
|
|
1046
1057
|
L
|
|
1047
|
-
]), $ =
|
|
1058
|
+
]), $ = ee(async (n) => {
|
|
1048
1059
|
Q.current && Q.current.abort();
|
|
1049
|
-
let
|
|
1050
|
-
Q.current =
|
|
1051
|
-
let o =
|
|
1060
|
+
let r = new AbortController();
|
|
1061
|
+
Q.current = r;
|
|
1062
|
+
let o = fe.current, u = U.current, d = he.current;
|
|
1052
1063
|
if (!o?.url) {
|
|
1053
|
-
g(
|
|
1064
|
+
g(H("renderer.defaultHttpInput.noUrlConfigured")), Q.current = null;
|
|
1054
1065
|
return;
|
|
1055
1066
|
}
|
|
1056
|
-
if (o.url && !
|
|
1067
|
+
if (o.url && !bt(o.url, u)) {
|
|
1057
1068
|
Q.current = null;
|
|
1058
1069
|
return;
|
|
1059
1070
|
}
|
|
1060
|
-
|
|
1071
|
+
p(!0), g(null);
|
|
1061
1072
|
try {
|
|
1062
|
-
let
|
|
1073
|
+
let p = f(xt(o.url, u, !0), me.current), h = _(o.searchParam && n ? `${p}${p.includes("?") ? "&" : "?"}${o.searchParam}=${encodeURIComponent(n)}` : p, a(o.queryParams, u)), v = s({ "Content-Type": "application/json" }, a(pe.current, u), a(o.headers, u)), b = [
|
|
1063
1074
|
"POST",
|
|
1064
1075
|
"PUT",
|
|
1065
1076
|
"PATCH"
|
|
1066
|
-
].includes(o.method || "") ? o.sendAllFormValues ? JSON.stringify(
|
|
1077
|
+
].includes(o.method || "") ? o.sendAllFormValues ? JSON.stringify(m(u, W.current)) : l(o.body, u, W.current) : void 0, ee = setTimeout(() => r.abort(), 3e4), x = await fetch(h, {
|
|
1067
1078
|
body: b || void 0,
|
|
1068
|
-
headers: Object.fromEntries(Object.entries(
|
|
1079
|
+
headers: Object.fromEntries(Object.entries(v).filter(([, e]) => e)),
|
|
1069
1080
|
method: o.method || "GET",
|
|
1070
|
-
signal:
|
|
1081
|
+
signal: r.signal
|
|
1071
1082
|
});
|
|
1072
|
-
if (clearTimeout(
|
|
1073
|
-
g(`HTTP Error ${
|
|
1083
|
+
if (clearTimeout(ee), !x.ok) {
|
|
1084
|
+
g(`HTTP Error ${x.status}: ${x.statusText}`);
|
|
1074
1085
|
return;
|
|
1075
1086
|
}
|
|
1076
|
-
let
|
|
1077
|
-
if (!
|
|
1078
|
-
g(
|
|
1087
|
+
let S = e(await x.text());
|
|
1088
|
+
if (!S.ok) {
|
|
1089
|
+
g(H("renderer.defaultHttpInput.invalidJson"));
|
|
1079
1090
|
return;
|
|
1080
1091
|
}
|
|
1081
|
-
let
|
|
1082
|
-
if (o.responseMapping && Array.isArray(
|
|
1083
|
-
let { valueField: e = "value", labelField:
|
|
1084
|
-
|
|
1085
|
-
let
|
|
1092
|
+
let C = i(S.value), w = o.responsePath ? t(C, o.responsePath) : C;
|
|
1093
|
+
if (o.responseMapping && Array.isArray(w)) {
|
|
1094
|
+
let { valueField: e = "value", labelField: n = "label", descriptionField: r, imageField: i } = o.responseMapping, a = _e.current;
|
|
1095
|
+
y(w.map((o) => {
|
|
1096
|
+
let s = r ? t(o, r) : void 0, l = i ? t(o, i) : void 0, u = String(t(o, n) || "");
|
|
1086
1097
|
return {
|
|
1087
|
-
description:
|
|
1088
|
-
image: typeof
|
|
1089
|
-
label:
|
|
1090
|
-
value: String(
|
|
1098
|
+
description: s != null && s !== "" ? String(s) : void 0,
|
|
1099
|
+
image: typeof l == "string" && l !== "" ? l : void 0,
|
|
1100
|
+
label: a ? c(u) : u,
|
|
1101
|
+
value: String(t(o, e) || "")
|
|
1091
1102
|
};
|
|
1092
1103
|
}));
|
|
1093
|
-
} else
|
|
1104
|
+
} else d(typeof w == "string" ? w : JSON.stringify(w));
|
|
1094
1105
|
} catch (e) {
|
|
1095
1106
|
if (e instanceof Error && e.name === "AbortError") return;
|
|
1096
|
-
g(e instanceof Error ? e.message :
|
|
1107
|
+
g(e instanceof Error ? e.message : H("renderer.defaultHttpInput.fetchFailed")), console.error("HTTP Input fetch error:", e);
|
|
1097
1108
|
} finally {
|
|
1098
|
-
|
|
1109
|
+
Q.current === r && (p(!1), Q.current = null);
|
|
1099
1110
|
}
|
|
1100
|
-
}, [
|
|
1101
|
-
if (
|
|
1102
|
-
|
|
1111
|
+
}, [H]);
|
|
1112
|
+
if (S(() => {
|
|
1113
|
+
fe.current = z, U.current = L, W.current = le, pe.current = ue, me.current = R, he.current = N, ge.current = $, _e.current = M.data.normalizeOptionLabels !== !1;
|
|
1103
1114
|
}, [
|
|
1104
|
-
|
|
1115
|
+
z,
|
|
1105
1116
|
L,
|
|
1106
|
-
|
|
1117
|
+
le,
|
|
1118
|
+
ue,
|
|
1107
1119
|
R,
|
|
1108
|
-
z,
|
|
1109
1120
|
N,
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
e
|
|
1118
|
-
|
|
1119
|
-
|
|
1121
|
+
$,
|
|
1122
|
+
M.data.normalizeOptionLabels
|
|
1123
|
+
]), S(() => () => {
|
|
1124
|
+
Q.current && Q.current.abort(), B.current = !1, de.current = !1;
|
|
1125
|
+
}, []), S(() => {
|
|
1126
|
+
if (B.current) return;
|
|
1127
|
+
B.current = !0;
|
|
1128
|
+
let e = fe.current, t = U.current, n = ge.current, r = e?.url && bt(e.url, t);
|
|
1129
|
+
e?.fetchOnMount && r && n && (n(), e.url && (V.current = yt(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
|
|
1130
|
+
}, []), S(() => {
|
|
1131
|
+
if (!B.current || !De || V.current === ke || !Ae) return;
|
|
1120
1132
|
let e = setTimeout(() => {
|
|
1121
|
-
$(),
|
|
1133
|
+
$(), V.current = ke;
|
|
1122
1134
|
}, 500);
|
|
1123
1135
|
return () => clearTimeout(e);
|
|
1124
1136
|
}, [
|
|
1137
|
+
ke,
|
|
1125
1138
|
De,
|
|
1126
|
-
|
|
1127
|
-
Oe,
|
|
1139
|
+
Ae,
|
|
1128
1140
|
$
|
|
1129
|
-
]),
|
|
1130
|
-
if (!
|
|
1131
|
-
|
|
1141
|
+
]), S(() => {
|
|
1142
|
+
if (!de.current) {
|
|
1143
|
+
de.current = !0;
|
|
1132
1144
|
return;
|
|
1133
1145
|
}
|
|
1134
|
-
let e =
|
|
1135
|
-
e?.fetchOnMount && r && n && (n(), e.url && (
|
|
1136
|
-
}, [
|
|
1137
|
-
body:
|
|
1138
|
-
fetchOnMount:
|
|
1139
|
-
headers:
|
|
1140
|
-
method:
|
|
1141
|
-
queryParams:
|
|
1142
|
-
responseMapping:
|
|
1143
|
-
responsePath:
|
|
1144
|
-
searchParam:
|
|
1145
|
-
sendAllFormValues:
|
|
1146
|
-
url:
|
|
1147
|
-
}), [
|
|
1148
|
-
if (!(
|
|
1146
|
+
let e = fe.current, t = U.current, n = ge.current, r = e?.url && bt(e.url, t);
|
|
1147
|
+
e?.fetchOnMount && r && n && (n(), e.url && (V.current = yt(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
|
|
1148
|
+
}, [C(() => JSON.stringify({
|
|
1149
|
+
body: z?.body,
|
|
1150
|
+
fetchOnMount: z?.fetchOnMount,
|
|
1151
|
+
headers: z?.headers,
|
|
1152
|
+
method: z?.method,
|
|
1153
|
+
queryParams: z?.queryParams,
|
|
1154
|
+
responseMapping: z?.responseMapping,
|
|
1155
|
+
responsePath: z?.responsePath,
|
|
1156
|
+
searchParam: z?.searchParam,
|
|
1157
|
+
sendAllFormValues: z?.sendAllFormValues,
|
|
1158
|
+
url: z?.url
|
|
1159
|
+
}), [z])]), S(() => {
|
|
1160
|
+
if (!(z?.searchParam && b)) return;
|
|
1149
1161
|
let e = setTimeout(() => {
|
|
1150
1162
|
$(b);
|
|
1151
1163
|
}, 300);
|
|
1152
1164
|
return () => clearTimeout(e);
|
|
1153
1165
|
}, [
|
|
1154
1166
|
b,
|
|
1155
|
-
|
|
1167
|
+
z?.searchParam,
|
|
1156
1168
|
$
|
|
1157
|
-
]),
|
|
1158
|
-
let e = Array.isArray(A) ? A[0] : A, t =
|
|
1159
|
-
if (
|
|
1160
|
-
let n =
|
|
1161
|
-
className: "tg:flex tg:items-center tg:gap-2",
|
|
1162
|
-
children: [/* @__PURE__ */ E(j, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ E("span", {
|
|
1163
|
-
className: "tg:text-muted-foreground",
|
|
1164
|
-
children: t?.label || ae || U("renderer.defaultHttpInput.search")
|
|
1165
|
-
})]
|
|
1166
|
-
}) : t?.label || ae || U("renderer.defaultHttpInput.search");
|
|
1169
|
+
]), z?.responseMapping) {
|
|
1170
|
+
let e = Array.isArray(A) ? A[0] : A, t = v.find((t) => t.value === e);
|
|
1171
|
+
if (z.searchParam) {
|
|
1172
|
+
let n = u && z?.showLoading, r = t?.label || oe || H("renderer.defaultHttpInput.search");
|
|
1167
1173
|
return /* @__PURE__ */ D(q, {
|
|
1168
1174
|
className: "tg:mb-4",
|
|
1169
1175
|
children: [
|
|
1170
1176
|
/* @__PURE__ */ D(Z, {
|
|
1171
1177
|
htmlFor: k,
|
|
1172
|
-
children: [
|
|
1178
|
+
children: [ce || M.data.name, M.data.required && /* @__PURE__ */ E("span", {
|
|
1173
1179
|
className: "tg:text-red-500",
|
|
1174
1180
|
children: "*"
|
|
1175
1181
|
})]
|
|
1176
1182
|
}),
|
|
1177
|
-
/* @__PURE__ */ E(
|
|
1178
|
-
missing:
|
|
1183
|
+
/* @__PURE__ */ E(tt, {
|
|
1184
|
+
missing: I,
|
|
1179
1185
|
children: /* @__PURE__ */ D("div", {
|
|
1180
1186
|
className: "tg:relative",
|
|
1181
|
-
children: [
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
}),
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
className: "tg:
|
|
1217
|
-
children:
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
},
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1187
|
+
children: [
|
|
1188
|
+
/* @__PURE__ */ D(ye, {
|
|
1189
|
+
open: re,
|
|
1190
|
+
onOpenChange: O,
|
|
1191
|
+
children: [/* @__PURE__ */ E(be, {
|
|
1192
|
+
asChild: !0,
|
|
1193
|
+
children: /* @__PURE__ */ D(K, {
|
|
1194
|
+
id: k,
|
|
1195
|
+
variant: "outline",
|
|
1196
|
+
role: "combobox",
|
|
1197
|
+
"aria-expanded": re,
|
|
1198
|
+
disabled: I.length > 0,
|
|
1199
|
+
className: G("tg:w-full tg:justify-between", (e || n) && "tg:pr-14"),
|
|
1200
|
+
children: [/* @__PURE__ */ E("span", {
|
|
1201
|
+
className: "tg:truncate",
|
|
1202
|
+
children: r
|
|
1203
|
+
}), /* @__PURE__ */ E(ae, { className: "tg:ml-2 tg:h-4 tg:w-4 tg:shrink-0 tg:opacity-50" })]
|
|
1204
|
+
})
|
|
1205
|
+
}), /* @__PURE__ */ E(xe, {
|
|
1206
|
+
className: "tg:w-[var(--radix-popover-trigger-width)] tg:p-0",
|
|
1207
|
+
align: "start",
|
|
1208
|
+
children: /* @__PURE__ */ D(Ge, {
|
|
1209
|
+
shouldFilter: !1,
|
|
1210
|
+
children: [/* @__PURE__ */ E(Ke, {
|
|
1211
|
+
placeholder: H("renderer.defaultHttpInput.search"),
|
|
1212
|
+
value: b,
|
|
1213
|
+
onValueChange: (e) => {
|
|
1214
|
+
x(e), g(null);
|
|
1215
|
+
}
|
|
1216
|
+
}), /* @__PURE__ */ D(qe, { children: [
|
|
1217
|
+
u && /* @__PURE__ */ E("div", {
|
|
1218
|
+
className: "tg:flex tg:items-center tg:justify-center tg:p-4",
|
|
1219
|
+
children: /* @__PURE__ */ E(j, { className: "tg:h-4 tg:w-4 tg:animate-spin" })
|
|
1220
|
+
}),
|
|
1221
|
+
!u && h && /* @__PURE__ */ D("div", {
|
|
1222
|
+
className: "tg:p-4 tg:text-destructive tg:text-sm",
|
|
1223
|
+
children: [/* @__PURE__ */ E("div", { children: h }), /* @__PURE__ */ E("button", {
|
|
1224
|
+
type: "button",
|
|
1225
|
+
onClick: () => $(b),
|
|
1226
|
+
className: "tg:mt-2 tg:block tg:text-primary tg:hover:underline",
|
|
1227
|
+
children: H("renderer.defaultHttpInput.retry")
|
|
1228
|
+
})]
|
|
1229
|
+
}),
|
|
1230
|
+
!(u || h) && /* @__PURE__ */ D(te, { children: [/* @__PURE__ */ E(Je, { children: H("renderer.defaultHttpInput.noResults") }), /* @__PURE__ */ E(Ye, { children: v.map((e) => /* @__PURE__ */ D(Xe, {
|
|
1231
|
+
value: e.value,
|
|
1232
|
+
onSelect: () => {
|
|
1233
|
+
N(e.value === A ? "" : e.value), O(!1);
|
|
1234
|
+
},
|
|
1235
|
+
children: [/* @__PURE__ */ E(ne, { className: G("tg:mr-2 tg:h-4 tg:w-4", A === e.value ? "tg:opacity-100" : "tg:opacity-0") }), /* @__PURE__ */ E(ct, {
|
|
1236
|
+
label: e.label,
|
|
1237
|
+
description: e.description,
|
|
1238
|
+
image: e.image
|
|
1239
|
+
})]
|
|
1240
|
+
}, e.value)) })] })
|
|
1241
|
+
] })]
|
|
1242
|
+
})
|
|
1243
|
+
})]
|
|
1244
|
+
}),
|
|
1245
|
+
n && /* @__PURE__ */ E(j, { className: "tg:-translate-y-1/2 tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-8 tg:size-4 tg:animate-spin tg:text-muted-foreground" }),
|
|
1246
|
+
e && !n && I.length === 0 && /* @__PURE__ */ E("button", {
|
|
1247
|
+
type: "button",
|
|
1248
|
+
"aria-label": H("common.clear"),
|
|
1249
|
+
onClick: () => N(""),
|
|
1250
|
+
className: "tg:-translate-y-1/2 tg:absolute tg:top-1/2 tg:right-8 tg:rounded-sm tg:p-0.5 tg:text-muted-foreground tg:opacity-70 tg:transition-opacity tg:hover:opacity-100",
|
|
1251
|
+
children: /* @__PURE__ */ E(se, { className: "tg:size-4" })
|
|
1252
|
+
})
|
|
1253
|
+
]
|
|
1241
1254
|
})
|
|
1242
1255
|
}),
|
|
1243
1256
|
P && /* @__PURE__ */ E(Y, { children: P }),
|
|
1244
|
-
|
|
1257
|
+
F && !P && /* @__PURE__ */ E(J, { children: F })
|
|
1245
1258
|
]
|
|
1246
1259
|
});
|
|
1247
1260
|
}
|
|
1248
|
-
let n =
|
|
1261
|
+
let n = u && z?.showLoading, r = I.length === 0 && v.length === 0 && !n ? h ?? H("renderer.defaultHttpInput.noDataAvailable") : void 0, i = Array.isArray(A) ? A[0] ?? "" : A ?? "", a = /* @__PURE__ */ D("div", {
|
|
1249
1262
|
className: "tg:relative",
|
|
1250
|
-
children: [
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
"
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1263
|
+
children: [
|
|
1264
|
+
/* @__PURE__ */ D(Se, {
|
|
1265
|
+
value: i,
|
|
1266
|
+
onValueChange: (e) => N(e),
|
|
1267
|
+
disabled: n || v.length === 0,
|
|
1268
|
+
name: ie,
|
|
1269
|
+
children: [/* @__PURE__ */ E(Te, {
|
|
1270
|
+
id: k,
|
|
1271
|
+
name: ie,
|
|
1272
|
+
className: G("tg:w-full", (i || n) && "tg:pr-14"),
|
|
1273
|
+
children: /* @__PURE__ */ E(we, { placeholder: oe || H("renderer.defaultHttpInput.selectOption") })
|
|
1274
|
+
}), /* @__PURE__ */ E(Ee, { children: /* @__PURE__ */ E(Ce, { children: v.map((e, t) => /* @__PURE__ */ E(Oe, {
|
|
1275
|
+
value: e.value,
|
|
1276
|
+
children: /* @__PURE__ */ E(ct, {
|
|
1277
|
+
label: e.label,
|
|
1278
|
+
description: e.description,
|
|
1279
|
+
image: e.image
|
|
1280
|
+
})
|
|
1281
|
+
}, e.value + t)) }) })]
|
|
1282
|
+
}),
|
|
1283
|
+
n && /* @__PURE__ */ E(j, { className: "tg:-translate-y-1/2 tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-8 tg:size-4 tg:animate-spin tg:text-muted-foreground" }),
|
|
1284
|
+
i && !n && /* @__PURE__ */ E("button", {
|
|
1285
|
+
type: "button",
|
|
1286
|
+
"aria-label": H("common.clear"),
|
|
1287
|
+
onClick: () => N(""),
|
|
1288
|
+
className: "tg:-translate-y-1/2 tg:absolute tg:top-1/2 tg:right-8 tg:rounded-sm tg:p-0.5 tg:text-muted-foreground tg:opacity-70 tg:transition-opacity tg:hover:opacity-100",
|
|
1289
|
+
children: /* @__PURE__ */ E(se, { className: "tg:size-4" })
|
|
1290
|
+
})
|
|
1291
|
+
]
|
|
1275
1292
|
});
|
|
1276
1293
|
return /* @__PURE__ */ D(q, {
|
|
1277
1294
|
className: "tg:mb-4",
|
|
1278
1295
|
children: [
|
|
1279
1296
|
/* @__PURE__ */ D(Z, {
|
|
1280
1297
|
htmlFor: k,
|
|
1281
|
-
children: [
|
|
1298
|
+
children: [ce || M.data.name, M.data.required && /* @__PURE__ */ E("span", {
|
|
1282
1299
|
className: "tg:text-red-500",
|
|
1283
1300
|
children: "*"
|
|
1284
1301
|
})]
|
|
1285
1302
|
}),
|
|
1286
|
-
/* @__PURE__ */ E(
|
|
1287
|
-
missing:
|
|
1288
|
-
children: r ? /* @__PURE__ */ E(
|
|
1303
|
+
/* @__PURE__ */ E(tt, {
|
|
1304
|
+
missing: I,
|
|
1305
|
+
children: r ? /* @__PURE__ */ E(je, { children: /* @__PURE__ */ D(Me, { children: [/* @__PURE__ */ E(Ne, {
|
|
1289
1306
|
asChild: !0,
|
|
1290
1307
|
children: /* @__PURE__ */ E("div", {
|
|
1291
1308
|
className: "tg:w-full",
|
|
1292
1309
|
children: a
|
|
1293
1310
|
})
|
|
1294
|
-
}), /* @__PURE__ */ E(
|
|
1311
|
+
}), /* @__PURE__ */ E(Pe, { children: /* @__PURE__ */ E("p", { children: r }) })] }) }) : a
|
|
1295
1312
|
}),
|
|
1296
1313
|
P && /* @__PURE__ */ E(Y, { children: P }),
|
|
1297
|
-
|
|
1314
|
+
F && !P && /* @__PURE__ */ E(J, { children: F })
|
|
1298
1315
|
]
|
|
1299
1316
|
});
|
|
1300
1317
|
}
|
|
@@ -1303,24 +1320,24 @@ var pt = ({ field: e, extra: t }) => {
|
|
|
1303
1320
|
children: [
|
|
1304
1321
|
/* @__PURE__ */ D(Z, {
|
|
1305
1322
|
htmlFor: k,
|
|
1306
|
-
children: [
|
|
1323
|
+
children: [ce || M.data.name, M.data.required && /* @__PURE__ */ E("span", {
|
|
1307
1324
|
className: "tg:text-red-500",
|
|
1308
1325
|
children: "*"
|
|
1309
1326
|
})]
|
|
1310
1327
|
}),
|
|
1311
1328
|
/* @__PURE__ */ E(X, {
|
|
1312
1329
|
type: "text",
|
|
1313
|
-
name:
|
|
1330
|
+
name: ie,
|
|
1314
1331
|
id: k,
|
|
1315
1332
|
value: typeof A == "string" ? A : JSON.stringify(A),
|
|
1316
1333
|
readOnly: !0,
|
|
1317
1334
|
disabled: !0
|
|
1318
1335
|
}),
|
|
1319
1336
|
P && /* @__PURE__ */ E(Y, { children: P }),
|
|
1320
|
-
|
|
1337
|
+
F && !P && /* @__PURE__ */ E(J, { children: F })
|
|
1321
1338
|
]
|
|
1322
1339
|
});
|
|
1323
|
-
},
|
|
1340
|
+
}, Ct = ({ field: e, extra: t }) => {
|
|
1324
1341
|
let { id: n, name: r, value: i, placeholder: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u } = t;
|
|
1325
1342
|
return /* @__PURE__ */ D(q, {
|
|
1326
1343
|
className: "tg:mb-4",
|
|
@@ -1344,7 +1361,7 @@ var pt = ({ field: e, extra: t }) => {
|
|
|
1344
1361
|
u && !c && /* @__PURE__ */ E(J, { children: u })
|
|
1345
1362
|
]
|
|
1346
1363
|
});
|
|
1347
|
-
},
|
|
1364
|
+
}, wt = ({ field: e, extra: t }) => {
|
|
1348
1365
|
let { id: n, name: r, value: i, placeholder: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u } = t;
|
|
1349
1366
|
return /* @__PURE__ */ D(q, {
|
|
1350
1367
|
className: "tg:mb-4",
|
|
@@ -1369,7 +1386,7 @@ var pt = ({ field: e, extra: t }) => {
|
|
|
1369
1386
|
u && !c && /* @__PURE__ */ E(J, { children: u })
|
|
1370
1387
|
]
|
|
1371
1388
|
});
|
|
1372
|
-
},
|
|
1389
|
+
}, Tt = F("tg:group/field tg:flex tg:w-full tg:gap-3 tg:data-[invalid=true]:text-destructive", {
|
|
1373
1390
|
defaultVariants: { orientation: "vertical" },
|
|
1374
1391
|
variants: { orientation: {
|
|
1375
1392
|
horizontal: [
|
|
@@ -1385,37 +1402,37 @@ var pt = ({ field: e, extra: t }) => {
|
|
|
1385
1402
|
vertical: ["tg:flex-col tg:[&>*]:w-full tg:[&>.sr-only]:w-auto"]
|
|
1386
1403
|
} }
|
|
1387
1404
|
});
|
|
1388
|
-
function
|
|
1405
|
+
function Et({ className: e, orientation: t = "vertical", ...n }) {
|
|
1389
1406
|
return /* @__PURE__ */ E("div", {
|
|
1390
1407
|
role: "group",
|
|
1391
1408
|
"data-slot": "field",
|
|
1392
1409
|
"data-orientation": t,
|
|
1393
|
-
className: G(
|
|
1410
|
+
className: G(Tt({ orientation: t }), e),
|
|
1394
1411
|
...n
|
|
1395
1412
|
});
|
|
1396
1413
|
}
|
|
1397
|
-
function
|
|
1414
|
+
function Dt({ className: e, ...t }) {
|
|
1398
1415
|
return /* @__PURE__ */ E("div", {
|
|
1399
1416
|
"data-slot": "field-content",
|
|
1400
1417
|
className: G("tg:group/field-content tg:flex tg:flex-1 tg:flex-col tg:gap-1.5 tg:leading-snug", e),
|
|
1401
1418
|
...t
|
|
1402
1419
|
});
|
|
1403
1420
|
}
|
|
1404
|
-
function
|
|
1421
|
+
function Ot({ className: e, ...t }) {
|
|
1405
1422
|
return /* @__PURE__ */ E(Z, {
|
|
1406
1423
|
"data-slot": "field-label",
|
|
1407
1424
|
className: G("tg:group/field-label tg:peer/field-label tg:flex tg:w-fit tg:gap-2 tg:leading-snug tg:group-data-[disabled=true]/field:opacity-50", "tg:has-[>[data-slot=field]]:w-full tg:has-[>[data-slot=field]]:flex-col tg:has-[>[data-slot=field]]:rounded-md tg:has-[>[data-slot=field]]:border tg:[&>*]:data-[slot=field]:p-4", "tg:has-data-[state=checked]:border-primary tg:has-data-[state=checked]:bg-primary/5 tg:dark:has-data-[state=checked]:bg-primary/10", e),
|
|
1408
1425
|
...t
|
|
1409
1426
|
});
|
|
1410
1427
|
}
|
|
1411
|
-
function
|
|
1428
|
+
function kt({ className: e, ...t }) {
|
|
1412
1429
|
return /* @__PURE__ */ E("div", {
|
|
1413
1430
|
"data-slot": "field-label",
|
|
1414
1431
|
className: G("tg:flex tg:w-fit tg:items-center tg:gap-2 tg:font-medium tg:text-sm tg:leading-snug tg:group-data-[disabled=true]/field:opacity-50", e),
|
|
1415
1432
|
...t
|
|
1416
1433
|
});
|
|
1417
1434
|
}
|
|
1418
|
-
function
|
|
1435
|
+
function At({ className: e, ...t }) {
|
|
1419
1436
|
return /* @__PURE__ */ E("p", {
|
|
1420
1437
|
"data-slot": "field-description",
|
|
1421
1438
|
className: G("tg:font-normal tg:text-muted-foreground tg:text-sm tg:leading-normal tg:group-has-[[data-orientation=horizontal]]/field:text-balance", "tg:last:mt-0 tg:nth-last-2:-mt-1 tg:[[data-variant=legend]+&]:-mt-1.5", "tg:[&>a]:underline tg:[&>a]:underline-offset-4 tg:[&>a:hover]:text-primary", e),
|
|
@@ -1424,14 +1441,14 @@ function Ot({ className: e, ...t }) {
|
|
|
1424
1441
|
}
|
|
1425
1442
|
//#endregion
|
|
1426
1443
|
//#region src/shared/components/ui/radio-group.tsx
|
|
1427
|
-
function
|
|
1444
|
+
function jt({ className: e, ...t }) {
|
|
1428
1445
|
return /* @__PURE__ */ E(W.Root, {
|
|
1429
1446
|
"data-slot": "radio-group",
|
|
1430
1447
|
className: G("tg:grid tg:gap-3", e),
|
|
1431
1448
|
...t
|
|
1432
1449
|
});
|
|
1433
1450
|
}
|
|
1434
|
-
function
|
|
1451
|
+
function Mt({ className: e, ...t }) {
|
|
1435
1452
|
return /* @__PURE__ */ E(W.Item, {
|
|
1436
1453
|
"data-slot": "radio-group-item",
|
|
1437
1454
|
className: G("tg:aspect-square tg:size-4 tg:shrink-0 tg:rounded-full tg:border tg:border-input tg:text-primary tg:shadow-xs tg:outline-none tg:transition-[color,box-shadow] tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:dark:bg-input/30 tg:dark:aria-invalid:ring-destructive/40", e),
|
|
@@ -1439,42 +1456,42 @@ function At({ className: e, ...t }) {
|
|
|
1439
1456
|
children: /* @__PURE__ */ E(W.Indicator, {
|
|
1440
1457
|
"data-slot": "radio-group-indicator",
|
|
1441
1458
|
className: "tg:relative tg:flex tg:items-center tg:justify-center",
|
|
1442
|
-
children: /* @__PURE__ */ E(
|
|
1459
|
+
children: /* @__PURE__ */ E(oe, { className: "tg:-translate-x-1/2 tg:-translate-y-1/2 tg:absolute tg:top-1/2 tg:left-1/2 tg:size-2 tg:fill-primary" })
|
|
1443
1460
|
})
|
|
1444
1461
|
});
|
|
1445
1462
|
}
|
|
1446
1463
|
//#endregion
|
|
1447
1464
|
//#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.tsx
|
|
1448
|
-
var
|
|
1449
|
-
let { id: n, name: i, value: a } = e, { node: o, setValue: s, error: c, label: l, helperText:
|
|
1465
|
+
var Nt = ({ field: e, extra: t }) => {
|
|
1466
|
+
let { id: n, name: i, value: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u, renderOptionExtras: f, compactOptions: p, missingDependencies: m } = t, { options: h, isLoading: g, error: _ } = ut(o), { optionsDisplayLimit: v } = r(), y = d(), b = a ? String(a) : "", ee = o.data.variant !== "default", x = `${n}-label`, S = v ? h.slice(0, v) : h, C = h.length - S.length;
|
|
1450
1467
|
return /* @__PURE__ */ D(q, {
|
|
1451
1468
|
className: "tg:mb-4",
|
|
1452
1469
|
children: [
|
|
1453
1470
|
/* @__PURE__ */ D(Z, {
|
|
1454
1471
|
className: "tg:mb-1",
|
|
1455
|
-
id:
|
|
1472
|
+
id: x,
|
|
1456
1473
|
children: [l || o.data.name, o.data.required && /* @__PURE__ */ E("span", {
|
|
1457
1474
|
className: "tg:text-red-500",
|
|
1458
1475
|
children: "*"
|
|
1459
1476
|
})]
|
|
1460
1477
|
}),
|
|
1461
|
-
/* @__PURE__ */ E(
|
|
1478
|
+
/* @__PURE__ */ E(nt, { missing: m }),
|
|
1462
1479
|
g && /* @__PURE__ */ D("div", {
|
|
1463
1480
|
className: "tg:flex tg:items-center tg:gap-2 tg:py-2 tg:text-muted-foreground tg:text-sm",
|
|
1464
1481
|
children: [/* @__PURE__ */ E(j, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ E("span", { children: y("renderer.defaultRadioInput.loadingOptions") })]
|
|
1465
1482
|
}),
|
|
1466
|
-
/* @__PURE__ */ D(
|
|
1483
|
+
/* @__PURE__ */ D(jt, {
|
|
1467
1484
|
value: b,
|
|
1468
1485
|
onValueChange: (e) => s(e),
|
|
1469
|
-
"aria-labelledby":
|
|
1486
|
+
"aria-labelledby": x,
|
|
1470
1487
|
name: i,
|
|
1471
|
-
className: G("tg:min-w-0",
|
|
1472
|
-
children: [
|
|
1488
|
+
className: G("tg:min-w-0", ee && "tg:flex tg:flex-col tg:gap-2"),
|
|
1489
|
+
children: [S.map((e, t) => {
|
|
1473
1490
|
let r = `${n}-${e.value}`, i = y(e.label) || e.value, a = y(e.description), o = String(e.value);
|
|
1474
|
-
return
|
|
1491
|
+
return ee ? /* @__PURE__ */ D(Ot, {
|
|
1475
1492
|
htmlFor: r,
|
|
1476
1493
|
className: G("tg:group/option tg:pointer-events-auto tg:relative", p && "tg:group-hover/option:pr-16"),
|
|
1477
|
-
children: [/* @__PURE__ */ D(
|
|
1494
|
+
children: [/* @__PURE__ */ D(Et, {
|
|
1478
1495
|
orientation: "horizontal",
|
|
1479
1496
|
"data-disabled": e.disabled || void 0,
|
|
1480
1497
|
children: [
|
|
@@ -1483,17 +1500,17 @@ var jt = ({ field: e, extra: t }) => {
|
|
|
1483
1500
|
alt: "",
|
|
1484
1501
|
className: "tg:h-10 tg:w-10 tg:shrink-0 tg:self-center tg:rounded tg:object-cover"
|
|
1485
1502
|
}),
|
|
1486
|
-
/* @__PURE__ */ D(
|
|
1503
|
+
/* @__PURE__ */ D(Dt, {
|
|
1487
1504
|
className: G(p && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
|
|
1488
|
-
children: [/* @__PURE__ */ E(
|
|
1505
|
+
children: [/* @__PURE__ */ E(kt, {
|
|
1489
1506
|
className: G(p && "tg:block tg:max-w-full tg:truncate"),
|
|
1490
1507
|
children: i
|
|
1491
|
-
}), a && /* @__PURE__ */ E(
|
|
1508
|
+
}), a && /* @__PURE__ */ E(At, {
|
|
1492
1509
|
className: G(p && "tg:block tg:max-w-full tg:truncate"),
|
|
1493
1510
|
children: a
|
|
1494
1511
|
})]
|
|
1495
1512
|
}),
|
|
1496
|
-
/* @__PURE__ */ E(
|
|
1513
|
+
/* @__PURE__ */ E(Mt, {
|
|
1497
1514
|
value: o,
|
|
1498
1515
|
id: r,
|
|
1499
1516
|
disabled: e.disabled,
|
|
@@ -1508,7 +1525,7 @@ var jt = ({ field: e, extra: t }) => {
|
|
|
1508
1525
|
}, e.value + t) : /* @__PURE__ */ D("div", {
|
|
1509
1526
|
className: G("tg:group/option tg:pointer-events-auto tg:relative tg:flex tg:items-start tg:space-x-2", p && "tg:min-w-0 tg:pr-22"),
|
|
1510
1527
|
children: [
|
|
1511
|
-
/* @__PURE__ */ E(
|
|
1528
|
+
/* @__PURE__ */ E(Mt, {
|
|
1512
1529
|
value: o,
|
|
1513
1530
|
id: r,
|
|
1514
1531
|
disabled: e.disabled,
|
|
@@ -1537,18 +1554,18 @@ var jt = ({ field: e, extra: t }) => {
|
|
|
1537
1554
|
})
|
|
1538
1555
|
]
|
|
1539
1556
|
}, e.value + t);
|
|
1540
|
-
}),
|
|
1557
|
+
}), C > 0 && /* @__PURE__ */ E("div", {
|
|
1541
1558
|
className: "tg:px-2 tg:py-1 tg:text-muted-foreground tg:text-xs",
|
|
1542
1559
|
children: "…"
|
|
1543
1560
|
})]
|
|
1544
1561
|
}),
|
|
1545
1562
|
c && /* @__PURE__ */ E(Y, { children: c }),
|
|
1546
1563
|
_ && !c && /* @__PURE__ */ E(Y, { children: _ }),
|
|
1547
|
-
|
|
1564
|
+
u && !c && !_ && /* @__PURE__ */ E(J, { children: u })
|
|
1548
1565
|
]
|
|
1549
1566
|
});
|
|
1550
|
-
},
|
|
1551
|
-
let { id: n, name: r, value: i, placeholder: a } = e, { node: o, setValue: s, error: c, label: l, helperText:
|
|
1567
|
+
}, Pt = ({ field: e, extra: t }) => {
|
|
1568
|
+
let { id: n, name: r, value: i, placeholder: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u, missingDependencies: f } = t, { options: p, isLoading: m, error: h } = ut(o), g = d(), _ = i ? String(i) : "";
|
|
1552
1569
|
return /* @__PURE__ */ D(q, {
|
|
1553
1570
|
className: "tg:mb-4",
|
|
1554
1571
|
children: [
|
|
@@ -1559,52 +1576,56 @@ var jt = ({ field: e, extra: t }) => {
|
|
|
1559
1576
|
children: "*"
|
|
1560
1577
|
})]
|
|
1561
1578
|
}),
|
|
1562
|
-
/* @__PURE__ */ E(
|
|
1579
|
+
/* @__PURE__ */ E(tt, {
|
|
1563
1580
|
missing: f,
|
|
1564
1581
|
children: /* @__PURE__ */ D("div", {
|
|
1565
1582
|
className: "tg:relative",
|
|
1566
|
-
children: [
|
|
1567
|
-
|
|
1568
|
-
value: _,
|
|
1569
|
-
onValueChange: (e) => s(e),
|
|
1570
|
-
disabled: m || f.length > 0,
|
|
1571
|
-
children: [/* @__PURE__ */ D(Ce, {
|
|
1572
|
-
id: n,
|
|
1583
|
+
children: [
|
|
1584
|
+
/* @__PURE__ */ D(Se, {
|
|
1573
1585
|
name: r,
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1586
|
+
value: _,
|
|
1587
|
+
onValueChange: (e) => s(e),
|
|
1588
|
+
disabled: m || f.length > 0,
|
|
1589
|
+
children: [/* @__PURE__ */ E(Te, {
|
|
1590
|
+
id: n,
|
|
1591
|
+
name: r,
|
|
1592
|
+
className: G("tg:w-full", (_ || m) && "tg:pr-14"),
|
|
1593
|
+
children: /* @__PURE__ */ E(we, { placeholder: a || g("renderer.defaultSelectInput.selectOption") })
|
|
1594
|
+
}), /* @__PURE__ */ E(Ee, { children: /* @__PURE__ */ E(Ce, { children: p.map((e, t) => /* @__PURE__ */ E(Oe, {
|
|
1595
|
+
value: String(e.value),
|
|
1596
|
+
disabled: e.disabled,
|
|
1597
|
+
children: /* @__PURE__ */ E(ct, {
|
|
1598
|
+
label: g(e.label) || e.value,
|
|
1599
|
+
description: g(e.description),
|
|
1600
|
+
image: e.image
|
|
1601
|
+
})
|
|
1602
|
+
}, `${e.value}-${t}`)) }) })]
|
|
1603
|
+
}),
|
|
1604
|
+
m && /* @__PURE__ */ E(j, { className: "tg:-translate-y-1/2 tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-8 tg:size-4 tg:animate-spin tg:text-muted-foreground" }),
|
|
1605
|
+
_ && !m && f.length === 0 && /* @__PURE__ */ E("button", {
|
|
1606
|
+
type: "button",
|
|
1607
|
+
"aria-label": g("common.clear"),
|
|
1608
|
+
onClick: () => s(""),
|
|
1609
|
+
className: "tg:-translate-y-1/2 tg:absolute tg:top-1/2 tg:right-8 tg:rounded-sm tg:p-0.5 tg:text-muted-foreground tg:opacity-70 tg:transition-opacity tg:hover:opacity-100",
|
|
1610
|
+
children: /* @__PURE__ */ E(se, { className: "tg:size-4" })
|
|
1611
|
+
})
|
|
1612
|
+
]
|
|
1592
1613
|
})
|
|
1593
1614
|
}),
|
|
1594
1615
|
c && /* @__PURE__ */ E(Y, { children: c }),
|
|
1595
1616
|
h && !c && /* @__PURE__ */ E(Y, { children: h }),
|
|
1596
|
-
|
|
1617
|
+
u && !c && !h && /* @__PURE__ */ E(J, { children: u })
|
|
1597
1618
|
]
|
|
1598
1619
|
});
|
|
1599
|
-
},
|
|
1620
|
+
}, Ft = (e) => null;
|
|
1600
1621
|
//#endregion
|
|
1601
1622
|
//#region src/shared/components/ui/switch.tsx
|
|
1602
|
-
function
|
|
1603
|
-
return /* @__PURE__ */ E(
|
|
1623
|
+
function It({ className: e, ...t }) {
|
|
1624
|
+
return /* @__PURE__ */ E(pe.Root, {
|
|
1604
1625
|
"data-slot": "switch",
|
|
1605
1626
|
className: G("tg:peer tg:inline-flex tg:h-[1.15rem] tg:w-8 tg:shrink-0 tg:items-center tg:rounded-full tg:border tg:border-transparent tg:shadow-xs tg:outline-none tg:transition-all tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:data-[state=checked]:bg-primary tg:data-[state=unchecked]:bg-input tg:dark:data-[state=unchecked]:bg-input/80", e),
|
|
1606
1627
|
...t,
|
|
1607
|
-
children: /* @__PURE__ */ E(
|
|
1628
|
+
children: /* @__PURE__ */ E(pe.Thumb, {
|
|
1608
1629
|
"data-slot": "switch-thumb",
|
|
1609
1630
|
className: G("tg:pointer-events-none tg:block tg:size-4 tg:rounded-full tg:bg-background tg:ring-0 tg:transition-transform tg:data-[state=checked]:translate-x-[calc(100%-2px)] tg:data-[state=unchecked]:translate-x-0 tg:dark:data-[state=checked]:bg-primary-foreground tg:dark:data-[state=unchecked]:bg-foreground")
|
|
1610
1631
|
})
|
|
@@ -1612,7 +1633,7 @@ function Pt({ className: e, ...t }) {
|
|
|
1612
1633
|
}
|
|
1613
1634
|
//#endregion
|
|
1614
1635
|
//#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.tsx
|
|
1615
|
-
var
|
|
1636
|
+
var Lt = ({ field: e, extra: t }) => {
|
|
1616
1637
|
let { id: n, name: r, value: i } = e, { node: a, setValue: o, error: s, label: c, helperText: l } = t;
|
|
1617
1638
|
return /* @__PURE__ */ D(q, {
|
|
1618
1639
|
className: "tg:mb-4",
|
|
@@ -1624,7 +1645,7 @@ var Ft = ({ field: e, extra: t }) => {
|
|
|
1624
1645
|
children: "*"
|
|
1625
1646
|
})]
|
|
1626
1647
|
}),
|
|
1627
|
-
/* @__PURE__ */ E(
|
|
1648
|
+
/* @__PURE__ */ E(It, {
|
|
1628
1649
|
id: n,
|
|
1629
1650
|
name: r,
|
|
1630
1651
|
checked: i,
|
|
@@ -1637,7 +1658,7 @@ var Ft = ({ field: e, extra: t }) => {
|
|
|
1637
1658
|
};
|
|
1638
1659
|
//#endregion
|
|
1639
1660
|
//#region src/shared/components/ui/textarea.tsx
|
|
1640
|
-
function
|
|
1661
|
+
function Rt({ className: e, ...t }) {
|
|
1641
1662
|
return /* @__PURE__ */ E("textarea", {
|
|
1642
1663
|
"data-slot": "textarea",
|
|
1643
1664
|
className: G("tg:field-sizing-content tg:flex tg:min-h-16 tg:w-full tg:rounded-md tg:border tg:border-input tg:bg-transparent tg:px-3 tg:py-2 tg:text-base tg:shadow-xs tg:outline-none tg:transition-[color,box-shadow] tg:placeholder:text-muted-foreground tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:md:text-sm tg:dark:bg-input/30 tg:dark:aria-invalid:ring-destructive/40", e),
|
|
@@ -1646,7 +1667,7 @@ function It({ className: e, ...t }) {
|
|
|
1646
1667
|
}
|
|
1647
1668
|
//#endregion
|
|
1648
1669
|
//#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.tsx
|
|
1649
|
-
var
|
|
1670
|
+
var zt = ({ field: e, extra: t }) => {
|
|
1650
1671
|
let { id: n, name: r, value: i, placeholder: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u } = t;
|
|
1651
1672
|
return /* @__PURE__ */ D(q, {
|
|
1652
1673
|
className: "tg:mb-4",
|
|
@@ -1658,7 +1679,7 @@ var Lt = ({ field: e, extra: t }) => {
|
|
|
1658
1679
|
children: "*"
|
|
1659
1680
|
})]
|
|
1660
1681
|
}),
|
|
1661
|
-
/* @__PURE__ */ E(
|
|
1682
|
+
/* @__PURE__ */ E(Rt, {
|
|
1662
1683
|
id: n,
|
|
1663
1684
|
name: r,
|
|
1664
1685
|
value: i ?? "",
|
|
@@ -1671,7 +1692,7 @@ var Lt = ({ field: e, extra: t }) => {
|
|
|
1671
1692
|
u && !c && /* @__PURE__ */ E(J, { children: u })
|
|
1672
1693
|
]
|
|
1673
1694
|
});
|
|
1674
|
-
},
|
|
1695
|
+
}, Bt = ({ field: e, extra: t }) => {
|
|
1675
1696
|
let { id: n, name: r, value: i, placeholder: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u } = t;
|
|
1676
1697
|
return /* @__PURE__ */ D(q, {
|
|
1677
1698
|
className: "tg:mb-4",
|
|
@@ -1695,7 +1716,7 @@ var Lt = ({ field: e, extra: t }) => {
|
|
|
1695
1716
|
u && !c && /* @__PURE__ */ E(J, { children: u })
|
|
1696
1717
|
]
|
|
1697
1718
|
});
|
|
1698
|
-
},
|
|
1719
|
+
}, Vt = ({ field: e, extra: t }) => {
|
|
1699
1720
|
let { id: n, name: r, value: i, placeholder: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u } = t;
|
|
1700
1721
|
return /* @__PURE__ */ D(q, {
|
|
1701
1722
|
className: "tg:mb-4",
|
|
@@ -1720,8 +1741,8 @@ var Lt = ({ field: e, extra: t }) => {
|
|
|
1720
1741
|
u && !c && /* @__PURE__ */ E(J, { children: u })
|
|
1721
1742
|
]
|
|
1722
1743
|
});
|
|
1723
|
-
},
|
|
1724
|
-
let { id: n, name: r, value: i } = e, { node: a, setValue: o, error: s, label: c, helperText: l } = t,
|
|
1744
|
+
}, Ht = ({ field: e, extra: t }) => {
|
|
1745
|
+
let { id: n, name: r, value: i } = e, { node: a, setValue: o, error: s, label: c, helperText: l } = t, u = d(), f = Array.isArray(i) ? i : [], p = f[0] || "", m = f[1] || "", h = (e) => {
|
|
1725
1746
|
o([e, m]);
|
|
1726
1747
|
}, g = (e) => {
|
|
1727
1748
|
o([p, e]);
|
|
@@ -1741,24 +1762,24 @@ var Lt = ({ field: e, extra: t }) => {
|
|
|
1741
1762
|
children: [/* @__PURE__ */ E(X, {
|
|
1742
1763
|
id: `${n}-start`,
|
|
1743
1764
|
name: `${r}-start`,
|
|
1744
|
-
"aria-label": `${c || a.data.name} - ${
|
|
1765
|
+
"aria-label": `${c || a.data.name} - ${u("renderer.defaultInputs.startTime")}`,
|
|
1745
1766
|
"aria-invalid": !!s,
|
|
1746
1767
|
"aria-describedby": s ? `${a.id}-error` : void 0,
|
|
1747
1768
|
type: "time",
|
|
1748
1769
|
value: p,
|
|
1749
1770
|
onChange: (e) => h(e.target.value),
|
|
1750
|
-
placeholder:
|
|
1771
|
+
placeholder: u("renderer.defaultInputs.startTime"),
|
|
1751
1772
|
className: "tg:flex-1 tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
|
|
1752
1773
|
}), /* @__PURE__ */ E(X, {
|
|
1753
1774
|
id: `${n}-end`,
|
|
1754
1775
|
name: `${r}-end`,
|
|
1755
|
-
"aria-label": `${c || a.data.name} - ${
|
|
1776
|
+
"aria-label": `${c || a.data.name} - ${u("renderer.defaultInputs.endTime")}`,
|
|
1756
1777
|
"aria-invalid": !!s,
|
|
1757
1778
|
"aria-describedby": s ? `${a.id}-error` : void 0,
|
|
1758
1779
|
type: "time",
|
|
1759
1780
|
value: m,
|
|
1760
1781
|
onChange: (e) => g(e.target.value),
|
|
1761
|
-
placeholder:
|
|
1782
|
+
placeholder: u("renderer.defaultInputs.endTime"),
|
|
1762
1783
|
className: "tg:flex-1 tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
|
|
1763
1784
|
})]
|
|
1764
1785
|
}),
|
|
@@ -1766,27 +1787,27 @@ var Lt = ({ field: e, extra: t }) => {
|
|
|
1766
1787
|
l && !s && /* @__PURE__ */ E(J, { children: l })
|
|
1767
1788
|
]
|
|
1768
1789
|
});
|
|
1769
|
-
},
|
|
1770
|
-
address:
|
|
1771
|
-
autocomplete:
|
|
1772
|
-
checkbox:
|
|
1773
|
-
date:
|
|
1774
|
-
daterange:
|
|
1775
|
-
file:
|
|
1776
|
-
hidden:
|
|
1777
|
-
http:
|
|
1778
|
-
number:
|
|
1779
|
-
password:
|
|
1780
|
-
radio:
|
|
1781
|
-
select:
|
|
1782
|
-
submit:
|
|
1783
|
-
switch:
|
|
1784
|
-
text:
|
|
1785
|
-
textarea:
|
|
1786
|
-
time:
|
|
1787
|
-
timerange:
|
|
1788
|
-
},
|
|
1789
|
-
let p =
|
|
1790
|
+
}, Ut = {
|
|
1791
|
+
address: $e,
|
|
1792
|
+
autocomplete: dt,
|
|
1793
|
+
checkbox: ft,
|
|
1794
|
+
date: ht,
|
|
1795
|
+
daterange: gt,
|
|
1796
|
+
file: _t,
|
|
1797
|
+
hidden: vt,
|
|
1798
|
+
http: St,
|
|
1799
|
+
number: Ct,
|
|
1800
|
+
password: wt,
|
|
1801
|
+
radio: Nt,
|
|
1802
|
+
select: Pt,
|
|
1803
|
+
submit: Ft,
|
|
1804
|
+
switch: Lt,
|
|
1805
|
+
text: Bt,
|
|
1806
|
+
textarea: zt,
|
|
1807
|
+
time: Vt,
|
|
1808
|
+
timerange: Ht
|
|
1809
|
+
}, Wt = b(({ label: e, id: t, disabled: n, isSubmitting: r, onBlur: i, onClick: a, onFocus: o, onPointerDown: s, onPointerLeave: c, onPointerMove: l, ...u }, f) => {
|
|
1810
|
+
let p = d();
|
|
1790
1811
|
return /* @__PURE__ */ D("button", {
|
|
1791
1812
|
ref: f,
|
|
1792
1813
|
id: t,
|
|
@@ -1799,9 +1820,9 @@ var Lt = ({ field: e, extra: t }) => {
|
|
|
1799
1820
|
onPointerMove: l,
|
|
1800
1821
|
type: "submit",
|
|
1801
1822
|
className: "tg:inline-flex tg:items-center tg:justify-center tg:gap-2 tg:rounded-md tg:bg-gray-900 tg:px-4 tg:py-2 tg:font-medium tg:text-sm tg:text-white tg:transition-colors tg:hover:bg-gray-800 tg:focus:outline-none tg:focus:ring-2 tg:focus:ring-gray-900 tg:focus:ring-offset-2 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:dark:bg-white tg:dark:text-gray-900 tg:dark:focus:ring-white tg:dark:hover:bg-gray-100",
|
|
1802
|
-
...
|
|
1823
|
+
...u,
|
|
1803
1824
|
children: [r && /* @__PURE__ */ E(j, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), e || p("renderer.defaultSubmitButton.submit")]
|
|
1804
1825
|
});
|
|
1805
1826
|
});
|
|
1806
1827
|
//#endregion
|
|
1807
|
-
export {
|
|
1828
|
+
export { ve as $, Ie as A, je as B, $e as C, Ke as D, Ye as E, Ue as F, Oe as G, Se as H, Le as I, Te as J, De as K, Fe as L, We as M, He as N, Xe as O, Ve as P, be as Q, Me as R, dt as S, Je as T, Ee as U, Ne as V, Ce as W, ye as X, we as Y, xe as Z, vt as _, Bt as a, ge as at, ht as b, Lt as c, Nt as d, _e as et, jt as f, St as g, Ct as h, Vt as i, q as it, Be as j, qe as k, It as l, wt as m, Ut as n, X as nt, zt as o, K as ot, Mt as p, ke as q, Ht as r, J as rt, Rt as s, G as st, Wt as t, Z as tt, Pt as u, _t as v, Ge as w, ft as x, gt as y, Pe as z };
|