@skalfa/skalfa-component 1.0.51 → 1.0.52
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.
|
@@ -197,7 +197,8 @@ function FormSupervisionComponent({ title, fields, submitControl, confirmation,
|
|
|
197
197
|
if (form?.onHide?.(valMap, prefix))
|
|
198
198
|
return null;
|
|
199
199
|
const ws = watchState[name];
|
|
200
|
-
|
|
200
|
+
const isHidden = form.construction?.hidden ?? ws?.hidden;
|
|
201
|
+
if (isHidden)
|
|
201
202
|
return null;
|
|
202
203
|
if (inputType === "cluster") {
|
|
203
204
|
const { name: mapName, fields: innerForms, label, tip, wrap, className, min } = form.construction;
|
|
@@ -247,7 +248,10 @@ function FormSupervisionComponent({ title, fields, submitControl, confirmation,
|
|
|
247
248
|
return ((0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)(form.className, generateColClass(form.col || "12")), children: customRender?.({ formControl, values, setValues, errors, setErrors, setRegister, prefixName: prefix }) }, key));
|
|
248
249
|
}
|
|
249
250
|
const Component = inputMap[inputType] || __1.InputComponent;
|
|
250
|
-
|
|
251
|
+
const construction = form.construction || {};
|
|
252
|
+
const disabled = construction.disabled ?? ws?.disabled;
|
|
253
|
+
const readOnly = construction.readOnly ?? ws?.readOnly;
|
|
254
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)(form.className, generateColClass(form.col || "12")), children: (0, jsx_runtime_1.jsx)(Component, { ...construction, ...formControl(name), disabled: disabled, readOnly: readOnly, name: name }) }, key));
|
|
251
255
|
};
|
|
252
256
|
(0, react_1.useEffect)(() => {
|
|
253
257
|
(modal == "failed") && setModal(false);
|
package/package.json
CHANGED
|
@@ -107,7 +107,7 @@ export type WatchAction = {
|
|
|
107
107
|
hidden ?: boolean
|
|
108
108
|
value ?: any
|
|
109
109
|
required ?: boolean
|
|
110
|
-
|
|
110
|
+
readOnly ?: boolean
|
|
111
111
|
reset ?: boolean
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -389,7 +389,8 @@ export function FormSupervisionComponent({
|
|
|
389
389
|
if (form?.onHide?.(valMap, prefix)) return null;
|
|
390
390
|
|
|
391
391
|
const ws = watchState[name];
|
|
392
|
-
|
|
392
|
+
const isHidden = (form.construction as any)?.hidden ?? ws?.hidden;
|
|
393
|
+
if (isHidden) return null;
|
|
393
394
|
|
|
394
395
|
if (inputType === "cluster") {
|
|
395
396
|
const { name: mapName, fields: innerForms, label, tip, wrap, className, min } = form.construction as ClusterConstruction;
|
|
@@ -492,13 +493,17 @@ export function FormSupervisionComponent({
|
|
|
492
493
|
}
|
|
493
494
|
|
|
494
495
|
const Component = inputMap[inputType] || InputComponent;
|
|
496
|
+
const construction = (form.construction as any) || {};
|
|
497
|
+
const disabled = construction.disabled ?? ws?.disabled;
|
|
498
|
+
const readOnly = construction.readOnly ?? ws?.readOnly;
|
|
499
|
+
|
|
495
500
|
return (
|
|
496
501
|
<div key={key} className={cn(form.className, generateColClass(form.col || "12"))}>
|
|
497
502
|
<Component
|
|
498
|
-
{...
|
|
503
|
+
{...construction}
|
|
499
504
|
{...formControl(name)}
|
|
500
|
-
disabled={
|
|
501
|
-
readOnly={
|
|
505
|
+
disabled={disabled}
|
|
506
|
+
readOnly={readOnly}
|
|
502
507
|
name={name}
|
|
503
508
|
/>
|
|
504
509
|
</div>
|