@abgov/jsonforms-components 2.42.0 → 2.42.2

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
@@ -7138,7 +7138,7 @@ let _$6 = t => t,
7138
7138
  _t22$1,
7139
7139
  _t23$1,
7140
7140
  _t24$1,
7141
- _t25,
7141
+ _t25$1,
7142
7142
  _t26,
7143
7143
  _t27,
7144
7144
  _t28;
@@ -7303,7 +7303,7 @@ const CategoryStatus = styled.td(_t23$1 || (_t23$1 = _$6`
7303
7303
  const Center = styled.div(_t24$1 || (_t24$1 = _$6`
7304
7304
  padding-top: 5px;
7305
7305
  `));
7306
- const PageStepperRow = styled.tr(_t25 || (_t25 = _$6`
7306
+ const PageStepperRow = styled.tr(_t25$1 || (_t25$1 = _$6`
7307
7307
  ${0}
7308
7308
  `), ({
7309
7309
  disabled
@@ -10084,7 +10084,8 @@ let _$3 = t => t,
10084
10084
  _t21,
10085
10085
  _t22,
10086
10086
  _t23,
10087
- _t24;
10087
+ _t24,
10088
+ _t25;
10088
10089
  const DeleteDialogContent = styled.div(_t$3 || (_t$3 = _$3`
10089
10090
  margin-bottom: var(--goa-space-m);
10090
10091
  `));
@@ -10153,44 +10154,47 @@ const Trash = styled.div(_t12 || (_t12 = _$3`
10153
10154
  const ListContainer = styled.div(_t13 || (_t13 = _$3`
10154
10155
  padding: 0 0 0 0;
10155
10156
  `));
10156
- const IconPadding = styled.div(_t14 || (_t14 = _$3`
10157
+ styled.div(_t14 || (_t14 = _$3`
10158
+ padding: 0 0 var(--goa-space-l) 0;
10159
+ `));
10160
+ const IconPadding = styled.div(_t15 || (_t15 = _$3`
10157
10161
  padding: 0.9rem 0.5rem 0 0;
10158
10162
  `));
10159
- const UpdateListContainer = styled.div(_t15 || (_t15 = _$3`
10163
+ const UpdateListContainer = styled.div(_t16 || (_t16 = _$3`
10160
10164
  width: 100%;
10161
10165
  border: 1px solid #dcdcdc;
10162
10166
  padding: var(--goa-space-xl);
10163
10167
  `));
10164
- styled.div(_t16 || (_t16 = _$3`
10168
+ styled.div(_t17 || (_t17 = _$3`
10165
10169
  padding: 0 1.5rem 0 0;
10166
10170
  border: 1px solid #dcdcdc;
10167
10171
  `));
10168
- const TableTHHeader = styled.th(_t17 || (_t17 = _$3`
10172
+ const TableTHHeader = styled.th(_t18 || (_t18 = _$3`
10169
10173
  background-color: var(--goa-color-greyscale-100) !important;
10170
10174
  vertical-align: top;
10171
10175
  `));
10172
- const ObjectArrayWarningIconDiv = styled.div(_t18 || (_t18 = _$3`
10176
+ const ObjectArrayWarningIconDiv = styled.div(_t19 || (_t19 = _$3`
10173
10177
  display: inline-flex;
10174
10178
  align-items: flex-start;
10175
10179
  gap: 0.25rem;
10176
10180
  font-size: var(--goa-font-size-2);
10177
10181
  color: var(--goa-color-interactive-error);
10178
10182
  `));
10179
- const ListWithDetailWarningIconDiv = styled.div(_t19 || (_t19 = _$3`
10183
+ const ListWithDetailWarningIconDiv = styled.div(_t20 || (_t20 = _$3`
10180
10184
  display: inline-flex;
10181
10185
  align-items: flex-start;
10182
10186
  gap: 0.25rem;
10183
10187
  font-size: var(--goa-font-size-3);
10184
10188
  color: var(--goa-color-interactive-error);
10185
10189
  `));
10186
- styled.label(_t20 || (_t20 = _$3`
10190
+ styled.label(_t21 || (_t21 = _$3`
10187
10191
  color: var(--goa-color-interactive-error);
10188
10192
  font-weight: var(--goa-font-weight-regular);
10189
10193
  font-size: var(--goa-font-size-3);
10190
10194
  line-height: var(--goa-line-height-1);
10191
10195
  font-style: normal;
10192
10196
  `));
10193
- styled.div(_t21 || (_t21 = _$3`
10197
+ styled.div(_t22 || (_t22 = _$3`
10194
10198
  margin-top: var(--goa-space-m);
10195
10199
  color: var(--goa-color-interactive-error);
10196
10200
  font-weight: var(--goa-font-weight-regular);
@@ -10198,10 +10202,10 @@ styled.div(_t21 || (_t21 = _$3`
10198
10202
  line-height: var(--goa-line-height-1);
10199
10203
  font-style: normal;
10200
10204
  `));
10201
- const HilightCellWarning = styled.div(_t22 || (_t22 = _$3`
10205
+ const HilightCellWarning = styled.div(_t23 || (_t23 = _$3`
10202
10206
  background-color: var(--goa-color-warning-default);
10203
10207
  `));
10204
- const FixTableHeaderAlignment = styled.div(_t23 || (_t23 = _$3`
10208
+ const FixTableHeaderAlignment = styled.div(_t24 || (_t24 = _$3`
10205
10209
  table thead th:nth-child(3) {
10206
10210
  text-align: center;
10207
10211
  }
@@ -10210,7 +10214,7 @@ const FixTableHeaderAlignment = styled.div(_t23 || (_t23 = _$3`
10210
10214
  text-align: center;
10211
10215
  }
10212
10216
  `));
10213
- const ListWithDetailsReviewCellDiv = styled.div(_t24 || (_t24 = _$3`
10217
+ const ListWithDetailsReviewCellDiv = styled.div(_t25 || (_t25 = _$3`
10214
10218
  display: 'flex';
10215
10219
  flex-direction: 'column';
10216
10220
  text-align: 'start';
@@ -11522,17 +11526,24 @@ const MainTab = ({
11522
11526
  } = useJsonForms();
11523
11527
  const rowData = getDataAtPath(core === null || core === void 0 ? void 0 : core.data, childPath);
11524
11528
  const orderedRowData = orderRowData(rowData, (_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.detail);
11525
- const rowErrors = (_b = core === null || core === void 0 ? void 0 : core.errors) === null || _b === void 0 ? void 0 : _b.filter(e => {
11526
- const base = `/${childPath.replace(/\./g, '/')}`;
11527
- return e.instancePath === base || e.instancePath.startsWith(base + '/');
11528
- }).filter(e => {
11529
- var _a;
11530
- return (((_a = e === null || e === void 0 ? void 0 : e.message) === null || _a === void 0 ? void 0 : _a.length) || 0) > 0;
11531
- }).map(e => humanizeAjvError(e, core.schema, core.uischema)).map((msg, index, arr) => `${msg}${index < arr.length - 1 ? ', ' : ''}`);
11529
+ function resolveField(e) {
11530
+ if (e.keyword === 'required') {
11531
+ return e.params.missingProperty;
11532
+ }
11533
+ const path = e.instancePath.split('/');
11534
+ return path[path.length - 1];
11535
+ }
11536
+ const rowBase = `/${childPath.replace(/\./g, '/')}`;
11537
+ const fieldErrors = (_b = core === null || core === void 0 ? void 0 : core.errors) === null || _b === void 0 ? void 0 : _b.filter(e => e.instancePath === rowBase || e.instancePath.startsWith(rowBase + '/')).reduce((acc, e) => {
11538
+ const field = resolveField(e);
11539
+ acc[field] = humanizeAjvError(e, core.schema, core.uischema); //e.message;
11540
+ return acc;
11541
+ }, {});
11542
+ const errorText = fieldErrors && Object.values(fieldErrors).length > 0 ? Object.values(fieldErrors).join(', ') : undefined;
11532
11543
  return jsx("div", {
11533
11544
  "data-testid": `object-array-main-item-${rowIndex}`,
11534
- children: (rowErrors === null || rowErrors === void 0 ? void 0 : rowErrors.length) ? jsx(GoabFormItem, {
11535
- error: (rowErrors === null || rowErrors === void 0 ? void 0 : rowErrors.length) ? rowErrors : null,
11545
+ children: errorText ? jsx(GoabFormItem, {
11546
+ error: errorText,
11536
11547
  children: jsx(MainItemComponent, {
11537
11548
  rowData: orderedRowData,
11538
11549
  childPath: childPath,
@@ -11575,7 +11586,7 @@ const ObjectArrayList = ({
11575
11586
  listTitle,
11576
11587
  errors
11577
11588
  }) => {
11578
- var _a, _b;
11589
+ var _a, _b, _c, _d;
11579
11590
  const isEmptyList = data === 0;
11580
11591
  const rightRef = useRef(null);
11581
11592
  const current = rightRef.current;
@@ -11607,6 +11618,7 @@ const ObjectArrayList = ({
11607
11618
  const selectCurrentTab = index => {
11608
11619
  setCurrentIndex(index);
11609
11620
  };
11621
+ const continueButtonTitle = (_d = (_c = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _c === void 0 ? void 0 : _c.componentProps) === null || _d === void 0 ? void 0 : _d.listWithDetailsContinueButtonTitle;
11610
11622
  return jsx(ListContainer, {
11611
11623
  children: jsxs(RowFlex, {
11612
11624
  children: [currentListPage === 0 && jsx(FlexTabs, {
@@ -11624,7 +11636,8 @@ const ObjectArrayList = ({
11624
11636
  enabled: enabled,
11625
11637
  current: current,
11626
11638
  setCurrentListPage: index => setCurrentListPage(index),
11627
- uischema: uischema
11639
+ uischema: uischema,
11640
+ schema: schema
11628
11641
  }, childPath);
11629
11642
  })
11630
11643
  }), currentListPage > 0 && jsxs(UpdateListContainer, {
@@ -11651,7 +11664,7 @@ const ObjectArrayList = ({
11651
11664
  setCurrentListPage(0);
11652
11665
  },
11653
11666
  testId: "next-list-button",
11654
- children: "Continue"
11667
+ children: continueButtonTitle ? continueButtonTitle : 'Continue'
11655
11668
  })]
11656
11669
  })]
11657
11670
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.42.0",
3
+ "version": "2.42.2",
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",
@@ -13,6 +13,7 @@ export declare const FlexForm: import("styled-components/dist/types").IStyledCom
13
13
  export declare const TabName: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
14
14
  export declare const Trash: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
15
15
  export declare const ListContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
16
+ export declare const DetailMargin: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
16
17
  export declare const IconPadding: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
17
18
  export declare const UpdateListContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
18
19
  export declare const CompleteContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;