@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
@@ -7,11 +7,9 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  require("./index.css");
10
- var _ui = require("@fileverse/ui");
11
10
  var _fortuneCore = require("@fileverse-dev/fortune-core");
12
- var _helper = require("../SheetOverlay/helper");
13
- require("./formating.css");
14
11
  var _immer = _interopRequireDefault(require("immer"));
12
+ var _ui = require("@fileverse/ui");
15
13
  var _context = _interopRequireDefault(require("../../context"));
16
14
  var _useDialog = require("../../hooks/useDialog");
17
15
  var _getDisplayedRangeTxt = require("../DataVerification/getDisplayedRangeTxt");
@@ -20,76 +18,22 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
20
18
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
21
19
  (0, _datepickerStyles.injectDatepickerStyles)();
22
20
  var ConditionRules = function ConditionRules(_a) {
23
- var rulesType = _a.type,
24
- context = _a.context;
25
- var _b = (0, _react.useState)('greaterThan'),
26
- type = _b[0],
27
- setType = _b[1];
28
- var _c = (0, _react.useState)(false),
29
- create = _c[0],
30
- setCreate = _c[1];
31
- var buttonClickCreateRef = (0, _react.useRef)(false);
32
- var _d = (0, _react.useState)([]),
33
- matchedConditionFormatKey = _d[0],
34
- setMatchedConditionFormatKey = _d[1];
35
- var _e = (0, _react.useState)(null),
36
- allConditionFormats = _e[0],
37
- setAllConditionFormats = _e[1];
38
- var setContext = (0, _react.useContext)(_context.default).setContext;
21
+ var type = _a.type;
22
+ var _b = (0, _react.useContext)(_context.default),
23
+ context = _b.context,
24
+ setContext = _b.setContext;
39
25
  var hideDialog = (0, _useDialog.useDialog)().hideDialog;
40
- var _f = (0, _fortuneCore.locale)(context),
41
- conditionformat = _f.conditionformat,
42
- button = _f.button,
43
- protection = _f.protection,
44
- generalDialog = _f.generalDialog;
45
- var _g = (0, _react.useState)({
26
+ var _c = (0, _fortuneCore.locale)(context),
27
+ conditionformat = _c.conditionformat,
28
+ button = _c.button,
29
+ protection = _c.protection,
30
+ generalDialog = _c.generalDialog;
31
+ var _d = (0, _react.useState)({
46
32
  textColor: "#FFFFFF",
47
33
  cellColor: "#D82E2A"
48
34
  }),
49
- colorRules = _g[0],
50
- setColorRules = _g[1];
51
- var _h = (0, _react.useState)(false),
52
- bold = _h[0],
53
- setBold = _h[1];
54
- var _j = (0, _react.useState)(false),
55
- italic = _j[0],
56
- setItalic = _j[1];
57
- var _k = (0, _react.useState)(false),
58
- underline = _k[0],
59
- setUnderline = _k[1];
60
- var _l = (0, _react.useState)(false),
61
- strikethrough = _l[0],
62
- setStrikethrough = _l[1];
63
- (0, _react.useEffect)(function () {
64
- var _a, _b, _c;
65
- var index = (0, _fortuneCore.getSheetIndex)(context, context === null || context === void 0 ? void 0 : context.currentSheetId) || 0;
66
- var allCondition = context.luckysheetfile[index].luckysheet_conditionformat_save;
67
- setAllConditionFormats(allCondition);
68
- var selectionColumn = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0].column;
69
- var selectionRow = (_b = context.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b[0].row;
70
- var matchedCondition = [];
71
- if (allCondition) {
72
- for (var key in allCondition) {
73
- var conditionFormat = allCondition[key];
74
- var range = (_c = conditionFormat.cellrange) === null || _c === void 0 ? void 0 : _c[0];
75
- if (!range || !selectionColumn || !selectionRow) continue;
76
- var rangeColumns = range.column;
77
- var rangeRows = range.row;
78
- var isColumnOverlap = !(selectionColumn[1] < rangeColumns[0] || selectionColumn[0] > rangeColumns[1]);
79
- var isRowOverlap = !(selectionRow[1] < rangeRows[0] || selectionRow[0] > rangeRows[1]);
80
- if (isColumnOverlap && isRowOverlap) {
81
- matchedCondition.push(key);
82
- }
83
- }
84
- setMatchedConditionFormatKey(matchedCondition);
85
- }
86
- if (buttonClickCreateRef.current) return;
87
- if (matchedCondition.length === 0) {
88
- setCreate(true);
89
- } else if (matchedCondition.length > 0) {
90
- setCreate(false);
91
- }
92
- }, [context]);
35
+ colorRules = _d[0],
36
+ setColorRules = _d[1];
93
37
  var dataSelectRange = (0, _react.useCallback)(function (selectType) {
94
38
  hideDialog();
95
39
  setContext(function (ctx) {
@@ -103,26 +47,15 @@ var ConditionRules = function ConditionRules(_a) {
103
47
  }, [colorRules.cellColor, colorRules.textColor, hideDialog, setContext]);
104
48
  var close = (0, _react.useCallback)(function (closeType) {
105
49
  if (closeType === "confirm") {
106
- buttonClickCreateRef.current = false;
107
- setCreate(false);
108
50
  setContext(function (ctx) {
109
51
  ctx.conditionRules.textColor.color = colorRules.textColor;
110
52
  ctx.conditionRules.cellColor.color = colorRules.cellColor;
111
- ctx.conditionRules.font = {
112
- bold: bold,
113
- italic: italic,
114
- underline: underline,
115
- strikethrough: strikethrough
116
- };
117
53
  (0, _fortuneCore.setConditionRules)(ctx, protection, generalDialog, conditionformat, ctx.conditionRules);
118
54
  });
119
- } else {
120
- buttonClickCreateRef.current = true;
121
- setCreate(false);
122
55
  }
123
56
  setContext(function (ctx) {
124
57
  ctx.conditionRules = {
125
- rulesType: "greaterThan",
58
+ rulesType: "",
126
59
  rulesValue: "",
127
60
  textColor: {
128
61
  check: true,
@@ -132,12 +65,6 @@ var ConditionRules = function ConditionRules(_a) {
132
65
  check: true,
133
66
  color: "#000000"
134
67
  },
135
- font: {
136
- bold: false,
137
- italic: false,
138
- underline: false,
139
- strikethrough: false
140
- },
141
68
  betweenValue: {
142
69
  value1: "",
143
70
  value2: ""
@@ -148,7 +75,7 @@ var ConditionRules = function ConditionRules(_a) {
148
75
  };
149
76
  });
150
77
  hideDialog();
151
- }, [colorRules, conditionformat, generalDialog, hideDialog, protection, setContext, bold, italic, underline, strikethrough]);
78
+ }, [colorRules, conditionformat, generalDialog, hideDialog, protection, setContext]);
152
79
  (0, _react.useEffect)(function () {
153
80
  setContext(function (ctx) {
154
81
  ctx.conditionRules.rulesType = type;
@@ -173,12 +100,6 @@ var ConditionRules = function ConditionRules(_a) {
173
100
  check: true,
174
101
  color: "#000000"
175
102
  },
176
- font: {
177
- bold: false,
178
- italic: false,
179
- underline: false,
180
- strikethrough: false
181
- },
182
103
  betweenValue: {
183
104
  value1: "",
184
105
  value2: ""
@@ -191,186 +112,17 @@ var ConditionRules = function ConditionRules(_a) {
191
112
  ctx.rangeDialog.type = "";
192
113
  ctx.rangeDialog.rangeTxt = "";
193
114
  });
194
- }, [type]);
195
- var conditionList = [{
196
- text: "greaterThan",
197
- value: ">",
198
- label: "Greater Than"
199
- }, {
200
- text: "greaterThanOrEqual",
201
- value: ">=",
202
- label: "Greater Than or Equal"
203
- }, {
204
- text: "lessThan",
205
- value: "<",
206
- label: "Less Than"
207
- }, {
208
- text: "lessThanOrEqual",
209
- value: "<=",
210
- label: "Less Than or Equal"
211
- }, {
212
- text: "between",
213
- value: "[]",
214
- label: "Between"
215
- }, {
216
- text: "equal",
217
- value: "=",
218
- label: "Equal"
219
- }, {
220
- text: "textContains",
221
- value: "()",
222
- label: "Text Contains"
223
- }, {
224
- text: "occurrenceDate",
225
- value: conditionformat.yesterday,
226
- label: "Occurrence Date"
227
- }, {
228
- text: "duplicateValue",
229
- value: "##",
230
- label: "Duplicate Value"
231
- }, {
232
- text: "top10",
233
- value: conditionformat.top10
234
- }, {
235
- text: "top10_percent",
236
- value: conditionformat.top10_percent,
237
- label: "Top 10 Percent"
238
- }, {
239
- text: "last10",
240
- value: conditionformat.last10,
241
- label: "Last 10"
242
- }, {
243
- text: "last10_percent",
244
- value: conditionformat.last10_percent,
245
- label: "Last 10 Percent"
246
- }, {
247
- text: "aboveAverage",
248
- value: conditionformat.above,
249
- label: "Above Average"
250
- }, {
251
- text: "belowAverage",
252
- value: conditionformat.below,
253
- label: "Below Average"
254
- }];
115
+ }, []);
255
116
  var titleType = type === "top10_percent" ? "top10" : type === "last10_percent" ? "last10" : type;
256
117
  return /*#__PURE__*/_react.default.createElement("div", {
257
118
  className: "condition-rules"
258
- }, !create ? (/*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
259
- style: {
260
- marginBottom: "16px"
261
- }
262
- }, matchedConditionFormatKey.map(function (key) {
263
- var _a, _b;
264
- return /*#__PURE__*/_react.default.createElement("div", {
265
- className: "group flex items-center border-b border-gray-200 condition-list-parent",
266
- key: key
267
- }, /*#__PURE__*/_react.default.createElement("div", {
268
- className: "condition-list-pill",
269
- style: {
270
- backgroundColor: allConditionFormats[key].format.cellColor || ""
271
- }
272
- }, /*#__PURE__*/_react.default.createElement("span", {
273
- className: "condition-list-text",
274
- style: {
275
- color: allConditionFormats[key].format.textColor || ""
276
- }
277
- }, "123")), /*#__PURE__*/_react.default.createElement("div", {
278
- className: "flex flex-col",
279
- style: {
280
- width: '200px',
281
- padding: '8px 0px'
282
- }
283
- }, /*#__PURE__*/_react.default.createElement("h3", {
284
- className: "condition-list-type"
285
- }, conditionformat[allConditionFormats[key].conditionName], ' ', (_a = allConditionFormats[key].conditionValue) === null || _a === void 0 ? void 0 : _a[0]), /*#__PURE__*/_react.default.createElement("p", {
286
- className: "condition-list-range"
287
- }, (_b = allConditionFormats[key].cellrange) === null || _b === void 0 ? void 0 : _b.map(function (range) {
288
- var startCol = (0, _helper.numberToColumn)(range.column[0] + 1);
289
- var endCol = (0, _helper.numberToColumn)(range.column[1] + 1);
290
- var startRow = range.row[0] + 1;
291
- var endRow = range.row[1] + 1;
292
- return "".concat(startCol).concat(startRow, ":").concat(endCol).concat(endRow);
293
- }).join(", "))), /*#__PURE__*/_react.default.createElement("div", {
294
- className: "opacity-0 group-hover:opacity-100 transition-opacity"
295
- }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
296
- elevation: 1,
297
- icon: "Trash2",
298
- size: "md",
299
- variant: "secondary",
300
- style: {
301
- border: '0px',
302
- boxShadow: 'none',
303
- color: 'hsl(var(--color-icon-secondary))'
304
- },
305
- onClick: function onClick() {
306
- setContext(function (ctx) {
307
- var index = (0, _fortuneCore.getSheetIndex)(ctx, ctx.currentSheetId);
308
- var ruleArr = ctx.luckysheetfile[index].luckysheet_conditionformat_save || [];
309
- console.log(matchedConditionFormatKey, ruleArr, allConditionFormats);
310
- ruleArr.splice(Number(key), 1);
311
- ctx.luckysheetfile[index].luckysheet_conditionformat_save = ruleArr;
312
- return ctx;
313
- });
314
- }
315
- })));
316
- })), /*#__PURE__*/_react.default.createElement(_ui.Button, {
317
- size: "md",
318
- variant: "secondary",
319
- onClick: function onClick() {
320
- setCreate(true);
321
- buttonClickCreateRef.current = true;
322
- }
323
- }, "Create New Condition Format"))) : (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
119
+ }, !["aboveAverage", "belowAverage"].includes(type) && (/*#__PURE__*/_react.default.createElement("div", {
324
120
  className: "flex flex-col"
325
121
  }, /*#__PURE__*/_react.default.createElement("div", {
326
122
  className: "condition-rules-value text-heading-xsm"
327
- }, conditionformat.applyRange, " range"), /*#__PURE__*/_react.default.createElement(_ui.TextField, {
328
- rightIcon: /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
329
- name: "Grid2x2",
330
- size: "sm",
331
- onClick: function onClick() {
332
- dataSelectRange("conditionRules".concat(type));
333
- }
334
- }),
335
- "aria-hidden": "true",
336
- readOnly: true,
337
- placeholder: conditionformat.selectRange,
338
- value: (0, _getDisplayedRangeTxt.getDisplayedRangeTxt)(context),
339
- onClick: function onClick() {
340
- dataSelectRange("conditionRules".concat(type));
341
- }
342
- })), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
343
- className: "condition-rules-value text-heading-xsm"
344
- }, "Format cells if"), /*#__PURE__*/_react.default.createElement(_ui.Select, {
345
- value: type,
346
- onValueChange: function onValueChange(value) {
347
- setType(value);
348
- }
349
- }, /*#__PURE__*/_react.default.createElement(_ui.SelectTrigger, null, /*#__PURE__*/_react.default.createElement(_ui.SelectValue, null, /*#__PURE__*/_react.default.createElement("div", {
350
- className: "flex items-center gap-2"
351
- }, /*#__PURE__*/_react.default.createElement("span", null, conditionformat[type])))), /*#__PURE__*/_react.default.createElement(_ui.SelectContent, {
352
- position: "popper",
353
- side: "bottom",
354
- align: "start",
355
- sideOffset: 4,
356
- className: "z-[100]",
357
- "data-dropdown-content": "true"
358
- }, conditionList.map(function (option) {
359
- return /*#__PURE__*/_react.default.createElement(_ui.SelectItem, {
360
- key: option.value,
361
- value: option.text
362
- }, /*#__PURE__*/_react.default.createElement("div", {
363
- className: "flex items-center gap-2"
364
- }, /*#__PURE__*/_react.default.createElement("span", null, conditionformat[option.text])));
365
- })))), !["aboveAverage", "belowAverage"].includes(type) && (/*#__PURE__*/_react.default.createElement("div", {
366
- className: "flex flex-col"
367
- }, (type === "greaterThan" || type === "greaterThanOrEqual" || type === "lessThan" || type === "lessThanOrEqual" || type === "equal" || type === "textContains") && (/*#__PURE__*/_react.default.createElement("div", {
123
+ }, conditionformat["conditionformat_".concat(titleType, "_title")]), (type === "greaterThan" || type === "greaterThanOrEqual" || type === "lessThan" || type === "lessThanOrEqual" || type === "equal" || type === "textContains") && (/*#__PURE__*/_react.default.createElement("div", {
368
124
  className: "w-full"
369
125
  }, /*#__PURE__*/_react.default.createElement(_ui.TextField, {
370
- placeholder: "Value",
371
- onKeyDown: function onKeyDown(e) {
372
- e.stopPropagation();
373
- },
374
126
  value: context.conditionRules.rulesValue,
375
127
  onChange: function onChange(e) {
376
128
  var value = e.target.value;
@@ -383,9 +135,6 @@ var ConditionRules = function ConditionRules(_a) {
383
135
  }, /*#__PURE__*/_react.default.createElement("div", {
384
136
  className: "w-full"
385
137
  }, /*#__PURE__*/_react.default.createElement(_ui.TextField, {
386
- onKeyDown: function onKeyDown(e) {
387
- e.stopPropagation();
388
- },
389
138
  placeholder: "From",
390
139
  value: context.conditionRules.betweenValue.value1,
391
140
  onChange: function onChange(e) {
@@ -397,9 +146,6 @@ var ConditionRules = function ConditionRules(_a) {
397
146
  })), /*#__PURE__*/_react.default.createElement("div", {
398
147
  className: "w-full"
399
148
  }, /*#__PURE__*/_react.default.createElement(_ui.TextField, {
400
- onKeyDown: function onKeyDown(e) {
401
- e.stopPropagation();
402
- },
403
149
  placeholder: "To",
404
150
  value: context.conditionRules.betweenValue.value2,
405
151
  onChange: function onChange(e) {
@@ -451,10 +197,6 @@ var ConditionRules = function ConditionRules(_a) {
451
197
  });
452
198
  }
453
199
  }), /*#__PURE__*/_react.default.createElement(_ui.TextField, {
454
- placeholder: "Value",
455
- onKeyDown: function onKeyDown(e) {
456
- e.stopPropagation();
457
- },
458
200
  className: "condition-rules-project-input pr-0",
459
201
  type: "number",
460
202
  min: 1,
@@ -485,116 +227,47 @@ var ConditionRules = function ConditionRules(_a) {
485
227
  })))))), /*#__PURE__*/_react.default.createElement("div", {
486
228
  className: "flex flex-col"
487
229
  }, /*#__PURE__*/_react.default.createElement("div", {
488
- className: "condition-rules-set-title text-heading-xsm"
489
- }, "Formatting styles"), /*#__PURE__*/_react.default.createElement("div", {
490
- className: "toolbar-container"
491
- }, /*#__PURE__*/_react.default.createElement("div", {
492
- className: "toolbar-header"
493
- }, /*#__PURE__*/_react.default.createElement("h2", {
494
- className: "toolbar-title"
495
- }, "Formatting styles preview")), /*#__PURE__*/_react.default.createElement("div", {
496
- className: "toolbar-content"
497
- }, /*#__PURE__*/_react.default.createElement(_ui.Button, {
498
- variant: "ghost",
499
- onClick: function onClick() {
500
- return setBold(!bold);
501
- },
502
- className: (0, _ui.cn)("fortune-toolbar-combo-button !min-w-fit !px-0", {}),
503
- style: {
504
- width: 30,
505
- height: 30,
506
- backgroundColor: bold ? "hsl(var(--color-bg-default-selected))" : ""
507
- }
508
- }, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
509
- name: "Bold",
510
- style: {
511
- width: '16px',
512
- height: '16px'
513
- }
514
- })), /*#__PURE__*/_react.default.createElement(_ui.Button, {
515
- variant: "ghost",
516
- onClick: function onClick() {
517
- return setItalic(!italic);
518
- },
519
- className: (0, _ui.cn)("fortune-toolbar-combo-button !min-w-fit !px-0", {}),
520
- style: {
521
- width: 30,
522
- height: 30
523
- }
524
- }, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
525
- name: "Italic",
526
- style: {
527
- width: '16px',
528
- height: '16px'
529
- }
530
- })), /*#__PURE__*/_react.default.createElement(_ui.Button, {
531
- variant: "ghost",
532
- onClick: function onClick() {
533
- return setUnderline(!underline);
534
- },
535
- className: (0, _ui.cn)("fortune-toolbar-combo-button !min-w-fit !px-0", {}),
536
- style: {
537
- width: 30,
538
- height: 30
539
- }
540
- }, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
541
- name: "Underline",
542
- style: {
543
- width: '16px',
544
- height: '16px'
545
- }
546
- })), /*#__PURE__*/_react.default.createElement(_ui.Button, {
547
- variant: "ghost",
230
+ className: "condition-rules-value text-heading-xsm"
231
+ }, conditionformat.applyRange), /*#__PURE__*/_react.default.createElement(_ui.TextField, {
232
+ rightIcon: /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
233
+ name: "Grid2x2",
234
+ size: "sm",
235
+ onClick: function onClick() {
236
+ dataSelectRange("conditionRules".concat(type));
237
+ }
238
+ }),
239
+ "aria-hidden": "true",
240
+ readOnly: true,
241
+ placeholder: conditionformat.selectRange,
242
+ value: (0, _getDisplayedRangeTxt.getDisplayedRangeTxt)(context),
548
243
  onClick: function onClick() {
549
- return setStrikethrough(!strikethrough);
550
- },
551
- className: (0, _ui.cn)("fortune-toolbar-combo-button !min-w-fit !px-0", {}),
552
- style: {
553
- width: 30,
554
- height: 30
555
- }
556
- }, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
557
- name: "Strikethrough",
558
- style: {
559
- width: '16px',
560
- height: '16px'
561
- }
562
- })), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_ui.Button, {
563
- variant: "ghost",
564
- className: (0, _ui.cn)("fortune-toolbar-combo-button !min-w-fit !px-0", {}),
565
- style: {
566
- width: 30,
567
- height: 30
244
+ dataSelectRange("conditionRules".concat(type));
568
245
  }
246
+ })), /*#__PURE__*/_react.default.createElement("div", {
247
+ className: "flex flex-col"
569
248
  }, /*#__PURE__*/_react.default.createElement("div", {
570
- style: {
571
- display: 'flex',
572
- flexDirection: 'column',
573
- alignItems: 'center'
249
+ className: "condition-rules-set-title text-heading-xsm"
250
+ }, "".concat(conditionformat.setAs, "\uFF1A")), /*#__PURE__*/_react.default.createElement("div", {
251
+ className: "condition-rules-setbox"
252
+ }, /*#__PURE__*/_react.default.createElement("div", {
253
+ className: "condition-rules-set"
254
+ }, /*#__PURE__*/_react.default.createElement("div", {
255
+ className: "condition-rules-color"
256
+ }, /*#__PURE__*/_react.default.createElement("span", {
257
+ id: "checkTextColor"
258
+ }, /*#__PURE__*/_react.default.createElement(_ui.Checkbox, {
259
+ className: "border-2",
260
+ checked: context.conditionRules.textColor.check,
261
+ onCheckedChange: function onCheckedChange(e) {
262
+ var checked = e.target.checked;
263
+ setContext(function (ctx) {
264
+ ctx.conditionRules.textColor.check = checked;
265
+ });
574
266
  }
575
- }, /*#__PURE__*/_react.default.createElement("svg", {
576
- style: {
577
- width: '19px',
578
- height: '19px'
579
- },
580
- xmlns: "http://www.w3.org/2000/svg",
581
- width: "24",
582
- height: "24",
583
- viewBox: "0 0 24 24",
584
- fill: "none",
585
- stroke: "currentColor",
586
- "stroke-width": "2",
587
- "stroke-linecap": "round",
588
- "stroke-linejoin": "round",
589
- className: "lucide lucide-spell-check2-icon lucide-spell-check-2"
590
- }, /*#__PURE__*/_react.default.createElement("path", {
591
- d: "m5 18 6-12 6 12"
592
- }), /*#__PURE__*/_react.default.createElement("path", {
593
- d: "M7 14h8"
594
- })), /*#__PURE__*/_react.default.createElement("input", {
595
- style: {
596
- marginBottom: "4px"
597
- },
267
+ })), /*#__PURE__*/_react.default.createElement("label", {
268
+ htmlFor: "checkTextColor",
269
+ className: "condition-rules-label"
270
+ }, conditionformat.textColor), /*#__PURE__*/_react.default.createElement("input", {
598
271
  type: "color",
599
272
  className: "condition-rules-select-color",
600
273
  value: colorRules.textColor,
@@ -604,25 +277,25 @@ var ConditionRules = function ConditionRules(_a) {
604
277
  draft.textColor = value;
605
278
  }));
606
279
  }
607
- })))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_ui.Button, {
608
- variant: "ghost",
609
- className: (0, _ui.cn)("fortune-toolbar-combo-button !min-w-fit !px-0", {}),
610
- style: {
611
- width: 30,
612
- height: 30
613
- }
280
+ }))), /*#__PURE__*/_react.default.createElement("div", {
281
+ className: "condition-rules-set"
614
282
  }, /*#__PURE__*/_react.default.createElement("div", {
615
- style: {
616
- display: 'flex',
617
- flexDirection: 'column'
618
- }
619
- }, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
620
- name: "PaintBucket",
621
- style: {
622
- width: '16px',
623
- height: '16px'
283
+ className: "condition-rules-color"
284
+ }, /*#__PURE__*/_react.default.createElement("span", {
285
+ id: "checkCellColor"
286
+ }, /*#__PURE__*/_react.default.createElement(_ui.Checkbox, {
287
+ className: "border-2",
288
+ checked: context.conditionRules.cellColor.check,
289
+ onCheckedChange: function onCheckedChange(e) {
290
+ var checked = e.target.checked;
291
+ setContext(function (ctx) {
292
+ ctx.conditionRules.cellColor.check = checked;
293
+ });
624
294
  }
625
- }), /*#__PURE__*/_react.default.createElement("input", {
295
+ })), /*#__PURE__*/_react.default.createElement("label", {
296
+ htmlFor: "checkCellColor",
297
+ className: "condition-rules-label"
298
+ }, conditionformat.cellColor), /*#__PURE__*/_react.default.createElement("input", {
626
299
  type: "color",
627
300
  className: "condition-rules-select-color",
628
301
  value: colorRules.cellColor,
@@ -632,11 +305,10 @@ var ConditionRules = function ConditionRules(_a) {
632
305
  draft.cellColor = value;
633
306
  }));
634
307
  }
635
- }))))))), /*#__PURE__*/_react.default.createElement("div", {
636
- className: "flex gap-2 justify-end",
637
- style: {
638
- marginTop: "8px"
639
- }
308
+ }))))), /*#__PURE__*/_react.default.createElement(_ui.Divider, {
309
+ className: "w-full border-t-[1px]"
310
+ }), /*#__PURE__*/_react.default.createElement("div", {
311
+ className: "flex gap-2 justify-end"
640
312
  }, /*#__PURE__*/_react.default.createElement(_ui.Button, {
641
313
  variant: "secondary",
642
314
  style: {
@@ -655,6 +327,6 @@ var ConditionRules = function ConditionRules(_a) {
655
327
  close("confirm");
656
328
  },
657
329
  tabIndex: 0
658
- }, "Create rule")))));
330
+ }, button.apply)));
659
331
  };
660
332
  var _default = exports.default = ConditionRules;
@@ -115,7 +115,7 @@
115
115
  }
116
116
 
117
117
  .condition-rules-set-title {
118
- margin: 0px 0px 16px 0px;
118
+ margin: 6px 0px;
119
119
  }
120
120
 
121
121
  .condition-rules-setbox {
@@ -149,23 +149,13 @@
149
149
  }
150
150
 
151
151
  .condition-rules-select-color {
152
- background: transparent;
153
- width: 16px;
154
- height: 4px;
155
- border-radius: 0px;
156
- border: none;
152
+ background: hsl(var(--color-bg-default));
153
+ width: 2.5rem;
154
+ height: 1.5rem;
155
+ border-radius: 4px;
157
156
  padding: 0;
158
157
  margin: 0;
159
158
  cursor: pointer;
160
- outline: none;
161
- }
162
-
163
- input[type="color"]::-webkit-color-swatch-wrapper {
164
- padding: 0;
165
- }
166
-
167
- input[type="color"]::-webkit-color-swatch {
168
- border: 1px solid #d4d4d4;
169
159
  }
170
160
 
171
161
  .condition-rules-between-box {
@@ -220,50 +210,3 @@ input[type="number"].condition-rules-project-input::-webkit-inner-spin-button {
220
210
  input[type="number"].condition-rules-project-input {
221
211
  -moz-appearance: textfield;
222
212
  }
223
-
224
- .condition-list-parent {
225
- padding: 12px 8px;
226
- gap: 12px;
227
- }
228
-
229
- .condition-list-parent:hover {
230
- background-color: hsl(var(--color-bg-default-hover));
231
- }
232
-
233
- .condition-list-pill {
234
- display: flex;
235
- align-items: center;
236
- justify-content: center;
237
- width: 44px;
238
- height: 56px;
239
- padding: 4px 16px;
240
- gap: 10px;
241
- border-radius: 4px;
242
- border: 1px solid #E8EBEC;
243
- }
244
-
245
- .condition-list-text {
246
- font-family: "Helvetica Neue";
247
- font-size: 14px;
248
- font-style: normal;
249
- font-weight: 500;
250
- line-height: 20px;
251
- }
252
-
253
- .condition-list-type {
254
- color: hsl(var(--color-text-default, #363B3F));
255
- font-family: "Helvetica Neue";
256
- font-size: 14px;
257
- font-style: normal;
258
- font-weight: 500;
259
- line-height: 20px;
260
- }
261
-
262
- .condition-list-range {
263
- color: hsl(var(--color-text-secondary, #77818A));
264
- font-family: "Helvetica Neue";
265
- font-size: 12px;
266
- font-style: normal;
267
- font-weight: 400;
268
- line-height: 16px;
269
- }