datastake-daf 0.6.463 → 0.6.465
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/dist/components/index.js +6 -51
- package/dist/utils/index.js +662 -0
- package/package.json +5 -1
- package/rollup.config.js +4 -0
- package/src/@daf/core/components/Document/WordDocument/Preview/WordDocument.stories.js +640 -0
- package/src/@daf/core/components/Document/WordDocument/Preview/index.js +118 -0
- package/src/@daf/core/components/Document/WordDocument/createDocument.js +565 -0
- package/src/@daf/core/components/Document/WordDocument/index.js +9 -0
- package/src/@daf/core/components/DynamicForm/helper.js +0 -7
- package/src/@daf/core/components/DynamicForm/index.jsx +0 -37
- package/src/@daf/core/components/DynamicForm/storyConfig.js +0 -1
- package/src/@daf/core/components/EditForm/storyConfig.js +1 -1
- package/src/@daf/core/components/EditForm/storyConfig1.js +9932 -131
- package/src/@daf/core/components/ViewForm/components/DataLink/flat.js +1 -1
- package/src/helpers/componentsToImages.js +29 -0
- package/src/utils.js +4 -0
- package/dist/style/datastake/mapbox-gl.css +0 -330
|
@@ -89,13 +89,6 @@ export const checkCondition = (condition, repeatValues, formsValue) => {
|
|
|
89
89
|
};
|
|
90
90
|
export function showHideInput(input, formsValue, repeatIndex, repeatValues, setValues, ref) {
|
|
91
91
|
if (input?.meta?.hidden === true) {
|
|
92
|
-
// Set default value for hidden fields
|
|
93
|
-
if (input?.meta?.defaultValue !== undefined && !propHasValue(formsValue[ref])) {
|
|
94
|
-
formsValue[ref] = input.meta.defaultValue;
|
|
95
|
-
if (setValues && typeof setValues === 'function') {
|
|
96
|
-
setValues({ ...formsValue });
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
92
|
return false;
|
|
100
93
|
}
|
|
101
94
|
if (input.showIf) {
|
|
@@ -168,34 +168,6 @@ export default function DynamicForm({
|
|
|
168
168
|
}
|
|
169
169
|
}, [data]);
|
|
170
170
|
|
|
171
|
-
// Initialize default values for hidden fields
|
|
172
|
-
useEffect(() => {
|
|
173
|
-
if (Object.keys(form).length > 0) {
|
|
174
|
-
const updatedValues = { ...values };
|
|
175
|
-
let hasChanges = false;
|
|
176
|
-
|
|
177
|
-
// Process all form fields to set default values for hidden fields
|
|
178
|
-
Object.keys(form).forEach(formKey => {
|
|
179
|
-
Object.keys(form[formKey]).forEach(fieldKey => {
|
|
180
|
-
const field = form[formKey][fieldKey];
|
|
181
|
-
if (field?.meta?.hidden === true && field?.meta?.defaultValue !== undefined) {
|
|
182
|
-
const fieldId = field.dataId || fieldKey;
|
|
183
|
-
if (!propHasValue(updatedValues[fieldId])) {
|
|
184
|
-
updatedValues[fieldId] = field.meta.defaultValue;
|
|
185
|
-
hasChanges = true;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
if (hasChanges) {
|
|
192
|
-
setValues(updatedValues);
|
|
193
|
-
// Also set the values in the Ant Design form
|
|
194
|
-
MainForm.setFieldsValue(updatedValues);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}, [form]);
|
|
198
|
-
|
|
199
171
|
const setSelectedForm = (id) => {
|
|
200
172
|
setForms(Forms.map(form => {
|
|
201
173
|
(id === form.id)
|
|
@@ -295,15 +267,6 @@ export default function DynamicForm({
|
|
|
295
267
|
}
|
|
296
268
|
value = fileList;
|
|
297
269
|
}
|
|
298
|
-
|
|
299
|
-
// Handle default values for hidden fields
|
|
300
|
-
if (input?.meta?.hidden === true && input?.meta?.defaultValue !== undefined && !propHasValue(value)) {
|
|
301
|
-
value = input.meta.defaultValue;
|
|
302
|
-
if (typeof path === 'string') {
|
|
303
|
-
dot.str(path, value, values);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
270
|
const config = {
|
|
308
271
|
name,
|
|
309
272
|
call: input.call ? input.call : input?.meta?.call,
|