@wise/dynamic-flow-client 4.1.0 → 4.2.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 CHANGED
@@ -8444,7 +8444,8 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
8444
8444
  autocompleteHint,
8445
8445
  default: defaultValue,
8446
8446
  minimum: minimumDate,
8447
- maximum: maximumDate
8447
+ maximum: maximumDate,
8448
+ suggestions
8448
8449
  } = schema;
8449
8450
  const { getErrorMessageFunctions, updateComponent, onRefresh, onValueChange } = mapperProps;
8450
8451
  const errorMessageFunctions = getErrorMessageFunctions(schema.validationMessages);
@@ -8469,6 +8470,11 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
8469
8470
  ],
8470
8471
  minimumDate,
8471
8472
  maximumDate,
8473
+ suggestions: suggestions ? {
8474
+ values: suggestions.values.map((suggestion) => __spreadProps(__spreadValues({}, suggestion), {
8475
+ image: mapSpecImage(suggestion.image)
8476
+ }))
8477
+ } : void 0,
8472
8478
  value,
8473
8479
  persistedState,
8474
8480
  validationAsyncState,
@@ -8764,6 +8770,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
8764
8770
  format,
8765
8771
  maxLength,
8766
8772
  minLength,
8773
+ suggestions,
8767
8774
  validationMessages
8768
8775
  } = schema;
8769
8776
  const { getErrorMessageFunctions, updateComponent, onRefresh, onValueChange, logEvent } = mapperProps;
@@ -8794,6 +8801,11 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
8794
8801
  displayFormat,
8795
8802
  maxLength,
8796
8803
  minLength,
8804
+ suggestions: suggestions ? {
8805
+ values: suggestions.values.map((suggestion) => __spreadProps(__spreadValues({}, suggestion), {
8806
+ image: mapSpecImage(suggestion.image)
8807
+ }))
8808
+ } : void 0,
8797
8809
  value,
8798
8810
  persistedState,
8799
8811
  validationAsyncState,
@@ -11447,6 +11459,7 @@ var dateInputComponentToProps = (component, rendererMapperProps) => __spreadProp
11447
11459
  autoComplete: component.autoComplete,
11448
11460
  minimumDate: component.minimumDate,
11449
11461
  maximumDate: component.maximumDate,
11462
+ suggestions: component.suggestions,
11450
11463
  onChange: component.onChange.bind(component)
11451
11464
  });
11452
11465
 
@@ -11713,6 +11726,7 @@ var textInputComponentToProps = (component, rendererMapperProps) => __spreadProp
11713
11726
  displayFormat: component.displayFormat,
11714
11727
  maxLength: component.maxLength,
11715
11728
  minLength: component.minLength,
11729
+ suggestions: component.suggestions,
11716
11730
  onChange: component.onChange.bind(component)
11717
11731
  });
11718
11732
 
package/build/main.mjs CHANGED
@@ -8421,7 +8421,8 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
8421
8421
  autocompleteHint,
8422
8422
  default: defaultValue,
8423
8423
  minimum: minimumDate,
8424
- maximum: maximumDate
8424
+ maximum: maximumDate,
8425
+ suggestions
8425
8426
  } = schema;
8426
8427
  const { getErrorMessageFunctions, updateComponent, onRefresh, onValueChange } = mapperProps;
8427
8428
  const errorMessageFunctions = getErrorMessageFunctions(schema.validationMessages);
@@ -8446,6 +8447,11 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
8446
8447
  ],
8447
8448
  minimumDate,
8448
8449
  maximumDate,
8450
+ suggestions: suggestions ? {
8451
+ values: suggestions.values.map((suggestion) => __spreadProps(__spreadValues({}, suggestion), {
8452
+ image: mapSpecImage(suggestion.image)
8453
+ }))
8454
+ } : void 0,
8449
8455
  value,
8450
8456
  persistedState,
8451
8457
  validationAsyncState,
@@ -8741,6 +8747,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
8741
8747
  format,
8742
8748
  maxLength,
8743
8749
  minLength,
8750
+ suggestions,
8744
8751
  validationMessages
8745
8752
  } = schema;
8746
8753
  const { getErrorMessageFunctions, updateComponent, onRefresh, onValueChange, logEvent } = mapperProps;
@@ -8771,6 +8778,11 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
8771
8778
  displayFormat,
8772
8779
  maxLength,
8773
8780
  minLength,
8781
+ suggestions: suggestions ? {
8782
+ values: suggestions.values.map((suggestion) => __spreadProps(__spreadValues({}, suggestion), {
8783
+ image: mapSpecImage(suggestion.image)
8784
+ }))
8785
+ } : void 0,
8774
8786
  value,
8775
8787
  persistedState,
8776
8788
  validationAsyncState,
@@ -11424,6 +11436,7 @@ var dateInputComponentToProps = (component, rendererMapperProps) => __spreadProp
11424
11436
  autoComplete: component.autoComplete,
11425
11437
  minimumDate: component.minimumDate,
11426
11438
  maximumDate: component.maximumDate,
11439
+ suggestions: component.suggestions,
11427
11440
  onChange: component.onChange.bind(component)
11428
11441
  });
11429
11442
 
@@ -11690,6 +11703,7 @@ var textInputComponentToProps = (component, rendererMapperProps) => __spreadProp
11690
11703
  displayFormat: component.displayFormat,
11691
11704
  maxLength: component.maxLength,
11692
11705
  minLength: component.minLength,
11706
+ suggestions: component.suggestions,
11693
11707
  onChange: component.onChange.bind(component)
11694
11708
  });
11695
11709
 
@@ -1,6 +1,6 @@
1
1
  import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
2
2
  import type { IsInvalidCheck } from '../features/validation/value-checks';
3
- import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationAsyncState } from '../types';
3
+ import type { InputComponent, OnValueChange, PersistedState, RepeatableSummary, Suggestions, UpdateComponent, ValidationAsyncState } from '../types';
4
4
  import type { PerformRefresh } from '../features/refresh/getPerformRefresh';
5
5
  import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
6
6
  export type DateInputComponent = InputComponent<string | null> & {
@@ -8,10 +8,11 @@ export type DateInputComponent = InputComponent<string | null> & {
8
8
  minimumDate?: string;
9
9
  maximumDate?: string;
10
10
  persistedState: PersistedState;
11
+ suggestions?: Suggestions;
11
12
  validationAsyncState: ValidationAsyncState;
12
13
  onChange: (value: string | null) => void;
13
14
  };
14
- export declare const createDateInputComponent: (textInputProps: Pick<DateInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "help" | "hidden" | "icon" | "image" | "minimumDate" | "maximumDate" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationAsyncState"> & {
15
+ export declare const createDateInputComponent: (textInputProps: Pick<DateInputComponent, "uid" | "id" | "analyticsId" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "help" | "hidden" | "icon" | "image" | "minimumDate" | "maximumDate" | "persistedState" | "placeholder" | "required" | "suggestions" | "title" | "value" | "validationAsyncState"> & {
15
16
  checks: IsInvalidCheck<string | null>[];
16
17
  performPersistAsync: PerformPersistAsync | undefined;
17
18
  performRefresh: PerformRefresh | undefined;
@@ -2,7 +2,7 @@ import type { PerformPersistAsync } from '../features/persistAsync/getPerformPer
2
2
  import { type PerformRefresh } from '../features/refresh/getPerformRefresh';
3
3
  import type { IsInvalidCheck } from '../features/validation/value-checks';
4
4
  import type { PerformValidationAsync } from '../features/validationAsync/getPerformValidationAsync';
5
- import type { Autocapitalization, InputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, ValidationAsyncState } from '../types';
5
+ import type { Autocapitalization, InputComponent, OnValueChange, PersistedState, RepeatableSummary, Suggestions, UpdateComponent, ValidationAsyncState } from '../types';
6
6
  export type TextInputComponent = InputComponent<string | null> & {
7
7
  type: 'text';
8
8
  autocapitalization?: Autocapitalization;
@@ -10,10 +10,11 @@ export type TextInputComponent = InputComponent<string | null> & {
10
10
  maxLength?: number;
11
11
  minLength?: number;
12
12
  persistedState: PersistedState;
13
+ suggestions?: Suggestions;
13
14
  validationAsyncState: ValidationAsyncState;
14
15
  onChange: (value: string | null) => void;
15
16
  };
16
- export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "uid" | "id" | "analyticsId" | "autocapitalization" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "displayFormat" | "help" | "hidden" | "icon" | "image" | "maxLength" | "minLength" | "persistedState" | "placeholder" | "required" | "title" | "value" | "validationAsyncState"> & {
17
+ export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "uid" | "id" | "analyticsId" | "autocapitalization" | "autoComplete" | "control" | "errors" | "description" | "disabled" | "displayFormat" | "help" | "hidden" | "icon" | "image" | "maxLength" | "minLength" | "persistedState" | "placeholder" | "required" | "suggestions" | "title" | "value" | "validationAsyncState"> & {
17
18
  checks: IsInvalidCheck<string | null>[];
18
19
  performPersistAsync: PerformPersistAsync | undefined;
19
20
  performValidationAsync: PerformValidationAsync | undefined;
@@ -93,6 +93,16 @@ export type Autocapitalization = 'none' | 'sentences' | 'words' | 'characters';
93
93
  export type Bias = 'none' | 'start' | 'end';
94
94
  export type Context = 'positive' | 'negative' | 'warning' | 'neutral';
95
95
  export type UploadSource = 'file' | 'camera';
96
+ export type Suggestions = {
97
+ values: SuggestionsValue[];
98
+ };
99
+ export type SuggestionsValue = {
100
+ label: string;
101
+ value?: JsonElement;
102
+ icon?: Icon;
103
+ image?: Image;
104
+ tag?: string;
105
+ };
96
106
  export type RepeatableSummary = {
97
107
  title?: string;
98
108
  description?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.js",