@abgov/jsonforms-components 2.53.0 → 2.54.0
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 +71 -28
- package/package.json +1 -1
- package/renderer-catalog.json +2 -2
package/index.esm.js
CHANGED
|
@@ -7371,7 +7371,10 @@ const MultiLineText = props => {
|
|
|
7371
7371
|
const {
|
|
7372
7372
|
required
|
|
7373
7373
|
} = props;
|
|
7374
|
-
const [textAreaValue,
|
|
7374
|
+
const [textAreaValue, setTextAreaValue] = React.useState(data || '');
|
|
7375
|
+
useEffect(() => {
|
|
7376
|
+
setTextAreaValue(data || '');
|
|
7377
|
+
}, [data]);
|
|
7375
7378
|
const appliedUiSchemaOptions = Object.assign({}, config, uischema == null ? void 0 : uischema.options);
|
|
7376
7379
|
const placeholder = (appliedUiSchemaOptions == null ? void 0 : appliedUiSchemaOptions.placeholder) || (schema == null ? void 0 : schema.description) || '';
|
|
7377
7380
|
const width = (_uischema$options$com = uischema == null || (_uischema$options = uischema.options) == null || (_uischema$options = _uischema$options.componentProps) == null ? void 0 : _uischema$options.width) != null ? _uischema$options$com : '100%';
|
|
@@ -8879,7 +8882,7 @@ const ObjectArrayToolBar = /*#__PURE__*/React.memo(function TableToolbar({
|
|
|
8879
8882
|
});
|
|
8880
8883
|
});
|
|
8881
8884
|
|
|
8882
|
-
const _excluded$
|
|
8885
|
+
const _excluded$5 = ["label", "path", "schema", "rootSchema", "uischema", "errors", "openDeleteDialog", "visible", "enabled", "cells", "data", "config"];
|
|
8883
8886
|
const getItemsTitle = schema => {
|
|
8884
8887
|
const items = schema == null ? void 0 : schema.items;
|
|
8885
8888
|
if (items && !Array.isArray(items) && typeof items === 'object') {
|
|
@@ -9759,7 +9762,7 @@ class ListWithDetailControl extends React.Component {
|
|
|
9759
9762
|
data,
|
|
9760
9763
|
config
|
|
9761
9764
|
} = _this$props,
|
|
9762
|
-
additionalProps = _objectWithoutPropertiesLoose(_this$props, _excluded$
|
|
9765
|
+
additionalProps = _objectWithoutPropertiesLoose(_this$props, _excluded$5);
|
|
9763
9766
|
const controlElement = uischema;
|
|
9764
9767
|
// eslint-disable-next-line
|
|
9765
9768
|
const listTitle = (_ref = (_ref2 = (_ref3 = (_uischema$label = uischema == null ? void 0 : uischema.label) != null ? _uischema$label : uischema == null || (_uischema$options15 = uischema.options) == null ? void 0 : _uischema$options15.title) != null ? _ref3 : getItemsTitle(schema)) != null ? _ref2 : schema == null ? void 0 : schema.title) != null ? _ref : label;
|
|
@@ -11176,7 +11179,7 @@ const renderCellColumn = ({
|
|
|
11176
11179
|
return null;
|
|
11177
11180
|
};
|
|
11178
11181
|
|
|
11179
|
-
const _excluded$
|
|
11182
|
+
const _excluded$4 = ["label", "path", "schema", "rootSchema", "uischema", "errors", "visible", "enabled", "cells", "data", "config", "isStepperReview", "handleChange", "removeItems"];
|
|
11180
11183
|
const GenerateRows = (Cell, schema, rowPath, enabled, openDeleteDialog, handleChange, cells, uischema, isInReview, count, data, errors) => {
|
|
11181
11184
|
if ((schema == null ? void 0 : schema.type) === 'object') {
|
|
11182
11185
|
const props = {
|
|
@@ -11583,7 +11586,7 @@ const ObjectArrayControl = props => {
|
|
|
11583
11586
|
config,
|
|
11584
11587
|
isStepperReview
|
|
11585
11588
|
} = props,
|
|
11586
|
-
additionalProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
11589
|
+
additionalProps = _objectWithoutPropertiesLoose(props, _excluded$4);
|
|
11587
11590
|
const parsedData = Array.isArray(data) ? data : [];
|
|
11588
11591
|
const latestData = Array.isArray(data) ? Object.fromEntries(parsedData.map((item, index) => [String(index), item])) : (_registers$categories = (_registers$categories2 = registers.categories[path]) == null ? void 0 : _registers$categories2.data) != null ? _registers$categories : {};
|
|
11589
11592
|
const latestCount = Array.isArray(data) ? parsedData.length : (_registers$categories3 = (_registers$categories4 = registers.categories[path]) == null ? void 0 : _registers$categories4.count) != null ? _registers$categories3 : Object.keys(latestData).length;
|
|
@@ -12679,7 +12682,7 @@ const RenderLink = props => {
|
|
|
12679
12682
|
});
|
|
12680
12683
|
};
|
|
12681
12684
|
|
|
12682
|
-
const _excluded$
|
|
12685
|
+
const _excluded$3 = ["isParent", "showLabel"];
|
|
12683
12686
|
const HelpContentReviewComponent = () => {
|
|
12684
12687
|
return jsx(Fragment, {
|
|
12685
12688
|
children: " "
|
|
@@ -12724,7 +12727,7 @@ const HelpContentComponent = _ref => {
|
|
|
12724
12727
|
isParent = true,
|
|
12725
12728
|
showLabel = true
|
|
12726
12729
|
} = _ref,
|
|
12727
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
12730
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
12728
12731
|
const labelClass = isParent ? 'parent-label' : 'child-label';
|
|
12729
12732
|
const marginClass = isParent ? 'parent-margin' : 'child-margin';
|
|
12730
12733
|
// eslint-disable-next-line
|
|
@@ -13488,7 +13491,7 @@ const SummaryRow = ({
|
|
|
13488
13491
|
});
|
|
13489
13492
|
};
|
|
13490
13493
|
|
|
13491
|
-
const _excluded$
|
|
13494
|
+
const _excluded$2 = ["type"];
|
|
13492
13495
|
const AdditionalInstructionsRow = ({
|
|
13493
13496
|
additionalInstructions,
|
|
13494
13497
|
componentProps
|
|
@@ -13497,7 +13500,7 @@ const AdditionalInstructionsRow = ({
|
|
|
13497
13500
|
const calloutType = (componentProps == null ? void 0 : componentProps.type) || 'information';
|
|
13498
13501
|
const type = validTypes.includes(calloutType) ? calloutType : 'information';
|
|
13499
13502
|
const _ref = componentProps || {},
|
|
13500
|
-
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
13503
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
13501
13504
|
const sanitizedHtml = sanitizeHtml(additionalInstructions);
|
|
13502
13505
|
return jsx("tr", {
|
|
13503
13506
|
children: jsx("td", {
|
|
@@ -14052,7 +14055,7 @@ let _2 = t => t,
|
|
|
14052
14055
|
_t2,
|
|
14053
14056
|
_t3,
|
|
14054
14057
|
_t4;
|
|
14055
|
-
const _excluded = ["data", "path", "handleChange", "uischema"];
|
|
14058
|
+
const _excluded$1 = ["data", "path", "handleChange", "uischema"];
|
|
14056
14059
|
const DELAY_DELETE_TIMEOUT_MS = 5;
|
|
14057
14060
|
const FileUploaderReview = props => {
|
|
14058
14061
|
return FileUploader(Object.assign({}, props, {
|
|
@@ -14066,7 +14069,7 @@ const FileUploader = _ref => {
|
|
|
14066
14069
|
handleChange,
|
|
14067
14070
|
uischema
|
|
14068
14071
|
} = _ref,
|
|
14069
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
14072
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
14070
14073
|
const enumerators = useContext(JsonFormContext);
|
|
14071
14074
|
const uploadTriggerFunction = enumerators == null || (_enumerators$function = enumerators.functions) == null ? void 0 : _enumerators$function.get('upload-file');
|
|
14072
14075
|
const uploadTrigger = uploadTriggerFunction && uploadTriggerFunction();
|
|
@@ -16488,7 +16491,25 @@ function handleAddressKeyDown(key, value, activeIndex, suggestions, onInputChang
|
|
|
16488
16491
|
return activeIndex;
|
|
16489
16492
|
}
|
|
16490
16493
|
|
|
16494
|
+
const _excluded = ["provinceState"];
|
|
16491
16495
|
const ADDRESS_PATH = 'api/gateway/v1/address/v1/find';
|
|
16496
|
+
const normalizeAddressData = (value, isAlbertaAddress) => {
|
|
16497
|
+
const defaults = isAlbertaAddress ? {
|
|
16498
|
+
country: 'CA',
|
|
16499
|
+
subdivisionCode: 'AB'
|
|
16500
|
+
} : {
|
|
16501
|
+
country: 'CA'
|
|
16502
|
+
};
|
|
16503
|
+
const source = value || {};
|
|
16504
|
+
const {
|
|
16505
|
+
provinceState
|
|
16506
|
+
} = source,
|
|
16507
|
+
rest = _objectWithoutPropertiesLoose(source, _excluded);
|
|
16508
|
+
const subdivisionCode = rest.subdivisionCode || provinceState;
|
|
16509
|
+
return Object.assign({}, defaults, rest, subdivisionCode ? {
|
|
16510
|
+
subdivisionCode
|
|
16511
|
+
} : {});
|
|
16512
|
+
};
|
|
16492
16513
|
const AddressLookUpControl = props => {
|
|
16493
16514
|
var _schema$properties, _uischema$options, _uischema$options$com, _uischema$options2, _errors$addressLine;
|
|
16494
16515
|
const {
|
|
@@ -16509,18 +16530,7 @@ const AddressLookUpControl = props => {
|
|
|
16509
16530
|
const [open, setOpen] = useState(false);
|
|
16510
16531
|
const addressContainerRef = useRef(null);
|
|
16511
16532
|
const label = typeof (uischema == null ? void 0 : uischema.label) === 'string' && uischema.label ? uischema.label : '';
|
|
16512
|
-
|
|
16513
|
-
if (isAlbertaAddress) {
|
|
16514
|
-
defaultAddress = {
|
|
16515
|
-
country: 'CA',
|
|
16516
|
-
subdivisionCode: 'AB'
|
|
16517
|
-
};
|
|
16518
|
-
} else {
|
|
16519
|
-
defaultAddress = {
|
|
16520
|
-
country: 'CA'
|
|
16521
|
-
};
|
|
16522
|
-
}
|
|
16523
|
-
const [address, setAddress] = useState(data || defaultAddress);
|
|
16533
|
+
const [address, setAddress] = useState(normalizeAddressData(data, isAlbertaAddress));
|
|
16524
16534
|
const [searchTerm, setSearchTerm] = useState('');
|
|
16525
16535
|
const [suggestions, setSuggestions] = useState([]);
|
|
16526
16536
|
const [loading, setLoading] = useState(false);
|
|
@@ -16538,6 +16548,14 @@ const AddressLookUpControl = props => {
|
|
|
16538
16548
|
const lastQueryRef = useRef('');
|
|
16539
16549
|
const cacheRef = useRef(new Map());
|
|
16540
16550
|
const spinnerTimerRef = useRef(null);
|
|
16551
|
+
useEffect(() => {
|
|
16552
|
+
const nextAddress = normalizeAddressData(data, isAlbertaAddress);
|
|
16553
|
+
setAddress(currentAddress => {
|
|
16554
|
+
const keys = ['addressLine1', 'addressLine2', 'municipality', 'postalCode', 'country', 'subdivisionCode'];
|
|
16555
|
+
const unchanged = keys.every(key => currentAddress[key] === nextAddress[key]);
|
|
16556
|
+
return unchanged ? currentAddress : nextAddress;
|
|
16557
|
+
});
|
|
16558
|
+
}, [data, isAlbertaAddress]);
|
|
16541
16559
|
const handleInputChange = (field, value) => {
|
|
16542
16560
|
var _schema$errorMessage;
|
|
16543
16561
|
if (field === 'addressLine1') {
|
|
@@ -16889,6 +16907,11 @@ const NameInputs = ({
|
|
|
16889
16907
|
});
|
|
16890
16908
|
};
|
|
16891
16909
|
|
|
16910
|
+
const normalizeNameData = value => ({
|
|
16911
|
+
firstName: (value == null ? void 0 : value.firstName) || '',
|
|
16912
|
+
middleName: (value == null ? void 0 : value.middleName) || '',
|
|
16913
|
+
lastName: (value == null ? void 0 : value.lastName) || ''
|
|
16914
|
+
});
|
|
16892
16915
|
const FullNameReviewControl = props => {
|
|
16893
16916
|
var _errors$firstName, _props$data3, _props$data4, _errors$lastName, _props$data5;
|
|
16894
16917
|
const requiredFields = props.schema.required;
|
|
@@ -16949,8 +16972,7 @@ const FullNameControl = props => {
|
|
|
16949
16972
|
uischema
|
|
16950
16973
|
} = props;
|
|
16951
16974
|
const requiredFields = schema.required;
|
|
16952
|
-
const
|
|
16953
|
-
const [nameData, setNameData] = useState(data || defaultName);
|
|
16975
|
+
const [nameData, setNameData] = useState(normalizeNameData(data));
|
|
16954
16976
|
const controlRef = useRef(null);
|
|
16955
16977
|
const formStepperCtx = useContext(JsonFormsStepperContext);
|
|
16956
16978
|
const stepperState = formStepperCtx == null || formStepperCtx.selectStepperState == null ? void 0 : formStepperCtx.selectStepperState();
|
|
@@ -16958,6 +16980,10 @@ const FullNameControl = props => {
|
|
|
16958
16980
|
updatedData = Object.fromEntries(Object.entries(updatedData).filter(([_, value]) => value !== ''));
|
|
16959
16981
|
handleChange(path, updatedData);
|
|
16960
16982
|
};
|
|
16983
|
+
useEffect(() => {
|
|
16984
|
+
const nextData = normalizeNameData(data);
|
|
16985
|
+
setNameData(currentData => currentData.firstName === nextData.firstName && currentData.middleName === nextData.middleName && currentData.lastName === nextData.lastName ? currentData : nextData);
|
|
16986
|
+
}, [data]);
|
|
16961
16987
|
const handleInputChange = (field, value) => {
|
|
16962
16988
|
const updatedName = Object.assign({}, nameData, {
|
|
16963
16989
|
[field]: value
|
|
@@ -17045,6 +17071,12 @@ handleRequiredFieldBlur) {
|
|
|
17045
17071
|
}, [formData]);
|
|
17046
17072
|
}
|
|
17047
17073
|
|
|
17074
|
+
const normalizeNameDobData = value => ({
|
|
17075
|
+
firstName: (value == null ? void 0 : value.firstName) || '',
|
|
17076
|
+
middleName: (value == null ? void 0 : value.middleName) || '',
|
|
17077
|
+
lastName: (value == null ? void 0 : value.lastName) || '',
|
|
17078
|
+
dateOfBirth: (value == null ? void 0 : value.dateOfBirth) || ''
|
|
17079
|
+
});
|
|
17048
17080
|
const FullNameDobControl = props => {
|
|
17049
17081
|
var _schema$required, _errors$firstName, _schema$required2, _schema$required3, _errors$lastName, _errors$dateOfBirth;
|
|
17050
17082
|
const {
|
|
@@ -17061,7 +17093,6 @@ const FullNameDobControl = props => {
|
|
|
17061
17093
|
const controlRef = useRef(null);
|
|
17062
17094
|
const formStepperCtx = useContext(JsonFormsStepperContext);
|
|
17063
17095
|
const stepperState = formStepperCtx == null || formStepperCtx.selectStepperState == null ? void 0 : formStepperCtx.selectStepperState();
|
|
17064
|
-
const defaultNameAndDob = {};
|
|
17065
17096
|
const validDates = () => {
|
|
17066
17097
|
const currentDate = new Date();
|
|
17067
17098
|
const minDate = new Date(currentDate.getFullYear() - 150, currentDate.getMonth(), currentDate.getDate()).toISOString().substring(0, 10);
|
|
@@ -17070,12 +17101,16 @@ const FullNameDobControl = props => {
|
|
|
17070
17101
|
maxDate: currentDate.toISOString().substring(0, 10)
|
|
17071
17102
|
};
|
|
17072
17103
|
};
|
|
17073
|
-
const [formData, setFormData] = useState(data
|
|
17104
|
+
const [formData, setFormData] = useState(normalizeNameDobData(data));
|
|
17074
17105
|
const updateFormData = updatedData => {
|
|
17075
17106
|
updatedData = Object.fromEntries(Object.entries(updatedData).filter(([_, value]) => value !== ''));
|
|
17076
17107
|
setFormData(updatedData);
|
|
17077
17108
|
handleChange(path, updatedData);
|
|
17078
17109
|
};
|
|
17110
|
+
useEffect(() => {
|
|
17111
|
+
const nextData = normalizeNameDobData(data);
|
|
17112
|
+
setFormData(currentData => currentData.firstName === nextData.firstName && currentData.middleName === nextData.middleName && currentData.lastName === nextData.lastName && currentData.dateOfBirth === nextData.dateOfBirth ? currentData : nextData);
|
|
17113
|
+
}, [data]);
|
|
17079
17114
|
const handleInputChange = (field, value) => {
|
|
17080
17115
|
const updatedData = Object.assign({}, formData, {
|
|
17081
17116
|
[field]: value
|
|
@@ -17240,6 +17275,10 @@ const PhoneGrid = styled.div(_t || (_t = _`
|
|
|
17240
17275
|
}
|
|
17241
17276
|
`));
|
|
17242
17277
|
const PHONE_REGEX = /^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/;
|
|
17278
|
+
const normalizePhoneData = value => ({
|
|
17279
|
+
type: (value == null ? void 0 : value.type) || '',
|
|
17280
|
+
number: (value == null ? void 0 : value.number) || ''
|
|
17281
|
+
});
|
|
17243
17282
|
const PhoneNumberWithTypeControl = props => {
|
|
17244
17283
|
const {
|
|
17245
17284
|
data,
|
|
@@ -17249,8 +17288,12 @@ const PhoneNumberWithTypeControl = props => {
|
|
|
17249
17288
|
visible,
|
|
17250
17289
|
required
|
|
17251
17290
|
} = props;
|
|
17252
|
-
const [formData, setFormData] = useState(data
|
|
17291
|
+
const [formData, setFormData] = useState(normalizePhoneData(data));
|
|
17253
17292
|
const [error, setError] = useState(undefined);
|
|
17293
|
+
useEffect(() => {
|
|
17294
|
+
const nextData = normalizePhoneData(data);
|
|
17295
|
+
setFormData(currentData => currentData.type === nextData.type && currentData.number === nextData.number ? currentData : nextData);
|
|
17296
|
+
}, [data]);
|
|
17254
17297
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17255
17298
|
const updateFormData = updated => {
|
|
17256
17299
|
setFormData(updated);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.54.0",
|
|
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",
|
package/renderer-catalog.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-03-
|
|
4
|
-
"sourceCommit": "
|
|
3
|
+
"generatedAt": "2026-03-13T20:38:10.020Z",
|
|
4
|
+
"sourceCommit": "748fb227701ff354e6276b45c8d91aeb3e984ca1",
|
|
5
5
|
"sourcePath": "libs/jsonforms-components/src/index.ts",
|
|
6
6
|
"rendererCount": 32,
|
|
7
7
|
"renderers": [
|