@abgov/jsonforms-components 2.6.5 → 2.6.7
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
|
@@ -6227,7 +6227,6 @@ const GoADateTimeInput = props => {
|
|
|
6227
6227
|
uischema,
|
|
6228
6228
|
isVisited,
|
|
6229
6229
|
errors,
|
|
6230
|
-
schema,
|
|
6231
6230
|
label,
|
|
6232
6231
|
setIsVisited
|
|
6233
6232
|
} = props;
|
|
@@ -6344,7 +6343,6 @@ const EnumSelect = props => {
|
|
|
6344
6343
|
path,
|
|
6345
6344
|
handleChange,
|
|
6346
6345
|
options,
|
|
6347
|
-
config,
|
|
6348
6346
|
label,
|
|
6349
6347
|
uischema,
|
|
6350
6348
|
required,
|
|
@@ -6418,7 +6416,6 @@ const RadioGroup = props => {
|
|
|
6418
6416
|
var _a;
|
|
6419
6417
|
const {
|
|
6420
6418
|
data,
|
|
6421
|
-
className,
|
|
6422
6419
|
id,
|
|
6423
6420
|
enabled,
|
|
6424
6421
|
schema,
|
|
@@ -6428,7 +6425,6 @@ const RadioGroup = props => {
|
|
|
6428
6425
|
options,
|
|
6429
6426
|
config,
|
|
6430
6427
|
label,
|
|
6431
|
-
t,
|
|
6432
6428
|
isVisited,
|
|
6433
6429
|
errors
|
|
6434
6430
|
} = props;
|
|
@@ -6513,7 +6509,6 @@ const GoABooleanControl = withJsonFormsControlProps(BooleanControl);
|
|
|
6513
6509
|
|
|
6514
6510
|
const BooleanRadioComponent = ({
|
|
6515
6511
|
data,
|
|
6516
|
-
visible,
|
|
6517
6512
|
enabled,
|
|
6518
6513
|
uischema,
|
|
6519
6514
|
handleChange,
|
|
@@ -6532,34 +6527,31 @@ const BooleanRadioComponent = ({
|
|
|
6532
6527
|
const TrueDescription = description || (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.descriptionForTrue);
|
|
6533
6528
|
const FalseDescription = description || (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.descriptionForFalse);
|
|
6534
6529
|
const BaseTestId = (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.testId) || `${path}-boolean-radio-jsonform`;
|
|
6535
|
-
return
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
if (value === TrueValue) {
|
|
6545
|
-
handleChange(path, true);
|
|
6546
|
-
}
|
|
6547
|
-
if (value === FalseValue) {
|
|
6548
|
-
handleChange(path, false);
|
|
6549
|
-
}
|
|
6530
|
+
return jsxs(GoARadioGroup, Object.assign({
|
|
6531
|
+
error: isVisited && errors.length,
|
|
6532
|
+
name: `${label}`,
|
|
6533
|
+
value: data === true ? TrueValue : data === false ? FalseValue : null,
|
|
6534
|
+
disabled: !enabled,
|
|
6535
|
+
testId: BaseTestId,
|
|
6536
|
+
onChange: (_name, value) => {
|
|
6537
|
+
if (value === TrueValue) {
|
|
6538
|
+
handleChange(path, true);
|
|
6550
6539
|
}
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6540
|
+
if (value === FalseValue) {
|
|
6541
|
+
handleChange(path, false);
|
|
6542
|
+
}
|
|
6543
|
+
}
|
|
6544
|
+
}, (_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.componentProps, {
|
|
6545
|
+
children: [jsx(GoARadioItem, {
|
|
6546
|
+
value: TrueValue,
|
|
6547
|
+
testId: `${BaseTestId}-yes-option`,
|
|
6548
|
+
description: EnableDescription ? TrueDescription : null
|
|
6549
|
+
}), jsx(GoARadioItem, {
|
|
6550
|
+
value: FalseValue,
|
|
6551
|
+
testId: `${BaseTestId}-no-option`,
|
|
6552
|
+
description: EnableDescription ? FalseDescription : null
|
|
6553
|
+
})]
|
|
6554
|
+
}));
|
|
6563
6555
|
};
|
|
6564
6556
|
const BooleanRadioControl = props => jsx(GoAInputBaseControl, Object.assign({}, props, {
|
|
6565
6557
|
input: BooleanRadioComponent
|
|
@@ -6602,8 +6594,7 @@ const CheckboxGroup = props => {
|
|
|
6602
6594
|
handleChange,
|
|
6603
6595
|
options,
|
|
6604
6596
|
config,
|
|
6605
|
-
label
|
|
6606
|
-
t
|
|
6597
|
+
label
|
|
6607
6598
|
} = props;
|
|
6608
6599
|
const newSchema = schema;
|
|
6609
6600
|
const enumData = (schema === null || schema === void 0 ? void 0 : schema.enum) || ((_a = newSchema === null || newSchema === void 0 ? void 0 : newSchema.items) === null || _a === void 0 ? void 0 : _a.enum) || [];
|
|
@@ -8529,7 +8520,8 @@ const FileUploader = _ref => {
|
|
|
8529
8520
|
const {
|
|
8530
8521
|
required,
|
|
8531
8522
|
label,
|
|
8532
|
-
i18nKeyPrefix
|
|
8523
|
+
i18nKeyPrefix,
|
|
8524
|
+
visible
|
|
8533
8525
|
} = props;
|
|
8534
8526
|
const propertyId = i18nKeyPrefix;
|
|
8535
8527
|
const variant = ((_d = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _d === void 0 ? void 0 : _d.variant) || 'button';
|
|
@@ -8647,45 +8639,48 @@ const FileUploader = _ref => {
|
|
|
8647
8639
|
})
|
|
8648
8640
|
});
|
|
8649
8641
|
};
|
|
8650
|
-
return
|
|
8651
|
-
|
|
8652
|
-
children:
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
children: sentenceCaseLabel
|
|
8658
|
-
}), !readOnly && jsx("div", {
|
|
8659
|
-
className: "file-upload",
|
|
8660
|
-
children: jsx(GoAFileUploadInput, {
|
|
8661
|
-
variant: variant,
|
|
8662
|
-
onSelectFile: uploadFile,
|
|
8663
|
-
maxFileSize: maxFileSize,
|
|
8664
|
-
accept: accept
|
|
8665
|
-
})
|
|
8666
|
-
}), helpText && jsx(HelpText, {
|
|
8667
|
-
children: helpText
|
|
8668
|
-
}), jsx("div", {
|
|
8669
|
-
children: loadingFileName !== undefined ? jsx(GoAModal, {
|
|
8670
|
-
open: loadingFileName !== undefined,
|
|
8671
|
-
children: jsx("div", {
|
|
8672
|
-
className: "align-center",
|
|
8673
|
-
children: jsx(GoACircularProgress, {
|
|
8674
|
-
visible: true,
|
|
8675
|
-
message: `Uploading ${loadingFileName}`,
|
|
8676
|
-
size: "large"
|
|
8677
|
-
})
|
|
8678
|
-
})
|
|
8642
|
+
return jsx(Visible, {
|
|
8643
|
+
visible: visible,
|
|
8644
|
+
children: jsxs(FileUploaderStyle, {
|
|
8645
|
+
className: "FileUploader",
|
|
8646
|
+
children: [required ? jsx(GoAFormItem, {
|
|
8647
|
+
label: sentenceCaseLabel,
|
|
8648
|
+
requirement: "required"
|
|
8679
8649
|
}) : jsx("div", {
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8650
|
+
className: "label",
|
|
8651
|
+
children: sentenceCaseLabel
|
|
8652
|
+
}), !readOnly && jsx("div", {
|
|
8653
|
+
className: "file-upload",
|
|
8654
|
+
children: jsx(GoAFileUploadInput, {
|
|
8655
|
+
variant: variant,
|
|
8656
|
+
onSelectFile: uploadFile,
|
|
8657
|
+
maxFileSize: maxFileSize,
|
|
8658
|
+
accept: accept
|
|
8686
8659
|
})
|
|
8687
|
-
})
|
|
8688
|
-
|
|
8660
|
+
}), helpText && jsx(HelpText, {
|
|
8661
|
+
children: helpText
|
|
8662
|
+
}), jsx("div", {
|
|
8663
|
+
children: loadingFileName !== undefined ? jsx(GoAModal, {
|
|
8664
|
+
open: loadingFileName !== undefined,
|
|
8665
|
+
children: jsx("div", {
|
|
8666
|
+
className: "align-center",
|
|
8667
|
+
children: jsx(GoACircularProgress, {
|
|
8668
|
+
visible: true,
|
|
8669
|
+
message: `Uploading ${loadingFileName}`,
|
|
8670
|
+
size: "large"
|
|
8671
|
+
})
|
|
8672
|
+
})
|
|
8673
|
+
}) : jsx("div", {
|
|
8674
|
+
children: multiFileUploader ? fileList && (fileList[props.i18nKeyPrefix] || []).map((_, index) => {
|
|
8675
|
+
return jsx(DownloadFileWidget, {
|
|
8676
|
+
index: index
|
|
8677
|
+
});
|
|
8678
|
+
}) : fileList && !deleteHide && getFile(fileListLength - 1) && fileListLength >= 0 && jsx(DownloadFileWidget, {
|
|
8679
|
+
index: fileListLength - 1
|
|
8680
|
+
})
|
|
8681
|
+
})
|
|
8682
|
+
})]
|
|
8683
|
+
})
|
|
8689
8684
|
});
|
|
8690
8685
|
};
|
|
8691
8686
|
const HelpText = styled.div(_t$3 || (_t$3 = _2`
|
|
@@ -10798,7 +10793,7 @@ const AddressLookUpControl = props => {
|
|
|
10798
10793
|
enabled,
|
|
10799
10794
|
handleChange,
|
|
10800
10795
|
uischema,
|
|
10801
|
-
|
|
10796
|
+
visible
|
|
10802
10797
|
} = props;
|
|
10803
10798
|
const isAlbertaAddress = ((_b = (_a = schema === null || schema === void 0 ? void 0 : schema.properties) === null || _a === void 0 ? void 0 : _a.subdivisionCode) === null || _b === void 0 ? void 0 : _b.const) === 'AB';
|
|
10804
10799
|
const formCtx = useContext(JsonFormContext);
|
|
@@ -10931,7 +10926,8 @@ const AddressLookUpControl = props => {
|
|
|
10931
10926
|
}
|
|
10932
10927
|
}, [activeIndex]);
|
|
10933
10928
|
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;
|
|
10934
|
-
return jsxs(
|
|
10929
|
+
return jsxs(Visible, {
|
|
10930
|
+
visible: visible,
|
|
10935
10931
|
children: [renderHelp(), jsx("h3", {
|
|
10936
10932
|
children: label
|
|
10937
10933
|
}), jsx(GoAFormItem, {
|
|
@@ -11333,7 +11329,8 @@ const FullNameControl = props => {
|
|
|
11333
11329
|
path,
|
|
11334
11330
|
schema,
|
|
11335
11331
|
handleChange,
|
|
11336
|
-
enabled
|
|
11332
|
+
enabled,
|
|
11333
|
+
visible
|
|
11337
11334
|
} = props;
|
|
11338
11335
|
const requiredFields = schema.required;
|
|
11339
11336
|
const defaultName = {};
|
|
@@ -11349,14 +11346,17 @@ const FullNameControl = props => {
|
|
|
11349
11346
|
setNameData(updatedName);
|
|
11350
11347
|
updateFormData(updatedName);
|
|
11351
11348
|
};
|
|
11352
|
-
return jsx(
|
|
11353
|
-
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11358
|
-
|
|
11359
|
-
|
|
11349
|
+
return jsx(Visible, {
|
|
11350
|
+
visible: visible,
|
|
11351
|
+
children: jsx(NameInputs, {
|
|
11352
|
+
firstName: nameData.firstName,
|
|
11353
|
+
middleName: nameData.middleName,
|
|
11354
|
+
lastName: nameData.lastName,
|
|
11355
|
+
handleInputChange: handleInputChange,
|
|
11356
|
+
data: data,
|
|
11357
|
+
disabled: !enabled,
|
|
11358
|
+
requiredFields: requiredFields
|
|
11359
|
+
})
|
|
11360
11360
|
});
|
|
11361
11361
|
};
|
|
11362
11362
|
|
|
@@ -11440,7 +11440,8 @@ const FullNameDobControl = props => {
|
|
|
11440
11440
|
path,
|
|
11441
11441
|
schema,
|
|
11442
11442
|
handleChange,
|
|
11443
|
-
enabled
|
|
11443
|
+
enabled,
|
|
11444
|
+
visible
|
|
11444
11445
|
} = props;
|
|
11445
11446
|
const requiredFields = schema.required;
|
|
11446
11447
|
const [errors, setErrors] = useState({});
|
|
@@ -11479,7 +11480,8 @@ const FullNameDobControl = props => {
|
|
|
11479
11480
|
setErrors(err);
|
|
11480
11481
|
};
|
|
11481
11482
|
useSyncAutofillFields(['firstName', 'middleName', 'lastName', 'dateOfBirth'], formData, updateFormData, handleRequiredFieldBlur);
|
|
11482
|
-
return jsxs(
|
|
11483
|
+
return jsxs(Visible, {
|
|
11484
|
+
visible: visible,
|
|
11483
11485
|
children: [jsxs(GoAGrid, {
|
|
11484
11486
|
minChildWidth: "0ch",
|
|
11485
11487
|
gap: "s",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.7",
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RankedTester, ControlProps } from '@jsonforms/core';
|
|
3
3
|
import { WithInputProps } from './type';
|
|
4
|
-
export declare const BooleanRadioComponent: ({ data,
|
|
4
|
+
export declare const BooleanRadioComponent: ({ data, enabled, uischema, handleChange, path, config, label, isVisited, errors, description, }: ControlProps & WithInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export declare const BooleanRadioControl: (props: ControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const GoABooleanRadioControlTester: RankedTester;
|
|
7
7
|
export declare const GoABooleanRadioControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
|