@react-typed-forms/schemas-html 2.4.1 → 3.1.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/CHANGELOG.json +25 -0
- package/CHANGELOG.md +11 -0
- package/lib/components/CheckRenderer.d.ts +2 -7
- package/lib/components/DefaultAccordion.d.ts +1 -1
- package/lib/components/DefaultArrayRenderer.d.ts +2 -1
- package/lib/components/DefaultLayout.d.ts +2 -3
- package/lib/createDefaultRenderers.d.ts +17 -4
- package/lib/index.cjs +434 -329
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +422 -294
- package/lib/index.js.map +1 -1
- package/lib/tailwind.d.ts +2 -2
- package/package.json +5 -5
package/lib/index.cjs
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
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');
|
|
4
|
+
var core = require('@react-typed-forms/core');
|
|
5
|
+
var react = require('react');
|
|
6
6
|
var base = require('@mui/base');
|
|
7
7
|
var ariaBase = require('@astroapps/aria-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
14
|
function _extends() {
|
|
@@ -41,7 +40,7 @@ function createDefaultDisplayRenderer(options) {
|
|
|
41
40
|
}
|
|
42
41
|
return {
|
|
43
42
|
render: function render(props, renderer) {
|
|
44
|
-
return
|
|
43
|
+
return /*#__PURE__*/jsxRuntime.jsx(DefaultDisplay, _extends({}, options, props, {
|
|
45
44
|
renderer: renderer
|
|
46
45
|
}));
|
|
47
46
|
},
|
|
@@ -57,20 +56,28 @@ function DefaultDisplay(_ref) {
|
|
|
57
56
|
style = _ref.style,
|
|
58
57
|
renderer = _ref.renderer,
|
|
59
58
|
options = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
60
|
-
var
|
|
59
|
+
var _renderer$html = renderer.html,
|
|
60
|
+
I = _renderer$html.I,
|
|
61
|
+
Div = _renderer$html.Div,
|
|
62
|
+
Span = _renderer$html.Span,
|
|
63
|
+
B = _renderer$html.B,
|
|
64
|
+
H1 = _renderer$html.H1;
|
|
61
65
|
switch (data.type) {
|
|
62
66
|
case schemas.DisplayDataType.Icon:
|
|
63
|
-
return
|
|
67
|
+
return /*#__PURE__*/jsxRuntime.jsx(I, {
|
|
64
68
|
style: style,
|
|
65
69
|
className: clsx__default["default"](schemas.getOverrideClass(className), display ? display.value : data.iconClass)
|
|
66
70
|
});
|
|
67
71
|
case schemas.DisplayDataType.Text:
|
|
68
|
-
return
|
|
72
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
69
73
|
style: style,
|
|
70
|
-
className: schemas.rendererClass(className, options.textClassName)
|
|
71
|
-
|
|
74
|
+
className: schemas.rendererClass(className, options.textClassName),
|
|
75
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Span, {
|
|
76
|
+
children: display ? schemas.coerceToString(display.value) : data.text
|
|
77
|
+
})
|
|
78
|
+
});
|
|
72
79
|
case schemas.DisplayDataType.Html:
|
|
73
|
-
return
|
|
80
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
74
81
|
style: style,
|
|
75
82
|
className: schemas.rendererClass(className, options.htmlClassName),
|
|
76
83
|
dangerouslySetInnerHTML: {
|
|
@@ -78,9 +85,15 @@ function DefaultDisplay(_ref) {
|
|
|
78
85
|
}
|
|
79
86
|
});
|
|
80
87
|
case schemas.DisplayDataType.Custom:
|
|
81
|
-
return
|
|
88
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
89
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(B, {
|
|
90
|
+
children: ["(", data.customId, ")"]
|
|
91
|
+
})
|
|
92
|
+
});
|
|
82
93
|
default:
|
|
83
|
-
return
|
|
94
|
+
return /*#__PURE__*/jsxRuntime.jsxs(H1, {
|
|
95
|
+
children: ["Unknown display type: ", data.type]
|
|
96
|
+
});
|
|
84
97
|
}
|
|
85
98
|
} finally {
|
|
86
99
|
_effect();
|
|
@@ -112,9 +125,8 @@ function ControlInput(_ref) {
|
|
|
112
125
|
}, function (v) {
|
|
113
126
|
return textValue.value = toText(v);
|
|
114
127
|
});
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return h("input", _extends({}, inputProps, {
|
|
128
|
+
var Input = renderer.html.Input;
|
|
129
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input, _extends({}, inputProps, {
|
|
118
130
|
type: convert[0],
|
|
119
131
|
value: textValue.value,
|
|
120
132
|
onChange: function onChange(e) {
|
|
@@ -191,7 +203,7 @@ function createSelectRenderer(options) {
|
|
|
191
203
|
}
|
|
192
204
|
return schemas.createDataRenderer(function (props, asArray) {
|
|
193
205
|
var _props$options;
|
|
194
|
-
return
|
|
206
|
+
return /*#__PURE__*/jsxRuntime.jsx(SelectDataRenderer, {
|
|
195
207
|
className: schemas.rendererClass(props.className, options.className),
|
|
196
208
|
state: props.control,
|
|
197
209
|
id: props.id,
|
|
@@ -210,11 +222,11 @@ function SelectDataRenderer(_ref) {
|
|
|
210
222
|
var _effect = core.useComponentTracking();
|
|
211
223
|
try {
|
|
212
224
|
var renderOption = function renderOption(x, i) {
|
|
213
|
-
return
|
|
214
|
-
key: i,
|
|
225
|
+
return /*#__PURE__*/jsxRuntime.jsx("option", {
|
|
215
226
|
value: convert(x.value),
|
|
216
|
-
disabled: !!x.disabled
|
|
217
|
-
|
|
227
|
+
disabled: !!x.disabled,
|
|
228
|
+
children: x.name
|
|
229
|
+
}, i);
|
|
218
230
|
};
|
|
219
231
|
var state = _ref.state,
|
|
220
232
|
options = _ref.options,
|
|
@@ -229,39 +241,41 @@ function SelectDataRenderer(_ref) {
|
|
|
229
241
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
230
242
|
var value = state.value,
|
|
231
243
|
disabled = state.disabled;
|
|
232
|
-
var _useState =
|
|
244
|
+
var _useState = react.useState(!required || value == null),
|
|
233
245
|
showEmpty = _useState[0];
|
|
234
|
-
var optionStringMap =
|
|
246
|
+
var optionStringMap = react.useMemo(function () {
|
|
235
247
|
return Object.fromEntries(options.map(function (x) {
|
|
236
248
|
return [convert(x.value), x.value];
|
|
237
249
|
}));
|
|
238
250
|
}, [options]);
|
|
239
|
-
var optionGroups =
|
|
251
|
+
var optionGroups = react.useMemo(function () {
|
|
240
252
|
return new Set(options.filter(function (x) {
|
|
241
253
|
return x.group;
|
|
242
254
|
}).map(function (x) {
|
|
243
255
|
return x.group;
|
|
244
256
|
}));
|
|
245
257
|
}, [options]);
|
|
246
|
-
return
|
|
258
|
+
return /*#__PURE__*/jsxRuntime.jsxs("select", _extends({}, props, {
|
|
247
259
|
className: className,
|
|
248
260
|
onChange: function onChange(v) {
|
|
249
261
|
return state.value = optionStringMap[v.target.value];
|
|
250
262
|
},
|
|
251
263
|
value: convert(value),
|
|
252
|
-
disabled: disabled || readonly
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
264
|
+
disabled: disabled || readonly,
|
|
265
|
+
children: [showEmpty && /*#__PURE__*/jsxRuntime.jsx("option", {
|
|
266
|
+
value: "",
|
|
267
|
+
children: required ? requiredText : emptyText
|
|
268
|
+
}), [].concat(optionGroups.keys()).map(function (x) {
|
|
269
|
+
return /*#__PURE__*/jsxRuntime.jsx("optgroup", {
|
|
270
|
+
label: x,
|
|
271
|
+
children: options.filter(function (o) {
|
|
272
|
+
return o.group === x;
|
|
273
|
+
}).map(renderOption)
|
|
274
|
+
}, x);
|
|
275
|
+
}), options.filter(function (x) {
|
|
276
|
+
return !x.group;
|
|
277
|
+
}).map(renderOption)]
|
|
278
|
+
}));
|
|
265
279
|
} finally {
|
|
266
280
|
_effect();
|
|
267
281
|
}
|
|
@@ -289,7 +303,7 @@ function createRadioRenderer(options) {
|
|
|
289
303
|
options = {};
|
|
290
304
|
}
|
|
291
305
|
return schemas.createDataRenderer(function (p, renderer) {
|
|
292
|
-
return
|
|
306
|
+
return /*#__PURE__*/jsxRuntime.jsx(CheckButtons, _extends({
|
|
293
307
|
classes: options,
|
|
294
308
|
controlClasses: p.renderOptions
|
|
295
309
|
}, p, {
|
|
@@ -314,7 +328,7 @@ function createCheckListRenderer(options) {
|
|
|
314
328
|
options = {};
|
|
315
329
|
}
|
|
316
330
|
return schemas.createDataRenderer(function (p, renderer) {
|
|
317
|
-
return
|
|
331
|
+
return /*#__PURE__*/jsxRuntime.jsx(CheckButtons, _extends({
|
|
318
332
|
classes: options,
|
|
319
333
|
controlClasses: p.renderOptions
|
|
320
334
|
}, p, {
|
|
@@ -354,44 +368,53 @@ function CheckButtons(_ref) {
|
|
|
354
368
|
_ref$controlClasses = _ref.controlClasses,
|
|
355
369
|
controlClasses = _ref$controlClasses === void 0 ? {} : _ref$controlClasses,
|
|
356
370
|
renderer = _ref.renderer;
|
|
357
|
-
var
|
|
371
|
+
var _renderer$html = renderer.html,
|
|
372
|
+
Button = _renderer$html.Button,
|
|
373
|
+
Input = _renderer$html.Input,
|
|
374
|
+
Label = _renderer$html.Label,
|
|
375
|
+
Div = _renderer$html.Div;
|
|
358
376
|
var disabled = control.disabled;
|
|
359
377
|
var name = "r" + control.uniqueId;
|
|
360
|
-
return
|
|
378
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
361
379
|
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
|
-
|
|
380
|
+
id: id,
|
|
381
|
+
children: /*#__PURE__*/jsxRuntime.jsx(core.RenderArrayElements, {
|
|
382
|
+
array: options == null ? void 0 : options.filter(function (x) {
|
|
383
|
+
return x.value != null;
|
|
384
|
+
}),
|
|
385
|
+
children: function children(o, i) {
|
|
386
|
+
var checked = core.useComputed(function () {
|
|
387
|
+
return isChecked(control, o);
|
|
388
|
+
}).value;
|
|
389
|
+
var selOrUnsel = checked ? schemas.rendererClass(controlClasses == null ? void 0 : controlClasses.selectedClass, classes.selectedClass) : schemas.rendererClass(controlClasses == null ? void 0 : controlClasses.notSelectedClass, classes.notSelectedClass);
|
|
390
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Button, {
|
|
391
|
+
className: clsx__default["default"](schemas.rendererClass(controlClasses == null ? void 0 : controlClasses.entryWrapperClass, classes.entryWrapperClass), selOrUnsel),
|
|
392
|
+
onClick: function onClick() {
|
|
393
|
+
return !readonly && setChecked(control, o, !checked);
|
|
394
|
+
},
|
|
395
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(Div, {
|
|
396
|
+
className: classes.entryClass,
|
|
397
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
398
|
+
id: name + "_" + i,
|
|
399
|
+
className: classes.checkClass,
|
|
400
|
+
type: type,
|
|
401
|
+
name: name,
|
|
402
|
+
readOnly: readonly,
|
|
403
|
+
disabled: disabled,
|
|
404
|
+
checked: checked,
|
|
405
|
+
onChange: function onChange(x) {
|
|
406
|
+
!readonly && setChecked(control, o, x.target.checked);
|
|
407
|
+
}
|
|
408
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
409
|
+
className: classes.labelClass,
|
|
410
|
+
htmlFor: name + "_" + i,
|
|
411
|
+
children: o.name
|
|
412
|
+
})]
|
|
413
|
+
}), entryAdornment == null ? void 0 : entryAdornment(o, i, checked)]
|
|
414
|
+
});
|
|
389
415
|
}
|
|
390
|
-
})
|
|
391
|
-
|
|
392
|
-
htmlFor: name + "_" + i
|
|
393
|
-
}, o.name)), entryAdornment == null ? void 0 : entryAdornment(o, i, checked));
|
|
394
|
-
}));
|
|
416
|
+
})
|
|
417
|
+
});
|
|
395
418
|
} finally {
|
|
396
419
|
_effect();
|
|
397
420
|
}
|
|
@@ -416,7 +439,7 @@ function createCheckboxRenderer(options) {
|
|
|
416
439
|
return function (p) {
|
|
417
440
|
return _extends({}, p, {
|
|
418
441
|
label: undefined,
|
|
419
|
-
children:
|
|
442
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CheckBox, {
|
|
420
443
|
p: p,
|
|
421
444
|
renderer: renderer,
|
|
422
445
|
options: options,
|
|
@@ -435,16 +458,17 @@ function CheckBox(_ref2) {
|
|
|
435
458
|
props = _ref2.props,
|
|
436
459
|
renderer = _ref2.renderer,
|
|
437
460
|
options = _ref2.options;
|
|
438
|
-
var
|
|
439
|
-
return
|
|
440
|
-
className: schemas.rendererClass(props.className, options.entryClass)
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
461
|
+
var Div = renderer.html.Div;
|
|
462
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Div, {
|
|
463
|
+
className: schemas.rendererClass(props.className, options.entryClass),
|
|
464
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Fcheckbox, {
|
|
465
|
+
id: props.id,
|
|
466
|
+
control: props.control.as(),
|
|
467
|
+
style: props.style,
|
|
468
|
+
className: options.checkClass,
|
|
469
|
+
renderer: renderer
|
|
470
|
+
}), p.label && renderer.renderLabel(p.label, undefined, undefined)]
|
|
471
|
+
});
|
|
448
472
|
} finally {
|
|
449
473
|
_effect2();
|
|
450
474
|
}
|
|
@@ -459,25 +483,20 @@ function Fcheckbox(_ref3) {
|
|
|
459
483
|
notValue = _ref3$notValue === void 0 ? false : _ref3$notValue,
|
|
460
484
|
renderer = _ref3.renderer,
|
|
461
485
|
others = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
|
|
462
|
-
var
|
|
463
|
-
// Update the HTML5 custom validity whenever the error message is changed/cleared
|
|
464
|
-
// useControlEffect(
|
|
465
|
-
// () => control.error,
|
|
466
|
-
// (s) => (control.element as HTMLInputElement)?.setCustomValidity(s ?? ""),
|
|
467
|
-
// );
|
|
486
|
+
var Input = renderer.html.Input;
|
|
468
487
|
var _formControlProps = core.formControlProps(control),
|
|
469
488
|
value = _formControlProps.value,
|
|
470
489
|
onChange = _formControlProps.onChange,
|
|
471
490
|
errorText = _formControlProps.errorText,
|
|
472
491
|
theseProps = _objectWithoutPropertiesLoose(_formControlProps, _excluded2);
|
|
473
|
-
return
|
|
492
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input, _extends({}, theseProps, {
|
|
474
493
|
checked: !!value !== notValue,
|
|
475
494
|
ref: function ref(r) {
|
|
476
|
-
control.element = r;
|
|
477
|
-
// if (r) r.setCustomValidity(control.current.error ?? "");
|
|
495
|
+
return control.element = r;
|
|
478
496
|
},
|
|
479
497
|
onChange: function onChange(e) {
|
|
480
|
-
|
|
498
|
+
control.touched = true;
|
|
499
|
+
control.value = e.target.checked !== notValue;
|
|
481
500
|
},
|
|
482
501
|
type: type
|
|
483
502
|
}, others));
|
|
@@ -493,7 +512,7 @@ function createDefaultLayoutRenderer(options) {
|
|
|
493
512
|
return schemas.createLayoutRenderer(function (props, renderers) {
|
|
494
513
|
var layout = schemas.renderLayoutParts(props, renderers);
|
|
495
514
|
return {
|
|
496
|
-
children: layout.wrapLayout(
|
|
515
|
+
children: layout.wrapLayout(/*#__PURE__*/jsxRuntime.jsx(DefaultLayout, _extends({
|
|
497
516
|
layout: layout
|
|
498
517
|
}, options, {
|
|
499
518
|
renderer: renderers
|
|
@@ -511,13 +530,18 @@ function DefaultLayout(_ref) {
|
|
|
511
530
|
try {
|
|
512
531
|
var errorClass = _ref.errorClass,
|
|
513
532
|
_ref$renderer = _ref.renderer,
|
|
514
|
-
|
|
533
|
+
_ref$renderer$html = _ref$renderer.html,
|
|
534
|
+
Div = _ref$renderer$html.Div,
|
|
535
|
+
Span = _ref$renderer$html.Span,
|
|
515
536
|
renderText = _ref$renderer.renderText,
|
|
516
537
|
_ref$renderError = _ref.renderError,
|
|
517
538
|
renderError = _ref$renderError === void 0 ? function (e) {
|
|
518
|
-
return e &&
|
|
519
|
-
|
|
520
|
-
|
|
539
|
+
return e && /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
540
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Span, {
|
|
541
|
+
className: errorClass,
|
|
542
|
+
children: renderText(e)
|
|
543
|
+
})
|
|
544
|
+
});
|
|
521
545
|
} : _ref$renderError,
|
|
522
546
|
_ref$layout = _ref.layout,
|
|
523
547
|
controlEnd = _ref$layout.controlEnd,
|
|
@@ -527,7 +551,9 @@ function DefaultLayout(_ref) {
|
|
|
527
551
|
errorControl = _ref$layout.errorControl;
|
|
528
552
|
var ec = errorControl;
|
|
529
553
|
var errorText = ec && ec.touched ? ec.error : undefined;
|
|
530
|
-
return
|
|
554
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
555
|
+
children: [label, controlStart, children, renderError(errorText), controlEnd]
|
|
556
|
+
});
|
|
531
557
|
} finally {
|
|
532
558
|
_effect();
|
|
533
559
|
}
|
|
@@ -546,12 +572,16 @@ function DefaultDisplayOnly(_ref) {
|
|
|
546
572
|
renderer = _ref.renderer;
|
|
547
573
|
var v = control.value;
|
|
548
574
|
var text = (_ref2 = schemaInterface.isEmptyValue(field, v) ? emptyText : schemaInterface.textValue(field, v)) != null ? _ref2 : "";
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
575
|
+
var _renderer$html = renderer.html,
|
|
576
|
+
Div = _renderer$html.Div,
|
|
577
|
+
Span = _renderer$html.Span;
|
|
578
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
552
579
|
style: style,
|
|
553
|
-
className: className
|
|
554
|
-
|
|
580
|
+
className: className,
|
|
581
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Span, {
|
|
582
|
+
children: text
|
|
583
|
+
})
|
|
584
|
+
});
|
|
555
585
|
} finally {
|
|
556
586
|
_effect();
|
|
557
587
|
}
|
|
@@ -566,7 +596,9 @@ function DefaultAccordion(_ref) {
|
|
|
566
596
|
contentStyle = _ref.contentStyle,
|
|
567
597
|
contentClassName = _ref.contentClassName,
|
|
568
598
|
designMode = _ref.designMode,
|
|
599
|
+
iconOpenName = _ref.iconOpenName,
|
|
569
600
|
iconOpenClass = _ref.iconOpenClass,
|
|
601
|
+
iconClosedName = _ref.iconClosedName,
|
|
570
602
|
iconClosedClass = _ref.iconClosedClass,
|
|
571
603
|
className = _ref.className,
|
|
572
604
|
_ref$renderTitle = _ref.renderTitle,
|
|
@@ -578,6 +610,11 @@ function DefaultAccordion(_ref) {
|
|
|
578
610
|
titleClass = _ref.titleClass,
|
|
579
611
|
useCss = _ref.useCss,
|
|
580
612
|
dataContext = _ref.dataContext;
|
|
613
|
+
var _renderers$html = renderers.html,
|
|
614
|
+
Button = _renderers$html.Button,
|
|
615
|
+
I = _renderers$html.I,
|
|
616
|
+
Div = _renderers$html.Div,
|
|
617
|
+
Label = _renderers$html.Label;
|
|
581
618
|
var dataControl = ((_dataContext$dataNode = dataContext.dataNode) != null ? _dataContext$dataNode : dataContext.parentNode).control;
|
|
582
619
|
var open = core.useControl(!!accordion.defaultExpanded);
|
|
583
620
|
if (dataControl && !dataControl.meta.accordionState) {
|
|
@@ -588,22 +625,28 @@ function DefaultAccordion(_ref) {
|
|
|
588
625
|
display: "none"
|
|
589
626
|
});
|
|
590
627
|
var title = renderers.renderLabelText(renderTitle(accordion.title, open));
|
|
591
|
-
var toggler = renderToggler ? renderToggler(open, title) :
|
|
628
|
+
var toggler = renderToggler ? renderToggler(open, title) : /*#__PURE__*/jsxRuntime.jsxs(Button, {
|
|
592
629
|
className: className,
|
|
593
630
|
onClick: function onClick() {
|
|
594
631
|
return open.setValue(function (x) {
|
|
595
632
|
return !x;
|
|
596
633
|
});
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
634
|
+
},
|
|
635
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
636
|
+
className: titleClass,
|
|
637
|
+
children: title
|
|
638
|
+
}), /*#__PURE__*/jsxRuntime.jsx(I, {
|
|
639
|
+
title: isOpen ? iconOpenName : iconClosedName,
|
|
640
|
+
className: clsx__default["default"](isOpen ? iconOpenClass : iconClosedClass)
|
|
641
|
+
})]
|
|
642
|
+
});
|
|
643
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
644
|
+
children: [toggler, (useCss || isOpen || designMode) && /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
645
|
+
style: fullContentStyle,
|
|
646
|
+
className: contentClassName,
|
|
647
|
+
children: children
|
|
648
|
+
})]
|
|
649
|
+
});
|
|
607
650
|
} finally {
|
|
608
651
|
_effect();
|
|
609
652
|
}
|
|
@@ -617,7 +660,7 @@ function createTabsRenderer(options) {
|
|
|
617
660
|
options = {};
|
|
618
661
|
}
|
|
619
662
|
return schemas.createGroupRenderer(function (p, renderer) {
|
|
620
|
-
return
|
|
663
|
+
return /*#__PURE__*/jsxRuntime.jsx(TabsGroupRenderer, _extends({}, p, {
|
|
621
664
|
tabOptions: p.renderOptions,
|
|
622
665
|
options: options
|
|
623
666
|
}));
|
|
@@ -629,24 +672,27 @@ function TabsGroupRenderer(_ref) {
|
|
|
629
672
|
var _effect = core.useComponentTracking();
|
|
630
673
|
try {
|
|
631
674
|
var renderTabs = function renderTabs(tabs, key) {
|
|
632
|
-
return
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
675
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
676
|
+
className: schemas.rendererClass(className, options.className),
|
|
677
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("ul", {
|
|
678
|
+
className: schemas.rendererClass(null, tabListClass),
|
|
679
|
+
children: tabs.map(function (x, i) {
|
|
680
|
+
return /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
681
|
+
className: schemas.rendererClass(null, tabClass),
|
|
682
|
+
onClick: function onClick() {
|
|
683
|
+
return tabIndex.value = i;
|
|
684
|
+
},
|
|
685
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
686
|
+
className: schemas.rendererClass(null, clsx__default["default"](labelClass, i == currentTab ? activeClass : inactiveClass)),
|
|
687
|
+
children: x.definition.title ? x.definition.title : "<untitled>"
|
|
688
|
+
})
|
|
689
|
+
}, i);
|
|
690
|
+
})
|
|
691
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
692
|
+
className: schemas.rendererClass(tabOptions.contentClass, contentClass),
|
|
693
|
+
children: renderChild(currentTab, tabs[currentTab])
|
|
694
|
+
})]
|
|
695
|
+
}, key);
|
|
650
696
|
};
|
|
651
697
|
var formNode = _ref.formNode,
|
|
652
698
|
className = _ref.className,
|
|
@@ -662,9 +708,11 @@ function TabsGroupRenderer(_ref) {
|
|
|
662
708
|
activeClass = options.activeClass,
|
|
663
709
|
contentClass = options.contentClass;
|
|
664
710
|
var currentTab = tabIndex.value;
|
|
665
|
-
return designMode ?
|
|
666
|
-
|
|
667
|
-
|
|
711
|
+
return designMode ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
712
|
+
children: formNode.getChildNodes().map(function (x, i) {
|
|
713
|
+
return renderTabs([x], i);
|
|
714
|
+
})
|
|
715
|
+
}) : renderTabs(formNode.getChildNodes(), 0);
|
|
668
716
|
} finally {
|
|
669
717
|
_effect();
|
|
670
718
|
}
|
|
@@ -709,7 +757,7 @@ function createDefaultGroupRenderer(options) {
|
|
|
709
757
|
formNode = props.formNode;
|
|
710
758
|
if (schemas.isTabsRenderer(renderOptions)) return tabsRenderer.render(props, renderer);
|
|
711
759
|
if (schemas.isSelectChildRenderer(renderOptions) && !props.designMode) {
|
|
712
|
-
return
|
|
760
|
+
return /*#__PURE__*/jsxRuntime.jsx(SelectChildGroupRenderer, _extends({}, props, {
|
|
713
761
|
renderOptions: renderOptions
|
|
714
762
|
}));
|
|
715
763
|
}
|
|
@@ -718,14 +766,14 @@ function createDefaultGroupRenderer(options) {
|
|
|
718
766
|
},
|
|
719
767
|
style = _ref3.style,
|
|
720
768
|
gcn = _ref3.className;
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
return h("div", {
|
|
769
|
+
var Div = renderer.html.Div;
|
|
770
|
+
return /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
724
771
|
className: schemas.rendererClass(props.className, clsx__default["default"](className, gcn)),
|
|
725
|
-
style: style
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
772
|
+
style: style,
|
|
773
|
+
children: formNode.getChildNodes().map(function (c, i) {
|
|
774
|
+
return renderChild(i, c);
|
|
775
|
+
})
|
|
776
|
+
});
|
|
729
777
|
}
|
|
730
778
|
return {
|
|
731
779
|
type: "group",
|
|
@@ -744,18 +792,19 @@ function SelectChildGroupRenderer(props) {
|
|
|
744
792
|
var ctrl = dynHook.runHook(p.dataContext, dynHook.state);
|
|
745
793
|
var childIndex = ctrl == null ? void 0 : ctrl.value;
|
|
746
794
|
var childDefinitions = p.formNode.getChildNodes();
|
|
747
|
-
return
|
|
795
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
796
|
+
children: typeof childIndex === "number" && childIndex < childDefinitions.length && childIndex >= 0 && p.renderChild(childIndex, childDefinitions[childIndex])
|
|
797
|
+
});
|
|
748
798
|
}, [dynHook.deps]);
|
|
749
|
-
return
|
|
799
|
+
return /*#__PURE__*/jsxRuntime.jsx(Render, _extends({}, props));
|
|
750
800
|
} finally {
|
|
751
801
|
_effect();
|
|
752
802
|
}
|
|
753
803
|
}
|
|
754
804
|
|
|
755
805
|
function createDefaultVisibilityRenderer() {
|
|
756
|
-
var h = jsxRuntime.jsx;
|
|
757
806
|
return schemas.createVisibilityRenderer(function (props, renderer) {
|
|
758
|
-
return
|
|
807
|
+
return /*#__PURE__*/jsxRuntime.jsx(DefaultVisibility, _extends({}, props, {
|
|
759
808
|
renderer: renderer
|
|
760
809
|
}));
|
|
761
810
|
});
|
|
@@ -770,7 +819,7 @@ function DefaultVisibility(_ref) {
|
|
|
770
819
|
divRef = _ref.divRef,
|
|
771
820
|
renderer = _ref.renderer;
|
|
772
821
|
var v = visibility.value;
|
|
773
|
-
|
|
822
|
+
react.useEffect(function () {
|
|
774
823
|
if (v) {
|
|
775
824
|
visibility.setValue(function (ex) {
|
|
776
825
|
return {
|
|
@@ -780,13 +829,13 @@ function DefaultVisibility(_ref) {
|
|
|
780
829
|
});
|
|
781
830
|
}
|
|
782
831
|
}, [v == null ? void 0 : v.visible]);
|
|
783
|
-
var
|
|
784
|
-
return v != null && v.visible ?
|
|
832
|
+
var Div = renderer.html.Div;
|
|
833
|
+
return v != null && v.visible ? /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
785
834
|
className: className,
|
|
786
835
|
style: style,
|
|
787
836
|
ref: divRef,
|
|
788
837
|
children: children
|
|
789
|
-
}) :
|
|
838
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
790
839
|
} finally {
|
|
791
840
|
_effect();
|
|
792
841
|
}
|
|
@@ -794,7 +843,7 @@ function DefaultVisibility(_ref) {
|
|
|
794
843
|
|
|
795
844
|
function createJsonataRenderer(className) {
|
|
796
845
|
return schemas.createDataRenderer(function (p) {
|
|
797
|
-
return
|
|
846
|
+
return /*#__PURE__*/jsxRuntime.jsx(JsonataRenderer, {
|
|
798
847
|
renderOptions: p.renderOptions,
|
|
799
848
|
className: schemas.rendererClass(p.className, className),
|
|
800
849
|
dataNode: p.dataNode,
|
|
@@ -826,7 +875,7 @@ function JsonataRenderer(_ref) {
|
|
|
826
875
|
};
|
|
827
876
|
});
|
|
828
877
|
var rendered = schemas.useJsonataExpression(renderOptions.expression, schemas.getRootDataNode(sdn).control, schemas.getJsonPath(sdn), bindings, schemas.coerceToString);
|
|
829
|
-
return
|
|
878
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
830
879
|
className: className,
|
|
831
880
|
dangerouslySetInnerHTML: {
|
|
832
881
|
__html: rendered.value
|
|
@@ -863,7 +912,7 @@ function createNullToggleRenderer() {
|
|
|
863
912
|
|
|
864
913
|
function createDefaultArrayDataRenderer(defaultActions) {
|
|
865
914
|
return schemas.createDataRenderer(function (props, renderers) {
|
|
866
|
-
return
|
|
915
|
+
return /*#__PURE__*/jsxRuntime.jsx(DataArrayRenderer, {
|
|
867
916
|
dataProps: props,
|
|
868
917
|
renderers: renderers,
|
|
869
918
|
defaultActions: defaultActions
|
|
@@ -899,9 +948,8 @@ function DataArrayRenderer(_ref) {
|
|
|
899
948
|
editExternal = _mergeObjects.editExternal;
|
|
900
949
|
var childOptions = schemas.isArrayRenderer(renderOptions) ? renderOptions.childOptions : undefined;
|
|
901
950
|
var renderAsElement = !schemas.isCompoundField(field);
|
|
902
|
-
var childDefinition =
|
|
951
|
+
var childDefinition = formNode.tree.createTempNode(formNode.id + "child", !renderAsElement ? {
|
|
903
952
|
type: schemas.ControlDefinitionType.Group,
|
|
904
|
-
children: definition.children,
|
|
905
953
|
groupOptions: {
|
|
906
954
|
type: schemas.GroupRenderType.Standard,
|
|
907
955
|
hideTitle: true
|
|
@@ -909,12 +957,11 @@ function DataArrayRenderer(_ref) {
|
|
|
909
957
|
} : {
|
|
910
958
|
type: schemas.ControlDefinitionType.Data,
|
|
911
959
|
field: definition.field,
|
|
912
|
-
children: definition.children,
|
|
913
960
|
renderOptions: childOptions != null ? childOptions : {
|
|
914
961
|
type: schemas.DataRenderType.Standard
|
|
915
962
|
},
|
|
916
963
|
hideTitle: true
|
|
917
|
-
}, formNode.
|
|
964
|
+
}, formNode.getChildNodes());
|
|
918
965
|
var visibilities = ((_definition$children = definition.children) != null ? _definition$children : []).map(function (x) {
|
|
919
966
|
return [useChildVisibility(x, undefined, true), x];
|
|
920
967
|
});
|
|
@@ -934,7 +981,7 @@ function DataArrayRenderer(_ref) {
|
|
|
934
981
|
}), {
|
|
935
982
|
required: required,
|
|
936
983
|
renderElement: function renderElement(i, wrap) {
|
|
937
|
-
return
|
|
984
|
+
return /*#__PURE__*/jsxRuntime.jsx(Entry, {
|
|
938
985
|
index: i,
|
|
939
986
|
renderChildElement: renderChildElement,
|
|
940
987
|
dataContext: dataContext,
|
|
@@ -979,9 +1026,11 @@ function RenderEntry(_ref2) {
|
|
|
979
1026
|
function createDefaultArrayRenderer(options) {
|
|
980
1027
|
return {
|
|
981
1028
|
render: function render(props, _ref4) {
|
|
982
|
-
var renderAction = _ref4.renderAction
|
|
983
|
-
|
|
984
|
-
|
|
1029
|
+
var renderAction = _ref4.renderAction,
|
|
1030
|
+
html = _ref4.html;
|
|
1031
|
+
return /*#__PURE__*/jsxRuntime.jsx(DefaultArrayRenderer, _extends({}, props, options, {
|
|
1032
|
+
renderAction: renderAction,
|
|
1033
|
+
html: html
|
|
985
1034
|
}));
|
|
986
1035
|
},
|
|
987
1036
|
type: "array"
|
|
@@ -1000,29 +1049,39 @@ function DefaultArrayRenderer(props) {
|
|
|
1000
1049
|
arrayControl = props.arrayControl,
|
|
1001
1050
|
renderAction = props.renderAction,
|
|
1002
1051
|
style = props.style,
|
|
1003
|
-
editAction = props.editAction
|
|
1052
|
+
editAction = props.editAction,
|
|
1053
|
+
Div = props.html.Div;
|
|
1004
1054
|
var _applyArrayLengthRest = schemas.applyArrayLengthRestrictions(props),
|
|
1005
1055
|
addAction = _applyArrayLengthRest.addAction,
|
|
1006
1056
|
removeAction = _applyArrayLengthRest.removeAction;
|
|
1007
|
-
return
|
|
1008
|
-
style: style
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1057
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Div, {
|
|
1058
|
+
style: style,
|
|
1059
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
1060
|
+
className: clsx__default["default"](className, removeAction && removableClass),
|
|
1061
|
+
children: /*#__PURE__*/jsxRuntime.jsx(core.RenderElements, {
|
|
1062
|
+
control: arrayControl,
|
|
1063
|
+
children: function children(_, x) {
|
|
1064
|
+
return renderElement(x, function (children) {
|
|
1065
|
+
return removeAction || editAction ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1066
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
1067
|
+
className: clsx__default["default"](childClass, removableChildClass),
|
|
1068
|
+
children: children
|
|
1069
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Div, {
|
|
1070
|
+
className: removeActionClass,
|
|
1071
|
+
children: [editAction && renderAction(editAction(x)), removeAction && renderAction(removeAction(x))]
|
|
1072
|
+
})]
|
|
1073
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
1074
|
+
className: childClass,
|
|
1075
|
+
children: children
|
|
1076
|
+
});
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
})
|
|
1080
|
+
}), addAction && /*#__PURE__*/jsxRuntime.jsx(Div, {
|
|
1081
|
+
className: addActionClass,
|
|
1082
|
+
children: renderAction(addAction)
|
|
1083
|
+
})]
|
|
1084
|
+
});
|
|
1026
1085
|
} finally {
|
|
1027
1086
|
_effect();
|
|
1028
1087
|
}
|
|
@@ -1035,7 +1094,7 @@ function createAutocompleteRenderer(options) {
|
|
|
1035
1094
|
}
|
|
1036
1095
|
return schemas.createDataRenderer(function (p) {
|
|
1037
1096
|
var _p$options, _p$options2;
|
|
1038
|
-
return p.field.collection ?
|
|
1097
|
+
return p.field.collection ? /*#__PURE__*/jsxRuntime.jsx(MultipleAutocomplete, {
|
|
1039
1098
|
options: (_p$options = p.options) != null ? _p$options : [],
|
|
1040
1099
|
control: p.control,
|
|
1041
1100
|
className: schemas.rendererClass(p.className, options.className),
|
|
@@ -1043,7 +1102,7 @@ function createAutocompleteRenderer(options) {
|
|
|
1043
1102
|
controlClasses: p.renderOptions,
|
|
1044
1103
|
readOnly: p.readonly,
|
|
1045
1104
|
id: p.id
|
|
1046
|
-
}) :
|
|
1105
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(SingleAutocomplete, {
|
|
1047
1106
|
options: (_p$options2 = p.options) != null ? _p$options2 : [],
|
|
1048
1107
|
control: p.control,
|
|
1049
1108
|
className: schemas.rendererClass(p.className, options.className),
|
|
@@ -1109,33 +1168,38 @@ function SingleAutocomplete(_ref) {
|
|
|
1109
1168
|
popupOpen = _useAutocomplete.popupOpen,
|
|
1110
1169
|
focused = _useAutocomplete.focused,
|
|
1111
1170
|
getPopupIndicatorProps = _useAutocomplete.getPopupIndicatorProps;
|
|
1112
|
-
return
|
|
1171
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", _extends({
|
|
1113
1172
|
id: id,
|
|
1114
1173
|
className: "relative"
|
|
1115
|
-
}, getRootProps()
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1174
|
+
}, getRootProps(), {
|
|
1175
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1176
|
+
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"),
|
|
1177
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("input", _extends({
|
|
1178
|
+
type: "text"
|
|
1179
|
+
}, getInputProps(), {
|
|
1180
|
+
placeholder: (_controlClasses$place = controlClasses == null ? void 0 : controlClasses.placeholder) != null ? _controlClasses$place : "",
|
|
1181
|
+
className: inputClass
|
|
1182
|
+
})), /*#__PURE__*/jsxRuntime.jsx("button", _extends({}, getPopupIndicatorProps(), {
|
|
1183
|
+
disabled: disabled || readOnly,
|
|
1184
|
+
className: "outline-0 shadow-none border-0 py-0 px-0.5 bg-transparent pr-[10px]",
|
|
1185
|
+
children: /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
1186
|
+
className: clsx__default["default"]("fa-solid fa-angle-down", "text-primary-500", popupOpen && "rotate-180")
|
|
1187
|
+
})
|
|
1188
|
+
}))]
|
|
1189
|
+
}), groupedOptions.length > 0 && popupOpen && /*#__PURE__*/jsxRuntime.jsx("ul", _extends({}, getListboxProps(), {
|
|
1190
|
+
className: listContainerClass,
|
|
1191
|
+
children: groupedOptions.map(function (option, index) {
|
|
1192
|
+
var optionProps = getOptionProps({
|
|
1193
|
+
option: option,
|
|
1194
|
+
index: index
|
|
1195
|
+
});
|
|
1196
|
+
return /*#__PURE__*/react.createElement("li", _extends({}, optionProps, {
|
|
1197
|
+
key: optionProps.key,
|
|
1198
|
+
className: listEntryClass
|
|
1199
|
+
}), option.name);
|
|
1200
|
+
})
|
|
1201
|
+
}))]
|
|
1202
|
+
}));
|
|
1139
1203
|
} finally {
|
|
1140
1204
|
_effect();
|
|
1141
1205
|
}
|
|
@@ -1198,48 +1262,53 @@ function MultipleAutocomplete(_ref3) {
|
|
|
1198
1262
|
popupOpen = _useAutocomplete2.popupOpen,
|
|
1199
1263
|
focused = _useAutocomplete2.focused,
|
|
1200
1264
|
getPopupIndicatorProps = _useAutocomplete2.getPopupIndicatorProps;
|
|
1201
|
-
return
|
|
1265
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", _extends({
|
|
1202
1266
|
id: id,
|
|
1203
1267
|
className: "relative"
|
|
1204
|
-
}, getRootProps()
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1268
|
+
}, getRootProps(), {
|
|
1269
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1270
|
+
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"),
|
|
1271
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1272
|
+
className: "flex flex-1 flex-row flex-wrap",
|
|
1273
|
+
children: [(_selectedOptionsContr2 = selectedOptionsControl.value) == null ? void 0 : _selectedOptionsContr2.map(function (v) {
|
|
1274
|
+
return /*#__PURE__*/jsxRuntime.jsx(Chip, {
|
|
1275
|
+
text: typeof v === "string" ? v : v.name,
|
|
1276
|
+
chipContainerClass: chipContainerClass,
|
|
1277
|
+
chipCloseButtonClass: chipCloseButtonClass,
|
|
1278
|
+
onDeleteClick: function onDeleteClick() {
|
|
1279
|
+
var c = selectedOptionsControl.elements.find(function (x) {
|
|
1280
|
+
return x.value == v;
|
|
1281
|
+
});
|
|
1282
|
+
if (c) core.removeElement(selectedOptionsControl, c);
|
|
1283
|
+
}
|
|
1284
|
+
}, typeof v === "string" ? v : v.name);
|
|
1285
|
+
}), /*#__PURE__*/jsxRuntime.jsx("input", _extends({
|
|
1286
|
+
type: "text"
|
|
1287
|
+
}, getInputProps(), {
|
|
1288
|
+
placeholder: (_controlClasses$place2 = controlClasses == null ? void 0 : controlClasses.placeholder) != null ? _controlClasses$place2 : "",
|
|
1289
|
+
className: clsx__default["default"](inputClass)
|
|
1290
|
+
}))]
|
|
1291
|
+
}), /*#__PURE__*/jsxRuntime.jsx("button", _extends({}, getPopupIndicatorProps(), {
|
|
1292
|
+
disabled: disabled || readOnly,
|
|
1293
|
+
className: "outline-0 shadow-none border-0 py-0 px-0.5 bg-transparent pr-[10px]",
|
|
1294
|
+
children: /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
1295
|
+
className: clsx__default["default"]("fa-solid fa-angle-down", "text-primary-500", popupOpen && "rotate-180")
|
|
1296
|
+
})
|
|
1297
|
+
}))]
|
|
1298
|
+
}), groupedOptions.length > 0 && popupOpen && /*#__PURE__*/jsxRuntime.jsx("ul", _extends({}, getListboxProps(), {
|
|
1299
|
+
className: listContainerClass,
|
|
1300
|
+
children: groupedOptions.map(function (option, index) {
|
|
1301
|
+
var optionProps = getOptionProps({
|
|
1302
|
+
option: option,
|
|
1303
|
+
index: index
|
|
1217
1304
|
});
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
className: clsx__default["default"](inputClass)
|
|
1226
|
-
}))), React.createElement("button", _extends({}, getPopupIndicatorProps(), {
|
|
1227
|
-
disabled: disabled || readOnly,
|
|
1228
|
-
className: "outline-0 shadow-none border-0 py-0 px-0.5 bg-transparent pr-[10px]"
|
|
1229
|
-
}), React.createElement("i", {
|
|
1230
|
-
className: clsx__default["default"]("fa-solid fa-angle-down", "text-primary-500", popupOpen && "rotate-180")
|
|
1231
|
-
}))), groupedOptions.length > 0 && popupOpen && React.createElement("ul", _extends({}, getListboxProps(), {
|
|
1232
|
-
className: listContainerClass
|
|
1233
|
-
}), groupedOptions.map(function (option, index) {
|
|
1234
|
-
var optionProps = getOptionProps({
|
|
1235
|
-
option: option,
|
|
1236
|
-
index: index
|
|
1237
|
-
});
|
|
1238
|
-
return React.createElement("li", _extends({}, optionProps, {
|
|
1239
|
-
key: optionProps.key,
|
|
1240
|
-
className: listEntryClass
|
|
1241
|
-
}), option.name);
|
|
1242
|
-
})));
|
|
1305
|
+
return /*#__PURE__*/react.createElement("li", _extends({}, optionProps, {
|
|
1306
|
+
key: optionProps.key,
|
|
1307
|
+
className: listEntryClass
|
|
1308
|
+
}), option.name);
|
|
1309
|
+
})
|
|
1310
|
+
}))]
|
|
1311
|
+
}));
|
|
1243
1312
|
} finally {
|
|
1244
1313
|
_effect2();
|
|
1245
1314
|
}
|
|
@@ -1251,14 +1320,15 @@ function Chip(_ref5) {
|
|
|
1251
1320
|
chipContainerClass = _ref5.chipContainerClass,
|
|
1252
1321
|
chipCloseButtonClass = _ref5.chipCloseButtonClass,
|
|
1253
1322
|
onDeleteClick = _ref5.onDeleteClick;
|
|
1254
|
-
return
|
|
1255
|
-
className: chipContainerClass
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1323
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1324
|
+
className: chipContainerClass,
|
|
1325
|
+
children: [text, /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
1326
|
+
className: chipCloseButtonClass,
|
|
1327
|
+
onClick: function onClick() {
|
|
1328
|
+
onDeleteClick == null || onDeleteClick();
|
|
1329
|
+
}
|
|
1330
|
+
})]
|
|
1331
|
+
});
|
|
1262
1332
|
} finally {
|
|
1263
1333
|
_effect3();
|
|
1264
1334
|
}
|
|
@@ -1280,11 +1350,13 @@ function createValueForFieldRenderer(options) {
|
|
|
1280
1350
|
var fieldRef = o.renderOptions.fieldRef;
|
|
1281
1351
|
var actualFieldRef = fieldRef ? (_schemaDataForFieldRe = schemas.schemaDataForFieldRef(fieldRef, o.dataContext.parentNode)) == null || (_schemaDataForFieldRe = _schemaDataForFieldRe.control) == null ? void 0 : _schemaDataForFieldRe.value : undefined;
|
|
1282
1352
|
var node = actualFieldRef ? schemas.schemaForFieldRef(actualFieldRef, options.schema) : undefined;
|
|
1283
|
-
return node ?
|
|
1353
|
+
return node ? /*#__PURE__*/jsxRuntime.jsx(ValueForField, {
|
|
1284
1354
|
renderer: renderer,
|
|
1285
1355
|
schema: node,
|
|
1286
1356
|
control: o.control
|
|
1287
|
-
}) :
|
|
1357
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1358
|
+
children: actualFieldRef ? "No schema node for " + actualFieldRef : ""
|
|
1359
|
+
});
|
|
1288
1360
|
}, {
|
|
1289
1361
|
renderType: RenderType
|
|
1290
1362
|
});
|
|
@@ -1302,7 +1374,7 @@ function ValueForField(_ref) {
|
|
|
1302
1374
|
"default": control
|
|
1303
1375
|
});
|
|
1304
1376
|
});
|
|
1305
|
-
var _useMemo =
|
|
1377
|
+
var _useMemo = react.useMemo(function () {
|
|
1306
1378
|
var rootSchema = schemas.rootSchemaNode([_extends({}, schema.field, {
|
|
1307
1379
|
field: "default",
|
|
1308
1380
|
required: false,
|
|
@@ -1317,7 +1389,7 @@ function ValueForField(_ref) {
|
|
|
1317
1389
|
var Render = schemas.useControlRendererComponent(schemas.groupedControl(controls), renderer, {
|
|
1318
1390
|
disabled: control.disabled
|
|
1319
1391
|
}, schemas.makeSchemaDataNode(rootSchema, value));
|
|
1320
|
-
return
|
|
1392
|
+
return /*#__PURE__*/jsxRuntime.jsx(Render, {});
|
|
1321
1393
|
} finally {
|
|
1322
1394
|
_effect();
|
|
1323
1395
|
}
|
|
@@ -1341,7 +1413,7 @@ function createOptionalAdornment(options) {
|
|
|
1341
1413
|
apply: function apply(rl) {
|
|
1342
1414
|
var _ref, _adornment$placement;
|
|
1343
1415
|
if (props.formOptions.readonly) return rl;
|
|
1344
|
-
if (!options.hideEdit && adornment.editSelectable) schemas.appendMarkupAt((_ref = (_adornment$placement = adornment.placement) != null ? _adornment$placement : options.defaultPlacement) != null ? _ref : schemas.AdornmentPlacement.LabelStart,
|
|
1416
|
+
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, {
|
|
1345
1417
|
control: editing,
|
|
1346
1418
|
className: options.checkClass
|
|
1347
1419
|
}))(rl);
|
|
@@ -1354,7 +1426,7 @@ function createOptionalAdornment(options) {
|
|
|
1354
1426
|
nullToggler: nullToggler,
|
|
1355
1427
|
dataContext: dataContext,
|
|
1356
1428
|
options: options
|
|
1357
|
-
}) :
|
|
1429
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(OptionalEditRenderer, {
|
|
1358
1430
|
children: children,
|
|
1359
1431
|
options: options,
|
|
1360
1432
|
editing: editing.as(),
|
|
@@ -1382,20 +1454,26 @@ function OptionalEditRenderer(_ref2) {
|
|
|
1382
1454
|
var nullToggler = schemas.getNullToggler(dataControl);
|
|
1383
1455
|
var allValues = schemas.getAllValues(dataControl);
|
|
1384
1456
|
var multipleValues = allValues.value.length > 1;
|
|
1385
|
-
var nullEdit = adornment.allowNull ?
|
|
1386
|
-
className: options.nullWrapperClass
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1457
|
+
var nullEdit = adornment.allowNull ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1458
|
+
className: options.nullWrapperClass,
|
|
1459
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(core.Fcheckbox, {
|
|
1460
|
+
control: nullToggler,
|
|
1461
|
+
className: options.checkClass,
|
|
1462
|
+
notValue: true
|
|
1463
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
1464
|
+
children: (_options$setNullText = options.setNullText) != null ? _options$setNullText : "Null"
|
|
1465
|
+
})]
|
|
1466
|
+
}) : undefined;
|
|
1467
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1468
|
+
className: options.className,
|
|
1469
|
+
children: multipleValues && editing.value === false ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1470
|
+
className: options.multiValuesClass,
|
|
1471
|
+
children: (_options$multiValuesT = options.multiValuesText) != null ? _options$multiValuesT : "Differing values"
|
|
1472
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1473
|
+
className: options.childWrapperClass,
|
|
1474
|
+
children: [nullEdit, children]
|
|
1475
|
+
})
|
|
1476
|
+
});
|
|
1399
1477
|
} finally {
|
|
1400
1478
|
_effect();
|
|
1401
1479
|
}
|
|
@@ -1403,7 +1481,7 @@ function OptionalEditRenderer(_ref2) {
|
|
|
1403
1481
|
|
|
1404
1482
|
function createMultilineFieldRenderer(className) {
|
|
1405
1483
|
return schemas.createDataRenderer(function (p) {
|
|
1406
|
-
return
|
|
1484
|
+
return /*#__PURE__*/jsxRuntime.jsx(MultilineTextfield, _extends({}, p, {
|
|
1407
1485
|
className: schemas.rendererClass(p.className, className)
|
|
1408
1486
|
}));
|
|
1409
1487
|
});
|
|
@@ -1413,7 +1491,7 @@ function MultilineTextfield(_ref) {
|
|
|
1413
1491
|
try {
|
|
1414
1492
|
var control = _ref.control,
|
|
1415
1493
|
className = _ref.className;
|
|
1416
|
-
var codeRef =
|
|
1494
|
+
var codeRef = react.useRef(null);
|
|
1417
1495
|
core.useControlEffect(function () {
|
|
1418
1496
|
return control.value;
|
|
1419
1497
|
}, function (v) {
|
|
@@ -1422,7 +1500,7 @@ function MultilineTextfield(_ref) {
|
|
|
1422
1500
|
c.textContent = v;
|
|
1423
1501
|
}
|
|
1424
1502
|
}, true);
|
|
1425
|
-
return
|
|
1503
|
+
return /*#__PURE__*/jsxRuntime.jsx("code", {
|
|
1426
1504
|
contentEditable: !control.disabled,
|
|
1427
1505
|
className: className,
|
|
1428
1506
|
onInput: function onInput(t) {
|
|
@@ -1440,7 +1518,7 @@ function createArrayElementRenderer(options) {
|
|
|
1440
1518
|
options = {};
|
|
1441
1519
|
}
|
|
1442
1520
|
return schemas.createDataRenderer(function (props, formRenderer) {
|
|
1443
|
-
return
|
|
1521
|
+
return /*#__PURE__*/jsxRuntime.jsx(ArrayElementRenderer, {
|
|
1444
1522
|
dataProps: props,
|
|
1445
1523
|
options: options,
|
|
1446
1524
|
formRenderer: formRenderer,
|
|
@@ -1486,33 +1564,36 @@ function ArrayElementRenderer(_ref) {
|
|
|
1486
1564
|
});
|
|
1487
1565
|
};
|
|
1488
1566
|
var parentDataNode = schemas.makeSchemaDataNode(dataProps.dataNode.schema, extData.fields.data);
|
|
1489
|
-
var elementGroup =
|
|
1567
|
+
var elementGroup = formNode.tree.createTempNode(formNode.id + "group", {
|
|
1490
1568
|
type: schemas.ControlDefinitionType.Group,
|
|
1491
|
-
children: formNode.definition.children,
|
|
1492
1569
|
groupOptions: {
|
|
1493
1570
|
type: schemas.GroupRenderType.Standard,
|
|
1494
1571
|
hideTitle: true
|
|
1495
1572
|
}
|
|
1496
|
-
}, formNode.
|
|
1497
|
-
var editContent =
|
|
1498
|
-
className: schemas.rendererClass(dataProps.className, options.className)
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1573
|
+
}, formNode.getChildNodes());
|
|
1574
|
+
var editContent = /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1575
|
+
className: schemas.rendererClass(dataProps.className, options.className),
|
|
1576
|
+
children: [renderChild("", elementGroup, {
|
|
1577
|
+
parentDataNode: parentDataNode,
|
|
1578
|
+
elementIndex: 0
|
|
1579
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1580
|
+
className: options.actionsClass,
|
|
1581
|
+
children: /*#__PURE__*/jsxRuntime.jsx(core.RenderElements, {
|
|
1582
|
+
control: extData.fields.actions,
|
|
1583
|
+
children: function children(c) {
|
|
1584
|
+
return formRenderer.renderAction(applyValidation(c.value));
|
|
1585
|
+
}
|
|
1586
|
+
})
|
|
1587
|
+
})]
|
|
1588
|
+
});
|
|
1509
1589
|
if (renderOptions.showInline || designMode) return editContent;
|
|
1510
|
-
return
|
|
1511
|
-
state: overlayState
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1590
|
+
return /*#__PURE__*/jsxRuntime.jsx(ariaBase.Modal, {
|
|
1591
|
+
state: overlayState,
|
|
1592
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ariaBase.Dialog, {
|
|
1593
|
+
children: editContent
|
|
1594
|
+
})
|
|
1595
|
+
});
|
|
1596
|
+
} else return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
1516
1597
|
} finally {
|
|
1517
1598
|
_effect();
|
|
1518
1599
|
}
|
|
@@ -1531,13 +1612,15 @@ function createButtonActionRenderer(actionId, options) {
|
|
|
1531
1612
|
actionId = _ref.actionId,
|
|
1532
1613
|
actionData = _ref.actionData,
|
|
1533
1614
|
disabled = _ref.disabled;
|
|
1534
|
-
var
|
|
1535
|
-
|
|
1536
|
-
|
|
1615
|
+
var Button = renderer.html.Button;
|
|
1616
|
+
var classNames = schemas.rendererClass(className, options.className);
|
|
1617
|
+
return /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1618
|
+
className: classNames,
|
|
1537
1619
|
disabled: disabled,
|
|
1538
1620
|
style: style,
|
|
1539
|
-
onClick: onClick
|
|
1540
|
-
|
|
1621
|
+
onClick: onClick,
|
|
1622
|
+
children: (_options$renderConten = options.renderContent == null ? void 0 : options.renderContent(actionText, actionId, actionData)) != null ? _options$renderConten : renderer.renderText(actionText, classNames)
|
|
1623
|
+
});
|
|
1541
1624
|
});
|
|
1542
1625
|
}
|
|
1543
1626
|
var DefaultBoolOptions = [{
|
|
@@ -1552,7 +1635,6 @@ function createDefaultDataRenderer(options) {
|
|
|
1552
1635
|
if (options === void 0) {
|
|
1553
1636
|
options = {};
|
|
1554
1637
|
}
|
|
1555
|
-
var h = React__default["default"].createElement;
|
|
1556
1638
|
var jsonataRenderer = createJsonataRenderer(options.jsonataClass);
|
|
1557
1639
|
var nullToggler = createNullToggleRenderer();
|
|
1558
1640
|
var multilineRenderer = createMultilineFieldRenderer(options.multilineClass);
|
|
@@ -1594,7 +1676,7 @@ function createDefaultDataRenderer(options) {
|
|
|
1594
1676
|
if (props.displayOnly || schemas.isDisplayOnlyRenderer(renderOptions)) return function (p) {
|
|
1595
1677
|
return _extends({}, p, {
|
|
1596
1678
|
className: "@ " + schemas.rendererClass(p.className, displayOnlyClass),
|
|
1597
|
-
children:
|
|
1679
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DefaultDisplayOnly, {
|
|
1598
1680
|
field: props.field,
|
|
1599
1681
|
schemaInterface: props.dataContext.schemaInterface,
|
|
1600
1682
|
control: props.control,
|
|
@@ -1632,11 +1714,13 @@ function createDefaultDataRenderer(options) {
|
|
|
1632
1714
|
}
|
|
1633
1715
|
if (fieldType == schemas.FieldType.Any) {
|
|
1634
1716
|
var _field$displayName;
|
|
1635
|
-
return
|
|
1717
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1718
|
+
children: ["Can't render field: ", (_field$displayName = field.displayName) != null ? _field$displayName : field.field, " (", renderType, ")"]
|
|
1719
|
+
});
|
|
1636
1720
|
}
|
|
1637
1721
|
if (schemas.isTextfieldRenderer(renderOptions) && renderOptions.multiline) return multilineRenderer.render(props, renderers);
|
|
1638
1722
|
var placeholder = schemas.isTextfieldRenderer(renderOptions) ? renderOptions.placeholder : undefined;
|
|
1639
|
-
return
|
|
1723
|
+
return /*#__PURE__*/jsxRuntime.jsx(ControlInput, {
|
|
1640
1724
|
className: schemas.rendererClass(props.className, inputClass),
|
|
1641
1725
|
style: props.style,
|
|
1642
1726
|
id: props.id,
|
|
@@ -1693,7 +1777,7 @@ function createDefaultAdornmentRenderer(options) {
|
|
|
1693
1777
|
});
|
|
1694
1778
|
var SetFieldWrapper = core.useTrackedComponent(setFieldWrapper, [dynamicHooks]);
|
|
1695
1779
|
return schemas.wrapLayout(function (x) {
|
|
1696
|
-
return
|
|
1780
|
+
return /*#__PURE__*/jsxRuntime.jsx(SetFieldWrapper, {
|
|
1697
1781
|
children: x,
|
|
1698
1782
|
parentContext: dataContext,
|
|
1699
1783
|
adornment: adornment
|
|
@@ -1702,13 +1786,13 @@ function createDefaultAdornmentRenderer(options) {
|
|
|
1702
1786
|
}
|
|
1703
1787
|
if (schemas.isIconAdornment(adornment)) {
|
|
1704
1788
|
var _adornment$placement;
|
|
1705
|
-
return schemas.appendMarkupAt((_adornment$placement = adornment.placement) != null ? _adornment$placement : schemas.AdornmentPlacement.ControlStart,
|
|
1789
|
+
return schemas.appendMarkupAt((_adornment$placement = adornment.placement) != null ? _adornment$placement : schemas.AdornmentPlacement.ControlStart, /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
1706
1790
|
className: adornment.iconClass
|
|
1707
1791
|
}))(rl);
|
|
1708
1792
|
}
|
|
1709
1793
|
if (schemas.isAccordionAdornment(adornment)) {
|
|
1710
1794
|
return schemas.wrapLayout(function (x) {
|
|
1711
|
-
return
|
|
1795
|
+
return /*#__PURE__*/jsxRuntime.jsx(DefaultAccordion, _extends({
|
|
1712
1796
|
renderers: renderers,
|
|
1713
1797
|
children: x,
|
|
1714
1798
|
accordion: adornment,
|
|
@@ -1739,21 +1823,37 @@ function createDefaultLabelRenderer(options) {
|
|
|
1739
1823
|
return {
|
|
1740
1824
|
render: function render(props, labelStart, labelEnd, renderers) {
|
|
1741
1825
|
var _options$requiredElem;
|
|
1742
|
-
var
|
|
1743
|
-
var requiredElement = (_options$requiredElem = options == null ? void 0 : options.requiredElement) != null ? _options$requiredElem : function (
|
|
1744
|
-
|
|
1826
|
+
var Label = renderers.html.Label;
|
|
1827
|
+
var requiredElement = (_options$requiredElem = options == null ? void 0 : options.requiredElement) != null ? _options$requiredElem : function (_ref5) {
|
|
1828
|
+
var Span = _ref5.Span;
|
|
1829
|
+
return /*#__PURE__*/jsxRuntime.jsx(Span, {
|
|
1830
|
+
children: " *"
|
|
1831
|
+
});
|
|
1745
1832
|
};
|
|
1746
1833
|
if (props.type == schemas.LabelType.Text) return renderers.renderText(props.label);
|
|
1747
|
-
return labelContainer(
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1834
|
+
return labelContainer(/*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1835
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(Label, {
|
|
1836
|
+
htmlFor: props.forId,
|
|
1837
|
+
className: schemas.rendererClass(props.className, clsx__default["default"](className, props.type === schemas.LabelType.Group && groupLabelClass, props.type === schemas.LabelType.Control && controlLabelClass)),
|
|
1838
|
+
children: [labelStart, renderers.renderLabelText(props.label), props.required && requiredElement(renderers.html)]
|
|
1839
|
+
}), labelEnd]
|
|
1840
|
+
}));
|
|
1751
1841
|
},
|
|
1752
1842
|
type: "label"
|
|
1753
1843
|
};
|
|
1754
1844
|
}
|
|
1845
|
+
var StandardHtmlComponents = {
|
|
1846
|
+
Button: "button",
|
|
1847
|
+
Label: "label",
|
|
1848
|
+
I: "i",
|
|
1849
|
+
Span: "span",
|
|
1850
|
+
Div: "div",
|
|
1851
|
+
H1: "h1",
|
|
1852
|
+
B: "b",
|
|
1853
|
+
Input: "input"
|
|
1854
|
+
};
|
|
1755
1855
|
function createDefaultRenderers(options) {
|
|
1756
|
-
var _options$renderText, _options$
|
|
1856
|
+
var _options$extraRendere, _options$renderText, _options$html;
|
|
1757
1857
|
if (options === void 0) {
|
|
1758
1858
|
options = {};
|
|
1759
1859
|
}
|
|
@@ -1767,10 +1867,11 @@ function createDefaultRenderers(options) {
|
|
|
1767
1867
|
adornment: createDefaultAdornmentRenderer(options.adornment),
|
|
1768
1868
|
renderLayout: createDefaultLayoutRenderer(options.layout),
|
|
1769
1869
|
visibility: createDefaultVisibilityRenderer(),
|
|
1870
|
+
extraRenderers: (_options$extraRendere = options.extraRenderers == null ? void 0 : options.extraRenderers(options)) != null ? _options$extraRendere : [],
|
|
1770
1871
|
renderText: (_options$renderText = options.renderText) != null ? _options$renderText : function (x) {
|
|
1771
1872
|
return x;
|
|
1772
1873
|
},
|
|
1773
|
-
|
|
1874
|
+
html: (_options$html = options.html) != null ? _options$html : StandardHtmlComponents
|
|
1774
1875
|
};
|
|
1775
1876
|
}
|
|
1776
1877
|
function createClassStyledRenderers() {
|
|
@@ -1800,10 +1901,12 @@ function createClassStyledRenderers() {
|
|
|
1800
1901
|
var defaultTailwindTheme = {
|
|
1801
1902
|
label: {
|
|
1802
1903
|
groupLabelClass: "font-bold",
|
|
1803
|
-
requiredElement: function requiredElement(
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1904
|
+
requiredElement: function requiredElement(_ref) {
|
|
1905
|
+
var Span = _ref.Span;
|
|
1906
|
+
return /*#__PURE__*/jsxRuntime.jsx(Span, {
|
|
1907
|
+
className: "text-red-500",
|
|
1908
|
+
children: " *"
|
|
1909
|
+
});
|
|
1807
1910
|
}
|
|
1808
1911
|
},
|
|
1809
1912
|
array: {
|
|
@@ -1834,6 +1937,7 @@ var defaultTailwindTheme = {
|
|
|
1834
1937
|
errorClass: "text-sm text-red-500"
|
|
1835
1938
|
},
|
|
1836
1939
|
data: {
|
|
1940
|
+
inputClass: "form-control",
|
|
1837
1941
|
displayOnlyClass: "flex flex-row items-center gap-2",
|
|
1838
1942
|
checkOptions: {
|
|
1839
1943
|
className: "flex items-center gap-4",
|
|
@@ -1884,6 +1988,7 @@ exports.Fcheckbox = Fcheckbox;
|
|
|
1884
1988
|
exports.JsonataRenderer = JsonataRenderer;
|
|
1885
1989
|
exports.OptionalEditRenderer = OptionalEditRenderer;
|
|
1886
1990
|
exports.SelectDataRenderer = SelectDataRenderer;
|
|
1991
|
+
exports.StandardHtmlComponents = StandardHtmlComponents;
|
|
1887
1992
|
exports.ValueForFieldExtension = ValueForFieldExtension;
|
|
1888
1993
|
exports.createAutocompleteRenderer = createAutocompleteRenderer;
|
|
1889
1994
|
exports.createButtonActionRenderer = createButtonActionRenderer;
|