@wise/dynamic-flow-client 3.16.5 → 3.16.7
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 +152 -112
- package/build/main.min.js +1 -1
- package/build/main.mjs +152 -112
- package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +2 -5
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +2 -5
- package/build/types/revamp/domain/components/utils/isExactLocalValueMatch.d.ts +2 -0
- package/build/types/revamp/domain/features/persistAsync/getComponentPersistAsync.d.ts +2 -4
- package/build/types/revamp/domain/types.d.ts +4 -1
- package/build/types/revamp/utils/component-utils.d.ts +1 -0
- package/package.json +16 -16
- package/build/types/revamp/domain/components/utils/local-value.d.ts +0 -2
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
2
1
|
import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
|
|
3
2
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
4
3
|
import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
|
|
5
|
-
import type { InputComponent, LocalValue,
|
|
4
|
+
import type { InputComponent, LocalValue, DomainComponent, UpdateComponent, LocalValueArray, OnValueChange, ValidationState } from '../types';
|
|
6
5
|
import type { SelectInputOption } from './SelectInputComponent';
|
|
7
6
|
export type MultiSelectComponent = InputComponent<LocalValueArray | null> & {
|
|
8
7
|
type: 'multi-select';
|
|
9
8
|
children: DomainComponent[];
|
|
10
9
|
options: SelectInputOption[];
|
|
11
|
-
persistedState: PersistedState;
|
|
12
10
|
validationState: ValidationState;
|
|
13
11
|
selectedIndices: number[];
|
|
14
12
|
getChildren: () => DomainComponent[];
|
|
15
13
|
getSelectedChildren: () => DomainComponent[] | null;
|
|
16
14
|
onSelect: (indices: number[]) => void;
|
|
17
15
|
};
|
|
18
|
-
export declare const createMultiSelectComponent: (multiSelectProps: Pick<MultiSelectComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "description" | "disabled" | "errors" | "hidden" | "
|
|
16
|
+
export declare const createMultiSelectComponent: (multiSelectProps: Pick<MultiSelectComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "description" | "disabled" | "errors" | "hidden" | "required" | "title" | "validationState"> & {
|
|
19
17
|
checks: IsInvalidCheck<LocalValueArray | null>[];
|
|
20
18
|
initialValue: LocalValue;
|
|
21
19
|
options: (SelectInputOption & {
|
|
22
20
|
component: DomainComponent;
|
|
23
21
|
})[];
|
|
24
|
-
performPersistAsync: PerformPersistAsync | undefined;
|
|
25
22
|
performValidationAsync: PerformValidationAsync | undefined;
|
|
26
23
|
performRefresh: PerformRefresh | undefined;
|
|
27
24
|
onValueChange: OnValueChange;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { Icon, Image } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type { InputComponent, LocalValue,
|
|
2
|
+
import type { InputComponent, LocalValue, RepeatableSummary, DomainComponent, UpdateComponent, OnValueChange } from '../types';
|
|
3
3
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
4
4
|
import type { AnalyticsEventDispatcher } from '../features/events';
|
|
5
|
-
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
6
5
|
import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
|
|
7
6
|
export type SelectInputComponent = InputComponent<LocalValue | null> & {
|
|
8
7
|
type: 'select';
|
|
9
8
|
selectedIndex: number | null;
|
|
10
9
|
options: SelectInputOption[];
|
|
11
10
|
children: DomainComponent[];
|
|
12
|
-
persistedState: PersistedState;
|
|
13
11
|
onSelect: (index: number | null) => void;
|
|
14
12
|
getChildren: () => DomainComponent[];
|
|
15
13
|
getSelectedChild: () => DomainComponent | null;
|
|
@@ -22,13 +20,12 @@ export type SelectInputOption = {
|
|
|
22
20
|
keywords?: string[];
|
|
23
21
|
disabled: boolean;
|
|
24
22
|
};
|
|
25
|
-
export declare const createSelectInputComponent: (selectProps: Pick<SelectInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "help" | "hidden" | "
|
|
23
|
+
export declare const createSelectInputComponent: (selectProps: Pick<SelectInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "help" | "hidden" | "placeholder" | "required" | "title"> & {
|
|
26
24
|
initialValue: LocalValue;
|
|
27
25
|
options: (SelectInputOption & {
|
|
28
26
|
component: DomainComponent;
|
|
29
27
|
})[];
|
|
30
28
|
checks: IsInvalidCheck<LocalValue>[];
|
|
31
|
-
performPersistAsync: PerformPersistAsync | undefined;
|
|
32
29
|
performRefresh?: PerformRefresh | undefined;
|
|
33
30
|
summariser: (value: LocalValue | null) => RepeatableSummary;
|
|
34
31
|
onValueChange: OnValueChange;
|
|
@@ -4,13 +4,11 @@ import type { BooleanInputComponent } from '../../components/BooleanInputCompone
|
|
|
4
4
|
import type { DateInputComponent } from '../../components/DateInputComponent';
|
|
5
5
|
import type { IntegerInputComponent } from '../../components/IntegerInputComponent';
|
|
6
6
|
import type { NumberInputComponent } from '../../components/NumberInputComponent';
|
|
7
|
-
import type { SelectInputComponent } from '../../components/SelectInputComponent';
|
|
8
7
|
import type { TextInputComponent } from '../../components/TextInputComponent';
|
|
9
8
|
import type { UploadInputComponent } from '../../components/UploadInputComponent';
|
|
10
|
-
import type { MultiSelectComponent } from '../../components/MultiSelectInputComponent';
|
|
11
9
|
import type { MultiUploadInputComponent } from '../../components/MultiUploadInputComponent';
|
|
12
10
|
import type { LocalValue, PersistedState } from '../../types';
|
|
13
|
-
type Persistable = BooleanInputComponent | DateInputComponent | IntegerInputComponent |
|
|
11
|
+
type Persistable = BooleanInputComponent | DateInputComponent | IntegerInputComponent | NumberInputComponent | TextInputComponent | UploadInputComponent;
|
|
14
12
|
/**
|
|
15
13
|
* Creates an onPersistAsync handler for a component.
|
|
16
14
|
*/
|
|
@@ -18,5 +16,5 @@ export declare const getComponentPersistAsync: (update: ReturnType<typeof getInp
|
|
|
18
16
|
/**
|
|
19
17
|
* Creates an onPersistAsync handler for a component.
|
|
20
18
|
*/
|
|
21
|
-
export declare const getComponentMultiPersistAsync: (update: ReturnType<typeof getInputUpdateFunction<MultiUploadInputComponent>>, performPersistAsync: PerformPersistAsync) => (value: LocalValue, id: string) => Promise<import("@wise/dynamic-flow-types/build/next").
|
|
19
|
+
export declare const getComponentMultiPersistAsync: (update: ReturnType<typeof getInputUpdateFunction<MultiUploadInputComponent>>, performPersistAsync: PerformPersistAsync) => (value: LocalValue, id: string) => Promise<string | number | boolean | import("@wise/dynamic-flow-types/build/next").JsonObject | import("@wise/dynamic-flow-types/build/next").JsonArray | null>;
|
|
22
20
|
export {};
|
|
@@ -43,7 +43,10 @@ export type BaseComponent = {
|
|
|
43
43
|
type: string;
|
|
44
44
|
uid: string;
|
|
45
45
|
analyticsId?: string;
|
|
46
|
+
/** Gets the form model value. Will wait for in-flight requests to finish (e.g. persist async) and return the most up to date value. */
|
|
46
47
|
getSubmittableValue: () => Promise<Model>;
|
|
48
|
+
/** Gets the (potentially incomplete) form model, synchronously. It will NOT wait for in-flight requests and will not include base64 encoded values. It can be used in places where accuracy is not required (such as matching algorithms) but on submission, you should always prefer getSubmittableValue */
|
|
49
|
+
getSubmittableValueSync: () => Model;
|
|
47
50
|
getSummary: () => RepeatableSummary;
|
|
48
51
|
validate: () => boolean;
|
|
49
52
|
};
|
|
@@ -64,7 +67,6 @@ export type InputComponent<V extends LocalValue> = ComponentWithTitle & {
|
|
|
64
67
|
autoComplete: string;
|
|
65
68
|
disabled: boolean;
|
|
66
69
|
errors: string[];
|
|
67
|
-
isPersisted?: boolean;
|
|
68
70
|
placeholder?: string;
|
|
69
71
|
required: boolean;
|
|
70
72
|
value: V;
|
|
@@ -89,6 +91,7 @@ export type PersistedState = {
|
|
|
89
91
|
id?: string;
|
|
90
92
|
abortController: AbortController;
|
|
91
93
|
lastSubmitted: LocalValue;
|
|
94
|
+
lastResponse: JsonElement | null;
|
|
92
95
|
submission: Promise<JsonElement | null>;
|
|
93
96
|
};
|
|
94
97
|
export type ValidationState = {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { LocalValue, DomainComponent } from '../domain/types';
|
|
3
3
|
export declare const getSubmittableData: (components: DomainComponent[]) => Promise<Model>;
|
|
4
|
+
export declare const getSubmittableDataSync: (components: DomainComponent[]) => Model;
|
|
4
5
|
export declare const getLocalValues: (components: DomainComponent[]) => LocalValue;
|
|
5
6
|
export declare const mergeLocalValues: (valueA: LocalValue, valueB: LocalValue) => LocalValue;
|
|
6
7
|
export declare const mergeModels: (valueA: Model, valueB: Model) => Model;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "3.16.
|
|
3
|
+
"version": "3.16.7",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.min.js",
|
|
@@ -36,26 +36,26 @@
|
|
|
36
36
|
"@cfaester/enzyme-adapter-react-18": "0.8.0",
|
|
37
37
|
"@chromatic-com/storybook": "1.6.1",
|
|
38
38
|
"@formatjs/cli": "^6.2.12",
|
|
39
|
-
"@storybook/addon-a11y": "^8.2.
|
|
40
|
-
"@storybook/addon-actions": "^8.2.
|
|
41
|
-
"@storybook/addon-essentials": "^8.2.
|
|
42
|
-
"@storybook/addon-interactions": "^8.2.
|
|
43
|
-
"@storybook/addon-links": "^8.2.
|
|
39
|
+
"@storybook/addon-a11y": "^8.2.9",
|
|
40
|
+
"@storybook/addon-actions": "^8.2.9",
|
|
41
|
+
"@storybook/addon-essentials": "^8.2.9",
|
|
42
|
+
"@storybook/addon-interactions": "^8.2.9",
|
|
43
|
+
"@storybook/addon-links": "^8.2.9",
|
|
44
44
|
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
|
|
45
|
-
"@storybook/manager-api": "^8.2.
|
|
46
|
-
"@storybook/react": "^8.2.
|
|
47
|
-
"@storybook/react-webpack5": "^8.2.
|
|
48
|
-
"@storybook/test": "^8.2.
|
|
49
|
-
"@storybook/types": "^8.2.
|
|
45
|
+
"@storybook/manager-api": "^8.2.9",
|
|
46
|
+
"@storybook/react": "^8.2.9",
|
|
47
|
+
"@storybook/react-webpack5": "^8.2.9",
|
|
48
|
+
"@storybook/test": "^8.2.9",
|
|
49
|
+
"@storybook/types": "^8.2.9",
|
|
50
50
|
"@testing-library/dom": "10.4.0",
|
|
51
51
|
"@testing-library/jest-dom": "6.4.8",
|
|
52
52
|
"@testing-library/react": "16.0.0",
|
|
53
53
|
"@testing-library/react-hooks": "8.0.1",
|
|
54
54
|
"@testing-library/user-event": "14.5.2",
|
|
55
|
-
"@transferwise/components": "46.
|
|
55
|
+
"@transferwise/components": "46.65.0",
|
|
56
56
|
"@transferwise/formatting": "^2.13.0",
|
|
57
57
|
"@transferwise/icons": "3.13.0",
|
|
58
|
-
"@transferwise/neptune-css": "14.
|
|
58
|
+
"@transferwise/neptune-css": "14.15.0",
|
|
59
59
|
"@types/enzyme": "^3.10.18",
|
|
60
60
|
"@types/jest": "29.5.12",
|
|
61
61
|
"@types/react": "18.3.3",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"react": "18.3.1",
|
|
79
79
|
"react-dom": "18.3.1",
|
|
80
80
|
"react-intl": "6.6.8",
|
|
81
|
-
"storybook": "8.2.
|
|
82
|
-
"stylelint": "16.8.
|
|
81
|
+
"storybook": "8.2.9",
|
|
82
|
+
"stylelint": "16.8.2",
|
|
83
83
|
"stylelint-config-standard": "36.0.1",
|
|
84
84
|
"stylelint-no-unsupported-browser-features": "8.0.1",
|
|
85
85
|
"stylelint-value-no-unknown-custom-properties": "6.0.1",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"nanoid": "5.0.7",
|
|
105
105
|
"react-webcam": "^7.2.0",
|
|
106
106
|
"screenfull": "^5.2.0",
|
|
107
|
-
"@wise/dynamic-flow-types": "2.
|
|
107
|
+
"@wise/dynamic-flow-types": "2.20.0"
|
|
108
108
|
},
|
|
109
109
|
"scripts": {
|
|
110
110
|
"dev": "pnpm build:visual-tests && storybook dev -p 3003",
|