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