@abgov/jsonforms-components 2.20.1 → 2.21.1

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 +130 -156
  2. package/package.json +1 -1
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, getControlPath, 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 _$b from 'lodash';
10
+ import * as _$a 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 _$a = t => t,
3551
- _t$a,
3550
+ let _$9 = t => t,
3551
+ _t$9,
3552
3552
  _t2$7;
3553
- styled.div(_t$a || (_t$a = _$a`
3553
+ styled.div(_t$9 || (_t$9 = _$9`
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 = _$a`
3559
+ const Visible = styled.div(_t2$7 || (_t2$7 = _$9`
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 _$9 = t => t,
5192
- _t$9,
5191
+ let _$8 = t => t,
5192
+ _t$8,
5193
5193
  _t2$6,
5194
5194
  _t3$5,
5195
5195
  _t4$5,
@@ -5197,42 +5197,42 @@ let _$9 = t => t,
5197
5197
  _t6$3,
5198
5198
  _t7$2,
5199
5199
  _t8$2;
5200
- const FormFieldWrapper = styled.div(_t$9 || (_t$9 = _$9`
5200
+ const FormFieldWrapper = styled.div(_t$8 || (_t$8 = _$8`
5201
5201
  margin-bottom: var(--goa-space-l);
5202
5202
  `));
5203
- const WarningIconDiv = styled.div(_t2$6 || (_t2$6 = _$9`
5203
+ const WarningIconDiv = styled.div(_t2$6 || (_t2$6 = _$8`
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 = _$9`
5210
+ const RequiredTextLabel = styled.label(_t3$5 || (_t3$5 = _$8`
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 = _$9`
5217
+ const PageReviewNameCol = styled.td(_t4$5 || (_t4$5 = _$8`
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 = _$9`
5223
+ const PageReviewValueCol = styled.td(_t5$4 || (_t5$4 = _$8`
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 = _$9`
5228
+ const CheckboxWrapper = styled.div(_t6$3 || (_t6$3 = _$8`
5229
5229
  height: 28px;
5230
5230
  `));
5231
- styled.h4(_t7$2 || (_t7$2 = _$9`
5231
+ styled.h4(_t7$2 || (_t7$2 = _$8`
5232
5232
  margin: 0 0 0.25rem 0;
5233
5233
  fontsize: larger;
5234
5234
  `));
5235
- styled.h4(_t8$2 || (_t8$2 = _$9`
5235
+ styled.h4(_t8$2 || (_t8$2 = _$8`
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 _$8 = t => t,
5461
- _t$8,
5460
+ let _$7 = t => t,
5461
+ _t$7,
5462
5462
  _t2$5,
5463
5463
  _t3$4,
5464
5464
  _t4$4;
5465
- const GoADropdownTextbox = styled.div(_t$8 || (_t$8 = _$8`
5465
+ const GoADropdownTextbox = styled.div(_t$7 || (_t$7 = _$7`
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$8 || (_t$8 = _$8`
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 = _$8`
5476
+ const GoADropdownListContainerWrapper = styled.div(_t2$5 || (_t2$5 = _$7`
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 = _$8`
5480
+ const GoADropdownListContainer = styled.div(_t3$4 || (_t3$4 = _$7`
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 = _$8`
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 = _$8`
5504
+ const GoADropdownListOption = styled.div(_t4$4 || (_t4$4 = _$7`
5505
5505
  padding: var(--goa-space-2xs) var(--goa-space-s);
5506
5506
  text-overflow: ellipsis;
5507
5507
  color: ${0} !important;
@@ -6031,7 +6031,7 @@ const reformatDateProps = props => {
6031
6031
  return newProps;
6032
6032
  };
6033
6033
  const GoADateInput = props => {
6034
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
6034
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
6035
6035
  const {
6036
6036
  data,
6037
6037
  config,
@@ -6046,8 +6046,20 @@ const GoADateInput = props => {
6046
6046
  const appliedUiSchemaOptions = Object.assign({}, config, uischema === null || uischema === void 0 ? void 0 : uischema.options);
6047
6047
  const readOnly = (_c = (_b = (_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.componentProps) === null || _b === void 0 ? void 0 : _b.readOnly) !== null && _c !== void 0 ? _c : false;
6048
6048
  const width = (_f = (_e = (_d = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _d === void 0 ? void 0 : _d.componentProps) === null || _e === void 0 ? void 0 : _e.width) !== null && _f !== void 0 ? _f : '100%';
6049
- const minDate = (_h = (_g = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _g === void 0 ? void 0 : _g.componentProps) === null || _h === void 0 ? void 0 : _h.min;
6050
- const maxDate = (_k = (_j = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _j === void 0 ? void 0 : _j.componentProps) === null || _k === void 0 ? void 0 : _k.max;
6049
+ const allowPastDate = (_g = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _g === void 0 ? void 0 : _g.allowPastDate;
6050
+ const allowFutureDate = (_h = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _h === void 0 ? void 0 : _h.allowFutureDate;
6051
+ let minDate = (_k = (_j = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _j === void 0 ? void 0 : _j.componentProps) === null || _k === void 0 ? void 0 : _k.min;
6052
+ let maxDate = (_m = (_l = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _l === void 0 ? void 0 : _l.componentProps) === null || _m === void 0 ? void 0 : _m.max;
6053
+ // Only apply if not both are true
6054
+ if (allowPastDate && !allowFutureDate) {
6055
+ // Only allow today and past dates
6056
+ const today = new Date();
6057
+ maxDate = today.toISOString().split('T')[0];
6058
+ } else if (!allowPastDate && allowFutureDate) {
6059
+ // Only allow today and future dates
6060
+ const today = new Date();
6061
+ minDate = today.toISOString().split('T')[0];
6062
+ }
6051
6063
  return jsx(GoAInputDate, Object.assign({
6052
6064
  error: isVisited && errors.length > 0,
6053
6065
  width: width,
@@ -6086,7 +6098,7 @@ const GoADateInput = props => {
6086
6098
  controlProps: props
6087
6099
  });
6088
6100
  }
6089
- }, reformatDateProps((_l = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _l === void 0 ? void 0 : _l.componentProps)));
6101
+ }, reformatDateProps((_o = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _o === void 0 ? void 0 : _o.componentProps)));
6090
6102
  };
6091
6103
  const GoADateControl = props => jsx(GoAInputBaseControl, Object.assign({}, props, {
6092
6104
  input: GoADateInput
@@ -6566,8 +6578,8 @@ const BooleanRadioControl = props => jsx(GoAInputBaseControl, Object.assign({},
6566
6578
  const GoABooleanRadioControlTester = rankWith(3, and(isBooleanControl, optionIs('radio', true)));
6567
6579
  const GoABooleanRadioControl = withJsonFormsControlProps(BooleanRadioControl);
6568
6580
 
6569
- let _$7 = t => t,
6570
- _t$7;
6581
+ let _$6 = t => t,
6582
+ _t$6;
6571
6583
  const Checkboxes = ({
6572
6584
  children,
6573
6585
  orientation,
@@ -6579,7 +6591,7 @@ const Checkboxes = ({
6579
6591
  children: children
6580
6592
  });
6581
6593
  };
6582
- const CheckBoxGroupDiv = styled.div(_t$7 || (_t$7 = _$7`
6594
+ const CheckBoxGroupDiv = styled.div(_t$6 || (_t$6 = _$6`
6583
6595
  .horizontal {
6584
6596
  display: flex;
6585
6597
  flex-direction: row;
@@ -6787,8 +6799,8 @@ const GoAInputBaseTableReview = props => {
6787
6799
  };
6788
6800
  const GoAInputBaseTableReviewControl = withJsonFormsControlProps(GoAInputBaseTableReview);
6789
6801
 
6790
- let _$6 = t => t,
6791
- _t$6;
6802
+ let _$5 = t => t,
6803
+ _t$5;
6792
6804
  const renderLayoutElements = (elements, schema, path, enabled, renderers, cells) => {
6793
6805
  return elements.map((child, index) => jsx(JsonFormsDispatch, {
6794
6806
  uischema: child,
@@ -6867,14 +6879,14 @@ const ReviewLayoutRenderer = ({
6867
6879
  }
6868
6880
  }
6869
6881
  };
6870
- const ReviewGrid = styled.div(_t$6 || (_t$6 = _$6`
6882
+ const ReviewGrid = styled.div(_t$5 || (_t$5 = _$5`
6871
6883
  display: grid;
6872
6884
  grid-template-columns: repeat(auto-fit, minmax(250px, calc(50% - 8px)));
6873
6885
  gap: 16px;
6874
6886
  `));
6875
6887
 
6876
- let _$5 = t => t,
6877
- _t$5,
6888
+ let _$4 = t => t,
6889
+ _t$4,
6878
6890
  _t2$4,
6879
6891
  _t3$3,
6880
6892
  _t4$3,
@@ -6896,7 +6908,7 @@ let _$5 = t => t,
6896
6908
  _t20$1,
6897
6909
  _t21,
6898
6910
  _t22;
6899
- const ReviewItem = styled.div(_t$5 || (_t$5 = _$5`
6911
+ const ReviewItem = styled.div(_t$4 || (_t$4 = _$4`
6900
6912
  display: flex;
6901
6913
  flex-direction: column;
6902
6914
  border: var(--goa-border-width-s) solid grey;
@@ -6907,7 +6919,7 @@ const ReviewItem = styled.div(_t$5 || (_t$5 = _$5`
6907
6919
  display: none;
6908
6920
  }
6909
6921
  `));
6910
- const ReviewItemSection = styled.div(_t2$4 || (_t2$4 = _$5`
6922
+ const ReviewItemSection = styled.div(_t2$4 || (_t2$4 = _$4`
6911
6923
  background-color: #f1f1f1;
6912
6924
  margin-bottom: var(--goa-space-m);
6913
6925
  padding: var(--goa-space-m);
@@ -6918,18 +6930,18 @@ const ReviewItemSection = styled.div(_t2$4 || (_t2$4 = _$5`
6918
6930
  max-width: 1600px;
6919
6931
  }
6920
6932
  `));
6921
- const ReviewItemHeader = styled.div(_t3$3 || (_t3$3 = _$5`
6933
+ const ReviewItemHeader = styled.div(_t3$3 || (_t3$3 = _$4`
6922
6934
  display: flex;
6923
6935
  align-items: center;
6924
6936
  justify-content: space-between;
6925
6937
  margin-bottom: var(--goa-space-xl);
6926
6938
  `));
6927
- const ReviewItemTitle = styled.div(_t4$3 || (_t4$3 = _$5`
6939
+ const ReviewItemTitle = styled.div(_t4$3 || (_t4$3 = _$4`
6928
6940
  font-size: var(--goa-space-l);
6929
6941
  line-height: var(--goa-space-xl);
6930
6942
  font-weight: 300;
6931
6943
  `));
6932
- const Anchor = styled.div(_t5$3 || (_t5$3 = _$5`
6944
+ const Anchor = styled.div(_t5$3 || (_t5$3 = _$4`
6933
6945
  color: #0070c4;
6934
6946
  text-decoration: underline;
6935
6947
  outline: none;
@@ -6940,20 +6952,20 @@ const Anchor = styled.div(_t5$3 || (_t5$3 = _$5`
6940
6952
  background-color: #e6f7ff;
6941
6953
  }
6942
6954
  `));
6943
- styled.div(_t6$2 || (_t6$2 = _$5`
6955
+ styled.div(_t6$2 || (_t6$2 = _$4`
6944
6956
  margin-left: var(--goa-space-m);
6945
6957
  `));
6946
- styled.div(_t7$1 || (_t7$1 = _$5`
6958
+ styled.div(_t7$1 || (_t7$1 = _$4`
6947
6959
  margin-bottom: var(--goa-space-m);
6948
6960
  `));
6949
- styled.div(_t8$1 || (_t8$1 = _$5`
6961
+ styled.div(_t8$1 || (_t8$1 = _$4`
6950
6962
  margin: var(--goa-space-s);
6951
6963
  width: 100%;
6952
6964
  `));
6953
- styled.h3(_t9$1 || (_t9$1 = _$5`
6965
+ styled.h3(_t9$1 || (_t9$1 = _$4`
6954
6966
  text-transform: capitalize;
6955
6967
  `));
6956
- const RightAlignmentDiv = styled.div(_t10$1 || (_t10$1 = _$5`
6968
+ const RightAlignmentDiv = styled.div(_t10$1 || (_t10$1 = _$4`
6957
6969
  @media screen and (max-width: 767px) {
6958
6970
  margin-bottom: var(--goa-space-l);
6959
6971
  }
@@ -6963,55 +6975,55 @@ const RightAlignmentDiv = styled.div(_t10$1 || (_t10$1 = _$5`
6963
6975
  margin-bottom: var(--goa-space-l);
6964
6976
  }
6965
6977
  `));
6966
- const FormStepperSummaryH3 = styled.h3(_t11$1 || (_t11$1 = _$5`
6978
+ const FormStepperSummaryH3 = styled.h3(_t11$1 || (_t11$1 = _$4`
6967
6979
  flex: 1;
6968
6980
  margin-bottom: var(--goa-space-m);
6969
6981
  font-size: var(--goa-font-size-7);
6970
6982
  line-height: var(--goa-line-height-4);
6971
6983
  font-weight: var(--goa-font-weight-regular);
6972
6984
  `));
6973
- const PageRenderPadding = styled.div(_t12$1 || (_t12$1 = _$5`
6985
+ const PageRenderPadding = styled.div(_t12$1 || (_t12$1 = _$4`
6974
6986
  margin-top: var(--goa-space-2xl);
6975
6987
  `));
6976
- const PageRenderPaddingBottom = styled.div(_t13$1 || (_t13$1 = _$5`
6988
+ styled.div(_t13$1 || (_t13$1 = _$4`
6977
6989
  margin-bottom: var(--goa-space-2xl);
6978
6990
  `));
6979
- const PageBorder = styled.h3(_t14$1 || (_t14$1 = _$5`
6991
+ const PageBorder = styled.h3(_t14$1 || (_t14$1 = _$4`
6980
6992
  padding: var(--goa-space-3xl);
6981
6993
  `));
6982
- const TableReviewItemSection = styled.div(_t15$1 || (_t15$1 = _$5`
6994
+ const TableReviewItemSection = styled.div(_t15$1 || (_t15$1 = _$4`
6983
6995
  .element-style {
6984
6996
  max-width: 1600px;
6985
6997
  }
6986
6998
  `));
6987
- const TableReviewItem = styled.div(_t16$1 || (_t16$1 = _$5`
6999
+ const TableReviewItem = styled.div(_t16$1 || (_t16$1 = _$4`
6988
7000
  border: 1px solid #dcdcdc;
6989
7001
  border-radius: 5px;
6990
7002
  padding: var(--goa-space-2xl);
6991
7003
  `));
6992
- const TableReviewPageTitleRow = styled.div(_t17$1 || (_t17$1 = _$5`
7004
+ const TableReviewPageTitleRow = styled.div(_t17$1 || (_t17$1 = _$4`
6993
7005
  margin-top: var(--goa-space-xl);
6994
7006
  display: flex;
6995
7007
  justify-content: space-between;
6996
7008
  `));
6997
- const TableReviewCategoryLabel = styled.h3(_t18$1 || (_t18$1 = _$5`
7009
+ const TableReviewCategoryLabel = styled.h3(_t18$1 || (_t18$1 = _$4`
6998
7010
  color: var(--goa-color-text-secondary) !important;
6999
7011
  margin-bottom: var(--goa-space-l);
7000
7012
  `));
7001
- const CategoryStatus = styled.td(_t19$1 || (_t19$1 = _$5`
7013
+ const CategoryStatus = styled.td(_t19$1 || (_t19$1 = _$4`
7002
7014
  width: var(--goa-space-xl);
7003
7015
  padding-right: var(--goa-space-xl);
7004
7016
  `));
7005
- const TocPageRef = styled.td(_t20$1 || (_t20$1 = _$5`
7017
+ const TocPageRef = styled.td(_t20$1 || (_t20$1 = _$4`
7006
7018
  padding-left: var(--goa-space-xl);
7007
7019
  `));
7008
- const CompletionStatus = styled.div(_t21 || (_t21 = _$5`
7020
+ const CompletionStatus = styled.div(_t21 || (_t21 = _$4`
7009
7021
  padding: 0;
7010
7022
  margin: 0;
7011
7023
  padding-left: var(--goa-space-xl);
7012
7024
  padding-bottom: var(--goa-space-xl);
7013
7025
  `));
7014
- const PageStepperRow = styled.tr(_t22 || (_t22 = _$5`
7026
+ const PageStepperRow = styled.tr(_t22 || (_t22 = _$4`
7015
7027
  ${0}
7016
7028
  `), ({
7017
7029
  disabled
@@ -7391,7 +7403,7 @@ const pickPropertyValues = (obj, property, endWithType) => {
7391
7403
  Object.entries(obj).forEach(function ([key, value]) {
7392
7404
  if (key === property) {
7393
7405
  values.push(value);
7394
- } else if (_$b.isObject(value)) {
7406
+ } else if (_$a.isObject(value)) {
7395
7407
  // if the object type is equal to end type, we are not going to continue the recursive approach
7396
7408
  if ((value === null || value === void 0 ? void 0 : value.type) === endWithType) {
7397
7409
  if (property in value) {
@@ -7400,7 +7412,7 @@ const pickPropertyValues = (obj, property, endWithType) => {
7400
7412
  } else {
7401
7413
  values = [...values, ...pickPropertyValues(value, property, endWithType)];
7402
7414
  }
7403
- } else if (_$b.isArray(value)) {
7415
+ } else if (_$a.isArray(value)) {
7404
7416
  const nextValues = value.map(function (arrayObj) {
7405
7417
  return pickPropertyValues(arrayObj, property, endWithType);
7406
7418
  });
@@ -8314,56 +8326,6 @@ const FormStepperPageReviewer = props => {
8314
8326
  };
8315
8327
  withAjvProps(withTranslateProps(withJsonFormsLayoutProps(FormStepperPageReviewer)));
8316
8328
 
8317
- let _$4 = t => t,
8318
- _t$4;
8319
- const BackButtonWrapper = styled.span(_t$4 || (_t$4 = _$4`
8320
- .back-link::before {
8321
- content: '';
8322
- display: inline-block;
8323
- width: 42px;
8324
- height: 24px;
8325
- vertical-align: middle;
8326
- 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>')
8327
- center center no-repeat;
8328
- }
8329
-
8330
- .back-link:visited::before,
8331
- .back-link:hover::before {
8332
- 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>')
8333
- center center no-repeat;
8334
- }
8335
-
8336
- .back-link {
8337
- margin-top: var(--goa-space-m);
8338
- }
8339
- display: inline-block;
8340
- color: #0070c4;
8341
- cursor: pointer;
8342
-
8343
- on .goa-icon {
8344
- display: inline-block !important;
8345
- position: relative;
8346
- top: 3px;
8347
- right: 2px;
8348
- color: #0070c4;
8349
- margin-left: 4px;
8350
- }
8351
- `));
8352
- const BackButton = ({
8353
- text,
8354
- testId,
8355
- link
8356
- }) => {
8357
- return jsx(BackButtonWrapper, {
8358
- "data-testid": "back-button-click",
8359
- onClick: link,
8360
- children: jsx("div", {
8361
- className: "back-link",
8362
- children: text
8363
- })
8364
- });
8365
- };
8366
-
8367
8329
  const RenderPages = props => {
8368
8330
  var _a, _b;
8369
8331
  const {
@@ -8435,41 +8397,41 @@ const RenderPages = props => {
8435
8397
  style: {
8436
8398
  marginTop: '1.5rem'
8437
8399
  },
8438
- children: [jsx(BackButton, {
8439
- testId: "back-button",
8440
- link: () => {
8441
- validatePage(index);
8442
- goToTableOfContext();
8443
- },
8444
- text: "Back"
8445
- }), jsxs(PageRenderPadding, {
8400
+ children: [jsxs(PageRenderPadding, {
8446
8401
  children: [jsxs("h3", {
8447
8402
  children: ["Step ", index + 1 - categories.filter(c => !c.visible && c.id < index).length, " of", ' ', categories.filter(c => c.visible).length]
8448
8403
  }), jsx(RenderStepElements, Object.assign({}, categoryProps))]
8449
8404
  }), jsx(PageRenderPadding, {
8450
- children: jsxs(GoAButtonGroup, {
8451
- alignment: "start",
8452
- children: [jsx(GoAButton, {
8453
- type: "submit",
8454
- onClick: () => {
8455
- handleSave();
8456
- let nextId = activeId + 1;
8457
- while (nextId < categories.length && categories[nextId].visible === false) {
8458
- nextId = nextId + 1;
8459
- }
8460
- goToPage(nextId);
8461
- },
8462
- disabled: !(category.isValid && category.isCompleted) || !enabled,
8463
- testId: "pages-save-continue-btn",
8464
- children: "Save and continue"
8465
- }), category.showReviewPageLink && jsx(GoAButton, {
8466
- type: "tertiary",
8467
- onClick: () => {
8468
- toggleShowReviewLink(activeId);
8469
- goToPage(categories.length);
8470
- },
8471
- testId: "pages-to-review-page-btn",
8472
- children: "Back to application overview"
8405
+ children: jsxs(GoAGrid, {
8406
+ minChildWidth: "100px",
8407
+ gap: "2xs",
8408
+ children: [jsx(GoAButtonGroup, {
8409
+ alignment: "start",
8410
+ children: jsx(GoAButton, {
8411
+ type: "secondary",
8412
+ onClick: () => {
8413
+ validatePage(index);
8414
+ goToTableOfContext();
8415
+ },
8416
+ testId: "back-button",
8417
+ children: "Previous"
8418
+ })
8419
+ }), jsx(GoAButtonGroup, {
8420
+ alignment: "end",
8421
+ children: jsx(GoAButton, {
8422
+ type: "submit",
8423
+ onClick: () => {
8424
+ handleSave();
8425
+ let nextId = activeId + 1;
8426
+ while (nextId < categories.length && categories[nextId].visible === false) {
8427
+ nextId = nextId + 1;
8428
+ }
8429
+ goToPage(nextId);
8430
+ },
8431
+ disabled: !(category.isValid && category.isCompleted) || !enabled,
8432
+ testId: "pages-save-continue-btn",
8433
+ children: "Next"
8434
+ })
8473
8435
  })]
8474
8436
  })
8475
8437
  })]
@@ -8477,26 +8439,32 @@ const RenderPages = props => {
8477
8439
  }
8478
8440
  }), isOnReview && jsxs("div", {
8479
8441
  "data-testid": "stepper-pages-review-page",
8480
- children: [jsx(PageRenderPaddingBottom, {
8481
- children: jsx(BackButton, {
8482
- testId: "review-back-button",
8483
- link: () => {
8484
- goToTableOfContext();
8485
- },
8486
- text: "Back"
8487
- })
8488
- }), jsx(FormStepperPageReviewer, Object.assign({}, props.categoryProps, {
8442
+ children: [jsx(FormStepperPageReviewer, Object.assign({}, props.categoryProps, {
8489
8443
  navigationFunc: goToPage
8490
8444
  })), jsx(PageRenderPadding, {
8491
- children: jsx(GoAButtonGroup, {
8492
- alignment: "end",
8493
- children: !hideSubmit ? jsx(GoAButton, {
8494
- type: 'primary',
8495
- onClick: handleSubmit,
8496
- disabled: !isValid,
8497
- testId: "pages-submit-btn",
8498
- children: "Submit"
8499
- }) : null
8445
+ children: jsxs(GoAGrid, {
8446
+ minChildWidth: "100px",
8447
+ gap: "2xs",
8448
+ children: [jsx(GoAButtonGroup, {
8449
+ alignment: "start",
8450
+ children: jsx(GoAButton, {
8451
+ type: "secondary",
8452
+ onClick: () => {
8453
+ goToTableOfContext();
8454
+ },
8455
+ testId: "back-button",
8456
+ children: "Previous"
8457
+ })
8458
+ }), jsx(GoAButtonGroup, {
8459
+ alignment: "end",
8460
+ children: !hideSubmit ? jsx(GoAButton, {
8461
+ type: 'primary',
8462
+ onClick: handleSubmit,
8463
+ disabled: !isValid,
8464
+ testId: "pages-submit-btn",
8465
+ children: "Submit"
8466
+ }) : null
8467
+ })]
8500
8468
  })
8501
8469
  })]
8502
8470
  })]
@@ -11844,6 +11812,9 @@ const FullNameDobControl = props => {
11844
11812
 
11845
11813
  const FullNameDobReviewControl = props => {
11846
11814
  var _a, _b, _c, _d;
11815
+ const {
11816
+ data
11817
+ } = props;
11847
11818
  return jsxs(Fragment, {
11848
11819
  children: [jsxs(GoAGrid, {
11849
11820
  minChildWidth: "0ch",
@@ -11851,6 +11822,7 @@ const FullNameDobReviewControl = props => {
11851
11822
  mb: "m",
11852
11823
  children: [jsx(GoAFormItem, {
11853
11824
  label: "First name",
11825
+ error: (data === null || data === void 0 ? void 0 : data.firstName) === undefined ? 'First name is required' : '',
11854
11826
  requirement: "required",
11855
11827
  children: jsx(TextWrapDiv, {
11856
11828
  children: jsx("div", {
@@ -11868,6 +11840,7 @@ const FullNameDobReviewControl = props => {
11868
11840
  })
11869
11841
  }), jsx(GoAFormItem, {
11870
11842
  label: "Last name",
11843
+ error: (data === null || data === void 0 ? void 0 : data.lastName) === undefined ? 'Last name is required' : '',
11871
11844
  requirement: "required",
11872
11845
  children: jsx(TextWrapDiv, {
11873
11846
  children: jsx("div", {
@@ -11881,6 +11854,7 @@ const FullNameDobReviewControl = props => {
11881
11854
  gap: "s",
11882
11855
  children: jsx(GoAFormItem, {
11883
11856
  label: "Date of birth",
11857
+ error: (data === null || data === void 0 ? void 0 : data.dateOfBirth) === undefined ? 'Date of birth is required' : '',
11884
11858
  requirement: "required",
11885
11859
  children: jsx(TextWrapDiv, {
11886
11860
  children: jsx("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.20.1",
3
+ "version": "2.21.1",
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",