@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,40 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
exports.__esModule = true;
|
|
14
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
-
var components_1 = require("@transferwise/components");
|
|
16
|
-
var __1 = require("..");
|
|
17
|
-
var utils_1 = require("../utils");
|
|
18
|
-
var getMedia = function (option) {
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const components_1 = require("@transferwise/components");
|
|
5
|
+
const __1 = require("..");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
const getMedia = (option) => {
|
|
19
8
|
var _a, _b, _c;
|
|
20
9
|
if ((_a = option.icon) === null || _a === void 0 ? void 0 : _a.name) {
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(components_1.Avatar,
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Avatar, Object.assign({ type: components_1.AvatarType.ICON }, { children: (0, jsx_runtime_1.jsx)(__1.DynamicIcon, { type: option.icon.name }) })));
|
|
22
11
|
}
|
|
23
12
|
if ((_b = option.icon) === null || _b === void 0 ? void 0 : _b.text) {
|
|
24
|
-
return (0, jsx_runtime_1.jsx)(components_1.Avatar,
|
|
13
|
+
return (0, jsx_runtime_1.jsx)(components_1.Avatar, Object.assign({ type: components_1.AvatarType.INITIALS }, { children: option.icon.text }));
|
|
25
14
|
}
|
|
26
15
|
if ((_c = option.image) === null || _c === void 0 ? void 0 : _c.url) {
|
|
27
|
-
|
|
16
|
+
const { url, text } = option.image;
|
|
28
17
|
return (0, jsx_runtime_1.jsx)("img", { src: url, alt: text });
|
|
29
18
|
}
|
|
30
19
|
return undefined;
|
|
31
20
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return ((0, jsx_runtime_1.jsx)(components_1.NavigationOption, { title: option.title, content: option.description, disabled: option.disabled, media: media, showMediaCircle: false, showMediaAtAllSizes: true, onClick:
|
|
21
|
+
const DynamicDecision = (props) => {
|
|
22
|
+
const decision = props.component;
|
|
23
|
+
const renderDecisionOption = (option, onAction) => {
|
|
24
|
+
const media = getMedia(option);
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(components_1.NavigationOption, { title: option.title, content: option.description, disabled: option.disabled, media: media, showMediaCircle: false, showMediaAtAllSizes: true, onClick: () => onAction(option.action) }, JSON.stringify(option)));
|
|
37
26
|
};
|
|
38
|
-
return ((0, jsx_runtime_1.jsx)("div",
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, utils_1.getMarginBottom)(decision.margin) }, { children: (0, jsx_runtime_1.jsx)(components_1.NavigationOptionsList, { children: decision.options.map((option) => renderDecisionOption(option, props.onAction)) }) })));
|
|
39
28
|
};
|
|
40
|
-
exports
|
|
29
|
+
exports.default = DynamicDecision;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var className = "m-t-0 ".concat(margin);
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const DynamicDivider = ({ component }) => {
|
|
6
|
+
const margin = (0, utils_1.getMarginBottom)(component.margin);
|
|
7
|
+
const className = `m-t-0 ${margin}`;
|
|
9
8
|
return (0, jsx_runtime_1.jsx)("hr", { className: className });
|
|
10
9
|
};
|
|
11
|
-
exports
|
|
10
|
+
exports.default = DynamicDivider;
|
|
@@ -1,37 +1,25 @@
|
|
|
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 components_1 = require("@transferwise/components");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const react_intl_1 = require("react-intl");
|
|
10
|
+
const hooks_1 = require("../../common/hooks");
|
|
11
|
+
const DynamicExternal_messages_1 = __importDefault(require("./DynamicExternal.messages"));
|
|
23
12
|
/** @deprecated - No longer supported, use the external feature instead */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
(0, react_1.useEffect)(function () {
|
|
13
|
+
const DynamicExternal = ({ component, onAction }) => {
|
|
14
|
+
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
15
|
+
const intl = (0, react_intl_1.useIntl)();
|
|
16
|
+
const openExternalUrl = (0, react_1.useCallback)(() => window.open(requestUrl, 'df-external-window'), [requestUrl]);
|
|
17
|
+
(0, react_1.useEffect)(() => {
|
|
30
18
|
openExternalUrl();
|
|
31
19
|
}, [openExternalUrl]);
|
|
32
|
-
|
|
33
|
-
?
|
|
20
|
+
const pollingConfiguration = polling && responseHandlers
|
|
21
|
+
? Object.assign(Object.assign({}, polling), { responseHandlers }) : undefined;
|
|
34
22
|
(0, hooks_1.useExternalStepPolling)(pollingConfiguration, onAction);
|
|
35
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Loader, { size: components_1.Size.LARGE, classNames: { 'tw-loader': 'tw-loader m-x-auto' } }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(components_1.Button,
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Loader, { size: components_1.Size.LARGE, classNames: { 'tw-loader': 'tw-loader m-x-auto' } }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(components_1.Button, Object.assign({ priority: "tertiary", block: true, onClick: openExternalUrl }, { children: retryTitle || intl.formatMessage(DynamicExternal_messages_1.default.retryTitle) }))] }));
|
|
36
24
|
};
|
|
37
|
-
exports
|
|
25
|
+
exports.default = DynamicExternal;
|
|
@@ -1,10 +1,10 @@
|
|
|
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
|
retryTitle: {
|
|
6
6
|
id: 'dynamicFlows.DynamicExternal.retryTitle',
|
|
7
7
|
defaultMessage: 'Reopen window',
|
|
8
|
-
description: ''
|
|
9
|
-
}
|
|
8
|
+
description: '',
|
|
9
|
+
},
|
|
10
10
|
});
|
|
@@ -1,27 +1,16 @@
|
|
|
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
|
-
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)("div",
|
|
24
|
-
props.onModelChange(
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const jsonSchemaForm_1 = __importDefault(require("../../jsonSchemaForm"));
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
const DynamicForm = (props) => {
|
|
10
|
+
const form = props.component;
|
|
11
|
+
const formSchema = form.schema; // There should be no $ref at this point
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, utils_1.getMarginBottom)(form.margin || 'md') }, { children: (0, jsx_runtime_1.jsx)(jsonSchemaForm_1.default, { schema: formSchema, model: props.model, submitted: props.submitted, errors: props.errors, onChange: (parameters) => {
|
|
13
|
+
props.onModelChange(Object.assign({ formSchema }, parameters));
|
|
25
14
|
}, onPersistAsync: props.onPersistAsync }) })));
|
|
26
15
|
};
|
|
27
|
-
exports
|
|
16
|
+
exports.default = DynamicForm;
|
|
@@ -1,33 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
exports.__esModule = true;
|
|
14
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
-
var utils_1 = require("../utils");
|
|
16
|
-
var DynamicHeading = function (props) {
|
|
17
|
-
var _a = props.component, text = _a.text, _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.align, align = _c === void 0 ? 'left' : _c, _d = _a.margin, margin = _d === void 0 ? 'md' : _d;
|
|
18
|
-
var classes = (0, utils_1.getTextAlignmentAndMargin)({ align: align, margin: margin });
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const DynamicHeading = (props) => {
|
|
6
|
+
const { text, size = 'md', align = 'left', margin = 'md' } = props.component;
|
|
7
|
+
const classes = (0, utils_1.getTextAlignmentAndMargin)({ align, margin });
|
|
19
8
|
switch (size) {
|
|
20
9
|
case 'xs':
|
|
21
|
-
return (0, jsx_runtime_1.jsx)("h5",
|
|
10
|
+
return (0, jsx_runtime_1.jsx)("h5", Object.assign({ className: classes }, { children: text }));
|
|
22
11
|
case 'sm':
|
|
23
|
-
return (0, jsx_runtime_1.jsx)("h4",
|
|
12
|
+
return (0, jsx_runtime_1.jsx)("h4", Object.assign({ className: classes }, { children: text }));
|
|
24
13
|
case 'lg':
|
|
25
|
-
return (0, jsx_runtime_1.jsx)("h2",
|
|
14
|
+
return (0, jsx_runtime_1.jsx)("h2", Object.assign({ className: classes }, { children: text }));
|
|
26
15
|
case 'xl':
|
|
27
|
-
return (0, jsx_runtime_1.jsx)("h1",
|
|
16
|
+
return (0, jsx_runtime_1.jsx)("h1", Object.assign({ className: classes }, { children: text }));
|
|
28
17
|
case 'md':
|
|
29
18
|
default:
|
|
30
|
-
return (0, jsx_runtime_1.jsx)("h3",
|
|
19
|
+
return (0, jsx_runtime_1.jsx)("h3", Object.assign({ className: classes }, { children: text }));
|
|
31
20
|
}
|
|
32
21
|
};
|
|
33
|
-
exports
|
|
22
|
+
exports.default = DynamicHeading;
|
|
@@ -22,17 +22,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
exports
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.isValidIconName = void 0;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var iconName = toCapitalisedCamelCase(type);
|
|
27
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
const icons = __importStar(require("@transferwise/icons"));
|
|
29
|
+
const DynamicIcon = ({ type }) => {
|
|
30
|
+
const iconName = toCapitalisedCamelCase(type);
|
|
32
31
|
if (!Object.keys(icons).includes(iconName)) {
|
|
33
32
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
34
33
|
}
|
|
35
|
-
|
|
34
|
+
const Icon = icons[iconName];
|
|
36
35
|
return (0, jsx_runtime_1.jsx)(Icon, { size: 24 });
|
|
37
36
|
};
|
|
38
37
|
function toCapitalisedCamelCase(value) {
|
|
@@ -40,11 +39,11 @@ function toCapitalisedCamelCase(value) {
|
|
|
40
39
|
}
|
|
41
40
|
function capitaliseFirstChar(value) {
|
|
42
41
|
var _a;
|
|
43
|
-
return
|
|
42
|
+
return `${(_a = value[0]) === null || _a === void 0 ? void 0 : _a.toUpperCase()}${value.slice(1)}`;
|
|
44
43
|
}
|
|
45
44
|
function isValidIconName(name) {
|
|
46
|
-
|
|
45
|
+
const iconName = toCapitalisedCamelCase(name);
|
|
47
46
|
return Object.keys(icons).includes(iconName);
|
|
48
47
|
}
|
|
49
48
|
exports.isValidIconName = isValidIconName;
|
|
50
|
-
exports
|
|
49
|
+
exports.default = DynamicIcon;
|
|
@@ -1,112 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
exports.__esModule = true;
|
|
50
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
51
|
-
var components_1 = require("@transferwise/components");
|
|
52
|
-
var react_1 = require("react");
|
|
53
|
-
var contexts_1 = require("../../common/contexts");
|
|
54
|
-
var utils_1 = require("../../common/utils");
|
|
55
|
-
var utils_2 = require("../utils");
|
|
56
|
-
var DynamicImage = function (_a) {
|
|
57
|
-
var image = _a.component;
|
|
58
|
-
var url = image.url, size = image.size, text = image.text, margin = image.margin;
|
|
59
|
-
var fetcher = (0, contexts_1.useFetcher)();
|
|
60
|
-
var _b = (0, react_1.useState)(''), imageSource = _b[0], setImageSource = _b[1];
|
|
61
|
-
(0, react_1.useEffect)(function () {
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const components_1 = require("@transferwise/components");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const contexts_1 = require("../../common/contexts");
|
|
7
|
+
const utils_1 = require("../../common/utils");
|
|
8
|
+
const utils_2 = require("../utils");
|
|
9
|
+
const DynamicImage = ({ component: image }) => {
|
|
10
|
+
const { url, size, text, margin } = image;
|
|
11
|
+
const fetcher = (0, contexts_1.useFetcher)();
|
|
12
|
+
const [imageSource, setImageSource] = (0, react_1.useState)('');
|
|
13
|
+
(0, react_1.useEffect)(() => {
|
|
62
14
|
void getImageSource(fetcher, url).then(setImageSource);
|
|
63
15
|
}, [url, fetcher]);
|
|
64
|
-
|
|
16
|
+
const imageProps = {
|
|
65
17
|
alt: text || '',
|
|
66
18
|
src: imageSource,
|
|
67
19
|
stretch: true,
|
|
68
|
-
shrink: true
|
|
20
|
+
shrink: true,
|
|
69
21
|
};
|
|
70
22
|
if (!imageSource) {
|
|
71
23
|
return null;
|
|
72
24
|
}
|
|
73
|
-
return ((0, jsx_runtime_1.jsx)("div",
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: `df-image ${size || 'xl'}` }, { children: (0, jsx_runtime_1.jsx)(components_1.Image, Object.assign({ className: `img-responsive ${(0, utils_2.getMarginBottom)(margin || 'lg')}` }, imageProps)) })));
|
|
74
26
|
};
|
|
75
|
-
|
|
27
|
+
const readImageBlobAsDataURL = (imageBlob) => {
|
|
76
28
|
// we can safely assume the type of reader.result is string
|
|
77
29
|
// because we're calling reader.readAsDataURL
|
|
78
30
|
// https://developer.mozilla.org/en-US/docs/Web/API/FileReader/result
|
|
79
|
-
return new Promise(
|
|
80
|
-
|
|
81
|
-
reader.addEventListener('loadend',
|
|
82
|
-
reader.addEventListener('error',
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
const reader = new FileReader();
|
|
33
|
+
reader.addEventListener('loadend', () => resolve(reader.result));
|
|
34
|
+
reader.addEventListener('error', (error) => reject(error));
|
|
83
35
|
reader.readAsDataURL(imageBlob);
|
|
84
36
|
});
|
|
85
37
|
};
|
|
86
|
-
|
|
38
|
+
const getImageSource = async (fetcher, imageUrl) => {
|
|
87
39
|
var _a;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
return [2 /*return*/, imageUrl];
|
|
105
|
-
}
|
|
106
|
-
catch (_c) {
|
|
107
|
-
return [2 /*return*/, imageUrl];
|
|
40
|
+
try {
|
|
41
|
+
if ((0, utils_1.isRelativePath)(imageUrl) || (imageUrl === null || imageUrl === void 0 ? void 0 : imageUrl.indexOf(`${(_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.origin}/`)) === 0) {
|
|
42
|
+
return fetcher(imageUrl, {
|
|
43
|
+
method: 'GET',
|
|
44
|
+
headers: { 'Content-Type': 'image/image' },
|
|
45
|
+
credentials: 'same-origin',
|
|
46
|
+
})
|
|
47
|
+
.then((response) => {
|
|
48
|
+
if (response.ok) {
|
|
49
|
+
return response.blob();
|
|
50
|
+
}
|
|
51
|
+
throw new Error('Image fetching failed');
|
|
52
|
+
})
|
|
53
|
+
.then(readImageBlobAsDataURL)
|
|
54
|
+
.catch(() => imageUrl);
|
|
108
55
|
}
|
|
109
|
-
return
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
56
|
+
return imageUrl;
|
|
57
|
+
}
|
|
58
|
+
catch (_b) {
|
|
59
|
+
return imageUrl;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.default = DynamicImage;
|
package/build/layout/index.js
CHANGED
|
@@ -1,48 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
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;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
6
|
exports.DynamicReview = exports.DynamicParagraph = exports.DynamicLoadingIndicator = exports.DynamicList = exports.DynamicLayout = exports.DynamicImage = exports.DynamicInfo = exports.DynamicIcon = exports.DynamicHeading = exports.DynamicForm = exports.DynamicExternal = exports.DynamicDivider = exports.DynamicDecision = exports.DynamicColumns = exports.DynamicButton = exports.DynamicBox = exports.DynamicAlert = void 0;
|
|
15
7
|
var DynamicAlert_1 = require("./alert/DynamicAlert");
|
|
16
|
-
|
|
8
|
+
Object.defineProperty(exports, "DynamicAlert", { enumerable: true, get: function () { return __importDefault(DynamicAlert_1).default; } });
|
|
17
9
|
var DynamicBox_1 = require("./box/DynamicBox");
|
|
18
|
-
|
|
10
|
+
Object.defineProperty(exports, "DynamicBox", { enumerable: true, get: function () { return __importDefault(DynamicBox_1).default; } });
|
|
19
11
|
var DynamicButton_1 = require("./button/DynamicButton");
|
|
20
|
-
|
|
12
|
+
Object.defineProperty(exports, "DynamicButton", { enumerable: true, get: function () { return __importDefault(DynamicButton_1).default; } });
|
|
21
13
|
var DynamicColumns_1 = require("./columns/DynamicColumns");
|
|
22
|
-
|
|
14
|
+
Object.defineProperty(exports, "DynamicColumns", { enumerable: true, get: function () { return __importDefault(DynamicColumns_1).default; } });
|
|
23
15
|
var DynamicDecision_1 = require("./decision/DynamicDecision");
|
|
24
|
-
|
|
16
|
+
Object.defineProperty(exports, "DynamicDecision", { enumerable: true, get: function () { return __importDefault(DynamicDecision_1).default; } });
|
|
25
17
|
var DynamicDivider_1 = require("./divider/DynamicDivider");
|
|
26
|
-
|
|
18
|
+
Object.defineProperty(exports, "DynamicDivider", { enumerable: true, get: function () { return __importDefault(DynamicDivider_1).default; } });
|
|
27
19
|
var DynamicExternal_1 = require("./external/DynamicExternal");
|
|
28
|
-
|
|
20
|
+
Object.defineProperty(exports, "DynamicExternal", { enumerable: true, get: function () { return __importDefault(DynamicExternal_1).default; } });
|
|
29
21
|
var DynamicForm_1 = require("./form/DynamicForm");
|
|
30
|
-
|
|
22
|
+
Object.defineProperty(exports, "DynamicForm", { enumerable: true, get: function () { return __importDefault(DynamicForm_1).default; } });
|
|
31
23
|
var DynamicHeading_1 = require("./heading/DynamicHeading");
|
|
32
|
-
|
|
24
|
+
Object.defineProperty(exports, "DynamicHeading", { enumerable: true, get: function () { return __importDefault(DynamicHeading_1).default; } });
|
|
33
25
|
var DynamicIcon_1 = require("./icon/DynamicIcon");
|
|
34
|
-
|
|
26
|
+
Object.defineProperty(exports, "DynamicIcon", { enumerable: true, get: function () { return __importDefault(DynamicIcon_1).default; } });
|
|
35
27
|
var DynamicInfo_1 = require("./info/DynamicInfo");
|
|
36
|
-
|
|
28
|
+
Object.defineProperty(exports, "DynamicInfo", { enumerable: true, get: function () { return __importDefault(DynamicInfo_1).default; } });
|
|
37
29
|
var DynamicImage_1 = require("./image/DynamicImage");
|
|
38
|
-
|
|
30
|
+
Object.defineProperty(exports, "DynamicImage", { enumerable: true, get: function () { return __importDefault(DynamicImage_1).default; } });
|
|
39
31
|
var DynamicLayout_1 = require("./DynamicLayout");
|
|
40
|
-
|
|
32
|
+
Object.defineProperty(exports, "DynamicLayout", { enumerable: true, get: function () { return __importDefault(DynamicLayout_1).default; } });
|
|
41
33
|
var DynamicList_1 = require("./list/DynamicList");
|
|
42
|
-
|
|
34
|
+
Object.defineProperty(exports, "DynamicList", { enumerable: true, get: function () { return __importDefault(DynamicList_1).default; } });
|
|
43
35
|
var DynamicLoadingIndicator_1 = require("./loadingIndicator/DynamicLoadingIndicator");
|
|
44
|
-
|
|
36
|
+
Object.defineProperty(exports, "DynamicLoadingIndicator", { enumerable: true, get: function () { return __importDefault(DynamicLoadingIndicator_1).default; } });
|
|
45
37
|
var DynamicParagraph_1 = require("./paragraph/DynamicParagraph");
|
|
46
|
-
|
|
38
|
+
Object.defineProperty(exports, "DynamicParagraph", { enumerable: true, get: function () { return __importDefault(DynamicParagraph_1).default; } });
|
|
47
39
|
var DynamicReview_1 = require("./review/DynamicReview");
|
|
48
|
-
|
|
40
|
+
Object.defineProperty(exports, "DynamicReview", { enumerable: true, get: function () { return __importDefault(DynamicReview_1).default; } });
|
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const components_1 = require("@transferwise/components");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const DynamicInfo = ({ component }) => {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, utils_1.getTextAlignmentAndMargin)(component) }, { children: (0, jsx_runtime_1.jsx)(components_1.Markdown, Object.assign({ config: { link: { target: '_blank' } } }, { children: component.markdown })) })));
|
|
12
8
|
};
|
|
13
|
-
exports.
|
|
14
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
-
var components_1 = require("@transferwise/components");
|
|
16
|
-
var utils_1 = require("../utils");
|
|
17
|
-
var DynamicInfo = function (_a) {
|
|
18
|
-
var component = _a.component;
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, utils_1.getTextAlignmentAndMargin)(component) }, { children: (0, jsx_runtime_1.jsx)(components_1.Markdown, __assign({ config: { link: { target: '_blank' } } }, { children: component.markdown })) })));
|
|
20
|
-
};
|
|
21
|
-
exports["default"] = DynamicInfo;
|
|
9
|
+
exports.default = DynamicInfo;
|
|
@@ -1,33 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
exports.__esModule = true;
|
|
14
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
4
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, utils_1.getMarginBottom)(component.margin || 'md') }, { children: [component.title ? (0, jsx_runtime_1.jsxs)("h4", __assign({ className: "m-b-2" }, { children: [" ", component.title, " "] })) : null, component.items.map(mapItemToSummary)] })));
|
|
5
|
+
const components_1 = require("@transferwise/components");
|
|
6
|
+
const __1 = require("..");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const DynamicList = ({ component }) => {
|
|
9
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, utils_1.getMarginBottom)(component.margin || 'md') }, { children: [component.title ? (0, jsx_runtime_1.jsxs)("h4", Object.assign({ className: "m-b-2" }, { children: [" ", component.title, " "] })) : null, component.items.map(mapItemToSummary)] })));
|
|
22
10
|
};
|
|
23
|
-
function mapItemToSummary(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return (0, jsx_runtime_1.jsx)(components_1.Summary,
|
|
11
|
+
function mapItemToSummary({ title, description, icon, status }) {
|
|
12
|
+
const props = Object.assign(Object.assign({ key: `${title}/${description || ''}`, title,
|
|
13
|
+
description }, ((icon === null || icon === void 0 ? void 0 : icon.name) ? { icon: (0, jsx_runtime_1.jsx)(__1.DynamicIcon, { type: icon.name }) } : {})), (status ? { status: statusMap[status] } : {}));
|
|
14
|
+
return (0, jsx_runtime_1.jsx)(components_1.Summary, Object.assign({}, props));
|
|
27
15
|
}
|
|
28
|
-
|
|
16
|
+
const statusMap = {
|
|
29
17
|
positive: 'done',
|
|
30
18
|
warning: 'pending',
|
|
31
|
-
neutral: 'notDone'
|
|
19
|
+
neutral: 'notDone',
|
|
32
20
|
};
|
|
33
|
-
exports
|
|
21
|
+
exports.default = DynamicList;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var margin = component.margin, _b = component.size, size = _b === void 0 ? 'md' : _b;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const components_1 = require("@transferwise/components");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const DynamicLoadingIndicator = ({ component }) => {
|
|
7
|
+
const { margin, size = 'md' } = component;
|
|
9
8
|
return ((0, jsx_runtime_1.jsx)(components_1.Loader, { size: size, classNames: {
|
|
10
|
-
'tw-loader':
|
|
9
|
+
'tw-loader': `tw-loader m-x-auto ${(0, utils_1.getMarginBottom)(margin)}`,
|
|
11
10
|
}, "data-testid": "loading-indicator" }));
|
|
12
11
|
};
|
|
13
|
-
exports
|
|
12
|
+
exports.default = DynamicLoadingIndicator;
|