@univerjs/sheets-conditional-formatting 0.24.0 → 0.25.0
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/lib/cjs/facade.js +142 -73
- package/lib/cjs/index.js +7 -7
- package/lib/es/facade.js +142 -73
- package/lib/es/index.js +7 -7
- package/lib/facade.js +142 -73
- package/lib/index.js +7 -7
- package/lib/types/facade/f-conditional-formatting-builder.d.ts +138 -69
- package/lib/types/facade/f-range.d.ts +6 -3
- package/lib/types/facade/f-worksheet.d.ts +14 -7
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +9 -9
package/lib/facade.js
CHANGED
|
@@ -3,7 +3,7 @@ import { AddCfCommand, CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperat
|
|
|
3
3
|
import { FRange, FWorksheet } from "@univerjs/sheets/facade";
|
|
4
4
|
import { FEnum } from "@univerjs/core/facade";
|
|
5
5
|
|
|
6
|
-
//#region \0@oxc-project+runtime@0.
|
|
6
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
|
|
7
7
|
function _typeof(o) {
|
|
8
8
|
"@babel/helpers - typeof";
|
|
9
9
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -14,7 +14,7 @@ function _typeof(o) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
|
-
//#region \0@oxc-project+runtime@0.
|
|
17
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
|
|
18
18
|
function toPrimitive(t, r) {
|
|
19
19
|
if ("object" != _typeof(t) || !t) return t;
|
|
20
20
|
var e = t[Symbol.toPrimitive];
|
|
@@ -27,14 +27,14 @@ function toPrimitive(t, r) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
//#endregion
|
|
30
|
-
//#region \0@oxc-project+runtime@0.
|
|
30
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
|
|
31
31
|
function toPropertyKey(t) {
|
|
32
32
|
var i = toPrimitive(t, "string");
|
|
33
33
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
//#endregion
|
|
37
|
-
//#region \0@oxc-project+runtime@0.
|
|
37
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
|
|
38
38
|
function _defineProperty(e, r, t) {
|
|
39
39
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
40
40
|
value: t,
|
|
@@ -133,7 +133,8 @@ var ConditionalFormatRuleBaseBuilder = class ConditionalFormatRuleBaseBuilder {
|
|
|
133
133
|
* @example
|
|
134
134
|
* ```typescript
|
|
135
135
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
136
|
-
* const fWorksheet = fWorkbook.
|
|
136
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
137
|
+
* if (!fWorksheet) return;
|
|
137
138
|
*
|
|
138
139
|
* // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
|
|
139
140
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -169,7 +170,8 @@ var ConditionalFormatRuleBaseBuilder = class ConditionalFormatRuleBaseBuilder {
|
|
|
169
170
|
* @example
|
|
170
171
|
* ```typescript
|
|
171
172
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
172
|
-
* const fWorksheet = fWorkbook.
|
|
173
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
174
|
+
* if (!fWorksheet) return;
|
|
173
175
|
*
|
|
174
176
|
* // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
|
|
175
177
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -220,7 +222,8 @@ var ConditionalFormatRuleBaseBuilder = class ConditionalFormatRuleBaseBuilder {
|
|
|
220
222
|
* @example
|
|
221
223
|
* ```typescript
|
|
222
224
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
223
|
-
* const fWorksheet = fWorkbook.
|
|
225
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
226
|
+
* if (!fWorksheet) return;
|
|
224
227
|
*
|
|
225
228
|
* // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
|
|
226
229
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -251,7 +254,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
251
254
|
* @example
|
|
252
255
|
* ```typescript
|
|
253
256
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
254
|
-
* const fWorksheet = fWorkbook.
|
|
257
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
258
|
+
* if (!fWorksheet) return;
|
|
255
259
|
*
|
|
256
260
|
* // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
|
|
257
261
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -281,7 +285,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
281
285
|
* @example
|
|
282
286
|
* ```typescript
|
|
283
287
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
284
|
-
* const fWorksheet = fWorkbook.
|
|
288
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
289
|
+
* if (!fWorksheet) return;
|
|
285
290
|
*
|
|
286
291
|
* // Create a conditional formatting rule that highlights cells with greater than average values in red for the range A1:D10.
|
|
287
292
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -306,7 +311,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
306
311
|
* @example
|
|
307
312
|
* ```typescript
|
|
308
313
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
309
|
-
* const fWorksheet = fWorkbook.
|
|
314
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
315
|
+
* if (!fWorksheet) return;
|
|
310
316
|
*
|
|
311
317
|
* // Create a conditional formatting rule that highlights cells with unique values in red for the range A1:D10.
|
|
312
318
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -330,7 +336,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
330
336
|
* @example
|
|
331
337
|
* ```typescript
|
|
332
338
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
333
|
-
* const fWorksheet = fWorkbook.
|
|
339
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
340
|
+
* if (!fWorksheet) return;
|
|
334
341
|
*
|
|
335
342
|
* // Create a conditional formatting rule that highlights cells with duplicate values in red for the range A1:D10.
|
|
336
343
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -358,7 +365,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
358
365
|
* @example
|
|
359
366
|
* ```typescript
|
|
360
367
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
361
|
-
* const fWorksheet = fWorkbook.
|
|
368
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
369
|
+
* if (!fWorksheet) return;
|
|
362
370
|
*
|
|
363
371
|
* // Create a conditional formatting rule that highlights the bottom 10% of values in red for the range A1:D10.
|
|
364
372
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -386,7 +394,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
386
394
|
* @example
|
|
387
395
|
* ```typescript
|
|
388
396
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
389
|
-
* const fWorksheet = fWorkbook.
|
|
397
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
398
|
+
* if (!fWorksheet) return;
|
|
390
399
|
*
|
|
391
400
|
* // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
|
|
392
401
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -414,7 +423,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
414
423
|
* @example
|
|
415
424
|
* ```typescript
|
|
416
425
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
417
|
-
* const fWorksheet = fWorkbook.
|
|
426
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
427
|
+
* if (!fWorksheet) return;
|
|
418
428
|
*
|
|
419
429
|
* // Create a conditional formatting rule that bolds the text for cells with not empty content in the range A1:D10.
|
|
420
430
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -441,7 +451,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
441
451
|
* @example
|
|
442
452
|
* ```typescript
|
|
443
453
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
444
|
-
* const fWorksheet = fWorkbook.
|
|
454
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
455
|
+
* if (!fWorksheet) return;
|
|
445
456
|
*
|
|
446
457
|
* // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
|
|
447
458
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -469,7 +480,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
469
480
|
* @example
|
|
470
481
|
* ```typescript
|
|
471
482
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
472
|
-
* const fWorksheet = fWorkbook.
|
|
483
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
484
|
+
* if (!fWorksheet) return;
|
|
473
485
|
*
|
|
474
486
|
* // Create a conditional formatting rule that italicizes the text for cells with not empty content in the range A1:D10.
|
|
475
487
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -496,7 +508,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
496
508
|
* @example
|
|
497
509
|
* ```typescript
|
|
498
510
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
499
|
-
* const fWorksheet = fWorkbook.
|
|
511
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
512
|
+
* if (!fWorksheet) return;
|
|
500
513
|
*
|
|
501
514
|
* // Create a conditional formatting rule that set text strikethrough for cells with not empty content in the range A1:D10.
|
|
502
515
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -523,7 +536,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
523
536
|
* @example
|
|
524
537
|
* ```typescript
|
|
525
538
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
526
|
-
* const fWorksheet = fWorkbook.
|
|
539
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
540
|
+
* if (!fWorksheet) return;
|
|
527
541
|
*
|
|
528
542
|
* // Create a conditional formatting rule that underlines the text for cells with not empty content in the range A1:D10.
|
|
529
543
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -549,7 +563,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
549
563
|
* @example
|
|
550
564
|
* ```typescript
|
|
551
565
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
552
|
-
* const fWorksheet = fWorkbook.
|
|
566
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
567
|
+
* if (!fWorksheet) return;
|
|
553
568
|
*
|
|
554
569
|
* // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
|
|
555
570
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -575,7 +590,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
575
590
|
* @example
|
|
576
591
|
* ```typescript
|
|
577
592
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
578
|
-
* const fWorksheet = fWorkbook.
|
|
593
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
594
|
+
* if (!fWorksheet) return;
|
|
579
595
|
*
|
|
580
596
|
* // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
|
|
581
597
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -602,7 +618,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
602
618
|
* @example
|
|
603
619
|
* ```typescript
|
|
604
620
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
605
|
-
* const fWorksheet = fWorkbook.
|
|
621
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
622
|
+
* if (!fWorksheet) return;
|
|
606
623
|
*
|
|
607
624
|
* // Create a conditional formatting rule that highlights cells with dates in the last 7 days in red for the range A1:D10.
|
|
608
625
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -628,7 +645,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
628
645
|
* @example
|
|
629
646
|
* ```typescript
|
|
630
647
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
631
|
-
* const fWorksheet = fWorkbook.
|
|
648
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
649
|
+
* if (!fWorksheet) return;
|
|
632
650
|
*
|
|
633
651
|
* // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
|
|
634
652
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -655,7 +673,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
655
673
|
* @example
|
|
656
674
|
* ```typescript
|
|
657
675
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
658
|
-
* const fWorksheet = fWorkbook.
|
|
676
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
677
|
+
* if (!fWorksheet) return;
|
|
659
678
|
*
|
|
660
679
|
* // Create a conditional formatting rule that highlights cells with values between 10 and 20 in red for the range A1:D10.
|
|
661
680
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -684,7 +703,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
684
703
|
* @example
|
|
685
704
|
* ```typescript
|
|
686
705
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
687
|
-
* const fWorksheet = fWorkbook.
|
|
706
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
707
|
+
* if (!fWorksheet) return;
|
|
688
708
|
*
|
|
689
709
|
* // Create a conditional formatting rule that highlights cells with values equal to 10 in red for the range A1:D10.
|
|
690
710
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -711,7 +731,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
711
731
|
* @example
|
|
712
732
|
* ```typescript
|
|
713
733
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
714
|
-
* const fWorksheet = fWorkbook.
|
|
734
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
735
|
+
* if (!fWorksheet) return;
|
|
715
736
|
*
|
|
716
737
|
* // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
|
|
717
738
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -738,7 +759,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
738
759
|
* @example
|
|
739
760
|
* ```typescript
|
|
740
761
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
741
|
-
* const fWorksheet = fWorkbook.
|
|
762
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
763
|
+
* if (!fWorksheet) return;
|
|
742
764
|
*
|
|
743
765
|
* // Create a conditional formatting rule that highlights cells with values greater than or equal to 10 in red for the range A1:D10.
|
|
744
766
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -765,7 +787,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
765
787
|
* @example
|
|
766
788
|
* ```typescript
|
|
767
789
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
768
|
-
* const fWorksheet = fWorkbook.
|
|
790
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
791
|
+
* if (!fWorksheet) return;
|
|
769
792
|
*
|
|
770
793
|
* // Create a conditional formatting rule that highlights cells with values less than 10 in red for the range A1:D10.
|
|
771
794
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -792,7 +815,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
792
815
|
* @example
|
|
793
816
|
* ```typescript
|
|
794
817
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
795
|
-
* const fWorksheet = fWorkbook.
|
|
818
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
819
|
+
* if (!fWorksheet) return;
|
|
796
820
|
*
|
|
797
821
|
* // Create a conditional formatting rule that highlights cells with values less than or equal to 10 in red for the range A1:D10.
|
|
798
822
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -820,7 +844,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
820
844
|
* @example
|
|
821
845
|
* ```typescript
|
|
822
846
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
823
|
-
* const fWorksheet = fWorkbook.
|
|
847
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
848
|
+
* if (!fWorksheet) return;
|
|
824
849
|
*
|
|
825
850
|
* // Create a conditional formatting rule that highlights cells with values not between 10 and 20 in red for the range A1:D10.
|
|
826
851
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -849,7 +874,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
849
874
|
* @example
|
|
850
875
|
* ```typescript
|
|
851
876
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
852
|
-
* const fWorksheet = fWorkbook.
|
|
877
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
878
|
+
* if (!fWorksheet) return;
|
|
853
879
|
*
|
|
854
880
|
* // Create a conditional formatting rule that highlights cells with values not equal to 10 in red for the range A1:D10.
|
|
855
881
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -876,7 +902,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
876
902
|
* @example
|
|
877
903
|
* ```typescript
|
|
878
904
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
879
|
-
* const fWorksheet = fWorkbook.
|
|
905
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
906
|
+
* if (!fWorksheet) return;
|
|
880
907
|
*
|
|
881
908
|
* // Create a conditional formatting rule that highlights cells with text containing 'apple' in red for the range A1:D10.
|
|
882
909
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -903,7 +930,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
903
930
|
* @example
|
|
904
931
|
* ```typescript
|
|
905
932
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
906
|
-
* const fWorksheet = fWorkbook.
|
|
933
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
934
|
+
* if (!fWorksheet) return;
|
|
907
935
|
*
|
|
908
936
|
* // Create a conditional formatting rule that highlights cells with text not containing 'apple' in red for the range A1:D10.
|
|
909
937
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -930,7 +958,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
930
958
|
* @example
|
|
931
959
|
* ```typescript
|
|
932
960
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
933
|
-
* const fWorksheet = fWorkbook.
|
|
961
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
962
|
+
* if (!fWorksheet) return;
|
|
934
963
|
*
|
|
935
964
|
* // Create a conditional formatting rule that highlights cells with text ending with '.ai' in red for the range A1:D10.
|
|
936
965
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -957,7 +986,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
957
986
|
* @example
|
|
958
987
|
* ```typescript
|
|
959
988
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
960
|
-
* const fWorksheet = fWorkbook.
|
|
989
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
990
|
+
* if (!fWorksheet) return;
|
|
961
991
|
*
|
|
962
992
|
* // Create a conditional formatting rule that highlights cells with text equal to 'apple' in red for the range A1:D10.
|
|
963
993
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -984,7 +1014,8 @@ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRule
|
|
|
984
1014
|
* @example
|
|
985
1015
|
* ```typescript
|
|
986
1016
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
987
|
-
* const fWorksheet = fWorkbook.
|
|
1017
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1018
|
+
* if (!fWorksheet) return;
|
|
988
1019
|
*
|
|
989
1020
|
* // Create a conditional formatting rule that highlights cells with text starting with 'https://' in red for the range A1:D10.
|
|
990
1021
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1012,7 +1043,8 @@ var ConditionalFormatDataBarRuleBuilder = class ConditionalFormatDataBarRuleBuil
|
|
|
1012
1043
|
* @example
|
|
1013
1044
|
* ```typescript
|
|
1014
1045
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1015
|
-
* const fWorksheet = fWorkbook.
|
|
1046
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1047
|
+
* if (!fWorksheet) return;
|
|
1016
1048
|
*
|
|
1017
1049
|
* // Create a conditional formatting rule that adds a data bar to cells with values between -100 and 100 in the range A1:D10.
|
|
1018
1050
|
* // positive values are green and negative values are red.
|
|
@@ -1060,7 +1092,8 @@ var ConditionalFormatDataBarRuleBuilder = class ConditionalFormatDataBarRuleBuil
|
|
|
1060
1092
|
* @example
|
|
1061
1093
|
* ```typescript
|
|
1062
1094
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1063
|
-
* const fWorksheet = fWorkbook.
|
|
1095
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1096
|
+
* if (!fWorksheet) return;
|
|
1064
1097
|
*
|
|
1065
1098
|
* // Create a conditional formatting rule that adds a data bar to cells with values between -100 and 100 in the range A1:D10.
|
|
1066
1099
|
* // positive values are green and negative values are red.
|
|
@@ -1099,7 +1132,8 @@ var ConditionalFormatColorScaleRuleBuilder = class ConditionalFormatColorScaleRu
|
|
|
1099
1132
|
* @example
|
|
1100
1133
|
* ```typescript
|
|
1101
1134
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1102
|
-
* const fWorksheet = fWorkbook.
|
|
1135
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1136
|
+
* if (!fWorksheet) return;
|
|
1103
1137
|
*
|
|
1104
1138
|
* // Create a conditional formatting rule that adds a color scale to cells with values between 0 and 100 in the range A1:D10.
|
|
1105
1139
|
* // The color scale is green for 0, yellow for 50, and red for 100.
|
|
@@ -1135,7 +1169,8 @@ var ConditionalFormatColorScaleRuleBuilder = class ConditionalFormatColorScaleRu
|
|
|
1135
1169
|
* @example
|
|
1136
1170
|
* ```typescript
|
|
1137
1171
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1138
|
-
* const fWorksheet = fWorkbook.
|
|
1172
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1173
|
+
* if (!fWorksheet) return;
|
|
1139
1174
|
*
|
|
1140
1175
|
* // Create a conditional formatting rule that adds a color scale to cells with values between 0 and 100 in the range A1:D10.
|
|
1141
1176
|
* // The color scale is green for 0, yellow for 50, and red for 100.
|
|
@@ -1165,7 +1200,8 @@ var ConditionalFormatIconSetRuleBuilder = class ConditionalFormatIconSetRuleBuil
|
|
|
1165
1200
|
* @example
|
|
1166
1201
|
* ```typescript
|
|
1167
1202
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1168
|
-
* const fWorksheet = fWorkbook.
|
|
1203
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1204
|
+
* if (!fWorksheet) return;
|
|
1169
1205
|
*
|
|
1170
1206
|
* // Create a 3-arrow icon set conditional formatting rule in the range A1:D10.
|
|
1171
1207
|
* // The first arrow is green for values greater than 20.
|
|
@@ -1229,7 +1265,8 @@ var ConditionalFormatIconSetRuleBuilder = class ConditionalFormatIconSetRuleBuil
|
|
|
1229
1265
|
* @example
|
|
1230
1266
|
* ```typescript
|
|
1231
1267
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1232
|
-
* const fWorksheet = fWorkbook.
|
|
1268
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1269
|
+
* if (!fWorksheet) return;
|
|
1233
1270
|
*
|
|
1234
1271
|
* // Create a 3-arrow icon set conditional formatting rule in the range A1:D10.
|
|
1235
1272
|
* // The first arrow is green for values greater than 20.
|
|
@@ -1296,7 +1333,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1296
1333
|
* @example
|
|
1297
1334
|
* ```typescript
|
|
1298
1335
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1299
|
-
* const fWorksheet = fWorkbook.
|
|
1336
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1337
|
+
* if (!fWorksheet) return;
|
|
1300
1338
|
*
|
|
1301
1339
|
* // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
|
|
1302
1340
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1318,7 +1356,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1318
1356
|
* @example
|
|
1319
1357
|
* ```typescript
|
|
1320
1358
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1321
|
-
* const fWorksheet = fWorkbook.
|
|
1359
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1360
|
+
* if (!fWorksheet) return;
|
|
1322
1361
|
*
|
|
1323
1362
|
* // Create a conditional formatting rule that highlights cells with greater than average values in red for the range A1:D10.
|
|
1324
1363
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1339,7 +1378,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1339
1378
|
* @example
|
|
1340
1379
|
* ```typescript
|
|
1341
1380
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1342
|
-
* const fWorksheet = fWorkbook.
|
|
1381
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1382
|
+
* if (!fWorksheet) return;
|
|
1343
1383
|
*
|
|
1344
1384
|
* // Create a conditional formatting rule that highlights cells with unique values in red for the range A1:D10.
|
|
1345
1385
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1360,7 +1400,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1360
1400
|
* @example
|
|
1361
1401
|
* ```typescript
|
|
1362
1402
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1363
|
-
* const fWorksheet = fWorkbook.
|
|
1403
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1404
|
+
* if (!fWorksheet) return;
|
|
1364
1405
|
*
|
|
1365
1406
|
* // Create a conditional formatting rule that highlights cells with duplicate values in red for the range A1:D10.
|
|
1366
1407
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1385,7 +1426,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1385
1426
|
* @example
|
|
1386
1427
|
* ```typescript
|
|
1387
1428
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1388
|
-
* const fWorksheet = fWorkbook.
|
|
1429
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1430
|
+
* if (!fWorksheet) return;
|
|
1389
1431
|
*
|
|
1390
1432
|
* // Create a conditional formatting rule that highlights the bottom 10% of values in red for the range A1:D10.
|
|
1391
1433
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1406,7 +1448,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1406
1448
|
* @example
|
|
1407
1449
|
* ```typescript
|
|
1408
1450
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1409
|
-
* const fWorksheet = fWorkbook.
|
|
1451
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1452
|
+
* if (!fWorksheet) return;
|
|
1410
1453
|
* console.log(fWorksheet.newConditionalFormattingRule().getIconMap()); // icons key-value map
|
|
1411
1454
|
* ```
|
|
1412
1455
|
*/
|
|
@@ -1422,7 +1465,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1422
1465
|
* @example
|
|
1423
1466
|
* ```typescript
|
|
1424
1467
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1425
|
-
* const fWorksheet = fWorkbook.
|
|
1468
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1469
|
+
* if (!fWorksheet) return;
|
|
1426
1470
|
*
|
|
1427
1471
|
* // Create a 3-arrow icon set conditional formatting rule in the range A1:D10.
|
|
1428
1472
|
* // The first arrow is green for values greater than 20.
|
|
@@ -1481,7 +1525,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1481
1525
|
* @example
|
|
1482
1526
|
* ```typescript
|
|
1483
1527
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1484
|
-
* const fWorksheet = fWorkbook.
|
|
1528
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1529
|
+
* if (!fWorksheet) return;
|
|
1485
1530
|
*
|
|
1486
1531
|
* // Create a conditional formatting rule that adds a color scale to cells with values between 0 and 100 in the range A1:D10.
|
|
1487
1532
|
* // The color scale is green for 0, yellow for 50, and red for 100.
|
|
@@ -1520,7 +1565,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1520
1565
|
* @example
|
|
1521
1566
|
* ```typescript
|
|
1522
1567
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1523
|
-
* const fWorksheet = fWorkbook.
|
|
1568
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1569
|
+
* if (!fWorksheet) return;
|
|
1524
1570
|
*
|
|
1525
1571
|
* // Create a conditional formatting rule that adds a data bar to cells with values between -100 and 100 in the range A1:D10.
|
|
1526
1572
|
* // positive values are green and negative values are red.
|
|
@@ -1548,7 +1594,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1548
1594
|
* @example
|
|
1549
1595
|
* ```typescript
|
|
1550
1596
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1551
|
-
* const fWorksheet = fWorkbook.
|
|
1597
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1598
|
+
* if (!fWorksheet) return;
|
|
1552
1599
|
*
|
|
1553
1600
|
* // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
|
|
1554
1601
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1570,7 +1617,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1570
1617
|
* @example
|
|
1571
1618
|
* ```typescript
|
|
1572
1619
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1573
|
-
* const fWorksheet = fWorkbook.
|
|
1620
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1621
|
+
* if (!fWorksheet) return;
|
|
1574
1622
|
*
|
|
1575
1623
|
* // Create a conditional formatting rule that bolds the text for cells with not empty content in the range A1:D10.
|
|
1576
1624
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1592,7 +1640,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1592
1640
|
* @example
|
|
1593
1641
|
* ```typescript
|
|
1594
1642
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1595
|
-
* const fWorksheet = fWorkbook.
|
|
1643
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1644
|
+
* if (!fWorksheet) return;
|
|
1596
1645
|
*
|
|
1597
1646
|
* // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
|
|
1598
1647
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1614,7 +1663,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1614
1663
|
* @example
|
|
1615
1664
|
* ```typescript
|
|
1616
1665
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1617
|
-
* const fWorksheet = fWorkbook.
|
|
1666
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1667
|
+
* if (!fWorksheet) return;
|
|
1618
1668
|
*
|
|
1619
1669
|
* // Create a conditional formatting rule that italicizes the text for cells with not empty content in the range A1:D10.
|
|
1620
1670
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1636,7 +1686,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1636
1686
|
* @example
|
|
1637
1687
|
* ```typescript
|
|
1638
1688
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1639
|
-
* const fWorksheet = fWorkbook.
|
|
1689
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1690
|
+
* if (!fWorksheet) return;
|
|
1640
1691
|
*
|
|
1641
1692
|
* // Create a conditional formatting rule that set text strikethrough for cells with not empty content in the range A1:D10.
|
|
1642
1693
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1658,7 +1709,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1658
1709
|
* @example
|
|
1659
1710
|
* ```typescript
|
|
1660
1711
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1661
|
-
* const fWorksheet = fWorkbook.
|
|
1712
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1713
|
+
* if (!fWorksheet) return;
|
|
1662
1714
|
*
|
|
1663
1715
|
* // Create a conditional formatting rule that underlines the text for cells with not empty content in the range A1:D10.
|
|
1664
1716
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1679,7 +1731,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1679
1731
|
* @example
|
|
1680
1732
|
* ```typescript
|
|
1681
1733
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1682
|
-
* const fWorksheet = fWorkbook.
|
|
1734
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1735
|
+
* if (!fWorksheet) return;
|
|
1683
1736
|
*
|
|
1684
1737
|
* // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
|
|
1685
1738
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1700,7 +1753,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1700
1753
|
* @example
|
|
1701
1754
|
* ```typescript
|
|
1702
1755
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1703
|
-
* const fWorksheet = fWorkbook.
|
|
1756
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1757
|
+
* if (!fWorksheet) return;
|
|
1704
1758
|
*
|
|
1705
1759
|
* // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
|
|
1706
1760
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1722,7 +1776,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1722
1776
|
* @example
|
|
1723
1777
|
* ```typescript
|
|
1724
1778
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1725
|
-
* const fWorksheet = fWorkbook.
|
|
1779
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1780
|
+
* if (!fWorksheet) return;
|
|
1726
1781
|
*
|
|
1727
1782
|
* // Create a conditional formatting rule that highlights cells with dates in the last 7 days in red for the range A1:D10.
|
|
1728
1783
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1744,7 +1799,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1744
1799
|
* @example
|
|
1745
1800
|
* ```typescript
|
|
1746
1801
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1747
|
-
* const fWorksheet = fWorkbook.
|
|
1802
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1803
|
+
* if (!fWorksheet) return;
|
|
1748
1804
|
*
|
|
1749
1805
|
* // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
|
|
1750
1806
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1767,7 +1823,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1767
1823
|
* @example
|
|
1768
1824
|
* ```typescript
|
|
1769
1825
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1770
|
-
* const fWorksheet = fWorkbook.
|
|
1826
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1827
|
+
* if (!fWorksheet) return;
|
|
1771
1828
|
*
|
|
1772
1829
|
* // Create a conditional formatting rule that highlights cells with values between 10 and 20 in red for the range A1:D10.
|
|
1773
1830
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1789,7 +1846,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1789
1846
|
* @example
|
|
1790
1847
|
* ```typescript
|
|
1791
1848
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1792
|
-
* const fWorksheet = fWorkbook.
|
|
1849
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1850
|
+
* if (!fWorksheet) return;
|
|
1793
1851
|
*
|
|
1794
1852
|
* // Create a conditional formatting rule that highlights cells with values equal to 10 in red for the range A1:D10.
|
|
1795
1853
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1811,7 +1869,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1811
1869
|
* @example
|
|
1812
1870
|
* ```typescript
|
|
1813
1871
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1814
|
-
* const fWorksheet = fWorkbook.
|
|
1872
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1873
|
+
* if (!fWorksheet) return;
|
|
1815
1874
|
*
|
|
1816
1875
|
* // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
|
|
1817
1876
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1833,7 +1892,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1833
1892
|
* @example
|
|
1834
1893
|
* ```typescript
|
|
1835
1894
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1836
|
-
* const fWorksheet = fWorkbook.
|
|
1895
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1896
|
+
* if (!fWorksheet) return;
|
|
1837
1897
|
*
|
|
1838
1898
|
* // Create a conditional formatting rule that highlights cells with values greater than or equal to 10 in red for the range A1:D10.
|
|
1839
1899
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1855,7 +1915,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1855
1915
|
* @example
|
|
1856
1916
|
* ```typescript
|
|
1857
1917
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1858
|
-
* const fWorksheet = fWorkbook.
|
|
1918
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1919
|
+
* if (!fWorksheet) return;
|
|
1859
1920
|
*
|
|
1860
1921
|
* // Create a conditional formatting rule that highlights cells with values less than 10 in red for the range A1:D10.
|
|
1861
1922
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1877,7 +1938,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1877
1938
|
* @example
|
|
1878
1939
|
* ```typescript
|
|
1879
1940
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1880
|
-
* const fWorksheet = fWorkbook.
|
|
1941
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1942
|
+
* if (!fWorksheet) return;
|
|
1881
1943
|
*
|
|
1882
1944
|
* // Create a conditional formatting rule that highlights cells with values less than or equal to 10 in red for the range A1:D10.
|
|
1883
1945
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1900,7 +1962,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1900
1962
|
* @example
|
|
1901
1963
|
* ```typescript
|
|
1902
1964
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1903
|
-
* const fWorksheet = fWorkbook.
|
|
1965
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1966
|
+
* if (!fWorksheet) return;
|
|
1904
1967
|
*
|
|
1905
1968
|
* // Create a conditional formatting rule that highlights cells with values not between 10 and 20 in red for the range A1:D10.
|
|
1906
1969
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1922,7 +1985,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1922
1985
|
* @example
|
|
1923
1986
|
* ```typescript
|
|
1924
1987
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1925
|
-
* const fWorksheet = fWorkbook.
|
|
1988
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
1989
|
+
* if (!fWorksheet) return;
|
|
1926
1990
|
*
|
|
1927
1991
|
* // Create a conditional formatting rule that highlights cells with values not equal to 10 in red for the range A1:D10.
|
|
1928
1992
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1944,7 +2008,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1944
2008
|
* @example
|
|
1945
2009
|
* ```typescript
|
|
1946
2010
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1947
|
-
* const fWorksheet = fWorkbook.
|
|
2011
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
2012
|
+
* if (!fWorksheet) return;
|
|
1948
2013
|
*
|
|
1949
2014
|
* // Create a conditional formatting rule that highlights cells with text containing 'apple' in red for the range A1:D10.
|
|
1950
2015
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1966,7 +2031,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1966
2031
|
* @example
|
|
1967
2032
|
* ```typescript
|
|
1968
2033
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1969
|
-
* const fWorksheet = fWorkbook.
|
|
2034
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
2035
|
+
* if (!fWorksheet) return;
|
|
1970
2036
|
*
|
|
1971
2037
|
* // Create a conditional formatting rule that highlights cells with text not containing 'apple' in red for the range A1:D10.
|
|
1972
2038
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -1988,7 +2054,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
1988
2054
|
* @example
|
|
1989
2055
|
* ```typescript
|
|
1990
2056
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1991
|
-
* const fWorksheet = fWorkbook.
|
|
2057
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
2058
|
+
* if (!fWorksheet) return;
|
|
1992
2059
|
*
|
|
1993
2060
|
* // Create a conditional formatting rule that highlights cells with text ending with '.ai' in red for the range A1:D10.
|
|
1994
2061
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -2010,7 +2077,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
2010
2077
|
* @example
|
|
2011
2078
|
* ```typescript
|
|
2012
2079
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
2013
|
-
* const fWorksheet = fWorkbook.
|
|
2080
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
2081
|
+
* if (!fWorksheet) return;
|
|
2014
2082
|
*
|
|
2015
2083
|
* // Create a conditional formatting rule that highlights cells with text equal to 'apple' in red for the range A1:D10.
|
|
2016
2084
|
* const fRange = fWorksheet.getRange('A1:D10');
|
|
@@ -2032,7 +2100,8 @@ var FConditionalFormattingBuilder = class {
|
|
|
2032
2100
|
* @example
|
|
2033
2101
|
* ```typescript
|
|
2034
2102
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
2035
|
-
* const fWorksheet = fWorkbook.
|
|
2103
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
2104
|
+
* if (!fWorksheet) return;
|
|
2036
2105
|
*
|
|
2037
2106
|
* // Create a conditional formatting rule that highlights cells with text starting with 'https://' in red for the range A1:D10.
|
|
2038
2107
|
* const fRange = fWorksheet.getRange('A1:D10');
|