@abgov/jsonforms-components 1.56.1 → 1.56.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 -17
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -6195,7 +6195,6 @@ const FormStepperView = props => {
6195
6195
  const submitForm = submitFormFunction && submitFormFunction();
6196
6196
  const optionProps = uischema.options || {};
6197
6197
  const [isOpen, setIsOpen] = useState(false);
6198
- const [isSelected, setIsSelected] = useState(false);
6199
6198
  const handleSubmit = () => {
6200
6199
  if (submitForm) {
6201
6200
  submitForm(data);
@@ -6217,9 +6216,7 @@ const FormStepperView = props => {
6217
6216
  className: "formStepper",
6218
6217
  children: [jsxs(GoAFormStepper, {
6219
6218
  testId: `form-stepper-headers-${(_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.testId}` || 'form-stepper-test',
6220
- step: isSelected === false ? -1 : activeId + 1,
6221
6219
  onChange: step => {
6222
- setIsSelected(true);
6223
6220
  goToPage(step - 1);
6224
6221
  },
6225
6222
  children: [categories === null || categories === void 0 ? void 0 : categories.map((c, index) => {
@@ -7427,6 +7424,7 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
7427
7424
  },
7428
7425
  children: !isInReview && jsx(GoAIconButton, {
7429
7426
  icon: "trash",
7427
+ testId: "trash-icon-button",
7430
7428
  "aria-label": `remove-element-${num}`,
7431
7429
  onClick: () => openDeleteDialog(num)
7432
7430
  })
@@ -9034,6 +9032,7 @@ const AddressViews = ({
9034
9032
  gap: "s",
9035
9033
  children: [jsxs(GoAFormItem, {
9036
9034
  label: "Province",
9035
+ error: !isAlbertaAddress && (data === null || data === void 0 ? void 0 : data.subdivisionCode) === undefined ? 'Province is required' : '',
9037
9036
  children: [isAlbertaAddress && jsx("div", {
9038
9037
  "data-testid": "address-form-province-view",
9039
9038
  children: "Alberta"
@@ -9114,7 +9113,7 @@ const NameInputs = ({
9114
9113
  mb: "m",
9115
9114
  testId: "wrapper",
9116
9115
  children: [jsx(GoAFormItem, {
9117
- testId: "formitem-first-name",
9116
+ testId: "form-item-first-name",
9118
9117
  label: "First name",
9119
9118
  requirement: (requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.includes('firstName')) ? 'required' : undefined,
9120
9119
  error: (_a = errors === null || errors === void 0 ? void 0 : errors['firstName']) !== null && _a !== void 0 ? _a : '',
@@ -9132,7 +9131,7 @@ const NameInputs = ({
9132
9131
  width: "100%"
9133
9132
  })
9134
9133
  }), jsx(GoAFormItem, {
9135
- testId: "formitem-middle-name",
9134
+ testId: "form-item-middle-name",
9136
9135
  label: "Middle name",
9137
9136
  requirement: (requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.includes('middleName')) ? 'required' : undefined,
9138
9137
  children: jsx(GoAInput, {
@@ -9146,7 +9145,7 @@ const NameInputs = ({
9146
9145
  width: "100%"
9147
9146
  })
9148
9147
  }), jsx(GoAFormItem, {
9149
- testId: "formitem-last-name",
9148
+ testId: "form-item-last-name",
9150
9149
  label: "Last name",
9151
9150
  requirement: (requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.includes('lastName')) ? 'required' : undefined,
9152
9151
  error: (_b = errors === null || errors === void 0 ? void 0 : errors['lastName']) !== null && _b !== void 0 ? _b : '',
@@ -9225,11 +9224,7 @@ const FullNameControl = props => {
9225
9224
  enabled
9226
9225
  } = props;
9227
9226
  const requiredFields = schema.required;
9228
- const defaultName = {
9229
- firstName: '',
9230
- middleName: '',
9231
- lastName: ''
9232
- };
9227
+ const defaultName = {};
9233
9228
  const [nameData, setNameData] = useState(data || defaultName);
9234
9229
  const updateFormData = updatedData => {
9235
9230
  updatedData = Object.fromEntries(Object.entries(updatedData).filter(([_, value]) => value !== ''));
@@ -9267,12 +9262,7 @@ const FullNameDobControl = props => {
9267
9262
  } = props;
9268
9263
  const requiredFields = schema.required;
9269
9264
  const [errors, setErrors] = useState({});
9270
- const defaultNameAndDob = {
9271
- firstName: '',
9272
- middleName: '',
9273
- lastName: '',
9274
- dateOfBirth: undefined
9275
- };
9265
+ const defaultNameAndDob = {};
9276
9266
  const validDates = () => {
9277
9267
  const currentDate = new Date();
9278
9268
  const minDate = new Date(currentDate.getFullYear() - 150, currentDate.getMonth(), currentDate.getDate()).toISOString().substring(0, 10);
@@ -9352,6 +9342,7 @@ const FullNameDobControl = props => {
9352
9342
  label: "Last name",
9353
9343
  requirement: ((_d = schema === null || schema === void 0 ? void 0 : schema.required) === null || _d === void 0 ? void 0 : _d.includes('lastName')) ? 'required' : undefined,
9354
9344
  error: (_e = errors === null || errors === void 0 ? void 0 : errors['lastName']) !== null && _e !== void 0 ? _e : '',
9345
+ testId: "form-item-last-name",
9355
9346
  children: jsx(GoAInput, {
9356
9347
  type: "text",
9357
9348
  name: "lastName",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.56.1",
3
+ "version": "1.56.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",