unifyedx-storybook-new 0.1.57 → 0.1.58
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.
|
@@ -75240,7 +75240,7 @@ function TreeView({
|
|
|
75240
75240
|
] });
|
|
75241
75241
|
}
|
|
75242
75242
|
|
|
75243
|
-
const getOptionsFromConfig = (optionsFrom, configData) => {
|
|
75243
|
+
const getOptionsFromConfig = React__default.useCallback((optionsFrom, configData) => {
|
|
75244
75244
|
if (!optionsFrom || !configData) return [];
|
|
75245
75245
|
const { config, valueField, labelField } = optionsFrom;
|
|
75246
75246
|
const configSection = configData[config];
|
|
@@ -75249,7 +75249,7 @@ const getOptionsFromConfig = (optionsFrom, configData) => {
|
|
|
75249
75249
|
value: item[valueField],
|
|
75250
75250
|
label: item[labelField]
|
|
75251
75251
|
}));
|
|
75252
|
-
};
|
|
75252
|
+
}, []);
|
|
75253
75253
|
function SectionRenderer({ item, data: initialData, updateHandler, validationErrors = {} }) {
|
|
75254
75254
|
console.log(item);
|
|
75255
75255
|
const [section, setSection] = React__default.useState(item);
|
|
@@ -75428,8 +75428,14 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
|
|
|
75428
75428
|
onChange: (value) => {
|
|
75429
75429
|
const newData = { ...data, [field.key]: value };
|
|
75430
75430
|
setData(newData);
|
|
75431
|
+
if (updateHandler) {
|
|
75432
|
+
updateHandler(section.key, newData);
|
|
75433
|
+
}
|
|
75431
75434
|
},
|
|
75432
|
-
options:
|
|
75435
|
+
options: React__default.useMemo(
|
|
75436
|
+
() => field.optionsFrom ? getOptionsFromConfig(field.optionsFrom, initialData) : field.options || [],
|
|
75437
|
+
[field.optionsFrom, initialData, field.options]
|
|
75438
|
+
),
|
|
75433
75439
|
placeholder: field.placeholder || `Select ${field.label}`,
|
|
75434
75440
|
required: field.required,
|
|
75435
75441
|
disabled: field.disabled ? field.disabled : false,
|