df-ae-forms-package 1.0.92 → 1.0.93
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/index.esm.js +14 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4566,7 +4566,7 @@ formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChan
|
|
|
4566
4566
|
position: 'sticky',
|
|
4567
4567
|
bottom: 0,
|
|
4568
4568
|
zIndex: 5
|
|
4569
|
-
}, children: jsxRuntime.jsxs("button", { onClick: onAddEntry, disabled: dataEntries.length >= maxEntries, style: {
|
|
4569
|
+
}, children: jsxRuntime.jsxs("button", { onClick: () => { console.log('[TableView] Add Entry button clicked (grid view)', 'entries:', dataEntries.length, 'max:', maxEntries); onAddEntry(); }, disabled: dataEntries.length >= maxEntries, style: {
|
|
4570
4570
|
padding: '8px 16px',
|
|
4571
4571
|
backgroundColor: dataEntries.length >= maxEntries ? '#f3f4f6' : '#10b981',
|
|
4572
4572
|
color: dataEntries.length >= maxEntries ? '#9ca3af' : '#ffffff',
|
|
@@ -4688,7 +4688,7 @@ formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChan
|
|
|
4688
4688
|
borderRadius: '8px',
|
|
4689
4689
|
display: 'flex',
|
|
4690
4690
|
justifyContent: 'center'
|
|
4691
|
-
}, children: jsxRuntime.jsxs("button", { onClick: onAddEntry, disabled: dataEntries.length >= maxEntries, style: {
|
|
4691
|
+
}, children: jsxRuntime.jsxs("button", { onClick: () => { console.log('[TableView] Add Entry button clicked (list view)', 'entries:', dataEntries.length, 'max:', maxEntries); onAddEntry(); }, disabled: dataEntries.length >= maxEntries, style: {
|
|
4692
4692
|
padding: '8px 16px',
|
|
4693
4693
|
backgroundColor: dataEntries.length >= maxEntries ? '#f3f4f6' : '#10b981',
|
|
4694
4694
|
color: dataEntries.length >= maxEntries ? '#9ca3af' : '#ffffff',
|
|
@@ -4938,6 +4938,10 @@ const DfFormDataGrid = ({ id, properties, mode = 'edit', formData = {}, onValueC
|
|
|
4938
4938
|
// In edit/preview modes, don't handle value changes as components are read-only
|
|
4939
4939
|
}, [mode, onValueChange]);
|
|
4940
4940
|
const handleAddEntry = React.useCallback(() => {
|
|
4941
|
+
console.log('[DfFormDataGrid] handleAddEntry called');
|
|
4942
|
+
console.log('[DfFormDataGrid] gridComponents:', gridComponents.length, gridComponents.map(c => c.id));
|
|
4943
|
+
console.log('[DfFormDataGrid] current entries:', properties.entries?.length);
|
|
4944
|
+
console.log('[DfFormDataGrid] onValueChange exists:', !!onValueChange);
|
|
4941
4945
|
// Use timestamp and random string to ensure uniqueness even if entries are deleted
|
|
4942
4946
|
const uniqueSuffix = `${Date.now()}-${Math.random().toString(36).substr(2, 5)}`;
|
|
4943
4947
|
const newEntryId = `entry-${uniqueSuffix}`;
|
|
@@ -4959,13 +4963,19 @@ const DfFormDataGrid = ({ id, properties, mode = 'edit', formData = {}, onValueC
|
|
|
4959
4963
|
}),
|
|
4960
4964
|
styles: {}
|
|
4961
4965
|
};
|
|
4966
|
+
console.log('[DfFormDataGrid] newEntry created:', newEntry.id, 'with', newEntry.components.length, 'components');
|
|
4962
4967
|
const updatedEntries = [...properties.entries, newEntry];
|
|
4968
|
+
console.log('[DfFormDataGrid] updatedEntries count:', updatedEntries.length);
|
|
4963
4969
|
if (onValueChange) {
|
|
4970
|
+
console.log('[DfFormDataGrid] calling onValueChange with updated entries');
|
|
4964
4971
|
onValueChange({
|
|
4965
4972
|
id,
|
|
4966
4973
|
value: { ...properties, entries: updatedEntries }
|
|
4967
4974
|
});
|
|
4968
4975
|
}
|
|
4976
|
+
else {
|
|
4977
|
+
console.log('[DfFormDataGrid] WARNING: onValueChange is not defined!');
|
|
4978
|
+
}
|
|
4969
4979
|
onEntryAdd?.();
|
|
4970
4980
|
}, [properties, onValueChange, id, onEntryAdd, gridComponents]);
|
|
4971
4981
|
const handleRemoveEntry = React.useCallback((entryIndex) => {
|
|
@@ -6542,8 +6552,10 @@ onComponentSelect, onComponentDelete, onComponentEdit, onComponentUpdate, select
|
|
|
6542
6552
|
});
|
|
6543
6553
|
onFormDataChange?.(updatedComponents);
|
|
6544
6554
|
}, onValueChange: (change) => {
|
|
6555
|
+
console.log('[DfFormPreview] datagrid onValueChange received:', change.id, 'hasEntries:', change.value && typeof change.value === 'object' && 'entries' in change.value);
|
|
6545
6556
|
// Handle datagrid value changes (entries updates)
|
|
6546
6557
|
if (change.id === component.id && change.value && typeof change.value === 'object' && 'entries' in change.value) {
|
|
6558
|
+
console.log('[DfFormPreview] datagrid entries update - entries count:', change.value.entries?.length);
|
|
6547
6559
|
// Update localFormComponents with new entries structure
|
|
6548
6560
|
const updatedComponents = localFormComponents.map(comp => {
|
|
6549
6561
|
if (comp.id === component.id) {
|