@wise/dynamic-flow-client 0.4.0 → 0.4.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/build/common/constants/DateMode.js +2 -2
- package/build/common/constants/FormControlType.js +2 -2
- package/build/common/constants/MonthFormat.js +2 -2
- package/build/common/constants/SchemaType.js +2 -2
- package/build/common/constants/Size.js +2 -2
- package/build/common/constants/index.js +1 -1
- package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +15 -27
- package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +11 -9
- package/build/common/contexts/eventsContext/EventsContext.js +11 -28
- package/build/common/contexts/fetcherContexts/FetcherContexts.js +14 -27
- package/build/common/contexts/index.js +1 -1
- package/build/common/contexts/logContext/LogContext.js +12 -30
- package/build/common/hooks/index.js +1 -1
- package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +3 -3
- package/build/common/hooks/useExternal/useExternal.js +8 -8
- package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +20 -31
- package/build/common/hooks/usePersistAsync/usePersistAsync.js +60 -139
- package/build/common/hooks/usePolling/usePolling.js +20 -21
- package/build/common/hooks/usePrevious/usePrevious.js +5 -5
- package/build/common/hooks/useStepPolling/useStepPolling.js +15 -14
- package/build/common/makeFetcher/index.js +1 -1
- package/build/common/makeFetcher/makeFetcher.js +10 -24
- package/build/common/messages.js +5 -5
- package/build/common/utils/api-utils.js +3 -4
- package/build/common/utils/date-utils.js +11 -11
- package/build/common/utils/debounce.js +11 -15
- package/build/common/utils/file-utils.js +12 -25
- package/build/common/utils/id-utils.js +4 -5
- package/build/common/utils/index.js +1 -1
- package/build/common/utils/is-equal.js +8 -8
- package/build/common/utils/schema-utils.js +6 -6
- package/build/common/utils/step-utils.js +14 -14
- package/build/common/validators/index.js +7 -7
- package/build/common/validators/models/model-validators.js +8 -8
- package/build/common/validators/models/models.utils.js +29 -42
- package/build/common/validators/schemas/schema-validators.js +11 -13
- package/build/common/validators/types/type-validators.js +9 -13
- package/build/common/validators/validationFailures/validation-failures.js +14 -14
- package/build/common/validators/validationFailures/validation-failures.utils.js +5 -7
- package/build/common/validators/values/value-validators.js +4 -6
- package/build/dynamicFlow/DynamicFlow.js +185 -307
- package/build/dynamicFlow/DynamicFlowStep.js +12 -23
- package/build/dynamicFlow/DynamicFlowTypes.js +1 -1
- package/build/dynamicFlow/index.js +6 -14
- package/build/dynamicFlow/stories/DynamicFlow.story.js +20 -20
- package/build/dynamicFlow/stories/EditableDynamicFlow.js +20 -33
- package/build/dynamicFlow/stories/fixtureFetcher.js +46 -104
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +22 -40
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +6 -6
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +10 -11
- package/build/dynamicFlow/utils/index.js +5 -2
- package/build/dynamicFlow/utils/responseParsers/response-parsers.js +53 -118
- package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +9 -9
- package/build/dynamicFlow/utils/useDynamicFlowState.js +51 -74
- package/build/dynamicFlow/utils/useLoader.js +9 -20
- package/build/fixtures/components/alert.js +8 -8
- package/build/fixtures/components/box.js +7 -7
- package/build/fixtures/components/button.js +25 -36
- package/build/fixtures/components/columns.js +10 -10
- package/build/fixtures/components/copyable.js +6 -6
- package/build/fixtures/components/decision.js +15 -15
- package/build/fixtures/components/heading.js +7 -7
- package/build/fixtures/components/image.js +10 -10
- package/build/fixtures/components/index.js +17 -25
- package/build/fixtures/components/info.js +22 -6
- package/build/fixtures/components/list.js +8 -8
- package/build/fixtures/components/loading-indicator.js +5 -5
- package/build/fixtures/components/paragraph.js +9 -9
- package/build/fixtures/components/review.js +11 -11
- package/build/fixtures/examples/camera-capture.js +29 -29
- package/build/fixtures/examples/index.js +9 -17
- package/build/fixtures/examples/recipient-update.js +69 -69
- package/build/fixtures/examples/recipient.js +63 -63
- package/build/fixtures/examples/single-file-upload.js +21 -21
- package/build/fixtures/examples/step-validation-errors.js +21 -21
- package/build/fixtures/features/action-response.js +8 -8
- package/build/fixtures/features/external.js +8 -8
- package/build/fixtures/features/index.js +9 -17
- package/build/fixtures/features/persist-async.js +11 -11
- package/build/fixtures/features/polling.js +9 -9
- package/build/fixtures/features/validation-async.js +10 -10
- package/build/fixtures/index.js +11 -22
- package/build/fixtures/jsonSchemaForm/allOf.js +30 -30
- package/build/fixtures/jsonSchemaForm/audRecipient.js +271 -271
- package/build/fixtures/jsonSchemaForm/currency.js +12 -12
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +11 -11
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +11 -11
- package/build/fixtures/jsonSchemaForm/oneOf.js +27 -27
- package/build/fixtures/jsonSchemaForm/oneOfTabs.js +16 -16
- package/build/fixtures/jsonSchemaForm/promotedOneOf.js +17 -17
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +30 -30
- package/build/fixtures/jsonSchemaForm/simple.js +16 -16
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +19 -19
- package/build/fixtures/jsonSchemaForm/validationAsync.js +8 -8
- package/build/fixtures/layouts/all.js +37 -37
- package/build/fixtures/layouts/final-step-layout.js +9 -9
- package/build/fixtures/layouts/index.js +10 -18
- package/build/fixtures/layouts/list.js +10 -10
- package/build/fixtures/layouts/pay-in.js +23 -23
- package/build/fixtures/layouts/review.js +38 -38
- package/build/fixtures/layouts/success.js +15 -15
- package/build/fixtures/responses/action-response-final.js +8 -8
- package/build/fixtures/responses/action.js +3 -3
- package/build/fixtures/responses/exit.js +3 -3
- package/build/fixtures/responses/index.js +8 -16
- package/build/fixtures/responses/recipient-update-final.js +8 -8
- package/build/fixtures/schemas/basic-form.js +11 -11
- package/build/fixtures/schemas/index.js +8 -16
- package/build/fixtures/schemas/number-and-integer.js +11 -11
- package/build/fixtures/schemas/one-of.js +43 -46
- package/build/fixtures/schemas/string-formats.js +15 -15
- package/build/fixtures/utils/image-util.js +8 -8
- package/build/formControl/FormControl.js +118 -148
- package/build/formControl/index.js +6 -14
- package/build/formControl/utils/index.js +1 -1
- package/build/formControl/utils/value-utils.js +18 -23
- package/build/i18n/index.js +31 -31
- package/build/index.js +13 -10
- package/build/jsonSchemaForm/JsonSchemaForm.js +12 -24
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +24 -37
- package/build/jsonSchemaForm/allOfSchema/index.js +6 -14
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +9 -20
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +9 -20
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +6 -14
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +56 -115
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +7 -7
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +6 -14
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +1 -1
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +19 -71
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +10 -11
- package/build/jsonSchemaForm/arrayTypeSchema/index.js +6 -14
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +45 -62
- package/build/jsonSchemaForm/basicTypeSchema/index.js +6 -14
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +39 -50
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +18 -18
- package/build/jsonSchemaForm/controlFeedback/index.js +6 -14
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js +52 -61
- package/build/jsonSchemaForm/genericSchema/index.js +6 -14
- package/build/jsonSchemaForm/help/Help.js +9 -9
- package/build/jsonSchemaForm/help/Help.messages.js +5 -5
- package/build/jsonSchemaForm/help/index.js +6 -14
- package/build/jsonSchemaForm/index.js +6 -14
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +28 -49
- package/build/jsonSchemaForm/objectSchema/index.js +6 -14
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +54 -74
- package/build/jsonSchemaForm/oneOfSchema/index.js +6 -14
- package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +3 -3
- package/build/jsonSchemaForm/oneOfSchema/utils/index.js +1 -1
- package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +19 -20
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +11 -22
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +5 -5
- package/build/jsonSchemaForm/persistAsyncSchema/index.js +6 -14
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +73 -127
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +6 -14
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +45 -110
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +17 -17
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +6 -14
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +28 -47
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js +6 -14
- package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +4 -4
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +13 -24
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +11 -22
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +12 -23
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +24 -26
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +6 -6
- package/build/jsonSchemaForm/readOnlySchema/index.js +6 -14
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +26 -39
- package/build/jsonSchemaForm/schemaFormControl/index.js +6 -14
- package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +5 -5
- package/build/jsonSchemaForm/schemaFormControl/utils/index.js +1 -1
- package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +30 -47
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +57 -119
- package/build/jsonSchemaForm/validationAsyncSchema/index.js +6 -14
- package/build/layout/DynamicLayout.js +10 -21
- package/build/layout/alert/DynamicAlert.js +9 -9
- package/build/layout/box/DynamicBox.js +12 -23
- package/build/layout/button/DynamicButton.js +16 -27
- package/build/layout/columns/DynamicColumns.js +13 -24
- package/build/layout/decision/DynamicDecision.js +16 -27
- package/build/layout/divider/DynamicDivider.js +7 -8
- package/build/layout/external/DynamicExternal.js +16 -28
- package/build/layout/external/DynamicExternal.messages.js +5 -5
- package/build/layout/form/DynamicForm.js +10 -21
- package/build/layout/heading/DynamicHeading.js +12 -23
- package/build/layout/icon/DynamicIcon.js +9 -10
- package/build/layout/image/DynamicImage.js +43 -93
- package/build/layout/index.js +21 -29
- package/build/layout/info/DynamicInfo.js +7 -19
- package/build/layout/list/DynamicList.js +14 -26
- package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +8 -9
- package/build/layout/paragraph/DynamicParagraph.js +19 -37
- package/build/layout/paragraph/DynamicParagraph.messages.js +6 -6
- package/build/layout/paragraph/useSnackBarIfAvailable.js +4 -4
- package/build/layout/review/DynamicReview.js +14 -26
- package/build/layout/utils.js +4 -6
- package/build/step/cameraStep/CameraStep.js +42 -88
- package/build/step/cameraStep/cameraCapture/CameraCapture.js +48 -105
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +7 -7
- package/build/step/cameraStep/cameraCapture/components/index.js +10 -28
- package/build/step/cameraStep/cameraCapture/hooks/index.js +17 -72
- package/build/step/cameraStep/cameraCapture/index.js +6 -14
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +33 -45
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +8 -19
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +6 -6
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +9 -21
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +7 -7
- package/build/step/cameraStep/cameraCapture/screens/index.js +6 -14
- package/build/step/cameraStep/cameraCapture/tracking/index.js +17 -99
- package/build/step/cameraStep/cameraCapture/utils/index.js +33 -96
- package/build/step/cameraStep/index.js +6 -14
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +20 -21
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +8 -8
- package/build/step/externalConfirmationStep/index.js +6 -14
- package/build/step/index.js +7 -15
- package/build/step/layoutStep/LayoutStep.js +19 -19
- package/build/step/layoutStep/index.js +6 -14
- package/build/step/layoutStep/utils/index.js +3 -14
- package/build/step/layoutStep/utils/inline-reference-utils.js +29 -46
- package/build/step/layoutStep/utils/layout-utils.js +34 -53
- package/build/types/common/FormControl.js +1 -1
- package/build/types/index.js +13 -13
- package/build/types/specification/Action.js +1 -1
- package/build/types/specification/FileUploadSchema.js +1 -1
- package/build/types/specification/LayoutComponent.js +1 -1
- package/build/types/specification/Model.js +9 -17
- package/build/types/specification/PersistAsync.js +1 -1
- package/build/types/specification/Polling.js +1 -1
- package/build/types/specification/Promotion.js +1 -1
- package/build/types/specification/Schema.js +8 -8
- package/build/types/specification/Step.js +3 -5
- package/build/types/specification/ValidationAsync.js +1 -1
- package/build/types/specification/core.js +1 -1
- package/package.json +1 -1
|
@@ -1,34 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
|
-
exports
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const contexts_1 = require("../common/contexts");
|
|
8
|
+
const genericSchema_1 = __importDefault(require("./genericSchema"));
|
|
9
|
+
const JsonSchemaForm = (props) => {
|
|
10
|
+
const schemaProps = Object.assign({ model: null, errors: null, disabled: false, baseUrl: '' }, props);
|
|
22
11
|
if ((0, contexts_1.useHasFetcherProvider)() || schemaProps.baseUrl == null) {
|
|
23
|
-
return (0, jsx_runtime_1.jsx)(genericSchema_1
|
|
12
|
+
return (0, jsx_runtime_1.jsx)(genericSchema_1.default, Object.assign({}, schemaProps));
|
|
24
13
|
}
|
|
25
|
-
return ((0, jsx_runtime_1.jsx)(Providers,
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(Providers, Object.assign({ baseUrl: schemaProps.baseUrl, onEvent: schemaProps.onEvent, onLog: schemaProps.onLog }, { children: (0, jsx_runtime_1.jsx)(genericSchema_1.default, Object.assign({}, schemaProps)) })));
|
|
26
15
|
};
|
|
27
|
-
exports
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return ((0, jsx_runtime_1.jsx)(contexts_1.LogProvider, __assign({ flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog: onLog !== null && onLog !== void 0 ? onLog : noop }, { children: (0, jsx_runtime_1.jsx)(contexts_1.EventsContextProvider, __assign({ metadata: { flowId: 'JsonSchemaForm', stepId: 'JsonSchemaForm' }, onEvent: onEvent !== null && onEvent !== void 0 ? onEvent : noop }, { children: (0, jsx_runtime_1.jsx)(contexts_1.FetcherProviderFromBaseUrl, __assign({ baseUrl: baseUrl }, { children: children })) })) })));
|
|
16
|
+
exports.default = JsonSchemaForm;
|
|
17
|
+
const Providers = ({ baseUrl, onEvent, onLog, children }) => {
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(contexts_1.LogProvider, Object.assign({ flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog: onLog !== null && onLog !== void 0 ? onLog : noop }, { children: (0, jsx_runtime_1.jsx)(contexts_1.EventsContextProvider, Object.assign({ metadata: { flowId: 'JsonSchemaForm', stepId: 'JsonSchemaForm' }, onEvent: onEvent !== null && onEvent !== void 0 ? onEvent : noop }, { children: (0, jsx_runtime_1.jsx)(contexts_1.FetcherProviderFromBaseUrl, Object.assign({ baseUrl: baseUrl }, { children: children })) })) })));
|
|
31
19
|
};
|
|
32
|
-
|
|
20
|
+
const noop = () => {
|
|
33
21
|
// noop
|
|
34
22
|
};
|
|
@@ -1,59 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
|
-
exports
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const validators_1 = require("../../common/validators");
|
|
10
|
+
const genericSchema_1 = __importDefault(require("../genericSchema"));
|
|
11
|
+
const splitModel = (model, schemas) => {
|
|
23
12
|
// If wew receive a model, break it down to parts valid for each schema
|
|
24
|
-
return schemas.map(
|
|
13
|
+
return schemas.map((schema) => (0, validators_1.getValidObjectModelParts)(model, schema) || {});
|
|
25
14
|
};
|
|
26
|
-
|
|
27
|
-
return models.reduce(
|
|
28
|
-
return
|
|
15
|
+
const combineModels = (models) => {
|
|
16
|
+
return models.reduce((current, combined) => {
|
|
17
|
+
return Object.assign(Object.assign({}, combined), current);
|
|
29
18
|
}, {});
|
|
30
19
|
};
|
|
31
|
-
|
|
20
|
+
const getSchemaColumnClasses = (width) => {
|
|
32
21
|
return {
|
|
33
22
|
'col-xs-12': true,
|
|
34
23
|
'col-sm-6': width === 'md',
|
|
35
|
-
'col-sm-4': width === 'sm'
|
|
24
|
+
'col-sm-4': width === 'sm',
|
|
36
25
|
};
|
|
37
26
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
const AllOfSchema = (props) => {
|
|
28
|
+
const onChangeModelIndex = (index, onChangeProps) => {
|
|
29
|
+
const modelSchema = props.schema.allOf[index];
|
|
41
30
|
// FIXME we should not mutate models here
|
|
42
31
|
// eslint-disable-next-line fp/no-mutation
|
|
43
32
|
models[index] = (0, validators_1.getValidObjectModelParts)(onChangeProps.model, modelSchema) || {};
|
|
44
33
|
setModels(models);
|
|
45
|
-
props.onChange(
|
|
34
|
+
props.onChange(Object.assign(Object.assign({}, onChangeProps), { model: combineModels(models) }));
|
|
46
35
|
};
|
|
47
|
-
|
|
48
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.schema.title && (0, jsx_runtime_1.jsx)("h3",
|
|
36
|
+
const [models, setModels] = (0, react_1.useState)(splitModel(props.model, props.schema.allOf));
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.schema.title && (0, jsx_runtime_1.jsx)("h3", Object.assign({ className: "page-header" }, { children: props.schema.title })), props.schema.description && (0, jsx_runtime_1.jsx)("p", { children: props.schema.description }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "row" }, { children: props.schema.allOf.map((schema, index) => (
|
|
49
38
|
// eslint-disable-next-line react/no-array-index-key
|
|
50
|
-
(0, jsx_runtime_1.jsx)("div",
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
model: onChangeProps.model }));
|
|
54
|
-
}, onPersistAsync: props.onPersistAsync }) }), index)); }) }))] }));
|
|
39
|
+
(0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)(getSchemaColumnClasses(schema.width)) }, { children: (0, jsx_runtime_1.jsx)(genericSchema_1.default, { schema: schema, model: models[index], errors: props.errors, submitted: props.submitted, disabled: props.disabled, onChange: (onChangeProps) => onChangeModelIndex(index, Object.assign(Object.assign({}, onChangeProps), {
|
|
40
|
+
// We can safely assume that the model here is going to be of the same type as the model prop
|
|
41
|
+
model: onChangeProps.model })), onPersistAsync: props.onPersistAsync }) }), index))) }))] }));
|
|
55
42
|
};
|
|
56
43
|
AllOfSchema.defaultProps = {
|
|
57
|
-
disabled: false
|
|
44
|
+
disabled: false,
|
|
58
45
|
};
|
|
59
|
-
exports
|
|
46
|
+
exports.default = AllOfSchema;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
exports.__esModule = true;
|
|
14
|
-
exports["default"] = void 0;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
15
7
|
var AllOfSchema_1 = require("./AllOfSchema");
|
|
16
|
-
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(AllOfSchema_1).default; } });
|
|
@@ -1,30 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
|
-
exports
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const types_1 = require("../../types");
|
|
8
|
+
const ArrayListSchema_1 = __importDefault(require("./arrayListSchema/ArrayListSchema"));
|
|
9
|
+
const ArraySchema = (props) => {
|
|
10
|
+
const { schema } = props;
|
|
22
11
|
if ((0, types_1.isListArraySchema)(schema)) {
|
|
23
|
-
return (0, jsx_runtime_1.jsx)(ArrayListSchema_1
|
|
12
|
+
return (0, jsx_runtime_1.jsx)(ArrayListSchema_1.default, Object.assign({}, props));
|
|
24
13
|
}
|
|
25
14
|
throw new Error('Not implemented'); // Tuple not implemented
|
|
26
15
|
};
|
|
27
16
|
ArraySchema.defaultProps = {
|
|
28
|
-
required: false
|
|
17
|
+
required: false,
|
|
29
18
|
};
|
|
30
|
-
exports
|
|
19
|
+
exports.default = ArraySchema;
|
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
|
-
exports
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const Schema_1 = require("../../../types/specification/Schema");
|
|
8
|
+
const multipleFileUploadSchema_1 = __importDefault(require("./multipleFileUploadSchema"));
|
|
9
|
+
const ArrayListSchema = (props) => {
|
|
10
|
+
const { schema } = props;
|
|
22
11
|
if ((0, Schema_1.isMultipleFileUploadSchema)(schema)) {
|
|
23
|
-
return (0, jsx_runtime_1.jsx)(multipleFileUploadSchema_1
|
|
12
|
+
return (0, jsx_runtime_1.jsx)(multipleFileUploadSchema_1.default, Object.assign({}, props, { schema: schema }));
|
|
24
13
|
}
|
|
25
14
|
throw new Error('Not implemented');
|
|
26
15
|
};
|
|
27
16
|
ArrayListSchema.defaultProps = {
|
|
28
17
|
errors: null,
|
|
29
|
-
required: false
|
|
18
|
+
required: false,
|
|
30
19
|
};
|
|
31
|
-
exports
|
|
20
|
+
exports.default = ArrayListSchema;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
exports.__esModule = true;
|
|
14
|
-
exports["default"] = void 0;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
15
7
|
var ArrayListSchema_1 = require("./ArrayListSchema");
|
|
16
|
-
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(ArrayListSchema_1).default; } });
|
|
@@ -1,145 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
4
|
};
|
|
52
|
-
exports
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const components_1 = require("@transferwise/components");
|
|
8
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const contexts_1 = require("../../../../common/contexts");
|
|
11
|
+
const hooks_1 = require("../../../../common/hooks");
|
|
12
|
+
const utils_1 = require("../../../../common/utils");
|
|
13
|
+
const validators_1 = require("../../../../common/validators");
|
|
14
|
+
const types_1 = require("../../../../types");
|
|
15
|
+
const controlFeedback_1 = __importDefault(require("../../../controlFeedback"));
|
|
16
|
+
const utils_2 = require("./utils");
|
|
17
|
+
const useFormattedDefaultErrorMessages_1 = require("./utils/useFormattedDefaultErrorMessages");
|
|
18
|
+
const MultipleFileUploadSchema = (props) => {
|
|
66
19
|
var _a, _b;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
case 3:
|
|
91
|
-
response = _a.sent();
|
|
92
|
-
onEvent('Dynamic Flow - PersistAsync', { status: 'success', schemaId: schema.$id });
|
|
93
|
-
return [2 /*return*/, (0, utils_2.constructUploadResponse)(response)];
|
|
94
|
-
case 4:
|
|
95
|
-
error_1 = _a.sent();
|
|
96
|
-
onEvent('Dynamic Flow - PersistAsync', { status: 'failure', schemaId: schema.$id });
|
|
97
|
-
return [2 /*return*/, Promise.reject((0, utils_2.constructUploadError)(error_1))];
|
|
98
|
-
case 5: return [2 /*return*/];
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
}); };
|
|
20
|
+
const { onChange, schema } = props;
|
|
21
|
+
const onEvent = (0, contexts_1.useEventDispatcher)();
|
|
22
|
+
const defaultErrorMessages = (0, useFormattedDefaultErrorMessages_1.useFormattedDefaultErrorMessages)(schema);
|
|
23
|
+
const uid = (0, react_1.useMemo)(() => schema.$id || (0, utils_1.generateRandomId)(), [schema.$id]);
|
|
24
|
+
const [inputChanged, setInputChanged] = (0, react_1.useState)(false);
|
|
25
|
+
const [files, setFiles] = (0, react_1.useState)(() => convertFileIdsToComponentFileObjects(props.model || []));
|
|
26
|
+
const performPersistAsync = (0, hooks_1.usePersistAsync)(schema.items.persistAsync);
|
|
27
|
+
const fileSchemaDescriptor = schema.items.persistAsync.schema;
|
|
28
|
+
const isBlob = (0, types_1.isBlobSchema)(fileSchemaDescriptor);
|
|
29
|
+
const uploadFile = async (userUploadedFile) => {
|
|
30
|
+
setInputChanged(true);
|
|
31
|
+
try {
|
|
32
|
+
const payload = await (0, utils_2.createPayload)(userUploadedFile, isBlob);
|
|
33
|
+
onEvent('Dynamic Flow - PersistAsync', { status: 'pending', schemaId: schema.$id });
|
|
34
|
+
const response = await performPersistAsync(payload);
|
|
35
|
+
onEvent('Dynamic Flow - PersistAsync', { status: 'success', schemaId: schema.$id });
|
|
36
|
+
return (0, utils_2.constructUploadResponse)(response);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
onEvent('Dynamic Flow - PersistAsync', { status: 'failure', schemaId: schema.$id });
|
|
40
|
+
return Promise.reject((0, utils_2.constructUploadError)(error));
|
|
41
|
+
}
|
|
42
|
+
};
|
|
102
43
|
function onFilesChange(newFiles) {
|
|
103
44
|
if ((0, utils_1.areFilesSame)(newFiles, files)) {
|
|
104
45
|
return;
|
|
105
46
|
}
|
|
106
47
|
setFiles(newFiles);
|
|
107
|
-
|
|
108
|
-
|
|
48
|
+
const validFiles = getSuccessfullyProcessedFiles(newFiles);
|
|
49
|
+
const data = validFiles.map((file) => file.id);
|
|
109
50
|
onChange({
|
|
110
51
|
model: data,
|
|
111
52
|
triggerSchema: schema,
|
|
112
|
-
triggerModel: data
|
|
53
|
+
triggerModel: data,
|
|
113
54
|
});
|
|
114
55
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
56
|
+
const validFiles = getSuccessfullyProcessedFiles(files);
|
|
57
|
+
const fileIds = validFiles.map((file) => file.id);
|
|
58
|
+
const fileListValidationFailures = (0, validators_1.getArrayValidationFailures)(fileIds, schema, props.required);
|
|
59
|
+
const showError = Boolean(props.errors) ||
|
|
119
60
|
((inputChanged || props.submitted) && Boolean(fileListValidationFailures.length));
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
defaultErrorMessages.maxFileSizeErrorMessage, maxFiles: props.schema.maxItems, maxFilesErrorMessage: ((_b = props.schema.validationMessages) === null || _b === void 0 ? void 0 : _b.maxItems) || defaultErrorMessages.maxItemsErrorMessage, uploadButtonTitle: fileSchemaDescriptor.title, description: fileSchemaDescriptor.description, disabled: props.disabled, onUploadFile:
|
|
124
|
-
return ((0, jsx_runtime_1.jsxs)("div",
|
|
61
|
+
const accepts = 'accepts' in fileSchemaDescriptor && fileSchemaDescriptor.accepts;
|
|
62
|
+
const maxSize = 'maxSize' in fileSchemaDescriptor && fileSchemaDescriptor.maxSize;
|
|
63
|
+
const uploadInputProps = Object.assign(Object.assign(Object.assign({ multiple: true, className: 'form-control', files, fileInputName: uid, id: uid }, (accepts ? { fileTypes: accepts } : undefined)), (maxSize ? { sizeLimit: (0, utils_1.toKilobytes)(maxSize) } : undefined)), { sizeLimitErrorMessage: ((_a = fileSchemaDescriptor.validationMessages) === null || _a === void 0 ? void 0 : _a.maxSize) ||
|
|
64
|
+
defaultErrorMessages.maxFileSizeErrorMessage, maxFiles: props.schema.maxItems, maxFilesErrorMessage: ((_b = props.schema.validationMessages) === null || _b === void 0 ? void 0 : _b.maxItems) || defaultErrorMessages.maxItemsErrorMessage, uploadButtonTitle: fileSchemaDescriptor.title, description: fileSchemaDescriptor.description, disabled: props.disabled, onUploadFile: (formData) => uploadFile(formData.get(uid)), onFilesChange, onDeleteFile: () => Promise.resolve() });
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)('form-group', { 'has-error': showError }) }, { children: [(0, jsx_runtime_1.jsx)("label", Object.assign({ className: "d-block control-label", htmlFor: uid }, { children: props.schema.title })), (0, jsx_runtime_1.jsx)(components_1.UploadInput, Object.assign({}, uploadInputProps)), (0, jsx_runtime_1.jsx)(controlFeedback_1.default, { changed: inputChanged, submitted: props.submitted, errors: props.errors, schema: props.schema, validations: fileListValidationFailures, validationMessages: getValidationMessages(schema, Boolean(props.required), defaultErrorMessages), infoMessage: null, focused: false, blurred: true })] })));
|
|
125
66
|
};
|
|
126
67
|
MultipleFileUploadSchema.defaultProps = {
|
|
127
68
|
errors: null,
|
|
128
|
-
required: false
|
|
69
|
+
required: false,
|
|
129
70
|
};
|
|
130
|
-
exports
|
|
71
|
+
exports.default = MultipleFileUploadSchema;
|
|
131
72
|
function getSuccessfullyProcessedFiles(allFiles) {
|
|
132
|
-
return allFiles.filter(
|
|
73
|
+
return allFiles.filter((file) => !file.error && file.status === 'succeeded');
|
|
133
74
|
}
|
|
134
75
|
function convertFileIdsToComponentFileObjects(fileIds) {
|
|
135
76
|
return fileIds
|
|
136
|
-
.map(
|
|
137
|
-
.filter(
|
|
77
|
+
.map((id) => (isValidId(id) ? { id, status: components_1.Status.SUCCEEDED } : null))
|
|
78
|
+
.filter((item) => item !== null);
|
|
138
79
|
}
|
|
139
80
|
function isValidId(id) {
|
|
140
81
|
return (0, validators_1.isNumber)(id) || (0, validators_1.isString)(id);
|
|
141
82
|
}
|
|
142
83
|
function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
143
|
-
|
|
144
|
-
return
|
|
84
|
+
const { minItems, maxItems } = schema;
|
|
85
|
+
return Object.assign(Object.assign(Object.assign({}, (required && { required: defaultErrorMessages.requiredMessage })), (minItems && { minItems: defaultErrorMessages.minItemsErrorMessage })), (maxItems && { maxItems: defaultErrorMessages.maxItemsErrorMessage }));
|
|
145
86
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_intl_1 = require("react-intl");
|
|
4
|
+
exports.default = (0, react_intl_1.defineMessages)({
|
|
5
5
|
minItemsError: {
|
|
6
6
|
id: 'dynamicFlows.MultipleFileUploadSchema.minItemsError',
|
|
7
7
|
defaultMessage: 'Please upload at least {minItems} file(s).',
|
|
8
|
-
description: 'Customer has uploaded not enough files. To fix: upload more files.'
|
|
8
|
+
description: 'Customer has uploaded not enough files. To fix: upload more files.',
|
|
9
9
|
},
|
|
10
10
|
maxItemsError: {
|
|
11
11
|
id: 'dynamicFlows.MultipleFileUploadSchema.maxItemsError',
|
|
12
12
|
defaultMessage: 'Please upload {maxItems} or fewer files.',
|
|
13
|
-
description: 'Customer has uploaded too many files. To fix: upload fewer files.'
|
|
13
|
+
description: 'Customer has uploaded too many files. To fix: upload fewer files.',
|
|
14
14
|
},
|
|
15
15
|
maxFileSizeError: {
|
|
16
16
|
id: 'dynamicFlows.MultipleFileUploadSchema.maxFileSizeError',
|
|
17
17
|
defaultMessage: 'Sorry, that file is too big. Please upload a smaller file.',
|
|
18
|
-
description: "Customer has uploaded a file that's too big. To fix: upload a smaller file."
|
|
19
|
-
}
|
|
18
|
+
description: "Customer has uploaded a file that's too big. To fix: upload a smaller file.",
|
|
19
|
+
},
|
|
20
20
|
});
|
package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
exports.__esModule = true;
|
|
14
|
-
exports["default"] = void 0;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
15
7
|
var MultipleFileUploadSchema_1 = require("./MultipleFileUploadSchema");
|
|
16
|
-
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(MultipleFileUploadSchema_1).default; } });
|
package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js
CHANGED
|
@@ -13,6 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
-
exports
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./upload-utils"), exports);
|
|
18
18
|
__exportStar(require("./useFormattedDefaultErrorMessages"), exports);
|