@react-typed-forms/schemas-rn 1.0.0 → 2.0.1
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/lib/components/CheckRenderer.d.ts +11 -0
- package/lib/components/ControlInput.d.ts +23 -0
- package/lib/components/DefaultAccordion.d.ts +21 -0
- package/lib/components/DefaultArrayRenderer.d.ts +24 -0
- package/lib/components/DefaultDialogRenderer.d.ts +16 -0
- package/lib/components/DefaultDisplay.d.ts +8 -0
- package/lib/components/DefaultDisplayOnly.d.ts +13 -0
- package/lib/components/DefaultGroupRenderer.d.ts +16 -0
- package/lib/components/DefaultLayout.d.ts +7 -0
- package/lib/components/DefaultVisibility.d.ts +7 -0
- package/lib/components/DefaultWizardRenderer.d.ts +2 -0
- package/lib/components/GridRenderer.d.ts +2 -0
- package/lib/components/Icon.d.ts +1 -1
- package/lib/components/NullToggle.d.ts +1 -0
- package/lib/components/RNCheckButtons.d.ts +2 -0
- package/lib/components/RNCheckboxRenderer.d.ts +14 -0
- package/lib/components/RNDateTimePickerRenderer.d.ts +1 -1
- package/lib/components/RNDialog.d.ts +41 -1
- package/lib/components/RNHtmlRenderer.d.ts +1 -1
- package/lib/components/RNScrollListRenderer.d.ts +7 -0
- package/lib/components/RNSelectRenderer.d.ts +4 -1
- package/lib/components/RNTextInputRenderer.d.ts +13 -0
- package/lib/components/SelectDataRenderer.d.ts +23 -0
- package/lib/createButtonActionRenderer.d.ts +3 -0
- package/lib/createDefaultRNRenderers.d.ts +8 -0
- package/lib/defaultTailwindTheme.d.ts +95 -0
- package/lib/index.cjs +2339 -403
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +8 -2
- package/lib/index.js +2228 -401
- package/lib/index.js.map +1 -1
- package/lib/rendererOptions.d.ts +209 -0
- package/lib/selectUtils.d.ts +16 -0
- package/lib/tailwind.d.ts +1 -3
- package/package.json +42 -43
- package/tsconfig.json +3 -1
- package/lib/components/RNCheckbox.d.ts +0 -12
- package/lib/components/RNTextInput.d.ts +0 -6
package/lib/index.cjs
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
var schemasHtml = require('@react-typed-forms/schemas-html');
|
|
2
|
-
var reactNative = require('react-native');
|
|
3
|
-
var CheckboxPrimitive = require('@rn-primitives/checkbox');
|
|
4
1
|
var React = require('react');
|
|
2
|
+
var schemas = require('@react-typed-forms/schemas');
|
|
3
|
+
var reactNative = require('react-native');
|
|
4
|
+
var jsxRuntime = require('nativewind/jsx-runtime');
|
|
5
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
5
6
|
var clsx = require('clsx');
|
|
6
7
|
var tailwindMerge = require('tailwind-merge');
|
|
8
|
+
var Slot = require('@rn-primitives/slot');
|
|
9
|
+
var CheckboxPrimitive = require('@rn-primitives/checkbox');
|
|
7
10
|
var nativewind = require('nativewind');
|
|
8
11
|
var vectorIcons = require('@expo/vector-icons');
|
|
9
|
-
var schemas = require('@react-typed-forms/schemas');
|
|
10
12
|
var MaterialIcons = require('@expo/vector-icons/MaterialIcons');
|
|
11
|
-
var jsxRuntime = require('nativewind/jsx-runtime');
|
|
12
13
|
var core = require('@react-typed-forms/core');
|
|
13
|
-
var RadioGroupPrimitive = require('@rn-primitives/radio-group');
|
|
14
14
|
var DateTimePickerModal = require('react-native-modal-datetime-picker');
|
|
15
15
|
var date = require('@internationalized/date');
|
|
16
16
|
var RenderHtml = require('react-native-render-html');
|
|
17
|
+
var RadioGroupPrimitive = require('@rn-primitives/radio-group');
|
|
17
18
|
var SelectPrimitive = require('@rn-primitives/select');
|
|
18
19
|
var Animated = require('react-native-reanimated');
|
|
19
20
|
var reactNativeSafeAreaContext = require('react-native-safe-area-context');
|
|
20
21
|
var reactNativeGestureHandler = require('react-native-gesture-handler');
|
|
21
|
-
var classVarianceAuthority = require('class-variance-authority');
|
|
22
|
-
var Slot = require('@rn-primitives/slot');
|
|
23
22
|
var DialogPrimitive = require('@rn-primitives/dialog');
|
|
24
23
|
|
|
25
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -42,17 +41,147 @@ function _interopNamespace(e) {
|
|
|
42
41
|
return n;
|
|
43
42
|
}
|
|
44
43
|
|
|
45
|
-
var
|
|
44
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
46
45
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
46
|
+
var clsx__default = /*#__PURE__*/_interopDefaultLegacy(clsx);
|
|
47
|
+
var Slot__namespace = /*#__PURE__*/_interopNamespace(Slot);
|
|
48
|
+
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
47
49
|
var MaterialIcons__default = /*#__PURE__*/_interopDefaultLegacy(MaterialIcons);
|
|
48
|
-
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
49
50
|
var DateTimePickerModal__default = /*#__PURE__*/_interopDefaultLegacy(DateTimePickerModal);
|
|
50
51
|
var RenderHtml__default = /*#__PURE__*/_interopDefaultLegacy(RenderHtml);
|
|
52
|
+
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
51
53
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
52
54
|
var Animated__default = /*#__PURE__*/_interopDefaultLegacy(Animated);
|
|
53
|
-
var Slot__namespace = /*#__PURE__*/_interopNamespace(Slot);
|
|
54
55
|
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
55
56
|
|
|
57
|
+
// Default tailwind theme adapted for React Native
|
|
58
|
+
var defaultTailwindTheme = {
|
|
59
|
+
label: {
|
|
60
|
+
groupLabelClass: "font-bold",
|
|
61
|
+
requiredElement: function requiredElement(_ref) {
|
|
62
|
+
var Span = _ref.Span;
|
|
63
|
+
return /*#__PURE__*/React__default["default"].createElement(Span, {
|
|
64
|
+
className: "text-red-500"
|
|
65
|
+
}, " *");
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
array: {
|
|
69
|
+
removableClass: "grid grid-cols-[1fr_auto] items-center gap-x-2",
|
|
70
|
+
childClass: "grow my-2",
|
|
71
|
+
addActionClass: "my-2",
|
|
72
|
+
removeActionClass: "flex gap-2"
|
|
73
|
+
},
|
|
74
|
+
group: {
|
|
75
|
+
standardClassName: "flex flex-col gap-4",
|
|
76
|
+
grid: {
|
|
77
|
+
className: "flex flex-col gap-4",
|
|
78
|
+
rowClass: "flex flex-row gap-4 justify-between",
|
|
79
|
+
cellClass: "flex-1"
|
|
80
|
+
},
|
|
81
|
+
flexClassName: "gap-2",
|
|
82
|
+
inlineClass: "",
|
|
83
|
+
tabs: {
|
|
84
|
+
className: "",
|
|
85
|
+
tabListClass: "flex flex-wrap text-sm font-medium text-center text-gray-500 border-b border-gray-200",
|
|
86
|
+
tabClass: "me-2",
|
|
87
|
+
labelClass: "flex items-center justify-center p-4 border-b-2",
|
|
88
|
+
inactiveClass: "border-transparent rounded-t-lg text-gray-600 border-gray-300",
|
|
89
|
+
activeClass: "text-blue-600 border-blue-600 rounded-t-lg text-blue-500 border-blue-500",
|
|
90
|
+
contentClass: "my-2"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
action: {
|
|
94
|
+
buttonClass: "rounded-lg p-3 text-white disabled:opacity-75",
|
|
95
|
+
primaryClass: "bg-primary-500",
|
|
96
|
+
secondaryClass: "bg-secondary-500",
|
|
97
|
+
iconBeforeClass: "px-2",
|
|
98
|
+
iconAfterClass: "px-2",
|
|
99
|
+
busyIcon: schemas.fontAwesomeIcon("spinner fa-spin")
|
|
100
|
+
},
|
|
101
|
+
layout: {
|
|
102
|
+
className: "flex flex-col",
|
|
103
|
+
errorClass: "text-sm text-red-500"
|
|
104
|
+
},
|
|
105
|
+
data: {
|
|
106
|
+
inputClass: "border rounded p-2",
|
|
107
|
+
displayOnlyClass: "flex flex-row items-center gap-2",
|
|
108
|
+
checkOptions: {
|
|
109
|
+
className: "flex items-center gap-4",
|
|
110
|
+
entryClass: "flex items-center gap-1"
|
|
111
|
+
},
|
|
112
|
+
selectOptions: {
|
|
113
|
+
emptyText: "<select>"
|
|
114
|
+
},
|
|
115
|
+
arrayElementOptions: {
|
|
116
|
+
actionsClass: "my-2 flex gap-2"
|
|
117
|
+
},
|
|
118
|
+
multilineClass: "border p-2",
|
|
119
|
+
autocompleteOptions: {
|
|
120
|
+
className: "w-full flex gap-[5px] pr-[5px] overflow-hidden rounded-lg bg-white border border-solid border-gray-200 min-h-[48px] py-1",
|
|
121
|
+
listContainerClass: "w-full text-sm p-1.5 my-3 mx-0 min-w-[120px] rounded-xl max-h-[300px] bg-white border border-solid border-surface-200 text-surface-900",
|
|
122
|
+
listEntryClass: "p-2 rounded-lg bg-primary-100 text-primary-900",
|
|
123
|
+
chipContainerClass: "flex flex-row items-center px-3 py-1 rounded-full bg-surface-100 m-1 gap-2",
|
|
124
|
+
chipCloseButtonClass: "p-1 bg-surface-300 rounded-full min-w-[24px] flex justify-center text-surface-50"
|
|
125
|
+
},
|
|
126
|
+
scrollListOptions: {
|
|
127
|
+
loadingIcon: schemas.fontAwesomeIcon("spinner fa-spin")
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
adornment: {
|
|
131
|
+
accordion: {
|
|
132
|
+
className: "flex items-center gap-2 my-2 w-fit",
|
|
133
|
+
titleTextClass: "cursor-pointer",
|
|
134
|
+
iconOpen: schemas.fontAwesomeIcon("chevron-up"),
|
|
135
|
+
iconClosed: schemas.fontAwesomeIcon("chevron-down")
|
|
136
|
+
},
|
|
137
|
+
optional: {
|
|
138
|
+
checkClass: "m-2",
|
|
139
|
+
className: "flex items-center gap-2 w-full",
|
|
140
|
+
multiValuesClass: "italic",
|
|
141
|
+
childWrapperClass: "grow"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
var defaultRnTailwindTheme = schemas.deepMerge({
|
|
147
|
+
data: {
|
|
148
|
+
checkOptions: {
|
|
149
|
+
entryClass: "flex flex-row items-center gap-[8px]",
|
|
150
|
+
labelClass: "flex-1"
|
|
151
|
+
},
|
|
152
|
+
selectOptions: {
|
|
153
|
+
emptyText: "select"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
label: {
|
|
157
|
+
labelContainer: function labelContainer(c) {
|
|
158
|
+
return jsxRuntime.jsx(reactNative.View, {
|
|
159
|
+
className: "flex flex-row gap-4 items-center",
|
|
160
|
+
children: c
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
array: {
|
|
165
|
+
removableClass: "flex flex-col gap-y-2"
|
|
166
|
+
},
|
|
167
|
+
action: {
|
|
168
|
+
buttonClass: "flex flex-row gap-2 bg-primary-500 rounded-lg p-3 web:hover:opacity-90 active:opacity-90",
|
|
169
|
+
textClass: "text-white"
|
|
170
|
+
},
|
|
171
|
+
adornment: {
|
|
172
|
+
accordion: {
|
|
173
|
+
className: "flex flex-row items-center gap-2 my-2 p-0 self-start"
|
|
174
|
+
},
|
|
175
|
+
helpText: {
|
|
176
|
+
iconName: "info-circle",
|
|
177
|
+
iconClass: "text-[12px]",
|
|
178
|
+
triggerContainerClass: "flex flex-row gap-2 items-baseline",
|
|
179
|
+
triggerLabelClass: "text-sm font-bold",
|
|
180
|
+
contentTextClass: "text-white font-semibold text-sm"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}, defaultTailwindTheme);
|
|
184
|
+
|
|
56
185
|
function _extends() {
|
|
57
186
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
58
187
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -66,7 +195,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
66
195
|
if (null == r) return {};
|
|
67
196
|
var t = {};
|
|
68
197
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
69
|
-
if (e.
|
|
198
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
70
199
|
t[n] = r[n];
|
|
71
200
|
}
|
|
72
201
|
return t;
|
|
@@ -76,6 +205,91 @@ function cn() {
|
|
|
76
205
|
return tailwindMerge.twMerge(clsx.clsx([].slice.call(arguments)));
|
|
77
206
|
}
|
|
78
207
|
|
|
208
|
+
var _excluded$b = ["className", "asChild"];
|
|
209
|
+
var TextClassContext = /*#__PURE__*/React__namespace.createContext(undefined);
|
|
210
|
+
var RNText = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
211
|
+
var className = _ref.className,
|
|
212
|
+
_ref$asChild = _ref.asChild,
|
|
213
|
+
asChild = _ref$asChild === void 0 ? false : _ref$asChild,
|
|
214
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
215
|
+
var textClass = React__namespace.useContext(TextClassContext);
|
|
216
|
+
var Component = asChild ? Slot__namespace.Text : reactNative.Text;
|
|
217
|
+
return jsxRuntime.jsx(Component, _extends({
|
|
218
|
+
className: cn("text-base text-foreground web:select-text", textClass, className),
|
|
219
|
+
ref: ref
|
|
220
|
+
}, props));
|
|
221
|
+
});
|
|
222
|
+
RNText.displayName = "RNText";
|
|
223
|
+
|
|
224
|
+
var _excluded$a = ["className", "variant", "size"];
|
|
225
|
+
var buttonVariants = classVarianceAuthority.cva("group flex items-center justify-center rounded-md web:ring-offset-background web:transition-colors web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2", {
|
|
226
|
+
variants: {
|
|
227
|
+
variant: {
|
|
228
|
+
"default": "bg-primary web:hover:opacity-90 active:opacity-90",
|
|
229
|
+
destructive: "bg-destructive web:hover:opacity-90 active:opacity-90",
|
|
230
|
+
outline: "border border-input bg-background web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",
|
|
231
|
+
secondary: "bg-secondary web:hover:opacity-80 active:opacity-80",
|
|
232
|
+
ghost: "web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",
|
|
233
|
+
link: "web:underline-offset-4 web:hover:underline web:focus:underline"
|
|
234
|
+
},
|
|
235
|
+
size: {
|
|
236
|
+
"default": "h-10 px-4 py-2 native:h-12 native:px-5 native:py-3",
|
|
237
|
+
sm: "h-9 rounded-md px-3",
|
|
238
|
+
lg: "h-11 rounded-md px-8 native:h-14",
|
|
239
|
+
icon: "h-10 w-10"
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
defaultVariants: {
|
|
243
|
+
variant: "default",
|
|
244
|
+
size: "default"
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
var buttonTextVariants = classVarianceAuthority.cva("web:whitespace-nowrap text-sm native:text-base font-medium text-foreground web:transition-colors", {
|
|
248
|
+
variants: {
|
|
249
|
+
variant: {
|
|
250
|
+
"default": "text-primary-foreground",
|
|
251
|
+
destructive: "text-destructive-foreground",
|
|
252
|
+
outline: "group-active:text-accent-foreground",
|
|
253
|
+
secondary: "text-secondary-foreground group-active:text-secondary-foreground",
|
|
254
|
+
ghost: "group-active:text-accent-foreground",
|
|
255
|
+
link: "text-primary group-active:underline"
|
|
256
|
+
},
|
|
257
|
+
size: {
|
|
258
|
+
"default": "",
|
|
259
|
+
sm: "",
|
|
260
|
+
lg: "native:text-lg",
|
|
261
|
+
icon: ""
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
defaultVariants: {
|
|
265
|
+
variant: "default",
|
|
266
|
+
size: "default"
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
var RNButton$1 = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
270
|
+
var className = _ref.className,
|
|
271
|
+
variant = _ref.variant,
|
|
272
|
+
size = _ref.size,
|
|
273
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
274
|
+
return jsxRuntime.jsx(TextClassContext.Provider, {
|
|
275
|
+
value: buttonTextVariants({
|
|
276
|
+
variant: variant,
|
|
277
|
+
size: size,
|
|
278
|
+
className: "web:pointer-events-none"
|
|
279
|
+
}),
|
|
280
|
+
children: jsxRuntime.jsx(reactNative.Pressable, _extends({
|
|
281
|
+
className: cn(props.disabled && "opacity-50 web:pointer-events-none", buttonVariants({
|
|
282
|
+
variant: variant,
|
|
283
|
+
size: size,
|
|
284
|
+
className: className
|
|
285
|
+
})),
|
|
286
|
+
ref: ref,
|
|
287
|
+
role: "button"
|
|
288
|
+
}, props))
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
RNButton$1.displayName = "Button";
|
|
292
|
+
|
|
79
293
|
nativewind.cssInterop(vectorIcons.FontAwesome, {
|
|
80
294
|
className: {
|
|
81
295
|
target: "style",
|
|
@@ -112,65 +326,133 @@ function Icon(_ref) {
|
|
|
112
326
|
}
|
|
113
327
|
}
|
|
114
328
|
|
|
115
|
-
var _excluded$
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
329
|
+
var _excluded$9 = ["className"];
|
|
330
|
+
function createRNCheckboxRenderer(options) {
|
|
331
|
+
if (options === void 0) {
|
|
332
|
+
options = {};
|
|
333
|
+
}
|
|
334
|
+
return schemas.createDataRenderer(function (props, renderer) {
|
|
335
|
+
return function (p) {
|
|
336
|
+
return _extends({}, p, {
|
|
337
|
+
label: undefined,
|
|
338
|
+
children: jsxRuntime.jsx(CheckBoxRenderer, {
|
|
339
|
+
p: p,
|
|
340
|
+
renderer: renderer,
|
|
341
|
+
options: options,
|
|
342
|
+
props: props
|
|
343
|
+
})
|
|
344
|
+
});
|
|
345
|
+
};
|
|
346
|
+
}, {
|
|
347
|
+
renderType: schemas.DataRenderType.Checkbox
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
function CheckBoxRenderer(_ref) {
|
|
351
|
+
var _effect = core.useComponentTracking();
|
|
352
|
+
try {
|
|
353
|
+
var onCheckboxPressed = function onCheckboxPressed() {
|
|
354
|
+
control.touched = true;
|
|
355
|
+
control.value = !value;
|
|
356
|
+
};
|
|
357
|
+
var p = _ref.p,
|
|
358
|
+
props = _ref.props,
|
|
359
|
+
renderer = _ref.renderer,
|
|
360
|
+
options = _ref.options;
|
|
361
|
+
var control = props.control.as();
|
|
362
|
+
var _formControlProps = core.formControlProps(control),
|
|
363
|
+
value = _formControlProps.value;
|
|
364
|
+
var _formControlProps2 = core.formControlProps(control),
|
|
365
|
+
disabled = _formControlProps2.disabled;
|
|
366
|
+
var checkboxDisabled = disabled || props.readonly;
|
|
367
|
+
return jsxRuntime.jsxs(reactNative.Pressable, {
|
|
368
|
+
className: schemas.rendererClass(props.className, options.entryClass),
|
|
369
|
+
onPress: onCheckboxPressed,
|
|
370
|
+
disabled: checkboxDisabled,
|
|
371
|
+
children: [jsxRuntime.jsx(RNCheckbox, {
|
|
372
|
+
id: props.id,
|
|
373
|
+
className: options.checkClass,
|
|
374
|
+
checked: !!value,
|
|
375
|
+
onCheckedChange: onCheckboxPressed,
|
|
376
|
+
disabled: checkboxDisabled
|
|
377
|
+
}), p.label && renderer.renderLabel(p.label, undefined, undefined)]
|
|
378
|
+
});
|
|
379
|
+
} finally {
|
|
380
|
+
_effect();
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
var RNCheckbox = /*#__PURE__*/React__namespace.forwardRef(function (_ref2, ref) {
|
|
384
|
+
var className = _ref2.className,
|
|
385
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$9);
|
|
119
386
|
return jsxRuntime.jsx(CheckboxPrimitive__namespace.Root, _extends({
|
|
120
387
|
ref: ref,
|
|
121
|
-
className: cn("web:peer h-4 w-4 native:h-[
|
|
388
|
+
className: cn("web:peer h-4 w-4 native:h-[24px] native:w-[24px] shrink-0 rounded-sm native:rounded border border-accent web:ring-offset-background web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className)
|
|
122
389
|
}, props, {
|
|
123
390
|
children: jsxRuntime.jsx(CheckboxPrimitive__namespace.Indicator, {
|
|
124
391
|
className: cn("items-center justify-center h-full w-full"),
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
392
|
+
asChild: true,
|
|
393
|
+
children: jsxRuntime.jsx(reactNative.View, {
|
|
394
|
+
children: jsxRuntime.jsx(Icon, {
|
|
395
|
+
name: "check",
|
|
396
|
+
className: "text-accent text-[18px]"
|
|
397
|
+
})
|
|
128
398
|
})
|
|
129
399
|
})
|
|
130
400
|
}));
|
|
131
401
|
});
|
|
132
402
|
RNCheckbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
|
|
133
403
|
|
|
134
|
-
var _excluded$
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
404
|
+
var _excluded$8 = ["renderOptions", "control", "readonly"],
|
|
405
|
+
_excluded2$5 = ["className", "placeholderClassName"];
|
|
406
|
+
function createRNTextInputRenderer(inputClass, inputTextClass) {
|
|
407
|
+
return schemas.createDataRenderer(function (p) {
|
|
408
|
+
var renderOptions = p.renderOptions,
|
|
409
|
+
control = p.control,
|
|
410
|
+
readonly = p.readonly,
|
|
411
|
+
rest = _objectWithoutPropertiesLoose(p, _excluded$8);
|
|
412
|
+
var _formControlProps = core.formControlProps(control),
|
|
413
|
+
disabled = _formControlProps.disabled;
|
|
414
|
+
var placeholder = renderOptions.placeholder,
|
|
415
|
+
multiline = renderOptions.multiline,
|
|
416
|
+
keyboardType = renderOptions.keyboardType,
|
|
417
|
+
autoComplete = renderOptions.autoComplete;
|
|
418
|
+
return jsxRuntime.jsx(RNTextInput, _extends({}, rest, {
|
|
419
|
+
className: cn(schemas.rendererClass(p.className, inputClass), schemas.rendererClass(p.textClass, inputTextClass)),
|
|
420
|
+
disabled: disabled,
|
|
421
|
+
readOnly: readonly,
|
|
422
|
+
placeholder: placeholder,
|
|
423
|
+
defaultValue: control.value,
|
|
424
|
+
onChangeText: function onChangeText(v) {
|
|
425
|
+
return control.value = v;
|
|
426
|
+
},
|
|
427
|
+
multiline: multiline,
|
|
428
|
+
keyboardType: keyboardType,
|
|
429
|
+
autoComplete: autoComplete
|
|
430
|
+
}));
|
|
431
|
+
}, {
|
|
432
|
+
renderType: schemas.DataRenderType.Textfield
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
function RNTextInput(_ref) {
|
|
436
|
+
var _effect = core.useComponentTracking();
|
|
437
|
+
try {
|
|
438
|
+
var className = _ref.className,
|
|
439
|
+
placeholderClassName = _ref.placeholderClassName,
|
|
440
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded2$5);
|
|
441
|
+
var editable = !props.disabled;
|
|
442
|
+
var readonly = props.readOnly ? true : undefined;
|
|
443
|
+
return jsxRuntime.jsx(reactNative.TextInput, _extends({}, props, {
|
|
444
|
+
className: cn("native:min-h-[54px] rounded-md border bg-background px-3 native:py-[6px] text-base lg:text-sm native:text-lg native:leading-[1.25] text-foreground placeholder:text-muted-foreground file:border-0 file:bg-transparent file:font-medium", !editable && "opacity-50", className),
|
|
445
|
+
placeholderClassName: cn("text-muted-foreground", placeholderClassName),
|
|
446
|
+
editable: editable,
|
|
447
|
+
readOnly: readonly
|
|
448
|
+
}));
|
|
449
|
+
} finally {
|
|
450
|
+
_effect();
|
|
451
|
+
}
|
|
452
|
+
}
|
|
150
453
|
RNTextInput.displayName = "RNInput";
|
|
151
454
|
|
|
152
|
-
var _excluded$
|
|
153
|
-
var RNRadioItem = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
154
|
-
var className = _ref.className,
|
|
155
|
-
checked = _ref.checked,
|
|
156
|
-
onChange = _ref.onChange,
|
|
157
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
158
|
-
return jsxRuntime.jsx(reactNative.Pressable, _extends({
|
|
159
|
-
ref: ref,
|
|
160
|
-
onPress: onChange,
|
|
161
|
-
className: cn("aspect-square h-4 w-4 native:h-5 native:w-5 rounded-full justify-center items-center border border-primary text-primary web:ring-offset-background web:focus:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2", props.disabled && "web:cursor-not-allowed opacity-50", className)
|
|
162
|
-
}, props, {
|
|
163
|
-
children: jsxRuntime.jsx(reactNative.View, {
|
|
164
|
-
className: "flex items-center justify-center",
|
|
165
|
-
children: checked && jsxRuntime.jsx(reactNative.View, {
|
|
166
|
-
className: "aspect-square h-[9px] w-[9px] native:h-[10] native:w-[10] bg-primary rounded-full"
|
|
167
|
-
})
|
|
168
|
-
})
|
|
169
|
-
}));
|
|
170
|
-
});
|
|
171
|
-
RNRadioItem.displayName = RadioGroupPrimitive__namespace.Item.displayName;
|
|
172
|
-
|
|
173
|
-
var _excluded$5 = ["control", "mode", "locale", "is24Hour", "className"];
|
|
455
|
+
var _excluded$7 = ["control", "mode", "locale", "is24Hour", "className"];
|
|
174
456
|
function createRNDateTimePickerRenderer(options) {
|
|
175
457
|
if (options === void 0) {
|
|
176
458
|
options = {};
|
|
@@ -200,7 +482,7 @@ function RNDateTimePicker(_ref) {
|
|
|
200
482
|
try {
|
|
201
483
|
switch (mode) {
|
|
202
484
|
case "date":
|
|
203
|
-
return date.parseDate(dateString).toDate(
|
|
485
|
+
return date.parseDate(dateString).toDate("UTC");
|
|
204
486
|
case "datetime":
|
|
205
487
|
return date.parseAbsolute(dateString, date.getLocalTimeZone()).toDate();
|
|
206
488
|
case "time":
|
|
@@ -220,7 +502,7 @@ function RNDateTimePicker(_ref) {
|
|
|
220
502
|
day: "2-digit",
|
|
221
503
|
month: "2-digit",
|
|
222
504
|
year: "numeric",
|
|
223
|
-
timeZone:
|
|
505
|
+
timeZone: "UTC"
|
|
224
506
|
};
|
|
225
507
|
break;
|
|
226
508
|
case "datetime":
|
|
@@ -256,7 +538,7 @@ function RNDateTimePicker(_ref) {
|
|
|
256
538
|
_ref$is24Hour = _ref.is24Hour,
|
|
257
539
|
is24Hour = _ref$is24Hour === void 0 ? true : _ref$is24Hour,
|
|
258
540
|
className = _ref.className,
|
|
259
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
541
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
260
542
|
var disabled = control.disabled;
|
|
261
543
|
var maximumDate = props.maximumDate,
|
|
262
544
|
minimumDate = props.minimumDate;
|
|
@@ -340,18 +622,55 @@ function RNHtmlRenderer(_ref) {
|
|
|
340
622
|
}
|
|
341
623
|
}
|
|
342
624
|
|
|
343
|
-
var _excluded$
|
|
344
|
-
|
|
625
|
+
var _excluded$6 = ["className", "checked", "onChange"];
|
|
626
|
+
var RNRadioItem = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
627
|
+
var className = _ref.className,
|
|
628
|
+
checked = _ref.checked,
|
|
629
|
+
onChange = _ref.onChange,
|
|
630
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
631
|
+
return jsxRuntime.jsx(reactNative.Pressable, _extends({
|
|
632
|
+
ref: ref,
|
|
633
|
+
onPress: onChange,
|
|
634
|
+
className: cn("aspect-square h-4 w-4 native:h-5 native:w-5 rounded-full justify-center items-center border border-primary text-primary web:ring-offset-background web:focus:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2", props.disabled && "web:cursor-not-allowed opacity-50", className)
|
|
635
|
+
}, props, {
|
|
636
|
+
children: jsxRuntime.jsx(reactNative.View, {
|
|
637
|
+
className: "flex items-center justify-center",
|
|
638
|
+
children: checked && jsxRuntime.jsx(reactNative.View, {
|
|
639
|
+
className: "aspect-square h-[9px] w-[9px] native:h-[10] native:w-[10] bg-primary rounded-full"
|
|
640
|
+
})
|
|
641
|
+
})
|
|
642
|
+
}));
|
|
643
|
+
});
|
|
644
|
+
RNRadioItem.displayName = RadioGroupPrimitive__namespace.Item.displayName;
|
|
645
|
+
|
|
646
|
+
// Utility function to create select conversion based on field type
|
|
647
|
+
function createSelectConversion(ft) {
|
|
648
|
+
switch (ft) {
|
|
649
|
+
case schemas.FieldType.String:
|
|
650
|
+
case schemas.FieldType.Int:
|
|
651
|
+
case schemas.FieldType.Double:
|
|
652
|
+
return function (a) {
|
|
653
|
+
return a;
|
|
654
|
+
};
|
|
655
|
+
default:
|
|
656
|
+
return function (a) {
|
|
657
|
+
var _a$toString;
|
|
658
|
+
return (_a$toString = a == null ? void 0 : a.toString()) != null ? _a$toString : "";
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
var _excluded$5 = ["state", "options", "className", "convert", "required", "emptyText", "requiredText", "portalHost", "readonly"],
|
|
664
|
+
_excluded2$4 = ["ref", "className", "children"],
|
|
345
665
|
_excluded3$2 = ["className", "children", "position", "portalHost"],
|
|
346
666
|
_excluded4$2 = ["className"],
|
|
347
|
-
_excluded5 = ["className", "children"]
|
|
348
|
-
_excluded6 = ["className"];
|
|
667
|
+
_excluded5 = ["className", "children"];
|
|
349
668
|
function createRNSelectRenderer(options) {
|
|
350
669
|
if (options === void 0) {
|
|
351
670
|
options = {};
|
|
352
671
|
}
|
|
353
672
|
return schemas.createDataRenderer(function (props, asArray) {
|
|
354
|
-
var _props$options;
|
|
673
|
+
var _props$options, _renderOptions$requir;
|
|
355
674
|
var renderOptions = props.definition.renderOptions;
|
|
356
675
|
return jsxRuntime.jsx(RNSelectRenderer, {
|
|
357
676
|
className: schemas.rendererClass(props.className, options.className),
|
|
@@ -361,8 +680,8 @@ function createRNSelectRenderer(options) {
|
|
|
361
680
|
options: (_props$options = props.options) != null ? _props$options : [],
|
|
362
681
|
required: props.required,
|
|
363
682
|
emptyText: options.emptyText,
|
|
364
|
-
requiredText: options.requiredText,
|
|
365
|
-
convert:
|
|
683
|
+
requiredText: (_renderOptions$requir = renderOptions.requiredText) != null ? _renderOptions$requir : options.requiredText,
|
|
684
|
+
convert: createSelectConversion(props.field.type),
|
|
366
685
|
portalHost: renderOptions.portalHost
|
|
367
686
|
});
|
|
368
687
|
}, {
|
|
@@ -378,8 +697,7 @@ function RNSelectRenderer(_ref) {
|
|
|
378
697
|
return jsxRuntime.jsx(SelectItem, {
|
|
379
698
|
value: convert(x.value).toString(),
|
|
380
699
|
label: x.name,
|
|
381
|
-
disabled: !!x.disabled
|
|
382
|
-
children: x.name
|
|
700
|
+
disabled: !!x.disabled
|
|
383
701
|
}, i);
|
|
384
702
|
};
|
|
385
703
|
var state = _ref.state,
|
|
@@ -392,7 +710,8 @@ function RNSelectRenderer(_ref) {
|
|
|
392
710
|
_ref$requiredText = _ref.requiredText,
|
|
393
711
|
requiredText = _ref$requiredText === void 0 ? "Please select" : _ref$requiredText,
|
|
394
712
|
portalHost = _ref.portalHost,
|
|
395
|
-
|
|
713
|
+
readonly = _ref.readonly,
|
|
714
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
396
715
|
var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
397
716
|
var contentInsets = {
|
|
398
717
|
top: insets.top,
|
|
@@ -405,6 +724,7 @@ function RNSelectRenderer(_ref) {
|
|
|
405
724
|
};
|
|
406
725
|
var value = state.value,
|
|
407
726
|
disabled = state.disabled;
|
|
727
|
+
// const showEmpty = useControl(!required || value == null);
|
|
408
728
|
var optionStringMap = React.useMemo(function () {
|
|
409
729
|
return Object.fromEntries(options.map(function (x) {
|
|
410
730
|
return [convert(x.value), x.value];
|
|
@@ -427,9 +747,11 @@ function RNSelectRenderer(_ref) {
|
|
|
427
747
|
};
|
|
428
748
|
}).at(0);
|
|
429
749
|
});
|
|
750
|
+
var selectContentWidth = core.useControl(100); // Min width 100 px
|
|
751
|
+
var selectContentWidthValue = selectContentWidth.value;
|
|
430
752
|
return jsxRuntime.jsxs(Select, _extends({}, props, {
|
|
431
|
-
disabled: disabled,
|
|
432
|
-
"aria-disabled": disabled,
|
|
753
|
+
disabled: disabled || readonly,
|
|
754
|
+
"aria-disabled": disabled || readonly,
|
|
433
755
|
defaultValue: {
|
|
434
756
|
value: value,
|
|
435
757
|
label: required ? requiredText : emptyText
|
|
@@ -439,14 +761,23 @@ function RNSelectRenderer(_ref) {
|
|
|
439
761
|
state.value = optionStringMap[o.value];
|
|
440
762
|
},
|
|
441
763
|
value: selectedOption.value,
|
|
764
|
+
className: "flex-1",
|
|
442
765
|
children: [jsxRuntime.jsx(SelectTrigger, {
|
|
443
766
|
className: "bg-white",
|
|
767
|
+
onLayout: function onLayout(e) {
|
|
768
|
+
selectContentWidth.value = e.nativeEvent.layout.width;
|
|
769
|
+
},
|
|
770
|
+
disabled: disabled || readonly,
|
|
771
|
+
"aria-disabled": disabled || readonly,
|
|
444
772
|
children: jsxRuntime.jsx(SelectValue, {
|
|
445
773
|
placeholder: required ? requiredText : emptyText
|
|
446
774
|
})
|
|
447
775
|
}), jsxRuntime.jsx(SelectContent, {
|
|
448
776
|
insets: contentInsets,
|
|
449
|
-
className: "bg-white
|
|
777
|
+
className: "bg-white",
|
|
778
|
+
style: {
|
|
779
|
+
width: selectContentWidthValue
|
|
780
|
+
},
|
|
450
781
|
portalHost: reactNative.Platform.select({
|
|
451
782
|
ios: portalHost
|
|
452
783
|
}),
|
|
@@ -473,23 +804,30 @@ function RNSelectRenderer(_ref) {
|
|
|
473
804
|
var Select = SelectPrimitive__namespace.Root;
|
|
474
805
|
var SelectGroup = SelectPrimitive__namespace.Group;
|
|
475
806
|
var SelectValue = SelectPrimitive__namespace.Value;
|
|
476
|
-
|
|
477
|
-
var
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
})
|
|
492
|
-
|
|
807
|
+
function SelectTrigger(_ref2) {
|
|
808
|
+
var _effect2 = core.useComponentTracking();
|
|
809
|
+
try {
|
|
810
|
+
var ref = _ref2.ref,
|
|
811
|
+
className = _ref2.className,
|
|
812
|
+
children = _ref2.children,
|
|
813
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$4);
|
|
814
|
+
return jsxRuntime.jsxs(SelectPrimitive__namespace.Trigger, _extends({
|
|
815
|
+
ref: ref,
|
|
816
|
+
className: cn("flex flex-row min-h-10 native:min-h-12 items-center text-sm justify-between border border-[#E7E7E8] bg-background px-3 py-2 [&>span]:line-clamp-1 min-w-[128px]", props.disabled && "opacity-50", className)
|
|
817
|
+
}, props, {
|
|
818
|
+
children: [jsxRuntime.jsx(reactNative.Pressable, {
|
|
819
|
+
pointerEvents: "none",
|
|
820
|
+
className: "flex-1",
|
|
821
|
+
children: children
|
|
822
|
+
}), jsxRuntime.jsx(Icon, {
|
|
823
|
+
name: "chevron-down",
|
|
824
|
+
className: "!text-[12px] text-accent"
|
|
825
|
+
})]
|
|
826
|
+
}));
|
|
827
|
+
} finally {
|
|
828
|
+
_effect2();
|
|
829
|
+
}
|
|
830
|
+
}
|
|
493
831
|
var SelectContent = /*#__PURE__*/React__namespace.forwardRef(function (_ref3, ref) {
|
|
494
832
|
var className = _ref3.className,
|
|
495
833
|
children = _ref3.children,
|
|
@@ -536,7 +874,7 @@ var SelectItem = /*#__PURE__*/React__namespace.forwardRef(function (_ref5, ref)
|
|
|
536
874
|
props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
|
|
537
875
|
return jsxRuntime.jsxs(SelectPrimitive__namespace.Item, _extends({
|
|
538
876
|
ref: ref,
|
|
539
|
-
className: cn("relative web:group flex flex-row w-full web:cursor-default web:select-none items-center rounded-sm py-1.5 native:py-2 pl-8 native:pl-10 pr-2 web:hover:bg-
|
|
877
|
+
className: cn("relative web:group flex flex-row w-full web:cursor-default web:select-none items-center rounded-sm py-1.5 native:py-2 pl-8 native:pl-10 pr-2 web:hover:bg-[#DDD]/50 active:bg-[#DDD] web:outline-none web:focus:bg-[#DDD]", props.disabled && "web:pointer-events-none opacity-50", className)
|
|
540
878
|
}, props, {
|
|
541
879
|
children: [jsxRuntime.jsx(reactNative.View, {
|
|
542
880
|
className: "absolute left-2 native:left-3.5 flex h-3.5 native:pt-px w-3.5 items-center justify-center",
|
|
@@ -552,79 +890,1823 @@ var SelectItem = /*#__PURE__*/React__namespace.forwardRef(function (_ref5, ref)
|
|
|
552
890
|
}));
|
|
553
891
|
});
|
|
554
892
|
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
893
|
+
|
|
894
|
+
var _excluded$4 = ["className"],
|
|
895
|
+
_excluded2$3 = ["className", "children"],
|
|
896
|
+
_excluded3$1 = ["className", "children", "portalHost", "closeOnOutsidePress"],
|
|
897
|
+
_excluded4$1 = ["className"];
|
|
898
|
+
var Dialog = DialogPrimitive__namespace.Root;
|
|
899
|
+
var DialogTrigger = DialogPrimitive__namespace.Trigger;
|
|
900
|
+
var DialogPortal = DialogPrimitive__namespace.Portal;
|
|
901
|
+
var DialogClose = DialogPrimitive__namespace.Close;
|
|
902
|
+
function DialogOverlayWeb(_ref) {
|
|
903
|
+
var _effect = core.useComponentTracking();
|
|
904
|
+
try {
|
|
905
|
+
var className = _ref.className,
|
|
906
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
907
|
+
var _DialogPrimitive$useR = DialogPrimitive__namespace.useRootContext(),
|
|
908
|
+
open = _DialogPrimitive$useR.open;
|
|
909
|
+
return jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, _extends({
|
|
910
|
+
className: cn("bg-black/80 flex justify-center items-center p-2 absolute top-0 right-0 bottom-0 left-0", open ? "web:animate-in web:fade-in-0" : "web:animate-out web:fade-out-0", className)
|
|
911
|
+
}, props));
|
|
912
|
+
} finally {
|
|
913
|
+
_effect();
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
DialogOverlayWeb.displayName = "DialogOverlayWeb";
|
|
917
|
+
function DialogOverlayNative(_ref2) {
|
|
918
|
+
var _effect2 = core.useComponentTracking();
|
|
919
|
+
try {
|
|
920
|
+
var className = _ref2.className,
|
|
921
|
+
children = _ref2.children,
|
|
922
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
|
|
923
|
+
return jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, _extends({
|
|
924
|
+
style: reactNative.StyleSheet.absoluteFill,
|
|
925
|
+
className: cn("flex bg-black/80 justify-center items-center p-2", className)
|
|
926
|
+
}, props, {
|
|
927
|
+
children: jsxRuntime.jsx(Animated__default["default"].View, {
|
|
928
|
+
children: children
|
|
929
|
+
})
|
|
930
|
+
}));
|
|
931
|
+
} finally {
|
|
932
|
+
_effect2();
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
DialogOverlayNative.displayName = "DialogOverlayNative";
|
|
936
|
+
var DialogOverlay = reactNative.Platform.select({
|
|
937
|
+
web: DialogOverlayWeb,
|
|
938
|
+
"default": DialogOverlayNative
|
|
939
|
+
});
|
|
940
|
+
var DialogContent = /*#__PURE__*/React__namespace.forwardRef(function (_ref3, ref) {
|
|
941
|
+
var className = _ref3.className,
|
|
942
|
+
children = _ref3.children,
|
|
943
|
+
portalHost = _ref3.portalHost,
|
|
944
|
+
closeOnOutsidePress = _ref3.closeOnOutsidePress,
|
|
945
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded3$1);
|
|
946
|
+
var _DialogPrimitive$useR2 = DialogPrimitive__namespace.useRootContext(),
|
|
947
|
+
open = _DialogPrimitive$useR2.open;
|
|
948
|
+
return jsxRuntime.jsx(DialogPortal, {
|
|
949
|
+
hostName: portalHost,
|
|
950
|
+
children: jsxRuntime.jsx(DialogOverlay, {
|
|
951
|
+
closeOnPress: closeOnOutsidePress,
|
|
952
|
+
children: jsxRuntime.jsx(DialogPrimitive__namespace.Content, _extends({
|
|
953
|
+
ref: ref,
|
|
954
|
+
className: cn("max-w-lg gap-4 border border-[#E7E7E8] web:cursor-default bg-white p-6 shadow-lg web:duration-200 rounded-lg", open ? "web:animate-in web:fade-in-0 web:zoom-in-95" : "web:animate-out web:fade-out-0 web:zoom-out-95", className)
|
|
955
|
+
}, props, {
|
|
956
|
+
children: children
|
|
957
|
+
}))
|
|
958
|
+
})
|
|
959
|
+
});
|
|
960
|
+
});
|
|
961
|
+
DialogContent.displayName = DialogPrimitive__namespace.Content.displayName;
|
|
962
|
+
var DialogTitle = /*#__PURE__*/React__namespace.forwardRef(function (_ref4, ref) {
|
|
963
|
+
var className = _ref4.className,
|
|
964
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded4$1);
|
|
965
|
+
return jsxRuntime.jsx(DialogPrimitive__namespace.Title, _extends({
|
|
559
966
|
ref: ref,
|
|
560
|
-
className: cn(
|
|
967
|
+
className: cn(className)
|
|
561
968
|
}, props));
|
|
562
969
|
});
|
|
563
|
-
|
|
970
|
+
DialogTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
971
|
+
/**
|
|
972
|
+
* If the content is <ScrollView>, the first child of the ScrollView should be a View with a prop of onStartShouldSetResponder={() => true}
|
|
973
|
+
*/
|
|
974
|
+
function RNDialog(_ref5) {
|
|
975
|
+
var _effect3 = core.useComponentTracking();
|
|
976
|
+
try {
|
|
977
|
+
var title = _ref5.title,
|
|
978
|
+
trigger = _ref5.trigger,
|
|
979
|
+
content = _ref5.content,
|
|
980
|
+
footer = _ref5.footer,
|
|
981
|
+
open = _ref5.open,
|
|
982
|
+
_onOpenChange = _ref5.onOpenChange,
|
|
983
|
+
_ref5$closeOnOutsideP = _ref5.closeOnOutsidePress,
|
|
984
|
+
closeOnOutsidePress = _ref5$closeOnOutsideP === void 0 ? false : _ref5$closeOnOutsideP,
|
|
985
|
+
containerClass = _ref5.containerClass,
|
|
986
|
+
portalHost = _ref5.portalHost;
|
|
987
|
+
var dialogOpen = open != null ? open : core.useControl(false);
|
|
988
|
+
var _useWindowDimensions = reactNative.useWindowDimensions(),
|
|
989
|
+
width = _useWindowDimensions.width;
|
|
990
|
+
var maxWidth = React.useMemo(function () {
|
|
991
|
+
return Math.min(width - 32, 1024);
|
|
992
|
+
}, [width]);
|
|
993
|
+
return jsxRuntime.jsxs(Dialog, {
|
|
994
|
+
open: dialogOpen.value,
|
|
995
|
+
onOpenChange: function onOpenChange(o) {
|
|
996
|
+
if (_onOpenChange) {
|
|
997
|
+
_onOpenChange(o);
|
|
998
|
+
} else {
|
|
999
|
+
dialogOpen.value = o;
|
|
1000
|
+
}
|
|
1001
|
+
},
|
|
1002
|
+
children: [trigger && jsxRuntime.jsx(DialogTrigger, {
|
|
1003
|
+
asChild: true,
|
|
1004
|
+
children: trigger
|
|
1005
|
+
}), jsxRuntime.jsxs(DialogContent, {
|
|
1006
|
+
closeOnOutsidePress: closeOnOutsidePress,
|
|
1007
|
+
className: cn("min-w-[200px] min-h-[200px] z-10", containerClass),
|
|
1008
|
+
style: {
|
|
1009
|
+
maxWidth: maxWidth
|
|
1010
|
+
},
|
|
1011
|
+
portalHost: reactNative.Platform.select({
|
|
1012
|
+
ios: portalHost
|
|
1013
|
+
}),
|
|
1014
|
+
children: [jsxRuntime.jsxs(reactNative.View, {
|
|
1015
|
+
className: "flex flex-row gap-[10px] justify-between items-start w-full",
|
|
1016
|
+
children: [jsxRuntime.jsx(DialogTitle, {
|
|
1017
|
+
asChild: true,
|
|
1018
|
+
className: "flex-1 flex-shrink title2",
|
|
1019
|
+
children: title
|
|
1020
|
+
}), jsxRuntime.jsx(DialogClose, {
|
|
1021
|
+
className: "rounded-sm",
|
|
1022
|
+
asChild: true,
|
|
1023
|
+
children: jsxRuntime.jsx(reactNative.TouchableOpacity, {
|
|
1024
|
+
children: jsxRuntime.jsx(vectorIcons.FontAwesome6, {
|
|
1025
|
+
name: "xmark-circle",
|
|
1026
|
+
size: 24,
|
|
1027
|
+
color: "#267151"
|
|
1028
|
+
})
|
|
1029
|
+
})
|
|
1030
|
+
})]
|
|
1031
|
+
}), content, footer]
|
|
1032
|
+
})]
|
|
1033
|
+
});
|
|
1034
|
+
} finally {
|
|
1035
|
+
_effect3();
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
564
1038
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
};
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
1039
|
+
function createRNScrollListRenderer(options) {
|
|
1040
|
+
if (options === void 0) {
|
|
1041
|
+
options = {};
|
|
1042
|
+
}
|
|
1043
|
+
return schemas.createDataRenderer(function (p, renderer) {
|
|
1044
|
+
return jsxRuntime.jsx(RNScrollListRenderer, {
|
|
1045
|
+
dataProps: p,
|
|
1046
|
+
renderer: renderer,
|
|
1047
|
+
options: options
|
|
1048
|
+
});
|
|
1049
|
+
}, {
|
|
1050
|
+
collection: true,
|
|
1051
|
+
renderType: schemas.DataRenderType.ScrollList
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
function RNScrollListRenderer(_ref) {
|
|
1055
|
+
var _effect = core.useComponentTracking();
|
|
1056
|
+
try {
|
|
1057
|
+
var _renderItem = function _renderItem(item) {
|
|
1058
|
+
var children = renderChild(item);
|
|
1059
|
+
return /*#__PURE__*/React.isValidElement(children) ? children : null;
|
|
1060
|
+
};
|
|
1061
|
+
var _ref$dataProps = _ref.dataProps,
|
|
1062
|
+
formNode = _ref$dataProps.formNode,
|
|
1063
|
+
renderChild = _ref$dataProps.renderChild,
|
|
1064
|
+
dataNode = _ref$dataProps.dataNode,
|
|
1065
|
+
actionOnClick = _ref$dataProps.actionOnClick,
|
|
1066
|
+
renderOptions = _ref$dataProps.renderOptions,
|
|
1067
|
+
dataContext = _ref$dataProps.dataContext,
|
|
1068
|
+
className = _ref$dataProps.className,
|
|
1069
|
+
renderer = _ref.renderer,
|
|
1070
|
+
options = _ref.options;
|
|
1071
|
+
var elements = formNode.children;
|
|
1072
|
+
var itemGap = options.itemGap,
|
|
1073
|
+
contentContainerClassName = options.contentContainerClassName,
|
|
1074
|
+
refreshControlTintColor = options.refreshControlTintColor;
|
|
1075
|
+
var bottomActionId = renderOptions.bottomActionId,
|
|
1076
|
+
refreshActionId = renderOptions.refreshActionId;
|
|
1077
|
+
var loadingControl = schemas.getLoadingControl(dataNode.control);
|
|
1078
|
+
var hasMoreControl = schemas.getHasMoreControl(dataNode.control);
|
|
1079
|
+
var refreshingControl = schemas.getRefreshingControl(dataNode.control);
|
|
1080
|
+
var handleLoadMore = bottomActionId ? actionOnClick == null ? void 0 : actionOnClick(bottomActionId, undefined, dataContext) : undefined;
|
|
1081
|
+
var handleRefresh = refreshActionId ? actionOnClick == null ? void 0 : actionOnClick(refreshActionId, undefined, dataContext) : undefined;
|
|
1082
|
+
return jsxRuntime.jsx(reactNative.FlatList, {
|
|
1083
|
+
refreshControl: jsxRuntime.jsx(reactNative.RefreshControl, {
|
|
1084
|
+
refreshing: refreshingControl.value,
|
|
1085
|
+
onRefresh: function onRefresh() {
|
|
1086
|
+
if (loadingControl.value) return;
|
|
1087
|
+
handleRefresh == null || handleRefresh(schemas.NoOpControlActionContext);
|
|
1088
|
+
},
|
|
1089
|
+
colors: refreshControlTintColor ? [refreshControlTintColor] : undefined,
|
|
1090
|
+
tintColor: refreshControlTintColor
|
|
1091
|
+
}),
|
|
1092
|
+
renderItem: function renderItem(_ref2) {
|
|
1093
|
+
var item = _ref2.item;
|
|
1094
|
+
return _renderItem(item);
|
|
1095
|
+
},
|
|
1096
|
+
data: elements,
|
|
1097
|
+
style: {
|
|
1098
|
+
flex: 1
|
|
1099
|
+
},
|
|
1100
|
+
contentContainerClassName: contentContainerClassName,
|
|
1101
|
+
ItemSeparatorComponent: function ItemSeparatorComponent() {
|
|
1102
|
+
return !!itemGap && jsxRuntime.jsx(reactNative.View, {
|
|
1103
|
+
style: {
|
|
1104
|
+
height: itemGap
|
|
1105
|
+
}
|
|
1106
|
+
});
|
|
1107
|
+
},
|
|
1108
|
+
showsVerticalScrollIndicator: false,
|
|
1109
|
+
onEndReachedThreshold: 0.4,
|
|
1110
|
+
onEndReached: function onEndReached() {
|
|
1111
|
+
if (!hasMoreControl.value || loadingControl.value) return;
|
|
1112
|
+
handleLoadMore == null || handleLoadMore(schemas.NoOpControlActionContext);
|
|
1113
|
+
},
|
|
1114
|
+
keyExtractor: function keyExtractor(item) {
|
|
1115
|
+
return item.uniqueId;
|
|
1116
|
+
},
|
|
1117
|
+
ListEmptyComponent: jsxRuntime.jsx(reactNative.View, {
|
|
1118
|
+
className: "h-full items-center justify-center",
|
|
1119
|
+
children: loadingControl.value ? jsxRuntime.jsx(reactNative.ActivityIndicator, {
|
|
1120
|
+
size: "large",
|
|
1121
|
+
color: refreshControlTintColor
|
|
1122
|
+
}) : jsxRuntime.jsx(reactNative.Text, {
|
|
1123
|
+
className: "headline",
|
|
1124
|
+
children: "No results found"
|
|
1125
|
+
})
|
|
1126
|
+
}),
|
|
1127
|
+
ListFooterComponent: elements.length > 0 ? jsxRuntime.jsx(reactNative.View, {
|
|
1128
|
+
className: "flex flex-row items-center justify-center py-[16px]",
|
|
1129
|
+
children: hasMoreControl.value ? loadingControl.value && jsxRuntime.jsx(reactNative.ActivityIndicator, {
|
|
1130
|
+
size: "large"
|
|
1131
|
+
}) : jsxRuntime.jsx(reactNative.Text, {
|
|
1132
|
+
className: "subhead",
|
|
1133
|
+
children: "You\u2019ve reached the end of the list."
|
|
1134
|
+
})
|
|
1135
|
+
}) : undefined
|
|
1136
|
+
});
|
|
1137
|
+
} finally {
|
|
1138
|
+
_effect();
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
function createDefaultDisplayRenderer(options) {
|
|
1143
|
+
if (options === void 0) {
|
|
1144
|
+
options = {};
|
|
1145
|
+
}
|
|
1146
|
+
return {
|
|
1147
|
+
render: function render(props, renderer) {
|
|
1148
|
+
return jsxRuntime.jsx(DefaultDisplay, {
|
|
1149
|
+
options: options,
|
|
1150
|
+
displayProps: props,
|
|
1151
|
+
renderer: renderer
|
|
1152
|
+
});
|
|
1153
|
+
},
|
|
1154
|
+
type: "display"
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
function DefaultDisplay(_ref) {
|
|
1158
|
+
var _effect = core.useComponentTracking();
|
|
1159
|
+
try {
|
|
1160
|
+
var _iconDisplay$icon, _iconDisplay$icon2;
|
|
1161
|
+
var renderer = _ref.renderer,
|
|
1162
|
+
options = _ref.options,
|
|
1163
|
+
displayProps = _ref.displayProps;
|
|
1164
|
+
var data = displayProps.data,
|
|
1165
|
+
display = displayProps.display,
|
|
1166
|
+
className = displayProps.className,
|
|
1167
|
+
textClass = displayProps.textClass,
|
|
1168
|
+
style = displayProps.style;
|
|
1169
|
+
var _renderer$html = renderer.html,
|
|
1170
|
+
I = _renderer$html.I,
|
|
1171
|
+
Div = _renderer$html.Div,
|
|
1172
|
+
B = _renderer$html.B,
|
|
1173
|
+
H1 = _renderer$html.H1,
|
|
1174
|
+
Span = _renderer$html.Span;
|
|
1175
|
+
switch (data.type) {
|
|
1176
|
+
case schemas.DisplayDataType.Icon:
|
|
1177
|
+
var iconDisplay = data;
|
|
1178
|
+
return jsxRuntime.jsx(I, {
|
|
1179
|
+
style: style,
|
|
1180
|
+
className: clsx__default["default"](schemas.getOverrideClass(className), display ? display.value : iconDisplay.iconClass),
|
|
1181
|
+
iconName: display ? display.value : (_iconDisplay$icon = iconDisplay.icon) == null ? void 0 : _iconDisplay$icon.name,
|
|
1182
|
+
iconLibrary: (_iconDisplay$icon2 = iconDisplay.icon) == null ? void 0 : _iconDisplay$icon2.library
|
|
1183
|
+
});
|
|
1184
|
+
case schemas.DisplayDataType.Text:
|
|
1185
|
+
var text = display ? schemas.coerceToString(display.value) : data.text;
|
|
1186
|
+
return jsxRuntime.jsx(Div, {
|
|
1187
|
+
style: style,
|
|
1188
|
+
className: schemas.rendererClass(className, options.textClassName),
|
|
1189
|
+
textClass: schemas.rendererClass(textClass, options.textTextClass),
|
|
1190
|
+
text: text,
|
|
1191
|
+
inline: displayProps.inline
|
|
1192
|
+
});
|
|
1193
|
+
case schemas.DisplayDataType.Html:
|
|
1194
|
+
return jsxRuntime.jsx(Div, {
|
|
1195
|
+
style: style,
|
|
1196
|
+
className: schemas.rendererClass(className, options.htmlClassName),
|
|
1197
|
+
inline: displayProps.inline,
|
|
1198
|
+
html: display ? schemas.coerceToString(display.value) : data.html
|
|
1199
|
+
});
|
|
1200
|
+
case schemas.DisplayDataType.Custom:
|
|
1201
|
+
return jsxRuntime.jsx(Div, {
|
|
1202
|
+
children: jsxRuntime.jsxs(B, {
|
|
1203
|
+
children: ["(", data.customId, ")"]
|
|
1204
|
+
})
|
|
1205
|
+
});
|
|
1206
|
+
default:
|
|
1207
|
+
return jsxRuntime.jsxs(H1, {
|
|
1208
|
+
children: ["Unknown display type: ", data.type]
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
} finally {
|
|
1212
|
+
_effect();
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
function createDefaultLayoutRenderer(options) {
|
|
1217
|
+
if (options === void 0) {
|
|
1218
|
+
options = {};
|
|
1219
|
+
}
|
|
1220
|
+
return schemas.createLayoutRenderer(function (props, renderers) {
|
|
1221
|
+
var layout = schemas.renderLayoutParts(props, renderers);
|
|
1222
|
+
return {
|
|
1223
|
+
children: layout.wrapLayout(jsxRuntime.jsx(DefaultLayout, _extends({
|
|
1224
|
+
layout: layout
|
|
1225
|
+
}, options, {
|
|
1226
|
+
renderer: renderers
|
|
1227
|
+
}))),
|
|
1228
|
+
inline: layout.inline,
|
|
1229
|
+
className: schemas.rendererClass(layout.className, options.className),
|
|
1230
|
+
style: layout.style,
|
|
1231
|
+
divRef: function divRef(e) {
|
|
1232
|
+
return e && props.errorControl ? props.errorControl.meta.scrollElement = e : undefined;
|
|
1233
|
+
}
|
|
1234
|
+
};
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
function DefaultLayout(_ref) {
|
|
1238
|
+
var _effect = core.useComponentTracking();
|
|
1239
|
+
try {
|
|
1240
|
+
var errorClass = _ref.errorClass,
|
|
1241
|
+
_ref$renderer$html = _ref.renderer.html,
|
|
1242
|
+
Div = _ref$renderer$html.Div,
|
|
1243
|
+
Span = _ref$renderer$html.Span,
|
|
1244
|
+
_ref$renderError = _ref.renderError,
|
|
1245
|
+
renderError = _ref$renderError === void 0 ? function (e, errorId) {
|
|
1246
|
+
return e && jsxRuntime.jsx(Div, {
|
|
1247
|
+
children: jsxRuntime.jsx(Span, {
|
|
1248
|
+
id: errorId,
|
|
1249
|
+
className: errorClass,
|
|
1250
|
+
children: e
|
|
1251
|
+
})
|
|
1252
|
+
});
|
|
1253
|
+
} : _ref$renderError,
|
|
1254
|
+
_ref$layout = _ref.layout,
|
|
1255
|
+
controlEnd = _ref$layout.controlEnd,
|
|
1256
|
+
controlStart = _ref$layout.controlStart,
|
|
1257
|
+
label = _ref$layout.label,
|
|
1258
|
+
children = _ref$layout.children,
|
|
1259
|
+
errorControl = _ref$layout.errorControl,
|
|
1260
|
+
errorId = _ref$layout.errorId;
|
|
1261
|
+
var ec = errorControl;
|
|
1262
|
+
var errorText = ec && ec.touched ? ec.error : undefined;
|
|
1263
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1264
|
+
children: [label, controlStart, children, renderError(errorText, errorId), controlEnd]
|
|
1265
|
+
});
|
|
1266
|
+
} finally {
|
|
1267
|
+
_effect();
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
function createDefaultVisibilityRenderer() {
|
|
1272
|
+
return schemas.createVisibilityRenderer(function (props, renderer) {
|
|
1273
|
+
return jsxRuntime.jsx(DefaultVisibility, _extends({}, props, {
|
|
1274
|
+
renderer: renderer
|
|
1275
|
+
}));
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
function DefaultVisibility(_ref) {
|
|
1279
|
+
var _effect = core.useComponentTracking();
|
|
1280
|
+
try {
|
|
1281
|
+
var visibility = _ref.visibility,
|
|
1282
|
+
children = _ref.children,
|
|
1283
|
+
className = _ref.className,
|
|
1284
|
+
style = _ref.style,
|
|
1285
|
+
divRef = _ref.divRef,
|
|
1286
|
+
renderer = _ref.renderer,
|
|
1287
|
+
inline = _ref.inline;
|
|
1288
|
+
var v = visibility.value;
|
|
1289
|
+
React.useEffect(function () {
|
|
1290
|
+
if (v) {
|
|
1291
|
+
visibility.setValue(function (ex) {
|
|
1292
|
+
return {
|
|
1293
|
+
visible: v.visible,
|
|
1294
|
+
showing: v.visible
|
|
1295
|
+
};
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
}, [v == null ? void 0 : v.visible]);
|
|
1299
|
+
var Div = renderer.html.Div;
|
|
1300
|
+
if (inline) return v != null && v.visible ? children : undefined;
|
|
1301
|
+
return v != null && v.visible ? jsxRuntime.jsx(Div, {
|
|
1302
|
+
className: className,
|
|
1303
|
+
style: style,
|
|
1304
|
+
nativeRef: divRef,
|
|
1305
|
+
children: children
|
|
1306
|
+
}) : jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
1307
|
+
} finally {
|
|
1308
|
+
_effect();
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
function RNCheckButtons(props) {
|
|
1313
|
+
var _effect = core.useComponentTracking();
|
|
1314
|
+
try {
|
|
1315
|
+
var control = props.control,
|
|
1316
|
+
options = props.options,
|
|
1317
|
+
readonly = props.readonly,
|
|
1318
|
+
className = props.className,
|
|
1319
|
+
id = props.id,
|
|
1320
|
+
type = props.type,
|
|
1321
|
+
isChecked = props.isChecked,
|
|
1322
|
+
setChecked = props.setChecked,
|
|
1323
|
+
entryAdornment = props.entryAdornment,
|
|
1324
|
+
classes = props.classes,
|
|
1325
|
+
_props$controlClasses = props.controlClasses,
|
|
1326
|
+
controlClasses = _props$controlClasses === void 0 ? {} : _props$controlClasses,
|
|
1327
|
+
renderer = props.renderer;
|
|
1328
|
+
var _renderer$html = renderer.html,
|
|
1329
|
+
Button = _renderer$html.Button,
|
|
1330
|
+
Input = _renderer$html.Input,
|
|
1331
|
+
Label = _renderer$html.Label,
|
|
1332
|
+
Div = _renderer$html.Div;
|
|
1333
|
+
var disabled = control.disabled;
|
|
1334
|
+
var name = "r" + control.uniqueId;
|
|
1335
|
+
return jsxRuntime.jsx(Div, {
|
|
1336
|
+
className: className,
|
|
1337
|
+
id: id,
|
|
1338
|
+
children: jsxRuntime.jsx(core.RenderArrayElements, {
|
|
1339
|
+
array: options == null ? void 0 : options.filter(function (x) {
|
|
1340
|
+
return x.value != null;
|
|
1341
|
+
}),
|
|
1342
|
+
children: function children(o, i) {
|
|
1343
|
+
var checked = core.useComputed(function () {
|
|
1344
|
+
return isChecked(control, o);
|
|
1345
|
+
}).value;
|
|
1346
|
+
var selOrUnsel = checked ? schemas.rendererClass(controlClasses == null ? void 0 : controlClasses.selectedClass, classes.selectedClass) : schemas.rendererClass(controlClasses == null ? void 0 : controlClasses.notSelectedClass, classes.notSelectedClass);
|
|
1347
|
+
return jsxRuntime.jsxs(Button, {
|
|
1348
|
+
className: clsx.clsx(schemas.rendererClass(controlClasses == null ? void 0 : controlClasses.entryWrapperClass, classes.entryWrapperClass), selOrUnsel),
|
|
1349
|
+
onClick: function onClick() {
|
|
1350
|
+
return !(readonly || disabled) && setChecked(control, o, !checked);
|
|
1351
|
+
},
|
|
1352
|
+
notWrapInText: true,
|
|
1353
|
+
children: [jsxRuntime.jsxs(Div, {
|
|
1354
|
+
className: classes.entryClass,
|
|
1355
|
+
children: [jsxRuntime.jsx(Input, {
|
|
1356
|
+
id: name + "_" + i,
|
|
1357
|
+
className: classes.checkClass,
|
|
1358
|
+
type: type,
|
|
1359
|
+
name: name,
|
|
1360
|
+
readOnly: readonly,
|
|
1361
|
+
disabled: disabled,
|
|
1362
|
+
checked: checked,
|
|
1363
|
+
onChangeChecked: function onChangeChecked(x) {
|
|
1364
|
+
!readonly && setChecked(control, o, x);
|
|
1365
|
+
}
|
|
1366
|
+
}), jsxRuntime.jsx(Label, {
|
|
1367
|
+
className: classes.labelClass,
|
|
1368
|
+
textClass: classes.labelClass,
|
|
1369
|
+
htmlFor: name + "_" + i,
|
|
1370
|
+
children: o.name
|
|
1371
|
+
})]
|
|
1372
|
+
}), entryAdornment == null ? void 0 : entryAdornment(o, i, checked)]
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
})
|
|
1376
|
+
});
|
|
1377
|
+
} finally {
|
|
1378
|
+
_effect();
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
function DefaultDisplayOnly(_ref) {
|
|
1383
|
+
var _effect = core.useComponentTracking();
|
|
1384
|
+
try {
|
|
1385
|
+
var _ref2;
|
|
1386
|
+
var dataNode = _ref.dataNode,
|
|
1387
|
+
className = _ref.className,
|
|
1388
|
+
emptyText = _ref.emptyText,
|
|
1389
|
+
schemaInterface = _ref.schemaInterface,
|
|
1390
|
+
style = _ref.style,
|
|
1391
|
+
renderer = _ref.renderer,
|
|
1392
|
+
textClass = _ref.textClass,
|
|
1393
|
+
inline = _ref.inline,
|
|
1394
|
+
state = _ref.state;
|
|
1395
|
+
var display = state.resolved.display;
|
|
1396
|
+
var text = display != null ? display : (_ref2 = schemaInterface.isEmptyValue(dataNode.schema.field, dataNode.control.value) ? emptyText : schemaInterface.textValueForData(dataNode)) != null ? _ref2 : "";
|
|
1397
|
+
var Div = renderer.html.Div;
|
|
1398
|
+
return jsxRuntime.jsx(Div, {
|
|
1399
|
+
style: style,
|
|
1400
|
+
className: className,
|
|
1401
|
+
textClass: textClass,
|
|
1402
|
+
text: text,
|
|
1403
|
+
inline: inline
|
|
1404
|
+
});
|
|
1405
|
+
} finally {
|
|
1406
|
+
_effect();
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
var _excluded$3 = ["control", "convert", "renderer", "errorId"],
|
|
1411
|
+
_excluded2$2 = ["errorText", "value", "onChange", "ref"];
|
|
1412
|
+
function ControlInput(_ref) {
|
|
1413
|
+
var _effect = core.useComponentTracking();
|
|
1414
|
+
try {
|
|
1415
|
+
var toText = function toText(value) {
|
|
1416
|
+
return value == null ? "" : convert[2](value);
|
|
1417
|
+
};
|
|
1418
|
+
var control = _ref.control,
|
|
1419
|
+
convert = _ref.convert,
|
|
1420
|
+
renderer = _ref.renderer,
|
|
1421
|
+
errorId = _ref.errorId,
|
|
1422
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
1423
|
+
var _formControlProps = core.formControlProps(control),
|
|
1424
|
+
errorText = _formControlProps.errorText,
|
|
1425
|
+
value = _formControlProps.value,
|
|
1426
|
+
onChange = _formControlProps.onChange,
|
|
1427
|
+
ref = _formControlProps.ref,
|
|
1428
|
+
inputProps = _objectWithoutPropertiesLoose(_formControlProps, _excluded2$2);
|
|
1429
|
+
var textValue = core.useControl(function () {
|
|
1430
|
+
return toText(value);
|
|
1431
|
+
});
|
|
1432
|
+
core.useControlEffect(function () {
|
|
1433
|
+
return control.value;
|
|
1434
|
+
}, function (v) {
|
|
1435
|
+
return textValue.value = toText(v);
|
|
1436
|
+
});
|
|
1437
|
+
var Input = renderer.html.Input;
|
|
1438
|
+
return jsxRuntime.jsx(Input, _extends({}, inputProps, {
|
|
1439
|
+
inputRef: ref,
|
|
1440
|
+
type: convert[0],
|
|
1441
|
+
value: textValue.value,
|
|
1442
|
+
"aria-describedby": !!errorText ? errorId : undefined,
|
|
1443
|
+
"aria-invalid": !!errorText || undefined,
|
|
1444
|
+
onChangeValue: function onChangeValue(e) {
|
|
1445
|
+
textValue.value = e;
|
|
1446
|
+
var converted = convert[1](e);
|
|
1447
|
+
if (converted !== undefined) control.value = converted;
|
|
1448
|
+
}
|
|
1449
|
+
}, props));
|
|
1450
|
+
} finally {
|
|
1451
|
+
_effect();
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
function createInputConversion(ft) {
|
|
1455
|
+
switch (ft) {
|
|
1456
|
+
case schemas.FieldType.String:
|
|
1457
|
+
return ["text", function (a) {
|
|
1458
|
+
return a;
|
|
1459
|
+
}, function (a) {
|
|
1460
|
+
return a;
|
|
1461
|
+
}];
|
|
1462
|
+
case schemas.FieldType.Bool:
|
|
1463
|
+
return ["text", function (a) {
|
|
1464
|
+
return a === "true" ? true : a === "false" ? false : undefined;
|
|
1465
|
+
}, function (a) {
|
|
1466
|
+
var _a$toString;
|
|
1467
|
+
return (_a$toString = a == null ? void 0 : a.toString()) != null ? _a$toString : "";
|
|
1468
|
+
}];
|
|
1469
|
+
case schemas.FieldType.Int:
|
|
1470
|
+
return ["number", function (a) {
|
|
1471
|
+
return a !== "" ? parseInt(a) : null;
|
|
1472
|
+
}, function (a) {
|
|
1473
|
+
return a == null ? "" : a;
|
|
1474
|
+
}];
|
|
1475
|
+
case schemas.FieldType.DateTime:
|
|
1476
|
+
return ["datetime-local", function (a) {
|
|
1477
|
+
return !a ? null : a;
|
|
1478
|
+
}, function (a) {
|
|
1479
|
+
return a;
|
|
1480
|
+
}];
|
|
1481
|
+
case schemas.FieldType.Date:
|
|
1482
|
+
return ["date", function (a) {
|
|
1483
|
+
return !a ? null : a;
|
|
1484
|
+
}, function (a) {
|
|
1485
|
+
return a;
|
|
1486
|
+
}];
|
|
1487
|
+
case schemas.FieldType.Time:
|
|
1488
|
+
return ["time", function (a) {
|
|
1489
|
+
var l = a.length;
|
|
1490
|
+
if (l === 5) return a + ":00";
|
|
1491
|
+
if (l === 8) return a;
|
|
1492
|
+
return undefined;
|
|
1493
|
+
}, function (a) {
|
|
1494
|
+
return a ? a.substring(0, 5) : "";
|
|
1495
|
+
}];
|
|
1496
|
+
case schemas.FieldType.Double:
|
|
1497
|
+
return ["number", function (a) {
|
|
1498
|
+
return a !== "" ? parseFloat(a) : null;
|
|
1499
|
+
}, function (a) {
|
|
1500
|
+
return a == null ? "" : a;
|
|
1501
|
+
}];
|
|
1502
|
+
default:
|
|
1503
|
+
return ["text", function (a) {
|
|
1504
|
+
return a;
|
|
1505
|
+
}, function (a) {
|
|
1506
|
+
return a;
|
|
1507
|
+
}];
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
function createDefaultArrayDataRenderer(defaultActions) {
|
|
1512
|
+
return schemas.createDataRenderer(function (props, renderers) {
|
|
1513
|
+
return jsxRuntime.jsx(DataArrayRenderer, {
|
|
1514
|
+
dataProps: props,
|
|
1515
|
+
renderers: renderers,
|
|
1516
|
+
defaultActions: defaultActions
|
|
1517
|
+
});
|
|
1518
|
+
}, {
|
|
1519
|
+
renderType: schemas.DataRenderType.Array,
|
|
1520
|
+
collection: true
|
|
1521
|
+
});
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* @trackControls
|
|
1525
|
+
*/
|
|
1526
|
+
function DataArrayRenderer(_ref) {
|
|
1527
|
+
var _effect = core.useComponentTracking();
|
|
1528
|
+
try {
|
|
1529
|
+
var dataProps = _ref.dataProps,
|
|
1530
|
+
renderers = _ref.renderers,
|
|
1531
|
+
defaultActions = _ref.defaultActions;
|
|
1532
|
+
var renderOptions = dataProps.renderOptions,
|
|
1533
|
+
control = dataProps.control,
|
|
1534
|
+
field = dataProps.field,
|
|
1535
|
+
readonly = dataProps.readonly,
|
|
1536
|
+
designMode = dataProps.designMode,
|
|
1537
|
+
required = dataProps.required,
|
|
1538
|
+
renderChild = dataProps.renderChild,
|
|
1539
|
+
definition = dataProps.definition,
|
|
1540
|
+
className = dataProps.className,
|
|
1541
|
+
style = dataProps.style,
|
|
1542
|
+
dataContext = dataProps.dataContext,
|
|
1543
|
+
formNode = dataProps.formNode;
|
|
1544
|
+
var _mergeObjects = schemas.mergeObjects(schemas.isArrayRenderer(renderOptions) ? renderOptions : {}, defaultActions),
|
|
1545
|
+
addText = _mergeObjects.addText,
|
|
1546
|
+
noAdd = _mergeObjects.noAdd,
|
|
1547
|
+
noRemove = _mergeObjects.noRemove,
|
|
1548
|
+
noReorder = _mergeObjects.noReorder,
|
|
1549
|
+
removeText = _mergeObjects.removeText,
|
|
1550
|
+
editExternal = _mergeObjects.editExternal,
|
|
1551
|
+
childOverrideClass = _mergeObjects.childOverrideClass;
|
|
1552
|
+
var arrayProps = _extends({}, schemas.createArrayActions(control.as(), function () {
|
|
1553
|
+
return formNode.getChildCount();
|
|
1554
|
+
}, field, {
|
|
1555
|
+
addText: addText,
|
|
1556
|
+
removeText: removeText,
|
|
1557
|
+
noAdd: noAdd,
|
|
1558
|
+
noRemove: noRemove,
|
|
1559
|
+
readonly: readonly,
|
|
1560
|
+
disabled: control.disabled,
|
|
1561
|
+
designMode: designMode,
|
|
1562
|
+
editExternal: editExternal
|
|
1563
|
+
}), {
|
|
1564
|
+
childOverrideClass: childOverrideClass,
|
|
1565
|
+
required: required,
|
|
1566
|
+
renderElement: function renderElement(i, wrap) {
|
|
1567
|
+
var n = formNode.getChild(i);
|
|
1568
|
+
return !n || !n.visible ? undefined : wrap(n.childKey, renderChild(n));
|
|
1569
|
+
},
|
|
1570
|
+
className: className ? className : undefined,
|
|
1571
|
+
style: style
|
|
1572
|
+
}, schemas.getLengthRestrictions(definition));
|
|
1573
|
+
return renderers.renderArray(arrayProps);
|
|
1574
|
+
} finally {
|
|
1575
|
+
_effect();
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
function createDefaultArrayRenderer(options) {
|
|
1579
|
+
return {
|
|
1580
|
+
render: function render(props, _ref2) {
|
|
1581
|
+
var renderAction = _ref2.renderAction;
|
|
1582
|
+
return jsxRuntime.jsx(DefaultArrayRenderer, _extends({}, props, options, {
|
|
1583
|
+
renderAction: renderAction
|
|
1584
|
+
}));
|
|
1585
|
+
},
|
|
1586
|
+
type: "array"
|
|
1587
|
+
};
|
|
1588
|
+
}
|
|
1589
|
+
function DefaultArrayRenderer(props) {
|
|
1590
|
+
var _effect2 = core.useComponentTracking();
|
|
1591
|
+
try {
|
|
1592
|
+
var renderElement = props.renderElement,
|
|
1593
|
+
className = props.className,
|
|
1594
|
+
removableClass = props.removableClass,
|
|
1595
|
+
childClass = props.childClass,
|
|
1596
|
+
removableChildClass = props.removableChildClass,
|
|
1597
|
+
removeActionClass = props.removeActionClass,
|
|
1598
|
+
addActionClass = props.addActionClass,
|
|
1599
|
+
getElementCount = props.getElementCount,
|
|
1600
|
+
renderAction = props.renderAction,
|
|
1601
|
+
style = props.style,
|
|
1602
|
+
editAction = props.editAction,
|
|
1603
|
+
childOverrideClass = props.childOverrideClass;
|
|
1604
|
+
var _applyArrayLengthRest = schemas.applyArrayLengthRestrictions(props),
|
|
1605
|
+
addAction = _applyArrayLengthRest.addAction,
|
|
1606
|
+
removeAction = _applyArrayLengthRest.removeAction;
|
|
1607
|
+
return jsxRuntime.jsxs(reactNative.View, {
|
|
1608
|
+
style: style,
|
|
1609
|
+
children: [jsxRuntime.jsx(reactNative.View, {
|
|
1610
|
+
className: clsx__default["default"](className, removeAction && removableClass),
|
|
1611
|
+
children: Array.from({
|
|
1612
|
+
length: getElementCount()
|
|
1613
|
+
}, function (_, x) {
|
|
1614
|
+
return jsxRuntime.jsx(core.RenderControl, {
|
|
1615
|
+
render: function render() {
|
|
1616
|
+
return renderElement(x, function (key, children) {
|
|
1617
|
+
return removeAction || editAction ? jsxRuntime.jsxs(React.Fragment, {
|
|
1618
|
+
children: [jsxRuntime.jsx(reactNative.View, {
|
|
1619
|
+
className: clsx__default["default"](schemas.rendererClass(childOverrideClass, childClass), removableChildClass),
|
|
1620
|
+
children: children
|
|
1621
|
+
}), jsxRuntime.jsxs(reactNative.View, {
|
|
1622
|
+
className: removeActionClass,
|
|
1623
|
+
children: [editAction && renderAction(editAction(x)), removeAction && renderAction(removeAction(x))]
|
|
1624
|
+
})]
|
|
1625
|
+
}, key) : jsxRuntime.jsx(reactNative.View, {
|
|
1626
|
+
className: schemas.rendererClass(childOverrideClass, childClass),
|
|
1627
|
+
children: children
|
|
1628
|
+
}, key);
|
|
1629
|
+
});
|
|
1630
|
+
}
|
|
1631
|
+
}, x);
|
|
1632
|
+
})
|
|
1633
|
+
}), addAction && jsxRuntime.jsx(reactNative.View, {
|
|
1634
|
+
className: addActionClass,
|
|
1635
|
+
children: renderAction(addAction)
|
|
1636
|
+
})]
|
|
1637
|
+
});
|
|
1638
|
+
} finally {
|
|
1639
|
+
_effect2();
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
var _excluded$2 = ["control", "type", "notValue", "renderer"],
|
|
1644
|
+
_excluded2$1 = ["value", "onChange", "errorText", "ref"];
|
|
1645
|
+
function createRadioRenderer(options) {
|
|
1646
|
+
if (options === void 0) {
|
|
1647
|
+
options = {};
|
|
1648
|
+
}
|
|
1649
|
+
return schemas.createDataRenderer(function (p, renderer) {
|
|
1650
|
+
return jsxRuntime.jsx(renderer.html.CheckButtons, _extends({
|
|
1651
|
+
classes: options,
|
|
1652
|
+
controlClasses: p.renderOptions
|
|
1653
|
+
}, p, {
|
|
1654
|
+
className: schemas.rendererClass(p.className, options.className),
|
|
1655
|
+
isChecked: function isChecked(control, o) {
|
|
1656
|
+
return control.value == o.value;
|
|
1657
|
+
},
|
|
1658
|
+
setChecked: function setChecked(c, o) {
|
|
1659
|
+
c.setTouched(true);
|
|
1660
|
+
c.value = o.value;
|
|
1661
|
+
},
|
|
1662
|
+
control: p.control,
|
|
1663
|
+
type: "radio",
|
|
1664
|
+
entryAdornment: schemas.fieldOptionAdornment(p),
|
|
1665
|
+
renderer: renderer
|
|
1666
|
+
}));
|
|
1667
|
+
}, {
|
|
1668
|
+
renderType: schemas.DataRenderType.Radio
|
|
1669
|
+
});
|
|
1670
|
+
}
|
|
1671
|
+
function createCheckListRenderer(options) {
|
|
1672
|
+
if (options === void 0) {
|
|
1673
|
+
options = {};
|
|
1674
|
+
}
|
|
1675
|
+
return schemas.createDataRenderer(function (p, renderer) {
|
|
1676
|
+
return jsxRuntime.jsx(renderer.html.CheckButtons, _extends({
|
|
1677
|
+
classes: options,
|
|
1678
|
+
controlClasses: p.renderOptions
|
|
1679
|
+
}, p, {
|
|
1680
|
+
className: schemas.rendererClass(p.className, options.className),
|
|
1681
|
+
isChecked: function isChecked(control, o) {
|
|
1682
|
+
var v = control.value;
|
|
1683
|
+
return Array.isArray(v) ? v.includes(o.value) : false;
|
|
1684
|
+
},
|
|
1685
|
+
setChecked: function setChecked(c, o, checked) {
|
|
1686
|
+
c.setTouched(true);
|
|
1687
|
+
c.setValue(function (x) {
|
|
1688
|
+
return schemas.setIncluded(x != null ? x : [], o.value, checked);
|
|
1689
|
+
});
|
|
1690
|
+
},
|
|
1691
|
+
control: p.control,
|
|
1692
|
+
type: "checkbox",
|
|
1693
|
+
entryAdornment: schemas.fieldOptionAdornment(p),
|
|
1694
|
+
renderer: renderer
|
|
1695
|
+
}));
|
|
1696
|
+
}, {
|
|
1697
|
+
collection: true,
|
|
1698
|
+
renderType: schemas.DataRenderType.CheckList
|
|
1699
|
+
});
|
|
1700
|
+
}
|
|
1701
|
+
function createElementSelectedRenderer(options) {
|
|
1702
|
+
if (options === void 0) {
|
|
1703
|
+
options = {};
|
|
1704
|
+
}
|
|
1705
|
+
return schemas.createDataRenderer(function (props, renderer) {
|
|
1706
|
+
return function (p) {
|
|
1707
|
+
return _extends({}, p, {
|
|
1708
|
+
label: undefined,
|
|
1709
|
+
children: jsxRuntime.jsx(CheckBoxSelected, {
|
|
1710
|
+
p: p,
|
|
1711
|
+
renderer: renderer,
|
|
1712
|
+
options: options,
|
|
1713
|
+
props: props
|
|
1714
|
+
})
|
|
1715
|
+
});
|
|
1716
|
+
};
|
|
1717
|
+
}, {
|
|
1718
|
+
renderType: schemas.DataRenderType.ElementSelected
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
function CheckBoxSelected(_ref) {
|
|
1722
|
+
var _effect = core.useComponentTracking();
|
|
1723
|
+
try {
|
|
1724
|
+
var _p$label;
|
|
1725
|
+
var p = _ref.p,
|
|
1726
|
+
props = _ref.props,
|
|
1727
|
+
renderer = _ref.renderer,
|
|
1728
|
+
options = _ref.options;
|
|
1729
|
+
var Div = renderer.html.Div;
|
|
1730
|
+
var selControl = schemas.useElementSelectedRenderer(props);
|
|
1731
|
+
return jsxRuntime.jsxs(Div, {
|
|
1732
|
+
className: schemas.rendererClass(props.className, options.entryClass),
|
|
1733
|
+
children: [jsxRuntime.jsx(Fcheckbox, {
|
|
1734
|
+
id: props.id,
|
|
1735
|
+
control: selControl,
|
|
1736
|
+
style: props.style,
|
|
1737
|
+
className: options.checkClass,
|
|
1738
|
+
renderer: renderer
|
|
1739
|
+
}), ((_p$label = p.label) == null ? void 0 : _p$label.label) && renderer.renderLabel(p.label, undefined, undefined)]
|
|
1740
|
+
});
|
|
1741
|
+
} finally {
|
|
1742
|
+
_effect();
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
function Fcheckbox(_ref3) {
|
|
1746
|
+
var _effect3 = core.useComponentTracking();
|
|
1747
|
+
try {
|
|
1748
|
+
var control = _ref3.control,
|
|
1749
|
+
_ref3$type = _ref3.type,
|
|
1750
|
+
type = _ref3$type === void 0 ? "checkbox" : _ref3$type,
|
|
1751
|
+
_ref3$notValue = _ref3.notValue,
|
|
1752
|
+
notValue = _ref3$notValue === void 0 ? false : _ref3$notValue,
|
|
1753
|
+
renderer = _ref3.renderer,
|
|
1754
|
+
others = _objectWithoutPropertiesLoose(_ref3, _excluded$2);
|
|
1755
|
+
var Input = renderer.html.Input;
|
|
1756
|
+
var _formControlProps = core.formControlProps(control),
|
|
1757
|
+
value = _formControlProps.value,
|
|
1758
|
+
onChange = _formControlProps.onChange,
|
|
1759
|
+
errorText = _formControlProps.errorText,
|
|
1760
|
+
ref = _formControlProps.ref,
|
|
1761
|
+
theseProps = _objectWithoutPropertiesLoose(_formControlProps, _excluded2$1);
|
|
1762
|
+
return jsxRuntime.jsx(Input, _extends({}, theseProps, {
|
|
1763
|
+
checked: !!value !== notValue,
|
|
1764
|
+
inputRef: function inputRef(r) {
|
|
1765
|
+
return control.element = r;
|
|
1766
|
+
},
|
|
1767
|
+
onChangeChecked: function onChangeChecked(e) {
|
|
1768
|
+
control.touched = true;
|
|
1769
|
+
control.value = e !== notValue;
|
|
1770
|
+
},
|
|
1771
|
+
type: type
|
|
1772
|
+
}, others));
|
|
1773
|
+
} finally {
|
|
1774
|
+
_effect3();
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
function DefaultAccordion(_ref) {
|
|
1779
|
+
var _effect = core.useComponentTracking();
|
|
1780
|
+
try {
|
|
1781
|
+
var _dataContext$dataNode;
|
|
1782
|
+
var openCtrl = _ref.openCtrl,
|
|
1783
|
+
children = _ref.children,
|
|
1784
|
+
contentStyle = _ref.contentStyle,
|
|
1785
|
+
className = _ref.className,
|
|
1786
|
+
contentClassName = _ref.contentClassName,
|
|
1787
|
+
designMode = _ref.designMode,
|
|
1788
|
+
renderers = _ref.renderers,
|
|
1789
|
+
dataContext = _ref.dataContext,
|
|
1790
|
+
title = _ref.title,
|
|
1791
|
+
options = _ref.options,
|
|
1792
|
+
defaultExpanded = _ref.defaultExpanded,
|
|
1793
|
+
isGroup = _ref.isGroup,
|
|
1794
|
+
titleTextClass = _ref.titleTextClass;
|
|
1795
|
+
var _ref2 = options != null ? options : {},
|
|
1796
|
+
iconOpen = _ref2.iconOpen,
|
|
1797
|
+
iconClosed = _ref2.iconClosed,
|
|
1798
|
+
togglerClass = _ref2.togglerClass,
|
|
1799
|
+
_ref2$renderTitle = _ref2.renderTitle,
|
|
1800
|
+
renderTitle = _ref2$renderTitle === void 0 ? function (t) {
|
|
1801
|
+
return t;
|
|
1802
|
+
} : _ref2$renderTitle,
|
|
1803
|
+
renderToggler = _ref2.renderToggler,
|
|
1804
|
+
useCss = _ref2.useCss;
|
|
1805
|
+
var panelId = React.useId();
|
|
1806
|
+
var _renderers$html = renderers.html,
|
|
1807
|
+
Button = _renderers$html.Button,
|
|
1808
|
+
I = _renderers$html.I,
|
|
1809
|
+
Div = _renderers$html.Div,
|
|
1810
|
+
Label = _renderers$html.Label;
|
|
1811
|
+
var dataControl = ((_dataContext$dataNode = dataContext.dataNode) != null ? _dataContext$dataNode : dataContext.parentNode).control;
|
|
1812
|
+
var open = core.useControl(!!defaultExpanded, {
|
|
1813
|
+
use: openCtrl
|
|
1814
|
+
});
|
|
1815
|
+
if (dataControl && !dataControl.meta.accordionState) {
|
|
1816
|
+
dataControl.meta.accordionState = open;
|
|
1817
|
+
}
|
|
1818
|
+
var isOpen = open.value;
|
|
1819
|
+
var fullContentStyle = isOpen || designMode ? contentStyle : _extends({}, contentStyle, {
|
|
1820
|
+
display: "none"
|
|
1821
|
+
});
|
|
1822
|
+
var currentIcon = isOpen ? iconOpen : iconClosed;
|
|
1823
|
+
var accordionClassName = schemas.rendererClass(className, options == null ? void 0 : options.className);
|
|
1824
|
+
var accordionTitleTextClass = schemas.rendererClass(titleTextClass, options == null ? void 0 : options.titleTextClass);
|
|
1825
|
+
var accordionTitle = isGroup ? title : jsxRuntime.jsx(Label, {
|
|
1826
|
+
textClass: accordionTitleTextClass,
|
|
1827
|
+
children: title
|
|
1828
|
+
});
|
|
1829
|
+
var toggler = renderToggler ? renderToggler(open, renderTitle(title, open)) : jsxRuntime.jsxs(Button, {
|
|
1830
|
+
className: accordionClassName,
|
|
1831
|
+
notWrapInText: true,
|
|
1832
|
+
onClick: function onClick() {
|
|
1833
|
+
return open.setValue(function (x) {
|
|
1834
|
+
return !x;
|
|
1835
|
+
});
|
|
1836
|
+
},
|
|
1837
|
+
"aria-expanded": isOpen,
|
|
1838
|
+
"aria-controls": panelId,
|
|
1839
|
+
children: [accordionTitle, currentIcon && jsxRuntime.jsx(I, {
|
|
1840
|
+
className: togglerClass,
|
|
1841
|
+
iconLibrary: currentIcon.library,
|
|
1842
|
+
iconName: currentIcon.name
|
|
1843
|
+
})]
|
|
1844
|
+
});
|
|
1845
|
+
// The content class name not currently used since if the content is wrapped in a group, the group will handle the styling
|
|
1846
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1847
|
+
children: [toggler, (useCss || isOpen || designMode) && jsxRuntime.jsx(Div, {
|
|
1848
|
+
id: panelId,
|
|
1849
|
+
role: "region",
|
|
1850
|
+
style: fullContentStyle,
|
|
1851
|
+
className: contentClassName,
|
|
1852
|
+
children: children
|
|
1853
|
+
})]
|
|
1854
|
+
});
|
|
1855
|
+
} finally {
|
|
1856
|
+
_effect();
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
function createAccordionGroupRenderer(options) {
|
|
1860
|
+
return schemas.createGroupRenderer(function (p, renderer) {
|
|
1861
|
+
return jsxRuntime.jsx(AccordionGroupRenderer, {
|
|
1862
|
+
groupProps: p,
|
|
1863
|
+
renderer: renderer,
|
|
1864
|
+
options: options
|
|
1865
|
+
});
|
|
1866
|
+
}, {
|
|
1867
|
+
renderType: schemas.GroupRenderType.Accordion
|
|
1868
|
+
});
|
|
1869
|
+
}
|
|
1870
|
+
function AccordionGroupRenderer(_ref3) {
|
|
1871
|
+
var _effect2 = core.useComponentTracking();
|
|
1872
|
+
try {
|
|
1873
|
+
var groupProps = _ref3.groupProps,
|
|
1874
|
+
renderer = _ref3.renderer,
|
|
1875
|
+
options = _ref3.options;
|
|
1876
|
+
var allChildren = groupProps.formNode.children;
|
|
1877
|
+
var titleChildren = allChildren.filter(function (x) {
|
|
1878
|
+
return x.definition.placement === "title";
|
|
1879
|
+
});
|
|
1880
|
+
var contentChildren = allChildren.filter(function (x) {
|
|
1881
|
+
return x.definition.placement !== "title";
|
|
1882
|
+
});
|
|
1883
|
+
var _groupProps$renderOpt = groupProps.renderOptions,
|
|
1884
|
+
expandStateField = _groupProps$renderOpt.expandStateField,
|
|
1885
|
+
defaultExpanded = _groupProps$renderOpt.defaultExpanded;
|
|
1886
|
+
var expandStateFieldNode = expandStateField ? schemas.schemaDataForFieldRef(expandStateField, groupProps.dataContext.parentNode) : null;
|
|
1887
|
+
var open = expandStateFieldNode == null ? void 0 : expandStateFieldNode.control.as();
|
|
1888
|
+
return jsxRuntime.jsx(DefaultAccordion, {
|
|
1889
|
+
openCtrl: open,
|
|
1890
|
+
isGroup: true,
|
|
1891
|
+
options: options,
|
|
1892
|
+
children: jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1893
|
+
children: contentChildren.map(function (x) {
|
|
1894
|
+
return groupProps.renderChild(x);
|
|
1895
|
+
})
|
|
1896
|
+
}),
|
|
1897
|
+
title: jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1898
|
+
children: titleChildren.map(function (x) {
|
|
1899
|
+
return groupProps.renderChild(x);
|
|
1900
|
+
})
|
|
1901
|
+
}),
|
|
1902
|
+
renderers: renderer,
|
|
1903
|
+
className: groupProps.className,
|
|
1904
|
+
dataContext: groupProps.dataContext,
|
|
1905
|
+
designMode: groupProps.designMode,
|
|
1906
|
+
defaultExpanded: defaultExpanded,
|
|
1907
|
+
contentStyle: groupProps.style
|
|
1908
|
+
});
|
|
1909
|
+
} finally {
|
|
1910
|
+
_effect2();
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
var _excluded$1 = ["control", "field", "renderOptions"];
|
|
1915
|
+
function createNullToggleRenderer() {
|
|
1916
|
+
return schemas.createDataRenderer(function (_ref, renderers) {
|
|
1917
|
+
var control = _ref.control,
|
|
1918
|
+
field = _ref.field,
|
|
1919
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
1920
|
+
var lastDefined = schemas.getLastDefinedValue(control);
|
|
1921
|
+
if (lastDefined.current.value == null) lastDefined.value = props.definition.defaultValue;
|
|
1922
|
+
var nullControl = schemas.getNullToggler(control);
|
|
1923
|
+
nullControl.disabled = props.readonly;
|
|
1924
|
+
return function (layout) {
|
|
1925
|
+
return renderers.renderData(_extends({}, props, {
|
|
1926
|
+
control: nullControl,
|
|
1927
|
+
field: _extends({}, field, {
|
|
1928
|
+
type: schemas.FieldType.Bool
|
|
1929
|
+
}),
|
|
1930
|
+
renderOptions: {
|
|
1931
|
+
type: schemas.DataRenderType.Checkbox
|
|
1932
|
+
}
|
|
1933
|
+
}))(layout);
|
|
1934
|
+
};
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
// ============================================================================
|
|
1939
|
+
// ADDITIONAL CONSTANTS
|
|
1940
|
+
// ============================================================================
|
|
1941
|
+
var DefaultBoolOptions = [{
|
|
1942
|
+
name: "Yes",
|
|
1943
|
+
value: true
|
|
1944
|
+
}, {
|
|
1945
|
+
name: "No",
|
|
1946
|
+
value: false
|
|
1947
|
+
}];
|
|
1948
|
+
|
|
1949
|
+
function createGridRenderer(options) {
|
|
1950
|
+
return schemas.createGroupRenderer(function (props, formRenderer) {
|
|
1951
|
+
return jsxRuntime.jsx(GridRenderer, {
|
|
1952
|
+
groupProps: props,
|
|
1953
|
+
formRenderer: formRenderer,
|
|
1954
|
+
options: options
|
|
1955
|
+
});
|
|
1956
|
+
}, {
|
|
1957
|
+
renderType: schemas.GroupRenderType.Grid
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
function GridRenderer(props) {
|
|
1961
|
+
var _effect = core.useComponentTracking();
|
|
1962
|
+
try {
|
|
1963
|
+
var _props$options, _ref, _gridOptions$columns;
|
|
1964
|
+
var _props$groupProps = props.groupProps,
|
|
1965
|
+
formNode = _props$groupProps.formNode,
|
|
1966
|
+
renderOptions = _props$groupProps.renderOptions,
|
|
1967
|
+
renderChild = _props$groupProps.renderChild,
|
|
1968
|
+
className = _props$groupProps.className;
|
|
1969
|
+
var filteredChildren = formNode.children.filter(function (x, i) {
|
|
1970
|
+
return x.visible;
|
|
1971
|
+
});
|
|
1972
|
+
var Div = props.formRenderer.html.Div;
|
|
1973
|
+
var defaults = (_props$options = props.options) != null ? _props$options : {};
|
|
1974
|
+
var gridOptions = renderOptions;
|
|
1975
|
+
var numColumns = (_ref = (_gridOptions$columns = gridOptions.columns) != null ? _gridOptions$columns : defaults.defaultColumns) != null ? _ref : 2;
|
|
1976
|
+
var allChildren = filteredChildren.map(function (x) {
|
|
1977
|
+
return renderChild(x);
|
|
1978
|
+
});
|
|
1979
|
+
var cellClass = gridOptions.cellClass ? getCellClassNames(gridOptions.cellClass) : getCellClassNames(defaults.cellClass);
|
|
1980
|
+
// split into numColumns items wrapped a div each
|
|
1981
|
+
var rows = [];
|
|
1982
|
+
for (var i = 0; i < allChildren.length; i += numColumns) {
|
|
1983
|
+
rows.push(allChildren.slice(i, i + numColumns));
|
|
1984
|
+
}
|
|
1985
|
+
return jsxRuntime.jsx(Div, {
|
|
1986
|
+
className: schemas.rendererClass(className, defaults.className),
|
|
1987
|
+
children: rows.map(function (row, rowIndex) {
|
|
1988
|
+
return jsxRuntime.jsx(Div, {
|
|
1989
|
+
className: schemas.rendererClass(gridOptions.rowClass, defaults.rowClass),
|
|
1990
|
+
children: row.map(function (cell, cellIndex) {
|
|
1991
|
+
var _cellClass$at;
|
|
1992
|
+
return jsxRuntime.jsx(Div, {
|
|
1993
|
+
className: (_cellClass$at = cellClass == null ? void 0 : cellClass.at(cellIndex)) != null ? _cellClass$at : "flex-1",
|
|
1994
|
+
children: cell
|
|
1995
|
+
}, cellIndex);
|
|
1996
|
+
})
|
|
1997
|
+
}, rowIndex);
|
|
1998
|
+
})
|
|
1999
|
+
});
|
|
2000
|
+
} finally {
|
|
2001
|
+
_effect();
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
function getCellClassNames(cellClass) {
|
|
2005
|
+
return cellClass == null ? void 0 : cellClass.split(",");
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
var defaultOptions = {
|
|
2009
|
+
classes: {
|
|
2010
|
+
className: undefined,
|
|
2011
|
+
contentClass: "min-h-96 overflow-auto",
|
|
2012
|
+
navContainerClass: "flex justify-between gap-4 my-2"
|
|
2013
|
+
},
|
|
2014
|
+
actions: {
|
|
2015
|
+
nextText: "Next",
|
|
2016
|
+
nextIcon: schemas.fontAwesomeIcon("chevron-right"),
|
|
2017
|
+
nextValidate: true,
|
|
2018
|
+
prevText: "Prev",
|
|
2019
|
+
prevIcon: schemas.fontAwesomeIcon("chevron-left"),
|
|
2020
|
+
prevValidate: false
|
|
2021
|
+
},
|
|
2022
|
+
renderNavigation: defaultNavigationRender
|
|
2023
|
+
};
|
|
2024
|
+
function defaultNavigationRender(_ref) {
|
|
2025
|
+
var formRenderer = _ref.formRenderer,
|
|
2026
|
+
prev = _ref.prev,
|
|
2027
|
+
next = _ref.next,
|
|
2028
|
+
className = _ref.className;
|
|
2029
|
+
{
|
|
2030
|
+
var Div = formRenderer.html.Div,
|
|
2031
|
+
renderAction = formRenderer.renderAction;
|
|
2032
|
+
return jsxRuntime.jsxs(Div, {
|
|
2033
|
+
className: className,
|
|
2034
|
+
children: [renderAction(prev), renderAction(next)]
|
|
2035
|
+
});
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
function createWizardRenderer(options) {
|
|
2039
|
+
return schemas.createGroupRenderer(function (props, formRenderer) {
|
|
2040
|
+
return jsxRuntime.jsx(WizardRenderer, {
|
|
2041
|
+
groupProps: props,
|
|
2042
|
+
formRenderer: formRenderer,
|
|
2043
|
+
options: options
|
|
2044
|
+
});
|
|
2045
|
+
}, {
|
|
2046
|
+
renderType: schemas.GroupRenderType.Wizard
|
|
2047
|
+
});
|
|
2048
|
+
}
|
|
2049
|
+
function WizardRenderer(_ref2) {
|
|
2050
|
+
var _effect = core.useComponentTracking();
|
|
2051
|
+
try {
|
|
2052
|
+
var countVisibleUntil = function countVisibleUntil(untilPage) {
|
|
2053
|
+
var count = 0;
|
|
2054
|
+
for (var i = 0; i < untilPage && i < childrenLength; i++) {
|
|
2055
|
+
if (formNode.getChild(i).visible) {
|
|
2056
|
+
count++;
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
return count;
|
|
2060
|
+
};
|
|
2061
|
+
var nav = function nav(dir, validate) {
|
|
2062
|
+
if (validate && !_validatePage()) {
|
|
2063
|
+
return;
|
|
2064
|
+
}
|
|
2065
|
+
var next = nextVisibleInDirection(dir);
|
|
2066
|
+
if (next != null) {
|
|
2067
|
+
page.value = next;
|
|
2068
|
+
}
|
|
2069
|
+
};
|
|
2070
|
+
var nextVisibleInDirection = function nextVisibleInDirection(dir) {
|
|
2071
|
+
var next = currentPage + dir;
|
|
2072
|
+
while (next >= 0 && next < childrenLength) {
|
|
2073
|
+
if (formNode.getChild(next).visible) {
|
|
2074
|
+
return next;
|
|
2075
|
+
}
|
|
2076
|
+
next += dir;
|
|
2077
|
+
}
|
|
2078
|
+
return null;
|
|
2079
|
+
};
|
|
2080
|
+
var _validatePage = function _validatePage() {
|
|
2081
|
+
var pageNode = formNode.getChild(currentPage);
|
|
2082
|
+
if (pageNode) {
|
|
2083
|
+
var valid = pageNode.validate();
|
|
2084
|
+
pageNode.setTouched(true);
|
|
2085
|
+
return valid;
|
|
2086
|
+
}
|
|
2087
|
+
return false;
|
|
2088
|
+
};
|
|
2089
|
+
var isPageValid = function isPageValid() {
|
|
2090
|
+
return formNode.getChild(currentPage).valid;
|
|
2091
|
+
};
|
|
2092
|
+
var props = _ref2.groupProps,
|
|
2093
|
+
formRenderer = _ref2.formRenderer,
|
|
2094
|
+
options = _ref2.options;
|
|
2095
|
+
var mergedOptions = schemas.deepMerge(options != null ? options : {}, defaultOptions);
|
|
2096
|
+
var _mergedOptions$classe = mergedOptions.classes,
|
|
2097
|
+
className = _mergedOptions$classe.className,
|
|
2098
|
+
contentClass = _mergedOptions$classe.contentClass,
|
|
2099
|
+
navContainerClass = _mergedOptions$classe.navContainerClass,
|
|
2100
|
+
_mergedOptions$action = mergedOptions.actions,
|
|
2101
|
+
nextText = _mergedOptions$action.nextText,
|
|
2102
|
+
nextIcon = _mergedOptions$action.nextIcon,
|
|
2103
|
+
prevText = _mergedOptions$action.prevText,
|
|
2104
|
+
prevIcon = _mergedOptions$action.prevIcon,
|
|
2105
|
+
nextValidate = _mergedOptions$action.nextValidate,
|
|
2106
|
+
prevValidate = _mergedOptions$action.prevValidate,
|
|
2107
|
+
renderNavigation = mergedOptions.renderNavigation;
|
|
2108
|
+
var formNode = props.formNode,
|
|
2109
|
+
designMode = props.designMode,
|
|
2110
|
+
renderChild = props.renderChild;
|
|
2111
|
+
var Div = formRenderer.html.Div;
|
|
2112
|
+
var childrenLength = formNode.getChildCount();
|
|
2113
|
+
var page = core.useControl(0);
|
|
2114
|
+
var currentPage = page.value;
|
|
2115
|
+
var isValid = core.useComputed(function () {
|
|
2116
|
+
return isPageValid();
|
|
2117
|
+
});
|
|
2118
|
+
var next = schemas.createAction("nav", function () {
|
|
2119
|
+
return nav(1, nextValidate);
|
|
2120
|
+
}, nextText, {
|
|
2121
|
+
hidden: !designMode && nextVisibleInDirection(1) == null,
|
|
2122
|
+
disabled: !isValid.value,
|
|
2123
|
+
icon: nextIcon,
|
|
2124
|
+
iconPlacement: schemas.IconPlacement.AfterText
|
|
2125
|
+
});
|
|
2126
|
+
var prev = schemas.createAction("nav", function () {
|
|
2127
|
+
return nav(-1, prevValidate);
|
|
2128
|
+
}, prevText, {
|
|
2129
|
+
disabled: !designMode && nextVisibleInDirection(-1) == null,
|
|
2130
|
+
icon: prevIcon
|
|
2131
|
+
});
|
|
2132
|
+
var navElement = renderNavigation({
|
|
2133
|
+
formRenderer: formRenderer,
|
|
2134
|
+
page: countVisibleUntil(currentPage),
|
|
2135
|
+
totalPages: countVisibleUntil(childrenLength),
|
|
2136
|
+
prev: prev,
|
|
2137
|
+
next: next,
|
|
2138
|
+
className: navContainerClass,
|
|
2139
|
+
validatePage: function validatePage() {
|
|
2140
|
+
try {
|
|
2141
|
+
return Promise.resolve(_validatePage());
|
|
2142
|
+
} catch (e) {
|
|
2143
|
+
return Promise.reject(e);
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
});
|
|
2147
|
+
var content = designMode ? jsxRuntime.jsx(Div, {
|
|
2148
|
+
children: formNode.children.map(function (child) {
|
|
2149
|
+
return renderChild(child);
|
|
2150
|
+
})
|
|
2151
|
+
}) : currentPage < childrenLength ? jsxRuntime.jsx(Div, {
|
|
2152
|
+
className: contentClass,
|
|
2153
|
+
children: renderChild(formNode.getChild(currentPage))
|
|
2154
|
+
}) : jsxRuntime.jsx(React.Fragment, {});
|
|
2155
|
+
return jsxRuntime.jsxs(Div, {
|
|
2156
|
+
className: schemas.rendererClass(props.className, className),
|
|
2157
|
+
children: [content, navElement]
|
|
2158
|
+
});
|
|
2159
|
+
} finally {
|
|
2160
|
+
_effect();
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
|
|
2164
|
+
var defaultRNDialogOptions = {
|
|
2165
|
+
classes: {
|
|
2166
|
+
className: "",
|
|
2167
|
+
titleClass: "flex-1 flex-shrink title2",
|
|
2168
|
+
containerClass: "w-full px-[16px]"
|
|
2169
|
+
}
|
|
2170
|
+
};
|
|
2171
|
+
function createDialogRenderer(options) {
|
|
2172
|
+
return schemas.createGroupRenderer(function (props, renderers) {
|
|
2173
|
+
return jsxRuntime.jsx(DefaultDialogRenderer, {
|
|
2174
|
+
props: props,
|
|
2175
|
+
options: options,
|
|
2176
|
+
renderer: renderers,
|
|
2177
|
+
renderOptions: props.renderOptions
|
|
2178
|
+
});
|
|
2179
|
+
}, {
|
|
2180
|
+
renderType: schemas.GroupRenderType.Dialog
|
|
2181
|
+
});
|
|
2182
|
+
}
|
|
2183
|
+
function DefaultDialogRenderer(_ref) {
|
|
2184
|
+
var _effect = core.useComponentTracking();
|
|
2185
|
+
try {
|
|
2186
|
+
var props = _ref.props,
|
|
2187
|
+
options = _ref.options,
|
|
2188
|
+
renderOptions = _ref.renderOptions,
|
|
2189
|
+
renderer = _ref.renderer;
|
|
2190
|
+
var _deepMerge = schemas.deepMerge(options, defaultRNDialogOptions),
|
|
2191
|
+
_deepMerge$classes = _deepMerge.classes,
|
|
2192
|
+
containerClass = _deepMerge$classes.containerClass,
|
|
2193
|
+
className = _deepMerge$classes.className,
|
|
2194
|
+
titleClass = _deepMerge$classes.titleClass;
|
|
2195
|
+
var dialogOpen = core.useControl(false);
|
|
2196
|
+
var _useWindowDimensions = reactNative.useWindowDimensions(),
|
|
2197
|
+
width = _useWindowDimensions.width;
|
|
2198
|
+
var maxWidth = React.useMemo(function () {
|
|
2199
|
+
return Math.min(width - 32, 1024);
|
|
2200
|
+
}, [width]);
|
|
2201
|
+
var actionOnClick = function actionOnClick(action) {
|
|
2202
|
+
switch (action) {
|
|
2203
|
+
case "closeDialog":
|
|
2204
|
+
return function () {
|
|
2205
|
+
dialogOpen.value = false;
|
|
2206
|
+
};
|
|
2207
|
+
case "openDialog":
|
|
2208
|
+
return function () {
|
|
2209
|
+
dialogOpen.value = true;
|
|
2210
|
+
};
|
|
2211
|
+
}
|
|
2212
|
+
};
|
|
2213
|
+
var allChildren = props.formNode.children;
|
|
2214
|
+
var triggerChildren = allChildren.filter(function (x) {
|
|
2215
|
+
return x.definition.placement === "trigger";
|
|
2216
|
+
});
|
|
2217
|
+
var title = renderOptions.title,
|
|
2218
|
+
portalHost = renderOptions.portalHost;
|
|
2219
|
+
return jsxRuntime.jsxs(Dialog, {
|
|
2220
|
+
open: dialogOpen.value,
|
|
2221
|
+
onOpenChange: function onOpenChange(o) {
|
|
2222
|
+
dialogOpen.value = o;
|
|
2223
|
+
},
|
|
2224
|
+
children: [triggerChildren.map(function (x) {
|
|
2225
|
+
return props.renderChild(x, {
|
|
2226
|
+
actionOnClick: actionOnClick
|
|
2227
|
+
});
|
|
2228
|
+
}), jsxRuntime.jsxs(DialogContent, {
|
|
2229
|
+
closeOnOutsidePress: false,
|
|
2230
|
+
className: cn("min-w-[200px] min-h-[200px] z-10", containerClass),
|
|
2231
|
+
style: {
|
|
2232
|
+
maxWidth: maxWidth
|
|
2233
|
+
},
|
|
2234
|
+
portalHost: reactNative.Platform.select({
|
|
2235
|
+
ios: portalHost != null && portalHost.trim() ? portalHost : undefined
|
|
2236
|
+
}),
|
|
2237
|
+
children: [jsxRuntime.jsxs(reactNative.View, {
|
|
2238
|
+
className: "flex flex-row gap-[10px] justify-between items-start w-full",
|
|
2239
|
+
children: [jsxRuntime.jsx(DialogTitle, {
|
|
2240
|
+
asChild: true,
|
|
2241
|
+
className: titleClass,
|
|
2242
|
+
children: title
|
|
2243
|
+
}), jsxRuntime.jsx(DialogClose, {
|
|
2244
|
+
className: "rounded-sm",
|
|
2245
|
+
asChild: true,
|
|
2246
|
+
children: jsxRuntime.jsx(reactNative.TouchableOpacity, {
|
|
2247
|
+
children: jsxRuntime.jsx(vectorIcons.FontAwesome6, {
|
|
2248
|
+
name: "xmark-circle",
|
|
2249
|
+
size: 24,
|
|
2250
|
+
color: "#267151"
|
|
2251
|
+
})
|
|
2252
|
+
})
|
|
2253
|
+
})]
|
|
2254
|
+
}), jsxRuntime.jsx(reactNative.ScrollView, {
|
|
2255
|
+
persistentScrollbar: true,
|
|
2256
|
+
children: jsxRuntime.jsx(reactNative.View, {
|
|
2257
|
+
className: "flex flex-col gap-[12px]",
|
|
2258
|
+
onStartShouldSetResponder: function onStartShouldSetResponder() {
|
|
2259
|
+
return true;
|
|
2260
|
+
},
|
|
2261
|
+
children: allChildren.filter(function (x) {
|
|
2262
|
+
return !x.definition.placement || x.definition.placement === "dialog";
|
|
2263
|
+
}).map(function (x, i) {
|
|
2264
|
+
return props.renderChild(x, {
|
|
2265
|
+
actionOnClick: actionOnClick
|
|
2266
|
+
});
|
|
2267
|
+
})
|
|
2268
|
+
})
|
|
2269
|
+
})]
|
|
2270
|
+
})]
|
|
2271
|
+
});
|
|
2272
|
+
} finally {
|
|
2273
|
+
_effect();
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
function createDefaultGroupRenderer(options, adornmentOptions) {
|
|
2278
|
+
var _options$accordion;
|
|
2279
|
+
// These renderers work with React Native via the HTML abstraction layer
|
|
2280
|
+
var gridRenderer = createGridRenderer(options == null ? void 0 : options.grid);
|
|
2281
|
+
var wizardRenderer = createWizardRenderer(options == null ? void 0 : options.wizard);
|
|
2282
|
+
// Stub renderers for React Native - these should be replaced with RN implementations
|
|
2283
|
+
var tabsRenderer = {
|
|
2284
|
+
render: function render(props, renderer) {
|
|
2285
|
+
console.error("Tabs renderer not implemented for React Native");
|
|
2286
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
2287
|
+
}
|
|
2288
|
+
};
|
|
2289
|
+
var dialogRenderer = createDialogRenderer(options == null ? void 0 : options.dialog);
|
|
2290
|
+
var accordionRenderer = createAccordionGroupRenderer((_options$accordion = options == null ? void 0 : options.accordion) != null ? _options$accordion : adornmentOptions == null ? void 0 : adornmentOptions.accordion);
|
|
2291
|
+
var _ref = options != null ? options : {},
|
|
2292
|
+
className = _ref.className,
|
|
2293
|
+
standardClassName = _ref.standardClassName,
|
|
2294
|
+
flexClassName = _ref.flexClassName,
|
|
2295
|
+
inlineClass = _ref.inlineClass,
|
|
2296
|
+
defaultFlexGap = _ref.defaultFlexGap;
|
|
2297
|
+
function flexStyles(options) {
|
|
2298
|
+
// React Native uses flexbox by default, no need for display: "flex"
|
|
2299
|
+
return {
|
|
2300
|
+
className: flexClassName,
|
|
2301
|
+
style: {
|
|
2302
|
+
gap: options.gap ? options.gap : defaultFlexGap,
|
|
2303
|
+
flexDirection: options.direction ? options.direction : undefined
|
|
2304
|
+
}
|
|
2305
|
+
};
|
|
2306
|
+
}
|
|
2307
|
+
function render(props, renderer) {
|
|
2308
|
+
var renderChild = props.renderChild,
|
|
2309
|
+
renderOptions = props.renderOptions,
|
|
2310
|
+
formNode = props.formNode;
|
|
2311
|
+
if (schemas.isTabsRenderer(renderOptions)) return tabsRenderer.render(props, renderer);
|
|
2312
|
+
if (schemas.isGridRenderer(renderOptions)) return gridRenderer.render(props, renderer);
|
|
2313
|
+
if (schemas.isWizardRenderer(renderOptions)) return wizardRenderer.render(props, renderer);
|
|
2314
|
+
if (schemas.isDialogRenderer(renderOptions)) return dialogRenderer.render(props, renderer);
|
|
2315
|
+
if (schemas.isAccordionRenderer(renderOptions)) return accordionRenderer.render(props, renderer);
|
|
2316
|
+
if (schemas.isSelectChildRenderer(renderOptions) && !props.designMode) {
|
|
2317
|
+
return jsxRuntime.jsx(SelectChildGroupRenderer, {
|
|
2318
|
+
props: _extends({}, props, {
|
|
2319
|
+
renderOptions: renderOptions
|
|
2320
|
+
}),
|
|
2321
|
+
renderer: renderer
|
|
2322
|
+
});
|
|
2323
|
+
}
|
|
2324
|
+
var _ref2 = schemas.isFlexRenderer(renderOptions) ? flexStyles(renderOptions) : schemas.isInlineRenderer(renderOptions) ? {
|
|
2325
|
+
className: inlineClass
|
|
2326
|
+
} : {
|
|
2327
|
+
className: standardClassName
|
|
2328
|
+
},
|
|
2329
|
+
style = _ref2.style,
|
|
2330
|
+
gcn = _ref2.className;
|
|
2331
|
+
var Div = renderer.html.Div;
|
|
2332
|
+
var inline = renderOptions.type == schemas.GroupRenderType.Inline;
|
|
2333
|
+
var children = formNode.children.map(function (c, i) {
|
|
2334
|
+
return renderChild(c, {
|
|
2335
|
+
inline: inline
|
|
2336
|
+
});
|
|
2337
|
+
});
|
|
2338
|
+
return jsxRuntime.jsx(Div, {
|
|
2339
|
+
className: schemas.rendererClass(props.className, clsx__default["default"](className, gcn)),
|
|
2340
|
+
textClass: props.textClass,
|
|
2341
|
+
style: style,
|
|
2342
|
+
inline: inline,
|
|
2343
|
+
children: children
|
|
2344
|
+
});
|
|
2345
|
+
}
|
|
2346
|
+
function renderLayout(props, renderer) {
|
|
2347
|
+
if (props.renderOptions.type === schemas.GroupRenderType.Contents) {
|
|
2348
|
+
var formNode = props.formNode,
|
|
2349
|
+
renderChild = props.renderChild;
|
|
2350
|
+
var children = formNode.children.map(function (c) {
|
|
2351
|
+
return renderChild(c);
|
|
2352
|
+
});
|
|
2353
|
+
return function (layout) {
|
|
2354
|
+
return _extends({}, layout, {
|
|
2355
|
+
inline: true,
|
|
2356
|
+
children: children
|
|
2357
|
+
});
|
|
2358
|
+
};
|
|
2359
|
+
}
|
|
2360
|
+
return render(props, renderer);
|
|
2361
|
+
}
|
|
2362
|
+
return {
|
|
2363
|
+
type: "group",
|
|
2364
|
+
render: renderLayout
|
|
2365
|
+
};
|
|
2366
|
+
}
|
|
2367
|
+
function SelectChildGroupRenderer(_ref3) {
|
|
2368
|
+
var _effect = core.useComponentTracking();
|
|
2369
|
+
try {
|
|
2370
|
+
var props = _ref3.props,
|
|
2371
|
+
renderer = _ref3.renderer;
|
|
2372
|
+
var Div = renderer.html.Div;
|
|
2373
|
+
var runExpression = props.runExpression,
|
|
2374
|
+
renderOptions = props.renderOptions;
|
|
2375
|
+
var ctrl = schemas.useExpression(undefined, runExpression, renderOptions == null ? void 0 : renderOptions.childIndexExpression, function (x) {
|
|
2376
|
+
return typeof x == "string" ? parseInt(x) : x;
|
|
2377
|
+
});
|
|
2378
|
+
var childIndex = ctrl == null ? void 0 : ctrl.value;
|
|
2379
|
+
var childCount = props.formNode.getChildCount();
|
|
2380
|
+
return jsxRuntime.jsx(Div, {
|
|
2381
|
+
children: typeof childIndex === "number" && childIndex < childCount && childIndex >= 0 && props.renderChild(props.formNode.getChild(childIndex))
|
|
2382
|
+
});
|
|
2383
|
+
} finally {
|
|
2384
|
+
_effect();
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
function createButtonActionRenderer(actionId, options) {
|
|
2389
|
+
if (options === void 0) {
|
|
2390
|
+
options = {};
|
|
2391
|
+
}
|
|
2392
|
+
return schemas.createActionRenderer(actionId, function (props, renderer) {
|
|
2393
|
+
var _props$icon, _ref, _props$iconPlacement, _ref2, _props$iconPlacement2, _options$renderConten;
|
|
2394
|
+
var key = props.key,
|
|
2395
|
+
onClick = props.onClick,
|
|
2396
|
+
actionText = props.actionText,
|
|
2397
|
+
className = props.className,
|
|
2398
|
+
style = props.style,
|
|
2399
|
+
actionId = props.actionId,
|
|
2400
|
+
actionData = props.actionData,
|
|
2401
|
+
disabled = props.disabled,
|
|
2402
|
+
textClass = props.textClass,
|
|
2403
|
+
actionStyle = props.actionStyle,
|
|
2404
|
+
inline = props.inline,
|
|
2405
|
+
actionContent = props.actionContent,
|
|
2406
|
+
busy = props.busy;
|
|
2407
|
+
var busyIcon = props.busy ? options.busyIcon : undefined;
|
|
2408
|
+
var stdIcon = (_props$icon = props.icon) != null && _props$icon.name ? props.icon : options.icon;
|
|
2409
|
+
var icon = busyIcon != null ? busyIcon : stdIcon;
|
|
2410
|
+
var stdIconPlacement = (_ref = (_props$iconPlacement = props.iconPlacement) != null ? _props$iconPlacement : options.iconPlacement) != null ? _ref : schemas.IconPlacement.BeforeText;
|
|
2411
|
+
var busyPlacement = (_ref2 = (_props$iconPlacement2 = props.iconPlacement) != null ? _props$iconPlacement2 : options.busyIconPlacement) != null ? _ref2 : schemas.IconPlacement.ReplaceText;
|
|
2412
|
+
var iconPlacement = busyIcon ? busyPlacement : stdIconPlacement;
|
|
2413
|
+
var _renderer$html = renderer.html,
|
|
2414
|
+
Button = _renderer$html.Button,
|
|
2415
|
+
I = _renderer$html.I,
|
|
2416
|
+
Span = _renderer$html.Span;
|
|
2417
|
+
var isLink = actionStyle == schemas.ActionStyle.Link;
|
|
2418
|
+
var isGroup = actionStyle == schemas.ActionStyle.Group;
|
|
2419
|
+
var classNames = schemas.rendererClass(className, isLink ? options.linkClass : isGroup ? options.groupClass : schemas.rendererClass(options.buttonClass, actionStyle == schemas.ActionStyle.Secondary ? options.secondaryClass : options.primaryClass));
|
|
2420
|
+
var textClassNames = schemas.rendererClass(textClass, isLink ? options.linkTextClass : schemas.rendererClass(options.textClass, actionStyle == schemas.ActionStyle.Secondary ? options.secondaryTextClass : options.primaryTextClass));
|
|
2421
|
+
var iconElement = icon && jsxRuntime.jsx(I, {
|
|
2422
|
+
iconName: icon.name,
|
|
2423
|
+
iconLibrary: icon.library,
|
|
2424
|
+
className: schemas.rendererClass(textClassNames, iconPlacement == schemas.IconPlacement.BeforeText ? options.iconBeforeClass : options.iconAfterClass)
|
|
2425
|
+
});
|
|
2426
|
+
var textElement = actionContent != null ? actionContent : actionText && jsxRuntime.jsx(Span, {
|
|
2427
|
+
className: textClassNames,
|
|
2428
|
+
children: actionText
|
|
2429
|
+
});
|
|
2430
|
+
return jsxRuntime.jsx(Button, {
|
|
2431
|
+
className: classNames,
|
|
2432
|
+
textClass: textClassNames,
|
|
2433
|
+
disabled: disabled,
|
|
2434
|
+
style: style,
|
|
2435
|
+
onClick: onClick,
|
|
2436
|
+
inline: inline,
|
|
2437
|
+
nonTextContent: isGroup,
|
|
2438
|
+
title: iconPlacement == schemas.IconPlacement.ReplaceText ? actionText : undefined,
|
|
2439
|
+
notWrapInText: options.notWrapInText,
|
|
2440
|
+
androidRippleColor: options.androidRippleColor,
|
|
2441
|
+
children: (_options$renderConten = options.renderContent == null ? void 0 : options.renderContent(actionText, actionId, actionData, busy)) != null ? _options$renderConten : jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2442
|
+
children: [iconPlacement == schemas.IconPlacement.BeforeText && iconElement, iconPlacement != schemas.IconPlacement.ReplaceText && textElement, iconPlacement != schemas.IconPlacement.BeforeText && iconElement]
|
|
2443
|
+
})
|
|
2444
|
+
}, key);
|
|
2445
|
+
});
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
var _excluded = ["inline", "textClass", "children", "notWrapInText", "androidRippleColor", "nonTextContent", "onClick"],
|
|
2449
|
+
_excluded2 = ["className", "html", "children", "textClass", "text", "style", "inline", "role"],
|
|
2450
|
+
_excluded3 = ["className", "html", "children", "textClass", "text", "style", "inline", "role"],
|
|
2451
|
+
_excluded4 = ["id", "type", "onChangeValue", "onChangeChecked", "checked", "value"];
|
|
2452
|
+
function createDefaultDataRenderer(options) {
|
|
2453
|
+
var _options$checkboxOpti, _options$checkboxOpti2, _options$radioOptions, _options$checkListOpt;
|
|
2454
|
+
if (options === void 0) {
|
|
2455
|
+
options = {};
|
|
2456
|
+
}
|
|
2457
|
+
var elementSelectedRenderer = createElementSelectedRenderer((_options$checkboxOpti = options.checkboxOptions) != null ? _options$checkboxOpti : options.checkOptions);
|
|
2458
|
+
var nullToggler = createNullToggleRenderer();
|
|
2459
|
+
// Use RN-specific renderers directly
|
|
2460
|
+
var checkboxRenderer = createRNCheckboxRenderer((_options$checkboxOpti2 = options.checkboxOptions) != null ? _options$checkboxOpti2 : options.checkOptions);
|
|
2461
|
+
var selectRenderer = createRNSelectRenderer(options.selectOptions);
|
|
2462
|
+
var radioRenderer = createRadioRenderer((_options$radioOptions = options.radioOptions) != null ? _options$radioOptions : options.checkOptions);
|
|
2463
|
+
var checkListRenderer = createCheckListRenderer((_options$checkListOpt = options.checkListOptions) != null ? _options$checkListOpt : options.checkOptions);
|
|
2464
|
+
var _optionRenderer$boole = _extends({
|
|
2465
|
+
optionRenderer: selectRenderer,
|
|
2466
|
+
booleanOptions: DefaultBoolOptions
|
|
2467
|
+
}, options),
|
|
2468
|
+
booleanOptions = _optionRenderer$boole.booleanOptions,
|
|
2469
|
+
optionRenderer = _optionRenderer$boole.optionRenderer,
|
|
2470
|
+
displayOnlyClass = _optionRenderer$boole.displayOnlyClass,
|
|
2471
|
+
defaultEmptyText = _optionRenderer$boole.defaultEmptyText;
|
|
2472
|
+
var arrayRenderer = createDefaultArrayDataRenderer(options.arrayOptions);
|
|
2473
|
+
var scrollListRenderer = createRNScrollListRenderer(options.scrollListOptions);
|
|
2474
|
+
// Add RN-specific text input renderer
|
|
2475
|
+
var textInputRenderer = createRNTextInputRenderer(options.inputClass, options.inputTextClass);
|
|
2476
|
+
// Add RN datetime picker for non-web platforms
|
|
2477
|
+
var dateTimeRenderer = reactNative.Platform.OS !== "web" ? createRNDateTimePickerRenderer(options) : null;
|
|
2478
|
+
return schemas.createDataRenderer(function (props, renderers) {
|
|
2479
|
+
var field = props.field;
|
|
2480
|
+
var fieldType = field.type;
|
|
2481
|
+
var renderOptions = props.renderOptions;
|
|
2482
|
+
var renderType = renderOptions.type ? renderOptions.type : schemas.DataRenderType.Standard;
|
|
2483
|
+
if (field.collection && props.dataNode.elementIndex == null && (renderType == schemas.DataRenderType.Standard || renderType == schemas.DataRenderType.Array || renderType == schemas.DataRenderType.ArrayElement)) {
|
|
2484
|
+
if (renderType == schemas.DataRenderType.ArrayElement) console.error("ArrayElement renderer not implemented for React Native");
|
|
2485
|
+
return arrayRenderer.render(props, renderers);
|
|
583
2486
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
2487
|
+
if (fieldType === schemas.FieldType.Compound && (schemas.isDataGroupRenderer(renderOptions) || renderType === schemas.DataRenderType.Standard)) {
|
|
2488
|
+
var _ref;
|
|
2489
|
+
var groupOptions = (_ref = schemas.isDataGroupRenderer(renderOptions) ? renderOptions.groupOptions : undefined) != null ? _ref : {
|
|
2490
|
+
type: "Standard",
|
|
2491
|
+
hideTitle: true
|
|
2492
|
+
};
|
|
2493
|
+
return renderers.renderGroup(_extends({}, props, {
|
|
2494
|
+
renderOptions: groupOptions
|
|
2495
|
+
}));
|
|
2496
|
+
}
|
|
2497
|
+
if (props.displayOnly || schemas.isDisplayOnlyRenderer(renderOptions)) return function (p) {
|
|
2498
|
+
return _extends({}, p, {
|
|
2499
|
+
className: "@ " + schemas.rendererClass(p.className, displayOnlyClass),
|
|
2500
|
+
children: jsxRuntime.jsx(DefaultDisplayOnly, {
|
|
2501
|
+
dataNode: props.dataNode,
|
|
2502
|
+
state: props.formNode,
|
|
2503
|
+
schemaInterface: props.dataContext.schemaInterface,
|
|
2504
|
+
className: props.className,
|
|
2505
|
+
textClass: props.textClass,
|
|
2506
|
+
style: props.style,
|
|
2507
|
+
inline: props.inline,
|
|
2508
|
+
renderer: renderers,
|
|
2509
|
+
emptyText: schemas.isDisplayOnlyRenderer(renderOptions) && renderOptions.emptyText ? renderOptions.emptyText : defaultEmptyText
|
|
2510
|
+
})
|
|
590
2511
|
});
|
|
2512
|
+
};
|
|
2513
|
+
var isBool = fieldType === schemas.FieldType.Bool;
|
|
2514
|
+
if (booleanOptions != null && isBool && props.options == null) {
|
|
2515
|
+
return renderers.renderData(_extends({}, props, {
|
|
2516
|
+
options: booleanOptions
|
|
2517
|
+
}));
|
|
591
2518
|
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
removableClass: "flex flex-col gap-y-2"
|
|
595
|
-
},
|
|
596
|
-
action: {
|
|
597
|
-
buttonClass: "flex flex-row gap-2 bg-primary-500 rounded-lg p-3 web:hover:opacity-90 active:opacity-90",
|
|
598
|
-
textClass: "text-white"
|
|
599
|
-
},
|
|
600
|
-
adornment: {
|
|
601
|
-
accordion: {
|
|
602
|
-
className: "flex flex-row items-center gap-2 my-2 p-0"
|
|
603
|
-
},
|
|
604
|
-
helpText: {
|
|
605
|
-
iconName: "info-circle",
|
|
606
|
-
iconClass: "text-[12px]",
|
|
607
|
-
triggerContainerClass: "flex flex-row gap-2 items-baseline",
|
|
608
|
-
triggerLabelClass: "text-sm font-bold",
|
|
609
|
-
contentTextClass: "text-white font-semibold text-sm"
|
|
2519
|
+
if (renderType === schemas.DataRenderType.Standard && schemas.hasOptions(props)) {
|
|
2520
|
+
return optionRenderer.render(props, renderers);
|
|
610
2521
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
2522
|
+
switch (renderType) {
|
|
2523
|
+
case schemas.DataRenderType.NullToggle:
|
|
2524
|
+
return nullToggler.render(props, renderers);
|
|
2525
|
+
case schemas.DataRenderType.CheckList:
|
|
2526
|
+
return checkListRenderer.render(props, renderers);
|
|
2527
|
+
case schemas.DataRenderType.ScrollList:
|
|
2528
|
+
return scrollListRenderer.render(props, renderers);
|
|
2529
|
+
case schemas.DataRenderType.Dropdown:
|
|
2530
|
+
return selectRenderer.render(props, renderers);
|
|
2531
|
+
case schemas.DataRenderType.Radio:
|
|
2532
|
+
return radioRenderer.render(props, renderers);
|
|
2533
|
+
case schemas.DataRenderType.Checkbox:
|
|
2534
|
+
return checkboxRenderer.render(props, renderers);
|
|
2535
|
+
case schemas.DataRenderType.Jsonata:
|
|
2536
|
+
console.error("Jsonata renderer not implemented for React Native");
|
|
2537
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
2538
|
+
case schemas.DataRenderType.Autocomplete:
|
|
2539
|
+
console.error("Autocomplete renderer not implemented for React Native");
|
|
2540
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
2541
|
+
case schemas.DataRenderType.ElementSelected:
|
|
2542
|
+
return elementSelectedRenderer.render(props, renderers);
|
|
2543
|
+
}
|
|
2544
|
+
// Handle DateTime fields with RN-specific datetime picker (if available)
|
|
2545
|
+
if ((fieldType === schemas.FieldType.Date || fieldType === schemas.FieldType.DateTime) && dateTimeRenderer) {
|
|
2546
|
+
return dateTimeRenderer.render(props, renderers);
|
|
2547
|
+
}
|
|
2548
|
+
if (fieldType == schemas.FieldType.Any) {
|
|
2549
|
+
var _field$displayName;
|
|
2550
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2551
|
+
children: ["Can't render field: ", (_field$displayName = field.displayName) != null ? _field$displayName : field.field, " (", renderType, ")"]
|
|
2552
|
+
});
|
|
2553
|
+
}
|
|
2554
|
+
// Use RN text input renderer for explicit textfield renderers
|
|
2555
|
+
if (schemas.isTextfieldRenderer(renderOptions)) {
|
|
2556
|
+
return textInputRenderer.render(props, renderers);
|
|
618
2557
|
}
|
|
619
|
-
|
|
2558
|
+
// Use ControlInput for default inputs (handles numbers, etc.)
|
|
2559
|
+
return jsxRuntime.jsx(ControlInput, {
|
|
2560
|
+
className: schemas.rendererClass(props.className, options.inputClass),
|
|
2561
|
+
textClass: schemas.rendererClass(props.textClass, options.inputTextClass),
|
|
2562
|
+
style: props.style,
|
|
2563
|
+
id: props.id,
|
|
2564
|
+
errorId: props.errorId,
|
|
2565
|
+
readOnly: props.readonly,
|
|
2566
|
+
control: props.control,
|
|
2567
|
+
convert: createInputConversion(props.field.type),
|
|
2568
|
+
renderer: renderers
|
|
2569
|
+
});
|
|
2570
|
+
});
|
|
2571
|
+
}
|
|
2572
|
+
function createDefaultAdornmentRenderer(options) {
|
|
2573
|
+
if (options === void 0) {
|
|
2574
|
+
options = {};
|
|
620
2575
|
}
|
|
621
|
-
|
|
622
|
-
|
|
2576
|
+
return {
|
|
2577
|
+
type: "adornment",
|
|
2578
|
+
render: function render(props, renderers) {
|
|
2579
|
+
if (schemas.isOptionalAdornment(props.adornment)) {
|
|
2580
|
+
console.error("Optional adornment not implemented for React Native");
|
|
2581
|
+
return {
|
|
2582
|
+
apply: function apply() {
|
|
2583
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
2584
|
+
},
|
|
2585
|
+
priority: 0
|
|
2586
|
+
};
|
|
2587
|
+
}
|
|
2588
|
+
var adornment = props.adornment,
|
|
2589
|
+
designMode = props.designMode,
|
|
2590
|
+
dataContext = props.dataContext,
|
|
2591
|
+
runExpression = props.runExpression;
|
|
2592
|
+
return {
|
|
2593
|
+
apply: function apply(rl) {
|
|
2594
|
+
if (schemas.isSetFieldAdornment(adornment) && runExpression) {
|
|
2595
|
+
return schemas.wrapLayout(function (x) {
|
|
2596
|
+
return jsxRuntime.jsx(SetFieldWrapper, {
|
|
2597
|
+
children: x,
|
|
2598
|
+
parentContext: dataContext,
|
|
2599
|
+
adornment: adornment,
|
|
2600
|
+
runExpression: runExpression
|
|
2601
|
+
});
|
|
2602
|
+
})(rl);
|
|
2603
|
+
}
|
|
2604
|
+
if (schemas.isIconAdornment(adornment)) {
|
|
2605
|
+
var I = renderers.html.I;
|
|
2606
|
+
var icon = adornment.icon,
|
|
2607
|
+
placement = adornment.placement,
|
|
2608
|
+
iconClass = adornment.iconClass;
|
|
2609
|
+
return schemas.appendMarkupAt(placement != null ? placement : schemas.AdornmentPlacement.ControlStart, jsxRuntime.jsx(I, {
|
|
2610
|
+
className: iconClass,
|
|
2611
|
+
iconName: icon == null ? void 0 : icon.name,
|
|
2612
|
+
iconLibrary: icon == null ? void 0 : icon.library
|
|
2613
|
+
}))(rl);
|
|
2614
|
+
}
|
|
2615
|
+
if (schemas.isAccordionAdornment(adornment)) {
|
|
2616
|
+
return schemas.wrapLayout(function (x) {
|
|
2617
|
+
var _rl$children$props;
|
|
2618
|
+
var displayProps = /*#__PURE__*/React.isValidElement(rl.children) ? (_rl$children$props = rl.children.props) == null ? void 0 : _rl$children$props.displayProps : undefined;
|
|
2619
|
+
return jsxRuntime.jsx(DefaultAccordion, {
|
|
2620
|
+
isGroup: false,
|
|
2621
|
+
renderers: renderers,
|
|
2622
|
+
children: x,
|
|
2623
|
+
className: displayProps == null ? void 0 : displayProps.className,
|
|
2624
|
+
titleTextClass: displayProps == null ? void 0 : displayProps.textClass,
|
|
2625
|
+
title: renderers.renderLabelText(adornment.title),
|
|
2626
|
+
defaultExpanded: adornment.defaultExpanded,
|
|
2627
|
+
contentStyle: rl.style,
|
|
2628
|
+
contentClassName: rl.className,
|
|
2629
|
+
designMode: designMode,
|
|
2630
|
+
dataContext: dataContext,
|
|
2631
|
+
options: options.accordion
|
|
2632
|
+
});
|
|
2633
|
+
})(rl);
|
|
2634
|
+
}
|
|
2635
|
+
},
|
|
2636
|
+
priority: 0,
|
|
2637
|
+
adornment: adornment
|
|
2638
|
+
};
|
|
2639
|
+
}
|
|
2640
|
+
};
|
|
2641
|
+
}
|
|
2642
|
+
function SetFieldWrapper(_ref2) {
|
|
2643
|
+
var children = _ref2.children,
|
|
2644
|
+
adornment = _ref2.adornment,
|
|
2645
|
+
parentContext = _ref2.parentContext,
|
|
2646
|
+
runExpression = _ref2.runExpression;
|
|
2647
|
+
var fieldNode = schemas.schemaDataForFieldRef(adornment.field, parentContext.parentNode);
|
|
2648
|
+
var otherField = fieldNode.control;
|
|
2649
|
+
var always = !adornment.defaultOnly;
|
|
2650
|
+
var value = schemas.useExpression(undefined, runExpression, adornment.expression, function (x) {
|
|
2651
|
+
return x;
|
|
2652
|
+
});
|
|
2653
|
+
core.useControlEffect(function () {
|
|
2654
|
+
return [value == null ? void 0 : value.value, (otherField == null ? void 0 : otherField.value) == null];
|
|
2655
|
+
}, function (_ref3) {
|
|
2656
|
+
var v = _ref3[0];
|
|
2657
|
+
otherField == null || otherField.setValue(function (x) {
|
|
2658
|
+
return always || x == null ? v : x;
|
|
2659
|
+
});
|
|
2660
|
+
}, true);
|
|
2661
|
+
return children;
|
|
2662
|
+
}
|
|
2663
|
+
function createDefaultLabelRenderer(options) {
|
|
2664
|
+
var _labelContainer$optio = _extends({
|
|
2665
|
+
labelContainer: function labelContainer(c) {
|
|
2666
|
+
return c;
|
|
2667
|
+
}
|
|
2668
|
+
}, options),
|
|
2669
|
+
className = _labelContainer$optio.className,
|
|
2670
|
+
controlLabelTextClass = _labelContainer$optio.controlLabelTextClass,
|
|
2671
|
+
groupLabelTextClass = _labelContainer$optio.groupLabelTextClass,
|
|
2672
|
+
groupLabelClass = _labelContainer$optio.groupLabelClass,
|
|
2673
|
+
controlLabelClass = _labelContainer$optio.controlLabelClass,
|
|
2674
|
+
textClass = _labelContainer$optio.textClass,
|
|
2675
|
+
labelContainer = _labelContainer$optio.labelContainer;
|
|
2676
|
+
return {
|
|
2677
|
+
render: function render(props, labelStart, labelEnd, renderers) {
|
|
2678
|
+
var _options$requiredElem;
|
|
2679
|
+
var _renderers$html = renderers.html,
|
|
2680
|
+
Label = _renderers$html.Label,
|
|
2681
|
+
Span = _renderers$html.Span;
|
|
2682
|
+
var requiredElement = (_options$requiredElem = options == null ? void 0 : options.requiredElement) != null ? _options$requiredElem : function (_ref4) {
|
|
2683
|
+
var Span = _ref4.Span;
|
|
2684
|
+
return jsxRuntime.jsx(Span, {
|
|
2685
|
+
children: " *"
|
|
2686
|
+
});
|
|
2687
|
+
};
|
|
2688
|
+
if (props.type == schemas.LabelType.Text) return jsxRuntime.jsx(Span, {
|
|
2689
|
+
children: props.label
|
|
2690
|
+
});
|
|
2691
|
+
return labelContainer(jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2692
|
+
children: [jsxRuntime.jsxs(Label, {
|
|
2693
|
+
htmlFor: props.forId,
|
|
2694
|
+
className: schemas.rendererClass(props.className, clsx__default["default"](className, props.type === schemas.LabelType.Group && groupLabelClass, props.type === schemas.LabelType.Control && controlLabelClass)),
|
|
2695
|
+
textClass: schemas.rendererClass(props.textClass, clsx__default["default"](textClass, props.type === schemas.LabelType.Group && groupLabelTextClass, props.type === schemas.LabelType.Control && controlLabelTextClass)),
|
|
2696
|
+
children: [labelStart, renderers.renderLabelText(props.label), props.required && requiredElement(renderers.html)]
|
|
2697
|
+
}), labelEnd]
|
|
2698
|
+
}));
|
|
2699
|
+
},
|
|
2700
|
+
type: "label"
|
|
2701
|
+
};
|
|
2702
|
+
}
|
|
2703
|
+
// React Native HTML Components Implementation
|
|
2704
|
+
function RNIcon(_ref5) {
|
|
623
2705
|
var _effect = core.useComponentTracking();
|
|
624
2706
|
try {
|
|
625
|
-
var iconName =
|
|
626
|
-
className =
|
|
627
|
-
iconLibrary =
|
|
2707
|
+
var iconName = _ref5.iconName,
|
|
2708
|
+
className = _ref5.className,
|
|
2709
|
+
iconLibrary = _ref5.iconLibrary;
|
|
628
2710
|
return iconName ? jsxRuntime.jsx(Icon, {
|
|
629
2711
|
name: iconName,
|
|
630
2712
|
className: className,
|
|
@@ -642,17 +2724,17 @@ function RNSpan(props) {
|
|
|
642
2724
|
_effect2();
|
|
643
2725
|
}
|
|
644
2726
|
}
|
|
645
|
-
function RNButton
|
|
2727
|
+
function RNButton(_ref6) {
|
|
646
2728
|
var _effect3 = core.useComponentTracking();
|
|
647
2729
|
try {
|
|
648
|
-
var inline =
|
|
649
|
-
textClass =
|
|
650
|
-
children =
|
|
651
|
-
notWrapInText =
|
|
652
|
-
androidRippleColor =
|
|
653
|
-
nonTextContent =
|
|
654
|
-
onClick =
|
|
655
|
-
props = _objectWithoutPropertiesLoose(
|
|
2730
|
+
var inline = _ref6.inline,
|
|
2731
|
+
textClass = _ref6.textClass,
|
|
2732
|
+
children = _ref6.children,
|
|
2733
|
+
notWrapInText = _ref6.notWrapInText,
|
|
2734
|
+
androidRippleColor = _ref6.androidRippleColor,
|
|
2735
|
+
nonTextContent = _ref6.nonTextContent,
|
|
2736
|
+
onClick = _ref6.onClick,
|
|
2737
|
+
props = _objectWithoutPropertiesLoose(_ref6, _excluded);
|
|
656
2738
|
if (inline) {
|
|
657
2739
|
return jsxRuntime.jsx(reactNative.Text, _extends({}, props, {
|
|
658
2740
|
className: textClass,
|
|
@@ -676,20 +2758,22 @@ function RNButton$1(_ref2) {
|
|
|
676
2758
|
_effect3();
|
|
677
2759
|
}
|
|
678
2760
|
}
|
|
679
|
-
function RNLabel(
|
|
2761
|
+
function RNLabel(_ref7) {
|
|
680
2762
|
var _effect4 = core.useComponentTracking();
|
|
681
2763
|
try {
|
|
682
|
-
var className =
|
|
683
|
-
html =
|
|
684
|
-
children =
|
|
685
|
-
textClass =
|
|
686
|
-
text =
|
|
687
|
-
style =
|
|
688
|
-
inline =
|
|
689
|
-
|
|
690
|
-
|
|
2764
|
+
var className = _ref7.className,
|
|
2765
|
+
html = _ref7.html,
|
|
2766
|
+
children = _ref7.children,
|
|
2767
|
+
textClass = _ref7.textClass,
|
|
2768
|
+
text = _ref7.text,
|
|
2769
|
+
style = _ref7.style,
|
|
2770
|
+
inline = _ref7.inline,
|
|
2771
|
+
role = _ref7.role,
|
|
2772
|
+
props = _objectWithoutPropertiesLoose(_ref7, _excluded2);
|
|
2773
|
+
return !isNodeEmpty(children) && jsxRuntime.jsx(reactNative.View, _extends({
|
|
691
2774
|
className: className,
|
|
692
|
-
style: style
|
|
2775
|
+
style: style,
|
|
2776
|
+
role: role
|
|
693
2777
|
}, props, {
|
|
694
2778
|
children: jsxRuntime.jsx(reactNative.Text, {
|
|
695
2779
|
className: textClass,
|
|
@@ -700,17 +2784,18 @@ function RNLabel(_ref3) {
|
|
|
700
2784
|
_effect4();
|
|
701
2785
|
}
|
|
702
2786
|
}
|
|
703
|
-
function RNDiv(
|
|
2787
|
+
function RNDiv(_ref8) {
|
|
704
2788
|
var _effect5 = core.useComponentTracking();
|
|
705
2789
|
try {
|
|
706
|
-
var className =
|
|
707
|
-
html =
|
|
708
|
-
children =
|
|
709
|
-
textClass =
|
|
710
|
-
text =
|
|
711
|
-
style =
|
|
712
|
-
inline =
|
|
713
|
-
|
|
2790
|
+
var className = _ref8.className,
|
|
2791
|
+
html = _ref8.html,
|
|
2792
|
+
children = _ref8.children,
|
|
2793
|
+
textClass = _ref8.textClass,
|
|
2794
|
+
text = _ref8.text,
|
|
2795
|
+
style = _ref8.style,
|
|
2796
|
+
inline = _ref8.inline,
|
|
2797
|
+
role = _ref8.role,
|
|
2798
|
+
props = _objectWithoutPropertiesLoose(_ref8, _excluded3);
|
|
714
2799
|
if (html != null) {
|
|
715
2800
|
return jsxRuntime.jsx(RNHtmlRenderer, _extends({}, props, {
|
|
716
2801
|
html: html
|
|
@@ -726,7 +2811,8 @@ function RNDiv(_ref4) {
|
|
|
726
2811
|
if (text != null) {
|
|
727
2812
|
return jsxRuntime.jsx(reactNative.View, _extends({
|
|
728
2813
|
className: className,
|
|
729
|
-
style: style
|
|
2814
|
+
style: style,
|
|
2815
|
+
role: role
|
|
730
2816
|
}, props, {
|
|
731
2817
|
children: jsxRuntime.jsx(reactNative.Text, {
|
|
732
2818
|
className: textClass,
|
|
@@ -737,7 +2823,8 @@ function RNDiv(_ref4) {
|
|
|
737
2823
|
return jsxRuntime.jsx(reactNative.View, _extends({
|
|
738
2824
|
className: className,
|
|
739
2825
|
style: style,
|
|
740
|
-
children: children
|
|
2826
|
+
children: children,
|
|
2827
|
+
role: role
|
|
741
2828
|
}, props));
|
|
742
2829
|
} finally {
|
|
743
2830
|
_effect5();
|
|
@@ -752,7 +2839,7 @@ function RNInput(props) {
|
|
|
752
2839
|
onChangeChecked = props.onChangeChecked,
|
|
753
2840
|
checked = props.checked,
|
|
754
2841
|
value = props.value,
|
|
755
|
-
rest = _objectWithoutPropertiesLoose(props, _excluded4
|
|
2842
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded4);
|
|
756
2843
|
switch (type) {
|
|
757
2844
|
case "radio":
|
|
758
2845
|
return jsxRuntime.jsx(RNRadioItem, _extends({}, rest, {
|
|
@@ -764,13 +2851,13 @@ function RNInput(props) {
|
|
|
764
2851
|
case "checkbox":
|
|
765
2852
|
return jsxRuntime.jsx(RNCheckbox, _extends({}, rest, {
|
|
766
2853
|
checked: !!checked,
|
|
767
|
-
onCheckedChange: function onCheckedChange(
|
|
2854
|
+
onCheckedChange: function onCheckedChange() {
|
|
768
2855
|
return onChangeChecked == null ? void 0 : onChangeChecked(!checked);
|
|
769
2856
|
}
|
|
770
2857
|
}), id);
|
|
771
2858
|
default:
|
|
772
2859
|
return jsxRuntime.jsx(RNTextInput, _extends({}, rest, {
|
|
773
|
-
|
|
2860
|
+
defaultValue: typeof value == "number" ? value.toString() : value,
|
|
774
2861
|
onChangeText: function onChangeText(t) {
|
|
775
2862
|
return onChangeValue == null ? void 0 : onChangeValue(t);
|
|
776
2863
|
}
|
|
@@ -780,238 +2867,87 @@ function RNInput(props) {
|
|
|
780
2867
|
_effect6();
|
|
781
2868
|
}
|
|
782
2869
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
var
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
var _excluded$1 = ["className", "variant", "size"];
|
|
801
|
-
var buttonVariants = classVarianceAuthority.cva("group flex items-center justify-center rounded-md web:ring-offset-background web:transition-colors web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2", {
|
|
802
|
-
variants: {
|
|
803
|
-
variant: {
|
|
804
|
-
"default": "bg-primary web:hover:opacity-90 active:opacity-90",
|
|
805
|
-
destructive: "bg-destructive web:hover:opacity-90 active:opacity-90",
|
|
806
|
-
outline: "border border-input bg-background web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",
|
|
807
|
-
secondary: "bg-secondary web:hover:opacity-80 active:opacity-80",
|
|
808
|
-
ghost: "web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",
|
|
809
|
-
link: "web:underline-offset-4 web:hover:underline web:focus:underline"
|
|
810
|
-
},
|
|
811
|
-
size: {
|
|
812
|
-
"default": "h-10 px-4 py-2 native:h-12 native:px-5 native:py-3",
|
|
813
|
-
sm: "h-9 rounded-md px-3",
|
|
814
|
-
lg: "h-11 rounded-md px-8 native:h-14",
|
|
815
|
-
icon: "h-10 w-10"
|
|
816
|
-
}
|
|
817
|
-
},
|
|
818
|
-
defaultVariants: {
|
|
819
|
-
variant: "default",
|
|
820
|
-
size: "default"
|
|
2870
|
+
// React Native HTML Components
|
|
2871
|
+
// React Native HTML Components
|
|
2872
|
+
var ReactNativeHtmlComponents = {
|
|
2873
|
+
I: RNIcon,
|
|
2874
|
+
B: RNSpan,
|
|
2875
|
+
Button: RNButton,
|
|
2876
|
+
Label: RNLabel,
|
|
2877
|
+
Span: RNSpan,
|
|
2878
|
+
H1: RNSpan,
|
|
2879
|
+
Div: RNDiv,
|
|
2880
|
+
Input: RNInput,
|
|
2881
|
+
CheckButtons: RNCheckButtons
|
|
2882
|
+
};
|
|
2883
|
+
function createDefaultRenderers(options) {
|
|
2884
|
+
var _options$extraRendere, _options$html;
|
|
2885
|
+
if (options === void 0) {
|
|
2886
|
+
options = {};
|
|
821
2887
|
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
},
|
|
840
|
-
defaultVariants: {
|
|
841
|
-
variant: "default",
|
|
842
|
-
size: "default"
|
|
2888
|
+
return {
|
|
2889
|
+
data: createDefaultDataRenderer(options.data),
|
|
2890
|
+
display: createDefaultDisplayRenderer(options.display),
|
|
2891
|
+
action: createButtonActionRenderer(undefined, options.action),
|
|
2892
|
+
array: createDefaultArrayRenderer(options.array),
|
|
2893
|
+
group: createDefaultGroupRenderer(options.group, options.adornment),
|
|
2894
|
+
label: createDefaultLabelRenderer(options.label),
|
|
2895
|
+
adornment: createDefaultAdornmentRenderer(options.adornment),
|
|
2896
|
+
renderLayout: createDefaultLayoutRenderer(options.layout),
|
|
2897
|
+
visibility: createDefaultVisibilityRenderer(),
|
|
2898
|
+
extraRenderers: (_options$extraRendere = options.extraRenderers == null ? void 0 : options.extraRenderers(options)) != null ? _options$extraRendere : [],
|
|
2899
|
+
html: (_options$html = options.html) != null ? _options$html : ReactNativeHtmlComponents
|
|
2900
|
+
};
|
|
2901
|
+
}
|
|
2902
|
+
function isNodeEmpty(node) {
|
|
2903
|
+
if (node === null || node === undefined || typeof node === "boolean") {
|
|
2904
|
+
return true;
|
|
843
2905
|
}
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
className: "web:pointer-events-none"
|
|
855
|
-
}),
|
|
856
|
-
children: jsxRuntime.jsx(reactNative.Pressable, _extends({
|
|
857
|
-
className: cn(props.disabled && "opacity-50 web:pointer-events-none", buttonVariants({
|
|
858
|
-
variant: variant,
|
|
859
|
-
size: size,
|
|
860
|
-
className: className
|
|
861
|
-
})),
|
|
862
|
-
ref: ref,
|
|
863
|
-
role: "button"
|
|
864
|
-
}, props))
|
|
865
|
-
});
|
|
866
|
-
});
|
|
867
|
-
RNButton.displayName = "Button";
|
|
868
|
-
|
|
869
|
-
var _excluded = ["className"],
|
|
870
|
-
_excluded2 = ["className", "children"],
|
|
871
|
-
_excluded3 = ["className", "children", "portalHost", "closeOnOutsidePress"],
|
|
872
|
-
_excluded4 = ["className"];
|
|
873
|
-
var Dialog = DialogPrimitive__namespace.Root;
|
|
874
|
-
var DialogTrigger = DialogPrimitive__namespace.Trigger;
|
|
875
|
-
var DialogPortal = DialogPrimitive__namespace.Portal;
|
|
876
|
-
var DialogClose = DialogPrimitive__namespace.Close;
|
|
877
|
-
var DialogOverlayWeb = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
878
|
-
var className = _ref.className,
|
|
879
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
880
|
-
var _DialogPrimitive$useR = DialogPrimitive__namespace.useRootContext(),
|
|
881
|
-
open = _DialogPrimitive$useR.open;
|
|
882
|
-
return jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, _extends({
|
|
883
|
-
className: cn("bg-black/80 flex justify-center items-center p-2 absolute top-0 right-0 bottom-0 left-0", open ? "web:animate-in web:fade-in-0" : "web:animate-out web:fade-out-0", className)
|
|
884
|
-
}, props, {
|
|
885
|
-
ref: ref
|
|
886
|
-
}));
|
|
887
|
-
});
|
|
888
|
-
DialogOverlayWeb.displayName = "DialogOverlayWeb";
|
|
889
|
-
var DialogOverlayNative = /*#__PURE__*/React__namespace.forwardRef(function (_ref2, ref) {
|
|
890
|
-
var className = _ref2.className,
|
|
891
|
-
children = _ref2.children,
|
|
892
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
893
|
-
return jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, _extends({
|
|
894
|
-
style: reactNative.StyleSheet.absoluteFill,
|
|
895
|
-
className: cn("flex bg-black/80 justify-center items-center p-2", className)
|
|
896
|
-
}, props, {
|
|
897
|
-
ref: ref,
|
|
898
|
-
children: jsxRuntime.jsx(Animated__default["default"].View, {
|
|
899
|
-
entering: Animated.FadeIn.duration(150),
|
|
900
|
-
exiting: Animated.FadeOut.duration(150),
|
|
901
|
-
children: jsxRuntime.jsx(reactNative.Pressable, {
|
|
902
|
-
children: children
|
|
903
|
-
})
|
|
904
|
-
})
|
|
905
|
-
}));
|
|
906
|
-
});
|
|
907
|
-
DialogOverlayNative.displayName = "DialogOverlayNative";
|
|
908
|
-
var DialogOverlay = reactNative.Platform.select({
|
|
909
|
-
web: DialogOverlayWeb,
|
|
910
|
-
"default": DialogOverlayNative
|
|
911
|
-
});
|
|
912
|
-
var DialogContent = /*#__PURE__*/React__namespace.forwardRef(function (_ref3, ref) {
|
|
913
|
-
var className = _ref3.className,
|
|
914
|
-
children = _ref3.children,
|
|
915
|
-
portalHost = _ref3.portalHost,
|
|
916
|
-
closeOnOutsidePress = _ref3.closeOnOutsidePress,
|
|
917
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
918
|
-
var _DialogPrimitive$useR2 = DialogPrimitive__namespace.useRootContext(),
|
|
919
|
-
open = _DialogPrimitive$useR2.open;
|
|
920
|
-
return jsxRuntime.jsx(DialogPortal, {
|
|
921
|
-
hostName: portalHost,
|
|
922
|
-
children: jsxRuntime.jsx(DialogOverlay, {
|
|
923
|
-
closeOnPress: closeOnOutsidePress,
|
|
924
|
-
children: jsxRuntime.jsx(DialogPrimitive__namespace.Content, _extends({
|
|
925
|
-
ref: ref,
|
|
926
|
-
className: cn("max-w-lg gap-4 border border-[#E7E7E8] web:cursor-default bg-white p-6 shadow-lg web:duration-200 rounded-lg", open ? "web:animate-in web:fade-in-0 web:zoom-in-95" : "web:animate-out web:fade-out-0 web:zoom-out-95", className)
|
|
927
|
-
}, props, {
|
|
928
|
-
children: children
|
|
929
|
-
}))
|
|
930
|
-
})
|
|
931
|
-
});
|
|
932
|
-
});
|
|
933
|
-
DialogContent.displayName = DialogPrimitive__namespace.Content.displayName;
|
|
934
|
-
var DialogTitle = /*#__PURE__*/React__namespace.forwardRef(function (_ref4, ref) {
|
|
935
|
-
var className = _ref4.className,
|
|
936
|
-
props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
937
|
-
return jsxRuntime.jsx(DialogPrimitive__namespace.Title, _extends({
|
|
938
|
-
ref: ref,
|
|
939
|
-
className: cn(className)
|
|
940
|
-
}, props));
|
|
941
|
-
});
|
|
942
|
-
DialogTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
943
|
-
function RNDialog(_ref5) {
|
|
944
|
-
var _effect = core.useComponentTracking();
|
|
945
|
-
try {
|
|
946
|
-
var title = _ref5.title,
|
|
947
|
-
trigger = _ref5.trigger,
|
|
948
|
-
content = _ref5.content,
|
|
949
|
-
footer = _ref5.footer,
|
|
950
|
-
open = _ref5.open,
|
|
951
|
-
_onOpenChange = _ref5.onOpenChange,
|
|
952
|
-
_ref5$closeOnOutsideP = _ref5.closeOnOutsidePress,
|
|
953
|
-
closeOnOutsidePress = _ref5$closeOnOutsideP === void 0 ? false : _ref5$closeOnOutsideP,
|
|
954
|
-
containerClass = _ref5.containerClass,
|
|
955
|
-
portalHost = _ref5.portalHost;
|
|
956
|
-
var dialogOpen = open != null ? open : core.useControl(false);
|
|
957
|
-
var _useWindowDimensions = reactNative.useWindowDimensions(),
|
|
958
|
-
width = _useWindowDimensions.width;
|
|
959
|
-
return jsxRuntime.jsxs(Dialog, {
|
|
960
|
-
open: dialogOpen.value,
|
|
961
|
-
onOpenChange: function onOpenChange(o) {
|
|
962
|
-
if (_onOpenChange) {
|
|
963
|
-
_onOpenChange(o);
|
|
964
|
-
} else {
|
|
965
|
-
dialogOpen.value = o;
|
|
966
|
-
}
|
|
967
|
-
},
|
|
968
|
-
children: [trigger && jsxRuntime.jsx(DialogTrigger, {
|
|
969
|
-
asChild: true,
|
|
970
|
-
children: trigger
|
|
971
|
-
}), jsxRuntime.jsxs(DialogContent, {
|
|
972
|
-
closeOnOutsidePress: closeOnOutsidePress,
|
|
973
|
-
className: cn("min-w-[200px] min-h-[200px]", containerClass),
|
|
974
|
-
style: {
|
|
975
|
-
maxWidth: width - 16
|
|
976
|
-
},
|
|
977
|
-
portalHost: reactNative.Platform.select({
|
|
978
|
-
ios: portalHost
|
|
979
|
-
}),
|
|
980
|
-
children: [jsxRuntime.jsxs(reactNative.View, {
|
|
981
|
-
className: "flex flex-row gap-[10px] justify-between items-start",
|
|
982
|
-
children: [jsxRuntime.jsx(DialogTitle, {
|
|
983
|
-
asChild: true,
|
|
984
|
-
className: "flex-1 flex-shrink title2",
|
|
985
|
-
children: title
|
|
986
|
-
}), jsxRuntime.jsx(DialogClose, {
|
|
987
|
-
className: "web:group rounded-sm web:ring-offset-background web:transition-opacity web:hover:opacity-100 web:focus:outline-none web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2 web:disabled:pointer-events-none",
|
|
988
|
-
children: jsxRuntime.jsx(vectorIcons.FontAwesome6, {
|
|
989
|
-
name: "xmark-circle",
|
|
990
|
-
size: 24,
|
|
991
|
-
color: "#267151"
|
|
992
|
-
})
|
|
993
|
-
})]
|
|
994
|
-
}), content, footer]
|
|
995
|
-
})]
|
|
996
|
-
});
|
|
997
|
-
} finally {
|
|
998
|
-
_effect();
|
|
2906
|
+
if (typeof node === "string" || typeof node === "number") {
|
|
2907
|
+
return false;
|
|
2908
|
+
}
|
|
2909
|
+
if (Array.isArray(node)) {
|
|
2910
|
+
return node.every(isNodeEmpty);
|
|
2911
|
+
}
|
|
2912
|
+
if (/*#__PURE__*/React__default["default"].isValidElement(node)) {
|
|
2913
|
+
var _element$props$childr, _element$props;
|
|
2914
|
+
var element = node;
|
|
2915
|
+
return isNodeEmpty((_element$props$childr = (_element$props = element.props) == null ? void 0 : _element$props.children) != null ? _element$props$childr : undefined);
|
|
999
2916
|
}
|
|
2917
|
+
return false;
|
|
1000
2918
|
}
|
|
1001
2919
|
|
|
2920
|
+
exports.DefaultBoolOptions = DefaultBoolOptions;
|
|
2921
|
+
exports.Dialog = Dialog;
|
|
2922
|
+
exports.DialogClose = DialogClose;
|
|
2923
|
+
exports.DialogContent = DialogContent;
|
|
2924
|
+
exports.DialogPortal = DialogPortal;
|
|
2925
|
+
exports.DialogTitle = DialogTitle;
|
|
2926
|
+
exports.DialogTrigger = DialogTrigger;
|
|
1002
2927
|
exports.Icon = Icon;
|
|
1003
|
-
exports.RNButton = RNButton;
|
|
2928
|
+
exports.RNButton = RNButton$1;
|
|
1004
2929
|
exports.RNCheckbox = RNCheckbox;
|
|
1005
2930
|
exports.RNDialog = RNDialog;
|
|
1006
2931
|
exports.RNHtmlRenderer = RNHtmlRenderer;
|
|
1007
2932
|
exports.RNRadioItem = RNRadioItem;
|
|
2933
|
+
exports.RNSelectRenderer = RNSelectRenderer;
|
|
1008
2934
|
exports.RNText = RNText;
|
|
1009
2935
|
exports.RNTextInput = RNTextInput;
|
|
2936
|
+
exports.ReactNativeHtmlComponents = ReactNativeHtmlComponents;
|
|
1010
2937
|
exports.TextClassContext = TextClassContext;
|
|
1011
2938
|
exports.buttonTextVariants = buttonTextVariants;
|
|
1012
2939
|
exports.buttonVariants = buttonVariants;
|
|
2940
|
+
exports.createButtonActionRenderer = createButtonActionRenderer;
|
|
2941
|
+
exports.createDefaultAdornmentRenderer = createDefaultAdornmentRenderer;
|
|
2942
|
+
exports.createDefaultDataRenderer = createDefaultDataRenderer;
|
|
2943
|
+
exports.createDefaultLabelRenderer = createDefaultLabelRenderer;
|
|
2944
|
+
exports.createDefaultRenderers = createDefaultRenderers;
|
|
2945
|
+
exports.createRNCheckboxRenderer = createRNCheckboxRenderer;
|
|
1013
2946
|
exports.createRNDateTimePickerRenderer = createRNDateTimePickerRenderer;
|
|
2947
|
+
exports.createRNScrollListRenderer = createRNScrollListRenderer;
|
|
1014
2948
|
exports.createRNSelectRenderer = createRNSelectRenderer;
|
|
2949
|
+
exports.createRNTextInputRenderer = createRNTextInputRenderer;
|
|
2950
|
+
exports.createSelectConversion = createSelectConversion;
|
|
1015
2951
|
exports.defaultRnTailwindTheme = defaultRnTailwindTheme;
|
|
1016
|
-
exports.
|
|
2952
|
+
exports.defaultTailwindTheme = defaultTailwindTheme;
|
|
1017
2953
|
//# sourceMappingURL=index.cjs.map
|