@abgov/jsonforms-components 2.6.2 → 2.6.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.
Files changed (2) hide show
  1. package/index.esm.js +8 -4
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -8506,7 +8506,6 @@ const FileUploaderReview = props => {
8506
8506
  };
8507
8507
  const FileUploader = _ref => {
8508
8508
  let {
8509
- data,
8510
8509
  path,
8511
8510
  handleChange,
8512
8511
  uischema
@@ -8521,6 +8520,7 @@ const FileUploader = _ref => {
8521
8520
  const deleteTriggerFunction = (_c = enumerators === null || enumerators === void 0 ? void 0 : enumerators.functions) === null || _c === void 0 ? void 0 : _c.get('delete-file');
8522
8521
  const deleteTrigger = deleteTriggerFunction && deleteTriggerFunction();
8523
8522
  const fileListValue = enumerators === null || enumerators === void 0 ? void 0 : enumerators.data.get('file-list');
8523
+ const [loadingFileName, setLoadingFileName] = useState(undefined);
8524
8524
  const countries = ['Argentina', 'Brazil', 'Canada', 'Denmark', 'Egypt', 'France', 'Greece', 'India', 'Japan', 'Kenya'];
8525
8525
  enumerators === null || enumerators === void 0 ? void 0 : enumerators.addFormContextData('countries', countries);
8526
8526
  const user = enumerators === null || enumerators === void 0 ? void 0 : enumerators.getFormContextData('user');
@@ -8544,6 +8544,7 @@ const FileUploader = _ref => {
8544
8544
  deleteTrigger(fileInList, propertyId);
8545
8545
  }
8546
8546
  }
8547
+ setLoadingFileName(file === null || file === void 0 ? void 0 : file.name);
8547
8548
  // To support multipleFileUploader, the propertyId (path) is in propertyId.index format
8548
8549
  uploadTrigger(file, `${propertyId}.${fileListLength}`);
8549
8550
  setDeleteHide(false);
@@ -8568,6 +8569,9 @@ const FileUploader = _ref => {
8568
8569
  return (_a = fileList === null || fileList === void 0 ? void 0 : fileList[props.i18nKeyPrefix]) === null || _a === void 0 ? void 0 : _a[index];
8569
8570
  }
8570
8571
  useEffect(() => {
8572
+ if (loadingFileName !== undefined) {
8573
+ setLoadingFileName(undefined);
8574
+ }
8571
8575
  // UseEffect is required because not having it causes a react update error, but
8572
8576
  // it doesn't function correctly within jsonforms unless there is a minor delay here
8573
8577
  const delayedFunction = () => {
@@ -8662,13 +8666,13 @@ const FileUploader = _ref => {
8662
8666
  }), helpText && jsx(HelpText, {
8663
8667
  children: helpText
8664
8668
  }), jsx("div", {
8665
- children: Array.isArray(data) && data[0] === 'Loading' ? jsx(GoAModal, {
8666
- open: Array.isArray(data) && data[0] === 'Loading',
8669
+ children: loadingFileName !== undefined ? jsx(GoAModal, {
8670
+ open: loadingFileName !== undefined,
8667
8671
  children: jsx("div", {
8668
8672
  className: "align-center",
8669
8673
  children: jsx(GoACircularProgress, {
8670
8674
  visible: true,
8671
- message: `Uploading ${data[1]}`,
8675
+ message: `Uploading ${loadingFileName}`,
8672
8676
  size: "large"
8673
8677
  })
8674
8678
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.6.2",
3
+ "version": "2.6.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",