@wise/dynamic-flow-client 3.5.0-experimental-b041af5 → 3.5.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/build/main.js +6 -2
- package/build/main.min.js +1 -1
- package/build/main.mjs +6 -2
- package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -1
- package/package.json +3 -2
- package/build/common/httpClientContext/HttpClientContext.js +0 -35
- package/build/common/httpClientContext/index.js +0 -1
- package/build/common/makeHttpClient/index.js +0 -1
- package/build/common/makeHttpClient/makeHttpClient.js +0 -34
- package/build/common/messages/generic-error.messages.js +0 -18
- package/build/common/messages/help.messages.js +0 -8
- package/build/common/messages/multi-file-upload.messages.js +0 -18
- package/build/common/messages/multi-select.messages.js +0 -8
- package/build/common/messages/paragraph.messages.js +0 -13
- package/build/common/messages/repeatable.messages.js +0 -23
- package/build/common/messages/validation.array.messages.js +0 -13
- package/build/common/messages/validation.messages.js +0 -53
- package/build/common/utils/api-utils.js +0 -4
- package/build/legacy/common/constants/DateMode.js +0 -4
- package/build/legacy/common/constants/FeatureName.js +0 -4
- package/build/legacy/common/constants/FormControlType.js +0 -21
- package/build/legacy/common/constants/MonthFormat.js +0 -4
- package/build/legacy/common/constants/Size.js +0 -7
- package/build/legacy/common/constants/index.js +0 -4
- package/build/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +0 -36
- package/build/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +0 -13
- package/build/legacy/common/contexts/eventsContext/EventsContext.js +0 -38
- package/build/legacy/common/contexts/featureContext/FeatureContext.js +0 -22
- package/build/legacy/common/contexts/index.js +0 -3
- package/build/legacy/common/contexts/logContext/LogContext.js +0 -44
- package/build/legacy/common/hooks/index.js +0 -7
- package/build/legacy/common/hooks/useDebouncedFunction/useDebouncedFunction.js +0 -9
- package/build/legacy/common/hooks/useExternal/useExternal.js +0 -15
- package/build/legacy/common/hooks/useExternalStepPolling/useExternalStepPolling.js +0 -70
- package/build/legacy/common/hooks/usePersistAsync/usePersistAsync.js +0 -172
- package/build/legacy/common/hooks/usePolling/usePolling.js +0 -51
- package/build/legacy/common/hooks/usePrevious/usePrevious.js +0 -8
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.js +0 -43
- package/build/legacy/common/messages.js +0 -8
- package/build/legacy/common/utils/api-utils.js +0 -6
- package/build/legacy/common/utils/date-utils.js +0 -22
- package/build/legacy/common/utils/debounce.js +0 -38
- package/build/legacy/common/utils/file-utils.js +0 -45
- package/build/legacy/common/utils/id-utils.js +0 -5
- package/build/legacy/common/utils/index.js +0 -11
- package/build/legacy/common/utils/is-equal.js +0 -21
- package/build/legacy/common/utils/misc-utils.js +0 -4
- package/build/legacy/common/utils/mobile-utils.js +0 -23
- package/build/legacy/common/utils/model-utils.js +0 -33
- package/build/legacy/common/utils/schema-utils.js +0 -113
- package/build/legacy/common/utils/step-utils.js +0 -32
- package/build/legacy/common/validators/index.js +0 -5
- package/build/legacy/common/validators/models/model-utils.js +0 -119
- package/build/legacy/common/validators/models/model-validators.js +0 -62
- package/build/legacy/common/validators/schemas/schema-validators.js +0 -101
- package/build/legacy/common/validators/types/type-validators.js +0 -14
- package/build/legacy/common/validators/validationFailures/validation-failures.js +0 -139
- package/build/legacy/common/validators/validationFailures/validation-failures.utils.js +0 -40
- package/build/legacy/common/validators/values/value-validators.js +0 -6
- package/build/legacy/dynamic-flow-types.js +0 -1
- package/build/legacy/formControl/FormControl.js +0 -266
- package/build/legacy/formControl/index.js +0 -1
- package/build/legacy/formControl/utils/getAutocompleteString.js +0 -80
- package/build/legacy/formControl/utils/index.js +0 -2
- package/build/legacy/formControl/utils/value-utils.js +0 -108
- package/build/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.js +0 -50
- package/build/legacy/jsonSchemaForm/allOfSchema/index.js +0 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.js +0 -84
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +0 -141
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +0 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +0 -2
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +0 -79
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +0 -14
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.js +0 -7
- package/build/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +0 -111
- package/build/legacy/jsonSchemaForm/basicTypeSchema/index.js +0 -1
- package/build/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.js +0 -86
- package/build/legacy/jsonSchemaForm/controlFeedback/index.js +0 -1
- package/build/legacy/jsonSchemaForm/help/Help.js +0 -20
- package/build/legacy/jsonSchemaForm/help/index.js +0 -1
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +0 -165
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +0 -133
- package/build/legacy/jsonSchemaForm/schemaFormControl/index.js +0 -1
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/index.js +0 -1
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +0 -107
- package/build/legacy/layout/DynamicLayout.js +0 -68
- package/build/legacy/layout/alert/DynamicAlert.js +0 -29
- package/build/legacy/layout/box/DynamicBox.js +0 -41
- package/build/legacy/layout/button/DynamicButton.js +0 -27
- package/build/legacy/layout/button/utils.js +0 -45
- package/build/legacy/layout/columns/DynamicColumns.js +0 -38
- package/build/legacy/layout/decision/DynamicDecision.js +0 -21
- package/build/legacy/layout/divider/DynamicDivider.js +0 -9
- package/build/legacy/layout/external/DynamicExternal.js +0 -32
- package/build/legacy/layout/external/DynamicExternal.messages.js +0 -8
- package/build/legacy/layout/form/DynamicForm.js +0 -22
- package/build/legacy/layout/heading/DynamicHeading.js +0 -51
- package/build/legacy/layout/icon/DynamicIcon.js +0 -17
- package/build/legacy/layout/icon/FlagIcon.js +0 -198
- package/build/legacy/layout/icon/NamedIcon.js +0 -19
- package/build/legacy/layout/image/DynamicImage.js +0 -111
- package/build/legacy/layout/index.js +0 -20
- package/build/legacy/layout/instructions/DynamicInstructions.js +0 -30
- package/build/legacy/layout/list/DynamicStatusList.js +0 -37
- package/build/legacy/layout/loadingIndicator/DynamicLoadingIndicator.js +0 -11
- package/build/legacy/layout/markdown/DynamicMarkdown.js +0 -23
- package/build/legacy/layout/modal/DynamicModal.js +0 -26
- package/build/legacy/layout/paragraph/DynamicParagraph.js +0 -46
- package/build/legacy/layout/paragraph/useSnackBarIfAvailable.js +0 -9
- package/build/legacy/layout/review/DynamicReview.js +0 -58
- package/build/legacy/layout/search/DynamicSearch.js +0 -58
- package/build/legacy/layout/search/SearchInput.js +0 -17
- package/build/legacy/layout/search/SearchResults.js +0 -31
- package/build/legacy/layout/search/useSearch.js +0 -137
- package/build/legacy/layout/utils/getNavigationOptionMedia.js +0 -28
- package/build/legacy/layout/utils/index.js +0 -32
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.js +0 -58
- package/build/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.js +0 -28
- package/build/legacy/step/cameraStep/cameraCapture/components/index.js +0 -3
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.js +0 -19
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.js +0 -8
- package/build/legacy/step/cameraStep/cameraCapture/types/index.js +0 -7
- package/build/legacy/step/layoutStep/LayoutStep.js +0 -33
- package/build/legacy/step/layoutStep/index.js +0 -1
- package/build/legacy/step/layoutStep/utils/index.js +0 -2
- package/build/legacy/step/layoutStep/utils/inline-reference-utils.js +0 -105
- package/build/legacy/step/layoutStep/utils/layout-utils.js +0 -212
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
-
if (ar || !(i in from)) {
|
|
15
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
-
ar[i] = from[i];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
-
};
|
|
21
|
-
export function convertStepToLayout(step, _a) {
|
|
22
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.displayStepTitle, displayStepTitle = _c === void 0 ? true : _c;
|
|
23
|
-
// This condition is meant as a temporary hack until mobile platforms will be refactored to fully support the layout property
|
|
24
|
-
if (step.layout) {
|
|
25
|
-
return addMissingTitleAndDescriptionToStep(step, displayStepTitle);
|
|
26
|
-
}
|
|
27
|
-
switch (step.type) {
|
|
28
|
-
case 'final':
|
|
29
|
-
return convertFinalStepToDynamicLayout(step);
|
|
30
|
-
case 'decision':
|
|
31
|
-
return convertDecisionStepToDynamicLayout(step);
|
|
32
|
-
case 'external':
|
|
33
|
-
return convertExternalStepToDynamicLayout(step);
|
|
34
|
-
default:
|
|
35
|
-
return convertFormStepToDynamicLayout(step);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function convertCommonComponents(step) {
|
|
39
|
-
var layout = [];
|
|
40
|
-
if (step.title) {
|
|
41
|
-
layout.push(convertStepTitleToDynamicHeading(step.title));
|
|
42
|
-
}
|
|
43
|
-
if (step.image) {
|
|
44
|
-
var image = convertStepImageToDynamicImage(step.image);
|
|
45
|
-
layout.push(image);
|
|
46
|
-
}
|
|
47
|
-
if (step.description) {
|
|
48
|
-
layout.push(convertStepDescriptionToDynamicParagraph(step.description));
|
|
49
|
-
}
|
|
50
|
-
return layout;
|
|
51
|
-
}
|
|
52
|
-
function convertExternalStepToDynamicLayout(step) {
|
|
53
|
-
return __spreadArray(__spreadArray([], convertCommonComponents(step), true), [convertStepToExternalComponent(step)], false);
|
|
54
|
-
}
|
|
55
|
-
function convertStepToExternalComponent(step) {
|
|
56
|
-
return {
|
|
57
|
-
type: 'external',
|
|
58
|
-
requestUrl: step.requestUrl,
|
|
59
|
-
polling: step.polling,
|
|
60
|
-
responseHandlers: step.responseHandlers,
|
|
61
|
-
retryTitle: step.retryTitle
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
function convertFormStepToDynamicLayout(step) {
|
|
65
|
-
var layout = convertCommonComponents(step);
|
|
66
|
-
if (step.reviewFields) {
|
|
67
|
-
layout.push(convertStepReviewToDynamicReview(step.reviewFields));
|
|
68
|
-
}
|
|
69
|
-
if (step.schemas) {
|
|
70
|
-
layout.push.apply(layout, getSchemaLayout(step));
|
|
71
|
-
}
|
|
72
|
-
if (step.actions) {
|
|
73
|
-
var actions = step.actions.map(convertStepActionToDynamicAction);
|
|
74
|
-
layout.push(dynamicBox(actions, 'md'));
|
|
75
|
-
}
|
|
76
|
-
return layout;
|
|
77
|
-
}
|
|
78
|
-
function convertFinalStepToDynamicLayout(step) {
|
|
79
|
-
var layout = [];
|
|
80
|
-
if (step.details) {
|
|
81
|
-
if (step.details.image) {
|
|
82
|
-
var image = convertFinalStepImageToDynamicImage(step.details.image);
|
|
83
|
-
layout.push(image);
|
|
84
|
-
}
|
|
85
|
-
if (step.details.title) {
|
|
86
|
-
layout.push(convertStepTitleToDynamicHeading(step.details.title));
|
|
87
|
-
}
|
|
88
|
-
if (step.details.description) {
|
|
89
|
-
layout.push(convertStepDescriptionToDynamicParagraph(step.details.description));
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
if (step.actions) {
|
|
93
|
-
var actions = step.actions.map(function (action) {
|
|
94
|
-
return convertStepActionToDynamicAction(__assign(__assign({}, action), { type: action.type || 'primary' }));
|
|
95
|
-
});
|
|
96
|
-
layout.push(dynamicBox(actions, 'md'));
|
|
97
|
-
}
|
|
98
|
-
return layout;
|
|
99
|
-
}
|
|
100
|
-
function convertDecisionStepToDynamicLayout(step) {
|
|
101
|
-
var layout = convertCommonComponents(step);
|
|
102
|
-
if (step.options) {
|
|
103
|
-
layout.push(convertStepDecisionToDynamicDecision(step.options));
|
|
104
|
-
}
|
|
105
|
-
return layout;
|
|
106
|
-
}
|
|
107
|
-
function dynamicBox(components, size) {
|
|
108
|
-
return {
|
|
109
|
-
type: 'box',
|
|
110
|
-
width: size || 'md',
|
|
111
|
-
components: components
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
function convertStepTitleToDynamicHeading(title) {
|
|
115
|
-
return {
|
|
116
|
-
type: 'heading',
|
|
117
|
-
text: title,
|
|
118
|
-
size: 'lg',
|
|
119
|
-
margin: 'lg',
|
|
120
|
-
align: 'center'
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
function convertStepDescriptionToDynamicParagraph(description) {
|
|
124
|
-
return {
|
|
125
|
-
type: 'paragraph',
|
|
126
|
-
text: description,
|
|
127
|
-
align: 'center'
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
function convertStepSchemaToDynamicForm(schema) {
|
|
131
|
-
return { type: 'form', schema: schema };
|
|
132
|
-
}
|
|
133
|
-
function convertStepDecisionToDynamicDecision(options) {
|
|
134
|
-
return {
|
|
135
|
-
type: 'decision',
|
|
136
|
-
options: options.map(convertStepDecisionOption)
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
function convertStepDecisionOption(option) {
|
|
140
|
-
return {
|
|
141
|
-
title: option.title,
|
|
142
|
-
description: option.description,
|
|
143
|
-
action: {
|
|
144
|
-
title: option.title,
|
|
145
|
-
method: 'GET',
|
|
146
|
-
url: option.url,
|
|
147
|
-
disabled: option.disabled
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
function convertStepImageToDynamicImage(image) {
|
|
152
|
-
return {
|
|
153
|
-
type: 'image',
|
|
154
|
-
url: image.url,
|
|
155
|
-
text: image.text,
|
|
156
|
-
margin: image.margin || 'lg',
|
|
157
|
-
size: image.size || 'md'
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
function convertFinalStepImageToDynamicImage(image) {
|
|
161
|
-
return typeof image === 'string'
|
|
162
|
-
? {
|
|
163
|
-
type: 'image',
|
|
164
|
-
url: image,
|
|
165
|
-
text: undefined,
|
|
166
|
-
margin: 'lg',
|
|
167
|
-
size: 'md'
|
|
168
|
-
}
|
|
169
|
-
: convertStepImageToDynamicImage(image);
|
|
170
|
-
}
|
|
171
|
-
export function convertStepActionToDynamicAction(action) {
|
|
172
|
-
var newAction = __assign(__assign({}, action), { title: action.title });
|
|
173
|
-
return {
|
|
174
|
-
type: 'button',
|
|
175
|
-
action: newAction
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
function convertStepReviewToDynamicReview(reviewFields) {
|
|
179
|
-
return {
|
|
180
|
-
type: 'review',
|
|
181
|
-
title: reviewFields.title,
|
|
182
|
-
fields: reviewFields.fields.map(convertReviewFieldToDefinition)
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
function convertReviewFieldToDefinition(reviewField) {
|
|
186
|
-
return {
|
|
187
|
-
label: reviewField.title,
|
|
188
|
-
value: reviewField.value
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
function getSchemaLayout(step) {
|
|
192
|
-
var layout = [];
|
|
193
|
-
if (step.schemas && step.schemas[0]) {
|
|
194
|
-
var schema = step.schemas[0];
|
|
195
|
-
var dynamicForm = convertStepSchemaToDynamicForm(schema);
|
|
196
|
-
if (isWideForm()) {
|
|
197
|
-
layout.push(dynamicForm);
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
layout.push(dynamicBox([dynamicForm], 'md'));
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
return layout;
|
|
204
|
-
}
|
|
205
|
-
function isWideForm() {
|
|
206
|
-
// For the time being we won't support automatically widening forms
|
|
207
|
-
// Unlike it V2, there is no way to easily iterate and identify narrow fields
|
|
208
|
-
return false;
|
|
209
|
-
}
|
|
210
|
-
function addMissingTitleAndDescriptionToStep(step, displayStepTitle) {
|
|
211
|
-
return __spreadArray(__spreadArray(__spreadArray([], (displayStepTitle && step.title ? [convertStepTitleToDynamicHeading(step.title)] : []), true), (step.description ? [convertStepDescriptionToDynamicParagraph(step.description)] : []), true), (step.layout || []), true);
|
|
212
|
-
}
|