@abgov/jsonforms-components 2.60.15 → 2.60.16

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
@@ -11758,6 +11758,16 @@ const DeleteDialog = /*#__PURE__*/React.memo(function DeleteDialog({
11758
11758
  }, 1);
11759
11759
  });
11760
11760
 
11761
+ const jsonPreviewStyle = {
11762
+ display: 'block',
11763
+ width: '100%',
11764
+ boxSizing: 'border-box',
11765
+ margin: 0,
11766
+ padding: 0,
11767
+ whiteSpace: 'pre-wrap',
11768
+ textAlign: 'left',
11769
+ overflowX: 'auto'
11770
+ };
11761
11771
  function prettify(prop) {
11762
11772
  return prop.replace(/([A-Z])/g, ' $1').replace(/[_-]/g, ' ').replace(/^./, c => c.toUpperCase());
11763
11773
  }
@@ -11874,18 +11884,21 @@ const renderCellColumn = ({
11874
11884
  return `${dateObj.year}-${dateObj.month}-${dayValue}`;
11875
11885
  }
11876
11886
  return jsx("pre", {
11887
+ style: jsonPreviewStyle,
11877
11888
  children: JSON.stringify(data, null, 2)
11878
11889
  });
11879
11890
  } else if (result.length === 0) {
11880
11891
  return renderWarningCell();
11881
11892
  } else if (result.length > 0 && (isObjectArrayEmpty(data) || nestedErrors.length > 0)) {
11882
11893
  return jsx("pre", {
11894
+ style: jsonPreviewStyle,
11883
11895
  children: renderWarningCell(JSON.stringify(data, null, 2))
11884
11896
  });
11885
11897
  } else if (data !== undefined && result.length > 0 && error !== '' && error !== undefined) {
11886
11898
  const values = Object.values(data);
11887
11899
  if (values && values.length > 0) {
11888
11900
  return jsx("pre", {
11901
+ style: jsonPreviewStyle,
11889
11902
  children: renderWarningCell(JSON.stringify(values.at(0), null, 2))
11890
11903
  });
11891
11904
  }
@@ -12637,6 +12650,7 @@ const ArrayControlReview = props => {
12637
12650
  const GoAArrayControlRenderer = withJsonFormsControlProps(ArrayControlBase);
12638
12651
  const GoAArrayControlReviewRenderer = withJsonFormsControlProps(ArrayControlReview);
12639
12652
  const PrimitiveArrayControl = props => {
12653
+ var _enumerators$function;
12640
12654
  const {
12641
12655
  data,
12642
12656
  path,
@@ -12648,8 +12662,13 @@ const PrimitiveArrayControl = props => {
12648
12662
  renderers,
12649
12663
  cells
12650
12664
  } = props;
12665
+ const enumerators = useContext(JsonFormContext);
12651
12666
  const rawItems = Array.isArray(data) ? data : [];
12652
12667
  const items = rawItems.filter(item => item !== undefined && item !== null);
12668
+ const deleteTriggerFunction = enumerators == null || (_enumerators$function = enumerators.functions) == null ? void 0 : _enumerators$function.get('delete-file');
12669
+ const deleteTrigger = deleteTriggerFunction && deleteTriggerFunction();
12670
+ const fileListValue = enumerators == null ? void 0 : enumerators.data.get('file-list');
12671
+ const fileList = fileListValue && fileListValue();
12653
12672
  useEffect(() => {
12654
12673
  if (rawItems.length !== items.length) {
12655
12674
  handleChange(path, items.length > 0 ? items : undefined);
@@ -12662,9 +12681,20 @@ const PrimitiveArrayControl = props => {
12662
12681
  const getOptionLabel = option => typeof option === 'string' ? option : option.title || option.const;
12663
12682
  const getOptionDescription = option => typeof option === 'string' ? undefined : option.description;
12664
12683
  const removeItem = index => {
12684
+ const itemSchema = schema == null ? void 0 : schema.items;
12685
+ const removedItem = items[index];
12686
+ const itemPath = composePaths(path, `${index}`);
12687
+ if ((itemSchema == null ? void 0 : itemSchema.format) === 'file-urn' && deleteTrigger && removedItem) {
12688
+ var _fileList$itemPath;
12689
+ const allUploadedFiles = Object.values(fileList || {}).flat() || [];
12690
+ const rowFile = (fileList == null || (_fileList$itemPath = fileList[itemPath]) == null ? void 0 : _fileList$itemPath.find(file => (file == null ? void 0 : file.urn) === removedItem)) || allUploadedFiles.find(file => (file == null ? void 0 : file.urn) === removedItem);
12691
+ if (rowFile != null && rowFile.urn) {
12692
+ deleteTrigger(rowFile, itemPath);
12693
+ }
12694
+ }
12665
12695
  const copy = [...items];
12666
12696
  copy.splice(index, 1);
12667
- handleChange(path, copy);
12697
+ handleChange(path, copy.length > 0 ? copy : undefined);
12668
12698
  };
12669
12699
  const getPrimitiveArrayOptions = schema => {
12670
12700
  const itemSchema = schema == null ? void 0 : schema.items;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.60.15",
3
+ "version": "2.60.16",
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",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-04-27T19:55:39.353Z",
4
- "sourceCommit": "c9005bf394764ce1ad7e3af2c39bff2c9b90f254",
3
+ "generatedAt": "2026-04-27T20:33:20.640Z",
4
+ "sourceCommit": "39950b0288e24ea3e4d895bf4bbe2b79c542625f",
5
5
  "sourcePath": "libs/jsonforms-components/src/index.ts",
6
6
  "rendererCount": 33,
7
7
  "renderers": [