treege 3.0.0-beta.8 → 3.0.0-beta.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -12
- package/README.md +448 -79
- package/dist/DefaultSubmitButton-Bk5U_6Qm.js +1819 -0
- package/dist/ThemeContext-DeWmeqHK.js +978 -0
- package/dist/editor/components/input/ComboboxWithCreate.d.ts +2 -1
- package/dist/editor/components/styles/EditorStyles.d.ts +2 -0
- package/dist/editor/constants/defaultNode.d.ts +1 -1
- package/dist/editor/constants/edgeTypes.d.ts +3 -2
- package/dist/editor/constants/inputTypeIcons.d.ts +3 -0
- package/dist/editor/constants/nodeSpacing.d.ts +25 -0
- package/dist/editor/constants/nodeTypes.d.ts +4 -5
- package/dist/editor/context/OpenApiContext.d.ts +79 -0
- package/dist/editor/context/TreegeEditorRuntimeProvider.d.ts +78 -0
- package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/controls/MiniMapControl.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/dialogs/AuthorizeDialog.d.ts +20 -0
- package/dist/editor/features/TreegeEditor/dialogs/ChangeNodeTypeDialog.d.ts +2 -0
- package/dist/editor/features/TreegeEditor/dialogs/DeleteNodeDialog.d.ts +2 -0
- package/dist/editor/features/TreegeEditor/dialogs/HeadersDialog.d.ts +19 -0
- package/dist/editor/features/TreegeEditor/dialogs/OpenApiDialog.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/edges/ConditionalEdge.d.ts +2 -2
- package/dist/editor/features/TreegeEditor/edges/DefaultEdge.d.ts +3 -0
- package/dist/editor/features/TreegeEditor/forms/HttpConfigForm.d.ts +4 -1
- package/dist/editor/features/TreegeEditor/forms/JsonTemplateEditor.d.ts +13 -0
- package/dist/editor/features/TreegeEditor/forms/OptionsMappingFields.d.ts +34 -0
- package/dist/editor/features/TreegeEditor/forms/OptionsSourceForm.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/forms/SensitiveHeaderWarning.d.ts +13 -0
- package/dist/editor/features/TreegeEditor/forms/SubmitConfigForm.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/inputs/ApiUrlCombobox.d.ts +20 -0
- package/dist/editor/features/TreegeEditor/inputs/ComboboxPattern.d.ts +2 -1
- package/dist/editor/features/TreegeEditor/inputs/OptionImageField.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/inputs/SelectNodeGroup.d.ts +22 -1
- package/dist/editor/features/TreegeEditor/layout/AutoLayout.d.ts +15 -0
- package/dist/editor/features/TreegeEditor/listeners/FlowChangeEmitter.d.ts +19 -0
- package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +5 -0
- package/dist/editor/features/TreegeEditor/nodes/components/BottomHandleDropdown.d.ts +25 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeGroupBadge.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeImage.d.ts +5 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeImageButton.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeInputPreview.d.ts +12 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeLabelInput.d.ts +10 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeMoreMenu.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeRequiredButton.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeStackOrderButtons.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeTypeBadge.d.ts +7 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeTypePickerMenuContent.d.ts +12 -0
- package/dist/editor/features/TreegeEditor/nodes/layout/NodeWrapper.d.ts +4 -2
- package/dist/editor/features/TreegeEditor/panel/AIGeneratorDialog.d.ts +16 -0
- package/dist/editor/features/TreegeEditor/panel/ActionsPanel.d.ts +7 -2
- package/dist/editor/features/TreegeEditor/panel/MultiSelectionPanel.d.ts +7 -0
- package/dist/editor/hooks/useAvailableParentFields.d.ts +13 -0
- package/dist/editor/hooks/useFlowActions.d.ts +6 -2
- package/dist/editor/hooks/useFlowConnections.d.ts +14 -0
- package/dist/editor/hooks/useFlowContent.d.ts +16 -0
- package/dist/editor/hooks/useHistoryStore.d.ts +26 -0
- package/dist/editor/hooks/useIsStackedEdge.d.ts +8 -0
- package/dist/editor/hooks/useKeyValueRows.d.ts +15 -0
- package/dist/editor/hooks/useNodesSelection.d.ts +5 -5
- package/dist/editor/hooks/useStackPosition.d.ts +14 -0
- package/dist/editor/hooks/useTranslate.d.ts +1 -1
- package/dist/editor/hooks/useUndoRedo.d.ts +31 -0
- package/dist/editor/types/ai.d.ts +65 -0
- package/dist/editor/types/editor.d.ts +106 -10
- package/dist/editor/types/openapi.d.ts +106 -0
- package/dist/editor/utils/aiFlowGenerator.d.ts +5 -0
- package/dist/editor/utils/cleanEmptyData.d.ts +18 -0
- package/dist/editor/utils/cleanNodeConfig.d.ts +5 -0
- package/dist/editor/utils/dagreLayout.d.ts +8 -0
- package/dist/editor/utils/edge.d.ts +50 -0
- package/dist/editor/utils/groupColor.d.ts +14 -0
- package/dist/editor/utils/image.d.ts +7 -0
- package/dist/editor/utils/inputTypeIcon.d.ts +6 -0
- package/dist/editor/utils/jsonBindTarget.d.ts +15 -0
- package/dist/editor/utils/openApiPayload.d.ts +12 -0
- package/dist/editor/utils/openapi.d.ts +35 -0
- package/dist/editor/utils/sensitiveHeaders.d.ts +20 -0
- package/dist/editor/utils/stackPositionIndex.d.ts +9 -0
- package/dist/editor-Dw_ODEe1.js +6507 -0
- package/dist/editor.js +3 -7
- package/dist/main.js +6 -52
- package/dist/renderer/context/TreegeRenderRuntimeProvider.d.ts +135 -0
- package/dist/renderer/context/TreegeRendererProvider.d.ts +15 -0
- package/dist/renderer/features/TreegeRenderer/native/TreegeRenderer.d.ts +19 -11
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.d.ts +7 -7
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputLabel.d.ts +10 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputWrapper.d.ts +9 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +20 -15
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultLoadingSkeleton.d.ts +8 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultStep.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButton.d.ts +9 -7
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButtonWrapper.d.ts +11 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultUI.d.ts +8 -7
- package/dist/renderer/features/TreegeRenderer/native/components/DependencyHint.d.ts +15 -0
- package/dist/renderer/features/TreegeRenderer/native/components/OptionItemContent.d.ts +17 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAddressInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAutocompleteInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultCheckboxInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateRangeInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultFileInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHiddenInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHttpInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultNumberInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultPasswordInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultRadioInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSelectInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSubmitInput.d.ts +11 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSwitchInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextareaInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeRangeInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +97 -24
- package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultFormWrapper.d.ts +3 -2
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputLabel.d.ts +9 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputWrapper.d.ts +9 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultLoadingSkeleton.d.ts +7 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultStep.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultSubmitButton.d.ts +5 -1
- package/dist/renderer/features/TreegeRenderer/web/components/DependencyHint.d.ts +22 -0
- package/dist/renderer/features/TreegeRenderer/web/components/OptionItemContent.d.ts +17 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultFileInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHiddenInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultNumberInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSelectInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSubmitInput.d.ts +11 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/styles/RendererStyles.d.ts +2 -0
- package/dist/renderer/hooks/useInputOptions.d.ts +28 -0
- package/dist/renderer/hooks/useRenderNode.d.ts +62 -0
- package/dist/renderer/hooks/useSubmitHandler.d.ts +36 -0
- package/dist/renderer/hooks/useTranslate.d.ts +7 -5
- package/dist/renderer/index.d.ts +5 -2
- package/dist/renderer/index.native.d.ts +20 -0
- package/dist/renderer/types/renderer.d.ts +316 -42
- package/dist/renderer/utils/flow.d.ts +1 -18
- package/dist/renderer/utils/form.d.ts +54 -2
- package/dist/renderer/utils/http.d.ts +177 -0
- package/dist/renderer/utils/jsonTemplate.d.ts +30 -0
- package/dist/renderer/utils/node.d.ts +29 -1
- package/dist/renderer/utils/sanitize.d.ts +85 -0
- package/dist/renderer/utils/sanitize.native.d.ts +69 -0
- package/dist/renderer/utils/step.d.ts +27 -0
- package/dist/renderer/utils/submit.d.ts +49 -0
- package/dist/renderer/utils/templateDependencies.d.ts +17 -0
- package/dist/renderer-CN83AtIp.js +256 -0
- package/dist/renderer-native.d.ts +2 -0
- package/dist/renderer-native.js +3703 -0
- package/dist/renderer.js +5 -45
- package/dist/shared/components/ui/badge.d.ts +2 -2
- package/dist/shared/components/ui/button.d.ts +3 -3
- package/dist/shared/components/ui/collapsible.d.ts +1 -1
- package/dist/shared/components/ui/command.d.ts +1 -1
- package/dist/shared/components/ui/dropdown-menu.d.ts +1 -1
- package/dist/shared/components/ui/field.d.ts +24 -0
- package/dist/shared/components/ui/form.d.ts +1 -1
- package/dist/shared/components/ui/item.d.ts +23 -0
- package/dist/shared/components/ui/popover.d.ts +10 -2
- package/dist/shared/components/ui/select.d.ts +3 -1
- package/dist/shared/components/ui/sheet.d.ts +1 -1
- package/dist/shared/components/ui/skeleton.d.ts +3 -0
- package/dist/shared/components/ui/toggle-group.d.ts +7 -0
- package/dist/shared/components/ui/toggle.d.ts +9 -0
- package/dist/shared/components/ui/tooltip.d.ts +1 -1
- package/dist/shared/constants/colors.d.ts +45 -0
- package/dist/shared/constants/inputType.d.ts +6 -0
- package/dist/shared/constants/node.d.ts +0 -1
- package/dist/shared/context/PortalContainerContext.d.ts +5 -0
- package/dist/shared/context/ThemeContext.d.ts +2 -0
- package/dist/shared/context/ThemeContext.native.d.ts +22 -0
- package/dist/shared/hooks/useMediaQuery.d.ts +12 -0
- package/dist/shared/hooks/useThemeColors.d.ts +37 -0
- package/dist/shared/locales/ar.json.d.ts +258 -19
- package/dist/shared/locales/de.json.d.ts +259 -20
- package/dist/shared/locales/en.json.d.ts +260 -21
- package/dist/shared/locales/es.json.d.ts +259 -20
- package/dist/shared/locales/fr.json.d.ts +259 -20
- package/dist/shared/locales/it.json.d.ts +259 -20
- package/dist/shared/locales/pt.json.d.ts +259 -20
- package/dist/shared/types/edge.d.ts +6 -0
- package/dist/shared/types/node.d.ts +153 -18
- package/dist/shared/utils/httpRecord.d.ts +20 -0
- package/dist/shared/utils/inputTypeGuards.d.ts +7 -0
- package/dist/shared/utils/nodeTypeGuards.d.ts +1 -6
- package/dist/shared/utils/normalizeLabel.d.ts +21 -0
- package/dist/useRenderNode-BZ7fZJxT.js +527 -0
- package/package.json +54 -22
- package/dist/ThemeContext-BIvs8Kw-.js +0 -758
- package/dist/TreegeEditor-Lv5Tn9_F.js +0 -2152
- package/dist/TreegeRenderer-D3EvsEfJ.js +0 -1413
- package/dist/editor/context/TreegeEditorContext.d.ts +0 -12
- package/dist/editor/features/TreegeEditor/forms/FlowNodeForm.d.ts +0 -2
- package/dist/editor/features/TreegeEditor/inputs/SelectInputType.d.ts +0 -7
- package/dist/editor/features/TreegeEditor/nodes/FlowNode.d.ts +0 -6
- package/dist/editor/features/TreegeEditor/nodes/GroupNode.d.ts +0 -6
- package/dist/editor/features/TreegeEditor/nodes/InputNode.d.ts +0 -6
- package/dist/editor/features/TreegeEditor/nodes/UINode.d.ts +0 -6
- package/dist/editor/hooks/useEdgesSelection.d.ts +0 -11
- package/dist/renderer/context/TreegeConfigContext.d.ts +0 -39
- package/dist/renderer/context/TreegeRendererContext.d.ts +0 -25
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultGroup.d.ts +0 -7
- package/dist/renderer/features/TreegeRenderer/web/components/DefaultGroup.d.ts +0 -6
- /package/dist/editor/components/{data-display/logo.d.ts → branding/Logo.d.ts} +0 -0
|
@@ -0,0 +1,1819 @@
|
|
|
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
|
+
import * as v from "react";
|
|
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
|
+
//#region src/shared/lib/utils.ts
|
|
22
|
+
var pe = ce({ prefix: "tg" });
|
|
23
|
+
function K(...e) {
|
|
24
|
+
return pe(L(e));
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/shared/components/ui/button.tsx
|
|
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
|
+
defaultVariants: {
|
|
30
|
+
size: "default",
|
|
31
|
+
variant: "default"
|
|
32
|
+
},
|
|
33
|
+
variants: {
|
|
34
|
+
size: {
|
|
35
|
+
default: "tg:h-9 tg:px-4 tg:py-2 tg:has-[>svg]:px-3",
|
|
36
|
+
icon: "tg:size-9",
|
|
37
|
+
"icon-lg": "tg:size-10",
|
|
38
|
+
"icon-sm": "tg:size-8",
|
|
39
|
+
lg: "tg:h-10 tg:rounded-md tg:px-6 tg:has-[>svg]:px-4",
|
|
40
|
+
sm: "tg:h-8 tg:rounded-md tg:gap-1.5 tg:px-3 tg:has-[>svg]:px-2.5",
|
|
41
|
+
xs: "tg:h-6 tg:rounded-md tg:gap-1 tg:px-2 tg:text-xs tg:has-[>svg]:px-1.5"
|
|
42
|
+
},
|
|
43
|
+
variant: {
|
|
44
|
+
default: "tg:bg-primary tg:text-primary-foreground tg:hover:bg-primary/90",
|
|
45
|
+
destructive: "tg:bg-destructive tg:text-white tg:hover:bg-destructive/90 tg:focus-visible:ring-destructive/20 tg:dark:focus-visible:ring-destructive/40 tg:dark:bg-destructive/60",
|
|
46
|
+
ghost: "tg:hover:bg-accent tg:hover:text-accent-foreground tg:dark:hover:bg-accent/50",
|
|
47
|
+
icon: "tg:opacity-60 tg:hover:bg-transparent! tg:hover:opacity-100",
|
|
48
|
+
link: "tg:text-primary tg:underline-offset-4 tg:hover:underline",
|
|
49
|
+
outline: "tg:border tg:bg-background tg:shadow-xs tg:hover:bg-accent tg:hover:text-accent-foreground tg:dark:bg-input/30 tg:dark:border-input tg:dark:hover:bg-input/50",
|
|
50
|
+
secondary: "tg:bg-secondary tg:text-secondary-foreground tg:hover:bg-secondary/80"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
function he({ className: e, variant: t, size: n, asChild: r = !1, ...i }) {
|
|
55
|
+
return /* @__PURE__ */ D(r ? F : "button", {
|
|
56
|
+
"data-slot": "button",
|
|
57
|
+
className: K(me({
|
|
58
|
+
className: e,
|
|
59
|
+
size: n,
|
|
60
|
+
variant: t
|
|
61
|
+
})),
|
|
62
|
+
...i
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/shared/components/ui/checkbox.tsx
|
|
67
|
+
function ge({ className: e, ...t }) {
|
|
68
|
+
return /* @__PURE__ */ D(R.Root, {
|
|
69
|
+
"data-slot": "checkbox",
|
|
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
|
+
...t,
|
|
72
|
+
children: /* @__PURE__ */ D(R.Indicator, {
|
|
73
|
+
"data-slot": "checkbox-indicator",
|
|
74
|
+
className: "tg:grid tg:place-content-center tg:text-current tg:transition-none",
|
|
75
|
+
children: /* @__PURE__ */ D(ne, { className: "tg:size-3.5" })
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/shared/components/ui/form.tsx
|
|
81
|
+
function q({ className: e, ...t }) {
|
|
82
|
+
return /* @__PURE__ */ D("div", {
|
|
83
|
+
"data-slot": "form-item",
|
|
84
|
+
className: K("tg:grid tg:gap-2", e),
|
|
85
|
+
...t
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function J({ className: e, ...t }) {
|
|
89
|
+
return /* @__PURE__ */ D("p", {
|
|
90
|
+
"data-slot": "form-description",
|
|
91
|
+
className: K("tg:text-muted-foreground tg:text-xs", e),
|
|
92
|
+
...t
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function Y({ className: e, ...t }) {
|
|
96
|
+
return /* @__PURE__ */ D("p", {
|
|
97
|
+
"data-slot": "form-error",
|
|
98
|
+
className: K("tg:text-destructive tg:text-xs", e),
|
|
99
|
+
...t
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/shared/components/ui/input.tsx
|
|
104
|
+
function X({ className: e, type: t, ...n }) {
|
|
105
|
+
return /* @__PURE__ */ D("input", {
|
|
106
|
+
type: t,
|
|
107
|
+
"data-slot": "input",
|
|
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
|
+
...n
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/shared/components/ui/label.tsx
|
|
114
|
+
var Z = ({ className: e, ...t }) => /* @__PURE__ */ D(le.Root, {
|
|
115
|
+
"data-slot": "label",
|
|
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
|
+
...t
|
|
118
|
+
}), Q = y(null), _e = () => S(Q), ve = ({ container: e, children: t }) => /* @__PURE__ */ D(Q.Provider, {
|
|
119
|
+
value: e,
|
|
120
|
+
children: t
|
|
121
|
+
});
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/shared/components/ui/popover.tsx
|
|
124
|
+
function ye({ ...e }) {
|
|
125
|
+
return /* @__PURE__ */ D(z.Root, {
|
|
126
|
+
"data-slot": "popover",
|
|
127
|
+
...e
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function be({ ...e }) {
|
|
131
|
+
return /* @__PURE__ */ D(z.Trigger, {
|
|
132
|
+
"data-slot": "popover-trigger",
|
|
133
|
+
...e
|
|
134
|
+
});
|
|
135
|
+
}
|
|
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__ */ D(z.Content, {
|
|
138
|
+
"data-slot": "popover-content",
|
|
139
|
+
align: t,
|
|
140
|
+
sideOffset: n,
|
|
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
|
+
...a
|
|
143
|
+
});
|
|
144
|
+
return r ? c : /* @__PURE__ */ D(z.Portal, {
|
|
145
|
+
container: s ?? void 0,
|
|
146
|
+
children: c
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/shared/components/ui/select.tsx
|
|
151
|
+
var Se = ({ ...e }) => /* @__PURE__ */ D(B.Root, {
|
|
152
|
+
"data-slot": "select",
|
|
153
|
+
...e
|
|
154
|
+
}), Ce = ({ ...e }) => /* @__PURE__ */ D(B.Group, {
|
|
155
|
+
"data-slot": "select-group",
|
|
156
|
+
...e
|
|
157
|
+
}), we = ({ ...e }) => /* @__PURE__ */ D(B.Value, {
|
|
158
|
+
"data-slot": "select-value",
|
|
159
|
+
...e
|
|
160
|
+
}), Te = ({ className: e, size: t = "default", children: n, ...r }) => /* @__PURE__ */ O(B.Trigger, {
|
|
161
|
+
"data-slot": "select-trigger",
|
|
162
|
+
"data-size": t,
|
|
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
|
+
...r,
|
|
165
|
+
children: [n, /* @__PURE__ */ D(B.Icon, {
|
|
166
|
+
asChild: !0,
|
|
167
|
+
children: /* @__PURE__ */ D(k, { className: "tg:size-4 tg:opacity-50" })
|
|
168
|
+
})]
|
|
169
|
+
}), Ee = ({ className: e, children: t, position: n = "popper", ...r }) => /* @__PURE__ */ D(B.Portal, {
|
|
170
|
+
container: _e() ?? void 0,
|
|
171
|
+
children: /* @__PURE__ */ O(B.Content, {
|
|
172
|
+
"data-slot": "select-content",
|
|
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
|
+
position: n,
|
|
175
|
+
...r,
|
|
176
|
+
children: [
|
|
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
|
+
children: t
|
|
181
|
+
}),
|
|
182
|
+
/* @__PURE__ */ D($, {})
|
|
183
|
+
]
|
|
184
|
+
})
|
|
185
|
+
}), De = ({ className: e, htmlFor: t, children: n, ...r }) => /* @__PURE__ */ D(B.Label, {
|
|
186
|
+
"data-slot": "select-label",
|
|
187
|
+
className: K("tg:pb-1.5 tg:font-medium tg:text-muted-foreground tg:text-sm", e),
|
|
188
|
+
...r,
|
|
189
|
+
children: /* @__PURE__ */ D("label", {
|
|
190
|
+
htmlFor: t,
|
|
191
|
+
children: n
|
|
192
|
+
})
|
|
193
|
+
}), Oe = ({ className: e, children: t, ...n }) => /* @__PURE__ */ O(B.Item, {
|
|
194
|
+
"data-slot": "select-item",
|
|
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
|
+
...n,
|
|
197
|
+
children: [/* @__PURE__ */ D("span", {
|
|
198
|
+
className: "tg:absolute tg:right-2 tg:flex tg:size-3.5 tg:items-center tg:justify-center",
|
|
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
|
+
"data-slot": "select-separator",
|
|
203
|
+
className: K("tg:-mx-1 tg:pointer-events-none tg:my-1 tg:h-px tg:bg-border", e),
|
|
204
|
+
...t
|
|
205
|
+
}), Ae = ({ className: e, ...t }) => /* @__PURE__ */ D(B.ScrollUpButton, {
|
|
206
|
+
"data-slot": "select-scroll-up-button",
|
|
207
|
+
className: K("tg:flex tg:cursor-default tg:items-center tg:justify-center tg:py-1", e),
|
|
208
|
+
...t,
|
|
209
|
+
children: /* @__PURE__ */ D(j, { className: "tg:size-4" })
|
|
210
|
+
}), $ = ({ className: e, ...t }) => /* @__PURE__ */ D(B.ScrollDownButton, {
|
|
211
|
+
"data-slot": "select-scroll-down-button",
|
|
212
|
+
className: K("tg:flex tg:cursor-default tg:items-center tg:justify-center tg:py-1", e),
|
|
213
|
+
...t,
|
|
214
|
+
children: /* @__PURE__ */ D(k, { className: "tg:size-4" })
|
|
215
|
+
});
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region src/shared/components/ui/tooltip.tsx
|
|
218
|
+
function je({ delayDuration: e = 0, ...t }) {
|
|
219
|
+
return /* @__PURE__ */ D(V.Provider, {
|
|
220
|
+
"data-slot": "tooltip-provider",
|
|
221
|
+
delayDuration: e,
|
|
222
|
+
...t
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
function Me({ ...e }) {
|
|
226
|
+
return /* @__PURE__ */ D(je, { children: /* @__PURE__ */ D(V.Root, {
|
|
227
|
+
"data-slot": "tooltip",
|
|
228
|
+
...e
|
|
229
|
+
}) });
|
|
230
|
+
}
|
|
231
|
+
function Ne({ ...e }) {
|
|
232
|
+
return /* @__PURE__ */ D(V.Trigger, {
|
|
233
|
+
"data-slot": "tooltip-trigger",
|
|
234
|
+
...e
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
function Pe({ className: e, sideOffset: t = 0, children: n, ...r }) {
|
|
238
|
+
return /* @__PURE__ */ D(V.Portal, {
|
|
239
|
+
container: _e() ?? void 0,
|
|
240
|
+
children: /* @__PURE__ */ O(V.Content, {
|
|
241
|
+
"data-slot": "tooltip-content",
|
|
242
|
+
sideOffset: t,
|
|
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
|
+
...r,
|
|
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
|
+
})
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/shared/components/ui/separator.tsx
|
|
251
|
+
function Fe({ className: e, orientation: t = "horizontal", decorative: n = !0, ...r }) {
|
|
252
|
+
return /* @__PURE__ */ D(ue.Root, {
|
|
253
|
+
"data-slot": "separator",
|
|
254
|
+
decorative: n,
|
|
255
|
+
orientation: t,
|
|
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
|
+
...r
|
|
258
|
+
});
|
|
259
|
+
}
|
|
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
|
|
272
|
+
//#region src/shared/components/ui/dialog.tsx
|
|
273
|
+
function Le({ ...e }) {
|
|
274
|
+
return /* @__PURE__ */ D(U.Root, {
|
|
275
|
+
"data-slot": "dialog",
|
|
276
|
+
...e
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
function Re({ ...e }) {
|
|
280
|
+
return /* @__PURE__ */ D(U.Trigger, {
|
|
281
|
+
"data-slot": "dialog-trigger",
|
|
282
|
+
...e
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
function ze({ ...e }) {
|
|
286
|
+
return /* @__PURE__ */ D(U.Portal, {
|
|
287
|
+
"data-slot": "dialog-portal",
|
|
288
|
+
...e
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
function Be({ className: e, ...t }) {
|
|
292
|
+
return /* @__PURE__ */ D(U.Overlay, {
|
|
293
|
+
"data-slot": "dialog-overlay",
|
|
294
|
+
className: K("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:fixed tg:inset-0 tg:z-[2000] tg:bg-black/50 tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in", e),
|
|
295
|
+
...t
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function Ve({ className: e, children: t, showCloseButton: n = !0, ...r }) {
|
|
299
|
+
let [i, a] = v.useState(null);
|
|
300
|
+
return /* @__PURE__ */ O(ze, {
|
|
301
|
+
"data-slot": "dialog-portal",
|
|
302
|
+
children: [/* @__PURE__ */ D(Be, {}), /* @__PURE__ */ D(U.Content, {
|
|
303
|
+
ref: a,
|
|
304
|
+
"data-slot": "dialog-content",
|
|
305
|
+
className: K("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:data-[state=closed]:zoom-out-95 tg:data-[state=open]:zoom-in-95 tg:fixed tg:top-[50%] tg:left-[50%] tg:z-[2000] tg:grid tg:w-full tg:max-w-[calc(100%-2rem)] tg:translate-x-[-50%] tg:translate-y-[-50%] tg:gap-4 tg:rounded-lg tg:border tg:bg-background tg:p-6 tg:shadow-lg tg:duration-200 tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in tg:sm:max-w-lg", e),
|
|
306
|
+
...r,
|
|
307
|
+
children: /* @__PURE__ */ O(ve, {
|
|
308
|
+
container: i,
|
|
309
|
+
children: [t, n && /* @__PURE__ */ O(U.Close, {
|
|
310
|
+
"data-slot": "dialog-close",
|
|
311
|
+
className: "tg:absolute tg:top-4 tg:right-4 tg:rounded-xs tg:opacity-70 tg:ring-offset-background tg:transition-opacity tg:hover:opacity-100 tg:focus:outline-hidden tg:focus:ring-2 tg:focus:ring-ring tg:focus:ring-offset-2 tg:disabled:pointer-events-none tg:data-[state=open]:bg-accent tg:data-[state=open]:text-muted-foreground tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0",
|
|
312
|
+
children: [/* @__PURE__ */ D(P, {}), /* @__PURE__ */ D("span", {
|
|
313
|
+
className: "tg:sr-only",
|
|
314
|
+
children: "Close"
|
|
315
|
+
})]
|
|
316
|
+
})]
|
|
317
|
+
})
|
|
318
|
+
})]
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
function He({ className: e, ...t }) {
|
|
322
|
+
return /* @__PURE__ */ D("div", {
|
|
323
|
+
"data-slot": "dialog-header",
|
|
324
|
+
className: K("tg:flex tg:flex-col tg:gap-2 tg:text-center tg:sm:text-left", e),
|
|
325
|
+
...t
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function Ue({ className: e, ...t }) {
|
|
329
|
+
return /* @__PURE__ */ D("div", {
|
|
330
|
+
"data-slot": "dialog-footer",
|
|
331
|
+
className: K("tg:flex tg:flex-col-reverse tg:gap-2 tg:sm:flex-row tg:sm:justify-end", e),
|
|
332
|
+
...t
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
function We({ className: e, ...t }) {
|
|
336
|
+
return /* @__PURE__ */ D(U.Title, {
|
|
337
|
+
"data-slot": "dialog-title",
|
|
338
|
+
className: K("tg:font-semibold tg:text-lg tg:leading-none", e),
|
|
339
|
+
...t
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
function Ge({ className: e, ...t }) {
|
|
343
|
+
return /* @__PURE__ */ D(U.Description, {
|
|
344
|
+
"data-slot": "dialog-description",
|
|
345
|
+
className: K("tg:text-muted-foreground tg:text-sm", e),
|
|
346
|
+
...t
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region src/shared/components/ui/command.tsx
|
|
351
|
+
function Ke({ className: e, ...t }) {
|
|
352
|
+
return /* @__PURE__ */ D(H, {
|
|
353
|
+
"data-slot": "command",
|
|
354
|
+
className: K("tg:flex tg:h-full tg:w-full tg:flex-col tg:overflow-hidden tg:rounded-md tg:bg-popover tg:text-popover-foreground", e),
|
|
355
|
+
...t
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
function qe({ className: e, ...t }) {
|
|
359
|
+
return /* @__PURE__ */ O("div", {
|
|
360
|
+
"data-slot": "command-input-wrapper",
|
|
361
|
+
className: "tg:flex tg:h-9 tg:items-center tg:gap-2 tg:border-b tg:px-3",
|
|
362
|
+
children: [/* @__PURE__ */ D(N, { className: "tg:size-4 tg:shrink-0 tg:opacity-50" }), /* @__PURE__ */ D(H.Input, {
|
|
363
|
+
"data-slot": "command-input",
|
|
364
|
+
className: K("tg:flex tg:h-10 tg:w-full tg:rounded-md tg:bg-transparent tg:py-3 tg:text-sm tg:outline-hidden tg:placeholder:text-muted-foreground tg:disabled:cursor-not-allowed tg:disabled:opacity-50", e),
|
|
365
|
+
...t
|
|
366
|
+
})]
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
function Je({ className: e, ...t }) {
|
|
370
|
+
return /* @__PURE__ */ D(H.List, {
|
|
371
|
+
"data-slot": "command-list",
|
|
372
|
+
className: K("tg:max-h-[300px] tg:scroll-py-1 tg:overflow-y-auto tg:overflow-x-hidden", e),
|
|
373
|
+
...t
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
function Ye({ ...e }) {
|
|
377
|
+
return /* @__PURE__ */ D(H.Empty, {
|
|
378
|
+
"data-slot": "command-empty",
|
|
379
|
+
className: "tg:py-6 tg:text-center tg:text-sm",
|
|
380
|
+
...e
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
function Xe({ className: e, ...t }) {
|
|
384
|
+
return /* @__PURE__ */ D(H.Group, {
|
|
385
|
+
"data-slot": "command-group",
|
|
386
|
+
className: K("tg:overflow-hidden tg:p-1 tg:text-foreground tg:[&_[cmdk-group-heading]]:px-2 tg:[&_[cmdk-group-heading]]:py-1.5 tg:[&_[cmdk-group-heading]]:font-medium tg:[&_[cmdk-group-heading]]:text-muted-foreground tg:[&_[cmdk-group-heading]]:text-xs", e),
|
|
387
|
+
...t
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
function Ze({ className: e, ...t }) {
|
|
391
|
+
return /* @__PURE__ */ D(H.Item, {
|
|
392
|
+
"data-slot": "command-item",
|
|
393
|
+
className: K("tg:relative tg:flex tg:cursor-default tg:select-none tg:items-center tg:gap-2 tg:rounded-sm tg:px-2 tg:py-1.5 tg:text-sm tg:outline-hidden tg:data-[disabled=true]:pointer-events-none tg:data-[selected=true]:bg-accent tg:data-[selected=true]:text-accent-foreground tg:data-[disabled=true]:opacity-50 tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg:not([class*='text-'])]:text-muted-foreground tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0", e),
|
|
394
|
+
...t
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
//#endregion
|
|
398
|
+
//#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.tsx
|
|
399
|
+
var Qe = async (e, t) => {
|
|
400
|
+
if (!e || e.trim().length < 3) return [];
|
|
401
|
+
try {
|
|
402
|
+
let n = await fetch(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&format=jsonv2&addressdetails=1&limit=5`, { headers: {
|
|
403
|
+
Accept: "application/json",
|
|
404
|
+
"User-Agent": "Treege Renderer",
|
|
405
|
+
...t && { "Accept-Language": t }
|
|
406
|
+
} });
|
|
407
|
+
return n.ok ? (await n.json()).map((e) => ({
|
|
408
|
+
label: e.display_name,
|
|
409
|
+
value: e.display_name
|
|
410
|
+
})) : [];
|
|
411
|
+
} catch (e) {
|
|
412
|
+
return console.error("Nominatim fetch error:", e), [];
|
|
413
|
+
}
|
|
414
|
+
}, $e = (e) => !e || e.trim().length < 3 ? Promise.resolve([]) : new Promise((t) => {
|
|
415
|
+
if (!window.google?.maps?.places) {
|
|
416
|
+
console.warn("Google Places SDK not loaded yet"), t([]);
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
new window.google.maps.places.AutocompleteService().getPlacePredictions({ input: e }, (e, n) => {
|
|
420
|
+
if (n !== google.maps.places.PlacesServiceStatus.OK || !e) {
|
|
421
|
+
console.warn("Google Places API status:", n), t([]);
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
t(e.map((e) => ({
|
|
425
|
+
label: e.description,
|
|
426
|
+
value: e.description
|
|
427
|
+
})));
|
|
428
|
+
});
|
|
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(() => {
|
|
436
|
+
if (!n || n.trim().length < 3) {
|
|
437
|
+
o([]);
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
let e = setTimeout(async () => {
|
|
441
|
+
o(b ? await $e(n) : await Qe(n, S));
|
|
442
|
+
}, 300);
|
|
443
|
+
return () => clearTimeout(e);
|
|
444
|
+
}, [
|
|
445
|
+
n,
|
|
446
|
+
b,
|
|
447
|
+
S
|
|
448
|
+
]), /* @__PURE__ */ O(ee, { children: [b && /* @__PURE__ */ D("script", {
|
|
449
|
+
async: !0,
|
|
450
|
+
src: `https://maps.googleapis.com/maps/api/js?key=${b}&libraries=places`
|
|
451
|
+
}), /* @__PURE__ */ O(q, {
|
|
452
|
+
className: "tg:mb-4",
|
|
453
|
+
children: [
|
|
454
|
+
/* @__PURE__ */ D(m, {
|
|
455
|
+
htmlFor: l,
|
|
456
|
+
label: v,
|
|
457
|
+
required: h.data.required
|
|
458
|
+
}),
|
|
459
|
+
/* @__PURE__ */ O("div", {
|
|
460
|
+
className: "tg:relative",
|
|
461
|
+
children: [
|
|
462
|
+
/* @__PURE__ */ D(X, {
|
|
463
|
+
type: "text",
|
|
464
|
+
id: l,
|
|
465
|
+
name: u,
|
|
466
|
+
"aria-label": v || h.data.name,
|
|
467
|
+
value: f || "",
|
|
468
|
+
onChange: (e) => te(e.target.value),
|
|
469
|
+
onFocus: () => {
|
|
470
|
+
a.length > 0 && c(!0);
|
|
471
|
+
},
|
|
472
|
+
placeholder: p || w("renderer.defaultAddressInput.enterAddress"),
|
|
473
|
+
className: "tg:pr-10",
|
|
474
|
+
autoComplete: "off"
|
|
475
|
+
}),
|
|
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", {
|
|
478
|
+
className: "tg:absolute tg:z-50 tg:mt-1 tg:w-full tg:rounded-md tg:border tg:bg-popover tg:shadow-md",
|
|
479
|
+
children: /* @__PURE__ */ 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, {
|
|
480
|
+
value: e.value,
|
|
481
|
+
onSelect: () => T(e),
|
|
482
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
483
|
+
children: [/* @__PURE__ */ D(oe, { className: "tg:mr-2 tg:h-4 tg:w-4" }), e.label]
|
|
484
|
+
}, t)) })] }) })
|
|
485
|
+
})
|
|
486
|
+
]
|
|
487
|
+
}),
|
|
488
|
+
_ && /* @__PURE__ */ D(Y, { children: _ }),
|
|
489
|
+
y && !_ && /* @__PURE__ */ D(J, { children: y })
|
|
490
|
+
]
|
|
491
|
+
})] });
|
|
492
|
+
}, tt = ({ missing: e }) => /* @__PURE__ */ O(ee, { children: [/* @__PURE__ */ D("p", {
|
|
493
|
+
className: "tg:font-medium",
|
|
494
|
+
children: d()("renderer.dependencyHint.title")
|
|
495
|
+
}), /* @__PURE__ */ D("ul", {
|
|
496
|
+
className: "tg:mt-1 tg:list-disc tg:pl-4",
|
|
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, {
|
|
499
|
+
asChild: !0,
|
|
500
|
+
children: /* @__PURE__ */ D("div", {
|
|
501
|
+
className: "tg:w-full",
|
|
502
|
+
children: t
|
|
503
|
+
})
|
|
504
|
+
}), /* @__PURE__ */ D(Pe, { children: /* @__PURE__ */ D(tt, { missing: e }) })] }) }), rt = ({ missing: e }) => e.length === 0 ? null : /* @__PURE__ */ D("div", {
|
|
505
|
+
className: "tg:text-muted-foreground tg:text-sm",
|
|
506
|
+
children: /* @__PURE__ */ D(tt, { missing: e })
|
|
507
|
+
});
|
|
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", {
|
|
509
|
+
defaultVariants: {
|
|
510
|
+
size: "default",
|
|
511
|
+
variant: "default"
|
|
512
|
+
},
|
|
513
|
+
variants: {
|
|
514
|
+
size: {
|
|
515
|
+
default: "tg:gap-4 tg:p-4",
|
|
516
|
+
sm: "tg:gap-2.5 tg:px-4 tg:py-3"
|
|
517
|
+
},
|
|
518
|
+
variant: {
|
|
519
|
+
default: "tg:bg-transparent",
|
|
520
|
+
muted: "tg:bg-muted/50",
|
|
521
|
+
outline: "tg:border-border"
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
});
|
|
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", {
|
|
526
|
+
defaultVariants: { variant: "default" },
|
|
527
|
+
variants: { variant: {
|
|
528
|
+
default: "tg:bg-transparent",
|
|
529
|
+
icon: "tg:size-8 tg:rounded-sm tg:border tg:bg-muted tg:[&_svg:not([class*='size-'])]:size-4",
|
|
530
|
+
image: "tg:size-10 tg:overflow-hidden tg:rounded-sm tg:[&_img]:size-full tg:[&_img]:object-cover"
|
|
531
|
+
} }
|
|
532
|
+
});
|
|
533
|
+
function at({ className: e, variant: t = "default", ...n }) {
|
|
534
|
+
return /* @__PURE__ */ D("div", {
|
|
535
|
+
"data-slot": "item-media",
|
|
536
|
+
"data-variant": t,
|
|
537
|
+
className: K(it({
|
|
538
|
+
className: e,
|
|
539
|
+
variant: t
|
|
540
|
+
})),
|
|
541
|
+
...n
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
function ot({ className: e, ...t }) {
|
|
545
|
+
return /* @__PURE__ */ D("div", {
|
|
546
|
+
"data-slot": "item-content",
|
|
547
|
+
className: K("tg:flex tg:flex-1 tg:flex-col tg:gap-1 tg:[&+[data-slot=item-content]]:flex-none", e),
|
|
548
|
+
...t
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
function st({ className: e, ...t }) {
|
|
552
|
+
return /* @__PURE__ */ D("div", {
|
|
553
|
+
"data-slot": "item-title",
|
|
554
|
+
className: K("tg:flex tg:w-fit tg:items-center tg:gap-2 tg:font-medium tg:text-sm tg:leading-snug", e),
|
|
555
|
+
...t
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
function ct({ className: e, ...t }) {
|
|
559
|
+
return /* @__PURE__ */ D("p", {
|
|
560
|
+
"data-slot": "item-description",
|
|
561
|
+
className: K("tg:line-clamp-2 tg:text-balance tg:font-normal tg:text-muted-foreground tg:text-sm tg:leading-normal", "tg:[&>a]:underline tg:[&>a]:underline-offset-4 tg:[&>a:hover]:text-primary", e),
|
|
562
|
+
...t
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
//#endregion
|
|
566
|
+
//#region src/renderer/features/TreegeRenderer/web/components/OptionItemContent.tsx
|
|
567
|
+
var lt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ O(ee, { children: [n && /* @__PURE__ */ D(at, {
|
|
568
|
+
variant: "image",
|
|
569
|
+
children: /* @__PURE__ */ D("img", {
|
|
570
|
+
src: n,
|
|
571
|
+
alt: ""
|
|
572
|
+
})
|
|
573
|
+
}), /* @__PURE__ */ O(ot, {
|
|
574
|
+
className: "tg:min-w-0 tg:gap-0",
|
|
575
|
+
children: [/* @__PURE__ */ D(st, {
|
|
576
|
+
className: "tg:block tg:w-full tg:truncate tg:font-normal",
|
|
577
|
+
children: e
|
|
578
|
+
}), t && /* @__PURE__ */ D(ct, {
|
|
579
|
+
className: "tg:line-clamp-1",
|
|
580
|
+
children: t
|
|
581
|
+
})]
|
|
582
|
+
})] }), ut = /\{\{([\w-]+)}}/g, dt = (e) => {
|
|
583
|
+
let [t, i] = E({
|
|
584
|
+
error: null,
|
|
585
|
+
fetched: null,
|
|
586
|
+
isLoading: !1
|
|
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) => {
|
|
589
|
+
let t = u[e];
|
|
590
|
+
return t != null && t !== "";
|
|
591
|
+
})) return null;
|
|
592
|
+
let e = p.method ?? "GET", t = {
|
|
593
|
+
body: [
|
|
594
|
+
"POST",
|
|
595
|
+
"PUT",
|
|
596
|
+
"PATCH"
|
|
597
|
+
].includes(e) ? l(p.body, u, []) : void 0,
|
|
598
|
+
headers: s(a(d, u), a(p.headers, u)),
|
|
599
|
+
mapping: p.mapping,
|
|
600
|
+
method: e,
|
|
601
|
+
queryParams: a(p.queryParams, u) ?? {},
|
|
602
|
+
responsePath: p.responsePath,
|
|
603
|
+
url: f(n(p.url, u, { encode: !0 }), c)
|
|
604
|
+
};
|
|
605
|
+
return JSON.stringify(t);
|
|
606
|
+
}, [
|
|
607
|
+
c,
|
|
608
|
+
p,
|
|
609
|
+
u,
|
|
610
|
+
d
|
|
611
|
+
]);
|
|
612
|
+
C(() => {
|
|
613
|
+
if (!_) {
|
|
614
|
+
i({
|
|
615
|
+
error: null,
|
|
616
|
+
fetched: null,
|
|
617
|
+
isLoading: !1
|
|
618
|
+
});
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
let e = JSON.parse(_), t = new AbortController();
|
|
622
|
+
return i((e) => ({
|
|
623
|
+
...e,
|
|
624
|
+
error: null,
|
|
625
|
+
isLoading: !0
|
|
626
|
+
})), (async () => {
|
|
627
|
+
let n = await g({
|
|
628
|
+
body: e.body,
|
|
629
|
+
headers: e.headers,
|
|
630
|
+
method: e.method,
|
|
631
|
+
queryParams: e.queryParams,
|
|
632
|
+
signal: t.signal,
|
|
633
|
+
url: e.url
|
|
634
|
+
});
|
|
635
|
+
if (!t.signal.aborted) {
|
|
636
|
+
if (!n.success) {
|
|
637
|
+
i({
|
|
638
|
+
error: n.error ?? "Fetch failed",
|
|
639
|
+
fetched: null,
|
|
640
|
+
isLoading: !1
|
|
641
|
+
});
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
i({
|
|
645
|
+
error: null,
|
|
646
|
+
fetched: o(n.data, e.responsePath, e.mapping),
|
|
647
|
+
isLoading: !1
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
})(), () => t.abort();
|
|
651
|
+
}, [_]);
|
|
652
|
+
let v = e.data.normalizeOptionLabels !== !1, y = w(() => t.fetched ? v ? t.fetched.map((e) => ({
|
|
653
|
+
...e,
|
|
654
|
+
label: h(e.label)
|
|
655
|
+
})) : t.fetched : m ?? [], [
|
|
656
|
+
t.fetched,
|
|
657
|
+
m,
|
|
658
|
+
v
|
|
659
|
+
]);
|
|
660
|
+
return {
|
|
661
|
+
error: t.error,
|
|
662
|
+
isLoading: t.isLoading,
|
|
663
|
+
options: y
|
|
664
|
+
};
|
|
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, {
|
|
668
|
+
className: "tg:mb-4",
|
|
669
|
+
children: [
|
|
670
|
+
/* @__PURE__ */ D(s, {
|
|
671
|
+
htmlFor: y,
|
|
672
|
+
label: f,
|
|
673
|
+
required: c.data.required
|
|
674
|
+
}),
|
|
675
|
+
/* @__PURE__ */ D(nt, {
|
|
676
|
+
missing: m,
|
|
677
|
+
children: /* @__PURE__ */ O("div", {
|
|
678
|
+
className: "tg:relative",
|
|
679
|
+
children: [
|
|
680
|
+
/* @__PURE__ */ O(ye, {
|
|
681
|
+
open: n,
|
|
682
|
+
onOpenChange: r,
|
|
683
|
+
children: [/* @__PURE__ */ D(be, {
|
|
684
|
+
asChild: !0,
|
|
685
|
+
children: /* @__PURE__ */ O(he, {
|
|
686
|
+
id: y,
|
|
687
|
+
variant: "outline",
|
|
688
|
+
role: "combobox",
|
|
689
|
+
"aria-label": f || c.data.name,
|
|
690
|
+
"aria-expanded": n,
|
|
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", {
|
|
696
|
+
className: "tg:flex tg:items-center tg:gap-2 tg:truncate",
|
|
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" })]
|
|
699
|
+
})
|
|
700
|
+
}), /* @__PURE__ */ D(xe, {
|
|
701
|
+
className: "tg:w-(--radix-popover-trigger-width) tg:p-0",
|
|
702
|
+
align: "start",
|
|
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, {
|
|
704
|
+
value: e.value,
|
|
705
|
+
disabled: e.disabled,
|
|
706
|
+
onSelect: () => {
|
|
707
|
+
l(e.value === a ? "" : e.value), r(!1);
|
|
708
|
+
},
|
|
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),
|
|
712
|
+
image: e.image
|
|
713
|
+
})]
|
|
714
|
+
}, e.value)) })] })] })
|
|
715
|
+
})]
|
|
716
|
+
}),
|
|
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", {
|
|
719
|
+
type: "button",
|
|
720
|
+
"aria-label": v("common.clear"),
|
|
721
|
+
onClick: () => l(""),
|
|
722
|
+
className: "tg:-translate-y-1/2 tg:absolute tg:top-1/2 tg:right-8 tg:rounded-sm tg:p-0.5 tg:text-muted-foreground tg:opacity-70 tg:transition-opacity tg:hover:opacity-100",
|
|
723
|
+
children: /* @__PURE__ */ D(se, { className: "tg:size-4" })
|
|
724
|
+
})
|
|
725
|
+
]
|
|
726
|
+
})
|
|
727
|
+
}),
|
|
728
|
+
u && /* @__PURE__ */ D(Y, {
|
|
729
|
+
id: b,
|
|
730
|
+
children: u
|
|
731
|
+
}),
|
|
732
|
+
_ && !u && /* @__PURE__ */ D(Y, { children: _ }),
|
|
733
|
+
p && !u && !_ && /* @__PURE__ */ D(J, { children: p })
|
|
734
|
+
]
|
|
735
|
+
});
|
|
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));
|
|
741
|
+
};
|
|
742
|
+
return /* @__PURE__ */ O(q, {
|
|
743
|
+
className: "tg:mb-4",
|
|
744
|
+
children: [
|
|
745
|
+
/* @__PURE__ */ D(o, {
|
|
746
|
+
className: "tg:mb-1",
|
|
747
|
+
id: e,
|
|
748
|
+
label: u,
|
|
749
|
+
required: s.data.required
|
|
750
|
+
}),
|
|
751
|
+
/* @__PURE__ */ D(rt, { missing: h }),
|
|
752
|
+
_ && /* @__PURE__ */ O("div", {
|
|
753
|
+
className: "tg:flex tg:items-center tg:gap-2 tg:py-2 tg:text-muted-foreground tg:text-sm",
|
|
754
|
+
children: [/* @__PURE__ */ D(M, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ D("span", { children: b("renderer.defaultCheckboxInput.loadingOptions") })]
|
|
755
|
+
}),
|
|
756
|
+
/* @__PURE__ */ O("div", {
|
|
757
|
+
role: "group",
|
|
758
|
+
"aria-labelledby": u ? e : void 0,
|
|
759
|
+
"aria-label": u ? void 0 : s.data.name,
|
|
760
|
+
className: "tg:min-w-0 tg:space-y-2",
|
|
761
|
+
children: [r.map((e, r) => {
|
|
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"),
|
|
765
|
+
children: [
|
|
766
|
+
/* @__PURE__ */ D(ge, {
|
|
767
|
+
id: `${n}-${e.value}`,
|
|
768
|
+
name: i,
|
|
769
|
+
checked: t.includes(String(e.value)),
|
|
770
|
+
onCheckedChange: (t) => x(String(e.value), !!t),
|
|
771
|
+
disabled: e.disabled,
|
|
772
|
+
className: "tg:mt-0.5"
|
|
773
|
+
}),
|
|
774
|
+
e.image && /* @__PURE__ */ D("img", {
|
|
775
|
+
src: e.image,
|
|
776
|
+
alt: "",
|
|
777
|
+
className: "tg:h-8 tg:w-8 tg:shrink-0 tg:rounded tg:object-cover"
|
|
778
|
+
}),
|
|
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, {
|
|
782
|
+
htmlFor: `${n}-${e.value}`,
|
|
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"),
|
|
787
|
+
children: a
|
|
788
|
+
})]
|
|
789
|
+
}),
|
|
790
|
+
p?.({
|
|
791
|
+
index: r,
|
|
792
|
+
option: e
|
|
793
|
+
})
|
|
794
|
+
]
|
|
795
|
+
}, e.value + r);
|
|
796
|
+
}), d > 0 && /* @__PURE__ */ D("div", {
|
|
797
|
+
className: "tg:px-2 tg:text-muted-foreground tg:text-xs",
|
|
798
|
+
children: "…"
|
|
799
|
+
})]
|
|
800
|
+
}),
|
|
801
|
+
l && /* @__PURE__ */ D(Y, { children: l }),
|
|
802
|
+
v && !l && /* @__PURE__ */ D(Y, { children: v }),
|
|
803
|
+
f && !l && !v && /* @__PURE__ */ D(J, { children: f })
|
|
804
|
+
]
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
return /* @__PURE__ */ O(q, {
|
|
808
|
+
className: "tg:mb-4",
|
|
809
|
+
children: [/* @__PURE__ */ O("div", {
|
|
810
|
+
className: "tg:flex tg:items-center tg:gap-3",
|
|
811
|
+
children: [/* @__PURE__ */ D(ge, {
|
|
812
|
+
id: n,
|
|
813
|
+
name: i,
|
|
814
|
+
"aria-label": u || s.data.name,
|
|
815
|
+
checked: typeof a == "boolean" ? a : !1,
|
|
816
|
+
onCheckedChange: (e) => c(!!e)
|
|
817
|
+
}), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D(o, {
|
|
818
|
+
htmlFor: n,
|
|
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 })]
|
|
824
|
+
});
|
|
825
|
+
};
|
|
826
|
+
//#endregion
|
|
827
|
+
//#region src/shared/components/ui/calendar.tsx
|
|
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, {
|
|
831
|
+
showOutsideDays: n,
|
|
832
|
+
className: K("tg:group/calendar tg:bg-background tg:p-3 tg:[--cell-size:--spacing(8)] tg:[[data-slot=card-content]_&]:bg-transparent tg:[[data-slot=popover-content]_&]:bg-transparent", String.raw`tg:rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`tg:rtl:**:[.rdp-button\_previous>svg]:rotate-180`, e),
|
|
833
|
+
captionLayout: r,
|
|
834
|
+
formatters: {
|
|
835
|
+
formatMonthDropdown: (e) => e.toLocaleString("default", { month: "short" }),
|
|
836
|
+
...a
|
|
837
|
+
},
|
|
838
|
+
classNames: {
|
|
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),
|
|
857
|
+
table: "tg:w-full tg:border-collapse",
|
|
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),
|
|
864
|
+
...t
|
|
865
|
+
},
|
|
866
|
+
components: {
|
|
867
|
+
Chevron: ({ className: e, orientation: t, ...n }) => D(t === "left" ? A : t === "right" ? re : k, {
|
|
868
|
+
className: K("tg:size-4", e),
|
|
869
|
+
...n
|
|
870
|
+
}),
|
|
871
|
+
DayButton: ht,
|
|
872
|
+
Root: ({ className: e, rootRef: t, ...n }) => /* @__PURE__ */ D("div", {
|
|
873
|
+
"data-slot": "calendar",
|
|
874
|
+
ref: t,
|
|
875
|
+
className: K(e),
|
|
876
|
+
...n
|
|
877
|
+
}),
|
|
878
|
+
WeekNumber: ({ children: e, ...t }) => /* @__PURE__ */ D("td", {
|
|
879
|
+
...t,
|
|
880
|
+
children: /* @__PURE__ */ D("div", {
|
|
881
|
+
className: "tg:flex tg:size-(--cell-size) tg:items-center tg:justify-center tg:text-center",
|
|
882
|
+
children: e
|
|
883
|
+
})
|
|
884
|
+
}),
|
|
885
|
+
...o
|
|
886
|
+
},
|
|
887
|
+
...s
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
function ht({ className: e, day: t, modifiers: n, ...r }) {
|
|
891
|
+
let i = de(), a = v.useRef(null);
|
|
892
|
+
return v.useEffect(() => {
|
|
893
|
+
n.focused && a.current?.focus();
|
|
894
|
+
}, [n.focused]), /* @__PURE__ */ D(he, {
|
|
895
|
+
ref: a,
|
|
896
|
+
variant: "ghost",
|
|
897
|
+
size: "icon",
|
|
898
|
+
"data-day": t.date.toLocaleDateString(),
|
|
899
|
+
"data-selected-single": n.selected && !n.range_start && !n.range_end && !n.range_middle,
|
|
900
|
+
"data-range-start": n.range_start,
|
|
901
|
+
"data-range-end": n.range_end,
|
|
902
|
+
"data-range-middle": n.range_middle,
|
|
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),
|
|
904
|
+
...r
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
//#endregion
|
|
908
|
+
//#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.tsx
|
|
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, {
|
|
912
|
+
className: "tg:mb-4",
|
|
913
|
+
children: [
|
|
914
|
+
/* @__PURE__ */ D(c, {
|
|
915
|
+
htmlFor: i,
|
|
916
|
+
label: p,
|
|
917
|
+
required: l.data.required
|
|
918
|
+
}),
|
|
919
|
+
/* @__PURE__ */ O(ye, {
|
|
920
|
+
open: n,
|
|
921
|
+
onOpenChange: r,
|
|
922
|
+
children: [/* @__PURE__ */ D(be, {
|
|
923
|
+
asChild: !0,
|
|
924
|
+
children: /* @__PURE__ */ O(he, {
|
|
925
|
+
variant: "outline",
|
|
926
|
+
id: i,
|
|
927
|
+
name: a,
|
|
928
|
+
"aria-label": p || l.data.name,
|
|
929
|
+
className: "tg:w-full tg:justify-between tg:font-normal",
|
|
930
|
+
children: [g ? g.toLocaleDateString() : s || h("renderer.defaultInputs.selectDate"), /* @__PURE__ */ D(k, { className: "tg:size-4" })]
|
|
931
|
+
})
|
|
932
|
+
}), /* @__PURE__ */ D(xe, {
|
|
933
|
+
className: "tg:w-auto tg:overflow-hidden tg:p-0",
|
|
934
|
+
align: "start",
|
|
935
|
+
children: /* @__PURE__ */ D(mt, {
|
|
936
|
+
mode: "single",
|
|
937
|
+
selected: g,
|
|
938
|
+
captionLayout: "dropdown",
|
|
939
|
+
disabled: (e) => {
|
|
940
|
+
if (l.data.disablePast) {
|
|
941
|
+
let t = /* @__PURE__ */ new Date();
|
|
942
|
+
return t.setHours(0, 0, 0, 0), e < t;
|
|
943
|
+
}
|
|
944
|
+
return !1;
|
|
945
|
+
},
|
|
946
|
+
onSelect: (e) => {
|
|
947
|
+
u(e ? e.toISOString() : ""), r(!1);
|
|
948
|
+
}
|
|
949
|
+
})
|
|
950
|
+
})]
|
|
951
|
+
}),
|
|
952
|
+
f && /* @__PURE__ */ D(Y, { children: f }),
|
|
953
|
+
m && !f && /* @__PURE__ */ D(J, { children: m })
|
|
954
|
+
]
|
|
955
|
+
});
|
|
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, {
|
|
959
|
+
className: "tg:mb-4",
|
|
960
|
+
children: [
|
|
961
|
+
/* @__PURE__ */ D(o, {
|
|
962
|
+
htmlFor: i,
|
|
963
|
+
label: u,
|
|
964
|
+
required: s.data.required
|
|
965
|
+
}),
|
|
966
|
+
/* @__PURE__ */ O(ye, {
|
|
967
|
+
open: n,
|
|
968
|
+
onOpenChange: r,
|
|
969
|
+
children: [/* @__PURE__ */ D(be, {
|
|
970
|
+
asChild: !0,
|
|
971
|
+
children: /* @__PURE__ */ O(he, {
|
|
972
|
+
id: i,
|
|
973
|
+
variant: "outline",
|
|
974
|
+
"aria-label": u || s.data.name,
|
|
975
|
+
className: "tg:w-full tg:justify-between tg:font-normal",
|
|
976
|
+
children: [h && g ? `${h.toLocaleDateString()} - ${g.toLocaleDateString()}` : h ? h.toLocaleDateString() : p("renderer.defaultInputs.selectDateRange"), /* @__PURE__ */ D(k, { className: "tg:size-4" })]
|
|
977
|
+
})
|
|
978
|
+
}), /* @__PURE__ */ D(xe, {
|
|
979
|
+
className: "tg:w-auto tg:overflow-hidden tg:p-0",
|
|
980
|
+
align: "start",
|
|
981
|
+
children: /* @__PURE__ */ D(mt, {
|
|
982
|
+
mode: "range",
|
|
983
|
+
selected: {
|
|
984
|
+
from: h,
|
|
985
|
+
to: g
|
|
986
|
+
},
|
|
987
|
+
captionLayout: "dropdown",
|
|
988
|
+
disabled: (e) => {
|
|
989
|
+
if (s.data.disablePast) {
|
|
990
|
+
let t = /* @__PURE__ */ new Date();
|
|
991
|
+
return t.setHours(0, 0, 0, 0), e < t;
|
|
992
|
+
}
|
|
993
|
+
return !1;
|
|
994
|
+
},
|
|
995
|
+
onSelect: (e) => {
|
|
996
|
+
c([e?.from ? e.from.toISOString() : void 0, e?.to ? e.to.toISOString() : void 0]);
|
|
997
|
+
},
|
|
998
|
+
numberOfMonths: 2
|
|
999
|
+
})
|
|
1000
|
+
})]
|
|
1001
|
+
}),
|
|
1002
|
+
l && /* @__PURE__ */ D(Y, { children: l }),
|
|
1003
|
+
f && !l && /* @__PURE__ */ D(J, { children: f })
|
|
1004
|
+
]
|
|
1005
|
+
});
|
|
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, {
|
|
1009
|
+
className: "tg:mb-4",
|
|
1010
|
+
children: [
|
|
1011
|
+
/* @__PURE__ */ D(a, {
|
|
1012
|
+
htmlFor: n,
|
|
1013
|
+
label: l,
|
|
1014
|
+
required: o.data.required
|
|
1015
|
+
}),
|
|
1016
|
+
/* @__PURE__ */ D(X, {
|
|
1017
|
+
type: "file",
|
|
1018
|
+
name: r,
|
|
1019
|
+
id: n,
|
|
1020
|
+
"aria-label": l || o.data.name,
|
|
1021
|
+
onChange: async (e) => {
|
|
1022
|
+
let { files: t } = e.target;
|
|
1023
|
+
if (!t || t.length === 0) {
|
|
1024
|
+
s(null);
|
|
1025
|
+
return;
|
|
1026
|
+
}
|
|
1027
|
+
if (o.data.multiple) {
|
|
1028
|
+
s(await u(Array.from(t)));
|
|
1029
|
+
return;
|
|
1030
|
+
}
|
|
1031
|
+
s(await p(t[0]));
|
|
1032
|
+
},
|
|
1033
|
+
multiple: o.data.multiple,
|
|
1034
|
+
placeholder: i
|
|
1035
|
+
}),
|
|
1036
|
+
c && /* @__PURE__ */ D(Y, { children: c }),
|
|
1037
|
+
d && !c && /* @__PURE__ */ D(J, { children: d })
|
|
1038
|
+
]
|
|
1039
|
+
});
|
|
1040
|
+
}, yt = ({ field: e }) => {
|
|
1041
|
+
let { id: t, name: n, value: r } = e;
|
|
1042
|
+
return /* @__PURE__ */ D(X, {
|
|
1043
|
+
type: "hidden",
|
|
1044
|
+
id: t,
|
|
1045
|
+
name: n,
|
|
1046
|
+
value: r ?? ""
|
|
1047
|
+
});
|
|
1048
|
+
}, bt = (e) => {
|
|
1049
|
+
let t = e.matchAll(/{{([\w-]+)}}/g);
|
|
1050
|
+
return Array.from(t, (e) => e[1]);
|
|
1051
|
+
}, xt = (e, t) => bt(e).every((e) => {
|
|
1052
|
+
let n = t[e];
|
|
1053
|
+
return n != null && n !== "";
|
|
1054
|
+
}), St = (e, t, n = !1) => e.replace(/{{([\w-]+)}}/g, (e, r) => {
|
|
1055
|
+
let i = t[r], a = i == null ? "" : String(i);
|
|
1056
|
+
return n ? encodeURIComponent(a) : a;
|
|
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,
|
|
1060
|
+
De,
|
|
1061
|
+
R
|
|
1062
|
+
]), $ = x(async (n) => {
|
|
1063
|
+
Q.current && Q.current.abort();
|
|
1064
|
+
let r = new AbortController();
|
|
1065
|
+
Q.current = r;
|
|
1066
|
+
let o = de.current, u = G.current, d = ge.current;
|
|
1067
|
+
if (!o?.url) {
|
|
1068
|
+
g(W("renderer.defaultHttpInput.noUrlConfigured")), Q.current = null;
|
|
1069
|
+
return;
|
|
1070
|
+
}
|
|
1071
|
+
if (o.url && !xt(o.url, u)) {
|
|
1072
|
+
Q.current = null;
|
|
1073
|
+
return;
|
|
1074
|
+
}
|
|
1075
|
+
p(!0), g(null);
|
|
1076
|
+
try {
|
|
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 = [
|
|
1078
|
+
"POST",
|
|
1079
|
+
"PUT",
|
|
1080
|
+
"PATCH"
|
|
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, {
|
|
1082
|
+
body: b || void 0,
|
|
1083
|
+
headers: Object.fromEntries(Object.entries(v).filter(([, e]) => e)),
|
|
1084
|
+
method: o.method || "GET",
|
|
1085
|
+
signal: r.signal
|
|
1086
|
+
});
|
|
1087
|
+
if (clearTimeout(x), !S.ok) {
|
|
1088
|
+
g(`HTTP Error ${S.status}: ${S.statusText}`);
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
let C = e(await S.text());
|
|
1092
|
+
if (!C.ok) {
|
|
1093
|
+
g(W("renderer.defaultHttpInput.invalidJson"));
|
|
1094
|
+
return;
|
|
1095
|
+
}
|
|
1096
|
+
let w = i(C.value), T = o.responsePath ? t(w, o.responsePath) : w;
|
|
1097
|
+
if (o.responseMapping && Array.isArray(T)) {
|
|
1098
|
+
let { valueField: e = "value", labelField: n = "label", descriptionField: r, imageField: i } = o.responseMapping, a = _e.current;
|
|
1099
|
+
y(T.map((o) => {
|
|
1100
|
+
let s = r ? t(o, r) : void 0, l = i ? t(o, i) : void 0, u = String(t(o, n) || "");
|
|
1101
|
+
return {
|
|
1102
|
+
description: s != null && s !== "" ? String(s) : void 0,
|
|
1103
|
+
image: typeof l == "string" && l !== "" ? l : void 0,
|
|
1104
|
+
label: a ? c(u) : u,
|
|
1105
|
+
value: String(t(o, e) || "")
|
|
1106
|
+
};
|
|
1107
|
+
}));
|
|
1108
|
+
} else d(typeof T == "string" ? T : JSON.stringify(T));
|
|
1109
|
+
} catch (e) {
|
|
1110
|
+
if (e instanceof Error && e.name === "AbortError") return;
|
|
1111
|
+
g(e instanceof Error ? e.message : W("renderer.defaultHttpInput.fetchFailed")), console.error("HTTP Input fetch error:", e);
|
|
1112
|
+
} finally {
|
|
1113
|
+
Q.current === r && (p(!1), Q.current = null);
|
|
1114
|
+
}
|
|
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;
|
|
1118
|
+
}, [
|
|
1119
|
+
V,
|
|
1120
|
+
R,
|
|
1121
|
+
le,
|
|
1122
|
+
z,
|
|
1123
|
+
B,
|
|
1124
|
+
P,
|
|
1125
|
+
$,
|
|
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;
|
|
1136
|
+
let e = setTimeout(() => {
|
|
1137
|
+
$(), U.current = ke;
|
|
1138
|
+
}, 500);
|
|
1139
|
+
return () => clearTimeout(e);
|
|
1140
|
+
}, [
|
|
1141
|
+
ke,
|
|
1142
|
+
De,
|
|
1143
|
+
Ae,
|
|
1144
|
+
$
|
|
1145
|
+
]), C(() => {
|
|
1146
|
+
if (!H.current) {
|
|
1147
|
+
H.current = !0;
|
|
1148
|
+
return;
|
|
1149
|
+
}
|
|
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;
|
|
1165
|
+
let e = setTimeout(() => {
|
|
1166
|
+
$(b);
|
|
1167
|
+
}, 300);
|
|
1168
|
+
return () => clearTimeout(e);
|
|
1169
|
+
}, [
|
|
1170
|
+
b,
|
|
1171
|
+
V?.searchParam,
|
|
1172
|
+
$
|
|
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, {
|
|
1178
|
+
className: "tg:mb-4",
|
|
1179
|
+
children: [
|
|
1180
|
+
/* @__PURE__ */ D(oe, {
|
|
1181
|
+
htmlFor: A,
|
|
1182
|
+
label: I,
|
|
1183
|
+
required: N.data.required
|
|
1184
|
+
}),
|
|
1185
|
+
/* @__PURE__ */ D(nt, {
|
|
1186
|
+
missing: ce,
|
|
1187
|
+
children: /* @__PURE__ */ O("div", {
|
|
1188
|
+
className: "tg:relative",
|
|
1189
|
+
children: [
|
|
1190
|
+
/* @__PURE__ */ O(ye, {
|
|
1191
|
+
open: ne,
|
|
1192
|
+
onOpenChange: k,
|
|
1193
|
+
children: [/* @__PURE__ */ D(be, {
|
|
1194
|
+
asChild: !0,
|
|
1195
|
+
children: /* @__PURE__ */ O(he, {
|
|
1196
|
+
id: A,
|
|
1197
|
+
variant: "outline",
|
|
1198
|
+
role: "combobox",
|
|
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", {
|
|
1204
|
+
className: "tg:truncate",
|
|
1205
|
+
children: r
|
|
1206
|
+
}), /* @__PURE__ */ D(ie, { className: "tg:ml-2 tg:h-4 tg:w-4 tg:shrink-0 tg:opacity-50" })]
|
|
1207
|
+
})
|
|
1208
|
+
}), /* @__PURE__ */ D(xe, {
|
|
1209
|
+
className: "tg:w-[var(--radix-popover-trigger-width)] tg:p-0",
|
|
1210
|
+
align: "start",
|
|
1211
|
+
children: /* @__PURE__ */ O(Ke, {
|
|
1212
|
+
shouldFilter: !1,
|
|
1213
|
+
children: [/* @__PURE__ */ D(qe, {
|
|
1214
|
+
placeholder: W("renderer.defaultHttpInput.search"),
|
|
1215
|
+
value: b,
|
|
1216
|
+
onValueChange: (e) => {
|
|
1217
|
+
S(e), g(null);
|
|
1218
|
+
}
|
|
1219
|
+
}), /* @__PURE__ */ O(Je, { children: [
|
|
1220
|
+
u && /* @__PURE__ */ D("div", {
|
|
1221
|
+
className: "tg:flex tg:items-center tg:justify-center tg:p-4",
|
|
1222
|
+
children: /* @__PURE__ */ D(M, { className: "tg:h-4 tg:w-4 tg:animate-spin" })
|
|
1223
|
+
}),
|
|
1224
|
+
!u && h && /* @__PURE__ */ O("div", {
|
|
1225
|
+
className: "tg:p-4 tg:text-destructive tg:text-sm",
|
|
1226
|
+
children: [/* @__PURE__ */ D("div", { children: h }), /* @__PURE__ */ D("button", {
|
|
1227
|
+
type: "button",
|
|
1228
|
+
onClick: () => $(b),
|
|
1229
|
+
className: "tg:mt-2 tg:block tg:text-primary tg:hover:underline",
|
|
1230
|
+
children: W("renderer.defaultHttpInput.retry")
|
|
1231
|
+
})]
|
|
1232
|
+
}),
|
|
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, {
|
|
1234
|
+
value: e.value,
|
|
1235
|
+
onSelect: () => {
|
|
1236
|
+
P(e.value === j ? "" : e.value), k(!1);
|
|
1237
|
+
},
|
|
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, {
|
|
1239
|
+
label: e.label,
|
|
1240
|
+
description: e.description,
|
|
1241
|
+
image: e.image
|
|
1242
|
+
})]
|
|
1243
|
+
}, e.value)) })] })
|
|
1244
|
+
] })]
|
|
1245
|
+
})
|
|
1246
|
+
})]
|
|
1247
|
+
}),
|
|
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", {
|
|
1250
|
+
type: "button",
|
|
1251
|
+
"aria-label": W("common.clear"),
|
|
1252
|
+
onClick: () => P(""),
|
|
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",
|
|
1254
|
+
children: /* @__PURE__ */ D(se, { className: "tg:size-4" })
|
|
1255
|
+
})
|
|
1256
|
+
]
|
|
1257
|
+
})
|
|
1258
|
+
}),
|
|
1259
|
+
F && /* @__PURE__ */ D(Y, { children: F }),
|
|
1260
|
+
L && !F && /* @__PURE__ */ D(J, { children: L })
|
|
1261
|
+
]
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
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", {
|
|
1265
|
+
className: "tg:relative",
|
|
1266
|
+
children: [
|
|
1267
|
+
/* @__PURE__ */ O(Se, {
|
|
1268
|
+
value: i,
|
|
1269
|
+
onValueChange: (e) => P(e),
|
|
1270
|
+
disabled: n || v.length === 0,
|
|
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, {
|
|
1279
|
+
value: e.value,
|
|
1280
|
+
children: /* @__PURE__ */ D(lt, {
|
|
1281
|
+
label: e.label,
|
|
1282
|
+
description: e.description,
|
|
1283
|
+
image: e.image
|
|
1284
|
+
})
|
|
1285
|
+
}, e.value + t)) }) })]
|
|
1286
|
+
}),
|
|
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", {
|
|
1289
|
+
type: "button",
|
|
1290
|
+
"aria-label": W("common.clear"),
|
|
1291
|
+
onClick: () => P(""),
|
|
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",
|
|
1293
|
+
children: /* @__PURE__ */ D(se, { className: "tg:size-4" })
|
|
1294
|
+
})
|
|
1295
|
+
]
|
|
1296
|
+
});
|
|
1297
|
+
return /* @__PURE__ */ O(q, {
|
|
1298
|
+
className: "tg:mb-4",
|
|
1299
|
+
children: [
|
|
1300
|
+
/* @__PURE__ */ D(oe, {
|
|
1301
|
+
htmlFor: A,
|
|
1302
|
+
label: I,
|
|
1303
|
+
required: N.data.required
|
|
1304
|
+
}),
|
|
1305
|
+
/* @__PURE__ */ D(nt, {
|
|
1306
|
+
missing: ce,
|
|
1307
|
+
children: r ? /* @__PURE__ */ D(je, { children: /* @__PURE__ */ O(Me, { children: [/* @__PURE__ */ D(Ne, {
|
|
1308
|
+
asChild: !0,
|
|
1309
|
+
children: /* @__PURE__ */ D("div", {
|
|
1310
|
+
className: "tg:w-full",
|
|
1311
|
+
children: a
|
|
1312
|
+
})
|
|
1313
|
+
}), /* @__PURE__ */ D(Pe, { children: /* @__PURE__ */ D("p", { children: r }) })] }) }) : a
|
|
1314
|
+
}),
|
|
1315
|
+
F && /* @__PURE__ */ D(Y, { children: F }),
|
|
1316
|
+
L && !F && /* @__PURE__ */ D(J, { children: L })
|
|
1317
|
+
]
|
|
1318
|
+
});
|
|
1319
|
+
}
|
|
1320
|
+
return /* @__PURE__ */ O(q, {
|
|
1321
|
+
className: "tg:mb-4",
|
|
1322
|
+
children: [
|
|
1323
|
+
/* @__PURE__ */ D(oe, {
|
|
1324
|
+
htmlFor: A,
|
|
1325
|
+
label: I,
|
|
1326
|
+
required: N.data.required
|
|
1327
|
+
}),
|
|
1328
|
+
/* @__PURE__ */ D(X, {
|
|
1329
|
+
type: "text",
|
|
1330
|
+
name: re,
|
|
1331
|
+
id: A,
|
|
1332
|
+
"aria-label": I || N.data.name,
|
|
1333
|
+
value: typeof j == "string" ? j : JSON.stringify(j),
|
|
1334
|
+
readOnly: !0,
|
|
1335
|
+
disabled: !0
|
|
1336
|
+
}),
|
|
1337
|
+
F && /* @__PURE__ */ D(Y, { children: F }),
|
|
1338
|
+
L && !F && /* @__PURE__ */ D(J, { children: L })
|
|
1339
|
+
]
|
|
1340
|
+
});
|
|
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, {
|
|
1344
|
+
className: "tg:mb-4",
|
|
1345
|
+
children: [
|
|
1346
|
+
/* @__PURE__ */ D(o, {
|
|
1347
|
+
htmlFor: n,
|
|
1348
|
+
label: u,
|
|
1349
|
+
required: s.data.required
|
|
1350
|
+
}),
|
|
1351
|
+
/* @__PURE__ */ D(X, {
|
|
1352
|
+
id: n,
|
|
1353
|
+
type: "number",
|
|
1354
|
+
name: r,
|
|
1355
|
+
"aria-label": u || s.data.name,
|
|
1356
|
+
value: i ?? "",
|
|
1357
|
+
onChange: (e) => c(e.target.value === "" ? null : Number(e.target.value)),
|
|
1358
|
+
placeholder: a
|
|
1359
|
+
}),
|
|
1360
|
+
l && /* @__PURE__ */ D(Y, { children: l }),
|
|
1361
|
+
d && !l && /* @__PURE__ */ D(J, { children: d })
|
|
1362
|
+
]
|
|
1363
|
+
});
|
|
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
|
+
className: "tg:mb-4",
|
|
1368
|
+
children: [
|
|
1369
|
+
/* @__PURE__ */ D(o, {
|
|
1370
|
+
htmlFor: n,
|
|
1371
|
+
label: u,
|
|
1372
|
+
required: s.data.required
|
|
1373
|
+
}),
|
|
1374
|
+
/* @__PURE__ */ D(X, {
|
|
1375
|
+
id: n,
|
|
1376
|
+
name: r,
|
|
1377
|
+
type: "password",
|
|
1378
|
+
"aria-label": u || s.data.name,
|
|
1379
|
+
value: i ?? "",
|
|
1380
|
+
onChange: (e) => c(e.target.value),
|
|
1381
|
+
placeholder: a,
|
|
1382
|
+
autoComplete: "new-password"
|
|
1383
|
+
}),
|
|
1384
|
+
l && /* @__PURE__ */ D(Y, { children: l }),
|
|
1385
|
+
d && !l && /* @__PURE__ */ D(J, { children: d })
|
|
1386
|
+
]
|
|
1387
|
+
});
|
|
1388
|
+
}, Et = I("tg:group/field tg:flex tg:w-full tg:gap-3 tg:data-[invalid=true]:text-destructive", {
|
|
1389
|
+
defaultVariants: { orientation: "vertical" },
|
|
1390
|
+
variants: { orientation: {
|
|
1391
|
+
horizontal: [
|
|
1392
|
+
"tg:flex-row tg:items-center",
|
|
1393
|
+
"tg:[&>[data-slot=field-label]]:flex-auto",
|
|
1394
|
+
"tg:has-[>[data-slot=field-content]]:items-start tg:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
1395
|
+
],
|
|
1396
|
+
responsive: [
|
|
1397
|
+
"tg:flex-col tg:@md/field-group:flex-row tg:@md/field-group:items-center tg:[&>*]:w-full tg:@md/field-group:[&>*]:w-auto tg:[&>.sr-only]:w-auto",
|
|
1398
|
+
"tg:@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
1399
|
+
"tg:@md/field-group:has-[>[data-slot=field-content]]:items-start tg:@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
1400
|
+
],
|
|
1401
|
+
vertical: ["tg:flex-col tg:[&>*]:w-full tg:[&>.sr-only]:w-auto"]
|
|
1402
|
+
} }
|
|
1403
|
+
});
|
|
1404
|
+
function Dt({ className: e, orientation: t = "vertical", ...n }) {
|
|
1405
|
+
return /* @__PURE__ */ D("div", {
|
|
1406
|
+
role: "group",
|
|
1407
|
+
"data-slot": "field",
|
|
1408
|
+
"data-orientation": t,
|
|
1409
|
+
className: K(Et({ orientation: t }), e),
|
|
1410
|
+
...n
|
|
1411
|
+
});
|
|
1412
|
+
}
|
|
1413
|
+
function Ot({ className: e, ...t }) {
|
|
1414
|
+
return /* @__PURE__ */ D("div", {
|
|
1415
|
+
"data-slot": "field-content",
|
|
1416
|
+
className: K("tg:group/field-content tg:flex tg:flex-1 tg:flex-col tg:gap-1.5 tg:leading-snug", e),
|
|
1417
|
+
...t
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
function kt({ className: e, ...t }) {
|
|
1421
|
+
return /* @__PURE__ */ D(Z, {
|
|
1422
|
+
"data-slot": "field-label",
|
|
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),
|
|
1424
|
+
...t
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
function At({ className: e, ...t }) {
|
|
1428
|
+
return /* @__PURE__ */ D("div", {
|
|
1429
|
+
"data-slot": "field-label",
|
|
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),
|
|
1431
|
+
...t
|
|
1432
|
+
});
|
|
1433
|
+
}
|
|
1434
|
+
function jt({ className: e, ...t }) {
|
|
1435
|
+
return /* @__PURE__ */ D("p", {
|
|
1436
|
+
"data-slot": "field-description",
|
|
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),
|
|
1438
|
+
...t
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
//#endregion
|
|
1442
|
+
//#region src/shared/components/ui/radio-group.tsx
|
|
1443
|
+
function Mt({ className: e, ...t }) {
|
|
1444
|
+
return /* @__PURE__ */ D(G.Root, {
|
|
1445
|
+
"data-slot": "radio-group",
|
|
1446
|
+
className: K("tg:grid tg:gap-3", e),
|
|
1447
|
+
...t
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
function Nt({ className: e, ...t }) {
|
|
1451
|
+
return /* @__PURE__ */ D(G.Item, {
|
|
1452
|
+
"data-slot": "radio-group-item",
|
|
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),
|
|
1454
|
+
...t,
|
|
1455
|
+
children: /* @__PURE__ */ D(G.Indicator, {
|
|
1456
|
+
"data-slot": "radio-group-indicator",
|
|
1457
|
+
className: "tg:relative tg:flex tg:items-center tg:justify-center",
|
|
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" })
|
|
1459
|
+
})
|
|
1460
|
+
});
|
|
1461
|
+
}
|
|
1462
|
+
//#endregion
|
|
1463
|
+
//#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.tsx
|
|
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, {
|
|
1467
|
+
className: "tg:mb-4",
|
|
1468
|
+
children: [
|
|
1469
|
+
/* @__PURE__ */ D(o, {
|
|
1470
|
+
className: "tg:mb-1",
|
|
1471
|
+
id: C,
|
|
1472
|
+
label: u,
|
|
1473
|
+
required: s.data.required
|
|
1474
|
+
}),
|
|
1475
|
+
/* @__PURE__ */ D(rt, { missing: h }),
|
|
1476
|
+
_ && /* @__PURE__ */ O("div", {
|
|
1477
|
+
className: "tg:flex tg:items-center tg:gap-2 tg:py-2 tg:text-muted-foreground tg:text-sm",
|
|
1478
|
+
children: [/* @__PURE__ */ D(M, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ D("span", { children: b("renderer.defaultRadioInput.loadingOptions") })]
|
|
1479
|
+
}),
|
|
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,
|
|
1485
|
+
name: i,
|
|
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, {
|
|
1490
|
+
htmlFor: r,
|
|
1491
|
+
className: K("tg:group/option tg:pointer-events-auto tg:relative", m && "tg:group-hover/option:pr-16"),
|
|
1492
|
+
children: [/* @__PURE__ */ O(Dt, {
|
|
1493
|
+
orientation: "horizontal",
|
|
1494
|
+
"data-disabled": e.disabled || void 0,
|
|
1495
|
+
children: [
|
|
1496
|
+
e.image && /* @__PURE__ */ D("img", {
|
|
1497
|
+
src: e.image,
|
|
1498
|
+
alt: "",
|
|
1499
|
+
className: "tg:h-10 tg:w-10 tg:shrink-0 tg:self-center tg:rounded tg:object-cover"
|
|
1500
|
+
}),
|
|
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"),
|
|
1505
|
+
children: i
|
|
1506
|
+
}), a && /* @__PURE__ */ D(jt, {
|
|
1507
|
+
className: K(m && "tg:block tg:max-w-full tg:truncate"),
|
|
1508
|
+
children: a
|
|
1509
|
+
})]
|
|
1510
|
+
}),
|
|
1511
|
+
/* @__PURE__ */ D(Nt, {
|
|
1512
|
+
value: o,
|
|
1513
|
+
id: r,
|
|
1514
|
+
disabled: e.disabled,
|
|
1515
|
+
className: K(m && "tg:ml-auto tg:shrink-0 tg:group-hover/option:invisible")
|
|
1516
|
+
})
|
|
1517
|
+
]
|
|
1518
|
+
}), p?.({
|
|
1519
|
+
index: t,
|
|
1520
|
+
option: e,
|
|
1521
|
+
variant: "card"
|
|
1522
|
+
})]
|
|
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"),
|
|
1525
|
+
children: [
|
|
1526
|
+
/* @__PURE__ */ D(Nt, {
|
|
1527
|
+
value: o,
|
|
1528
|
+
id: r,
|
|
1529
|
+
disabled: e.disabled,
|
|
1530
|
+
className: "tg:mt-0.5"
|
|
1531
|
+
}),
|
|
1532
|
+
e.image && /* @__PURE__ */ D("img", {
|
|
1533
|
+
src: e.image,
|
|
1534
|
+
alt: "",
|
|
1535
|
+
className: "tg:h-8 tg:w-8 tg:rounded tg:object-cover"
|
|
1536
|
+
}),
|
|
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, {
|
|
1540
|
+
htmlFor: r,
|
|
1541
|
+
className: K("tg:cursor-pointer tg:font-normal tg:text-sm", m && "tg:block tg:max-w-full tg:truncate"),
|
|
1542
|
+
children: i
|
|
1543
|
+
}), a && /* @__PURE__ */ D("span", {
|
|
1544
|
+
className: K("tg:text-muted-foreground tg:text-xs", m && "tg:block tg:max-w-full tg:truncate"),
|
|
1545
|
+
children: a
|
|
1546
|
+
})]
|
|
1547
|
+
}),
|
|
1548
|
+
p?.({
|
|
1549
|
+
index: t,
|
|
1550
|
+
option: e,
|
|
1551
|
+
variant: "default"
|
|
1552
|
+
})
|
|
1553
|
+
]
|
|
1554
|
+
}, e.value + t);
|
|
1555
|
+
}), T > 0 && /* @__PURE__ */ D("div", {
|
|
1556
|
+
className: "tg:px-2 tg:py-1 tg:text-muted-foreground tg:text-xs",
|
|
1557
|
+
children: "…"
|
|
1558
|
+
})]
|
|
1559
|
+
}),
|
|
1560
|
+
l && /* @__PURE__ */ D(Y, { children: l }),
|
|
1561
|
+
v && !l && /* @__PURE__ */ D(Y, { children: v }),
|
|
1562
|
+
f && !l && !v && /* @__PURE__ */ D(J, { children: f })
|
|
1563
|
+
]
|
|
1564
|
+
});
|
|
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, {
|
|
1568
|
+
className: "tg:mb-4",
|
|
1569
|
+
children: [
|
|
1570
|
+
/* @__PURE__ */ D(o, {
|
|
1571
|
+
htmlFor: n,
|
|
1572
|
+
label: u,
|
|
1573
|
+
required: s.data.required
|
|
1574
|
+
}),
|
|
1575
|
+
/* @__PURE__ */ D(nt, {
|
|
1576
|
+
missing: p,
|
|
1577
|
+
children: /* @__PURE__ */ O("div", {
|
|
1578
|
+
className: "tg:relative",
|
|
1579
|
+
children: [
|
|
1580
|
+
/* @__PURE__ */ O(Se, {
|
|
1581
|
+
name: r,
|
|
1582
|
+
value: v,
|
|
1583
|
+
onValueChange: (e) => c(e),
|
|
1584
|
+
disabled: h || p.length > 0,
|
|
1585
|
+
children: [/* @__PURE__ */ D(Te, {
|
|
1586
|
+
id: n,
|
|
1587
|
+
name: r,
|
|
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, {
|
|
1592
|
+
value: String(e.value),
|
|
1593
|
+
disabled: e.disabled,
|
|
1594
|
+
children: /* @__PURE__ */ D(lt, {
|
|
1595
|
+
label: _(e.label) || e.value,
|
|
1596
|
+
description: _(e.description),
|
|
1597
|
+
image: e.image
|
|
1598
|
+
})
|
|
1599
|
+
}, `${e.value}-${t}`)) }) })]
|
|
1600
|
+
}),
|
|
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", {
|
|
1603
|
+
type: "button",
|
|
1604
|
+
"aria-label": _("common.clear"),
|
|
1605
|
+
onClick: () => c(""),
|
|
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",
|
|
1607
|
+
children: /* @__PURE__ */ D(se, { className: "tg:size-4" })
|
|
1608
|
+
})
|
|
1609
|
+
]
|
|
1610
|
+
})
|
|
1611
|
+
}),
|
|
1612
|
+
l && /* @__PURE__ */ D(Y, { children: l }),
|
|
1613
|
+
g && !l && /* @__PURE__ */ D(Y, { children: g }),
|
|
1614
|
+
f && !l && !g && /* @__PURE__ */ D(J, { children: f })
|
|
1615
|
+
]
|
|
1616
|
+
});
|
|
1617
|
+
}, It = (e) => null;
|
|
1618
|
+
//#endregion
|
|
1619
|
+
//#region src/shared/components/ui/switch.tsx
|
|
1620
|
+
function Lt({ className: e, ...t }) {
|
|
1621
|
+
return /* @__PURE__ */ D(fe.Root, {
|
|
1622
|
+
"data-slot": "switch",
|
|
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),
|
|
1624
|
+
...t,
|
|
1625
|
+
children: /* @__PURE__ */ D(fe.Thumb, {
|
|
1626
|
+
"data-slot": "switch-thumb",
|
|
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")
|
|
1628
|
+
})
|
|
1629
|
+
});
|
|
1630
|
+
}
|
|
1631
|
+
//#endregion
|
|
1632
|
+
//#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.tsx
|
|
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, {
|
|
1636
|
+
className: "tg:mb-4",
|
|
1637
|
+
children: [
|
|
1638
|
+
/* @__PURE__ */ D(a, {
|
|
1639
|
+
htmlFor: n,
|
|
1640
|
+
label: l,
|
|
1641
|
+
required: o.data.required
|
|
1642
|
+
}),
|
|
1643
|
+
/* @__PURE__ */ D(Lt, {
|
|
1644
|
+
id: n,
|
|
1645
|
+
name: r,
|
|
1646
|
+
"aria-label": l || o.data.name,
|
|
1647
|
+
checked: i,
|
|
1648
|
+
onCheckedChange: s
|
|
1649
|
+
}),
|
|
1650
|
+
u && !c && /* @__PURE__ */ D(J, { children: u }),
|
|
1651
|
+
c && /* @__PURE__ */ D(Y, { children: c })
|
|
1652
|
+
]
|
|
1653
|
+
});
|
|
1654
|
+
};
|
|
1655
|
+
//#endregion
|
|
1656
|
+
//#region src/shared/components/ui/textarea.tsx
|
|
1657
|
+
function zt({ className: e, ...t }) {
|
|
1658
|
+
return /* @__PURE__ */ D("textarea", {
|
|
1659
|
+
"data-slot": "textarea",
|
|
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),
|
|
1661
|
+
...t
|
|
1662
|
+
});
|
|
1663
|
+
}
|
|
1664
|
+
//#endregion
|
|
1665
|
+
//#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.tsx
|
|
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, {
|
|
1669
|
+
className: "tg:mb-4",
|
|
1670
|
+
children: [
|
|
1671
|
+
/* @__PURE__ */ D(o, {
|
|
1672
|
+
htmlFor: n,
|
|
1673
|
+
label: u,
|
|
1674
|
+
required: s.data.required
|
|
1675
|
+
}),
|
|
1676
|
+
/* @__PURE__ */ D(zt, {
|
|
1677
|
+
id: n,
|
|
1678
|
+
name: r,
|
|
1679
|
+
"aria-label": u || s.data.name,
|
|
1680
|
+
value: i ?? "",
|
|
1681
|
+
onChange: (e) => c(e.target.value),
|
|
1682
|
+
placeholder: a,
|
|
1683
|
+
className: "tg:w-full tg:rounded-md tg:border tg:px-3 tg:py-2",
|
|
1684
|
+
rows: 4
|
|
1685
|
+
}),
|
|
1686
|
+
l && /* @__PURE__ */ D(Y, { children: l }),
|
|
1687
|
+
d && !l && /* @__PURE__ */ D(J, { children: d })
|
|
1688
|
+
]
|
|
1689
|
+
});
|
|
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, {
|
|
1693
|
+
className: "tg:mb-4",
|
|
1694
|
+
children: [
|
|
1695
|
+
/* @__PURE__ */ D(o, {
|
|
1696
|
+
htmlFor: n,
|
|
1697
|
+
label: u,
|
|
1698
|
+
required: s.data.required
|
|
1699
|
+
}),
|
|
1700
|
+
/* @__PURE__ */ D(X, {
|
|
1701
|
+
type: "text",
|
|
1702
|
+
id: n,
|
|
1703
|
+
name: r,
|
|
1704
|
+
"aria-label": u || s.data.name,
|
|
1705
|
+
value: i ?? "",
|
|
1706
|
+
onChange: (e) => c(e.target.value),
|
|
1707
|
+
placeholder: a
|
|
1708
|
+
}),
|
|
1709
|
+
l && /* @__PURE__ */ D(Y, { children: l }),
|
|
1710
|
+
d && !l && /* @__PURE__ */ D(J, { children: d })
|
|
1711
|
+
]
|
|
1712
|
+
});
|
|
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, {
|
|
1716
|
+
className: "tg:mb-4",
|
|
1717
|
+
children: [
|
|
1718
|
+
/* @__PURE__ */ D(o, {
|
|
1719
|
+
htmlFor: n,
|
|
1720
|
+
label: u,
|
|
1721
|
+
required: s.data.required
|
|
1722
|
+
}),
|
|
1723
|
+
/* @__PURE__ */ D(X, {
|
|
1724
|
+
type: "time",
|
|
1725
|
+
id: n,
|
|
1726
|
+
name: r,
|
|
1727
|
+
"aria-label": u || s.data.name,
|
|
1728
|
+
value: i ?? "",
|
|
1729
|
+
onChange: (e) => c(e.target.value),
|
|
1730
|
+
placeholder: a,
|
|
1731
|
+
className: "tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
|
|
1732
|
+
}),
|
|
1733
|
+
l && /* @__PURE__ */ D(Y, { children: l }),
|
|
1734
|
+
d && !l && /* @__PURE__ */ D(J, { children: d })
|
|
1735
|
+
]
|
|
1736
|
+
});
|
|
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]);
|
|
1742
|
+
};
|
|
1743
|
+
return /* @__PURE__ */ O(q, {
|
|
1744
|
+
className: "tg:mb-4",
|
|
1745
|
+
children: [
|
|
1746
|
+
/* @__PURE__ */ D(a, {
|
|
1747
|
+
htmlFor: `${n}-start`,
|
|
1748
|
+
label: l,
|
|
1749
|
+
required: o.data.required
|
|
1750
|
+
}),
|
|
1751
|
+
/* @__PURE__ */ O("div", {
|
|
1752
|
+
className: "tg:flex tg:gap-2",
|
|
1753
|
+
children: [/* @__PURE__ */ D(X, {
|
|
1754
|
+
id: `${n}-start`,
|
|
1755
|
+
name: `${r}-start`,
|
|
1756
|
+
"aria-label": `${l || o.data.name} - ${f("renderer.defaultInputs.startTime")}`,
|
|
1757
|
+
"aria-invalid": !!c,
|
|
1758
|
+
"aria-describedby": c ? `${o.id}-error` : void 0,
|
|
1759
|
+
type: "time",
|
|
1760
|
+
value: m,
|
|
1761
|
+
onChange: (e) => g(e.target.value),
|
|
1762
|
+
placeholder: f("renderer.defaultInputs.startTime"),
|
|
1763
|
+
className: "tg:flex-1 tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
|
|
1764
|
+
}), /* @__PURE__ */ D(X, {
|
|
1765
|
+
id: `${n}-end`,
|
|
1766
|
+
name: `${r}-end`,
|
|
1767
|
+
"aria-label": `${l || o.data.name} - ${f("renderer.defaultInputs.endTime")}`,
|
|
1768
|
+
"aria-invalid": !!c,
|
|
1769
|
+
"aria-describedby": c ? `${o.id}-error` : void 0,
|
|
1770
|
+
type: "time",
|
|
1771
|
+
value: h,
|
|
1772
|
+
onChange: (e) => _(e.target.value),
|
|
1773
|
+
placeholder: f("renderer.defaultInputs.endTime"),
|
|
1774
|
+
className: "tg:flex-1 tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
|
|
1775
|
+
})]
|
|
1776
|
+
}),
|
|
1777
|
+
c && /* @__PURE__ */ D(Y, { children: c }),
|
|
1778
|
+
u && !c && /* @__PURE__ */ D(J, { children: u })
|
|
1779
|
+
]
|
|
1780
|
+
});
|
|
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) => {
|
|
1801
|
+
let p = d();
|
|
1802
|
+
return /* @__PURE__ */ O("button", {
|
|
1803
|
+
ref: f,
|
|
1804
|
+
id: t,
|
|
1805
|
+
onBlur: i,
|
|
1806
|
+
onClick: a,
|
|
1807
|
+
onFocus: o,
|
|
1808
|
+
onPointerDown: s,
|
|
1809
|
+
disabled: n || r,
|
|
1810
|
+
onPointerLeave: c,
|
|
1811
|
+
onPointerMove: l,
|
|
1812
|
+
type: "submit",
|
|
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",
|
|
1814
|
+
...u,
|
|
1815
|
+
children: [r && /* @__PURE__ */ D(M, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), e || p("renderer.defaultSubmitButton.submit")]
|
|
1816
|
+
});
|
|
1817
|
+
});
|
|
1818
|
+
//#endregion
|
|
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 };
|