@fileverse-dev/fortune-react 1.2.64-patch-12 → 1.2.65

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.
Files changed (33) hide show
  1. package/es/components/ConditionFormat/ConditionRules.d.ts +1 -3
  2. package/es/components/ConditionFormat/ConditionRules.js +79 -408
  3. package/es/components/ConditionFormat/index.css +5 -62
  4. package/es/components/ConditionFormat/index.js +4 -2
  5. package/es/components/ContextMenu/index.js +41 -10
  6. package/es/components/SheetOverlay/helper.d.ts +0 -1
  7. package/es/components/SheetOverlay/helper.js +1 -1
  8. package/es/components/Toolbar/index.d.ts +1 -1
  9. package/es/components/Toolbar/index.js +25 -49
  10. package/es/components/Workbook/api.d.ts +0 -4
  11. package/es/components/Workbook/api.js +0 -4
  12. package/es/components/Workbook/index.d.ts +0 -4
  13. package/es/components/Workbook/index.js +0 -3
  14. package/lib/components/ConditionFormat/ConditionRules.d.ts +1 -3
  15. package/lib/components/ConditionFormat/ConditionRules.js +77 -405
  16. package/lib/components/ConditionFormat/index.css +5 -62
  17. package/lib/components/ConditionFormat/index.js +3 -1
  18. package/lib/components/ContextMenu/index.js +41 -10
  19. package/lib/components/SheetOverlay/helper.d.ts +0 -1
  20. package/lib/components/SheetOverlay/helper.js +0 -1
  21. package/lib/components/Toolbar/index.d.ts +1 -1
  22. package/lib/components/Toolbar/index.js +25 -49
  23. package/lib/components/Workbook/api.d.ts +0 -4
  24. package/lib/components/Workbook/api.js +0 -4
  25. package/lib/components/Workbook/index.d.ts +0 -4
  26. package/lib/components/Workbook/index.js +0 -3
  27. package/package.json +2 -2
  28. package/es/components/ConditionFormat/formating.css +0 -103
  29. package/es/components/Toolbar/conditionalFormatPortal.d.ts +0 -6
  30. package/es/components/Toolbar/conditionalFormatPortal.js +0 -13
  31. package/lib/components/ConditionFormat/formating.css +0 -103
  32. package/lib/components/Toolbar/conditionalFormatPortal.d.ts +0 -6
  33. package/lib/components/Toolbar/conditionalFormatPortal.js +0 -20
@@ -1,8 +1,6 @@
1
1
  import React from "react";
2
2
  import "./index.css";
3
- import "./formating.css";
4
3
  declare const ConditionRules: React.FC<{
5
- type?: string;
6
- context?: any;
4
+ type: string;
7
5
  }>;
8
6
  export default ConditionRules;
@@ -1,87 +1,30 @@
1
- import React, { useRef, useCallback, useContext, useEffect, useState } from "react";
1
+ import React, { useCallback, useContext, useEffect, useState } from "react";
2
2
  import "./index.css";
3
- import { cn } from "@fileverse/ui";
4
- import { locale, setConditionRules, getSheetIndex } from "@fileverse-dev/fortune-core";
5
- import { numberToColumn } from "../SheetOverlay/helper";
6
- import "./formating.css";
3
+ import { locale, setConditionRules } from "@fileverse-dev/fortune-core";
7
4
  import produce from "immer";
8
- import { Button, IconButton, LucideIcon, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, TextField } from "@fileverse/ui";
5
+ import { Button, Checkbox, Divider, IconButton, LucideIcon, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, TextField } from "@fileverse/ui";
9
6
  import WorkbookContext from "../../context";
10
7
  import { useDialog } from "../../hooks/useDialog";
11
8
  import { getDisplayedRangeTxt } from "../DataVerification/getDisplayedRangeTxt";
12
9
  import { injectDatepickerStyles } from "../../utils/datepickerStyles";
13
10
  injectDatepickerStyles();
14
11
  var ConditionRules = function ConditionRules(_a) {
15
- var rulesType = _a.type,
16
- context = _a.context;
17
- var _b = useState('greaterThan'),
18
- type = _b[0],
19
- setType = _b[1];
20
- var _c = useState(false),
21
- create = _c[0],
22
- setCreate = _c[1];
23
- var buttonClickCreateRef = useRef(false);
24
- var _d = useState([]),
25
- matchedConditionFormatKey = _d[0],
26
- setMatchedConditionFormatKey = _d[1];
27
- var _e = useState(null),
28
- allConditionFormats = _e[0],
29
- setAllConditionFormats = _e[1];
30
- var setContext = useContext(WorkbookContext).setContext;
12
+ var type = _a.type;
13
+ var _b = useContext(WorkbookContext),
14
+ context = _b.context,
15
+ setContext = _b.setContext;
31
16
  var hideDialog = useDialog().hideDialog;
32
- var _f = locale(context),
33
- conditionformat = _f.conditionformat,
34
- button = _f.button,
35
- protection = _f.protection,
36
- generalDialog = _f.generalDialog;
37
- var _g = useState({
17
+ var _c = locale(context),
18
+ conditionformat = _c.conditionformat,
19
+ button = _c.button,
20
+ protection = _c.protection,
21
+ generalDialog = _c.generalDialog;
22
+ var _d = useState({
38
23
  textColor: "#FFFFFF",
39
24
  cellColor: "#D82E2A"
40
25
  }),
41
- colorRules = _g[0],
42
- setColorRules = _g[1];
43
- var _h = useState(false),
44
- bold = _h[0],
45
- setBold = _h[1];
46
- var _j = useState(false),
47
- italic = _j[0],
48
- setItalic = _j[1];
49
- var _k = useState(false),
50
- underline = _k[0],
51
- setUnderline = _k[1];
52
- var _l = useState(false),
53
- strikethrough = _l[0],
54
- setStrikethrough = _l[1];
55
- useEffect(function () {
56
- var _a, _b, _c;
57
- var index = getSheetIndex(context, context === null || context === void 0 ? void 0 : context.currentSheetId) || 0;
58
- var allCondition = context.luckysheetfile[index].luckysheet_conditionformat_save;
59
- setAllConditionFormats(allCondition);
60
- var selectionColumn = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0].column;
61
- var selectionRow = (_b = context.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b[0].row;
62
- var matchedCondition = [];
63
- if (allCondition) {
64
- for (var key in allCondition) {
65
- var conditionFormat = allCondition[key];
66
- var range = (_c = conditionFormat.cellrange) === null || _c === void 0 ? void 0 : _c[0];
67
- if (!range || !selectionColumn || !selectionRow) continue;
68
- var rangeColumns = range.column;
69
- var rangeRows = range.row;
70
- var isColumnOverlap = !(selectionColumn[1] < rangeColumns[0] || selectionColumn[0] > rangeColumns[1]);
71
- var isRowOverlap = !(selectionRow[1] < rangeRows[0] || selectionRow[0] > rangeRows[1]);
72
- if (isColumnOverlap && isRowOverlap) {
73
- matchedCondition.push(key);
74
- }
75
- }
76
- setMatchedConditionFormatKey(matchedCondition);
77
- }
78
- if (buttonClickCreateRef.current) return;
79
- if (matchedCondition.length === 0) {
80
- setCreate(true);
81
- } else if (matchedCondition.length > 0) {
82
- setCreate(false);
83
- }
84
- }, [context]);
26
+ colorRules = _d[0],
27
+ setColorRules = _d[1];
85
28
  var dataSelectRange = useCallback(function (selectType) {
86
29
  hideDialog();
87
30
  setContext(function (ctx) {
@@ -95,26 +38,15 @@ var ConditionRules = function ConditionRules(_a) {
95
38
  }, [colorRules.cellColor, colorRules.textColor, hideDialog, setContext]);
96
39
  var close = useCallback(function (closeType) {
97
40
  if (closeType === "confirm") {
98
- buttonClickCreateRef.current = false;
99
- setCreate(false);
100
41
  setContext(function (ctx) {
101
42
  ctx.conditionRules.textColor.color = colorRules.textColor;
102
43
  ctx.conditionRules.cellColor.color = colorRules.cellColor;
103
- ctx.conditionRules.font = {
104
- bold: bold,
105
- italic: italic,
106
- underline: underline,
107
- strikethrough: strikethrough
108
- };
109
44
  setConditionRules(ctx, protection, generalDialog, conditionformat, ctx.conditionRules);
110
45
  });
111
- } else {
112
- buttonClickCreateRef.current = true;
113
- setCreate(false);
114
46
  }
115
47
  setContext(function (ctx) {
116
48
  ctx.conditionRules = {
117
- rulesType: "greaterThan",
49
+ rulesType: "",
118
50
  rulesValue: "",
119
51
  textColor: {
120
52
  check: true,
@@ -124,12 +56,6 @@ var ConditionRules = function ConditionRules(_a) {
124
56
  check: true,
125
57
  color: "#000000"
126
58
  },
127
- font: {
128
- bold: false,
129
- italic: false,
130
- underline: false,
131
- strikethrough: false
132
- },
133
59
  betweenValue: {
134
60
  value1: "",
135
61
  value2: ""
@@ -140,7 +66,7 @@ var ConditionRules = function ConditionRules(_a) {
140
66
  };
141
67
  });
142
68
  hideDialog();
143
- }, [colorRules, conditionformat, generalDialog, hideDialog, protection, setContext, bold, italic, underline, strikethrough]);
69
+ }, [colorRules, conditionformat, generalDialog, hideDialog, protection, setContext]);
144
70
  useEffect(function () {
145
71
  setContext(function (ctx) {
146
72
  ctx.conditionRules.rulesType = type;
@@ -165,12 +91,6 @@ var ConditionRules = function ConditionRules(_a) {
165
91
  check: true,
166
92
  color: "#000000"
167
93
  },
168
- font: {
169
- bold: false,
170
- italic: false,
171
- underline: false,
172
- strikethrough: false
173
- },
174
94
  betweenValue: {
175
95
  value1: "",
176
96
  value2: ""
@@ -183,186 +103,17 @@ var ConditionRules = function ConditionRules(_a) {
183
103
  ctx.rangeDialog.type = "";
184
104
  ctx.rangeDialog.rangeTxt = "";
185
105
  });
186
- }, [type]);
187
- var conditionList = [{
188
- text: "greaterThan",
189
- value: ">",
190
- label: "Greater Than"
191
- }, {
192
- text: "greaterThanOrEqual",
193
- value: ">=",
194
- label: "Greater Than or Equal"
195
- }, {
196
- text: "lessThan",
197
- value: "<",
198
- label: "Less Than"
199
- }, {
200
- text: "lessThanOrEqual",
201
- value: "<=",
202
- label: "Less Than or Equal"
203
- }, {
204
- text: "between",
205
- value: "[]",
206
- label: "Between"
207
- }, {
208
- text: "equal",
209
- value: "=",
210
- label: "Equal"
211
- }, {
212
- text: "textContains",
213
- value: "()",
214
- label: "Text Contains"
215
- }, {
216
- text: "occurrenceDate",
217
- value: conditionformat.yesterday,
218
- label: "Occurrence Date"
219
- }, {
220
- text: "duplicateValue",
221
- value: "##",
222
- label: "Duplicate Value"
223
- }, {
224
- text: "top10",
225
- value: conditionformat.top10
226
- }, {
227
- text: "top10_percent",
228
- value: conditionformat.top10_percent,
229
- label: "Top 10 Percent"
230
- }, {
231
- text: "last10",
232
- value: conditionformat.last10,
233
- label: "Last 10"
234
- }, {
235
- text: "last10_percent",
236
- value: conditionformat.last10_percent,
237
- label: "Last 10 Percent"
238
- }, {
239
- text: "aboveAverage",
240
- value: conditionformat.above,
241
- label: "Above Average"
242
- }, {
243
- text: "belowAverage",
244
- value: conditionformat.below,
245
- label: "Below Average"
246
- }];
106
+ }, []);
247
107
  var titleType = type === "top10_percent" ? "top10" : type === "last10_percent" ? "last10" : type;
248
108
  return /*#__PURE__*/React.createElement("div", {
249
109
  className: "condition-rules"
250
- }, !create ? (/*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
251
- style: {
252
- marginBottom: "16px"
253
- }
254
- }, matchedConditionFormatKey.map(function (key) {
255
- var _a, _b;
256
- return /*#__PURE__*/React.createElement("div", {
257
- className: "group flex items-center border-b border-gray-200 condition-list-parent",
258
- key: key
259
- }, /*#__PURE__*/React.createElement("div", {
260
- className: "condition-list-pill",
261
- style: {
262
- backgroundColor: allConditionFormats[key].format.cellColor || ""
263
- }
264
- }, /*#__PURE__*/React.createElement("span", {
265
- className: "condition-list-text",
266
- style: {
267
- color: allConditionFormats[key].format.textColor || ""
268
- }
269
- }, "123")), /*#__PURE__*/React.createElement("div", {
270
- className: "flex flex-col",
271
- style: {
272
- width: '200px',
273
- padding: '8px 0px'
274
- }
275
- }, /*#__PURE__*/React.createElement("h3", {
276
- className: "condition-list-type"
277
- }, conditionformat[allConditionFormats[key].conditionName], ' ', (_a = allConditionFormats[key].conditionValue) === null || _a === void 0 ? void 0 : _a[0]), /*#__PURE__*/React.createElement("p", {
278
- className: "condition-list-range"
279
- }, (_b = allConditionFormats[key].cellrange) === null || _b === void 0 ? void 0 : _b.map(function (range) {
280
- var startCol = numberToColumn(range.column[0] + 1);
281
- var endCol = numberToColumn(range.column[1] + 1);
282
- var startRow = range.row[0] + 1;
283
- var endRow = range.row[1] + 1;
284
- return "".concat(startCol).concat(startRow, ":").concat(endCol).concat(endRow);
285
- }).join(", "))), /*#__PURE__*/React.createElement("div", {
286
- className: "opacity-0 group-hover:opacity-100 transition-opacity"
287
- }, /*#__PURE__*/React.createElement(IconButton, {
288
- elevation: 1,
289
- icon: "Trash2",
290
- size: "md",
291
- variant: "secondary",
292
- style: {
293
- border: '0px',
294
- boxShadow: 'none',
295
- color: 'hsl(var(--color-icon-secondary))'
296
- },
297
- onClick: function onClick() {
298
- setContext(function (ctx) {
299
- var index = getSheetIndex(ctx, ctx.currentSheetId);
300
- var ruleArr = ctx.luckysheetfile[index].luckysheet_conditionformat_save || [];
301
- console.log(matchedConditionFormatKey, ruleArr, allConditionFormats);
302
- ruleArr.splice(Number(key), 1);
303
- ctx.luckysheetfile[index].luckysheet_conditionformat_save = ruleArr;
304
- return ctx;
305
- });
306
- }
307
- })));
308
- })), /*#__PURE__*/React.createElement(Button, {
309
- size: "md",
310
- variant: "secondary",
311
- onClick: function onClick() {
312
- setCreate(true);
313
- buttonClickCreateRef.current = true;
314
- }
315
- }, "Create New Condition Format"))) : (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
110
+ }, !["aboveAverage", "belowAverage"].includes(type) && (/*#__PURE__*/React.createElement("div", {
316
111
  className: "flex flex-col"
317
112
  }, /*#__PURE__*/React.createElement("div", {
318
113
  className: "condition-rules-value text-heading-xsm"
319
- }, conditionformat.applyRange, " range"), /*#__PURE__*/React.createElement(TextField, {
320
- rightIcon: /*#__PURE__*/React.createElement(LucideIcon, {
321
- name: "Grid2x2",
322
- size: "sm",
323
- onClick: function onClick() {
324
- dataSelectRange("conditionRules".concat(type));
325
- }
326
- }),
327
- "aria-hidden": "true",
328
- readOnly: true,
329
- placeholder: conditionformat.selectRange,
330
- value: getDisplayedRangeTxt(context),
331
- onClick: function onClick() {
332
- dataSelectRange("conditionRules".concat(type));
333
- }
334
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
335
- className: "condition-rules-value text-heading-xsm"
336
- }, "Format cells if"), /*#__PURE__*/React.createElement(Select, {
337
- value: type,
338
- onValueChange: function onValueChange(value) {
339
- setType(value);
340
- }
341
- }, /*#__PURE__*/React.createElement(SelectTrigger, null, /*#__PURE__*/React.createElement(SelectValue, null, /*#__PURE__*/React.createElement("div", {
342
- className: "flex items-center gap-2"
343
- }, /*#__PURE__*/React.createElement("span", null, conditionformat[type])))), /*#__PURE__*/React.createElement(SelectContent, {
344
- position: "popper",
345
- side: "bottom",
346
- align: "start",
347
- sideOffset: 4,
348
- className: "z-[100]",
349
- "data-dropdown-content": "true"
350
- }, conditionList.map(function (option) {
351
- return /*#__PURE__*/React.createElement(SelectItem, {
352
- key: option.value,
353
- value: option.text
354
- }, /*#__PURE__*/React.createElement("div", {
355
- className: "flex items-center gap-2"
356
- }, /*#__PURE__*/React.createElement("span", null, conditionformat[option.text])));
357
- })))), !["aboveAverage", "belowAverage"].includes(type) && (/*#__PURE__*/React.createElement("div", {
358
- className: "flex flex-col"
359
- }, (type === "greaterThan" || type === "greaterThanOrEqual" || type === "lessThan" || type === "lessThanOrEqual" || type === "equal" || type === "textContains") && (/*#__PURE__*/React.createElement("div", {
114
+ }, conditionformat["conditionformat_".concat(titleType, "_title")]), (type === "greaterThan" || type === "greaterThanOrEqual" || type === "lessThan" || type === "lessThanOrEqual" || type === "equal" || type === "textContains") && (/*#__PURE__*/React.createElement("div", {
360
115
  className: "w-full"
361
116
  }, /*#__PURE__*/React.createElement(TextField, {
362
- placeholder: "Value",
363
- onKeyDown: function onKeyDown(e) {
364
- e.stopPropagation();
365
- },
366
117
  value: context.conditionRules.rulesValue,
367
118
  onChange: function onChange(e) {
368
119
  var value = e.target.value;
@@ -375,9 +126,6 @@ var ConditionRules = function ConditionRules(_a) {
375
126
  }, /*#__PURE__*/React.createElement("div", {
376
127
  className: "w-full"
377
128
  }, /*#__PURE__*/React.createElement(TextField, {
378
- onKeyDown: function onKeyDown(e) {
379
- e.stopPropagation();
380
- },
381
129
  placeholder: "From",
382
130
  value: context.conditionRules.betweenValue.value1,
383
131
  onChange: function onChange(e) {
@@ -389,9 +137,6 @@ var ConditionRules = function ConditionRules(_a) {
389
137
  })), /*#__PURE__*/React.createElement("div", {
390
138
  className: "w-full"
391
139
  }, /*#__PURE__*/React.createElement(TextField, {
392
- onKeyDown: function onKeyDown(e) {
393
- e.stopPropagation();
394
- },
395
140
  placeholder: "To",
396
141
  value: context.conditionRules.betweenValue.value2,
397
142
  onChange: function onChange(e) {
@@ -443,10 +188,6 @@ var ConditionRules = function ConditionRules(_a) {
443
188
  });
444
189
  }
445
190
  }), /*#__PURE__*/React.createElement(TextField, {
446
- placeholder: "Value",
447
- onKeyDown: function onKeyDown(e) {
448
- e.stopPropagation();
449
- },
450
191
  className: "condition-rules-project-input pr-0",
451
192
  type: "number",
452
193
  min: 1,
@@ -477,116 +218,47 @@ var ConditionRules = function ConditionRules(_a) {
477
218
  })))))), /*#__PURE__*/React.createElement("div", {
478
219
  className: "flex flex-col"
479
220
  }, /*#__PURE__*/React.createElement("div", {
480
- className: "condition-rules-set-title text-heading-xsm"
481
- }, "Formatting styles"), /*#__PURE__*/React.createElement("div", {
482
- className: "toolbar-container"
483
- }, /*#__PURE__*/React.createElement("div", {
484
- className: "toolbar-header"
485
- }, /*#__PURE__*/React.createElement("h2", {
486
- className: "toolbar-title"
487
- }, "Formatting styles preview")), /*#__PURE__*/React.createElement("div", {
488
- className: "toolbar-content"
489
- }, /*#__PURE__*/React.createElement(Button, {
490
- variant: "ghost",
491
- onClick: function onClick() {
492
- return setBold(!bold);
493
- },
494
- className: cn("fortune-toolbar-combo-button !min-w-fit !px-0", {}),
495
- style: {
496
- width: 30,
497
- height: 30,
498
- backgroundColor: bold ? "hsl(var(--color-bg-default-selected))" : ""
499
- }
500
- }, /*#__PURE__*/React.createElement(LucideIcon, {
501
- name: "Bold",
502
- style: {
503
- width: '16px',
504
- height: '16px'
505
- }
506
- })), /*#__PURE__*/React.createElement(Button, {
507
- variant: "ghost",
508
- onClick: function onClick() {
509
- return setItalic(!italic);
510
- },
511
- className: cn("fortune-toolbar-combo-button !min-w-fit !px-0", {}),
512
- style: {
513
- width: 30,
514
- height: 30
515
- }
516
- }, /*#__PURE__*/React.createElement(LucideIcon, {
517
- name: "Italic",
518
- style: {
519
- width: '16px',
520
- height: '16px'
521
- }
522
- })), /*#__PURE__*/React.createElement(Button, {
523
- variant: "ghost",
524
- onClick: function onClick() {
525
- return setUnderline(!underline);
526
- },
527
- className: cn("fortune-toolbar-combo-button !min-w-fit !px-0", {}),
528
- style: {
529
- width: 30,
530
- height: 30
531
- }
532
- }, /*#__PURE__*/React.createElement(LucideIcon, {
533
- name: "Underline",
534
- style: {
535
- width: '16px',
536
- height: '16px'
537
- }
538
- })), /*#__PURE__*/React.createElement(Button, {
539
- variant: "ghost",
221
+ className: "condition-rules-value text-heading-xsm"
222
+ }, conditionformat.applyRange), /*#__PURE__*/React.createElement(TextField, {
223
+ rightIcon: /*#__PURE__*/React.createElement(LucideIcon, {
224
+ name: "Grid2x2",
225
+ size: "sm",
226
+ onClick: function onClick() {
227
+ dataSelectRange("conditionRules".concat(type));
228
+ }
229
+ }),
230
+ "aria-hidden": "true",
231
+ readOnly: true,
232
+ placeholder: conditionformat.selectRange,
233
+ value: getDisplayedRangeTxt(context),
540
234
  onClick: function onClick() {
541
- return setStrikethrough(!strikethrough);
542
- },
543
- className: cn("fortune-toolbar-combo-button !min-w-fit !px-0", {}),
544
- style: {
545
- width: 30,
546
- height: 30
547
- }
548
- }, /*#__PURE__*/React.createElement(LucideIcon, {
549
- name: "Strikethrough",
550
- style: {
551
- width: '16px',
552
- height: '16px'
553
- }
554
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
555
- variant: "ghost",
556
- className: cn("fortune-toolbar-combo-button !min-w-fit !px-0", {}),
557
- style: {
558
- width: 30,
559
- height: 30
235
+ dataSelectRange("conditionRules".concat(type));
560
236
  }
237
+ })), /*#__PURE__*/React.createElement("div", {
238
+ className: "flex flex-col"
561
239
  }, /*#__PURE__*/React.createElement("div", {
562
- style: {
563
- display: 'flex',
564
- flexDirection: 'column',
565
- alignItems: 'center'
240
+ className: "condition-rules-set-title text-heading-xsm"
241
+ }, "".concat(conditionformat.setAs, "\uFF1A")), /*#__PURE__*/React.createElement("div", {
242
+ className: "condition-rules-setbox"
243
+ }, /*#__PURE__*/React.createElement("div", {
244
+ className: "condition-rules-set"
245
+ }, /*#__PURE__*/React.createElement("div", {
246
+ className: "condition-rules-color"
247
+ }, /*#__PURE__*/React.createElement("span", {
248
+ id: "checkTextColor"
249
+ }, /*#__PURE__*/React.createElement(Checkbox, {
250
+ className: "border-2",
251
+ checked: context.conditionRules.textColor.check,
252
+ onCheckedChange: function onCheckedChange(e) {
253
+ var checked = e.target.checked;
254
+ setContext(function (ctx) {
255
+ ctx.conditionRules.textColor.check = checked;
256
+ });
566
257
  }
567
- }, /*#__PURE__*/React.createElement("svg", {
568
- style: {
569
- width: '19px',
570
- height: '19px'
571
- },
572
- xmlns: "http://www.w3.org/2000/svg",
573
- width: "24",
574
- height: "24",
575
- viewBox: "0 0 24 24",
576
- fill: "none",
577
- stroke: "currentColor",
578
- "stroke-width": "2",
579
- "stroke-linecap": "round",
580
- "stroke-linejoin": "round",
581
- className: "lucide lucide-spell-check2-icon lucide-spell-check-2"
582
- }, /*#__PURE__*/React.createElement("path", {
583
- d: "m5 18 6-12 6 12"
584
- }), /*#__PURE__*/React.createElement("path", {
585
- d: "M7 14h8"
586
- })), /*#__PURE__*/React.createElement("input", {
587
- style: {
588
- marginBottom: "4px"
589
- },
258
+ })), /*#__PURE__*/React.createElement("label", {
259
+ htmlFor: "checkTextColor",
260
+ className: "condition-rules-label"
261
+ }, conditionformat.textColor), /*#__PURE__*/React.createElement("input", {
590
262
  type: "color",
591
263
  className: "condition-rules-select-color",
592
264
  value: colorRules.textColor,
@@ -596,25 +268,25 @@ var ConditionRules = function ConditionRules(_a) {
596
268
  draft.textColor = value;
597
269
  }));
598
270
  }
599
- })))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
600
- variant: "ghost",
601
- className: cn("fortune-toolbar-combo-button !min-w-fit !px-0", {}),
602
- style: {
603
- width: 30,
604
- height: 30
605
- }
271
+ }))), /*#__PURE__*/React.createElement("div", {
272
+ className: "condition-rules-set"
606
273
  }, /*#__PURE__*/React.createElement("div", {
607
- style: {
608
- display: 'flex',
609
- flexDirection: 'column'
610
- }
611
- }, /*#__PURE__*/React.createElement(LucideIcon, {
612
- name: "PaintBucket",
613
- style: {
614
- width: '16px',
615
- height: '16px'
274
+ className: "condition-rules-color"
275
+ }, /*#__PURE__*/React.createElement("span", {
276
+ id: "checkCellColor"
277
+ }, /*#__PURE__*/React.createElement(Checkbox, {
278
+ className: "border-2",
279
+ checked: context.conditionRules.cellColor.check,
280
+ onCheckedChange: function onCheckedChange(e) {
281
+ var checked = e.target.checked;
282
+ setContext(function (ctx) {
283
+ ctx.conditionRules.cellColor.check = checked;
284
+ });
616
285
  }
617
- }), /*#__PURE__*/React.createElement("input", {
286
+ })), /*#__PURE__*/React.createElement("label", {
287
+ htmlFor: "checkCellColor",
288
+ className: "condition-rules-label"
289
+ }, conditionformat.cellColor), /*#__PURE__*/React.createElement("input", {
618
290
  type: "color",
619
291
  className: "condition-rules-select-color",
620
292
  value: colorRules.cellColor,
@@ -624,11 +296,10 @@ var ConditionRules = function ConditionRules(_a) {
624
296
  draft.cellColor = value;
625
297
  }));
626
298
  }
627
- }))))))), /*#__PURE__*/React.createElement("div", {
628
- className: "flex gap-2 justify-end",
629
- style: {
630
- marginTop: "8px"
631
- }
299
+ }))))), /*#__PURE__*/React.createElement(Divider, {
300
+ className: "w-full border-t-[1px]"
301
+ }), /*#__PURE__*/React.createElement("div", {
302
+ className: "flex gap-2 justify-end"
632
303
  }, /*#__PURE__*/React.createElement(Button, {
633
304
  variant: "secondary",
634
305
  style: {
@@ -647,6 +318,6 @@ var ConditionRules = function ConditionRules(_a) {
647
318
  close("confirm");
648
319
  },
649
320
  tabIndex: 0
650
- }, "Create rule")))));
321
+ }, button.apply)));
651
322
  };
652
323
  export default ConditionRules;