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.
@@ -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,
@@ -204,7 +204,6 @@ export const storyData = {
204
204
  "notAvailable": true,
205
205
  "group": "identification",
206
206
  "hidden": true,
207
- "defaultValue": "plot",
208
207
  "mandatory": true
209
208
  },
210
209
  "position": 2,
@@ -1,3 +1,3 @@
1
- import { getApiBaseUrl, getAppHeader, storyData } from "./storyConfig2";
1
+ import { getApiBaseUrl, getAppHeader, storyData } from "./storyConfig1";
2
2
 
3
3
  export { getApiBaseUrl, getAppHeader, storyData };