@abgov/jsonforms-components 1.40.0 → 1.40.2
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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import React, { createContext, useContext, useReducer, useMemo, useEffect, useState, useRef, useCallback } from 'react';
|
|
3
|
-
import { GoAFormItem, GoAInput, GoATextArea, GoACallout, GoAInputDate, GoAInputDateTime, GoAInputTime, GoARadioGroup, GoARadioItem, GoACheckbox, GoAGrid, GoAFormStepper, GoAFormStep, GoAPages, GoAButton, GoAModal, GoAButtonGroup, GoAIconButton, GoAFileUploadInput, GoACircularProgress, GoAContainer, GoATable, GoADropdown, GoADropdownItem, GoADetails
|
|
3
|
+
import { GoAFormItem, GoAInput, GoATextArea, GoACallout, GoAInputDate, GoAInputDateTime, GoAInputTime, GoARadioGroup, GoARadioItem, GoACheckbox, GoAGrid, GoAFormStepper, GoAFormStep, GoAPages, GoAButton, GoAModal, GoAButtonGroup, GoAIconButton, GoAFileUploadInput, GoACircularProgress, GoAContainer, GoATable, GoADropdown, GoADropdownItem, GoADetails } from '@abgov/react-components';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import axios from 'axios';
|
|
6
6
|
import get$1 from 'lodash/get';
|
|
7
7
|
import { rankWith, isStringControl, and, optionIs, uiTypeIs, isDateControl, isNumberControl, isIntegerControl, isDateTimeControl, isTimeControl, isEnumControl, isBooleanControl, getAjv, isVisible, isEnabled, deriveLabelForUISchemaElement, schemaTypeIs, formatIs, createDefaultValue, Paths, or, isObjectArrayControl, isPrimitiveArrayControl, isControl, isScoped, hasType, isCategorization, isLayout } from '@jsonforms/core';
|
|
8
8
|
import { withJsonFormsControlProps, withJsonFormsRendererProps, withJsonFormsEnumProps, withTranslateProps, useJsonForms, JsonFormsDispatch, withJsonFormsLayoutProps, withJsonFormsArrayLayoutProps, withJsonFormsCellProps } from '@jsonforms/react';
|
|
9
|
-
import { isEqual, isObject as isObject$e } from 'lodash';
|
|
9
|
+
import { isEqual, isEmpty as isEmpty$2, isObject as isObject$e } from 'lodash';
|
|
10
10
|
import merge from 'lodash/merge';
|
|
11
11
|
import isEmpty$1 from 'lodash/isEmpty';
|
|
12
12
|
import range from 'lodash/range';
|
|
@@ -2465,12 +2465,19 @@ const StepperContext = /*#__PURE__*/createContext({
|
|
|
2465
2465
|
const isEmpty = value => {
|
|
2466
2466
|
return value === undefined || value === null || typeof value === 'string' && value.length < 1;
|
|
2467
2467
|
};
|
|
2468
|
-
const getCompletionStatus = (table, step) => {
|
|
2468
|
+
const getCompletionStatus = (table, step, isFormChanged = false) => {
|
|
2469
2469
|
const nonEmptyCount = getNonEmptyCount(table, step);
|
|
2470
|
+
const requiredCount = getRequiredCount(table, step);
|
|
2470
2471
|
if (nonEmptyCount === 0) {
|
|
2471
|
-
|
|
2472
|
+
if (!isFormChanged) {
|
|
2473
|
+
return undefined;
|
|
2474
|
+
}
|
|
2475
|
+
if (requiredCount === 0) {
|
|
2476
|
+
return 'complete';
|
|
2477
|
+
} else {
|
|
2478
|
+
return 'incomplete';
|
|
2479
|
+
}
|
|
2472
2480
|
}
|
|
2473
|
-
const requiredCount = getRequiredCount(table, step);
|
|
2474
2481
|
const requiredNonEmptyCount = getNonEmptyRequiredCount(table, step);
|
|
2475
2482
|
if (requiredNonEmptyCount === requiredCount) {
|
|
2476
2483
|
return 'complete';
|
|
@@ -2478,7 +2485,9 @@ const getCompletionStatus = (table, step) => {
|
|
|
2478
2485
|
return 'incomplete';
|
|
2479
2486
|
};
|
|
2480
2487
|
const getNonEmptyCount = (table, step) => {
|
|
2481
|
-
const nonEmptyStatuses = Object.keys(table).filter(k =>
|
|
2488
|
+
const nonEmptyStatuses = Object.keys(table).filter(k => {
|
|
2489
|
+
return table[k].step === step && !isEmpty(table[k].value);
|
|
2490
|
+
});
|
|
2482
2491
|
return nonEmptyStatuses.length;
|
|
2483
2492
|
};
|
|
2484
2493
|
const getRequiredCount = (table, step) => {
|
|
@@ -4419,7 +4428,7 @@ const TAB_KEY = 'Tab';
|
|
|
4419
4428
|
let _$7 = t => t,
|
|
4420
4429
|
_t$7,
|
|
4421
4430
|
_t2$4,
|
|
4422
|
-
_t3$
|
|
4431
|
+
_t3$4,
|
|
4423
4432
|
_t4$2;
|
|
4424
4433
|
styled.div(_t$7 || (_t$7 = _$7`
|
|
4425
4434
|
text-overflow: ellipsis;
|
|
@@ -4442,7 +4451,7 @@ const GoADropdownListContainerWrapper = styled.div(_t2$4 || (_t2$4 = _$7`
|
|
|
4442
4451
|
position: relative;
|
|
4443
4452
|
display: ${0};
|
|
4444
4453
|
`), p => !(p === null || p === void 0 ? void 0 : p.isOpen) && 'none');
|
|
4445
|
-
const GoADropdownListContainer = styled.div(_t3$
|
|
4454
|
+
const GoADropdownListContainer = styled.div(_t3$4 || (_t3$4 = _$7`
|
|
4446
4455
|
border: solid 1px var(--goa-color-greyscale-200);
|
|
4447
4456
|
border-radius: var(--goa-space-2xs);
|
|
4448
4457
|
background: var(--goa-color-greyscale-white);
|
|
@@ -5094,7 +5103,7 @@ const LayoutRenderer = ({
|
|
|
5094
5103
|
let _$5 = t => t,
|
|
5095
5104
|
_t$5,
|
|
5096
5105
|
_t2$3,
|
|
5097
|
-
_t3$
|
|
5106
|
+
_t3$3,
|
|
5098
5107
|
_t4$1,
|
|
5099
5108
|
_t5$1,
|
|
5100
5109
|
_t6$1,
|
|
@@ -5120,7 +5129,7 @@ const ReviewItemSection = styled.div(_t2$3 || (_t2$3 = _$5`
|
|
|
5120
5129
|
border: 1px solid #dcdcdc;
|
|
5121
5130
|
border-radius: 5px;
|
|
5122
5131
|
`));
|
|
5123
|
-
const ReviewItemHeader = styled.div(_t3$
|
|
5132
|
+
const ReviewItemHeader = styled.div(_t3$3 || (_t3$3 = _$5`
|
|
5124
5133
|
display: flex;
|
|
5125
5134
|
align-items: center;
|
|
5126
5135
|
justify-content: space-between;
|
|
@@ -5593,7 +5602,7 @@ const FormStepper = props => {
|
|
|
5593
5602
|
useEffect(() => {
|
|
5594
5603
|
const statuses = Array(categories.length);
|
|
5595
5604
|
categories.forEach((_, i) => {
|
|
5596
|
-
statuses[i] = getCompletionStatus(inputStatuses, i + 1);
|
|
5605
|
+
statuses[i] = isEmpty$2(stepStatuses[i]) ? getCompletionStatus(inputStatuses, i + 1) : stepStatuses[i];
|
|
5597
5606
|
});
|
|
5598
5607
|
setStepStatuses(statuses);
|
|
5599
5608
|
}, [inputStatuses, categories]);
|
|
@@ -5613,7 +5622,7 @@ const FormStepper = props => {
|
|
|
5613
5622
|
return jsx(Fragment, {});
|
|
5614
5623
|
}
|
|
5615
5624
|
function nextPage(page, disabled) {
|
|
5616
|
-
const pageStatus = getCompletionStatus(inputStatuses, page);
|
|
5625
|
+
const pageStatus = getCompletionStatus(inputStatuses, page, true);
|
|
5617
5626
|
const statuses = [...stepStatuses];
|
|
5618
5627
|
statuses[page - 1] = pageStatus ? pageStatus : 'incomplete';
|
|
5619
5628
|
setStepStatuses(statuses);
|
|
@@ -5625,6 +5634,10 @@ const FormStepper = props => {
|
|
|
5625
5634
|
setPage(page);
|
|
5626
5635
|
}
|
|
5627
5636
|
function prevPage(page, disabled) {
|
|
5637
|
+
const pageStatus = getCompletionStatus(inputStatuses, page, true);
|
|
5638
|
+
const statuses = [...stepStatuses];
|
|
5639
|
+
statuses[page - 1] = pageStatus ? pageStatus : 'incomplete';
|
|
5640
|
+
setStepStatuses(statuses);
|
|
5628
5641
|
page--;
|
|
5629
5642
|
while (page >= 0 && disabled[page - 1]) {
|
|
5630
5643
|
/* istanbul ignore next */
|
|
@@ -5904,7 +5917,7 @@ const DeleteFileModal = ({
|
|
|
5904
5917
|
let _$3 = t => t,
|
|
5905
5918
|
_t$3,
|
|
5906
5919
|
_t2$2,
|
|
5907
|
-
_t3$
|
|
5920
|
+
_t3$2;
|
|
5908
5921
|
const DELAY_UPLOAD_TIMEOUT_MS = 5;
|
|
5909
5922
|
const DELAY_DELETE_TIMEOUT_MS = 5;
|
|
5910
5923
|
const FileUploaderReview = props => {
|
|
@@ -6075,7 +6088,7 @@ const AttachmentBorder = styled.div(_t2$2 || (_t2$2 = _$3`
|
|
|
6075
6088
|
width: fit-content;
|
|
6076
6089
|
margin-top: var(--goa-space-2xs);
|
|
6077
6090
|
`));
|
|
6078
|
-
const FileUploaderStyle = styled.div(_t3$
|
|
6091
|
+
const FileUploaderStyle = styled.div(_t3$2 || (_t3$2 = _$3`
|
|
6079
6092
|
.label {
|
|
6080
6093
|
display: block;
|
|
6081
6094
|
font-weight: var(--goa-font-weight-bold);
|
|
@@ -6269,7 +6282,7 @@ $$8({ target: 'Object', stat: true }, {
|
|
|
6269
6282
|
let _$2 = t => t,
|
|
6270
6283
|
_t$2,
|
|
6271
6284
|
_t2$1,
|
|
6272
|
-
_t3,
|
|
6285
|
+
_t3$1,
|
|
6273
6286
|
_t4,
|
|
6274
6287
|
_t5,
|
|
6275
6288
|
_t6,
|
|
@@ -6288,7 +6301,7 @@ const NonEmptyCellStyle = styled.div(_t2$1 || (_t2$1 = _$2`
|
|
|
6288
6301
|
background-color: #000:
|
|
6289
6302
|
}
|
|
6290
6303
|
`));
|
|
6291
|
-
const ToolBarHeader = styled.div(_t3 || (_t3 = _$2`
|
|
6304
|
+
const ToolBarHeader = styled.div(_t3$1 || (_t3$1 = _$2`
|
|
6292
6305
|
margin-bottom: var(--goa-space-l);
|
|
6293
6306
|
`));
|
|
6294
6307
|
const ObjectArrayTitle = styled.h2(_t4 || (_t4 = _$2`
|
|
@@ -7412,7 +7425,8 @@ const GoAListWithDetailsTester = rankWith(3, and(uiTypeIs('ListWithDetail')));
|
|
|
7412
7425
|
|
|
7413
7426
|
let _$1 = t => t,
|
|
7414
7427
|
_t$1,
|
|
7415
|
-
_t2
|
|
7428
|
+
_t2,
|
|
7429
|
+
_t3;
|
|
7416
7430
|
const SearchBox = styled.div(_t$1 || (_t$1 = _$1`
|
|
7417
7431
|
position: relative;
|
|
7418
7432
|
|
|
@@ -7448,6 +7462,20 @@ const LabelDiv = styled.div(_t2 || (_t2 = _$1`
|
|
|
7448
7462
|
font-size: var(--fs-sl);
|
|
7449
7463
|
padding-bottom: 1.5rem;
|
|
7450
7464
|
`));
|
|
7465
|
+
const ListItem = styled.li(_t3 || (_t3 = _$1`
|
|
7466
|
+
background-color: ${0};
|
|
7467
|
+
color: ${0};
|
|
7468
|
+
font-weight: ${0};
|
|
7469
|
+
`), ({
|
|
7470
|
+
selectedIndex,
|
|
7471
|
+
index
|
|
7472
|
+
}) => selectedIndex === index ? 'var(--color-primary)' : '', ({
|
|
7473
|
+
selectedIndex,
|
|
7474
|
+
index
|
|
7475
|
+
}) => selectedIndex === index ? 'var(--color-white) !important' : '', ({
|
|
7476
|
+
selectedIndex,
|
|
7477
|
+
index
|
|
7478
|
+
}) => selectedIndex === index ? 'var(--fw-bold)' : '');
|
|
7451
7479
|
|
|
7452
7480
|
const AddressInputs = ({
|
|
7453
7481
|
address,
|
|
@@ -7626,7 +7654,7 @@ const fetchAddressSuggestions = (formUrl, searchTerm, isAlbertaAddress) => __awa
|
|
|
7626
7654
|
const response = yield axios.get(formUrl, {
|
|
7627
7655
|
params
|
|
7628
7656
|
});
|
|
7629
|
-
return response.data.Items
|
|
7657
|
+
return response.data.Items;
|
|
7630
7658
|
} catch (error) {
|
|
7631
7659
|
console.error('Error fetching address suggestions:', error);
|
|
7632
7660
|
return [];
|
|
@@ -7904,6 +7932,8 @@ const AddressLookUpControl = props => {
|
|
|
7904
7932
|
setAddress(updatedAddress);
|
|
7905
7933
|
handleChange(path, updatedAddress);
|
|
7906
7934
|
};
|
|
7935
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
7936
|
+
const dropdownRef = useRef(null);
|
|
7907
7937
|
const handleInputChange = (field, value) => {
|
|
7908
7938
|
var _a, _b;
|
|
7909
7939
|
let newAddress;
|
|
@@ -7935,14 +7965,15 @@ const AddressLookUpControl = props => {
|
|
|
7935
7965
|
if (searchTerm.length > 2) {
|
|
7936
7966
|
setLoading(true);
|
|
7937
7967
|
setOpen(true);
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7968
|
+
yield fetchAddressSuggestions(formUrl, searchTerm, isAlbertaAddress).then(response => {
|
|
7969
|
+
const suggestions = filterSuggestionsWithoutAddressCount(response);
|
|
7970
|
+
if (isAlbertaAddress) {
|
|
7971
|
+
setSuggestions(filterAlbertaAddresses(suggestions));
|
|
7972
|
+
} else {
|
|
7973
|
+
setSuggestions(suggestions);
|
|
7974
|
+
}
|
|
7975
|
+
setLoading(false);
|
|
7976
|
+
});
|
|
7946
7977
|
} else {
|
|
7947
7978
|
setSuggestions([]);
|
|
7948
7979
|
setOpen(false);
|
|
@@ -7961,14 +7992,62 @@ const AddressLookUpControl = props => {
|
|
|
7961
7992
|
setSuggestions([]);
|
|
7962
7993
|
setErrors({});
|
|
7963
7994
|
};
|
|
7995
|
+
/* istanbul ignore next */
|
|
7964
7996
|
const handleRequiredFieldBlur = name => {
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
err[name] = name === 'municipality' ?
|
|
7997
|
+
const err = Object.assign({}, errors);
|
|
7998
|
+
if ((data === null || data === void 0 ? void 0 : data["city"]) === undefined || (data === null || data === void 0 ? void 0 : data["city"]) === "") {
|
|
7999
|
+
err[name] = name === 'municipality' ? 'city is required' : "";
|
|
8000
|
+
setErrors(err);
|
|
8001
|
+
}
|
|
8002
|
+
if (!(data === null || data === void 0 ? void 0 : data[name]) || data[name] === '' || (data === null || data === void 0 ? void 0 : data[name]) === undefined) {
|
|
8003
|
+
err[name] = name === 'municipality' ? 'city is required' : `${name} is required`;
|
|
8004
|
+
setErrors(err);
|
|
8005
|
+
}
|
|
8006
|
+
if (!(data === null || data === void 0 ? void 0 : data[name])) {
|
|
8007
|
+
err[name] = name === 'addressLine1' ? `${name} is required` : ``;
|
|
7968
8008
|
setErrors(err);
|
|
7969
8009
|
} else {
|
|
7970
8010
|
delete errors[name];
|
|
7971
8011
|
}
|
|
8012
|
+
setTimeout(() => {
|
|
8013
|
+
setSuggestions([]);
|
|
8014
|
+
setOpen(false);
|
|
8015
|
+
}, 100);
|
|
8016
|
+
};
|
|
8017
|
+
useEffect(() => {
|
|
8018
|
+
if (dropdownRef.current) {
|
|
8019
|
+
const selectedItem = dropdownRef.current.children[selectedIndex];
|
|
8020
|
+
if (selectedItem) {
|
|
8021
|
+
selectedItem.scrollIntoView({
|
|
8022
|
+
block: 'nearest',
|
|
8023
|
+
behavior: 'smooth'
|
|
8024
|
+
});
|
|
8025
|
+
}
|
|
8026
|
+
}
|
|
8027
|
+
}, [selectedIndex, open]);
|
|
8028
|
+
/* istanbul ignore next */
|
|
8029
|
+
const handleKeyDown = (e, value, key) => {
|
|
8030
|
+
var _a;
|
|
8031
|
+
if (key === 'ArrowDown') {
|
|
8032
|
+
setSelectedIndex(prevIndex => prevIndex < suggestions.length - 1 ? prevIndex + 1 : 0);
|
|
8033
|
+
handleDropdownChange(value);
|
|
8034
|
+
} else if (key === 'ArrowUp') {
|
|
8035
|
+
setSelectedIndex(prevIndex => prevIndex > 0 ? prevIndex - 1 : suggestions.length - 1);
|
|
8036
|
+
handleDropdownChange(value);
|
|
8037
|
+
} else if (key === 'Enter') {
|
|
8038
|
+
handleDropdownChange(value);
|
|
8039
|
+
setLoading(false);
|
|
8040
|
+
if (selectedIndex >= 0) {
|
|
8041
|
+
(_a = document.getElementById("goaInput")) === null || _a === void 0 ? void 0 : _a.blur();
|
|
8042
|
+
const suggestion = suggestions[selectedIndex];
|
|
8043
|
+
if (suggestion) {
|
|
8044
|
+
setTimeout(() => {
|
|
8045
|
+
handleSuggestionClick(suggestion);
|
|
8046
|
+
setOpen(false);
|
|
8047
|
+
}, 100);
|
|
8048
|
+
}
|
|
8049
|
+
}
|
|
8050
|
+
}
|
|
7972
8051
|
};
|
|
7973
8052
|
const readOnly = (_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.readOnly) !== null && _f !== void 0 ? _f : false;
|
|
7974
8053
|
return jsxs("div", {
|
|
@@ -7979,6 +8058,7 @@ const AddressLookUpControl = props => {
|
|
|
7979
8058
|
children: jsxs(SearchBox, {
|
|
7980
8059
|
children: [jsx(GoAInput, {
|
|
7981
8060
|
leadingIcon: autocompletion && enabled ? 'search' : undefined,
|
|
8061
|
+
id: "goaInput",
|
|
7982
8062
|
name: "addressLine1",
|
|
7983
8063
|
testId: "address-form-address1",
|
|
7984
8064
|
readonly: readOnly,
|
|
@@ -7986,17 +8066,31 @@ const AddressLookUpControl = props => {
|
|
|
7986
8066
|
ariaLabel: 'address-form-address1',
|
|
7987
8067
|
placeholder: "Start typing the first line of your address, required.",
|
|
7988
8068
|
value: (address === null || address === void 0 ? void 0 : address.addressLine1) || '',
|
|
7989
|
-
onChange: (
|
|
8069
|
+
onChange: (e, value) => {
|
|
8070
|
+
handleDropdownChange(value);
|
|
8071
|
+
},
|
|
7990
8072
|
onBlur: name => handleRequiredFieldBlur(name),
|
|
7991
|
-
width: "100%"
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
8073
|
+
width: "100%",
|
|
8074
|
+
onKeyPress: (e, value, key) => {
|
|
8075
|
+
if (open) {
|
|
8076
|
+
handleKeyDown(e, value, key);
|
|
8077
|
+
}
|
|
8078
|
+
}
|
|
8079
|
+
}), loading && autocompletion && jsx(GoACircularProgress, {
|
|
8080
|
+
variant: "inline",
|
|
8081
|
+
size: "small",
|
|
8082
|
+
visible: true
|
|
8083
|
+
}), suggestions && autocompletion && jsx("ul", {
|
|
8084
|
+
ref: dropdownRef,
|
|
7996
8085
|
className: "suggestions",
|
|
7997
8086
|
tabIndex: 0,
|
|
7998
|
-
children: suggestions && autocompletion && open && suggestions.map((suggestion, index) => jsx(
|
|
7999
|
-
|
|
8087
|
+
children: suggestions && autocompletion && open && suggestions.map((suggestion, index) => jsx(ListItem, {
|
|
8088
|
+
"data-index": index,
|
|
8089
|
+
onClick: () => {
|
|
8090
|
+
handleSuggestionClick(suggestion);
|
|
8091
|
+
},
|
|
8092
|
+
selectedIndex: selectedIndex,
|
|
8093
|
+
index: index,
|
|
8000
8094
|
children: `${suggestion.Text} ${suggestion.Description}`
|
|
8001
8095
|
}, index))
|
|
8002
8096
|
})]
|
|
@@ -8185,7 +8279,7 @@ const NameInputs = ({
|
|
|
8185
8279
|
testId: "wrapper",
|
|
8186
8280
|
children: [jsx(GoAFormItem, {
|
|
8187
8281
|
testId: "formitem-first-name",
|
|
8188
|
-
label: "First
|
|
8282
|
+
label: "First name",
|
|
8189
8283
|
requirement: (requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.includes('firstName')) ? 'required' : undefined,
|
|
8190
8284
|
error: (_a = errors === null || errors === void 0 ? void 0 : errors['firstName']) !== null && _a !== void 0 ? _a : '',
|
|
8191
8285
|
children: jsx(GoAInput, {
|
|
@@ -8203,7 +8297,7 @@ const NameInputs = ({
|
|
|
8203
8297
|
})
|
|
8204
8298
|
}), jsx(GoAFormItem, {
|
|
8205
8299
|
testId: "formitem-middle-name",
|
|
8206
|
-
label: "Middle
|
|
8300
|
+
label: "Middle name",
|
|
8207
8301
|
requirement: (requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.includes('middleName')) ? 'required' : undefined,
|
|
8208
8302
|
children: jsx(GoAInput, {
|
|
8209
8303
|
type: "text",
|
|
@@ -8216,7 +8310,7 @@ const NameInputs = ({
|
|
|
8216
8310
|
})
|
|
8217
8311
|
}), jsx(GoAFormItem, {
|
|
8218
8312
|
testId: "formitem-last-name",
|
|
8219
|
-
label: "Last
|
|
8313
|
+
label: "Last name",
|
|
8220
8314
|
requirement: (requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.includes('lastName')) ? 'required' : undefined,
|
|
8221
8315
|
error: (_b = errors === null || errors === void 0 ? void 0 : errors['lastName']) !== null && _b !== void 0 ? _b : '',
|
|
8222
8316
|
children: jsx(GoAInput, {
|
|
@@ -8384,7 +8478,7 @@ const FullNameDobControl = props => {
|
|
|
8384
8478
|
minChildWidth: "0ch",
|
|
8385
8479
|
gap: "s",
|
|
8386
8480
|
children: [jsx(GoAFormItem, {
|
|
8387
|
-
label: "First
|
|
8481
|
+
label: "First name",
|
|
8388
8482
|
requirement: ((_a = schema === null || schema === void 0 ? void 0 : schema.required) === null || _a === void 0 ? void 0 : _a.includes('firstName')) ? 'required' : undefined,
|
|
8389
8483
|
error: (_b = errors === null || errors === void 0 ? void 0 : errors['firstName']) !== null && _b !== void 0 ? _b : '',
|
|
8390
8484
|
children: jsx(GoAInput, {
|
|
@@ -8404,7 +8498,7 @@ const FullNameDobControl = props => {
|
|
|
8404
8498
|
width: "100%"
|
|
8405
8499
|
})
|
|
8406
8500
|
}), jsx(GoAFormItem, {
|
|
8407
|
-
label: "Middle
|
|
8501
|
+
label: "Middle name",
|
|
8408
8502
|
requirement: ((_c = schema === null || schema === void 0 ? void 0 : schema.required) === null || _c === void 0 ? void 0 : _c.includes('middleName')) ? 'required' : undefined,
|
|
8409
8503
|
children: jsx(GoAInput, {
|
|
8410
8504
|
type: "text",
|
|
@@ -8416,7 +8510,7 @@ const FullNameDobControl = props => {
|
|
|
8416
8510
|
width: "100%"
|
|
8417
8511
|
})
|
|
8418
8512
|
}), jsx(GoAFormItem, {
|
|
8419
|
-
label: "Last
|
|
8513
|
+
label: "Last name",
|
|
8420
8514
|
requirement: ((_d = schema === null || schema === void 0 ? void 0 : schema.required) === null || _d === void 0 ? void 0 : _d.includes('lastName')) ? 'required' : undefined,
|
|
8421
8515
|
error: (_e = errors === null || errors === void 0 ? void 0 : errors['lastName']) !== null && _e !== void 0 ? _e : '',
|
|
8422
8516
|
children: jsx(GoAInput, {
|
|
@@ -8437,7 +8531,7 @@ const FullNameDobControl = props => {
|
|
|
8437
8531
|
minChildWidth: "0ch",
|
|
8438
8532
|
gap: "s",
|
|
8439
8533
|
children: jsx(GoAFormItem, {
|
|
8440
|
-
label: "Date of
|
|
8534
|
+
label: "Date of birth",
|
|
8441
8535
|
error: (_f = errors === null || errors === void 0 ? void 0 : errors['dateOfBirth']) !== null && _f !== void 0 ? _f : '',
|
|
8442
8536
|
requirement: (requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.includes('dateOfBirth')) ? 'required' : undefined,
|
|
8443
8537
|
children: jsx(GoAInput, {
|
|
@@ -8469,20 +8563,20 @@ const FullNameDobReviewControl = props => {
|
|
|
8469
8563
|
minChildWidth: "0ch",
|
|
8470
8564
|
gap: "s",
|
|
8471
8565
|
children: [jsx(GoAFormItem, {
|
|
8472
|
-
label: "First
|
|
8566
|
+
label: "First name",
|
|
8473
8567
|
requirement: (requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.includes('firstName')) ? 'required' : undefined,
|
|
8474
8568
|
children: jsx("div", {
|
|
8475
8569
|
"data-testid": `firstName-control-${props.id}`,
|
|
8476
8570
|
children: (_a = props.data) === null || _a === void 0 ? void 0 : _a.firstName
|
|
8477
8571
|
})
|
|
8478
8572
|
}), jsx(GoAFormItem, {
|
|
8479
|
-
label: "Middle
|
|
8573
|
+
label: "Middle name",
|
|
8480
8574
|
children: jsx("div", {
|
|
8481
8575
|
"data-testid": `middleName-control-${props.id}`,
|
|
8482
8576
|
children: (_b = props.data) === null || _b === void 0 ? void 0 : _b.middleName
|
|
8483
8577
|
})
|
|
8484
8578
|
}), jsx(GoAFormItem, {
|
|
8485
|
-
label: "Last
|
|
8579
|
+
label: "Last name",
|
|
8486
8580
|
requirement: (requiredFields === null || requiredFields === void 0 ? void 0 : requiredFields.includes('lastName')) ? 'required' : undefined,
|
|
8487
8581
|
children: jsx("div", {
|
|
8488
8582
|
"data-testid": `lastName-control-${props.id}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.40.
|
|
3
|
+
"version": "1.40.2",
|
|
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",
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
interface ListItemProps {
|
|
3
|
+
selectedIndex: number;
|
|
4
|
+
index: number;
|
|
5
|
+
}
|
|
2
6
|
export declare const SearchBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
7
|
export declare const LabelDiv: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
|
+
export declare const ListItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, ListItemProps>> & string;
|
|
9
|
+
export {};
|
|
@@ -15,5 +15,5 @@ export declare const StepperContext: import("react").Context<{
|
|
|
15
15
|
isInitialized: (_: string) => boolean;
|
|
16
16
|
stepId: number;
|
|
17
17
|
}>;
|
|
18
|
-
export declare const getCompletionStatus: (table: StatusTable, step: number) => GoAFormStepStatusType | undefined;
|
|
18
|
+
export declare const getCompletionStatus: (table: StatusTable, step: number, isFormChanged?: boolean) => GoAFormStepStatusType | undefined;
|
|
19
19
|
export declare const logRequiredFields: (table: StatusTable, step: number) => void;
|