@abgov/jsonforms-components 1.44.5 → 1.45.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 +13 -10
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -6050,7 +6050,7 @@ const FileUploaderReview = props => {
|
|
|
6050
6050
|
}));
|
|
6051
6051
|
};
|
|
6052
6052
|
const FileUploader = _a => {
|
|
6053
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
6053
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
6054
6054
|
var {
|
|
6055
6055
|
data,
|
|
6056
6056
|
path,
|
|
@@ -6059,15 +6059,15 @@ const FileUploader = _a => {
|
|
|
6059
6059
|
} = _a,
|
|
6060
6060
|
props = __rest(_a, ["data", "path", "handleChange", "uischema"]);
|
|
6061
6061
|
const enumerators = useContext(JsonFormContext);
|
|
6062
|
-
const uploadTriggerFunction = enumerators.functions.get('upload-file');
|
|
6062
|
+
const uploadTriggerFunction = (_b = enumerators === null || enumerators === void 0 ? void 0 : enumerators.functions) === null || _b === void 0 ? void 0 : _b.get('upload-file');
|
|
6063
6063
|
const uploadTrigger = uploadTriggerFunction && uploadTriggerFunction();
|
|
6064
|
-
const downloadTriggerFunction = enumerators.functions.get('download-file');
|
|
6064
|
+
const downloadTriggerFunction = (_c = enumerators === null || enumerators === void 0 ? void 0 : enumerators.functions) === null || _c === void 0 ? void 0 : _c.get('download-file');
|
|
6065
6065
|
const downloadTrigger = downloadTriggerFunction && downloadTriggerFunction();
|
|
6066
|
-
const deleteTriggerFunction = enumerators.functions.get('delete-file');
|
|
6066
|
+
const deleteTriggerFunction = (_d = enumerators === null || enumerators === void 0 ? void 0 : enumerators.functions) === null || _d === void 0 ? void 0 : _d.get('delete-file');
|
|
6067
6067
|
const deleteTrigger = deleteTriggerFunction && deleteTriggerFunction();
|
|
6068
|
-
const fileListValue = enumerators.data.get('file-list');
|
|
6068
|
+
const fileListValue = enumerators === null || enumerators === void 0 ? void 0 : enumerators.data.get('file-list');
|
|
6069
6069
|
const countries = ['Argentina', 'Brazil', 'Canada', 'Denmark', 'Egypt', 'France', 'Greece', 'India', 'Japan', 'Kenya'];
|
|
6070
|
-
enumerators.addFormContextData('countries', countries);
|
|
6070
|
+
enumerators === null || enumerators === void 0 ? void 0 : enumerators.addFormContextData('countries', countries);
|
|
6071
6071
|
const user = enumerators === null || enumerators === void 0 ? void 0 : enumerators.getFormContextData('user');
|
|
6072
6072
|
// eslint-disable-next-line
|
|
6073
6073
|
const fileList = fileListValue && fileListValue();
|
|
@@ -6077,7 +6077,7 @@ const FileUploader = _a => {
|
|
|
6077
6077
|
i18nKeyPrefix
|
|
6078
6078
|
} = props;
|
|
6079
6079
|
const propertyId = i18nKeyPrefix;
|
|
6080
|
-
const variant = ((
|
|
6080
|
+
const variant = ((_e = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _e === void 0 ? void 0 : _e.variant) || 'button';
|
|
6081
6081
|
const [showFileDeleteConfirmation, setShowFileDeleteConfirmation] = useState(false);
|
|
6082
6082
|
function uploadFile(file) {
|
|
6083
6083
|
if (uploadTrigger) {
|
|
@@ -6117,9 +6117,12 @@ const FileUploader = _a => {
|
|
|
6117
6117
|
const timeoutId = setTimeout(delayedFunction, 1);
|
|
6118
6118
|
return () => clearTimeout(timeoutId);
|
|
6119
6119
|
}, [handleChange, fileList, propertyId]);
|
|
6120
|
-
const readOnly = ((
|
|
6121
|
-
const maxFileSize = (
|
|
6122
|
-
const accept = (
|
|
6120
|
+
const readOnly = ((_g = (_f = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _f === void 0 ? void 0 : _f.componentProps) === null || _g === void 0 ? void 0 : _g.readOnly) === true || (props === null || props === void 0 ? void 0 : props.isStepperReview) === true || user === null;
|
|
6121
|
+
const maxFileSize = (_k = (_j = (_h = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _h === void 0 ? void 0 : _h.componentProps) === null || _j === void 0 ? void 0 : _j.maxFileSize) !== null && _k !== void 0 ? _k : '';
|
|
6122
|
+
const accept = (_o = (_m = (_l = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _l === void 0 ? void 0 : _l.componentProps) === null || _m === void 0 ? void 0 : _m.accept) !== null && _o !== void 0 ? _o : '';
|
|
6123
|
+
if (!enumerators) {
|
|
6124
|
+
return jsx(Fragment, {});
|
|
6125
|
+
}
|
|
6123
6126
|
return jsxs(FileUploaderStyle, {
|
|
6124
6127
|
id: "file-upload",
|
|
6125
6128
|
className: "FileUploader",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.45.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",
|