@react-typed-forms/schemas-html 3.0.0 → 4.0.0
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 +6 -8
- package/lib/components/ControlInput.d.ts +9 -2
- package/lib/components/DefaultAccordion.d.ts +1 -1
- package/lib/components/DefaultArrayRenderer.d.ts +5 -1
- package/lib/components/DefaultDialogRenderer.d.ts +20 -0
- package/lib/components/DefaultDisplay.d.ts +4 -1
- package/lib/components/DefaultDisplayOnly.d.ts +5 -5
- package/lib/components/DefaultGroupRenderer.d.ts +8 -10
- package/lib/components/DefaultLayout.d.ts +2 -3
- package/lib/components/DefaultVisibility.d.ts +3 -2
- package/lib/components/DefaultWizardRenderer.d.ts +28 -0
- package/lib/components/GridRenderer.d.ts +6 -0
- package/lib/components/JsonataRenderer.d.ts +3 -2
- package/lib/components/TabsRenderer.d.ts +0 -5
- package/lib/components/ValueForFieldRenderer.d.ts +2 -0
- package/lib/components/VisibleChildrenRenderer.d.ts +14 -0
- package/lib/createButtonActionRenderer.d.ts +21 -0
- package/lib/createDefaultRenderers.d.ts +26 -11
- package/lib/index.cjs +1314 -612
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1238 -543
- package/lib/index.js.map +1 -1
- package/lib/tailwind.d.ts +20 -6
- package/package.json +9 -8
package/lib/index.cjs
CHANGED
|
@@ -1,49 +1,27 @@
|
|
|
1
|
-
var React = require('react');
|
|
2
1
|
var clsx = require('clsx');
|
|
3
2
|
var schemas = require('@react-typed-forms/schemas');
|
|
4
|
-
var core = require('@react-typed-forms/core');
|
|
5
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var
|
|
4
|
+
var core = require('@react-typed-forms/core');
|
|
5
|
+
var react = require('react');
|
|
7
6
|
var ariaBase = require('@astroapps/aria-base');
|
|
7
|
+
var base = require('@mui/base');
|
|
8
8
|
var overlays = require('@react-stately/overlays');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
11
|
|
|
12
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
12
|
var clsx__default = /*#__PURE__*/_interopDefaultLegacy(clsx);
|
|
14
13
|
|
|
15
|
-
function _extends() {
|
|
16
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
17
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
18
|
-
var t = arguments[e];
|
|
19
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
20
|
-
}
|
|
21
|
-
return n;
|
|
22
|
-
}, _extends.apply(null, arguments);
|
|
23
|
-
}
|
|
24
|
-
function _objectDestructuringEmpty(t) {
|
|
25
|
-
if (null == t) throw new TypeError("Cannot destructure " + t);
|
|
26
|
-
}
|
|
27
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
28
|
-
if (null == r) return {};
|
|
29
|
-
var t = {};
|
|
30
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
31
|
-
if (e.includes(n)) continue;
|
|
32
|
-
t[n] = r[n];
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
var _excluded$4 = ["data", "display", "className", "style", "renderer"];
|
|
38
14
|
function createDefaultDisplayRenderer(options) {
|
|
39
15
|
if (options === void 0) {
|
|
40
16
|
options = {};
|
|
41
17
|
}
|
|
42
18
|
return {
|
|
43
19
|
render: function render(props, renderer) {
|
|
44
|
-
return
|
|
20
|
+
return /*#__PURE__*/jsxRuntime.jsx(DefaultDisplay, {
|
|
21
|
+
options: options,
|
|
22
|
+
displayProps: props,
|
|
45
23
|
renderer: renderer
|
|
46
|
-
})
|
|
24
|
+
});
|
|
47
25
|
},
|
|
48
26
|
type: "display"
|
|
49
27
|
};
|
|
@@ -51,44 +29,86 @@ function createDefaultDisplayRenderer(options) {
|
|
|
51
29
|
function DefaultDisplay(_ref) {
|
|
52
30
|
var _effect = core.useComponentTracking();
|
|
53
31
|
try {
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
32
|
+
var _iconDisplay$icon, _iconDisplay$icon2;
|
|
33
|
+
var renderer = _ref.renderer,
|
|
34
|
+
options = _ref.options,
|
|
35
|
+
displayProps = _ref.displayProps;
|
|
36
|
+
var data = displayProps.data,
|
|
37
|
+
display = displayProps.display,
|
|
38
|
+
className = displayProps.className,
|
|
39
|
+
textClass = displayProps.textClass,
|
|
40
|
+
style = displayProps.style;
|
|
41
|
+
var _renderer$html = renderer.html,
|
|
42
|
+
I = _renderer$html.I,
|
|
43
|
+
Div = _renderer$html.Div,
|
|
44
|
+
B = _renderer$html.B,
|
|
45
|
+
H1 = _renderer$html.H1,
|
|
46
|
+
Span = _renderer$html.Span;
|
|
61
47
|
switch (data.type) {
|
|
62
48
|
case schemas.DisplayDataType.Icon:
|
|
63
|
-
|
|
49
|
+
var iconDisplay = data;
|
|
50
|
+
return /*#__PURE__*/jsxRuntime.jsx(I, {
|
|
64
51
|
style: style,
|
|
65
|
-
className: clsx__default["default"](schemas.getOverrideClass(className), display ? display.value :
|
|
52
|
+
className: clsx__default["default"](schemas.getOverrideClass(className), display ? display.value : iconDisplay.iconClass),
|
|
53
|
+
iconName: display ? display.value : (_iconDisplay$icon = iconDisplay.icon) == null ? void 0 : _iconDisplay$icon.name,
|
|
54
|
+
iconLibrary: (_iconDisplay$icon2 = iconDisplay.icon) == null ? void 0 : _iconDisplay$icon2.library
|
|
66
55
|
});
|
|
67
56
|
case schemas.DisplayDataType.Text:
|
|
68
|
-
|
|
57
|
+
var text = display ? schemas.coerceToString(display.value) : data.text;
|
|
58
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
69
59
|
style: style,
|
|
70
|
-
className: schemas.rendererClass(className, options.textClassName)
|
|
71
|
-
|
|
60
|
+
className: schemas.rendererClass(className, options.textClassName),
|
|
61
|
+
textClass: schemas.rendererClass(textClass, options.textTextClass),
|
|
62
|
+
text: text,
|
|
63
|
+
inline: displayProps.inline
|
|
64
|
+
});
|
|
72
65
|
case schemas.DisplayDataType.Html:
|
|
73
|
-
return
|
|
66
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
74
67
|
style: style,
|
|
75
68
|
className: schemas.rendererClass(className, options.htmlClassName),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
69
|
+
inline: displayProps.inline,
|
|
70
|
+
html: display ? schemas.coerceToString(display.value) : data.html
|
|
79
71
|
});
|
|
80
72
|
case schemas.DisplayDataType.Custom:
|
|
81
|
-
return
|
|
73
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
74
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(B, {
|
|
75
|
+
children: ["(", data.customId, ")"]
|
|
76
|
+
})
|
|
77
|
+
});
|
|
82
78
|
default:
|
|
83
|
-
return
|
|
79
|
+
return /*#__PURE__*/jsxRuntime.jsxs(H1, {
|
|
80
|
+
children: ["Unknown display type: ", data.type]
|
|
81
|
+
});
|
|
84
82
|
}
|
|
85
83
|
} finally {
|
|
86
84
|
_effect();
|
|
87
85
|
}
|
|
88
86
|
}
|
|
89
87
|
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
function _extends() {
|
|
89
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
90
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
91
|
+
var t = arguments[e];
|
|
92
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
93
|
+
}
|
|
94
|
+
return n;
|
|
95
|
+
}, _extends.apply(null, arguments);
|
|
96
|
+
}
|
|
97
|
+
function _objectDestructuringEmpty(t) {
|
|
98
|
+
if (null == t) throw new TypeError("Cannot destructure " + t);
|
|
99
|
+
}
|
|
100
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
101
|
+
if (null == r) return {};
|
|
102
|
+
var t = {};
|
|
103
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
104
|
+
if (e.includes(n)) continue;
|
|
105
|
+
t[n] = r[n];
|
|
106
|
+
}
|
|
107
|
+
return t;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
var _excluded$4 = ["control", "convert", "renderer"],
|
|
111
|
+
_excluded2$2 = ["errorText", "value", "onChange", "ref"];
|
|
92
112
|
function ControlInput(_ref) {
|
|
93
113
|
var _effect = core.useComponentTracking();
|
|
94
114
|
try {
|
|
@@ -98,12 +118,13 @@ function ControlInput(_ref) {
|
|
|
98
118
|
var control = _ref.control,
|
|
99
119
|
convert = _ref.convert,
|
|
100
120
|
renderer = _ref.renderer,
|
|
101
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
121
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
102
122
|
var _formControlProps = core.formControlProps(control),
|
|
103
123
|
errorText = _formControlProps.errorText,
|
|
104
124
|
value = _formControlProps.value,
|
|
105
125
|
onChange = _formControlProps.onChange,
|
|
106
|
-
|
|
126
|
+
ref = _formControlProps.ref,
|
|
127
|
+
inputProps = _objectWithoutPropertiesLoose(_formControlProps, _excluded2$2);
|
|
107
128
|
var textValue = core.useControl(function () {
|
|
108
129
|
return toText(value);
|
|
109
130
|
});
|
|
@@ -112,14 +133,14 @@ function ControlInput(_ref) {
|
|
|
112
133
|
}, function (v) {
|
|
113
134
|
return textValue.value = toText(v);
|
|
114
135
|
});
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
136
|
+
var Input = renderer.html.Input;
|
|
137
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input, _extends({}, inputProps, {
|
|
138
|
+
inputRef: ref,
|
|
118
139
|
type: convert[0],
|
|
119
140
|
value: textValue.value,
|
|
120
|
-
|
|
121
|
-
textValue.value = e
|
|
122
|
-
var converted = convert[1](e
|
|
141
|
+
onChangeValue: function onChangeValue(e) {
|
|
142
|
+
textValue.value = e;
|
|
143
|
+
var converted = convert[1](e);
|
|
123
144
|
if (converted !== undefined) control.value = converted;
|
|
124
145
|
}
|
|
125
146
|
}, props));
|
|
@@ -184,14 +205,14 @@ function createInputConversion(ft) {
|
|
|
184
205
|
}
|
|
185
206
|
}
|
|
186
207
|
|
|
187
|
-
var _excluded$
|
|
208
|
+
var _excluded$3 = ["state", "options", "className", "convert", "required", "emptyText", "requiredText", "readonly"];
|
|
188
209
|
function createSelectRenderer(options) {
|
|
189
210
|
if (options === void 0) {
|
|
190
211
|
options = {};
|
|
191
212
|
}
|
|
192
213
|
return schemas.createDataRenderer(function (props, asArray) {
|
|
193
214
|
var _props$options;
|
|
194
|
-
return
|
|
215
|
+
return /*#__PURE__*/jsxRuntime.jsx(SelectDataRenderer, {
|
|
195
216
|
className: schemas.rendererClass(props.className, options.className),
|
|
196
217
|
state: props.control,
|
|
197
218
|
id: props.id,
|
|
@@ -210,11 +231,11 @@ function SelectDataRenderer(_ref) {
|
|
|
210
231
|
var _effect = core.useComponentTracking();
|
|
211
232
|
try {
|
|
212
233
|
var renderOption = function renderOption(x, i) {
|
|
213
|
-
return
|
|
214
|
-
key: i,
|
|
234
|
+
return /*#__PURE__*/jsxRuntime.jsx("option", {
|
|
215
235
|
value: convert(x.value),
|
|
216
|
-
disabled: !!x.disabled
|
|
217
|
-
|
|
236
|
+
disabled: !!x.disabled,
|
|
237
|
+
children: x.name
|
|
238
|
+
}, i);
|
|
218
239
|
};
|
|
219
240
|
var state = _ref.state,
|
|
220
241
|
options = _ref.options,
|
|
@@ -226,42 +247,44 @@ function SelectDataRenderer(_ref) {
|
|
|
226
247
|
_ref$requiredText = _ref.requiredText,
|
|
227
248
|
requiredText = _ref$requiredText === void 0 ? "<please select>" : _ref$requiredText,
|
|
228
249
|
readonly = _ref.readonly,
|
|
229
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
250
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
230
251
|
var value = state.value,
|
|
231
252
|
disabled = state.disabled;
|
|
232
|
-
var _useState =
|
|
253
|
+
var _useState = react.useState(!required || value == null),
|
|
233
254
|
showEmpty = _useState[0];
|
|
234
|
-
var optionStringMap =
|
|
255
|
+
var optionStringMap = react.useMemo(function () {
|
|
235
256
|
return Object.fromEntries(options.map(function (x) {
|
|
236
257
|
return [convert(x.value), x.value];
|
|
237
258
|
}));
|
|
238
259
|
}, [options]);
|
|
239
|
-
var optionGroups =
|
|
260
|
+
var optionGroups = react.useMemo(function () {
|
|
240
261
|
return new Set(options.filter(function (x) {
|
|
241
262
|
return x.group;
|
|
242
263
|
}).map(function (x) {
|
|
243
264
|
return x.group;
|
|
244
265
|
}));
|
|
245
266
|
}, [options]);
|
|
246
|
-
return
|
|
267
|
+
return /*#__PURE__*/jsxRuntime.jsxs("select", _extends({}, props, {
|
|
247
268
|
className: className,
|
|
248
269
|
onChange: function onChange(v) {
|
|
249
270
|
return state.value = optionStringMap[v.target.value];
|
|
250
271
|
},
|
|
251
272
|
value: convert(value),
|
|
252
|
-
disabled: disabled || readonly
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
273
|
+
disabled: disabled || readonly,
|
|
274
|
+
children: [showEmpty && /*#__PURE__*/jsxRuntime.jsx("option", {
|
|
275
|
+
value: "",
|
|
276
|
+
children: required ? requiredText : emptyText
|
|
277
|
+
}), [].concat(optionGroups.keys()).map(function (x) {
|
|
278
|
+
return /*#__PURE__*/jsxRuntime.jsx("optgroup", {
|
|
279
|
+
label: x,
|
|
280
|
+
children: options.filter(function (o) {
|
|
281
|
+
return o.group === x;
|
|
282
|
+
}).map(renderOption)
|
|
283
|
+
}, x);
|
|
284
|
+
}), options.filter(function (x) {
|
|
285
|
+
return !x.group;
|
|
286
|
+
}).map(renderOption)]
|
|
287
|
+
}));
|
|
265
288
|
} finally {
|
|
266
289
|
_effect();
|
|
267
290
|
}
|
|
@@ -282,14 +305,14 @@ function createSelectConversion(ft) {
|
|
|
282
305
|
}
|
|
283
306
|
}
|
|
284
307
|
|
|
285
|
-
var _excluded$
|
|
286
|
-
_excluded2 = ["value", "onChange", "errorText"];
|
|
308
|
+
var _excluded$2 = ["control", "type", "notValue", "renderer"],
|
|
309
|
+
_excluded2$1 = ["value", "onChange", "errorText", "ref"];
|
|
287
310
|
function createRadioRenderer(options) {
|
|
288
311
|
if (options === void 0) {
|
|
289
312
|
options = {};
|
|
290
313
|
}
|
|
291
314
|
return schemas.createDataRenderer(function (p, renderer) {
|
|
292
|
-
return
|
|
315
|
+
return /*#__PURE__*/jsxRuntime.jsx(CheckButtons, _extends({
|
|
293
316
|
classes: options,
|
|
294
317
|
controlClasses: p.renderOptions
|
|
295
318
|
}, p, {
|
|
@@ -298,7 +321,8 @@ function createRadioRenderer(options) {
|
|
|
298
321
|
return control.value == o.value;
|
|
299
322
|
},
|
|
300
323
|
setChecked: function setChecked(c, o) {
|
|
301
|
-
|
|
324
|
+
c.setTouched(true);
|
|
325
|
+
c.value = o.value;
|
|
302
326
|
},
|
|
303
327
|
control: p.control,
|
|
304
328
|
type: "radio",
|
|
@@ -314,7 +338,7 @@ function createCheckListRenderer(options) {
|
|
|
314
338
|
options = {};
|
|
315
339
|
}
|
|
316
340
|
return schemas.createDataRenderer(function (p, renderer) {
|
|
317
|
-
return
|
|
341
|
+
return /*#__PURE__*/jsxRuntime.jsx(CheckButtons, _extends({
|
|
318
342
|
classes: options,
|
|
319
343
|
controlClasses: p.renderOptions
|
|
320
344
|
}, p, {
|
|
@@ -324,6 +348,7 @@ function createCheckListRenderer(options) {
|
|
|
324
348
|
return Array.isArray(v) ? v.includes(o.value) : false;
|
|
325
349
|
},
|
|
326
350
|
setChecked: function setChecked(c, o, checked) {
|
|
351
|
+
c.setTouched(true);
|
|
327
352
|
c.setValue(function (x) {
|
|
328
353
|
return setIncluded(x != null ? x : [], o.value, checked);
|
|
329
354
|
});
|
|
@@ -354,44 +379,53 @@ function CheckButtons(_ref) {
|
|
|
354
379
|
_ref$controlClasses = _ref.controlClasses,
|
|
355
380
|
controlClasses = _ref$controlClasses === void 0 ? {} : _ref$controlClasses,
|
|
356
381
|
renderer = _ref.renderer;
|
|
357
|
-
var
|
|
382
|
+
var _renderer$html = renderer.html,
|
|
383
|
+
Button = _renderer$html.Button,
|
|
384
|
+
Input = _renderer$html.Input,
|
|
385
|
+
Label = _renderer$html.Label,
|
|
386
|
+
Div = _renderer$html.Div;
|
|
358
387
|
var disabled = control.disabled;
|
|
359
388
|
var name = "r" + control.uniqueId;
|
|
360
|
-
return
|
|
389
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
361
390
|
className: className,
|
|
362
|
-
id: id
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
391
|
+
id: id,
|
|
392
|
+
children: /*#__PURE__*/jsxRuntime.jsx(core.RenderArrayElements, {
|
|
393
|
+
array: options == null ? void 0 : options.filter(function (x) {
|
|
394
|
+
return x.value != null;
|
|
395
|
+
}),
|
|
396
|
+
children: function children(o, i) {
|
|
397
|
+
var checked = core.useComputed(function () {
|
|
398
|
+
return isChecked(control, o);
|
|
399
|
+
}).value;
|
|
400
|
+
var selOrUnsel = checked ? schemas.rendererClass(controlClasses == null ? void 0 : controlClasses.selectedClass, classes.selectedClass) : schemas.rendererClass(controlClasses == null ? void 0 : controlClasses.notSelectedClass, classes.notSelectedClass);
|
|
401
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Button, {
|
|
402
|
+
className: clsx__default["default"](schemas.rendererClass(controlClasses == null ? void 0 : controlClasses.entryWrapperClass, classes.entryWrapperClass), selOrUnsel),
|
|
403
|
+
onClick: function onClick() {
|
|
404
|
+
return !readonly && setChecked(control, o, !checked);
|
|
405
|
+
},
|
|
406
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(Div, {
|
|
407
|
+
className: classes.entryClass,
|
|
408
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
409
|
+
id: name + "_" + i,
|
|
410
|
+
className: classes.checkClass,
|
|
411
|
+
type: type,
|
|
412
|
+
name: name,
|
|
413
|
+
readOnly: readonly,
|
|
414
|
+
disabled: disabled,
|
|
415
|
+
checked: checked,
|
|
416
|
+
onChangeChecked: function onChangeChecked(x) {
|
|
417
|
+
!readonly && setChecked(control, o, x);
|
|
418
|
+
}
|
|
419
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
420
|
+
className: classes.labelClass,
|
|
421
|
+
htmlFor: name + "_" + i,
|
|
422
|
+
children: o.name
|
|
423
|
+
})]
|
|
424
|
+
}), entryAdornment == null ? void 0 : entryAdornment(o, i, checked)]
|
|
425
|
+
});
|
|
389
426
|
}
|
|
390
|
-
})
|
|
391
|
-
|
|
392
|
-
htmlFor: name + "_" + i
|
|
393
|
-
}, o.name)), entryAdornment == null ? void 0 : entryAdornment(o, i, checked));
|
|
394
|
-
}));
|
|
427
|
+
})
|
|
428
|
+
});
|
|
395
429
|
} finally {
|
|
396
430
|
_effect();
|
|
397
431
|
}
|
|
@@ -416,7 +450,7 @@ function createCheckboxRenderer(options) {
|
|
|
416
450
|
return function (p) {
|
|
417
451
|
return _extends({}, p, {
|
|
418
452
|
label: undefined,
|
|
419
|
-
children:
|
|
453
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CheckBox, {
|
|
420
454
|
p: p,
|
|
421
455
|
renderer: renderer,
|
|
422
456
|
options: options,
|
|
@@ -428,61 +462,121 @@ function createCheckboxRenderer(options) {
|
|
|
428
462
|
renderType: schemas.DataRenderType.Checkbox
|
|
429
463
|
});
|
|
430
464
|
}
|
|
431
|
-
function
|
|
465
|
+
function createElementSelectedRenderer(options) {
|
|
466
|
+
if (options === void 0) {
|
|
467
|
+
options = {};
|
|
468
|
+
}
|
|
469
|
+
return schemas.createDataRenderer(function (props, renderer) {
|
|
470
|
+
return function (p) {
|
|
471
|
+
return _extends({}, p, {
|
|
472
|
+
label: undefined,
|
|
473
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CheckBoxSelected, {
|
|
474
|
+
p: p,
|
|
475
|
+
renderer: renderer,
|
|
476
|
+
options: options,
|
|
477
|
+
props: props
|
|
478
|
+
})
|
|
479
|
+
});
|
|
480
|
+
};
|
|
481
|
+
}, {
|
|
482
|
+
renderType: schemas.DataRenderType.ElementSelected
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
function CheckBoxSelected(_ref2) {
|
|
432
486
|
var _effect2 = core.useComponentTracking();
|
|
433
487
|
try {
|
|
434
488
|
var p = _ref2.p,
|
|
435
489
|
props = _ref2.props,
|
|
436
490
|
renderer = _ref2.renderer,
|
|
437
491
|
options = _ref2.options;
|
|
438
|
-
var
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
492
|
+
var Div = renderer.html.Div;
|
|
493
|
+
var elementValue = core.useControl();
|
|
494
|
+
react.useEffect(function () {
|
|
495
|
+
props.runExpression(elementValue, props.renderOptions.elementExpression, function (v) {
|
|
496
|
+
return elementValue.value = v;
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
var isSelected = core.useComputed(function () {
|
|
500
|
+
var _props$control$as$val, _props$control$as$val2;
|
|
501
|
+
return (_props$control$as$val = (_props$control$as$val2 = props.control.as().value) == null ? void 0 : _props$control$as$val2.includes(elementValue.current.value)) != null ? _props$control$as$val : false;
|
|
502
|
+
});
|
|
503
|
+
var selControl = core.useControl(function () {
|
|
504
|
+
return isSelected.current.value;
|
|
505
|
+
});
|
|
506
|
+
selControl.value = isSelected.value;
|
|
507
|
+
core.useControlEffect(function () {
|
|
508
|
+
return selControl.value;
|
|
509
|
+
}, function (v) {
|
|
510
|
+
props.control.as().setValue(function (x) {
|
|
511
|
+
return setIncluded(x != null ? x : [], elementValue.value, v);
|
|
512
|
+
});
|
|
513
|
+
});
|
|
514
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Div, {
|
|
515
|
+
className: schemas.rendererClass(props.className, options.entryClass),
|
|
516
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Fcheckbox, {
|
|
517
|
+
id: props.id,
|
|
518
|
+
control: selControl,
|
|
519
|
+
style: props.style,
|
|
520
|
+
className: options.checkClass,
|
|
521
|
+
renderer: renderer
|
|
522
|
+
}), p.label && renderer.renderLabel(p.label, undefined, undefined)]
|
|
523
|
+
});
|
|
448
524
|
} finally {
|
|
449
525
|
_effect2();
|
|
450
526
|
}
|
|
451
527
|
}
|
|
452
|
-
function
|
|
528
|
+
function CheckBox(_ref3) {
|
|
453
529
|
var _effect3 = core.useComponentTracking();
|
|
454
530
|
try {
|
|
455
|
-
var
|
|
456
|
-
|
|
457
|
-
type = _ref3$type === void 0 ? "checkbox" : _ref3$type,
|
|
458
|
-
_ref3$notValue = _ref3.notValue,
|
|
459
|
-
notValue = _ref3$notValue === void 0 ? false : _ref3$notValue,
|
|
531
|
+
var p = _ref3.p,
|
|
532
|
+
props = _ref3.props,
|
|
460
533
|
renderer = _ref3.renderer,
|
|
461
|
-
|
|
462
|
-
var
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
534
|
+
options = _ref3.options;
|
|
535
|
+
var Div = renderer.html.Div;
|
|
536
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Div, {
|
|
537
|
+
className: schemas.rendererClass(props.className, options.entryClass),
|
|
538
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Fcheckbox, {
|
|
539
|
+
id: props.id,
|
|
540
|
+
control: props.control.as(),
|
|
541
|
+
style: props.style,
|
|
542
|
+
className: options.checkClass,
|
|
543
|
+
renderer: renderer
|
|
544
|
+
}), p.label && renderer.renderLabel(p.label, undefined, undefined)]
|
|
545
|
+
});
|
|
546
|
+
} finally {
|
|
547
|
+
_effect3();
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
function Fcheckbox(_ref4) {
|
|
551
|
+
var _effect4 = core.useComponentTracking();
|
|
552
|
+
try {
|
|
553
|
+
var control = _ref4.control,
|
|
554
|
+
_ref4$type = _ref4.type,
|
|
555
|
+
type = _ref4$type === void 0 ? "checkbox" : _ref4$type,
|
|
556
|
+
_ref4$notValue = _ref4.notValue,
|
|
557
|
+
notValue = _ref4$notValue === void 0 ? false : _ref4$notValue,
|
|
558
|
+
renderer = _ref4.renderer,
|
|
559
|
+
others = _objectWithoutPropertiesLoose(_ref4, _excluded$2);
|
|
560
|
+
var Input = renderer.html.Input;
|
|
468
561
|
var _formControlProps = core.formControlProps(control),
|
|
469
562
|
value = _formControlProps.value,
|
|
470
563
|
onChange = _formControlProps.onChange,
|
|
471
564
|
errorText = _formControlProps.errorText,
|
|
472
|
-
|
|
473
|
-
|
|
565
|
+
ref = _formControlProps.ref,
|
|
566
|
+
theseProps = _objectWithoutPropertiesLoose(_formControlProps, _excluded2$1);
|
|
567
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input, _extends({}, theseProps, {
|
|
474
568
|
checked: !!value !== notValue,
|
|
475
|
-
|
|
476
|
-
control.element = r;
|
|
477
|
-
// if (r) r.setCustomValidity(control.current.error ?? "");
|
|
569
|
+
inputRef: function inputRef(r) {
|
|
570
|
+
return control.element = r;
|
|
478
571
|
},
|
|
479
|
-
|
|
480
|
-
|
|
572
|
+
onChangeChecked: function onChangeChecked(e) {
|
|
573
|
+
control.touched = true;
|
|
574
|
+
control.value = e !== notValue;
|
|
481
575
|
},
|
|
482
576
|
type: type
|
|
483
577
|
}, others));
|
|
484
578
|
} finally {
|
|
485
|
-
|
|
579
|
+
_effect4();
|
|
486
580
|
}
|
|
487
581
|
}
|
|
488
582
|
|
|
@@ -493,11 +587,12 @@ function createDefaultLayoutRenderer(options) {
|
|
|
493
587
|
return schemas.createLayoutRenderer(function (props, renderers) {
|
|
494
588
|
var layout = schemas.renderLayoutParts(props, renderers);
|
|
495
589
|
return {
|
|
496
|
-
children: layout.wrapLayout(
|
|
590
|
+
children: layout.wrapLayout(/*#__PURE__*/jsxRuntime.jsx(DefaultLayout, _extends({
|
|
497
591
|
layout: layout
|
|
498
592
|
}, options, {
|
|
499
593
|
renderer: renderers
|
|
500
594
|
}))),
|
|
595
|
+
inline: layout.inline,
|
|
501
596
|
className: schemas.rendererClass(layout.className, options.className),
|
|
502
597
|
style: layout.style,
|
|
503
598
|
divRef: function divRef(e) {
|
|
@@ -510,14 +605,17 @@ function DefaultLayout(_ref) {
|
|
|
510
605
|
var _effect = core.useComponentTracking();
|
|
511
606
|
try {
|
|
512
607
|
var errorClass = _ref.errorClass,
|
|
513
|
-
_ref$renderer = _ref.renderer,
|
|
514
|
-
|
|
515
|
-
|
|
608
|
+
_ref$renderer$html = _ref.renderer.html,
|
|
609
|
+
Div = _ref$renderer$html.Div,
|
|
610
|
+
Span = _ref$renderer$html.Span,
|
|
516
611
|
_ref$renderError = _ref.renderError,
|
|
517
612
|
renderError = _ref$renderError === void 0 ? function (e) {
|
|
518
|
-
return e &&
|
|
519
|
-
|
|
520
|
-
|
|
613
|
+
return e && /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
614
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Span, {
|
|
615
|
+
className: errorClass,
|
|
616
|
+
children: e
|
|
617
|
+
})
|
|
618
|
+
});
|
|
521
619
|
} : _ref$renderError,
|
|
522
620
|
_ref$layout = _ref.layout,
|
|
523
621
|
controlEnd = _ref$layout.controlEnd,
|
|
@@ -527,7 +625,9 @@ function DefaultLayout(_ref) {
|
|
|
527
625
|
errorControl = _ref$layout.errorControl;
|
|
528
626
|
var ec = errorControl;
|
|
529
627
|
var errorText = ec && ec.touched ? ec.error : undefined;
|
|
530
|
-
return
|
|
628
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
629
|
+
children: [label, controlStart, children, renderError(errorText), controlEnd]
|
|
630
|
+
});
|
|
531
631
|
} finally {
|
|
532
632
|
_effect();
|
|
533
633
|
}
|
|
@@ -537,21 +637,23 @@ function DefaultDisplayOnly(_ref) {
|
|
|
537
637
|
var _effect = core.useComponentTracking();
|
|
538
638
|
try {
|
|
539
639
|
var _ref2;
|
|
540
|
-
var
|
|
640
|
+
var dataNode = _ref.dataNode,
|
|
541
641
|
className = _ref.className,
|
|
542
642
|
emptyText = _ref.emptyText,
|
|
543
643
|
schemaInterface = _ref.schemaInterface,
|
|
544
|
-
field = _ref.field,
|
|
545
644
|
style = _ref.style,
|
|
546
|
-
renderer = _ref.renderer
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
var
|
|
551
|
-
return
|
|
645
|
+
renderer = _ref.renderer,
|
|
646
|
+
textClass = _ref.textClass,
|
|
647
|
+
inline = _ref.inline;
|
|
648
|
+
var text = (_ref2 = schemaInterface.isEmptyValue(dataNode.schema.field, dataNode.control.value) ? emptyText : schemaInterface.textValueForData(dataNode)) != null ? _ref2 : "";
|
|
649
|
+
var Div = renderer.html.Div;
|
|
650
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
552
651
|
style: style,
|
|
553
|
-
className: className
|
|
554
|
-
|
|
652
|
+
className: className,
|
|
653
|
+
textClass: textClass,
|
|
654
|
+
text: text,
|
|
655
|
+
inline: inline
|
|
656
|
+
});
|
|
555
657
|
} finally {
|
|
556
658
|
_effect();
|
|
557
659
|
}
|
|
@@ -566,8 +668,8 @@ function DefaultAccordion(_ref) {
|
|
|
566
668
|
contentStyle = _ref.contentStyle,
|
|
567
669
|
contentClassName = _ref.contentClassName,
|
|
568
670
|
designMode = _ref.designMode,
|
|
569
|
-
|
|
570
|
-
|
|
671
|
+
iconOpen = _ref.iconOpen,
|
|
672
|
+
iconClosed = _ref.iconClosed,
|
|
571
673
|
className = _ref.className,
|
|
572
674
|
_ref$renderTitle = _ref.renderTitle,
|
|
573
675
|
renderTitle = _ref$renderTitle === void 0 ? function (t) {
|
|
@@ -578,6 +680,11 @@ function DefaultAccordion(_ref) {
|
|
|
578
680
|
titleClass = _ref.titleClass,
|
|
579
681
|
useCss = _ref.useCss,
|
|
580
682
|
dataContext = _ref.dataContext;
|
|
683
|
+
var _renderers$html = renderers.html,
|
|
684
|
+
Button = _renderers$html.Button,
|
|
685
|
+
I = _renderers$html.I,
|
|
686
|
+
Div = _renderers$html.Div,
|
|
687
|
+
Label = _renderers$html.Label;
|
|
581
688
|
var dataControl = ((_dataContext$dataNode = dataContext.dataNode) != null ? _dataContext$dataNode : dataContext.parentNode).control;
|
|
582
689
|
var open = core.useControl(!!accordion.defaultExpanded);
|
|
583
690
|
if (dataControl && !dataControl.meta.accordionState) {
|
|
@@ -588,22 +695,29 @@ function DefaultAccordion(_ref) {
|
|
|
588
695
|
display: "none"
|
|
589
696
|
});
|
|
590
697
|
var title = renderers.renderLabelText(renderTitle(accordion.title, open));
|
|
591
|
-
var
|
|
698
|
+
var currentIcon = isOpen ? iconOpen : iconClosed;
|
|
699
|
+
var toggler = renderToggler ? renderToggler(open, title) : /*#__PURE__*/jsxRuntime.jsxs(Button, {
|
|
592
700
|
className: className,
|
|
593
701
|
onClick: function onClick() {
|
|
594
702
|
return open.setValue(function (x) {
|
|
595
703
|
return !x;
|
|
596
704
|
});
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
705
|
+
},
|
|
706
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
707
|
+
className: titleClass,
|
|
708
|
+
children: title
|
|
709
|
+
}), currentIcon && /*#__PURE__*/jsxRuntime.jsx(I, {
|
|
710
|
+
iconLibrary: currentIcon.library,
|
|
711
|
+
iconName: currentIcon.name
|
|
712
|
+
})]
|
|
713
|
+
});
|
|
714
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
715
|
+
children: [toggler, (useCss || isOpen || designMode) && /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
716
|
+
style: fullContentStyle,
|
|
717
|
+
className: contentClassName,
|
|
718
|
+
children: children
|
|
719
|
+
})]
|
|
720
|
+
});
|
|
607
721
|
} finally {
|
|
608
722
|
_effect();
|
|
609
723
|
}
|
|
@@ -612,47 +726,49 @@ function getAccordionState(c) {
|
|
|
612
726
|
return c.meta.accordionState;
|
|
613
727
|
}
|
|
614
728
|
|
|
729
|
+
/**
|
|
730
|
+
* @trackControls
|
|
731
|
+
*/
|
|
732
|
+
function VisibleChildrenRenderer(props) {
|
|
733
|
+
var _effect = core.useComponentTracking();
|
|
734
|
+
try {
|
|
735
|
+
var childStates = props.parentFormNode.getChildNodes().map(function (x) {
|
|
736
|
+
return props.parent.getChildState(x);
|
|
737
|
+
});
|
|
738
|
+
return props.render(props.props, function (i) {
|
|
739
|
+
return !childStates[i].hidden;
|
|
740
|
+
});
|
|
741
|
+
} finally {
|
|
742
|
+
_effect();
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
615
746
|
function createTabsRenderer(options) {
|
|
616
747
|
if (options === void 0) {
|
|
617
748
|
options = {};
|
|
618
749
|
}
|
|
619
750
|
return schemas.createGroupRenderer(function (p, renderer) {
|
|
620
|
-
return
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
751
|
+
return /*#__PURE__*/jsxRuntime.jsx(VisibleChildrenRenderer, {
|
|
752
|
+
render: renderAllTabs,
|
|
753
|
+
dataContext: p.dataContext,
|
|
754
|
+
parentFormNode: p.formNode,
|
|
755
|
+
parent: p,
|
|
756
|
+
props: {
|
|
757
|
+
groupProps: p,
|
|
758
|
+
tabOptions: p.renderOptions,
|
|
759
|
+
options: options
|
|
760
|
+
}
|
|
761
|
+
});
|
|
624
762
|
}, {
|
|
625
763
|
renderType: schemas.GroupRenderType.Tabs
|
|
626
764
|
});
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
className: schemas.rendererClass(className, options.className)
|
|
635
|
-
}, React.createElement("ul", {
|
|
636
|
-
className: schemas.rendererClass(null, tabListClass)
|
|
637
|
-
}, tabs.map(function (x, i) {
|
|
638
|
-
return React.createElement("li", {
|
|
639
|
-
key: i,
|
|
640
|
-
className: schemas.rendererClass(null, tabClass),
|
|
641
|
-
onClick: function onClick() {
|
|
642
|
-
return tabIndex.value = i;
|
|
643
|
-
}
|
|
644
|
-
}, React.createElement("span", {
|
|
645
|
-
className: schemas.rendererClass(null, clsx__default["default"](labelClass, i == currentTab ? activeClass : inactiveClass))
|
|
646
|
-
}, x.definition.title ? x.definition.title : "<untitled>"));
|
|
647
|
-
})), React.createElement("div", {
|
|
648
|
-
className: schemas.rendererClass(tabOptions.contentClass, contentClass)
|
|
649
|
-
}, renderChild(currentTab, tabs[currentTab])));
|
|
650
|
-
};
|
|
651
|
-
var formNode = _ref.formNode,
|
|
652
|
-
className = _ref.className,
|
|
653
|
-
options = _ref.options,
|
|
654
|
-
renderChild = _ref.renderChild,
|
|
655
|
-
designMode = _ref.designMode,
|
|
765
|
+
function renderAllTabs(_ref, isVisible) {
|
|
766
|
+
var options = _ref.options,
|
|
767
|
+
_ref$groupProps = _ref.groupProps,
|
|
768
|
+
designMode = _ref$groupProps.designMode,
|
|
769
|
+
formNode = _ref$groupProps.formNode,
|
|
770
|
+
className = _ref$groupProps.className,
|
|
771
|
+
renderChild = _ref$groupProps.renderChild,
|
|
656
772
|
tabOptions = _ref.tabOptions;
|
|
657
773
|
var tabIndex = core.useControl(0);
|
|
658
774
|
var tabClass = options.tabClass,
|
|
@@ -662,37 +778,338 @@ function TabsGroupRenderer(_ref) {
|
|
|
662
778
|
activeClass = options.activeClass,
|
|
663
779
|
contentClass = options.contentClass;
|
|
664
780
|
var currentTab = tabIndex.value;
|
|
665
|
-
return designMode ?
|
|
666
|
-
|
|
667
|
-
|
|
781
|
+
return designMode ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
782
|
+
children: formNode.getChildNodes().map(function (x, i) {
|
|
783
|
+
return renderTabs([x], i);
|
|
784
|
+
})
|
|
785
|
+
}) : renderTabs(formNode.getChildNodes().filter(function (x, i) {
|
|
786
|
+
return isVisible(i);
|
|
787
|
+
}), 0);
|
|
788
|
+
function renderTabs(tabs, key) {
|
|
789
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
790
|
+
className: schemas.rendererClass(className, options.className),
|
|
791
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("ul", {
|
|
792
|
+
className: schemas.rendererClass(null, tabListClass),
|
|
793
|
+
children: tabs.map(function (x, i) {
|
|
794
|
+
return /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
795
|
+
className: schemas.rendererClass(null, tabClass),
|
|
796
|
+
onClick: function onClick() {
|
|
797
|
+
return tabIndex.value = i;
|
|
798
|
+
},
|
|
799
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
800
|
+
className: schemas.rendererClass(null, clsx__default["default"](labelClass, i == currentTab ? activeClass : inactiveClass)),
|
|
801
|
+
children: x.definition.title ? x.definition.title : "<untitled>"
|
|
802
|
+
})
|
|
803
|
+
}, i);
|
|
804
|
+
})
|
|
805
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
806
|
+
className: schemas.rendererClass(tabOptions.contentClass, contentClass),
|
|
807
|
+
children: renderChild(currentTab, tabs[currentTab])
|
|
808
|
+
})]
|
|
809
|
+
}, key);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
function createGridRenderer(options) {
|
|
815
|
+
return schemas.createGroupRenderer(function (props, formRenderer) {
|
|
816
|
+
return /*#__PURE__*/jsxRuntime.jsx(VisibleChildrenRenderer, {
|
|
817
|
+
props: _extends({}, props, {
|
|
818
|
+
formRenderer: formRenderer,
|
|
819
|
+
defaultOptions: options
|
|
820
|
+
}),
|
|
821
|
+
render: renderGrid,
|
|
822
|
+
parent: props,
|
|
823
|
+
dataContext: props.dataContext,
|
|
824
|
+
parentFormNode: props.formNode
|
|
825
|
+
});
|
|
826
|
+
}, {
|
|
827
|
+
renderType: schemas.GroupRenderType.Grid
|
|
828
|
+
});
|
|
829
|
+
function renderGrid(props, isChildVisible) {
|
|
830
|
+
var _props$defaultOptions, _ref, _gridOptions$columns;
|
|
831
|
+
var filteredChildren = props.formNode.getChildNodes().filter(function (x, i) {
|
|
832
|
+
return isChildVisible(i);
|
|
833
|
+
});
|
|
834
|
+
var Div = props.formRenderer.html.Div;
|
|
835
|
+
var defaults = (_props$defaultOptions = props.defaultOptions) != null ? _props$defaultOptions : {};
|
|
836
|
+
var gridOptions = props.renderOptions;
|
|
837
|
+
var numColumns = (_ref = (_gridOptions$columns = gridOptions.columns) != null ? _gridOptions$columns : defaults.defaultColumns) != null ? _ref : 2;
|
|
838
|
+
var allChildren = filteredChildren.map(function (x, i) {
|
|
839
|
+
return props.renderChild(i, x);
|
|
840
|
+
});
|
|
841
|
+
// split into numColumns items wrapped a div each
|
|
842
|
+
var rows = [];
|
|
843
|
+
for (var i = 0; i < allChildren.length; i += numColumns) {
|
|
844
|
+
rows.push(allChildren.slice(i, i + numColumns));
|
|
845
|
+
}
|
|
846
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
847
|
+
className: schemas.rendererClass(props.className, defaults.className),
|
|
848
|
+
children: rows.map(function (row, rowIndex) {
|
|
849
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
850
|
+
className: schemas.rendererClass(gridOptions.rowClass, defaults.rowClass),
|
|
851
|
+
children: row
|
|
852
|
+
}, rowIndex);
|
|
853
|
+
})
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
var defaultOptions = {
|
|
859
|
+
classes: {
|
|
860
|
+
className: undefined,
|
|
861
|
+
contentClass: "min-h-96 overflow-auto",
|
|
862
|
+
navContainerClass: "flex justify-between gap-4 my-2"
|
|
863
|
+
},
|
|
864
|
+
actions: {
|
|
865
|
+
nextText: "Next",
|
|
866
|
+
nextIcon: schemas.fontAwesomeIcon("chevron-right"),
|
|
867
|
+
nextValidate: true,
|
|
868
|
+
prevText: "Prev",
|
|
869
|
+
prevIcon: schemas.fontAwesomeIcon("chevron-left"),
|
|
870
|
+
prevValidate: false
|
|
871
|
+
},
|
|
872
|
+
renderNavigation: defaultNavigationRender
|
|
873
|
+
};
|
|
874
|
+
function defaultNavigationRender(_ref) {
|
|
875
|
+
var formRenderer = _ref.formRenderer,
|
|
876
|
+
prev = _ref.prev,
|
|
877
|
+
next = _ref.next,
|
|
878
|
+
className = _ref.className;
|
|
879
|
+
{
|
|
880
|
+
var Div = formRenderer.html.Div,
|
|
881
|
+
renderAction = formRenderer.renderAction;
|
|
882
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Div, {
|
|
883
|
+
className: className,
|
|
884
|
+
children: [renderAction(prev), renderAction(next)]
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
function createWizardRenderer(options) {
|
|
889
|
+
return schemas.createGroupRenderer(function (props, formRenderer) {
|
|
890
|
+
return /*#__PURE__*/jsxRuntime.jsx(VisibleChildrenRenderer, {
|
|
891
|
+
props: _extends({}, props, {
|
|
892
|
+
formRenderer: formRenderer,
|
|
893
|
+
defaultOptions: options
|
|
894
|
+
}),
|
|
895
|
+
render: renderWizard,
|
|
896
|
+
parent: props,
|
|
897
|
+
dataContext: props.dataContext,
|
|
898
|
+
parentFormNode: props.formNode
|
|
899
|
+
});
|
|
900
|
+
}, {
|
|
901
|
+
renderType: schemas.GroupRenderType.Wizard
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
function renderWizard(props, isChildVisible) {
|
|
905
|
+
var _props$defaultOptions;
|
|
906
|
+
var mergedOptions = schemas.deepMerge((_props$defaultOptions = props.defaultOptions) != null ? _props$defaultOptions : {}, defaultOptions);
|
|
907
|
+
var _mergedOptions$classe = mergedOptions.classes,
|
|
908
|
+
className = _mergedOptions$classe.className,
|
|
909
|
+
contentClass = _mergedOptions$classe.contentClass,
|
|
910
|
+
navContainerClass = _mergedOptions$classe.navContainerClass,
|
|
911
|
+
_mergedOptions$action = mergedOptions.actions,
|
|
912
|
+
nextText = _mergedOptions$action.nextText,
|
|
913
|
+
nextIcon = _mergedOptions$action.nextIcon,
|
|
914
|
+
prevText = _mergedOptions$action.prevText,
|
|
915
|
+
prevIcon = _mergedOptions$action.prevIcon,
|
|
916
|
+
nextValidate = _mergedOptions$action.nextValidate,
|
|
917
|
+
prevValidate = _mergedOptions$action.prevValidate,
|
|
918
|
+
renderNavigation = mergedOptions.renderNavigation;
|
|
919
|
+
var Div = props.formRenderer.html.Div;
|
|
920
|
+
var children = props.formNode.getChildNodes();
|
|
921
|
+
var allVisible = children.map(function (_, i) {
|
|
922
|
+
return isChildVisible(i);
|
|
923
|
+
});
|
|
924
|
+
var page = core.useControl(0);
|
|
925
|
+
var currentPage = page.value;
|
|
926
|
+
var isValid = core.useComputed(function () {
|
|
927
|
+
return isPageValid();
|
|
928
|
+
});
|
|
929
|
+
var next = schemas.createAction("nav", function () {
|
|
930
|
+
return nav(1, nextValidate);
|
|
931
|
+
}, nextText, {
|
|
932
|
+
hidden: !props.designMode && nextVisibleInDirection(1) == null,
|
|
933
|
+
disabled: !isValid.value,
|
|
934
|
+
icon: nextIcon,
|
|
935
|
+
iconPlacement: schemas.IconPlacement.AfterText
|
|
936
|
+
});
|
|
937
|
+
var prev = schemas.createAction("nav", function () {
|
|
938
|
+
return nav(-1, prevValidate);
|
|
939
|
+
}, prevText, {
|
|
940
|
+
disabled: !props.designMode && nextVisibleInDirection(-1) == null,
|
|
941
|
+
icon: prevIcon
|
|
942
|
+
});
|
|
943
|
+
var navElement = renderNavigation({
|
|
944
|
+
formRenderer: props.formRenderer,
|
|
945
|
+
page: countVisibleUntil(currentPage),
|
|
946
|
+
totalPages: countVisibleUntil(children.length),
|
|
947
|
+
prev: prev,
|
|
948
|
+
next: next,
|
|
949
|
+
className: navContainerClass,
|
|
950
|
+
validatePage: function () {
|
|
951
|
+
try {
|
|
952
|
+
return Promise.resolve(_validatePage());
|
|
953
|
+
} catch (e) {
|
|
954
|
+
return Promise.reject(e);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
});
|
|
958
|
+
var content = props.designMode ? /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
959
|
+
children: children.map(function (child, i) {
|
|
960
|
+
return props.renderChild(i, child);
|
|
961
|
+
})
|
|
962
|
+
}) : currentPage < children.length ? /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
963
|
+
className: contentClass,
|
|
964
|
+
children: props.renderChild(currentPage, children[currentPage])
|
|
965
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(react.Fragment, {});
|
|
966
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Div, {
|
|
967
|
+
className: schemas.rendererClass(props.className, className),
|
|
968
|
+
children: [content, navElement]
|
|
969
|
+
});
|
|
970
|
+
function countVisibleUntil(untilPage) {
|
|
971
|
+
var count = 0;
|
|
972
|
+
for (var i = 0; i < untilPage && i < allVisible.length; i++) {
|
|
973
|
+
if (allVisible[i]) {
|
|
974
|
+
count++;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
return count;
|
|
978
|
+
}
|
|
979
|
+
function nav(dir, validate) {
|
|
980
|
+
if (validate && !_validatePage()) {
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
var next = nextVisibleInDirection(dir);
|
|
984
|
+
if (next != null) {
|
|
985
|
+
page.value = next;
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
function nextVisibleInDirection(dir) {
|
|
989
|
+
var next = currentPage + dir;
|
|
990
|
+
while (next >= 0 && next < children.length) {
|
|
991
|
+
if (allVisible[next]) {
|
|
992
|
+
return next;
|
|
993
|
+
}
|
|
994
|
+
next += dir;
|
|
995
|
+
}
|
|
996
|
+
return null;
|
|
997
|
+
}
|
|
998
|
+
function _validatePage() {
|
|
999
|
+
var pageNode = children[currentPage];
|
|
1000
|
+
var hasErrors = false;
|
|
1001
|
+
schemas.visitFormDataInContext(props.dataContext.parentNode, pageNode, schemas.validationVisitor(function () {
|
|
1002
|
+
hasErrors = true;
|
|
1003
|
+
}));
|
|
1004
|
+
return !hasErrors;
|
|
1005
|
+
}
|
|
1006
|
+
function isPageValid() {
|
|
1007
|
+
var pageNode = children[currentPage];
|
|
1008
|
+
var hasErrors = false;
|
|
1009
|
+
schemas.visitFormDataInContext(props.dataContext.parentNode, pageNode, function (c) {
|
|
1010
|
+
if (!c.control.valid) hasErrors = true;
|
|
1011
|
+
});
|
|
1012
|
+
return !hasErrors;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
var defaultDialogOptions = {
|
|
1017
|
+
classes: {
|
|
1018
|
+
className: "",
|
|
1019
|
+
titleClass: "text-2xl font-bold"
|
|
1020
|
+
}
|
|
1021
|
+
};
|
|
1022
|
+
function createDialogRenderer(options) {
|
|
1023
|
+
return schemas.createGroupRenderer(function (props, renderer) {
|
|
1024
|
+
return /*#__PURE__*/jsxRuntime.jsx(DefaultDialogRenderer, {
|
|
1025
|
+
props: props,
|
|
1026
|
+
options: options,
|
|
1027
|
+
renderer: renderer,
|
|
1028
|
+
renderOptions: props.renderOptions
|
|
1029
|
+
});
|
|
1030
|
+
}, {
|
|
1031
|
+
renderType: schemas.GroupRenderType.Dialog
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
function DefaultDialogRenderer(_ref) {
|
|
1035
|
+
var _effect = core.useComponentTracking();
|
|
1036
|
+
try {
|
|
1037
|
+
var designContent = function designContent() {
|
|
1038
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1039
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1040
|
+
onClickCapture: function onClickCapture() {
|
|
1041
|
+
return overlayState.toggle();
|
|
1042
|
+
},
|
|
1043
|
+
children: renderer.renderAction(schemas.createAction("Toggle Dialog", function () {}, open.value ? "Hide Content" : "Show Content", {
|
|
1044
|
+
actionStyle: schemas.ActionStyle.Link
|
|
1045
|
+
}))
|
|
1046
|
+
}), open.value && dialogContent]
|
|
1047
|
+
});
|
|
1048
|
+
};
|
|
1049
|
+
var props = _ref.props,
|
|
1050
|
+
renderOptions = _ref.renderOptions,
|
|
1051
|
+
options = _ref.options,
|
|
1052
|
+
renderer = _ref.renderer;
|
|
1053
|
+
var _deepMerge = schemas.deepMerge(options, defaultDialogOptions),
|
|
1054
|
+
_deepMerge$classes = _deepMerge.classes,
|
|
1055
|
+
titleClass = _deepMerge$classes.titleClass,
|
|
1056
|
+
className = _deepMerge$classes.className;
|
|
1057
|
+
var open = core.useControl(false);
|
|
1058
|
+
var overlayState = ariaBase.createOverlayState(open);
|
|
1059
|
+
var actionOnClick = function actionOnClick(action) {
|
|
1060
|
+
switch (action) {
|
|
1061
|
+
case "closeDialog":
|
|
1062
|
+
return function () {
|
|
1063
|
+
return overlayState.close();
|
|
1064
|
+
};
|
|
1065
|
+
case "openDialog":
|
|
1066
|
+
return function () {
|
|
1067
|
+
return overlayState.open();
|
|
1068
|
+
};
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1071
|
+
var triggerChildren = props.formNode.getChildNodes().filter(function (x) {
|
|
1072
|
+
return x.definition.placement === "trigger";
|
|
1073
|
+
});
|
|
1074
|
+
var dialogContent = /*#__PURE__*/jsxRuntime.jsx(ariaBase.Dialog, {
|
|
1075
|
+
title: renderOptions.title,
|
|
1076
|
+
titleClass: titleClass,
|
|
1077
|
+
className: schemas.rendererClass(props.className, className),
|
|
1078
|
+
children: props.formNode.getChildNodes().filter(function (x) {
|
|
1079
|
+
return !x.definition.placement || x.definition.placement === "dialog";
|
|
1080
|
+
}).map(function (x, i) {
|
|
1081
|
+
return props.renderChild(i, x, {
|
|
1082
|
+
actionOnClick: actionOnClick
|
|
1083
|
+
});
|
|
1084
|
+
})
|
|
1085
|
+
});
|
|
1086
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1087
|
+
children: [triggerChildren.map(function (x, i) {
|
|
1088
|
+
return props.renderChild(i, x, {
|
|
1089
|
+
actionOnClick: actionOnClick
|
|
1090
|
+
});
|
|
1091
|
+
}), props.designMode ? designContent() : open.value && /*#__PURE__*/jsxRuntime.jsx(ariaBase.Modal, {
|
|
1092
|
+
state: overlayState,
|
|
1093
|
+
isDismissable: true,
|
|
1094
|
+
children: dialogContent
|
|
1095
|
+
})]
|
|
1096
|
+
});
|
|
668
1097
|
} finally {
|
|
669
1098
|
_effect();
|
|
670
1099
|
}
|
|
671
1100
|
}
|
|
672
1101
|
|
|
673
1102
|
function createDefaultGroupRenderer(options) {
|
|
1103
|
+
var gridRenderer = createGridRenderer(options == null ? void 0 : options.grid);
|
|
674
1104
|
var tabsRenderer = createTabsRenderer(options == null ? void 0 : options.tabs);
|
|
1105
|
+
var wizardRenderer = createWizardRenderer(options == null ? void 0 : options.wizard);
|
|
1106
|
+
var dialogRenderer = createDialogRenderer(options == null ? void 0 : options.dialog);
|
|
675
1107
|
var _ref = options != null ? options : {},
|
|
676
1108
|
className = _ref.className,
|
|
677
|
-
_ref$gridStyles = _ref.gridStyles,
|
|
678
|
-
gridStyles = _ref$gridStyles === void 0 ? defaultGridStyles : _ref$gridStyles,
|
|
679
|
-
_ref$defaultGridColum = _ref.defaultGridColumns,
|
|
680
|
-
defaultGridColumns = _ref$defaultGridColum === void 0 ? 2 : _ref$defaultGridColum,
|
|
681
|
-
gridClassName = _ref.gridClassName,
|
|
682
1109
|
standardClassName = _ref.standardClassName,
|
|
683
1110
|
flexClassName = _ref.flexClassName,
|
|
1111
|
+
inlineClass = _ref.inlineClass,
|
|
684
1112
|
defaultFlexGap = _ref.defaultFlexGap;
|
|
685
|
-
function defaultGridStyles(_ref2) {
|
|
686
|
-
var _ref2$columns = _ref2.columns,
|
|
687
|
-
columns = _ref2$columns === void 0 ? defaultGridColumns : _ref2$columns;
|
|
688
|
-
return {
|
|
689
|
-
className: gridClassName,
|
|
690
|
-
style: {
|
|
691
|
-
display: "grid",
|
|
692
|
-
gridTemplateColumns: "repeat(" + columns + ", 1fr)"
|
|
693
|
-
}
|
|
694
|
-
};
|
|
695
|
-
}
|
|
696
1113
|
function flexStyles(options) {
|
|
697
1114
|
return {
|
|
698
1115
|
className: flexClassName,
|
|
@@ -708,54 +1125,78 @@ function createDefaultGroupRenderer(options) {
|
|
|
708
1125
|
renderOptions = props.renderOptions,
|
|
709
1126
|
formNode = props.formNode;
|
|
710
1127
|
if (schemas.isTabsRenderer(renderOptions)) return tabsRenderer.render(props, renderer);
|
|
1128
|
+
if (schemas.isGridRenderer(renderOptions)) return gridRenderer.render(props, renderer);
|
|
1129
|
+
if (schemas.isWizardRenderer(renderOptions)) return wizardRenderer.render(props, renderer);
|
|
1130
|
+
if (schemas.isDialogRenderer(renderOptions)) return dialogRenderer.render(props, renderer);
|
|
711
1131
|
if (schemas.isSelectChildRenderer(renderOptions) && !props.designMode) {
|
|
712
|
-
return
|
|
1132
|
+
return /*#__PURE__*/jsxRuntime.jsx(SelectChildGroupRenderer, _extends({}, props, {
|
|
713
1133
|
renderOptions: renderOptions
|
|
714
1134
|
}));
|
|
715
1135
|
}
|
|
716
|
-
var
|
|
1136
|
+
var _ref2 = schemas.isFlexRenderer(renderOptions) ? flexStyles(renderOptions) : schemas.isInlineRenderer(renderOptions) ? {
|
|
1137
|
+
className: inlineClass
|
|
1138
|
+
} : {
|
|
717
1139
|
className: standardClassName
|
|
718
1140
|
},
|
|
719
|
-
style =
|
|
720
|
-
gcn =
|
|
721
|
-
|
|
722
|
-
var
|
|
723
|
-
|
|
1141
|
+
style = _ref2.style,
|
|
1142
|
+
gcn = _ref2.className;
|
|
1143
|
+
var Div = renderer.html.Div;
|
|
1144
|
+
var inline = renderOptions.type == schemas.GroupRenderType.Inline;
|
|
1145
|
+
var children = formNode.getChildNodes().map(function (c, i) {
|
|
1146
|
+
return renderChild(i, c, {
|
|
1147
|
+
inline: inline
|
|
1148
|
+
});
|
|
1149
|
+
});
|
|
1150
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
724
1151
|
className: schemas.rendererClass(props.className, clsx__default["default"](className, gcn)),
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
1152
|
+
textClass: props.textClass,
|
|
1153
|
+
style: style,
|
|
1154
|
+
inline: inline,
|
|
1155
|
+
children: children
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
function renderLayout(props, renderer) {
|
|
1159
|
+
if (props.renderOptions.type === schemas.GroupRenderType.Contents) {
|
|
1160
|
+
var formNode = props.formNode,
|
|
1161
|
+
renderChild = props.renderChild;
|
|
1162
|
+
var children = formNode.getChildNodes().map(function (c, i) {
|
|
1163
|
+
return renderChild(i, c);
|
|
1164
|
+
});
|
|
1165
|
+
return function (layout) {
|
|
1166
|
+
return _extends({}, layout, {
|
|
1167
|
+
inline: true,
|
|
1168
|
+
children: children
|
|
1169
|
+
});
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
return render(props, renderer);
|
|
729
1173
|
}
|
|
730
1174
|
return {
|
|
731
1175
|
type: "group",
|
|
732
|
-
render:
|
|
1176
|
+
render: renderLayout
|
|
733
1177
|
};
|
|
734
1178
|
}
|
|
735
1179
|
function SelectChildGroupRenderer(props) {
|
|
736
1180
|
var _effect = core.useComponentTracking();
|
|
737
1181
|
try {
|
|
738
|
-
var
|
|
1182
|
+
var runExpression = props.runExpression,
|
|
739
1183
|
renderOptions = props.renderOptions;
|
|
740
|
-
var
|
|
741
|
-
return x == "string" ? parseInt(x) : x;
|
|
1184
|
+
var ctrl = schemas.useExpression(undefined, runExpression, renderOptions == null ? void 0 : renderOptions.childIndexExpression, function (x) {
|
|
1185
|
+
return typeof x == "string" ? parseInt(x) : x;
|
|
1186
|
+
});
|
|
1187
|
+
var childIndex = ctrl == null ? void 0 : ctrl.value;
|
|
1188
|
+
var childDefinitions = props.formNode.getChildNodes();
|
|
1189
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1190
|
+
children: typeof childIndex === "number" && childIndex < childDefinitions.length && childIndex >= 0 && props.renderChild(childIndex, childDefinitions[childIndex])
|
|
742
1191
|
});
|
|
743
|
-
var Render = core.useTrackedComponent(function (p) {
|
|
744
|
-
var ctrl = dynHook.runHook(p.dataContext, dynHook.state);
|
|
745
|
-
var childIndex = ctrl == null ? void 0 : ctrl.value;
|
|
746
|
-
var childDefinitions = p.formNode.getChildNodes();
|
|
747
|
-
return React.createElement("div", null, typeof childIndex === "number" && childIndex < childDefinitions.length && childIndex >= 0 && p.renderChild(childIndex, childDefinitions[childIndex]));
|
|
748
|
-
}, [dynHook.deps]);
|
|
749
|
-
return React.createElement(Render, props);
|
|
750
1192
|
} finally {
|
|
751
1193
|
_effect();
|
|
752
1194
|
}
|
|
753
1195
|
}
|
|
754
1196
|
|
|
755
1197
|
function createDefaultVisibilityRenderer() {
|
|
756
|
-
var h = jsxRuntime.jsx;
|
|
757
1198
|
return schemas.createVisibilityRenderer(function (props, renderer) {
|
|
758
|
-
return
|
|
1199
|
+
return /*#__PURE__*/jsxRuntime.jsx(DefaultVisibility, _extends({}, props, {
|
|
759
1200
|
renderer: renderer
|
|
760
1201
|
}));
|
|
761
1202
|
});
|
|
@@ -768,9 +1209,10 @@ function DefaultVisibility(_ref) {
|
|
|
768
1209
|
className = _ref.className,
|
|
769
1210
|
style = _ref.style,
|
|
770
1211
|
divRef = _ref.divRef,
|
|
771
|
-
renderer = _ref.renderer
|
|
1212
|
+
renderer = _ref.renderer,
|
|
1213
|
+
inline = _ref.inline;
|
|
772
1214
|
var v = visibility.value;
|
|
773
|
-
|
|
1215
|
+
react.useEffect(function () {
|
|
774
1216
|
if (v) {
|
|
775
1217
|
visibility.setValue(function (ex) {
|
|
776
1218
|
return {
|
|
@@ -780,13 +1222,14 @@ function DefaultVisibility(_ref) {
|
|
|
780
1222
|
});
|
|
781
1223
|
}
|
|
782
1224
|
}, [v == null ? void 0 : v.visible]);
|
|
783
|
-
var
|
|
784
|
-
return v != null && v.visible ?
|
|
1225
|
+
var Div = renderer.html.Div;
|
|
1226
|
+
if (inline) return v != null && v.visible ? children : undefined;
|
|
1227
|
+
return v != null && v.visible ? /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
785
1228
|
className: className,
|
|
786
1229
|
style: style,
|
|
787
|
-
|
|
1230
|
+
nativeRef: divRef,
|
|
788
1231
|
children: children
|
|
789
|
-
}) :
|
|
1232
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
790
1233
|
} finally {
|
|
791
1234
|
_effect();
|
|
792
1235
|
}
|
|
@@ -794,13 +1237,14 @@ function DefaultVisibility(_ref) {
|
|
|
794
1237
|
|
|
795
1238
|
function createJsonataRenderer(className) {
|
|
796
1239
|
return schemas.createDataRenderer(function (p) {
|
|
797
|
-
return
|
|
1240
|
+
return /*#__PURE__*/jsxRuntime.jsx(JsonataRenderer, {
|
|
798
1241
|
renderOptions: p.renderOptions,
|
|
799
1242
|
className: schemas.rendererClass(p.className, className),
|
|
800
1243
|
dataNode: p.dataNode,
|
|
801
1244
|
dataContext: p.dataContext,
|
|
802
1245
|
control: p.control,
|
|
803
|
-
readonly: p.readonly
|
|
1246
|
+
readonly: p.readonly,
|
|
1247
|
+
runExpression: p.runExpression
|
|
804
1248
|
});
|
|
805
1249
|
}, {
|
|
806
1250
|
renderType: schemas.DataRenderType.Jsonata
|
|
@@ -814,19 +1258,22 @@ function JsonataRenderer(_ref) {
|
|
|
814
1258
|
readonly = _ref.readonly,
|
|
815
1259
|
className = _ref.className,
|
|
816
1260
|
dataContext = _ref.dataContext,
|
|
817
|
-
dataNode = _ref.dataNode
|
|
1261
|
+
dataNode = _ref.dataNode,
|
|
1262
|
+
runExpression = _ref.runExpression;
|
|
818
1263
|
var sdn = dataNode.elementIndex != null ? dataNode : dataContext.parentNode;
|
|
819
1264
|
var bindings = core.useComputed(function () {
|
|
820
|
-
return {
|
|
1265
|
+
return _extends({}, dataContext.variables, {
|
|
821
1266
|
value: control.value,
|
|
822
1267
|
readonly: readonly,
|
|
823
1268
|
disabled: control.disabled,
|
|
824
|
-
formData: dataContext.formData,
|
|
825
1269
|
dataPath: schemas.getJsonPath(dataNode)
|
|
826
|
-
};
|
|
1270
|
+
});
|
|
827
1271
|
});
|
|
828
|
-
var rendered = schemas.
|
|
829
|
-
|
|
1272
|
+
var rendered = schemas.useExpression("", runExpression, {
|
|
1273
|
+
type: schemas.ExpressionType.Jsonata,
|
|
1274
|
+
expression: renderOptions.expression
|
|
1275
|
+
}, schemas.coerceToString, bindings);
|
|
1276
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
830
1277
|
className: className,
|
|
831
1278
|
dangerouslySetInnerHTML: {
|
|
832
1279
|
__html: rendered.value
|
|
@@ -837,12 +1284,12 @@ function JsonataRenderer(_ref) {
|
|
|
837
1284
|
}
|
|
838
1285
|
}
|
|
839
1286
|
|
|
840
|
-
var _excluded = ["control", "field", "renderOptions"];
|
|
1287
|
+
var _excluded$1 = ["control", "field", "renderOptions"];
|
|
841
1288
|
function createNullToggleRenderer() {
|
|
842
1289
|
return schemas.createDataRenderer(function (_ref, renderers) {
|
|
843
1290
|
var control = _ref.control,
|
|
844
1291
|
field = _ref.field,
|
|
845
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1292
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
846
1293
|
var lastDefined = schemas.getLastDefinedValue(control);
|
|
847
1294
|
if (lastDefined.current.value == null) lastDefined.value = props.definition.defaultValue;
|
|
848
1295
|
var nullControl = schemas.getNullToggler(control);
|
|
@@ -863,7 +1310,7 @@ function createNullToggleRenderer() {
|
|
|
863
1310
|
|
|
864
1311
|
function createDefaultArrayDataRenderer(defaultActions) {
|
|
865
1312
|
return schemas.createDataRenderer(function (props, renderers) {
|
|
866
|
-
return
|
|
1313
|
+
return /*#__PURE__*/jsxRuntime.jsx(DataArrayRenderer, {
|
|
867
1314
|
dataProps: props,
|
|
868
1315
|
renderers: renderers,
|
|
869
1316
|
defaultActions: defaultActions
|
|
@@ -873,120 +1320,125 @@ function createDefaultArrayDataRenderer(defaultActions) {
|
|
|
873
1320
|
collection: true
|
|
874
1321
|
});
|
|
875
1322
|
}
|
|
1323
|
+
/**
|
|
1324
|
+
* @trackControls
|
|
1325
|
+
*/
|
|
876
1326
|
function DataArrayRenderer(_ref) {
|
|
877
|
-
var
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
control = dataProps.control,
|
|
883
|
-
field = dataProps.field,
|
|
884
|
-
readonly = dataProps.readonly,
|
|
885
|
-
designMode = dataProps.designMode,
|
|
886
|
-
required = dataProps.required,
|
|
887
|
-
renderChild = dataProps.renderChild,
|
|
888
|
-
definition = dataProps.definition,
|
|
889
|
-
className = dataProps.className,
|
|
890
|
-
style = dataProps.style,
|
|
891
|
-
useChildVisibility = dataProps.useChildVisibility,
|
|
892
|
-
dataContext = dataProps.dataContext,
|
|
893
|
-
formNode = dataProps.formNode;
|
|
894
|
-
var _mergeObjects = schemas.mergeObjects(schemas.isArrayRenderer(renderOptions) ? renderOptions : {}, defaultActions),
|
|
895
|
-
addText = _mergeObjects.addText,
|
|
896
|
-
noAdd = _mergeObjects.noAdd,
|
|
897
|
-
noRemove = _mergeObjects.noRemove,
|
|
898
|
-
removeText = _mergeObjects.removeText,
|
|
899
|
-
editExternal = _mergeObjects.editExternal;
|
|
900
|
-
var childOptions = schemas.isArrayRenderer(renderOptions) ? renderOptions.childOptions : undefined;
|
|
901
|
-
var renderAsElement = !schemas.isCompoundField(field);
|
|
902
|
-
var childDefinition = formNode.tree.createTempNode(formNode.id + "child", !renderAsElement ? {
|
|
903
|
-
type: schemas.ControlDefinitionType.Group,
|
|
904
|
-
groupOptions: {
|
|
905
|
-
type: schemas.GroupRenderType.Standard,
|
|
906
|
-
hideTitle: true
|
|
907
|
-
}
|
|
908
|
-
} : {
|
|
909
|
-
type: schemas.ControlDefinitionType.Data,
|
|
910
|
-
field: definition.field,
|
|
911
|
-
renderOptions: childOptions != null ? childOptions : {
|
|
912
|
-
type: schemas.DataRenderType.Standard
|
|
913
|
-
},
|
|
914
|
-
hideTitle: true
|
|
915
|
-
}, formNode.getChildNodes());
|
|
916
|
-
var visibilities = ((_definition$children = definition.children) != null ? _definition$children : []).map(function (x) {
|
|
917
|
-
return [useChildVisibility(x, undefined, true), x];
|
|
918
|
-
});
|
|
919
|
-
var deps = schemas.makeHookDepString(visibilities, function (x) {
|
|
920
|
-
return x[0].deps;
|
|
921
|
-
});
|
|
922
|
-
var Entry = core.useTrackedComponent(RenderEntry, [deps]);
|
|
923
|
-
var arrayProps = _extends({}, schemas.createArrayActions(control.as(), field, {
|
|
924
|
-
addText: addText,
|
|
925
|
-
removeText: removeText,
|
|
926
|
-
noAdd: noAdd,
|
|
927
|
-
noRemove: noRemove,
|
|
928
|
-
readonly: readonly,
|
|
929
|
-
disabled: control.disabled,
|
|
930
|
-
designMode: designMode,
|
|
931
|
-
editExternal: editExternal
|
|
932
|
-
}), {
|
|
933
|
-
required: required,
|
|
934
|
-
renderElement: function renderElement(i, wrap) {
|
|
935
|
-
return React.createElement(Entry, {
|
|
936
|
-
index: i,
|
|
937
|
-
renderChildElement: renderChildElement,
|
|
938
|
-
dataContext: dataContext,
|
|
939
|
-
visibilities: visibilities,
|
|
940
|
-
wrap: wrap
|
|
1327
|
+
var _effect = core.useComponentTracking();
|
|
1328
|
+
try {
|
|
1329
|
+
var renderChildElement = function renderChildElement(i, elementNode) {
|
|
1330
|
+
return renderChild(elementNode.control.uniqueId, childNode, {
|
|
1331
|
+
parentDataNode: elementNode
|
|
941
1332
|
});
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1333
|
+
};
|
|
1334
|
+
var dataProps = _ref.dataProps,
|
|
1335
|
+
renderers = _ref.renderers,
|
|
1336
|
+
defaultActions = _ref.defaultActions;
|
|
1337
|
+
var renderOptions = dataProps.renderOptions,
|
|
1338
|
+
control = dataProps.control,
|
|
1339
|
+
field = dataProps.field,
|
|
1340
|
+
readonly = dataProps.readonly,
|
|
1341
|
+
designMode = dataProps.designMode,
|
|
1342
|
+
required = dataProps.required,
|
|
1343
|
+
renderChild = dataProps.renderChild,
|
|
1344
|
+
definition = dataProps.definition,
|
|
1345
|
+
className = dataProps.className,
|
|
1346
|
+
style = dataProps.style,
|
|
1347
|
+
dataContext = dataProps.dataContext,
|
|
1348
|
+
formNode = dataProps.formNode,
|
|
1349
|
+
getChildState = dataProps.getChildState;
|
|
1350
|
+
var _mergeObjects = schemas.mergeObjects(schemas.isArrayRenderer(renderOptions) ? renderOptions : {}, defaultActions),
|
|
1351
|
+
addText = _mergeObjects.addText,
|
|
1352
|
+
noAdd = _mergeObjects.noAdd,
|
|
1353
|
+
noRemove = _mergeObjects.noRemove,
|
|
1354
|
+
noReorder = _mergeObjects.noReorder,
|
|
1355
|
+
removeText = _mergeObjects.removeText,
|
|
1356
|
+
editExternal = _mergeObjects.editExternal;
|
|
1357
|
+
var childDefs = formNode.getResolvedChildren();
|
|
1358
|
+
var renderAsElement = !schemas.isCompoundField(field);
|
|
1359
|
+
var defaultChildDef = {
|
|
1360
|
+
type: schemas.ControlDefinitionType.Data,
|
|
1361
|
+
field: ".",
|
|
1362
|
+
renderOptions: {
|
|
1363
|
+
type: schemas.DataRenderType.Standard
|
|
1364
|
+
},
|
|
1365
|
+
hideTitle: true
|
|
1366
|
+
};
|
|
1367
|
+
var childDef = {
|
|
1368
|
+
type: schemas.ControlDefinitionType.Group,
|
|
1369
|
+
groupOptions: {
|
|
1370
|
+
type: schemas.GroupRenderType.Standard,
|
|
1371
|
+
hideTitle: true
|
|
1372
|
+
},
|
|
1373
|
+
children: renderAsElement && childDefs.length == 0 ? [defaultChildDef] : childDefs
|
|
1374
|
+
};
|
|
1375
|
+
var childNode = formNode.createChildNode("child", childDef);
|
|
1376
|
+
var childNodes = childNode.getChildNodes();
|
|
1377
|
+
var arrayProps = _extends({}, schemas.createArrayActions(control.as(), field, {
|
|
1378
|
+
addText: addText,
|
|
1379
|
+
removeText: removeText,
|
|
1380
|
+
noAdd: noAdd,
|
|
1381
|
+
noRemove: noRemove,
|
|
1382
|
+
readonly: readonly,
|
|
1383
|
+
disabled: control.disabled,
|
|
1384
|
+
designMode: designMode,
|
|
1385
|
+
editExternal: editExternal
|
|
1386
|
+
}), {
|
|
1387
|
+
required: required,
|
|
1388
|
+
renderElement: function renderElement(i, wrap) {
|
|
1389
|
+
return /*#__PURE__*/jsxRuntime.jsx(RenderEntry, {
|
|
1390
|
+
index: i,
|
|
1391
|
+
renderChildElement: renderChildElement,
|
|
1392
|
+
dataContext: dataContext,
|
|
1393
|
+
wrap: wrap,
|
|
1394
|
+
isChildHidden: function isChildHidden(dataNode) {
|
|
1395
|
+
return childNodes.every(function (x) {
|
|
1396
|
+
return getChildState(x, dataNode).hidden;
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
});
|
|
1400
|
+
},
|
|
1401
|
+
className: className ? className : undefined,
|
|
1402
|
+
style: style
|
|
1403
|
+
}, schemas.getLengthRestrictions(definition));
|
|
1404
|
+
return renderers.renderArray(arrayProps);
|
|
1405
|
+
} finally {
|
|
1406
|
+
_effect();
|
|
954
1407
|
}
|
|
955
1408
|
}
|
|
1409
|
+
/**
|
|
1410
|
+
* @trackControls
|
|
1411
|
+
*/
|
|
956
1412
|
function RenderEntry(_ref2) {
|
|
957
|
-
var
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
var
|
|
965
|
-
|
|
966
|
-
return
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
});
|
|
971
|
-
var anyVisible = childVis.length == 0 || childVis.some(function (x) {
|
|
972
|
-
return x === true;
|
|
973
|
-
});
|
|
974
|
-
if (!anyVisible) return undefined;
|
|
975
|
-
return wrap(renderChildElement(i, elementNode));
|
|
1413
|
+
var _effect2 = core.useComponentTracking();
|
|
1414
|
+
try {
|
|
1415
|
+
var i = _ref2.index,
|
|
1416
|
+
renderChildElement = _ref2.renderChildElement,
|
|
1417
|
+
wrap = _ref2.wrap,
|
|
1418
|
+
isChildHidden = _ref2.isChildHidden,
|
|
1419
|
+
dataContext = _ref2.dataContext;
|
|
1420
|
+
var elementNode = dataContext.dataNode.getChildElement(i);
|
|
1421
|
+
if (isChildHidden(elementNode)) return undefined;
|
|
1422
|
+
return wrap(renderChildElement(i, elementNode));
|
|
1423
|
+
} finally {
|
|
1424
|
+
_effect2();
|
|
1425
|
+
}
|
|
976
1426
|
}
|
|
977
1427
|
function createDefaultArrayRenderer(options) {
|
|
978
1428
|
return {
|
|
979
|
-
render: function render(props,
|
|
980
|
-
var renderAction =
|
|
981
|
-
|
|
982
|
-
|
|
1429
|
+
render: function render(props, _ref3) {
|
|
1430
|
+
var renderAction = _ref3.renderAction,
|
|
1431
|
+
html = _ref3.html;
|
|
1432
|
+
return /*#__PURE__*/jsxRuntime.jsx(DefaultArrayRenderer, _extends({}, props, options, {
|
|
1433
|
+
renderAction: renderAction,
|
|
1434
|
+
html: html
|
|
983
1435
|
}));
|
|
984
1436
|
},
|
|
985
1437
|
type: "array"
|
|
986
1438
|
};
|
|
987
1439
|
}
|
|
988
1440
|
function DefaultArrayRenderer(props) {
|
|
989
|
-
var
|
|
1441
|
+
var _effect3 = core.useComponentTracking();
|
|
990
1442
|
try {
|
|
991
1443
|
var renderElement = props.renderElement,
|
|
992
1444
|
className = props.className,
|
|
@@ -998,31 +1450,41 @@ function DefaultArrayRenderer(props) {
|
|
|
998
1450
|
arrayControl = props.arrayControl,
|
|
999
1451
|
renderAction = props.renderAction,
|
|
1000
1452
|
style = props.style,
|
|
1001
|
-
editAction = props.editAction
|
|
1453
|
+
editAction = props.editAction,
|
|
1454
|
+
Div = props.html.Div;
|
|
1002
1455
|
var _applyArrayLengthRest = schemas.applyArrayLengthRestrictions(props),
|
|
1003
1456
|
addAction = _applyArrayLengthRest.addAction,
|
|
1004
1457
|
removeAction = _applyArrayLengthRest.removeAction;
|
|
1005
|
-
return
|
|
1006
|
-
style: style
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1458
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Div, {
|
|
1459
|
+
style: style,
|
|
1460
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
1461
|
+
className: clsx__default["default"](className, removeAction && removableClass),
|
|
1462
|
+
children: /*#__PURE__*/jsxRuntime.jsx(core.RenderElements, {
|
|
1463
|
+
control: arrayControl,
|
|
1464
|
+
children: function children(_, x) {
|
|
1465
|
+
return renderElement(x, function (children) {
|
|
1466
|
+
return removeAction || editAction ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1467
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
1468
|
+
className: clsx__default["default"](childClass, removableChildClass),
|
|
1469
|
+
children: children
|
|
1470
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Div, {
|
|
1471
|
+
className: removeActionClass,
|
|
1472
|
+
children: [editAction && renderAction(editAction(x)), removeAction && renderAction(removeAction(x))]
|
|
1473
|
+
})]
|
|
1474
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
1475
|
+
className: childClass,
|
|
1476
|
+
children: children
|
|
1477
|
+
});
|
|
1478
|
+
});
|
|
1479
|
+
}
|
|
1480
|
+
})
|
|
1481
|
+
}), addAction && /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
1482
|
+
className: addActionClass,
|
|
1483
|
+
children: renderAction(addAction)
|
|
1484
|
+
})]
|
|
1485
|
+
});
|
|
1024
1486
|
} finally {
|
|
1025
|
-
|
|
1487
|
+
_effect3();
|
|
1026
1488
|
}
|
|
1027
1489
|
}
|
|
1028
1490
|
|
|
@@ -1033,7 +1495,7 @@ function createAutocompleteRenderer(options) {
|
|
|
1033
1495
|
}
|
|
1034
1496
|
return schemas.createDataRenderer(function (p) {
|
|
1035
1497
|
var _p$options, _p$options2;
|
|
1036
|
-
return p.field.collection ?
|
|
1498
|
+
return p.field.collection ? /*#__PURE__*/jsxRuntime.jsx(MultipleAutocomplete, {
|
|
1037
1499
|
options: (_p$options = p.options) != null ? _p$options : [],
|
|
1038
1500
|
control: p.control,
|
|
1039
1501
|
className: schemas.rendererClass(p.className, options.className),
|
|
@@ -1041,7 +1503,7 @@ function createAutocompleteRenderer(options) {
|
|
|
1041
1503
|
controlClasses: p.renderOptions,
|
|
1042
1504
|
readOnly: p.readonly,
|
|
1043
1505
|
id: p.id
|
|
1044
|
-
}) :
|
|
1506
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(SingleAutocomplete, {
|
|
1045
1507
|
options: (_p$options2 = p.options) != null ? _p$options2 : [],
|
|
1046
1508
|
control: p.control,
|
|
1047
1509
|
className: schemas.rendererClass(p.className, options.className),
|
|
@@ -1078,6 +1540,7 @@ function SingleAutocomplete(_ref) {
|
|
|
1078
1540
|
var _useAutocomplete = base.useAutocomplete(_extends({
|
|
1079
1541
|
freeSolo: true,
|
|
1080
1542
|
multiple: false,
|
|
1543
|
+
readOnly: readOnly,
|
|
1081
1544
|
value: selectedOptionControl.value,
|
|
1082
1545
|
inputValue: inputControl.value,
|
|
1083
1546
|
getOptionLabel: function getOptionLabel(v) {
|
|
@@ -1107,33 +1570,39 @@ function SingleAutocomplete(_ref) {
|
|
|
1107
1570
|
popupOpen = _useAutocomplete.popupOpen,
|
|
1108
1571
|
focused = _useAutocomplete.focused,
|
|
1109
1572
|
getPopupIndicatorProps = _useAutocomplete.getPopupIndicatorProps;
|
|
1110
|
-
return
|
|
1573
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", _extends({
|
|
1111
1574
|
id: id,
|
|
1112
1575
|
className: "relative"
|
|
1113
|
-
}, getRootProps()
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1576
|
+
}, getRootProps(), {
|
|
1577
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1578
|
+
className: clsx__default["default"](className, focused ? "border-primary-400 shadow-[0_0_0_3px_transparent] shadow-primary-200" : "shadow-[0_2px_2px_transparent] shadow-surface-50"),
|
|
1579
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("input", _extends({
|
|
1580
|
+
type: "text"
|
|
1581
|
+
}, getInputProps(), {
|
|
1582
|
+
placeholder: (_controlClasses$place = controlClasses == null ? void 0 : controlClasses.placeholder) != null ? _controlClasses$place : "",
|
|
1583
|
+
className: inputClass,
|
|
1584
|
+
readOnly: readOnly
|
|
1585
|
+
})), /*#__PURE__*/jsxRuntime.jsx("button", _extends({}, getPopupIndicatorProps(), {
|
|
1586
|
+
disabled: disabled || readOnly,
|
|
1587
|
+
className: "outline-0 shadow-none border-0 py-0 px-0.5 bg-transparent pr-[10px]",
|
|
1588
|
+
children: /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
1589
|
+
className: clsx__default["default"]("fa-solid fa-angle-down", "text-primary-500", popupOpen && "rotate-180")
|
|
1590
|
+
})
|
|
1591
|
+
}))]
|
|
1592
|
+
}), groupedOptions.length > 0 && popupOpen && /*#__PURE__*/jsxRuntime.jsx("ul", _extends({}, getListboxProps(), {
|
|
1593
|
+
className: listContainerClass,
|
|
1594
|
+
children: groupedOptions.map(function (option, index) {
|
|
1595
|
+
var optionProps = getOptionProps({
|
|
1596
|
+
option: option,
|
|
1597
|
+
index: index
|
|
1598
|
+
});
|
|
1599
|
+
return /*#__PURE__*/react.createElement("li", _extends({}, optionProps, {
|
|
1600
|
+
key: optionProps.key,
|
|
1601
|
+
className: listEntryClass
|
|
1602
|
+
}), option.name);
|
|
1603
|
+
})
|
|
1604
|
+
}))]
|
|
1605
|
+
}));
|
|
1137
1606
|
} finally {
|
|
1138
1607
|
_effect();
|
|
1139
1608
|
}
|
|
@@ -1169,6 +1638,7 @@ function MultipleAutocomplete(_ref3) {
|
|
|
1169
1638
|
value: (_selectedOptionsContr = selectedOptionsControl.value) != null ? _selectedOptionsContr : [],
|
|
1170
1639
|
inputValue: inputControl.value,
|
|
1171
1640
|
freeSolo: true,
|
|
1641
|
+
readOnly: readOnly,
|
|
1172
1642
|
multiple: true,
|
|
1173
1643
|
getOptionLabel: function getOptionLabel(v) {
|
|
1174
1644
|
return typeof v === "string" ? v : v.name;
|
|
@@ -1196,48 +1666,54 @@ function MultipleAutocomplete(_ref3) {
|
|
|
1196
1666
|
popupOpen = _useAutocomplete2.popupOpen,
|
|
1197
1667
|
focused = _useAutocomplete2.focused,
|
|
1198
1668
|
getPopupIndicatorProps = _useAutocomplete2.getPopupIndicatorProps;
|
|
1199
|
-
return
|
|
1669
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", _extends({
|
|
1200
1670
|
id: id,
|
|
1201
1671
|
className: "relative"
|
|
1202
|
-
}, getRootProps()
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1672
|
+
}, getRootProps(), {
|
|
1673
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1674
|
+
className: clsx__default["default"](className, focused ? "border-primary-400 shadow-[0_0_0_3px_transparent] shadow-primary-200" : "shadow-[0_2px_2px_transparent] shadow-surface-50"),
|
|
1675
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1676
|
+
className: "flex flex-1 flex-row flex-wrap",
|
|
1677
|
+
children: [(_selectedOptionsContr2 = selectedOptionsControl.value) == null ? void 0 : _selectedOptionsContr2.map(function (v) {
|
|
1678
|
+
return /*#__PURE__*/jsxRuntime.jsx(Chip, {
|
|
1679
|
+
text: typeof v === "string" ? v : v.name,
|
|
1680
|
+
chipContainerClass: chipContainerClass,
|
|
1681
|
+
chipCloseButtonClass: chipCloseButtonClass,
|
|
1682
|
+
onDeleteClick: readOnly || disabled ? undefined : function () {
|
|
1683
|
+
var c = selectedOptionsControl.elements.find(function (x) {
|
|
1684
|
+
return x.value == v;
|
|
1685
|
+
});
|
|
1686
|
+
if (c) core.removeElement(selectedOptionsControl, c);
|
|
1687
|
+
}
|
|
1688
|
+
}, typeof v === "string" ? v : v.name);
|
|
1689
|
+
}), /*#__PURE__*/jsxRuntime.jsx("input", _extends({
|
|
1690
|
+
type: "text"
|
|
1691
|
+
}, getInputProps(), {
|
|
1692
|
+
placeholder: (_controlClasses$place2 = controlClasses == null ? void 0 : controlClasses.placeholder) != null ? _controlClasses$place2 : "",
|
|
1693
|
+
className: clsx__default["default"](inputClass),
|
|
1694
|
+
readOnly: readOnly
|
|
1695
|
+
}))]
|
|
1696
|
+
}), /*#__PURE__*/jsxRuntime.jsx("button", _extends({}, getPopupIndicatorProps(), {
|
|
1697
|
+
disabled: disabled || readOnly,
|
|
1698
|
+
className: "outline-0 shadow-none border-0 py-0 px-0.5 bg-transparent pr-[10px]",
|
|
1699
|
+
children: /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
1700
|
+
className: clsx__default["default"]("fa-solid fa-angle-down", "text-primary-500", popupOpen && "rotate-180")
|
|
1701
|
+
})
|
|
1702
|
+
}))]
|
|
1703
|
+
}), groupedOptions.length > 0 && popupOpen && /*#__PURE__*/jsxRuntime.jsx("ul", _extends({}, getListboxProps(), {
|
|
1704
|
+
className: listContainerClass,
|
|
1705
|
+
children: groupedOptions.map(function (option, index) {
|
|
1706
|
+
var optionProps = getOptionProps({
|
|
1707
|
+
option: option,
|
|
1708
|
+
index: index
|
|
1215
1709
|
});
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
className: clsx__default["default"](inputClass)
|
|
1224
|
-
}))), React.createElement("button", _extends({}, getPopupIndicatorProps(), {
|
|
1225
|
-
disabled: disabled || readOnly,
|
|
1226
|
-
className: "outline-0 shadow-none border-0 py-0 px-0.5 bg-transparent pr-[10px]"
|
|
1227
|
-
}), React.createElement("i", {
|
|
1228
|
-
className: clsx__default["default"]("fa-solid fa-angle-down", "text-primary-500", popupOpen && "rotate-180")
|
|
1229
|
-
}))), groupedOptions.length > 0 && popupOpen && React.createElement("ul", _extends({}, getListboxProps(), {
|
|
1230
|
-
className: listContainerClass
|
|
1231
|
-
}), groupedOptions.map(function (option, index) {
|
|
1232
|
-
var optionProps = getOptionProps({
|
|
1233
|
-
option: option,
|
|
1234
|
-
index: index
|
|
1235
|
-
});
|
|
1236
|
-
return React.createElement("li", _extends({}, optionProps, {
|
|
1237
|
-
key: optionProps.key,
|
|
1238
|
-
className: listEntryClass
|
|
1239
|
-
}), option.name);
|
|
1240
|
-
})));
|
|
1710
|
+
return /*#__PURE__*/react.createElement("li", _extends({}, optionProps, {
|
|
1711
|
+
key: optionProps.key,
|
|
1712
|
+
className: listEntryClass
|
|
1713
|
+
}), option.name);
|
|
1714
|
+
})
|
|
1715
|
+
}))]
|
|
1716
|
+
}));
|
|
1241
1717
|
} finally {
|
|
1242
1718
|
_effect2();
|
|
1243
1719
|
}
|
|
@@ -1249,14 +1725,15 @@ function Chip(_ref5) {
|
|
|
1249
1725
|
chipContainerClass = _ref5.chipContainerClass,
|
|
1250
1726
|
chipCloseButtonClass = _ref5.chipCloseButtonClass,
|
|
1251
1727
|
onDeleteClick = _ref5.onDeleteClick;
|
|
1252
|
-
return
|
|
1253
|
-
className: chipContainerClass
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1728
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1729
|
+
className: chipContainerClass,
|
|
1730
|
+
children: [text, /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
1731
|
+
className: chipCloseButtonClass,
|
|
1732
|
+
onClick: function onClick() {
|
|
1733
|
+
onDeleteClick == null || onDeleteClick();
|
|
1734
|
+
}
|
|
1735
|
+
})]
|
|
1736
|
+
});
|
|
1260
1737
|
} finally {
|
|
1261
1738
|
_effect3();
|
|
1262
1739
|
}
|
|
@@ -1268,21 +1745,35 @@ var ValueForFieldExtension = {
|
|
|
1268
1745
|
value: RenderType,
|
|
1269
1746
|
name: "Value For Field",
|
|
1270
1747
|
fields: schemas.buildSchema({
|
|
1271
|
-
fieldRef: schemas.stringField("Field Reference")
|
|
1748
|
+
fieldRef: schemas.stringField("Field Reference"),
|
|
1749
|
+
noOptions: schemas.boolField("No Options"),
|
|
1750
|
+
refIsDirect: schemas.boolField("Reference is direct")
|
|
1272
1751
|
})
|
|
1273
1752
|
}
|
|
1274
1753
|
};
|
|
1275
1754
|
function createValueForFieldRenderer(options) {
|
|
1276
1755
|
return schemas.createDataRenderer(function (o, renderer) {
|
|
1277
1756
|
var _schemaDataForFieldRe;
|
|
1278
|
-
var
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1757
|
+
var _o$renderOptions = o.renderOptions,
|
|
1758
|
+
fieldRef = _o$renderOptions.fieldRef,
|
|
1759
|
+
noOptions = _o$renderOptions.noOptions,
|
|
1760
|
+
refIsDirect = _o$renderOptions.refIsDirect;
|
|
1761
|
+
var actualFieldRef = fieldRef ? refIsDirect ? fieldRef : (_schemaDataForFieldRe = schemas.schemaDataForFieldRef(fieldRef, o.dataContext.parentNode)) == null || (_schemaDataForFieldRe = _schemaDataForFieldRe.control) == null ? void 0 : _schemaDataForFieldRe.value : ".";
|
|
1762
|
+
var schemaField;
|
|
1763
|
+
if (refIsDirect) {
|
|
1764
|
+
var dataNode = schemas.schemaDataForFieldRef(actualFieldRef, o.dataContext.parentNode);
|
|
1765
|
+
schemaField = core.trackedValue(dataNode.control.as());
|
|
1766
|
+
} else {
|
|
1767
|
+
schemaField = actualFieldRef ? schemas.schemaForFieldRef(actualFieldRef, options.schema).field : undefined;
|
|
1768
|
+
}
|
|
1769
|
+
return schemaField ? /*#__PURE__*/jsxRuntime.jsx(ValueForField, {
|
|
1282
1770
|
renderer: renderer,
|
|
1283
|
-
|
|
1284
|
-
control: o.control
|
|
1285
|
-
|
|
1771
|
+
schemaField: schemaField,
|
|
1772
|
+
control: o.control,
|
|
1773
|
+
noOptions: noOptions
|
|
1774
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1775
|
+
children: actualFieldRef ? "No schema node for " + actualFieldRef : ""
|
|
1776
|
+
});
|
|
1286
1777
|
}, {
|
|
1287
1778
|
renderType: RenderType
|
|
1288
1779
|
});
|
|
@@ -1290,9 +1781,10 @@ function createValueForFieldRenderer(options) {
|
|
|
1290
1781
|
function ValueForField(_ref) {
|
|
1291
1782
|
var _effect = core.useComponentTracking();
|
|
1292
1783
|
try {
|
|
1293
|
-
var
|
|
1784
|
+
var schemaField = _ref.schemaField,
|
|
1294
1785
|
renderer = _ref.renderer,
|
|
1295
|
-
control = _ref.control
|
|
1786
|
+
control = _ref.control,
|
|
1787
|
+
noOptions = _ref.noOptions;
|
|
1296
1788
|
var value = core.useControl({
|
|
1297
1789
|
"default": undefined
|
|
1298
1790
|
}, undefined, function (e) {
|
|
@@ -1300,22 +1792,28 @@ function ValueForField(_ref) {
|
|
|
1300
1792
|
"default": control
|
|
1301
1793
|
});
|
|
1302
1794
|
});
|
|
1303
|
-
var _useMemo =
|
|
1304
|
-
var
|
|
1795
|
+
var _useMemo = react.useMemo(function () {
|
|
1796
|
+
var adjustedField = _extends({}, schemaField, {
|
|
1797
|
+
collection: noOptions ? false : schemaField.collection,
|
|
1798
|
+
options: noOptions ? undefined : schemaField.options,
|
|
1305
1799
|
field: "default",
|
|
1306
1800
|
required: false,
|
|
1307
1801
|
notNullable: false,
|
|
1308
1802
|
onlyForTypes: null,
|
|
1309
1803
|
defaultValue: undefined
|
|
1310
|
-
})
|
|
1311
|
-
|
|
1312
|
-
|
|
1804
|
+
});
|
|
1805
|
+
var control = _extends({}, schemas.defaultControlForField(adjustedField), {
|
|
1806
|
+
hideTitle: true
|
|
1807
|
+
});
|
|
1808
|
+
var rootSchema = schemas.createSchemaTree([adjustedField]).rootNode;
|
|
1809
|
+
return [control, rootSchema];
|
|
1810
|
+
}, [schemaField]),
|
|
1313
1811
|
controls = _useMemo[0],
|
|
1314
1812
|
rootSchema = _useMemo[1];
|
|
1315
|
-
var Render = schemas.useControlRendererComponent(
|
|
1813
|
+
var Render = schemas.useControlRendererComponent(controls, renderer, {
|
|
1316
1814
|
disabled: control.disabled
|
|
1317
1815
|
}, schemas.makeSchemaDataNode(rootSchema, value));
|
|
1318
|
-
return
|
|
1816
|
+
return /*#__PURE__*/jsxRuntime.jsx(Render, {});
|
|
1319
1817
|
} finally {
|
|
1320
1818
|
_effect();
|
|
1321
1819
|
}
|
|
@@ -1339,7 +1837,7 @@ function createOptionalAdornment(options) {
|
|
|
1339
1837
|
apply: function apply(rl) {
|
|
1340
1838
|
var _ref, _adornment$placement;
|
|
1341
1839
|
if (props.formOptions.readonly) return rl;
|
|
1342
|
-
if (!options.hideEdit && adornment.editSelectable) schemas.appendMarkupAt((_ref = (_adornment$placement = adornment.placement) != null ? _adornment$placement : options.defaultPlacement) != null ? _ref : schemas.AdornmentPlacement.LabelStart,
|
|
1840
|
+
if (!options.hideEdit && adornment.editSelectable) schemas.appendMarkupAt((_ref = (_adornment$placement = adornment.placement) != null ? _adornment$placement : options.defaultPlacement) != null ? _ref : schemas.AdornmentPlacement.LabelStart, /*#__PURE__*/jsxRuntime.jsx(core.Fcheckbox, {
|
|
1343
1841
|
control: editing,
|
|
1344
1842
|
className: options.checkClass
|
|
1345
1843
|
}))(rl);
|
|
@@ -1352,7 +1850,7 @@ function createOptionalAdornment(options) {
|
|
|
1352
1850
|
nullToggler: nullToggler,
|
|
1353
1851
|
dataContext: dataContext,
|
|
1354
1852
|
options: options
|
|
1355
|
-
}) :
|
|
1853
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(OptionalEditRenderer, {
|
|
1356
1854
|
children: children,
|
|
1357
1855
|
options: options,
|
|
1358
1856
|
editing: editing.as(),
|
|
@@ -1380,20 +1878,26 @@ function OptionalEditRenderer(_ref2) {
|
|
|
1380
1878
|
var nullToggler = schemas.getNullToggler(dataControl);
|
|
1381
1879
|
var allValues = schemas.getAllValues(dataControl);
|
|
1382
1880
|
var multipleValues = allValues.value.length > 1;
|
|
1383
|
-
var nullEdit = adornment.allowNull ?
|
|
1384
|
-
className: options.nullWrapperClass
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
}
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1881
|
+
var nullEdit = adornment.allowNull ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1882
|
+
className: options.nullWrapperClass,
|
|
1883
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(core.Fcheckbox, {
|
|
1884
|
+
control: nullToggler,
|
|
1885
|
+
className: options.checkClass,
|
|
1886
|
+
notValue: true
|
|
1887
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
1888
|
+
children: (_options$setNullText = options.setNullText) != null ? _options$setNullText : "Null"
|
|
1889
|
+
})]
|
|
1890
|
+
}) : undefined;
|
|
1891
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1892
|
+
className: options.className,
|
|
1893
|
+
children: multipleValues && editing.value === false ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1894
|
+
className: options.multiValuesClass,
|
|
1895
|
+
children: (_options$multiValuesT = options.multiValuesText) != null ? _options$multiValuesT : "Differing values"
|
|
1896
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1897
|
+
className: options.childWrapperClass,
|
|
1898
|
+
children: [nullEdit, children]
|
|
1899
|
+
})
|
|
1900
|
+
});
|
|
1397
1901
|
} finally {
|
|
1398
1902
|
_effect();
|
|
1399
1903
|
}
|
|
@@ -1401,7 +1905,7 @@ function OptionalEditRenderer(_ref2) {
|
|
|
1401
1905
|
|
|
1402
1906
|
function createMultilineFieldRenderer(className) {
|
|
1403
1907
|
return schemas.createDataRenderer(function (p) {
|
|
1404
|
-
return
|
|
1908
|
+
return /*#__PURE__*/jsxRuntime.jsx(MultilineTextfield, _extends({}, p, {
|
|
1405
1909
|
className: schemas.rendererClass(p.className, className)
|
|
1406
1910
|
}));
|
|
1407
1911
|
});
|
|
@@ -1411,7 +1915,7 @@ function MultilineTextfield(_ref) {
|
|
|
1411
1915
|
try {
|
|
1412
1916
|
var control = _ref.control,
|
|
1413
1917
|
className = _ref.className;
|
|
1414
|
-
var codeRef =
|
|
1918
|
+
var codeRef = react.useRef(null);
|
|
1415
1919
|
core.useControlEffect(function () {
|
|
1416
1920
|
return control.value;
|
|
1417
1921
|
}, function (v) {
|
|
@@ -1420,7 +1924,7 @@ function MultilineTextfield(_ref) {
|
|
|
1420
1924
|
c.textContent = v;
|
|
1421
1925
|
}
|
|
1422
1926
|
}, true);
|
|
1423
|
-
return
|
|
1927
|
+
return /*#__PURE__*/jsxRuntime.jsx("code", {
|
|
1424
1928
|
contentEditable: !control.disabled,
|
|
1425
1929
|
className: className,
|
|
1426
1930
|
onInput: function onInput(t) {
|
|
@@ -1438,7 +1942,7 @@ function createArrayElementRenderer(options) {
|
|
|
1438
1942
|
options = {};
|
|
1439
1943
|
}
|
|
1440
1944
|
return schemas.createDataRenderer(function (props, formRenderer) {
|
|
1441
|
-
return
|
|
1945
|
+
return /*#__PURE__*/jsxRuntime.jsx(ArrayElementRenderer, {
|
|
1442
1946
|
dataProps: props,
|
|
1443
1947
|
options: options,
|
|
1444
1948
|
formRenderer: formRenderer,
|
|
@@ -1484,32 +1988,36 @@ function ArrayElementRenderer(_ref) {
|
|
|
1484
1988
|
});
|
|
1485
1989
|
};
|
|
1486
1990
|
var parentDataNode = schemas.makeSchemaDataNode(dataProps.dataNode.schema, extData.fields.data);
|
|
1487
|
-
var elementGroup = formNode.
|
|
1991
|
+
var elementGroup = formNode.createChildNode("group", {
|
|
1488
1992
|
type: schemas.ControlDefinitionType.Group,
|
|
1489
1993
|
groupOptions: {
|
|
1490
1994
|
type: schemas.GroupRenderType.Standard,
|
|
1491
1995
|
hideTitle: true
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1996
|
+
},
|
|
1997
|
+
children: formNode.getResolvedChildren()
|
|
1998
|
+
});
|
|
1999
|
+
var editContent = /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2000
|
+
className: schemas.rendererClass(dataProps.className, options.className),
|
|
2001
|
+
children: [renderChild("", elementGroup, {
|
|
2002
|
+
parentDataNode: parentDataNode
|
|
2003
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2004
|
+
className: options.actionsClass,
|
|
2005
|
+
children: /*#__PURE__*/jsxRuntime.jsx(core.RenderElements, {
|
|
2006
|
+
control: extData.fields.actions,
|
|
2007
|
+
children: function children(c) {
|
|
2008
|
+
return formRenderer.renderAction(applyValidation(c.value));
|
|
2009
|
+
}
|
|
2010
|
+
})
|
|
2011
|
+
})]
|
|
2012
|
+
});
|
|
1506
2013
|
if (renderOptions.showInline || designMode) return editContent;
|
|
1507
|
-
return
|
|
1508
|
-
state: overlayState
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
2014
|
+
return /*#__PURE__*/jsxRuntime.jsx(ariaBase.Modal, {
|
|
2015
|
+
state: overlayState,
|
|
2016
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ariaBase.Dialog, {
|
|
2017
|
+
children: editContent
|
|
2018
|
+
})
|
|
2019
|
+
});
|
|
2020
|
+
} else return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
1513
2021
|
} finally {
|
|
1514
2022
|
_effect();
|
|
1515
2023
|
}
|
|
@@ -1519,24 +2027,61 @@ function createButtonActionRenderer(actionId, options) {
|
|
|
1519
2027
|
if (options === void 0) {
|
|
1520
2028
|
options = {};
|
|
1521
2029
|
}
|
|
1522
|
-
return schemas.createActionRenderer(actionId, function (
|
|
1523
|
-
var _options$renderConten;
|
|
1524
|
-
var
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
2030
|
+
return schemas.createActionRenderer(actionId, function (props, renderer) {
|
|
2031
|
+
var _props$icon, _ref, _props$iconPlacement, _options$renderConten;
|
|
2032
|
+
var key = props.key,
|
|
2033
|
+
onClick = props.onClick,
|
|
2034
|
+
actionText = props.actionText,
|
|
2035
|
+
className = props.className,
|
|
2036
|
+
style = props.style,
|
|
2037
|
+
actionId = props.actionId,
|
|
2038
|
+
actionData = props.actionData,
|
|
2039
|
+
disabled = props.disabled,
|
|
2040
|
+
textClass = props.textClass,
|
|
2041
|
+
actionStyle = props.actionStyle,
|
|
2042
|
+
inline = props.inline,
|
|
2043
|
+
actionContent = props.actionContent;
|
|
2044
|
+
var icon = (_props$icon = props.icon) != null && _props$icon.name ? props.icon : options.icon;
|
|
2045
|
+
var iconPlacement = (_ref = (_props$iconPlacement = props.iconPlacement) != null ? _props$iconPlacement : options.iconPlacement) != null ? _ref : schemas.IconPlacement.BeforeText;
|
|
2046
|
+
var _renderer$html = renderer.html,
|
|
2047
|
+
Button = _renderer$html.Button,
|
|
2048
|
+
I = _renderer$html.I,
|
|
2049
|
+
Span = _renderer$html.Span;
|
|
2050
|
+
var isLink = actionStyle == schemas.ActionStyle.Link;
|
|
2051
|
+
var isGroup = actionStyle == schemas.ActionStyle.Group;
|
|
2052
|
+
var classNames = schemas.rendererClass(className, isLink ? options.linkClass : isGroup ? options.groupClass : schemas.rendererClass(options.buttonClass, actionStyle == schemas.ActionStyle.Secondary ? options.secondaryClass : options.primaryClass));
|
|
2053
|
+
var iconElement = icon && /*#__PURE__*/jsxRuntime.jsx(I, {
|
|
2054
|
+
iconName: icon.name,
|
|
2055
|
+
iconLibrary: icon.library,
|
|
2056
|
+
className: iconPlacement == schemas.IconPlacement.BeforeText ? options.iconBeforeClass : options.iconAfterClass
|
|
2057
|
+
});
|
|
2058
|
+
var textClassNames = schemas.rendererClass(textClass, isLink ? options.linkTextClass : schemas.rendererClass(options.textClass, actionStyle == schemas.ActionStyle.Secondary ? options.secondaryTextClass : options.primaryTextClass));
|
|
2059
|
+
var textElement = actionContent != null ? actionContent : actionText && /*#__PURE__*/jsxRuntime.jsx(Span, {
|
|
2060
|
+
className: textClassNames,
|
|
2061
|
+
children: actionText
|
|
2062
|
+
});
|
|
2063
|
+
return /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2064
|
+
className: classNames,
|
|
2065
|
+
textClass: textClassNames,
|
|
1534
2066
|
disabled: disabled,
|
|
1535
2067
|
style: style,
|
|
1536
|
-
onClick: onClick
|
|
1537
|
-
|
|
2068
|
+
onClick: onClick,
|
|
2069
|
+
inline: inline,
|
|
2070
|
+
nonTextContent: isGroup,
|
|
2071
|
+
title: iconPlacement == schemas.IconPlacement.ReplaceText ? actionText : undefined,
|
|
2072
|
+
notWrapInText: options.notWrapInText,
|
|
2073
|
+
androidRippleColor: options.androidRippleColor,
|
|
2074
|
+
children: (_options$renderConten = options.renderContent == null ? void 0 : options.renderContent(actionText, actionId, actionData)) != null ? _options$renderConten : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2075
|
+
children: [iconPlacement == schemas.IconPlacement.BeforeText && iconElement, iconPlacement != schemas.IconPlacement.ReplaceText && textElement, iconPlacement != schemas.IconPlacement.BeforeText && iconElement]
|
|
2076
|
+
})
|
|
2077
|
+
}, key);
|
|
1538
2078
|
});
|
|
1539
2079
|
}
|
|
2080
|
+
|
|
2081
|
+
var _excluded = ["inline", "textClass", "className", "notWrapInText", "androidRippleColor", "onClick", "nonTextContent"],
|
|
2082
|
+
_excluded2 = ["textClass", "className", "onChangeValue", "onChangeChecked", "inputRef"],
|
|
2083
|
+
_excluded3 = ["text", "html", "children", "className", "textClass", "nativeRef", "inline"],
|
|
2084
|
+
_excluded4 = ["textClass", "className"];
|
|
1540
2085
|
var DefaultBoolOptions = [{
|
|
1541
2086
|
name: "Yes",
|
|
1542
2087
|
value: true
|
|
@@ -1545,15 +2090,15 @@ var DefaultBoolOptions = [{
|
|
|
1545
2090
|
value: false
|
|
1546
2091
|
}];
|
|
1547
2092
|
function createDefaultDataRenderer(options) {
|
|
1548
|
-
var _options$
|
|
2093
|
+
var _options$checkboxOpti, _options$checkboxOpti2, _options$radioOptions, _options$checkListOpt;
|
|
1549
2094
|
if (options === void 0) {
|
|
1550
2095
|
options = {};
|
|
1551
2096
|
}
|
|
1552
|
-
var
|
|
2097
|
+
var elementSelectedRenderer = createElementSelectedRenderer((_options$checkboxOpti = options.checkboxOptions) != null ? _options$checkboxOpti : options.checkOptions);
|
|
1553
2098
|
var jsonataRenderer = createJsonataRenderer(options.jsonataClass);
|
|
1554
2099
|
var nullToggler = createNullToggleRenderer();
|
|
1555
2100
|
var multilineRenderer = createMultilineFieldRenderer(options.multilineClass);
|
|
1556
|
-
var checkboxRenderer = createCheckboxRenderer((_options$
|
|
2101
|
+
var checkboxRenderer = createCheckboxRenderer((_options$checkboxOpti2 = options.checkboxOptions) != null ? _options$checkboxOpti2 : options.checkOptions);
|
|
1557
2102
|
var selectRenderer = createSelectRenderer(options.selectOptions);
|
|
1558
2103
|
var radioRenderer = createRadioRenderer((_options$radioOptions = options.radioOptions) != null ? _options$radioOptions : options.checkOptions);
|
|
1559
2104
|
var checkListRenderer = createCheckListRenderer((_options$checkListOpt = options.checkListOptions) != null ? _options$checkListOpt : options.checkOptions);
|
|
@@ -1563,6 +2108,7 @@ function createDefaultDataRenderer(options) {
|
|
|
1563
2108
|
booleanOptions: DefaultBoolOptions
|
|
1564
2109
|
}, options),
|
|
1565
2110
|
inputClass = _optionRenderer$boole.inputClass,
|
|
2111
|
+
inputTextClass = _optionRenderer$boole.inputTextClass,
|
|
1566
2112
|
booleanOptions = _optionRenderer$boole.booleanOptions,
|
|
1567
2113
|
optionRenderer = _optionRenderer$boole.optionRenderer,
|
|
1568
2114
|
displayOnlyClass = _optionRenderer$boole.displayOnlyClass,
|
|
@@ -1574,13 +2120,13 @@ function createDefaultDataRenderer(options) {
|
|
|
1574
2120
|
var fieldType = field.type;
|
|
1575
2121
|
var renderOptions = props.renderOptions;
|
|
1576
2122
|
var renderType = renderOptions.type;
|
|
1577
|
-
if (field.collection && props.elementIndex == null && (renderType == schemas.DataRenderType.Standard || renderType == schemas.DataRenderType.Array || renderType == schemas.DataRenderType.ArrayElement)) {
|
|
2123
|
+
if (field.collection && props.dataNode.elementIndex == null && (renderType == schemas.DataRenderType.Standard || renderType == schemas.DataRenderType.Array || renderType == schemas.DataRenderType.ArrayElement)) {
|
|
1578
2124
|
if (renderType == schemas.DataRenderType.ArrayElement) return arrayElementRenderer.render(props, renderers);
|
|
1579
2125
|
return arrayRenderer.render(props, renderers);
|
|
1580
2126
|
}
|
|
1581
2127
|
if (fieldType === schemas.FieldType.Compound) {
|
|
1582
|
-
var
|
|
1583
|
-
var groupOptions = (
|
|
2128
|
+
var _ref;
|
|
2129
|
+
var groupOptions = (_ref = schemas.isDataGroupRenderer(renderOptions) ? renderOptions.groupOptions : undefined) != null ? _ref : {
|
|
1584
2130
|
type: "Standard",
|
|
1585
2131
|
hideTitle: true
|
|
1586
2132
|
};
|
|
@@ -1591,12 +2137,13 @@ function createDefaultDataRenderer(options) {
|
|
|
1591
2137
|
if (props.displayOnly || schemas.isDisplayOnlyRenderer(renderOptions)) return function (p) {
|
|
1592
2138
|
return _extends({}, p, {
|
|
1593
2139
|
className: "@ " + schemas.rendererClass(p.className, displayOnlyClass),
|
|
1594
|
-
children:
|
|
1595
|
-
|
|
2140
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DefaultDisplayOnly, {
|
|
2141
|
+
dataNode: props.dataNode,
|
|
1596
2142
|
schemaInterface: props.dataContext.schemaInterface,
|
|
1597
|
-
control: props.control,
|
|
1598
2143
|
className: props.className,
|
|
2144
|
+
textClass: props.textClass,
|
|
1599
2145
|
style: props.style,
|
|
2146
|
+
inline: props.inline,
|
|
1600
2147
|
renderer: renderers,
|
|
1601
2148
|
emptyText: schemas.isDisplayOnlyRenderer(renderOptions) && renderOptions.emptyText ? renderOptions.emptyText : defaultEmptyText
|
|
1602
2149
|
})
|
|
@@ -1626,15 +2173,20 @@ function createDefaultDataRenderer(options) {
|
|
|
1626
2173
|
return jsonataRenderer.render(props, renderers);
|
|
1627
2174
|
case schemas.DataRenderType.Autocomplete:
|
|
1628
2175
|
return autocompleteRenderer.render(props, renderers);
|
|
2176
|
+
case schemas.DataRenderType.ElementSelected:
|
|
2177
|
+
return elementSelectedRenderer.render(props, renderers);
|
|
1629
2178
|
}
|
|
1630
2179
|
if (fieldType == schemas.FieldType.Any) {
|
|
1631
2180
|
var _field$displayName;
|
|
1632
|
-
return
|
|
2181
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2182
|
+
children: ["Can't render field: ", (_field$displayName = field.displayName) != null ? _field$displayName : field.field, " (", renderType, ")"]
|
|
2183
|
+
});
|
|
1633
2184
|
}
|
|
1634
2185
|
if (schemas.isTextfieldRenderer(renderOptions) && renderOptions.multiline) return multilineRenderer.render(props, renderers);
|
|
1635
2186
|
var placeholder = schemas.isTextfieldRenderer(renderOptions) ? renderOptions.placeholder : undefined;
|
|
1636
|
-
return
|
|
2187
|
+
return /*#__PURE__*/jsxRuntime.jsx(ControlInput, {
|
|
1637
2188
|
className: schemas.rendererClass(props.className, inputClass),
|
|
2189
|
+
textClass: schemas.rendererClass(props.textClass, inputTextClass),
|
|
1638
2190
|
style: props.style,
|
|
1639
2191
|
id: props.id,
|
|
1640
2192
|
readOnly: props.readonly,
|
|
@@ -1659,53 +2211,33 @@ function createDefaultAdornmentRenderer(options) {
|
|
|
1659
2211
|
var adornment = props.adornment,
|
|
1660
2212
|
designMode = props.designMode,
|
|
1661
2213
|
dataContext = props.dataContext,
|
|
1662
|
-
|
|
2214
|
+
runExpression = props.runExpression;
|
|
1663
2215
|
return {
|
|
1664
2216
|
apply: function apply(rl) {
|
|
1665
|
-
if (schemas.isSetFieldAdornment(adornment) &&
|
|
1666
|
-
var setFieldWrapper = function setFieldWrapper(_ref3) {
|
|
1667
|
-
var children = _ref3.children,
|
|
1668
|
-
adornment = _ref3.adornment,
|
|
1669
|
-
parentContext = _ref3.parentContext;
|
|
1670
|
-
var _dynamicHooks = dynamicHooks(parentContext),
|
|
1671
|
-
value = _dynamicHooks.value;
|
|
1672
|
-
var fieldNode = schemas.schemaDataForFieldRef(adornment.field, parentContext.parentNode);
|
|
1673
|
-
var otherField = fieldNode.control;
|
|
1674
|
-
var always = !adornment.defaultOnly;
|
|
1675
|
-
core.useControlEffect(function () {
|
|
1676
|
-
return [value == null ? void 0 : value.value, (otherField == null ? void 0 : otherField.value) == null];
|
|
1677
|
-
}, function (_ref4) {
|
|
1678
|
-
var v = _ref4[0];
|
|
1679
|
-
otherField == null || otherField.setValue(function (x) {
|
|
1680
|
-
return always || x == null ? v : x;
|
|
1681
|
-
});
|
|
1682
|
-
}, true);
|
|
1683
|
-
return children;
|
|
1684
|
-
};
|
|
1685
|
-
var hook = useExpr(adornment.expression, function (x) {
|
|
1686
|
-
return x;
|
|
1687
|
-
});
|
|
1688
|
-
var dynamicHooks = schemas.useDynamicHooks({
|
|
1689
|
-
value: hook
|
|
1690
|
-
});
|
|
1691
|
-
var SetFieldWrapper = core.useTrackedComponent(setFieldWrapper, [dynamicHooks]);
|
|
2217
|
+
if (schemas.isSetFieldAdornment(adornment) && runExpression) {
|
|
1692
2218
|
return schemas.wrapLayout(function (x) {
|
|
1693
|
-
return
|
|
2219
|
+
return /*#__PURE__*/jsxRuntime.jsx(SetFieldWrapper, {
|
|
1694
2220
|
children: x,
|
|
1695
2221
|
parentContext: dataContext,
|
|
1696
|
-
adornment: adornment
|
|
2222
|
+
adornment: adornment,
|
|
2223
|
+
runExpression: runExpression
|
|
1697
2224
|
});
|
|
1698
2225
|
})(rl);
|
|
1699
2226
|
}
|
|
1700
2227
|
if (schemas.isIconAdornment(adornment)) {
|
|
1701
|
-
var
|
|
1702
|
-
|
|
1703
|
-
|
|
2228
|
+
var I = renderers.html.I;
|
|
2229
|
+
var icon = adornment.icon,
|
|
2230
|
+
placement = adornment.placement,
|
|
2231
|
+
iconClass = adornment.iconClass;
|
|
2232
|
+
return schemas.appendMarkupAt(placement != null ? placement : schemas.AdornmentPlacement.ControlStart, /*#__PURE__*/jsxRuntime.jsx(I, {
|
|
2233
|
+
className: iconClass,
|
|
2234
|
+
iconName: icon == null ? void 0 : icon.name,
|
|
2235
|
+
iconLibrary: icon == null ? void 0 : icon.library
|
|
1704
2236
|
}))(rl);
|
|
1705
2237
|
}
|
|
1706
2238
|
if (schemas.isAccordionAdornment(adornment)) {
|
|
1707
2239
|
return schemas.wrapLayout(function (x) {
|
|
1708
|
-
return
|
|
2240
|
+
return /*#__PURE__*/jsxRuntime.jsx(DefaultAccordion, _extends({
|
|
1709
2241
|
renderers: renderers,
|
|
1710
2242
|
children: x,
|
|
1711
2243
|
accordion: adornment,
|
|
@@ -1723,6 +2255,27 @@ function createDefaultAdornmentRenderer(options) {
|
|
|
1723
2255
|
}
|
|
1724
2256
|
};
|
|
1725
2257
|
}
|
|
2258
|
+
function SetFieldWrapper(_ref2) {
|
|
2259
|
+
var children = _ref2.children,
|
|
2260
|
+
adornment = _ref2.adornment,
|
|
2261
|
+
parentContext = _ref2.parentContext,
|
|
2262
|
+
runExpression = _ref2.runExpression;
|
|
2263
|
+
var fieldNode = schemas.schemaDataForFieldRef(adornment.field, parentContext.parentNode);
|
|
2264
|
+
var otherField = fieldNode.control;
|
|
2265
|
+
var always = !adornment.defaultOnly;
|
|
2266
|
+
var value = schemas.useExpression(undefined, runExpression, adornment.expression, function (x) {
|
|
2267
|
+
return x;
|
|
2268
|
+
});
|
|
2269
|
+
core.useControlEffect(function () {
|
|
2270
|
+
return [value == null ? void 0 : value.value, (otherField == null ? void 0 : otherField.value) == null];
|
|
2271
|
+
}, function (_ref3) {
|
|
2272
|
+
var v = _ref3[0];
|
|
2273
|
+
otherField == null || otherField.setValue(function (x) {
|
|
2274
|
+
return always || x == null ? v : x;
|
|
2275
|
+
});
|
|
2276
|
+
}, true);
|
|
2277
|
+
return children;
|
|
2278
|
+
}
|
|
1726
2279
|
function createDefaultLabelRenderer(options) {
|
|
1727
2280
|
var _labelContainer$optio = _extends({
|
|
1728
2281
|
labelContainer: function labelContainer(c) {
|
|
@@ -1730,27 +2283,159 @@ function createDefaultLabelRenderer(options) {
|
|
|
1730
2283
|
}
|
|
1731
2284
|
}, options),
|
|
1732
2285
|
className = _labelContainer$optio.className,
|
|
2286
|
+
controlLabelTextClass = _labelContainer$optio.controlLabelTextClass,
|
|
2287
|
+
groupLabelTextClass = _labelContainer$optio.groupLabelTextClass,
|
|
1733
2288
|
groupLabelClass = _labelContainer$optio.groupLabelClass,
|
|
1734
2289
|
controlLabelClass = _labelContainer$optio.controlLabelClass,
|
|
2290
|
+
textClass = _labelContainer$optio.textClass,
|
|
1735
2291
|
labelContainer = _labelContainer$optio.labelContainer;
|
|
1736
2292
|
return {
|
|
1737
2293
|
render: function render(props, labelStart, labelEnd, renderers) {
|
|
1738
2294
|
var _options$requiredElem;
|
|
1739
|
-
var
|
|
1740
|
-
|
|
1741
|
-
|
|
2295
|
+
var _renderers$html = renderers.html,
|
|
2296
|
+
Label = _renderers$html.Label,
|
|
2297
|
+
Span = _renderers$html.Span;
|
|
2298
|
+
var requiredElement = (_options$requiredElem = options == null ? void 0 : options.requiredElement) != null ? _options$requiredElem : function (_ref4) {
|
|
2299
|
+
var Span = _ref4.Span;
|
|
2300
|
+
return /*#__PURE__*/jsxRuntime.jsx(Span, {
|
|
2301
|
+
children: " *"
|
|
2302
|
+
});
|
|
1742
2303
|
};
|
|
1743
|
-
if (props.type == schemas.LabelType.Text) return
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
2304
|
+
if (props.type == schemas.LabelType.Text) return /*#__PURE__*/jsxRuntime.jsx(Span, {
|
|
2305
|
+
children: props.label
|
|
2306
|
+
});
|
|
2307
|
+
return labelContainer(/*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2308
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(Label, {
|
|
2309
|
+
htmlFor: props.forId,
|
|
2310
|
+
className: schemas.rendererClass(props.className, clsx__default["default"](className, props.type === schemas.LabelType.Group && groupLabelClass, props.type === schemas.LabelType.Control && controlLabelClass)),
|
|
2311
|
+
textClass: schemas.rendererClass(props.textClass, clsx__default["default"](textClass, props.type === schemas.LabelType.Group && groupLabelTextClass, props.type === schemas.LabelType.Control && controlLabelTextClass)),
|
|
2312
|
+
children: [labelStart, renderers.renderLabelText(props.label), props.required && requiredElement(renderers.html)]
|
|
2313
|
+
}), labelEnd]
|
|
2314
|
+
}));
|
|
1748
2315
|
},
|
|
1749
2316
|
type: "label"
|
|
1750
2317
|
};
|
|
1751
2318
|
}
|
|
2319
|
+
var StandardHtmlComponents = {
|
|
2320
|
+
Button: DefaultHtmlButtonRenderer,
|
|
2321
|
+
Label: DefaultHtmlLabelRenderer,
|
|
2322
|
+
I: DefaultHtmlIconRenderer,
|
|
2323
|
+
Span: "span",
|
|
2324
|
+
Div: DefaultHtmlDivRenderer,
|
|
2325
|
+
H1: "h1",
|
|
2326
|
+
B: "b",
|
|
2327
|
+
Input: DefaultHtmlInputRenderer
|
|
2328
|
+
};
|
|
2329
|
+
function DefaultHtmlButtonRenderer(_ref5) {
|
|
2330
|
+
var _effect = core.useComponentTracking();
|
|
2331
|
+
try {
|
|
2332
|
+
var inline = _ref5.inline,
|
|
2333
|
+
textClass = _ref5.textClass,
|
|
2334
|
+
className = _ref5.className,
|
|
2335
|
+
notWrapInText = _ref5.notWrapInText,
|
|
2336
|
+
androidRippleColor = _ref5.androidRippleColor,
|
|
2337
|
+
onClick = _ref5.onClick,
|
|
2338
|
+
nonTextContent = _ref5.nonTextContent,
|
|
2339
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded);
|
|
2340
|
+
var Comp = nonTextContent ? "div" : "button";
|
|
2341
|
+
return /*#__PURE__*/jsxRuntime.jsx(Comp, _extends({
|
|
2342
|
+
role: nonTextContent ? "button" : undefined,
|
|
2343
|
+
onClick: onClick ? function (e) {
|
|
2344
|
+
e.stopPropagation();
|
|
2345
|
+
onClick();
|
|
2346
|
+
} : undefined,
|
|
2347
|
+
className: nonTextContent ? className : clsx__default["default"](className, textClass)
|
|
2348
|
+
}, props));
|
|
2349
|
+
} finally {
|
|
2350
|
+
_effect();
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
function DefaultHtmlInputRenderer(_ref6) {
|
|
2354
|
+
var _effect2 = core.useComponentTracking();
|
|
2355
|
+
try {
|
|
2356
|
+
var textClass = _ref6.textClass,
|
|
2357
|
+
className = _ref6.className,
|
|
2358
|
+
onChangeValue = _ref6.onChangeValue,
|
|
2359
|
+
onChangeChecked = _ref6.onChangeChecked,
|
|
2360
|
+
inputRef = _ref6.inputRef,
|
|
2361
|
+
props = _objectWithoutPropertiesLoose(_ref6, _excluded2);
|
|
2362
|
+
return /*#__PURE__*/jsxRuntime.jsx("input", _extends({
|
|
2363
|
+
ref: inputRef
|
|
2364
|
+
}, props, {
|
|
2365
|
+
className: clsx__default["default"](className, textClass),
|
|
2366
|
+
onChange: onChangeValue ? function (e) {
|
|
2367
|
+
return onChangeValue(e.target.value);
|
|
2368
|
+
} : onChangeChecked ? function (e) {
|
|
2369
|
+
return onChangeChecked(e.target.checked);
|
|
2370
|
+
} : undefined
|
|
2371
|
+
}));
|
|
2372
|
+
} finally {
|
|
2373
|
+
_effect2();
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
function DefaultHtmlDivRenderer(_ref7) {
|
|
2377
|
+
var _effect3 = core.useComponentTracking();
|
|
2378
|
+
try {
|
|
2379
|
+
var text = _ref7.text,
|
|
2380
|
+
html = _ref7.html,
|
|
2381
|
+
children = _ref7.children,
|
|
2382
|
+
className = _ref7.className,
|
|
2383
|
+
textClass = _ref7.textClass,
|
|
2384
|
+
nativeRef = _ref7.nativeRef,
|
|
2385
|
+
inline = _ref7.inline,
|
|
2386
|
+
props = _objectWithoutPropertiesLoose(_ref7, _excluded3);
|
|
2387
|
+
var Tag = inline ? "span" : "div";
|
|
2388
|
+
return /*#__PURE__*/jsxRuntime.jsx(Tag, _extends({}, props, {
|
|
2389
|
+
ref: nativeRef,
|
|
2390
|
+
className: clsx__default["default"](className, textClass),
|
|
2391
|
+
children: text != null ? text : children,
|
|
2392
|
+
dangerouslySetInnerHTML: html ? {
|
|
2393
|
+
__html: html
|
|
2394
|
+
} : undefined
|
|
2395
|
+
}));
|
|
2396
|
+
} finally {
|
|
2397
|
+
_effect3();
|
|
2398
|
+
}
|
|
2399
|
+
}
|
|
2400
|
+
function DefaultHtmlLabelRenderer(_ref8) {
|
|
2401
|
+
var _effect4 = core.useComponentTracking();
|
|
2402
|
+
try {
|
|
2403
|
+
var textClass = _ref8.textClass,
|
|
2404
|
+
className = _ref8.className,
|
|
2405
|
+
props = _objectWithoutPropertiesLoose(_ref8, _excluded4);
|
|
2406
|
+
return /*#__PURE__*/jsxRuntime.jsx("label", _extends({}, props, {
|
|
2407
|
+
className: clsx__default["default"](className, textClass)
|
|
2408
|
+
}));
|
|
2409
|
+
} finally {
|
|
2410
|
+
_effect4();
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
function DefaultHtmlIconRenderer(_ref9) {
|
|
2414
|
+
var _effect5 = core.useComponentTracking();
|
|
2415
|
+
try {
|
|
2416
|
+
var toIconClass = function toIconClass() {
|
|
2417
|
+
if (!iconName) return undefined;
|
|
2418
|
+
switch (iconLibrary) {
|
|
2419
|
+
case schemas.IconLibrary.FontAwesome:
|
|
2420
|
+
return "fa fa-" + iconName;
|
|
2421
|
+
default:
|
|
2422
|
+
return iconName;
|
|
2423
|
+
}
|
|
2424
|
+
};
|
|
2425
|
+
var iconName = _ref9.iconName,
|
|
2426
|
+
iconLibrary = _ref9.iconLibrary,
|
|
2427
|
+
className = _ref9.className,
|
|
2428
|
+
style = _ref9.style;
|
|
2429
|
+
return iconName ? /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
2430
|
+
className: clsx__default["default"](className, toIconClass()),
|
|
2431
|
+
style: style
|
|
2432
|
+
}) : undefined;
|
|
2433
|
+
} finally {
|
|
2434
|
+
_effect5();
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
1752
2437
|
function createDefaultRenderers(options) {
|
|
1753
|
-
var _options$
|
|
2438
|
+
var _options$extraRendere, _options$html;
|
|
1754
2439
|
if (options === void 0) {
|
|
1755
2440
|
options = {};
|
|
1756
2441
|
}
|
|
@@ -1764,10 +2449,8 @@ function createDefaultRenderers(options) {
|
|
|
1764
2449
|
adornment: createDefaultAdornmentRenderer(options.adornment),
|
|
1765
2450
|
renderLayout: createDefaultLayoutRenderer(options.layout),
|
|
1766
2451
|
visibility: createDefaultVisibilityRenderer(),
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
},
|
|
1770
|
-
h: (_options$h = options.h) != null ? _options$h : React.createElement
|
|
2452
|
+
extraRenderers: (_options$extraRendere = options.extraRenderers == null ? void 0 : options.extraRenderers(options)) != null ? _options$extraRendere : [],
|
|
2453
|
+
html: (_options$html = options.html) != null ? _options$html : StandardHtmlComponents
|
|
1771
2454
|
};
|
|
1772
2455
|
}
|
|
1773
2456
|
function createClassStyledRenderers() {
|
|
@@ -1782,7 +2465,7 @@ function createClassStyledRenderers() {
|
|
|
1782
2465
|
className: "control-array"
|
|
1783
2466
|
},
|
|
1784
2467
|
action: {
|
|
1785
|
-
|
|
2468
|
+
buttonClass: "action"
|
|
1786
2469
|
},
|
|
1787
2470
|
data: {
|
|
1788
2471
|
inputClass: "data"
|
|
@@ -1797,10 +2480,12 @@ function createClassStyledRenderers() {
|
|
|
1797
2480
|
var defaultTailwindTheme = {
|
|
1798
2481
|
label: {
|
|
1799
2482
|
groupLabelClass: "font-bold",
|
|
1800
|
-
requiredElement: function requiredElement(
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
2483
|
+
requiredElement: function requiredElement(_ref) {
|
|
2484
|
+
var Span = _ref.Span;
|
|
2485
|
+
return /*#__PURE__*/jsxRuntime.jsx(Span, {
|
|
2486
|
+
className: "text-red-500",
|
|
2487
|
+
children: " *"
|
|
2488
|
+
});
|
|
1804
2489
|
}
|
|
1805
2490
|
},
|
|
1806
2491
|
array: {
|
|
@@ -1811,8 +2496,12 @@ var defaultTailwindTheme = {
|
|
|
1811
2496
|
},
|
|
1812
2497
|
group: {
|
|
1813
2498
|
standardClassName: "flex flex-col gap-4",
|
|
1814
|
-
|
|
2499
|
+
grid: {
|
|
2500
|
+
className: "flex flex-col gap-4",
|
|
2501
|
+
rowClass: "flex flex-row gap-4 justify-between *:flex-1"
|
|
2502
|
+
},
|
|
1815
2503
|
flexClassName: "gap-2",
|
|
2504
|
+
inlineClass: "",
|
|
1816
2505
|
tabs: {
|
|
1817
2506
|
className: "",
|
|
1818
2507
|
tabListClass: "flex flex-wrap text-sm font-medium text-center text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400",
|
|
@@ -1824,17 +2513,22 @@ var defaultTailwindTheme = {
|
|
|
1824
2513
|
}
|
|
1825
2514
|
},
|
|
1826
2515
|
action: {
|
|
1827
|
-
|
|
2516
|
+
buttonClass: "rounded-lg p-3 text-white disabled:opacity-75 disabled:cursor-not-allowed",
|
|
2517
|
+
primaryClass: "bg-primary-500",
|
|
2518
|
+
secondaryClass: "bg-secondary-500",
|
|
2519
|
+
iconBeforeClass: "px-2",
|
|
2520
|
+
iconAfterClass: "px-2"
|
|
1828
2521
|
},
|
|
1829
2522
|
layout: {
|
|
1830
2523
|
className: "flex flex-col",
|
|
1831
2524
|
errorClass: "text-sm text-red-500"
|
|
1832
2525
|
},
|
|
1833
2526
|
data: {
|
|
2527
|
+
inputClass: "form-control",
|
|
1834
2528
|
displayOnlyClass: "flex flex-row items-center gap-2",
|
|
1835
2529
|
checkOptions: {
|
|
1836
2530
|
className: "flex items-center gap-4",
|
|
1837
|
-
entryClass: "flex gap-1
|
|
2531
|
+
entryClass: "flex items-center gap-1"
|
|
1838
2532
|
},
|
|
1839
2533
|
selectOptions: {
|
|
1840
2534
|
emptyText: "<select>"
|
|
@@ -1855,8 +2549,8 @@ var defaultTailwindTheme = {
|
|
|
1855
2549
|
accordion: {
|
|
1856
2550
|
className: "flex items-center gap-2 my-2",
|
|
1857
2551
|
titleClass: "cursor-pointer",
|
|
1858
|
-
|
|
1859
|
-
|
|
2552
|
+
iconOpen: schemas.fontAwesomeIcon("chevron-up"),
|
|
2553
|
+
iconClosed: schemas.fontAwesomeIcon("chevron-down")
|
|
1860
2554
|
},
|
|
1861
2555
|
optional: {
|
|
1862
2556
|
checkClass: "m-2",
|
|
@@ -1875,12 +2569,18 @@ exports.DefaultArrayRenderer = DefaultArrayRenderer;
|
|
|
1875
2569
|
exports.DefaultBoolOptions = DefaultBoolOptions;
|
|
1876
2570
|
exports.DefaultDisplay = DefaultDisplay;
|
|
1877
2571
|
exports.DefaultDisplayOnly = DefaultDisplayOnly;
|
|
2572
|
+
exports.DefaultHtmlButtonRenderer = DefaultHtmlButtonRenderer;
|
|
2573
|
+
exports.DefaultHtmlDivRenderer = DefaultHtmlDivRenderer;
|
|
2574
|
+
exports.DefaultHtmlIconRenderer = DefaultHtmlIconRenderer;
|
|
2575
|
+
exports.DefaultHtmlInputRenderer = DefaultHtmlInputRenderer;
|
|
2576
|
+
exports.DefaultHtmlLabelRenderer = DefaultHtmlLabelRenderer;
|
|
1878
2577
|
exports.DefaultLayout = DefaultLayout;
|
|
1879
2578
|
exports.DefaultVisibility = DefaultVisibility;
|
|
1880
2579
|
exports.Fcheckbox = Fcheckbox;
|
|
1881
2580
|
exports.JsonataRenderer = JsonataRenderer;
|
|
1882
2581
|
exports.OptionalEditRenderer = OptionalEditRenderer;
|
|
1883
2582
|
exports.SelectDataRenderer = SelectDataRenderer;
|
|
2583
|
+
exports.StandardHtmlComponents = StandardHtmlComponents;
|
|
1884
2584
|
exports.ValueForFieldExtension = ValueForFieldExtension;
|
|
1885
2585
|
exports.createAutocompleteRenderer = createAutocompleteRenderer;
|
|
1886
2586
|
exports.createButtonActionRenderer = createButtonActionRenderer;
|
|
@@ -1897,6 +2597,7 @@ exports.createDefaultLabelRenderer = createDefaultLabelRenderer;
|
|
|
1897
2597
|
exports.createDefaultLayoutRenderer = createDefaultLayoutRenderer;
|
|
1898
2598
|
exports.createDefaultRenderers = createDefaultRenderers;
|
|
1899
2599
|
exports.createDefaultVisibilityRenderer = createDefaultVisibilityRenderer;
|
|
2600
|
+
exports.createElementSelectedRenderer = createElementSelectedRenderer;
|
|
1900
2601
|
exports.createInputConversion = createInputConversion;
|
|
1901
2602
|
exports.createJsonataRenderer = createJsonataRenderer;
|
|
1902
2603
|
exports.createNullToggleRenderer = createNullToggleRenderer;
|
|
@@ -1905,6 +2606,7 @@ exports.createRadioRenderer = createRadioRenderer;
|
|
|
1905
2606
|
exports.createSelectConversion = createSelectConversion;
|
|
1906
2607
|
exports.createSelectRenderer = createSelectRenderer;
|
|
1907
2608
|
exports.createValueForFieldRenderer = createValueForFieldRenderer;
|
|
2609
|
+
exports.createWizardRenderer = createWizardRenderer;
|
|
1908
2610
|
exports.defaultTailwindTheme = defaultTailwindTheme;
|
|
1909
2611
|
exports.getAccordionState = getAccordionState;
|
|
1910
2612
|
exports.setIncluded = setIncluded;
|