@abgov/jsonforms-components 2.13.2 → 2.13.4

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
@@ -6598,7 +6598,8 @@ const CheckboxGroup = props => {
6598
6598
  handleChange,
6599
6599
  options,
6600
6600
  config,
6601
- label
6601
+ label,
6602
+ enabled
6602
6603
  } = props;
6603
6604
  const newSchema = schema;
6604
6605
  const enumData = (schema === null || schema === void 0 ? void 0 : schema.enum) || ((_a = newSchema === null || newSchema === void 0 ? void 0 : newSchema.items) === null || _a === void 0 ? void 0 : _a.enum) || [];
@@ -6609,6 +6610,7 @@ const CheckboxGroup = props => {
6609
6610
  children: enumData.map(enumValue => {
6610
6611
  return jsx(GoACheckbox, Object.assign({
6611
6612
  name: enumValue,
6613
+ disabled: !enabled,
6612
6614
  checked: data ? data.includes(enumValue) : false,
6613
6615
  value: `${enumValue}`
6614
6616
  }, appliedUiSchemaOptions, {
@@ -9146,7 +9148,7 @@ const ObjectArrayToolBar = /*#__PURE__*/React.memo(function TableToolbar({
9146
9148
  children: jsx(GoAButton, {
9147
9149
  disabled: !enabled,
9148
9150
  testId: `object-array-toolbar-${label}`,
9149
- "aria-label": translations.addAriaLabel,
9151
+ "aria-label": `Add to button to ${(label === null || label === void 0 ? void 0 : label.toLowerCase()) || ''}`,
9150
9152
  onClick: addItem(path, createDefaultValue(schema, rootSchema)),
9151
9153
  type: (_c = (_b = uischema.options) === null || _b === void 0 ? void 0 : _b.addButtonType) !== null && _c !== void 0 ? _c : 'primary',
9152
9154
  children: ((_d = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _d === void 0 ? void 0 : _d.addButtonText) || capitalizeFirstLetter(`Add ${arrayLabel}`)
@@ -9321,12 +9323,13 @@ const getValidColumnProps$1 = scopedSchema => {
9321
9323
  };
9322
9324
  const EmptyList$1 = ({
9323
9325
  numColumns,
9326
+ noDataMessage,
9324
9327
  translations
9325
9328
  }) => jsx(GoAGrid, {
9326
9329
  minChildWidth: "30ch",
9327
9330
  children: jsx(TextCenter, {
9328
9331
  children: jsx("b", {
9329
- children: translations.noDataMessage
9332
+ children: noDataMessage
9330
9333
  })
9331
9334
  })
9332
9335
  });
@@ -9563,9 +9566,12 @@ const ObjectArrayList$1 = ({
9563
9566
  isInReview,
9564
9567
  handleChange
9565
9568
  }) => {
9569
+ var _a, _b;
9566
9570
  const isEmptyList = count === 0;
9567
9571
  if (isEmptyList) {
9572
+ const noDataMessage = (_b = (_a = uischema.options) === null || _a === void 0 ? void 0 : _a.noDataMessage) !== null && _b !== void 0 ? _b : 'No data';
9568
9573
  return jsx(EmptyList$1, {
9574
+ noDataMessage: noDataMessage,
9569
9575
  numColumns: getValidColumnProps$1(schema).length + 1,
9570
9576
  translations: translations
9571
9577
  });
@@ -9911,12 +9917,12 @@ const getValidColumnProps = scopedSchema => {
9911
9917
  };
9912
9918
  const EmptyList = ({
9913
9919
  numColumns,
9914
- translations
9920
+ noDataMessage
9915
9921
  }) => jsx(GoAGrid, {
9916
9922
  minChildWidth: "60ch",
9917
9923
  children: jsx(TextCenter, {
9918
9924
  children: jsx("b", {
9919
- children: translations.noDataMessage
9925
+ children: noDataMessage
9920
9926
  })
9921
9927
  })
9922
9928
  });
@@ -10129,10 +10135,9 @@ const ObjectArrayList = ({
10129
10135
  // eslint-disable-next-line react-hooks/exhaustive-deps
10130
10136
  }, [current, rightHeight, rightRef]);
10131
10137
  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
- }
10138
+ const noDataMessge = (_b = (_a = uischema.options) === null || _a === void 0 ? void 0 : _a.noDataMessage) !== null && _b !== void 0 ? _b : 'No data';
10135
10139
  return jsx(EmptyList, {
10140
+ noDataMessage: noDataMessge,
10136
10141
  numColumns: getValidColumnProps(schema).length + 1,
10137
10142
  translations: translations
10138
10143
  });
@@ -10323,10 +10328,6 @@ const ListWithDetailsControl = props => {
10323
10328
  setOpen(false);
10324
10329
  // eslint-disable-next-line
10325
10330
  }, [setOpen, path, rowData, rowData]);
10326
- // const deleteTitle =
10327
- // props.translations !== null && props.translations.deleteDialogTitle !== undefined
10328
- // ? props.translations.deleteDialogTitle
10329
- // : '';
10330
10331
  return jsxs(Visible, {
10331
10332
  visible: visible,
10332
10333
  children: [jsx(ListWithDetailControl, Object.assign({}, props, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.13.2",
3
+ "version": "2.13.4",
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 {