@abgov/jsonforms-components 2.21.2 → 2.21.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
@@ -7,7 +7,7 @@ import axios from 'axios';
7
7
  import get$1 from 'lodash/get';
8
8
  import { rankWith, isStringControl, and, optionIs, uiTypeIs, isDateControl, isNumberControl, isIntegerControl, isDateTimeControl, isTimeControl, isEnumControl, isBooleanControl, getAjv, isVisible, toDataPath, isEnabled, deriveLabelForUISchemaElement, schemaTypeIs, formatIs, createDefaultValue, or, isObjectArrayControl, isPrimitiveArrayControl, Paths, schemaMatches, hasType, isControl, isCategorization, isLayout } from '@jsonforms/core';
9
9
  import { withJsonFormsControlProps, withJsonFormsEnumProps, withTranslateProps, JsonFormsDispatch, useJsonForms, withJsonFormsLayoutProps, withJsonFormsArrayLayoutProps, withJsonFormsAllOfProps, withJsonFormsCellProps } from '@jsonforms/react';
10
- import * as _$a from 'lodash';
10
+ import * as _$b from 'lodash';
11
11
  import { isEqual, isEmpty as isEmpty$1, isObject as isObject$f } from 'lodash';
12
12
  import merge from 'lodash/merge';
13
13
  import isEmpty from 'lodash/isEmpty';
@@ -3547,16 +3547,16 @@ const onChangeForNumericControl = props => {
3547
3547
  }
3548
3548
  };
3549
3549
 
3550
- let _$9 = t => t,
3551
- _t$9,
3550
+ let _$a = t => t,
3551
+ _t$a,
3552
3552
  _t2$7;
3553
- styled.div(_t$9 || (_t$9 = _$9`
3553
+ styled.div(_t$a || (_t$a = _$a`
3554
3554
  height: 70vh;
3555
3555
  overflow-y: auto;
3556
3556
  padding-left: var(--goa-space-2xs);
3557
3557
  padding-right: var(--goa-space-2xs);
3558
3558
  `));
3559
- const Visible = styled.div(_t2$7 || (_t2$7 = _$9`
3559
+ const Visible = styled.div(_t2$7 || (_t2$7 = _$a`
3560
3560
  display: ${0};
3561
3561
  `), p => p.visible ? 'initial' : 'none');
3562
3562
 
@@ -5188,8 +5188,8 @@ const JsonFormRegisterProvider = ({
5188
5188
  });
5189
5189
  };
5190
5190
 
5191
- let _$8 = t => t,
5192
- _t$8,
5191
+ let _$9 = t => t,
5192
+ _t$9,
5193
5193
  _t2$6,
5194
5194
  _t3$5,
5195
5195
  _t4$5,
@@ -5197,42 +5197,42 @@ let _$8 = t => t,
5197
5197
  _t6$3,
5198
5198
  _t7$2,
5199
5199
  _t8$2;
5200
- const FormFieldWrapper = styled.div(_t$8 || (_t$8 = _$8`
5200
+ const FormFieldWrapper = styled.div(_t$9 || (_t$9 = _$9`
5201
5201
  margin-bottom: var(--goa-space-l);
5202
5202
  `));
5203
- const WarningIconDiv = styled.div(_t2$6 || (_t2$6 = _$8`
5203
+ const WarningIconDiv = styled.div(_t2$6 || (_t2$6 = _$9`
5204
5204
  display: inline-flex;
5205
5205
  align-items: flex-start;
5206
5206
  gap: 0.25rem;
5207
5207
  font-size: var(--goa-font-size-2);
5208
5208
  color: var(--goa-color-interactive-error);
5209
5209
  `));
5210
- const RequiredTextLabel = styled.label(_t3$5 || (_t3$5 = _$8`
5210
+ const RequiredTextLabel = styled.label(_t3$5 || (_t3$5 = _$9`
5211
5211
  color: var(--goa-color-greyscale-700);
5212
5212
  font-weight: var(--goa-font-weight-regular);
5213
5213
  font-size: var(--goa-font-size-2);
5214
5214
  line-height: var(--goa-line-height-1);
5215
5215
  font-style: normal;
5216
5216
  `));
5217
- const PageReviewNameCol = styled.td(_t4$5 || (_t4$5 = _$8`
5217
+ const PageReviewNameCol = styled.td(_t4$5 || (_t4$5 = _$9`
5218
5218
  width: 5%;
5219
5219
  padding-top: var(--goa-space-s);
5220
5220
  padding-bottom: var(--goa-space-s);
5221
5221
  padding-right: var(--goa-space-m);
5222
5222
  `));
5223
- const PageReviewValueCol = styled.td(_t5$4 || (_t5$4 = _$8`
5223
+ const PageReviewValueCol = styled.td(_t5$4 || (_t5$4 = _$9`
5224
5224
  width: 20%;
5225
5225
  text-align: left;
5226
5226
  `));
5227
5227
  //Check and unchecked are different heights otherwise
5228
- const CheckboxWrapper = styled.div(_t6$3 || (_t6$3 = _$8`
5228
+ const CheckboxWrapper = styled.div(_t6$3 || (_t6$3 = _$9`
5229
5229
  height: 28px;
5230
5230
  `));
5231
- styled.h4(_t7$2 || (_t7$2 = _$8`
5231
+ styled.h4(_t7$2 || (_t7$2 = _$9`
5232
5232
  margin: 0 0 0.25rem 0;
5233
5233
  fontsize: larger;
5234
5234
  `));
5235
- styled.h4(_t8$2 || (_t8$2 = _$8`
5235
+ styled.h4(_t8$2 || (_t8$2 = _$9`
5236
5236
  border-bottom: 1px solid #ddd;
5237
5237
  `));
5238
5238
 
@@ -5457,12 +5457,12 @@ const SPACE_KEY = ' ';
5457
5457
  const ALT_KEY = 'Alt';
5458
5458
  const SHIFT_KEY = 'Shift';
5459
5459
 
5460
- let _$7 = t => t,
5461
- _t$7,
5460
+ let _$8 = t => t,
5461
+ _t$8,
5462
5462
  _t2$5,
5463
5463
  _t3$4,
5464
5464
  _t4$4;
5465
- const GoADropdownTextbox = styled.div(_t$7 || (_t$7 = _$7`
5465
+ const GoADropdownTextbox = styled.div(_t$8 || (_t$8 = _$8`
5466
5466
  border-radius: var(--goa-space-2xs);
5467
5467
  box-shadow: ${0};
5468
5468
  &:hover {
@@ -5473,11 +5473,11 @@ const GoADropdownTextbox = styled.div(_t$7 || (_t$7 = _$7`
5473
5473
  box-shadow: ${0};
5474
5474
  }
5475
5475
  `), p => p.isOpen ? `0 0 0 3px var(--goa-color-interactive-focus)` : '', p => p.isOpen ? `0 0 0 3px var(--goa-color-interactive-focus) !important` : '');
5476
- const GoADropdownListContainerWrapper = styled.div(_t2$5 || (_t2$5 = _$7`
5476
+ const GoADropdownListContainerWrapper = styled.div(_t2$5 || (_t2$5 = _$8`
5477
5477
  position: relative;
5478
5478
  display: ${0};
5479
5479
  `), p => !(p === null || p === void 0 ? void 0 : p.isOpen) && 'none');
5480
- const GoADropdownListContainer = styled.div(_t3$4 || (_t3$4 = _$7`
5480
+ const GoADropdownListContainer = styled.div(_t3$4 || (_t3$4 = _$8`
5481
5481
  border: solid 1px var(--goa-color-greyscale-200);
5482
5482
  border-radius: var(--goa-space-2xs);
5483
5483
  background: var(--goa-color-greyscale-white);
@@ -5501,7 +5501,7 @@ const GoADropdownListContainer = styled.div(_t3$4 || (_t3$4 = _$7`
5501
5501
  scrollbar-color: #a8a8a8 var(--goa-color-greyscale-100) !important;
5502
5502
  }
5503
5503
  `), p => p.optionListMaxHeight || '272px');
5504
- const GoADropdownListOption = styled.div(_t4$4 || (_t4$4 = _$7`
5504
+ const GoADropdownListOption = styled.div(_t4$4 || (_t4$4 = _$8`
5505
5505
  padding: var(--goa-space-2xs) var(--goa-space-s);
5506
5506
  text-overflow: ellipsis;
5507
5507
  color: ${0} !important;
@@ -5549,7 +5549,8 @@ const Dropdown = props => {
5549
5549
  optionListMaxHeight,
5550
5550
  isAutoCompletion,
5551
5551
  enabled,
5552
- id
5552
+ id,
5553
+ width
5553
5554
  } = props;
5554
5555
  const [isOpen, setIsOpen] = useState(false);
5555
5556
  const [selectedOption, setSelectedOption] = useState(selected);
@@ -5716,6 +5717,9 @@ const Dropdown = props => {
5716
5717
  };
5717
5718
  return jsxs("div", {
5718
5719
  "data-testid": id,
5720
+ style: {
5721
+ width: width || '100%'
5722
+ },
5719
5723
  children: [jsx(GoADropdownTextbox, {
5720
5724
  isOpen: isOpen,
5721
5725
  onClick: e => {
@@ -5855,6 +5859,7 @@ const GoAInputText = props => {
5855
5859
  selected: data,
5856
5860
  id: `jsonforms-${label}-dropdown`,
5857
5861
  label: label || '',
5862
+ width: width,
5858
5863
  isAutoCompletion: autoCompletion,
5859
5864
  onChange: value => {
5860
5865
  handleChange(path, value);
@@ -6355,7 +6360,7 @@ function fetchRegisterConfigFromOptions(options) {
6355
6360
  return config;
6356
6361
  }
6357
6362
  const EnumSelect = props => {
6358
- var _a, _b, _c, _d;
6363
+ var _a, _b, _c, _d, _e, _f;
6359
6364
  const {
6360
6365
  data,
6361
6366
  enabled,
@@ -6401,6 +6406,7 @@ const EnumSelect = props => {
6401
6406
  }
6402
6407
  return newOptions.filter(option => option.value !== '');
6403
6408
  }, [registerData, options]);
6409
+ const width = ((_f = (_e = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _e === void 0 ? void 0 : _e.componentProps) === null || _f === void 0 ? void 0 : _f.width) || '100%';
6404
6410
  useEffect(() => {
6405
6411
  if (registerConfig) {
6406
6412
  registerCtx === null || registerCtx === void 0 ? void 0 : registerCtx.fetchRegisterByUrl(registerConfig);
@@ -6413,6 +6419,7 @@ const EnumSelect = props => {
6413
6419
  items: mergedOptions,
6414
6420
  enabled: enabled,
6415
6421
  selected: data,
6422
+ width: width,
6416
6423
  id: `jsonforms-${label}-dropdown`,
6417
6424
  label: label,
6418
6425
  isAutoCompletion: autoCompletion,
@@ -6578,8 +6585,8 @@ const BooleanRadioControl = props => jsx(GoAInputBaseControl, Object.assign({},
6578
6585
  const GoABooleanRadioControlTester = rankWith(3, and(isBooleanControl, optionIs('radio', true)));
6579
6586
  const GoABooleanRadioControl = withJsonFormsControlProps(BooleanRadioControl);
6580
6587
 
6581
- let _$6 = t => t,
6582
- _t$6;
6588
+ let _$7 = t => t,
6589
+ _t$7;
6583
6590
  const Checkboxes = ({
6584
6591
  children,
6585
6592
  orientation,
@@ -6591,7 +6598,7 @@ const Checkboxes = ({
6591
6598
  children: children
6592
6599
  });
6593
6600
  };
6594
- const CheckBoxGroupDiv = styled.div(_t$6 || (_t$6 = _$6`
6601
+ const CheckBoxGroupDiv = styled.div(_t$7 || (_t$7 = _$7`
6595
6602
  .horizontal {
6596
6603
  display: flex;
6597
6604
  flex-direction: row;
@@ -6799,8 +6806,8 @@ const GoAInputBaseTableReview = props => {
6799
6806
  };
6800
6807
  const GoAInputBaseTableReviewControl = withJsonFormsControlProps(GoAInputBaseTableReview);
6801
6808
 
6802
- let _$5 = t => t,
6803
- _t$5;
6809
+ let _$6 = t => t,
6810
+ _t$6;
6804
6811
  const renderLayoutElements = (elements, schema, path, enabled, renderers, cells) => {
6805
6812
  return elements.map((child, index) => jsx(JsonFormsDispatch, {
6806
6813
  uischema: child,
@@ -6879,14 +6886,14 @@ const ReviewLayoutRenderer = ({
6879
6886
  }
6880
6887
  }
6881
6888
  };
6882
- const ReviewGrid = styled.div(_t$5 || (_t$5 = _$5`
6889
+ const ReviewGrid = styled.div(_t$6 || (_t$6 = _$6`
6883
6890
  display: grid;
6884
6891
  grid-template-columns: repeat(auto-fit, minmax(250px, calc(50% - 8px)));
6885
6892
  gap: 16px;
6886
6893
  `));
6887
6894
 
6888
- let _$4 = t => t,
6889
- _t$4,
6895
+ let _$5 = t => t,
6896
+ _t$5,
6890
6897
  _t2$4,
6891
6898
  _t3$3,
6892
6899
  _t4$3,
@@ -6907,8 +6914,9 @@ let _$4 = t => t,
6907
6914
  _t19$1,
6908
6915
  _t20$1,
6909
6916
  _t21,
6910
- _t22;
6911
- const ReviewItem = styled.div(_t$4 || (_t$4 = _$4`
6917
+ _t22,
6918
+ _t23;
6919
+ const ReviewItem = styled.div(_t$5 || (_t$5 = _$5`
6912
6920
  display: flex;
6913
6921
  flex-direction: column;
6914
6922
  border: var(--goa-border-width-s) solid grey;
@@ -6919,7 +6927,7 @@ const ReviewItem = styled.div(_t$4 || (_t$4 = _$4`
6919
6927
  display: none;
6920
6928
  }
6921
6929
  `));
6922
- const ReviewItemSection = styled.div(_t2$4 || (_t2$4 = _$4`
6930
+ const ReviewItemSection = styled.div(_t2$4 || (_t2$4 = _$5`
6923
6931
  background-color: #f1f1f1;
6924
6932
  margin-bottom: var(--goa-space-m);
6925
6933
  padding: var(--goa-space-m);
@@ -6930,18 +6938,18 @@ const ReviewItemSection = styled.div(_t2$4 || (_t2$4 = _$4`
6930
6938
  max-width: 1600px;
6931
6939
  }
6932
6940
  `));
6933
- const ReviewItemHeader = styled.div(_t3$3 || (_t3$3 = _$4`
6941
+ const ReviewItemHeader = styled.div(_t3$3 || (_t3$3 = _$5`
6934
6942
  display: flex;
6935
6943
  align-items: center;
6936
6944
  justify-content: space-between;
6937
6945
  margin-bottom: var(--goa-space-xl);
6938
6946
  `));
6939
- const ReviewItemTitle = styled.div(_t4$3 || (_t4$3 = _$4`
6947
+ const ReviewItemTitle = styled.div(_t4$3 || (_t4$3 = _$5`
6940
6948
  font-size: var(--goa-space-l);
6941
6949
  line-height: var(--goa-space-xl);
6942
6950
  font-weight: 300;
6943
6951
  `));
6944
- const Anchor = styled.div(_t5$3 || (_t5$3 = _$4`
6952
+ const Anchor = styled.div(_t5$3 || (_t5$3 = _$5`
6945
6953
  color: #0070c4;
6946
6954
  text-decoration: underline;
6947
6955
  outline: none;
@@ -6952,20 +6960,20 @@ const Anchor = styled.div(_t5$3 || (_t5$3 = _$4`
6952
6960
  background-color: #e6f7ff;
6953
6961
  }
6954
6962
  `));
6955
- styled.div(_t6$2 || (_t6$2 = _$4`
6963
+ styled.div(_t6$2 || (_t6$2 = _$5`
6956
6964
  margin-left: var(--goa-space-m);
6957
6965
  `));
6958
- styled.div(_t7$1 || (_t7$1 = _$4`
6966
+ styled.div(_t7$1 || (_t7$1 = _$5`
6959
6967
  margin-bottom: var(--goa-space-m);
6960
6968
  `));
6961
- styled.div(_t8$1 || (_t8$1 = _$4`
6969
+ styled.div(_t8$1 || (_t8$1 = _$5`
6962
6970
  margin: var(--goa-space-s);
6963
6971
  width: 100%;
6964
6972
  `));
6965
- styled.h3(_t9$1 || (_t9$1 = _$4`
6973
+ styled.h3(_t9$1 || (_t9$1 = _$5`
6966
6974
  text-transform: capitalize;
6967
6975
  `));
6968
- const RightAlignmentDiv = styled.div(_t10$1 || (_t10$1 = _$4`
6976
+ const RightAlignmentDiv = styled.div(_t10$1 || (_t10$1 = _$5`
6969
6977
  @media screen and (max-width: 767px) {
6970
6978
  margin-bottom: var(--goa-space-l);
6971
6979
  }
@@ -6975,55 +6983,55 @@ const RightAlignmentDiv = styled.div(_t10$1 || (_t10$1 = _$4`
6975
6983
  margin-bottom: var(--goa-space-l);
6976
6984
  }
6977
6985
  `));
6978
- const FormStepperSummaryH3 = styled.h3(_t11$1 || (_t11$1 = _$4`
6986
+ const FormStepperSummaryH3 = styled.h3(_t11$1 || (_t11$1 = _$5`
6979
6987
  flex: 1;
6980
6988
  margin-bottom: var(--goa-space-m);
6981
6989
  font-size: var(--goa-font-size-7);
6982
6990
  line-height: var(--goa-line-height-4);
6983
6991
  font-weight: var(--goa-font-weight-regular);
6984
6992
  `));
6985
- const PageRenderPadding = styled.div(_t12$1 || (_t12$1 = _$4`
6993
+ const PageRenderPadding = styled.div(_t12$1 || (_t12$1 = _$5`
6986
6994
  margin-top: var(--goa-space-2xl);
6987
6995
  `));
6988
- styled.div(_t13$1 || (_t13$1 = _$4`
6996
+ styled.div(_t13$1 || (_t13$1 = _$5`
6989
6997
  margin-bottom: var(--goa-space-2xl);
6990
6998
  `));
6991
- const PageBorder = styled.h3(_t14$1 || (_t14$1 = _$4`
6999
+ const PageBorder = styled.h3(_t14$1 || (_t14$1 = _$5`
6992
7000
  padding: var(--goa-space-3xl);
6993
7001
  `));
6994
- const TableReviewItemSection = styled.div(_t15$1 || (_t15$1 = _$4`
7002
+ const TableReviewItemSection = styled.div(_t15$1 || (_t15$1 = _$5`
6995
7003
  .element-style {
6996
7004
  max-width: 1600px;
6997
7005
  }
6998
7006
  `));
6999
- const TableReviewItem = styled.div(_t16$1 || (_t16$1 = _$4`
7007
+ const TableReviewItem = styled.div(_t16$1 || (_t16$1 = _$5`
7000
7008
  border: 1px solid #dcdcdc;
7001
7009
  border-radius: 5px;
7002
7010
  padding: var(--goa-space-2xl);
7003
7011
  `));
7004
- const TableReviewPageTitleRow = styled.div(_t17$1 || (_t17$1 = _$4`
7012
+ const TableReviewPageTitleRow = styled.div(_t17$1 || (_t17$1 = _$5`
7005
7013
  margin-top: var(--goa-space-xl);
7006
7014
  display: flex;
7007
7015
  justify-content: space-between;
7008
7016
  `));
7009
- const TableReviewCategoryLabel = styled.h3(_t18$1 || (_t18$1 = _$4`
7017
+ const TableReviewCategoryLabel = styled.h3(_t18$1 || (_t18$1 = _$5`
7010
7018
  color: var(--goa-color-text-secondary) !important;
7011
7019
  margin-bottom: var(--goa-space-l);
7012
7020
  `));
7013
- const CategoryStatus = styled.td(_t19$1 || (_t19$1 = _$4`
7021
+ const CategoryStatus = styled.td(_t19$1 || (_t19$1 = _$5`
7014
7022
  width: var(--goa-space-xl);
7015
7023
  padding-right: var(--goa-space-xl);
7016
7024
  `));
7017
- const TocPageRef = styled.td(_t20$1 || (_t20$1 = _$4`
7025
+ const TocPageRef = styled.td(_t20$1 || (_t20$1 = _$5`
7018
7026
  padding-left: var(--goa-space-xl);
7019
7027
  `));
7020
- const CompletionStatus = styled.div(_t21 || (_t21 = _$4`
7028
+ const CompletionStatus = styled.div(_t21 || (_t21 = _$5`
7021
7029
  padding: 0;
7022
7030
  margin: 0;
7023
7031
  padding-left: var(--goa-space-xl);
7024
7032
  padding-bottom: var(--goa-space-xl);
7025
7033
  `));
7026
- const PageStepperRow = styled.tr(_t22 || (_t22 = _$4`
7034
+ const PageStepperRow = styled.tr(_t22 || (_t22 = _$5`
7027
7035
  ${0}
7028
7036
  `), ({
7029
7037
  disabled
@@ -7033,6 +7041,17 @@ const PageStepperRow = styled.tr(_t22 || (_t22 = _$4`
7033
7041
  ` : `
7034
7042
  cursor: pointer;
7035
7043
  `);
7044
+ const SectionHeaderRowTr = styled.tr(_t23 || (_t23 = _$5`
7045
+ & > td {
7046
+ border: 0 !important;
7047
+ padding-top: var(--goa-space-l);
7048
+ padding-bottom: var(--goa-space-s);
7049
+ }
7050
+
7051
+ & + tr > td {
7052
+ border-top: none !important;
7053
+ }
7054
+ `));
7036
7055
 
7037
7056
  class ContextProviderClass {
7038
7057
  async addDataByUrl(key, url, processDataFunction, token) {
@@ -7403,7 +7422,7 @@ const pickPropertyValues = (obj, property, endWithType) => {
7403
7422
  Object.entries(obj).forEach(function ([key, value]) {
7404
7423
  if (key === property) {
7405
7424
  values.push(value);
7406
- } else if (_$a.isObject(value)) {
7425
+ } else if (_$b.isObject(value)) {
7407
7426
  // if the object type is equal to end type, we are not going to continue the recursive approach
7408
7427
  if ((value === null || value === void 0 ? void 0 : value.type) === endWithType) {
7409
7428
  if (property in value) {
@@ -7412,7 +7431,7 @@ const pickPropertyValues = (obj, property, endWithType) => {
7412
7431
  } else {
7413
7432
  values = [...values, ...pickPropertyValues(value, property, endWithType)];
7414
7433
  }
7415
- } else if (_$a.isArray(value)) {
7434
+ } else if (_$b.isArray(value)) {
7416
7435
  const nextValues = value.map(function (arrayObj) {
7417
7436
  return pickPropertyValues(arrayObj, property, endWithType);
7418
7437
  });
@@ -8122,7 +8141,7 @@ const SectionHeaderRow = ({
8122
8141
  index
8123
8142
  }) => {
8124
8143
  const section = `${index}. ${title}`;
8125
- return jsx("tr", {
8144
+ return jsx(SectionHeaderRowTr, {
8126
8145
  children: jsx("td", {
8127
8146
  colSpan: 2,
8128
8147
  children: jsx(GoAText, {
@@ -8188,8 +8207,12 @@ const SummaryRow = ({
8188
8207
  isValid,
8189
8208
  onClick
8190
8209
  }) => {
8191
- return jsxs("tr", {
8192
- children: [jsx(TocPageRef, {
8210
+ return jsx("tr", {
8211
+ children: jsx(GoAText, {
8212
+ size: "heading-m",
8213
+ mt: "none",
8214
+ mb: "xl",
8215
+ ml: "xl",
8193
8216
  children: jsx("a", {
8194
8217
  "data-testid": `page-ref-${index}`,
8195
8218
  href: "#",
@@ -8197,11 +8220,9 @@ const SummaryRow = ({
8197
8220
  e.preventDefault();
8198
8221
  onClick(index);
8199
8222
  },
8200
- children: jsx("b", {
8201
- children: "Summary"
8202
- })
8223
+ children: "Summary"
8203
8224
  })
8204
- }), jsx(CategoryStatus, {})]
8225
+ })
8205
8226
  });
8206
8227
  };
8207
8228
 
@@ -8349,6 +8370,56 @@ const FormStepperPageReviewer = props => {
8349
8370
  };
8350
8371
  withAjvProps(withTranslateProps(withJsonFormsLayoutProps(FormStepperPageReviewer)));
8351
8372
 
8373
+ let _$4 = t => t,
8374
+ _t$4;
8375
+ const BackButtonWrapper = styled.span(_t$4 || (_t$4 = _$4`
8376
+ .back-link::before {
8377
+ content: '';
8378
+ display: inline-block;
8379
+ width: 42px;
8380
+ height: 24px;
8381
+ vertical-align: middle;
8382
+ background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 2 22 22" fill="none" stroke="%230070C4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>')
8383
+ center center no-repeat;
8384
+ }
8385
+
8386
+ .back-link:visited::before,
8387
+ .back-link:hover::before {
8388
+ background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 2 22 22" fill="none" stroke="%23004f84" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>')
8389
+ center center no-repeat;
8390
+ }
8391
+
8392
+ .back-link {
8393
+ margin-top: var(--goa-space-m);
8394
+ }
8395
+ display: inline-block;
8396
+ color: #0070c4;
8397
+ cursor: pointer;
8398
+
8399
+ on .goa-icon {
8400
+ display: inline-block !important;
8401
+ position: relative;
8402
+ top: 3px;
8403
+ right: 2px;
8404
+ color: #0070c4;
8405
+ margin-left: 4px;
8406
+ }
8407
+ `));
8408
+ const BackButton = ({
8409
+ text,
8410
+ testId,
8411
+ link
8412
+ }) => {
8413
+ return jsx(BackButtonWrapper, {
8414
+ "data-testid": "back-button-click",
8415
+ onClick: link,
8416
+ children: jsx("div", {
8417
+ className: "back-link",
8418
+ children: text
8419
+ })
8420
+ });
8421
+ };
8422
+
8352
8423
  const RenderPages = props => {
8353
8424
  var _a, _b;
8354
8425
  const {
@@ -8402,7 +8473,14 @@ const RenderPages = props => {
8402
8473
  children: jsx("div", {
8403
8474
  id: `${path || `goa`}-form-pages`,
8404
8475
  children: jsxs(PageBorder, {
8405
- children: [categories === null || categories === void 0 ? void 0 : categories.map((category, index) => {
8476
+ children: [jsx(BackButton, {
8477
+ text: "Back to tasks",
8478
+ link: () => {
8479
+ handleSave();
8480
+ goToTableOfContext();
8481
+ },
8482
+ testId: "back-to-tasks"
8483
+ }), categories === null || categories === void 0 ? void 0 : categories.map((category, index) => {
8406
8484
  const categoryProps = {
8407
8485
  category: category.uischema,
8408
8486
  categoryIndex: category.id,
@@ -8428,17 +8506,23 @@ const RenderPages = props => {
8428
8506
  children: jsxs(GoAGrid, {
8429
8507
  minChildWidth: "100px",
8430
8508
  gap: "2xs",
8431
- children: [jsx(GoAButtonGroup, {
8509
+ children: [jsxs(GoAButtonGroup, {
8432
8510
  alignment: "start",
8433
- children: jsx(GoAButton, {
8511
+ children: [activeId > 0 && jsx(GoAButton, {
8434
8512
  type: "secondary",
8435
8513
  onClick: () => {
8436
- validatePage(index);
8437
- goToTableOfContext();
8514
+ handleSave();
8515
+ let prevId = activeId - 1;
8516
+ while (prevId >= 0 && categories[prevId].visible === false) {
8517
+ prevId = prevId - 1;
8518
+ }
8519
+ if (prevId >= 0) {
8520
+ goToPage(prevId);
8521
+ }
8438
8522
  },
8439
- testId: "back-button",
8523
+ testId: "pages-prev-btn",
8440
8524
  children: "Previous"
8441
- })
8525
+ }), ' ']
8442
8526
  }), jsx(GoAButtonGroup, {
8443
8527
  alignment: "end",
8444
8528
  children: jsx(GoAButton, {
@@ -8451,7 +8535,7 @@ const RenderPages = props => {
8451
8535
  }
8452
8536
  goToPage(nextId);
8453
8537
  },
8454
- disabled: !(category.isValid && category.isCompleted) || !enabled,
8538
+ disabled: !enabled,
8455
8539
  testId: "pages-save-continue-btn",
8456
8540
  children: "Next"
8457
8541
  })
@@ -8465,20 +8549,10 @@ const RenderPages = props => {
8465
8549
  children: [jsx(FormStepperPageReviewer, Object.assign({}, props.categoryProps, {
8466
8550
  navigationFunc: goToPage
8467
8551
  })), jsx(PageRenderPadding, {
8468
- children: jsxs(GoAGrid, {
8552
+ children: jsx(GoAGrid, {
8469
8553
  minChildWidth: "100px",
8470
8554
  gap: "2xs",
8471
- children: [jsx(GoAButtonGroup, {
8472
- alignment: "start",
8473
- children: jsx(GoAButton, {
8474
- type: "secondary",
8475
- onClick: () => {
8476
- goToTableOfContext();
8477
- },
8478
- testId: "back-button",
8479
- children: "Previous"
8480
- })
8481
- }), jsx(GoAButtonGroup, {
8555
+ children: jsx(GoAButtonGroup, {
8482
8556
  alignment: "end",
8483
8557
  children: !hideSubmit ? jsx(GoAButton, {
8484
8558
  type: 'primary',
@@ -8487,7 +8561,7 @@ const RenderPages = props => {
8487
8561
  testId: "pages-submit-btn",
8488
8562
  children: "Submit"
8489
8563
  }) : null
8490
- })]
8564
+ })
8491
8565
  })
8492
8566
  })]
8493
8567
  })]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.21.2",
3
+ "version": "2.21.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",
@@ -11,6 +11,7 @@ export interface DropdownProps {
11
11
  onChange: (value: string) => void;
12
12
  isAutoCompletion?: boolean;
13
13
  id?: string;
14
+ width: string;
14
15
  }
15
16
  export interface GoADropdownTextboxProps {
16
17
  isOpen: boolean;
@@ -23,4 +23,5 @@ interface PageStepperRowProps {
23
23
  disabled: boolean;
24
24
  }
25
25
  export declare const PageStepperRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, PageStepperRowProps>> & string;
26
+ export declare const SectionHeaderRowTr: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, never>> & string;
26
27
  export {};