@abgov/jsonforms-components 1.43.3 → 1.43.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.
Files changed (2) hide show
  1. package/index.esm.js +15 -5
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -2466,7 +2466,7 @@ const StepperContext = /*#__PURE__*/createContext({
2466
2466
  stepId: 0
2467
2467
  });
2468
2468
  const isEmpty = value => {
2469
- return value === undefined || value === null || typeof value === 'string' && value.length < 1;
2469
+ return value === undefined || value === null || typeof value === 'string' && value.length < 1 || typeof value === 'boolean' && value === false;
2470
2470
  };
2471
2471
  const getCompletionStatus = (table, step, isFormChanged = false) => {
2472
2472
  const nonEmptyCount = getNonEmptyCount(table, step);
@@ -5743,15 +5743,24 @@ const FormStepper = props => {
5743
5743
  }
5744
5744
  setPage(page);
5745
5745
  }
5746
+ const getAllStatuses = (nextPage, totalVisibleTabs) => {
5747
+ const previouslyActivePage = nextPage - 1;
5748
+ const statuses = [...stepStatuses];
5749
+ for (let currentPage = 1; currentPage <= previouslyActivePage; currentPage++) {
5750
+ const pageStatus = getCompletionStatus(inputStatuses, currentPage, true);
5751
+ statuses[currentPage - 1] = pageStatus ? pageStatus : 'incomplete';
5752
+ }
5753
+ return statuses;
5754
+ };
5746
5755
  /* istanbul ignore next */
5747
5756
  function setTab(page) {
5748
5757
  const categoryLabels = [...allCategories.elements.map(category => category.label), summaryLabel];
5749
5758
  const visibleLabels = [...visibleCategoryLabels, summaryLabel];
5750
5759
  const newPage = mapToVisibleStep(page, categoryLabels, visibleLabels);
5751
- const pageStatus = getCompletionStatus(inputStatuses, page, true);
5752
- const statuses = [...stepStatuses];
5753
- statuses[page - 1] = pageStatus ? pageStatus : 'incomplete';
5754
- setStepStatuses(statuses);
5760
+ if (Object.keys(inputStatuses).length) {
5761
+ const statuses = getAllStatuses(page, visibleLabels.length);
5762
+ setStepStatuses(statuses);
5763
+ }
5755
5764
  setPage(newPage);
5756
5765
  }
5757
5766
  function setPage(page) {
@@ -6144,6 +6153,7 @@ const AttachmentBorder = styled.div(_t2$2 || (_t2$2 = _$3`
6144
6153
  margin-top: var(--goa-space-2xs);
6145
6154
  `));
6146
6155
  const FileUploaderStyle = styled.div(_t3$2 || (_t3$2 = _$3`
6156
+ margin-bottom: var(--goa-space-l);
6147
6157
  .label {
6148
6158
  display: block;
6149
6159
  font-weight: var(--goa-font-weight-bold);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.43.3",
3
+ "version": "1.43.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",