@wise/dynamic-flow-client 3.21.2 → 3.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.css +14 -0
- package/build/main.js +656 -392
- package/build/main.min.js +1 -1
- package/build/main.mjs +520 -256
- 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 +1 -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/utils/type-utils.d.ts +1 -1
- package/package.json +4 -6
- 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
|
@@ -1474,7 +1474,7 @@ var allOfComponentToProps = ({ control, description, help, title }, children) =>
|
|
|
1474
1474
|
|
|
1475
1475
|
// src/revamp/renderers/mappers/utils/inputComponentToProps.ts
|
|
1476
1476
|
var inputComponentToProps = (component, type) => {
|
|
1477
|
-
var _a
|
|
1477
|
+
var _a;
|
|
1478
1478
|
const {
|
|
1479
1479
|
autoComplete,
|
|
1480
1480
|
control,
|
|
@@ -1486,29 +1486,46 @@ var inputComponentToProps = (component, type) => {
|
|
|
1486
1486
|
placeholder,
|
|
1487
1487
|
required,
|
|
1488
1488
|
title,
|
|
1489
|
+
validationAsyncState,
|
|
1489
1490
|
onBlur,
|
|
1490
1491
|
onFocus
|
|
1491
1492
|
} = component;
|
|
1492
|
-
const
|
|
1493
|
-
const { messages } = validationState != null ? validationState : {};
|
|
1493
|
+
const { messages } = validationAsyncState != null ? validationAsyncState : {};
|
|
1494
1494
|
return {
|
|
1495
1495
|
type,
|
|
1496
1496
|
autoComplete,
|
|
1497
1497
|
control,
|
|
1498
|
-
description
|
|
1498
|
+
description,
|
|
1499
1499
|
disabled,
|
|
1500
|
-
error: (
|
|
1500
|
+
error: (_a = messages == null ? void 0 : messages.error) != null ? _a : errors == null ? void 0 : errors[0],
|
|
1501
1501
|
help,
|
|
1502
1502
|
id,
|
|
1503
1503
|
label: title,
|
|
1504
1504
|
placeholder,
|
|
1505
1505
|
required,
|
|
1506
|
+
validationState: getValidationState(errors, validationAsyncState),
|
|
1506
1507
|
value: component.getLocalValue(),
|
|
1507
1508
|
onBlur: onBlur.bind(component),
|
|
1508
1509
|
onFocus: onFocus.bind(component)
|
|
1509
1510
|
};
|
|
1510
1511
|
};
|
|
1511
|
-
var
|
|
1512
|
+
var getValidationState = (errors, validationAsyncState) => {
|
|
1513
|
+
if (validationAsyncState) {
|
|
1514
|
+
if (validationAsyncState == null ? void 0 : validationAsyncState.messages.error) {
|
|
1515
|
+
return { status: "invalid", message: validationAsyncState == null ? void 0 : validationAsyncState.messages.error };
|
|
1516
|
+
}
|
|
1517
|
+
if (validationAsyncState == null ? void 0 : validationAsyncState.messages.success) {
|
|
1518
|
+
return { status: "valid", message: validationAsyncState == null ? void 0 : validationAsyncState.messages.success };
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
if (errors) {
|
|
1522
|
+
if (errors.length > 0) {
|
|
1523
|
+
return { status: "invalid", message: errors[0] };
|
|
1524
|
+
}
|
|
1525
|
+
return { status: "valid" };
|
|
1526
|
+
}
|
|
1527
|
+
return void 0;
|
|
1528
|
+
};
|
|
1512
1529
|
|
|
1513
1530
|
// src/revamp/renderers/mappers/booleanInputComponentToProps.ts
|
|
1514
1531
|
var booleanInputComponentToProps = (component) => {
|
|
@@ -1756,17 +1773,27 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
|
|
|
1756
1773
|
description,
|
|
1757
1774
|
editableItem: editableItemChildren,
|
|
1758
1775
|
editItemTitle,
|
|
1776
|
+
error: errors == null ? void 0 : errors[0],
|
|
1759
1777
|
items: itemProps,
|
|
1760
1778
|
maxItems,
|
|
1761
1779
|
minItems,
|
|
1762
1780
|
title,
|
|
1763
|
-
|
|
1781
|
+
validationState: getValidationState2(errors),
|
|
1764
1782
|
onAdd: onAdd.bind(component),
|
|
1765
1783
|
onEdit: onEdit.bind(component),
|
|
1766
1784
|
onSave: onSave.bind(component),
|
|
1767
1785
|
onRemove: onRemove.bind(component)
|
|
1768
1786
|
};
|
|
1769
1787
|
};
|
|
1788
|
+
var getValidationState2 = (errors) => {
|
|
1789
|
+
if (errors) {
|
|
1790
|
+
if (errors.length > 0) {
|
|
1791
|
+
return { status: "invalid", message: errors[0] };
|
|
1792
|
+
}
|
|
1793
|
+
return { status: "valid" };
|
|
1794
|
+
}
|
|
1795
|
+
return void 0;
|
|
1796
|
+
};
|
|
1770
1797
|
|
|
1771
1798
|
// src/revamp/renderers/mappers/reviewComponentToProps.ts
|
|
1772
1799
|
var reviewComponentToProps = ({
|
|
@@ -7392,18 +7419,18 @@ var getDebouncedPerformRefresh = (performRefresh) => performRefresh ? debounce(p
|
|
|
7392
7419
|
// src/revamp/domain/features/validationAsync/getComponentValidationAsync.ts
|
|
7393
7420
|
var getComponentValidationAsync = (update, performValidationAsync) => (
|
|
7394
7421
|
/**
|
|
7395
|
-
* Will update the
|
|
7422
|
+
* Will update the validationAsyncState when a new request is made, and will update
|
|
7396
7423
|
* the description or set errors when the request completes.
|
|
7397
7424
|
*/
|
|
7398
|
-
async (
|
|
7399
|
-
const { abortController, lastSubmitted } =
|
|
7425
|
+
async (validationAsyncState, currentValue) => {
|
|
7426
|
+
const { abortController, lastSubmitted } = validationAsyncState;
|
|
7400
7427
|
if (lastSubmitted === currentValue) {
|
|
7401
7428
|
return;
|
|
7402
7429
|
}
|
|
7403
7430
|
const newAbortController = abortAndResetController(abortController);
|
|
7404
7431
|
if (isNullish(currentValue)) {
|
|
7405
7432
|
update((draft) => {
|
|
7406
|
-
draft.
|
|
7433
|
+
draft.validationAsyncState = {
|
|
7407
7434
|
abortController: newAbortController,
|
|
7408
7435
|
lastSubmitted: currentValue,
|
|
7409
7436
|
messages: {}
|
|
@@ -7415,7 +7442,7 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
|
|
|
7415
7442
|
const newSubmission = performValidationAsync({ value: currentValue, signal }).then((message) => {
|
|
7416
7443
|
update((draft) => {
|
|
7417
7444
|
if (message) {
|
|
7418
|
-
draft.
|
|
7445
|
+
draft.validationAsyncState.messages.success = message;
|
|
7419
7446
|
}
|
|
7420
7447
|
});
|
|
7421
7448
|
return message;
|
|
@@ -7424,11 +7451,11 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
|
|
|
7424
7451
|
return null;
|
|
7425
7452
|
}
|
|
7426
7453
|
update((draft) => {
|
|
7427
|
-
draft.
|
|
7454
|
+
draft.validationAsyncState.messages.error = error.message;
|
|
7428
7455
|
});
|
|
7429
7456
|
});
|
|
7430
7457
|
update((draft) => {
|
|
7431
|
-
draft.
|
|
7458
|
+
draft.validationAsyncState = {
|
|
7432
7459
|
abortController: newAbortController,
|
|
7433
7460
|
lastSubmitted: currentValue,
|
|
7434
7461
|
messages: {}
|
|
@@ -7483,7 +7510,7 @@ var createNumberInputComponent = (numberInputProps, updateComponent) => {
|
|
|
7483
7510
|
onChange(updatedValue) {
|
|
7484
7511
|
update((draft) => {
|
|
7485
7512
|
draft.errors = [];
|
|
7486
|
-
draft.
|
|
7513
|
+
draft.validationAsyncState.messages = {};
|
|
7487
7514
|
draft.value = updatedValue;
|
|
7488
7515
|
});
|
|
7489
7516
|
performDebouncedRefresh == null ? void 0 : performDebouncedRefresh();
|
|
@@ -7532,7 +7559,7 @@ var createNumberInputComponent = (numberInputProps, updateComponent) => {
|
|
|
7532
7559
|
return __spreadProps(__spreadValues({}, numberComponent), {
|
|
7533
7560
|
onBlur() {
|
|
7534
7561
|
if (this.validate()) {
|
|
7535
|
-
validateAsync(this.
|
|
7562
|
+
validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
|
|
7536
7563
|
});
|
|
7537
7564
|
}
|
|
7538
7565
|
}
|
|
@@ -7844,7 +7871,7 @@ var mapCommonSchemaProps = (schemaMapperProps) => {
|
|
|
7844
7871
|
control,
|
|
7845
7872
|
description,
|
|
7846
7873
|
disabled: schemaHasDisabled(schema) ? schema.disabled : false,
|
|
7847
|
-
errors: isString(validationErrors) ? [validationErrors] :
|
|
7874
|
+
errors: isString(validationErrors) ? [validationErrors] : void 0,
|
|
7848
7875
|
hidden: Boolean(hidden),
|
|
7849
7876
|
keywords,
|
|
7850
7877
|
required: Boolean(required),
|
|
@@ -7903,8 +7930,8 @@ var getValidationMessage = (json) => {
|
|
|
7903
7930
|
return isString(message) ? message : null;
|
|
7904
7931
|
};
|
|
7905
7932
|
|
|
7906
|
-
// src/revamp/domain/features/validationAsync/
|
|
7907
|
-
var
|
|
7933
|
+
// src/revamp/domain/features/validationAsync/getInitialValidationAsyncState.ts
|
|
7934
|
+
var getInitialValidationAsyncState = () => ({
|
|
7908
7935
|
abortController: new AbortController(),
|
|
7909
7936
|
lastSubmitted: null,
|
|
7910
7937
|
messages: {}
|
|
@@ -7913,8 +7940,8 @@ var getInitialValidationState = () => ({
|
|
|
7913
7940
|
// src/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.ts
|
|
7914
7941
|
var getValidationAsyncInitialState = (schemaMapperProps, mapperProps) => {
|
|
7915
7942
|
const performValidationAsync = getValidationAsyncFn(schemaMapperProps, mapperProps);
|
|
7916
|
-
const
|
|
7917
|
-
return { performValidationAsync,
|
|
7943
|
+
const validationAsyncState = getInitialValidationAsyncState();
|
|
7944
|
+
return { performValidationAsync, validationAsyncState };
|
|
7918
7945
|
};
|
|
7919
7946
|
var getValidationAsyncFn = (schemaMapperProps, mapperProps) => {
|
|
7920
7947
|
const { schema } = schemaMapperProps;
|
|
@@ -7943,7 +7970,7 @@ var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
7943
7970
|
schemaMapperProps,
|
|
7944
7971
|
mapperProps
|
|
7945
7972
|
);
|
|
7946
|
-
const { performValidationAsync,
|
|
7973
|
+
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
7947
7974
|
schemaMapperProps,
|
|
7948
7975
|
mapperProps
|
|
7949
7976
|
);
|
|
@@ -7962,7 +7989,7 @@ var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
7962
7989
|
maximum,
|
|
7963
7990
|
minimum,
|
|
7964
7991
|
persistedState,
|
|
7965
|
-
|
|
7992
|
+
validationAsyncState,
|
|
7966
7993
|
performPersistAsync,
|
|
7967
7994
|
performRefresh: getPerformRefresh(schema, onRefresh),
|
|
7968
7995
|
performValidationAsync,
|
|
@@ -8224,7 +8251,7 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
|
|
|
8224
8251
|
onChange(updatedValue) {
|
|
8225
8252
|
update((draft) => {
|
|
8226
8253
|
draft.errors = [];
|
|
8227
|
-
draft.
|
|
8254
|
+
draft.validationAsyncState.messages = {};
|
|
8228
8255
|
draft.value = updatedValue;
|
|
8229
8256
|
});
|
|
8230
8257
|
performDebouncedRefresh == null ? void 0 : performDebouncedRefresh();
|
|
@@ -8273,7 +8300,7 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
|
|
|
8273
8300
|
return __spreadProps(__spreadValues({}, integerComponent), {
|
|
8274
8301
|
onBlur() {
|
|
8275
8302
|
if (this.validate()) {
|
|
8276
|
-
validateAsync(this.
|
|
8303
|
+
validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
|
|
8277
8304
|
});
|
|
8278
8305
|
}
|
|
8279
8306
|
}
|
|
@@ -8292,7 +8319,7 @@ var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8292
8319
|
schemaMapperProps,
|
|
8293
8320
|
mapperProps
|
|
8294
8321
|
);
|
|
8295
|
-
const { performValidationAsync,
|
|
8322
|
+
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
8296
8323
|
schemaMapperProps,
|
|
8297
8324
|
mapperProps
|
|
8298
8325
|
);
|
|
@@ -8312,7 +8339,7 @@ var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8312
8339
|
minimum,
|
|
8313
8340
|
persistedState,
|
|
8314
8341
|
value,
|
|
8315
|
-
|
|
8342
|
+
validationAsyncState,
|
|
8316
8343
|
performPersistAsync,
|
|
8317
8344
|
performRefresh: getPerformRefresh(schema, onRefresh),
|
|
8318
8345
|
performValidationAsync,
|
|
@@ -8515,7 +8542,7 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
|
|
|
8515
8542
|
onChange(updatedValue) {
|
|
8516
8543
|
update((draft) => {
|
|
8517
8544
|
draft.errors = [];
|
|
8518
|
-
draft.
|
|
8545
|
+
draft.validationAsyncState.messages = {};
|
|
8519
8546
|
draft.value = updatedValue;
|
|
8520
8547
|
});
|
|
8521
8548
|
performRefresh == null ? void 0 : performRefresh();
|
|
@@ -8566,7 +8593,7 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
|
|
|
8566
8593
|
return __spreadProps(__spreadValues({}, dateInputComponent), {
|
|
8567
8594
|
onBlur() {
|
|
8568
8595
|
if (this.validate()) {
|
|
8569
|
-
validateAsync(this.
|
|
8596
|
+
validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
|
|
8570
8597
|
});
|
|
8571
8598
|
}
|
|
8572
8599
|
}
|
|
@@ -8590,7 +8617,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8590
8617
|
schemaMapperProps,
|
|
8591
8618
|
mapperProps
|
|
8592
8619
|
);
|
|
8593
|
-
const { performValidationAsync,
|
|
8620
|
+
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
8594
8621
|
schemaMapperProps,
|
|
8595
8622
|
mapperProps
|
|
8596
8623
|
);
|
|
@@ -8609,7 +8636,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8609
8636
|
maximumDate,
|
|
8610
8637
|
value,
|
|
8611
8638
|
persistedState,
|
|
8612
|
-
|
|
8639
|
+
validationAsyncState,
|
|
8613
8640
|
performPersistAsync,
|
|
8614
8641
|
performRefresh: getPerformRefresh(schema, onRefresh),
|
|
8615
8642
|
performValidationAsync,
|
|
@@ -8821,7 +8848,7 @@ var createTextInputComponent = (textInputProps, updateComponent) => {
|
|
|
8821
8848
|
onChange(updatedValue) {
|
|
8822
8849
|
update((draft) => {
|
|
8823
8850
|
draft.errors = [];
|
|
8824
|
-
draft.
|
|
8851
|
+
draft.validationAsyncState.messages = {};
|
|
8825
8852
|
draft.value = updatedValue;
|
|
8826
8853
|
});
|
|
8827
8854
|
performDebouncedRefresh == null ? void 0 : performDebouncedRefresh();
|
|
@@ -8870,7 +8897,7 @@ var createTextInputComponent = (textInputProps, updateComponent) => {
|
|
|
8870
8897
|
return __spreadProps(__spreadValues({}, inputComponent), {
|
|
8871
8898
|
onBlur() {
|
|
8872
8899
|
if (this.validate()) {
|
|
8873
|
-
validateAsync(this.
|
|
8900
|
+
validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
|
|
8874
8901
|
});
|
|
8875
8902
|
}
|
|
8876
8903
|
}
|
|
@@ -8899,7 +8926,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8899
8926
|
schemaMapperProps,
|
|
8900
8927
|
mapperProps
|
|
8901
8928
|
);
|
|
8902
|
-
const { performValidationAsync,
|
|
8929
|
+
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
8903
8930
|
schemaMapperProps,
|
|
8904
8931
|
mapperProps
|
|
8905
8932
|
);
|
|
@@ -8921,7 +8948,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8921
8948
|
minLength,
|
|
8922
8949
|
value,
|
|
8923
8950
|
persistedState,
|
|
8924
|
-
|
|
8951
|
+
validationAsyncState,
|
|
8925
8952
|
performPersistAsync,
|
|
8926
8953
|
performRefresh: getPerformRefresh(schema, onRefresh),
|
|
8927
8954
|
performValidationAsync,
|
|
@@ -8973,7 +9000,7 @@ var createContainerComponent = (containerProps) => __spreadProps(__spreadValues(
|
|
|
8973
9000
|
}
|
|
8974
9001
|
});
|
|
8975
9002
|
|
|
8976
|
-
// src/revamp/domain/components/
|
|
9003
|
+
// src/revamp/domain/components/RepeatableComponent.ts
|
|
8977
9004
|
var createRepeatableComponent = (repeatableProps, updateComponent) => {
|
|
8978
9005
|
const _a = repeatableProps, {
|
|
8979
9006
|
uid,
|
|
@@ -9118,7 +9145,8 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9118
9145
|
schema: items,
|
|
9119
9146
|
localValue: editableValue,
|
|
9120
9147
|
model: localValueToJsonElement(editableValue),
|
|
9121
|
-
validationErrors: void 0
|
|
9148
|
+
validationErrors: void 0,
|
|
9149
|
+
required: true
|
|
9122
9150
|
},
|
|
9123
9151
|
mapperProps
|
|
9124
9152
|
);
|
|
@@ -9400,7 +9428,7 @@ var createMultiSelectComponent = (multiSelectProps, updateComponent) => {
|
|
|
9400
9428
|
onSelect(indices) {
|
|
9401
9429
|
inputComponent.onSelect.call(this, indices);
|
|
9402
9430
|
if (this.validate()) {
|
|
9403
|
-
validateAsync(this.
|
|
9431
|
+
validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
|
|
9404
9432
|
});
|
|
9405
9433
|
}
|
|
9406
9434
|
}
|
|
@@ -9451,7 +9479,7 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9451
9479
|
const { maxItems, minItems, title, validationMessages } = schema;
|
|
9452
9480
|
const { getErrorMessageFunctions, onRefresh, onValueChange, updateComponent } = mapperProps;
|
|
9453
9481
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
9454
|
-
const { performValidationAsync,
|
|
9482
|
+
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
9455
9483
|
schemaMapperProps,
|
|
9456
9484
|
mapperProps
|
|
9457
9485
|
);
|
|
@@ -9470,7 +9498,7 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9470
9498
|
options,
|
|
9471
9499
|
required,
|
|
9472
9500
|
title,
|
|
9473
|
-
|
|
9501
|
+
validationAsyncState,
|
|
9474
9502
|
performValidationAsync,
|
|
9475
9503
|
performRefresh: getPerformRefresh(schema, onRefresh),
|
|
9476
9504
|
onValueChange
|
|
@@ -9646,7 +9674,7 @@ var createBooleanInputComponent = (booleanInputProps, updateComponent) => {
|
|
|
9646
9674
|
return __spreadProps(__spreadValues({}, booleanComponent), {
|
|
9647
9675
|
onChange(updatedValue) {
|
|
9648
9676
|
booleanComponent.onChange.call(this, updatedValue);
|
|
9649
|
-
validateAsync(this.
|
|
9677
|
+
validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
|
|
9650
9678
|
});
|
|
9651
9679
|
}
|
|
9652
9680
|
});
|
|
@@ -9664,7 +9692,7 @@ var booleanSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9664
9692
|
schemaMapperProps,
|
|
9665
9693
|
mapperProps
|
|
9666
9694
|
);
|
|
9667
|
-
const { performValidationAsync,
|
|
9695
|
+
const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
|
|
9668
9696
|
schemaMapperProps,
|
|
9669
9697
|
mapperProps
|
|
9670
9698
|
);
|
|
@@ -9675,7 +9703,7 @@ var booleanSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9675
9703
|
__spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
|
|
9676
9704
|
value: value != null ? value : false,
|
|
9677
9705
|
persistedState,
|
|
9678
|
-
|
|
9706
|
+
validationAsyncState,
|
|
9679
9707
|
performPersistAsync,
|
|
9680
9708
|
performRefresh,
|
|
9681
9709
|
performValidationAsync,
|
|
@@ -10210,13 +10238,44 @@ var createStatusListComponent = (statusListProps) => __spreadProps(__spreadValue
|
|
|
10210
10238
|
});
|
|
10211
10239
|
|
|
10212
10240
|
// src/revamp/domain/mappers/layout/statusListLayoutToComponent.ts
|
|
10213
|
-
var statusListLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
|
|
10241
|
+
var statusListLayoutToComponent = (uid, { control, items, margin = "md", title }, { onAction, onLink }) => createStatusListComponent({
|
|
10214
10242
|
uid,
|
|
10215
10243
|
control,
|
|
10216
|
-
items
|
|
10244
|
+
items: items.map((item) => {
|
|
10245
|
+
var _a, _b, _c;
|
|
10246
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
10247
|
+
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,
|
|
10248
|
+
callToAction: item.callToAction ? getItemCallToAction(item.callToAction, onAction, onLink) : void 0
|
|
10249
|
+
});
|
|
10250
|
+
}),
|
|
10217
10251
|
margin,
|
|
10218
10252
|
title
|
|
10219
10253
|
});
|
|
10254
|
+
var getItemCallToAction = (callToAction, onAction, onLink) => {
|
|
10255
|
+
const { accessibilityDescription, behavior, title } = callToAction;
|
|
10256
|
+
if (behavior.link) {
|
|
10257
|
+
const { url } = behavior.link;
|
|
10258
|
+
return {
|
|
10259
|
+
accessibilityDescription,
|
|
10260
|
+
href: url,
|
|
10261
|
+
title,
|
|
10262
|
+
onClick: () => {
|
|
10263
|
+
void onLink(url);
|
|
10264
|
+
}
|
|
10265
|
+
};
|
|
10266
|
+
}
|
|
10267
|
+
if (behavior.action) {
|
|
10268
|
+
const { action } = behavior;
|
|
10269
|
+
return {
|
|
10270
|
+
accessibilityDescription,
|
|
10271
|
+
title,
|
|
10272
|
+
onClick: () => {
|
|
10273
|
+
void onAction(action);
|
|
10274
|
+
}
|
|
10275
|
+
};
|
|
10276
|
+
}
|
|
10277
|
+
return void 0;
|
|
10278
|
+
};
|
|
10220
10279
|
|
|
10221
10280
|
// src/revamp/domain/mappers/layout/listLayoutToComponent.ts
|
|
10222
10281
|
var listLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
|
|
@@ -10283,7 +10342,7 @@ var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
|
10283
10342
|
case "search":
|
|
10284
10343
|
return searchLayoutToComponent(uid, layout, mapperProps);
|
|
10285
10344
|
case "status-list":
|
|
10286
|
-
return statusListLayoutToComponent(uid, layout);
|
|
10345
|
+
return statusListLayoutToComponent(uid, layout, mapperProps);
|
|
10287
10346
|
default:
|
|
10288
10347
|
throw new Error(`Invalid layout type in ${JSON.stringify(layout)}`);
|
|
10289
10348
|
}
|
|
@@ -11165,10 +11224,29 @@ function LabelContentWithHelp({ text, help }) {
|
|
|
11165
11224
|
|
|
11166
11225
|
// ../renderers/src/components/FieldInput.tsx
|
|
11167
11226
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
11168
|
-
function FieldInput({ id, children, label,
|
|
11227
|
+
function FieldInput({ id, children, label, validation, description, help }) {
|
|
11169
11228
|
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
11170
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
11229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
11230
|
+
import_components4.Field,
|
|
11231
|
+
{
|
|
11232
|
+
id,
|
|
11233
|
+
label: labelContent,
|
|
11234
|
+
description,
|
|
11235
|
+
message: validation == null ? void 0 : validation.message,
|
|
11236
|
+
sentiment: mapStatusToSentiment(validation),
|
|
11237
|
+
children
|
|
11238
|
+
}
|
|
11239
|
+
);
|
|
11171
11240
|
}
|
|
11241
|
+
var mapStatusToSentiment = (validation) => {
|
|
11242
|
+
if (validation) {
|
|
11243
|
+
if (validation.status === "valid") {
|
|
11244
|
+
return "positive";
|
|
11245
|
+
}
|
|
11246
|
+
return "negative";
|
|
11247
|
+
}
|
|
11248
|
+
return void 0;
|
|
11249
|
+
};
|
|
11172
11250
|
var FieldInput_default = FieldInput;
|
|
11173
11251
|
|
|
11174
11252
|
// ../renderers/src/BooleanInputRenderer.tsx
|
|
@@ -11177,9 +11255,27 @@ var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
|
11177
11255
|
var BooleanInputRenderer = {
|
|
11178
11256
|
canRenderType: "input-boolean",
|
|
11179
11257
|
render: (props) => {
|
|
11180
|
-
const _a = props, {
|
|
11258
|
+
const _a = props, {
|
|
11259
|
+
id,
|
|
11260
|
+
control,
|
|
11261
|
+
label = "",
|
|
11262
|
+
description,
|
|
11263
|
+
help,
|
|
11264
|
+
type,
|
|
11265
|
+
validationState,
|
|
11266
|
+
value
|
|
11267
|
+
} = _a, rest = __objRest(_a, [
|
|
11268
|
+
"id",
|
|
11269
|
+
"control",
|
|
11270
|
+
"label",
|
|
11271
|
+
"description",
|
|
11272
|
+
"help",
|
|
11273
|
+
"type",
|
|
11274
|
+
"validationState",
|
|
11275
|
+
"value"
|
|
11276
|
+
]);
|
|
11181
11277
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label, secondary: description, checked: value });
|
|
11182
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FieldInput_default, { id, label: "", description: "",
|
|
11278
|
+
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
11279
|
}
|
|
11184
11280
|
};
|
|
11185
11281
|
var BooleanInputRenderer_default = BooleanInputRenderer;
|
|
@@ -11404,23 +11500,33 @@ var DateInputRenderer = {
|
|
|
11404
11500
|
control,
|
|
11405
11501
|
label,
|
|
11406
11502
|
description,
|
|
11407
|
-
error,
|
|
11408
11503
|
type,
|
|
11409
11504
|
help,
|
|
11505
|
+
validationState,
|
|
11410
11506
|
value: initialValue
|
|
11411
11507
|
} = _a, rest = __objRest(_a, [
|
|
11412
11508
|
"id",
|
|
11413
11509
|
"control",
|
|
11414
11510
|
"label",
|
|
11415
11511
|
"description",
|
|
11416
|
-
"error",
|
|
11417
11512
|
"type",
|
|
11418
11513
|
"help",
|
|
11514
|
+
"validationState",
|
|
11419
11515
|
"value"
|
|
11420
11516
|
]);
|
|
11421
11517
|
const value = initialValue != null ? initialValue : "";
|
|
11422
11518
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
11423
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
11519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
11520
|
+
FieldInput_default,
|
|
11521
|
+
{
|
|
11522
|
+
id,
|
|
11523
|
+
label,
|
|
11524
|
+
description,
|
|
11525
|
+
validation: validationState,
|
|
11526
|
+
help,
|
|
11527
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(VariableDateInput_default, { control, inputProps })
|
|
11528
|
+
}
|
|
11529
|
+
);
|
|
11424
11530
|
}
|
|
11425
11531
|
};
|
|
11426
11532
|
var DateInputRenderer_default = DateInputRenderer;
|
|
@@ -11708,23 +11814,33 @@ var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
|
11708
11814
|
var IntegerInputRenderer = {
|
|
11709
11815
|
canRenderType: "input-integer",
|
|
11710
11816
|
render: (props) => {
|
|
11711
|
-
const _a = props, { id, label,
|
|
11712
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11713
|
-
|
|
11714
|
-
|
|
11817
|
+
const _a = props, { id, label, description, help, type, validationState, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "description", "help", "type", "validationState", "value", "onChange"]);
|
|
11818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11819
|
+
FieldInput_default,
|
|
11820
|
+
{
|
|
11715
11821
|
id,
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
|
|
11725
|
-
|
|
11726
|
-
|
|
11727
|
-
|
|
11822
|
+
label,
|
|
11823
|
+
description,
|
|
11824
|
+
validation: validationState,
|
|
11825
|
+
help,
|
|
11826
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11827
|
+
import_components14.Input,
|
|
11828
|
+
__spreadValues({
|
|
11829
|
+
id,
|
|
11830
|
+
name: id,
|
|
11831
|
+
type: "number",
|
|
11832
|
+
step: "1",
|
|
11833
|
+
pattern: "\\d+",
|
|
11834
|
+
value: value != null ? value : "",
|
|
11835
|
+
onChange: ({ target: { value: newValue } }) => {
|
|
11836
|
+
const parsedValue = Number.parseInt(newValue, 10);
|
|
11837
|
+
onChange(Number.isNaN(parsedValue) ? null : parsedValue);
|
|
11838
|
+
},
|
|
11839
|
+
onWheel
|
|
11840
|
+
}, rest)
|
|
11841
|
+
)
|
|
11842
|
+
}
|
|
11843
|
+
);
|
|
11728
11844
|
}
|
|
11729
11845
|
};
|
|
11730
11846
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
@@ -11830,10 +11946,10 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
11830
11946
|
disabled,
|
|
11831
11947
|
label,
|
|
11832
11948
|
help,
|
|
11833
|
-
error,
|
|
11834
11949
|
options,
|
|
11835
11950
|
placeholder,
|
|
11836
11951
|
selectedIndices,
|
|
11952
|
+
validationState,
|
|
11837
11953
|
onSelect
|
|
11838
11954
|
} = props;
|
|
11839
11955
|
const mergedIndices = stagedIndices != null ? stagedIndices : selectedIndices;
|
|
@@ -11864,39 +11980,49 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
11864
11980
|
};
|
|
11865
11981
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components19.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
11866
11982
|
};
|
|
11867
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11868
|
-
|
|
11983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11984
|
+
FieldInput_default,
|
|
11869
11985
|
{
|
|
11870
11986
|
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
|
-
|
|
11987
|
+
label,
|
|
11988
|
+
help,
|
|
11989
|
+
description,
|
|
11990
|
+
validation: validationState,
|
|
11991
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11992
|
+
import_components19.SelectInput,
|
|
11993
|
+
{
|
|
11994
|
+
id,
|
|
11995
|
+
items: options.map((option, index) => {
|
|
11996
|
+
var _a, _b, _c;
|
|
11997
|
+
return {
|
|
11998
|
+
type: "option",
|
|
11999
|
+
value: index,
|
|
12000
|
+
filterMatchers: [
|
|
12001
|
+
...(_a = option.keywords) != null ? _a : [],
|
|
12002
|
+
(_b = option.title) != null ? _b : "",
|
|
12003
|
+
(_c = option.description) != null ? _c : ""
|
|
12004
|
+
],
|
|
12005
|
+
disabled: option.disabled
|
|
12006
|
+
};
|
|
12007
|
+
}),
|
|
12008
|
+
disabled,
|
|
12009
|
+
placeholder,
|
|
12010
|
+
value: mergedIndices,
|
|
12011
|
+
renderValue,
|
|
12012
|
+
multiple: true,
|
|
12013
|
+
onChange: (values) => {
|
|
12014
|
+
setStagedIndices(values);
|
|
12015
|
+
},
|
|
12016
|
+
onClose: () => {
|
|
12017
|
+
if (stagedIndices) {
|
|
12018
|
+
onSelect(stagedIndices);
|
|
12019
|
+
setStagedIndices(void 0);
|
|
12020
|
+
}
|
|
12021
|
+
}
|
|
11896
12022
|
}
|
|
11897
|
-
|
|
12023
|
+
)
|
|
11898
12024
|
}
|
|
11899
|
-
)
|
|
12025
|
+
);
|
|
11900
12026
|
}
|
|
11901
12027
|
var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
|
|
11902
12028
|
|
|
@@ -11912,8 +12038,8 @@ function UploadFieldInput({
|
|
|
11912
12038
|
children,
|
|
11913
12039
|
label,
|
|
11914
12040
|
description,
|
|
11915
|
-
|
|
11916
|
-
|
|
12041
|
+
help,
|
|
12042
|
+
validation
|
|
11917
12043
|
}) {
|
|
11918
12044
|
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
11919
12045
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
@@ -11921,12 +12047,12 @@ function UploadFieldInput({
|
|
|
11921
12047
|
"div",
|
|
11922
12048
|
{
|
|
11923
12049
|
className: (0, import_classnames3.default)("form-group d-block", {
|
|
11924
|
-
"has-error":
|
|
12050
|
+
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
11925
12051
|
}),
|
|
11926
12052
|
children: [
|
|
11927
12053
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
11928
12054
|
children,
|
|
11929
|
-
|
|
12055
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components20.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
11930
12056
|
]
|
|
11931
12057
|
}
|
|
11932
12058
|
);
|
|
@@ -11969,10 +12095,10 @@ var MultiUploadInputRenderer = {
|
|
|
11969
12095
|
label,
|
|
11970
12096
|
description,
|
|
11971
12097
|
disabled,
|
|
11972
|
-
error,
|
|
11973
12098
|
maxSize,
|
|
11974
12099
|
maxItems,
|
|
11975
12100
|
uploadLabel,
|
|
12101
|
+
validationState,
|
|
11976
12102
|
onUpload,
|
|
11977
12103
|
onDelete
|
|
11978
12104
|
} = props;
|
|
@@ -11985,22 +12111,32 @@ var MultiUploadInputRenderer = {
|
|
|
11985
12111
|
};
|
|
11986
12112
|
const onDeleteFile = async (fileId) => onDelete(String(fileId));
|
|
11987
12113
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
11988
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11989
|
-
|
|
12114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12115
|
+
UploadFieldInput_default,
|
|
11990
12116
|
{
|
|
11991
12117
|
id,
|
|
11992
|
-
|
|
12118
|
+
label,
|
|
11993
12119
|
description,
|
|
11994
|
-
|
|
11995
|
-
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12120
|
+
validation: validationState,
|
|
12121
|
+
help,
|
|
12122
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12123
|
+
import_components21.UploadInput,
|
|
12124
|
+
{
|
|
12125
|
+
id,
|
|
12126
|
+
"aria-describedby": descriptionId,
|
|
12127
|
+
description,
|
|
12128
|
+
disabled,
|
|
12129
|
+
fileTypes: getAcceptsString(accepts),
|
|
12130
|
+
maxFiles: maxItems,
|
|
12131
|
+
multiple: true,
|
|
12132
|
+
sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
|
|
12133
|
+
uploadButtonTitle: uploadLabel,
|
|
12134
|
+
onDeleteFile,
|
|
12135
|
+
onUploadFile
|
|
12136
|
+
}
|
|
12137
|
+
)
|
|
12002
12138
|
}
|
|
12003
|
-
)
|
|
12139
|
+
);
|
|
12004
12140
|
}
|
|
12005
12141
|
};
|
|
12006
12142
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
@@ -12011,21 +12147,31 @@ var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
|
12011
12147
|
var NumberInputRenderer = {
|
|
12012
12148
|
canRenderType: "input-number",
|
|
12013
12149
|
render: (props) => {
|
|
12014
|
-
const _a = props, { id, label,
|
|
12015
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12016
|
-
|
|
12017
|
-
|
|
12150
|
+
const _a = props, { id, label, description, help, type, validationState, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "description", "help", "type", "validationState", "value", "onChange"]);
|
|
12151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12152
|
+
FieldInput_default,
|
|
12153
|
+
{
|
|
12018
12154
|
id,
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12155
|
+
label,
|
|
12156
|
+
description,
|
|
12157
|
+
validation: validationState,
|
|
12158
|
+
help,
|
|
12159
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12160
|
+
import_components22.Input,
|
|
12161
|
+
__spreadValues({
|
|
12162
|
+
id,
|
|
12163
|
+
name: id,
|
|
12164
|
+
type: "number",
|
|
12165
|
+
value: value != null ? value : "",
|
|
12166
|
+
onChange: ({ target: { value: newValue } }) => {
|
|
12167
|
+
const parsedValue = Number.parseFloat(newValue);
|
|
12168
|
+
onChange(Number.isNaN(parsedValue) ? null : parsedValue);
|
|
12169
|
+
},
|
|
12170
|
+
onWheel
|
|
12171
|
+
}, rest)
|
|
12172
|
+
)
|
|
12173
|
+
}
|
|
12174
|
+
);
|
|
12029
12175
|
}
|
|
12030
12176
|
};
|
|
12031
12177
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
@@ -12145,9 +12291,9 @@ function Repeatable(props) {
|
|
|
12145
12291
|
description,
|
|
12146
12292
|
editableItem,
|
|
12147
12293
|
editItemTitle,
|
|
12148
|
-
error,
|
|
12149
12294
|
items,
|
|
12150
12295
|
title,
|
|
12296
|
+
validationState,
|
|
12151
12297
|
onEdit,
|
|
12152
12298
|
onAdd,
|
|
12153
12299
|
onSave,
|
|
@@ -12183,7 +12329,7 @@ function Repeatable(props) {
|
|
|
12183
12329
|
"div",
|
|
12184
12330
|
{
|
|
12185
12331
|
className: (0, import_classnames5.default)("form-group", {
|
|
12186
|
-
"has-error":
|
|
12332
|
+
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
12187
12333
|
}),
|
|
12188
12334
|
children: [
|
|
12189
12335
|
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
@@ -12196,7 +12342,7 @@ function Repeatable(props) {
|
|
|
12196
12342
|
onClick: () => onAddItem()
|
|
12197
12343
|
}
|
|
12198
12344
|
),
|
|
12199
|
-
|
|
12345
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components25.InlineAlert, { type: "negative", children: validationState.message })
|
|
12200
12346
|
]
|
|
12201
12347
|
}
|
|
12202
12348
|
),
|
|
@@ -12235,7 +12381,7 @@ function ItemSummaryOption({
|
|
|
12235
12381
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
12236
12382
|
|
|
12237
12383
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
12238
|
-
var
|
|
12384
|
+
var import_components27 = require("@transferwise/components");
|
|
12239
12385
|
|
|
12240
12386
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
12241
12387
|
var import_react_intl16 = require("react-intl");
|
|
@@ -12261,22 +12407,26 @@ var generic_error_messages_default2 = (0, import_react_intl15.defineMessages)({
|
|
|
12261
12407
|
});
|
|
12262
12408
|
|
|
12263
12409
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
12410
|
+
var import_components26 = require("@transferwise/components");
|
|
12264
12411
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
12265
12412
|
function ErrorResult({ state }) {
|
|
12266
12413
|
const intl = (0, import_react_intl16.useIntl)();
|
|
12414
|
+
const buttonVisualProps = {
|
|
12415
|
+
priority: "tertiary",
|
|
12416
|
+
size: "sm",
|
|
12417
|
+
style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
|
|
12418
|
+
};
|
|
12267
12419
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "m-t-2", children: [
|
|
12268
12420
|
intl.formatMessage(generic_error_messages_default2.genericError),
|
|
12269
12421
|
"\xA0",
|
|
12270
12422
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
12271
|
-
|
|
12272
|
-
{
|
|
12273
|
-
|
|
12274
|
-
onClick: (e) => {
|
|
12275
|
-
e.preventDefault();
|
|
12423
|
+
import_components26.Button,
|
|
12424
|
+
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
12425
|
+
onClick: () => {
|
|
12276
12426
|
state.onRetry();
|
|
12277
12427
|
},
|
|
12278
12428
|
children: intl.formatMessage(generic_error_messages_default2.retry)
|
|
12279
|
-
}
|
|
12429
|
+
})
|
|
12280
12430
|
)
|
|
12281
12431
|
] });
|
|
12282
12432
|
}
|
|
@@ -12296,8 +12446,8 @@ function BlockSearchRendererComponent({
|
|
|
12296
12446
|
const [hasSearched, setHasSearched] = (0, import_react14.useState)(false);
|
|
12297
12447
|
const trackEvent = useTrackEvent();
|
|
12298
12448
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: getMargin(margin), children: [
|
|
12299
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FieldInput_default, { id, description: "",
|
|
12300
|
-
|
|
12449
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
12450
|
+
import_components27.Input,
|
|
12301
12451
|
{
|
|
12302
12452
|
id,
|
|
12303
12453
|
name: id,
|
|
@@ -12333,16 +12483,16 @@ function SearchResultContent({
|
|
|
12333
12483
|
}
|
|
12334
12484
|
}
|
|
12335
12485
|
function EmptySearchResult({ state }) {
|
|
12336
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
12486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components27.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
12337
12487
|
}
|
|
12338
12488
|
function SearchResults({
|
|
12339
12489
|
state
|
|
12340
12490
|
}) {
|
|
12341
12491
|
const trackEvent = useTrackEvent();
|
|
12342
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
12492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components27.NavigationOptionsList, { children: state.results.map((result) => {
|
|
12343
12493
|
const { icon, image } = result;
|
|
12344
12494
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
12345
|
-
|
|
12495
|
+
import_components27.NavigationOption,
|
|
12346
12496
|
{
|
|
12347
12497
|
title: result.title,
|
|
12348
12498
|
content: result.description,
|
|
@@ -12363,7 +12513,7 @@ function SearchResults({
|
|
|
12363
12513
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
12364
12514
|
|
|
12365
12515
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
12366
|
-
var
|
|
12516
|
+
var import_components28 = require("@transferwise/components");
|
|
12367
12517
|
var import_icons2 = require("@transferwise/icons");
|
|
12368
12518
|
var import_react15 = require("react");
|
|
12369
12519
|
var import_react_intl17 = require("react-intl");
|
|
@@ -12379,8 +12529,8 @@ function InlineSearchRenderer({
|
|
|
12379
12529
|
const [hasSearched, setHasSearched] = (0, import_react15.useState)(false);
|
|
12380
12530
|
const trackEvent = useTrackEvent();
|
|
12381
12531
|
const intl = (0, import_react_intl17.useIntl)();
|
|
12382
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FieldInput_default, { id, description: "",
|
|
12383
|
-
|
|
12532
|
+
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)(
|
|
12533
|
+
import_components28.Typeahead,
|
|
12384
12534
|
{
|
|
12385
12535
|
id: "typeahead-input-id",
|
|
12386
12536
|
intl,
|
|
@@ -12426,7 +12576,7 @@ function mapResultToTypeaheadOption(result) {
|
|
|
12426
12576
|
}
|
|
12427
12577
|
function TypeaheadFooter({ state, isLoading }) {
|
|
12428
12578
|
if (state.type === "noResults") {
|
|
12429
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
12579
|
+
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
12580
|
}
|
|
12431
12581
|
if (state.type === "error") {
|
|
12432
12582
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ErrorResult, { state }) });
|
|
@@ -12447,7 +12597,7 @@ var SearchRenderer = {
|
|
|
12447
12597
|
var SearchRenderer_default = SearchRenderer;
|
|
12448
12598
|
|
|
12449
12599
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
12450
|
-
var
|
|
12600
|
+
var import_components29 = require("@transferwise/components");
|
|
12451
12601
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
12452
12602
|
function RadioInputRendererComponent(props) {
|
|
12453
12603
|
const {
|
|
@@ -12455,36 +12605,46 @@ function RadioInputRendererComponent(props) {
|
|
|
12455
12605
|
children,
|
|
12456
12606
|
description,
|
|
12457
12607
|
disabled,
|
|
12458
|
-
error,
|
|
12459
12608
|
help,
|
|
12460
12609
|
label,
|
|
12461
12610
|
options,
|
|
12462
12611
|
selectedIndex,
|
|
12612
|
+
validationState,
|
|
12463
12613
|
onSelect
|
|
12464
12614
|
} = props;
|
|
12465
12615
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
12466
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12467
|
-
|
|
12616
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12617
|
+
FieldInput_default,
|
|
12468
12618
|
{
|
|
12469
|
-
|
|
12470
|
-
|
|
12471
|
-
|
|
12472
|
-
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12477
|
-
|
|
12478
|
-
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
|
|
12619
|
+
id,
|
|
12620
|
+
label,
|
|
12621
|
+
help,
|
|
12622
|
+
description,
|
|
12623
|
+
validation: validationState,
|
|
12624
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12625
|
+
import_components29.RadioGroup,
|
|
12626
|
+
{
|
|
12627
|
+
name: id,
|
|
12628
|
+
radios: options.map((option, index) => ({
|
|
12629
|
+
label: option.title,
|
|
12630
|
+
value: index,
|
|
12631
|
+
secondary: option.description,
|
|
12632
|
+
disabled: option.disabled || disabled,
|
|
12633
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
12634
|
+
})),
|
|
12635
|
+
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
12636
|
+
onChange: onSelect
|
|
12637
|
+
},
|
|
12638
|
+
`${id}-${selectedIndex}`
|
|
12639
|
+
) })
|
|
12640
|
+
}
|
|
12641
|
+
),
|
|
12482
12642
|
children
|
|
12483
12643
|
] });
|
|
12484
12644
|
}
|
|
12485
12645
|
|
|
12486
12646
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
12487
|
-
var
|
|
12647
|
+
var import_components30 = require("@transferwise/components");
|
|
12488
12648
|
var import_react16 = require("react");
|
|
12489
12649
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
12490
12650
|
function TabInputRendererComponent(props) {
|
|
@@ -12493,11 +12653,11 @@ function TabInputRendererComponent(props) {
|
|
|
12493
12653
|
children,
|
|
12494
12654
|
description,
|
|
12495
12655
|
disabled,
|
|
12496
|
-
error,
|
|
12497
12656
|
help,
|
|
12498
12657
|
label,
|
|
12499
12658
|
options,
|
|
12500
12659
|
selectedIndex,
|
|
12660
|
+
validationState,
|
|
12501
12661
|
onSelect
|
|
12502
12662
|
} = props;
|
|
12503
12663
|
(0, import_react16.useEffect)(() => {
|
|
@@ -12506,41 +12666,51 @@ function TabInputRendererComponent(props) {
|
|
|
12506
12666
|
}
|
|
12507
12667
|
}, [selectedIndex, onSelect, options.length]);
|
|
12508
12668
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
12509
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12510
|
-
|
|
12669
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12670
|
+
FieldInput_default,
|
|
12511
12671
|
{
|
|
12512
|
-
|
|
12513
|
-
|
|
12514
|
-
|
|
12515
|
-
|
|
12516
|
-
|
|
12517
|
-
|
|
12518
|
-
|
|
12519
|
-
|
|
12520
|
-
|
|
12521
|
-
|
|
12672
|
+
id,
|
|
12673
|
+
label,
|
|
12674
|
+
help,
|
|
12675
|
+
description,
|
|
12676
|
+
validation: validationState,
|
|
12677
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12678
|
+
import_components30.Tabs,
|
|
12679
|
+
{
|
|
12680
|
+
name: id,
|
|
12681
|
+
selected: selectedIndex != null ? selectedIndex : 0,
|
|
12682
|
+
tabs: options.map((option) => ({
|
|
12683
|
+
title: option.title,
|
|
12684
|
+
// if we pass null, we get some props-types console errors
|
|
12685
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
12686
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, {}),
|
|
12687
|
+
disabled: option.disabled || disabled
|
|
12688
|
+
})),
|
|
12689
|
+
onTabSelect: onSelect
|
|
12690
|
+
}
|
|
12691
|
+
)
|
|
12522
12692
|
}
|
|
12523
|
-
)
|
|
12693
|
+
),
|
|
12524
12694
|
children
|
|
12525
12695
|
] });
|
|
12526
12696
|
}
|
|
12527
12697
|
var isValidIndex = (index, options) => index !== null && index >= 0 && index < options;
|
|
12528
12698
|
|
|
12529
12699
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
12530
|
-
var
|
|
12700
|
+
var import_components32 = require("@transferwise/components");
|
|
12531
12701
|
|
|
12532
12702
|
// ../renderers/src/SelectInputRenderer/SelectTriggerMedia.tsx
|
|
12533
|
-
var
|
|
12703
|
+
var import_components31 = require("@transferwise/components");
|
|
12534
12704
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
12535
12705
|
function SelectTriggerMedia({ icon, image }) {
|
|
12536
12706
|
if (image == null ? void 0 : image.url) {
|
|
12537
12707
|
return null;
|
|
12538
12708
|
}
|
|
12539
12709
|
if (icon && "name" in icon) {
|
|
12540
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12710
|
+
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
12711
|
}
|
|
12542
12712
|
if (icon && "text" in icon) {
|
|
12543
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components31.Avatar, { type: import_components31.AvatarType.ICON, size: 24, children: icon.text });
|
|
12544
12714
|
}
|
|
12545
12715
|
return null;
|
|
12546
12716
|
}
|
|
@@ -12553,13 +12723,13 @@ function SelectInputRendererComponent(props) {
|
|
|
12553
12723
|
children,
|
|
12554
12724
|
description,
|
|
12555
12725
|
disabled,
|
|
12556
|
-
error,
|
|
12557
12726
|
help,
|
|
12558
12727
|
label,
|
|
12559
12728
|
options,
|
|
12560
12729
|
placeholder,
|
|
12561
12730
|
required,
|
|
12562
12731
|
selectedIndex,
|
|
12732
|
+
validationState,
|
|
12563
12733
|
onSelect
|
|
12564
12734
|
} = props;
|
|
12565
12735
|
const items = options.map(
|
|
@@ -12587,54 +12757,84 @@ function SelectInputRendererComponent(props) {
|
|
|
12587
12757
|
description: option.description,
|
|
12588
12758
|
icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
12589
12759
|
};
|
|
12590
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components32.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
12591
12761
|
};
|
|
12592
12762
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
12593
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12594
|
-
|
|
12763
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12764
|
+
FieldInput_default,
|
|
12595
12765
|
{
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
|
|
12766
|
+
id,
|
|
12767
|
+
label,
|
|
12768
|
+
help,
|
|
12769
|
+
description,
|
|
12770
|
+
validation: validationState,
|
|
12771
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12772
|
+
import_components32.SelectInput,
|
|
12773
|
+
{
|
|
12774
|
+
name: id,
|
|
12775
|
+
placeholder,
|
|
12776
|
+
items,
|
|
12777
|
+
disabled,
|
|
12778
|
+
value: selectedIndex,
|
|
12779
|
+
renderValue,
|
|
12780
|
+
filterable: items.length >= 8,
|
|
12781
|
+
onChange: onSelect,
|
|
12782
|
+
onClear: required ? void 0 : () => onSelect(null)
|
|
12783
|
+
}
|
|
12784
|
+
)
|
|
12605
12785
|
}
|
|
12606
|
-
)
|
|
12786
|
+
),
|
|
12607
12787
|
children
|
|
12608
12788
|
] });
|
|
12609
12789
|
}
|
|
12610
12790
|
|
|
12611
12791
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
12612
12792
|
var import_react17 = require("react");
|
|
12613
|
-
var
|
|
12793
|
+
var import_components33 = require("@transferwise/components");
|
|
12614
12794
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
12615
12795
|
function SegmentedInputRendererComponent(props) {
|
|
12616
|
-
const {
|
|
12796
|
+
const {
|
|
12797
|
+
id,
|
|
12798
|
+
children,
|
|
12799
|
+
description,
|
|
12800
|
+
help,
|
|
12801
|
+
label,
|
|
12802
|
+
options,
|
|
12803
|
+
selectedIndex,
|
|
12804
|
+
validationState,
|
|
12805
|
+
onSelect
|
|
12806
|
+
} = props;
|
|
12617
12807
|
(0, import_react17.useEffect)(() => {
|
|
12618
12808
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
12619
12809
|
onSelect(0);
|
|
12620
12810
|
}
|
|
12621
12811
|
}, [selectedIndex, onSelect, options.length]);
|
|
12622
12812
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
12623
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12624
|
-
|
|
12813
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12814
|
+
FieldInput_default,
|
|
12625
12815
|
{
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12816
|
+
id,
|
|
12817
|
+
label,
|
|
12818
|
+
help,
|
|
12819
|
+
description,
|
|
12820
|
+
validation: validationState,
|
|
12821
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12822
|
+
import_components33.SegmentedControl,
|
|
12823
|
+
{
|
|
12824
|
+
name: `${id}-segmented-control`,
|
|
12825
|
+
value: String(selectedIndex),
|
|
12826
|
+
mode: "view",
|
|
12827
|
+
segments: options.map((option, index) => ({
|
|
12828
|
+
id: String(index),
|
|
12829
|
+
value: String(index),
|
|
12830
|
+
label: option.title,
|
|
12831
|
+
controls: `${id}-children`
|
|
12832
|
+
})),
|
|
12833
|
+
onChange: (value) => onSelect(Number(value))
|
|
12834
|
+
}
|
|
12835
|
+
)
|
|
12636
12836
|
}
|
|
12637
|
-
)
|
|
12837
|
+
),
|
|
12638
12838
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { id: `${id}-children`, children })
|
|
12639
12839
|
] });
|
|
12640
12840
|
}
|
|
@@ -12661,21 +12861,28 @@ var SelectInputRenderer = {
|
|
|
12661
12861
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
12662
12862
|
|
|
12663
12863
|
// ../renderers/src/StatusListRenderer.tsx
|
|
12664
|
-
var
|
|
12864
|
+
var import_components34 = require("@transferwise/components");
|
|
12665
12865
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
12666
12866
|
var StatusListRenderer = {
|
|
12667
12867
|
canRenderType: "status-list",
|
|
12668
12868
|
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
|
-
|
|
12869
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components34.Header, { title }) : null,
|
|
12870
|
+
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12871
|
+
import_components34.Summary,
|
|
12672
12872
|
{
|
|
12673
12873
|
title: itemTitle,
|
|
12674
12874
|
description,
|
|
12675
12875
|
icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DynamicIcon_default, { name: icon.name }) : null,
|
|
12676
|
-
status: mapStatus(status)
|
|
12876
|
+
status: mapStatus(status),
|
|
12877
|
+
action: callToAction ? {
|
|
12878
|
+
"aria-label": callToAction.accessibilityDescription,
|
|
12879
|
+
href: callToAction.href,
|
|
12880
|
+
text: callToAction.title,
|
|
12881
|
+
target: callToAction.href ? "_blank" : void 0,
|
|
12882
|
+
onClick: callToAction.href ? void 0 : callToAction.onClick
|
|
12883
|
+
} : void 0
|
|
12677
12884
|
},
|
|
12678
|
-
`${
|
|
12885
|
+
`${itemTitle}/${description || ""}`
|
|
12679
12886
|
))
|
|
12680
12887
|
] })
|
|
12681
12888
|
};
|
|
@@ -12688,7 +12895,7 @@ var mapStatus = (status) => {
|
|
|
12688
12895
|
};
|
|
12689
12896
|
|
|
12690
12897
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
12691
|
-
var
|
|
12898
|
+
var import_components35 = require("@transferwise/components");
|
|
12692
12899
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
12693
12900
|
function VariableTextInput({
|
|
12694
12901
|
control,
|
|
@@ -12714,37 +12921,37 @@ function TextInput(_a) {
|
|
|
12714
12921
|
if (typeof displayFormat === "string") {
|
|
12715
12922
|
const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
|
|
12716
12923
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12717
|
-
|
|
12924
|
+
import_components35.InputWithDisplayFormat,
|
|
12718
12925
|
__spreadValues({
|
|
12719
12926
|
displayPattern: displayFormat,
|
|
12720
12927
|
onChange: (newValue) => onChange(newValue)
|
|
12721
12928
|
}, inputProps)
|
|
12722
12929
|
);
|
|
12723
12930
|
}
|
|
12724
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components35.Input, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
|
|
12725
12932
|
}
|
|
12726
12933
|
function TextAreaInput(_a) {
|
|
12727
12934
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12728
12935
|
const textAreaProps = __spreadValues({ id, name: id }, rest);
|
|
12729
12936
|
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12730
|
-
|
|
12937
|
+
import_components35.TextareaWithDisplayFormat,
|
|
12731
12938
|
__spreadValues({
|
|
12732
12939
|
displayPattern: displayFormat,
|
|
12733
12940
|
onChange: (newValue) => onChange(newValue)
|
|
12734
12941
|
}, textAreaProps)
|
|
12735
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12942
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components35.TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
|
|
12736
12943
|
}
|
|
12737
12944
|
function NumericInput(_a) {
|
|
12738
12945
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12739
12946
|
const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
|
|
12740
12947
|
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12741
|
-
|
|
12948
|
+
import_components35.InputWithDisplayFormat,
|
|
12742
12949
|
__spreadValues({
|
|
12743
12950
|
displayPattern: displayFormat,
|
|
12744
12951
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
12745
12952
|
}, numericProps)
|
|
12746
12953
|
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12747
|
-
|
|
12954
|
+
import_components35.Input,
|
|
12748
12955
|
__spreadValues({
|
|
12749
12956
|
onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
|
|
12750
12957
|
}, numericProps)
|
|
@@ -12752,7 +12959,7 @@ function NumericInput(_a) {
|
|
|
12752
12959
|
}
|
|
12753
12960
|
function PhoneNumberInput(_a) {
|
|
12754
12961
|
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
12755
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components35.PhoneNumberInput, __spreadValues({ initialValue: value }, rest));
|
|
12756
12963
|
}
|
|
12757
12964
|
var VariableTextInput_default = VariableTextInput;
|
|
12758
12965
|
|
|
@@ -12771,6 +12978,7 @@ var TextInputRenderer = {
|
|
|
12771
12978
|
maxLength,
|
|
12772
12979
|
minLength,
|
|
12773
12980
|
type,
|
|
12981
|
+
validationState,
|
|
12774
12982
|
value: initialValue
|
|
12775
12983
|
} = _a, rest = __objRest(_a, [
|
|
12776
12984
|
"id",
|
|
@@ -12782,22 +12990,33 @@ var TextInputRenderer = {
|
|
|
12782
12990
|
"maxLength",
|
|
12783
12991
|
"minLength",
|
|
12784
12992
|
"type",
|
|
12993
|
+
"validationState",
|
|
12785
12994
|
"value"
|
|
12786
12995
|
]);
|
|
12787
12996
|
const value = initialValue != null ? initialValue : "";
|
|
12788
12997
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
12789
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12999
|
+
FieldInput_default,
|
|
13000
|
+
{
|
|
13001
|
+
id,
|
|
13002
|
+
label,
|
|
13003
|
+
description,
|
|
13004
|
+
validation: validationState,
|
|
13005
|
+
help,
|
|
13006
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(VariableTextInput_default, { control, inputProps })
|
|
13007
|
+
}
|
|
13008
|
+
);
|
|
12790
13009
|
}
|
|
12791
13010
|
};
|
|
12792
13011
|
var TextInputRenderer_default = TextInputRenderer;
|
|
12793
13012
|
|
|
12794
13013
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
12795
|
-
var
|
|
13014
|
+
var import_components36 = require("@transferwise/components");
|
|
12796
13015
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
12797
13016
|
var UploadInputRenderer = {
|
|
12798
13017
|
canRenderType: "input-upload",
|
|
12799
13018
|
render: (props) => {
|
|
12800
|
-
const { id, accepts,
|
|
13019
|
+
const { id, accepts, label, description, disabled, maxSize, validationState, onUpload } = props;
|
|
12801
13020
|
const onUploadFile = async (formData) => {
|
|
12802
13021
|
const file = formData.get("file");
|
|
12803
13022
|
return onUpload(file).then(() => ({
|
|
@@ -12809,19 +13028,28 @@ var UploadInputRenderer = {
|
|
|
12809
13028
|
};
|
|
12810
13029
|
return (
|
|
12811
13030
|
// We don't pass help here as there is no sensible place to display it
|
|
12812
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12813
|
-
|
|
13031
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
13032
|
+
UploadFieldInput_default,
|
|
12814
13033
|
{
|
|
12815
13034
|
id,
|
|
12816
|
-
|
|
12817
|
-
|
|
12818
|
-
|
|
12819
|
-
|
|
12820
|
-
|
|
12821
|
-
|
|
12822
|
-
|
|
13035
|
+
label: void 0,
|
|
13036
|
+
description: void 0,
|
|
13037
|
+
validation: validationState,
|
|
13038
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
13039
|
+
import_components36.UploadInput,
|
|
13040
|
+
{
|
|
13041
|
+
id,
|
|
13042
|
+
description,
|
|
13043
|
+
disabled,
|
|
13044
|
+
fileTypes: getAcceptsString(accepts),
|
|
13045
|
+
sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
|
|
13046
|
+
uploadButtonTitle: label,
|
|
13047
|
+
onDeleteFile,
|
|
13048
|
+
onUploadFile
|
|
13049
|
+
}
|
|
13050
|
+
)
|
|
12823
13051
|
}
|
|
12824
|
-
)
|
|
13052
|
+
)
|
|
12825
13053
|
);
|
|
12826
13054
|
}
|
|
12827
13055
|
};
|
|
@@ -12836,10 +13064,10 @@ var LargeUploadRenderer = {
|
|
|
12836
13064
|
label,
|
|
12837
13065
|
description,
|
|
12838
13066
|
disabled,
|
|
12839
|
-
error,
|
|
12840
13067
|
help,
|
|
12841
13068
|
maxSize,
|
|
12842
13069
|
type,
|
|
13070
|
+
validationState,
|
|
12843
13071
|
onUpload
|
|
12844
13072
|
} = _a, rest = __objRest(_a, [
|
|
12845
13073
|
"id",
|
|
@@ -12848,10 +13076,10 @@ var LargeUploadRenderer = {
|
|
|
12848
13076
|
"label",
|
|
12849
13077
|
"description",
|
|
12850
13078
|
"disabled",
|
|
12851
|
-
"error",
|
|
12852
13079
|
"help",
|
|
12853
13080
|
"maxSize",
|
|
12854
13081
|
"type",
|
|
13082
|
+
"validationState",
|
|
12855
13083
|
"onUpload"
|
|
12856
13084
|
]);
|
|
12857
13085
|
const uploadProps = __spreadProps(__spreadValues({}, rest), { id, name: id });
|
|
@@ -12864,21 +13092,31 @@ var LargeUploadRenderer = {
|
|
|
12864
13092
|
throw e;
|
|
12865
13093
|
}
|
|
12866
13094
|
};
|
|
12867
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12868
|
-
|
|
12869
|
-
|
|
12870
|
-
|
|
12871
|
-
|
|
12872
|
-
|
|
12873
|
-
|
|
12874
|
-
|
|
12875
|
-
|
|
12876
|
-
|
|
13095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
13096
|
+
FieldInput_default,
|
|
13097
|
+
{
|
|
13098
|
+
id,
|
|
13099
|
+
label,
|
|
13100
|
+
description,
|
|
13101
|
+
validation: validationState,
|
|
13102
|
+
help,
|
|
13103
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
13104
|
+
import_components36.Upload,
|
|
13105
|
+
__spreadProps(__spreadValues({}, uploadProps), {
|
|
13106
|
+
usAccept: getAcceptsString(accepts),
|
|
13107
|
+
usDisabled: disabled,
|
|
13108
|
+
onSuccess: onUploadFile,
|
|
13109
|
+
onFailure: async () => onUpload(null),
|
|
13110
|
+
onCancel: async () => onUpload(null)
|
|
13111
|
+
})
|
|
13112
|
+
)
|
|
13113
|
+
}
|
|
13114
|
+
);
|
|
12877
13115
|
}
|
|
12878
13116
|
};
|
|
12879
13117
|
|
|
12880
13118
|
// ../renderers/src/ReviewRenderer.tsx
|
|
12881
|
-
var
|
|
13119
|
+
var import_components37 = require("@transferwise/components");
|
|
12882
13120
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
12883
13121
|
var ReviewRenderer = {
|
|
12884
13122
|
canRenderType: "review",
|
|
@@ -12892,9 +13130,9 @@ var ReviewRenderer = {
|
|
|
12892
13130
|
}
|
|
12893
13131
|
} : void 0;
|
|
12894
13132
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: getMargin(margin), children: [
|
|
12895
|
-
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13133
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components37.Header, { title: title != null ? title : "", action }),
|
|
12896
13134
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12897
|
-
|
|
13135
|
+
import_components37.DefinitionList,
|
|
12898
13136
|
{
|
|
12899
13137
|
layout: orientation,
|
|
12900
13138
|
definitions: fields.map(({ label, value, help }, index) => ({
|
|
@@ -12970,7 +13208,7 @@ var external_confirmation_messages_default = (0, import_react_intl18.defineMessa
|
|
|
12970
13208
|
});
|
|
12971
13209
|
|
|
12972
13210
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
12973
|
-
var
|
|
13211
|
+
var import_components38 = require("@transferwise/components");
|
|
12974
13212
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
12975
13213
|
function ExternalConfirmationDialog({
|
|
12976
13214
|
external,
|
|
@@ -12979,10 +13217,10 @@ function ExternalConfirmationDialog({
|
|
|
12979
13217
|
const { formatMessage } = (0, import_react_intl19.useIntl)();
|
|
12980
13218
|
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
13219
|
/* @__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)(
|
|
13220
|
+
/* @__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
13221
|
/* @__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
13222
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12985
|
-
|
|
13223
|
+
import_components38.Button,
|
|
12986
13224
|
{
|
|
12987
13225
|
block: true,
|
|
12988
13226
|
className: "m-b-2",
|
|
@@ -12995,7 +13233,7 @@ function ExternalConfirmationDialog({
|
|
|
12995
13233
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
12996
13234
|
}
|
|
12997
13235
|
),
|
|
12998
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13236
|
+
/* @__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
13237
|
] }) })
|
|
13000
13238
|
] }) });
|
|
13001
13239
|
}
|
|
@@ -13024,23 +13262,21 @@ function useExternal(url) {
|
|
|
13024
13262
|
}
|
|
13025
13263
|
|
|
13026
13264
|
// ../renderers/src/step/BackButton.tsx
|
|
13027
|
-
var
|
|
13265
|
+
var import_components39 = require("@transferwise/components");
|
|
13028
13266
|
var import_icons3 = require("@transferwise/icons");
|
|
13029
13267
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
13030
13268
|
function BackButton({ title, onClick }) {
|
|
13031
13269
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "m-b-2", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
13032
|
-
"
|
|
13270
|
+
"button",
|
|
13033
13271
|
{
|
|
13034
|
-
|
|
13272
|
+
type: "button",
|
|
13035
13273
|
className: "df-back-btn",
|
|
13274
|
+
title,
|
|
13036
13275
|
"aria-label": title,
|
|
13037
|
-
onClick
|
|
13038
|
-
event.preventDefault();
|
|
13039
|
-
onClick();
|
|
13040
|
-
},
|
|
13276
|
+
onClick,
|
|
13041
13277
|
children: [
|
|
13042
13278
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "sr-only", children: title }),
|
|
13043
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13279
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components39.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
|
|
13044
13280
|
]
|
|
13045
13281
|
}
|
|
13046
13282
|
) });
|
|
@@ -13048,7 +13284,7 @@ function BackButton({ title, onClick }) {
|
|
|
13048
13284
|
var BackButton_default = BackButton;
|
|
13049
13285
|
|
|
13050
13286
|
// ../renderers/src/step/StepRenderer.tsx
|
|
13051
|
-
var
|
|
13287
|
+
var import_components40 = require("@transferwise/components");
|
|
13052
13288
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
13053
13289
|
var StepRenderer = {
|
|
13054
13290
|
canRenderType: "step",
|
|
@@ -13064,10 +13300,10 @@ function StepRendererComponent(props) {
|
|
|
13064
13300
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(StepRendererContextProvider, { value, children: [
|
|
13065
13301
|
back ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
13066
13302
|
title || description ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "m-b-4", children: [
|
|
13067
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13303
|
+
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
13304
|
description ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
13069
13305
|
] }) : void 0,
|
|
13070
|
-
error ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13306
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components40.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
13071
13307
|
children
|
|
13072
13308
|
] });
|
|
13073
13309
|
}
|
|
@@ -14518,10 +14754,10 @@ var import_classnames15 = __toESM(require_classnames());
|
|
|
14518
14754
|
var import_react53 = require("react");
|
|
14519
14755
|
|
|
14520
14756
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
14521
|
-
var
|
|
14757
|
+
var import_components42 = require("@transferwise/components");
|
|
14522
14758
|
|
|
14523
14759
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
14524
|
-
var
|
|
14760
|
+
var import_components41 = require("@transferwise/components");
|
|
14525
14761
|
|
|
14526
14762
|
// src/legacy/layout/icon/FlagIcon.tsx
|
|
14527
14763
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
@@ -14572,10 +14808,10 @@ var DynamicIcon_default2 = DynamicIcon2;
|
|
|
14572
14808
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
14573
14809
|
var getNavigationOptionMedia = ({ icon, image }) => {
|
|
14574
14810
|
if (icon == null ? void 0 : icon.name) {
|
|
14575
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
14811
|
+
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
14812
|
}
|
|
14577
14813
|
if (icon == null ? void 0 : icon.text) {
|
|
14578
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
14814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components41.Avatar, { type: import_components41.AvatarType.INITIALS, children: icon.text });
|
|
14579
14815
|
}
|
|
14580
14816
|
if (image == null ? void 0 : image.url) {
|
|
14581
14817
|
const { url, text } = image;
|
|
@@ -14619,7 +14855,7 @@ var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
|
14619
14855
|
var DynamicAlert = ({ component: alert }) => {
|
|
14620
14856
|
const { context, markdown, margin } = alert;
|
|
14621
14857
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
14622
|
-
|
|
14858
|
+
import_components42.Alert,
|
|
14623
14859
|
{
|
|
14624
14860
|
type: mapContextToAlertType(legacy_mapContext(context)),
|
|
14625
14861
|
className: getMargin2(margin),
|
|
@@ -14722,7 +14958,7 @@ var getBoxWidthClasses = (component) => {
|
|
|
14722
14958
|
var DynamicBox_default = DynamicBox;
|
|
14723
14959
|
|
|
14724
14960
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
14725
|
-
var
|
|
14961
|
+
var import_components43 = require("@transferwise/components");
|
|
14726
14962
|
|
|
14727
14963
|
// src/legacy/layout/button/utils.ts
|
|
14728
14964
|
var priorities = {
|
|
@@ -14794,7 +15030,7 @@ function DynamicButtonWithoutBehavior(props) {
|
|
|
14794
15030
|
}
|
|
14795
15031
|
};
|
|
14796
15032
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
14797
|
-
|
|
15033
|
+
import_components43.Button,
|
|
14798
15034
|
{
|
|
14799
15035
|
size: getButtonSize(component.size),
|
|
14800
15036
|
type: priority === "tertiary" ? void 0 : type,
|
|
@@ -14826,7 +15062,7 @@ function DynamicButtonWithBehavior(props) {
|
|
|
14826
15062
|
}
|
|
14827
15063
|
};
|
|
14828
15064
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
14829
|
-
|
|
15065
|
+
import_components43.Button,
|
|
14830
15066
|
{
|
|
14831
15067
|
size: getButtonSize(component.size),
|
|
14832
15068
|
type: priority === "tertiary" ? void 0 : type,
|
|
@@ -14894,15 +15130,15 @@ var getWidth = (bias) => {
|
|
|
14894
15130
|
var DynamicColumns_default = DynamicColumns;
|
|
14895
15131
|
|
|
14896
15132
|
// src/legacy/layout/decision/DynamicDecision.tsx
|
|
14897
|
-
var
|
|
15133
|
+
var import_components44 = require("@transferwise/components");
|
|
14898
15134
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
14899
15135
|
function DynamicDecision({ component, onAction }) {
|
|
14900
15136
|
const { loading } = useDynamicFlow();
|
|
14901
15137
|
const { margin, options, title } = component;
|
|
14902
15138
|
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
|
-
|
|
15139
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components44.Header, { as: "h2", title }),
|
|
15140
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components44.NavigationOptionsList, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15141
|
+
import_components44.NavigationOption,
|
|
14906
15142
|
{
|
|
14907
15143
|
title: option.title,
|
|
14908
15144
|
content: option.description,
|
|
@@ -14928,7 +15164,7 @@ var DynamicDivider = ({ component }) => {
|
|
|
14928
15164
|
var DynamicDivider_default = DynamicDivider;
|
|
14929
15165
|
|
|
14930
15166
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
14931
|
-
var
|
|
15167
|
+
var import_components45 = require("@transferwise/components");
|
|
14932
15168
|
var import_react32 = require("react");
|
|
14933
15169
|
var import_react_intl21 = require("react-intl");
|
|
14934
15170
|
|
|
@@ -14959,9 +15195,9 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
14959
15195
|
}) : void 0;
|
|
14960
15196
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
14961
15197
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
14962
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15198
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components45.Loader, { size: import_components45.Size.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
|
|
14963
15199
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("br", {}),
|
|
14964
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15200
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components45.Button, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
|
|
14965
15201
|
] });
|
|
14966
15202
|
};
|
|
14967
15203
|
var DynamicExternal_default = DynamicExternal;
|
|
@@ -14970,7 +15206,7 @@ var DynamicExternal_default = DynamicExternal;
|
|
|
14970
15206
|
var import_react46 = require("react");
|
|
14971
15207
|
|
|
14972
15208
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
14973
|
-
var
|
|
15209
|
+
var import_components46 = require("@transferwise/components");
|
|
14974
15210
|
var import_classnames6 = __toESM(require_classnames());
|
|
14975
15211
|
var import_react33 = require("react");
|
|
14976
15212
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
@@ -14982,7 +15218,7 @@ var getSchemaColumnClasses = (width) => ({
|
|
|
14982
15218
|
"col-sm-4": width === "sm"
|
|
14983
15219
|
});
|
|
14984
15220
|
function AllOfSchema(props) {
|
|
14985
|
-
const { disabled = false } = props;
|
|
15221
|
+
const { disabled = false, hideTitle = false } = props;
|
|
14986
15222
|
const onChangeModelIndex = (index, onChangeProps) => {
|
|
14987
15223
|
const modelSchema = props.schema.allOf[index];
|
|
14988
15224
|
models[index] = getValidObjectModelParts(onChangeProps.model, modelSchema) || {};
|
|
@@ -14991,7 +15227,7 @@ function AllOfSchema(props) {
|
|
|
14991
15227
|
};
|
|
14992
15228
|
const [models, setModels] = (0, import_react33.useState)(splitModel(props.model, props.schema.allOf));
|
|
14993
15229
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
14994
|
-
props.schema.title && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
15230
|
+
props.schema.title && !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components46.Header, { title: props.schema.title }),
|
|
14995
15231
|
props.schema.description && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("p", { children: props.schema.description }),
|
|
14996
15232
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
|
|
14997
15233
|
// eslint-disable-next-line react/no-array-index-key
|
|
@@ -15016,12 +15252,12 @@ function AllOfSchema(props) {
|
|
|
15016
15252
|
var AllOfSchema_default = AllOfSchema;
|
|
15017
15253
|
|
|
15018
15254
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
15019
|
-
var
|
|
15255
|
+
var import_components48 = require("@transferwise/components");
|
|
15020
15256
|
var import_classnames7 = __toESM(require_classnames());
|
|
15021
15257
|
var import_react34 = require("react");
|
|
15022
15258
|
|
|
15023
15259
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
15024
|
-
var
|
|
15260
|
+
var import_components47 = require("@transferwise/components");
|
|
15025
15261
|
var import_formatting2 = require("@transferwise/formatting");
|
|
15026
15262
|
var import_react_intl22 = require("react-intl");
|
|
15027
15263
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
@@ -15034,9 +15270,9 @@ function ControlFeedback(props) {
|
|
|
15034
15270
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
15035
15271
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
15036
15272
|
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)(
|
|
15273
|
+
isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components47.InlineAlert, { type: "error", children: errors }) : null,
|
|
15274
|
+
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,
|
|
15275
|
+
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_components47.InlineAlert, { type: "info", children: [
|
|
15040
15276
|
isDescriptionVisible && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: props.schema.description }),
|
|
15041
15277
|
hasInfoMessage && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: props.infoMessage })
|
|
15042
15278
|
] })
|
|
@@ -15221,7 +15457,7 @@ function MultipleFileUploadSchema(props) {
|
|
|
15221
15457
|
const feedbackId = `${uid}-feedback`;
|
|
15222
15458
|
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: (0, import_classnames7.default)("form-group", { "has-error": showError }), children: [
|
|
15223
15459
|
/* @__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)(
|
|
15460
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components48.UploadInput, __spreadValues({}, uploadInputProps)) }),
|
|
15225
15461
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
15226
15462
|
ControlFeedback_default,
|
|
15227
15463
|
{
|
|
@@ -15244,7 +15480,7 @@ function getSuccessfullyProcessedFiles(allFiles) {
|
|
|
15244
15480
|
return allFiles.filter((file) => !file.error && file.status === "succeeded");
|
|
15245
15481
|
}
|
|
15246
15482
|
function convertFileIdsToComponentFileObjects(fileIds) {
|
|
15247
|
-
return fileIds.map((id) => isValidId(id) ? { id, status:
|
|
15483
|
+
return fileIds.map((id) => isValidId(id) ? { id, status: import_components48.Status.SUCCEEDED } : null).filter((item) => item !== null);
|
|
15248
15484
|
}
|
|
15249
15485
|
function isValidId(id) {
|
|
15250
15486
|
return isNumber3(id) || isString2(id);
|
|
@@ -15255,13 +15491,13 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
15255
15491
|
}
|
|
15256
15492
|
|
|
15257
15493
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
15258
|
-
var
|
|
15494
|
+
var import_components50 = require("@transferwise/components");
|
|
15259
15495
|
var import_classnames8 = __toESM(require_classnames());
|
|
15260
15496
|
var import_react35 = require("react");
|
|
15261
15497
|
var import_react_intl26 = require("react-intl");
|
|
15262
15498
|
|
|
15263
15499
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
15264
|
-
var
|
|
15500
|
+
var import_components49 = require("@transferwise/components");
|
|
15265
15501
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
15266
15502
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
15267
15503
|
switch (controlType) {
|
|
@@ -15313,17 +15549,17 @@ var getIconPropertyForSelectOption = (icon) => {
|
|
|
15313
15549
|
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
15314
15550
|
if (image == null ? void 0 : image.url) {
|
|
15315
15551
|
return {
|
|
15316
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15552
|
+
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
15553
|
};
|
|
15318
15554
|
}
|
|
15319
15555
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
15320
15556
|
return {
|
|
15321
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15557
|
+
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
15558
|
};
|
|
15323
15559
|
}
|
|
15324
15560
|
if (icon == null ? void 0 : icon.text) {
|
|
15325
15561
|
return {
|
|
15326
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15562
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components49.Avatar, { type: import_components49.AvatarType.INITIALS, children: icon.text })
|
|
15327
15563
|
};
|
|
15328
15564
|
}
|
|
15329
15565
|
return null;
|
|
@@ -15417,7 +15653,7 @@ function MultiSelectSchema({
|
|
|
15417
15653
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_classnames8.default)("d-flex flex-column", formGroupClasses), children: [
|
|
15418
15654
|
schema.title ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("label", { htmlFor: id, children: schema.title }) : void 0,
|
|
15419
15655
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
15420
|
-
|
|
15656
|
+
import_components50.SelectInput,
|
|
15421
15657
|
{
|
|
15422
15658
|
id,
|
|
15423
15659
|
multiple: true,
|
|
@@ -15442,7 +15678,7 @@ function MultiSelectSchema({
|
|
|
15442
15678
|
if (withinTrigger) {
|
|
15443
15679
|
return selected && index === selected[0] ? getFormattedMessage() : void 0;
|
|
15444
15680
|
}
|
|
15445
|
-
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
15681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components50.SelectInputOptionContent, { title: label, note: note != null ? note : secondary, icon });
|
|
15446
15682
|
},
|
|
15447
15683
|
onChange: broadcastModelChange
|
|
15448
15684
|
}
|
|
@@ -15472,17 +15708,17 @@ var getInitialModelIndices2 = (model, options) => {
|
|
|
15472
15708
|
};
|
|
15473
15709
|
|
|
15474
15710
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
15475
|
-
var
|
|
15711
|
+
var import_components52 = require("@transferwise/components");
|
|
15476
15712
|
var import_icons4 = require("@transferwise/icons");
|
|
15477
15713
|
var import_react37 = require("react");
|
|
15478
15714
|
var import_react_intl29 = require("react-intl");
|
|
15479
15715
|
|
|
15480
15716
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
15481
|
-
var
|
|
15717
|
+
var import_components51 = require("@transferwise/components");
|
|
15482
15718
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
15483
15719
|
function ItemSummaryOption2({ item, onClick }) {
|
|
15484
15720
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
15485
|
-
|
|
15721
|
+
import_components51.NavigationOption,
|
|
15486
15722
|
{
|
|
15487
15723
|
media: getNavigationOptionMedia(item),
|
|
15488
15724
|
title: item.title,
|
|
@@ -15853,7 +16089,7 @@ function RepeatableSchema({
|
|
|
15853
16089
|
"has-error": (_a = errors && !isEmpty(errors)) != null ? _a : submitted && validations.length
|
|
15854
16090
|
};
|
|
15855
16091
|
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)(
|
|
16092
|
+
schema.title && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_components52.Header, { title: schema.title }),
|
|
15857
16093
|
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15858
16094
|
ItemSummaryOption2,
|
|
15859
16095
|
{
|
|
@@ -15863,7 +16099,7 @@ function RepeatableSchema({
|
|
|
15863
16099
|
JSON.stringify(itemSummary)
|
|
15864
16100
|
)),
|
|
15865
16101
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15866
|
-
|
|
16102
|
+
import_components52.NavigationOption,
|
|
15867
16103
|
{
|
|
15868
16104
|
media: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_icons4.Plus, {}),
|
|
15869
16105
|
title: schema.addItemTitle || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
@@ -15872,7 +16108,7 @@ function RepeatableSchema({
|
|
|
15872
16108
|
}
|
|
15873
16109
|
),
|
|
15874
16110
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15875
|
-
|
|
16111
|
+
import_components52.Modal,
|
|
15876
16112
|
{
|
|
15877
16113
|
open: openModalType !== null,
|
|
15878
16114
|
title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
@@ -15961,7 +16197,7 @@ var ArraySchema = (props) => {
|
|
|
15961
16197
|
var ArraySchema_default = ArraySchema;
|
|
15962
16198
|
|
|
15963
16199
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
15964
|
-
var
|
|
16200
|
+
var import_components53 = require("@transferwise/components");
|
|
15965
16201
|
var import_classnames10 = __toESM(require_classnames());
|
|
15966
16202
|
var import_react38 = require("react");
|
|
15967
16203
|
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
@@ -16004,7 +16240,7 @@ function ObjectSchema(props) {
|
|
|
16004
16240
|
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
16005
16241
|
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
16006
16242
|
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("fieldset", { children: [
|
|
16007
|
-
props.schema.title && !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
16243
|
+
props.schema.title && !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_components53.Header, { title: props.schema.title, as: "legend" }),
|
|
16008
16244
|
props.schema.description && !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("p", { children: [
|
|
16009
16245
|
" ",
|
|
16010
16246
|
props.schema.description,
|
|
@@ -16038,12 +16274,12 @@ function ObjectSchema(props) {
|
|
|
16038
16274
|
var ObjectSchema_default = ObjectSchema;
|
|
16039
16275
|
|
|
16040
16276
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
16041
|
-
var
|
|
16277
|
+
var import_components56 = require("@transferwise/components");
|
|
16042
16278
|
var import_classnames11 = __toESM(require_classnames());
|
|
16043
16279
|
var import_react41 = require("react");
|
|
16044
16280
|
|
|
16045
16281
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
16046
|
-
var
|
|
16282
|
+
var import_components54 = require("@transferwise/components");
|
|
16047
16283
|
var import_react_intl31 = require("react-intl");
|
|
16048
16284
|
|
|
16049
16285
|
// src/common/messages/help.messages.ts
|
|
@@ -16061,10 +16297,10 @@ var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
|
16061
16297
|
function Help2(props) {
|
|
16062
16298
|
const intl = (0, import_react_intl31.useIntl)();
|
|
16063
16299
|
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16064
|
-
|
|
16300
|
+
import_components54.Info,
|
|
16065
16301
|
{
|
|
16066
16302
|
className: "m-l-1",
|
|
16067
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16303
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_components54.Markdown, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
|
|
16068
16304
|
presentation: "POPOVER",
|
|
16069
16305
|
size: "sm",
|
|
16070
16306
|
"aria-label": intl.formatMessage(help_messages_default2.helpAria)
|
|
@@ -16078,7 +16314,7 @@ var import_react40 = require("react");
|
|
|
16078
16314
|
var import_react_intl32 = require("react-intl");
|
|
16079
16315
|
|
|
16080
16316
|
// src/legacy/formControl/FormControl.tsx
|
|
16081
|
-
var
|
|
16317
|
+
var import_components55 = require("@transferwise/components");
|
|
16082
16318
|
var import_react39 = require("react");
|
|
16083
16319
|
|
|
16084
16320
|
// src/legacy/formControl/utils/value-utils.ts
|
|
@@ -16356,7 +16592,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16356
16592
|
switch (type) {
|
|
16357
16593
|
case FormControlType.RADIO:
|
|
16358
16594
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16359
|
-
|
|
16595
|
+
import_components55.RadioGroup,
|
|
16360
16596
|
{
|
|
16361
16597
|
radios: options.map(this.mapOption),
|
|
16362
16598
|
name,
|
|
@@ -16372,7 +16608,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16372
16608
|
);
|
|
16373
16609
|
case FormControlType.CHECKBOX:
|
|
16374
16610
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16375
|
-
|
|
16611
|
+
import_components55.Checkbox,
|
|
16376
16612
|
{
|
|
16377
16613
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
16378
16614
|
disabled,
|
|
@@ -16390,7 +16626,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16390
16626
|
const items = options;
|
|
16391
16627
|
const selected = this.getSelectedOption(options);
|
|
16392
16628
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "d-flex flex-column", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16393
|
-
|
|
16629
|
+
import_components55.SelectInput,
|
|
16394
16630
|
{
|
|
16395
16631
|
id,
|
|
16396
16632
|
UNSAFE_triggerButtonProps: {
|
|
@@ -16406,7 +16642,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16406
16642
|
})),
|
|
16407
16643
|
value: selected != null ? selected : null,
|
|
16408
16644
|
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16409
|
-
|
|
16645
|
+
import_components55.SelectInputOptionContent,
|
|
16410
16646
|
{
|
|
16411
16647
|
title: label2,
|
|
16412
16648
|
note: withinTrigger ? note != null ? note : secondary : note,
|
|
@@ -16435,7 +16671,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16435
16671
|
}
|
|
16436
16672
|
case FormControlType.TAB:
|
|
16437
16673
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16438
|
-
|
|
16674
|
+
import_components55.Tabs,
|
|
16439
16675
|
{
|
|
16440
16676
|
selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
|
|
16441
16677
|
tabs: options.map((option) => ({
|
|
@@ -16520,7 +16756,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16520
16756
|
case FormControlType.DATE:
|
|
16521
16757
|
case FormControlType.DATETIME:
|
|
16522
16758
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16523
|
-
|
|
16759
|
+
import_components55.DateInput,
|
|
16524
16760
|
{
|
|
16525
16761
|
"aria-labelledby": labelledBy,
|
|
16526
16762
|
dayAutoComplete: this.getAutocompleteValue({ suffix: "-day" }),
|
|
@@ -16537,7 +16773,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16537
16773
|
);
|
|
16538
16774
|
case FormControlType.DATELOOKUP: {
|
|
16539
16775
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16540
|
-
|
|
16776
|
+
import_components55.DateLookup,
|
|
16541
16777
|
{
|
|
16542
16778
|
value: getSafeDateStringValue(value),
|
|
16543
16779
|
min: minDate,
|
|
@@ -16555,7 +16791,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16555
16791
|
}
|
|
16556
16792
|
case FormControlType.TEL:
|
|
16557
16793
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16558
|
-
|
|
16794
|
+
import_components55.PhoneNumberInput,
|
|
16559
16795
|
{
|
|
16560
16796
|
disabled,
|
|
16561
16797
|
countryCode,
|
|
@@ -16587,7 +16823,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16587
16823
|
};
|
|
16588
16824
|
if (this.props.displayPattern) {
|
|
16589
16825
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16590
|
-
|
|
16826
|
+
import_components55.TextareaWithDisplayFormat,
|
|
16591
16827
|
__spreadProps(__spreadValues({
|
|
16592
16828
|
displayPattern: this.props.displayPattern
|
|
16593
16829
|
}, textareaProps), {
|
|
@@ -16606,7 +16842,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16606
16842
|
case FormControlType.FILE:
|
|
16607
16843
|
case FormControlType.UPLOAD: {
|
|
16608
16844
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16609
|
-
|
|
16845
|
+
import_components55.Upload,
|
|
16610
16846
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
16611
16847
|
usAccept: uploadProps.usAccept || "*",
|
|
16612
16848
|
usDisabled: uploadProps.usDisabled || disabled,
|
|
@@ -16643,7 +16879,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
16643
16879
|
};
|
|
16644
16880
|
if (this.props.displayPattern) {
|
|
16645
16881
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16646
|
-
|
|
16882
|
+
import_components55.InputWithDisplayFormat,
|
|
16647
16883
|
__spreadProps(__spreadValues({
|
|
16648
16884
|
displayPattern: this.props.displayPattern
|
|
16649
16885
|
}, inputProps), {
|
|
@@ -16983,7 +17219,7 @@ function getTitleAndHelp(schema, forId, labelId) {
|
|
|
16983
17219
|
schema.title,
|
|
16984
17220
|
" ",
|
|
16985
17221
|
helpElement
|
|
16986
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
17222
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_components56.Header, { title: (_a = schema.title) != null ? _a : "" }) });
|
|
16987
17223
|
return schema.title ? titleElement : helpElement;
|
|
16988
17224
|
}
|
|
16989
17225
|
function getValidations(props, schemaIndex) {
|
|
@@ -17021,7 +17257,7 @@ var import_react43 = require("react");
|
|
|
17021
17257
|
var import_react_intl33 = require("react-intl");
|
|
17022
17258
|
|
|
17023
17259
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
17024
|
-
var
|
|
17260
|
+
var import_components57 = require("@transferwise/components");
|
|
17025
17261
|
var import_react42 = require("react");
|
|
17026
17262
|
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
17027
17263
|
function UploadInputAdapter(props) {
|
|
@@ -17039,7 +17275,7 @@ function UploadInputAdapter(props) {
|
|
|
17039
17275
|
onCancel
|
|
17040
17276
|
} = props;
|
|
17041
17277
|
const onEvent = useEventDispatcher();
|
|
17042
|
-
const files = (0, import_react42.useMemo)(() => fileId ? [{ id: fileId, status:
|
|
17278
|
+
const files = (0, import_react42.useMemo)(() => fileId ? [{ id: fileId, status: import_components57.Status.SUCCEEDED }] : [], [fileId]);
|
|
17043
17279
|
const uploadFile = (formData) => {
|
|
17044
17280
|
onEvent("Dynamic Flow - PersistAsync", { status: "pending", schemaId: id });
|
|
17045
17281
|
return httpClient(String(httpOptions.url), {
|
|
@@ -17059,7 +17295,7 @@ function UploadInputAdapter(props) {
|
|
|
17059
17295
|
});
|
|
17060
17296
|
};
|
|
17061
17297
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
17062
|
-
|
|
17298
|
+
import_components57.UploadInput,
|
|
17063
17299
|
{
|
|
17064
17300
|
id,
|
|
17065
17301
|
fileInputName: httpOptions.fileInputName,
|
|
@@ -17194,7 +17430,7 @@ var getSelectionFromModel = (schema, model) => {
|
|
|
17194
17430
|
};
|
|
17195
17431
|
|
|
17196
17432
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
17197
|
-
var
|
|
17433
|
+
var import_components58 = require("@transferwise/components");
|
|
17198
17434
|
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
17199
17435
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
17200
17436
|
const { id, selection, setSelection } = props;
|
|
@@ -17206,12 +17442,12 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
17206
17442
|
const toggleSelection = () => {
|
|
17207
17443
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
17208
17444
|
};
|
|
17209
|
-
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
17445
|
+
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
17446
|
};
|
|
17211
17447
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
17212
17448
|
|
|
17213
17449
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
17214
|
-
var
|
|
17450
|
+
var import_components59 = require("@transferwise/components");
|
|
17215
17451
|
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
17216
17452
|
function PromotedOneOfRadioControl(props) {
|
|
17217
17453
|
var _a, _b;
|
|
@@ -17232,7 +17468,7 @@ function PromotedOneOfRadioControl(props) {
|
|
|
17232
17468
|
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "form-group", children: [
|
|
17233
17469
|
title && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("label", { className: "control-label", htmlFor: id, children: title }),
|
|
17234
17470
|
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
17235
|
-
|
|
17471
|
+
import_components59.RadioGroup,
|
|
17236
17472
|
{
|
|
17237
17473
|
name: "promoted-selection",
|
|
17238
17474
|
selectedValue: selection,
|
|
@@ -17323,7 +17559,7 @@ function getOtherOneOf(schema) {
|
|
|
17323
17559
|
var PromotedOneOfSchema_default = PromotedOneOfSchema;
|
|
17324
17560
|
|
|
17325
17561
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
17326
|
-
var
|
|
17562
|
+
var import_components60 = require("@transferwise/components");
|
|
17327
17563
|
var import_react_intl35 = require("react-intl");
|
|
17328
17564
|
|
|
17329
17565
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.ts
|
|
@@ -17347,7 +17583,7 @@ function ReadOnlySchema({ schema, model }) {
|
|
|
17347
17583
|
const { title = "" } = schema;
|
|
17348
17584
|
const { formatMessage } = (0, import_react_intl35.useIntl)();
|
|
17349
17585
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
17350
|
-
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
17586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_components60.DefinitionList, { layout: import_components60.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
17351
17587
|
}
|
|
17352
17588
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
17353
17589
|
function getValueForSchema({
|
|
@@ -17571,7 +17807,7 @@ function DynamicForm({
|
|
|
17571
17807
|
var DynamicForm_default = DynamicForm;
|
|
17572
17808
|
|
|
17573
17809
|
// src/legacy/layout/heading/DynamicHeading.tsx
|
|
17574
|
-
var
|
|
17810
|
+
var import_components61 = require("@transferwise/components");
|
|
17575
17811
|
var import_classnames13 = __toESM(require_classnames());
|
|
17576
17812
|
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
17577
17813
|
var DynamicHeading = (props) => {
|
|
@@ -17598,30 +17834,30 @@ var DisplayHeading2 = ({ size, text, classes }) => {
|
|
|
17598
17834
|
switch (size) {
|
|
17599
17835
|
case "xs":
|
|
17600
17836
|
case "sm":
|
|
17601
|
-
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
17837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components61.Display, { type: "display-small", className: classes, children: text });
|
|
17602
17838
|
case "xl":
|
|
17603
17839
|
case "lg":
|
|
17604
|
-
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
17840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components61.Display, { type: "display-large", className: classes, children: text });
|
|
17605
17841
|
case "md":
|
|
17606
17842
|
default:
|
|
17607
|
-
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
17843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components61.Display, { type: "display-medium", className: classes, children: text });
|
|
17608
17844
|
}
|
|
17609
17845
|
};
|
|
17610
17846
|
var DynamicHeading_default = DynamicHeading;
|
|
17611
17847
|
|
|
17612
17848
|
// src/legacy/layout/markdown/DynamicMarkdown.tsx
|
|
17613
|
-
var
|
|
17849
|
+
var import_components62 = require("@transferwise/components");
|
|
17614
17850
|
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
17615
17851
|
var DynamicMarkdown = ({ component }) => {
|
|
17616
17852
|
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)(
|
|
17853
|
+
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
17854
|
};
|
|
17619
17855
|
var DynamicInfo = ({ component }) => {
|
|
17620
|
-
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
17856
|
+
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
17857
|
};
|
|
17622
17858
|
|
|
17623
17859
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
17624
|
-
var
|
|
17860
|
+
var import_components63 = require("@transferwise/components");
|
|
17625
17861
|
var import_react48 = require("react");
|
|
17626
17862
|
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
17627
17863
|
function DynamicImage({ component: image }) {
|
|
@@ -17640,7 +17876,7 @@ function DynamicImage({ component: image }) {
|
|
|
17640
17876
|
if (!imageSource) {
|
|
17641
17877
|
return null;
|
|
17642
17878
|
}
|
|
17643
|
-
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
17879
|
+
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
17880
|
}
|
|
17645
17881
|
var readImageBlobAsDataURL2 = (imageBlob) => (
|
|
17646
17882
|
// we can safely assume the type of reader.result is string
|
|
@@ -17676,7 +17912,7 @@ var getImageSource2 = async (httpClient, imageUrl) => {
|
|
|
17676
17912
|
var DynamicImage_default = DynamicImage;
|
|
17677
17913
|
|
|
17678
17914
|
// src/legacy/layout/instructions/DynamicInstructions.tsx
|
|
17679
|
-
var
|
|
17915
|
+
var import_components64 = require("@transferwise/components");
|
|
17680
17916
|
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
17681
17917
|
var doContext2 = ["positive", "neutral"];
|
|
17682
17918
|
var dontContext2 = ["warning", "negative"];
|
|
@@ -17685,8 +17921,8 @@ var DynamicInstructions = ({ component }) => {
|
|
|
17685
17921
|
const dos = items.filter((item) => doContext2.includes(item.context)).map(({ text }) => text);
|
|
17686
17922
|
const donts = items.filter((item) => dontContext2.includes(item.context)).map(({ text }) => text);
|
|
17687
17923
|
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)(
|
|
17924
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_components64.Header, { title: component.title }) : null,
|
|
17925
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_components64.InstructionsList, { dos, donts })
|
|
17690
17926
|
] });
|
|
17691
17927
|
};
|
|
17692
17928
|
var DynamicInstructions_default = DynamicInstructions;
|
|
@@ -17796,21 +18032,49 @@ function DynamicLayout(props) {
|
|
|
17796
18032
|
var DynamicLayout_default = DynamicLayout;
|
|
17797
18033
|
|
|
17798
18034
|
// src/legacy/layout/list/DynamicStatusList.tsx
|
|
17799
|
-
var
|
|
18035
|
+
var import_components65 = require("@transferwise/components");
|
|
17800
18036
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
17801
|
-
var DynamicStatusList = ({ component }) => {
|
|
18037
|
+
var DynamicStatusList = ({ component, onAction }) => {
|
|
17802
18038
|
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)
|
|
18039
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_components65.Header, { title: component.title }) : null,
|
|
18040
|
+
component.items.map((item) => mapListItemToSummary(item, onAction))
|
|
17805
18041
|
] });
|
|
17806
18042
|
};
|
|
17807
|
-
var mapListItemToSummary = (
|
|
17808
|
-
const
|
|
18043
|
+
var mapListItemToSummary = (props, onAction) => {
|
|
18044
|
+
const { title, description, icon, status } = props;
|
|
18045
|
+
const summaryProps = __spreadValues(__spreadValues({
|
|
17809
18046
|
key: `${title}/${description || ""}`,
|
|
17810
18047
|
title,
|
|
17811
|
-
description
|
|
18048
|
+
description,
|
|
18049
|
+
action: "callToAction" in props ? callToActionToSummaryAction(props == null ? void 0 : props.callToAction, onAction) : void 0
|
|
17812
18050
|
}, (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)(
|
|
18051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_components65.Summary, __spreadValues({}, summaryProps));
|
|
18052
|
+
};
|
|
18053
|
+
var callToActionToSummaryAction = (callToAction, onAction) => {
|
|
18054
|
+
if (!callToAction) {
|
|
18055
|
+
return void 0;
|
|
18056
|
+
}
|
|
18057
|
+
const { accessibilityDescription, behavior, title } = callToAction;
|
|
18058
|
+
if (behavior.link) {
|
|
18059
|
+
const { link } = behavior;
|
|
18060
|
+
return {
|
|
18061
|
+
text: title,
|
|
18062
|
+
"aria-label": accessibilityDescription,
|
|
18063
|
+
href: link.url,
|
|
18064
|
+
target: "_blank"
|
|
18065
|
+
};
|
|
18066
|
+
}
|
|
18067
|
+
if (behavior.action) {
|
|
18068
|
+
const { action } = behavior;
|
|
18069
|
+
return {
|
|
18070
|
+
text: title,
|
|
18071
|
+
"aria-label": accessibilityDescription,
|
|
18072
|
+
onClick: () => {
|
|
18073
|
+
onAction(action);
|
|
18074
|
+
}
|
|
18075
|
+
};
|
|
18076
|
+
}
|
|
18077
|
+
return void 0;
|
|
17814
18078
|
};
|
|
17815
18079
|
var statusListMap = {
|
|
17816
18080
|
done: "done",
|
|
@@ -17826,12 +18090,12 @@ var statusMap = __spreadValues(__spreadValues({}, statusListMap), legacyStatusMa
|
|
|
17826
18090
|
var DynamicStatusList_default = DynamicStatusList;
|
|
17827
18091
|
|
|
17828
18092
|
// src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
17829
|
-
var
|
|
18093
|
+
var import_components66 = require("@transferwise/components");
|
|
17830
18094
|
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
17831
18095
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
17832
18096
|
const { margin = "md", size = "md" } = component;
|
|
17833
18097
|
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
17834
|
-
|
|
18098
|
+
import_components66.Loader,
|
|
17835
18099
|
{
|
|
17836
18100
|
size,
|
|
17837
18101
|
classNames: {
|
|
@@ -17844,7 +18108,7 @@ var DynamicLoadingIndicator = ({ component }) => {
|
|
|
17844
18108
|
var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
|
|
17845
18109
|
|
|
17846
18110
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
17847
|
-
var
|
|
18111
|
+
var import_components68 = require("@transferwise/components");
|
|
17848
18112
|
var import_react_intl37 = require("react-intl");
|
|
17849
18113
|
|
|
17850
18114
|
// src/common/messages/paragraph.messages.ts
|
|
@@ -17863,10 +18127,10 @@ var paragraph_messages_default2 = (0, import_react_intl36.defineMessages)({
|
|
|
17863
18127
|
});
|
|
17864
18128
|
|
|
17865
18129
|
// src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
|
|
17866
|
-
var
|
|
18130
|
+
var import_components67 = require("@transferwise/components");
|
|
17867
18131
|
var import_react49 = require("react");
|
|
17868
18132
|
function useSnackBarIfAvailable2() {
|
|
17869
|
-
const context = (0, import_react49.useContext)(
|
|
18133
|
+
const context = (0, import_react49.useContext)(import_components67.SnackbarContext);
|
|
17870
18134
|
return context ? context.createSnackbar : noop3;
|
|
17871
18135
|
}
|
|
17872
18136
|
function noop3() {
|
|
@@ -17903,7 +18167,7 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
17903
18167
|
style: { textOverflow: "ellipsis" }
|
|
17904
18168
|
}
|
|
17905
18169
|
),
|
|
17906
|
-
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
18170
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_components68.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default2.copy) })
|
|
17907
18171
|
] });
|
|
17908
18172
|
}
|
|
17909
18173
|
function noop4() {
|
|
@@ -17911,7 +18175,7 @@ function noop4() {
|
|
|
17911
18175
|
var DynamicParagraph_default = DynamicParagraph;
|
|
17912
18176
|
|
|
17913
18177
|
// src/legacy/layout/review/DynamicReview.tsx
|
|
17914
|
-
var
|
|
18178
|
+
var import_components69 = require("@transferwise/components");
|
|
17915
18179
|
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
17916
18180
|
var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
|
|
17917
18181
|
key: String(index),
|
|
@@ -17965,8 +18229,8 @@ function DynamicReview(props) {
|
|
|
17965
18229
|
const callToAction = review.callToAction ? getReviewAction2(review.callToAction.title, review.callToAction.action) : null;
|
|
17966
18230
|
const legacyCallToAction = !callToAction && review.action ? getReviewAction2(review.action.title || "", review.action) : null;
|
|
17967
18231
|
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)(
|
|
18232
|
+
review.title && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_components69.Header, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
|
|
18233
|
+
/* @__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
18234
|
] });
|
|
17971
18235
|
}
|
|
17972
18236
|
var DynamicReview_default = DynamicReview;
|
|
@@ -17976,13 +18240,13 @@ var import_react51 = require("react");
|
|
|
17976
18240
|
var import_icons5 = require("@transferwise/icons");
|
|
17977
18241
|
|
|
17978
18242
|
// src/legacy/layout/search/SearchInput.tsx
|
|
17979
|
-
var
|
|
18243
|
+
var import_components70 = require("@transferwise/components");
|
|
17980
18244
|
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
17981
18245
|
var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
17982
18246
|
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("label", { className: "control-label d-inline", children: [
|
|
17983
18247
|
title,
|
|
17984
18248
|
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
17985
|
-
|
|
18249
|
+
import_components70.Input,
|
|
17986
18250
|
{
|
|
17987
18251
|
type: "text",
|
|
17988
18252
|
value,
|
|
@@ -17995,15 +18259,15 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
17995
18259
|
};
|
|
17996
18260
|
|
|
17997
18261
|
// src/legacy/layout/search/SearchResults.tsx
|
|
17998
|
-
var
|
|
18262
|
+
var import_components71 = require("@transferwise/components");
|
|
17999
18263
|
var import_react_intl38 = require("react-intl");
|
|
18000
18264
|
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
18001
18265
|
function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
18002
18266
|
if (results.length === 0) {
|
|
18003
18267
|
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("p", { className: "m-t-2", children: emptyMessage });
|
|
18004
18268
|
}
|
|
18005
|
-
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
18006
|
-
|
|
18269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_components71.NavigationOptionsList, { children: results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
18270
|
+
import_components71.NavigationOption,
|
|
18007
18271
|
{
|
|
18008
18272
|
title: result.title,
|
|
18009
18273
|
content: result.description,
|
|
@@ -18104,7 +18368,7 @@ var addQueryParameter2 = (url, key, value) => {
|
|
|
18104
18368
|
};
|
|
18105
18369
|
|
|
18106
18370
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
18107
|
-
var
|
|
18371
|
+
var import_components72 = require("@transferwise/components");
|
|
18108
18372
|
var import_classnames14 = __toESM(require_classnames());
|
|
18109
18373
|
var import_react_intl39 = require("react-intl");
|
|
18110
18374
|
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
@@ -18147,7 +18411,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
18147
18411
|
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
18412
|
title,
|
|
18149
18413
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "m-t-1", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
18150
|
-
|
|
18414
|
+
import_components72.Typeahead,
|
|
18151
18415
|
{
|
|
18152
18416
|
id: "typeahead-input-id",
|
|
18153
18417
|
intl,
|
|
@@ -18203,7 +18467,7 @@ function TypeaheadFooter2({
|
|
|
18203
18467
|
emptyMessage
|
|
18204
18468
|
}) {
|
|
18205
18469
|
if (state === "success" && results.length === 0) {
|
|
18206
|
-
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
18470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_components72.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
|
|
18207
18471
|
}
|
|
18208
18472
|
if (state === "error" && results.length === 0) {
|
|
18209
18473
|
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(ErrorResult2, { onRetrySearch }) });
|
|
@@ -18216,7 +18480,7 @@ function TypeaheadFooter2({
|
|
|
18216
18480
|
var DynamicSearch_default = DynamicSearch;
|
|
18217
18481
|
|
|
18218
18482
|
// src/legacy/layout/modal/DynamicModal.tsx
|
|
18219
|
-
var
|
|
18483
|
+
var import_components73 = require("@transferwise/components");
|
|
18220
18484
|
var import_react52 = require("react");
|
|
18221
18485
|
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
18222
18486
|
function DynamicModal(props) {
|
|
@@ -18224,9 +18488,9 @@ function DynamicModal(props) {
|
|
|
18224
18488
|
const { component, onAction } = props;
|
|
18225
18489
|
const { margin = "md" } = component;
|
|
18226
18490
|
return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
|
|
18227
|
-
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
18491
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_components73.Button, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
|
|
18228
18492
|
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
18229
|
-
|
|
18493
|
+
import_components73.Modal,
|
|
18230
18494
|
{
|
|
18231
18495
|
scroll: "content",
|
|
18232
18496
|
open: visible,
|
|
@@ -18777,7 +19041,7 @@ var CameraCapture_messages_default = (0, import_react_intl42.defineMessages)({
|
|
|
18777
19041
|
});
|
|
18778
19042
|
|
|
18779
19043
|
// src/common/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
18780
|
-
var
|
|
19044
|
+
var import_components74 = require("@transferwise/components");
|
|
18781
19045
|
var import_react_intl43 = require("react-intl");
|
|
18782
19046
|
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
18783
19047
|
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(CaptureButton, { onClick: onCapture }) });
|
|
@@ -18788,24 +19052,24 @@ var ReviewBottomBar = ({
|
|
|
18788
19052
|
const intl = (0, import_react_intl43.useIntl)();
|
|
18789
19053
|
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
19054
|
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
18791
|
-
|
|
19055
|
+
import_components74.Button,
|
|
18792
19056
|
{
|
|
18793
19057
|
className: "m-b-1",
|
|
18794
19058
|
block: true,
|
|
18795
|
-
size:
|
|
18796
|
-
type:
|
|
19059
|
+
size: import_components74.Size.MEDIUM,
|
|
19060
|
+
type: import_components74.ControlType.ACCENT,
|
|
18797
19061
|
onClick: onSubmit,
|
|
18798
19062
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
18799
19063
|
}
|
|
18800
19064
|
),
|
|
18801
19065
|
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
18802
|
-
|
|
19066
|
+
import_components74.Button,
|
|
18803
19067
|
{
|
|
18804
19068
|
className: "m-b-2",
|
|
18805
19069
|
block: true,
|
|
18806
|
-
size:
|
|
18807
|
-
type:
|
|
18808
|
-
priority:
|
|
19070
|
+
size: import_components74.Size.MEDIUM,
|
|
19071
|
+
type: import_components74.ControlType.ACCENT,
|
|
19072
|
+
priority: import_components74.Priority.SECONDARY,
|
|
18809
19073
|
onClick: onRetry,
|
|
18810
19074
|
children: intl.formatMessage(CameraCapture_messages_default.reviewRetry)
|
|
18811
19075
|
}
|
|
@@ -19090,13 +19354,13 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
19090
19354
|
var Overlay_default = Overlay;
|
|
19091
19355
|
|
|
19092
19356
|
// src/common/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
19093
|
-
var
|
|
19357
|
+
var import_components75 = require("@transferwise/components");
|
|
19094
19358
|
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
19095
19359
|
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
19096
19360
|
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
19361
|
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
19098
19362
|
/* @__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)(
|
|
19363
|
+
onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_components75.Button, { block: true, onClick: onAction, children: actionButton })
|
|
19100
19364
|
] }) }) });
|
|
19101
19365
|
}
|
|
19102
19366
|
var CameraErrorScreen_default = CameraErrorScreen;
|
|
@@ -19450,7 +19714,7 @@ function getOrigin2(url) {
|
|
|
19450
19714
|
}
|
|
19451
19715
|
|
|
19452
19716
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
19453
|
-
var
|
|
19717
|
+
var import_components77 = require("@transferwise/components");
|
|
19454
19718
|
var import_icons6 = require("@transferwise/icons");
|
|
19455
19719
|
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
19456
19720
|
function BackButton2({ title, action, onAction }) {
|
|
@@ -19466,7 +19730,7 @@ function BackButton2({ title, action, onAction }) {
|
|
|
19466
19730
|
},
|
|
19467
19731
|
children: [
|
|
19468
19732
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "sr-only", children: title }),
|
|
19469
|
-
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
19733
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_components77.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_icons6.ArrowLeft, { size: "24" }) })
|
|
19470
19734
|
]
|
|
19471
19735
|
}
|
|
19472
19736
|
) });
|
|
@@ -19643,19 +19907,19 @@ var getSchemaReference = (component) => {
|
|
|
19643
19907
|
var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object" && !Object.hasOwnProperty.call(schema, "$ref");
|
|
19644
19908
|
|
|
19645
19909
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
19646
|
-
var
|
|
19910
|
+
var import_components78 = require("@transferwise/components");
|
|
19647
19911
|
var import_react66 = require("react");
|
|
19648
19912
|
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
19649
19913
|
function useLoader(loaderConfig, initialState) {
|
|
19650
19914
|
const config = __spreadValues({
|
|
19651
|
-
size:
|
|
19915
|
+
size: import_components78.Size.EXTRA_LARGE,
|
|
19652
19916
|
initial: true,
|
|
19653
19917
|
submission: false
|
|
19654
19918
|
}, loaderConfig);
|
|
19655
19919
|
const [loadingState, setLoadingState] = (0, import_react66.useState)(initialState);
|
|
19656
19920
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
19657
19921
|
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
19658
|
-
|
|
19922
|
+
import_components78.Loader,
|
|
19659
19923
|
{
|
|
19660
19924
|
size: config.size,
|
|
19661
19925
|
classNames: { "tw-loader": "tw-loader m-x-auto" },
|