@wise/dynamic-flow-client 3.21.2 → 3.22.1
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/i18n/de.json +2 -1
- package/build/i18n/en.json +2 -1
- package/build/i18n/es.json +2 -1
- package/build/i18n/fr.json +2 -1
- package/build/i18n/hu.json +2 -1
- package/build/i18n/id.json +2 -1
- package/build/i18n/it.json +2 -1
- package/build/i18n/ja.json +2 -1
- package/build/i18n/pl.json +2 -1
- package/build/i18n/pt.json +2 -1
- package/build/i18n/ro.json +2 -1
- package/build/i18n/ru.json +2 -1
- package/build/i18n/th.json +2 -1
- package/build/i18n/tr.json +2 -1
- package/build/i18n/zh_CN.json +2 -1
- package/build/i18n/zh_HK.json +2 -1
- package/build/main.css +14 -0
- package/build/main.js +822 -492
- package/build/main.min.js +1 -1
- package/build/main.mjs +686 -356
- package/build/types/common/messages/search.messages.d.ts +8 -0
- package/build/types/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +1 -0
- package/build/types/legacy/layout/list/DynamicStatusList.d.ts +1 -1
- package/build/types/legacy/test-utils/index.d.ts +1 -1
- package/build/types/legacy/test-utils/legacy-utils.d.ts +1 -15
- package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +3 -3
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +3 -3
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +3 -3
- package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +3 -3
- package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +3 -0
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +3 -3
- package/build/types/revamp/domain/components/{repeatableComponent/RepeatableComponent.d.ts → RepeatableComponent.d.ts} +3 -3
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +1 -0
- package/build/types/revamp/domain/components/StatusListComponent.d.ts +19 -2
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +3 -3
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -0
- package/build/types/revamp/domain/features/validationAsync/getComponentValidationAsync.d.ts +2 -2
- package/build/types/revamp/domain/features/validationAsync/getInitialValidationAsyncState.d.ts +2 -0
- package/build/types/revamp/domain/mappers/layout/statusListLayoutToComponent.d.ts +2 -1
- package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/utils/mapCommonSchemaProps.d.ts +1 -1
- package/build/types/revamp/domain/types.d.ts +5 -4
- package/build/types/revamp/renderers/mappers/repeatableComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/utils/inputComponentToProps.d.ts +3 -1
- package/build/types/revamp/renderers/mappers/utils/mapErrorsToValidationState.d.ts +2 -0
- package/build/types/revamp/utils/type-utils.d.ts +1 -1
- package/package.json +11 -13
- package/build/types/legacy/dynamicFlow/tests/DynamicFlow.legacy.spec.d.ts +0 -1
- package/build/types/legacy/formControl/FormControl.spec.d.ts +0 -1
- package/build/types/legacy/jsonSchemaForm/JsonSchemaForm.spec.d.ts +0 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/ArrayTypeSchema.spec.d.ts +0 -1
- package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.errors.spec.d.ts +0 -1
- package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.spec.d.ts +0 -1
- package/build/types/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.spec.d.ts +0 -1
- package/build/types/legacy/jsonSchemaForm/genericSchema/GenericSchema.spec.d.ts +0 -1
- package/build/types/legacy/jsonSchemaForm/help/Help.spec.d.ts +0 -1
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.spec.d.ts +0 -1
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.spec.d.ts +0 -1
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.spec.d.ts +0 -1
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.spec.d.ts +0 -1
- package/build/types/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.spec.d.ts +0 -1
- package/build/types/legacy/layout/DynamicLayout.end-to-end.spec.d.ts +0 -1
- package/build/types/legacy/layout/DynamicLayout.spec.d.ts +0 -1
- package/build/types/legacy/layout/box/DynamicBox.spec.d.ts +0 -1
- package/build/types/legacy/layout/columns/DynamicColumns.spec.d.ts +0 -1
- package/build/types/legacy/layout/decision/DynamicDecision.spec.d.ts +0 -1
- package/build/types/legacy/layout/divider/DynamicDivider.spec.d.ts +0 -1
- package/build/types/legacy/layout/form/DynamicForm.spec.d.ts +0 -1
- package/build/types/legacy/step/layoutStep/LayoutStep.spec.d.ts +0 -1
- package/build/types/revamp/domain/features/validationAsync/getInitialValidationState.d.ts +0 -2
package/build/main.js
CHANGED
|
@@ -524,7 +524,8 @@ var de_default = {
|
|
|
524
524
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "Bitte lade mindestens {minItems} Datei(en) hoch.",
|
|
525
525
|
"dynamicFlows.PersistAsyncSchema.genericError": "Da ist etwas schiefgegangen. Versuche es bitte nochmal.",
|
|
526
526
|
"dynamicFlows.ReadOnlySchema.no": "Nein",
|
|
527
|
-
"dynamicFlows.ReadOnlySchema.yes": "Ja"
|
|
527
|
+
"dynamicFlows.ReadOnlySchema.yes": "Ja",
|
|
528
|
+
"dynamicFlows.SearchLayout.loading": "L\xE4dt..."
|
|
528
529
|
};
|
|
529
530
|
|
|
530
531
|
// src/i18n/en.json
|
|
@@ -574,7 +575,8 @@ var en_default = {
|
|
|
574
575
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "Please upload at least {minItems} file(s).",
|
|
575
576
|
"dynamicFlows.PersistAsyncSchema.genericError": "Something went wrong, please try again.",
|
|
576
577
|
"dynamicFlows.ReadOnlySchema.no": "No",
|
|
577
|
-
"dynamicFlows.ReadOnlySchema.yes": "Yes"
|
|
578
|
+
"dynamicFlows.ReadOnlySchema.yes": "Yes",
|
|
579
|
+
"dynamicFlows.SearchLayout.loading": "Loading..."
|
|
578
580
|
};
|
|
579
581
|
|
|
580
582
|
// src/i18n/es.json
|
|
@@ -624,7 +626,8 @@ var es_default = {
|
|
|
624
626
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "Sube al menos {minItems} archivo(s).",
|
|
625
627
|
"dynamicFlows.PersistAsyncSchema.genericError": "Ha habido un error. Int\xE9ntalo de nuevo.",
|
|
626
628
|
"dynamicFlows.ReadOnlySchema.no": "No",
|
|
627
|
-
"dynamicFlows.ReadOnlySchema.yes": "S\xED"
|
|
629
|
+
"dynamicFlows.ReadOnlySchema.yes": "S\xED",
|
|
630
|
+
"dynamicFlows.SearchLayout.loading": "Cargando..."
|
|
628
631
|
};
|
|
629
632
|
|
|
630
633
|
// src/i18n/fr.json
|
|
@@ -674,7 +677,8 @@ var fr_default = {
|
|
|
674
677
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "Veuillez t\xE9l\xE9charger au moins {minItems} fichier(s).",
|
|
675
678
|
"dynamicFlows.PersistAsyncSchema.genericError": "Une erreur s'est produite, veuillez r\xE9essayer.",
|
|
676
679
|
"dynamicFlows.ReadOnlySchema.no": "Non",
|
|
677
|
-
"dynamicFlows.ReadOnlySchema.yes": "Oui"
|
|
680
|
+
"dynamicFlows.ReadOnlySchema.yes": "Oui",
|
|
681
|
+
"dynamicFlows.SearchLayout.loading": "Chargement..."
|
|
678
682
|
};
|
|
679
683
|
|
|
680
684
|
// src/i18n/hu.json
|
|
@@ -724,7 +728,8 @@ var hu_default = {
|
|
|
724
728
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "K\xE9r\xFCnk, hogy legal\xE1bb {minItems} f\xE1jlt t\xF6lts fel.",
|
|
725
729
|
"dynamicFlows.PersistAsyncSchema.genericError": "Valami hiba t\xF6rt\xE9nt. K\xE9r\xFCnk, pr\xF3b\xE1ld \xFAjra.",
|
|
726
730
|
"dynamicFlows.ReadOnlySchema.no": "Nem",
|
|
727
|
-
"dynamicFlows.ReadOnlySchema.yes": "Igen"
|
|
731
|
+
"dynamicFlows.ReadOnlySchema.yes": "Igen",
|
|
732
|
+
"dynamicFlows.SearchLayout.loading": "Bet\xF6lt\xE9s..."
|
|
728
733
|
};
|
|
729
734
|
|
|
730
735
|
// src/i18n/id.json
|
|
@@ -774,7 +779,8 @@ var id_default = {
|
|
|
774
779
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "Harap unggah sedikitnya {minItems} file.",
|
|
775
780
|
"dynamicFlows.PersistAsyncSchema.genericError": "Terjadi kesalahan, mohon coba lagi.",
|
|
776
781
|
"dynamicFlows.ReadOnlySchema.no": "Tidak",
|
|
777
|
-
"dynamicFlows.ReadOnlySchema.yes": "Ya"
|
|
782
|
+
"dynamicFlows.ReadOnlySchema.yes": "Ya",
|
|
783
|
+
"dynamicFlows.SearchLayout.loading": "Memuat..."
|
|
778
784
|
};
|
|
779
785
|
|
|
780
786
|
// src/i18n/it.json
|
|
@@ -824,7 +830,8 @@ var it_default = {
|
|
|
824
830
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "Carica almeno {minItems} file.",
|
|
825
831
|
"dynamicFlows.PersistAsyncSchema.genericError": "Qualcosa \xE8 andato storto. Riprova.",
|
|
826
832
|
"dynamicFlows.ReadOnlySchema.no": "No",
|
|
827
|
-
"dynamicFlows.ReadOnlySchema.yes": "S\xEC"
|
|
833
|
+
"dynamicFlows.ReadOnlySchema.yes": "S\xEC",
|
|
834
|
+
"dynamicFlows.SearchLayout.loading": "Caricamento..."
|
|
828
835
|
};
|
|
829
836
|
|
|
830
837
|
// src/i18n/ja.json
|
|
@@ -874,7 +881,8 @@ var ja_default = {
|
|
|
874
881
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "{minItems}\u500B\u4EE5\u4E0A\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
875
882
|
"dynamicFlows.PersistAsyncSchema.genericError": "\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u518D\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",
|
|
876
883
|
"dynamicFlows.ReadOnlySchema.no": "\u3044\u3044\u3048",
|
|
877
|
-
"dynamicFlows.ReadOnlySchema.yes": "\u306F\u3044"
|
|
884
|
+
"dynamicFlows.ReadOnlySchema.yes": "\u306F\u3044",
|
|
885
|
+
"dynamicFlows.SearchLayout.loading": "\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"
|
|
878
886
|
};
|
|
879
887
|
|
|
880
888
|
// src/i18n/pl.json
|
|
@@ -924,7 +932,8 @@ var pl_default = {
|
|
|
924
932
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "Prze\u015Blij co najmniej nast\u0119puj\u0105c\u0105 liczb\u0119 plik\xF3w: {minItems}.",
|
|
925
933
|
"dynamicFlows.PersistAsyncSchema.genericError": "Wyst\u0105pi\u0142 b\u0142\u0105d, prosimy spr\xF3bowa\u0107 ponownie.",
|
|
926
934
|
"dynamicFlows.ReadOnlySchema.no": "Nie",
|
|
927
|
-
"dynamicFlows.ReadOnlySchema.yes": "Tak"
|
|
935
|
+
"dynamicFlows.ReadOnlySchema.yes": "Tak",
|
|
936
|
+
"dynamicFlows.SearchLayout.loading": "Trwa \u0142adowanie..."
|
|
928
937
|
};
|
|
929
938
|
|
|
930
939
|
// src/i18n/pt.json
|
|
@@ -974,7 +983,8 @@ var pt_default = {
|
|
|
974
983
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "Por favor, envie pelo menos {minItems} arquivo(s).",
|
|
975
984
|
"dynamicFlows.PersistAsyncSchema.genericError": "Ocorreu um erro. Por favor, tente novamente.",
|
|
976
985
|
"dynamicFlows.ReadOnlySchema.no": "N\xE3o",
|
|
977
|
-
"dynamicFlows.ReadOnlySchema.yes": "Sim"
|
|
986
|
+
"dynamicFlows.ReadOnlySchema.yes": "Sim",
|
|
987
|
+
"dynamicFlows.SearchLayout.loading": "Carregando..."
|
|
978
988
|
};
|
|
979
989
|
|
|
980
990
|
// src/i18n/ro.json
|
|
@@ -1024,7 +1034,8 @@ var ro_default = {
|
|
|
1024
1034
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "Te rug\u0103m s\u0103 \xEEncarci cel pu\u021Bin {minItems} fi\u0219ier(e).",
|
|
1025
1035
|
"dynamicFlows.PersistAsyncSchema.genericError": "Ceva nu a mers bine, te rug\u0103m s\u0103 \xEEncerci din nou.",
|
|
1026
1036
|
"dynamicFlows.ReadOnlySchema.no": "Nu",
|
|
1027
|
-
"dynamicFlows.ReadOnlySchema.yes": "Da"
|
|
1037
|
+
"dynamicFlows.ReadOnlySchema.yes": "Da",
|
|
1038
|
+
"dynamicFlows.SearchLayout.loading": "Se \xEEncarc\u0103..."
|
|
1028
1039
|
};
|
|
1029
1040
|
|
|
1030
1041
|
// src/i18n/ru.json
|
|
@@ -1074,7 +1085,8 @@ var ru_default = {
|
|
|
1074
1085
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u043F\u043E \u043A\u0440\u0430\u0439\u043D\u0435\u0439 \u043C\u0435\u0440\u0435 {minItems} \u0444\u0430\u0439\u043B(-\u0430/\u043E\u0432).",
|
|
1075
1086
|
"dynamicFlows.PersistAsyncSchema.genericError": "\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A, \u043F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437.",
|
|
1076
1087
|
"dynamicFlows.ReadOnlySchema.no": "\u041D\u0435\u0442",
|
|
1077
|
-
"dynamicFlows.ReadOnlySchema.yes": "\u0414\u0430"
|
|
1088
|
+
"dynamicFlows.ReadOnlySchema.yes": "\u0414\u0430",
|
|
1089
|
+
"dynamicFlows.SearchLayout.loading": "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430..."
|
|
1078
1090
|
};
|
|
1079
1091
|
|
|
1080
1092
|
// src/i18n/th.json
|
|
@@ -1124,7 +1136,8 @@ var th_default = {
|
|
|
1124
1136
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u0E42\u0E1B\u0E23\u0E14\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 {minItems} \u0E44\u0E1F\u0E25\u0E4C",
|
|
1125
1137
|
"dynamicFlows.PersistAsyncSchema.genericError": "\u0E40\u0E01\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14\u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07 \u0E42\u0E1B\u0E23\u0E14\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
|
|
1126
1138
|
"dynamicFlows.ReadOnlySchema.no": "\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48",
|
|
1127
|
-
"dynamicFlows.ReadOnlySchema.yes": "\u0E43\u0E0A\u0E48"
|
|
1139
|
+
"dynamicFlows.ReadOnlySchema.yes": "\u0E43\u0E0A\u0E48",
|
|
1140
|
+
"dynamicFlows.SearchLayout.loading": "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14..."
|
|
1128
1141
|
};
|
|
1129
1142
|
|
|
1130
1143
|
// src/i18n/tr.json
|
|
@@ -1174,7 +1187,8 @@ var tr_default = {
|
|
|
1174
1187
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "L\xFCtfen en az {minItems} dosya y\xFCkleyin.",
|
|
1175
1188
|
"dynamicFlows.PersistAsyncSchema.genericError": "Bir \u015Feyler ters gitti, l\xFCtfen tekrar deneyin.",
|
|
1176
1189
|
"dynamicFlows.ReadOnlySchema.no": "Hay\u0131r",
|
|
1177
|
-
"dynamicFlows.ReadOnlySchema.yes": "Evet"
|
|
1190
|
+
"dynamicFlows.ReadOnlySchema.yes": "Evet",
|
|
1191
|
+
"dynamicFlows.SearchLayout.loading": "Y\xFCkleniyor..."
|
|
1178
1192
|
};
|
|
1179
1193
|
|
|
1180
1194
|
// src/i18n/zh_CN.json
|
|
@@ -1224,7 +1238,8 @@ var zh_CN_default = {
|
|
|
1224
1238
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u8BF7\u4E0A\u4F20\u81F3\u5C11 {minItems} \u4E2A\u6587\u4EF6\u3002",
|
|
1225
1239
|
"dynamicFlows.PersistAsyncSchema.genericError": "\u51FA\u9519\u4E86\uFF0C\u8BF7\u91CD\u8BD5\u3002",
|
|
1226
1240
|
"dynamicFlows.ReadOnlySchema.no": "\u5426",
|
|
1227
|
-
"dynamicFlows.ReadOnlySchema.yes": "\u662F"
|
|
1241
|
+
"dynamicFlows.ReadOnlySchema.yes": "\u662F",
|
|
1242
|
+
"dynamicFlows.SearchLayout.loading": "\u6B63\u5728\u52A0\u8F7D\u2026"
|
|
1228
1243
|
};
|
|
1229
1244
|
|
|
1230
1245
|
// src/i18n/zh_HK.json
|
|
@@ -1274,7 +1289,8 @@ var zh_HK_default = {
|
|
|
1274
1289
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u8ACB\u4E0A\u8F09\u81F3\u5C11{minItems}\u500B\u6A94\u6848\u3002",
|
|
1275
1290
|
"dynamicFlows.PersistAsyncSchema.genericError": "\u51FA\u73FE\u4E86\u554F\u984C\uFF0C\u8ACB\u518D\u8A66\u4E00\u6B21\u3002",
|
|
1276
1291
|
"dynamicFlows.ReadOnlySchema.no": "\u5426",
|
|
1277
|
-
"dynamicFlows.ReadOnlySchema.yes": "\u662F"
|
|
1292
|
+
"dynamicFlows.ReadOnlySchema.yes": "\u662F",
|
|
1293
|
+
"dynamicFlows.SearchLayout.loading": "\u8F09\u5165\u4E2D\u2026"
|
|
1278
1294
|
};
|
|
1279
1295
|
|
|
1280
1296
|
// src/i18n/index.ts
|
|
@@ -1472,9 +1488,20 @@ var allOfComponentToProps = ({ control, description, help, title }, children) =>
|
|
|
1472
1488
|
title
|
|
1473
1489
|
});
|
|
1474
1490
|
|
|
1491
|
+
// src/revamp/renderers/mappers/utils/mapErrorsToValidationState.ts
|
|
1492
|
+
var mapErrorsToValidationState = (errors) => {
|
|
1493
|
+
if (errors) {
|
|
1494
|
+
if (errors.length > 0) {
|
|
1495
|
+
return { status: "invalid", message: errors[0] };
|
|
1496
|
+
}
|
|
1497
|
+
return { status: "valid" };
|
|
1498
|
+
}
|
|
1499
|
+
return void 0;
|
|
1500
|
+
};
|
|
1501
|
+
|
|
1475
1502
|
// src/revamp/renderers/mappers/utils/inputComponentToProps.ts
|
|
1476
1503
|
var inputComponentToProps = (component, type) => {
|
|
1477
|
-
var _a
|
|
1504
|
+
var _a;
|
|
1478
1505
|
const {
|
|
1479
1506
|
autoComplete,
|
|
1480
1507
|
control,
|
|
@@ -1486,29 +1513,40 @@ var inputComponentToProps = (component, type) => {
|
|
|
1486
1513
|
placeholder,
|
|
1487
1514
|
required,
|
|
1488
1515
|
title,
|
|
1516
|
+
validationAsyncState,
|
|
1489
1517
|
onBlur,
|
|
1490
1518
|
onFocus
|
|
1491
1519
|
} = component;
|
|
1492
|
-
const
|
|
1493
|
-
const { messages } = validationState != null ? validationState : {};
|
|
1520
|
+
const { messages } = validationAsyncState != null ? validationAsyncState : {};
|
|
1494
1521
|
return {
|
|
1495
1522
|
type,
|
|
1496
1523
|
autoComplete,
|
|
1497
1524
|
control,
|
|
1498
|
-
description
|
|
1525
|
+
description,
|
|
1499
1526
|
disabled,
|
|
1500
|
-
error: (
|
|
1527
|
+
error: (_a = messages == null ? void 0 : messages.error) != null ? _a : errors == null ? void 0 : errors[0],
|
|
1501
1528
|
help,
|
|
1502
1529
|
id,
|
|
1503
1530
|
label: title,
|
|
1504
1531
|
placeholder,
|
|
1505
1532
|
required,
|
|
1533
|
+
validationState: getValidationState(errors, validationAsyncState),
|
|
1506
1534
|
value: component.getLocalValue(),
|
|
1507
1535
|
onBlur: onBlur.bind(component),
|
|
1508
1536
|
onFocus: onFocus.bind(component)
|
|
1509
1537
|
};
|
|
1510
1538
|
};
|
|
1511
|
-
var
|
|
1539
|
+
var getValidationState = (errors, validationAsyncState) => {
|
|
1540
|
+
if (validationAsyncState) {
|
|
1541
|
+
if (validationAsyncState == null ? void 0 : validationAsyncState.messages.error) {
|
|
1542
|
+
return { status: "invalid", message: validationAsyncState == null ? void 0 : validationAsyncState.messages.error };
|
|
1543
|
+
}
|
|
1544
|
+
if (validationAsyncState == null ? void 0 : validationAsyncState.messages.success) {
|
|
1545
|
+
return { status: "valid", message: validationAsyncState == null ? void 0 : validationAsyncState.messages.success };
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
return mapErrorsToValidationState(errors);
|
|
1549
|
+
};
|
|
1512
1550
|
|
|
1513
1551
|
// src/revamp/renderers/mappers/booleanInputComponentToProps.ts
|
|
1514
1552
|
var booleanInputComponentToProps = (component) => {
|
|
@@ -1666,15 +1704,14 @@ var modalComponentToProps = ({ content, control, margin, trigger }, components)
|
|
|
1666
1704
|
|
|
1667
1705
|
// src/revamp/renderers/mappers/multiUploadInputComponentToProps.ts
|
|
1668
1706
|
var multiUploadInputComponentToProps = (component) => {
|
|
1669
|
-
const { accepts, fileMap, maxSize, minItems, maxItems, uploadLabel } = component;
|
|
1670
|
-
const
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
});
|
|
1707
|
+
const { accepts, errorsMap, fileMap, maxSize, minItems, maxItems, uploadLabel } = component;
|
|
1708
|
+
const fileList = Object.entries(fileMap).map(
|
|
1709
|
+
([id, file]) => ({
|
|
1710
|
+
id,
|
|
1711
|
+
file,
|
|
1712
|
+
validationState: mapErrorsToValidationState(errorsMap[id])
|
|
1713
|
+
})
|
|
1714
|
+
);
|
|
1678
1715
|
return __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-upload-multi")), {
|
|
1679
1716
|
accepts,
|
|
1680
1717
|
maxSize,
|
|
@@ -1756,11 +1793,12 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
|
|
|
1756
1793
|
description,
|
|
1757
1794
|
editableItem: editableItemChildren,
|
|
1758
1795
|
editItemTitle,
|
|
1796
|
+
error: errors == null ? void 0 : errors[0],
|
|
1759
1797
|
items: itemProps,
|
|
1760
1798
|
maxItems,
|
|
1761
1799
|
minItems,
|
|
1762
1800
|
title,
|
|
1763
|
-
|
|
1801
|
+
validationState: mapErrorsToValidationState(errors),
|
|
1764
1802
|
onAdd: onAdd.bind(component),
|
|
1765
1803
|
onEdit: onEdit.bind(component),
|
|
1766
1804
|
onSave: onSave.bind(component),
|
|
@@ -7392,18 +7430,18 @@ var getDebouncedPerformRefresh = (performRefresh) => performRefresh ? debounce(p
|
|
|
7392
7430
|
// src/revamp/domain/features/validationAsync/getComponentValidationAsync.ts
|
|
7393
7431
|
var getComponentValidationAsync = (update, performValidationAsync) => (
|
|
7394
7432
|
/**
|
|
7395
|
-
* Will update the
|
|
7433
|
+
* Will update the validationAsyncState when a new request is made, and will update
|
|
7396
7434
|
* the description or set errors when the request completes.
|
|
7397
7435
|
*/
|
|
7398
|
-
async (
|
|
7399
|
-
const { abortController, lastSubmitted } =
|
|
7436
|
+
async (validationAsyncState, currentValue) => {
|
|
7437
|
+
const { abortController, lastSubmitted } = validationAsyncState;
|
|
7400
7438
|
if (lastSubmitted === currentValue) {
|
|
7401
7439
|
return;
|
|
7402
7440
|
}
|
|
7403
7441
|
const newAbortController = abortAndResetController(abortController);
|
|
7404
7442
|
if (isNullish(currentValue)) {
|
|
7405
7443
|
update((draft) => {
|
|
7406
|
-
draft.
|
|
7444
|
+
draft.validationAsyncState = {
|
|
7407
7445
|
abortController: newAbortController,
|
|
7408
7446
|
lastSubmitted: currentValue,
|
|
7409
7447
|
messages: {}
|
|
@@ -7415,7 +7453,7 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
|
|
|
7415
7453
|
const newSubmission = performValidationAsync({ value: currentValue, signal }).then((message) => {
|
|
7416
7454
|
update((draft) => {
|
|
7417
7455
|
if (message) {
|
|
7418
|
-
draft.
|
|
7456
|
+
draft.validationAsyncState.messages.success = message;
|
|
7419
7457
|
}
|
|
7420
7458
|
});
|
|
7421
7459
|
return message;
|
|
@@ -7424,11 +7462,11 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
|
|
|
7424
7462
|
return null;
|
|
7425
7463
|
}
|
|
7426
7464
|
update((draft) => {
|
|
7427
|
-
draft.
|
|
7465
|
+
draft.validationAsyncState.messages.error = error.message;
|
|
7428
7466
|
});
|
|
7429
7467
|
});
|
|
7430
7468
|
update((draft) => {
|
|
7431
|
-
draft.
|
|
7469
|
+
draft.validationAsyncState = {
|
|
7432
7470
|
abortController: newAbortController,
|
|
7433
7471
|
lastSubmitted: currentValue,
|
|
7434
7472
|
messages: {}
|
|
@@ -7483,7 +7521,7 @@ var createNumberInputComponent = (numberInputProps, updateComponent) => {
|
|
|
7483
7521
|
onChange(updatedValue) {
|
|
7484
7522
|
update((draft) => {
|
|
7485
7523
|
draft.errors = [];
|
|
7486
|
-
draft.
|
|
7524
|
+
draft.validationAsyncState.messages = {};
|
|
7487
7525
|
draft.value = updatedValue;
|
|
7488
7526
|
});
|
|
7489
7527
|
performDebouncedRefresh == null ? void 0 : performDebouncedRefresh();
|
|
@@ -7532,7 +7570,7 @@ var createNumberInputComponent = (numberInputProps, updateComponent) => {
|
|
|
7532
7570
|
return __spreadProps(__spreadValues({}, numberComponent), {
|
|
7533
7571
|
onBlur() {
|
|
7534
7572
|
if (this.validate()) {
|
|
7535
|
-
validateAsync(this.
|
|
7573
|
+
validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
|
|
7536
7574
|
});
|
|
7537
7575
|
}
|
|
7538
7576
|
}
|
|
@@ -7844,7 +7882,7 @@ var mapCommonSchemaProps = (schemaMapperProps) => {
|
|
|
7844
7882
|
control,
|
|
7845
7883
|
description,
|
|
7846
7884
|
disabled: schemaHasDisabled(schema) ? schema.disabled : false,
|
|
7847
|
-
errors: isString(validationErrors) ? [validationErrors] :
|
|
7885
|
+
errors: isString(validationErrors) ? [validationErrors] : void 0,
|
|
7848
7886
|
hidden: Boolean(hidden),
|
|
7849
7887
|
keywords,
|
|
7850
7888
|
required: Boolean(required),
|
|
@@ -7903,8 +7941,8 @@ var getValidationMessage = (json) => {
|
|
|
7903
7941
|
return isString(message) ? message : null;
|
|
7904
7942
|
};
|
|
7905
7943
|
|
|
7906
|
-
// src/revamp/domain/features/validationAsync/
|
|
7907
|
-
var
|
|
7944
|
+
// src/revamp/domain/features/validationAsync/getInitialValidationAsyncState.ts
|
|
7945
|
+
var getInitialValidationAsyncState = () => ({
|
|
7908
7946
|
abortController: new AbortController(),
|
|
7909
7947
|
lastSubmitted: null,
|
|
7910
7948
|
messages: {}
|
|
@@ -7913,8 +7951,8 @@ var getInitialValidationState = () => ({
|
|
|
7913
7951
|
// src/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.ts
|
|
7914
7952
|
var getValidationAsyncInitialState = (schemaMapperProps, mapperProps) => {
|
|
7915
7953
|
const performValidationAsync = getValidationAsyncFn(schemaMapperProps, mapperProps);
|
|
7916
|
-
const
|
|
7917
|
-
return { performValidationAsync,
|
|
7954
|
+
const validationAsyncState = getInitialValidationAsyncState();
|
|
7955
|
+
return { performValidationAsync, validationAsyncState };
|
|
7918
7956
|
};
|
|
7919
7957
|
var getValidationAsyncFn = (schemaMapperProps, mapperProps) => {
|
|
7920
7958
|
const { schema } = schemaMapperProps;
|
|
@@ -7943,7 +7981,7 @@ var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
7943
7981
|
schemaMapperProps,
|
|
7944
7982
|
mapperProps
|
|
7945
7983
|
);
|
|
7946
|
-
const { performValidationAsync,
|
|
7984
|
+
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
7947
7985
|
schemaMapperProps,
|
|
7948
7986
|
mapperProps
|
|
7949
7987
|
);
|
|
@@ -7962,7 +8000,7 @@ var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
7962
8000
|
maximum,
|
|
7963
8001
|
minimum,
|
|
7964
8002
|
persistedState,
|
|
7965
|
-
|
|
8003
|
+
validationAsyncState,
|
|
7966
8004
|
performPersistAsync,
|
|
7967
8005
|
performRefresh: getPerformRefresh(schema, onRefresh),
|
|
7968
8006
|
performValidationAsync,
|
|
@@ -8224,7 +8262,7 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
|
|
|
8224
8262
|
onChange(updatedValue) {
|
|
8225
8263
|
update((draft) => {
|
|
8226
8264
|
draft.errors = [];
|
|
8227
|
-
draft.
|
|
8265
|
+
draft.validationAsyncState.messages = {};
|
|
8228
8266
|
draft.value = updatedValue;
|
|
8229
8267
|
});
|
|
8230
8268
|
performDebouncedRefresh == null ? void 0 : performDebouncedRefresh();
|
|
@@ -8273,7 +8311,7 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
|
|
|
8273
8311
|
return __spreadProps(__spreadValues({}, integerComponent), {
|
|
8274
8312
|
onBlur() {
|
|
8275
8313
|
if (this.validate()) {
|
|
8276
|
-
validateAsync(this.
|
|
8314
|
+
validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
|
|
8277
8315
|
});
|
|
8278
8316
|
}
|
|
8279
8317
|
}
|
|
@@ -8292,7 +8330,7 @@ var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8292
8330
|
schemaMapperProps,
|
|
8293
8331
|
mapperProps
|
|
8294
8332
|
);
|
|
8295
|
-
const { performValidationAsync,
|
|
8333
|
+
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
8296
8334
|
schemaMapperProps,
|
|
8297
8335
|
mapperProps
|
|
8298
8336
|
);
|
|
@@ -8312,7 +8350,7 @@ var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8312
8350
|
minimum,
|
|
8313
8351
|
persistedState,
|
|
8314
8352
|
value,
|
|
8315
|
-
|
|
8353
|
+
validationAsyncState,
|
|
8316
8354
|
performPersistAsync,
|
|
8317
8355
|
performRefresh: getPerformRefresh(schema, onRefresh),
|
|
8318
8356
|
performValidationAsync,
|
|
@@ -8515,7 +8553,7 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
|
|
|
8515
8553
|
onChange(updatedValue) {
|
|
8516
8554
|
update((draft) => {
|
|
8517
8555
|
draft.errors = [];
|
|
8518
|
-
draft.
|
|
8556
|
+
draft.validationAsyncState.messages = {};
|
|
8519
8557
|
draft.value = updatedValue;
|
|
8520
8558
|
});
|
|
8521
8559
|
performRefresh == null ? void 0 : performRefresh();
|
|
@@ -8566,7 +8604,7 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
|
|
|
8566
8604
|
return __spreadProps(__spreadValues({}, dateInputComponent), {
|
|
8567
8605
|
onBlur() {
|
|
8568
8606
|
if (this.validate()) {
|
|
8569
|
-
validateAsync(this.
|
|
8607
|
+
validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
|
|
8570
8608
|
});
|
|
8571
8609
|
}
|
|
8572
8610
|
}
|
|
@@ -8590,7 +8628,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8590
8628
|
schemaMapperProps,
|
|
8591
8629
|
mapperProps
|
|
8592
8630
|
);
|
|
8593
|
-
const { performValidationAsync,
|
|
8631
|
+
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
8594
8632
|
schemaMapperProps,
|
|
8595
8633
|
mapperProps
|
|
8596
8634
|
);
|
|
@@ -8609,7 +8647,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8609
8647
|
maximumDate,
|
|
8610
8648
|
value,
|
|
8611
8649
|
persistedState,
|
|
8612
|
-
|
|
8650
|
+
validationAsyncState,
|
|
8613
8651
|
performPersistAsync,
|
|
8614
8652
|
performRefresh: getPerformRefresh(schema, onRefresh),
|
|
8615
8653
|
performValidationAsync,
|
|
@@ -8821,7 +8859,7 @@ var createTextInputComponent = (textInputProps, updateComponent) => {
|
|
|
8821
8859
|
onChange(updatedValue) {
|
|
8822
8860
|
update((draft) => {
|
|
8823
8861
|
draft.errors = [];
|
|
8824
|
-
draft.
|
|
8862
|
+
draft.validationAsyncState.messages = {};
|
|
8825
8863
|
draft.value = updatedValue;
|
|
8826
8864
|
});
|
|
8827
8865
|
performDebouncedRefresh == null ? void 0 : performDebouncedRefresh();
|
|
@@ -8870,7 +8908,7 @@ var createTextInputComponent = (textInputProps, updateComponent) => {
|
|
|
8870
8908
|
return __spreadProps(__spreadValues({}, inputComponent), {
|
|
8871
8909
|
onBlur() {
|
|
8872
8910
|
if (this.validate()) {
|
|
8873
|
-
validateAsync(this.
|
|
8911
|
+
validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
|
|
8874
8912
|
});
|
|
8875
8913
|
}
|
|
8876
8914
|
}
|
|
@@ -8899,7 +8937,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8899
8937
|
schemaMapperProps,
|
|
8900
8938
|
mapperProps
|
|
8901
8939
|
);
|
|
8902
|
-
const { performValidationAsync,
|
|
8940
|
+
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
8903
8941
|
schemaMapperProps,
|
|
8904
8942
|
mapperProps
|
|
8905
8943
|
);
|
|
@@ -8921,7 +8959,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8921
8959
|
minLength,
|
|
8922
8960
|
value,
|
|
8923
8961
|
persistedState,
|
|
8924
|
-
|
|
8962
|
+
validationAsyncState,
|
|
8925
8963
|
performPersistAsync,
|
|
8926
8964
|
performRefresh: getPerformRefresh(schema, onRefresh),
|
|
8927
8965
|
performValidationAsync,
|
|
@@ -8973,7 +9011,7 @@ var createContainerComponent = (containerProps) => __spreadProps(__spreadValues(
|
|
|
8973
9011
|
}
|
|
8974
9012
|
});
|
|
8975
9013
|
|
|
8976
|
-
// src/revamp/domain/components/
|
|
9014
|
+
// src/revamp/domain/components/RepeatableComponent.ts
|
|
8977
9015
|
var createRepeatableComponent = (repeatableProps, updateComponent) => {
|
|
8978
9016
|
const _a = repeatableProps, {
|
|
8979
9017
|
uid,
|
|
@@ -9118,7 +9156,8 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9118
9156
|
schema: items,
|
|
9119
9157
|
localValue: editableValue,
|
|
9120
9158
|
model: localValueToJsonElement(editableValue),
|
|
9121
|
-
validationErrors: void 0
|
|
9159
|
+
validationErrors: void 0,
|
|
9160
|
+
required: true
|
|
9122
9161
|
},
|
|
9123
9162
|
mapperProps
|
|
9124
9163
|
);
|
|
@@ -9161,9 +9200,28 @@ var getRandomInt = () => Math.floor(Math.random() * 1e8);
|
|
|
9161
9200
|
|
|
9162
9201
|
// src/revamp/domain/components/MultiUploadInputComponent.ts
|
|
9163
9202
|
var createMultiUploadInputComponent = (uploadInputProps, updateComponent) => {
|
|
9164
|
-
const _a = uploadInputProps, {
|
|
9203
|
+
const _a = uploadInputProps, {
|
|
9204
|
+
uid,
|
|
9205
|
+
id,
|
|
9206
|
+
checks,
|
|
9207
|
+
fileChecks,
|
|
9208
|
+
format,
|
|
9209
|
+
performPersistAsync,
|
|
9210
|
+
onValueChange,
|
|
9211
|
+
summariser
|
|
9212
|
+
} = _a, rest = __objRest(_a, [
|
|
9213
|
+
"uid",
|
|
9214
|
+
"id",
|
|
9215
|
+
"checks",
|
|
9216
|
+
"fileChecks",
|
|
9217
|
+
"format",
|
|
9218
|
+
"performPersistAsync",
|
|
9219
|
+
"onValueChange",
|
|
9220
|
+
"summariser"
|
|
9221
|
+
]);
|
|
9165
9222
|
const update = getInputUpdateFunction(uid, updateComponent);
|
|
9166
9223
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
9224
|
+
const getFileValidationErrors = getLocalValueValidator(fileChecks);
|
|
9167
9225
|
const getAndSetValidationErrors = (currentValue) => {
|
|
9168
9226
|
const messages = getValidationErrors(currentValue);
|
|
9169
9227
|
update((draft) => {
|
|
@@ -9176,6 +9234,7 @@ var createMultiUploadInputComponent = (uploadInputProps, updateComponent) => {
|
|
|
9176
9234
|
uid,
|
|
9177
9235
|
id,
|
|
9178
9236
|
format: "base64",
|
|
9237
|
+
errorsMap: {},
|
|
9179
9238
|
fileMap: {},
|
|
9180
9239
|
onBlur() {
|
|
9181
9240
|
getAndSetValidationErrors(this.getLocalValue());
|
|
@@ -9190,13 +9249,17 @@ var createMultiUploadInputComponent = (uploadInputProps, updateComponent) => {
|
|
|
9190
9249
|
update((draft) => {
|
|
9191
9250
|
draft.value.splice(fileIndex, 1);
|
|
9192
9251
|
const _a2 = draft.fileMap, { [fileId]: _ } = _a2, files = __objRest(_a2, [__restKey(fileId)]);
|
|
9252
|
+
const _b = draft.errorsMap, { [fileId]: removedErrors } = _b, fileErrors = __objRest(_b, [__restKey(fileId)]);
|
|
9193
9253
|
draft.fileMap = files;
|
|
9254
|
+
draft.errorsMap = fileErrors;
|
|
9194
9255
|
});
|
|
9195
9256
|
}
|
|
9196
9257
|
},
|
|
9197
9258
|
async onUpload(file, fileId) {
|
|
9259
|
+
const fileErrors = getFileValidationErrors(file);
|
|
9198
9260
|
update((draft) => {
|
|
9199
9261
|
draft.fileMap[fileId] = file;
|
|
9262
|
+
draft.errorsMap[fileId] = fileErrors;
|
|
9200
9263
|
draft.value = [...this.value, file];
|
|
9201
9264
|
draft.errors = [];
|
|
9202
9265
|
});
|
|
@@ -9217,7 +9280,7 @@ var createMultiUploadInputComponent = (uploadInputProps, updateComponent) => {
|
|
|
9217
9280
|
},
|
|
9218
9281
|
validate() {
|
|
9219
9282
|
const messages = getAndSetValidationErrors(this.getLocalValue());
|
|
9220
|
-
return messages.length === 0;
|
|
9283
|
+
return messages.length === 0 && Object.values(this.errorsMap).every((errors) => errors.length === 0);
|
|
9221
9284
|
}
|
|
9222
9285
|
}, rest);
|
|
9223
9286
|
if (!performPersistAsync) {
|
|
@@ -9276,6 +9339,7 @@ var arraySchemaToMultiUploadComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9276
9339
|
accepts,
|
|
9277
9340
|
autoComplete: "off",
|
|
9278
9341
|
checks: schema.hidden ? [] : checks,
|
|
9342
|
+
fileChecks: [],
|
|
9279
9343
|
format,
|
|
9280
9344
|
maxSize,
|
|
9281
9345
|
minItems,
|
|
@@ -9400,7 +9464,7 @@ var createMultiSelectComponent = (multiSelectProps, updateComponent) => {
|
|
|
9400
9464
|
onSelect(indices) {
|
|
9401
9465
|
inputComponent.onSelect.call(this, indices);
|
|
9402
9466
|
if (this.validate()) {
|
|
9403
|
-
validateAsync(this.
|
|
9467
|
+
validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
|
|
9404
9468
|
});
|
|
9405
9469
|
}
|
|
9406
9470
|
}
|
|
@@ -9451,7 +9515,7 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9451
9515
|
const { maxItems, minItems, title, validationMessages } = schema;
|
|
9452
9516
|
const { getErrorMessageFunctions, onRefresh, onValueChange, updateComponent } = mapperProps;
|
|
9453
9517
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
9454
|
-
const { performValidationAsync,
|
|
9518
|
+
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
9455
9519
|
schemaMapperProps,
|
|
9456
9520
|
mapperProps
|
|
9457
9521
|
);
|
|
@@ -9470,7 +9534,7 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9470
9534
|
options,
|
|
9471
9535
|
required,
|
|
9472
9536
|
title,
|
|
9473
|
-
|
|
9537
|
+
validationAsyncState,
|
|
9474
9538
|
performValidationAsync,
|
|
9475
9539
|
performRefresh: getPerformRefresh(schema, onRefresh),
|
|
9476
9540
|
onValueChange
|
|
@@ -9646,7 +9710,7 @@ var createBooleanInputComponent = (booleanInputProps, updateComponent) => {
|
|
|
9646
9710
|
return __spreadProps(__spreadValues({}, booleanComponent), {
|
|
9647
9711
|
onChange(updatedValue) {
|
|
9648
9712
|
booleanComponent.onChange.call(this, updatedValue);
|
|
9649
|
-
validateAsync(this.
|
|
9713
|
+
validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
|
|
9650
9714
|
});
|
|
9651
9715
|
}
|
|
9652
9716
|
});
|
|
@@ -9664,7 +9728,7 @@ var booleanSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9664
9728
|
schemaMapperProps,
|
|
9665
9729
|
mapperProps
|
|
9666
9730
|
);
|
|
9667
|
-
const { performValidationAsync,
|
|
9731
|
+
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
9668
9732
|
schemaMapperProps,
|
|
9669
9733
|
mapperProps
|
|
9670
9734
|
);
|
|
@@ -9675,7 +9739,7 @@ var booleanSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9675
9739
|
__spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
|
|
9676
9740
|
value: value != null ? value : false,
|
|
9677
9741
|
persistedState,
|
|
9678
|
-
|
|
9742
|
+
validationAsyncState,
|
|
9679
9743
|
performPersistAsync,
|
|
9680
9744
|
performRefresh,
|
|
9681
9745
|
performValidationAsync,
|
|
@@ -10210,13 +10274,44 @@ var createStatusListComponent = (statusListProps) => __spreadProps(__spreadValue
|
|
|
10210
10274
|
});
|
|
10211
10275
|
|
|
10212
10276
|
// src/revamp/domain/mappers/layout/statusListLayoutToComponent.ts
|
|
10213
|
-
var statusListLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
|
|
10277
|
+
var statusListLayoutToComponent = (uid, { control, items, margin = "md", title }, { onAction, onLink }) => createStatusListComponent({
|
|
10214
10278
|
uid,
|
|
10215
10279
|
control,
|
|
10216
|
-
items
|
|
10280
|
+
items: items.map((item) => {
|
|
10281
|
+
var _a, _b, _c;
|
|
10282
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
10283
|
+
href: (_c = (_b = (_a = item == null ? void 0 : item.callToAction) == null ? void 0 : _a.behavior) == null ? void 0 : _b.link) == null ? void 0 : _c.url,
|
|
10284
|
+
callToAction: item.callToAction ? getItemCallToAction(item.callToAction, onAction, onLink) : void 0
|
|
10285
|
+
});
|
|
10286
|
+
}),
|
|
10217
10287
|
margin,
|
|
10218
10288
|
title
|
|
10219
10289
|
});
|
|
10290
|
+
var getItemCallToAction = (callToAction, onAction, onLink) => {
|
|
10291
|
+
const { accessibilityDescription, behavior, title } = callToAction;
|
|
10292
|
+
if (behavior.link) {
|
|
10293
|
+
const { url } = behavior.link;
|
|
10294
|
+
return {
|
|
10295
|
+
accessibilityDescription,
|
|
10296
|
+
href: url,
|
|
10297
|
+
title,
|
|
10298
|
+
onClick: () => {
|
|
10299
|
+
void onLink(url);
|
|
10300
|
+
}
|
|
10301
|
+
};
|
|
10302
|
+
}
|
|
10303
|
+
if (behavior.action) {
|
|
10304
|
+
const { action } = behavior;
|
|
10305
|
+
return {
|
|
10306
|
+
accessibilityDescription,
|
|
10307
|
+
title,
|
|
10308
|
+
onClick: () => {
|
|
10309
|
+
void onAction(action);
|
|
10310
|
+
}
|
|
10311
|
+
};
|
|
10312
|
+
}
|
|
10313
|
+
return void 0;
|
|
10314
|
+
};
|
|
10220
10315
|
|
|
10221
10316
|
// src/revamp/domain/mappers/layout/listLayoutToComponent.ts
|
|
10222
10317
|
var listLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
|
|
@@ -10283,7 +10378,7 @@ var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
|
10283
10378
|
case "search":
|
|
10284
10379
|
return searchLayoutToComponent(uid, layout, mapperProps);
|
|
10285
10380
|
case "status-list":
|
|
10286
|
-
return statusListLayoutToComponent(uid, layout);
|
|
10381
|
+
return statusListLayoutToComponent(uid, layout, mapperProps);
|
|
10287
10382
|
default:
|
|
10288
10383
|
throw new Error(`Invalid layout type in ${JSON.stringify(layout)}`);
|
|
10289
10384
|
}
|
|
@@ -11165,10 +11260,29 @@ function LabelContentWithHelp({ text, help }) {
|
|
|
11165
11260
|
|
|
11166
11261
|
// ../renderers/src/components/FieldInput.tsx
|
|
11167
11262
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
11168
|
-
function FieldInput({ id, children, label,
|
|
11263
|
+
function FieldInput({ id, children, label, validation, description, help }) {
|
|
11169
11264
|
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
11170
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
11265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
11266
|
+
import_components4.Field,
|
|
11267
|
+
{
|
|
11268
|
+
id,
|
|
11269
|
+
label: labelContent,
|
|
11270
|
+
description,
|
|
11271
|
+
message: validation == null ? void 0 : validation.message,
|
|
11272
|
+
sentiment: mapStatusToSentiment(validation),
|
|
11273
|
+
children
|
|
11274
|
+
}
|
|
11275
|
+
);
|
|
11171
11276
|
}
|
|
11277
|
+
var mapStatusToSentiment = (validation) => {
|
|
11278
|
+
if (validation) {
|
|
11279
|
+
if (validation.status === "valid") {
|
|
11280
|
+
return "positive";
|
|
11281
|
+
}
|
|
11282
|
+
return "negative";
|
|
11283
|
+
}
|
|
11284
|
+
return void 0;
|
|
11285
|
+
};
|
|
11172
11286
|
var FieldInput_default = FieldInput;
|
|
11173
11287
|
|
|
11174
11288
|
// ../renderers/src/BooleanInputRenderer.tsx
|
|
@@ -11177,9 +11291,27 @@ var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
|
11177
11291
|
var BooleanInputRenderer = {
|
|
11178
11292
|
canRenderType: "input-boolean",
|
|
11179
11293
|
render: (props) => {
|
|
11180
|
-
const _a = props, {
|
|
11294
|
+
const _a = props, {
|
|
11295
|
+
id,
|
|
11296
|
+
control,
|
|
11297
|
+
label = "",
|
|
11298
|
+
description,
|
|
11299
|
+
help,
|
|
11300
|
+
type,
|
|
11301
|
+
validationState,
|
|
11302
|
+
value
|
|
11303
|
+
} = _a, rest = __objRest(_a, [
|
|
11304
|
+
"id",
|
|
11305
|
+
"control",
|
|
11306
|
+
"label",
|
|
11307
|
+
"description",
|
|
11308
|
+
"help",
|
|
11309
|
+
"type",
|
|
11310
|
+
"validationState",
|
|
11311
|
+
"value"
|
|
11312
|
+
]);
|
|
11181
11313
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label, secondary: description, checked: value });
|
|
11182
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FieldInput_default, { id, label: "", description: "",
|
|
11314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_components5.Checkbox, __spreadValues({ id }, checkboxProps)) });
|
|
11183
11315
|
}
|
|
11184
11316
|
};
|
|
11185
11317
|
var BooleanInputRenderer_default = BooleanInputRenderer;
|
|
@@ -11404,23 +11536,33 @@ var DateInputRenderer = {
|
|
|
11404
11536
|
control,
|
|
11405
11537
|
label,
|
|
11406
11538
|
description,
|
|
11407
|
-
error,
|
|
11408
11539
|
type,
|
|
11409
11540
|
help,
|
|
11541
|
+
validationState,
|
|
11410
11542
|
value: initialValue
|
|
11411
11543
|
} = _a, rest = __objRest(_a, [
|
|
11412
11544
|
"id",
|
|
11413
11545
|
"control",
|
|
11414
11546
|
"label",
|
|
11415
11547
|
"description",
|
|
11416
|
-
"error",
|
|
11417
11548
|
"type",
|
|
11418
11549
|
"help",
|
|
11550
|
+
"validationState",
|
|
11419
11551
|
"value"
|
|
11420
11552
|
]);
|
|
11421
11553
|
const value = initialValue != null ? initialValue : "";
|
|
11422
11554
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
11423
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
11555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
11556
|
+
FieldInput_default,
|
|
11557
|
+
{
|
|
11558
|
+
id,
|
|
11559
|
+
label,
|
|
11560
|
+
description,
|
|
11561
|
+
validation: validationState,
|
|
11562
|
+
help,
|
|
11563
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(VariableDateInput_default, { control, inputProps })
|
|
11564
|
+
}
|
|
11565
|
+
);
|
|
11424
11566
|
}
|
|
11425
11567
|
};
|
|
11426
11568
|
var DateInputRenderer_default = DateInputRenderer;
|
|
@@ -11708,23 +11850,33 @@ var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
|
11708
11850
|
var IntegerInputRenderer = {
|
|
11709
11851
|
canRenderType: "input-integer",
|
|
11710
11852
|
render: (props) => {
|
|
11711
|
-
const _a = props, { id, label,
|
|
11712
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11713
|
-
|
|
11714
|
-
|
|
11853
|
+
const _a = props, { id, label, description, help, type, validationState, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "description", "help", "type", "validationState", "value", "onChange"]);
|
|
11854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11855
|
+
FieldInput_default,
|
|
11856
|
+
{
|
|
11715
11857
|
id,
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
|
|
11725
|
-
|
|
11726
|
-
|
|
11727
|
-
|
|
11858
|
+
label,
|
|
11859
|
+
description,
|
|
11860
|
+
validation: validationState,
|
|
11861
|
+
help,
|
|
11862
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11863
|
+
import_components14.Input,
|
|
11864
|
+
__spreadValues({
|
|
11865
|
+
id,
|
|
11866
|
+
name: id,
|
|
11867
|
+
type: "number",
|
|
11868
|
+
step: "1",
|
|
11869
|
+
pattern: "\\d+",
|
|
11870
|
+
value: value != null ? value : "",
|
|
11871
|
+
onChange: ({ target: { value: newValue } }) => {
|
|
11872
|
+
const parsedValue = Number.parseInt(newValue, 10);
|
|
11873
|
+
onChange(Number.isNaN(parsedValue) ? null : parsedValue);
|
|
11874
|
+
},
|
|
11875
|
+
onWheel
|
|
11876
|
+
}, rest)
|
|
11877
|
+
)
|
|
11878
|
+
}
|
|
11879
|
+
);
|
|
11728
11880
|
}
|
|
11729
11881
|
};
|
|
11730
11882
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
@@ -11830,10 +11982,10 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
11830
11982
|
disabled,
|
|
11831
11983
|
label,
|
|
11832
11984
|
help,
|
|
11833
|
-
error,
|
|
11834
11985
|
options,
|
|
11835
11986
|
placeholder,
|
|
11836
11987
|
selectedIndices,
|
|
11988
|
+
validationState,
|
|
11837
11989
|
onSelect
|
|
11838
11990
|
} = props;
|
|
11839
11991
|
const mergedIndices = stagedIndices != null ? stagedIndices : selectedIndices;
|
|
@@ -11864,39 +12016,49 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
11864
12016
|
};
|
|
11865
12017
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components19.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
11866
12018
|
};
|
|
11867
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11868
|
-
|
|
12019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
12020
|
+
FieldInput_default,
|
|
11869
12021
|
{
|
|
11870
12022
|
id,
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
|
|
12023
|
+
label,
|
|
12024
|
+
help,
|
|
12025
|
+
description,
|
|
12026
|
+
validation: validationState,
|
|
12027
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
12028
|
+
import_components19.SelectInput,
|
|
12029
|
+
{
|
|
12030
|
+
id,
|
|
12031
|
+
items: options.map((option, index) => {
|
|
12032
|
+
var _a, _b, _c;
|
|
12033
|
+
return {
|
|
12034
|
+
type: "option",
|
|
12035
|
+
value: index,
|
|
12036
|
+
filterMatchers: [
|
|
12037
|
+
...(_a = option.keywords) != null ? _a : [],
|
|
12038
|
+
(_b = option.title) != null ? _b : "",
|
|
12039
|
+
(_c = option.description) != null ? _c : ""
|
|
12040
|
+
],
|
|
12041
|
+
disabled: option.disabled
|
|
12042
|
+
};
|
|
12043
|
+
}),
|
|
12044
|
+
disabled,
|
|
12045
|
+
placeholder,
|
|
12046
|
+
value: mergedIndices,
|
|
12047
|
+
renderValue,
|
|
12048
|
+
multiple: true,
|
|
12049
|
+
onChange: (values) => {
|
|
12050
|
+
setStagedIndices(values);
|
|
12051
|
+
},
|
|
12052
|
+
onClose: () => {
|
|
12053
|
+
if (stagedIndices) {
|
|
12054
|
+
onSelect(stagedIndices);
|
|
12055
|
+
setStagedIndices(void 0);
|
|
12056
|
+
}
|
|
12057
|
+
}
|
|
11896
12058
|
}
|
|
11897
|
-
|
|
12059
|
+
)
|
|
11898
12060
|
}
|
|
11899
|
-
)
|
|
12061
|
+
);
|
|
11900
12062
|
}
|
|
11901
12063
|
var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
|
|
11902
12064
|
|
|
@@ -11912,8 +12074,8 @@ function UploadFieldInput({
|
|
|
11912
12074
|
children,
|
|
11913
12075
|
label,
|
|
11914
12076
|
description,
|
|
11915
|
-
|
|
11916
|
-
|
|
12077
|
+
help,
|
|
12078
|
+
validation
|
|
11917
12079
|
}) {
|
|
11918
12080
|
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
11919
12081
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
@@ -11921,12 +12083,12 @@ function UploadFieldInput({
|
|
|
11921
12083
|
"div",
|
|
11922
12084
|
{
|
|
11923
12085
|
className: (0, import_classnames3.default)("form-group d-block", {
|
|
11924
|
-
"has-error":
|
|
12086
|
+
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
11925
12087
|
}),
|
|
11926
12088
|
children: [
|
|
11927
12089
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
11928
12090
|
children,
|
|
11929
|
-
|
|
12091
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components20.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
11930
12092
|
]
|
|
11931
12093
|
}
|
|
11932
12094
|
);
|
|
@@ -11969,10 +12131,10 @@ var MultiUploadInputRenderer = {
|
|
|
11969
12131
|
label,
|
|
11970
12132
|
description,
|
|
11971
12133
|
disabled,
|
|
11972
|
-
error,
|
|
11973
12134
|
maxSize,
|
|
11974
12135
|
maxItems,
|
|
11975
12136
|
uploadLabel,
|
|
12137
|
+
validationState,
|
|
11976
12138
|
onUpload,
|
|
11977
12139
|
onDelete
|
|
11978
12140
|
} = props;
|
|
@@ -11985,22 +12147,32 @@ var MultiUploadInputRenderer = {
|
|
|
11985
12147
|
};
|
|
11986
12148
|
const onDeleteFile = async (fileId) => onDelete(String(fileId));
|
|
11987
12149
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
11988
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11989
|
-
|
|
12150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12151
|
+
UploadFieldInput_default,
|
|
11990
12152
|
{
|
|
11991
12153
|
id,
|
|
11992
|
-
|
|
12154
|
+
label,
|
|
11993
12155
|
description,
|
|
11994
|
-
|
|
11995
|
-
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12156
|
+
validation: validationState,
|
|
12157
|
+
help,
|
|
12158
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12159
|
+
import_components21.UploadInput,
|
|
12160
|
+
{
|
|
12161
|
+
id,
|
|
12162
|
+
"aria-describedby": descriptionId,
|
|
12163
|
+
description,
|
|
12164
|
+
disabled,
|
|
12165
|
+
fileTypes: getAcceptsString(accepts),
|
|
12166
|
+
maxFiles: maxItems,
|
|
12167
|
+
multiple: true,
|
|
12168
|
+
sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
|
|
12169
|
+
uploadButtonTitle: uploadLabel,
|
|
12170
|
+
onDeleteFile,
|
|
12171
|
+
onUploadFile
|
|
12172
|
+
}
|
|
12173
|
+
)
|
|
12002
12174
|
}
|
|
12003
|
-
)
|
|
12175
|
+
);
|
|
12004
12176
|
}
|
|
12005
12177
|
};
|
|
12006
12178
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
@@ -12011,21 +12183,31 @@ var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
|
12011
12183
|
var NumberInputRenderer = {
|
|
12012
12184
|
canRenderType: "input-number",
|
|
12013
12185
|
render: (props) => {
|
|
12014
|
-
const _a = props, { id, label,
|
|
12015
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12016
|
-
|
|
12017
|
-
|
|
12186
|
+
const _a = props, { id, label, description, help, type, validationState, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "description", "help", "type", "validationState", "value", "onChange"]);
|
|
12187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12188
|
+
FieldInput_default,
|
|
12189
|
+
{
|
|
12018
12190
|
id,
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12191
|
+
label,
|
|
12192
|
+
description,
|
|
12193
|
+
validation: validationState,
|
|
12194
|
+
help,
|
|
12195
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12196
|
+
import_components22.Input,
|
|
12197
|
+
__spreadValues({
|
|
12198
|
+
id,
|
|
12199
|
+
name: id,
|
|
12200
|
+
type: "number",
|
|
12201
|
+
value: value != null ? value : "",
|
|
12202
|
+
onChange: ({ target: { value: newValue } }) => {
|
|
12203
|
+
const parsedValue = Number.parseFloat(newValue);
|
|
12204
|
+
onChange(Number.isNaN(parsedValue) ? null : parsedValue);
|
|
12205
|
+
},
|
|
12206
|
+
onWheel
|
|
12207
|
+
}, rest)
|
|
12208
|
+
)
|
|
12209
|
+
}
|
|
12210
|
+
);
|
|
12029
12211
|
}
|
|
12030
12212
|
};
|
|
12031
12213
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
@@ -12145,9 +12327,9 @@ function Repeatable(props) {
|
|
|
12145
12327
|
description,
|
|
12146
12328
|
editableItem,
|
|
12147
12329
|
editItemTitle,
|
|
12148
|
-
error,
|
|
12149
12330
|
items,
|
|
12150
12331
|
title,
|
|
12332
|
+
validationState,
|
|
12151
12333
|
onEdit,
|
|
12152
12334
|
onAdd,
|
|
12153
12335
|
onSave,
|
|
@@ -12183,7 +12365,7 @@ function Repeatable(props) {
|
|
|
12183
12365
|
"div",
|
|
12184
12366
|
{
|
|
12185
12367
|
className: (0, import_classnames5.default)("form-group", {
|
|
12186
|
-
"has-error":
|
|
12368
|
+
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
12187
12369
|
}),
|
|
12188
12370
|
children: [
|
|
12189
12371
|
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
@@ -12196,7 +12378,7 @@ function Repeatable(props) {
|
|
|
12196
12378
|
onClick: () => onAddItem()
|
|
12197
12379
|
}
|
|
12198
12380
|
),
|
|
12199
|
-
|
|
12381
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components25.InlineAlert, { type: "negative", children: validationState.message })
|
|
12200
12382
|
]
|
|
12201
12383
|
}
|
|
12202
12384
|
),
|
|
@@ -12235,7 +12417,7 @@ function ItemSummaryOption({
|
|
|
12235
12417
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
12236
12418
|
|
|
12237
12419
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
12238
|
-
var
|
|
12420
|
+
var import_components27 = require("@transferwise/components");
|
|
12239
12421
|
|
|
12240
12422
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
12241
12423
|
var import_react_intl16 = require("react-intl");
|
|
@@ -12261,28 +12443,45 @@ var generic_error_messages_default2 = (0, import_react_intl15.defineMessages)({
|
|
|
12261
12443
|
});
|
|
12262
12444
|
|
|
12263
12445
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
12446
|
+
var import_components26 = require("@transferwise/components");
|
|
12264
12447
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
12265
12448
|
function ErrorResult({ state }) {
|
|
12266
12449
|
const intl = (0, import_react_intl16.useIntl)();
|
|
12450
|
+
const buttonVisualProps = {
|
|
12451
|
+
priority: "tertiary",
|
|
12452
|
+
size: "sm",
|
|
12453
|
+
style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
|
|
12454
|
+
};
|
|
12267
12455
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "m-t-2", children: [
|
|
12268
12456
|
intl.formatMessage(generic_error_messages_default2.genericError),
|
|
12269
12457
|
"\xA0",
|
|
12270
12458
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
12271
|
-
|
|
12272
|
-
{
|
|
12273
|
-
|
|
12274
|
-
onClick: (e) => {
|
|
12275
|
-
e.preventDefault();
|
|
12459
|
+
import_components26.Button,
|
|
12460
|
+
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
12461
|
+
onClick: () => {
|
|
12276
12462
|
state.onRetry();
|
|
12277
12463
|
},
|
|
12278
12464
|
children: intl.formatMessage(generic_error_messages_default2.retry)
|
|
12279
|
-
}
|
|
12465
|
+
})
|
|
12280
12466
|
)
|
|
12281
12467
|
] });
|
|
12282
12468
|
}
|
|
12283
12469
|
|
|
12284
12470
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
12285
12471
|
var import_react14 = require("react");
|
|
12472
|
+
|
|
12473
|
+
// ../renderers/src/messages/search.messages.ts
|
|
12474
|
+
var import_react_intl17 = require("react-intl");
|
|
12475
|
+
var search_messages_default = (0, import_react_intl17.defineMessages)({
|
|
12476
|
+
loading: {
|
|
12477
|
+
id: "df.wise.SearchLayout.loading",
|
|
12478
|
+
defaultMessage: "Loading...",
|
|
12479
|
+
description: "A message shown to the user while their search is being processed, before results appear."
|
|
12480
|
+
}
|
|
12481
|
+
});
|
|
12482
|
+
|
|
12483
|
+
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
12484
|
+
var import_react_intl18 = require("react-intl");
|
|
12286
12485
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
12287
12486
|
function BlockSearchRendererComponent({
|
|
12288
12487
|
id,
|
|
@@ -12295,9 +12494,10 @@ function BlockSearchRendererComponent({
|
|
|
12295
12494
|
}) {
|
|
12296
12495
|
const [hasSearched, setHasSearched] = (0, import_react14.useState)(false);
|
|
12297
12496
|
const trackEvent = useTrackEvent();
|
|
12497
|
+
const { formatMessage } = (0, import_react_intl18.useIntl)();
|
|
12298
12498
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: getMargin(margin), children: [
|
|
12299
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FieldInput_default, { id, description: "",
|
|
12300
|
-
|
|
12499
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
12500
|
+
import_components27.Input,
|
|
12301
12501
|
{
|
|
12302
12502
|
id,
|
|
12303
12503
|
name: id,
|
|
@@ -12313,7 +12513,7 @@ function BlockSearchRendererComponent({
|
|
|
12313
12513
|
}
|
|
12314
12514
|
}
|
|
12315
12515
|
) }),
|
|
12316
|
-
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, { children:
|
|
12516
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SearchResultContent, { state, onChange })
|
|
12317
12517
|
] });
|
|
12318
12518
|
}
|
|
12319
12519
|
function SearchResultContent({
|
|
@@ -12333,16 +12533,16 @@ function SearchResultContent({
|
|
|
12333
12533
|
}
|
|
12334
12534
|
}
|
|
12335
12535
|
function EmptySearchResult({ state }) {
|
|
12336
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
12536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components27.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
12337
12537
|
}
|
|
12338
12538
|
function SearchResults({
|
|
12339
12539
|
state
|
|
12340
12540
|
}) {
|
|
12341
12541
|
const trackEvent = useTrackEvent();
|
|
12342
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
12542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components27.NavigationOptionsList, { children: state.results.map((result) => {
|
|
12343
12543
|
const { icon, image } = result;
|
|
12344
12544
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
12345
|
-
|
|
12545
|
+
import_components27.NavigationOption,
|
|
12346
12546
|
{
|
|
12347
12547
|
title: result.title,
|
|
12348
12548
|
content: result.description,
|
|
@@ -12363,10 +12563,10 @@ function SearchResults({
|
|
|
12363
12563
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
12364
12564
|
|
|
12365
12565
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
12366
|
-
var
|
|
12566
|
+
var import_components28 = require("@transferwise/components");
|
|
12367
12567
|
var import_icons2 = require("@transferwise/icons");
|
|
12368
12568
|
var import_react15 = require("react");
|
|
12369
|
-
var
|
|
12569
|
+
var import_react_intl19 = require("react-intl");
|
|
12370
12570
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
12371
12571
|
function InlineSearchRenderer({
|
|
12372
12572
|
id,
|
|
@@ -12378,9 +12578,9 @@ function InlineSearchRenderer({
|
|
|
12378
12578
|
}) {
|
|
12379
12579
|
const [hasSearched, setHasSearched] = (0, import_react15.useState)(false);
|
|
12380
12580
|
const trackEvent = useTrackEvent();
|
|
12381
|
-
const intl = (0,
|
|
12382
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FieldInput_default, { id, description: "",
|
|
12383
|
-
|
|
12581
|
+
const intl = (0, import_react_intl19.useIntl)();
|
|
12582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
12583
|
+
import_components28.Typeahead,
|
|
12384
12584
|
{
|
|
12385
12585
|
id: "typeahead-input-id",
|
|
12386
12586
|
intl,
|
|
@@ -12425,14 +12625,15 @@ function mapResultToTypeaheadOption(result) {
|
|
|
12425
12625
|
};
|
|
12426
12626
|
}
|
|
12427
12627
|
function TypeaheadFooter({ state, isLoading }) {
|
|
12628
|
+
const { formatMessage } = (0, import_react_intl19.useIntl)();
|
|
12428
12629
|
if (state.type === "noResults") {
|
|
12429
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
12630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components28.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
12430
12631
|
}
|
|
12431
12632
|
if (state.type === "error") {
|
|
12432
12633
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ErrorResult, { state }) });
|
|
12433
12634
|
}
|
|
12434
12635
|
if (state.type === "pending" || isLoading) {
|
|
12435
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "m-t-2 m-x-2", children:
|
|
12636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
12436
12637
|
}
|
|
12437
12638
|
return null;
|
|
12438
12639
|
}
|
|
@@ -12447,7 +12648,7 @@ var SearchRenderer = {
|
|
|
12447
12648
|
var SearchRenderer_default = SearchRenderer;
|
|
12448
12649
|
|
|
12449
12650
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
12450
|
-
var
|
|
12651
|
+
var import_components29 = require("@transferwise/components");
|
|
12451
12652
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
12452
12653
|
function RadioInputRendererComponent(props) {
|
|
12453
12654
|
const {
|
|
@@ -12455,36 +12656,46 @@ function RadioInputRendererComponent(props) {
|
|
|
12455
12656
|
children,
|
|
12456
12657
|
description,
|
|
12457
12658
|
disabled,
|
|
12458
|
-
error,
|
|
12459
12659
|
help,
|
|
12460
12660
|
label,
|
|
12461
12661
|
options,
|
|
12462
12662
|
selectedIndex,
|
|
12663
|
+
validationState,
|
|
12463
12664
|
onSelect
|
|
12464
12665
|
} = props;
|
|
12465
12666
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
12466
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12467
|
-
|
|
12667
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12668
|
+
FieldInput_default,
|
|
12468
12669
|
{
|
|
12469
|
-
|
|
12470
|
-
|
|
12471
|
-
|
|
12472
|
-
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12477
|
-
|
|
12478
|
-
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
|
|
12670
|
+
id,
|
|
12671
|
+
label,
|
|
12672
|
+
help,
|
|
12673
|
+
description,
|
|
12674
|
+
validation: validationState,
|
|
12675
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12676
|
+
import_components29.RadioGroup,
|
|
12677
|
+
{
|
|
12678
|
+
name: id,
|
|
12679
|
+
radios: options.map((option, index) => ({
|
|
12680
|
+
label: option.title,
|
|
12681
|
+
value: index,
|
|
12682
|
+
secondary: option.description,
|
|
12683
|
+
disabled: option.disabled || disabled,
|
|
12684
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
12685
|
+
})),
|
|
12686
|
+
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
12687
|
+
onChange: onSelect
|
|
12688
|
+
},
|
|
12689
|
+
`${id}-${selectedIndex}`
|
|
12690
|
+
) })
|
|
12691
|
+
}
|
|
12692
|
+
),
|
|
12482
12693
|
children
|
|
12483
12694
|
] });
|
|
12484
12695
|
}
|
|
12485
12696
|
|
|
12486
12697
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
12487
|
-
var
|
|
12698
|
+
var import_components30 = require("@transferwise/components");
|
|
12488
12699
|
var import_react16 = require("react");
|
|
12489
12700
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
12490
12701
|
function TabInputRendererComponent(props) {
|
|
@@ -12493,11 +12704,11 @@ function TabInputRendererComponent(props) {
|
|
|
12493
12704
|
children,
|
|
12494
12705
|
description,
|
|
12495
12706
|
disabled,
|
|
12496
|
-
error,
|
|
12497
12707
|
help,
|
|
12498
12708
|
label,
|
|
12499
12709
|
options,
|
|
12500
12710
|
selectedIndex,
|
|
12711
|
+
validationState,
|
|
12501
12712
|
onSelect
|
|
12502
12713
|
} = props;
|
|
12503
12714
|
(0, import_react16.useEffect)(() => {
|
|
@@ -12506,41 +12717,51 @@ function TabInputRendererComponent(props) {
|
|
|
12506
12717
|
}
|
|
12507
12718
|
}, [selectedIndex, onSelect, options.length]);
|
|
12508
12719
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
12509
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12510
|
-
|
|
12720
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12721
|
+
FieldInput_default,
|
|
12511
12722
|
{
|
|
12512
|
-
|
|
12513
|
-
|
|
12514
|
-
|
|
12515
|
-
|
|
12516
|
-
|
|
12517
|
-
|
|
12518
|
-
|
|
12519
|
-
|
|
12520
|
-
|
|
12521
|
-
|
|
12723
|
+
id,
|
|
12724
|
+
label,
|
|
12725
|
+
help,
|
|
12726
|
+
description,
|
|
12727
|
+
validation: validationState,
|
|
12728
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12729
|
+
import_components30.Tabs,
|
|
12730
|
+
{
|
|
12731
|
+
name: id,
|
|
12732
|
+
selected: selectedIndex != null ? selectedIndex : 0,
|
|
12733
|
+
tabs: options.map((option) => ({
|
|
12734
|
+
title: option.title,
|
|
12735
|
+
// if we pass null, we get some props-types console errors
|
|
12736
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
12737
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, {}),
|
|
12738
|
+
disabled: option.disabled || disabled
|
|
12739
|
+
})),
|
|
12740
|
+
onTabSelect: onSelect
|
|
12741
|
+
}
|
|
12742
|
+
)
|
|
12522
12743
|
}
|
|
12523
|
-
)
|
|
12744
|
+
),
|
|
12524
12745
|
children
|
|
12525
12746
|
] });
|
|
12526
12747
|
}
|
|
12527
12748
|
var isValidIndex = (index, options) => index !== null && index >= 0 && index < options;
|
|
12528
12749
|
|
|
12529
12750
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
12530
|
-
var
|
|
12751
|
+
var import_components32 = require("@transferwise/components");
|
|
12531
12752
|
|
|
12532
12753
|
// ../renderers/src/SelectInputRenderer/SelectTriggerMedia.tsx
|
|
12533
|
-
var
|
|
12754
|
+
var import_components31 = require("@transferwise/components");
|
|
12534
12755
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
12535
12756
|
function SelectTriggerMedia({ icon, image }) {
|
|
12536
12757
|
if (image == null ? void 0 : image.url) {
|
|
12537
12758
|
return null;
|
|
12538
12759
|
}
|
|
12539
12760
|
if (icon && "name" in icon) {
|
|
12540
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components31.Avatar, { type: import_components31.AvatarType.ICON, size: 24, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
12541
12762
|
}
|
|
12542
12763
|
if (icon && "text" in icon) {
|
|
12543
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components31.Avatar, { type: import_components31.AvatarType.ICON, size: 24, children: icon.text });
|
|
12544
12765
|
}
|
|
12545
12766
|
return null;
|
|
12546
12767
|
}
|
|
@@ -12553,13 +12774,13 @@ function SelectInputRendererComponent(props) {
|
|
|
12553
12774
|
children,
|
|
12554
12775
|
description,
|
|
12555
12776
|
disabled,
|
|
12556
|
-
error,
|
|
12557
12777
|
help,
|
|
12558
12778
|
label,
|
|
12559
12779
|
options,
|
|
12560
12780
|
placeholder,
|
|
12561
12781
|
required,
|
|
12562
12782
|
selectedIndex,
|
|
12783
|
+
validationState,
|
|
12563
12784
|
onSelect
|
|
12564
12785
|
} = props;
|
|
12565
12786
|
const items = options.map(
|
|
@@ -12587,54 +12808,84 @@ function SelectInputRendererComponent(props) {
|
|
|
12587
12808
|
description: option.description,
|
|
12588
12809
|
icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
12589
12810
|
};
|
|
12590
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components32.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
12591
12812
|
};
|
|
12592
12813
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
12593
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12594
|
-
|
|
12814
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12815
|
+
FieldInput_default,
|
|
12595
12816
|
{
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
|
|
12817
|
+
id,
|
|
12818
|
+
label,
|
|
12819
|
+
help,
|
|
12820
|
+
description,
|
|
12821
|
+
validation: validationState,
|
|
12822
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12823
|
+
import_components32.SelectInput,
|
|
12824
|
+
{
|
|
12825
|
+
name: id,
|
|
12826
|
+
placeholder,
|
|
12827
|
+
items,
|
|
12828
|
+
disabled,
|
|
12829
|
+
value: selectedIndex,
|
|
12830
|
+
renderValue,
|
|
12831
|
+
filterable: items.length >= 8,
|
|
12832
|
+
onChange: onSelect,
|
|
12833
|
+
onClear: required ? void 0 : () => onSelect(null)
|
|
12834
|
+
}
|
|
12835
|
+
)
|
|
12605
12836
|
}
|
|
12606
|
-
)
|
|
12837
|
+
),
|
|
12607
12838
|
children
|
|
12608
12839
|
] });
|
|
12609
12840
|
}
|
|
12610
12841
|
|
|
12611
12842
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
12612
12843
|
var import_react17 = require("react");
|
|
12613
|
-
var
|
|
12844
|
+
var import_components33 = require("@transferwise/components");
|
|
12614
12845
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
12615
12846
|
function SegmentedInputRendererComponent(props) {
|
|
12616
|
-
const {
|
|
12847
|
+
const {
|
|
12848
|
+
id,
|
|
12849
|
+
children,
|
|
12850
|
+
description,
|
|
12851
|
+
help,
|
|
12852
|
+
label,
|
|
12853
|
+
options,
|
|
12854
|
+
selectedIndex,
|
|
12855
|
+
validationState,
|
|
12856
|
+
onSelect
|
|
12857
|
+
} = props;
|
|
12617
12858
|
(0, import_react17.useEffect)(() => {
|
|
12618
12859
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
12619
12860
|
onSelect(0);
|
|
12620
12861
|
}
|
|
12621
12862
|
}, [selectedIndex, onSelect, options.length]);
|
|
12622
12863
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
12623
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12624
|
-
|
|
12864
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12865
|
+
FieldInput_default,
|
|
12625
12866
|
{
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12867
|
+
id,
|
|
12868
|
+
label,
|
|
12869
|
+
help,
|
|
12870
|
+
description,
|
|
12871
|
+
validation: validationState,
|
|
12872
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12873
|
+
import_components33.SegmentedControl,
|
|
12874
|
+
{
|
|
12875
|
+
name: `${id}-segmented-control`,
|
|
12876
|
+
value: String(selectedIndex),
|
|
12877
|
+
mode: "view",
|
|
12878
|
+
segments: options.map((option, index) => ({
|
|
12879
|
+
id: String(index),
|
|
12880
|
+
value: String(index),
|
|
12881
|
+
label: option.title,
|
|
12882
|
+
controls: `${id}-children`
|
|
12883
|
+
})),
|
|
12884
|
+
onChange: (value) => onSelect(Number(value))
|
|
12885
|
+
}
|
|
12886
|
+
)
|
|
12636
12887
|
}
|
|
12637
|
-
)
|
|
12888
|
+
),
|
|
12638
12889
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { id: `${id}-children`, children })
|
|
12639
12890
|
] });
|
|
12640
12891
|
}
|
|
@@ -12661,21 +12912,28 @@ var SelectInputRenderer = {
|
|
|
12661
12912
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
12662
12913
|
|
|
12663
12914
|
// ../renderers/src/StatusListRenderer.tsx
|
|
12664
|
-
var
|
|
12915
|
+
var import_components34 = require("@transferwise/components");
|
|
12665
12916
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
12666
12917
|
var StatusListRenderer = {
|
|
12667
12918
|
canRenderType: "status-list",
|
|
12668
12919
|
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: getMargin(margin), children: [
|
|
12669
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12670
|
-
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12671
|
-
|
|
12920
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components34.Header, { title }) : null,
|
|
12921
|
+
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12922
|
+
import_components34.Summary,
|
|
12672
12923
|
{
|
|
12673
12924
|
title: itemTitle,
|
|
12674
12925
|
description,
|
|
12675
12926
|
icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DynamicIcon_default, { name: icon.name }) : null,
|
|
12676
|
-
status: mapStatus(status)
|
|
12927
|
+
status: mapStatus(status),
|
|
12928
|
+
action: callToAction ? {
|
|
12929
|
+
"aria-label": callToAction.accessibilityDescription,
|
|
12930
|
+
href: callToAction.href,
|
|
12931
|
+
text: callToAction.title,
|
|
12932
|
+
target: callToAction.href ? "_blank" : void 0,
|
|
12933
|
+
onClick: callToAction.href ? void 0 : callToAction.onClick
|
|
12934
|
+
} : void 0
|
|
12677
12935
|
},
|
|
12678
|
-
`${
|
|
12936
|
+
`${itemTitle}/${description || ""}`
|
|
12679
12937
|
))
|
|
12680
12938
|
] })
|
|
12681
12939
|
};
|
|
@@ -12688,7 +12946,7 @@ var mapStatus = (status) => {
|
|
|
12688
12946
|
};
|
|
12689
12947
|
|
|
12690
12948
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
12691
|
-
var
|
|
12949
|
+
var import_components35 = require("@transferwise/components");
|
|
12692
12950
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
12693
12951
|
function VariableTextInput({
|
|
12694
12952
|
control,
|
|
@@ -12714,37 +12972,37 @@ function TextInput(_a) {
|
|
|
12714
12972
|
if (typeof displayFormat === "string") {
|
|
12715
12973
|
const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
|
|
12716
12974
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12717
|
-
|
|
12975
|
+
import_components35.InputWithDisplayFormat,
|
|
12718
12976
|
__spreadValues({
|
|
12719
12977
|
displayPattern: displayFormat,
|
|
12720
12978
|
onChange: (newValue) => onChange(newValue)
|
|
12721
12979
|
}, inputProps)
|
|
12722
12980
|
);
|
|
12723
12981
|
}
|
|
12724
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components35.Input, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
|
|
12725
12983
|
}
|
|
12726
12984
|
function TextAreaInput(_a) {
|
|
12727
12985
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12728
12986
|
const textAreaProps = __spreadValues({ id, name: id }, rest);
|
|
12729
12987
|
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12730
|
-
|
|
12988
|
+
import_components35.TextareaWithDisplayFormat,
|
|
12731
12989
|
__spreadValues({
|
|
12732
12990
|
displayPattern: displayFormat,
|
|
12733
12991
|
onChange: (newValue) => onChange(newValue)
|
|
12734
12992
|
}, textAreaProps)
|
|
12735
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12993
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components35.TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
|
|
12736
12994
|
}
|
|
12737
12995
|
function NumericInput(_a) {
|
|
12738
12996
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12739
12997
|
const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
|
|
12740
12998
|
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12741
|
-
|
|
12999
|
+
import_components35.InputWithDisplayFormat,
|
|
12742
13000
|
__spreadValues({
|
|
12743
13001
|
displayPattern: displayFormat,
|
|
12744
13002
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
12745
13003
|
}, numericProps)
|
|
12746
13004
|
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12747
|
-
|
|
13005
|
+
import_components35.Input,
|
|
12748
13006
|
__spreadValues({
|
|
12749
13007
|
onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
|
|
12750
13008
|
}, numericProps)
|
|
@@ -12752,7 +13010,7 @@ function NumericInput(_a) {
|
|
|
12752
13010
|
}
|
|
12753
13011
|
function PhoneNumberInput(_a) {
|
|
12754
13012
|
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
12755
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
13013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components35.PhoneNumberInput, __spreadValues({ initialValue: value }, rest));
|
|
12756
13014
|
}
|
|
12757
13015
|
var VariableTextInput_default = VariableTextInput;
|
|
12758
13016
|
|
|
@@ -12771,6 +13029,7 @@ var TextInputRenderer = {
|
|
|
12771
13029
|
maxLength,
|
|
12772
13030
|
minLength,
|
|
12773
13031
|
type,
|
|
13032
|
+
validationState,
|
|
12774
13033
|
value: initialValue
|
|
12775
13034
|
} = _a, rest = __objRest(_a, [
|
|
12776
13035
|
"id",
|
|
@@ -12782,22 +13041,33 @@ var TextInputRenderer = {
|
|
|
12782
13041
|
"maxLength",
|
|
12783
13042
|
"minLength",
|
|
12784
13043
|
"type",
|
|
13044
|
+
"validationState",
|
|
12785
13045
|
"value"
|
|
12786
13046
|
]);
|
|
12787
13047
|
const value = initialValue != null ? initialValue : "";
|
|
12788
13048
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
12789
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
13049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
13050
|
+
FieldInput_default,
|
|
13051
|
+
{
|
|
13052
|
+
id,
|
|
13053
|
+
label,
|
|
13054
|
+
description,
|
|
13055
|
+
validation: validationState,
|
|
13056
|
+
help,
|
|
13057
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(VariableTextInput_default, { control, inputProps })
|
|
13058
|
+
}
|
|
13059
|
+
);
|
|
12790
13060
|
}
|
|
12791
13061
|
};
|
|
12792
13062
|
var TextInputRenderer_default = TextInputRenderer;
|
|
12793
13063
|
|
|
12794
13064
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
12795
|
-
var
|
|
13065
|
+
var import_components36 = require("@transferwise/components");
|
|
12796
13066
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
12797
13067
|
var UploadInputRenderer = {
|
|
12798
13068
|
canRenderType: "input-upload",
|
|
12799
13069
|
render: (props) => {
|
|
12800
|
-
const { id, accepts,
|
|
13070
|
+
const { id, accepts, label, description, disabled, maxSize, validationState, onUpload } = props;
|
|
12801
13071
|
const onUploadFile = async (formData) => {
|
|
12802
13072
|
const file = formData.get("file");
|
|
12803
13073
|
return onUpload(file).then(() => ({
|
|
@@ -12809,19 +13079,28 @@ var UploadInputRenderer = {
|
|
|
12809
13079
|
};
|
|
12810
13080
|
return (
|
|
12811
13081
|
// We don't pass help here as there is no sensible place to display it
|
|
12812
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12813
|
-
|
|
13082
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
13083
|
+
UploadFieldInput_default,
|
|
12814
13084
|
{
|
|
12815
13085
|
id,
|
|
12816
|
-
|
|
12817
|
-
|
|
12818
|
-
|
|
12819
|
-
|
|
12820
|
-
|
|
12821
|
-
|
|
12822
|
-
|
|
13086
|
+
label: void 0,
|
|
13087
|
+
description: void 0,
|
|
13088
|
+
validation: validationState,
|
|
13089
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
13090
|
+
import_components36.UploadInput,
|
|
13091
|
+
{
|
|
13092
|
+
id,
|
|
13093
|
+
description,
|
|
13094
|
+
disabled,
|
|
13095
|
+
fileTypes: getAcceptsString(accepts),
|
|
13096
|
+
sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
|
|
13097
|
+
uploadButtonTitle: label,
|
|
13098
|
+
onDeleteFile,
|
|
13099
|
+
onUploadFile
|
|
13100
|
+
}
|
|
13101
|
+
)
|
|
12823
13102
|
}
|
|
12824
|
-
)
|
|
13103
|
+
)
|
|
12825
13104
|
);
|
|
12826
13105
|
}
|
|
12827
13106
|
};
|
|
@@ -12836,10 +13115,10 @@ var LargeUploadRenderer = {
|
|
|
12836
13115
|
label,
|
|
12837
13116
|
description,
|
|
12838
13117
|
disabled,
|
|
12839
|
-
error,
|
|
12840
13118
|
help,
|
|
12841
13119
|
maxSize,
|
|
12842
13120
|
type,
|
|
13121
|
+
validationState,
|
|
12843
13122
|
onUpload
|
|
12844
13123
|
} = _a, rest = __objRest(_a, [
|
|
12845
13124
|
"id",
|
|
@@ -12848,10 +13127,10 @@ var LargeUploadRenderer = {
|
|
|
12848
13127
|
"label",
|
|
12849
13128
|
"description",
|
|
12850
13129
|
"disabled",
|
|
12851
|
-
"error",
|
|
12852
13130
|
"help",
|
|
12853
13131
|
"maxSize",
|
|
12854
13132
|
"type",
|
|
13133
|
+
"validationState",
|
|
12855
13134
|
"onUpload"
|
|
12856
13135
|
]);
|
|
12857
13136
|
const uploadProps = __spreadProps(__spreadValues({}, rest), { id, name: id });
|
|
@@ -12864,21 +13143,31 @@ var LargeUploadRenderer = {
|
|
|
12864
13143
|
throw e;
|
|
12865
13144
|
}
|
|
12866
13145
|
};
|
|
12867
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12868
|
-
|
|
12869
|
-
|
|
12870
|
-
|
|
12871
|
-
|
|
12872
|
-
|
|
12873
|
-
|
|
12874
|
-
|
|
12875
|
-
|
|
12876
|
-
|
|
13146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
13147
|
+
FieldInput_default,
|
|
13148
|
+
{
|
|
13149
|
+
id,
|
|
13150
|
+
label,
|
|
13151
|
+
description,
|
|
13152
|
+
validation: validationState,
|
|
13153
|
+
help,
|
|
13154
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
13155
|
+
import_components36.Upload,
|
|
13156
|
+
__spreadProps(__spreadValues({}, uploadProps), {
|
|
13157
|
+
usAccept: getAcceptsString(accepts),
|
|
13158
|
+
usDisabled: disabled,
|
|
13159
|
+
onSuccess: onUploadFile,
|
|
13160
|
+
onFailure: async () => onUpload(null),
|
|
13161
|
+
onCancel: async () => onUpload(null)
|
|
13162
|
+
})
|
|
13163
|
+
)
|
|
13164
|
+
}
|
|
13165
|
+
);
|
|
12877
13166
|
}
|
|
12878
13167
|
};
|
|
12879
13168
|
|
|
12880
13169
|
// ../renderers/src/ReviewRenderer.tsx
|
|
12881
|
-
var
|
|
13170
|
+
var import_components37 = require("@transferwise/components");
|
|
12882
13171
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
12883
13172
|
var ReviewRenderer = {
|
|
12884
13173
|
canRenderType: "review",
|
|
@@ -12892,9 +13181,9 @@ var ReviewRenderer = {
|
|
|
12892
13181
|
}
|
|
12893
13182
|
} : void 0;
|
|
12894
13183
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: getMargin(margin), children: [
|
|
12895
|
-
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13184
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components37.Header, { title: title != null ? title : "", action }),
|
|
12896
13185
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12897
|
-
|
|
13186
|
+
import_components37.DefinitionList,
|
|
12898
13187
|
{
|
|
12899
13188
|
layout: orientation,
|
|
12900
13189
|
definitions: fields.map(({ label, value, help }, index) => ({
|
|
@@ -12942,11 +13231,11 @@ var getFieldValue = (value, help, orientation) => {
|
|
|
12942
13231
|
var import_react19 = require("react");
|
|
12943
13232
|
|
|
12944
13233
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
12945
|
-
var
|
|
13234
|
+
var import_react_intl21 = require("react-intl");
|
|
12946
13235
|
|
|
12947
13236
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
12948
|
-
var
|
|
12949
|
-
var external_confirmation_messages_default = (0,
|
|
13237
|
+
var import_react_intl20 = require("react-intl");
|
|
13238
|
+
var external_confirmation_messages_default = (0, import_react_intl20.defineMessages)({
|
|
12950
13239
|
title: {
|
|
12951
13240
|
id: "df.wise.ExternalConfirmation.title",
|
|
12952
13241
|
defaultMessage: "Please confirm",
|
|
@@ -12970,19 +13259,19 @@ var external_confirmation_messages_default = (0, import_react_intl18.defineMessa
|
|
|
12970
13259
|
});
|
|
12971
13260
|
|
|
12972
13261
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
12973
|
-
var
|
|
13262
|
+
var import_components38 = require("@transferwise/components");
|
|
12974
13263
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
12975
13264
|
function ExternalConfirmationDialog({
|
|
12976
13265
|
external,
|
|
12977
13266
|
onClose
|
|
12978
13267
|
}) {
|
|
12979
|
-
const { formatMessage } = (0,
|
|
13268
|
+
const { formatMessage } = (0, import_react_intl21.useIntl)();
|
|
12980
13269
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
12981
13270
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
12982
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13271
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components38.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
|
|
12983
13272
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
12984
13273
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12985
|
-
|
|
13274
|
+
import_components38.Button,
|
|
12986
13275
|
{
|
|
12987
13276
|
block: true,
|
|
12988
13277
|
className: "m-b-2",
|
|
@@ -12995,7 +13284,7 @@ function ExternalConfirmationDialog({
|
|
|
12995
13284
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
12996
13285
|
}
|
|
12997
13286
|
),
|
|
12998
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13287
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components38.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
12999
13288
|
] }) })
|
|
13000
13289
|
] }) });
|
|
13001
13290
|
}
|
|
@@ -13024,23 +13313,21 @@ function useExternal(url) {
|
|
|
13024
13313
|
}
|
|
13025
13314
|
|
|
13026
13315
|
// ../renderers/src/step/BackButton.tsx
|
|
13027
|
-
var
|
|
13316
|
+
var import_components39 = require("@transferwise/components");
|
|
13028
13317
|
var import_icons3 = require("@transferwise/icons");
|
|
13029
13318
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
13030
13319
|
function BackButton({ title, onClick }) {
|
|
13031
13320
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "m-b-2", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
13032
|
-
"
|
|
13321
|
+
"button",
|
|
13033
13322
|
{
|
|
13034
|
-
|
|
13323
|
+
type: "button",
|
|
13035
13324
|
className: "df-back-btn",
|
|
13325
|
+
title,
|
|
13036
13326
|
"aria-label": title,
|
|
13037
|
-
onClick
|
|
13038
|
-
event.preventDefault();
|
|
13039
|
-
onClick();
|
|
13040
|
-
},
|
|
13327
|
+
onClick,
|
|
13041
13328
|
children: [
|
|
13042
13329
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "sr-only", children: title }),
|
|
13043
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13330
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components39.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
|
|
13044
13331
|
]
|
|
13045
13332
|
}
|
|
13046
13333
|
) });
|
|
@@ -13048,7 +13335,7 @@ function BackButton({ title, onClick }) {
|
|
|
13048
13335
|
var BackButton_default = BackButton;
|
|
13049
13336
|
|
|
13050
13337
|
// ../renderers/src/step/StepRenderer.tsx
|
|
13051
|
-
var
|
|
13338
|
+
var import_components40 = require("@transferwise/components");
|
|
13052
13339
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
13053
13340
|
var StepRenderer = {
|
|
13054
13341
|
canRenderType: "step",
|
|
@@ -13064,10 +13351,10 @@ function StepRendererComponent(props) {
|
|
|
13064
13351
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(StepRendererContextProvider, { value, children: [
|
|
13065
13352
|
back ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
13066
13353
|
title || description ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "m-b-4", children: [
|
|
13067
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13354
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components40.Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
13068
13355
|
description ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
13069
13356
|
] }) : void 0,
|
|
13070
|
-
error ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13357
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components40.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
13071
13358
|
children
|
|
13072
13359
|
] });
|
|
13073
13360
|
}
|
|
@@ -13541,7 +13828,7 @@ function isReference(block) {
|
|
|
13541
13828
|
|
|
13542
13829
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
13543
13830
|
var import_react67 = require("react");
|
|
13544
|
-
var
|
|
13831
|
+
var import_react_intl53 = require("react-intl");
|
|
13545
13832
|
|
|
13546
13833
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
13547
13834
|
var import_react25 = require("react");
|
|
@@ -14463,11 +14750,11 @@ function useExternalStepPolling(polling, onAction) {
|
|
|
14463
14750
|
|
|
14464
14751
|
// src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
|
|
14465
14752
|
var import_react55 = require("react");
|
|
14466
|
-
var
|
|
14753
|
+
var import_react_intl44 = require("react-intl");
|
|
14467
14754
|
|
|
14468
14755
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
14469
14756
|
var import_react54 = require("react");
|
|
14470
|
-
var
|
|
14757
|
+
var import_react_intl43 = require("react-intl");
|
|
14471
14758
|
|
|
14472
14759
|
// src/legacy/common/constants/DateMode.ts
|
|
14473
14760
|
var DateMode = {
|
|
@@ -14518,10 +14805,10 @@ var import_classnames15 = __toESM(require_classnames());
|
|
|
14518
14805
|
var import_react53 = require("react");
|
|
14519
14806
|
|
|
14520
14807
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
14521
|
-
var
|
|
14808
|
+
var import_components42 = require("@transferwise/components");
|
|
14522
14809
|
|
|
14523
14810
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
14524
|
-
var
|
|
14811
|
+
var import_components41 = require("@transferwise/components");
|
|
14525
14812
|
|
|
14526
14813
|
// src/legacy/layout/icon/FlagIcon.tsx
|
|
14527
14814
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
@@ -14572,10 +14859,10 @@ var DynamicIcon_default2 = DynamicIcon2;
|
|
|
14572
14859
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
14573
14860
|
var getNavigationOptionMedia = ({ icon, image }) => {
|
|
14574
14861
|
if (icon == null ? void 0 : icon.name) {
|
|
14575
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
14862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components41.Avatar, { type: import_components41.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(DynamicIcon_default2, { type: icon.name }) });
|
|
14576
14863
|
}
|
|
14577
14864
|
if (icon == null ? void 0 : icon.text) {
|
|
14578
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
14865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components41.Avatar, { type: import_components41.AvatarType.INITIALS, children: icon.text });
|
|
14579
14866
|
}
|
|
14580
14867
|
if (image == null ? void 0 : image.url) {
|
|
14581
14868
|
const { url, text } = image;
|
|
@@ -14619,7 +14906,7 @@ var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
|
14619
14906
|
var DynamicAlert = ({ component: alert }) => {
|
|
14620
14907
|
const { context, markdown, margin } = alert;
|
|
14621
14908
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
14622
|
-
|
|
14909
|
+
import_components42.Alert,
|
|
14623
14910
|
{
|
|
14624
14911
|
type: mapContextToAlertType(legacy_mapContext(context)),
|
|
14625
14912
|
className: getMargin2(margin),
|
|
@@ -14722,7 +15009,7 @@ var getBoxWidthClasses = (component) => {
|
|
|
14722
15009
|
var DynamicBox_default = DynamicBox;
|
|
14723
15010
|
|
|
14724
15011
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
14725
|
-
var
|
|
15012
|
+
var import_components43 = require("@transferwise/components");
|
|
14726
15013
|
|
|
14727
15014
|
// src/legacy/layout/button/utils.ts
|
|
14728
15015
|
var priorities = {
|
|
@@ -14794,7 +15081,7 @@ function DynamicButtonWithoutBehavior(props) {
|
|
|
14794
15081
|
}
|
|
14795
15082
|
};
|
|
14796
15083
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
14797
|
-
|
|
15084
|
+
import_components43.Button,
|
|
14798
15085
|
{
|
|
14799
15086
|
size: getButtonSize(component.size),
|
|
14800
15087
|
type: priority === "tertiary" ? void 0 : type,
|
|
@@ -14826,7 +15113,7 @@ function DynamicButtonWithBehavior(props) {
|
|
|
14826
15113
|
}
|
|
14827
15114
|
};
|
|
14828
15115
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
14829
|
-
|
|
15116
|
+
import_components43.Button,
|
|
14830
15117
|
{
|
|
14831
15118
|
size: getButtonSize(component.size),
|
|
14832
15119
|
type: priority === "tertiary" ? void 0 : type,
|
|
@@ -14894,15 +15181,15 @@ var getWidth = (bias) => {
|
|
|
14894
15181
|
var DynamicColumns_default = DynamicColumns;
|
|
14895
15182
|
|
|
14896
15183
|
// src/legacy/layout/decision/DynamicDecision.tsx
|
|
14897
|
-
var
|
|
15184
|
+
var import_components44 = require("@transferwise/components");
|
|
14898
15185
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
14899
15186
|
function DynamicDecision({ component, onAction }) {
|
|
14900
15187
|
const { loading } = useDynamicFlow();
|
|
14901
15188
|
const { margin, options, title } = component;
|
|
14902
15189
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: getMargin2(margin), children: [
|
|
14903
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
14904
|
-
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
14905
|
-
|
|
15190
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components44.Header, { as: "h2", title }),
|
|
15191
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components44.NavigationOptionsList, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15192
|
+
import_components44.NavigationOption,
|
|
14906
15193
|
{
|
|
14907
15194
|
title: option.title,
|
|
14908
15195
|
content: option.description,
|
|
@@ -14928,13 +15215,13 @@ var DynamicDivider = ({ component }) => {
|
|
|
14928
15215
|
var DynamicDivider_default = DynamicDivider;
|
|
14929
15216
|
|
|
14930
15217
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
14931
|
-
var
|
|
15218
|
+
var import_components45 = require("@transferwise/components");
|
|
14932
15219
|
var import_react32 = require("react");
|
|
14933
|
-
var
|
|
15220
|
+
var import_react_intl23 = require("react-intl");
|
|
14934
15221
|
|
|
14935
15222
|
// src/legacy/layout/external/DynamicExternal.messages.ts
|
|
14936
|
-
var
|
|
14937
|
-
var DynamicExternal_messages_default = (0,
|
|
15223
|
+
var import_react_intl22 = require("react-intl");
|
|
15224
|
+
var DynamicExternal_messages_default = (0, import_react_intl22.defineMessages)({
|
|
14938
15225
|
retryTitle: {
|
|
14939
15226
|
id: "dynamicFlows.DynamicExternal.retryTitle",
|
|
14940
15227
|
defaultMessage: "Reopen window",
|
|
@@ -14946,7 +15233,7 @@ var DynamicExternal_messages_default = (0, import_react_intl20.defineMessages)({
|
|
|
14946
15233
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
14947
15234
|
var DynamicExternal = ({ component, onAction }) => {
|
|
14948
15235
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
14949
|
-
const intl = (0,
|
|
15236
|
+
const intl = (0, import_react_intl23.useIntl)();
|
|
14950
15237
|
const openExternalUrl = (0, import_react32.useCallback)(
|
|
14951
15238
|
() => window.open(requestUrl, "df-external-window"),
|
|
14952
15239
|
[requestUrl]
|
|
@@ -14959,9 +15246,9 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
14959
15246
|
}) : void 0;
|
|
14960
15247
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
14961
15248
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
14962
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15249
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components45.Loader, { size: import_components45.Size.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
|
|
14963
15250
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("br", {}),
|
|
14964
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15251
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components45.Button, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
|
|
14965
15252
|
] });
|
|
14966
15253
|
};
|
|
14967
15254
|
var DynamicExternal_default = DynamicExternal;
|
|
@@ -14970,7 +15257,7 @@ var DynamicExternal_default = DynamicExternal;
|
|
|
14970
15257
|
var import_react46 = require("react");
|
|
14971
15258
|
|
|
14972
15259
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
14973
|
-
var
|
|
15260
|
+
var import_components46 = require("@transferwise/components");
|
|
14974
15261
|
var import_classnames6 = __toESM(require_classnames());
|
|
14975
15262
|
var import_react33 = require("react");
|
|
14976
15263
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
@@ -14982,7 +15269,7 @@ var getSchemaColumnClasses = (width) => ({
|
|
|
14982
15269
|
"col-sm-4": width === "sm"
|
|
14983
15270
|
});
|
|
14984
15271
|
function AllOfSchema(props) {
|
|
14985
|
-
const { disabled = false } = props;
|
|
15272
|
+
const { disabled = false, hideTitle = false } = props;
|
|
14986
15273
|
const onChangeModelIndex = (index, onChangeProps) => {
|
|
14987
15274
|
const modelSchema = props.schema.allOf[index];
|
|
14988
15275
|
models[index] = getValidObjectModelParts(onChangeProps.model, modelSchema) || {};
|
|
@@ -14991,7 +15278,7 @@ function AllOfSchema(props) {
|
|
|
14991
15278
|
};
|
|
14992
15279
|
const [models, setModels] = (0, import_react33.useState)(splitModel(props.model, props.schema.allOf));
|
|
14993
15280
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
14994
|
-
props.schema.title && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
15281
|
+
props.schema.title && !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components46.Header, { title: props.schema.title }),
|
|
14995
15282
|
props.schema.description && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("p", { children: props.schema.description }),
|
|
14996
15283
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
|
|
14997
15284
|
// eslint-disable-next-line react/no-array-index-key
|
|
@@ -15016,14 +15303,14 @@ function AllOfSchema(props) {
|
|
|
15016
15303
|
var AllOfSchema_default = AllOfSchema;
|
|
15017
15304
|
|
|
15018
15305
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
15019
|
-
var
|
|
15306
|
+
var import_components48 = require("@transferwise/components");
|
|
15020
15307
|
var import_classnames7 = __toESM(require_classnames());
|
|
15021
15308
|
var import_react34 = require("react");
|
|
15022
15309
|
|
|
15023
15310
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
15024
|
-
var
|
|
15311
|
+
var import_components47 = require("@transferwise/components");
|
|
15025
15312
|
var import_formatting2 = require("@transferwise/formatting");
|
|
15026
|
-
var
|
|
15313
|
+
var import_react_intl24 = require("react-intl");
|
|
15027
15314
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
15028
15315
|
function ControlFeedback(props) {
|
|
15029
15316
|
const { errors = "", validations = [], validationMessages = {} } = props;
|
|
@@ -15034,16 +15321,16 @@ function ControlFeedback(props) {
|
|
|
15034
15321
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
15035
15322
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
15036
15323
|
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { id: props.id, children: [
|
|
15037
|
-
isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15038
|
-
isValidationVisible ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15039
|
-
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
15324
|
+
isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components47.InlineAlert, { type: "error", children: errors }) : null,
|
|
15325
|
+
isValidationVisible ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components47.InlineAlert, { type: "error", children: validations.map((validation) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: mergedValidationMessages[validation] }, validation)) }) : null,
|
|
15326
|
+
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_components47.InlineAlert, { type: "info", children: [
|
|
15040
15327
|
isDescriptionVisible && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: props.schema.description }),
|
|
15041
15328
|
hasInfoMessage && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: props.infoMessage })
|
|
15042
15329
|
] })
|
|
15043
15330
|
] });
|
|
15044
15331
|
}
|
|
15045
15332
|
function useDefaultValidationMessages(schema) {
|
|
15046
|
-
const { formatMessage, locale } = (0,
|
|
15333
|
+
const { formatMessage, locale } = (0, import_react_intl24.useIntl)();
|
|
15047
15334
|
const formattedMessages = {
|
|
15048
15335
|
type: formatMessage(validation_messages_default.type),
|
|
15049
15336
|
minimum: formatMessage(validation_messages_default.minimum, {
|
|
@@ -15130,11 +15417,11 @@ function constructUploadError(response) {
|
|
|
15130
15417
|
}
|
|
15131
15418
|
|
|
15132
15419
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.tsx
|
|
15133
|
-
var
|
|
15420
|
+
var import_react_intl26 = require("react-intl");
|
|
15134
15421
|
|
|
15135
15422
|
// src/legacy/common/messages.ts
|
|
15136
|
-
var
|
|
15137
|
-
var messages_default = (0,
|
|
15423
|
+
var import_react_intl25 = require("react-intl");
|
|
15424
|
+
var messages_default = (0, import_react_intl25.defineMessages)({
|
|
15138
15425
|
required: {
|
|
15139
15426
|
id: "dynamicFlows.DefaultErrorMessages.required",
|
|
15140
15427
|
defaultMessage: "Please fill out this field.",
|
|
@@ -15147,7 +15434,7 @@ function useFormattedDefaultErrorMessages({
|
|
|
15147
15434
|
maxItems,
|
|
15148
15435
|
minItems
|
|
15149
15436
|
}) {
|
|
15150
|
-
const { formatMessage } = (0,
|
|
15437
|
+
const { formatMessage } = (0, import_react_intl26.useIntl)();
|
|
15151
15438
|
const { maxFileSizeError, maxItemsError, minItemsError } = multi_file_upload_messages_default;
|
|
15152
15439
|
return {
|
|
15153
15440
|
maxFileSizeErrorMessage: formatMessage(maxFileSizeError),
|
|
@@ -15221,7 +15508,7 @@ function MultipleFileUploadSchema(props) {
|
|
|
15221
15508
|
const feedbackId = `${uid}-feedback`;
|
|
15222
15509
|
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: (0, import_classnames7.default)("form-group", { "has-error": showError }), children: [
|
|
15223
15510
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
|
|
15224
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
15511
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components48.UploadInput, __spreadValues({}, uploadInputProps)) }),
|
|
15225
15512
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
15226
15513
|
ControlFeedback_default,
|
|
15227
15514
|
{
|
|
@@ -15244,7 +15531,7 @@ function getSuccessfullyProcessedFiles(allFiles) {
|
|
|
15244
15531
|
return allFiles.filter((file) => !file.error && file.status === "succeeded");
|
|
15245
15532
|
}
|
|
15246
15533
|
function convertFileIdsToComponentFileObjects(fileIds) {
|
|
15247
|
-
return fileIds.map((id) => isValidId(id) ? { id, status:
|
|
15534
|
+
return fileIds.map((id) => isValidId(id) ? { id, status: import_components48.Status.SUCCEEDED } : null).filter((item) => item !== null);
|
|
15248
15535
|
}
|
|
15249
15536
|
function isValidId(id) {
|
|
15250
15537
|
return isNumber3(id) || isString2(id);
|
|
@@ -15255,13 +15542,13 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
15255
15542
|
}
|
|
15256
15543
|
|
|
15257
15544
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
15258
|
-
var
|
|
15545
|
+
var import_components50 = require("@transferwise/components");
|
|
15259
15546
|
var import_classnames8 = __toESM(require_classnames());
|
|
15260
15547
|
var import_react35 = require("react");
|
|
15261
|
-
var
|
|
15548
|
+
var import_react_intl28 = require("react-intl");
|
|
15262
15549
|
|
|
15263
15550
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
15264
|
-
var
|
|
15551
|
+
var import_components49 = require("@transferwise/components");
|
|
15265
15552
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
15266
15553
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
15267
15554
|
switch (controlType) {
|
|
@@ -15313,17 +15600,17 @@ var getIconPropertyForSelectOption = (icon) => {
|
|
|
15313
15600
|
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
15314
15601
|
if (image == null ? void 0 : image.url) {
|
|
15315
15602
|
return {
|
|
15316
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15603
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components49.Avatar, { type: import_components49.AvatarType.THUMBNAIL, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("img", { src: image.url, alt: "" }) })
|
|
15317
15604
|
};
|
|
15318
15605
|
}
|
|
15319
15606
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
15320
15607
|
return {
|
|
15321
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15608
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components49.Avatar, { type: import_components49.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(DynamicIcon_default2, { type: icon.name }) })
|
|
15322
15609
|
};
|
|
15323
15610
|
}
|
|
15324
15611
|
if (icon == null ? void 0 : icon.text) {
|
|
15325
15612
|
return {
|
|
15326
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15613
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components49.Avatar, { type: import_components49.AvatarType.INITIALS, children: icon.text })
|
|
15327
15614
|
};
|
|
15328
15615
|
}
|
|
15329
15616
|
return null;
|
|
@@ -15352,8 +15639,8 @@ var getDisabled = (disabled) => {
|
|
|
15352
15639
|
};
|
|
15353
15640
|
|
|
15354
15641
|
// src/common/messages/multi-select.messages.ts
|
|
15355
|
-
var
|
|
15356
|
-
var multi_select_messages_default2 = (0,
|
|
15642
|
+
var import_react_intl27 = require("react-intl");
|
|
15643
|
+
var multi_select_messages_default2 = (0, import_react_intl27.defineMessages)({
|
|
15357
15644
|
summary: {
|
|
15358
15645
|
id: "dynamicFlows.MultiSelect.summary",
|
|
15359
15646
|
defaultMessage: "{first} and {count} more",
|
|
@@ -15371,7 +15658,7 @@ function MultiSelectSchema({
|
|
|
15371
15658
|
errors,
|
|
15372
15659
|
onChange
|
|
15373
15660
|
}) {
|
|
15374
|
-
const { formatMessage, locale } = (0,
|
|
15661
|
+
const { formatMessage, locale } = (0, import_react_intl28.useIntl)();
|
|
15375
15662
|
const { disabled, items, validationMessages, placeholder } = schema;
|
|
15376
15663
|
const options = items.oneOf.map((item) => mapConstSchemaToOption(item, "select"));
|
|
15377
15664
|
const id = (0, import_react35.useMemo)(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
@@ -15417,7 +15704,7 @@ function MultiSelectSchema({
|
|
|
15417
15704
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_classnames8.default)("d-flex flex-column", formGroupClasses), children: [
|
|
15418
15705
|
schema.title ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("label", { htmlFor: id, children: schema.title }) : void 0,
|
|
15419
15706
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
15420
|
-
|
|
15707
|
+
import_components50.SelectInput,
|
|
15421
15708
|
{
|
|
15422
15709
|
id,
|
|
15423
15710
|
multiple: true,
|
|
@@ -15442,7 +15729,7 @@ function MultiSelectSchema({
|
|
|
15442
15729
|
if (withinTrigger) {
|
|
15443
15730
|
return selected && index === selected[0] ? getFormattedMessage() : void 0;
|
|
15444
15731
|
}
|
|
15445
|
-
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
15732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components50.SelectInputOptionContent, { title: label, note: note != null ? note : secondary, icon });
|
|
15446
15733
|
},
|
|
15447
15734
|
onChange: broadcastModelChange
|
|
15448
15735
|
}
|
|
@@ -15472,17 +15759,17 @@ var getInitialModelIndices2 = (model, options) => {
|
|
|
15472
15759
|
};
|
|
15473
15760
|
|
|
15474
15761
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
15475
|
-
var
|
|
15762
|
+
var import_components52 = require("@transferwise/components");
|
|
15476
15763
|
var import_icons4 = require("@transferwise/icons");
|
|
15477
15764
|
var import_react37 = require("react");
|
|
15478
|
-
var
|
|
15765
|
+
var import_react_intl31 = require("react-intl");
|
|
15479
15766
|
|
|
15480
15767
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
15481
|
-
var
|
|
15768
|
+
var import_components51 = require("@transferwise/components");
|
|
15482
15769
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
15483
15770
|
function ItemSummaryOption2({ item, onClick }) {
|
|
15484
15771
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
15485
|
-
|
|
15772
|
+
import_components51.NavigationOption,
|
|
15486
15773
|
{
|
|
15487
15774
|
media: getNavigationOptionMedia(item),
|
|
15488
15775
|
title: item.title,
|
|
@@ -15494,8 +15781,8 @@ function ItemSummaryOption2({ item, onClick }) {
|
|
|
15494
15781
|
}
|
|
15495
15782
|
|
|
15496
15783
|
// src/common/messages/repeatable.messages.ts
|
|
15497
|
-
var
|
|
15498
|
-
var repeatable_messages_default2 = (0,
|
|
15784
|
+
var import_react_intl29 = require("react-intl");
|
|
15785
|
+
var repeatable_messages_default2 = (0, import_react_intl29.defineMessages)({
|
|
15499
15786
|
addItemTitle: {
|
|
15500
15787
|
id: "dynamicFlows.ArraySchema.addItemTitle",
|
|
15501
15788
|
defaultMessage: "Add Item",
|
|
@@ -15520,7 +15807,7 @@ var repeatable_messages_default2 = (0, import_react_intl27.defineMessages)({
|
|
|
15520
15807
|
|
|
15521
15808
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
|
|
15522
15809
|
var import_react36 = require("react");
|
|
15523
|
-
var
|
|
15810
|
+
var import_react_intl30 = require("react-intl");
|
|
15524
15811
|
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
15525
15812
|
function RepeatableSchemaStep({
|
|
15526
15813
|
type,
|
|
@@ -15531,7 +15818,7 @@ function RepeatableSchemaStep({
|
|
|
15531
15818
|
onModelChange,
|
|
15532
15819
|
onAction
|
|
15533
15820
|
}) {
|
|
15534
|
-
const { formatMessage } = (0,
|
|
15821
|
+
const { formatMessage } = (0, import_react_intl30.useIntl)();
|
|
15535
15822
|
const [filename, setFilename] = (0, import_react36.useState)(void 0);
|
|
15536
15823
|
const step = {
|
|
15537
15824
|
layout: [
|
|
@@ -15838,7 +16125,7 @@ function RepeatableSchema({
|
|
|
15838
16125
|
setEditableItem({ item: null, model: null });
|
|
15839
16126
|
setOpenModalType(null);
|
|
15840
16127
|
};
|
|
15841
|
-
const { formatMessage } = (0,
|
|
16128
|
+
const { formatMessage } = (0, import_react_intl31.useIntl)();
|
|
15842
16129
|
const validations = getValidationFailures(model, schema, required);
|
|
15843
16130
|
const base64ValidationMessages = useFormattedDefaultErrorMessages({
|
|
15844
16131
|
minItems: schema.minItems,
|
|
@@ -15853,7 +16140,7 @@ function RepeatableSchema({
|
|
|
15853
16140
|
"has-error": (_a = errors && !isEmpty(errors)) != null ? _a : submitted && validations.length
|
|
15854
16141
|
};
|
|
15855
16142
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { id, className: (0, import_classnames9.default)(formGroupClasses), children: [
|
|
15856
|
-
schema.title && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
16143
|
+
schema.title && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_components52.Header, { title: schema.title }),
|
|
15857
16144
|
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15858
16145
|
ItemSummaryOption2,
|
|
15859
16146
|
{
|
|
@@ -15863,7 +16150,7 @@ function RepeatableSchema({
|
|
|
15863
16150
|
JSON.stringify(itemSummary)
|
|
15864
16151
|
)),
|
|
15865
16152
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15866
|
-
|
|
16153
|
+
import_components52.NavigationOption,
|
|
15867
16154
|
{
|
|
15868
16155
|
media: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_icons4.Plus, {}),
|
|
15869
16156
|
title: schema.addItemTitle || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
@@ -15872,7 +16159,7 @@ function RepeatableSchema({
|
|
|
15872
16159
|
}
|
|
15873
16160
|
),
|
|
15874
16161
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15875
|
-
|
|
16162
|
+
import_components52.Modal,
|
|
15876
16163
|
{
|
|
15877
16164
|
open: openModalType !== null,
|
|
15878
16165
|
title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
@@ -15961,7 +16248,7 @@ var ArraySchema = (props) => {
|
|
|
15961
16248
|
var ArraySchema_default = ArraySchema;
|
|
15962
16249
|
|
|
15963
16250
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
15964
|
-
var
|
|
16251
|
+
var import_components53 = require("@transferwise/components");
|
|
15965
16252
|
var import_classnames10 = __toESM(require_classnames());
|
|
15966
16253
|
var import_react38 = require("react");
|
|
15967
16254
|
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
@@ -16004,7 +16291,7 @@ function ObjectSchema(props) {
|
|
|
16004
16291
|
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
16005
16292
|
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
16006
16293
|
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("fieldset", { children: [
|
|
16007
|
-
props.schema.title && !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
16294
|
+
props.schema.title && !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_components53.Header, { title: props.schema.title, as: "legend" }),
|
|
16008
16295
|
props.schema.description && !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("p", { children: [
|
|
16009
16296
|
" ",
|
|
16010
16297
|
props.schema.description,
|
|
@@ -16038,17 +16325,17 @@ function ObjectSchema(props) {
|
|
|
16038
16325
|
var ObjectSchema_default = ObjectSchema;
|
|
16039
16326
|
|
|
16040
16327
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
16041
|
-
var
|
|
16328
|
+
var import_components56 = require("@transferwise/components");
|
|
16042
16329
|
var import_classnames11 = __toESM(require_classnames());
|
|
16043
16330
|
var import_react41 = require("react");
|
|
16044
16331
|
|
|
16045
16332
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
16046
|
-
var
|
|
16047
|
-
var
|
|
16333
|
+
var import_components54 = require("@transferwise/components");
|
|
16334
|
+
var import_react_intl33 = require("react-intl");
|
|
16048
16335
|
|
|
16049
16336
|
// src/common/messages/help.messages.ts
|
|
16050
|
-
var
|
|
16051
|
-
var help_messages_default2 = (0,
|
|
16337
|
+
var import_react_intl32 = require("react-intl");
|
|
16338
|
+
var help_messages_default2 = (0, import_react_intl32.defineMessages)({
|
|
16052
16339
|
helpAria: {
|
|
16053
16340
|
id: "dynamicFlows.Help.ariaLabel",
|
|
16054
16341
|
defaultMessage: "Click here for more info.",
|
|
@@ -16059,12 +16346,12 @@ var help_messages_default2 = (0, import_react_intl30.defineMessages)({
|
|
|
16059
16346
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
16060
16347
|
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
16061
16348
|
function Help2(props) {
|
|
16062
|
-
const intl = (0,
|
|
16349
|
+
const intl = (0, import_react_intl33.useIntl)();
|
|
16063
16350
|
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16064
|
-
|
|
16351
|
+
import_components54.Info,
|
|
16065
16352
|
{
|
|
16066
16353
|
className: "m-l-1",
|
|
16067
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16354
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_components54.Markdown, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
|
|
16068
16355
|
presentation: "POPOVER",
|
|
16069
16356
|
size: "sm",
|
|
16070
16357
|
"aria-label": intl.formatMessage(help_messages_default2.helpAria)
|
|
@@ -16075,10 +16362,10 @@ var Help_default2 = Help2;
|
|
|
16075
16362
|
|
|
16076
16363
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
16077
16364
|
var import_react40 = require("react");
|
|
16078
|
-
var
|
|
16365
|
+
var import_react_intl34 = require("react-intl");
|
|
16079
16366
|
|
|
16080
16367
|
// src/legacy/formControl/FormControl.tsx
|
|
16081
|
-
var
|
|
16368
|
+
var import_components55 = require("@transferwise/components");
|
|
16082
16369
|
var import_react39 = require("react");
|
|
16083
16370
|
|
|
16084
16371
|
// src/legacy/formControl/utils/value-utils.ts
|
|
@@ -16356,7 +16643,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16356
16643
|
switch (type) {
|
|
16357
16644
|
case FormControlType.RADIO:
|
|
16358
16645
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16359
|
-
|
|
16646
|
+
import_components55.RadioGroup,
|
|
16360
16647
|
{
|
|
16361
16648
|
radios: options.map(this.mapOption),
|
|
16362
16649
|
name,
|
|
@@ -16372,7 +16659,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16372
16659
|
);
|
|
16373
16660
|
case FormControlType.CHECKBOX:
|
|
16374
16661
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16375
|
-
|
|
16662
|
+
import_components55.Checkbox,
|
|
16376
16663
|
{
|
|
16377
16664
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
16378
16665
|
disabled,
|
|
@@ -16390,7 +16677,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16390
16677
|
const items = options;
|
|
16391
16678
|
const selected = this.getSelectedOption(options);
|
|
16392
16679
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "d-flex flex-column", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16393
|
-
|
|
16680
|
+
import_components55.SelectInput,
|
|
16394
16681
|
{
|
|
16395
16682
|
id,
|
|
16396
16683
|
UNSAFE_triggerButtonProps: {
|
|
@@ -16406,7 +16693,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16406
16693
|
})),
|
|
16407
16694
|
value: selected != null ? selected : null,
|
|
16408
16695
|
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16409
|
-
|
|
16696
|
+
import_components55.SelectInputOptionContent,
|
|
16410
16697
|
{
|
|
16411
16698
|
title: label2,
|
|
16412
16699
|
note: withinTrigger ? note != null ? note : secondary : note,
|
|
@@ -16435,7 +16722,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16435
16722
|
}
|
|
16436
16723
|
case FormControlType.TAB:
|
|
16437
16724
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16438
|
-
|
|
16725
|
+
import_components55.Tabs,
|
|
16439
16726
|
{
|
|
16440
16727
|
selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
|
|
16441
16728
|
tabs: options.map((option) => ({
|
|
@@ -16520,7 +16807,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16520
16807
|
case FormControlType.DATE:
|
|
16521
16808
|
case FormControlType.DATETIME:
|
|
16522
16809
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16523
|
-
|
|
16810
|
+
import_components55.DateInput,
|
|
16524
16811
|
{
|
|
16525
16812
|
"aria-labelledby": labelledBy,
|
|
16526
16813
|
dayAutoComplete: this.getAutocompleteValue({ suffix: "-day" }),
|
|
@@ -16537,7 +16824,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16537
16824
|
);
|
|
16538
16825
|
case FormControlType.DATELOOKUP: {
|
|
16539
16826
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16540
|
-
|
|
16827
|
+
import_components55.DateLookup,
|
|
16541
16828
|
{
|
|
16542
16829
|
value: getSafeDateStringValue(value),
|
|
16543
16830
|
min: minDate,
|
|
@@ -16555,7 +16842,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16555
16842
|
}
|
|
16556
16843
|
case FormControlType.TEL:
|
|
16557
16844
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16558
|
-
|
|
16845
|
+
import_components55.PhoneNumberInput,
|
|
16559
16846
|
{
|
|
16560
16847
|
disabled,
|
|
16561
16848
|
countryCode,
|
|
@@ -16587,7 +16874,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16587
16874
|
};
|
|
16588
16875
|
if (this.props.displayPattern) {
|
|
16589
16876
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16590
|
-
|
|
16877
|
+
import_components55.TextareaWithDisplayFormat,
|
|
16591
16878
|
__spreadProps(__spreadValues({
|
|
16592
16879
|
displayPattern: this.props.displayPattern
|
|
16593
16880
|
}, textareaProps), {
|
|
@@ -16606,7 +16893,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16606
16893
|
case FormControlType.FILE:
|
|
16607
16894
|
case FormControlType.UPLOAD: {
|
|
16608
16895
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16609
|
-
|
|
16896
|
+
import_components55.Upload,
|
|
16610
16897
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
16611
16898
|
usAccept: uploadProps.usAccept || "*",
|
|
16612
16899
|
usDisabled: uploadProps.usDisabled || disabled,
|
|
@@ -16643,7 +16930,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16643
16930
|
};
|
|
16644
16931
|
if (this.props.displayPattern) {
|
|
16645
16932
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16646
|
-
|
|
16933
|
+
import_components55.InputWithDisplayFormat,
|
|
16647
16934
|
__spreadProps(__spreadValues({
|
|
16648
16935
|
displayPattern: this.props.displayPattern
|
|
16649
16936
|
}, inputProps), {
|
|
@@ -16781,7 +17068,7 @@ function SchemaFormControl(props) {
|
|
|
16781
17068
|
labelledBy
|
|
16782
17069
|
} = props;
|
|
16783
17070
|
const log = useLogger();
|
|
16784
|
-
const intl = (0,
|
|
17071
|
+
const intl = (0, import_react_intl34.useIntl)();
|
|
16785
17072
|
const getSanitisedValue = (value2) => isNativeInput(schema.type) && (isNull3(value2) || isUndefined3(value2)) ? "" : value2;
|
|
16786
17073
|
const onModelChange = (value2, type, metadata) => {
|
|
16787
17074
|
onChange(getValidBasicModelOrNull(value2, schema), type, metadata);
|
|
@@ -16983,7 +17270,7 @@ function getTitleAndHelp(schema, forId, labelId) {
|
|
|
16983
17270
|
schema.title,
|
|
16984
17271
|
" ",
|
|
16985
17272
|
helpElement
|
|
16986
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
17273
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_components56.Header, { title: (_a = schema.title) != null ? _a : "" }) });
|
|
16987
17274
|
return schema.title ? titleElement : helpElement;
|
|
16988
17275
|
}
|
|
16989
17276
|
function getValidations(props, schemaIndex) {
|
|
@@ -17018,10 +17305,10 @@ var OneOfSchema_default = OneOfSchema;
|
|
|
17018
17305
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
17019
17306
|
var import_classnames12 = __toESM(require_classnames());
|
|
17020
17307
|
var import_react43 = require("react");
|
|
17021
|
-
var
|
|
17308
|
+
var import_react_intl35 = require("react-intl");
|
|
17022
17309
|
|
|
17023
17310
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
17024
|
-
var
|
|
17311
|
+
var import_components57 = require("@transferwise/components");
|
|
17025
17312
|
var import_react42 = require("react");
|
|
17026
17313
|
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
17027
17314
|
function UploadInputAdapter(props) {
|
|
@@ -17039,7 +17326,7 @@ function UploadInputAdapter(props) {
|
|
|
17039
17326
|
onCancel
|
|
17040
17327
|
} = props;
|
|
17041
17328
|
const onEvent = useEventDispatcher();
|
|
17042
|
-
const files = (0, import_react42.useMemo)(() => fileId ? [{ id: fileId, status:
|
|
17329
|
+
const files = (0, import_react42.useMemo)(() => fileId ? [{ id: fileId, status: import_components57.Status.SUCCEEDED }] : [], [fileId]);
|
|
17043
17330
|
const uploadFile = (formData) => {
|
|
17044
17331
|
onEvent("Dynamic Flow - PersistAsync", { status: "pending", schemaId: id });
|
|
17045
17332
|
return httpClient(String(httpOptions.url), {
|
|
@@ -17059,7 +17346,7 @@ function UploadInputAdapter(props) {
|
|
|
17059
17346
|
});
|
|
17060
17347
|
};
|
|
17061
17348
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
17062
|
-
|
|
17349
|
+
import_components57.UploadInput,
|
|
17063
17350
|
{
|
|
17064
17351
|
id,
|
|
17065
17352
|
fileInputName: httpOptions.fileInputName,
|
|
@@ -17085,7 +17372,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
17085
17372
|
const [persistAsyncValidations, setPersistAsyncValidations] = (0, import_react43.useState)(null);
|
|
17086
17373
|
const [validations, setValidations] = (0, import_react43.useState)([]);
|
|
17087
17374
|
const [changed, setChanged] = (0, import_react43.useState)(false);
|
|
17088
|
-
const intl = (0,
|
|
17375
|
+
const intl = (0, import_react_intl35.useIntl)();
|
|
17089
17376
|
const httpClient = useHttpClient();
|
|
17090
17377
|
const onEvent = useEventDispatcher();
|
|
17091
17378
|
(0, import_react43.useEffect)(() => {
|
|
@@ -17194,7 +17481,7 @@ var getSelectionFromModel = (schema, model) => {
|
|
|
17194
17481
|
};
|
|
17195
17482
|
|
|
17196
17483
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
17197
|
-
var
|
|
17484
|
+
var import_components58 = require("@transferwise/components");
|
|
17198
17485
|
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
17199
17486
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
17200
17487
|
const { id, selection, setSelection } = props;
|
|
@@ -17206,12 +17493,12 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
17206
17493
|
const toggleSelection = () => {
|
|
17207
17494
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
17208
17495
|
};
|
|
17209
|
-
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
17496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_components58.Checkbox, { id, label: title, checked, onChange: toggleSelection }) });
|
|
17210
17497
|
};
|
|
17211
17498
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
17212
17499
|
|
|
17213
17500
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
17214
|
-
var
|
|
17501
|
+
var import_components59 = require("@transferwise/components");
|
|
17215
17502
|
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
17216
17503
|
function PromotedOneOfRadioControl(props) {
|
|
17217
17504
|
var _a, _b;
|
|
@@ -17232,7 +17519,7 @@ function PromotedOneOfRadioControl(props) {
|
|
|
17232
17519
|
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "form-group", children: [
|
|
17233
17520
|
title && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("label", { className: "control-label", htmlFor: id, children: title }),
|
|
17234
17521
|
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
17235
|
-
|
|
17522
|
+
import_components59.RadioGroup,
|
|
17236
17523
|
{
|
|
17237
17524
|
name: "promoted-selection",
|
|
17238
17525
|
selectedValue: selection,
|
|
@@ -17323,12 +17610,12 @@ function getOtherOneOf(schema) {
|
|
|
17323
17610
|
var PromotedOneOfSchema_default = PromotedOneOfSchema;
|
|
17324
17611
|
|
|
17325
17612
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
17326
|
-
var
|
|
17327
|
-
var
|
|
17613
|
+
var import_components60 = require("@transferwise/components");
|
|
17614
|
+
var import_react_intl37 = require("react-intl");
|
|
17328
17615
|
|
|
17329
17616
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.ts
|
|
17330
|
-
var
|
|
17331
|
-
var ReadOnlySchema_messages_default = (0,
|
|
17617
|
+
var import_react_intl36 = require("react-intl");
|
|
17618
|
+
var ReadOnlySchema_messages_default = (0, import_react_intl36.defineMessages)({
|
|
17332
17619
|
yes: {
|
|
17333
17620
|
id: "dynamicFlows.ReadOnlySchema.yes",
|
|
17334
17621
|
defaultMessage: "Yes",
|
|
@@ -17345,9 +17632,9 @@ var ReadOnlySchema_messages_default = (0, import_react_intl34.defineMessages)({
|
|
|
17345
17632
|
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
17346
17633
|
function ReadOnlySchema({ schema, model }) {
|
|
17347
17634
|
const { title = "" } = schema;
|
|
17348
|
-
const { formatMessage } = (0,
|
|
17635
|
+
const { formatMessage } = (0, import_react_intl37.useIntl)();
|
|
17349
17636
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
17350
|
-
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
17637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_components60.DefinitionList, { layout: import_components60.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
17351
17638
|
}
|
|
17352
17639
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
17353
17640
|
function getValueForSchema({
|
|
@@ -17571,7 +17858,7 @@ function DynamicForm({
|
|
|
17571
17858
|
var DynamicForm_default = DynamicForm;
|
|
17572
17859
|
|
|
17573
17860
|
// src/legacy/layout/heading/DynamicHeading.tsx
|
|
17574
|
-
var
|
|
17861
|
+
var import_components61 = require("@transferwise/components");
|
|
17575
17862
|
var import_classnames13 = __toESM(require_classnames());
|
|
17576
17863
|
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
17577
17864
|
var DynamicHeading = (props) => {
|
|
@@ -17598,30 +17885,30 @@ var DisplayHeading2 = ({ size, text, classes }) => {
|
|
|
17598
17885
|
switch (size) {
|
|
17599
17886
|
case "xs":
|
|
17600
17887
|
case "sm":
|
|
17601
|
-
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
17888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components61.Display, { type: "display-small", className: classes, children: text });
|
|
17602
17889
|
case "xl":
|
|
17603
17890
|
case "lg":
|
|
17604
|
-
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
17891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components61.Display, { type: "display-large", className: classes, children: text });
|
|
17605
17892
|
case "md":
|
|
17606
17893
|
default:
|
|
17607
|
-
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
17894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components61.Display, { type: "display-medium", className: classes, children: text });
|
|
17608
17895
|
}
|
|
17609
17896
|
};
|
|
17610
17897
|
var DynamicHeading_default = DynamicHeading;
|
|
17611
17898
|
|
|
17612
17899
|
// src/legacy/layout/markdown/DynamicMarkdown.tsx
|
|
17613
|
-
var
|
|
17900
|
+
var import_components62 = require("@transferwise/components");
|
|
17614
17901
|
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
17615
17902
|
var DynamicMarkdown = ({ component }) => {
|
|
17616
17903
|
const { content, align, margin } = component;
|
|
17617
|
-
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
17904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components62.Markdown, { config: { link: { target: "_blank" } }, children: content }) });
|
|
17618
17905
|
};
|
|
17619
17906
|
var DynamicInfo = ({ component }) => {
|
|
17620
|
-
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
17907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components62.Markdown, { config: { link: { target: "_blank" } }, children: component.markdown }) });
|
|
17621
17908
|
};
|
|
17622
17909
|
|
|
17623
17910
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
17624
|
-
var
|
|
17911
|
+
var import_components63 = require("@transferwise/components");
|
|
17625
17912
|
var import_react48 = require("react");
|
|
17626
17913
|
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
17627
17914
|
function DynamicImage({ component: image }) {
|
|
@@ -17640,7 +17927,7 @@ function DynamicImage({ component: image }) {
|
|
|
17640
17927
|
if (!imageSource) {
|
|
17641
17928
|
return null;
|
|
17642
17929
|
}
|
|
17643
|
-
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
17930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_components63.Image, __spreadValues({ className: `img-responsive ${getMargin2(margin || "md")}` }, imageProps)) });
|
|
17644
17931
|
}
|
|
17645
17932
|
var readImageBlobAsDataURL2 = (imageBlob) => (
|
|
17646
17933
|
// we can safely assume the type of reader.result is string
|
|
@@ -17676,7 +17963,7 @@ var getImageSource2 = async (httpClient, imageUrl) => {
|
|
|
17676
17963
|
var DynamicImage_default = DynamicImage;
|
|
17677
17964
|
|
|
17678
17965
|
// src/legacy/layout/instructions/DynamicInstructions.tsx
|
|
17679
|
-
var
|
|
17966
|
+
var import_components64 = require("@transferwise/components");
|
|
17680
17967
|
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
17681
17968
|
var doContext2 = ["positive", "neutral"];
|
|
17682
17969
|
var dontContext2 = ["warning", "negative"];
|
|
@@ -17685,8 +17972,8 @@ var DynamicInstructions = ({ component }) => {
|
|
|
17685
17972
|
const dos = items.filter((item) => doContext2.includes(item.context)).map(({ text }) => text);
|
|
17686
17973
|
const donts = items.filter((item) => dontContext2.includes(item.context)).map(({ text }) => text);
|
|
17687
17974
|
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: getMargin2(component.margin || "md"), children: [
|
|
17688
|
-
component.title ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
17689
|
-
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
17975
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_components64.Header, { title: component.title }) : null,
|
|
17976
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_components64.InstructionsList, { dos, donts })
|
|
17690
17977
|
] });
|
|
17691
17978
|
};
|
|
17692
17979
|
var DynamicInstructions_default = DynamicInstructions;
|
|
@@ -17796,21 +18083,49 @@ function DynamicLayout(props) {
|
|
|
17796
18083
|
var DynamicLayout_default = DynamicLayout;
|
|
17797
18084
|
|
|
17798
18085
|
// src/legacy/layout/list/DynamicStatusList.tsx
|
|
17799
|
-
var
|
|
18086
|
+
var import_components65 = require("@transferwise/components");
|
|
17800
18087
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
17801
|
-
var DynamicStatusList = ({ component }) => {
|
|
18088
|
+
var DynamicStatusList = ({ component, onAction }) => {
|
|
17802
18089
|
return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: getMargin2(component.margin || "md"), children: [
|
|
17803
|
-
component.title ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
17804
|
-
component.items.map(mapListItemToSummary)
|
|
18090
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_components65.Header, { title: component.title }) : null,
|
|
18091
|
+
component.items.map((item) => mapListItemToSummary(item, onAction))
|
|
17805
18092
|
] });
|
|
17806
18093
|
};
|
|
17807
|
-
var mapListItemToSummary = (
|
|
17808
|
-
const
|
|
18094
|
+
var mapListItemToSummary = (props, onAction) => {
|
|
18095
|
+
const { title, description, icon, status } = props;
|
|
18096
|
+
const summaryProps = __spreadValues(__spreadValues({
|
|
17809
18097
|
key: `${title}/${description || ""}`,
|
|
17810
18098
|
title,
|
|
17811
|
-
description
|
|
18099
|
+
description,
|
|
18100
|
+
action: "callToAction" in props ? callToActionToSummaryAction(props == null ? void 0 : props.callToAction, onAction) : void 0
|
|
17812
18101
|
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
|
|
17813
|
-
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
18102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_components65.Summary, __spreadValues({}, summaryProps));
|
|
18103
|
+
};
|
|
18104
|
+
var callToActionToSummaryAction = (callToAction, onAction) => {
|
|
18105
|
+
if (!callToAction) {
|
|
18106
|
+
return void 0;
|
|
18107
|
+
}
|
|
18108
|
+
const { accessibilityDescription, behavior, title } = callToAction;
|
|
18109
|
+
if (behavior.link) {
|
|
18110
|
+
const { link } = behavior;
|
|
18111
|
+
return {
|
|
18112
|
+
text: title,
|
|
18113
|
+
"aria-label": accessibilityDescription,
|
|
18114
|
+
href: link.url,
|
|
18115
|
+
target: "_blank"
|
|
18116
|
+
};
|
|
18117
|
+
}
|
|
18118
|
+
if (behavior.action) {
|
|
18119
|
+
const { action } = behavior;
|
|
18120
|
+
return {
|
|
18121
|
+
text: title,
|
|
18122
|
+
"aria-label": accessibilityDescription,
|
|
18123
|
+
onClick: () => {
|
|
18124
|
+
onAction(action);
|
|
18125
|
+
}
|
|
18126
|
+
};
|
|
18127
|
+
}
|
|
18128
|
+
return void 0;
|
|
17814
18129
|
};
|
|
17815
18130
|
var statusListMap = {
|
|
17816
18131
|
done: "done",
|
|
@@ -17826,12 +18141,12 @@ var statusMap = __spreadValues(__spreadValues({}, statusListMap), legacyStatusMa
|
|
|
17826
18141
|
var DynamicStatusList_default = DynamicStatusList;
|
|
17827
18142
|
|
|
17828
18143
|
// src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
17829
|
-
var
|
|
18144
|
+
var import_components66 = require("@transferwise/components");
|
|
17830
18145
|
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
17831
18146
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
17832
18147
|
const { margin = "md", size = "md" } = component;
|
|
17833
18148
|
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
17834
|
-
|
|
18149
|
+
import_components66.Loader,
|
|
17835
18150
|
{
|
|
17836
18151
|
size,
|
|
17837
18152
|
classNames: {
|
|
@@ -17844,12 +18159,12 @@ var DynamicLoadingIndicator = ({ component }) => {
|
|
|
17844
18159
|
var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
|
|
17845
18160
|
|
|
17846
18161
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
17847
|
-
var
|
|
17848
|
-
var
|
|
18162
|
+
var import_components68 = require("@transferwise/components");
|
|
18163
|
+
var import_react_intl39 = require("react-intl");
|
|
17849
18164
|
|
|
17850
18165
|
// src/common/messages/paragraph.messages.ts
|
|
17851
|
-
var
|
|
17852
|
-
var paragraph_messages_default2 = (0,
|
|
18166
|
+
var import_react_intl38 = require("react-intl");
|
|
18167
|
+
var paragraph_messages_default2 = (0, import_react_intl38.defineMessages)({
|
|
17853
18168
|
copy: {
|
|
17854
18169
|
id: "dynamicFlows.DynamicParagraph.copy",
|
|
17855
18170
|
defaultMessage: "Copy",
|
|
@@ -17863,10 +18178,10 @@ var paragraph_messages_default2 = (0, import_react_intl36.defineMessages)({
|
|
|
17863
18178
|
});
|
|
17864
18179
|
|
|
17865
18180
|
// src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
|
|
17866
|
-
var
|
|
18181
|
+
var import_components67 = require("@transferwise/components");
|
|
17867
18182
|
var import_react49 = require("react");
|
|
17868
18183
|
function useSnackBarIfAvailable2() {
|
|
17869
|
-
const context = (0, import_react49.useContext)(
|
|
18184
|
+
const context = (0, import_react49.useContext)(import_components67.SnackbarContext);
|
|
17870
18185
|
return context ? context.createSnackbar : noop3;
|
|
17871
18186
|
}
|
|
17872
18187
|
function noop3() {
|
|
@@ -17881,7 +18196,7 @@ function BasicDynamicParagraph({ component }) {
|
|
|
17881
18196
|
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("p", { className: `np-text-body-large ${getTextAlignmentAndMargin2(component)}`, children: component.text });
|
|
17882
18197
|
}
|
|
17883
18198
|
function CopyableDynamicParagraph({ component }) {
|
|
17884
|
-
const { formatMessage } = (0,
|
|
18199
|
+
const { formatMessage } = (0, import_react_intl39.useIntl)();
|
|
17885
18200
|
const createSnackbar = useSnackBarIfAvailable2();
|
|
17886
18201
|
const { text } = component;
|
|
17887
18202
|
const copy = () => {
|
|
@@ -17903,7 +18218,7 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
17903
18218
|
style: { textOverflow: "ellipsis" }
|
|
17904
18219
|
}
|
|
17905
18220
|
),
|
|
17906
|
-
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
18221
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_components68.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default2.copy) })
|
|
17907
18222
|
] });
|
|
17908
18223
|
}
|
|
17909
18224
|
function noop4() {
|
|
@@ -17911,7 +18226,7 @@ function noop4() {
|
|
|
17911
18226
|
var DynamicParagraph_default = DynamicParagraph;
|
|
17912
18227
|
|
|
17913
18228
|
// src/legacy/layout/review/DynamicReview.tsx
|
|
17914
|
-
var
|
|
18229
|
+
var import_components69 = require("@transferwise/components");
|
|
17915
18230
|
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
17916
18231
|
var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
|
|
17917
18232
|
key: String(index),
|
|
@@ -17965,8 +18280,8 @@ function DynamicReview(props) {
|
|
|
17965
18280
|
const callToAction = review.callToAction ? getReviewAction2(review.callToAction.title, review.callToAction.action) : null;
|
|
17966
18281
|
const legacyCallToAction = !callToAction && review.action ? getReviewAction2(review.action.title || "", review.action) : null;
|
|
17967
18282
|
return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: margin, children: [
|
|
17968
|
-
review.title && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
17969
|
-
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
18283
|
+
review.title && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_components69.Header, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
|
|
18284
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_components69.DefinitionList, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
|
|
17970
18285
|
] });
|
|
17971
18286
|
}
|
|
17972
18287
|
var DynamicReview_default = DynamicReview;
|
|
@@ -17976,13 +18291,13 @@ var import_react51 = require("react");
|
|
|
17976
18291
|
var import_icons5 = require("@transferwise/icons");
|
|
17977
18292
|
|
|
17978
18293
|
// src/legacy/layout/search/SearchInput.tsx
|
|
17979
|
-
var
|
|
18294
|
+
var import_components70 = require("@transferwise/components");
|
|
17980
18295
|
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
17981
18296
|
var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
17982
18297
|
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("label", { className: "control-label d-inline", children: [
|
|
17983
18298
|
title,
|
|
17984
18299
|
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
17985
|
-
|
|
18300
|
+
import_components70.Input,
|
|
17986
18301
|
{
|
|
17987
18302
|
type: "text",
|
|
17988
18303
|
value,
|
|
@@ -17995,15 +18310,15 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
17995
18310
|
};
|
|
17996
18311
|
|
|
17997
18312
|
// src/legacy/layout/search/SearchResults.tsx
|
|
17998
|
-
var
|
|
17999
|
-
var
|
|
18313
|
+
var import_components71 = require("@transferwise/components");
|
|
18314
|
+
var import_react_intl40 = require("react-intl");
|
|
18000
18315
|
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
18001
18316
|
function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
18002
18317
|
if (results.length === 0) {
|
|
18003
18318
|
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("p", { className: "m-t-2", children: emptyMessage });
|
|
18004
18319
|
}
|
|
18005
|
-
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
18006
|
-
|
|
18320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_components71.NavigationOptionsList, { children: results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
18321
|
+
import_components71.NavigationOption,
|
|
18007
18322
|
{
|
|
18008
18323
|
title: result.title,
|
|
18009
18324
|
content: result.description,
|
|
@@ -18016,7 +18331,7 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
|
18016
18331
|
)) });
|
|
18017
18332
|
}
|
|
18018
18333
|
function ErrorResult2({ onRetrySearch }) {
|
|
18019
|
-
const intl = (0,
|
|
18334
|
+
const intl = (0, import_react_intl40.useIntl)();
|
|
18020
18335
|
return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("p", { className: "m-t-2", children: [
|
|
18021
18336
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
18022
18337
|
"\xA0",
|
|
@@ -18104,14 +18419,26 @@ var addQueryParameter2 = (url, key, value) => {
|
|
|
18104
18419
|
};
|
|
18105
18420
|
|
|
18106
18421
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
18107
|
-
var
|
|
18422
|
+
var import_components72 = require("@transferwise/components");
|
|
18108
18423
|
var import_classnames14 = __toESM(require_classnames());
|
|
18109
|
-
var
|
|
18424
|
+
var import_react_intl42 = require("react-intl");
|
|
18425
|
+
|
|
18426
|
+
// src/common/messages/search.messages.ts
|
|
18427
|
+
var import_react_intl41 = require("react-intl");
|
|
18428
|
+
var search_messages_default2 = (0, import_react_intl41.defineMessages)({
|
|
18429
|
+
loading: {
|
|
18430
|
+
id: "dynamicFlows.SearchLayout.loading",
|
|
18431
|
+
defaultMessage: "Loading...",
|
|
18432
|
+
description: "A message shown to the user while their search is being processed, before results appear."
|
|
18433
|
+
}
|
|
18434
|
+
});
|
|
18435
|
+
|
|
18436
|
+
// src/legacy/layout/search/DynamicSearch.tsx
|
|
18110
18437
|
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
18111
18438
|
var DEBOUNCE_TIME2 = 400;
|
|
18112
18439
|
function DynamicSearch({ component, onAction }) {
|
|
18113
18440
|
const [query, setQuery] = (0, import_react51.useState)("");
|
|
18114
|
-
const intl = (0,
|
|
18441
|
+
const intl = (0, import_react_intl42.useIntl)();
|
|
18115
18442
|
const { control, title, margin, url, method, param, emptyMessage } = component;
|
|
18116
18443
|
const { status, results, search } = useSearch({ url, method, param });
|
|
18117
18444
|
const onEvent = useEventDispatcher();
|
|
@@ -18143,11 +18470,12 @@ function DynamicSearch({ component, onAction }) {
|
|
|
18143
18470
|
setQuery(query);
|
|
18144
18471
|
void search(query);
|
|
18145
18472
|
};
|
|
18473
|
+
const loadingMessage = intl.formatMessage(search_messages_default2.loading);
|
|
18146
18474
|
if (control === "inline") {
|
|
18147
18475
|
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: (0, import_classnames14.default)(getMargin2(margin != null ? margin : "md"), "df-search-typeahead"), children: /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("label", { className: "control-label d-inline", children: [
|
|
18148
18476
|
title,
|
|
18149
18477
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "m-t-1", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
18150
|
-
|
|
18478
|
+
import_components72.Typeahead,
|
|
18151
18479
|
{
|
|
18152
18480
|
id: "typeahead-input-id",
|
|
18153
18481
|
intl,
|
|
@@ -18160,6 +18488,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
18160
18488
|
state: status,
|
|
18161
18489
|
results,
|
|
18162
18490
|
emptyMessage,
|
|
18491
|
+
loadingMessage,
|
|
18163
18492
|
onRetrySearch
|
|
18164
18493
|
}
|
|
18165
18494
|
),
|
|
@@ -18197,26 +18526,27 @@ function mapResultToTypeaheadOption2(result) {
|
|
|
18197
18526
|
};
|
|
18198
18527
|
}
|
|
18199
18528
|
function TypeaheadFooter2({
|
|
18529
|
+
emptyMessage,
|
|
18530
|
+
loadingMessage,
|
|
18200
18531
|
results,
|
|
18201
18532
|
state,
|
|
18202
|
-
onRetrySearch
|
|
18203
|
-
emptyMessage
|
|
18533
|
+
onRetrySearch
|
|
18204
18534
|
}) {
|
|
18205
18535
|
if (state === "success" && results.length === 0) {
|
|
18206
|
-
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
18536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_components72.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
|
|
18207
18537
|
}
|
|
18208
18538
|
if (state === "error" && results.length === 0) {
|
|
18209
18539
|
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(ErrorResult2, { onRetrySearch }) });
|
|
18210
18540
|
}
|
|
18211
18541
|
if (state === "loading" || results.length === 0) {
|
|
18212
|
-
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("p", { className: "m-t-2 m-x-2", children:
|
|
18542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("p", { className: "m-t-2 m-x-2", children: loadingMessage });
|
|
18213
18543
|
}
|
|
18214
18544
|
return null;
|
|
18215
18545
|
}
|
|
18216
18546
|
var DynamicSearch_default = DynamicSearch;
|
|
18217
18547
|
|
|
18218
18548
|
// src/legacy/layout/modal/DynamicModal.tsx
|
|
18219
|
-
var
|
|
18549
|
+
var import_components73 = require("@transferwise/components");
|
|
18220
18550
|
var import_react52 = require("react");
|
|
18221
18551
|
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
18222
18552
|
function DynamicModal(props) {
|
|
@@ -18224,9 +18554,9 @@ function DynamicModal(props) {
|
|
|
18224
18554
|
const { component, onAction } = props;
|
|
18225
18555
|
const { margin = "md" } = component;
|
|
18226
18556
|
return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
|
|
18227
|
-
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
18557
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_components73.Button, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
|
|
18228
18558
|
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
18229
|
-
|
|
18559
|
+
import_components73.Modal,
|
|
18230
18560
|
{
|
|
18231
18561
|
scroll: "content",
|
|
18232
18562
|
open: visible,
|
|
@@ -18385,7 +18715,7 @@ var controlTypesWithPersistOnChange = /* @__PURE__ */ new Set([
|
|
|
18385
18715
|
]);
|
|
18386
18716
|
function PersistAsyncBasicSchema(props) {
|
|
18387
18717
|
const { schema, required = false, submitted, errors, onChange, onPersistAsync } = props;
|
|
18388
|
-
const intl = (0,
|
|
18718
|
+
const intl = (0, import_react_intl43.useIntl)();
|
|
18389
18719
|
const httpClient = useHttpClient();
|
|
18390
18720
|
const onEvent = useEventDispatcher();
|
|
18391
18721
|
const [persistAsyncModel, setPersistAsyncModel] = (0, import_react54.useState)(null);
|
|
@@ -18480,7 +18810,7 @@ var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
|
|
|
18480
18810
|
var usePersistAsync = (persistAsync) => {
|
|
18481
18811
|
const [abortController, setAbortController] = (0, import_react55.useState)(null);
|
|
18482
18812
|
const httpClient = useHttpClient();
|
|
18483
|
-
const intl = (0,
|
|
18813
|
+
const intl = (0, import_react_intl44.useIntl)();
|
|
18484
18814
|
const { schema } = persistAsync;
|
|
18485
18815
|
async function handlePersistAsync(model) {
|
|
18486
18816
|
const isInvalidSchema = model instanceof Blob ? !isBlobSchema2(schema) : !isValidSchema(model, schema);
|
|
@@ -18713,12 +19043,12 @@ var import_react63 = require("react");
|
|
|
18713
19043
|
|
|
18714
19044
|
// src/common/cameraCapture/CameraCapture.tsx
|
|
18715
19045
|
var import_react62 = require("react");
|
|
18716
|
-
var
|
|
19046
|
+
var import_react_intl49 = require("react-intl");
|
|
18717
19047
|
var import_react_webcam = __toESM(require("react-webcam"));
|
|
18718
19048
|
|
|
18719
19049
|
// src/common/cameraCapture/CameraCapture.messages.ts
|
|
18720
|
-
var
|
|
18721
|
-
var CameraCapture_messages_default = (0,
|
|
19050
|
+
var import_react_intl45 = require("react-intl");
|
|
19051
|
+
var CameraCapture_messages_default = (0, import_react_intl45.defineMessages)({
|
|
18722
19052
|
reviewSubmit: {
|
|
18723
19053
|
id: "dynamicFlows.CameraCapture.reviewSubmit",
|
|
18724
19054
|
defaultMessage: "Yes, submit",
|
|
@@ -18777,35 +19107,35 @@ var CameraCapture_messages_default = (0, import_react_intl42.defineMessages)({
|
|
|
18777
19107
|
});
|
|
18778
19108
|
|
|
18779
19109
|
// src/common/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
18780
|
-
var
|
|
18781
|
-
var
|
|
19110
|
+
var import_components74 = require("@transferwise/components");
|
|
19111
|
+
var import_react_intl46 = require("react-intl");
|
|
18782
19112
|
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
18783
19113
|
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(CaptureButton, { onClick: onCapture }) });
|
|
18784
19114
|
var ReviewBottomBar = ({
|
|
18785
19115
|
onSubmit,
|
|
18786
19116
|
onRetry
|
|
18787
19117
|
}) => {
|
|
18788
|
-
const intl = (0,
|
|
19118
|
+
const intl = (0, import_react_intl46.useIntl)();
|
|
18789
19119
|
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
18790
19120
|
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
18791
|
-
|
|
19121
|
+
import_components74.Button,
|
|
18792
19122
|
{
|
|
18793
19123
|
className: "m-b-1",
|
|
18794
19124
|
block: true,
|
|
18795
|
-
size:
|
|
18796
|
-
type:
|
|
19125
|
+
size: import_components74.Size.MEDIUM,
|
|
19126
|
+
type: import_components74.ControlType.ACCENT,
|
|
18797
19127
|
onClick: onSubmit,
|
|
18798
19128
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
18799
19129
|
}
|
|
18800
19130
|
),
|
|
18801
19131
|
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
18802
|
-
|
|
19132
|
+
import_components74.Button,
|
|
18803
19133
|
{
|
|
18804
19134
|
className: "m-b-2",
|
|
18805
19135
|
block: true,
|
|
18806
|
-
size:
|
|
18807
|
-
type:
|
|
18808
|
-
priority:
|
|
19136
|
+
size: import_components74.Size.MEDIUM,
|
|
19137
|
+
type: import_components74.ControlType.ACCENT,
|
|
19138
|
+
priority: import_components74.Priority.SECONDARY,
|
|
18809
19139
|
onClick: onRetry,
|
|
18810
19140
|
children: intl.formatMessage(CameraCapture_messages_default.reviewRetry)
|
|
18811
19141
|
}
|
|
@@ -18824,11 +19154,11 @@ var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime120.j
|
|
|
18824
19154
|
);
|
|
18825
19155
|
|
|
18826
19156
|
// src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
18827
|
-
var
|
|
19157
|
+
var import_react_intl48 = require("react-intl");
|
|
18828
19158
|
|
|
18829
19159
|
// src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.ts
|
|
18830
|
-
var
|
|
18831
|
-
var OrientationLockOverlay_messages_default = (0,
|
|
19160
|
+
var import_react_intl47 = require("react-intl");
|
|
19161
|
+
var OrientationLockOverlay_messages_default = (0, import_react_intl47.defineMessages)({
|
|
18832
19162
|
text: {
|
|
18833
19163
|
id: "dynamicFlows.CameraCapture.rotatePhone.text",
|
|
18834
19164
|
defaultMessage: "Rotate your phone to portrait view to take a photo",
|
|
@@ -18839,7 +19169,7 @@ var OrientationLockOverlay_messages_default = (0, import_react_intl44.defineMess
|
|
|
18839
19169
|
// src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
18840
19170
|
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
18841
19171
|
function OrientationLockOverlay() {
|
|
18842
|
-
const intl = (0,
|
|
19172
|
+
const intl = (0, import_react_intl48.useIntl)();
|
|
18843
19173
|
return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "orientation-lock-overlay", children: [
|
|
18844
19174
|
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
18845
19175
|
"img",
|
|
@@ -19090,13 +19420,13 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
19090
19420
|
var Overlay_default = Overlay;
|
|
19091
19421
|
|
|
19092
19422
|
// src/common/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
19093
|
-
var
|
|
19423
|
+
var import_components75 = require("@transferwise/components");
|
|
19094
19424
|
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
19095
19425
|
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
19096
19426
|
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
19097
19427
|
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
19098
19428
|
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("p", { className: "text-xs-center m-b-5", children: description }),
|
|
19099
|
-
onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
19429
|
+
onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_components75.Button, { block: true, onClick: onAction, children: actionButton })
|
|
19100
19430
|
] }) }) });
|
|
19101
19431
|
}
|
|
19102
19432
|
var CameraErrorScreen_default = CameraErrorScreen;
|
|
@@ -19129,7 +19459,7 @@ function CameraCapture({
|
|
|
19129
19459
|
shouldLockOrientation,
|
|
19130
19460
|
onEvent
|
|
19131
19461
|
);
|
|
19132
|
-
const intl = (0,
|
|
19462
|
+
const intl = (0, import_react_intl49.useIntl)();
|
|
19133
19463
|
const handleCapture = (0, import_react62.useCallback)(async () => {
|
|
19134
19464
|
var _a, _b, _c, _d, _e, _f;
|
|
19135
19465
|
if (((_a = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _a.video) && ((_c = (_b = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _b.video) == null ? void 0 : _c.readyState) >= 3) {
|
|
@@ -19352,11 +19682,11 @@ function getFirstAction(step) {
|
|
|
19352
19682
|
}
|
|
19353
19683
|
|
|
19354
19684
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
19355
|
-
var
|
|
19685
|
+
var import_react_intl51 = require("react-intl");
|
|
19356
19686
|
|
|
19357
19687
|
// src/common/messages/external-confirmation.messages.ts
|
|
19358
|
-
var
|
|
19359
|
-
var external_confirmation_messages_default2 = (0,
|
|
19688
|
+
var import_react_intl50 = require("react-intl");
|
|
19689
|
+
var external_confirmation_messages_default2 = (0, import_react_intl50.defineMessages)({
|
|
19360
19690
|
title: {
|
|
19361
19691
|
id: "dynamicFlows.ExternalConfirmation.title",
|
|
19362
19692
|
defaultMessage: "Please confirm",
|
|
@@ -19384,7 +19714,7 @@ var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
|
19384
19714
|
var noop6 = () => {
|
|
19385
19715
|
};
|
|
19386
19716
|
function ExternalConfirmationStep({ url, onClose }) {
|
|
19387
|
-
const { formatMessage } = (0,
|
|
19717
|
+
const { formatMessage } = (0, import_react_intl51.useIntl)();
|
|
19388
19718
|
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
19389
19719
|
DynamicLayout_default,
|
|
19390
19720
|
{
|
|
@@ -19450,7 +19780,7 @@ function getOrigin2(url) {
|
|
|
19450
19780
|
}
|
|
19451
19781
|
|
|
19452
19782
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
19453
|
-
var
|
|
19783
|
+
var import_components77 = require("@transferwise/components");
|
|
19454
19784
|
var import_icons6 = require("@transferwise/icons");
|
|
19455
19785
|
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
19456
19786
|
function BackButton2({ title, action, onAction }) {
|
|
@@ -19466,7 +19796,7 @@ function BackButton2({ title, action, onAction }) {
|
|
|
19466
19796
|
},
|
|
19467
19797
|
children: [
|
|
19468
19798
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "sr-only", children: title }),
|
|
19469
|
-
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
19799
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_components77.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_icons6.ArrowLeft, { size: "24" }) })
|
|
19470
19800
|
]
|
|
19471
19801
|
}
|
|
19472
19802
|
) });
|
|
@@ -19643,19 +19973,19 @@ var getSchemaReference = (component) => {
|
|
|
19643
19973
|
var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object" && !Object.hasOwnProperty.call(schema, "$ref");
|
|
19644
19974
|
|
|
19645
19975
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
19646
|
-
var
|
|
19976
|
+
var import_components78 = require("@transferwise/components");
|
|
19647
19977
|
var import_react66 = require("react");
|
|
19648
19978
|
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
19649
19979
|
function useLoader(loaderConfig, initialState) {
|
|
19650
19980
|
const config = __spreadValues({
|
|
19651
|
-
size:
|
|
19981
|
+
size: import_components78.Size.EXTRA_LARGE,
|
|
19652
19982
|
initial: true,
|
|
19653
19983
|
submission: false
|
|
19654
19984
|
}, loaderConfig);
|
|
19655
19985
|
const [loadingState, setLoadingState] = (0, import_react66.useState)(initialState);
|
|
19656
19986
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
19657
19987
|
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
19658
|
-
|
|
19988
|
+
import_components78.Loader,
|
|
19659
19989
|
{
|
|
19660
19990
|
size: config.size,
|
|
19661
19991
|
classNames: { "tw-loader": "tw-loader m-x-auto" },
|
|
@@ -19757,9 +20087,9 @@ var assertResponseIsValid2 = (response) => {
|
|
|
19757
20087
|
var isResponse2 = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
|
|
19758
20088
|
|
|
19759
20089
|
// src/legacy/dynamicFlow/utils/useErrorResponse.tsx
|
|
19760
|
-
var
|
|
20090
|
+
var import_react_intl52 = require("react-intl");
|
|
19761
20091
|
var useErrorResponse = () => {
|
|
19762
|
-
const { formatMessage } = (0,
|
|
20092
|
+
const { formatMessage } = (0, import_react_intl52.useIntl)();
|
|
19763
20093
|
return async (response, fetchType, isInitialRequest) => {
|
|
19764
20094
|
try {
|
|
19765
20095
|
const errorResponse = await parseErrorResponse(response);
|
|
@@ -19803,7 +20133,7 @@ var DynamicFlowComponent = ({
|
|
|
19803
20133
|
setSchemaModel
|
|
19804
20134
|
} = useDynamicFlowState(initialStep);
|
|
19805
20135
|
const [submitted, setSubmitted] = (0, import_react67.useState)(false);
|
|
19806
|
-
const { locale } = (0,
|
|
20136
|
+
const { locale } = (0, import_react_intl53.useIntl)();
|
|
19807
20137
|
const { isLoading, loader, setLoadingState } = useLoader(
|
|
19808
20138
|
loaderConfig,
|
|
19809
20139
|
initialStep ? "idle" : "initial"
|