@abgov/jsonforms-components 2.13.1 → 2.13.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
@@ -9146,7 +9146,7 @@ const ObjectArrayToolBar = /*#__PURE__*/React.memo(function TableToolbar({
9146
9146
  children: jsx(GoAButton, {
9147
9147
  disabled: !enabled,
9148
9148
  testId: `object-array-toolbar-${label}`,
9149
- "aria-label": translations.addAriaLabel,
9149
+ "aria-label": `Add to button to ${(label === null || label === void 0 ? void 0 : label.toLowerCase()) || ''}`,
9150
9150
  onClick: addItem(path, createDefaultValue(schema, rootSchema)),
9151
9151
  type: (_c = (_b = uischema.options) === null || _b === void 0 ? void 0 : _b.addButtonType) !== null && _c !== void 0 ? _c : 'primary',
9152
9152
  children: ((_d = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _d === void 0 ? void 0 : _d.addButtonText) || capitalizeFirstLetter(`Add ${arrayLabel}`)
@@ -9321,12 +9321,13 @@ const getValidColumnProps$1 = scopedSchema => {
9321
9321
  };
9322
9322
  const EmptyList$1 = ({
9323
9323
  numColumns,
9324
+ noDataMessage,
9324
9325
  translations
9325
9326
  }) => jsx(GoAGrid, {
9326
9327
  minChildWidth: "30ch",
9327
9328
  children: jsx(TextCenter, {
9328
9329
  children: jsx("b", {
9329
- children: translations.noDataMessage
9330
+ children: noDataMessage
9330
9331
  })
9331
9332
  })
9332
9333
  });
@@ -9563,9 +9564,12 @@ const ObjectArrayList$1 = ({
9563
9564
  isInReview,
9564
9565
  handleChange
9565
9566
  }) => {
9567
+ var _a, _b;
9566
9568
  const isEmptyList = count === 0;
9567
9569
  if (isEmptyList) {
9570
+ const noDataMessage = (_b = (_a = uischema.options) === null || _a === void 0 ? void 0 : _a.noDataMessage) !== null && _b !== void 0 ? _b : 'No data';
9568
9571
  return jsx(EmptyList$1, {
9572
+ noDataMessage: noDataMessage,
9569
9573
  numColumns: getValidColumnProps$1(schema).length + 1,
9570
9574
  translations: translations
9571
9575
  });
@@ -9911,12 +9915,12 @@ const getValidColumnProps = scopedSchema => {
9911
9915
  };
9912
9916
  const EmptyList = ({
9913
9917
  numColumns,
9914
- translations
9918
+ noDataMessage
9915
9919
  }) => jsx(GoAGrid, {
9916
9920
  minChildWidth: "60ch",
9917
9921
  children: jsx(TextCenter, {
9918
9922
  children: jsx("b", {
9919
- children: translations.noDataMessage
9923
+ children: noDataMessage
9920
9924
  })
9921
9925
  })
9922
9926
  });
@@ -10129,10 +10133,9 @@ const ObjectArrayList = ({
10129
10133
  // eslint-disable-next-line react-hooks/exhaustive-deps
10130
10134
  }, [current, rightHeight, rightRef]);
10131
10135
  if (isEmptyList) {
10132
- if (((_a = uischema.options) === null || _a === void 0 ? void 0 : _a.noDataMessage) !== undefined) {
10133
- translations.noDataMessage = (_b = uischema.options) === null || _b === void 0 ? void 0 : _b.noDataMessage;
10134
- }
10136
+ const noDataMessge = (_b = (_a = uischema.options) === null || _a === void 0 ? void 0 : _a.noDataMessage) !== null && _b !== void 0 ? _b : 'No data';
10135
10137
  return jsx(EmptyList, {
10138
+ noDataMessage: noDataMessge,
10136
10139
  numColumns: getValidColumnProps(schema).length + 1,
10137
10140
  translations: translations
10138
10141
  });
@@ -10323,7 +10326,6 @@ const ListWithDetailsControl = props => {
10323
10326
  setOpen(false);
10324
10327
  // eslint-disable-next-line
10325
10328
  }, [setOpen, path, rowData, rowData]);
10326
- const deleteTitle = props.translations !== null && props.translations.deleteDialogTitle !== undefined ? props.translations.deleteDialogTitle : '';
10327
10329
  return jsxs(Visible, {
10328
10330
  visible: visible,
10329
10331
  children: [jsx(ListWithDetailControl, Object.assign({}, props, {
@@ -10335,7 +10337,7 @@ const ListWithDetailsControl = props => {
10335
10337
  open: open,
10336
10338
  onCancel: deleteCancel,
10337
10339
  onConfirm: deleteConfirm,
10338
- title: deleteTitle,
10340
+ title: 'Delete confirmation',
10339
10341
  message: `Are you sure you wish to delete ${name}`
10340
10342
  })]
10341
10343
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.13.1",
3
+ "version": "2.13.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",
@@ -5,6 +5,7 @@ export type ObjectArrayControlProps = ArrayLayoutProps & WithDeleteDialogSupport
5
5
  export declare const extractScopesFromUISchema: (uischema: any) => string[];
6
6
  export interface EmptyListProps {
7
7
  numColumns: number;
8
+ noDataMessage: string;
8
9
  translations: ArrayTranslations;
9
10
  }
10
11
  interface NonEmptyRowComponentProps {
@@ -81,6 +81,7 @@ export interface NonEmptyRowProps {
81
81
  }
82
82
  export interface EmptyListProps {
83
83
  numColumns: number;
84
+ noDataMessage: string;
84
85
  translations: ArrayTranslations;
85
86
  }
86
87
  export interface TableRowsProp {