@synerise/ds-condition 1.6.16 → 1.6.18
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/CHANGELOG.md +8 -0
- package/dist/Condition.d.ts +2 -2
- package/dist/Condition.js +128 -207
- package/dist/Condition.style.d.ts +32 -32
- package/dist/Condition.style.js +84 -93
- package/dist/Condition.types.d.ts +5 -5
- package/dist/Condition.types.js +1 -1
- package/dist/ConditionStep/AddCondition/AddCondition.d.ts +1 -1
- package/dist/ConditionStep/AddCondition/AddCondition.js +25 -28
- package/dist/ConditionStep/AddCondition/AddCondition.types.d.ts +2 -2
- package/dist/ConditionStep/AddCondition/AddCondition.types.js +1 -1
- package/dist/ConditionStep/AddCondition/index.js +4 -1
- package/dist/ConditionStep/ConditionRow/ConditionRow.d.ts +1 -1
- package/dist/ConditionStep/ConditionRow/ConditionRow.js +109 -167
- package/dist/ConditionStep/ConditionRow/ConditionRow.types.d.ts +4 -4
- package/dist/ConditionStep/ConditionRow/ConditionRow.types.js +1 -1
- package/dist/ConditionStep/ConditionRow/index.js +4 -2
- package/dist/ConditionStep/ConditionStep.d.ts +1 -1
- package/dist/ConditionStep/ConditionStep.js +144 -247
- package/dist/ConditionStep/ConditionStep.types.d.ts +6 -6
- package/dist/ConditionStep/ConditionStep.types.js +1 -1
- package/dist/ConditionStep/EmptyCondition/EmptyCondition.d.ts +1 -1
- package/dist/ConditionStep/EmptyCondition/EmptyCondition.js +16 -15
- package/dist/ConditionStep/EmptyCondition/emptyCondition.styles.d.ts +6 -6
- package/dist/ConditionStep/EmptyCondition/emptyCondition.styles.js +9 -5
- package/dist/ConditionStep/EmptyCondition/index.js +4 -1
- package/dist/ConditionStep/StepHeader/StepHeader.d.ts +1 -1
- package/dist/ConditionStep/StepHeader/StepHeader.js +46 -62
- package/dist/ConditionStep/StepHeader/StepHeader.types.d.ts +2 -2
- package/dist/ConditionStep/StepHeader/StepHeader.types.js +1 -1
- package/dist/ConditionStep/StepHeader/index.js +4 -2
- package/dist/ConditionStep/StepName/StepName.d.ts +2 -2
- package/dist/ConditionStep/StepName/StepName.js +19 -10
- package/dist/ConditionStep/index.js +4 -2
- package/dist/constants.js +22 -11
- package/dist/hooks/useTranslations.d.ts +1 -1
- package/dist/hooks/useTranslations.js +61 -59
- package/dist/index.js +4 -1
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +17 -17
package/dist/Condition.style.js
CHANGED
|
@@ -1,180 +1,171 @@
|
|
|
1
|
-
import styled, { css } from
|
|
2
|
-
import Cruds from
|
|
3
|
-
import { Value } from
|
|
4
|
-
import Icon from
|
|
5
|
-
import { InputGroupItem } from
|
|
6
|
-
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import Cruds from "@synerise/ds-cruds";
|
|
3
|
+
import { Value } from "@synerise/ds-factors/dist/FactorValue/Parameter/Parameter.style";
|
|
4
|
+
import Icon from "@synerise/ds-icon";
|
|
5
|
+
import { InputGroupItem } from "@synerise/ds-input/dist/InputGroup.styles";
|
|
6
|
+
const ErrorWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
7
7
|
displayName: "Conditionstyle__ErrorWrapper",
|
|
8
8
|
componentId: "sc-1lk06p3-0"
|
|
9
|
-
})(["color:", ";margin-top:8px;"],
|
|
10
|
-
|
|
11
|
-
});
|
|
12
|
-
export var DragIcon = styled(Icon).withConfig({
|
|
9
|
+
})(["color:", ";margin-top:8px;"], (props) => props.theme.palette["red-600"]);
|
|
10
|
+
const DragIcon = /* @__PURE__ */ styled(Icon).withConfig({
|
|
13
11
|
displayName: "Conditionstyle__DragIcon",
|
|
14
12
|
componentId: "sc-1lk06p3-1"
|
|
15
13
|
})(["opacity:0;visibility:hidden;position:absolute;top:0;left:-24px;cursor:grab;"]);
|
|
16
|
-
|
|
14
|
+
const StepConditionCruds = /* @__PURE__ */ styled(Cruds).withConfig({
|
|
17
15
|
displayName: "Conditionstyle__StepConditionCruds",
|
|
18
16
|
componentId: "sc-1lk06p3-2"
|
|
19
17
|
})(["position:absolute;top:16px;right:24px;visibility:hidden;opacity:0;"]);
|
|
20
|
-
|
|
18
|
+
const StepConditions = /* @__PURE__ */ styled.div.withConfig({
|
|
21
19
|
displayName: "Conditionstyle__StepConditions",
|
|
22
20
|
componentId: "sc-1lk06p3-3"
|
|
23
|
-
})(["display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;margin-top:0;padding:0 24px;width:", ";", "{left:0;top:16px;}"],
|
|
24
|
-
|
|
25
|
-
}, DragIcon);
|
|
26
|
-
export var StepName = styled.div.withConfig({
|
|
21
|
+
})(["display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;margin-top:0;padding:0 24px;width:", ";", "{left:0;top:16px;}"], (props) => props.withCruds ? "calc(100% - 48px)" : "100%", DragIcon);
|
|
22
|
+
const StepName = /* @__PURE__ */ styled.div.withConfig({
|
|
27
23
|
displayName: "Conditionstyle__StepName",
|
|
28
24
|
componentId: "sc-1lk06p3-4"
|
|
29
|
-
})(["font-size:13px;line-height:1.84;color:", ";display:flex;flex-direction:row;align-items:center;justify-content:flex-start;white-space:pre-wrap;gap:8px;&&& input{margin-top:2px;cursor:default;}"],
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
export var StepIndexWrapper = styled.span.withConfig({
|
|
25
|
+
})(["font-size:13px;line-height:1.84;color:", ";display:flex;flex-direction:row;align-items:center;justify-content:flex-start;white-space:pre-wrap;gap:8px;&&& input{margin-top:2px;cursor:default;}"], (props) => props.theme.palette["grey-800"]);
|
|
26
|
+
const StepIndexWrapper = /* @__PURE__ */ styled.span.withConfig({
|
|
33
27
|
displayName: "Conditionstyle__StepIndexWrapper",
|
|
34
28
|
componentId: "sc-1lk06p3-5"
|
|
35
29
|
})(["font-size:13px;font-weight:500;"]);
|
|
36
|
-
|
|
30
|
+
const Condition = /* @__PURE__ */ styled.div.withConfig({
|
|
37
31
|
displayName: "Conditionstyle__Condition",
|
|
38
32
|
componentId: "sc-1lk06p3-6"
|
|
39
33
|
})(["padding:12px 0;display:block;min-width:575px;width:100%;.steps-list{width:100%;}"]);
|
|
40
|
-
|
|
34
|
+
const ConditionStepWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
41
35
|
displayName: "Conditionstyle__ConditionStepWrapper",
|
|
42
36
|
componentId: "sc-1lk06p3-7"
|
|
43
37
|
})([""]);
|
|
44
|
-
|
|
38
|
+
const And = /* @__PURE__ */ styled.div.withConfig({
|
|
45
39
|
displayName: "Conditionstyle__And",
|
|
46
40
|
componentId: "sc-1lk06p3-8"
|
|
47
41
|
})(["display:contents;"]);
|
|
48
|
-
|
|
42
|
+
const StepCruds = /* @__PURE__ */ styled.div.withConfig({
|
|
49
43
|
displayName: "Conditionstyle__StepCruds",
|
|
50
44
|
componentId: "sc-1lk06p3-9"
|
|
51
45
|
})(["display:flex;align-items:center;justify-content:flex-end;opacity:0;visibility:hidden;"]);
|
|
52
|
-
|
|
46
|
+
const LeftSide = /* @__PURE__ */ styled.div.withConfig({
|
|
53
47
|
displayName: "Conditionstyle__LeftSide",
|
|
54
48
|
componentId: "sc-1lk06p3-10"
|
|
55
49
|
})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;position:relative;"]);
|
|
56
|
-
|
|
50
|
+
const StepHeader = /* @__PURE__ */ styled.div.withConfig({
|
|
57
51
|
displayName: "Conditionstyle__StepHeader",
|
|
58
52
|
componentId: "sc-1lk06p3-11"
|
|
59
53
|
})(["display:flex;width:100%;flex-direction:row;align-items:flex-end;justify-content:space-between;margin-bottom:8px;padding:0 24px;"]);
|
|
60
|
-
|
|
54
|
+
const DraggedLabel = /* @__PURE__ */ styled.span.withConfig({
|
|
61
55
|
displayName: "Conditionstyle__DraggedLabel",
|
|
62
56
|
componentId: "sc-1lk06p3-12"
|
|
63
|
-
})(["width:100%;height:100%;display:none;position:absolute;top:0;left:0;align-items:center;justify-content:flex-start;padding-left:18px;color:", ";font-size:13px;"],
|
|
64
|
-
|
|
65
|
-
});
|
|
66
|
-
export var Step = styled.div.withConfig({
|
|
57
|
+
})(["width:100%;height:100%;display:none;position:absolute;top:0;left:0;align-items:center;justify-content:flex-start;padding-left:18px;color:", ";font-size:13px;"], (props) => props.theme.palette["grey-600"]);
|
|
58
|
+
const Step = /* @__PURE__ */ styled.div.withConfig({
|
|
67
59
|
displayName: "Conditionstyle__Step",
|
|
68
60
|
componentId: "sc-1lk06p3-13"
|
|
69
|
-
})(["padding:", ";position:relative;", " ", " &:hover{", ";", "{opacity:1;visibility:visible;}", "{opacity:1;visibility:visible;}", "{opacity:1;visibility:visible;}}"],
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return props.showSuffix && css(["&:after{display:flex;width:100%;padding:18px 0 18px 24px;bottom:-18px;content:attr(data-conditionSuffix);background-color:", ";position:relative;font-size:16px;font-weight:500;color:#3f4c5b;}"], props.theme.palette.white);
|
|
74
|
-
}, function (props) {
|
|
75
|
-
return props.active && !props.singleStepCondition && css(["&:hover{background-color:", ";}"], props.theme.palette['grey-050']);
|
|
76
|
-
}, function (props) {
|
|
77
|
-
return !props.hoverDisabled && "background-color: " + props.theme.palette['grey-050'];
|
|
78
|
-
}, StepCruds, StepConditionCruds, DragIcon);
|
|
79
|
-
export var DropLabel = styled.div.withConfig({
|
|
61
|
+
})(["padding:", ";position:relative;", " ", " &:hover{", ";", "{opacity:1;visibility:visible;}", "{opacity:1;visibility:visible;}", "{opacity:1;visibility:visible;}}"], ({
|
|
62
|
+
singleStepCondition
|
|
63
|
+
}) => singleStepCondition ? "24px 0" : "12px 0", (props) => props.showSuffix && css(["&:after{display:flex;width:100%;padding:18px 0 18px 24px;bottom:-18px;content:attr(data-conditionSuffix);background-color:", ";position:relative;font-size:16px;font-weight:500;color:#3f4c5b;}"], props.theme.palette.white), (props) => props.active && !props.singleStepCondition && css(["&:hover{background-color:", ";}"], props.theme.palette["grey-050"]), (props) => !props.hoverDisabled && `background-color: ${props.theme.palette["grey-050"]}`, StepCruds, StepConditionCruds, DragIcon);
|
|
64
|
+
const DropLabel = /* @__PURE__ */ styled.div.withConfig({
|
|
80
65
|
displayName: "Conditionstyle__DropLabel",
|
|
81
66
|
componentId: "sc-1lk06p3-14"
|
|
82
67
|
})(["display:none;"]);
|
|
83
|
-
|
|
68
|
+
const DragLabelPart = /* @__PURE__ */ styled.div.withConfig({
|
|
84
69
|
displayName: "Conditionstyle__DragLabelPart",
|
|
85
70
|
componentId: "sc-1lk06p3-15"
|
|
86
71
|
})([""]);
|
|
87
|
-
|
|
72
|
+
const DragLabel = /* @__PURE__ */ styled.div.withConfig({
|
|
88
73
|
displayName: "Conditionstyle__DragLabel",
|
|
89
74
|
componentId: "sc-1lk06p3-16"
|
|
90
75
|
})(["display:none;align-items:center;gap:8px;"]);
|
|
91
|
-
|
|
76
|
+
const StepWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
92
77
|
displayName: "Conditionstyle__StepWrapper",
|
|
93
78
|
componentId: "sc-1lk06p3-17"
|
|
94
|
-
})(["", " ", ""],
|
|
95
|
-
|
|
96
|
-
}, function (props) {
|
|
97
|
-
return props.isDragged && css(["", "{display:none;}", "{display:block;}height:50px;overflow:hidden;display:flex;align-items:center;justify-content:center;background-color:", ";color:", ";border-left:2px solid ", ";"], Step, DropLabel, props.theme.palette['blue-050'], props.theme.palette['blue-600'], props.theme.palette['blue-600']);
|
|
98
|
-
});
|
|
99
|
-
export var Subject = styled.div.withConfig({
|
|
79
|
+
})(["", " ", ""], (props) => props.isDragOverlay && css(["", "{display:none;}height:50px;overflow:hidden;cursor:grabbing;background:", ";box-shadow:0 16px 32px 0 #23293619;display:flex;align-items:center;", "{display:flex;}"], Step, props.theme.palette.white, DragLabel), (props) => props.isDragged && css(["", "{display:none;}", "{display:block;}height:50px;overflow:hidden;display:flex;align-items:center;justify-content:center;background-color:", ";color:", ";border-left:2px solid ", ";"], Step, DropLabel, props.theme.palette["blue-050"], props.theme.palette["blue-600"], props.theme.palette["blue-600"]));
|
|
80
|
+
const Subject = /* @__PURE__ */ styled.div.withConfig({
|
|
100
81
|
displayName: "Conditionstyle__Subject",
|
|
101
82
|
componentId: "sc-1lk06p3-18"
|
|
102
83
|
})([""]);
|
|
103
|
-
|
|
104
|
-
|
|
84
|
+
const RemoveIconWrapper = /* @__PURE__ */ styled.span.attrs({
|
|
85
|
+
"data-testid": "ds-conditions-remove-row"
|
|
105
86
|
}).withConfig({
|
|
106
87
|
displayName: "Conditionstyle__RemoveIconWrapper",
|
|
107
88
|
componentId: "sc-1lk06p3-19"
|
|
108
89
|
})(["visibility:hidden;pointer-events:none;opacity:0;transition:all 0.3s ease;width:24px;height:32px;display:flex;align-items:center;justify-content:center;margin-left:8px;"]);
|
|
109
|
-
|
|
90
|
+
const ConditionWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
110
91
|
displayName: "Conditionstyle__ConditionWrapper",
|
|
111
92
|
componentId: "sc-1lk06p3-20"
|
|
112
|
-
})(["", ";", "{min-width:0;}", "{min-width:50px;max-width:none;}"],
|
|
113
|
-
|
|
114
|
-
}, InputGroupItem, Value);
|
|
115
|
-
export var ConditionParameterWrapper = styled(ConditionWrapper).withConfig({
|
|
93
|
+
})(["", ";", "{min-width:0;}", "{min-width:50px;max-width:none;}"], (props) => Boolean(props.withRemoveTrigger) && css(["&{display:flex;> *{min-width:0;}}", "{flex:0 0 24px;}"], RemoveIconWrapper), InputGroupItem, Value);
|
|
94
|
+
const ConditionParameterWrapper = /* @__PURE__ */ styled(ConditionWrapper).withConfig({
|
|
116
95
|
displayName: "Conditionstyle__ConditionParameterWrapper",
|
|
117
96
|
componentId: "sc-1lk06p3-21"
|
|
118
97
|
})(["flex:0 400 auto;min-width:120px;"]);
|
|
119
|
-
|
|
98
|
+
const ConditionOperatorWrapper = /* @__PURE__ */ styled(ConditionWrapper).withConfig({
|
|
120
99
|
displayName: "Conditionstyle__ConditionOperatorWrapper",
|
|
121
100
|
componentId: "sc-1lk06p3-22"
|
|
122
101
|
})(["flex:0 0 auto;"]);
|
|
123
|
-
|
|
102
|
+
const ConditionFactorWrapper = /* @__PURE__ */ styled(ConditionWrapper).withConfig({
|
|
124
103
|
displayName: "Conditionstyle__ConditionFactorWrapper",
|
|
125
104
|
componentId: "sc-1lk06p3-23"
|
|
126
105
|
})(["flex:30 1 auto;"]);
|
|
127
|
-
|
|
106
|
+
const ConditionRows = /* @__PURE__ */ styled.div.withConfig({
|
|
128
107
|
displayName: "Conditionstyle__ConditionRows",
|
|
129
108
|
componentId: "sc-1lk06p3-24"
|
|
130
109
|
})(["flex-grow:1;min-width:0;"]);
|
|
131
|
-
|
|
110
|
+
const ConditionRowDefinition = /* @__PURE__ */ styled.div.withConfig({
|
|
132
111
|
displayName: "Conditionstyle__ConditionRowDefinition",
|
|
133
112
|
componentId: "sc-1lk06p3-25"
|
|
134
113
|
})(["display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;"]);
|
|
135
|
-
|
|
114
|
+
const ConditionRowLine = /* @__PURE__ */ styled.div.withConfig({
|
|
136
115
|
displayName: "Conditionstyle__ConditionRowLine",
|
|
137
116
|
componentId: "sc-1lk06p3-26"
|
|
138
117
|
})(["flex-grow:1;min-width:0;"]);
|
|
139
|
-
|
|
118
|
+
const AddConditionRow = /* @__PURE__ */ styled.div.withConfig({
|
|
140
119
|
displayName: "Conditionstyle__AddConditionRow",
|
|
141
120
|
componentId: "sc-1lk06p3-27"
|
|
142
121
|
})(["display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:row;"]);
|
|
143
|
-
|
|
122
|
+
const ConditionConnections = /* @__PURE__ */ styled.span.withConfig({
|
|
144
123
|
displayName: "Conditionstyle__ConditionConnections",
|
|
145
124
|
componentId: "sc-1lk06p3-28"
|
|
146
|
-
})(["display:flex;width:32px;min-width:32px;margin:0 12px;position:relative;height:32px;&:before{position:absolute;content:'';width:", ";height:1px;top:16px;left:", ";background-color:", ";}&:after{display:", ";position:absolute;content:'';width:1px;left:50%;height:auto;top:", ";bottom:", ";background-color:", ";}"],
|
|
147
|
-
|
|
148
|
-
}, function (props) {
|
|
149
|
-
return props.first ? '0' : '16px';
|
|
150
|
-
}, function (props) {
|
|
151
|
-
return props.theme.palette['grey-300'];
|
|
152
|
-
}, function (props) {
|
|
153
|
-
return props.first && props.last || props.last && props.readOnly ? 'none' : 'flex';
|
|
154
|
-
}, function (props) {
|
|
155
|
-
return props.first ? '16px' : '0';
|
|
156
|
-
}, function (props) {
|
|
157
|
-
return props.last ? '16px' : '-100%';
|
|
158
|
-
}, function (props) {
|
|
159
|
-
return props.theme.palette['grey-300'];
|
|
160
|
-
});
|
|
161
|
-
export var ConditionRow = styled.div.withConfig({
|
|
125
|
+
})(["display:flex;width:32px;min-width:32px;margin:0 12px;position:relative;height:32px;&:before{position:absolute;content:'';width:", ";height:1px;top:16px;left:", ";background-color:", ";}&:after{display:", ";position:absolute;content:'';width:1px;left:50%;height:auto;top:", ";bottom:", ";background-color:", ";}"], (props) => props.first ? "100%" : "16px", (props) => props.first ? "0" : "16px", (props) => props.theme.palette["grey-300"], (props) => props.first && props.last || props.last && props.readOnly ? "none" : "flex", (props) => props.first ? "16px" : "0", (props) => props.last ? "16px" : "-100%", (props) => props.theme.palette["grey-300"]);
|
|
126
|
+
const ConditionRow = /* @__PURE__ */ styled.div.withConfig({
|
|
162
127
|
displayName: "Conditionstyle__ConditionRow",
|
|
163
128
|
componentId: "sc-1lk06p3-29"
|
|
164
|
-
})(["padding-bottom:", ";display:flex;flex-grow:1;", "{height:", ";", "}}", "{margin-right:8px;&:last-of-type{margin-right:0;flex-grow:1;min-width:0;}&:only-of-type{flex-grow:0;}}&:hover{", "{opacity:1;visibility:visible;pointer-events:all;cursor:pointer;}}"],
|
|
165
|
-
|
|
166
|
-
}, ConditionConnections, function (props) {
|
|
167
|
-
return props.withError ? 'auto' : '32px';
|
|
168
|
-
}, function (props) {
|
|
169
|
-
return props.withError && css(["&:after{bottom:", ";"], function () {
|
|
170
|
-
return props.last ? '16px' : 'calc(-100% + 24px)';
|
|
171
|
-
});
|
|
172
|
-
}, ConditionWrapper, RemoveIconWrapper);
|
|
173
|
-
export var AddStepButton = styled.div.withConfig({
|
|
129
|
+
})(["padding-bottom:", ";display:flex;flex-grow:1;", "{height:", ";", "}}", "{margin-right:8px;&:last-of-type{margin-right:0;flex-grow:1;min-width:0;}&:only-of-type{flex-grow:0;}}&:hover{", "{opacity:1;visibility:visible;pointer-events:all;cursor:pointer;}}"], (props) => props.onlyChild ? "0" : "16px", ConditionConnections, (props) => props.withError ? "auto" : "32px", (props) => props.withError && css(["&:after{bottom:", ";"], () => props.last ? "16px" : "calc(-100% + 24px)"), ConditionWrapper, RemoveIconWrapper);
|
|
130
|
+
const AddStepButton = /* @__PURE__ */ styled.div.withConfig({
|
|
174
131
|
displayName: "Conditionstyle__AddStepButton",
|
|
175
132
|
componentId: "sc-1lk06p3-30"
|
|
176
133
|
})(["margin:12px 24px 0;"]);
|
|
177
|
-
|
|
134
|
+
const ActionAttribute = /* @__PURE__ */ styled.div.withConfig({
|
|
178
135
|
displayName: "Conditionstyle__ActionAttribute",
|
|
179
136
|
componentId: "sc-1lk06p3-31"
|
|
180
|
-
})(["margin-left:8px;display:flex;"]);
|
|
137
|
+
})(["margin-left:8px;display:flex;"]);
|
|
138
|
+
export {
|
|
139
|
+
ActionAttribute,
|
|
140
|
+
AddConditionRow,
|
|
141
|
+
AddStepButton,
|
|
142
|
+
And,
|
|
143
|
+
Condition,
|
|
144
|
+
ConditionConnections,
|
|
145
|
+
ConditionFactorWrapper,
|
|
146
|
+
ConditionOperatorWrapper,
|
|
147
|
+
ConditionParameterWrapper,
|
|
148
|
+
ConditionRow,
|
|
149
|
+
ConditionRowDefinition,
|
|
150
|
+
ConditionRowLine,
|
|
151
|
+
ConditionRows,
|
|
152
|
+
ConditionStepWrapper,
|
|
153
|
+
ConditionWrapper,
|
|
154
|
+
DragIcon,
|
|
155
|
+
DragLabel,
|
|
156
|
+
DragLabelPart,
|
|
157
|
+
DraggedLabel,
|
|
158
|
+
DropLabel,
|
|
159
|
+
ErrorWrapper,
|
|
160
|
+
LeftSide,
|
|
161
|
+
RemoveIconWrapper,
|
|
162
|
+
Step,
|
|
163
|
+
StepConditionCruds,
|
|
164
|
+
StepConditions,
|
|
165
|
+
StepCruds,
|
|
166
|
+
StepHeader,
|
|
167
|
+
StepIndexWrapper,
|
|
168
|
+
StepName,
|
|
169
|
+
StepWrapper,
|
|
170
|
+
Subject
|
|
171
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { ComponentType, ReactNode, ReactText } from 'react';
|
|
2
|
+
import { ContextGroup, ContextItem, ContextProps } from '@synerise/ds-context-selector';
|
|
3
|
+
import { FactorType, FactorValueComponentProps, FactorValueType, FactorsProps, InputProps, ParameterValueType } from '@synerise/ds-factors';
|
|
4
|
+
import { OperatorsItem, OperatorsProps } from '@synerise/ds-operators';
|
|
5
|
+
import { SubjectItem, SubjectProps } from '@synerise/ds-subject';
|
|
6
6
|
export type ConditionStepCrudActions = {
|
|
7
7
|
removeStep?: (stepId: ReactText) => void;
|
|
8
8
|
duplicateStep?: (stepId: ReactText) => void;
|
package/dist/Condition.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import { default as React } from 'react';
|
|
2
2
|
import type * as T from './AddCondition.types';
|
|
3
3
|
export declare const AddCondition: ({ addCondition, stepId, conditionsNumber, texts, isDisabled, errorText, }: T.AddConditionProps) => React.JSX.Element;
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Button from
|
|
3
|
-
import Icon, { Add2M } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return
|
|
14
|
-
last: true,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
disabled: isDisabled
|
|
27
|
-
}, conditionsNumber > 0 ? texts.addConditionRowButton : texts.addFirstConditionRowButton), !isDisabled && errorText && /*#__PURE__*/React.createElement(S.ErrorWrapper, null, errorText))));
|
|
28
|
-
};
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Button from "@synerise/ds-button";
|
|
3
|
+
import Icon, { Add2M } from "@synerise/ds-icon";
|
|
4
|
+
import { AddConditionRow, ConditionConnections, ConditionRowLine, ErrorWrapper } from "../../Condition.style.js";
|
|
5
|
+
const AddCondition = ({
|
|
6
|
+
addCondition,
|
|
7
|
+
stepId,
|
|
8
|
+
conditionsNumber,
|
|
9
|
+
texts,
|
|
10
|
+
isDisabled = false,
|
|
11
|
+
errorText
|
|
12
|
+
}) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(AddConditionRow, { children: [
|
|
14
|
+
/* @__PURE__ */ jsx(ConditionConnections, { last: true, first: conditionsNumber === 0 }),
|
|
15
|
+
/* @__PURE__ */ jsxs(ConditionRowLine, { children: [
|
|
16
|
+
/* @__PURE__ */ jsx(Button, { icon: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Add2M, {}) }), error: !isDisabled && Boolean(errorText), type: "ghost", mode: "icon-label", onClick: () => {
|
|
17
|
+
addCondition && addCondition(stepId);
|
|
18
|
+
}, disabled: isDisabled, children: conditionsNumber > 0 ? texts.addConditionRowButton : texts.addFirstConditionRowButton }),
|
|
19
|
+
!isDisabled && errorText && /* @__PURE__ */ jsx(ErrorWrapper, { children: errorText })
|
|
20
|
+
] })
|
|
21
|
+
] }) });
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
AddCondition
|
|
25
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ConditionTexts } from '../../Condition.types';
|
|
3
3
|
export type AddConditionProps = {
|
|
4
4
|
addCondition: (stepId: React.ReactText) => void;
|
|
5
5
|
stepId: React.ReactText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import { default as React } from 'react';
|
|
2
2
|
import type * as T from './ConditionRow.types';
|
|
3
3
|
export declare const ConditionRow: ({ index, conditionId, conditionParameter, conditionOperator, conditionFactor, removeCondition, addCondition, minConditionLength, maxConditionLength, conditionsNumber, stepId, currentStepId, currentConditionId, currentField, selectParameter, selectOperator, setStepConditionFactorType, setStepConditionFactorValue, getPopupContainerOverride, onActivate, hasPriority, texts, onDeactivate, inputProps, readOnly, parameterSelectorComponent, factorParameterSelectorComponent, factorValueExtraProps, }: T.ConditionRowProps) => React.JSX.Element;
|