@abgov/jsonforms-components 2.52.1 → 2.52.3
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/index.esm.js
CHANGED
|
@@ -8532,7 +8532,8 @@ let _$7 = t => t,
|
|
|
8532
8532
|
_t25$1,
|
|
8533
8533
|
_t26$1,
|
|
8534
8534
|
_t27$1,
|
|
8535
|
-
_t28$1
|
|
8535
|
+
_t28$1,
|
|
8536
|
+
_t29;
|
|
8536
8537
|
const DeleteDialogContent = styled.div(_t$8 || (_t$8 = _$7`
|
|
8537
8538
|
margin-bottom: var(--goa-space-m);
|
|
8538
8539
|
`));
|
|
@@ -8571,7 +8572,7 @@ const RowFlex = styled.div(_t9$1 || (_t9$1 = _$7`
|
|
|
8571
8572
|
|
|
8572
8573
|
align-items: flex-start;
|
|
8573
8574
|
`));
|
|
8574
|
-
const
|
|
8575
|
+
const RowFlexMenuMain = styled.div(_t0$1 || (_t0$1 = _$7`
|
|
8575
8576
|
display: flex;
|
|
8576
8577
|
flex-direction: column;
|
|
8577
8578
|
align-items: stretch;
|
|
@@ -8588,12 +8589,29 @@ const RowFlexMenu = styled.div(_t0$1 || (_t0$1 = _$7`
|
|
|
8588
8589
|
border-color: var(--goa-color-greyscale-400);
|
|
8589
8590
|
}
|
|
8590
8591
|
`));
|
|
8591
|
-
const
|
|
8592
|
+
const RowFlexMenuLeft = styled.div(_t1$1 || (_t1$1 = _$7`
|
|
8593
|
+
display: flex;
|
|
8594
|
+
flex-direction: row;
|
|
8595
|
+
align-items: stretch;
|
|
8596
|
+
border: 1px solid var(--goa-color-greyscale-300);
|
|
8597
|
+
border-radius: var(--goa-border-radius-m);
|
|
8598
|
+
margin-top: var(--goa-space-xs);
|
|
8599
|
+
background-color: var(--goa-color-greyscale-white);
|
|
8600
|
+
padding: 0;
|
|
8601
|
+
gap: 0;
|
|
8602
|
+
position: relative;
|
|
8603
|
+
overflow: visible;
|
|
8604
|
+
|
|
8605
|
+
&:hover {
|
|
8606
|
+
border-color: var(--goa-color-greyscale-400);
|
|
8607
|
+
}
|
|
8608
|
+
`));
|
|
8609
|
+
const FlexTabs = styled.div(_t10$1 || (_t10$1 = _$7`
|
|
8592
8610
|
flex-direction: column;
|
|
8593
8611
|
flex: 1;
|
|
8594
8612
|
overflow-y: auto !important;
|
|
8595
8613
|
`));
|
|
8596
|
-
const FlexTabsWithMargin = styled.div(
|
|
8614
|
+
const FlexTabsWithMargin = styled.div(_t11$1 || (_t11$1 = _$7`
|
|
8597
8615
|
flex-direction: column;
|
|
8598
8616
|
flex: 1;
|
|
8599
8617
|
overflow-y: auto !important;
|
|
@@ -8602,64 +8620,64 @@ const FlexTabsWithMargin = styled.div(_t10$1 || (_t10$1 = _$7`
|
|
|
8602
8620
|
flex-shrink: 1;
|
|
8603
8621
|
// max-height: 500px;
|
|
8604
8622
|
`));
|
|
8605
|
-
const FlexForm = styled.div(
|
|
8623
|
+
const FlexForm = styled.div(_t12$1 || (_t12$1 = _$7`
|
|
8606
8624
|
flex-direction: column;
|
|
8607
8625
|
flex: 3;
|
|
8608
8626
|
flex-shrink: 0;
|
|
8609
8627
|
overflow-y: visible;
|
|
8610
8628
|
`));
|
|
8611
|
-
const TabName = styled.div(
|
|
8629
|
+
const TabName = styled.div(_t13$1 || (_t13$1 = _$7`
|
|
8612
8630
|
margin: 1rem 0 1rem 1rem;
|
|
8613
8631
|
font-weight: 400;
|
|
8614
8632
|
white-space: nowrap;
|
|
8615
8633
|
overflow: hidden;
|
|
8616
8634
|
text-overflow: ellipsis;
|
|
8617
8635
|
`));
|
|
8618
|
-
const Trash = styled.div(
|
|
8636
|
+
const Trash = styled.div(_t14$1 || (_t14$1 = _$7`
|
|
8619
8637
|
margin: 0.9rem 0.4rem 0.6rem 0.75rem;
|
|
8620
8638
|
margin-left: auto;
|
|
8621
8639
|
`));
|
|
8622
|
-
const ListContainer = styled.div(
|
|
8640
|
+
const ListContainer = styled.div(_t15$1 || (_t15$1 = _$7`
|
|
8623
8641
|
padding: 0 0 0 0;
|
|
8624
8642
|
`));
|
|
8625
|
-
styled.div(
|
|
8643
|
+
styled.div(_t16$1 || (_t16$1 = _$7`
|
|
8626
8644
|
padding: 0 0 var(--goa-space-l) 0;
|
|
8627
8645
|
`));
|
|
8628
|
-
const UpdateListContainer = styled.div(
|
|
8646
|
+
const UpdateListContainer = styled.div(_t17$1 || (_t17$1 = _$7`
|
|
8629
8647
|
width: 100%;
|
|
8630
8648
|
border: 1px solid #dcdcdc;
|
|
8631
8649
|
padding: var(--goa-space-xl);
|
|
8632
8650
|
`));
|
|
8633
|
-
styled.div(
|
|
8651
|
+
styled.div(_t18$1 || (_t18$1 = _$7`
|
|
8634
8652
|
padding: 0 1.5rem 0 0;
|
|
8635
8653
|
border: 1px solid #dcdcdc;
|
|
8636
8654
|
`));
|
|
8637
|
-
const TableTHHeader = styled.th(
|
|
8655
|
+
const TableTHHeader = styled.th(_t19$1 || (_t19$1 = _$7`
|
|
8638
8656
|
background-color: var(--goa-color-greyscale-100) !important;
|
|
8639
8657
|
vertical-align: top;
|
|
8640
8658
|
`));
|
|
8641
|
-
const ObjectArrayWarningIconDiv = styled.div(
|
|
8659
|
+
const ObjectArrayWarningIconDiv = styled.div(_t20$1 || (_t20$1 = _$7`
|
|
8642
8660
|
display: inline-flex;
|
|
8643
8661
|
align-items: flex-start;
|
|
8644
8662
|
gap: 0.25rem;
|
|
8645
8663
|
font-size: var(--goa-font-size-2);
|
|
8646
8664
|
color: var(--goa-color-interactive-error);
|
|
8647
8665
|
`));
|
|
8648
|
-
const ListWithDetailWarningIconDiv = styled.div(
|
|
8666
|
+
const ListWithDetailWarningIconDiv = styled.div(_t21$1 || (_t21$1 = _$7`
|
|
8649
8667
|
display: inline-flex;
|
|
8650
8668
|
align-items: flex-start;
|
|
8651
8669
|
gap: 0.25rem;
|
|
8652
8670
|
font-size: var(--goa-font-size-3);
|
|
8653
8671
|
color: var(--goa-color-interactive-error);
|
|
8654
8672
|
`));
|
|
8655
|
-
styled.label(
|
|
8673
|
+
styled.label(_t22$1 || (_t22$1 = _$7`
|
|
8656
8674
|
color: var(--goa-color-interactive-error);
|
|
8657
8675
|
font-weight: var(--goa-font-weight-regular);
|
|
8658
8676
|
font-size: var(--goa-font-size-3);
|
|
8659
8677
|
line-height: var(--goa-line-height-1);
|
|
8660
8678
|
font-style: normal;
|
|
8661
8679
|
`));
|
|
8662
|
-
styled.div(
|
|
8680
|
+
styled.div(_t23$1 || (_t23$1 = _$7`
|
|
8663
8681
|
margin-top: var(--goa-space-m);
|
|
8664
8682
|
color: var(--goa-color-interactive-error);
|
|
8665
8683
|
font-weight: var(--goa-font-weight-regular);
|
|
@@ -8667,10 +8685,10 @@ styled.div(_t22$1 || (_t22$1 = _$7`
|
|
|
8667
8685
|
line-height: var(--goa-line-height-1);
|
|
8668
8686
|
font-style: normal;
|
|
8669
8687
|
`));
|
|
8670
|
-
const HilightCellWarning = styled.div(
|
|
8671
|
-
background-color:
|
|
8688
|
+
const HilightCellWarning = styled.div(_t24$1 || (_t24$1 = _$7`
|
|
8689
|
+
background-color: transparent;
|
|
8672
8690
|
`));
|
|
8673
|
-
const FixTableHeaderAlignment = styled.div(
|
|
8691
|
+
const FixTableHeaderAlignment = styled.div(_t25$1 || (_t25$1 = _$7`
|
|
8674
8692
|
table thead th:nth-child(3) {
|
|
8675
8693
|
text-align: center;
|
|
8676
8694
|
}
|
|
@@ -8679,22 +8697,22 @@ const FixTableHeaderAlignment = styled.div(_t24$1 || (_t24$1 = _$7`
|
|
|
8679
8697
|
text-align: center;
|
|
8680
8698
|
}
|
|
8681
8699
|
`));
|
|
8682
|
-
const ListWithDetailsReviewCellDiv = styled.div(
|
|
8700
|
+
const ListWithDetailsReviewCellDiv = styled.div(_t26$1 || (_t26$1 = _$7`
|
|
8683
8701
|
display: 'flex';
|
|
8684
8702
|
flex-direction: 'column';
|
|
8685
8703
|
text-align: 'start';
|
|
8686
8704
|
`));
|
|
8687
|
-
const IconsContainer = styled.div(
|
|
8705
|
+
const IconsContainer = styled.div(_t27$1 || (_t27$1 = _$7`
|
|
8688
8706
|
display: flex;
|
|
8689
8707
|
align-items: center;
|
|
8690
8708
|
justify-content: flex-end;
|
|
8691
8709
|
gap: var(--goa-space-xs);
|
|
8692
8710
|
padding-bottom: var(--goa-space-xs);
|
|
8693
8711
|
`));
|
|
8694
|
-
const TableContentContainer = styled.div(
|
|
8712
|
+
const TableContentContainer = styled.div(_t28$1 || (_t28$1 = _$7`
|
|
8695
8713
|
padding: var(--goa-space-l);
|
|
8696
8714
|
`));
|
|
8697
|
-
const NoDataMessage = styled.div(
|
|
8715
|
+
const NoDataMessage = styled.div(_t29 || (_t29 = _$7`
|
|
8698
8716
|
padding: var(--goa-space-xl) var(--goa-space-l);
|
|
8699
8717
|
color: var(--goa-color-greyscale-700);
|
|
8700
8718
|
font: var(--goa-typography-body-m);
|
|
@@ -9011,40 +9029,52 @@ function getValue(obj, path) {
|
|
|
9011
9029
|
return undefined;
|
|
9012
9030
|
}, obj);
|
|
9013
9031
|
}
|
|
9032
|
+
function prettify$1(prop) {
|
|
9033
|
+
return prop.replace(/([A-Z])/g, ' $1').replace(/[_-]/g, ' ').replace(/^./, c => c.toUpperCase());
|
|
9034
|
+
}
|
|
9014
9035
|
function findLabelForPath(path, uiSchema, schema) {
|
|
9036
|
+
const propertyKey = path.split('.').pop() || path;
|
|
9037
|
+
const fallbackLabel = prettify$1(propertyKey);
|
|
9015
9038
|
if (!uiSchema) {
|
|
9016
|
-
return
|
|
9039
|
+
return fallbackLabel;
|
|
9017
9040
|
}
|
|
9018
9041
|
if (isControlElement(uiSchema)) {
|
|
9019
9042
|
const controlPath = uiSchema.scope ? toDataPath(uiSchema.scope) : '';
|
|
9020
9043
|
if (controlPath === path) {
|
|
9044
|
+
var _schema$properties;
|
|
9021
9045
|
const label = uiSchema.label;
|
|
9022
|
-
if (typeof label === 'string') {
|
|
9046
|
+
if (typeof label === 'string' && label.trim()) {
|
|
9023
9047
|
return label;
|
|
9024
9048
|
} else if (typeof label === 'object' && label !== null && 'text' in label) {
|
|
9025
|
-
|
|
9049
|
+
var _label$text;
|
|
9050
|
+
return ((_label$text = label.text) == null ? void 0 : _label$text.trim()) || fallbackLabel;
|
|
9051
|
+
}
|
|
9052
|
+
if (propertyKey && schema != null && (_schema$properties = schema.properties) != null && _schema$properties[propertyKey]) {
|
|
9053
|
+
const property = schema.properties[propertyKey];
|
|
9054
|
+
if (typeof property === 'object' && 'title' in property && property.title) {
|
|
9055
|
+
return String(property.title);
|
|
9056
|
+
}
|
|
9026
9057
|
}
|
|
9027
|
-
return
|
|
9058
|
+
return fallbackLabel;
|
|
9028
9059
|
}
|
|
9029
9060
|
}
|
|
9030
9061
|
if (isLayoutElement(uiSchema)) {
|
|
9031
9062
|
for (const element of uiSchema.elements) {
|
|
9032
9063
|
const label = findLabelForPath(path, element, schema);
|
|
9033
|
-
if (label !==
|
|
9064
|
+
if (label !== fallbackLabel) {
|
|
9034
9065
|
return label;
|
|
9035
9066
|
}
|
|
9036
9067
|
}
|
|
9037
9068
|
}
|
|
9038
9069
|
if (schema != null && schema.properties) {
|
|
9039
|
-
const propertyKey = path.split('.').pop();
|
|
9040
9070
|
if (propertyKey && schema.properties[propertyKey]) {
|
|
9041
9071
|
const property = schema.properties[propertyKey];
|
|
9042
|
-
if (typeof property === 'object' && 'title' in property) {
|
|
9043
|
-
return String(property.title)
|
|
9072
|
+
if (typeof property === 'object' && 'title' in property && property.title) {
|
|
9073
|
+
return String(property.title);
|
|
9044
9074
|
}
|
|
9045
9075
|
}
|
|
9046
9076
|
}
|
|
9047
|
-
return
|
|
9077
|
+
return fallbackLabel;
|
|
9048
9078
|
}
|
|
9049
9079
|
function generateSummaryPairs(rowData, detailUiSchema, schema) {
|
|
9050
9080
|
const paths = extractPaths(detailUiSchema);
|
|
@@ -9156,7 +9186,7 @@ const MainItemComponent = ({
|
|
|
9156
9186
|
testId: "delete button",
|
|
9157
9187
|
onClick: () => openDeleteDialog(childPath, rowIndex, displayName)
|
|
9158
9188
|
}) : null]
|
|
9159
|
-
}), jsx(
|
|
9189
|
+
}), jsx(RowFlexMenuMain, {
|
|
9160
9190
|
tabIndex: 0,
|
|
9161
9191
|
children: jsx(TableContentContainer, {
|
|
9162
9192
|
children: jsx(SummaryDisplay, {
|
|
@@ -9175,9 +9205,6 @@ function getEffectiveInstancePath(error) {
|
|
|
9175
9205
|
}
|
|
9176
9206
|
return error.instancePath;
|
|
9177
9207
|
}
|
|
9178
|
-
function prettify(prop) {
|
|
9179
|
-
return prop.replace(/([A-Z])/g, ' $1').replace(/[_-]/g, ' ').replace(/^./, c => c.toUpperCase());
|
|
9180
|
-
}
|
|
9181
9208
|
function resolveLabel(instancePath, schema, uischema) {
|
|
9182
9209
|
const prop = instancePath.split('/').filter(Boolean).pop();
|
|
9183
9210
|
const scope = `#/properties/${prop}`;
|
|
@@ -9192,7 +9219,7 @@ function resolveLabel(instancePath, schema, uischema) {
|
|
|
9192
9219
|
if (resolvedSchema != null && resolvedSchema.title) {
|
|
9193
9220
|
return resolvedSchema.title;
|
|
9194
9221
|
}
|
|
9195
|
-
return prettify(prop || 'Unknown field');
|
|
9222
|
+
return prettify$1(prop || 'Unknown field');
|
|
9196
9223
|
}
|
|
9197
9224
|
function ajvPathToSchemaPath(instancePath) {
|
|
9198
9225
|
const parts = instancePath.split('/').filter(Boolean);
|
|
@@ -9284,7 +9311,7 @@ const LeftTab = ({
|
|
|
9284
9311
|
}
|
|
9285
9312
|
}
|
|
9286
9313
|
},
|
|
9287
|
-
children: jsxs(
|
|
9314
|
+
children: jsxs(RowFlexMenuLeft, {
|
|
9288
9315
|
tabIndex: 0,
|
|
9289
9316
|
children: [jsx(TabName, {
|
|
9290
9317
|
children: name
|
|
@@ -9344,12 +9371,12 @@ const MainTab = ({
|
|
|
9344
9371
|
// Fallback: if nestedErrors contain a missingProperty, use it
|
|
9345
9372
|
const missingFromNested = nestedErrors == null || (_nestedErrors$ = nestedErrors[0]) == null || (_nestedErrors$ = _nestedErrors$.params) == null ? void 0 : _nestedErrors$.missingProperty;
|
|
9346
9373
|
if (missingFromNested) {
|
|
9347
|
-
acc.fields[field] = prettify(missingFromNested) + ' is required';
|
|
9374
|
+
acc.fields[field] = prettify$1(missingFromNested) + ' is required';
|
|
9348
9375
|
} else {
|
|
9349
9376
|
const raw = e.message;
|
|
9350
9377
|
if (raw && (raw.includes('must have required property') || raw.includes('is a required property'))) {
|
|
9351
9378
|
const m = raw.match(/'([^']+)'/);
|
|
9352
|
-
if (m && m[1]) acc.fields[field] = prettify(m[1]) + ' is required';else acc.fields[field] = raw;
|
|
9379
|
+
if (m && m[1]) acc.fields[field] = prettify$1(m[1]) + ' is required';else acc.fields[field] = raw;
|
|
9353
9380
|
} else {
|
|
9354
9381
|
acc.fields[field] = raw || 'Unknown error';
|
|
9355
9382
|
}
|
|
@@ -9362,12 +9389,12 @@ const MainTab = ({
|
|
|
9362
9389
|
var _nestedErrors$2;
|
|
9363
9390
|
const missingFromNested = nestedErrors == null || (_nestedErrors$2 = nestedErrors[0]) == null || (_nestedErrors$2 = _nestedErrors$2.params) == null ? void 0 : _nestedErrors$2.missingProperty;
|
|
9364
9391
|
if (missingFromNested) {
|
|
9365
|
-
acc.row = prettify(missingFromNested) + ' is required';
|
|
9392
|
+
acc.row = prettify$1(missingFromNested) + ' is required';
|
|
9366
9393
|
} else {
|
|
9367
9394
|
const raw = e == null ? void 0 : e.message;
|
|
9368
9395
|
if (raw && (raw.includes('must have required property') || raw.includes('is a required property'))) {
|
|
9369
9396
|
const m = raw.match(/'([^']+)'/);
|
|
9370
|
-
if (m && m[1]) acc.row = prettify(m[1]) + ' is required';else acc.row = raw;
|
|
9397
|
+
if (m && m[1]) acc.row = prettify$1(m[1]) + ' is required';else acc.row = raw;
|
|
9371
9398
|
} else {
|
|
9372
9399
|
acc.row = raw || 'Unknown error';
|
|
9373
9400
|
}
|
|
@@ -9381,7 +9408,7 @@ const MainTab = ({
|
|
|
9381
9408
|
if (typeof msg === 'string' && (msg.includes('must have required property') || msg.includes('is a required property'))) {
|
|
9382
9409
|
const propertyMatch = msg.match(/'([^']+)'/);
|
|
9383
9410
|
if (propertyMatch && propertyMatch[1]) {
|
|
9384
|
-
msg = prettify(propertyMatch[1]) + ' is required';
|
|
9411
|
+
msg = prettify$1(propertyMatch[1]) + ' is required';
|
|
9385
9412
|
}
|
|
9386
9413
|
}
|
|
9387
9414
|
acc.fields[field] = msg;
|
|
@@ -10858,6 +10885,9 @@ const DeleteDialog = /*#__PURE__*/React.memo(function DeleteDialog({
|
|
|
10858
10885
|
}, 1);
|
|
10859
10886
|
});
|
|
10860
10887
|
|
|
10888
|
+
function prettify(prop) {
|
|
10889
|
+
return prop.replace(/([A-Z])/g, ' $1').replace(/[_-]/g, ' ').replace(/^./, c => c.toUpperCase());
|
|
10890
|
+
}
|
|
10861
10891
|
/**
|
|
10862
10892
|
* Extract Json data schema name attribute and the ui schema label name.
|
|
10863
10893
|
* @param obj
|
|
@@ -10871,20 +10901,33 @@ const extractNames = (obj, names = {}) => {
|
|
|
10871
10901
|
const typedObj = obj;
|
|
10872
10902
|
if (typeof typedObj.scope === 'string') {
|
|
10873
10903
|
const parts = typedObj.scope.split('/');
|
|
10874
|
-
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
names[
|
|
10904
|
+
const key = parts[parts.length - 1];
|
|
10905
|
+
if (typeof typedObj.label === 'string' && typedObj.label.trim()) {
|
|
10906
|
+
names[key] = typedObj.label;
|
|
10907
|
+
} else if (typeof typedObj.label === 'object' && typedObj.label !== null && 'text' in typedObj.label && typeof typedObj.label.text === 'string' && typedObj.label.text.trim()) {
|
|
10908
|
+
names[key] = typedObj.label.text;
|
|
10909
|
+
} else {
|
|
10910
|
+
names[key] = prettify(key);
|
|
10879
10911
|
}
|
|
10880
10912
|
}
|
|
10881
10913
|
Object.values(typedObj).forEach(value => extractNames(value, names));
|
|
10882
10914
|
}
|
|
10883
10915
|
return names;
|
|
10884
10916
|
};
|
|
10917
|
+
function getHeaderLabel(headName, itemsSchema, columnLabels) {
|
|
10918
|
+
if (columnLabels != null && columnLabels[headName]) {
|
|
10919
|
+
return columnLabels[headName];
|
|
10920
|
+
}
|
|
10921
|
+
const fieldSchema = itemsSchema == null ? void 0 : itemsSchema[headName];
|
|
10922
|
+
if (fieldSchema && typeof fieldSchema.title === 'string' && fieldSchema.title.trim()) {
|
|
10923
|
+
return fieldSchema.title;
|
|
10924
|
+
}
|
|
10925
|
+
return prettify(headName);
|
|
10926
|
+
}
|
|
10885
10927
|
const DataTable = ({
|
|
10886
10928
|
itemsSchema,
|
|
10887
|
-
data
|
|
10929
|
+
data,
|
|
10930
|
+
columnLabels
|
|
10888
10931
|
}) => {
|
|
10889
10932
|
var _Object$keys;
|
|
10890
10933
|
return jsxs(GoabTable, {
|
|
@@ -10893,7 +10936,7 @@ const DataTable = ({
|
|
|
10893
10936
|
children: jsx("tr", {
|
|
10894
10937
|
children: itemsSchema && ((_Object$keys = Object.keys(itemsSchema)) == null ? void 0 : _Object$keys.map((headNames, ix) => {
|
|
10895
10938
|
return jsx("th", {
|
|
10896
|
-
children: headNames
|
|
10939
|
+
children: getHeaderLabel(headNames, itemsSchema, columnLabels)
|
|
10897
10940
|
}, ix);
|
|
10898
10941
|
}))
|
|
10899
10942
|
})
|
|
@@ -10969,9 +11012,12 @@ const renderCellColumn = ({
|
|
|
10969
11012
|
});
|
|
10970
11013
|
}
|
|
10971
11014
|
} else {
|
|
11015
|
+
const firstRow = Array.isArray(data) ? data[0] : undefined;
|
|
11016
|
+
const columnLabels = extractNames(firstRow);
|
|
10972
11017
|
return jsx(DataTable, {
|
|
10973
11018
|
itemsSchema: data[0],
|
|
10974
|
-
data: data
|
|
11019
|
+
data: data,
|
|
11020
|
+
columnLabels: columnLabels
|
|
10975
11021
|
});
|
|
10976
11022
|
}
|
|
10977
11023
|
}
|
|
@@ -11365,7 +11411,7 @@ const ObjectArrayList = ({
|
|
|
11365
11411
|
}, 0);
|
|
11366
11412
|
};
|
|
11367
11413
|
const ObjectArrayControl = props => {
|
|
11368
|
-
var
|
|
11414
|
+
var _registers$categories, _registers$categories2, _registers$categories3, _registers$categories4, _uischema$options5;
|
|
11369
11415
|
const [registers, dispatch] = useReducer(objectListReducer, initialState);
|
|
11370
11416
|
const [open, setOpen] = useState(false);
|
|
11371
11417
|
const [rowData, setRowData] = useState(0);
|
|
@@ -11386,7 +11432,9 @@ const ObjectArrayControl = props => {
|
|
|
11386
11432
|
isStepperReview
|
|
11387
11433
|
} = props,
|
|
11388
11434
|
additionalProps = _objectWithoutPropertiesLoose(props, _excluded$3);
|
|
11389
|
-
const parsedData = data;
|
|
11435
|
+
const parsedData = Array.isArray(data) ? data : [];
|
|
11436
|
+
const latestData = Array.isArray(data) ? Object.fromEntries(parsedData.map((item, index) => [String(index), item])) : (_registers$categories = (_registers$categories2 = registers.categories[path]) == null ? void 0 : _registers$categories2.data) != null ? _registers$categories : {};
|
|
11437
|
+
const latestCount = Array.isArray(data) ? parsedData.length : (_registers$categories3 = (_registers$categories4 = registers.categories[path]) == null ? void 0 : _registers$categories4.count) != null ? _registers$categories3 : Object.keys(latestData).length;
|
|
11390
11438
|
const openDeleteDialog = useCallback((rowIndex, name) => {
|
|
11391
11439
|
setOpen(true);
|
|
11392
11440
|
setRowData(rowIndex);
|
|
@@ -11483,26 +11531,29 @@ const ObjectArrayControl = props => {
|
|
|
11483
11531
|
useEffect(() => {
|
|
11484
11532
|
const updatedData = Object.fromEntries((parsedData || []).map((item, index) => [index, item]));
|
|
11485
11533
|
const count = Object.keys(updatedData).length;
|
|
11486
|
-
const
|
|
11534
|
+
const currentCategory = registers.categories[path];
|
|
11535
|
+
const hasSameCount = (currentCategory == null ? void 0 : currentCategory.count) === count;
|
|
11536
|
+
const hasSameData = JSON.stringify((currentCategory == null ? void 0 : currentCategory.data) || {}) === JSON.stringify(updatedData);
|
|
11537
|
+
if (hasSameCount && hasSameData) {
|
|
11538
|
+
return;
|
|
11539
|
+
}
|
|
11540
|
+
const dispatchData = Object.assign({}, registers.categories, {
|
|
11487
11541
|
[path]: {
|
|
11488
11542
|
count: count,
|
|
11489
11543
|
data: updatedData
|
|
11490
11544
|
}
|
|
11491
|
-
};
|
|
11492
|
-
|
|
11493
|
-
|
|
11494
|
-
|
|
11495
|
-
|
|
11496
|
-
|
|
11497
|
-
}
|
|
11498
|
-
// eslint-disable-next-line
|
|
11499
|
-
}, []);
|
|
11545
|
+
});
|
|
11546
|
+
dispatch({
|
|
11547
|
+
type: SET_DATA_ACTION,
|
|
11548
|
+
payload: dispatchData
|
|
11549
|
+
});
|
|
11550
|
+
}, [parsedData, path]);
|
|
11500
11551
|
const controlElement = uischema;
|
|
11501
11552
|
const listTitle = label || ((_uischema$options5 = uischema.options) == null ? void 0 : _uischema$options5.title);
|
|
11502
11553
|
const isInReview = isStepperReview === true;
|
|
11503
11554
|
const isListWithDetail = controlElement.type === 'ListWithDetail';
|
|
11504
11555
|
if (isInReview) {
|
|
11505
|
-
var _uischema$options6
|
|
11556
|
+
var _uischema$options6;
|
|
11506
11557
|
return jsx("tr", {
|
|
11507
11558
|
children: jsxs(PageReviewContainer, {
|
|
11508
11559
|
colSpan: 3,
|
|
@@ -11550,8 +11601,8 @@ const ObjectArrayControl = props => {
|
|
|
11550
11601
|
enabled: enabled,
|
|
11551
11602
|
openDeleteDialog: openDeleteDialog,
|
|
11552
11603
|
translations: {},
|
|
11553
|
-
count:
|
|
11554
|
-
data:
|
|
11604
|
+
count: latestCount,
|
|
11605
|
+
data: latestData,
|
|
11555
11606
|
cells: cells,
|
|
11556
11607
|
config: config,
|
|
11557
11608
|
isInReview: isInReview,
|
|
@@ -11593,8 +11644,8 @@ const ObjectArrayControl = props => {
|
|
|
11593
11644
|
enabled: enabled,
|
|
11594
11645
|
openDeleteDialog: openDeleteDialog,
|
|
11595
11646
|
translations: {},
|
|
11596
|
-
count:
|
|
11597
|
-
data:
|
|
11647
|
+
count: latestCount,
|
|
11648
|
+
data: latestData,
|
|
11598
11649
|
cells: cells,
|
|
11599
11650
|
config: config,
|
|
11600
11651
|
isInReview: isInReview,
|
|
@@ -13240,7 +13291,7 @@ const CategoryRow = ({
|
|
|
13240
13291
|
return category.visible ? jsxs(PageStepperRow, {
|
|
13241
13292
|
disabled: !(category != null && category.isEnabled),
|
|
13242
13293
|
role: "button",
|
|
13243
|
-
tabIndex:
|
|
13294
|
+
tabIndex: -1,
|
|
13244
13295
|
onClick: e => {
|
|
13245
13296
|
e.preventDefault();
|
|
13246
13297
|
if (category != null && category.isEnabled) onClick(index);
|
|
@@ -13254,6 +13305,7 @@ const CategoryRow = ({
|
|
|
13254
13305
|
})
|
|
13255
13306
|
}, `task-list-${index}-stepper-row-label`), jsx(CategoryStatus, {
|
|
13256
13307
|
children: jsx(Center, {
|
|
13308
|
+
tabIndex: -1,
|
|
13257
13309
|
children: getCategoryStatusBadge(category)
|
|
13258
13310
|
})
|
|
13259
13311
|
})]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.52.
|
|
3
|
+
"version": "2.52.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
|
|
6
6
|
"repository": "https://github.com/GovAlta/adsp-monorepo",
|
package/renderer-catalog.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-03-
|
|
4
|
-
"sourceCommit": "
|
|
3
|
+
"generatedAt": "2026-03-10T15:56:36.838Z",
|
|
4
|
+
"sourceCommit": "2079e47e5ff044820a6458b37acbc20dde1c5377",
|
|
5
5
|
"sourcePath": "libs/jsonforms-components/src/index.ts",
|
|
6
6
|
"rendererCount": 32,
|
|
7
7
|
"renderers": [
|
|
@@ -10,6 +10,7 @@ export declare const extractNames: (obj: unknown, names?: Record<string, string>
|
|
|
10
10
|
export interface TableProps {
|
|
11
11
|
itemsSchema: Record<string, unknown>;
|
|
12
12
|
data: Record<string, unknown>[];
|
|
13
|
+
columnLabels?: Record<string, string>;
|
|
13
14
|
}
|
|
14
15
|
export declare const isObjectArrayEmpty: (currentData: string) => boolean;
|
|
15
16
|
export declare const renderCellColumn: ({ data, error, errors, index, rowPath, element, isRequired, }: RenderCellColumnProps) => string | import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -7,7 +7,8 @@ export declare const RequiredSpan: import("styled-components/dist/types").IStyle
|
|
|
7
7
|
export declare const TextCenter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
8
|
export declare const SideMenuItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
9
9
|
export declare const RowFlex: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const RowFlexMenuMain: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
11
|
+
export declare const RowFlexMenuLeft: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
11
12
|
export declare const FlexTabs: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
12
13
|
export declare const FlexTabsWithMargin: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
13
14
|
export declare const FlexForm: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|