treege 3.0.0-beta.9 → 3.0.0-beta.91
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 +598 -79
- package/dist/DefaultSubmitButton-NeSDqyzv.js +1909 -0
- package/dist/ThemeContext-CPsC8QIP.js +1008 -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/DefaultFileValueField.d.ts +14 -0
- 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/inputs/TranslatableInput.d.ts +20 -0
- 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-DJbNgLSF.js +6485 -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/context/TreegeViewerProvider.d.ts +28 -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/features/TreegeViewer/utils/viewerFields.d.ts +102 -0
- package/dist/renderer/features/TreegeViewer/web/TreegeViewer.d.ts +94 -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 +37 -0
- package/dist/renderer/hooks/useTranslate.d.ts +7 -5
- package/dist/renderer/index.d.ts +10 -2
- package/dist/renderer/index.native.d.ts +20 -0
- package/dist/renderer/types/renderer.d.ts +332 -49
- package/dist/renderer/utils/extraPayload.d.ts +21 -0
- package/dist/renderer/utils/file.d.ts +24 -10
- 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 +50 -0
- package/dist/renderer/utils/templateDependencies.d.ts +17 -0
- package/dist/renderer-CNbSt_QW.js +446 -0
- package/dist/renderer-native.d.ts +2 -0
- package/dist/renderer-native.js +3696 -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 +259 -19
- package/dist/shared/locales/de.json.d.ts +260 -20
- package/dist/shared/locales/en.json.d.ts +261 -21
- package/dist/shared/locales/es.json.d.ts +260 -20
- package/dist/shared/locales/fr.json.d.ts +260 -20
- package/dist/shared/locales/it.json.d.ts +260 -20
- package/dist/shared/locales/pt.json.d.ts +260 -20
- package/dist/shared/types/edge.d.ts +6 -0
- package/dist/shared/types/file.d.ts +14 -0
- package/dist/shared/types/node.d.ts +155 -19
- 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 +22 -0
- package/dist/shared/utils/translations.d.ts +21 -1
- package/dist/useRenderNode-CG466pNk.js +538 -0
- package/package.json +54 -22
- package/dist/ThemeContext-BIvs8Kw-.js +0 -758
- package/dist/TreegeEditor-Lv5Tn9_F.js +0 -2152
- package/dist/TreegeRenderer-BVaqgInZ.js +0 -1405
- 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,3696 @@
|
|
|
1
|
+
import { B as e, D as t, F as n, M as r, N as i, P as a, R as o, T as s, V as c, X as l, _ as u, a as d, b as f, c as p, g as m, h, i as g, k as _, l as v, m as y, n as b, o as x, q as S, r as C, s as ee, t as w, v as T, w as te, x as ne, y as E, z as re } from "./ThemeContext-CPsC8QIP.js";
|
|
2
|
+
import { a as D, c as O, i as k, l as A, n as ie, o as ae, r as oe, s as j, t as M } from "./useRenderNode-CG466pNk.js";
|
|
3
|
+
import { useCallback as se, useEffect as N, useMemo as ce, useRef as P, useState as F } from "react";
|
|
4
|
+
import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
5
|
+
import { ActivityIndicator as le, Alert as ue, Animated as de, FlatList as fe, Image as pe, Modal as me, ScrollView as he, StyleSheet as z, Switch as ge, Text as B, TextInput as _e, TouchableOpacity as V, View as H } from "react-native";
|
|
6
|
+
//#region src/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.tsx
|
|
7
|
+
var ve = ({ children: e }) => /* @__PURE__ */ L(H, {
|
|
8
|
+
style: ye.container,
|
|
9
|
+
children: e
|
|
10
|
+
}), ye = z.create({ container: { padding: 16 } }), be = ({ label: e, required: t, style: n }) => {
|
|
11
|
+
let { colors: r } = b();
|
|
12
|
+
return e ? /* @__PURE__ */ R(B, {
|
|
13
|
+
style: [
|
|
14
|
+
xe.label,
|
|
15
|
+
{ color: r.textSecondary },
|
|
16
|
+
n
|
|
17
|
+
],
|
|
18
|
+
children: [e, t && /* @__PURE__ */ L(B, {
|
|
19
|
+
style: { color: r.error },
|
|
20
|
+
children: "*"
|
|
21
|
+
})]
|
|
22
|
+
}) : null;
|
|
23
|
+
}, xe = z.create({ label: {
|
|
24
|
+
fontSize: 14,
|
|
25
|
+
fontWeight: "500",
|
|
26
|
+
marginBottom: 8
|
|
27
|
+
} }), Se = async (e, t) => {
|
|
28
|
+
if (!e || e.trim().length < 3) return [];
|
|
29
|
+
try {
|
|
30
|
+
let n = await fetch(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&format=jsonv2&addressdetails=1&limit=5`, { headers: {
|
|
31
|
+
Accept: "application/json",
|
|
32
|
+
"User-Agent": "Treege Renderer",
|
|
33
|
+
...t && { "Accept-Language": t }
|
|
34
|
+
} });
|
|
35
|
+
return n.ok ? (await n.json()).map((e) => ({
|
|
36
|
+
label: e.display_name,
|
|
37
|
+
value: e.display_name
|
|
38
|
+
})) : [];
|
|
39
|
+
} catch (e) {
|
|
40
|
+
return console.error("Nominatim fetch error:", e), [];
|
|
41
|
+
}
|
|
42
|
+
}, Ce = async (e, t) => {
|
|
43
|
+
if (!e || e.trim().length < 3) return [];
|
|
44
|
+
try {
|
|
45
|
+
let n = await fetch(`https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${encodeURIComponent(e)}&key=${t}`);
|
|
46
|
+
if (!n.ok) return console.warn("Google Places API request failed:", n.status), [];
|
|
47
|
+
let r = await n.json();
|
|
48
|
+
return r.status !== "OK" && r.status !== "ZERO_RESULTS" ? (console.warn("Google Places API status:", r.status), []) : (r.predictions || []).map((e) => ({
|
|
49
|
+
label: e.description,
|
|
50
|
+
value: e.description
|
|
51
|
+
}));
|
|
52
|
+
} catch (e) {
|
|
53
|
+
return console.error("Google Places fetch error:", e), [];
|
|
54
|
+
}
|
|
55
|
+
}, we = ({ field: e, extra: t }) => {
|
|
56
|
+
let [r, i] = F(""), [a, o] = F([]), [s, l] = F(!1), [u, d] = F(!1), { value: f, placeholder: p, id: m, name: h } = e, { InputLabel: g, node: _, setValue: v, error: y, label: x, helperText: S } = t, { language: C, googleApiKey: ee } = c(), w = n(), { colors: T } = b(), te = se((e) => {
|
|
57
|
+
v(e.value), i(""), l(!1), o([]);
|
|
58
|
+
}, [v]), ne = () => {
|
|
59
|
+
l(!1);
|
|
60
|
+
};
|
|
61
|
+
return N(() => {
|
|
62
|
+
if (!r || r.trim().length < 3) {
|
|
63
|
+
o([]), d(!1);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
d(!0);
|
|
67
|
+
let e = setTimeout(async () => {
|
|
68
|
+
o(ee ? await Ce(r, ee) : await Se(r, C)), d(!1);
|
|
69
|
+
}, 300);
|
|
70
|
+
return () => {
|
|
71
|
+
clearTimeout(e), d(!1);
|
|
72
|
+
};
|
|
73
|
+
}, [
|
|
74
|
+
r,
|
|
75
|
+
C,
|
|
76
|
+
ee
|
|
77
|
+
]), /* @__PURE__ */ R(H, {
|
|
78
|
+
style: U.container,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ L(g, {
|
|
81
|
+
label: x,
|
|
82
|
+
required: _.data.required
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ R(V, {
|
|
85
|
+
style: [
|
|
86
|
+
U.trigger,
|
|
87
|
+
{
|
|
88
|
+
backgroundColor: T.input,
|
|
89
|
+
borderColor: T.border
|
|
90
|
+
},
|
|
91
|
+
y && { borderColor: T.error }
|
|
92
|
+
],
|
|
93
|
+
onPress: () => l(!0),
|
|
94
|
+
activeOpacity: .7,
|
|
95
|
+
children: [/* @__PURE__ */ L(B, {
|
|
96
|
+
style: [
|
|
97
|
+
U.triggerText,
|
|
98
|
+
{ color: T.text },
|
|
99
|
+
!f && { color: T.textMuted }
|
|
100
|
+
],
|
|
101
|
+
numberOfLines: 1,
|
|
102
|
+
children: f || p || w("renderer.defaultAddressInput.enterAddress")
|
|
103
|
+
}), /* @__PURE__ */ L(B, {
|
|
104
|
+
style: U.icon,
|
|
105
|
+
children: "📍"
|
|
106
|
+
})]
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ L(me, {
|
|
109
|
+
visible: s,
|
|
110
|
+
transparent: !0,
|
|
111
|
+
animationType: "fade",
|
|
112
|
+
onRequestClose: ne,
|
|
113
|
+
children: /* @__PURE__ */ L(V, {
|
|
114
|
+
style: U.modalOverlay,
|
|
115
|
+
activeOpacity: 1,
|
|
116
|
+
onPress: ne,
|
|
117
|
+
children: /* @__PURE__ */ R(V, {
|
|
118
|
+
style: [U.modalContent, { backgroundColor: T.card }],
|
|
119
|
+
activeOpacity: 1,
|
|
120
|
+
onPress: () => {},
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ R(H, {
|
|
123
|
+
style: [U.modalHeader, { borderBottomColor: T.separator }],
|
|
124
|
+
children: [/* @__PURE__ */ L(B, {
|
|
125
|
+
style: [U.modalTitle, { color: T.text }],
|
|
126
|
+
children: x || p || w("renderer.defaultAddressInput.enterAddress")
|
|
127
|
+
}), /* @__PURE__ */ L(V, {
|
|
128
|
+
onPress: ne,
|
|
129
|
+
children: /* @__PURE__ */ L(B, {
|
|
130
|
+
style: [U.closeButton, { color: T.textMuted }],
|
|
131
|
+
children: "✕"
|
|
132
|
+
})
|
|
133
|
+
})]
|
|
134
|
+
}),
|
|
135
|
+
/* @__PURE__ */ R(H, {
|
|
136
|
+
style: U.searchContainer,
|
|
137
|
+
children: [/* @__PURE__ */ L(_e, {
|
|
138
|
+
style: [U.searchInput, {
|
|
139
|
+
backgroundColor: T.muted,
|
|
140
|
+
borderColor: T.border,
|
|
141
|
+
color: T.text
|
|
142
|
+
}],
|
|
143
|
+
placeholder: p || w("renderer.defaultAddressInput.enterAddress"),
|
|
144
|
+
placeholderTextColor: T.textMuted,
|
|
145
|
+
value: r,
|
|
146
|
+
onChangeText: i,
|
|
147
|
+
autoFocus: !0,
|
|
148
|
+
autoCapitalize: "none",
|
|
149
|
+
autoCorrect: !1
|
|
150
|
+
}), u && /* @__PURE__ */ L(le, {
|
|
151
|
+
size: "small",
|
|
152
|
+
color: T.primary,
|
|
153
|
+
style: U.searchLoader
|
|
154
|
+
})]
|
|
155
|
+
}),
|
|
156
|
+
u ? /* @__PURE__ */ R(H, {
|
|
157
|
+
style: U.loadingContainer,
|
|
158
|
+
children: [/* @__PURE__ */ L(le, {
|
|
159
|
+
size: "small",
|
|
160
|
+
color: T.primary
|
|
161
|
+
}), /* @__PURE__ */ L(B, {
|
|
162
|
+
style: [U.loadingText, { color: T.textMuted }],
|
|
163
|
+
children: w("renderer.defaultAddressInput.searching")
|
|
164
|
+
})]
|
|
165
|
+
}) : /* @__PURE__ */ L(fe, {
|
|
166
|
+
data: a,
|
|
167
|
+
keyExtractor: (e, t) => t.toString(),
|
|
168
|
+
style: U.suggestionsList,
|
|
169
|
+
contentContainerStyle: U.suggestionsListContent,
|
|
170
|
+
keyboardShouldPersistTaps: "handled",
|
|
171
|
+
ListEmptyComponent: r.length >= 3 ? /* @__PURE__ */ L(H, {
|
|
172
|
+
style: U.emptyContainer,
|
|
173
|
+
children: /* @__PURE__ */ L(B, {
|
|
174
|
+
style: [U.emptyText, { color: T.textMuted }],
|
|
175
|
+
children: w("renderer.defaultAddressInput.noAddressesFound")
|
|
176
|
+
})
|
|
177
|
+
}) : /* @__PURE__ */ L(H, {
|
|
178
|
+
style: U.emptyContainer,
|
|
179
|
+
children: /* @__PURE__ */ L(B, {
|
|
180
|
+
style: [U.emptyText, { color: T.textMuted }],
|
|
181
|
+
children: w("renderer.defaultAddressInput.typeMinChars")
|
|
182
|
+
})
|
|
183
|
+
}),
|
|
184
|
+
renderItem: ({ item: e }) => /* @__PURE__ */ R(V, {
|
|
185
|
+
style: U.suggestionItem,
|
|
186
|
+
onPress: () => te(e),
|
|
187
|
+
activeOpacity: .7,
|
|
188
|
+
children: [/* @__PURE__ */ L(B, {
|
|
189
|
+
style: U.suggestionIcon,
|
|
190
|
+
children: "📍"
|
|
191
|
+
}), /* @__PURE__ */ L(B, {
|
|
192
|
+
style: [U.suggestionText, { color: T.text }],
|
|
193
|
+
numberOfLines: 2,
|
|
194
|
+
children: e.label
|
|
195
|
+
})]
|
|
196
|
+
})
|
|
197
|
+
})
|
|
198
|
+
]
|
|
199
|
+
})
|
|
200
|
+
})
|
|
201
|
+
}),
|
|
202
|
+
y && /* @__PURE__ */ L(B, {
|
|
203
|
+
style: [U.error, { color: T.error }],
|
|
204
|
+
children: y
|
|
205
|
+
}),
|
|
206
|
+
S && !y && /* @__PURE__ */ L(B, {
|
|
207
|
+
style: [U.helperText, { color: T.textMuted }],
|
|
208
|
+
children: S
|
|
209
|
+
})
|
|
210
|
+
]
|
|
211
|
+
});
|
|
212
|
+
}, U = z.create({
|
|
213
|
+
closeButton: {
|
|
214
|
+
fontSize: 24,
|
|
215
|
+
fontWeight: "300"
|
|
216
|
+
},
|
|
217
|
+
container: { marginBottom: 16 },
|
|
218
|
+
emptyContainer: {
|
|
219
|
+
alignItems: "center",
|
|
220
|
+
paddingVertical: 24
|
|
221
|
+
},
|
|
222
|
+
emptyText: { fontSize: 14 },
|
|
223
|
+
error: {
|
|
224
|
+
fontSize: 12,
|
|
225
|
+
marginTop: 4
|
|
226
|
+
},
|
|
227
|
+
helperText: {
|
|
228
|
+
fontSize: 12,
|
|
229
|
+
marginTop: 4
|
|
230
|
+
},
|
|
231
|
+
icon: { fontSize: 16 },
|
|
232
|
+
loadingContainer: {
|
|
233
|
+
alignItems: "center",
|
|
234
|
+
flexDirection: "row",
|
|
235
|
+
justifyContent: "center",
|
|
236
|
+
paddingVertical: 24
|
|
237
|
+
},
|
|
238
|
+
loadingText: {
|
|
239
|
+
fontSize: 14,
|
|
240
|
+
marginLeft: 8
|
|
241
|
+
},
|
|
242
|
+
modalContent: {
|
|
243
|
+
borderRadius: 12,
|
|
244
|
+
maxHeight: "80%",
|
|
245
|
+
padding: 16,
|
|
246
|
+
width: "90%"
|
|
247
|
+
},
|
|
248
|
+
modalHeader: {
|
|
249
|
+
alignItems: "center",
|
|
250
|
+
borderBottomWidth: 1,
|
|
251
|
+
flexDirection: "row",
|
|
252
|
+
justifyContent: "space-between",
|
|
253
|
+
marginBottom: 12,
|
|
254
|
+
paddingBottom: 12
|
|
255
|
+
},
|
|
256
|
+
modalOverlay: {
|
|
257
|
+
alignItems: "center",
|
|
258
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
259
|
+
flex: 1,
|
|
260
|
+
justifyContent: "center"
|
|
261
|
+
},
|
|
262
|
+
modalTitle: {
|
|
263
|
+
fontSize: 18,
|
|
264
|
+
fontWeight: "600"
|
|
265
|
+
},
|
|
266
|
+
searchContainer: {
|
|
267
|
+
marginBottom: 12,
|
|
268
|
+
position: "relative"
|
|
269
|
+
},
|
|
270
|
+
searchInput: {
|
|
271
|
+
borderRadius: 6,
|
|
272
|
+
borderWidth: 1,
|
|
273
|
+
fontSize: 14,
|
|
274
|
+
paddingHorizontal: 12,
|
|
275
|
+
paddingRight: 40,
|
|
276
|
+
paddingVertical: 10
|
|
277
|
+
},
|
|
278
|
+
searchLoader: {
|
|
279
|
+
position: "absolute",
|
|
280
|
+
right: 12,
|
|
281
|
+
top: "50%",
|
|
282
|
+
transform: [{ translateY: -10 }]
|
|
283
|
+
},
|
|
284
|
+
suggestionIcon: {
|
|
285
|
+
fontSize: 16,
|
|
286
|
+
marginRight: 8
|
|
287
|
+
},
|
|
288
|
+
suggestionItem: {
|
|
289
|
+
alignItems: "center",
|
|
290
|
+
borderRadius: 6,
|
|
291
|
+
flexDirection: "row",
|
|
292
|
+
paddingHorizontal: 12,
|
|
293
|
+
paddingVertical: 12
|
|
294
|
+
},
|
|
295
|
+
suggestionsList: {
|
|
296
|
+
flexGrow: 0,
|
|
297
|
+
flexShrink: 1
|
|
298
|
+
},
|
|
299
|
+
suggestionsListContent: { flexGrow: 0 },
|
|
300
|
+
suggestionText: {
|
|
301
|
+
flex: 1,
|
|
302
|
+
fontSize: 14
|
|
303
|
+
},
|
|
304
|
+
trigger: {
|
|
305
|
+
alignItems: "center",
|
|
306
|
+
borderRadius: 6,
|
|
307
|
+
borderWidth: 1,
|
|
308
|
+
flexDirection: "row",
|
|
309
|
+
justifyContent: "space-between",
|
|
310
|
+
paddingHorizontal: 12,
|
|
311
|
+
paddingVertical: 10
|
|
312
|
+
},
|
|
313
|
+
triggerText: {
|
|
314
|
+
flex: 1,
|
|
315
|
+
fontSize: 14
|
|
316
|
+
}
|
|
317
|
+
}), Te = ({ label: e, description: t, image: n, disabled: r }) => {
|
|
318
|
+
let { colors: i } = b();
|
|
319
|
+
return /* @__PURE__ */ R(H, {
|
|
320
|
+
style: Ee.content,
|
|
321
|
+
children: [n ? /* @__PURE__ */ L(pe, {
|
|
322
|
+
source: { uri: n },
|
|
323
|
+
style: Ee.image
|
|
324
|
+
}) : null, /* @__PURE__ */ R(H, {
|
|
325
|
+
style: Ee.textWrapper,
|
|
326
|
+
children: [/* @__PURE__ */ L(B, {
|
|
327
|
+
style: [Ee.label, { color: r ? i.textMuted : i.text }],
|
|
328
|
+
children: e
|
|
329
|
+
}), t ? /* @__PURE__ */ L(B, {
|
|
330
|
+
style: [Ee.description, { color: i.textMuted }],
|
|
331
|
+
children: t
|
|
332
|
+
}) : null]
|
|
333
|
+
})]
|
|
334
|
+
});
|
|
335
|
+
}, Ee = z.create({
|
|
336
|
+
content: {
|
|
337
|
+
alignItems: "center",
|
|
338
|
+
flex: 1,
|
|
339
|
+
flexDirection: "row",
|
|
340
|
+
gap: 12
|
|
341
|
+
},
|
|
342
|
+
description: {
|
|
343
|
+
fontSize: 12,
|
|
344
|
+
marginTop: 2
|
|
345
|
+
},
|
|
346
|
+
image: {
|
|
347
|
+
borderRadius: 6,
|
|
348
|
+
height: 40,
|
|
349
|
+
width: 40
|
|
350
|
+
},
|
|
351
|
+
label: { fontSize: 14 },
|
|
352
|
+
textWrapper: { flex: 1 }
|
|
353
|
+
}), De = ({ field: e, extra: t }) => {
|
|
354
|
+
let [r, i] = F(!1), [a, o] = F(""), { value: s, placeholder: c } = e, { InputLabel: l, node: u, setValue: d, error: f, label: p, helperText: m } = t, h = n(), { colors: g } = b(), _ = u.data.options || [], v = _.find((e) => e.value === s), y = ce(() => {
|
|
355
|
+
if (!a.trim()) return _;
|
|
356
|
+
let e = a.toLowerCase();
|
|
357
|
+
return _.filter((t) => h(t.label).toLowerCase().includes(e) || t.value.toLowerCase().includes(e));
|
|
358
|
+
}, [
|
|
359
|
+
_,
|
|
360
|
+
a,
|
|
361
|
+
h
|
|
362
|
+
]), x = (e) => {
|
|
363
|
+
d(e === s ? "" : e), i(!1), o("");
|
|
364
|
+
}, S = () => {
|
|
365
|
+
i(!1), o("");
|
|
366
|
+
};
|
|
367
|
+
return /* @__PURE__ */ R(H, {
|
|
368
|
+
style: W.container,
|
|
369
|
+
children: [
|
|
370
|
+
/* @__PURE__ */ L(l, {
|
|
371
|
+
label: p,
|
|
372
|
+
required: u.data.required
|
|
373
|
+
}),
|
|
374
|
+
/* @__PURE__ */ R(V, {
|
|
375
|
+
style: [
|
|
376
|
+
W.trigger,
|
|
377
|
+
{
|
|
378
|
+
backgroundColor: g.input,
|
|
379
|
+
borderColor: g.border
|
|
380
|
+
},
|
|
381
|
+
f && { borderColor: g.error }
|
|
382
|
+
],
|
|
383
|
+
onPress: () => i(!0),
|
|
384
|
+
activeOpacity: .7,
|
|
385
|
+
children: [
|
|
386
|
+
/* @__PURE__ */ L(B, {
|
|
387
|
+
style: [
|
|
388
|
+
W.triggerText,
|
|
389
|
+
{ color: g.text },
|
|
390
|
+
!s && { color: g.textMuted }
|
|
391
|
+
],
|
|
392
|
+
numberOfLines: 1,
|
|
393
|
+
children: s && v ? h(v.label) : c || h("renderer.defaultAutocompleteInput.selectOption")
|
|
394
|
+
}),
|
|
395
|
+
s ? /* @__PURE__ */ L(V, {
|
|
396
|
+
onPress: () => d(""),
|
|
397
|
+
hitSlop: {
|
|
398
|
+
bottom: 8,
|
|
399
|
+
left: 8,
|
|
400
|
+
right: 8,
|
|
401
|
+
top: 8
|
|
402
|
+
},
|
|
403
|
+
style: W.clearButton,
|
|
404
|
+
children: /* @__PURE__ */ L(B, {
|
|
405
|
+
style: [W.clearIcon, { color: g.textMuted }],
|
|
406
|
+
children: "✕"
|
|
407
|
+
})
|
|
408
|
+
}) : null,
|
|
409
|
+
/* @__PURE__ */ L(B, {
|
|
410
|
+
style: [W.arrow, { color: g.textMuted }],
|
|
411
|
+
children: "▼"
|
|
412
|
+
})
|
|
413
|
+
]
|
|
414
|
+
}),
|
|
415
|
+
/* @__PURE__ */ L(me, {
|
|
416
|
+
visible: r,
|
|
417
|
+
transparent: !0,
|
|
418
|
+
animationType: "fade",
|
|
419
|
+
onRequestClose: S,
|
|
420
|
+
children: /* @__PURE__ */ L(V, {
|
|
421
|
+
style: W.modalOverlay,
|
|
422
|
+
activeOpacity: 1,
|
|
423
|
+
onPress: S,
|
|
424
|
+
children: /* @__PURE__ */ R(V, {
|
|
425
|
+
style: [W.modalContent, { backgroundColor: g.card }],
|
|
426
|
+
activeOpacity: 1,
|
|
427
|
+
onPress: () => {},
|
|
428
|
+
children: [
|
|
429
|
+
/* @__PURE__ */ R(H, {
|
|
430
|
+
style: [W.modalHeader, { borderBottomColor: g.separator }],
|
|
431
|
+
children: [/* @__PURE__ */ L(B, {
|
|
432
|
+
style: [W.modalTitle, { color: g.text }],
|
|
433
|
+
children: p || c || h("renderer.defaultAutocompleteInput.selectOption")
|
|
434
|
+
}), /* @__PURE__ */ L(V, {
|
|
435
|
+
onPress: S,
|
|
436
|
+
children: /* @__PURE__ */ L(B, {
|
|
437
|
+
style: [W.closeButton, { color: g.textMuted }],
|
|
438
|
+
children: "✕"
|
|
439
|
+
})
|
|
440
|
+
})]
|
|
441
|
+
}),
|
|
442
|
+
/* @__PURE__ */ L(H, {
|
|
443
|
+
style: W.searchContainer,
|
|
444
|
+
children: /* @__PURE__ */ L(_e, {
|
|
445
|
+
style: [W.searchInput, {
|
|
446
|
+
backgroundColor: g.muted,
|
|
447
|
+
borderColor: g.border,
|
|
448
|
+
color: g.text
|
|
449
|
+
}],
|
|
450
|
+
placeholder: c || h("renderer.defaultAutocompleteInput.search"),
|
|
451
|
+
placeholderTextColor: g.textMuted,
|
|
452
|
+
value: a,
|
|
453
|
+
onChangeText: o,
|
|
454
|
+
autoFocus: !0,
|
|
455
|
+
autoCapitalize: "none",
|
|
456
|
+
autoCorrect: !1
|
|
457
|
+
})
|
|
458
|
+
}),
|
|
459
|
+
/* @__PURE__ */ L(fe, {
|
|
460
|
+
data: y,
|
|
461
|
+
keyExtractor: (e) => e.value,
|
|
462
|
+
style: W.optionsList,
|
|
463
|
+
contentContainerStyle: W.optionsListContent,
|
|
464
|
+
ListEmptyComponent: /* @__PURE__ */ L(H, {
|
|
465
|
+
style: W.emptyContainer,
|
|
466
|
+
children: /* @__PURE__ */ L(B, {
|
|
467
|
+
style: [W.emptyText, { color: g.textMuted }],
|
|
468
|
+
children: h("renderer.defaultAutocompleteInput.noResults")
|
|
469
|
+
})
|
|
470
|
+
}),
|
|
471
|
+
renderItem: ({ item: e }) => {
|
|
472
|
+
let t = e.value === s;
|
|
473
|
+
return /* @__PURE__ */ R(V, {
|
|
474
|
+
style: [W.option, t && { backgroundColor: g.primaryLight }],
|
|
475
|
+
onPress: () => x(e.value),
|
|
476
|
+
disabled: e.disabled,
|
|
477
|
+
activeOpacity: .7,
|
|
478
|
+
children: [/* @__PURE__ */ L(Te, {
|
|
479
|
+
label: h(e.label) || e.value,
|
|
480
|
+
description: h(e.description),
|
|
481
|
+
image: e.image,
|
|
482
|
+
disabled: e.disabled
|
|
483
|
+
}), t && /* @__PURE__ */ L(B, {
|
|
484
|
+
style: [W.checkmark, { color: g.primary }],
|
|
485
|
+
children: "✓"
|
|
486
|
+
})]
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
})
|
|
490
|
+
]
|
|
491
|
+
})
|
|
492
|
+
})
|
|
493
|
+
}),
|
|
494
|
+
f && /* @__PURE__ */ L(B, {
|
|
495
|
+
style: [W.error, { color: g.error }],
|
|
496
|
+
children: f
|
|
497
|
+
}),
|
|
498
|
+
m && !f && /* @__PURE__ */ L(B, {
|
|
499
|
+
style: [W.helperText, { color: g.textMuted }],
|
|
500
|
+
children: m
|
|
501
|
+
})
|
|
502
|
+
]
|
|
503
|
+
});
|
|
504
|
+
}, W = z.create({
|
|
505
|
+
arrow: { fontSize: 12 },
|
|
506
|
+
checkmark: {
|
|
507
|
+
fontSize: 18,
|
|
508
|
+
fontWeight: "700"
|
|
509
|
+
},
|
|
510
|
+
clearButton: {
|
|
511
|
+
marginRight: 8,
|
|
512
|
+
paddingHorizontal: 2
|
|
513
|
+
},
|
|
514
|
+
clearIcon: { fontSize: 14 },
|
|
515
|
+
closeButton: {
|
|
516
|
+
fontSize: 24,
|
|
517
|
+
fontWeight: "300"
|
|
518
|
+
},
|
|
519
|
+
container: { marginBottom: 16 },
|
|
520
|
+
emptyContainer: {
|
|
521
|
+
alignItems: "center",
|
|
522
|
+
paddingVertical: 24
|
|
523
|
+
},
|
|
524
|
+
emptyText: { fontSize: 14 },
|
|
525
|
+
error: {
|
|
526
|
+
fontSize: 12,
|
|
527
|
+
marginTop: 4
|
|
528
|
+
},
|
|
529
|
+
helperText: {
|
|
530
|
+
fontSize: 12,
|
|
531
|
+
marginTop: 4
|
|
532
|
+
},
|
|
533
|
+
modalContent: {
|
|
534
|
+
borderRadius: 12,
|
|
535
|
+
maxHeight: "80%",
|
|
536
|
+
padding: 16,
|
|
537
|
+
width: "90%"
|
|
538
|
+
},
|
|
539
|
+
modalHeader: {
|
|
540
|
+
alignItems: "center",
|
|
541
|
+
borderBottomWidth: 1,
|
|
542
|
+
flexDirection: "row",
|
|
543
|
+
justifyContent: "space-between",
|
|
544
|
+
marginBottom: 12,
|
|
545
|
+
paddingBottom: 12
|
|
546
|
+
},
|
|
547
|
+
modalOverlay: {
|
|
548
|
+
alignItems: "center",
|
|
549
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
550
|
+
flex: 1,
|
|
551
|
+
justifyContent: "center"
|
|
552
|
+
},
|
|
553
|
+
modalTitle: {
|
|
554
|
+
fontSize: 18,
|
|
555
|
+
fontWeight: "600"
|
|
556
|
+
},
|
|
557
|
+
option: {
|
|
558
|
+
alignItems: "center",
|
|
559
|
+
borderRadius: 6,
|
|
560
|
+
flexDirection: "row",
|
|
561
|
+
justifyContent: "space-between",
|
|
562
|
+
paddingHorizontal: 12,
|
|
563
|
+
paddingVertical: 12
|
|
564
|
+
},
|
|
565
|
+
optionsList: {
|
|
566
|
+
flexGrow: 0,
|
|
567
|
+
flexShrink: 1
|
|
568
|
+
},
|
|
569
|
+
optionsListContent: { flexGrow: 0 },
|
|
570
|
+
searchContainer: { marginBottom: 12 },
|
|
571
|
+
searchInput: {
|
|
572
|
+
borderRadius: 6,
|
|
573
|
+
borderWidth: 1,
|
|
574
|
+
fontSize: 14,
|
|
575
|
+
paddingHorizontal: 12,
|
|
576
|
+
paddingVertical: 10
|
|
577
|
+
},
|
|
578
|
+
trigger: {
|
|
579
|
+
alignItems: "center",
|
|
580
|
+
borderRadius: 6,
|
|
581
|
+
borderWidth: 1,
|
|
582
|
+
flexDirection: "row",
|
|
583
|
+
justifyContent: "space-between",
|
|
584
|
+
paddingHorizontal: 12,
|
|
585
|
+
paddingVertical: 10
|
|
586
|
+
},
|
|
587
|
+
triggerText: {
|
|
588
|
+
flex: 1,
|
|
589
|
+
fontSize: 14
|
|
590
|
+
}
|
|
591
|
+
}), Oe = ({ field: e, extra: t }) => {
|
|
592
|
+
let r = n(), { value: i } = e, { InputLabel: a, node: o, setValue: s, error: c, label: l, helperText: u } = t, { colors: d } = b(), f = o.data.options || [], p = f.length > 0, m = Array.isArray(i) ? i : [], h = typeof i == "boolean" ? i : !1, g = (e) => {
|
|
593
|
+
s(p ? m.includes(e) ? m.filter((t) => t !== e) : [...m, e] : !h);
|
|
594
|
+
}, _ = (e) => p ? m.includes(e) : h;
|
|
595
|
+
return /* @__PURE__ */ R(H, {
|
|
596
|
+
style: G.container,
|
|
597
|
+
children: [
|
|
598
|
+
/* @__PURE__ */ L(a, {
|
|
599
|
+
label: l,
|
|
600
|
+
required: o.data.required
|
|
601
|
+
}),
|
|
602
|
+
f.length > 0 ? f.map((e) => {
|
|
603
|
+
let t = r(e.description);
|
|
604
|
+
return /* @__PURE__ */ R(V, {
|
|
605
|
+
style: G.option,
|
|
606
|
+
onPress: () => g(e.value),
|
|
607
|
+
disabled: e.disabled,
|
|
608
|
+
activeOpacity: .7,
|
|
609
|
+
accessible: !0,
|
|
610
|
+
accessibilityRole: "checkbox",
|
|
611
|
+
accessibilityState: {
|
|
612
|
+
checked: _(e.value),
|
|
613
|
+
disabled: e.disabled
|
|
614
|
+
},
|
|
615
|
+
accessibilityLabel: r(e.label) || e.value,
|
|
616
|
+
children: [
|
|
617
|
+
/* @__PURE__ */ L(H, {
|
|
618
|
+
style: [
|
|
619
|
+
G.checkbox,
|
|
620
|
+
{
|
|
621
|
+
backgroundColor: d.input,
|
|
622
|
+
borderColor: d.border
|
|
623
|
+
},
|
|
624
|
+
_(e.value) && {
|
|
625
|
+
backgroundColor: d.primary,
|
|
626
|
+
borderColor: d.primary
|
|
627
|
+
}
|
|
628
|
+
],
|
|
629
|
+
children: _(e.value) && /* @__PURE__ */ L(B, {
|
|
630
|
+
style: G.checkmark,
|
|
631
|
+
children: "✓"
|
|
632
|
+
})
|
|
633
|
+
}),
|
|
634
|
+
e.image ? /* @__PURE__ */ L(pe, {
|
|
635
|
+
source: { uri: e.image },
|
|
636
|
+
style: G.image
|
|
637
|
+
}) : null,
|
|
638
|
+
/* @__PURE__ */ R(H, {
|
|
639
|
+
style: G.optionTextContainer,
|
|
640
|
+
children: [/* @__PURE__ */ L(B, {
|
|
641
|
+
style: [
|
|
642
|
+
G.optionLabel,
|
|
643
|
+
{ color: d.textSecondary },
|
|
644
|
+
e.disabled && { color: d.textMuted }
|
|
645
|
+
],
|
|
646
|
+
children: r(e.label) || e.value
|
|
647
|
+
}), t && /* @__PURE__ */ L(B, {
|
|
648
|
+
style: [G.optionDescription, { color: d.textMuted }],
|
|
649
|
+
children: t
|
|
650
|
+
})]
|
|
651
|
+
})
|
|
652
|
+
]
|
|
653
|
+
}, e.value);
|
|
654
|
+
}) : /* @__PURE__ */ R(V, {
|
|
655
|
+
style: G.option,
|
|
656
|
+
onPress: () => g(""),
|
|
657
|
+
activeOpacity: .7,
|
|
658
|
+
accessible: !0,
|
|
659
|
+
accessibilityRole: "checkbox",
|
|
660
|
+
accessibilityState: { checked: h },
|
|
661
|
+
accessibilityLabel: l || o.data.name,
|
|
662
|
+
children: [/* @__PURE__ */ L(H, {
|
|
663
|
+
style: [
|
|
664
|
+
G.checkbox,
|
|
665
|
+
{
|
|
666
|
+
backgroundColor: d.input,
|
|
667
|
+
borderColor: d.border
|
|
668
|
+
},
|
|
669
|
+
h && {
|
|
670
|
+
backgroundColor: d.primary,
|
|
671
|
+
borderColor: d.primary
|
|
672
|
+
}
|
|
673
|
+
],
|
|
674
|
+
children: h && /* @__PURE__ */ L(B, {
|
|
675
|
+
style: G.checkmark,
|
|
676
|
+
children: "✓"
|
|
677
|
+
})
|
|
678
|
+
}), l && /* @__PURE__ */ L(B, {
|
|
679
|
+
style: [G.optionLabel, { color: d.textSecondary }],
|
|
680
|
+
children: l
|
|
681
|
+
})]
|
|
682
|
+
}),
|
|
683
|
+
c && /* @__PURE__ */ L(B, {
|
|
684
|
+
style: [G.error, { color: d.error }],
|
|
685
|
+
children: c
|
|
686
|
+
}),
|
|
687
|
+
u && !c && /* @__PURE__ */ L(B, {
|
|
688
|
+
style: [G.helperText, { color: d.textMuted }],
|
|
689
|
+
children: u
|
|
690
|
+
})
|
|
691
|
+
]
|
|
692
|
+
});
|
|
693
|
+
}, G = z.create({
|
|
694
|
+
checkbox: {
|
|
695
|
+
alignItems: "center",
|
|
696
|
+
borderRadius: 4,
|
|
697
|
+
borderWidth: 2,
|
|
698
|
+
height: 20,
|
|
699
|
+
justifyContent: "center",
|
|
700
|
+
marginRight: 12,
|
|
701
|
+
width: 20
|
|
702
|
+
},
|
|
703
|
+
checkmark: {
|
|
704
|
+
color: "#FFFFFF",
|
|
705
|
+
fontSize: 14,
|
|
706
|
+
fontWeight: "700"
|
|
707
|
+
},
|
|
708
|
+
container: { marginBottom: 16 },
|
|
709
|
+
error: {
|
|
710
|
+
fontSize: 12,
|
|
711
|
+
marginTop: 4
|
|
712
|
+
},
|
|
713
|
+
helperText: {
|
|
714
|
+
fontSize: 12,
|
|
715
|
+
marginTop: 4
|
|
716
|
+
},
|
|
717
|
+
image: {
|
|
718
|
+
borderRadius: 4,
|
|
719
|
+
height: 32,
|
|
720
|
+
marginRight: 8,
|
|
721
|
+
width: 32
|
|
722
|
+
},
|
|
723
|
+
option: {
|
|
724
|
+
alignItems: "flex-start",
|
|
725
|
+
flexDirection: "row",
|
|
726
|
+
marginBottom: 8
|
|
727
|
+
},
|
|
728
|
+
optionDescription: {
|
|
729
|
+
fontSize: 12,
|
|
730
|
+
marginTop: 2
|
|
731
|
+
},
|
|
732
|
+
optionLabel: { fontSize: 14 },
|
|
733
|
+
optionTextContainer: { flex: 1 }
|
|
734
|
+
}), ke = ({ field: e, extra: t }) => {
|
|
735
|
+
let [r, i] = F(!1), { value: a, placeholder: o } = e, { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f } = t, { colors: p } = b(), m = n(), h = a ? new Date(a) : void 0, { year: g, month: _, today: v } = ce(() => {
|
|
736
|
+
let e = h || /* @__PURE__ */ new Date(), t = e.getFullYear(), n = e.getMonth(), r = /* @__PURE__ */ new Date();
|
|
737
|
+
return r.setHours(0, 0, 0, 0), {
|
|
738
|
+
month: n,
|
|
739
|
+
today: r,
|
|
740
|
+
year: t
|
|
741
|
+
};
|
|
742
|
+
}, [h]), [y, x] = F(g), [S, C] = F(_), ee = [
|
|
743
|
+
"January",
|
|
744
|
+
"February",
|
|
745
|
+
"March",
|
|
746
|
+
"April",
|
|
747
|
+
"May",
|
|
748
|
+
"June",
|
|
749
|
+
"July",
|
|
750
|
+
"August",
|
|
751
|
+
"September",
|
|
752
|
+
"October",
|
|
753
|
+
"November",
|
|
754
|
+
"December"
|
|
755
|
+
], w = ce(() => {
|
|
756
|
+
let e = new Date(y, S, 1).getDay(), t = new Date(y, S + 1, 0).getDate(), n = new Date(y, S, 0).getDate(), r = [];
|
|
757
|
+
for (let t = e - 1; t >= 0; t--) r.push({
|
|
758
|
+
date: new Date(y, S - 1, n - t),
|
|
759
|
+
day: n - t,
|
|
760
|
+
isCurrentMonth: !1
|
|
761
|
+
});
|
|
762
|
+
for (let e = 1; e <= t; e++) r.push({
|
|
763
|
+
date: new Date(y, S, e),
|
|
764
|
+
day: e,
|
|
765
|
+
isCurrentMonth: !0
|
|
766
|
+
});
|
|
767
|
+
let i = 42 - r.length;
|
|
768
|
+
for (let e = 1; e <= i; e++) r.push({
|
|
769
|
+
date: new Date(y, S + 1, e),
|
|
770
|
+
day: e,
|
|
771
|
+
isCurrentMonth: !1
|
|
772
|
+
});
|
|
773
|
+
return r;
|
|
774
|
+
}, [y, S]), T = se((e) => {
|
|
775
|
+
c.data.disablePast && e < v || (l(e.toISOString()), i(!1));
|
|
776
|
+
}, [
|
|
777
|
+
c.data.disablePast,
|
|
778
|
+
v,
|
|
779
|
+
l
|
|
780
|
+
]), te = () => {
|
|
781
|
+
S === 0 ? (C(11), x(y - 1)) : C(S - 1);
|
|
782
|
+
}, ne = () => {
|
|
783
|
+
S === 11 ? (C(0), x(y + 1)) : C(S + 1);
|
|
784
|
+
}, E = () => h ? h.toLocaleDateString() : o || m("renderer.defaultInputs.selectDate"), re = (e) => c.data.disablePast ? e < v : !1, D = (e) => h ? e.getDate() === h.getDate() && e.getMonth() === h.getMonth() && e.getFullYear() === h.getFullYear() : !1;
|
|
785
|
+
return /* @__PURE__ */ R(H, {
|
|
786
|
+
style: K.container,
|
|
787
|
+
children: [
|
|
788
|
+
/* @__PURE__ */ L(s, {
|
|
789
|
+
label: d,
|
|
790
|
+
required: c.data.required
|
|
791
|
+
}),
|
|
792
|
+
/* @__PURE__ */ R(V, {
|
|
793
|
+
style: [
|
|
794
|
+
K.trigger,
|
|
795
|
+
{
|
|
796
|
+
backgroundColor: p.input,
|
|
797
|
+
borderColor: p.border
|
|
798
|
+
},
|
|
799
|
+
u && { borderColor: p.error }
|
|
800
|
+
],
|
|
801
|
+
onPress: () => i(!0),
|
|
802
|
+
activeOpacity: .7,
|
|
803
|
+
children: [/* @__PURE__ */ L(B, {
|
|
804
|
+
style: [
|
|
805
|
+
K.triggerText,
|
|
806
|
+
{ color: p.text },
|
|
807
|
+
!a && { color: p.textMuted }
|
|
808
|
+
],
|
|
809
|
+
numberOfLines: 1,
|
|
810
|
+
children: E()
|
|
811
|
+
}), /* @__PURE__ */ L(B, {
|
|
812
|
+
style: K.icon,
|
|
813
|
+
children: "📅"
|
|
814
|
+
})]
|
|
815
|
+
}),
|
|
816
|
+
/* @__PURE__ */ L(me, {
|
|
817
|
+
visible: r,
|
|
818
|
+
transparent: !0,
|
|
819
|
+
animationType: "fade",
|
|
820
|
+
onRequestClose: () => i(!1),
|
|
821
|
+
children: /* @__PURE__ */ L(V, {
|
|
822
|
+
style: K.modalOverlay,
|
|
823
|
+
activeOpacity: 1,
|
|
824
|
+
onPress: () => i(!1),
|
|
825
|
+
children: /* @__PURE__ */ R(V, {
|
|
826
|
+
style: [K.modalContent, { backgroundColor: p.card }],
|
|
827
|
+
activeOpacity: 1,
|
|
828
|
+
onPress: () => {},
|
|
829
|
+
children: [
|
|
830
|
+
/* @__PURE__ */ R(H, {
|
|
831
|
+
style: [K.modalHeader, { borderBottomColor: p.separator }],
|
|
832
|
+
children: [/* @__PURE__ */ L(B, {
|
|
833
|
+
style: [K.modalTitle, { color: p.text }],
|
|
834
|
+
children: d || o || m("renderer.defaultInputs.selectDate")
|
|
835
|
+
}), /* @__PURE__ */ L(V, {
|
|
836
|
+
onPress: () => i(!1),
|
|
837
|
+
children: /* @__PURE__ */ L(B, {
|
|
838
|
+
style: [K.closeButton, { color: p.textMuted }],
|
|
839
|
+
children: "✕"
|
|
840
|
+
})
|
|
841
|
+
})]
|
|
842
|
+
}),
|
|
843
|
+
/* @__PURE__ */ R(H, {
|
|
844
|
+
style: K.calendarHeader,
|
|
845
|
+
children: [
|
|
846
|
+
/* @__PURE__ */ L(V, {
|
|
847
|
+
onPress: te,
|
|
848
|
+
style: K.navButton,
|
|
849
|
+
children: /* @__PURE__ */ L(B, {
|
|
850
|
+
style: [K.navButtonText, { color: p.primary }],
|
|
851
|
+
children: "‹"
|
|
852
|
+
})
|
|
853
|
+
}),
|
|
854
|
+
/* @__PURE__ */ R(B, {
|
|
855
|
+
style: [K.monthYear, { color: p.text }],
|
|
856
|
+
children: [
|
|
857
|
+
ee[S],
|
|
858
|
+
" ",
|
|
859
|
+
y
|
|
860
|
+
]
|
|
861
|
+
}),
|
|
862
|
+
/* @__PURE__ */ L(V, {
|
|
863
|
+
onPress: ne,
|
|
864
|
+
style: K.navButton,
|
|
865
|
+
children: /* @__PURE__ */ L(B, {
|
|
866
|
+
style: [K.navButtonText, { color: p.primary }],
|
|
867
|
+
children: "›"
|
|
868
|
+
})
|
|
869
|
+
})
|
|
870
|
+
]
|
|
871
|
+
}),
|
|
872
|
+
/* @__PURE__ */ L(H, {
|
|
873
|
+
style: K.weekDays,
|
|
874
|
+
children: [
|
|
875
|
+
"Sun",
|
|
876
|
+
"Mon",
|
|
877
|
+
"Tue",
|
|
878
|
+
"Wed",
|
|
879
|
+
"Thu",
|
|
880
|
+
"Fri",
|
|
881
|
+
"Sat"
|
|
882
|
+
].map((e) => /* @__PURE__ */ L(B, {
|
|
883
|
+
style: [K.weekDay, { color: p.textMuted }],
|
|
884
|
+
children: e
|
|
885
|
+
}, e))
|
|
886
|
+
}),
|
|
887
|
+
/* @__PURE__ */ L(fe, {
|
|
888
|
+
data: w,
|
|
889
|
+
keyExtractor: (e, t) => `${e.date.getTime()}-${t}`,
|
|
890
|
+
numColumns: 7,
|
|
891
|
+
scrollEnabled: !1,
|
|
892
|
+
style: K.calendar,
|
|
893
|
+
contentContainerStyle: K.calendarContent,
|
|
894
|
+
renderItem: ({ item: e }) => {
|
|
895
|
+
let t = re(e.date), n = D(e.date);
|
|
896
|
+
return /* @__PURE__ */ L(V, {
|
|
897
|
+
style: [
|
|
898
|
+
K.dayCell,
|
|
899
|
+
!e.isCurrentMonth && K.dayCellOtherMonth,
|
|
900
|
+
n && {
|
|
901
|
+
backgroundColor: p.primary,
|
|
902
|
+
borderRadius: 20
|
|
903
|
+
},
|
|
904
|
+
t && K.dayCellDisabled
|
|
905
|
+
],
|
|
906
|
+
onPress: () => T(e.date),
|
|
907
|
+
disabled: t,
|
|
908
|
+
activeOpacity: .7,
|
|
909
|
+
children: /* @__PURE__ */ L(B, {
|
|
910
|
+
style: [
|
|
911
|
+
K.dayText,
|
|
912
|
+
{ color: p.text },
|
|
913
|
+
!e.isCurrentMonth && { color: p.textMuted },
|
|
914
|
+
n && {
|
|
915
|
+
color: p.background,
|
|
916
|
+
fontWeight: "600"
|
|
917
|
+
},
|
|
918
|
+
t && { color: p.textMuted }
|
|
919
|
+
],
|
|
920
|
+
children: e.day
|
|
921
|
+
})
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
})
|
|
925
|
+
]
|
|
926
|
+
})
|
|
927
|
+
})
|
|
928
|
+
}),
|
|
929
|
+
u && /* @__PURE__ */ L(B, {
|
|
930
|
+
style: [K.error, { color: p.error }],
|
|
931
|
+
children: u
|
|
932
|
+
}),
|
|
933
|
+
f && !u && /* @__PURE__ */ L(B, {
|
|
934
|
+
style: [K.helperText, { color: p.textMuted }],
|
|
935
|
+
children: f
|
|
936
|
+
})
|
|
937
|
+
]
|
|
938
|
+
});
|
|
939
|
+
}, K = z.create({
|
|
940
|
+
calendar: {
|
|
941
|
+
flexGrow: 0,
|
|
942
|
+
flexShrink: 1
|
|
943
|
+
},
|
|
944
|
+
calendarContent: { flexGrow: 0 },
|
|
945
|
+
calendarHeader: {
|
|
946
|
+
alignItems: "center",
|
|
947
|
+
flexDirection: "row",
|
|
948
|
+
justifyContent: "space-between",
|
|
949
|
+
marginBottom: 16,
|
|
950
|
+
paddingHorizontal: 8
|
|
951
|
+
},
|
|
952
|
+
closeButton: {
|
|
953
|
+
fontSize: 24,
|
|
954
|
+
fontWeight: "300"
|
|
955
|
+
},
|
|
956
|
+
container: { marginBottom: 16 },
|
|
957
|
+
dayCell: {
|
|
958
|
+
alignItems: "center",
|
|
959
|
+
aspectRatio: 1,
|
|
960
|
+
flex: 1,
|
|
961
|
+
justifyContent: "center",
|
|
962
|
+
margin: 2,
|
|
963
|
+
maxWidth: "14.28%"
|
|
964
|
+
},
|
|
965
|
+
dayCellDisabled: { opacity: .3 },
|
|
966
|
+
dayCellOtherMonth: { opacity: .3 },
|
|
967
|
+
dayText: { fontSize: 14 },
|
|
968
|
+
error: {
|
|
969
|
+
fontSize: 12,
|
|
970
|
+
marginTop: 4
|
|
971
|
+
},
|
|
972
|
+
helperText: {
|
|
973
|
+
fontSize: 12,
|
|
974
|
+
marginTop: 4
|
|
975
|
+
},
|
|
976
|
+
icon: { fontSize: 16 },
|
|
977
|
+
modalContent: {
|
|
978
|
+
borderRadius: 12,
|
|
979
|
+
maxHeight: "80%",
|
|
980
|
+
padding: 16,
|
|
981
|
+
width: "90%"
|
|
982
|
+
},
|
|
983
|
+
modalHeader: {
|
|
984
|
+
alignItems: "center",
|
|
985
|
+
borderBottomWidth: 1,
|
|
986
|
+
flexDirection: "row",
|
|
987
|
+
justifyContent: "space-between",
|
|
988
|
+
marginBottom: 16,
|
|
989
|
+
paddingBottom: 12
|
|
990
|
+
},
|
|
991
|
+
modalOverlay: {
|
|
992
|
+
alignItems: "center",
|
|
993
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
994
|
+
flex: 1,
|
|
995
|
+
justifyContent: "center"
|
|
996
|
+
},
|
|
997
|
+
modalTitle: {
|
|
998
|
+
fontSize: 18,
|
|
999
|
+
fontWeight: "600"
|
|
1000
|
+
},
|
|
1001
|
+
monthYear: {
|
|
1002
|
+
fontSize: 16,
|
|
1003
|
+
fontWeight: "600"
|
|
1004
|
+
},
|
|
1005
|
+
navButton: { padding: 8 },
|
|
1006
|
+
navButtonText: {
|
|
1007
|
+
fontSize: 24,
|
|
1008
|
+
fontWeight: "600"
|
|
1009
|
+
},
|
|
1010
|
+
trigger: {
|
|
1011
|
+
alignItems: "center",
|
|
1012
|
+
borderRadius: 6,
|
|
1013
|
+
borderWidth: 1,
|
|
1014
|
+
flexDirection: "row",
|
|
1015
|
+
justifyContent: "space-between",
|
|
1016
|
+
paddingHorizontal: 12,
|
|
1017
|
+
paddingVertical: 10
|
|
1018
|
+
},
|
|
1019
|
+
triggerText: {
|
|
1020
|
+
flex: 1,
|
|
1021
|
+
fontSize: 14
|
|
1022
|
+
},
|
|
1023
|
+
weekDay: {
|
|
1024
|
+
flex: 1,
|
|
1025
|
+
fontSize: 12,
|
|
1026
|
+
fontWeight: "600",
|
|
1027
|
+
maxWidth: "14.28%",
|
|
1028
|
+
textAlign: "center"
|
|
1029
|
+
},
|
|
1030
|
+
weekDays: {
|
|
1031
|
+
flexDirection: "row",
|
|
1032
|
+
marginBottom: 8
|
|
1033
|
+
}
|
|
1034
|
+
}), Ae = ({ field: e, extra: t }) => {
|
|
1035
|
+
let [r, i] = F(!1), [a, o] = F(!0), { value: s } = e, { InputLabel: c, node: l, setValue: u, error: d, label: f, helperText: p } = t, m = n(), { colors: h } = b(), g = Array.isArray(s) ? s : [], _ = g[0] ? new Date(g[0]) : void 0, v = g[1] ? new Date(g[1]) : void 0, { year: y, month: x, today: S } = ce(() => {
|
|
1036
|
+
let e = _ || /* @__PURE__ */ new Date(), t = e.getFullYear(), n = e.getMonth(), r = /* @__PURE__ */ new Date();
|
|
1037
|
+
return r.setHours(0, 0, 0, 0), {
|
|
1038
|
+
month: n,
|
|
1039
|
+
today: r,
|
|
1040
|
+
year: t
|
|
1041
|
+
};
|
|
1042
|
+
}, [_]), [C, ee] = F(y), [w, T] = F(x), te = [
|
|
1043
|
+
"January",
|
|
1044
|
+
"February",
|
|
1045
|
+
"March",
|
|
1046
|
+
"April",
|
|
1047
|
+
"May",
|
|
1048
|
+
"June",
|
|
1049
|
+
"July",
|
|
1050
|
+
"August",
|
|
1051
|
+
"September",
|
|
1052
|
+
"October",
|
|
1053
|
+
"November",
|
|
1054
|
+
"December"
|
|
1055
|
+
], ne = ce(() => {
|
|
1056
|
+
let e = new Date(C, w, 1).getDay(), t = new Date(C, w + 1, 0).getDate(), n = new Date(C, w, 0).getDate(), r = [];
|
|
1057
|
+
for (let t = e - 1; t >= 0; t--) r.push({
|
|
1058
|
+
date: new Date(C, w - 1, n - t),
|
|
1059
|
+
day: n - t,
|
|
1060
|
+
isCurrentMonth: !1
|
|
1061
|
+
});
|
|
1062
|
+
for (let e = 1; e <= t; e++) r.push({
|
|
1063
|
+
date: new Date(C, w, e),
|
|
1064
|
+
day: e,
|
|
1065
|
+
isCurrentMonth: !0
|
|
1066
|
+
});
|
|
1067
|
+
let i = 42 - r.length;
|
|
1068
|
+
for (let e = 1; e <= i; e++) r.push({
|
|
1069
|
+
date: new Date(C, w + 1, e),
|
|
1070
|
+
day: e,
|
|
1071
|
+
isCurrentMonth: !1
|
|
1072
|
+
});
|
|
1073
|
+
return r;
|
|
1074
|
+
}, [C, w]), E = se((e) => {
|
|
1075
|
+
l.data.disablePast && e < S || (a ? (u([e.toISOString(), v?.toISOString()]), o(!1)) : (u(_ && e < _ ? [e.toISOString(), _.toISOString()] : [_?.toISOString(), e.toISOString()]), i(!1), o(!0)));
|
|
1076
|
+
}, [
|
|
1077
|
+
l.data.disablePast,
|
|
1078
|
+
S,
|
|
1079
|
+
a,
|
|
1080
|
+
_,
|
|
1081
|
+
v,
|
|
1082
|
+
u
|
|
1083
|
+
]), re = () => {
|
|
1084
|
+
w === 0 ? (T(11), ee(C - 1)) : T(w - 1);
|
|
1085
|
+
}, D = () => {
|
|
1086
|
+
w === 11 ? (T(0), ee(C + 1)) : T(w + 1);
|
|
1087
|
+
}, O = () => _ && v ? `${_.toLocaleDateString()} - ${v.toLocaleDateString()}` : _ ? _.toLocaleDateString() : m("renderer.defaultInputs.selectDateRange"), k = (e) => l.data.disablePast ? e < S : !1, A = (e) => _ && v ? e >= _ && e <= v : !1, ie = (e) => {
|
|
1088
|
+
if (!(_ || v)) return !1;
|
|
1089
|
+
let t = _ && e.getDate() === _.getDate() && e.getMonth() === _.getMonth() && e.getFullYear() === _.getFullYear(), n = v && e.getDate() === v.getDate() && e.getMonth() === v.getMonth() && e.getFullYear() === v.getFullYear();
|
|
1090
|
+
return t || n;
|
|
1091
|
+
};
|
|
1092
|
+
return /* @__PURE__ */ R(H, {
|
|
1093
|
+
style: q.container,
|
|
1094
|
+
children: [
|
|
1095
|
+
/* @__PURE__ */ L(c, {
|
|
1096
|
+
label: f,
|
|
1097
|
+
required: l.data.required
|
|
1098
|
+
}),
|
|
1099
|
+
/* @__PURE__ */ R(V, {
|
|
1100
|
+
style: [
|
|
1101
|
+
q.trigger,
|
|
1102
|
+
{
|
|
1103
|
+
backgroundColor: h.input,
|
|
1104
|
+
borderColor: h.border
|
|
1105
|
+
},
|
|
1106
|
+
d && { borderColor: h.error }
|
|
1107
|
+
],
|
|
1108
|
+
onPress: () => i(!0),
|
|
1109
|
+
activeOpacity: .7,
|
|
1110
|
+
children: [/* @__PURE__ */ L(B, {
|
|
1111
|
+
style: [
|
|
1112
|
+
q.triggerText,
|
|
1113
|
+
{ color: h.text },
|
|
1114
|
+
!_ && { color: h.textMuted }
|
|
1115
|
+
],
|
|
1116
|
+
numberOfLines: 1,
|
|
1117
|
+
children: O()
|
|
1118
|
+
}), /* @__PURE__ */ L(B, {
|
|
1119
|
+
style: q.icon,
|
|
1120
|
+
children: "📅"
|
|
1121
|
+
})]
|
|
1122
|
+
}),
|
|
1123
|
+
/* @__PURE__ */ L(me, {
|
|
1124
|
+
visible: r,
|
|
1125
|
+
transparent: !0,
|
|
1126
|
+
animationType: "fade",
|
|
1127
|
+
onRequestClose: () => i(!1),
|
|
1128
|
+
children: /* @__PURE__ */ L(V, {
|
|
1129
|
+
style: q.modalOverlay,
|
|
1130
|
+
activeOpacity: 1,
|
|
1131
|
+
onPress: () => i(!1),
|
|
1132
|
+
children: /* @__PURE__ */ R(V, {
|
|
1133
|
+
style: [q.modalContent, { backgroundColor: h.card }],
|
|
1134
|
+
activeOpacity: 1,
|
|
1135
|
+
onPress: () => {},
|
|
1136
|
+
children: [
|
|
1137
|
+
/* @__PURE__ */ R(H, {
|
|
1138
|
+
style: [q.modalHeader, { borderBottomColor: h.separator }],
|
|
1139
|
+
children: [/* @__PURE__ */ L(B, {
|
|
1140
|
+
style: [q.modalTitle, { color: h.text }],
|
|
1141
|
+
children: f || m("renderer.defaultInputs.selectDateRange")
|
|
1142
|
+
}), /* @__PURE__ */ L(V, {
|
|
1143
|
+
onPress: () => i(!1),
|
|
1144
|
+
children: /* @__PURE__ */ L(B, {
|
|
1145
|
+
style: [q.closeButton, { color: h.textMuted }],
|
|
1146
|
+
children: "✕"
|
|
1147
|
+
})
|
|
1148
|
+
})]
|
|
1149
|
+
}),
|
|
1150
|
+
/* @__PURE__ */ L(H, {
|
|
1151
|
+
style: [q.rangeIndicator, { backgroundColor: h.primaryLight }],
|
|
1152
|
+
children: /* @__PURE__ */ L(B, {
|
|
1153
|
+
style: [q.rangeIndicatorText, { color: h.primary }],
|
|
1154
|
+
children: m(a ? "renderer.defaultInputs.startDate" : "renderer.defaultInputs.endDate")
|
|
1155
|
+
})
|
|
1156
|
+
}),
|
|
1157
|
+
/* @__PURE__ */ R(H, {
|
|
1158
|
+
style: q.calendarHeader,
|
|
1159
|
+
children: [
|
|
1160
|
+
/* @__PURE__ */ L(V, {
|
|
1161
|
+
onPress: re,
|
|
1162
|
+
style: q.navButton,
|
|
1163
|
+
children: /* @__PURE__ */ L(B, {
|
|
1164
|
+
style: [q.navButtonText, { color: h.primary }],
|
|
1165
|
+
children: "‹"
|
|
1166
|
+
})
|
|
1167
|
+
}),
|
|
1168
|
+
/* @__PURE__ */ R(B, {
|
|
1169
|
+
style: [q.monthYear, { color: h.text }],
|
|
1170
|
+
children: [
|
|
1171
|
+
te[w],
|
|
1172
|
+
" ",
|
|
1173
|
+
C
|
|
1174
|
+
]
|
|
1175
|
+
}),
|
|
1176
|
+
/* @__PURE__ */ L(V, {
|
|
1177
|
+
onPress: D,
|
|
1178
|
+
style: q.navButton,
|
|
1179
|
+
children: /* @__PURE__ */ L(B, {
|
|
1180
|
+
style: [q.navButtonText, { color: h.primary }],
|
|
1181
|
+
children: "›"
|
|
1182
|
+
})
|
|
1183
|
+
})
|
|
1184
|
+
]
|
|
1185
|
+
}),
|
|
1186
|
+
/* @__PURE__ */ L(H, {
|
|
1187
|
+
style: q.weekDays,
|
|
1188
|
+
children: [
|
|
1189
|
+
"Sun",
|
|
1190
|
+
"Mon",
|
|
1191
|
+
"Tue",
|
|
1192
|
+
"Wed",
|
|
1193
|
+
"Thu",
|
|
1194
|
+
"Fri",
|
|
1195
|
+
"Sat"
|
|
1196
|
+
].map((e) => /* @__PURE__ */ L(B, {
|
|
1197
|
+
style: [q.weekDay, { color: h.textMuted }],
|
|
1198
|
+
children: e
|
|
1199
|
+
}, e))
|
|
1200
|
+
}),
|
|
1201
|
+
/* @__PURE__ */ L(fe, {
|
|
1202
|
+
data: ne,
|
|
1203
|
+
keyExtractor: (e, t) => `${e.date.getTime()}-${t}`,
|
|
1204
|
+
numColumns: 7,
|
|
1205
|
+
scrollEnabled: !1,
|
|
1206
|
+
style: q.calendar,
|
|
1207
|
+
contentContainerStyle: q.calendarContent,
|
|
1208
|
+
renderItem: ({ item: e }) => {
|
|
1209
|
+
let t = k(e.date), n = A(e.date), r = ie(e.date);
|
|
1210
|
+
return /* @__PURE__ */ L(V, {
|
|
1211
|
+
style: [
|
|
1212
|
+
q.dayCell,
|
|
1213
|
+
!e.isCurrentMonth && q.dayCellOtherMonth,
|
|
1214
|
+
n && { backgroundColor: h.primaryLight },
|
|
1215
|
+
r && {
|
|
1216
|
+
backgroundColor: h.primary,
|
|
1217
|
+
borderRadius: 20
|
|
1218
|
+
},
|
|
1219
|
+
t && q.dayCellDisabled
|
|
1220
|
+
],
|
|
1221
|
+
onPress: () => E(e.date),
|
|
1222
|
+
disabled: t,
|
|
1223
|
+
activeOpacity: .7,
|
|
1224
|
+
children: /* @__PURE__ */ L(B, {
|
|
1225
|
+
style: [
|
|
1226
|
+
q.dayText,
|
|
1227
|
+
{ color: h.text },
|
|
1228
|
+
!e.isCurrentMonth && { color: h.textMuted },
|
|
1229
|
+
n && { color: h.primary },
|
|
1230
|
+
r && {
|
|
1231
|
+
color: h.background,
|
|
1232
|
+
fontWeight: "600"
|
|
1233
|
+
},
|
|
1234
|
+
t && { color: h.textMuted }
|
|
1235
|
+
],
|
|
1236
|
+
children: e.day
|
|
1237
|
+
})
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1240
|
+
})
|
|
1241
|
+
]
|
|
1242
|
+
})
|
|
1243
|
+
})
|
|
1244
|
+
}),
|
|
1245
|
+
d && /* @__PURE__ */ L(B, {
|
|
1246
|
+
style: [q.error, { color: h.error }],
|
|
1247
|
+
children: d
|
|
1248
|
+
}),
|
|
1249
|
+
p && !d && /* @__PURE__ */ L(B, {
|
|
1250
|
+
style: [q.helperText, { color: h.textMuted }],
|
|
1251
|
+
children: p
|
|
1252
|
+
})
|
|
1253
|
+
]
|
|
1254
|
+
});
|
|
1255
|
+
}, q = z.create({
|
|
1256
|
+
calendar: {
|
|
1257
|
+
flexGrow: 0,
|
|
1258
|
+
flexShrink: 1
|
|
1259
|
+
},
|
|
1260
|
+
calendarContent: { flexGrow: 0 },
|
|
1261
|
+
calendarHeader: {
|
|
1262
|
+
alignItems: "center",
|
|
1263
|
+
flexDirection: "row",
|
|
1264
|
+
justifyContent: "space-between",
|
|
1265
|
+
marginBottom: 16,
|
|
1266
|
+
paddingHorizontal: 8
|
|
1267
|
+
},
|
|
1268
|
+
closeButton: {
|
|
1269
|
+
fontSize: 24,
|
|
1270
|
+
fontWeight: "300"
|
|
1271
|
+
},
|
|
1272
|
+
container: { marginBottom: 16 },
|
|
1273
|
+
dayCell: {
|
|
1274
|
+
alignItems: "center",
|
|
1275
|
+
aspectRatio: 1,
|
|
1276
|
+
flex: 1,
|
|
1277
|
+
justifyContent: "center",
|
|
1278
|
+
margin: 2,
|
|
1279
|
+
maxWidth: "14.28%"
|
|
1280
|
+
},
|
|
1281
|
+
dayCellDisabled: { opacity: .3 },
|
|
1282
|
+
dayCellOtherMonth: { opacity: .3 },
|
|
1283
|
+
dayText: { fontSize: 14 },
|
|
1284
|
+
error: {
|
|
1285
|
+
fontSize: 12,
|
|
1286
|
+
marginTop: 4
|
|
1287
|
+
},
|
|
1288
|
+
helperText: {
|
|
1289
|
+
fontSize: 12,
|
|
1290
|
+
marginTop: 4
|
|
1291
|
+
},
|
|
1292
|
+
icon: { fontSize: 16 },
|
|
1293
|
+
modalContent: {
|
|
1294
|
+
borderRadius: 12,
|
|
1295
|
+
maxHeight: "80%",
|
|
1296
|
+
padding: 16,
|
|
1297
|
+
width: "90%"
|
|
1298
|
+
},
|
|
1299
|
+
modalHeader: {
|
|
1300
|
+
alignItems: "center",
|
|
1301
|
+
borderBottomWidth: 1,
|
|
1302
|
+
flexDirection: "row",
|
|
1303
|
+
justifyContent: "space-between",
|
|
1304
|
+
marginBottom: 12,
|
|
1305
|
+
paddingBottom: 12
|
|
1306
|
+
},
|
|
1307
|
+
modalOverlay: {
|
|
1308
|
+
alignItems: "center",
|
|
1309
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
1310
|
+
flex: 1,
|
|
1311
|
+
justifyContent: "center"
|
|
1312
|
+
},
|
|
1313
|
+
modalTitle: {
|
|
1314
|
+
fontSize: 18,
|
|
1315
|
+
fontWeight: "600"
|
|
1316
|
+
},
|
|
1317
|
+
monthYear: {
|
|
1318
|
+
fontSize: 16,
|
|
1319
|
+
fontWeight: "600"
|
|
1320
|
+
},
|
|
1321
|
+
navButton: { padding: 8 },
|
|
1322
|
+
navButtonText: {
|
|
1323
|
+
fontSize: 24,
|
|
1324
|
+
fontWeight: "600"
|
|
1325
|
+
},
|
|
1326
|
+
rangeIndicator: {
|
|
1327
|
+
alignItems: "center",
|
|
1328
|
+
borderRadius: 6,
|
|
1329
|
+
marginBottom: 12,
|
|
1330
|
+
paddingVertical: 8
|
|
1331
|
+
},
|
|
1332
|
+
rangeIndicatorText: {
|
|
1333
|
+
fontSize: 14,
|
|
1334
|
+
fontWeight: "600"
|
|
1335
|
+
},
|
|
1336
|
+
trigger: {
|
|
1337
|
+
alignItems: "center",
|
|
1338
|
+
borderRadius: 6,
|
|
1339
|
+
borderWidth: 1,
|
|
1340
|
+
flexDirection: "row",
|
|
1341
|
+
justifyContent: "space-between",
|
|
1342
|
+
paddingHorizontal: 12,
|
|
1343
|
+
paddingVertical: 10
|
|
1344
|
+
},
|
|
1345
|
+
triggerText: {
|
|
1346
|
+
flex: 1,
|
|
1347
|
+
fontSize: 14
|
|
1348
|
+
},
|
|
1349
|
+
weekDay: {
|
|
1350
|
+
flex: 1,
|
|
1351
|
+
fontSize: 12,
|
|
1352
|
+
fontWeight: "600",
|
|
1353
|
+
maxWidth: "14.28%",
|
|
1354
|
+
textAlign: "center"
|
|
1355
|
+
},
|
|
1356
|
+
weekDays: {
|
|
1357
|
+
flexDirection: "row",
|
|
1358
|
+
marginBottom: 8
|
|
1359
|
+
}
|
|
1360
|
+
}), je = ({ field: e, extra: t }) => {
|
|
1361
|
+
let [r, i] = F(null), [a, o] = F(!0), { value: s } = e, { InputLabel: c, node: l, setValue: d, error: f, label: p, helperText: m } = t, { colors: h } = b(), g = n(), _ = E(s), v = l.data.multiple, y = se(async () => {
|
|
1362
|
+
if (r) try {
|
|
1363
|
+
let e = (await r({ allowMultiSelection: v })).map((e) => ({
|
|
1364
|
+
data: e.uri,
|
|
1365
|
+
lastModified: Date.now(),
|
|
1366
|
+
name: e.name,
|
|
1367
|
+
size: e.size,
|
|
1368
|
+
type: e.type || "application/octet-stream"
|
|
1369
|
+
}));
|
|
1370
|
+
d(v ? [..._, ...e] : e[0] || null);
|
|
1371
|
+
} catch (e) {
|
|
1372
|
+
e.code !== "DOCUMENT_PICKER_CANCELED" && ue.alert("Error", g("renderer.defaultInputs.filePickerError"));
|
|
1373
|
+
}
|
|
1374
|
+
}, [
|
|
1375
|
+
r,
|
|
1376
|
+
_,
|
|
1377
|
+
v,
|
|
1378
|
+
d,
|
|
1379
|
+
g
|
|
1380
|
+
]), x = se((e) => {
|
|
1381
|
+
let t = _.filter((t, n) => n !== e);
|
|
1382
|
+
d(t.length > 0 ? t : null);
|
|
1383
|
+
}, [_, d]);
|
|
1384
|
+
return N(() => {
|
|
1385
|
+
(async () => {
|
|
1386
|
+
try {
|
|
1387
|
+
let { pick: e } = await import("react-native-document-picker");
|
|
1388
|
+
i(() => e);
|
|
1389
|
+
} catch {
|
|
1390
|
+
i(null);
|
|
1391
|
+
} finally {
|
|
1392
|
+
o(!1);
|
|
1393
|
+
}
|
|
1394
|
+
})();
|
|
1395
|
+
}, []), a ? null : r ? /* @__PURE__ */ R(H, {
|
|
1396
|
+
style: J.container,
|
|
1397
|
+
children: [
|
|
1398
|
+
/* @__PURE__ */ L(c, {
|
|
1399
|
+
label: p,
|
|
1400
|
+
required: l.data.required
|
|
1401
|
+
}),
|
|
1402
|
+
_.length > 0 && /* @__PURE__ */ L(H, {
|
|
1403
|
+
style: J.filesList,
|
|
1404
|
+
children: _.map((e, t) => /* @__PURE__ */ R(H, {
|
|
1405
|
+
style: [J.fileItem, {
|
|
1406
|
+
backgroundColor: h.card,
|
|
1407
|
+
borderColor: h.separator
|
|
1408
|
+
}],
|
|
1409
|
+
children: [
|
|
1410
|
+
/* @__PURE__ */ L(H, {
|
|
1411
|
+
style: [J.fileIcon, { backgroundColor: h.muted }],
|
|
1412
|
+
children: /* @__PURE__ */ L(B, {
|
|
1413
|
+
style: J.fileIconText,
|
|
1414
|
+
children: "📄"
|
|
1415
|
+
})
|
|
1416
|
+
}),
|
|
1417
|
+
/* @__PURE__ */ R(H, {
|
|
1418
|
+
style: J.fileInfo,
|
|
1419
|
+
children: [/* @__PURE__ */ L(B, {
|
|
1420
|
+
style: [J.fileName, { color: h.text }],
|
|
1421
|
+
numberOfLines: 1,
|
|
1422
|
+
children: e.name
|
|
1423
|
+
}), e.size > 0 && /* @__PURE__ */ L(B, {
|
|
1424
|
+
style: [J.fileSize, { color: h.textMuted }],
|
|
1425
|
+
children: u(e.size)
|
|
1426
|
+
})]
|
|
1427
|
+
}),
|
|
1428
|
+
/* @__PURE__ */ L(V, {
|
|
1429
|
+
style: J.removeButton,
|
|
1430
|
+
onPress: () => x(t),
|
|
1431
|
+
activeOpacity: .7,
|
|
1432
|
+
accessibilityLabel: g("renderer.defaultInputs.removeFile"),
|
|
1433
|
+
children: /* @__PURE__ */ L(B, {
|
|
1434
|
+
style: [J.removeButtonText, { color: h.textMuted }],
|
|
1435
|
+
children: "✕"
|
|
1436
|
+
})
|
|
1437
|
+
})
|
|
1438
|
+
]
|
|
1439
|
+
}, `${e.name}-${t}`))
|
|
1440
|
+
}),
|
|
1441
|
+
/* @__PURE__ */ L(V, {
|
|
1442
|
+
style: [J.pickButton, {
|
|
1443
|
+
backgroundColor: h.input,
|
|
1444
|
+
borderColor: h.border
|
|
1445
|
+
}],
|
|
1446
|
+
onPress: y,
|
|
1447
|
+
activeOpacity: .7,
|
|
1448
|
+
children: /* @__PURE__ */ L(B, {
|
|
1449
|
+
style: [J.pickButtonText, { color: h.textMuted }],
|
|
1450
|
+
children: _.length === 0 ? g(v ? "renderer.defaultInputs.selectFiles" : "renderer.defaultInputs.selectFile") : g(v ? "renderer.defaultInputs.addMoreFiles" : "renderer.defaultInputs.replaceFile")
|
|
1451
|
+
})
|
|
1452
|
+
}),
|
|
1453
|
+
f && /* @__PURE__ */ L(B, {
|
|
1454
|
+
style: [J.error, { color: h.error }],
|
|
1455
|
+
children: f
|
|
1456
|
+
}),
|
|
1457
|
+
m && !f && /* @__PURE__ */ L(B, {
|
|
1458
|
+
style: [J.helperText, { color: h.textMuted }],
|
|
1459
|
+
children: m
|
|
1460
|
+
})
|
|
1461
|
+
]
|
|
1462
|
+
}) : /* @__PURE__ */ R(H, {
|
|
1463
|
+
style: J.container,
|
|
1464
|
+
children: [
|
|
1465
|
+
/* @__PURE__ */ L(c, {
|
|
1466
|
+
label: p,
|
|
1467
|
+
required: l.data.required
|
|
1468
|
+
}),
|
|
1469
|
+
/* @__PURE__ */ L(H, {
|
|
1470
|
+
style: [J.unavailableContainer, {
|
|
1471
|
+
backgroundColor: h.errorLight,
|
|
1472
|
+
borderColor: h.error
|
|
1473
|
+
}],
|
|
1474
|
+
children: /* @__PURE__ */ L(B, {
|
|
1475
|
+
style: [J.unavailableText, { color: h.error }],
|
|
1476
|
+
children: g("renderer.defaultInputs.filePickerUnavailable")
|
|
1477
|
+
})
|
|
1478
|
+
}),
|
|
1479
|
+
m && /* @__PURE__ */ L(B, {
|
|
1480
|
+
style: [J.helperText, { color: h.textMuted }],
|
|
1481
|
+
children: m
|
|
1482
|
+
})
|
|
1483
|
+
]
|
|
1484
|
+
});
|
|
1485
|
+
}, J = z.create({
|
|
1486
|
+
container: { marginBottom: 16 },
|
|
1487
|
+
error: {
|
|
1488
|
+
fontSize: 12,
|
|
1489
|
+
marginTop: 4
|
|
1490
|
+
},
|
|
1491
|
+
fileIcon: {
|
|
1492
|
+
alignItems: "center",
|
|
1493
|
+
borderRadius: 6,
|
|
1494
|
+
height: 40,
|
|
1495
|
+
justifyContent: "center",
|
|
1496
|
+
width: 40
|
|
1497
|
+
},
|
|
1498
|
+
fileIconText: { fontSize: 20 },
|
|
1499
|
+
fileInfo: {
|
|
1500
|
+
flex: 1,
|
|
1501
|
+
marginLeft: 12
|
|
1502
|
+
},
|
|
1503
|
+
fileItem: {
|
|
1504
|
+
alignItems: "center",
|
|
1505
|
+
borderRadius: 6,
|
|
1506
|
+
borderWidth: 1,
|
|
1507
|
+
flexDirection: "row",
|
|
1508
|
+
marginBottom: 8,
|
|
1509
|
+
padding: 12
|
|
1510
|
+
},
|
|
1511
|
+
fileName: {
|
|
1512
|
+
fontSize: 14,
|
|
1513
|
+
fontWeight: "500"
|
|
1514
|
+
},
|
|
1515
|
+
fileSize: {
|
|
1516
|
+
fontSize: 12,
|
|
1517
|
+
marginTop: 2
|
|
1518
|
+
},
|
|
1519
|
+
filesList: { marginBottom: 12 },
|
|
1520
|
+
helperText: {
|
|
1521
|
+
fontSize: 12,
|
|
1522
|
+
marginTop: 4
|
|
1523
|
+
},
|
|
1524
|
+
pickButton: {
|
|
1525
|
+
alignItems: "center",
|
|
1526
|
+
borderRadius: 6,
|
|
1527
|
+
borderStyle: "dashed",
|
|
1528
|
+
borderWidth: 2,
|
|
1529
|
+
justifyContent: "center",
|
|
1530
|
+
paddingVertical: 16
|
|
1531
|
+
},
|
|
1532
|
+
pickButtonText: {
|
|
1533
|
+
fontSize: 14,
|
|
1534
|
+
fontWeight: "500"
|
|
1535
|
+
},
|
|
1536
|
+
removeButton: { padding: 4 },
|
|
1537
|
+
removeButtonText: { fontSize: 18 },
|
|
1538
|
+
unavailableContainer: {
|
|
1539
|
+
alignItems: "center",
|
|
1540
|
+
borderRadius: 6,
|
|
1541
|
+
borderWidth: 1,
|
|
1542
|
+
justifyContent: "center",
|
|
1543
|
+
paddingVertical: 16
|
|
1544
|
+
},
|
|
1545
|
+
unavailableText: {
|
|
1546
|
+
fontSize: 12,
|
|
1547
|
+
textAlign: "center"
|
|
1548
|
+
}
|
|
1549
|
+
}), Me = (e) => null, Ne = ({ missing: e, children: t }) => {
|
|
1550
|
+
let r = n(), { colors: i } = b();
|
|
1551
|
+
return /* @__PURE__ */ R(I, { children: [t, e.length > 0 && /* @__PURE__ */ R(H, {
|
|
1552
|
+
style: Pe.container,
|
|
1553
|
+
children: [/* @__PURE__ */ L(B, {
|
|
1554
|
+
style: [Pe.title, { color: i.textMuted }],
|
|
1555
|
+
children: r("renderer.dependencyHint.title")
|
|
1556
|
+
}), e.map((e) => /* @__PURE__ */ R(B, {
|
|
1557
|
+
style: [Pe.item, { color: i.textMuted }],
|
|
1558
|
+
children: [
|
|
1559
|
+
"•",
|
|
1560
|
+
" ",
|
|
1561
|
+
e.label
|
|
1562
|
+
]
|
|
1563
|
+
}, e.id))]
|
|
1564
|
+
})] });
|
|
1565
|
+
}, Pe = z.create({
|
|
1566
|
+
container: {
|
|
1567
|
+
gap: 2,
|
|
1568
|
+
marginTop: 4
|
|
1569
|
+
},
|
|
1570
|
+
item: { fontSize: 12 },
|
|
1571
|
+
title: {
|
|
1572
|
+
fontSize: 12,
|
|
1573
|
+
fontWeight: "500"
|
|
1574
|
+
}
|
|
1575
|
+
}), Fe = (e) => {
|
|
1576
|
+
let t = e.matchAll(/{{([\w-]+)}}/g);
|
|
1577
|
+
return Array.from(t, (e) => e[1]);
|
|
1578
|
+
}, Ie = (e, t) => Fe(e).every((e) => {
|
|
1579
|
+
let n = t[e];
|
|
1580
|
+
return n != null && n !== "";
|
|
1581
|
+
}), Le = (e, t, n = !1) => e.replace(/{{([\w-]+)}}/g, (e, r) => {
|
|
1582
|
+
let i = t[r], a = i == null ? "" : String(i);
|
|
1583
|
+
return n ? encodeURIComponent(a) : a;
|
|
1584
|
+
}), Re = ({ field: e, extra: o }) => {
|
|
1585
|
+
let [l, u] = F(!1), [d, f] = F(null), [p, m] = F([]), [h, g] = F(""), [v, y] = F(!1), { value: x, placeholder: S } = e, { InputLabel: C, node: w, setValue: T, error: E, label: D, helperText: O, missingDependencies: k } = o, { formValues: A, inputNodes: ie, headers: ae, baseUrl: oe } = c(), { colors: j } = b(), { httpConfig: M } = w.data, I = n(), ue = P(!1), de = P(!1), pe = P(""), he = P(M), z = P(A), ge = P(ie), ve = P(ae), ye = P(oe), be = P(T), xe = P(null), Se = P(null), Ce = P(w.data.normalizeOptionLabels !== !1), we = ce(() => M?.url ? Fe(M.url) : [], [M?.url]), U = we.length > 0, Ee = ce(() => we.map((e) => `${e}:${String(A[e] ?? "")}`).join("|"), [we, A]), De = ce(() => M?.url ? U ? Ie(M.url, A) : !0 : !1, [
|
|
1586
|
+
M?.url,
|
|
1587
|
+
U,
|
|
1588
|
+
A
|
|
1589
|
+
]), W = se(async (e) => {
|
|
1590
|
+
Se.current && Se.current.abort();
|
|
1591
|
+
let n = new AbortController();
|
|
1592
|
+
Se.current = n;
|
|
1593
|
+
let o = he.current, c = z.current, l = be.current;
|
|
1594
|
+
if (!o?.url) {
|
|
1595
|
+
f(I("renderer.defaultHttpInput.noUrlConfigured")), Se.current = null;
|
|
1596
|
+
return;
|
|
1597
|
+
}
|
|
1598
|
+
if (o.url && !Ie(o.url, c)) {
|
|
1599
|
+
Se.current = null;
|
|
1600
|
+
return;
|
|
1601
|
+
}
|
|
1602
|
+
u(!0), f(null);
|
|
1603
|
+
try {
|
|
1604
|
+
let u = i(Le(o.url, c, !0), ye.current), d = s(o.searchParam && e ? `${u}${u.includes("?") ? "&" : "?"}${o.searchParam}=${encodeURIComponent(e)}` : u, r(o.queryParams, c)), p = _({ "Content-Type": "application/json" }, r(ve.current, c), r(o.headers, c)), h = [
|
|
1605
|
+
"POST",
|
|
1606
|
+
"PUT",
|
|
1607
|
+
"PATCH"
|
|
1608
|
+
].includes(o.method || "") ? o.sendAllFormValues ? JSON.stringify(ee(c, ge.current)) : te(o.body, c, ge.current) : void 0, g = setTimeout(() => n.abort(), 3e4), v = await fetch(d, {
|
|
1609
|
+
body: h || void 0,
|
|
1610
|
+
headers: Object.fromEntries(Object.entries(p).filter(([, e]) => e)),
|
|
1611
|
+
method: o.method || "GET",
|
|
1612
|
+
signal: n.signal
|
|
1613
|
+
});
|
|
1614
|
+
if (clearTimeout(g), !v.ok) {
|
|
1615
|
+
f(`HTTP Error ${v.status}: ${v.statusText}`);
|
|
1616
|
+
return;
|
|
1617
|
+
}
|
|
1618
|
+
let y = a(await v.text());
|
|
1619
|
+
if (!y.ok) {
|
|
1620
|
+
f(I("renderer.defaultHttpInput.invalidJson"));
|
|
1621
|
+
return;
|
|
1622
|
+
}
|
|
1623
|
+
let b = re(y.value), x = o.responsePath ? t(b, o.responsePath) : b;
|
|
1624
|
+
if (o.responseMapping && Array.isArray(x)) {
|
|
1625
|
+
let { valueField: e = "value", labelField: n = "label", descriptionField: r, imageField: i } = o.responseMapping, a = Ce.current;
|
|
1626
|
+
m(x.map((o) => {
|
|
1627
|
+
let s = r ? t(o, r) : void 0, c = i ? t(o, i) : void 0, l = String(t(o, n) || "");
|
|
1628
|
+
return {
|
|
1629
|
+
description: s != null && s !== "" ? String(s) : void 0,
|
|
1630
|
+
image: typeof c == "string" && c !== "" ? c : void 0,
|
|
1631
|
+
label: a ? ne(l) : l,
|
|
1632
|
+
value: String(t(o, e) || "")
|
|
1633
|
+
};
|
|
1634
|
+
}));
|
|
1635
|
+
} else l(typeof x == "string" ? x : JSON.stringify(x));
|
|
1636
|
+
} catch (e) {
|
|
1637
|
+
if (e instanceof Error && e.name === "AbortError") return;
|
|
1638
|
+
f(e instanceof Error ? e.message : I("renderer.defaultHttpInput.fetchFailed")), console.error("HTTP Input fetch error:", e);
|
|
1639
|
+
} finally {
|
|
1640
|
+
Se.current === n && (u(!1), Se.current = null);
|
|
1641
|
+
}
|
|
1642
|
+
}, [I]);
|
|
1643
|
+
if (N(() => {
|
|
1644
|
+
he.current = M, z.current = A, ge.current = ie, ve.current = ae, ye.current = oe, be.current = T, xe.current = W, Ce.current = w.data.normalizeOptionLabels !== !1;
|
|
1645
|
+
}, [
|
|
1646
|
+
M,
|
|
1647
|
+
A,
|
|
1648
|
+
ie,
|
|
1649
|
+
ae,
|
|
1650
|
+
oe,
|
|
1651
|
+
T,
|
|
1652
|
+
W,
|
|
1653
|
+
w.data.normalizeOptionLabels
|
|
1654
|
+
]), N(() => () => {
|
|
1655
|
+
Se.current && Se.current.abort(), ue.current = !1, de.current = !1;
|
|
1656
|
+
}, []), N(() => {
|
|
1657
|
+
if (ue.current) return;
|
|
1658
|
+
ue.current = !0;
|
|
1659
|
+
let e = he.current, t = z.current, n = xe.current, r = e?.url && Ie(e.url, t);
|
|
1660
|
+
e?.fetchOnMount && r && n && (n(), e.url && (pe.current = Fe(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
|
|
1661
|
+
}, []), N(() => {
|
|
1662
|
+
if (!ue.current || !U || pe.current === Ee || !De) return;
|
|
1663
|
+
let e = setTimeout(() => {
|
|
1664
|
+
W(), pe.current = Ee;
|
|
1665
|
+
}, 500);
|
|
1666
|
+
return () => clearTimeout(e);
|
|
1667
|
+
}, [
|
|
1668
|
+
Ee,
|
|
1669
|
+
U,
|
|
1670
|
+
De,
|
|
1671
|
+
W
|
|
1672
|
+
]), N(() => {
|
|
1673
|
+
if (!de.current) {
|
|
1674
|
+
de.current = !0;
|
|
1675
|
+
return;
|
|
1676
|
+
}
|
|
1677
|
+
let e = he.current, t = z.current, n = xe.current, r = e?.url && Ie(e.url, t);
|
|
1678
|
+
e?.fetchOnMount && r && n && (n(), e.url && (pe.current = Fe(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
|
|
1679
|
+
}, [ce(() => JSON.stringify({
|
|
1680
|
+
body: M?.body,
|
|
1681
|
+
fetchOnMount: M?.fetchOnMount,
|
|
1682
|
+
headers: M?.headers,
|
|
1683
|
+
method: M?.method,
|
|
1684
|
+
queryParams: M?.queryParams,
|
|
1685
|
+
responseMapping: M?.responseMapping,
|
|
1686
|
+
responsePath: M?.responsePath,
|
|
1687
|
+
searchParam: M?.searchParam,
|
|
1688
|
+
sendAllFormValues: M?.sendAllFormValues,
|
|
1689
|
+
url: M?.url
|
|
1690
|
+
}), [M])]), N(() => {
|
|
1691
|
+
if (!(M?.searchParam && h)) return;
|
|
1692
|
+
let e = setTimeout(() => {
|
|
1693
|
+
W(h);
|
|
1694
|
+
}, 300);
|
|
1695
|
+
return () => clearTimeout(e);
|
|
1696
|
+
}, [
|
|
1697
|
+
h,
|
|
1698
|
+
M?.searchParam,
|
|
1699
|
+
W
|
|
1700
|
+
]), M?.responseMapping) {
|
|
1701
|
+
let e = Array.isArray(x) ? x[0] : x, t = p.find((t) => t.value === e);
|
|
1702
|
+
if (M.searchParam) {
|
|
1703
|
+
let n = l && M?.showLoading;
|
|
1704
|
+
return /* @__PURE__ */ R(H, {
|
|
1705
|
+
style: Y.container,
|
|
1706
|
+
children: [
|
|
1707
|
+
/* @__PURE__ */ L(C, {
|
|
1708
|
+
label: D,
|
|
1709
|
+
required: w.data.required
|
|
1710
|
+
}),
|
|
1711
|
+
/* @__PURE__ */ L(Ne, {
|
|
1712
|
+
missing: k,
|
|
1713
|
+
children: /* @__PURE__ */ R(V, {
|
|
1714
|
+
style: [
|
|
1715
|
+
Y.trigger,
|
|
1716
|
+
{
|
|
1717
|
+
backgroundColor: j.input,
|
|
1718
|
+
borderColor: j.border
|
|
1719
|
+
},
|
|
1720
|
+
E && { borderColor: j.error },
|
|
1721
|
+
k.length > 0 && { backgroundColor: j.muted }
|
|
1722
|
+
],
|
|
1723
|
+
onPress: () => y(!0),
|
|
1724
|
+
disabled: k.length > 0,
|
|
1725
|
+
activeOpacity: .7,
|
|
1726
|
+
children: [
|
|
1727
|
+
/* @__PURE__ */ L(B, {
|
|
1728
|
+
style: [
|
|
1729
|
+
Y.triggerText,
|
|
1730
|
+
{ color: j.text },
|
|
1731
|
+
!t && { color: j.textMuted }
|
|
1732
|
+
],
|
|
1733
|
+
numberOfLines: 1,
|
|
1734
|
+
children: t?.label || S || I("renderer.defaultHttpInput.search")
|
|
1735
|
+
}),
|
|
1736
|
+
n && /* @__PURE__ */ L(le, {
|
|
1737
|
+
size: "small",
|
|
1738
|
+
color: j.primary,
|
|
1739
|
+
style: Y.triggerLoader
|
|
1740
|
+
}),
|
|
1741
|
+
e ? /* @__PURE__ */ L(V, {
|
|
1742
|
+
onPress: () => T(""),
|
|
1743
|
+
hitSlop: {
|
|
1744
|
+
bottom: 8,
|
|
1745
|
+
left: 8,
|
|
1746
|
+
right: 8,
|
|
1747
|
+
top: 8
|
|
1748
|
+
},
|
|
1749
|
+
style: Y.clearButton,
|
|
1750
|
+
children: /* @__PURE__ */ L(B, {
|
|
1751
|
+
style: [Y.clearIcon, { color: j.textMuted }],
|
|
1752
|
+
children: "✕"
|
|
1753
|
+
})
|
|
1754
|
+
}) : null,
|
|
1755
|
+
/* @__PURE__ */ L(B, {
|
|
1756
|
+
style: [Y.arrow, { color: j.textMuted }],
|
|
1757
|
+
children: "▼"
|
|
1758
|
+
})
|
|
1759
|
+
]
|
|
1760
|
+
})
|
|
1761
|
+
}),
|
|
1762
|
+
/* @__PURE__ */ L(me, {
|
|
1763
|
+
visible: v,
|
|
1764
|
+
transparent: !0,
|
|
1765
|
+
animationType: "fade",
|
|
1766
|
+
onRequestClose: () => y(!1),
|
|
1767
|
+
children: /* @__PURE__ */ L(V, {
|
|
1768
|
+
style: Y.modalOverlay,
|
|
1769
|
+
activeOpacity: 1,
|
|
1770
|
+
onPress: () => y(!1),
|
|
1771
|
+
children: /* @__PURE__ */ R(V, {
|
|
1772
|
+
style: [Y.modalContent, { backgroundColor: j.card }],
|
|
1773
|
+
activeOpacity: 1,
|
|
1774
|
+
onPress: () => {},
|
|
1775
|
+
children: [
|
|
1776
|
+
/* @__PURE__ */ R(H, {
|
|
1777
|
+
style: [Y.modalHeader, { borderBottomColor: j.separator }],
|
|
1778
|
+
children: [/* @__PURE__ */ L(B, {
|
|
1779
|
+
style: [Y.modalTitle, { color: j.text }],
|
|
1780
|
+
children: D || S || I("renderer.defaultHttpInput.search")
|
|
1781
|
+
}), /* @__PURE__ */ L(V, {
|
|
1782
|
+
onPress: () => y(!1),
|
|
1783
|
+
children: /* @__PURE__ */ L(B, {
|
|
1784
|
+
style: [Y.closeButton, { color: j.textMuted }],
|
|
1785
|
+
children: "✕"
|
|
1786
|
+
})
|
|
1787
|
+
})]
|
|
1788
|
+
}),
|
|
1789
|
+
/* @__PURE__ */ L(H, {
|
|
1790
|
+
style: Y.searchContainer,
|
|
1791
|
+
children: /* @__PURE__ */ L(_e, {
|
|
1792
|
+
style: [Y.searchInput, {
|
|
1793
|
+
backgroundColor: j.muted,
|
|
1794
|
+
borderColor: j.border,
|
|
1795
|
+
color: j.text
|
|
1796
|
+
}],
|
|
1797
|
+
placeholder: I("renderer.defaultHttpInput.search"),
|
|
1798
|
+
placeholderTextColor: j.textMuted,
|
|
1799
|
+
value: h,
|
|
1800
|
+
onChangeText: (e) => {
|
|
1801
|
+
g(e), f(null);
|
|
1802
|
+
},
|
|
1803
|
+
autoFocus: !0,
|
|
1804
|
+
autoCapitalize: "none",
|
|
1805
|
+
autoCorrect: !1
|
|
1806
|
+
})
|
|
1807
|
+
}),
|
|
1808
|
+
l ? /* @__PURE__ */ L(H, {
|
|
1809
|
+
style: Y.loadingContainer,
|
|
1810
|
+
children: /* @__PURE__ */ L(le, {
|
|
1811
|
+
size: "small",
|
|
1812
|
+
color: j.primary
|
|
1813
|
+
})
|
|
1814
|
+
}) : d ? /* @__PURE__ */ R(H, {
|
|
1815
|
+
style: Y.errorContainer,
|
|
1816
|
+
children: [/* @__PURE__ */ L(B, {
|
|
1817
|
+
style: [Y.errorText, { color: j.error }],
|
|
1818
|
+
children: d
|
|
1819
|
+
}), /* @__PURE__ */ L(V, {
|
|
1820
|
+
onPress: () => W(h),
|
|
1821
|
+
style: Y.retryButton,
|
|
1822
|
+
children: /* @__PURE__ */ L(B, {
|
|
1823
|
+
style: [Y.retryButtonText, { color: j.primary }],
|
|
1824
|
+
children: I("renderer.defaultHttpInput.retry")
|
|
1825
|
+
})
|
|
1826
|
+
})]
|
|
1827
|
+
}) : /* @__PURE__ */ L(fe, {
|
|
1828
|
+
data: p,
|
|
1829
|
+
keyExtractor: (e) => e.value,
|
|
1830
|
+
style: Y.optionsList,
|
|
1831
|
+
contentContainerStyle: Y.optionsListContent,
|
|
1832
|
+
ListEmptyComponent: /* @__PURE__ */ L(H, {
|
|
1833
|
+
style: Y.emptyContainer,
|
|
1834
|
+
children: /* @__PURE__ */ L(B, {
|
|
1835
|
+
style: [Y.emptyText, { color: j.textMuted }],
|
|
1836
|
+
children: I("renderer.defaultHttpInput.noResults")
|
|
1837
|
+
})
|
|
1838
|
+
}),
|
|
1839
|
+
renderItem: ({ item: t }) => {
|
|
1840
|
+
let n = t.value === e;
|
|
1841
|
+
return /* @__PURE__ */ R(V, {
|
|
1842
|
+
style: [Y.option, n && { backgroundColor: j.primaryLight }],
|
|
1843
|
+
onPress: () => {
|
|
1844
|
+
T(t.value), y(!1);
|
|
1845
|
+
},
|
|
1846
|
+
activeOpacity: .7,
|
|
1847
|
+
children: [/* @__PURE__ */ L(Te, {
|
|
1848
|
+
label: t.label,
|
|
1849
|
+
description: t.description,
|
|
1850
|
+
image: t.image
|
|
1851
|
+
}), n && /* @__PURE__ */ L(B, {
|
|
1852
|
+
style: [Y.checkmark, { color: j.primary }],
|
|
1853
|
+
children: "✓"
|
|
1854
|
+
})]
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
})
|
|
1858
|
+
]
|
|
1859
|
+
})
|
|
1860
|
+
})
|
|
1861
|
+
}),
|
|
1862
|
+
E && /* @__PURE__ */ L(B, {
|
|
1863
|
+
style: [Y.error, { color: j.error }],
|
|
1864
|
+
children: E
|
|
1865
|
+
}),
|
|
1866
|
+
O && !E && /* @__PURE__ */ L(B, {
|
|
1867
|
+
style: [Y.helperText, { color: j.textMuted }],
|
|
1868
|
+
children: O
|
|
1869
|
+
})
|
|
1870
|
+
]
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
let n = l && M?.showLoading, r = k.length === 0 && p.length === 0 && !n ? d ?? I("renderer.defaultHttpInput.noDataAvailable") : void 0;
|
|
1874
|
+
return /* @__PURE__ */ R(H, {
|
|
1875
|
+
style: Y.container,
|
|
1876
|
+
children: [
|
|
1877
|
+
/* @__PURE__ */ L(C, {
|
|
1878
|
+
label: D,
|
|
1879
|
+
required: w.data.required
|
|
1880
|
+
}),
|
|
1881
|
+
/* @__PURE__ */ L(Ne, {
|
|
1882
|
+
missing: k,
|
|
1883
|
+
children: /* @__PURE__ */ R(V, {
|
|
1884
|
+
style: [
|
|
1885
|
+
Y.trigger,
|
|
1886
|
+
{
|
|
1887
|
+
backgroundColor: j.input,
|
|
1888
|
+
borderColor: j.border
|
|
1889
|
+
},
|
|
1890
|
+
E && { borderColor: j.error },
|
|
1891
|
+
(n || p.length === 0) && { backgroundColor: j.muted }
|
|
1892
|
+
],
|
|
1893
|
+
onPress: () => y(!0),
|
|
1894
|
+
disabled: n || p.length === 0,
|
|
1895
|
+
activeOpacity: .7,
|
|
1896
|
+
children: [
|
|
1897
|
+
/* @__PURE__ */ L(B, {
|
|
1898
|
+
style: [
|
|
1899
|
+
Y.triggerText,
|
|
1900
|
+
{ color: j.text },
|
|
1901
|
+
!t && { color: j.textMuted }
|
|
1902
|
+
],
|
|
1903
|
+
numberOfLines: 1,
|
|
1904
|
+
children: t?.label || S || I("renderer.defaultHttpInput.selectOption")
|
|
1905
|
+
}),
|
|
1906
|
+
n && /* @__PURE__ */ L(le, {
|
|
1907
|
+
size: "small",
|
|
1908
|
+
color: j.primary,
|
|
1909
|
+
style: Y.triggerLoader
|
|
1910
|
+
}),
|
|
1911
|
+
e ? /* @__PURE__ */ L(V, {
|
|
1912
|
+
onPress: () => T(""),
|
|
1913
|
+
hitSlop: {
|
|
1914
|
+
bottom: 8,
|
|
1915
|
+
left: 8,
|
|
1916
|
+
right: 8,
|
|
1917
|
+
top: 8
|
|
1918
|
+
},
|
|
1919
|
+
style: Y.clearButton,
|
|
1920
|
+
children: /* @__PURE__ */ L(B, {
|
|
1921
|
+
style: [Y.clearIcon, { color: j.textMuted }],
|
|
1922
|
+
children: "✕"
|
|
1923
|
+
})
|
|
1924
|
+
}) : null,
|
|
1925
|
+
/* @__PURE__ */ L(B, {
|
|
1926
|
+
style: [Y.arrow, { color: j.textMuted }],
|
|
1927
|
+
children: "▼"
|
|
1928
|
+
})
|
|
1929
|
+
]
|
|
1930
|
+
})
|
|
1931
|
+
}),
|
|
1932
|
+
r && /* @__PURE__ */ L(B, {
|
|
1933
|
+
style: [Y.disabledMessage, { color: j.error }],
|
|
1934
|
+
children: r
|
|
1935
|
+
}),
|
|
1936
|
+
/* @__PURE__ */ L(me, {
|
|
1937
|
+
visible: v,
|
|
1938
|
+
transparent: !0,
|
|
1939
|
+
animationType: "fade",
|
|
1940
|
+
onRequestClose: () => y(!1),
|
|
1941
|
+
children: /* @__PURE__ */ L(V, {
|
|
1942
|
+
style: Y.modalOverlay,
|
|
1943
|
+
activeOpacity: 1,
|
|
1944
|
+
onPress: () => y(!1),
|
|
1945
|
+
children: /* @__PURE__ */ R(V, {
|
|
1946
|
+
style: [Y.modalContent, { backgroundColor: j.card }],
|
|
1947
|
+
activeOpacity: 1,
|
|
1948
|
+
onPress: () => {},
|
|
1949
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1950
|
+
style: [Y.modalHeader, { borderBottomColor: j.separator }],
|
|
1951
|
+
children: [/* @__PURE__ */ L(B, {
|
|
1952
|
+
style: [Y.modalTitle, { color: j.text }],
|
|
1953
|
+
children: D || S || I("renderer.defaultHttpInput.selectOption")
|
|
1954
|
+
}), /* @__PURE__ */ L(V, {
|
|
1955
|
+
onPress: () => y(!1),
|
|
1956
|
+
children: /* @__PURE__ */ L(B, {
|
|
1957
|
+
style: [Y.closeButton, { color: j.textMuted }],
|
|
1958
|
+
children: "✕"
|
|
1959
|
+
})
|
|
1960
|
+
})]
|
|
1961
|
+
}), /* @__PURE__ */ L(fe, {
|
|
1962
|
+
data: p,
|
|
1963
|
+
keyExtractor: (e) => e.value,
|
|
1964
|
+
style: Y.optionsList,
|
|
1965
|
+
contentContainerStyle: Y.optionsListContent,
|
|
1966
|
+
renderItem: ({ item: t }) => {
|
|
1967
|
+
let n = t.value === e;
|
|
1968
|
+
return /* @__PURE__ */ R(V, {
|
|
1969
|
+
style: [Y.option, n && { backgroundColor: j.primaryLight }],
|
|
1970
|
+
onPress: () => {
|
|
1971
|
+
T(t.value), y(!1);
|
|
1972
|
+
},
|
|
1973
|
+
activeOpacity: .7,
|
|
1974
|
+
children: [/* @__PURE__ */ L(Te, {
|
|
1975
|
+
label: t.label,
|
|
1976
|
+
description: t.description,
|
|
1977
|
+
image: t.image
|
|
1978
|
+
}), n && /* @__PURE__ */ L(B, {
|
|
1979
|
+
style: [Y.checkmark, { color: j.primary }],
|
|
1980
|
+
children: "✓"
|
|
1981
|
+
})]
|
|
1982
|
+
});
|
|
1983
|
+
}
|
|
1984
|
+
})]
|
|
1985
|
+
})
|
|
1986
|
+
})
|
|
1987
|
+
}),
|
|
1988
|
+
E && /* @__PURE__ */ L(B, {
|
|
1989
|
+
style: [Y.error, { color: j.error }],
|
|
1990
|
+
children: E
|
|
1991
|
+
}),
|
|
1992
|
+
O && !E && /* @__PURE__ */ L(B, {
|
|
1993
|
+
style: [Y.helperText, { color: j.textMuted }],
|
|
1994
|
+
children: O
|
|
1995
|
+
})
|
|
1996
|
+
]
|
|
1997
|
+
});
|
|
1998
|
+
}
|
|
1999
|
+
return /* @__PURE__ */ R(H, {
|
|
2000
|
+
style: Y.container,
|
|
2001
|
+
children: [
|
|
2002
|
+
/* @__PURE__ */ L(C, {
|
|
2003
|
+
label: D,
|
|
2004
|
+
required: w.data.required
|
|
2005
|
+
}),
|
|
2006
|
+
/* @__PURE__ */ L(_e, {
|
|
2007
|
+
style: [Y.input, {
|
|
2008
|
+
backgroundColor: j.muted,
|
|
2009
|
+
borderColor: j.border,
|
|
2010
|
+
color: j.textMuted
|
|
2011
|
+
}],
|
|
2012
|
+
value: typeof x == "string" ? x : JSON.stringify(x),
|
|
2013
|
+
editable: !1
|
|
2014
|
+
}),
|
|
2015
|
+
E && /* @__PURE__ */ L(B, {
|
|
2016
|
+
style: [Y.error, { color: j.error }],
|
|
2017
|
+
children: E
|
|
2018
|
+
}),
|
|
2019
|
+
O && !E && /* @__PURE__ */ L(B, {
|
|
2020
|
+
style: [Y.helperText, { color: j.textMuted }],
|
|
2021
|
+
children: O
|
|
2022
|
+
})
|
|
2023
|
+
]
|
|
2024
|
+
});
|
|
2025
|
+
}, Y = z.create({
|
|
2026
|
+
arrow: { fontSize: 12 },
|
|
2027
|
+
checkmark: {
|
|
2028
|
+
fontSize: 18,
|
|
2029
|
+
fontWeight: "700"
|
|
2030
|
+
},
|
|
2031
|
+
clearButton: {
|
|
2032
|
+
marginRight: 8,
|
|
2033
|
+
paddingHorizontal: 2
|
|
2034
|
+
},
|
|
2035
|
+
clearIcon: { fontSize: 14 },
|
|
2036
|
+
closeButton: {
|
|
2037
|
+
fontSize: 24,
|
|
2038
|
+
fontWeight: "300"
|
|
2039
|
+
},
|
|
2040
|
+
container: { marginBottom: 16 },
|
|
2041
|
+
disabledMessage: {
|
|
2042
|
+
fontSize: 12,
|
|
2043
|
+
marginTop: 4
|
|
2044
|
+
},
|
|
2045
|
+
emptyContainer: {
|
|
2046
|
+
alignItems: "center",
|
|
2047
|
+
paddingVertical: 24
|
|
2048
|
+
},
|
|
2049
|
+
emptyText: { fontSize: 14 },
|
|
2050
|
+
error: {
|
|
2051
|
+
fontSize: 12,
|
|
2052
|
+
marginTop: 4
|
|
2053
|
+
},
|
|
2054
|
+
errorContainer: {
|
|
2055
|
+
alignItems: "center",
|
|
2056
|
+
paddingVertical: 16
|
|
2057
|
+
},
|
|
2058
|
+
errorText: {
|
|
2059
|
+
fontSize: 14,
|
|
2060
|
+
textAlign: "center"
|
|
2061
|
+
},
|
|
2062
|
+
helperText: {
|
|
2063
|
+
fontSize: 12,
|
|
2064
|
+
marginTop: 4
|
|
2065
|
+
},
|
|
2066
|
+
input: {
|
|
2067
|
+
borderRadius: 6,
|
|
2068
|
+
borderWidth: 1,
|
|
2069
|
+
fontSize: 14,
|
|
2070
|
+
paddingHorizontal: 12,
|
|
2071
|
+
paddingVertical: 10
|
|
2072
|
+
},
|
|
2073
|
+
loadingContainer: {
|
|
2074
|
+
alignItems: "center",
|
|
2075
|
+
paddingVertical: 24
|
|
2076
|
+
},
|
|
2077
|
+
modalContent: {
|
|
2078
|
+
borderRadius: 12,
|
|
2079
|
+
maxHeight: "80%",
|
|
2080
|
+
padding: 16,
|
|
2081
|
+
width: "90%"
|
|
2082
|
+
},
|
|
2083
|
+
modalHeader: {
|
|
2084
|
+
alignItems: "center",
|
|
2085
|
+
borderBottomWidth: 1,
|
|
2086
|
+
flexDirection: "row",
|
|
2087
|
+
justifyContent: "space-between",
|
|
2088
|
+
marginBottom: 12,
|
|
2089
|
+
paddingBottom: 12
|
|
2090
|
+
},
|
|
2091
|
+
modalOverlay: {
|
|
2092
|
+
alignItems: "center",
|
|
2093
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
2094
|
+
flex: 1,
|
|
2095
|
+
justifyContent: "center"
|
|
2096
|
+
},
|
|
2097
|
+
modalTitle: {
|
|
2098
|
+
fontSize: 18,
|
|
2099
|
+
fontWeight: "600"
|
|
2100
|
+
},
|
|
2101
|
+
option: {
|
|
2102
|
+
alignItems: "center",
|
|
2103
|
+
borderRadius: 6,
|
|
2104
|
+
flexDirection: "row",
|
|
2105
|
+
justifyContent: "space-between",
|
|
2106
|
+
paddingHorizontal: 12,
|
|
2107
|
+
paddingVertical: 12
|
|
2108
|
+
},
|
|
2109
|
+
optionsList: {
|
|
2110
|
+
flexGrow: 0,
|
|
2111
|
+
flexShrink: 1
|
|
2112
|
+
},
|
|
2113
|
+
optionsListContent: { flexGrow: 0 },
|
|
2114
|
+
retryButton: { marginTop: 12 },
|
|
2115
|
+
retryButtonText: {
|
|
2116
|
+
fontSize: 14,
|
|
2117
|
+
textDecorationLine: "underline"
|
|
2118
|
+
},
|
|
2119
|
+
searchContainer: { marginBottom: 12 },
|
|
2120
|
+
searchInput: {
|
|
2121
|
+
borderRadius: 6,
|
|
2122
|
+
borderWidth: 1,
|
|
2123
|
+
fontSize: 14,
|
|
2124
|
+
paddingHorizontal: 12,
|
|
2125
|
+
paddingVertical: 10
|
|
2126
|
+
},
|
|
2127
|
+
trigger: {
|
|
2128
|
+
alignItems: "center",
|
|
2129
|
+
borderRadius: 6,
|
|
2130
|
+
borderWidth: 1,
|
|
2131
|
+
flexDirection: "row",
|
|
2132
|
+
justifyContent: "space-between",
|
|
2133
|
+
paddingHorizontal: 12,
|
|
2134
|
+
paddingVertical: 10
|
|
2135
|
+
},
|
|
2136
|
+
triggerLoader: { marginRight: 8 },
|
|
2137
|
+
triggerText: {
|
|
2138
|
+
flex: 1,
|
|
2139
|
+
fontSize: 14
|
|
2140
|
+
}
|
|
2141
|
+
}), ze = ({ field: e, extra: t }) => {
|
|
2142
|
+
let { value: n, placeholder: r, name: i } = e, [a, o] = F(n?.toString() ?? ""), { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f } = t, { colors: p } = b();
|
|
2143
|
+
return N(() => {
|
|
2144
|
+
o(n?.toString() ?? "");
|
|
2145
|
+
}, [n]), /* @__PURE__ */ R(H, {
|
|
2146
|
+
style: Be.container,
|
|
2147
|
+
children: [
|
|
2148
|
+
/* @__PURE__ */ L(s, {
|
|
2149
|
+
label: d,
|
|
2150
|
+
required: c.data.required
|
|
2151
|
+
}),
|
|
2152
|
+
/* @__PURE__ */ L(_e, {
|
|
2153
|
+
style: [
|
|
2154
|
+
Be.input,
|
|
2155
|
+
{
|
|
2156
|
+
backgroundColor: p.input,
|
|
2157
|
+
borderColor: p.border,
|
|
2158
|
+
color: p.text
|
|
2159
|
+
},
|
|
2160
|
+
u && { borderColor: p.error }
|
|
2161
|
+
],
|
|
2162
|
+
value: a,
|
|
2163
|
+
onChangeText: (e) => {
|
|
2164
|
+
if (o(e), e.trim() === "") {
|
|
2165
|
+
l(null);
|
|
2166
|
+
return;
|
|
2167
|
+
}
|
|
2168
|
+
let t = Number(e);
|
|
2169
|
+
Number.isNaN(t) || l(t);
|
|
2170
|
+
},
|
|
2171
|
+
placeholder: r,
|
|
2172
|
+
placeholderTextColor: p.textMuted,
|
|
2173
|
+
keyboardType: "numeric",
|
|
2174
|
+
accessibilityLabel: i
|
|
2175
|
+
}),
|
|
2176
|
+
u && /* @__PURE__ */ L(B, {
|
|
2177
|
+
style: [Be.error, { color: p.error }],
|
|
2178
|
+
children: u
|
|
2179
|
+
}),
|
|
2180
|
+
f && !u && /* @__PURE__ */ L(B, {
|
|
2181
|
+
style: [Be.helperText, { color: p.textMuted }],
|
|
2182
|
+
children: f
|
|
2183
|
+
})
|
|
2184
|
+
]
|
|
2185
|
+
});
|
|
2186
|
+
}, Be = z.create({
|
|
2187
|
+
container: { marginBottom: 16 },
|
|
2188
|
+
error: {
|
|
2189
|
+
fontSize: 12,
|
|
2190
|
+
marginTop: 4
|
|
2191
|
+
},
|
|
2192
|
+
helperText: {
|
|
2193
|
+
fontSize: 12,
|
|
2194
|
+
marginTop: 4
|
|
2195
|
+
},
|
|
2196
|
+
input: {
|
|
2197
|
+
borderRadius: 6,
|
|
2198
|
+
borderWidth: 1,
|
|
2199
|
+
fontSize: 14,
|
|
2200
|
+
paddingHorizontal: 12,
|
|
2201
|
+
paddingVertical: 8
|
|
2202
|
+
}
|
|
2203
|
+
}), Ve = ({ field: e, extra: t }) => {
|
|
2204
|
+
let [n, r] = F(!1), { value: i, placeholder: a, name: o } = e, { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f } = t, { colors: p } = b();
|
|
2205
|
+
return /* @__PURE__ */ R(H, {
|
|
2206
|
+
style: He.container,
|
|
2207
|
+
children: [
|
|
2208
|
+
/* @__PURE__ */ L(s, {
|
|
2209
|
+
label: d,
|
|
2210
|
+
required: c.data.required
|
|
2211
|
+
}),
|
|
2212
|
+
/* @__PURE__ */ R(H, {
|
|
2213
|
+
style: He.inputWrapper,
|
|
2214
|
+
children: [/* @__PURE__ */ L(_e, {
|
|
2215
|
+
style: [
|
|
2216
|
+
He.input,
|
|
2217
|
+
{
|
|
2218
|
+
backgroundColor: p.input,
|
|
2219
|
+
borderColor: p.border,
|
|
2220
|
+
color: p.text
|
|
2221
|
+
},
|
|
2222
|
+
u && { borderColor: p.error }
|
|
2223
|
+
],
|
|
2224
|
+
value: i ?? "",
|
|
2225
|
+
onChangeText: l,
|
|
2226
|
+
placeholder: a,
|
|
2227
|
+
placeholderTextColor: p.textMuted,
|
|
2228
|
+
secureTextEntry: !n,
|
|
2229
|
+
accessibilityLabel: o
|
|
2230
|
+
}), /* @__PURE__ */ L(V, {
|
|
2231
|
+
style: He.toggleButton,
|
|
2232
|
+
onPress: () => r(!n),
|
|
2233
|
+
activeOpacity: .7,
|
|
2234
|
+
children: /* @__PURE__ */ L(B, {
|
|
2235
|
+
style: [He.toggleText, { color: p.primary }],
|
|
2236
|
+
children: n ? "Hide" : "Show"
|
|
2237
|
+
})
|
|
2238
|
+
})]
|
|
2239
|
+
}),
|
|
2240
|
+
u && /* @__PURE__ */ L(B, {
|
|
2241
|
+
style: [He.error, { color: p.error }],
|
|
2242
|
+
children: u
|
|
2243
|
+
}),
|
|
2244
|
+
f && !u && /* @__PURE__ */ L(B, {
|
|
2245
|
+
style: [He.helperText, { color: p.textMuted }],
|
|
2246
|
+
children: f
|
|
2247
|
+
})
|
|
2248
|
+
]
|
|
2249
|
+
});
|
|
2250
|
+
}, He = z.create({
|
|
2251
|
+
container: { marginBottom: 16 },
|
|
2252
|
+
error: {
|
|
2253
|
+
fontSize: 12,
|
|
2254
|
+
marginTop: 4
|
|
2255
|
+
},
|
|
2256
|
+
helperText: {
|
|
2257
|
+
fontSize: 12,
|
|
2258
|
+
marginTop: 4
|
|
2259
|
+
},
|
|
2260
|
+
input: {
|
|
2261
|
+
borderRadius: 6,
|
|
2262
|
+
borderWidth: 1,
|
|
2263
|
+
flex: 1,
|
|
2264
|
+
fontSize: 14,
|
|
2265
|
+
paddingHorizontal: 12,
|
|
2266
|
+
paddingVertical: 8
|
|
2267
|
+
},
|
|
2268
|
+
inputWrapper: {
|
|
2269
|
+
alignItems: "center",
|
|
2270
|
+
flexDirection: "row",
|
|
2271
|
+
position: "relative"
|
|
2272
|
+
},
|
|
2273
|
+
toggleButton: {
|
|
2274
|
+
paddingHorizontal: 12,
|
|
2275
|
+
paddingVertical: 8,
|
|
2276
|
+
position: "absolute",
|
|
2277
|
+
right: 0
|
|
2278
|
+
},
|
|
2279
|
+
toggleText: {
|
|
2280
|
+
fontSize: 12,
|
|
2281
|
+
fontWeight: "600"
|
|
2282
|
+
}
|
|
2283
|
+
}), Ue = ({ field: e, extra: t }) => {
|
|
2284
|
+
let { value: r } = e, { InputLabel: i, node: a, setValue: o, error: s, label: c, helperText: l } = t, { colors: u } = b(), d = n(), f = a.data.options || [], p = r || "", m = a.data.variant !== "default", h = (e) => {
|
|
2285
|
+
o(e);
|
|
2286
|
+
};
|
|
2287
|
+
return /* @__PURE__ */ R(H, {
|
|
2288
|
+
style: X.container,
|
|
2289
|
+
children: [
|
|
2290
|
+
/* @__PURE__ */ L(i, {
|
|
2291
|
+
label: c,
|
|
2292
|
+
required: a.data.required
|
|
2293
|
+
}),
|
|
2294
|
+
f.map((e) => {
|
|
2295
|
+
let t = p === e.value, n = d(e.label) || e.value, r = d(e.description);
|
|
2296
|
+
return m ? /* @__PURE__ */ R(V, {
|
|
2297
|
+
style: [
|
|
2298
|
+
X.card,
|
|
2299
|
+
{
|
|
2300
|
+
backgroundColor: u.input,
|
|
2301
|
+
borderColor: u.border
|
|
2302
|
+
},
|
|
2303
|
+
t && {
|
|
2304
|
+
backgroundColor: `${u.primary}10`,
|
|
2305
|
+
borderColor: u.primary
|
|
2306
|
+
},
|
|
2307
|
+
e.disabled && { opacity: .5 }
|
|
2308
|
+
],
|
|
2309
|
+
onPress: () => h(e.value),
|
|
2310
|
+
disabled: e.disabled,
|
|
2311
|
+
activeOpacity: .7,
|
|
2312
|
+
children: [
|
|
2313
|
+
e.image && /* @__PURE__ */ L(pe, {
|
|
2314
|
+
source: { uri: e.image },
|
|
2315
|
+
style: X.cardImage
|
|
2316
|
+
}),
|
|
2317
|
+
/* @__PURE__ */ R(H, {
|
|
2318
|
+
style: X.cardTextContainer,
|
|
2319
|
+
children: [/* @__PURE__ */ L(B, {
|
|
2320
|
+
style: [X.cardLabel, { color: u.textSecondary }],
|
|
2321
|
+
children: n
|
|
2322
|
+
}), r && /* @__PURE__ */ L(B, {
|
|
2323
|
+
style: [X.cardDescription, { color: u.textMuted }],
|
|
2324
|
+
children: r
|
|
2325
|
+
})]
|
|
2326
|
+
}),
|
|
2327
|
+
/* @__PURE__ */ L(H, {
|
|
2328
|
+
style: [
|
|
2329
|
+
X.radio,
|
|
2330
|
+
X.cardRadio,
|
|
2331
|
+
{
|
|
2332
|
+
backgroundColor: u.input,
|
|
2333
|
+
borderColor: u.border
|
|
2334
|
+
},
|
|
2335
|
+
t && { borderColor: u.primary }
|
|
2336
|
+
],
|
|
2337
|
+
children: t && /* @__PURE__ */ L(H, { style: [X.radioInner, { backgroundColor: u.primary }] })
|
|
2338
|
+
})
|
|
2339
|
+
]
|
|
2340
|
+
}, e.value) : /* @__PURE__ */ R(V, {
|
|
2341
|
+
style: X.option,
|
|
2342
|
+
onPress: () => h(e.value),
|
|
2343
|
+
disabled: e.disabled,
|
|
2344
|
+
activeOpacity: .7,
|
|
2345
|
+
children: [
|
|
2346
|
+
/* @__PURE__ */ L(H, {
|
|
2347
|
+
style: [
|
|
2348
|
+
X.radio,
|
|
2349
|
+
{
|
|
2350
|
+
backgroundColor: u.input,
|
|
2351
|
+
borderColor: u.border
|
|
2352
|
+
},
|
|
2353
|
+
t && { borderColor: u.primary }
|
|
2354
|
+
],
|
|
2355
|
+
children: t && /* @__PURE__ */ L(H, { style: [X.radioInner, { backgroundColor: u.primary }] })
|
|
2356
|
+
}),
|
|
2357
|
+
e.image && /* @__PURE__ */ L(pe, {
|
|
2358
|
+
source: { uri: e.image },
|
|
2359
|
+
style: X.image
|
|
2360
|
+
}),
|
|
2361
|
+
/* @__PURE__ */ R(H, {
|
|
2362
|
+
style: X.optionTextContainer,
|
|
2363
|
+
children: [/* @__PURE__ */ L(B, {
|
|
2364
|
+
style: [
|
|
2365
|
+
X.optionLabel,
|
|
2366
|
+
{ color: u.textSecondary },
|
|
2367
|
+
e.disabled && { color: u.textMuted }
|
|
2368
|
+
],
|
|
2369
|
+
children: n
|
|
2370
|
+
}), r && /* @__PURE__ */ L(B, {
|
|
2371
|
+
style: [X.optionDescription, { color: u.textMuted }],
|
|
2372
|
+
children: r
|
|
2373
|
+
})]
|
|
2374
|
+
})
|
|
2375
|
+
]
|
|
2376
|
+
}, e.value);
|
|
2377
|
+
}),
|
|
2378
|
+
s && /* @__PURE__ */ L(B, {
|
|
2379
|
+
style: [X.error, { color: u.error }],
|
|
2380
|
+
children: s
|
|
2381
|
+
}),
|
|
2382
|
+
l && !s && /* @__PURE__ */ L(B, {
|
|
2383
|
+
style: [X.helperText, { color: u.textMuted }],
|
|
2384
|
+
children: l
|
|
2385
|
+
})
|
|
2386
|
+
]
|
|
2387
|
+
});
|
|
2388
|
+
}, X = z.create({
|
|
2389
|
+
card: {
|
|
2390
|
+
alignItems: "center",
|
|
2391
|
+
borderRadius: 8,
|
|
2392
|
+
borderWidth: 1,
|
|
2393
|
+
flexDirection: "row",
|
|
2394
|
+
marginBottom: 8,
|
|
2395
|
+
padding: 16
|
|
2396
|
+
},
|
|
2397
|
+
cardDescription: {
|
|
2398
|
+
fontSize: 12,
|
|
2399
|
+
marginTop: 4
|
|
2400
|
+
},
|
|
2401
|
+
cardImage: {
|
|
2402
|
+
borderRadius: 4,
|
|
2403
|
+
height: 40,
|
|
2404
|
+
marginRight: 12,
|
|
2405
|
+
width: 40
|
|
2406
|
+
},
|
|
2407
|
+
cardLabel: {
|
|
2408
|
+
fontSize: 14,
|
|
2409
|
+
fontWeight: "500"
|
|
2410
|
+
},
|
|
2411
|
+
cardRadio: {
|
|
2412
|
+
marginLeft: 12,
|
|
2413
|
+
marginRight: 0
|
|
2414
|
+
},
|
|
2415
|
+
cardTextContainer: { flex: 1 },
|
|
2416
|
+
container: { marginBottom: 16 },
|
|
2417
|
+
error: {
|
|
2418
|
+
fontSize: 12,
|
|
2419
|
+
marginTop: 4
|
|
2420
|
+
},
|
|
2421
|
+
helperText: {
|
|
2422
|
+
fontSize: 12,
|
|
2423
|
+
marginTop: 4
|
|
2424
|
+
},
|
|
2425
|
+
image: {
|
|
2426
|
+
borderRadius: 4,
|
|
2427
|
+
height: 32,
|
|
2428
|
+
marginRight: 8,
|
|
2429
|
+
width: 32
|
|
2430
|
+
},
|
|
2431
|
+
option: {
|
|
2432
|
+
alignItems: "center",
|
|
2433
|
+
flexDirection: "row",
|
|
2434
|
+
marginBottom: 8
|
|
2435
|
+
},
|
|
2436
|
+
optionDescription: {
|
|
2437
|
+
fontSize: 12,
|
|
2438
|
+
marginTop: 2
|
|
2439
|
+
},
|
|
2440
|
+
optionLabel: { fontSize: 14 },
|
|
2441
|
+
optionTextContainer: { flex: 1 },
|
|
2442
|
+
radio: {
|
|
2443
|
+
alignItems: "center",
|
|
2444
|
+
borderRadius: 10,
|
|
2445
|
+
borderWidth: 2,
|
|
2446
|
+
height: 20,
|
|
2447
|
+
justifyContent: "center",
|
|
2448
|
+
marginRight: 12,
|
|
2449
|
+
width: 20
|
|
2450
|
+
},
|
|
2451
|
+
radioInner: {
|
|
2452
|
+
borderRadius: 5,
|
|
2453
|
+
height: 10,
|
|
2454
|
+
width: 10
|
|
2455
|
+
}
|
|
2456
|
+
}), We = ({ field: e, extra: t }) => {
|
|
2457
|
+
let [r, i] = F(!1), { value: a, placeholder: o } = e, { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f } = t, { colors: p } = b(), m = n(), h = c.data.options || [], g = c.data.multiple, _ = Array.isArray(a) ? a : a ? [a] : [], v = (e) => {
|
|
2458
|
+
g ? l(_.includes(e) ? _.filter((t) => t !== e) : [..._, e]) : (l(e), i(!1));
|
|
2459
|
+
};
|
|
2460
|
+
return /* @__PURE__ */ R(H, {
|
|
2461
|
+
style: Z.container,
|
|
2462
|
+
children: [
|
|
2463
|
+
/* @__PURE__ */ L(s, {
|
|
2464
|
+
label: d,
|
|
2465
|
+
required: c.data.required
|
|
2466
|
+
}),
|
|
2467
|
+
/* @__PURE__ */ R(V, {
|
|
2468
|
+
style: [
|
|
2469
|
+
Z.trigger,
|
|
2470
|
+
{
|
|
2471
|
+
backgroundColor: p.input,
|
|
2472
|
+
borderColor: p.border
|
|
2473
|
+
},
|
|
2474
|
+
u && { borderColor: p.error }
|
|
2475
|
+
],
|
|
2476
|
+
onPress: () => i(!0),
|
|
2477
|
+
activeOpacity: .7,
|
|
2478
|
+
children: [
|
|
2479
|
+
/* @__PURE__ */ L(B, {
|
|
2480
|
+
style: [
|
|
2481
|
+
Z.triggerText,
|
|
2482
|
+
{ color: p.text },
|
|
2483
|
+
_.length === 0 && { color: p.textMuted }
|
|
2484
|
+
],
|
|
2485
|
+
children: (() => {
|
|
2486
|
+
if (_.length === 0) return o || "Select...";
|
|
2487
|
+
if (g) return h.filter((e) => _.includes(e.value)).map((e) => m(e.label) || e.value).join(", ");
|
|
2488
|
+
let e = h.find((e) => e.value === _[0]);
|
|
2489
|
+
return e ? m(e.label) || e.value : o || "Select...";
|
|
2490
|
+
})()
|
|
2491
|
+
}),
|
|
2492
|
+
_.length > 0 && /* @__PURE__ */ L(V, {
|
|
2493
|
+
onPress: () => l(g ? [] : ""),
|
|
2494
|
+
hitSlop: {
|
|
2495
|
+
bottom: 8,
|
|
2496
|
+
left: 8,
|
|
2497
|
+
right: 8,
|
|
2498
|
+
top: 8
|
|
2499
|
+
},
|
|
2500
|
+
style: Z.clearButton,
|
|
2501
|
+
children: /* @__PURE__ */ L(B, {
|
|
2502
|
+
style: [Z.clearIcon, { color: p.textMuted }],
|
|
2503
|
+
children: "✕"
|
|
2504
|
+
})
|
|
2505
|
+
}),
|
|
2506
|
+
/* @__PURE__ */ L(B, {
|
|
2507
|
+
style: [Z.arrow, { color: p.textMuted }],
|
|
2508
|
+
children: "▼"
|
|
2509
|
+
})
|
|
2510
|
+
]
|
|
2511
|
+
}),
|
|
2512
|
+
/* @__PURE__ */ L(me, {
|
|
2513
|
+
visible: r,
|
|
2514
|
+
transparent: !0,
|
|
2515
|
+
animationType: "fade",
|
|
2516
|
+
onRequestClose: () => i(!1),
|
|
2517
|
+
children: /* @__PURE__ */ L(V, {
|
|
2518
|
+
style: Z.modalOverlay,
|
|
2519
|
+
activeOpacity: 1,
|
|
2520
|
+
onPress: () => i(!1),
|
|
2521
|
+
children: /* @__PURE__ */ R(H, {
|
|
2522
|
+
style: [Z.modalContent, { backgroundColor: p.card }],
|
|
2523
|
+
onStartShouldSetResponder: () => !0,
|
|
2524
|
+
children: [
|
|
2525
|
+
/* @__PURE__ */ R(H, {
|
|
2526
|
+
style: [Z.modalHeader, { borderBottomColor: p.border }],
|
|
2527
|
+
children: [/* @__PURE__ */ L(B, {
|
|
2528
|
+
style: [Z.modalTitle, { color: p.text }],
|
|
2529
|
+
children: d || o || m("renderer.defaultSelectInput.selectOption")
|
|
2530
|
+
}), /* @__PURE__ */ L(V, {
|
|
2531
|
+
onPress: () => i(!1),
|
|
2532
|
+
children: /* @__PURE__ */ L(B, {
|
|
2533
|
+
style: [Z.closeButton, { color: p.textMuted }],
|
|
2534
|
+
children: "✕"
|
|
2535
|
+
})
|
|
2536
|
+
})]
|
|
2537
|
+
}),
|
|
2538
|
+
/* @__PURE__ */ L(he, {
|
|
2539
|
+
style: Z.optionsList,
|
|
2540
|
+
children: h.map((e) => {
|
|
2541
|
+
let t = _.includes(e.value);
|
|
2542
|
+
return /* @__PURE__ */ R(V, {
|
|
2543
|
+
style: [Z.option, t && { backgroundColor: `${p.primary}20` }],
|
|
2544
|
+
onPress: () => v(e.value),
|
|
2545
|
+
disabled: e.disabled,
|
|
2546
|
+
activeOpacity: .7,
|
|
2547
|
+
children: [/* @__PURE__ */ L(Te, {
|
|
2548
|
+
label: m(e.label) || e.value,
|
|
2549
|
+
description: m(e.description),
|
|
2550
|
+
image: e.image,
|
|
2551
|
+
disabled: e.disabled
|
|
2552
|
+
}), t && /* @__PURE__ */ L(B, {
|
|
2553
|
+
style: [Z.checkmark, { color: p.primary }],
|
|
2554
|
+
children: "✓"
|
|
2555
|
+
})]
|
|
2556
|
+
}, e.value);
|
|
2557
|
+
})
|
|
2558
|
+
}),
|
|
2559
|
+
g && /* @__PURE__ */ L(V, {
|
|
2560
|
+
style: [Z.doneButton, { backgroundColor: p.primary }],
|
|
2561
|
+
onPress: () => i(!1),
|
|
2562
|
+
children: /* @__PURE__ */ L(B, {
|
|
2563
|
+
style: Z.doneButtonText,
|
|
2564
|
+
children: "Done"
|
|
2565
|
+
})
|
|
2566
|
+
})
|
|
2567
|
+
]
|
|
2568
|
+
})
|
|
2569
|
+
})
|
|
2570
|
+
}),
|
|
2571
|
+
u && /* @__PURE__ */ L(B, {
|
|
2572
|
+
style: [Z.error, { color: p.error }],
|
|
2573
|
+
children: u
|
|
2574
|
+
}),
|
|
2575
|
+
f && !u && /* @__PURE__ */ L(B, {
|
|
2576
|
+
style: [Z.helperText, { color: p.textMuted }],
|
|
2577
|
+
children: f
|
|
2578
|
+
})
|
|
2579
|
+
]
|
|
2580
|
+
});
|
|
2581
|
+
}, Z = z.create({
|
|
2582
|
+
arrow: { fontSize: 12 },
|
|
2583
|
+
checkmark: {
|
|
2584
|
+
fontSize: 18,
|
|
2585
|
+
fontWeight: "700"
|
|
2586
|
+
},
|
|
2587
|
+
clearButton: {
|
|
2588
|
+
marginRight: 8,
|
|
2589
|
+
paddingHorizontal: 2
|
|
2590
|
+
},
|
|
2591
|
+
clearIcon: { fontSize: 14 },
|
|
2592
|
+
closeButton: {
|
|
2593
|
+
fontSize: 24,
|
|
2594
|
+
fontWeight: "300"
|
|
2595
|
+
},
|
|
2596
|
+
container: { marginBottom: 16 },
|
|
2597
|
+
doneButton: {
|
|
2598
|
+
alignItems: "center",
|
|
2599
|
+
borderRadius: 6,
|
|
2600
|
+
marginTop: 12,
|
|
2601
|
+
paddingVertical: 12
|
|
2602
|
+
},
|
|
2603
|
+
doneButtonText: {
|
|
2604
|
+
color: "#FFFFFF",
|
|
2605
|
+
fontSize: 16,
|
|
2606
|
+
fontWeight: "600"
|
|
2607
|
+
},
|
|
2608
|
+
error: {
|
|
2609
|
+
fontSize: 12,
|
|
2610
|
+
marginTop: 4
|
|
2611
|
+
},
|
|
2612
|
+
helperText: {
|
|
2613
|
+
fontSize: 12,
|
|
2614
|
+
marginTop: 4
|
|
2615
|
+
},
|
|
2616
|
+
modalContent: {
|
|
2617
|
+
borderRadius: 12,
|
|
2618
|
+
maxHeight: "80%",
|
|
2619
|
+
padding: 16,
|
|
2620
|
+
width: "90%"
|
|
2621
|
+
},
|
|
2622
|
+
modalHeader: {
|
|
2623
|
+
alignItems: "center",
|
|
2624
|
+
borderBottomWidth: 1,
|
|
2625
|
+
flexDirection: "row",
|
|
2626
|
+
justifyContent: "space-between",
|
|
2627
|
+
marginBottom: 12,
|
|
2628
|
+
paddingBottom: 12
|
|
2629
|
+
},
|
|
2630
|
+
modalOverlay: {
|
|
2631
|
+
alignItems: "center",
|
|
2632
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
2633
|
+
flex: 1,
|
|
2634
|
+
justifyContent: "center"
|
|
2635
|
+
},
|
|
2636
|
+
modalTitle: {
|
|
2637
|
+
fontSize: 18,
|
|
2638
|
+
fontWeight: "600"
|
|
2639
|
+
},
|
|
2640
|
+
option: {
|
|
2641
|
+
alignItems: "center",
|
|
2642
|
+
borderRadius: 6,
|
|
2643
|
+
flexDirection: "row",
|
|
2644
|
+
justifyContent: "space-between",
|
|
2645
|
+
paddingHorizontal: 12,
|
|
2646
|
+
paddingVertical: 12
|
|
2647
|
+
},
|
|
2648
|
+
optionsList: { maxHeight: 300 },
|
|
2649
|
+
trigger: {
|
|
2650
|
+
alignItems: "center",
|
|
2651
|
+
borderRadius: 6,
|
|
2652
|
+
borderWidth: 1,
|
|
2653
|
+
flexDirection: "row",
|
|
2654
|
+
justifyContent: "space-between",
|
|
2655
|
+
paddingHorizontal: 12,
|
|
2656
|
+
paddingVertical: 10
|
|
2657
|
+
},
|
|
2658
|
+
triggerText: {
|
|
2659
|
+
flex: 1,
|
|
2660
|
+
fontSize: 14
|
|
2661
|
+
}
|
|
2662
|
+
}), Ge = (e) => null, Ke = ({ field: e, extra: t }) => {
|
|
2663
|
+
let { value: n } = e, { InputLabel: r, node: i, setValue: a, error: o, label: s, helperText: c } = t, { colors: l } = b(), u = !!n;
|
|
2664
|
+
return /* @__PURE__ */ R(H, {
|
|
2665
|
+
style: qe.container,
|
|
2666
|
+
children: [
|
|
2667
|
+
/* @__PURE__ */ R(H, {
|
|
2668
|
+
style: qe.row,
|
|
2669
|
+
children: [/* @__PURE__ */ L(H, {
|
|
2670
|
+
style: qe.labelContainer,
|
|
2671
|
+
children: /* @__PURE__ */ L(r, {
|
|
2672
|
+
label: s,
|
|
2673
|
+
required: i.data.required
|
|
2674
|
+
})
|
|
2675
|
+
}), /* @__PURE__ */ L(ge, {
|
|
2676
|
+
trackColor: {
|
|
2677
|
+
false: l.border,
|
|
2678
|
+
true: `${l.primary}80`
|
|
2679
|
+
},
|
|
2680
|
+
thumbColor: u ? l.primary : l.card,
|
|
2681
|
+
ios_backgroundColor: l.border,
|
|
2682
|
+
onValueChange: a,
|
|
2683
|
+
value: u
|
|
2684
|
+
})]
|
|
2685
|
+
}),
|
|
2686
|
+
o && /* @__PURE__ */ L(B, {
|
|
2687
|
+
style: [qe.error, { color: l.error }],
|
|
2688
|
+
children: o
|
|
2689
|
+
}),
|
|
2690
|
+
c && !o && /* @__PURE__ */ L(B, {
|
|
2691
|
+
style: [qe.helperText, { color: l.textMuted }],
|
|
2692
|
+
children: c
|
|
2693
|
+
})
|
|
2694
|
+
]
|
|
2695
|
+
});
|
|
2696
|
+
}, qe = z.create({
|
|
2697
|
+
container: { marginBottom: 16 },
|
|
2698
|
+
error: {
|
|
2699
|
+
fontSize: 12,
|
|
2700
|
+
marginTop: 4
|
|
2701
|
+
},
|
|
2702
|
+
helperText: {
|
|
2703
|
+
fontSize: 12,
|
|
2704
|
+
marginTop: 4
|
|
2705
|
+
},
|
|
2706
|
+
labelContainer: { flex: 1 },
|
|
2707
|
+
row: {
|
|
2708
|
+
alignItems: "center",
|
|
2709
|
+
flexDirection: "row",
|
|
2710
|
+
justifyContent: "space-between"
|
|
2711
|
+
}
|
|
2712
|
+
}), Je = ({ field: e, extra: t }) => {
|
|
2713
|
+
let { value: n, placeholder: r, name: i } = e, { InputLabel: a, node: o, setValue: s, error: c, label: l, helperText: u } = t, { colors: d } = b();
|
|
2714
|
+
return /* @__PURE__ */ R(H, {
|
|
2715
|
+
style: Ye.container,
|
|
2716
|
+
children: [
|
|
2717
|
+
/* @__PURE__ */ L(a, {
|
|
2718
|
+
label: l,
|
|
2719
|
+
required: o.data.required
|
|
2720
|
+
}),
|
|
2721
|
+
/* @__PURE__ */ L(_e, {
|
|
2722
|
+
style: [
|
|
2723
|
+
Ye.textarea,
|
|
2724
|
+
{
|
|
2725
|
+
backgroundColor: d.input,
|
|
2726
|
+
borderColor: d.border,
|
|
2727
|
+
color: d.text
|
|
2728
|
+
},
|
|
2729
|
+
c && { borderColor: d.error }
|
|
2730
|
+
],
|
|
2731
|
+
value: n ?? "",
|
|
2732
|
+
onChangeText: s,
|
|
2733
|
+
placeholder: r,
|
|
2734
|
+
placeholderTextColor: d.textMuted,
|
|
2735
|
+
multiline: !0,
|
|
2736
|
+
numberOfLines: 4,
|
|
2737
|
+
textAlignVertical: "top",
|
|
2738
|
+
accessibilityLabel: i
|
|
2739
|
+
}),
|
|
2740
|
+
c && /* @__PURE__ */ L(B, {
|
|
2741
|
+
style: [Ye.error, { color: d.error }],
|
|
2742
|
+
children: c
|
|
2743
|
+
}),
|
|
2744
|
+
u && !c && /* @__PURE__ */ L(B, {
|
|
2745
|
+
style: [Ye.helperText, { color: d.textMuted }],
|
|
2746
|
+
children: u
|
|
2747
|
+
})
|
|
2748
|
+
]
|
|
2749
|
+
});
|
|
2750
|
+
}, Ye = z.create({
|
|
2751
|
+
container: { marginBottom: 16 },
|
|
2752
|
+
error: {
|
|
2753
|
+
fontSize: 12,
|
|
2754
|
+
marginTop: 4
|
|
2755
|
+
},
|
|
2756
|
+
helperText: {
|
|
2757
|
+
fontSize: 12,
|
|
2758
|
+
marginTop: 4
|
|
2759
|
+
},
|
|
2760
|
+
textarea: {
|
|
2761
|
+
borderRadius: 6,
|
|
2762
|
+
borderWidth: 1,
|
|
2763
|
+
fontSize: 14,
|
|
2764
|
+
minHeight: 100,
|
|
2765
|
+
paddingHorizontal: 12,
|
|
2766
|
+
paddingVertical: 8
|
|
2767
|
+
}
|
|
2768
|
+
}), Xe = ({ field: e, extra: t }) => {
|
|
2769
|
+
let { value: n, placeholder: r, name: i } = e, { InputLabel: a, node: o, setValue: s, error: c, label: l, helperText: u } = t, { colors: d } = b();
|
|
2770
|
+
return /* @__PURE__ */ R(H, {
|
|
2771
|
+
style: Ze.container,
|
|
2772
|
+
children: [
|
|
2773
|
+
/* @__PURE__ */ L(a, {
|
|
2774
|
+
label: l,
|
|
2775
|
+
required: o.data.required
|
|
2776
|
+
}),
|
|
2777
|
+
/* @__PURE__ */ L(_e, {
|
|
2778
|
+
style: [
|
|
2779
|
+
Ze.input,
|
|
2780
|
+
{
|
|
2781
|
+
backgroundColor: d.input,
|
|
2782
|
+
borderColor: d.border,
|
|
2783
|
+
color: d.text
|
|
2784
|
+
},
|
|
2785
|
+
c && { borderColor: d.error }
|
|
2786
|
+
],
|
|
2787
|
+
value: n ?? "",
|
|
2788
|
+
onChangeText: s,
|
|
2789
|
+
placeholder: r,
|
|
2790
|
+
placeholderTextColor: d.textMuted,
|
|
2791
|
+
accessibilityLabel: i
|
|
2792
|
+
}),
|
|
2793
|
+
c && /* @__PURE__ */ L(B, {
|
|
2794
|
+
style: [Ze.error, { color: d.error }],
|
|
2795
|
+
children: c
|
|
2796
|
+
}),
|
|
2797
|
+
u && !c && /* @__PURE__ */ L(B, {
|
|
2798
|
+
style: [Ze.helperText, { color: d.textMuted }],
|
|
2799
|
+
children: u
|
|
2800
|
+
})
|
|
2801
|
+
]
|
|
2802
|
+
});
|
|
2803
|
+
}, Ze = z.create({
|
|
2804
|
+
container: { marginBottom: 16 },
|
|
2805
|
+
error: {
|
|
2806
|
+
fontSize: 12,
|
|
2807
|
+
marginTop: 4
|
|
2808
|
+
},
|
|
2809
|
+
helperText: {
|
|
2810
|
+
fontSize: 12,
|
|
2811
|
+
marginTop: 4
|
|
2812
|
+
},
|
|
2813
|
+
input: {
|
|
2814
|
+
borderRadius: 6,
|
|
2815
|
+
borderWidth: 1,
|
|
2816
|
+
fontSize: 14,
|
|
2817
|
+
paddingHorizontal: 12,
|
|
2818
|
+
paddingVertical: 8
|
|
2819
|
+
}
|
|
2820
|
+
}), Qe = ({ field: e, extra: t }) => {
|
|
2821
|
+
let { value: r, placeholder: i } = e, a = (r || "").split(":"), o = Number.parseInt(a[0], 10), s = Number.parseInt(a[1], 10), c = Number.isNaN(o) ? 0 : o, l = Number.isNaN(s) ? 0 : s, [u, d] = F(c || 0), [f, p] = F(l || 0), [m, h] = F(!1), { InputLabel: g, node: _, setValue: v, error: y, label: x, helperText: S } = t, { colors: C } = b(), ee = n(), w = P(null), T = P(null), te = Array.from({ length: 24 }, (e, t) => t), ne = Array.from({ length: 60 }, (e, t) => t), E = () => r || i || ee("renderer.defaultInputs.selectTime"), re = se(() => {
|
|
2822
|
+
v(`${String(u).padStart(2, "0")}:${String(f).padStart(2, "0")}`), h(!1);
|
|
2823
|
+
}, [
|
|
2824
|
+
u,
|
|
2825
|
+
f,
|
|
2826
|
+
v
|
|
2827
|
+
]);
|
|
2828
|
+
return /* @__PURE__ */ R(H, {
|
|
2829
|
+
style: Q.container,
|
|
2830
|
+
children: [
|
|
2831
|
+
/* @__PURE__ */ L(g, {
|
|
2832
|
+
label: x,
|
|
2833
|
+
required: _.data.required
|
|
2834
|
+
}),
|
|
2835
|
+
/* @__PURE__ */ R(V, {
|
|
2836
|
+
style: [
|
|
2837
|
+
Q.trigger,
|
|
2838
|
+
{
|
|
2839
|
+
backgroundColor: C.input,
|
|
2840
|
+
borderColor: C.border
|
|
2841
|
+
},
|
|
2842
|
+
y && { borderColor: C.error }
|
|
2843
|
+
],
|
|
2844
|
+
onPress: () => {
|
|
2845
|
+
d(c || 0), p(l || 0), h(!0);
|
|
2846
|
+
},
|
|
2847
|
+
activeOpacity: .7,
|
|
2848
|
+
children: [/* @__PURE__ */ L(B, {
|
|
2849
|
+
style: [
|
|
2850
|
+
Q.triggerText,
|
|
2851
|
+
{ color: C.text },
|
|
2852
|
+
!r && { color: C.textMuted }
|
|
2853
|
+
],
|
|
2854
|
+
numberOfLines: 1,
|
|
2855
|
+
children: E()
|
|
2856
|
+
}), /* @__PURE__ */ L(B, {
|
|
2857
|
+
style: Q.icon,
|
|
2858
|
+
children: "🕐"
|
|
2859
|
+
})]
|
|
2860
|
+
}),
|
|
2861
|
+
/* @__PURE__ */ L(me, {
|
|
2862
|
+
visible: m,
|
|
2863
|
+
transparent: !0,
|
|
2864
|
+
animationType: "fade",
|
|
2865
|
+
onRequestClose: () => h(!1),
|
|
2866
|
+
children: /* @__PURE__ */ L(V, {
|
|
2867
|
+
style: Q.modalOverlay,
|
|
2868
|
+
activeOpacity: 1,
|
|
2869
|
+
onPress: () => h(!1),
|
|
2870
|
+
children: /* @__PURE__ */ R(V, {
|
|
2871
|
+
style: [Q.modalContent, { backgroundColor: C.card }],
|
|
2872
|
+
activeOpacity: 1,
|
|
2873
|
+
onPress: () => {},
|
|
2874
|
+
children: [
|
|
2875
|
+
/* @__PURE__ */ R(H, {
|
|
2876
|
+
style: [Q.modalHeader, { borderBottomColor: C.separator }],
|
|
2877
|
+
children: [/* @__PURE__ */ L(B, {
|
|
2878
|
+
style: [Q.modalTitle, { color: C.text }],
|
|
2879
|
+
children: x || i || ee("renderer.defaultInputs.selectTime")
|
|
2880
|
+
}), /* @__PURE__ */ L(V, {
|
|
2881
|
+
onPress: () => h(!1),
|
|
2882
|
+
children: /* @__PURE__ */ L(B, {
|
|
2883
|
+
style: [Q.closeButton, { color: C.textMuted }],
|
|
2884
|
+
children: "✕"
|
|
2885
|
+
})
|
|
2886
|
+
})]
|
|
2887
|
+
}),
|
|
2888
|
+
/* @__PURE__ */ R(H, {
|
|
2889
|
+
style: Q.pickerContainer,
|
|
2890
|
+
children: [
|
|
2891
|
+
/* @__PURE__ */ R(H, {
|
|
2892
|
+
style: Q.pickerColumn,
|
|
2893
|
+
children: [/* @__PURE__ */ L(B, {
|
|
2894
|
+
style: [Q.pickerLabel, { color: C.textMuted }],
|
|
2895
|
+
children: "Hour"
|
|
2896
|
+
}), /* @__PURE__ */ L(he, {
|
|
2897
|
+
ref: w,
|
|
2898
|
+
style: Q.picker,
|
|
2899
|
+
contentContainerStyle: Q.pickerContent,
|
|
2900
|
+
showsVerticalScrollIndicator: !1,
|
|
2901
|
+
children: te.map((e) => /* @__PURE__ */ L(V, {
|
|
2902
|
+
style: [Q.pickerItem, u === e && { backgroundColor: C.primary }],
|
|
2903
|
+
onPress: () => d(e),
|
|
2904
|
+
activeOpacity: .7,
|
|
2905
|
+
children: /* @__PURE__ */ L(B, {
|
|
2906
|
+
style: [
|
|
2907
|
+
Q.pickerItemText,
|
|
2908
|
+
{ color: C.text },
|
|
2909
|
+
u === e && {
|
|
2910
|
+
color: C.background,
|
|
2911
|
+
fontWeight: "600"
|
|
2912
|
+
}
|
|
2913
|
+
],
|
|
2914
|
+
children: String(e).padStart(2, "0")
|
|
2915
|
+
})
|
|
2916
|
+
}, e))
|
|
2917
|
+
})]
|
|
2918
|
+
}),
|
|
2919
|
+
/* @__PURE__ */ L(B, {
|
|
2920
|
+
style: [Q.pickerSeparator, { color: C.text }],
|
|
2921
|
+
children: ":"
|
|
2922
|
+
}),
|
|
2923
|
+
/* @__PURE__ */ R(H, {
|
|
2924
|
+
style: Q.pickerColumn,
|
|
2925
|
+
children: [/* @__PURE__ */ L(B, {
|
|
2926
|
+
style: [Q.pickerLabel, { color: C.textMuted }],
|
|
2927
|
+
children: "Minute"
|
|
2928
|
+
}), /* @__PURE__ */ L(he, {
|
|
2929
|
+
ref: T,
|
|
2930
|
+
style: Q.picker,
|
|
2931
|
+
contentContainerStyle: Q.pickerContent,
|
|
2932
|
+
showsVerticalScrollIndicator: !1,
|
|
2933
|
+
children: ne.map((e) => /* @__PURE__ */ L(V, {
|
|
2934
|
+
style: [Q.pickerItem, f === e && { backgroundColor: C.primary }],
|
|
2935
|
+
onPress: () => p(e),
|
|
2936
|
+
activeOpacity: .7,
|
|
2937
|
+
children: /* @__PURE__ */ L(B, {
|
|
2938
|
+
style: [
|
|
2939
|
+
Q.pickerItemText,
|
|
2940
|
+
{ color: C.text },
|
|
2941
|
+
f === e && {
|
|
2942
|
+
color: C.background,
|
|
2943
|
+
fontWeight: "600"
|
|
2944
|
+
}
|
|
2945
|
+
],
|
|
2946
|
+
children: String(e).padStart(2, "0")
|
|
2947
|
+
})
|
|
2948
|
+
}, e))
|
|
2949
|
+
})]
|
|
2950
|
+
})
|
|
2951
|
+
]
|
|
2952
|
+
}),
|
|
2953
|
+
/* @__PURE__ */ L(V, {
|
|
2954
|
+
style: [Q.confirmButton, { backgroundColor: C.primary }],
|
|
2955
|
+
onPress: re,
|
|
2956
|
+
activeOpacity: .7,
|
|
2957
|
+
children: /* @__PURE__ */ L(B, {
|
|
2958
|
+
style: [Q.confirmButtonText, { color: C.background }],
|
|
2959
|
+
children: "Confirm"
|
|
2960
|
+
})
|
|
2961
|
+
})
|
|
2962
|
+
]
|
|
2963
|
+
})
|
|
2964
|
+
})
|
|
2965
|
+
}),
|
|
2966
|
+
y && /* @__PURE__ */ L(B, {
|
|
2967
|
+
style: [Q.error, { color: C.error }],
|
|
2968
|
+
children: y
|
|
2969
|
+
}),
|
|
2970
|
+
S && !y && /* @__PURE__ */ L(B, {
|
|
2971
|
+
style: [Q.helperText, { color: C.textMuted }],
|
|
2972
|
+
children: S
|
|
2973
|
+
})
|
|
2974
|
+
]
|
|
2975
|
+
});
|
|
2976
|
+
}, Q = z.create({
|
|
2977
|
+
closeButton: {
|
|
2978
|
+
fontSize: 24,
|
|
2979
|
+
fontWeight: "300"
|
|
2980
|
+
},
|
|
2981
|
+
confirmButton: {
|
|
2982
|
+
alignItems: "center",
|
|
2983
|
+
borderRadius: 6,
|
|
2984
|
+
marginTop: 16,
|
|
2985
|
+
paddingVertical: 12
|
|
2986
|
+
},
|
|
2987
|
+
confirmButtonText: {
|
|
2988
|
+
fontSize: 16,
|
|
2989
|
+
fontWeight: "600"
|
|
2990
|
+
},
|
|
2991
|
+
container: { marginBottom: 16 },
|
|
2992
|
+
error: {
|
|
2993
|
+
fontSize: 12,
|
|
2994
|
+
marginTop: 4
|
|
2995
|
+
},
|
|
2996
|
+
helperText: {
|
|
2997
|
+
fontSize: 12,
|
|
2998
|
+
marginTop: 4
|
|
2999
|
+
},
|
|
3000
|
+
icon: { fontSize: 16 },
|
|
3001
|
+
modalContent: {
|
|
3002
|
+
borderRadius: 12,
|
|
3003
|
+
padding: 16,
|
|
3004
|
+
width: "80%"
|
|
3005
|
+
},
|
|
3006
|
+
modalHeader: {
|
|
3007
|
+
alignItems: "center",
|
|
3008
|
+
borderBottomWidth: 1,
|
|
3009
|
+
flexDirection: "row",
|
|
3010
|
+
justifyContent: "space-between",
|
|
3011
|
+
marginBottom: 16,
|
|
3012
|
+
paddingBottom: 12
|
|
3013
|
+
},
|
|
3014
|
+
modalOverlay: {
|
|
3015
|
+
alignItems: "center",
|
|
3016
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
3017
|
+
flex: 1,
|
|
3018
|
+
justifyContent: "center"
|
|
3019
|
+
},
|
|
3020
|
+
modalTitle: {
|
|
3021
|
+
fontSize: 18,
|
|
3022
|
+
fontWeight: "600"
|
|
3023
|
+
},
|
|
3024
|
+
picker: { maxHeight: 200 },
|
|
3025
|
+
pickerColumn: { flex: 1 },
|
|
3026
|
+
pickerContainer: {
|
|
3027
|
+
alignItems: "center",
|
|
3028
|
+
flexDirection: "row",
|
|
3029
|
+
gap: 8
|
|
3030
|
+
},
|
|
3031
|
+
pickerContent: { paddingVertical: 8 },
|
|
3032
|
+
pickerItem: {
|
|
3033
|
+
alignItems: "center",
|
|
3034
|
+
borderRadius: 6,
|
|
3035
|
+
marginVertical: 2,
|
|
3036
|
+
paddingVertical: 10
|
|
3037
|
+
},
|
|
3038
|
+
pickerItemText: { fontSize: 18 },
|
|
3039
|
+
pickerLabel: {
|
|
3040
|
+
fontSize: 12,
|
|
3041
|
+
fontWeight: "600",
|
|
3042
|
+
marginBottom: 8,
|
|
3043
|
+
textAlign: "center"
|
|
3044
|
+
},
|
|
3045
|
+
pickerSeparator: {
|
|
3046
|
+
fontSize: 24,
|
|
3047
|
+
fontWeight: "600"
|
|
3048
|
+
},
|
|
3049
|
+
trigger: {
|
|
3050
|
+
alignItems: "center",
|
|
3051
|
+
borderRadius: 6,
|
|
3052
|
+
borderWidth: 1,
|
|
3053
|
+
flexDirection: "row",
|
|
3054
|
+
justifyContent: "space-between",
|
|
3055
|
+
paddingHorizontal: 12,
|
|
3056
|
+
paddingVertical: 10
|
|
3057
|
+
},
|
|
3058
|
+
triggerText: {
|
|
3059
|
+
flex: 1,
|
|
3060
|
+
fontSize: 14
|
|
3061
|
+
}
|
|
3062
|
+
}), $e = ({ field: e, extra: t }) => {
|
|
3063
|
+
let [r, i] = F(!1), [a, o] = F(!0), { value: s } = e, { InputLabel: c, node: l, setValue: u, error: d, label: f, helperText: p } = t, { colors: m } = b(), h = n(), g = Array.isArray(s) ? s : [], _ = g[0] || "", v = g[1] || "", y = _.split(":"), x = Number.parseInt(y[0], 10), S = Number.parseInt(y[1], 10), C = Number.isNaN(x) ? 0 : x, ee = Number.isNaN(S) ? 0 : S, w = v.split(":"), T = Number.parseInt(w[0], 10), te = Number.parseInt(w[1], 10), ne = Number.isNaN(T) ? 0 : T, E = Number.isNaN(te) ? 0 : te, [re, D] = F(0), [O, k] = F(0), A = Array.from({ length: 24 }, (e, t) => t), ie = Array.from({ length: 60 }, (e, t) => t), ae = () => _ && v ? `${_} - ${v}` : _ || h("renderer.defaultInputs.selectTimeRange"), oe = se(() => {
|
|
3064
|
+
let e = `${String(re).padStart(2, "0")}:${String(O).padStart(2, "0")}`;
|
|
3065
|
+
a ? (u([e, v]), o(!1), D(ne || 0), k(E || 0)) : (u([_, e]), i(!1), o(!0));
|
|
3066
|
+
}, [
|
|
3067
|
+
a,
|
|
3068
|
+
re,
|
|
3069
|
+
O,
|
|
3070
|
+
_,
|
|
3071
|
+
v,
|
|
3072
|
+
ne,
|
|
3073
|
+
E,
|
|
3074
|
+
u
|
|
3075
|
+
]);
|
|
3076
|
+
return /* @__PURE__ */ R(H, {
|
|
3077
|
+
style: $.container,
|
|
3078
|
+
children: [
|
|
3079
|
+
/* @__PURE__ */ L(c, {
|
|
3080
|
+
label: f,
|
|
3081
|
+
required: l.data.required
|
|
3082
|
+
}),
|
|
3083
|
+
/* @__PURE__ */ R(V, {
|
|
3084
|
+
style: [
|
|
3085
|
+
$.trigger,
|
|
3086
|
+
{
|
|
3087
|
+
backgroundColor: m.input,
|
|
3088
|
+
borderColor: m.border
|
|
3089
|
+
},
|
|
3090
|
+
d && { borderColor: m.error }
|
|
3091
|
+
],
|
|
3092
|
+
onPress: () => {
|
|
3093
|
+
D(C || 0), k(ee || 0), o(!0), i(!0);
|
|
3094
|
+
},
|
|
3095
|
+
activeOpacity: .7,
|
|
3096
|
+
children: [/* @__PURE__ */ L(B, {
|
|
3097
|
+
style: [
|
|
3098
|
+
$.triggerText,
|
|
3099
|
+
{ color: m.text },
|
|
3100
|
+
!_ && { color: m.textMuted }
|
|
3101
|
+
],
|
|
3102
|
+
numberOfLines: 1,
|
|
3103
|
+
children: ae()
|
|
3104
|
+
}), /* @__PURE__ */ L(B, {
|
|
3105
|
+
style: $.icon,
|
|
3106
|
+
children: "🕐"
|
|
3107
|
+
})]
|
|
3108
|
+
}),
|
|
3109
|
+
/* @__PURE__ */ L(me, {
|
|
3110
|
+
visible: r,
|
|
3111
|
+
transparent: !0,
|
|
3112
|
+
animationType: "fade",
|
|
3113
|
+
onRequestClose: () => i(!1),
|
|
3114
|
+
children: /* @__PURE__ */ L(V, {
|
|
3115
|
+
style: $.modalOverlay,
|
|
3116
|
+
activeOpacity: 1,
|
|
3117
|
+
onPress: () => i(!1),
|
|
3118
|
+
children: /* @__PURE__ */ R(V, {
|
|
3119
|
+
style: [$.modalContent, { backgroundColor: m.card }],
|
|
3120
|
+
activeOpacity: 1,
|
|
3121
|
+
onPress: () => {},
|
|
3122
|
+
children: [
|
|
3123
|
+
/* @__PURE__ */ R(H, {
|
|
3124
|
+
style: [$.modalHeader, { borderBottomColor: m.separator }],
|
|
3125
|
+
children: [/* @__PURE__ */ L(B, {
|
|
3126
|
+
style: [$.modalTitle, { color: m.text }],
|
|
3127
|
+
children: f || h("renderer.defaultInputs.selectTimeRange")
|
|
3128
|
+
}), /* @__PURE__ */ L(V, {
|
|
3129
|
+
onPress: () => i(!1),
|
|
3130
|
+
children: /* @__PURE__ */ L(B, {
|
|
3131
|
+
style: [$.closeButton, { color: m.textMuted }],
|
|
3132
|
+
children: "✕"
|
|
3133
|
+
})
|
|
3134
|
+
})]
|
|
3135
|
+
}),
|
|
3136
|
+
/* @__PURE__ */ L(H, {
|
|
3137
|
+
style: [$.rangeIndicator, { backgroundColor: m.primaryLight }],
|
|
3138
|
+
children: /* @__PURE__ */ L(B, {
|
|
3139
|
+
style: [$.rangeIndicatorText, { color: m.primary }],
|
|
3140
|
+
children: h(a ? "renderer.defaultInputs.startTime" : "renderer.defaultInputs.endTime")
|
|
3141
|
+
})
|
|
3142
|
+
}),
|
|
3143
|
+
/* @__PURE__ */ R(H, {
|
|
3144
|
+
style: $.pickerContainer,
|
|
3145
|
+
children: [
|
|
3146
|
+
/* @__PURE__ */ R(H, {
|
|
3147
|
+
style: $.pickerColumn,
|
|
3148
|
+
children: [/* @__PURE__ */ L(B, {
|
|
3149
|
+
style: [$.pickerLabel, { color: m.textMuted }],
|
|
3150
|
+
children: "Hour"
|
|
3151
|
+
}), /* @__PURE__ */ L(he, {
|
|
3152
|
+
style: $.picker,
|
|
3153
|
+
contentContainerStyle: $.pickerContent,
|
|
3154
|
+
showsVerticalScrollIndicator: !1,
|
|
3155
|
+
children: A.map((e) => /* @__PURE__ */ L(V, {
|
|
3156
|
+
style: [$.pickerItem, re === e && { backgroundColor: m.primary }],
|
|
3157
|
+
onPress: () => D(e),
|
|
3158
|
+
activeOpacity: .7,
|
|
3159
|
+
children: /* @__PURE__ */ L(B, {
|
|
3160
|
+
style: [
|
|
3161
|
+
$.pickerItemText,
|
|
3162
|
+
{ color: m.text },
|
|
3163
|
+
re === e && {
|
|
3164
|
+
color: m.background,
|
|
3165
|
+
fontWeight: "600"
|
|
3166
|
+
}
|
|
3167
|
+
],
|
|
3168
|
+
children: String(e).padStart(2, "0")
|
|
3169
|
+
})
|
|
3170
|
+
}, e))
|
|
3171
|
+
})]
|
|
3172
|
+
}),
|
|
3173
|
+
/* @__PURE__ */ L(B, {
|
|
3174
|
+
style: [$.pickerSeparator, { color: m.text }],
|
|
3175
|
+
children: ":"
|
|
3176
|
+
}),
|
|
3177
|
+
/* @__PURE__ */ R(H, {
|
|
3178
|
+
style: $.pickerColumn,
|
|
3179
|
+
children: [/* @__PURE__ */ L(B, {
|
|
3180
|
+
style: [$.pickerLabel, { color: m.textMuted }],
|
|
3181
|
+
children: "Minute"
|
|
3182
|
+
}), /* @__PURE__ */ L(he, {
|
|
3183
|
+
style: $.picker,
|
|
3184
|
+
contentContainerStyle: $.pickerContent,
|
|
3185
|
+
showsVerticalScrollIndicator: !1,
|
|
3186
|
+
children: ie.map((e) => /* @__PURE__ */ L(V, {
|
|
3187
|
+
style: [$.pickerItem, O === e && { backgroundColor: m.primary }],
|
|
3188
|
+
onPress: () => k(e),
|
|
3189
|
+
activeOpacity: .7,
|
|
3190
|
+
children: /* @__PURE__ */ L(B, {
|
|
3191
|
+
style: [
|
|
3192
|
+
$.pickerItemText,
|
|
3193
|
+
{ color: m.text },
|
|
3194
|
+
O === e && {
|
|
3195
|
+
color: m.background,
|
|
3196
|
+
fontWeight: "600"
|
|
3197
|
+
}
|
|
3198
|
+
],
|
|
3199
|
+
children: String(e).padStart(2, "0")
|
|
3200
|
+
})
|
|
3201
|
+
}, e))
|
|
3202
|
+
})]
|
|
3203
|
+
})
|
|
3204
|
+
]
|
|
3205
|
+
}),
|
|
3206
|
+
/* @__PURE__ */ L(V, {
|
|
3207
|
+
style: [$.confirmButton, { backgroundColor: m.primary }],
|
|
3208
|
+
onPress: oe,
|
|
3209
|
+
activeOpacity: .7,
|
|
3210
|
+
children: /* @__PURE__ */ L(B, {
|
|
3211
|
+
style: [$.confirmButtonText, { color: m.background }],
|
|
3212
|
+
children: a ? "Next" : "Confirm"
|
|
3213
|
+
})
|
|
3214
|
+
})
|
|
3215
|
+
]
|
|
3216
|
+
})
|
|
3217
|
+
})
|
|
3218
|
+
}),
|
|
3219
|
+
d && /* @__PURE__ */ L(B, {
|
|
3220
|
+
style: [$.error, { color: m.error }],
|
|
3221
|
+
children: d
|
|
3222
|
+
}),
|
|
3223
|
+
p && !d && /* @__PURE__ */ L(B, {
|
|
3224
|
+
style: [$.helperText, { color: m.textMuted }],
|
|
3225
|
+
children: p
|
|
3226
|
+
})
|
|
3227
|
+
]
|
|
3228
|
+
});
|
|
3229
|
+
}, $ = z.create({
|
|
3230
|
+
closeButton: {
|
|
3231
|
+
fontSize: 24,
|
|
3232
|
+
fontWeight: "300"
|
|
3233
|
+
},
|
|
3234
|
+
confirmButton: {
|
|
3235
|
+
alignItems: "center",
|
|
3236
|
+
borderRadius: 6,
|
|
3237
|
+
marginTop: 16,
|
|
3238
|
+
paddingVertical: 12
|
|
3239
|
+
},
|
|
3240
|
+
confirmButtonText: {
|
|
3241
|
+
fontSize: 16,
|
|
3242
|
+
fontWeight: "600"
|
|
3243
|
+
},
|
|
3244
|
+
container: { marginBottom: 16 },
|
|
3245
|
+
error: {
|
|
3246
|
+
fontSize: 12,
|
|
3247
|
+
marginTop: 4
|
|
3248
|
+
},
|
|
3249
|
+
helperText: {
|
|
3250
|
+
fontSize: 12,
|
|
3251
|
+
marginTop: 4
|
|
3252
|
+
},
|
|
3253
|
+
icon: { fontSize: 16 },
|
|
3254
|
+
modalContent: {
|
|
3255
|
+
borderRadius: 12,
|
|
3256
|
+
padding: 16,
|
|
3257
|
+
width: "80%"
|
|
3258
|
+
},
|
|
3259
|
+
modalHeader: {
|
|
3260
|
+
alignItems: "center",
|
|
3261
|
+
borderBottomWidth: 1,
|
|
3262
|
+
flexDirection: "row",
|
|
3263
|
+
justifyContent: "space-between",
|
|
3264
|
+
marginBottom: 12,
|
|
3265
|
+
paddingBottom: 12
|
|
3266
|
+
},
|
|
3267
|
+
modalOverlay: {
|
|
3268
|
+
alignItems: "center",
|
|
3269
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
3270
|
+
flex: 1,
|
|
3271
|
+
justifyContent: "center"
|
|
3272
|
+
},
|
|
3273
|
+
modalTitle: {
|
|
3274
|
+
fontSize: 18,
|
|
3275
|
+
fontWeight: "600"
|
|
3276
|
+
},
|
|
3277
|
+
picker: { maxHeight: 200 },
|
|
3278
|
+
pickerColumn: { flex: 1 },
|
|
3279
|
+
pickerContainer: {
|
|
3280
|
+
alignItems: "center",
|
|
3281
|
+
flexDirection: "row",
|
|
3282
|
+
gap: 8
|
|
3283
|
+
},
|
|
3284
|
+
pickerContent: { paddingVertical: 8 },
|
|
3285
|
+
pickerItem: {
|
|
3286
|
+
alignItems: "center",
|
|
3287
|
+
borderRadius: 6,
|
|
3288
|
+
marginVertical: 2,
|
|
3289
|
+
paddingVertical: 10
|
|
3290
|
+
},
|
|
3291
|
+
pickerItemText: { fontSize: 18 },
|
|
3292
|
+
pickerLabel: {
|
|
3293
|
+
fontSize: 12,
|
|
3294
|
+
fontWeight: "600",
|
|
3295
|
+
marginBottom: 8,
|
|
3296
|
+
textAlign: "center"
|
|
3297
|
+
},
|
|
3298
|
+
pickerSeparator: {
|
|
3299
|
+
fontSize: 24,
|
|
3300
|
+
fontWeight: "600"
|
|
3301
|
+
},
|
|
3302
|
+
rangeIndicator: {
|
|
3303
|
+
alignItems: "center",
|
|
3304
|
+
borderRadius: 6,
|
|
3305
|
+
marginBottom: 12,
|
|
3306
|
+
paddingVertical: 8
|
|
3307
|
+
},
|
|
3308
|
+
rangeIndicatorText: {
|
|
3309
|
+
fontSize: 14,
|
|
3310
|
+
fontWeight: "600"
|
|
3311
|
+
},
|
|
3312
|
+
trigger: {
|
|
3313
|
+
alignItems: "center",
|
|
3314
|
+
borderRadius: 6,
|
|
3315
|
+
borderWidth: 1,
|
|
3316
|
+
flexDirection: "row",
|
|
3317
|
+
justifyContent: "space-between",
|
|
3318
|
+
paddingHorizontal: 12,
|
|
3319
|
+
paddingVertical: 10
|
|
3320
|
+
},
|
|
3321
|
+
triggerText: {
|
|
3322
|
+
flex: 1,
|
|
3323
|
+
fontSize: 14
|
|
3324
|
+
}
|
|
3325
|
+
}), et = {
|
|
3326
|
+
address: we,
|
|
3327
|
+
autocomplete: De,
|
|
3328
|
+
checkbox: Oe,
|
|
3329
|
+
date: ke,
|
|
3330
|
+
daterange: Ae,
|
|
3331
|
+
file: je,
|
|
3332
|
+
hidden: Me,
|
|
3333
|
+
http: Re,
|
|
3334
|
+
number: ze,
|
|
3335
|
+
password: Ve,
|
|
3336
|
+
radio: Ue,
|
|
3337
|
+
select: We,
|
|
3338
|
+
submit: Ge,
|
|
3339
|
+
switch: Ke,
|
|
3340
|
+
text: Xe,
|
|
3341
|
+
textarea: Je,
|
|
3342
|
+
time: Qe,
|
|
3343
|
+
timerange: $e
|
|
3344
|
+
}, tt = ({ step: e, label: t, children: r, canGoBack: i, isLastStep: a, canContinue: o, isSubmitting: s, onBack: c, onContinue: u }) => {
|
|
3345
|
+
let { colors: d } = b(), f = n(), p = !o || s, m = e.nodes.find((e) => l(e) && e.data.type === "submit"), h = m && l(m) ? f(m.data.label) : void 0, g = a ? h || f("renderer.defaultSubmitButton.submit") : f("renderer.step.continue");
|
|
3346
|
+
return /* @__PURE__ */ R(H, { children: [
|
|
3347
|
+
t ? /* @__PURE__ */ L(B, {
|
|
3348
|
+
style: [nt.label, { color: d.text }],
|
|
3349
|
+
children: t
|
|
3350
|
+
}) : null,
|
|
3351
|
+
/* @__PURE__ */ L(H, {
|
|
3352
|
+
style: nt.content,
|
|
3353
|
+
children: r
|
|
3354
|
+
}),
|
|
3355
|
+
/* @__PURE__ */ R(H, {
|
|
3356
|
+
style: nt.actions,
|
|
3357
|
+
children: [i ? /* @__PURE__ */ L(V, {
|
|
3358
|
+
style: [
|
|
3359
|
+
nt.backButton,
|
|
3360
|
+
{ borderColor: d.border },
|
|
3361
|
+
s && nt.disabled
|
|
3362
|
+
],
|
|
3363
|
+
onPress: c,
|
|
3364
|
+
disabled: s,
|
|
3365
|
+
activeOpacity: .7,
|
|
3366
|
+
children: /* @__PURE__ */ L(B, {
|
|
3367
|
+
style: [nt.backButtonText, { color: d.text }],
|
|
3368
|
+
children: f("renderer.step.back")
|
|
3369
|
+
})
|
|
3370
|
+
}) : /* @__PURE__ */ L(H, {}), /* @__PURE__ */ L(V, {
|
|
3371
|
+
style: [
|
|
3372
|
+
nt.continueButton,
|
|
3373
|
+
{ backgroundColor: d.primary },
|
|
3374
|
+
p && {
|
|
3375
|
+
backgroundColor: d.primaryDisabled,
|
|
3376
|
+
opacity: .6
|
|
3377
|
+
}
|
|
3378
|
+
],
|
|
3379
|
+
onPress: u,
|
|
3380
|
+
disabled: p,
|
|
3381
|
+
activeOpacity: .7,
|
|
3382
|
+
children: s ? /* @__PURE__ */ L(le, { color: d.primaryForeground }) : /* @__PURE__ */ L(B, {
|
|
3383
|
+
style: [nt.continueButtonText, { color: d.primaryForeground }],
|
|
3384
|
+
children: g
|
|
3385
|
+
})
|
|
3386
|
+
})]
|
|
3387
|
+
})
|
|
3388
|
+
] });
|
|
3389
|
+
}, nt = z.create({
|
|
3390
|
+
actions: {
|
|
3391
|
+
alignItems: "center",
|
|
3392
|
+
flexDirection: "row",
|
|
3393
|
+
justifyContent: "space-between",
|
|
3394
|
+
marginTop: 24
|
|
3395
|
+
},
|
|
3396
|
+
backButton: {
|
|
3397
|
+
borderRadius: 6,
|
|
3398
|
+
borderWidth: 1,
|
|
3399
|
+
paddingHorizontal: 16,
|
|
3400
|
+
paddingVertical: 10
|
|
3401
|
+
},
|
|
3402
|
+
backButtonText: {
|
|
3403
|
+
fontSize: 14,
|
|
3404
|
+
fontWeight: "500"
|
|
3405
|
+
},
|
|
3406
|
+
content: { gap: 8 },
|
|
3407
|
+
continueButton: {
|
|
3408
|
+
alignItems: "center",
|
|
3409
|
+
borderRadius: 6,
|
|
3410
|
+
justifyContent: "center",
|
|
3411
|
+
paddingHorizontal: 24,
|
|
3412
|
+
paddingVertical: 12
|
|
3413
|
+
},
|
|
3414
|
+
continueButtonText: {
|
|
3415
|
+
fontSize: 14,
|
|
3416
|
+
fontWeight: "600"
|
|
3417
|
+
},
|
|
3418
|
+
disabled: { opacity: .5 },
|
|
3419
|
+
label: {
|
|
3420
|
+
fontSize: 16,
|
|
3421
|
+
fontWeight: "600",
|
|
3422
|
+
marginBottom: 12
|
|
3423
|
+
}
|
|
3424
|
+
}), rt = ({ children: e = "Submit", disabled: t, isSubmitting: n, onPress: r }) => {
|
|
3425
|
+
let { colors: i } = b();
|
|
3426
|
+
return /* @__PURE__ */ L(V, {
|
|
3427
|
+
style: [
|
|
3428
|
+
it.button,
|
|
3429
|
+
{ backgroundColor: i.primary },
|
|
3430
|
+
(t || n) && {
|
|
3431
|
+
backgroundColor: i.primaryDisabled,
|
|
3432
|
+
opacity: .6
|
|
3433
|
+
}
|
|
3434
|
+
],
|
|
3435
|
+
disabled: t || n,
|
|
3436
|
+
onPress: r,
|
|
3437
|
+
activeOpacity: .7,
|
|
3438
|
+
children: n ? /* @__PURE__ */ L(le, { color: i.primaryForeground }) : /* @__PURE__ */ L(B, {
|
|
3439
|
+
style: [it.buttonText, { color: i.primaryForeground }],
|
|
3440
|
+
children: e
|
|
3441
|
+
})
|
|
3442
|
+
});
|
|
3443
|
+
}, it = z.create({
|
|
3444
|
+
button: {
|
|
3445
|
+
alignItems: "center",
|
|
3446
|
+
borderRadius: 6,
|
|
3447
|
+
justifyContent: "center",
|
|
3448
|
+
marginTop: 16,
|
|
3449
|
+
paddingHorizontal: 24,
|
|
3450
|
+
paddingVertical: 12
|
|
3451
|
+
},
|
|
3452
|
+
buttonText: {
|
|
3453
|
+
fontSize: 16,
|
|
3454
|
+
fontWeight: "600"
|
|
3455
|
+
}
|
|
3456
|
+
}), at = ({ children: e }) => e, ot = ({ node: e }) => {
|
|
3457
|
+
let t = n(), { colors: r } = b(), i = t(e.data?.label);
|
|
3458
|
+
return /* @__PURE__ */ L(B, {
|
|
3459
|
+
style: [ct.title, { color: r.text }],
|
|
3460
|
+
children: i
|
|
3461
|
+
});
|
|
3462
|
+
}, st = () => {
|
|
3463
|
+
let { colors: e } = b();
|
|
3464
|
+
return /* @__PURE__ */ L(H, { style: [ct.divider, { backgroundColor: e.separator }] });
|
|
3465
|
+
}, ct = z.create({
|
|
3466
|
+
divider: {
|
|
3467
|
+
height: 1,
|
|
3468
|
+
marginBottom: 16,
|
|
3469
|
+
marginTop: 0
|
|
3470
|
+
},
|
|
3471
|
+
title: {
|
|
3472
|
+
fontSize: 20,
|
|
3473
|
+
fontWeight: "700",
|
|
3474
|
+
marginBottom: 16
|
|
3475
|
+
}
|
|
3476
|
+
}), lt = {
|
|
3477
|
+
divider: st,
|
|
3478
|
+
title: ot
|
|
3479
|
+
}, ut = ({ node: e, children: t }) => {
|
|
3480
|
+
let { image: n } = e.data;
|
|
3481
|
+
return /* @__PURE__ */ R(H, { children: [n && /* @__PURE__ */ L(pe, {
|
|
3482
|
+
source: { uri: n },
|
|
3483
|
+
style: dt.image,
|
|
3484
|
+
resizeMode: "cover"
|
|
3485
|
+
}), t] });
|
|
3486
|
+
}, dt = z.create({ image: {
|
|
3487
|
+
borderRadius: 6,
|
|
3488
|
+
height: 160,
|
|
3489
|
+
marginBottom: 8,
|
|
3490
|
+
width: "100%"
|
|
3491
|
+
} }), ft = ({ style: e }) => {
|
|
3492
|
+
let { colors: t } = b(), n = P(new de.Value(.5)).current;
|
|
3493
|
+
return N(() => {
|
|
3494
|
+
let e = de.loop(de.sequence([de.timing(n, {
|
|
3495
|
+
duration: 600,
|
|
3496
|
+
toValue: 1,
|
|
3497
|
+
useNativeDriver: !0
|
|
3498
|
+
}), de.timing(n, {
|
|
3499
|
+
duration: 600,
|
|
3500
|
+
toValue: .5,
|
|
3501
|
+
useNativeDriver: !0
|
|
3502
|
+
})]));
|
|
3503
|
+
return e.start(), () => e.stop();
|
|
3504
|
+
}, [n]), /* @__PURE__ */ L(de.View, { style: [
|
|
3505
|
+
mt.bar,
|
|
3506
|
+
{
|
|
3507
|
+
backgroundColor: t.muted,
|
|
3508
|
+
opacity: n
|
|
3509
|
+
},
|
|
3510
|
+
e
|
|
3511
|
+
] });
|
|
3512
|
+
}, pt = () => /* @__PURE__ */ R(H, {
|
|
3513
|
+
accessibilityState: { busy: !0 },
|
|
3514
|
+
children: [
|
|
3515
|
+
/* @__PURE__ */ L(ft, { style: mt.title }),
|
|
3516
|
+
/* @__PURE__ */ L(H, {
|
|
3517
|
+
style: mt.fields,
|
|
3518
|
+
children: [
|
|
3519
|
+
0,
|
|
3520
|
+
1,
|
|
3521
|
+
2
|
|
3522
|
+
].map((e) => /* @__PURE__ */ R(H, {
|
|
3523
|
+
style: mt.field,
|
|
3524
|
+
children: [/* @__PURE__ */ L(ft, { style: mt.fieldLabel }), /* @__PURE__ */ L(ft, { style: mt.fieldInput })]
|
|
3525
|
+
}, e))
|
|
3526
|
+
}),
|
|
3527
|
+
/* @__PURE__ */ L(H, {
|
|
3528
|
+
style: mt.actions,
|
|
3529
|
+
children: /* @__PURE__ */ L(ft, { style: mt.button })
|
|
3530
|
+
})
|
|
3531
|
+
]
|
|
3532
|
+
}), mt = z.create({
|
|
3533
|
+
actions: {
|
|
3534
|
+
alignItems: "flex-end",
|
|
3535
|
+
marginTop: 24
|
|
3536
|
+
},
|
|
3537
|
+
bar: { borderRadius: 6 },
|
|
3538
|
+
button: {
|
|
3539
|
+
height: 44,
|
|
3540
|
+
width: 120
|
|
3541
|
+
},
|
|
3542
|
+
field: { gap: 8 },
|
|
3543
|
+
fieldInput: {
|
|
3544
|
+
height: 44,
|
|
3545
|
+
width: "100%"
|
|
3546
|
+
},
|
|
3547
|
+
fieldLabel: {
|
|
3548
|
+
height: 16,
|
|
3549
|
+
width: "25%"
|
|
3550
|
+
},
|
|
3551
|
+
fields: { gap: 24 },
|
|
3552
|
+
title: {
|
|
3553
|
+
height: 24,
|
|
3554
|
+
marginBottom: 24,
|
|
3555
|
+
width: "33%"
|
|
3556
|
+
}
|
|
3557
|
+
}), ht = ({ baseUrl: t, components: n, contentContainerStyle: r, extraPayload: i, flow: a, googleApiKey: o, headers: s, initialValues: c, isLoading: l = !1, isSubmitting: u = !1, language: d, onBack: f, onChange: p, onSubmit: m, showPoweredBy: h, style: g, theme: _, validate: v, validationMode: y }) => {
|
|
3558
|
+
let { colors: x } = b(), { canContinueStep: S, canSubmit: C, clearSubmitMessage: ee, config: w, currentStep: T, currentStepGroupNode: te, currentStepIndex: ne, formErrors: E, formValues: re, goToNextStep: D, goToPreviousStep: O, handleSubmit: k, inputNodes: A, isFirstStep: ae, isLastStep: oe, isSubmitting: j, missingRequiredFields: N, setFieldValue: P, steps: F, submitMessage: I, t: le } = ie({
|
|
3559
|
+
baseUrl: t,
|
|
3560
|
+
components: n,
|
|
3561
|
+
extraPayload: i,
|
|
3562
|
+
flow: a,
|
|
3563
|
+
googleApiKey: o,
|
|
3564
|
+
headers: s,
|
|
3565
|
+
initialValues: c,
|
|
3566
|
+
language: d,
|
|
3567
|
+
onChange: p,
|
|
3568
|
+
onSubmit: m,
|
|
3569
|
+
showPoweredBy: h,
|
|
3570
|
+
theme: _,
|
|
3571
|
+
validate: v,
|
|
3572
|
+
validationMode: y
|
|
3573
|
+
}), ue = u || j, { FormWrapper: de, SubmitButtonWrapper: fe, renderNode: pe } = M({
|
|
3574
|
+
config: w,
|
|
3575
|
+
DefaultFormWrapper: ve,
|
|
3576
|
+
DefaultInputLabel: be,
|
|
3577
|
+
DefaultInputWrapper: ut,
|
|
3578
|
+
DefaultSubmitButton: rt,
|
|
3579
|
+
DefaultSubmitButtonWrapper: at,
|
|
3580
|
+
defaultInputRenderers: et,
|
|
3581
|
+
defaultUI: lt,
|
|
3582
|
+
formErrors: E,
|
|
3583
|
+
formValues: re,
|
|
3584
|
+
inputNodes: A,
|
|
3585
|
+
isSubmitting: ue,
|
|
3586
|
+
missingRequiredFields: N,
|
|
3587
|
+
setFieldValue: P
|
|
3588
|
+
}), me = w.components.step ?? tt, z = w.components.loadingSkeleton ?? pt, ge = ce(() => le(te?.data?.label), [le, te]), _e = se(() => {
|
|
3589
|
+
if (oe) {
|
|
3590
|
+
k();
|
|
3591
|
+
return;
|
|
3592
|
+
}
|
|
3593
|
+
D();
|
|
3594
|
+
}, [
|
|
3595
|
+
oe,
|
|
3596
|
+
k,
|
|
3597
|
+
D
|
|
3598
|
+
]), V = se(() => {
|
|
3599
|
+
if (ae) {
|
|
3600
|
+
f?.();
|
|
3601
|
+
return;
|
|
3602
|
+
}
|
|
3603
|
+
O();
|
|
3604
|
+
}, [
|
|
3605
|
+
ae,
|
|
3606
|
+
f,
|
|
3607
|
+
O
|
|
3608
|
+
]), ye = !ae || !!f;
|
|
3609
|
+
return /* @__PURE__ */ L(he, {
|
|
3610
|
+
nestedScrollEnabled: !0,
|
|
3611
|
+
style: [
|
|
3612
|
+
_t.container,
|
|
3613
|
+
{ backgroundColor: x.background },
|
|
3614
|
+
g
|
|
3615
|
+
],
|
|
3616
|
+
contentContainerStyle: r,
|
|
3617
|
+
children: l ? /* @__PURE__ */ L(z, {}) : /* @__PURE__ */ R(e, {
|
|
3618
|
+
value: {
|
|
3619
|
+
baseUrl: w.baseUrl,
|
|
3620
|
+
flow: a,
|
|
3621
|
+
formErrors: E,
|
|
3622
|
+
formValues: re,
|
|
3623
|
+
googleApiKey: w.googleApiKey,
|
|
3624
|
+
headers: w.headers,
|
|
3625
|
+
inputNodes: A,
|
|
3626
|
+
language: w.language,
|
|
3627
|
+
setFieldValue: P
|
|
3628
|
+
},
|
|
3629
|
+
children: [/* @__PURE__ */ R(de, {
|
|
3630
|
+
onSubmit: k,
|
|
3631
|
+
children: [T && /* @__PURE__ */ L(fe, {
|
|
3632
|
+
missingFields: N,
|
|
3633
|
+
children: /* @__PURE__ */ L(me, {
|
|
3634
|
+
step: T,
|
|
3635
|
+
groupNode: te,
|
|
3636
|
+
stepIndex: ne,
|
|
3637
|
+
totalSteps: F.length,
|
|
3638
|
+
isFirstStep: ae,
|
|
3639
|
+
isLastStep: oe,
|
|
3640
|
+
canContinue: S && (!oe || C),
|
|
3641
|
+
canGoBack: ye,
|
|
3642
|
+
isSubmitting: ue,
|
|
3643
|
+
onBack: V,
|
|
3644
|
+
onContinue: _e,
|
|
3645
|
+
label: ge,
|
|
3646
|
+
children: T.nodes.map((e) => pe(e))
|
|
3647
|
+
})
|
|
3648
|
+
}), w.showPoweredBy && /* @__PURE__ */ L(B, {
|
|
3649
|
+
style: [_t.poweredBy, { color: x.textMuted }],
|
|
3650
|
+
children: "Powered by Treege"
|
|
3651
|
+
})]
|
|
3652
|
+
}), I && /* @__PURE__ */ R(H, {
|
|
3653
|
+
style: [_t.message, { backgroundColor: I.type === "success" ? x.successBg : x.errorBg }],
|
|
3654
|
+
children: [/* @__PURE__ */ L(B, {
|
|
3655
|
+
style: [_t.messageText, { color: I.type === "success" ? x.success : x.error }],
|
|
3656
|
+
children: I.message
|
|
3657
|
+
}), /* @__PURE__ */ L(B, {
|
|
3658
|
+
style: [_t.messageClose, { color: I.type === "success" ? x.success : x.error }],
|
|
3659
|
+
onPress: ee,
|
|
3660
|
+
children: le("common.close")
|
|
3661
|
+
})]
|
|
3662
|
+
})]
|
|
3663
|
+
})
|
|
3664
|
+
});
|
|
3665
|
+
}, gt = (e) => /* @__PURE__ */ L(w, {
|
|
3666
|
+
theme: e.theme,
|
|
3667
|
+
storageKey: "treege-renderer-theme",
|
|
3668
|
+
children: /* @__PURE__ */ L(ht, { ...e })
|
|
3669
|
+
}), _t = z.create({
|
|
3670
|
+
container: {
|
|
3671
|
+
flexBasis: "auto",
|
|
3672
|
+
flexGrow: 1,
|
|
3673
|
+
flexShrink: 1
|
|
3674
|
+
},
|
|
3675
|
+
message: {
|
|
3676
|
+
borderRadius: 6,
|
|
3677
|
+
marginVertical: 16,
|
|
3678
|
+
padding: 16
|
|
3679
|
+
},
|
|
3680
|
+
messageClose: {
|
|
3681
|
+
fontSize: 14,
|
|
3682
|
+
marginTop: 8,
|
|
3683
|
+
textDecorationLine: "underline"
|
|
3684
|
+
},
|
|
3685
|
+
messageText: {
|
|
3686
|
+
fontSize: 14,
|
|
3687
|
+
fontWeight: "500"
|
|
3688
|
+
},
|
|
3689
|
+
poweredBy: {
|
|
3690
|
+
fontSize: 12,
|
|
3691
|
+
paddingVertical: 8,
|
|
3692
|
+
textAlign: "right"
|
|
3693
|
+
}
|
|
3694
|
+
});
|
|
3695
|
+
//#endregion
|
|
3696
|
+
export { we as DefaultAddressInput, De as DefaultAutocompleteInput, Oe as DefaultCheckboxInput, ke as DefaultDateInput, Ae as DefaultDateRangeInput, st as DefaultDividerUI, je as DefaultFileInput, Me as DefaultHiddenInput, Re as DefaultHttpInput, be as DefaultInputLabel, ze as DefaultNumberInput, Ve as DefaultPasswordInput, Ue as DefaultRadioInput, We as DefaultSelectInput, Ke as DefaultSwitchInput, Xe as DefaultTextInput, Je as DefaultTextareaInput, Qe as DefaultTimeInput, $e as DefaultTimeRangeInput, ot as DefaultTitleUI, gt as TreegeRenderer, O as TreegeRendererProvider, C as applyReferenceTransformation, g as buildInitialFormValues, d as calculateReferenceFieldUpdates, x as checkFormFieldHasValue, ee as convertFormValuesToNamedFormat, et as defaultInputRenderers, lt as defaultUI, ae as evaluateCondition, j as evaluateConditions, y as fileNameFromUrl, h as fileToSerializable, m as filesToSerializable, oe as findStartNode, u as formatFileSize, k as getFlowRenderState, S as getTranslatedText, p as isFieldEmpty, T as isRemoteFileData, D as isStartNode, E as normalizeSerializableFiles, v as resolveNodeDefaultValue, o as sanitize, re as sanitizeHttpResponse, f as serializableToFile, ie as useTreegeRenderer, A as useTreegeRendererConfig };
|