@wise/dynamic-flow-client 3.25.0 → 3.25.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/main.js +40 -13
- package/build/main.min.js +1 -1
- package/build/main.mjs +40 -13
- package/package.json +1 -1
package/build/main.mjs
CHANGED
|
@@ -6965,12 +6965,18 @@ var alertLayoutToComponent = (uid, { control, markdown, margin = "md", context =
|
|
|
6965
6965
|
control,
|
|
6966
6966
|
markdown,
|
|
6967
6967
|
margin,
|
|
6968
|
-
callToAction:
|
|
6968
|
+
callToAction: getComponentCallToAction(callToAction, onAction),
|
|
6969
6969
|
context: mapLegacyContext(context)
|
|
6970
6970
|
});
|
|
6971
6971
|
};
|
|
6972
6972
|
var getComponentCallToAction = (callToAction, onAction) => {
|
|
6973
|
+
if (!callToAction) {
|
|
6974
|
+
return void 0;
|
|
6975
|
+
}
|
|
6973
6976
|
const { accessibilityDescription, behavior, title } = callToAction;
|
|
6977
|
+
if ("type" in behavior) {
|
|
6978
|
+
return void 0;
|
|
6979
|
+
}
|
|
6974
6980
|
if (behavior.link) {
|
|
6975
6981
|
const { url } = behavior.link;
|
|
6976
6982
|
return {
|
|
@@ -7071,9 +7077,13 @@ var buttonLayoutToComponent = (uid, button, mapperProps) => {
|
|
|
7071
7077
|
var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
|
|
7072
7078
|
const { onAction, onLink, step } = mapperProps;
|
|
7073
7079
|
const { context, control, disabled, margin = "md", pinOrder, size, title, behavior } = button;
|
|
7074
|
-
const
|
|
7075
|
-
|
|
7076
|
-
|
|
7080
|
+
const getOnClick = () => {
|
|
7081
|
+
if ("type" in behavior) {
|
|
7082
|
+
return () => {
|
|
7083
|
+
};
|
|
7084
|
+
}
|
|
7085
|
+
const { action, link } = behavior;
|
|
7086
|
+
const inlinedAction = action ? inlineAction(action, step == null ? void 0 : step.actions) : null;
|
|
7077
7087
|
if (inlinedAction) {
|
|
7078
7088
|
return () => {
|
|
7079
7089
|
void onAction(inlinedAction);
|
|
@@ -7086,7 +7096,7 @@ var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
|
|
|
7086
7096
|
}
|
|
7087
7097
|
return () => {
|
|
7088
7098
|
};
|
|
7089
|
-
}
|
|
7099
|
+
};
|
|
7090
7100
|
return createButtonComponent({
|
|
7091
7101
|
uid,
|
|
7092
7102
|
context: mapLegacyContext(context != null ? context : "neutral"),
|
|
@@ -7096,7 +7106,7 @@ var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
|
|
|
7096
7106
|
pinOrder,
|
|
7097
7107
|
size,
|
|
7098
7108
|
title: title != null ? title : "",
|
|
7099
|
-
onClick
|
|
7109
|
+
onClick: getOnClick()
|
|
7100
7110
|
});
|
|
7101
7111
|
};
|
|
7102
7112
|
var buttonLayoutToComponentWithAction = (uid, button, mapperProps) => {
|
|
@@ -10126,6 +10136,9 @@ var getReviewAction = ({ onAction, onLink, callToAction, action }) => {
|
|
|
10126
10136
|
if (callToAction) {
|
|
10127
10137
|
const { action: ctaAction, behavior, title } = callToAction;
|
|
10128
10138
|
if (behavior) {
|
|
10139
|
+
if ("type" in behavior) {
|
|
10140
|
+
return void 0;
|
|
10141
|
+
}
|
|
10129
10142
|
const { accessibilityDescription, action: behaviorAction, link } = behavior;
|
|
10130
10143
|
const onClick = () => {
|
|
10131
10144
|
if (behaviorAction) {
|
|
@@ -10330,18 +10343,32 @@ var createStatusListComponent = (statusListProps) => __spreadProps(__spreadValue
|
|
|
10330
10343
|
var statusListLayoutToComponent = (uid, { control, items, margin = "md", title }, { onAction, onLink }) => createStatusListComponent({
|
|
10331
10344
|
uid,
|
|
10332
10345
|
control,
|
|
10333
|
-
items: items.map((item) => {
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
callToAction: item.callToAction ? getItemCallToAction(item.callToAction, onAction, onLink) : void 0
|
|
10338
|
-
});
|
|
10339
|
-
}),
|
|
10346
|
+
items: items.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
10347
|
+
href: getItemHref(item.callToAction),
|
|
10348
|
+
callToAction: getItemCallToAction(item.callToAction, onAction, onLink)
|
|
10349
|
+
})),
|
|
10340
10350
|
margin,
|
|
10341
10351
|
title
|
|
10342
10352
|
});
|
|
10353
|
+
var getItemHref = (callToAction) => {
|
|
10354
|
+
var _a;
|
|
10355
|
+
if (!callToAction) {
|
|
10356
|
+
return void 0;
|
|
10357
|
+
}
|
|
10358
|
+
const { behavior } = callToAction;
|
|
10359
|
+
if ("type" in behavior) {
|
|
10360
|
+
return void 0;
|
|
10361
|
+
}
|
|
10362
|
+
return (_a = behavior == null ? void 0 : behavior.link) == null ? void 0 : _a.url;
|
|
10363
|
+
};
|
|
10343
10364
|
var getItemCallToAction = (callToAction, onAction, onLink) => {
|
|
10365
|
+
if (!callToAction) {
|
|
10366
|
+
return void 0;
|
|
10367
|
+
}
|
|
10344
10368
|
const { accessibilityDescription, behavior, title } = callToAction;
|
|
10369
|
+
if ("type" in behavior) {
|
|
10370
|
+
return void 0;
|
|
10371
|
+
}
|
|
10345
10372
|
if (behavior.link) {
|
|
10346
10373
|
const { url } = behavior.link;
|
|
10347
10374
|
return {
|