df-ae-forms-package 1.0.97 → 1.0.98
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.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +16 -5
- package/dist/index.esm.js +58 -101
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +56 -99
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4334,57 +4334,20 @@ const DraggableGridComponent = ({ component, selectedComponent, mode, onComponen
|
|
|
4334
4334
|
e.currentTarget.style.backgroundColor = '#ef4444';
|
|
4335
4335
|
}, children: jsxRuntime.jsx(lucideReact.Trash2, { size: 12 }) })] }))] }));
|
|
4336
4336
|
};
|
|
4337
|
-
|
|
4338
|
-
const GridDropZone = ({ gridComponents, mode, onComponentSelect, onComponentDelete, onComponentEdit, onComponentUpdate, selectedComponent, renderFormComponent, gridId, formData, formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChange, onAttachmentChange, columnView, shouldShowComponent }) => {
|
|
4337
|
+
const GridDropZone = ({ gridComponents, mode, onComponentSelect, onComponentDelete, onComponentEdit, onComponentUpdate, selectedComponent, renderFormComponent, gridId, formData = {}, formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChange, onAttachmentChange, columnView = false, shouldShowComponent }) => {
|
|
4339
4338
|
const { setNodeRef, isOver } = core.useDroppable({
|
|
4340
4339
|
id: `grid-drop-zone-${gridId}`,
|
|
4341
|
-
disabled: mode !== 'edit'
|
|
4342
|
-
data: {
|
|
4343
|
-
isGridDropZone: true,
|
|
4344
|
-
gridId: gridId
|
|
4345
|
-
}
|
|
4346
|
-
});
|
|
4347
|
-
// Sensors for drag and drop
|
|
4348
|
-
const sensors = core.useSensors(core.useSensor(core.PointerSensor, {
|
|
4349
|
-
activationConstraint: {
|
|
4350
|
-
distance: 8,
|
|
4351
|
-
},
|
|
4352
|
-
}), core.useSensor(core.KeyboardSensor, {
|
|
4353
|
-
coordinateGetter: sortable.sortableKeyboardCoordinates,
|
|
4354
|
-
}));
|
|
4355
|
-
const handleDragEnd = ((event) => {
|
|
4356
|
-
const { active, over } = event;
|
|
4357
|
-
if (over && active.id !== over.id) {
|
|
4358
|
-
gridComponents.findIndex((item) => item.id === active.id);
|
|
4359
|
-
gridComponents.findIndex((item) => item.id === over.id);
|
|
4360
|
-
}
|
|
4340
|
+
disabled: mode !== 'edit'
|
|
4361
4341
|
});
|
|
4362
|
-
return (jsxRuntime.jsx("div", { ref: setNodeRef, className:
|
|
4363
|
-
border: isOver ? '2px dashed #3b82f6' : '
|
|
4342
|
+
return (jsxRuntime.jsx("div", { ref: setNodeRef, className: "grid-drop-zone", style: {
|
|
4343
|
+
border: isOver ? '2px dashed #3b82f6' : '2px dashed #d1d5db',
|
|
4364
4344
|
borderRadius: '8px',
|
|
4365
4345
|
padding: '16px',
|
|
4366
|
-
backgroundColor: isOver ? 'var(--df-color-primary-light)' : '
|
|
4367
|
-
minHeight: '
|
|
4368
|
-
transition: 'all 0.2s ease'
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
color: 'var(--df-color-text-light)',
|
|
4372
|
-
fontSize: '14px',
|
|
4373
|
-
padding: '40px 20px',
|
|
4374
|
-
display: 'flex',
|
|
4375
|
-
flexDirection: 'column',
|
|
4376
|
-
alignItems: 'center',
|
|
4377
|
-
gap: '8px',
|
|
4378
|
-
backgroundColor: 'var(--df-color-fb-container)',
|
|
4379
|
-
border: '1px dashed var(--df-color-fb-border)',
|
|
4380
|
-
borderRadius: '8px'
|
|
4381
|
-
}, children: [jsxRuntime.jsx("div", { style: {
|
|
4382
|
-
fontWeight: '500',
|
|
4383
|
-
color: isOver ? 'var(--df-color-primary)' : 'var(--df-color-text-dark)'
|
|
4384
|
-
}, children: isOver ? 'Drop components here' : 'Empty DataGrid' }), jsxRuntime.jsx("div", { style: {
|
|
4385
|
-
fontSize: '12px',
|
|
4386
|
-
color: '#9ca3af'
|
|
4387
|
-
}, children: "Drag and drop components here to create your grid" })] })) : (jsxRuntime.jsxs(core.DndContext, { sensors: sensors, onDragEnd: handleDragEnd, children: [jsxRuntime.jsx(sortable.SortableContext, { items: gridComponents.map(c => c.id), strategy: columnView ? sortable.verticalListSortingStrategy : sortable.horizontalListSortingStrategy, children: jsxRuntime.jsx("div", { style: {
|
|
4346
|
+
backgroundColor: isOver ? 'var(--df-color-primary-light)' : 'var(--df-color-fb-container)',
|
|
4347
|
+
minHeight: '120px',
|
|
4348
|
+
transition: 'all 0.2s ease',
|
|
4349
|
+
position: 'relative'
|
|
4350
|
+
}, children: gridComponents.length > 0 ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(sortable.SortableContext, { items: gridComponents.map(c => c.id), strategy: sortable.horizontalListSortingStrategy, children: jsxRuntime.jsx("div", { style: {
|
|
4388
4351
|
display: 'flex',
|
|
4389
4352
|
flexDirection: columnView ? 'column' : 'row',
|
|
4390
4353
|
flexWrap: 'nowrap',
|
|
@@ -4409,14 +4372,28 @@ const GridDropZone = ({ gridComponents, mode, onComponentSelect, onComponentDele
|
|
|
4409
4372
|
minHeight: '40px',
|
|
4410
4373
|
display: 'flex',
|
|
4411
4374
|
alignItems: 'center',
|
|
4412
|
-
justifyContent: 'center'
|
|
4413
|
-
|
|
4414
|
-
|
|
4375
|
+
justifyContent: 'center'
|
|
4376
|
+
}, children: isOver ? (jsxRuntime.jsx("span", { style: { color: '#3b82f6', fontWeight: '500' }, children: "Drop component here to add to grid" })) : (jsxRuntime.jsx("span", { children: "+ Drop more components here" })) })] })) : (jsxRuntime.jsxs("div", { style: {
|
|
4377
|
+
textAlign: 'center',
|
|
4378
|
+
color: 'var(--df-color-text-light)',
|
|
4379
|
+
fontSize: '14px',
|
|
4380
|
+
padding: '40px 20px',
|
|
4381
|
+
display: 'flex',
|
|
4382
|
+
flexDirection: 'column',
|
|
4383
|
+
alignItems: 'center',
|
|
4384
|
+
gap: '8px',
|
|
4385
|
+
backgroundColor: 'var(--df-color-fb-container)',
|
|
4386
|
+
border: '1px dashed var(--df-color-fb-border)',
|
|
4387
|
+
borderRadius: '8px'
|
|
4388
|
+
}, children: [jsxRuntime.jsx("div", { style: {
|
|
4389
|
+
fontWeight: '500',
|
|
4390
|
+
color: isOver ? 'var(--df-color-primary)' : 'var(--df-color-text-dark)'
|
|
4391
|
+
}, children: isOver ? 'Drop components here' : 'Empty DataGrid' }), jsxRuntime.jsx("div", { style: {
|
|
4392
|
+
fontSize: '12px',
|
|
4393
|
+
color: '#9ca3af'
|
|
4394
|
+
}, children: "Drag and drop components here to create your grid" })] })) }));
|
|
4415
4395
|
};
|
|
4416
|
-
|
|
4417
|
-
const TableView = ({ templateComponents, dataEntries, renderFormComponent, mode, allowAddRemoveEntries, addAnotherText, removeText, maxEntries, minEntries, displayAsGrid = true, onAddEntry, onRemoveEntry, formData, // Use current formData to render values
|
|
4418
|
-
formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChange, onAttachmentChange, columnView, shouldShowComponent }) => {
|
|
4419
|
-
const _formData = formData || {};
|
|
4396
|
+
const TableView = ({ templateComponents, dataEntries, renderFormComponent, mode = 'preview', allowAddRemoveEntries = true, addAnotherText = 'Add Another', removeText = 'Remove', maxEntries = 10, minEntries = 1, displayAsGrid = true, onAddEntry, onRemoveEntry, formData: _formData = {}, formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChange, onAttachmentChange, columnView = false, shouldShowComponent }) => {
|
|
4420
4397
|
const visibleTemplateComponents = React.useMemo(() => {
|
|
4421
4398
|
if (!shouldShowComponent)
|
|
4422
4399
|
return templateComponents;
|
|
@@ -4478,18 +4455,16 @@ formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChan
|
|
|
4478
4455
|
whiteSpace: 'nowrap',
|
|
4479
4456
|
overflow: 'hidden',
|
|
4480
4457
|
textOverflow: 'ellipsis'
|
|
4481
|
-
}, children: component.basic?.label || `Column ${index + 1}` }, `header-${component.id
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
: undefined,
|
|
4458
|
+
}, children: component.basic?.label || `Column ${index + 1}` }, `header-${component.id}`))) })), dataEntries.length > 0 ? (dataEntries.map((entry, entryIndex) => (jsxRuntime.jsxs("div", { className: "table-row", style: {
|
|
4459
|
+
display: 'grid',
|
|
4460
|
+
// Change grid columns to 1fr for column view
|
|
4461
|
+
gridTemplateColumns: columnView
|
|
4462
|
+
? '1fr'
|
|
4463
|
+
: `repeat(${visibleTemplateComponents.length}, minmax(150px, 1fr))`,
|
|
4488
4464
|
borderBottom: entryIndex < dataEntries.length - 1 ? '1px solid var(--df-color-fb-border)' : 'none',
|
|
4489
4465
|
backgroundColor: entryIndex % 2 === 0 ? 'var(--df-color-fb-container)' : 'var(--df-color-fb-bg)',
|
|
4490
4466
|
position: 'relative',
|
|
4491
|
-
minWidth: columnView ? '100%' : `${visibleTemplateComponents.length * 150}px
|
|
4492
|
-
padding: columnView ? '16px' : '0'
|
|
4467
|
+
minWidth: columnView ? '100%' : `${visibleTemplateComponents.length * 150}px`
|
|
4493
4468
|
}, children: [visibleTemplateComponents.map((templateComponent, componentIndex) => {
|
|
4494
4469
|
let entryComponent = entry.components?.[componentIndex];
|
|
4495
4470
|
if (!entryComponent) {
|
|
@@ -4515,24 +4490,21 @@ formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChan
|
|
|
4515
4490
|
};
|
|
4516
4491
|
}
|
|
4517
4492
|
return (jsxRuntime.jsx("div", { style: {
|
|
4518
|
-
padding:
|
|
4493
|
+
padding: '12px 16px',
|
|
4519
4494
|
borderRight: !columnView && componentIndex < visibleTemplateComponents.length - 1 ? '1px solid var(--df-color-fb-border)' : 'none',
|
|
4520
4495
|
// Add bottom border for fields in column view except the last one
|
|
4521
4496
|
borderBottom: columnView && componentIndex < visibleTemplateComponents.length - 1 ? '1px dashed var(--df-color-fb-border)' : 'none',
|
|
4522
|
-
minHeight:
|
|
4497
|
+
minHeight: '60px',
|
|
4523
4498
|
minWidth: columnView ? '100%' : '150px',
|
|
4524
|
-
width: columnView ? '100%' : 'auto',
|
|
4525
4499
|
display: 'flex',
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
overflow: 'hidden',
|
|
4529
|
-
gap: columnView ? '8px' : '0'
|
|
4500
|
+
alignItems: 'center',
|
|
4501
|
+
overflow: 'hidden'
|
|
4530
4502
|
}, children: jsxRuntime.jsx("div", { style: {
|
|
4531
4503
|
width: '100%',
|
|
4532
|
-
minWidth:
|
|
4504
|
+
minWidth: '120px',
|
|
4533
4505
|
overflow: 'hidden'
|
|
4534
4506
|
}, children: renderFormComponent(entryComponent, !columnView) }) }, `${entry.id}-${componentIndex}`));
|
|
4535
|
-
}), mode === 'test' && allowAddRemoveEntries && dataEntries.length > minEntries && (jsxRuntime.jsx("button", { onClick: () => onRemoveEntry(entryIndex), disabled: dataEntries.length <= minEntries, style: {
|
|
4507
|
+
}), mode === 'test' && allowAddRemoveEntries && dataEntries.length > minEntries && (jsxRuntime.jsx("button", { onClick: () => onRemoveEntry?.(entryIndex), disabled: dataEntries.length <= minEntries, style: {
|
|
4536
4508
|
position: 'absolute',
|
|
4537
4509
|
top: '8px',
|
|
4538
4510
|
right: '8px',
|
|
@@ -4566,7 +4538,7 @@ formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChan
|
|
|
4566
4538
|
position: 'sticky',
|
|
4567
4539
|
bottom: 0,
|
|
4568
4540
|
zIndex: 5
|
|
4569
|
-
}, children: jsxRuntime.jsxs("button", { onClick:
|
|
4541
|
+
}, children: jsxRuntime.jsxs("button", { onClick: onAddEntry, disabled: dataEntries.length >= maxEntries, style: {
|
|
4570
4542
|
padding: '8px 16px',
|
|
4571
4543
|
backgroundColor: dataEntries.length >= maxEntries ? '#f3f4f6' : '#10b981',
|
|
4572
4544
|
color: dataEntries.length >= maxEntries ? '#9ca3af' : '#ffffff',
|
|
@@ -4604,7 +4576,7 @@ formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChan
|
|
|
4604
4576
|
fontWeight: '600',
|
|
4605
4577
|
color: 'var(--df-color-text-dark)',
|
|
4606
4578
|
fontSize: '14px'
|
|
4607
|
-
}, children: ["Entry #", entryIndex + 1] }), mode === 'test' && allowAddRemoveEntries && dataEntries.length > 1 && (jsxRuntime.jsx("button", { onClick: () => onRemoveEntry(entryIndex), disabled: dataEntries.length <= minEntries, style: {
|
|
4579
|
+
}, children: ["Entry #", entryIndex + 1] }), mode === 'test' && allowAddRemoveEntries && dataEntries.length > 1 && (jsxRuntime.jsx("button", { onClick: () => onRemoveEntry?.(entryIndex), disabled: dataEntries.length <= minEntries, style: {
|
|
4608
4580
|
padding: '4px 8px',
|
|
4609
4581
|
backgroundColor: dataEntries.length <= minEntries ? '#f3f4f6' : '#ef4444',
|
|
4610
4582
|
color: dataEntries.length <= minEntries ? '#9ca3af' : '#ffffff',
|
|
@@ -4620,39 +4592,40 @@ formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChan
|
|
|
4620
4592
|
height: '24px',
|
|
4621
4593
|
justifyContent: 'center'
|
|
4622
4594
|
}, title: removeText, children: jsxRuntime.jsx("span", { style: { fontSize: '14px' }, children: "\u00D7" }) }))] }), jsxRuntime.jsx("div", { style: {
|
|
4623
|
-
display:
|
|
4624
|
-
|
|
4625
|
-
gridTemplateColumns: !columnView ? 'repeat(auto-fit, minmax(200px, 1fr))' : undefined,
|
|
4595
|
+
display: 'grid',
|
|
4596
|
+
gridTemplateColumns: columnView ? '1fr' : 'repeat(auto-fit, minmax(200px, 1fr))',
|
|
4626
4597
|
gap: '16px'
|
|
4627
4598
|
}, children: visibleTemplateComponents.map((templateComponent, componentIndex) => {
|
|
4599
|
+
// Find the corresponding component in this entry by index first, then by name+label
|
|
4628
4600
|
let entryComponent = entry.components?.[componentIndex];
|
|
4601
|
+
// If no component at this index, try to find by name+label
|
|
4629
4602
|
if (!entryComponent) {
|
|
4630
4603
|
entryComponent = entry.components?.find((comp) => comp.name === templateComponent.name &&
|
|
4631
4604
|
comp.basic?.label === templateComponent.basic?.label);
|
|
4632
4605
|
}
|
|
4633
4606
|
if (!entryComponent) {
|
|
4607
|
+
// Use entry.id (which is unique) instead of entryIndex
|
|
4634
4608
|
const uniqueId = `${templateComponent.id}-${entry.id}-${componentIndex}`;
|
|
4635
4609
|
entryComponent = {
|
|
4636
4610
|
...templateComponent,
|
|
4637
4611
|
id: uniqueId,
|
|
4638
4612
|
basic: {
|
|
4639
4613
|
...templateComponent.basic,
|
|
4640
|
-
showLabel:
|
|
4614
|
+
showLabel: false // Hide label in datagrid cells
|
|
4641
4615
|
}
|
|
4642
4616
|
};
|
|
4643
4617
|
}
|
|
4644
4618
|
else {
|
|
4619
|
+
// Preserve the original ID to maintain form value connections
|
|
4645
4620
|
entryComponent = {
|
|
4646
4621
|
...entryComponent,
|
|
4647
|
-
id: entryComponent.id,
|
|
4622
|
+
id: entryComponent.id, // Keep the original ID
|
|
4648
4623
|
basic: {
|
|
4649
4624
|
...entryComponent.basic,
|
|
4650
|
-
showLabel:
|
|
4625
|
+
showLabel: false // Hide label in datagrid cells
|
|
4651
4626
|
}
|
|
4652
4627
|
};
|
|
4653
4628
|
}
|
|
4654
|
-
if (!entryComponent)
|
|
4655
|
-
return null;
|
|
4656
4629
|
return (jsxRuntime.jsxs("div", { style: {
|
|
4657
4630
|
display: 'flex',
|
|
4658
4631
|
flexDirection: 'column',
|
|
@@ -4688,7 +4661,7 @@ formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChan
|
|
|
4688
4661
|
borderRadius: '8px',
|
|
4689
4662
|
display: 'flex',
|
|
4690
4663
|
justifyContent: 'center'
|
|
4691
|
-
}, children: jsxRuntime.jsxs("button", { onClick:
|
|
4664
|
+
}, children: jsxRuntime.jsxs("button", { onClick: onAddEntry, disabled: dataEntries.length >= maxEntries, style: {
|
|
4692
4665
|
padding: '8px 16px',
|
|
4693
4666
|
backgroundColor: dataEntries.length >= maxEntries ? '#f3f4f6' : '#10b981',
|
|
4694
4667
|
color: dataEntries.length >= maxEntries ? '#9ca3af' : '#ffffff',
|
|
@@ -4701,12 +4674,6 @@ formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChan
|
|
|
4701
4674
|
alignItems: 'center',
|
|
4702
4675
|
gap: '8px',
|
|
4703
4676
|
transition: 'all 0.2s ease'
|
|
4704
|
-
}, onMouseEnter: (e) => {
|
|
4705
|
-
if (dataEntries.length < maxEntries) {
|
|
4706
|
-
e.currentTarget.style.backgroundColor = '#059669';
|
|
4707
|
-
}
|
|
4708
|
-
}, onMouseLeave: (e) => {
|
|
4709
|
-
e.currentTarget.style.backgroundColor = '#10b981';
|
|
4710
4677
|
}, children: [jsxRuntime.jsx("span", { children: "+" }), addAnotherText] }) }))] }));
|
|
4711
4678
|
};
|
|
4712
4679
|
const DfFormDataGrid = ({ id, properties, mode = 'edit', formData = {}, onValueChange, onSelect, isSelected = false, className = '', onDataGridSelect, onComponentSelect, onComponentDelete, onComponentEdit, onComponentUpdate, selectedComponent, renderFormComponent, onEntryAdd, onEntryRemove, formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChange, onAttachmentChange, shouldShowComponent }) => {
|
|
@@ -4938,10 +4905,6 @@ const DfFormDataGrid = ({ id, properties, mode = 'edit', formData = {}, onValueC
|
|
|
4938
4905
|
// In edit/preview modes, don't handle value changes as components are read-only
|
|
4939
4906
|
}, [mode, onValueChange]);
|
|
4940
4907
|
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);
|
|
4945
4908
|
// Use timestamp and random string to ensure uniqueness even if entries are deleted
|
|
4946
4909
|
const uniqueSuffix = `${Date.now()}-${Math.random().toString(36).substr(2, 5)}`;
|
|
4947
4910
|
const newEntryId = `entry-${uniqueSuffix}`;
|
|
@@ -4963,19 +4926,13 @@ const DfFormDataGrid = ({ id, properties, mode = 'edit', formData = {}, onValueC
|
|
|
4963
4926
|
}),
|
|
4964
4927
|
styles: {}
|
|
4965
4928
|
};
|
|
4966
|
-
console.log('[DfFormDataGrid] newEntry created:', newEntry.id, 'with', newEntry.components.length, 'components');
|
|
4967
4929
|
const updatedEntries = [...properties.entries, newEntry];
|
|
4968
|
-
console.log('[DfFormDataGrid] updatedEntries count:', updatedEntries.length);
|
|
4969
4930
|
if (onValueChange) {
|
|
4970
|
-
console.log('[DfFormDataGrid] calling onValueChange with updated entries');
|
|
4971
4931
|
onValueChange({
|
|
4972
4932
|
id,
|
|
4973
4933
|
value: { ...properties, entries: updatedEntries }
|
|
4974
4934
|
});
|
|
4975
4935
|
}
|
|
4976
|
-
else {
|
|
4977
|
-
console.log('[DfFormDataGrid] WARNING: onValueChange is not defined!');
|
|
4978
|
-
}
|
|
4979
4936
|
onEntryAdd?.();
|
|
4980
4937
|
}, [properties, onValueChange, id, onEntryAdd, gridComponents]);
|
|
4981
4938
|
const handleRemoveEntry = React.useCallback((entryIndex) => {
|
|
@@ -5072,7 +5029,7 @@ const DfFormDataGrid = ({ id, properties, mode = 'edit', formData = {}, onValueC
|
|
|
5072
5029
|
, {
|
|
5073
5030
|
// Cast to FormComponentType[] to satisfy TableView typing; gridComponents
|
|
5074
5031
|
// are always child form components of the datagrid.
|
|
5075
|
-
templateComponents: gridComponents, dataEntries: dataEntries, renderFormComponent: renderFormComponent || renderComponent, mode: mode, allowAddRemoveEntries: properties.datagrid?.allowAddRemoveEntries ?? true, addAnotherText: properties.datagrid?.addAnotherText ?? 'Add Entry', removeText: properties.datagrid?.removeText ?? 'Remove', maxEntries: properties.datagrid?.maxEntries ?? 10, minEntries: properties.datagrid?.minEntries ?? 1, displayAsGrid: properties.datagrid?.displayAsGrid ?? true, onAddEntry: handleAddEntry, onRemoveEntry: handleRemoveEntry, formData: formData, formTemplateId: formTemplateId, onThresholdActionCompletion: onThresholdActionCompletion, onThresholdIssueRaised: onThresholdIssueRaised, onNotesChange: onNotesChange, onAttachmentChange: onAttachmentChange, columnView: properties.datagrid?.columnView, shouldShowComponent: shouldShowComponent })) }))] }));
|
|
5032
|
+
templateComponents: gridComponents, dataEntries: dataEntries, renderFormComponent: renderFormComponent || renderComponent, mode: mode, allowAddRemoveEntries: properties.datagrid?.allowAddRemoveEntries ?? true, addAnotherText: properties.datagrid?.addAnotherText ?? 'Add Entry', removeText: properties.datagrid?.removeText ?? 'Remove', maxEntries: properties.datagrid?.maxEntries ?? 10, minEntries: properties.datagrid?.minEntries ?? 1, displayAsGrid: properties.datagrid?.displayAsGrid ?? true, onAddEntry: onEntryAdd ? onEntryAdd : handleAddEntry, onRemoveEntry: onEntryRemove ? onEntryRemove : handleRemoveEntry, formData: formData, formTemplateId: formTemplateId, onThresholdActionCompletion: onThresholdActionCompletion, onThresholdIssueRaised: onThresholdIssueRaised, onNotesChange: onNotesChange, onAttachmentChange: onAttachmentChange, columnView: properties.datagrid?.columnView, shouldShowComponent: shouldShowComponent })) }))] }));
|
|
5076
5033
|
};
|
|
5077
5034
|
|
|
5078
5035
|
const DraggableChild = ({ child, selectedChild, mode, onChildSelect, onChildDelete, renderFormComponent, isOverlay = false, isChildrenEditMode = false, formData = {}, formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChange, onAttachmentChange, workOrderNumber, assetNumber, user, onCreateIssue, onUpdateIssue }) => {
|