@abgov/jsonforms-components 1.58.1 → 1.58.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
|
@@ -8982,10 +8982,17 @@ const AddressLookUpControl = props => {
|
|
|
8982
8982
|
const autocompletion = ((_c = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _c === void 0 ? void 0 : _c.autocomplete) !== false;
|
|
8983
8983
|
const [open, setOpen] = useState(false);
|
|
8984
8984
|
const label = typeof (uischema === null || uischema === void 0 ? void 0 : uischema.label) === 'string' && uischema.label ? uischema.label : '';
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8985
|
+
let defaultAddress = {};
|
|
8986
|
+
if (isAlbertaAddress) {
|
|
8987
|
+
defaultAddress = {
|
|
8988
|
+
country: 'CA',
|
|
8989
|
+
subdivisionCode: 'AB'
|
|
8990
|
+
};
|
|
8991
|
+
} else {
|
|
8992
|
+
defaultAddress = {
|
|
8993
|
+
country: 'CA'
|
|
8994
|
+
};
|
|
8995
|
+
}
|
|
8989
8996
|
const [address, setAddress] = useState(data || defaultAddress);
|
|
8990
8997
|
const [searchTerm, setSearchTerm] = useState('');
|
|
8991
8998
|
const [saveSearchTerm, setSaveSearchTerm] = useState(false);
|
|
@@ -9187,7 +9194,8 @@ const AddressLookUpControl = props => {
|
|
|
9187
9194
|
|
|
9188
9195
|
const AddressViews = ({
|
|
9189
9196
|
data,
|
|
9190
|
-
isAlbertaAddress
|
|
9197
|
+
isAlbertaAddress,
|
|
9198
|
+
withoutHeader
|
|
9191
9199
|
}) => {
|
|
9192
9200
|
var _a;
|
|
9193
9201
|
const provinces = [{
|
|
@@ -9231,7 +9239,7 @@ const AddressViews = ({
|
|
|
9231
9239
|
label: 'Yukon'
|
|
9232
9240
|
}];
|
|
9233
9241
|
return jsxs(Fragment, {
|
|
9234
|
-
children: [jsx(GoAGrid, {
|
|
9242
|
+
children: [withoutHeader !== true && jsx(GoAGrid, {
|
|
9235
9243
|
minChildWidth: "0",
|
|
9236
9244
|
gap: "s",
|
|
9237
9245
|
children: jsx(GoAFormItem, {
|
|
@@ -9306,6 +9314,48 @@ const AddressLookUpControlReview = props => {
|
|
|
9306
9314
|
isAlbertaAddress: isAlbertaAddress
|
|
9307
9315
|
});
|
|
9308
9316
|
};
|
|
9317
|
+
const AddressLoopUpControlTableReview = props => {
|
|
9318
|
+
var _a, _b, _c;
|
|
9319
|
+
const {
|
|
9320
|
+
data,
|
|
9321
|
+
schema,
|
|
9322
|
+
uischema
|
|
9323
|
+
} = props;
|
|
9324
|
+
const categoryIndex = (_a = uischema.options) === null || _a === void 0 ? void 0 : _a.categoryIndex;
|
|
9325
|
+
const formStepperCtx = useContext(JsonFormsStepperContext);
|
|
9326
|
+
const isAlbertaAddress = ((_c = (_b = schema === null || schema === void 0 ? void 0 : schema.properties) === null || _b === void 0 ? void 0 : _b.subdivisionCode) === null || _c === void 0 ? void 0 : _c.const) === 'AB';
|
|
9327
|
+
return jsxs(Fragment, {
|
|
9328
|
+
children: [jsxs("tr", {
|
|
9329
|
+
"data-testid": "address-lookup-table-review",
|
|
9330
|
+
children: [jsx(PageReviewNameCol, {
|
|
9331
|
+
children: jsx("strong", {
|
|
9332
|
+
children: `${isAlbertaAddress ? 'Alberta' : 'Canada'} postal address`
|
|
9333
|
+
})
|
|
9334
|
+
}), jsx(PageReviewValueCol, {}), jsx(PageReviewActionCol, {
|
|
9335
|
+
children: jsx(GoAButton, {
|
|
9336
|
+
type: "tertiary",
|
|
9337
|
+
testId: `page-review-change-address-btn`,
|
|
9338
|
+
onClick: () => {
|
|
9339
|
+
if (formStepperCtx) {
|
|
9340
|
+
formStepperCtx.toggleShowReviewLink(categoryIndex);
|
|
9341
|
+
formStepperCtx.goToPage(categoryIndex);
|
|
9342
|
+
}
|
|
9343
|
+
},
|
|
9344
|
+
children: "Change"
|
|
9345
|
+
})
|
|
9346
|
+
})]
|
|
9347
|
+
}), jsx("tr", {
|
|
9348
|
+
children: jsx("td", {
|
|
9349
|
+
colSpan: 3,
|
|
9350
|
+
children: jsx(AddressViews, {
|
|
9351
|
+
data: data,
|
|
9352
|
+
isAlbertaAddress: isAlbertaAddress,
|
|
9353
|
+
withoutHeader: true
|
|
9354
|
+
})
|
|
9355
|
+
})
|
|
9356
|
+
})]
|
|
9357
|
+
});
|
|
9358
|
+
};
|
|
9309
9359
|
|
|
9310
9360
|
const isPropertiesMatch = (obj, props, isExactMatch) => {
|
|
9311
9361
|
if (isObject$f(obj)) {
|
|
@@ -11202,6 +11252,12 @@ const GoABaseTableReviewRenderers = [
|
|
|
11202
11252
|
}, {
|
|
11203
11253
|
tester: GoAListWithDetailsTester,
|
|
11204
11254
|
renderer: GoAInputBaseTableReviewControl
|
|
11255
|
+
}, {
|
|
11256
|
+
tester: FullNameDobTester,
|
|
11257
|
+
renderer: GoAInputBaseTableReviewControl
|
|
11258
|
+
}, {
|
|
11259
|
+
tester: AddressLookUpTester,
|
|
11260
|
+
renderer: withJsonFormsControlProps(AddressLoopUpControlTableReview)
|
|
11205
11261
|
}, {
|
|
11206
11262
|
tester: GoAHorizontalLayoutTester,
|
|
11207
11263
|
renderer: GoAInputBaseTableReviewControl
|
|
@@ -11255,4 +11311,4 @@ const GoARenderers = [...GoABaseRenderers, {
|
|
|
11255
11311
|
}];
|
|
11256
11312
|
const GoACells = [...InputCells];
|
|
11257
11313
|
|
|
11258
|
-
export { ADD_DATALIST_ACTION, ADD_NO_ANONYMOUS_ACTION, ADD_REGISTER_DATA_ACTION, ADD_REGISTER_DATA_ERROR, AddressLookUpControl, AddressLookUpControlReview, AddressLookUpTester, ArrayControl, ArrayControlBase, ArrayControlReview, BooleanComponent, BooleanControl, BooleanRadioComponent, BooleanRadioControl, CategorizationPagesRendererTester, CategorizationStepperRendererTester, CheckboxGroup, ContextProviderC, ContextProviderClass, ContextProviderFactory, EnumCheckboxControl, EnumRadioControl, EnumSelect, FileUploader, FileUploaderReview, FileUploaderTester, FormPageStepper, FormPagesView, FormStepper, FormStepperControl, FormStepperPagesControl, FormStepperReviewControl, FormStepperReviewer, FormStepperView, FullNameControl, FullNameDobControl, FullNameDobReviewControl, FullNameDobTester, FullNameReviewControl, FullNameTester, GoAArrayControlRenderer, GoAArrayControlReviewRenderer, GoAArrayControlTester, GoABaseInputReviewComponent, GoABaseRenderers, GoABaseReviewRenderers, GoABaseTableReviewRenderers, GoABooleanControl, GoABooleanControlTester, GoABooleanRadioControl, GoABooleanRadioControlTester, GoACells, GoACheckoutGroupControlTester, GoADateControl, GoADateControlTester, GoADateInput, GoADateTimeControl, GoADateTimeControlTester, GoADateTimeInput, GoAEnumCheckboxGroupControl, GoAEnumControl, GoAEnumControlTester, GoAEnumRadioGroupControl, GoAInputBaseControl, GoAInputBaseTableReview, GoAInputBaseTableReviewControl, GoAInputDateControl, GoAInputDateTimeControl, GoAInputInteger, GoAInputIntegerControl, GoAInputNumberControl, GoAInputText, GoAInputTextControl, GoAInputTimeControl, GoAIntegerControl, GoAIntegerControlTester, GoAListWithDetailsControlRenderer, GoAListWithDetailsTester, GoANumberControl, GoANumberControlTester, GoANumberInput, GoARadioGroupControlTester, GoARenderers, GoAReviewRenderers, GoATextControl, GoATextControlTester, GoATimeControl, GoATimeControlTester, GoATimeInput, GoInputBaseReview, GoInputBaseReviewControl, JsonFormContext, JsonFormRegisterProvider, JsonFormsRegisterContext, ListWithDetailsControl, MultiLineText, MultiLineTextControl, MultiLineTextControlInput, MultiLineTextControlTester, RadioGroup, categoriesAreValid, createDefaultAjv, enumControl, errMalformedDate, formatSin, isAddressLookup, isFullName, isFullNameDoB, registerReducer, resolveRefs, tryResolveRefs };
|
|
11314
|
+
export { ADD_DATALIST_ACTION, ADD_NO_ANONYMOUS_ACTION, ADD_REGISTER_DATA_ACTION, ADD_REGISTER_DATA_ERROR, AddressLookUpControl, AddressLookUpControlReview, AddressLookUpTester, AddressLoopUpControlTableReview, ArrayControl, ArrayControlBase, ArrayControlReview, BooleanComponent, BooleanControl, BooleanRadioComponent, BooleanRadioControl, CategorizationPagesRendererTester, CategorizationStepperRendererTester, CheckboxGroup, ContextProviderC, ContextProviderClass, ContextProviderFactory, EnumCheckboxControl, EnumRadioControl, EnumSelect, FileUploader, FileUploaderReview, FileUploaderTester, FormPageStepper, FormPagesView, FormStepper, FormStepperControl, FormStepperPagesControl, FormStepperReviewControl, FormStepperReviewer, FormStepperView, FullNameControl, FullNameDobControl, FullNameDobReviewControl, FullNameDobTester, FullNameReviewControl, FullNameTester, GoAArrayControlRenderer, GoAArrayControlReviewRenderer, GoAArrayControlTester, GoABaseInputReviewComponent, GoABaseRenderers, GoABaseReviewRenderers, GoABaseTableReviewRenderers, GoABooleanControl, GoABooleanControlTester, GoABooleanRadioControl, GoABooleanRadioControlTester, GoACells, GoACheckoutGroupControlTester, GoADateControl, GoADateControlTester, GoADateInput, GoADateTimeControl, GoADateTimeControlTester, GoADateTimeInput, GoAEnumCheckboxGroupControl, GoAEnumControl, GoAEnumControlTester, GoAEnumRadioGroupControl, GoAInputBaseControl, GoAInputBaseTableReview, GoAInputBaseTableReviewControl, GoAInputDateControl, GoAInputDateTimeControl, GoAInputInteger, GoAInputIntegerControl, GoAInputNumberControl, GoAInputText, GoAInputTextControl, GoAInputTimeControl, GoAIntegerControl, GoAIntegerControlTester, GoAListWithDetailsControlRenderer, GoAListWithDetailsTester, GoANumberControl, GoANumberControlTester, GoANumberInput, GoARadioGroupControlTester, GoARenderers, GoAReviewRenderers, GoATextControl, GoATextControlTester, GoATimeControl, GoATimeControlTester, GoATimeInput, GoInputBaseReview, GoInputBaseReviewControl, JsonFormContext, JsonFormRegisterProvider, JsonFormsRegisterContext, ListWithDetailsControl, MultiLineText, MultiLineTextControl, MultiLineTextControlInput, MultiLineTextControlTester, RadioGroup, categoriesAreValid, createDefaultAjv, enumControl, errMalformedDate, formatSin, isAddressLookup, isFullName, isFullNameDoB, registerReducer, resolveRefs, tryResolveRefs };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.58.
|
|
3
|
+
"version": "1.58.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,4 +1,5 @@
|
|
|
1
1
|
import { ControlProps } from '@jsonforms/core';
|
|
2
2
|
type AddressViewProps = ControlProps;
|
|
3
3
|
export declare const AddressLookUpControlReview: (props: AddressViewProps) => JSX.Element;
|
|
4
|
+
export declare const AddressLoopUpControlTableReview: (props: AddressViewProps) => JSX.Element;
|
|
4
5
|
export {};
|