@fileverse-dev/fortune-react 1.2.78-cf-1 → 1.2.78-cf-2
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.
|
@@ -27,6 +27,7 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
27
27
|
editConditionFormatKey = _d[0],
|
|
28
28
|
setEditConditionFormatKey = _d[1];
|
|
29
29
|
var editKeyRef = useRef(null);
|
|
30
|
+
var firstRenderRef = useRef(true);
|
|
30
31
|
var _e = useState(""),
|
|
31
32
|
editConditionRange = _e[0],
|
|
32
33
|
setEditConditionRange = _e[1];
|
|
@@ -89,11 +90,13 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
89
90
|
setMatchedConditionFormatKey(matchedCondition);
|
|
90
91
|
}
|
|
91
92
|
if (buttonClickCreateRef.current) return;
|
|
92
|
-
if (matchedCondition.length
|
|
93
|
-
setCreate(true);
|
|
94
|
-
} else if (matchedCondition.length > 0) {
|
|
93
|
+
if (matchedCondition.length >= 0) {
|
|
95
94
|
setCreate(false);
|
|
96
95
|
}
|
|
96
|
+
if (firstRenderRef.current && matchedCondition.length <= 0) {
|
|
97
|
+
setCreate(true);
|
|
98
|
+
firstRenderRef.current = false;
|
|
99
|
+
}
|
|
97
100
|
}, [context]);
|
|
98
101
|
var updateCacheRules = function updateCacheRules() {
|
|
99
102
|
setContext(function (ctx) {
|
|
@@ -146,7 +149,6 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
146
149
|
buttonClickCreateRef.current = false;
|
|
147
150
|
setCreate(false);
|
|
148
151
|
setContext(function (ctx) {
|
|
149
|
-
console.log("whole rule", ctx.conditionRules);
|
|
150
152
|
ctx.conditionRules.textColor.color = colorRules.textColor;
|
|
151
153
|
ctx.conditionRules.cellColor.color = colorRules.cellColor;
|
|
152
154
|
ctx.conditionRules.font = {
|
|
@@ -203,6 +205,14 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
203
205
|
projectValue: "10"
|
|
204
206
|
};
|
|
205
207
|
});
|
|
208
|
+
setBold(false);
|
|
209
|
+
setItalic(false);
|
|
210
|
+
setUnderline(false);
|
|
211
|
+
setStrikethrough(false);
|
|
212
|
+
setColorRules({
|
|
213
|
+
textColor: "#177E23",
|
|
214
|
+
cellColor: "#DDFBDF"
|
|
215
|
+
});
|
|
206
216
|
updateCacheRules();
|
|
207
217
|
setEditConditionFormatKey(null);
|
|
208
218
|
setContext(function (ctx) {
|
|
@@ -471,7 +481,7 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
471
481
|
}, (type === "greaterThan" || type === "greaterThanOrEqual" || type === "lessThan" || type === "lessThanOrEqual" || type === "equal" || type === "textContains") && (/*#__PURE__*/React.createElement("div", {
|
|
472
482
|
className: "w-full"
|
|
473
483
|
}, /*#__PURE__*/React.createElement(TextField, {
|
|
474
|
-
placeholder: "Value",
|
|
484
|
+
placeholder: "Value is required",
|
|
475
485
|
onKeyDown: function onKeyDown(e) {
|
|
476
486
|
e.stopPropagation();
|
|
477
487
|
},
|
|
@@ -306,7 +306,7 @@ var FxEditor = function FxEditor() {
|
|
|
306
306
|
}, /*#__PURE__*/React.createElement(NameBox, null), /*#__PURE__*/React.createElement("div", {
|
|
307
307
|
className: "fortune-fx-icon",
|
|
308
308
|
style: {
|
|
309
|
-
cursor:
|
|
309
|
+
cursor: "pointer"
|
|
310
310
|
},
|
|
311
311
|
onClick: function onClick() {
|
|
312
312
|
var _a;
|
|
@@ -36,6 +36,7 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
36
36
|
editConditionFormatKey = _d[0],
|
|
37
37
|
setEditConditionFormatKey = _d[1];
|
|
38
38
|
var editKeyRef = (0, _react.useRef)(null);
|
|
39
|
+
var firstRenderRef = (0, _react.useRef)(true);
|
|
39
40
|
var _e = (0, _react.useState)(""),
|
|
40
41
|
editConditionRange = _e[0],
|
|
41
42
|
setEditConditionRange = _e[1];
|
|
@@ -98,11 +99,13 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
98
99
|
setMatchedConditionFormatKey(matchedCondition);
|
|
99
100
|
}
|
|
100
101
|
if (buttonClickCreateRef.current) return;
|
|
101
|
-
if (matchedCondition.length
|
|
102
|
-
setCreate(true);
|
|
103
|
-
} else if (matchedCondition.length > 0) {
|
|
102
|
+
if (matchedCondition.length >= 0) {
|
|
104
103
|
setCreate(false);
|
|
105
104
|
}
|
|
105
|
+
if (firstRenderRef.current && matchedCondition.length <= 0) {
|
|
106
|
+
setCreate(true);
|
|
107
|
+
firstRenderRef.current = false;
|
|
108
|
+
}
|
|
106
109
|
}, [context]);
|
|
107
110
|
var updateCacheRules = function updateCacheRules() {
|
|
108
111
|
setContext(function (ctx) {
|
|
@@ -155,7 +158,6 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
155
158
|
buttonClickCreateRef.current = false;
|
|
156
159
|
setCreate(false);
|
|
157
160
|
setContext(function (ctx) {
|
|
158
|
-
console.log("whole rule", ctx.conditionRules);
|
|
159
161
|
ctx.conditionRules.textColor.color = colorRules.textColor;
|
|
160
162
|
ctx.conditionRules.cellColor.color = colorRules.cellColor;
|
|
161
163
|
ctx.conditionRules.font = {
|
|
@@ -212,6 +214,14 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
212
214
|
projectValue: "10"
|
|
213
215
|
};
|
|
214
216
|
});
|
|
217
|
+
setBold(false);
|
|
218
|
+
setItalic(false);
|
|
219
|
+
setUnderline(false);
|
|
220
|
+
setStrikethrough(false);
|
|
221
|
+
setColorRules({
|
|
222
|
+
textColor: "#177E23",
|
|
223
|
+
cellColor: "#DDFBDF"
|
|
224
|
+
});
|
|
215
225
|
updateCacheRules();
|
|
216
226
|
setEditConditionFormatKey(null);
|
|
217
227
|
setContext(function (ctx) {
|
|
@@ -480,7 +490,7 @@ var ConditionRules = function ConditionRules(_a) {
|
|
|
480
490
|
}, (type === "greaterThan" || type === "greaterThanOrEqual" || type === "lessThan" || type === "lessThanOrEqual" || type === "equal" || type === "textContains") && (/*#__PURE__*/_react.default.createElement("div", {
|
|
481
491
|
className: "w-full"
|
|
482
492
|
}, /*#__PURE__*/_react.default.createElement(_ui.TextField, {
|
|
483
|
-
placeholder: "Value",
|
|
493
|
+
placeholder: "Value is required",
|
|
484
494
|
onKeyDown: function onKeyDown(e) {
|
|
485
495
|
e.stopPropagation();
|
|
486
496
|
},
|
|
@@ -315,7 +315,7 @@ var FxEditor = function FxEditor() {
|
|
|
315
315
|
}, /*#__PURE__*/_react.default.createElement(_NameBox.default, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
316
316
|
className: "fortune-fx-icon",
|
|
317
317
|
style: {
|
|
318
|
-
cursor:
|
|
318
|
+
cursor: "pointer"
|
|
319
319
|
},
|
|
320
320
|
onClick: function onClick() {
|
|
321
321
|
var _a;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.2.78-cf-
|
|
3
|
+
"version": "1.2.78-cf-2",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"tsc": "tsc"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@fileverse-dev/fortune-core": "1.2.78-cf-
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.2.78-cf-2",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-40",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|