@react-typed-forms/schemas 11.11.1 → 11.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/createDefaultRenderers.d.ts +1 -0
- package/lib/hooks.d.ts +1 -1
- package/lib/index.js +116 -30
- package/lib/index.js.map +1 -1
- package/lib/schemaBuilder.d.ts +4 -0
- package/lib/types.d.ts +8 -2
- package/lib/util.d.ts +1 -1
- package/package.json +1 -1
|
@@ -70,5 +70,6 @@ interface DefaultLabelRendererOptions {
|
|
|
70
70
|
labelContainer?: (children: ReactElement) => ReactElement;
|
|
71
71
|
}
|
|
72
72
|
export declare function createDefaultLabelRenderer(options?: DefaultLabelRendererOptions): LabelRendererRegistration;
|
|
73
|
+
export declare function createNullToggleRenderer(): DataRendererRegistration;
|
|
73
74
|
export declare function createDefaultRenderers(options?: DefaultRendererOptions): DefaultRenderers;
|
|
74
75
|
export {};
|
package/lib/hooks.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare function useEvalVisibilityHook(useEvalExpressionHook: UseEvalExpr
|
|
|
8
8
|
export declare function useEvalReadonlyHook(useEvalExpressionHook: UseEvalExpressionHook, definition: ControlDefinition): EvalExpressionHook<boolean>;
|
|
9
9
|
export declare function useEvalStyleHook(useEvalExpressionHook: UseEvalExpressionHook, property: DynamicPropertyType, definition: ControlDefinition): EvalExpressionHook<React.CSSProperties>;
|
|
10
10
|
export declare function useEvalAllowedOptionsHook(useEvalExpressionHook: UseEvalExpressionHook, definition: ControlDefinition): EvalExpressionHook<any[]>;
|
|
11
|
-
export declare function useEvalDisabledHook(useEvalExpressionHook: UseEvalExpressionHook, definition: ControlDefinition): EvalExpressionHook<boolean>;
|
|
11
|
+
export declare function useEvalDisabledHook(useEvalExpressionHook: UseEvalExpressionHook, definition: ControlDefinition, fieldPath?: SchemaField[], elementIndex?: number): EvalExpressionHook<boolean>;
|
|
12
12
|
export declare function useEvalDisplayHook(useEvalExpressionHook: UseEvalExpressionHook, definition: ControlDefinition): DynamicHookGenerator<Control<string | undefined> | undefined, ControlDataContext>;
|
|
13
13
|
export declare function useEvalDefaultValueHook(useEvalExpressionHook: UseEvalExpressionHook, definition: ControlDefinition, schemaField: SchemaField | undefined, element: boolean): EvalExpressionHook;
|
|
14
14
|
export declare function defaultEvalHooks(expr: EntityExpression, context: ControlDataContext, coerce: (v: any) => any): Control<any>;
|
package/lib/index.js
CHANGED
|
@@ -58,6 +58,7 @@ exports.ExpressionType = void 0;
|
|
|
58
58
|
ExpressionType["Data"] = "Data";
|
|
59
59
|
ExpressionType["DataMatch"] = "FieldValue";
|
|
60
60
|
ExpressionType["UserMatch"] = "UserMatch";
|
|
61
|
+
ExpressionType["NotEmpty"] = "NotEmpty";
|
|
61
62
|
})(exports.ExpressionType || (exports.ExpressionType = {}));
|
|
62
63
|
exports.AdornmentPlacement = void 0;
|
|
63
64
|
(function (AdornmentPlacement) {
|
|
@@ -89,6 +90,7 @@ exports.DataRenderType = void 0;
|
|
|
89
90
|
DataRenderType["Dropdown"] = "Dropdown";
|
|
90
91
|
DataRenderType["DisplayOnly"] = "DisplayOnly";
|
|
91
92
|
DataRenderType["Group"] = "Group";
|
|
93
|
+
DataRenderType["NullToggle"] = "NullToggle";
|
|
92
94
|
})(exports.DataRenderType || (exports.DataRenderType = {}));
|
|
93
95
|
exports.SyncTextType = void 0;
|
|
94
96
|
(function (SyncTextType) {
|
|
@@ -197,7 +199,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
197
199
|
if (null == r) return {};
|
|
198
200
|
var t = {};
|
|
199
201
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
200
|
-
if (e.
|
|
202
|
+
if (e.includes(n)) continue;
|
|
201
203
|
t[n] = r[n];
|
|
202
204
|
}
|
|
203
205
|
return t;
|
|
@@ -500,10 +502,11 @@ function visitControlData(definition, ctx, cb) {
|
|
|
500
502
|
return undefined;
|
|
501
503
|
}
|
|
502
504
|
}
|
|
503
|
-
function lookupChildControl(data, path) {
|
|
504
|
-
|
|
505
|
+
function lookupChildControl(data, path, element) {
|
|
506
|
+
var fieldPath = path.map(function (x) {
|
|
505
507
|
return x.field;
|
|
506
|
-
})
|
|
508
|
+
});
|
|
509
|
+
return lookupChildControlPath(data, element == null ? fieldPath : [].concat(fieldPath, [element]));
|
|
507
510
|
}
|
|
508
511
|
function lookupChildControlPath(data, jsonPath) {
|
|
509
512
|
var childPath = [].concat(data.path, jsonPath);
|
|
@@ -710,6 +713,12 @@ function intField(displayName, options) {
|
|
|
710
713
|
displayName: displayName
|
|
711
714
|
}, options));
|
|
712
715
|
}
|
|
716
|
+
function doubleField(displayName, options) {
|
|
717
|
+
return makeScalarField(_extends({
|
|
718
|
+
type: exports.FieldType.Double,
|
|
719
|
+
displayName: displayName
|
|
720
|
+
}, options));
|
|
721
|
+
}
|
|
713
722
|
function dateField(displayName, options) {
|
|
714
723
|
return makeScalarField(_extends({
|
|
715
724
|
type: exports.FieldType.Date,
|
|
@@ -998,27 +1007,34 @@ function useEvalAllowedOptionsHook(useEvalExpressionHook, definition) {
|
|
|
998
1007
|
return core.useControl([]);
|
|
999
1008
|
}, undefined);
|
|
1000
1009
|
}
|
|
1001
|
-
function useEvalDisabledHook(useEvalExpressionHook, definition) {
|
|
1010
|
+
function useEvalDisabledHook(useEvalExpressionHook, definition, fieldPath, elementIndex) {
|
|
1002
1011
|
var dynamicDisabled = useEvalDynamicBoolHook(definition, exports.DynamicPropertyType.Disabled, useEvalExpressionHook);
|
|
1003
|
-
return makeDynamicPropertyHook(dynamicDisabled, function () {
|
|
1012
|
+
return makeDynamicPropertyHook(dynamicDisabled, function (ctx, _ref3) {
|
|
1013
|
+
var fieldPath = _ref3.fieldPath;
|
|
1004
1014
|
return core.useComputed(function () {
|
|
1005
|
-
|
|
1015
|
+
var _dataControl$meta$nul;
|
|
1016
|
+
var dataControl = fieldPath && lookupChildControl(ctx, fieldPath, elementIndex);
|
|
1017
|
+
var setToNull = (dataControl == null || (_dataControl$meta$nul = dataControl.meta["nullControl"]) == null ? void 0 : _dataControl$meta$nul.value) === false;
|
|
1018
|
+
return setToNull || isControlDisabled(definition);
|
|
1006
1019
|
});
|
|
1007
|
-
},
|
|
1020
|
+
}, {
|
|
1021
|
+
fieldPath: fieldPath,
|
|
1022
|
+
elementIndex: elementIndex
|
|
1023
|
+
});
|
|
1008
1024
|
}
|
|
1009
1025
|
function useEvalDisplayHook(useEvalExpressionHook, definition) {
|
|
1010
1026
|
return useEvalDynamicHook(definition, exports.DynamicPropertyType.Display, useEvalExpressionHook);
|
|
1011
1027
|
}
|
|
1012
1028
|
function useEvalDefaultValueHook(useEvalExpressionHook, definition, schemaField, element) {
|
|
1013
1029
|
var dynamicValue = useEvalDynamicHook(definition, exports.DynamicPropertyType.DefaultValue, useEvalExpressionHook);
|
|
1014
|
-
return makeDynamicPropertyHook(dynamicValue, function (ctx,
|
|
1015
|
-
var definition =
|
|
1016
|
-
schemaField =
|
|
1030
|
+
return makeDynamicPropertyHook(dynamicValue, function (ctx, _ref4) {
|
|
1031
|
+
var definition = _ref4.definition,
|
|
1032
|
+
schemaField = _ref4.schemaField;
|
|
1017
1033
|
return core.useComputed(calcDefault);
|
|
1018
1034
|
function calcDefault() {
|
|
1019
|
-
var
|
|
1020
|
-
required =
|
|
1021
|
-
dcv =
|
|
1035
|
+
var _ref5 = isDataControlDefinition(definition) ? [definition.required, definition.defaultValue] : [false, undefined],
|
|
1036
|
+
required = _ref5[0],
|
|
1037
|
+
dcv = _ref5[1];
|
|
1022
1038
|
return dcv != null ? dcv : schemaField ? element ? elementValueForField(schemaField) : defaultValueForField(schemaField, required, true) : undefined;
|
|
1023
1039
|
}
|
|
1024
1040
|
}, {
|
|
@@ -1051,6 +1067,20 @@ function useDataMatchExpression(fvExpr, fields, data, coerce) {
|
|
|
1051
1067
|
return coerce(Array.isArray(fv) ? fv.includes(fvExpr.value) : fv === fvExpr.value);
|
|
1052
1068
|
});
|
|
1053
1069
|
}
|
|
1070
|
+
function useNotEmptyExpression(fvExpr, fields, schemaInterface, data, coerce) {
|
|
1071
|
+
if (coerce === void 0) {
|
|
1072
|
+
coerce = function coerce(x) {
|
|
1073
|
+
return x;
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
var refField = findFieldPath(fields, fvExpr.field);
|
|
1077
|
+
var otherField = refField ? lookupChildControl(data, refField) : undefined;
|
|
1078
|
+
return core.useCalculatedControl(function () {
|
|
1079
|
+
var fv = otherField == null ? void 0 : otherField.value;
|
|
1080
|
+
var field = refField == null ? void 0 : refField.at(-1);
|
|
1081
|
+
return coerce(field && !schemaInterface.isEmptyValue(field, fv));
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
1054
1084
|
function defaultEvalHooks(expr, context, coerce) {
|
|
1055
1085
|
switch (expr.type) {
|
|
1056
1086
|
case exports.ExpressionType.Jsonata:
|
|
@@ -1059,6 +1089,8 @@ function defaultEvalHooks(expr, context, coerce) {
|
|
|
1059
1089
|
return useDataExpression(expr, context.fields, context, coerce);
|
|
1060
1090
|
case exports.ExpressionType.DataMatch:
|
|
1061
1091
|
return useDataMatchExpression(expr, context.fields, context, coerce);
|
|
1092
|
+
case exports.ExpressionType.NotEmpty:
|
|
1093
|
+
return useNotEmptyExpression(expr, context.fields, context.schemaInterface, context, coerce);
|
|
1062
1094
|
default:
|
|
1063
1095
|
return core.useControl(undefined);
|
|
1064
1096
|
}
|
|
@@ -1373,7 +1405,7 @@ var DefaultSchemaInterface = /*#__PURE__*/function () {
|
|
|
1373
1405
|
}();
|
|
1374
1406
|
var defaultSchemaInterface = new DefaultSchemaInterface();
|
|
1375
1407
|
|
|
1376
|
-
var _excluded$
|
|
1408
|
+
var _excluded$4 = ["definition", "field", "control", "formOptions", "style", "allowedOptions", "schemaInterface"];
|
|
1377
1409
|
var AppendAdornmentPriority = 0;
|
|
1378
1410
|
var WrapAdornmentPriority = 1000;
|
|
1379
1411
|
exports.LabelType = void 0;
|
|
@@ -1398,7 +1430,7 @@ function useControlRenderer(definition, fields, renderer, options) {
|
|
|
1398
1430
|
defaultValueControl: useEvalDefaultValueHook(useExpr, definition, schemaField, elementIndex != null),
|
|
1399
1431
|
visibleControl: useEvalVisibilityHook(useExpr, definition, fieldPath),
|
|
1400
1432
|
readonlyControl: useEvalReadonlyHook(useExpr, definition),
|
|
1401
|
-
disabledControl: useEvalDisabledHook(useExpr, definition),
|
|
1433
|
+
disabledControl: useEvalDisabledHook(useExpr, definition, fieldPath, elementIndex),
|
|
1402
1434
|
allowedOptions: useEvalAllowedOptionsHook(useExpr, definition),
|
|
1403
1435
|
labelText: useEvalLabelText(useExpr, definition),
|
|
1404
1436
|
actionData: useEvalActionHook(useExpr, definition),
|
|
@@ -1466,15 +1498,17 @@ function useControlRenderer(definition, fields, renderer, options) {
|
|
|
1466
1498
|
control = _getControlData[1],
|
|
1467
1499
|
controlDataContext = _getControlData[2];
|
|
1468
1500
|
core.useControlEffect(function () {
|
|
1469
|
-
|
|
1501
|
+
var _definition$renderOpt;
|
|
1502
|
+
return [visibility.value, defaultValueControl.value, control == null ? void 0 : control.isNull, isDataControlDefinition(definition) && definition.dontClearHidden, isDataControlDefinition(definition) && ((_definition$renderOpt = definition.renderOptions) == null ? void 0 : _definition$renderOpt.type) == exports.DataRenderType.NullToggle, parentControl.isNull, _options.hidden, readonlyControl.value];
|
|
1470
1503
|
}, function (_ref2) {
|
|
1471
1504
|
var vc = _ref2[0],
|
|
1472
1505
|
dv = _ref2[1],
|
|
1473
1506
|
_ = _ref2[2],
|
|
1474
1507
|
dontClear = _ref2[3],
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1508
|
+
dontDefault = _ref2[4],
|
|
1509
|
+
parentNull = _ref2[5],
|
|
1510
|
+
hidden = _ref2[6],
|
|
1511
|
+
ro = _ref2[7];
|
|
1478
1512
|
if (!ro) {
|
|
1479
1513
|
if (control) {
|
|
1480
1514
|
if (vc && vc.visible === vc.showing) {
|
|
@@ -1482,7 +1516,7 @@ function useControlRenderer(definition, fields, renderer, options) {
|
|
|
1482
1516
|
if (_options.clearHidden && !dontClear) {
|
|
1483
1517
|
control.value = undefined;
|
|
1484
1518
|
}
|
|
1485
|
-
} else control.setValue(function (x) {
|
|
1519
|
+
} else if (!dontDefault) control.setValue(function (x) {
|
|
1486
1520
|
return x != null ? x : dv;
|
|
1487
1521
|
});
|
|
1488
1522
|
}
|
|
@@ -1635,7 +1669,7 @@ function ControlRenderer(_ref3) {
|
|
|
1635
1669
|
}
|
|
1636
1670
|
}
|
|
1637
1671
|
function defaultDataProps(_ref4) {
|
|
1638
|
-
var _definition$validator, _allowedOptions$value, _definition$children, _definition$
|
|
1672
|
+
var _definition$validator, _allowedOptions$value, _definition$children, _definition$renderOpt2;
|
|
1639
1673
|
var definition = _ref4.definition,
|
|
1640
1674
|
field = _ref4.field,
|
|
1641
1675
|
control = _ref4.control,
|
|
@@ -1644,7 +1678,7 @@ function defaultDataProps(_ref4) {
|
|
|
1644
1678
|
allowedOptions = _ref4.allowedOptions,
|
|
1645
1679
|
_ref4$schemaInterface = _ref4.schemaInterface,
|
|
1646
1680
|
schemaInterface = _ref4$schemaInterface === void 0 ? defaultSchemaInterface : _ref4$schemaInterface,
|
|
1647
|
-
props = _objectWithoutPropertiesLoose(_ref4, _excluded$
|
|
1681
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded$4);
|
|
1648
1682
|
var lengthVal = (_definition$validator = definition.validators) == null ? void 0 : _definition$validator.find(function (x) {
|
|
1649
1683
|
return x.type === exports.ValidatorType.Length;
|
|
1650
1684
|
});
|
|
@@ -1669,7 +1703,7 @@ function defaultDataProps(_ref4) {
|
|
|
1669
1703
|
};
|
|
1670
1704
|
}) : fieldOptions,
|
|
1671
1705
|
readonly: !!formOptions.readonly,
|
|
1672
|
-
renderOptions: (_definition$
|
|
1706
|
+
renderOptions: (_definition$renderOpt2 = definition.renderOptions) != null ? _definition$renderOpt2 : {
|
|
1673
1707
|
type: "Standard"
|
|
1674
1708
|
},
|
|
1675
1709
|
required: required,
|
|
@@ -2015,7 +2049,7 @@ var defaultTailwindTheme = {
|
|
|
2015
2049
|
}
|
|
2016
2050
|
};
|
|
2017
2051
|
|
|
2018
|
-
var _excluded$
|
|
2052
|
+
var _excluded$3 = ["data", "display", "className", "style"];
|
|
2019
2053
|
function createDefaultDisplayRenderer(options) {
|
|
2020
2054
|
if (options === void 0) {
|
|
2021
2055
|
options = {};
|
|
@@ -2035,7 +2069,7 @@ function DefaultDisplay(_ref) {
|
|
|
2035
2069
|
display = _ref.display,
|
|
2036
2070
|
className = _ref.className,
|
|
2037
2071
|
style = _ref.style,
|
|
2038
|
-
options = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2072
|
+
options = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
2039
2073
|
switch (data.type) {
|
|
2040
2074
|
case exports.DisplayDataType.Icon:
|
|
2041
2075
|
return /*#__PURE__*/React__default["default"].createElement("i", {
|
|
@@ -2121,7 +2155,7 @@ function DefaultVisibility(_ref) {
|
|
|
2121
2155
|
}
|
|
2122
2156
|
}
|
|
2123
2157
|
|
|
2124
|
-
var _excluded$
|
|
2158
|
+
var _excluded$2 = ["state", "options", "className", "convert", "required", "emptyText", "requiredText", "readonly"];
|
|
2125
2159
|
function createSelectRenderer(options) {
|
|
2126
2160
|
if (options === void 0) {
|
|
2127
2161
|
options = {};
|
|
@@ -2156,7 +2190,7 @@ function SelectDataRenderer(_ref) {
|
|
|
2156
2190
|
_ref$requiredText = _ref.requiredText,
|
|
2157
2191
|
requiredText = _ref$requiredText === void 0 ? "<please select>" : _ref$requiredText,
|
|
2158
2192
|
readonly = _ref.readonly,
|
|
2159
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2193
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
2160
2194
|
var value = state.value,
|
|
2161
2195
|
disabled = state.disabled;
|
|
2162
2196
|
var _useState = React.useState(!required || value == null),
|
|
@@ -2223,7 +2257,7 @@ function DefaultDisplayOnly(_ref) {
|
|
|
2223
2257
|
}
|
|
2224
2258
|
}
|
|
2225
2259
|
|
|
2226
|
-
var _excluded = ["control", "convert"],
|
|
2260
|
+
var _excluded$1 = ["control", "convert"],
|
|
2227
2261
|
_excluded2 = ["errorText", "value", "onChange"];
|
|
2228
2262
|
function ControlInput(_ref) {
|
|
2229
2263
|
var _effect = core.useComponentTracking();
|
|
@@ -2233,7 +2267,7 @@ function ControlInput(_ref) {
|
|
|
2233
2267
|
};
|
|
2234
2268
|
var control = _ref.control,
|
|
2235
2269
|
convert = _ref.convert,
|
|
2236
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
2270
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
2237
2271
|
var _formControlProps = core.formControlProps(control),
|
|
2238
2272
|
errorText = _formControlProps.errorText,
|
|
2239
2273
|
value = _formControlProps.value,
|
|
@@ -2534,6 +2568,7 @@ function DefaultAccordion(_ref) {
|
|
|
2534
2568
|
}
|
|
2535
2569
|
}
|
|
2536
2570
|
|
|
2571
|
+
var _excluded = ["control", "field", "renderOptions"];
|
|
2537
2572
|
function createButtonActionRenderer(actionId, options) {
|
|
2538
2573
|
if (options === void 0) {
|
|
2539
2574
|
options = {};
|
|
@@ -2622,6 +2657,7 @@ function createDefaultDataRenderer(options) {
|
|
|
2622
2657
|
if (options === void 0) {
|
|
2623
2658
|
options = {};
|
|
2624
2659
|
}
|
|
2660
|
+
var nullToggler = createNullToggleRenderer();
|
|
2625
2661
|
var checkboxRenderer = createCheckboxRenderer((_options$checkOptions = options.checkOptions) != null ? _options$checkOptions : options.checkboxOptions);
|
|
2626
2662
|
var selectRenderer = createSelectRenderer(options.selectOptions);
|
|
2627
2663
|
var radioRenderer = createRadioRenderer((_options$radioOptions = options.radioOptions) != null ? _options$radioOptions : options.checkOptions);
|
|
@@ -2679,6 +2715,8 @@ function createDefaultDataRenderer(options) {
|
|
|
2679
2715
|
return optionRenderer.render(props, renderers);
|
|
2680
2716
|
}
|
|
2681
2717
|
switch (renderType) {
|
|
2718
|
+
case exports.DataRenderType.NullToggle:
|
|
2719
|
+
return nullToggler.render(props, renderers);
|
|
2682
2720
|
case exports.DataRenderType.CheckList:
|
|
2683
2721
|
return checkListRenderer.render(props, renderers);
|
|
2684
2722
|
case exports.DataRenderType.Dropdown:
|
|
@@ -2779,6 +2817,52 @@ function createDefaultLabelRenderer(options) {
|
|
|
2779
2817
|
type: "label"
|
|
2780
2818
|
};
|
|
2781
2819
|
}
|
|
2820
|
+
function createNullToggleRenderer() {
|
|
2821
|
+
return createDataRenderer(function (_ref7, renderers) {
|
|
2822
|
+
var _control$meta, _nullControl, _control$meta$_nullCo;
|
|
2823
|
+
var control = _ref7.control,
|
|
2824
|
+
field = _ref7.field,
|
|
2825
|
+
props = _objectWithoutPropertiesLoose(_ref7, _excluded);
|
|
2826
|
+
var nullControl = (_control$meta$_nullCo = (_control$meta = control.meta)[_nullControl = "nullControl"]) != null ? _control$meta$_nullCo : _control$meta[_nullControl] = core.newControl(control.current.value != null);
|
|
2827
|
+
return function (layout) {
|
|
2828
|
+
var newLayout = renderers.renderData(_extends({}, props, {
|
|
2829
|
+
control: nullControl,
|
|
2830
|
+
field: _extends({}, field, {
|
|
2831
|
+
type: exports.FieldType.Bool
|
|
2832
|
+
}),
|
|
2833
|
+
renderOptions: {
|
|
2834
|
+
type: exports.DataRenderType.Checkbox
|
|
2835
|
+
}
|
|
2836
|
+
}))(layout);
|
|
2837
|
+
return _extends({}, newLayout, {
|
|
2838
|
+
children: /*#__PURE__*/React__default["default"].createElement(NullWrapper, {
|
|
2839
|
+
control: control,
|
|
2840
|
+
nullControl: nullControl,
|
|
2841
|
+
children: newLayout.children,
|
|
2842
|
+
defaultValue: props.definition.defaultValue
|
|
2843
|
+
})
|
|
2844
|
+
});
|
|
2845
|
+
};
|
|
2846
|
+
});
|
|
2847
|
+
}
|
|
2848
|
+
function NullWrapper(_ref8) {
|
|
2849
|
+
var children = _ref8.children,
|
|
2850
|
+
nullControl = _ref8.nullControl,
|
|
2851
|
+
control = _ref8.control,
|
|
2852
|
+
defaultValue = _ref8.defaultValue;
|
|
2853
|
+
core.useControlEffect(function () {
|
|
2854
|
+
return nullControl.value;
|
|
2855
|
+
}, function (e) {
|
|
2856
|
+
if (e) {
|
|
2857
|
+
var _nullControl$meta$non;
|
|
2858
|
+
control.value = (_nullControl$meta$non = nullControl.meta["nonNullValue"]) != null ? _nullControl$meta$non : defaultValue;
|
|
2859
|
+
} else {
|
|
2860
|
+
nullControl.meta["nonNullValue"] = control.value;
|
|
2861
|
+
control.value = null;
|
|
2862
|
+
}
|
|
2863
|
+
});
|
|
2864
|
+
return children;
|
|
2865
|
+
}
|
|
2782
2866
|
function createDefaultRenderers(options) {
|
|
2783
2867
|
if (options === void 0) {
|
|
2784
2868
|
options = {};
|
|
@@ -3008,6 +3092,7 @@ exports.createGroupRenderer = createGroupRenderer;
|
|
|
3008
3092
|
exports.createInputConversion = createInputConversion;
|
|
3009
3093
|
exports.createLabelRenderer = createLabelRenderer;
|
|
3010
3094
|
exports.createLayoutRenderer = createLayoutRenderer;
|
|
3095
|
+
exports.createNullToggleRenderer = createNullToggleRenderer;
|
|
3011
3096
|
exports.createRadioRenderer = createRadioRenderer;
|
|
3012
3097
|
exports.createSelectConversion = createSelectConversion;
|
|
3013
3098
|
exports.createSelectRenderer = createSelectRenderer;
|
|
@@ -3026,6 +3111,7 @@ exports.defaultTailwindTheme = defaultTailwindTheme;
|
|
|
3026
3111
|
exports.defaultUseEvalExpressionHook = defaultUseEvalExpressionHook;
|
|
3027
3112
|
exports.defaultValueForField = defaultValueForField;
|
|
3028
3113
|
exports.defaultValueForFields = defaultValueForFields;
|
|
3114
|
+
exports.doubleField = doubleField;
|
|
3029
3115
|
exports.dynamicDefaultValue = dynamicDefaultValue;
|
|
3030
3116
|
exports.dynamicDisabled = dynamicDisabled;
|
|
3031
3117
|
exports.dynamicReadonly = dynamicReadonly;
|