@abgov/jsonforms-components 1.7.0 → 1.8.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 +11 -8
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -3819,7 +3819,7 @@ requiredFields) => elements.map((element, index) => {
|
|
|
3819
3819
|
const clonedElement = JSON.parse(JSON.stringify(element));
|
|
3820
3820
|
const lastSegment = (_a = clonedElement.scope) === null || _a === void 0 ? void 0 : _a.split('/').pop();
|
|
3821
3821
|
if (clonedElement.type === 'Control' && clonedElement.scope) {
|
|
3822
|
-
const label = resolveLabelFromScope(clonedElement.scope);
|
|
3822
|
+
const label = clonedElement.label ? clonedElement.label : resolveLabelFromScope(clonedElement.scope);
|
|
3823
3823
|
if (!label) return null;
|
|
3824
3824
|
const value = getFormFieldValue(clonedElement.scope, data ? data : {}).toString();
|
|
3825
3825
|
const asterisk = requiredFields.indexOf(lastSegment) !== -1 ? ' *' : '';
|
|
@@ -4216,9 +4216,12 @@ const FileUploader = _a => {
|
|
|
4216
4216
|
const [showFileDeleteConfirmation, setShowFileDeleteConfirmation] = useState(false);
|
|
4217
4217
|
function uploadFile(file) {
|
|
4218
4218
|
if (uploadTrigger) {
|
|
4219
|
-
const value = ['Loading', Array.isArray(data) ? data[1] : data, file === null || file === void 0 ? void 0 : file.name];
|
|
4220
|
-
handleChange(propertyId, value);
|
|
4221
4219
|
uploadTrigger(file, propertyId);
|
|
4220
|
+
const handleFunction = () => {
|
|
4221
|
+
const value = ['Loading', Array.isArray(data) ? data[1] : file === null || file === void 0 ? void 0 : file.name];
|
|
4222
|
+
handleChange(propertyId, value);
|
|
4223
|
+
};
|
|
4224
|
+
setTimeout(handleFunction, 1);
|
|
4222
4225
|
}
|
|
4223
4226
|
}
|
|
4224
4227
|
function downloadFile(file) {
|
|
@@ -4241,14 +4244,14 @@ const FileUploader = _a => {
|
|
|
4241
4244
|
// UseEffect is required because not having it causes a react update error, but
|
|
4242
4245
|
// it doesn't function correctly within jsonforms unless there is a minor delay here
|
|
4243
4246
|
const delayedFunction = () => {
|
|
4244
|
-
var _a
|
|
4245
|
-
if (fileList
|
|
4246
|
-
handleChange(propertyId, fileList && ((
|
|
4247
|
+
var _a;
|
|
4248
|
+
if (fileList) {
|
|
4249
|
+
handleChange(propertyId, fileList && ((_a = fileList[propertyId]) === null || _a === void 0 ? void 0 : _a.urn));
|
|
4247
4250
|
}
|
|
4248
4251
|
};
|
|
4249
4252
|
const timeoutId = setTimeout(delayedFunction, 1);
|
|
4250
4253
|
return () => clearTimeout(timeoutId);
|
|
4251
|
-
}, [
|
|
4254
|
+
}, [handleChange, fileList, propertyId]);
|
|
4252
4255
|
return jsxs(FileUploaderStyle, {
|
|
4253
4256
|
id: "file-upload",
|
|
4254
4257
|
className: "FileUploader",
|
|
@@ -4271,7 +4274,7 @@ const FileUploader = _a => {
|
|
|
4271
4274
|
className: "align-center",
|
|
4272
4275
|
children: jsx(GoACircularProgress, {
|
|
4273
4276
|
visible: true,
|
|
4274
|
-
message: `Uploading ${data[
|
|
4277
|
+
message: `Uploading ${data[1]}`,
|
|
4275
4278
|
size: "large"
|
|
4276
4279
|
})
|
|
4277
4280
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.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",
|