@wise/dynamic-flow-client 4.4.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/i18n/th.json +6 -6
- package/build/main.js +220 -107
- package/build/main.mjs +220 -107
- package/build/types/revamp/domain/components/DecisionComponent.d.ts +4 -1
- package/build/types/revamp/domain/components/ListComponent.d.ts +5 -4
- package/build/types/revamp/domain/components/ReviewComponent.d.ts +8 -8
- package/build/types/revamp/domain/components/RootDomainComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/step/ExternalConfirmationComponent.d.ts +12 -0
- package/build/types/revamp/domain/components/{StepDomainComponent.d.ts → step/StepDomainComponent.d.ts} +8 -7
- package/build/types/revamp/domain/mappers/layout/deprecatedListLayoutToComponent.d.ts +1 -0
- package/build/types/revamp/domain/mappers/mapStepToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/utils/legacy-utils.d.ts +3 -3
- package/build/types/revamp/domain/mappers/utils/utils.d.ts +4 -0
- package/build/types/revamp/domain/types.d.ts +16 -2
- package/build/types/revamp/renderers/mappers/externalComponentToProps.d.ts +4 -0
- package/build/types/revamp/renderers/stepComponentToProps.d.ts +1 -1
- package/package.json +5 -5
package/build/main.mjs
CHANGED
|
@@ -701,21 +701,21 @@ var th_default = {
|
|
|
701
701
|
"dynamicFlows.CameraCapture.CameraConnectionIssue.action": "\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
|
|
702
702
|
"dynamicFlows.CameraCapture.CameraConnectionIssue.paragraph": "\u0E42\u0E1B\u0E23\u0E14\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E01\u0E32\u0E23\u0E40\u0E0A\u0E37\u0E48\u0E2D\u0E21\u0E15\u0E48\u0E2D\u0E43\u0E2B\u0E21\u0E48\u0E41\u0E25\u0E49\u0E27\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
|
|
703
703
|
"dynamicFlows.CameraCapture.CameraConnectionIssue.title": "\u0E40\u0E23\u0E32\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E40\u0E02\u0E49\u0E32\u0E16\u0E36\u0E07\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E44\u0E14\u0E49",
|
|
704
|
-
"dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "\u0E40\u0E1A\u0E23\u0E32\u0E27\u0E4C\u0E40\u0E0B\u0E2D\u0E23\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E43\u0E0A\u0E49\u0E44\u0E21\u0E48\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E01\u0E25\u0E49\u0E2D\u0E07 \u0E43\u0E2B\u0E49\u0E25\u0E2D\u0E07\u0E43\u0E0A\u0E49\u0E40\u0E1A\u0E23\u0E32\u0E27\u0E4C\u0E40\u0E0B\u0E2D\u0E23\u0E4C\u0E41\u0E25\u0E30\u0E2D\u0E38\u0E1B\u0E01\u0E23\u0E13\u0E4C\u0E2D\u0E37\u0E48\u0E19 \u0E2B\u0E23\u0E37\u0E2D\u0E14\u0E32\u0E27\u0E19\u0E4C\u0E42\u0E2B\u0E25\u0E14\u0E41\u0E2D\u0E1B\u0E21\u0E37\u0E2D\u0E16\u0E37\u0E2D\u0E02\u0E2D\u0E07\u0E40\u0E23\u0E32
|
|
704
|
+
"dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "\u0E40\u0E1A\u0E23\u0E32\u0E27\u0E4C\u0E40\u0E0B\u0E2D\u0E23\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E43\u0E0A\u0E49\u0E44\u0E21\u0E48\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E01\u0E25\u0E49\u0E2D\u0E07 \u0E43\u0E2B\u0E49\u0E25\u0E2D\u0E07\u0E43\u0E0A\u0E49\u0E40\u0E1A\u0E23\u0E32\u0E27\u0E4C\u0E40\u0E0B\u0E2D\u0E23\u0E4C\u0E41\u0E25\u0E30\u0E2D\u0E38\u0E1B\u0E01\u0E23\u0E13\u0E4C\u0E2D\u0E37\u0E48\u0E19 \u0E2B\u0E23\u0E37\u0E2D\u0E14\u0E32\u0E27\u0E19\u0E4C\u0E42\u0E2B\u0E25\u0E14\u0E41\u0E2D\u0E1B\u0E21\u0E37\u0E2D\u0E16\u0E37\u0E2D\u0E02\u0E2D\u0E07\u0E40\u0E23\u0E32",
|
|
705
705
|
"dynamicFlows.CameraCapture.CameraNotSupported.title": "\u0E44\u0E21\u0E48\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E01\u0E25\u0E49\u0E2D\u0E07",
|
|
706
706
|
"dynamicFlows.CameraCapture.NoCameraAccess.action": "\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E0A\u0E49\u0E01\u0E32\u0E23\u0E40\u0E02\u0E49\u0E32\u0E16\u0E36\u0E07\u0E01\u0E25\u0E49\u0E2D\u0E07",
|
|
707
707
|
"dynamicFlows.CameraCapture.NoCameraAccess.paragraph": "\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19\u0E01\u0E32\u0E23\u0E40\u0E02\u0E49\u0E32\u0E16\u0E36\u0E07\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E43\u0E19\u0E01\u0E32\u0E23\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32\u0E40\u0E1A\u0E23\u0E32\u0E27\u0E4C\u0E40\u0E0B\u0E2D\u0E23\u0E4C\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E43\u0E2B\u0E21\u0E48\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
|
|
708
708
|
"dynamicFlows.CameraCapture.NoCameraAccess.title": "\u0E40\u0E23\u0E32\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E40\u0E02\u0E49\u0E32\u0E16\u0E36\u0E07\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E44\u0E14\u0E49",
|
|
709
709
|
"dynamicFlows.CameraCapture.reviewInstructions": "\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E0A\u0E31\u0E14\u0E40\u0E08\u0E19 \u0E2D\u0E48\u0E32\u0E19\u0E44\u0E14\u0E49 \u0E41\u0E25\u0E30\u0E04\u0E23\u0E1A\u0E16\u0E49\u0E27\u0E19\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48",
|
|
710
|
-
"dynamicFlows.CameraCapture.reviewRetry": "\u0E44\u0E21\u0E48 \u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\
|
|
710
|
+
"dynamicFlows.CameraCapture.reviewRetry": "\u0E44\u0E21\u0E48 \u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
|
|
711
711
|
"dynamicFlows.CameraCapture.reviewSubmit": "\u0E43\u0E0A\u0E48 \u0E2A\u0E48\u0E07\u0E40\u0E25\u0E22",
|
|
712
712
|
"dynamicFlows.CameraCapture.rotatePhone.text": "\u0E2B\u0E21\u0E38\u0E19\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E43\u0E2B\u0E49\u0E40\u0E1B\u0E47\u0E19\u0E21\u0E38\u0E21\u0E41\u0E19\u0E27\u0E15\u0E31\u0E49\u0E07\u0E41\u0E25\u0E49\u0E27\u0E16\u0E48\u0E32\u0E22\u0E23\u0E39\u0E1B",
|
|
713
|
-
"dynamicFlows.ControlFeedback.maxLength": "\u0E42\u0E1B\u0E23\u0E14\u0E1B\u0E49\u0E2D\u0E19 {maxLength} \u0E2D\u0E31\u0E01\
|
|
713
|
+
"dynamicFlows.ControlFeedback.maxLength": "\u0E42\u0E1B\u0E23\u0E14\u0E1B\u0E49\u0E2D\u0E19 {maxLength} \u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E2B\u0E23\u0E37\u0E2D\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E19\u0E31\u0E49\u0E19",
|
|
714
714
|
"dynamicFlows.ControlFeedback.maximum": "\u0E42\u0E1B\u0E23\u0E14\u0E1B\u0E49\u0E2D\u0E19\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 {maximum} \u0E2B\u0E23\u0E37\u0E2D\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",
|
|
715
|
-
"dynamicFlows.ControlFeedback.maximumDate": "\u0E42\u0E1B\u0E23\u0E14\
|
|
716
|
-
"dynamicFlows.ControlFeedback.minLength": "\u0E42\u0E1B\u0E23\u0E14\u0E1B\u0E49\u0E2D\u0E19\u0E2D\u0E31\u0E01\
|
|
715
|
+
"dynamicFlows.ControlFeedback.maximumDate": "\u0E42\u0E1B\u0E23\u0E14\u0E43\u0E2A\u0E48\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E1B\u0E47\u0E19 {maximum} \u0E2B\u0E23\u0E37\u0E2D\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32\u0E19\u0E31\u0E49\u0E19",
|
|
716
|
+
"dynamicFlows.ControlFeedback.minLength": "\u0E42\u0E1B\u0E23\u0E14\u0E1B\u0E49\u0E2D\u0E19\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 {minLength} \u0E15\u0E31\u0E27",
|
|
717
717
|
"dynamicFlows.ControlFeedback.minimum": "\u0E42\u0E1B\u0E23\u0E14\u0E1B\u0E49\u0E2D\u0E19\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 {minimum} \u0E2B\u0E23\u0E37\u0E2D\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",
|
|
718
|
-
"dynamicFlows.ControlFeedback.minimumDate": "\u0E42\u0E1B\u0E23\u0E14\
|
|
718
|
+
"dynamicFlows.ControlFeedback.minimumDate": "\u0E42\u0E1B\u0E23\u0E14\u0E43\u0E2A\u0E48\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E1B\u0E47\u0E19 {minimum} \u0E2B\u0E23\u0E37\u0E2D\u0E2B\u0E25\u0E31\u0E07\u0E08\u0E32\u0E01\u0E19\u0E31\u0E49\u0E19",
|
|
719
719
|
"dynamicFlows.ControlFeedback.pattern": "\u0E42\u0E1B\u0E23\u0E14\u0E43\u0E2A\u0E48\u0E43\u0E19\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
720
720
|
"dynamicFlows.ControlFeedback.patternDate": "\u0E42\u0E1B\u0E23\u0E14\u0E1B\u0E49\u0E2D\u0E19\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E43\u0E19\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
721
721
|
"dynamicFlows.ControlFeedback.required": "\u0E42\u0E1B\u0E23\u0E14\u0E43\u0E2A\u0E48\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E43\u0E19\u0E0A\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49",
|
|
@@ -1074,6 +1074,7 @@ function getChildren(node) {
|
|
|
1074
1074
|
case "status-list":
|
|
1075
1075
|
case "input-text":
|
|
1076
1076
|
case "input-upload":
|
|
1077
|
+
case "external-confirmation":
|
|
1077
1078
|
return [];
|
|
1078
1079
|
}
|
|
1079
1080
|
}
|
|
@@ -1496,7 +1497,10 @@ var repeatableComponentToProps = (component, rendererMapperProps) => {
|
|
|
1496
1497
|
};
|
|
1497
1498
|
|
|
1498
1499
|
// src/revamp/renderers/mappers/reviewComponentToProps.ts
|
|
1499
|
-
var reviewComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "type", "callToAction", "control", "
|
|
1500
|
+
var reviewComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "type", "callToAction", "control", "margin", "title")), {
|
|
1501
|
+
fields: component.fields.map(mapField)
|
|
1502
|
+
}), rendererMapperProps);
|
|
1503
|
+
var mapField = (field) => __spreadValues({}, field);
|
|
1500
1504
|
|
|
1501
1505
|
// src/revamp/domain/mappers/utils/image.ts
|
|
1502
1506
|
var mapSpecImage = (image) => {
|
|
@@ -1632,11 +1636,17 @@ var tupleComponentToProps = (component, rendererMapperProps) => {
|
|
|
1632
1636
|
|
|
1633
1637
|
// src/revamp/renderers/mappers/listComponentToProps.ts
|
|
1634
1638
|
var listComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "type", "callToAction", "control", "margin", "title")), rendererMapperProps), {
|
|
1635
|
-
items: component.items.map(
|
|
1636
|
-
var item = __objRest(_a, []);
|
|
1637
|
-
return __spreadValues({}, item);
|
|
1638
|
-
})
|
|
1639
|
+
items: component.items.map(mapItem)
|
|
1639
1640
|
});
|
|
1641
|
+
var mapItem = (item) => {
|
|
1642
|
+
var _a, _b;
|
|
1643
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
1644
|
+
// populate deprecated fields
|
|
1645
|
+
subtitle: item.description,
|
|
1646
|
+
value: (_a = item.supportingValues) == null ? void 0 : _a.value,
|
|
1647
|
+
subvalue: (_b = item.supportingValues) == null ? void 0 : _b.subvalue
|
|
1648
|
+
});
|
|
1649
|
+
};
|
|
1640
1650
|
|
|
1641
1651
|
// src/revamp/renderers/stepComponentToProps.ts
|
|
1642
1652
|
var stepComponentToProps = (component, rendererMapperProps) => {
|
|
@@ -1646,7 +1656,6 @@ var stepComponentToProps = (component, rendererMapperProps) => {
|
|
|
1646
1656
|
control,
|
|
1647
1657
|
description,
|
|
1648
1658
|
error,
|
|
1649
|
-
external,
|
|
1650
1659
|
loadingState,
|
|
1651
1660
|
step,
|
|
1652
1661
|
title,
|
|
@@ -1661,7 +1670,6 @@ var stepComponentToProps = (component, rendererMapperProps) => {
|
|
|
1661
1670
|
control,
|
|
1662
1671
|
description,
|
|
1663
1672
|
error,
|
|
1664
|
-
external,
|
|
1665
1673
|
loadingState,
|
|
1666
1674
|
step,
|
|
1667
1675
|
title,
|
|
@@ -1676,12 +1684,12 @@ var stepComponentToProps = (component, rendererMapperProps) => {
|
|
|
1676
1684
|
// src/revamp/renderers/mappers/rootComponentToProps.ts
|
|
1677
1685
|
var rootComponentToProps = (rootComponent, rendererMapperProps) => {
|
|
1678
1686
|
const childrenProps = rootComponent.getChildren().map((child) => componentToRendererProps(child, rendererMapperProps));
|
|
1679
|
-
return {
|
|
1687
|
+
return __spreadValues({
|
|
1680
1688
|
type: "root",
|
|
1681
1689
|
uid: rootComponent.uid,
|
|
1682
1690
|
children: childrenProps.map(rendererMapperProps.render),
|
|
1683
1691
|
childrenProps
|
|
1684
|
-
};
|
|
1692
|
+
}, rendererMapperProps);
|
|
1685
1693
|
};
|
|
1686
1694
|
|
|
1687
1695
|
// src/revamp/renderers/mappers/modalContentComponentToProps.ts
|
|
@@ -1699,6 +1707,19 @@ var modalContentComponentToProps = (component, rendererMapperProps) => {
|
|
|
1699
1707
|
}, rendererMapperProps);
|
|
1700
1708
|
};
|
|
1701
1709
|
|
|
1710
|
+
// src/revamp/renderers/mappers/externalComponentToProps.ts
|
|
1711
|
+
var externalComponentToProps = (component, rendererMapperProps) => {
|
|
1712
|
+
return __spreadValues({
|
|
1713
|
+
type: "external-confirmation",
|
|
1714
|
+
uid: component.uid,
|
|
1715
|
+
url: component.url,
|
|
1716
|
+
status: component.status,
|
|
1717
|
+
onSuccess: component.onSuccess.bind(component),
|
|
1718
|
+
onFailure: component.onFailure.bind(component),
|
|
1719
|
+
onCancel: component.onCancel.bind(component)
|
|
1720
|
+
}, rendererMapperProps);
|
|
1721
|
+
};
|
|
1722
|
+
|
|
1702
1723
|
// src/revamp/renderers/mappers/componentToRendererProps.ts
|
|
1703
1724
|
var componentToRendererProps = (component, rendererMapperProps) => {
|
|
1704
1725
|
if (isHiddenComponent(component)) {
|
|
@@ -1729,6 +1750,8 @@ var componentToRendererProps = (component, rendererMapperProps) => {
|
|
|
1729
1750
|
return decisionComponentToProps(component, rendererMapperProps);
|
|
1730
1751
|
case "divider":
|
|
1731
1752
|
return dividerComponentToProps(component, rendererMapperProps);
|
|
1753
|
+
case "external-confirmation":
|
|
1754
|
+
return externalComponentToProps(component, rendererMapperProps);
|
|
1732
1755
|
case "form":
|
|
1733
1756
|
return formComponentToProps(component, rendererMapperProps);
|
|
1734
1757
|
case "heading":
|
|
@@ -1892,6 +1915,40 @@ var createRootDomainComponent = (updateComponent) => {
|
|
|
1892
1915
|
return rootComponent;
|
|
1893
1916
|
};
|
|
1894
1917
|
|
|
1918
|
+
// src/revamp/domain/components/step/ExternalConfirmationComponent.ts
|
|
1919
|
+
var createExternalConfirmation = (uid, url, updateComponent) => {
|
|
1920
|
+
const update = getInputUpdateFunction(updateComponent);
|
|
1921
|
+
return {
|
|
1922
|
+
type: "external-confirmation",
|
|
1923
|
+
uid,
|
|
1924
|
+
url,
|
|
1925
|
+
status: "initial",
|
|
1926
|
+
onSuccess() {
|
|
1927
|
+
update(this, (draft) => {
|
|
1928
|
+
draft.status = "success";
|
|
1929
|
+
});
|
|
1930
|
+
},
|
|
1931
|
+
onFailure() {
|
|
1932
|
+
if (this.status === "initial") {
|
|
1933
|
+
update(this, (draft) => {
|
|
1934
|
+
draft.status = "failure";
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
},
|
|
1938
|
+
onCancel() {
|
|
1939
|
+
update(this, (draft) => {
|
|
1940
|
+
draft.status = "dismissed";
|
|
1941
|
+
});
|
|
1942
|
+
},
|
|
1943
|
+
getSubmittableValue: async () => null,
|
|
1944
|
+
getSubmittableValueSync: () => null,
|
|
1945
|
+
getLocalValue: () => null,
|
|
1946
|
+
getSummary: () => ({}),
|
|
1947
|
+
// Noop
|
|
1948
|
+
validate: () => true
|
|
1949
|
+
};
|
|
1950
|
+
};
|
|
1951
|
+
|
|
1895
1952
|
// src/revamp/domain/features/summary/summary-utils.ts
|
|
1896
1953
|
var getSummariser = (schema) => (value) => {
|
|
1897
1954
|
const { summary, icon, image } = schema;
|
|
@@ -1932,7 +1989,7 @@ var summaryIfProvides = (summary, { value, icon, image }) => {
|
|
|
1932
1989
|
var validateComponents = (components) => components.reduce((acc, component) => component.validate() && acc, true);
|
|
1933
1990
|
var getLocalValueValidator = (checks) => (currentValue) => checks.map((check) => check(currentValue)).filter(isString);
|
|
1934
1991
|
|
|
1935
|
-
// src/revamp/domain/components/StepDomainComponent.ts
|
|
1992
|
+
// src/revamp/domain/components/step/StepDomainComponent.ts
|
|
1936
1993
|
var createStepComponent = (stepProps) => {
|
|
1937
1994
|
const _a = stepProps, { uid, stepPolling, stepRefreshAfter, updateComponent } = _a, rest = __objRest(_a, ["uid", "stepPolling", "stepRefreshAfter", "updateComponent"]);
|
|
1938
1995
|
const update = getInputUpdateFunction(updateComponent);
|
|
@@ -1959,7 +2016,7 @@ var createStepComponent = (stepProps) => {
|
|
|
1959
2016
|
update(this, updateFn);
|
|
1960
2017
|
},
|
|
1961
2018
|
getChildren() {
|
|
1962
|
-
return this.components;
|
|
2019
|
+
return this.externalConfirmation ? [...this.components, this.externalConfirmation] : this.components;
|
|
1963
2020
|
},
|
|
1964
2021
|
getModals() {
|
|
1965
2022
|
return this.modals;
|
|
@@ -2378,6 +2435,27 @@ var createDecisionComponent = (decisionProps) => __spreadProps(__spreadValues({
|
|
|
2378
2435
|
validate: () => true
|
|
2379
2436
|
});
|
|
2380
2437
|
|
|
2438
|
+
// src/revamp/domain/mappers/utils/utils.ts
|
|
2439
|
+
var mapInlineAlert = (alert) => {
|
|
2440
|
+
return alert ? {
|
|
2441
|
+
content: alert.content,
|
|
2442
|
+
context: alert.context ? mapLegacyContext(alert.context) : "neutral"
|
|
2443
|
+
} : void 0;
|
|
2444
|
+
};
|
|
2445
|
+
var mapAdditionalInfo = (info, onBehavior) => {
|
|
2446
|
+
if (info) {
|
|
2447
|
+
const behavior = getDomainLayerBehavior(info, []);
|
|
2448
|
+
return {
|
|
2449
|
+
text: info.text,
|
|
2450
|
+
accessibilityDescription: info.accessibilityDescription,
|
|
2451
|
+
onClick: () => {
|
|
2452
|
+
void onBehavior(behavior);
|
|
2453
|
+
}
|
|
2454
|
+
};
|
|
2455
|
+
}
|
|
2456
|
+
return void 0;
|
|
2457
|
+
};
|
|
2458
|
+
|
|
2381
2459
|
// src/revamp/domain/mappers/layout/decisionLayoutToComponent.ts
|
|
2382
2460
|
var decisionLayoutToComponent = (uid, {
|
|
2383
2461
|
control,
|
|
@@ -2388,20 +2466,66 @@ var decisionLayoutToComponent = (uid, {
|
|
|
2388
2466
|
uid,
|
|
2389
2467
|
control,
|
|
2390
2468
|
margin,
|
|
2391
|
-
options: options.map((option) =>
|
|
2392
|
-
var _a, _b;
|
|
2393
|
-
const behavior = getDomainLayerBehavior(option, (_a = step.actions) != null ? _a : []);
|
|
2394
|
-
return __spreadProps(__spreadValues({}, option), {
|
|
2395
|
-
disabled: (_b = option.disabled) != null ? _b : false,
|
|
2396
|
-
href: behavior.type === "link" ? behavior.url : void 0,
|
|
2397
|
-
image: mapSpecImage(option.image),
|
|
2398
|
-
onClick: () => {
|
|
2399
|
-
void onBehavior(behavior);
|
|
2400
|
-
}
|
|
2401
|
-
});
|
|
2402
|
-
}),
|
|
2469
|
+
options: options.map((option) => mapOption(option, onBehavior, step.actions)),
|
|
2403
2470
|
title
|
|
2404
2471
|
});
|
|
2472
|
+
var mapOption = (option, onBehavior, stepActions = []) => {
|
|
2473
|
+
var _a;
|
|
2474
|
+
const behavior = getDomainLayerBehavior(option, stepActions);
|
|
2475
|
+
return __spreadProps(__spreadValues({}, option), {
|
|
2476
|
+
disabled: (_a = option.disabled) != null ? _a : false,
|
|
2477
|
+
href: behavior.type === "link" ? behavior.url : void 0,
|
|
2478
|
+
image: mapSpecImage(option.image),
|
|
2479
|
+
inlineAlert: mapInlineAlert(option.inlineAlert),
|
|
2480
|
+
onClick: () => {
|
|
2481
|
+
void onBehavior(behavior);
|
|
2482
|
+
}
|
|
2483
|
+
});
|
|
2484
|
+
};
|
|
2485
|
+
|
|
2486
|
+
// src/revamp/domain/components/StatusListComponent.ts
|
|
2487
|
+
var createStatusListComponent = (statusListProps) => __spreadProps(__spreadValues({
|
|
2488
|
+
type: "status-list"
|
|
2489
|
+
}, statusListProps), {
|
|
2490
|
+
getLocalValue: () => null,
|
|
2491
|
+
getSubmittableValue: async () => null,
|
|
2492
|
+
getSubmittableValueSync: () => null,
|
|
2493
|
+
getSummary: () => ({}),
|
|
2494
|
+
// Noop,
|
|
2495
|
+
validate: () => true
|
|
2496
|
+
});
|
|
2497
|
+
|
|
2498
|
+
// src/revamp/domain/mappers/layout/deprecatedListLayoutToComponent.ts
|
|
2499
|
+
var isDeprecatedListLayout = (layout) => {
|
|
2500
|
+
const usesCallToAction = layout.callToAction != null;
|
|
2501
|
+
const usesNewProperties = layout.items.some(
|
|
2502
|
+
(item) => item.additionalInfo != null || item.inlineAlert != null || item.supportingValues != null || item.subtitle != null || item.value != null || item.subvalue != null
|
|
2503
|
+
);
|
|
2504
|
+
return !usesCallToAction && !usesNewProperties;
|
|
2505
|
+
};
|
|
2506
|
+
var deprecatedListLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
|
|
2507
|
+
uid,
|
|
2508
|
+
control,
|
|
2509
|
+
items: items.map(({ description, icon, status, title: itemTitle }) => ({
|
|
2510
|
+
description,
|
|
2511
|
+
icon: icon != null ? icon : { text: "" },
|
|
2512
|
+
title: itemTitle != null ? itemTitle : "",
|
|
2513
|
+
status: status ? mapLegacyStatus(status) : void 0
|
|
2514
|
+
})),
|
|
2515
|
+
margin,
|
|
2516
|
+
title
|
|
2517
|
+
});
|
|
2518
|
+
var mapLegacyStatus = (status) => {
|
|
2519
|
+
switch (status) {
|
|
2520
|
+
case "positive":
|
|
2521
|
+
return "done";
|
|
2522
|
+
case "warning":
|
|
2523
|
+
return "pending";
|
|
2524
|
+
case "neutral":
|
|
2525
|
+
default:
|
|
2526
|
+
return "not-done";
|
|
2527
|
+
}
|
|
2528
|
+
};
|
|
2405
2529
|
|
|
2406
2530
|
// src/revamp/domain/components/DividerComponent.ts
|
|
2407
2531
|
var createDividerComponent = (props) => __spreadProps(__spreadValues({
|
|
@@ -5361,6 +5485,50 @@ var instructionsLayoutToComponent = (uid, { control, items, margin = "md", title
|
|
|
5361
5485
|
title
|
|
5362
5486
|
});
|
|
5363
5487
|
|
|
5488
|
+
// src/revamp/domain/components/ListComponent.ts
|
|
5489
|
+
var createListComponent = (listProps) => __spreadProps(__spreadValues({
|
|
5490
|
+
type: "list"
|
|
5491
|
+
}, listProps), {
|
|
5492
|
+
getLocalValue: () => null,
|
|
5493
|
+
getSubmittableValue: async () => null,
|
|
5494
|
+
getSubmittableValueSync: () => null,
|
|
5495
|
+
getSummary: () => ({}),
|
|
5496
|
+
// noop
|
|
5497
|
+
validate: () => true
|
|
5498
|
+
});
|
|
5499
|
+
|
|
5500
|
+
// src/revamp/domain/mappers/layout/listLayoutToComponent.ts
|
|
5501
|
+
var listLayoutToComponent = (uid, { callToAction, control, items, margin = "md", title }, mapperProps) => {
|
|
5502
|
+
var _a;
|
|
5503
|
+
const { step, onBehavior } = mapperProps;
|
|
5504
|
+
return createListComponent({
|
|
5505
|
+
uid,
|
|
5506
|
+
control,
|
|
5507
|
+
items: items.map((item) => mapItem2(item, mapperProps)),
|
|
5508
|
+
callToAction: getDomainLayerCallToAction(callToAction, onBehavior, (_a = step.actions) != null ? _a : []),
|
|
5509
|
+
margin,
|
|
5510
|
+
title
|
|
5511
|
+
});
|
|
5512
|
+
};
|
|
5513
|
+
var mapItem2 = (item, mapperProps) => {
|
|
5514
|
+
var _b;
|
|
5515
|
+
const _a = item, { value, subvalue, subtitle } = _a, rest = __objRest(_a, ["value", "subvalue", "subtitle"]);
|
|
5516
|
+
return __spreadProps(__spreadValues({}, rest), {
|
|
5517
|
+
description: (_b = item.description) != null ? _b : subtitle,
|
|
5518
|
+
image: mapSpecImage(item.image),
|
|
5519
|
+
supportingValues: mapSupportingValues(item),
|
|
5520
|
+
additionalInfo: mapAdditionalInfo(item.additionalInfo, mapperProps.onBehavior),
|
|
5521
|
+
inlineAlert: mapInlineAlert(item.inlineAlert)
|
|
5522
|
+
});
|
|
5523
|
+
};
|
|
5524
|
+
var mapSupportingValues = (item) => {
|
|
5525
|
+
const { value, subvalue, supportingValues } = item;
|
|
5526
|
+
if (supportingValues) {
|
|
5527
|
+
return supportingValues;
|
|
5528
|
+
}
|
|
5529
|
+
return value || subvalue ? { value, subvalue } : void 0;
|
|
5530
|
+
};
|
|
5531
|
+
|
|
5364
5532
|
// src/revamp/domain/components/LoadingIndicatorComponent.ts
|
|
5365
5533
|
var createLoadingIndicatorComponent = (loadingIndicatorProps) => __spreadProps(__spreadValues({
|
|
5366
5534
|
type: "loading-indicator"
|
|
@@ -5462,16 +5630,13 @@ var createReviewComponent = (reviewProps) => __spreadProps(__spreadValues({
|
|
|
5462
5630
|
// src/revamp/domain/mappers/layout/reviewLayoutToComponent.ts
|
|
5463
5631
|
var reviewLayoutToComponent = (uid, { fields, title, callToAction, control, margin = "md", orientation, action }, { onBehavior, step }) => createReviewComponent({
|
|
5464
5632
|
uid,
|
|
5465
|
-
callToAction:
|
|
5633
|
+
callToAction: getCallToAction2({ onBehavior, callToAction, action, stepActions: step.actions }),
|
|
5466
5634
|
control: getOrientationControl({ control, orientation }),
|
|
5467
|
-
fields: fields.map((field) => {
|
|
5468
|
-
var _a;
|
|
5469
|
-
return __spreadProps(__spreadValues({}, field), { help: (_a = field.help) == null ? void 0 : _a.markdown });
|
|
5470
|
-
}),
|
|
5635
|
+
fields: fields.map((field) => mapReviewField(field, { onBehavior, step })),
|
|
5471
5636
|
margin,
|
|
5472
5637
|
title
|
|
5473
5638
|
});
|
|
5474
|
-
var
|
|
5639
|
+
var getCallToAction2 = ({
|
|
5475
5640
|
onBehavior,
|
|
5476
5641
|
callToAction,
|
|
5477
5642
|
action,
|
|
@@ -5482,6 +5647,7 @@ var getReviewAction = ({
|
|
|
5482
5647
|
}
|
|
5483
5648
|
if (action == null ? void 0 : action.title) {
|
|
5484
5649
|
return {
|
|
5650
|
+
type: "action",
|
|
5485
5651
|
title: action.title,
|
|
5486
5652
|
onClick: () => {
|
|
5487
5653
|
void onBehavior({ type: "action", action });
|
|
@@ -5502,6 +5668,20 @@ var getOrientationControl = ({
|
|
|
5502
5668
|
}
|
|
5503
5669
|
return void 0;
|
|
5504
5670
|
};
|
|
5671
|
+
var mapReviewField = (field, { onBehavior, step }) => {
|
|
5672
|
+
var _a, _b;
|
|
5673
|
+
return __spreadProps(__spreadValues({}, field), {
|
|
5674
|
+
image: mapSpecImage(field.image),
|
|
5675
|
+
help: (_a = field.help) == null ? void 0 : _a.markdown,
|
|
5676
|
+
inlineAlert: mapInlineAlert(field.inlineAlert),
|
|
5677
|
+
additionalInfo: mapAdditionalInfo(field.additionalInfo, onBehavior),
|
|
5678
|
+
callToAction: getCallToAction2({
|
|
5679
|
+
onBehavior,
|
|
5680
|
+
callToAction: field.callToAction,
|
|
5681
|
+
stepActions: (_b = step.actions) != null ? _b : []
|
|
5682
|
+
})
|
|
5683
|
+
});
|
|
5684
|
+
};
|
|
5505
5685
|
|
|
5506
5686
|
// src/revamp/domain/components/searchComponent/SearchComponent.ts
|
|
5507
5687
|
var DEBOUNCE_TIME = 400;
|
|
@@ -5648,18 +5828,6 @@ var searchLayoutToComponent = (uid, { control, emptyMessage = "", method, param,
|
|
|
5648
5828
|
);
|
|
5649
5829
|
};
|
|
5650
5830
|
|
|
5651
|
-
// src/revamp/domain/components/StatusListComponent.ts
|
|
5652
|
-
var createStatusListComponent = (statusListProps) => __spreadProps(__spreadValues({
|
|
5653
|
-
type: "status-list"
|
|
5654
|
-
}, statusListProps), {
|
|
5655
|
-
getLocalValue: () => null,
|
|
5656
|
-
getSubmittableValue: async () => null,
|
|
5657
|
-
getSubmittableValueSync: () => null,
|
|
5658
|
-
getSummary: () => ({}),
|
|
5659
|
-
// Noop,
|
|
5660
|
-
validate: () => true
|
|
5661
|
-
});
|
|
5662
|
-
|
|
5663
5831
|
// src/revamp/domain/mappers/layout/statusListLayoutToComponent.ts
|
|
5664
5832
|
var statusListLayoutToComponent = (uid, { control, items, margin = "md", title }, { onBehavior, step }) => createStatusListComponent({
|
|
5665
5833
|
uid,
|
|
@@ -5677,59 +5845,6 @@ var statusListLayoutToComponent = (uid, { control, items, margin = "md", title }
|
|
|
5677
5845
|
title
|
|
5678
5846
|
});
|
|
5679
5847
|
|
|
5680
|
-
// src/revamp/domain/mappers/layout/deprecatedListLayoutToComponent.ts
|
|
5681
|
-
var deprecatedListLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
|
|
5682
|
-
uid,
|
|
5683
|
-
control,
|
|
5684
|
-
items: items.map(({ description, icon, status, title: itemTitle }) => ({
|
|
5685
|
-
description,
|
|
5686
|
-
icon: icon != null ? icon : { text: "" },
|
|
5687
|
-
title: itemTitle != null ? itemTitle : "",
|
|
5688
|
-
status: status ? mapLegacyStatus(status) : void 0
|
|
5689
|
-
})),
|
|
5690
|
-
margin,
|
|
5691
|
-
title
|
|
5692
|
-
});
|
|
5693
|
-
var mapLegacyStatus = (status) => {
|
|
5694
|
-
switch (status) {
|
|
5695
|
-
case "positive":
|
|
5696
|
-
return "done";
|
|
5697
|
-
case "warning":
|
|
5698
|
-
return "pending";
|
|
5699
|
-
case "neutral":
|
|
5700
|
-
default:
|
|
5701
|
-
return "not-done";
|
|
5702
|
-
}
|
|
5703
|
-
};
|
|
5704
|
-
|
|
5705
|
-
// src/revamp/domain/components/ListComponent.ts
|
|
5706
|
-
var createListComponent = (listProps) => __spreadProps(__spreadValues({
|
|
5707
|
-
type: "list"
|
|
5708
|
-
}, listProps), {
|
|
5709
|
-
getLocalValue: () => null,
|
|
5710
|
-
getSubmittableValue: async () => null,
|
|
5711
|
-
getSubmittableValueSync: () => null,
|
|
5712
|
-
getSummary: () => ({}),
|
|
5713
|
-
// noop
|
|
5714
|
-
validate: () => true
|
|
5715
|
-
});
|
|
5716
|
-
|
|
5717
|
-
// src/revamp/domain/mappers/layout/listLayoutToComponent.ts
|
|
5718
|
-
var listLayoutToComponent = (uid, { callToAction, control, items, margin = "md", title }, mapperProps) => {
|
|
5719
|
-
var _a;
|
|
5720
|
-
const { step, onBehavior } = mapperProps;
|
|
5721
|
-
return createListComponent({
|
|
5722
|
-
uid,
|
|
5723
|
-
control,
|
|
5724
|
-
items: items.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
5725
|
-
image: mapSpecImage(item.image)
|
|
5726
|
-
})),
|
|
5727
|
-
callToAction: getDomainLayerCallToAction(callToAction, onBehavior, (_a = step.actions) != null ? _a : []),
|
|
5728
|
-
margin,
|
|
5729
|
-
title
|
|
5730
|
-
});
|
|
5731
|
-
};
|
|
5732
|
-
|
|
5733
5848
|
// src/revamp/domain/mappers/mapLayoutToComponent.ts
|
|
5734
5849
|
var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
5735
5850
|
switch (layout.type) {
|
|
@@ -5756,10 +5871,7 @@ var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
|
5756
5871
|
case "instructions":
|
|
5757
5872
|
return instructionsLayoutToComponent(uid, layout);
|
|
5758
5873
|
case "list":
|
|
5759
|
-
|
|
5760
|
-
return deprecatedListLayoutToComponent(uid, layout);
|
|
5761
|
-
}
|
|
5762
|
-
return listLayoutToComponent(uid, layout, mapperProps);
|
|
5874
|
+
return isDeprecatedListLayout(layout) ? deprecatedListLayoutToComponent(uid, layout) : listLayoutToComponent(uid, layout, mapperProps);
|
|
5763
5875
|
case "loading-indicator":
|
|
5764
5876
|
return loadingIndicatorLayoutToComponent(uid, layout);
|
|
5765
5877
|
case "markdown":
|
|
@@ -5863,6 +5975,7 @@ var mapStepToComponent = (_a) => {
|
|
|
5863
5975
|
const onRefresh = async (schemaId, url) => restProps.onRefresh(schemaId, url != null ? url : refreshUrl);
|
|
5864
5976
|
const stepPolling = polling ? getStepPolling({ pollingConfig: polling, onBehavior, onPoll }) : void 0;
|
|
5865
5977
|
const stepRefreshAfter = refreshAfter ? getStepRefreshAfter({ refreshAfter, onRefresh }) : void 0;
|
|
5978
|
+
const externalConfirmation = (external == null ? void 0 : external.url) ? createExternalConfirmation(`${uid}-external-confirmation`, external == null ? void 0 : external.url, updateComponent) : void 0;
|
|
5866
5979
|
const mapperProps = __spreadProps(__spreadValues({}, restProps), { trackEvent, onBehavior, onRefresh });
|
|
5867
5980
|
const unreferencedSchemaFormComponents = mapUnreferencedSchemas(mapperProps);
|
|
5868
5981
|
const layoutComponents = layout.map(
|
|
@@ -5876,7 +5989,7 @@ var mapStepToComponent = (_a) => {
|
|
|
5876
5989
|
control,
|
|
5877
5990
|
description,
|
|
5878
5991
|
error: errors == null ? void 0 : errors.error,
|
|
5879
|
-
|
|
5992
|
+
externalConfirmation,
|
|
5880
5993
|
loadingState,
|
|
5881
5994
|
stepPolling,
|
|
5882
5995
|
stepRefreshAfter,
|
|
@@ -11644,7 +11757,7 @@ var getDefinitionListLayout = (review) => {
|
|
|
11644
11757
|
function DynamicReview({ component: review, onAction }) {
|
|
11645
11758
|
var _a, _b;
|
|
11646
11759
|
const margin = getMargin(review.margin || "xs");
|
|
11647
|
-
const
|
|
11760
|
+
const getReviewAction = (callToAction2) => {
|
|
11648
11761
|
const { title, action, behavior } = callToAction2;
|
|
11649
11762
|
if (behavior) {
|
|
11650
11763
|
if ("type" in behavior) {
|
|
@@ -11692,7 +11805,7 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
11692
11805
|
};
|
|
11693
11806
|
};
|
|
11694
11807
|
const orientation = getDefinitionListLayout(review);
|
|
11695
|
-
const callToAction = review.callToAction ?
|
|
11808
|
+
const callToAction = review.callToAction ? getReviewAction(review.callToAction) : null;
|
|
11696
11809
|
const legacyCallToAction = !callToAction && review.action ? { text: (_a = review.action.title) != null ? _a : "", onClick: getOnClick(review.action) } : null;
|
|
11697
11810
|
return /* @__PURE__ */ jsxs19("div", { className: margin, children: [
|
|
11698
11811
|
review.title && /* @__PURE__ */ jsx57(Header8, { title: review.title, action: (_b = callToAction != null ? callToAction : legacyCallToAction) != null ? _b : void 0 }),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Icon } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import type { Image, LayoutComponent } from '../types';
|
|
2
|
+
import type { Image, InlineAlert, LayoutComponent, SupportingValues } from '../types';
|
|
3
3
|
export type DecisionComponent = LayoutComponent & {
|
|
4
4
|
type: 'decision';
|
|
5
5
|
options: DecisionOption[];
|
|
@@ -13,6 +13,9 @@ export type DecisionOption = {
|
|
|
13
13
|
image?: Image;
|
|
14
14
|
title: string;
|
|
15
15
|
tag?: string;
|
|
16
|
+
additionalText?: string;
|
|
17
|
+
supportingValues?: SupportingValues;
|
|
18
|
+
inlineAlert?: InlineAlert;
|
|
16
19
|
onClick: () => void;
|
|
17
20
|
};
|
|
18
21
|
export declare const createDecisionComponent: (decisionProps: Pick<DecisionComponent, "uid" | "control" | "margin" | "options" | "title">) => DecisionComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Icon } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
-
import { CallToAction, Image, LayoutComponent } from '../types';
|
|
2
|
+
import { AdditionalInfo, CallToAction, Image, InlineAlert, LayoutComponent, SupportingValues } from '../types';
|
|
3
3
|
export type ListComponent = LayoutComponent & {
|
|
4
4
|
type: 'list';
|
|
5
5
|
items: ListItem[];
|
|
@@ -10,9 +10,10 @@ export type ListItem = {
|
|
|
10
10
|
icon?: Icon;
|
|
11
11
|
image?: Image;
|
|
12
12
|
title?: string;
|
|
13
|
-
|
|
14
|
-
value?: string;
|
|
15
|
-
subvalue?: string;
|
|
13
|
+
description?: string;
|
|
16
14
|
tag?: string;
|
|
15
|
+
supportingValues?: SupportingValues;
|
|
16
|
+
additionalInfo?: AdditionalInfo;
|
|
17
|
+
inlineAlert?: InlineAlert;
|
|
17
18
|
};
|
|
18
19
|
export declare const createListComponent: (listProps: Pick<ListComponent, "uid" | "callToAction" | "control" | "items" | "margin" | "title">) => ListComponent;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Icon } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { AdditionalInfo, CallToAction, Image, InlineAlert, LayoutComponent } from '../types';
|
|
2
3
|
export type ReviewComponent = LayoutComponent & {
|
|
3
4
|
type: 'review';
|
|
4
5
|
fields: ReviewField[];
|
|
5
6
|
title?: string;
|
|
6
|
-
callToAction?:
|
|
7
|
+
callToAction?: CallToAction;
|
|
7
8
|
};
|
|
8
9
|
export type ReviewField = {
|
|
9
10
|
help?: string;
|
|
@@ -11,11 +12,10 @@ export type ReviewField = {
|
|
|
11
12
|
value: string;
|
|
12
13
|
rawValue?: string;
|
|
13
14
|
tag?: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
onClick: () => void;
|
|
15
|
+
inlineAlert?: InlineAlert;
|
|
16
|
+
additionalInfo?: AdditionalInfo;
|
|
17
|
+
callToAction?: CallToAction;
|
|
18
|
+
icon?: Icon;
|
|
19
|
+
image?: Image;
|
|
20
20
|
};
|
|
21
21
|
export declare const createReviewComponent: (reviewProps: Pick<ReviewComponent, "uid" | "callToAction" | "control" | "fields" | "margin" | "title">) => ReviewComponent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnalyticsEventDispatcher } from '../features/events';
|
|
2
2
|
import { BaseComponent, DomainComponent, LoadingState, LocalValue, UpdateComponent } from '../types';
|
|
3
|
-
import { StepDomainComponent } from './StepDomainComponent';
|
|
3
|
+
import { StepDomainComponent } from './step/StepDomainComponent';
|
|
4
4
|
import { ModalContentComponent } from './ModalContentComponent';
|
|
5
5
|
export type RootDomainComponent = BaseComponent & {
|
|
6
6
|
type: 'root';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseComponent, LocalValue, UpdateComponent } from '../../types';
|
|
2
|
+
export type ExternalConfirmationComponent = BaseComponent & {
|
|
3
|
+
type: 'external-confirmation';
|
|
4
|
+
uid: string;
|
|
5
|
+
status: 'initial' | 'success' | 'failure' | 'dismissed';
|
|
6
|
+
url: string;
|
|
7
|
+
onSuccess: () => void;
|
|
8
|
+
onFailure: () => void;
|
|
9
|
+
onCancel: () => void;
|
|
10
|
+
getLocalValue: () => LocalValue;
|
|
11
|
+
};
|
|
12
|
+
export declare const createExternalConfirmation: (uid: string, url: string, updateComponent: UpdateComponent) => ExternalConfirmationComponent;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { BaseComponent, DomainComponent, LoadingState, LocalValue, OnBehavior, UpdateComponent } from '
|
|
1
|
+
import type { BaseComponent, DomainComponent, LoadingState, LocalValue, OnBehavior, UpdateComponent } from '../../types';
|
|
2
2
|
import type { Step } from '@wise/dynamic-flow-types/build/next';
|
|
3
|
-
import type { AnalyticsEventDispatcher } from '
|
|
4
|
-
import type { StepPolling } from '
|
|
5
|
-
import { StepRefreshAfter } from '
|
|
6
|
-
import { ModalContentComponent } from '
|
|
3
|
+
import type { AnalyticsEventDispatcher } from '../../features/events';
|
|
4
|
+
import type { StepPolling } from '../../features/polling/getStepPolling';
|
|
5
|
+
import { StepRefreshAfter } from '../../features/refreshAfter/getStepRefreshAfter';
|
|
6
|
+
import { ModalContentComponent } from '../ModalContentComponent';
|
|
7
|
+
import { ExternalConfirmationComponent } from './ExternalConfirmationComponent';
|
|
7
8
|
export type StepDomainComponent = BaseComponent & {
|
|
8
9
|
type: 'step';
|
|
9
10
|
back?: BackNavigation;
|
|
@@ -11,7 +12,7 @@ export type StepDomainComponent = BaseComponent & {
|
|
|
11
12
|
control?: string;
|
|
12
13
|
description?: string;
|
|
13
14
|
error?: string;
|
|
14
|
-
|
|
15
|
+
externalConfirmation?: ExternalConfirmationComponent;
|
|
15
16
|
loadingState: LoadingState;
|
|
16
17
|
step: Step;
|
|
17
18
|
title?: string;
|
|
@@ -31,7 +32,7 @@ type BackNavigation = {
|
|
|
31
32
|
title?: string;
|
|
32
33
|
onClick: () => void;
|
|
33
34
|
};
|
|
34
|
-
export declare const createStepComponent: (stepProps: Pick<StepDomainComponent, "uid" | "back" | "components" | "control" | "description" | "error" | "
|
|
35
|
+
export declare const createStepComponent: (stepProps: Pick<StepDomainComponent, "uid" | "back" | "components" | "control" | "description" | "error" | "externalConfirmation" | "loadingState" | "step" | "title" | "trackEvent" | "onBehavior"> & {
|
|
35
36
|
stepPolling?: StepPolling;
|
|
36
37
|
stepRefreshAfter?: StepRefreshAfter;
|
|
37
38
|
updateComponent: UpdateComponent;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { ListLayout } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
export declare const isDeprecatedListLayout: (layout: ListLayout) => boolean;
|
|
2
3
|
export declare const deprecatedListLayoutToComponent: (uid: string, { control, items, margin, title }: ListLayout) => import("../../components/StatusListComponent").StatusListComponent;
|
|
@@ -8,4 +8,4 @@ export type StepMapperProps = Omit<MapperProps, 'trackEvent'> & {
|
|
|
8
8
|
trackEvent: AnalyticsEventDispatcher<string>;
|
|
9
9
|
onPoll: OnPoll;
|
|
10
10
|
};
|
|
11
|
-
export declare const mapStepToComponent: ({ uid: rootUid, loadingState, displayStepTitle, trackEvent, onPoll, onBehavior, ...restProps }: StepMapperProps) => import("../components/StepDomainComponent").StepDomainComponent;
|
|
11
|
+
export declare const mapStepToComponent: ({ uid: rootUid, loadingState, displayStepTitle, trackEvent, onPoll, onBehavior, ...restProps }: StepMapperProps) => import("../components/step/StepDomainComponent").StepDomainComponent;
|