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