@univerjs/sheets-data-validation 0.6.0-experimental.20250125-1d060b9 → 0.6.0-experimental.20250220-d9a8e74

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/es/facade.js CHANGED
@@ -1,17 +1,18 @@
1
- var j = Object.defineProperty;
2
- var q = (c, e, t) => e in c ? j(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t;
3
- var f = (c, e, t) => q(c, typeof e != "symbol" ? e + "" : e, t);
4
- import { UpdateSheetDataValidationSettingCommand as U, UpdateSheetDataValidationOptionsCommand as v, UpdateSheetDataValidationRangeCommand as C, RemoveSheetDataValidationCommand as T, ClearRangeDataValidationCommand as W, AddSheetDataValidationCommand as A, SheetsDataValidationValidatorService as S, SheetDataValidationModel as V, RemoveSheetAllDataValidationCommand as O } from "@univerjs/sheets-data-validation";
5
- import { FRange as y, FWorkbook as M, FWorksheet as N } from "@univerjs/sheets/facade";
6
- import { generateRandomId as B, DataValidationType as o, DataValidationErrorStyle as w, DataValidationOperator as h, IUniverInstanceService as H, ICommandService as p, FUniver as x, CanceledError as _, toDisposable as g, FEventName as $ } from "@univerjs/core";
7
- import { DataValidationModel as b, getRuleOptions as F } from "@univerjs/data-validation";
8
- import { serializeRangeToRefString as P } from "@univerjs/engine-formula";
1
+ var H = Object.defineProperty;
2
+ var j = (g, e, t) => e in g ? H(g, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : g[e] = t;
3
+ var _ = (g, e, t) => j(g, typeof e != "symbol" ? e + "" : e, t);
4
+ import { UpdateSheetDataValidationSettingCommand as b, UpdateSheetDataValidationOptionsCommand as U, UpdateSheetDataValidationRangeCommand as C, RemoveSheetDataValidationCommand as A, ClearRangeDataValidationCommand as q, AddSheetDataValidationCommand as T, SheetsDataValidationValidatorService as S, SheetDataValidationModel as w, RemoveSheetAllDataValidationCommand as O } from "@univerjs/sheets-data-validation";
5
+ import { FRange as y, FWorkbook as x, FWorksheet as N } from "@univerjs/sheets/facade";
6
+ import { generateRandomId as L, DataValidationType as o, DataValidationErrorStyle as k, DataValidationOperator as h, IUniverInstanceService as W, ICommandService as p, CanceledError as f, toDisposable as c } from "@univerjs/core";
7
+ import { DataValidationModel as v, getRuleOptions as $ } from "@univerjs/data-validation";
8
+ import { serializeRangeToRefString as F } from "@univerjs/engine-formula";
9
+ import { FUniver as M, FEventName as P } from "@univerjs/core/facade";
9
10
  import { filter as R } from "rxjs";
10
- class D {
11
+ class E {
11
12
  constructor(e) {
12
- f(this, "_rule");
13
+ _(this, "_rule");
13
14
  this._rule = e != null ? e : {
14
- uid: B(),
15
+ uid: L(),
15
16
  ranges: void 0,
16
17
  type: o.CUSTOM
17
18
  };
@@ -38,9 +39,9 @@ class D {
38
39
  * ```
39
40
  */
40
41
  copy() {
41
- return new D({
42
+ return new E({
42
43
  ...this._rule,
43
- uid: B()
44
+ uid: L()
44
45
  });
45
46
  }
46
47
  /**
@@ -53,7 +54,7 @@ class D {
53
54
  * ```
54
55
  */
55
56
  getAllowInvalid() {
56
- return this._rule.errorStyle !== w.STOP;
57
+ return this._rule.errorStyle !== k.STOP;
57
58
  }
58
59
  /**
59
60
  * Gets the data validation type of the rule
@@ -227,8 +228,8 @@ class D {
227
228
  * const rule = builder.requireNumberBetween(1, 10).build();
228
229
  * ```
229
230
  */
230
- requireNumberBetween(e, t, r) {
231
- return this._rule.formula1 = `${e}`, this._rule.formula2 = `${t}`, this._rule.operator = h.BETWEEN, this._rule.type = r ? o.WHOLE : o.DECIMAL, this;
231
+ requireNumberBetween(e, t, i) {
232
+ return this._rule.formula1 = `${e}`, this._rule.formula2 = `${t}`, this._rule.operator = h.BETWEEN, this._rule.type = i ? o.WHOLE : o.DECIMAL, this;
232
233
  }
233
234
  /**
234
235
  * Requires the user to enter a number that is equal to a specific value, which can be an integer or a decimal
@@ -314,8 +315,8 @@ class D {
314
315
  * const rule = builder.requireNumberNotBetween(1, 10).build();
315
316
  * ```
316
317
  */
317
- requireNumberNotBetween(e, t, r) {
318
- return this._rule.formula1 = `${e}`, this._rule.formula2 = `${t}`, this._rule.operator = h.NOT_BETWEEN, this._rule.type = r ? o.WHOLE : o.DECIMAL, this;
318
+ requireNumberNotBetween(e, t, i) {
319
+ return this._rule.formula1 = `${e}`, this._rule.formula2 = `${t}`, this._rule.operator = h.NOT_BETWEEN, this._rule.type = i ? o.WHOLE : o.DECIMAL, this;
319
320
  }
320
321
  /**
321
322
  * Creates a data validation rule that requires the user to enter a number that is not equal to a specific value
@@ -345,8 +346,8 @@ class D {
345
346
  * const rule = builder.requireValueInList(['Yes', 'No']).build();
346
347
  * ```
347
348
  */
348
- requireValueInList(e, t, r) {
349
- return this._rule.type = t ? o.LIST_MULTIPLE : o.LIST, this._rule.formula1 = e.join(","), this._rule.formula2 = void 0, this._rule.showDropDown = r != null ? r : !0, this;
349
+ requireValueInList(e, t, i) {
350
+ return this._rule.type = t ? o.LIST_MULTIPLE : o.LIST, this._rule.formula1 = e.join(","), this._rule.formula2 = void 0, this._rule.showDropDown = i != null ? i : !0, this;
350
351
  }
351
352
  /**
352
353
  * Sets a data validation rule that requires the user to enter a value within a specific range
@@ -362,12 +363,12 @@ class D {
362
363
  * const rule = builder.requireValueInRange(range).build();
363
364
  * ```
364
365
  */
365
- requireValueInRange(e, t, r) {
366
- return this._rule.type = t ? o.LIST_MULTIPLE : o.LIST, this._rule.formula1 = `=${P({
366
+ requireValueInRange(e, t, i) {
367
+ return this._rule.type = t ? o.LIST_MULTIPLE : o.LIST, this._rule.formula1 = `=${F({
367
368
  unitId: e.getUnitId(),
368
369
  sheetName: e.getSheetName(),
369
370
  range: e.getRange()
370
- })}`, this._rule.formula2 = void 0, this._rule.showDropDown = r != null ? r : !0, this;
371
+ })}`, this._rule.formula2 = void 0, this._rule.showDropDown = i != null ? i : !0, this;
371
372
  }
372
373
  /**
373
374
  * Sets whether to allow invalid data and configures the error style
@@ -382,7 +383,7 @@ class D {
382
383
  * ```
383
384
  */
384
385
  setAllowInvalid(e) {
385
- return this._rule.errorStyle = e ? w.WARNING : w.STOP, this;
386
+ return this._rule.errorStyle = e ? k.WARNING : k.STOP, this;
386
387
  }
387
388
  /**
388
389
  * Sets whether to allow blank values
@@ -416,11 +417,11 @@ class D {
416
417
  }
417
418
  }
418
419
  class m {
419
- constructor(e, t, r) {
420
- f(this, "rule");
421
- f(this, "_worksheet");
422
- f(this, "_injector");
423
- this._injector = r, this.rule = e, this._worksheet = t;
420
+ constructor(e, t, i) {
421
+ _(this, "rule");
422
+ _(this, "_worksheet");
423
+ _(this, "_injector");
424
+ this._injector = i, this.rule = e, this._worksheet = t;
424
425
  }
425
426
  /**
426
427
  * Gets whether invalid data is allowed based on the error style value
@@ -436,7 +437,7 @@ class m {
436
437
  * ```
437
438
  */
438
439
  getAllowInvalid() {
439
- return this.rule.errorStyle !== w.STOP;
440
+ return this.rule.errorStyle !== k.STOP;
440
441
  }
441
442
  /**
442
443
  * Gets the data validation type of the rule
@@ -501,7 +502,7 @@ class m {
501
502
  * ```
502
503
  */
503
504
  copy() {
504
- return new D(this.rule);
505
+ return new E(this.rule);
505
506
  }
506
507
  /**
507
508
  * Gets whether the data validation rule is applied to the worksheet
@@ -519,7 +520,7 @@ class m {
519
520
  getApplied() {
520
521
  if (!this._worksheet)
521
522
  return !1;
522
- const t = this._injector.get(b).getRuleById(this._worksheet.getUnitId(), this._worksheet.getSheetId(), this.rule.uid);
523
+ const t = this._injector.get(v).getRuleById(this._worksheet.getUnitId(), this._worksheet.getSheetId(), this.rule.uid);
523
524
  return !!(t && t.ranges.length);
524
525
  }
525
526
  /**
@@ -538,7 +539,7 @@ class m {
538
539
  getRanges() {
539
540
  if (!this.getApplied())
540
541
  return [];
541
- const e = this._injector.get(H).getUnit(this._worksheet.getUnitId());
542
+ const e = this._injector.get(W).getUnit(this._worksheet.getUnitId());
542
543
  return this.rule.ranges.map((t) => this._injector.createInstance(y, e, this._worksheet, t));
543
544
  }
544
545
  /**
@@ -595,8 +596,8 @@ class m {
595
596
  * );
596
597
  * ```
597
598
  */
598
- setCriteria(e, t, r = !0) {
599
- if (this.getApplied() && !this._injector.get(p).syncExecuteCommand(U.id, {
599
+ setCriteria(e, t, i = !0) {
600
+ if (this.getApplied() && !this._injector.get(p).syncExecuteCommand(b.id, {
600
601
  unitId: this.getUnitId(),
601
602
  subUnitId: this.getSheetId(),
602
603
  ruleId: this.rule.uid,
@@ -605,11 +606,11 @@ class m {
605
606
  formula1: t[1],
606
607
  formula2: t[2],
607
608
  type: this.rule.type,
608
- allowBlank: r
609
+ allowBlank: i
609
610
  }
610
611
  }))
611
612
  throw new Error("setCriteria failed");
612
- return this.rule.operator = t[0], this.rule.formula1 = t[1], this.rule.formula2 = t[2], this.rule.type = e, this.rule.allowBlank = r, this;
613
+ return this.rule.operator = t[0], this.rule.formula1 = t[1], this.rule.formula2 = t[2], this.rule.type = e, this.rule.allowBlank = i, this;
613
614
  }
614
615
  /**
615
616
  * Set the options for the data validation rule
@@ -630,12 +631,12 @@ class m {
630
631
  * ```
631
632
  */
632
633
  setOptions(e) {
633
- if (this.getApplied() && !this._injector.get(p).syncExecuteCommand(v.id, {
634
+ if (this.getApplied() && !this._injector.get(p).syncExecuteCommand(U.id, {
634
635
  unitId: this.getUnitId(),
635
636
  subUnitId: this.getSheetId(),
636
637
  ruleId: this.rule.uid,
637
638
  options: {
638
- ...F(this.rule),
639
+ ...$(this.rule),
639
640
  ...e
640
641
  }
641
642
  }))
@@ -662,7 +663,7 @@ class m {
662
663
  unitId: this.getUnitId(),
663
664
  subUnitId: this.getSheetId(),
664
665
  ruleId: this.rule.uid,
665
- ranges: e.map((a) => a.getRange())
666
+ ranges: e.map((r) => r.getRange())
666
667
  }))
667
668
  throw new Error("setRanges failed");
668
669
  return this.rule.ranges = e.map((t) => t.getRange()), this;
@@ -681,7 +682,7 @@ class m {
681
682
  * ```
682
683
  */
683
684
  delete() {
684
- return this.getApplied() ? this._injector.get(p).syncExecuteCommand(T.id, {
685
+ return this.getApplied() ? this._injector.get(p).syncExecuteCommand(A.id, {
685
686
  unitId: this.getUnitId(),
686
687
  subUnitId: this.getSheetId(),
687
688
  ruleId: this.rule.uid
@@ -691,7 +692,7 @@ class m {
691
692
  class G extends y {
692
693
  setDataValidation(e) {
693
694
  if (!e)
694
- return this._commandService.syncExecuteCommand(W.id, {
695
+ return this._commandService.syncExecuteCommand(q.id, {
695
696
  unitId: this._workbook.getUnitId(),
696
697
  subUnitId: this._worksheet.getSheetId(),
697
698
  ranges: [this._range]
@@ -704,7 +705,7 @@ class G extends y {
704
705
  ranges: [this._range]
705
706
  }
706
707
  };
707
- return this._commandService.syncExecuteCommand(A.id, t), this;
708
+ return this._commandService.syncExecuteCommand(T.id, t), this;
708
709
  }
709
710
  getDataValidation() {
710
711
  const t = this._injector.get(S).getDataValidation(
@@ -730,159 +731,180 @@ class G extends y {
730
731
  }
731
732
  }
732
733
  y.extend(G);
733
- class Q extends x {
734
+ class Q extends M {
734
735
  /**
735
736
  * @deprecated use `univerAPI.newDataValidation()` as instead.
736
737
  * @returns {FDataValidationBuilder} A new instance of the FDataValidationBuilder class
737
738
  */
738
739
  static newDataValidation() {
739
- return new D();
740
+ return new E();
740
741
  }
741
742
  newDataValidation() {
742
- return new D();
743
+ return new E();
743
744
  }
744
745
  /**
745
746
  * @ignore
746
747
  */
747
748
  // eslint-disable-next-line max-lines-per-function
748
749
  _initialize(e) {
749
- if (!e.has(V)) return;
750
- const t = e.get(V), r = e.get(p);
751
- this.disposeWithMe(t.ruleChange$.subscribe((a) => {
752
- const { unitId: i, subUnitId: n, rule: d, oldRule: u, type: s } = a, l = this.getSheetTarget(i, n);
753
- if (!l)
754
- return;
755
- const { workbook: I, worksheet: k } = l, E = new m(d, k.getSheet(), this._injector);
756
- this.fireEvent(this.Event.SheetDataValidationChanged, {
757
- origin: a,
758
- worksheet: k,
759
- workbook: I,
760
- changeType: s,
761
- oldRule: u,
762
- rule: E
763
- });
764
- })), this.disposeWithMe(t.validStatusChange$.subscribe((a) => {
765
- const { unitId: i, subUnitId: n, ruleId: d, status: u, row: s, col: l } = a, I = this.getSheetTarget(i, n);
766
- if (!I)
767
- return;
768
- const { workbook: k, worksheet: E } = I, L = E.getDataValidation(d);
769
- L && this.fireEvent(this.Event.SheetDataValidatorStatusChanged, {
770
- workbook: k,
771
- worksheet: E,
772
- row: s,
773
- column: l,
774
- rule: L,
775
- status: u
776
- });
777
- })), this.disposeWithMe(r.beforeCommandExecuted((a) => {
778
- switch (a.id) {
779
- case A.id: {
780
- const i = a.params, n = this.getSheetTarget(i.unitId, i.subUnitId);
750
+ if (!e.has(w)) return;
751
+ const t = e.get(w), i = e.get(p);
752
+ this.registerEventHandler(
753
+ this.Event.SheetDataValidationChanged,
754
+ () => t.ruleChange$.subscribe((r) => {
755
+ const { unitId: a, subUnitId: n, rule: u, oldRule: l, type: s } = r, d = this.getSheetTarget(a, n);
756
+ if (!d)
757
+ return;
758
+ const { workbook: D, worksheet: I } = d, V = new m(u, I.getSheet(), this._injector);
759
+ this.fireEvent(this.Event.SheetDataValidationChanged, {
760
+ origin: r,
761
+ worksheet: I,
762
+ workbook: D,
763
+ changeType: s,
764
+ oldRule: l,
765
+ rule: V
766
+ });
767
+ })
768
+ ), this.registerEventHandler(
769
+ this.Event.SheetDataValidatorStatusChanged,
770
+ () => t.validStatusChange$.subscribe((r) => {
771
+ const { unitId: a, subUnitId: n, ruleId: u, status: l, row: s, col: d } = r, D = this.getSheetTarget(a, n);
772
+ if (!D)
773
+ return;
774
+ const { workbook: I, worksheet: V } = D, B = V.getDataValidation(u);
775
+ B && this.fireEvent(this.Event.SheetDataValidatorStatusChanged, {
776
+ workbook: I,
777
+ worksheet: V,
778
+ row: s,
779
+ column: d,
780
+ rule: B,
781
+ status: l
782
+ });
783
+ })
784
+ ), this.registerEventHandler(
785
+ this.Event.BeforeSheetDataValidationAdd,
786
+ () => i.beforeCommandExecuted((r) => {
787
+ if (r.id === T.id) {
788
+ const a = r.params, n = this.getSheetTarget(a.unitId, a.subUnitId);
781
789
  if (!n)
782
790
  return;
783
- const { workbook: d, worksheet: u } = n, s = {
784
- worksheet: u,
785
- workbook: d,
786
- rule: i.rule
791
+ const { workbook: u, worksheet: l } = n, s = {
792
+ worksheet: l,
793
+ workbook: u,
794
+ rule: a.rule
787
795
  };
788
796
  if (this.fireEvent(this.Event.BeforeSheetDataValidationAdd, s), s.cancel)
789
- throw new _();
790
- break;
797
+ throw new f();
791
798
  }
792
- case U.id: {
793
- const i = a.params, n = this.getSheetTarget(i.unitId, i.subUnitId);
799
+ })
800
+ ), this.registerEventHandler(
801
+ this.Event.BeforeSheetDataValidationCriteriaUpdate,
802
+ () => i.beforeCommandExecuted((r) => {
803
+ if (r.id === b.id) {
804
+ const a = r.params, n = this.getSheetTarget(a.unitId, a.subUnitId);
794
805
  if (!n)
795
806
  return;
796
- const { workbook: d, worksheet: u } = n, s = u.getDataValidation(i.ruleId);
807
+ const { workbook: u, worksheet: l } = n, s = l.getDataValidation(a.ruleId);
797
808
  if (!s)
798
809
  return;
799
- const l = {
800
- worksheet: u,
801
- workbook: d,
810
+ const d = {
811
+ worksheet: l,
812
+ workbook: u,
802
813
  rule: s,
803
- ruleId: i.ruleId,
804
- newCriteria: i.setting
814
+ ruleId: a.ruleId,
815
+ newCriteria: a.setting
805
816
  };
806
- if (this.fireEvent(this.Event.BeforeSheetDataValidationCriteriaUpdate, l), l.cancel)
807
- throw new _();
808
- break;
817
+ if (this.fireEvent(this.Event.BeforeSheetDataValidationCriteriaUpdate, d), d.cancel)
818
+ throw new f();
809
819
  }
810
- case C.id: {
811
- const i = a.params, n = this.getSheetTarget(i.unitId, i.subUnitId);
820
+ })
821
+ ), this.registerEventHandler(
822
+ this.Event.BeforeSheetDataValidationRangeUpdate,
823
+ () => i.beforeCommandExecuted((r) => {
824
+ if (r.id === C.id) {
825
+ const a = r.params, n = this.getSheetTarget(a.unitId, a.subUnitId);
812
826
  if (!n)
813
827
  return;
814
- const { workbook: d, worksheet: u } = n, s = u.getDataValidation(i.ruleId);
828
+ const { workbook: u, worksheet: l } = n, s = l.getDataValidation(a.ruleId);
815
829
  if (!s)
816
830
  return;
817
- const l = {
818
- worksheet: u,
819
- workbook: d,
831
+ const d = {
832
+ worksheet: l,
833
+ workbook: u,
820
834
  rule: s,
821
- ruleId: i.ruleId,
822
- newRanges: i.ranges
835
+ ruleId: a.ruleId,
836
+ newRanges: a.ranges
823
837
  };
824
- if (this.fireEvent(this.Event.BeforeSheetDataValidationRangeUpdate, l), l.cancel)
825
- throw new _();
826
- break;
838
+ if (this.fireEvent(this.Event.BeforeSheetDataValidationRangeUpdate, d), d.cancel)
839
+ throw new f();
827
840
  }
828
- case v.id: {
829
- const i = a.params, n = this.getSheetTarget(i.unitId, i.subUnitId);
841
+ })
842
+ ), this.registerEventHandler(
843
+ this.Event.BeforeSheetDataValidationOptionsUpdate,
844
+ () => i.beforeCommandExecuted((r) => {
845
+ if (r.id === U.id) {
846
+ const a = r.params, n = this.getSheetTarget(a.unitId, a.subUnitId);
830
847
  if (!n)
831
848
  return;
832
- const { workbook: d, worksheet: u } = n, s = u.getDataValidation(i.ruleId);
849
+ const { workbook: u, worksheet: l } = n, s = l.getDataValidation(a.ruleId);
833
850
  if (!s)
834
851
  return;
835
- const l = {
836
- worksheet: u,
837
- workbook: d,
852
+ const d = {
853
+ worksheet: l,
854
+ workbook: u,
838
855
  rule: s,
839
- ruleId: i.ruleId,
840
- newOptions: i.options
856
+ ruleId: a.ruleId,
857
+ newOptions: a.options
841
858
  };
842
- if (this.fireEvent(this.Event.BeforeSheetDataValidationOptionsUpdate, l), l.cancel)
843
- throw new _();
844
- break;
859
+ if (this.fireEvent(this.Event.BeforeSheetDataValidationOptionsUpdate, d), d.cancel)
860
+ throw new f();
845
861
  }
846
- case T.id: {
847
- const i = a.params, n = this.getSheetTarget(i.unitId, i.subUnitId);
862
+ })
863
+ ), this.registerEventHandler(
864
+ this.Event.BeforeSheetDataValidationDelete,
865
+ () => i.beforeCommandExecuted((r) => {
866
+ if (r.id === A.id) {
867
+ const a = r.params, n = this.getSheetTarget(a.unitId, a.subUnitId);
848
868
  if (!n)
849
869
  return;
850
- const { workbook: d, worksheet: u } = n, s = u.getDataValidation(i.ruleId);
870
+ const { workbook: u, worksheet: l } = n, s = l.getDataValidation(a.ruleId);
851
871
  if (!s)
852
872
  return;
853
- const l = {
854
- worksheet: u,
855
- workbook: d,
873
+ const d = {
874
+ worksheet: l,
875
+ workbook: u,
856
876
  rule: s,
857
- ruleId: i.ruleId
877
+ ruleId: a.ruleId
858
878
  };
859
- if (this.fireEvent(this.Event.BeforeSheetDataValidationDelete, l), l.cancel)
860
- throw new _();
861
- break;
879
+ if (this.fireEvent(this.Event.BeforeSheetDataValidationDelete, d), d.cancel)
880
+ throw new f();
862
881
  }
863
- case O.id: {
864
- const i = a.params, n = this.getSheetTarget(i.unitId, i.subUnitId);
882
+ })
883
+ ), this.registerEventHandler(
884
+ this.Event.BeforeSheetDataValidationDeleteAll,
885
+ () => i.beforeCommandExecuted((r) => {
886
+ if (r.id === O.id) {
887
+ const a = r.params, n = this.getSheetTarget(a.unitId, a.subUnitId);
865
888
  if (!n)
866
889
  return;
867
- const { workbook: d, worksheet: u } = n, s = {
868
- worksheet: u,
869
- workbook: d,
870
- rules: u.getDataValidations()
890
+ const { workbook: u, worksheet: l } = n, s = {
891
+ worksheet: l,
892
+ workbook: u,
893
+ rules: l.getDataValidations()
871
894
  };
872
895
  if (this.fireEvent(this.Event.BeforeSheetDataValidationDeleteAll, s), s.cancel)
873
- throw new _();
874
- break;
896
+ throw new f();
875
897
  }
876
- }
877
- }));
898
+ })
899
+ );
878
900
  }
879
901
  }
880
- x.extend(Q);
881
- class z extends M {
902
+ M.extend(Q);
903
+ class z extends x {
882
904
  _initialize() {
883
905
  Object.defineProperty(this, "_dataValidationModel", {
884
906
  get() {
885
- return this._injector.get(V);
907
+ return this._injector.get(w);
886
908
  }
887
909
  });
888
910
  }
@@ -891,82 +913,82 @@ class z extends M {
891
913
  }
892
914
  // region DataValidationHooks
893
915
  onDataValidationChange(e) {
894
- return g(this._dataValidationModel.ruleChange$.pipe(R((t) => t.unitId === this._workbook.getUnitId())).subscribe(e));
916
+ return c(this._dataValidationModel.ruleChange$.pipe(R((t) => t.unitId === this._workbook.getUnitId())).subscribe(e));
895
917
  }
896
918
  onDataValidationStatusChange(e) {
897
- return g(this._dataValidationModel.validStatusChange$.pipe(R((t) => t.unitId === this._workbook.getUnitId())).subscribe(e));
919
+ return c(this._dataValidationModel.validStatusChange$.pipe(R((t) => t.unitId === this._workbook.getUnitId())).subscribe(e));
898
920
  }
899
921
  onBeforeAddDataValidation(e) {
900
- return g(this._commandService.beforeCommandExecuted((t, r) => {
901
- const a = t.params;
902
- if (t.id === A.id) {
903
- if (a.unitId !== this._workbook.getUnitId())
922
+ return c(this._commandService.beforeCommandExecuted((t, i) => {
923
+ const r = t.params;
924
+ if (t.id === T.id) {
925
+ if (r.unitId !== this._workbook.getUnitId())
904
926
  return;
905
- if (e(a, r) === !1)
927
+ if (e(r, i) === !1)
906
928
  throw new Error("Command is stopped by the hook onBeforeAddDataValidation");
907
929
  }
908
930
  }));
909
931
  }
910
932
  onBeforeUpdateDataValidationCriteria(e) {
911
- return g(this._commandService.beforeCommandExecuted((t, r) => {
912
- const a = t.params;
913
- if (t.id === U.id) {
914
- if (a.unitId !== this._workbook.getUnitId())
933
+ return c(this._commandService.beforeCommandExecuted((t, i) => {
934
+ const r = t.params;
935
+ if (t.id === b.id) {
936
+ if (r.unitId !== this._workbook.getUnitId())
915
937
  return;
916
- if (e(a, r) === !1)
938
+ if (e(r, i) === !1)
917
939
  throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationCriteria");
918
940
  }
919
941
  }));
920
942
  }
921
943
  onBeforeUpdateDataValidationRange(e) {
922
- return g(this._commandService.beforeCommandExecuted((t, r) => {
923
- const a = t.params;
944
+ return c(this._commandService.beforeCommandExecuted((t, i) => {
945
+ const r = t.params;
924
946
  if (t.id === C.id) {
925
- if (a.unitId !== this._workbook.getUnitId())
947
+ if (r.unitId !== this._workbook.getUnitId())
926
948
  return;
927
- if (e(a, r) === !1)
949
+ if (e(r, i) === !1)
928
950
  throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationRange");
929
951
  }
930
952
  }));
931
953
  }
932
954
  onBeforeUpdateDataValidationOptions(e) {
933
- return g(this._commandService.beforeCommandExecuted((t, r) => {
934
- const a = t.params;
935
- if (t.id === v.id) {
936
- if (a.unitId !== this._workbook.getUnitId())
955
+ return c(this._commandService.beforeCommandExecuted((t, i) => {
956
+ const r = t.params;
957
+ if (t.id === U.id) {
958
+ if (r.unitId !== this._workbook.getUnitId())
937
959
  return;
938
- if (e(a, r) === !1)
960
+ if (e(r, i) === !1)
939
961
  throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationOptions");
940
962
  }
941
963
  }));
942
964
  }
943
965
  onBeforeDeleteDataValidation(e) {
944
- return g(this._commandService.beforeCommandExecuted((t, r) => {
945
- const a = t.params;
946
- if (t.id === T.id) {
947
- if (a.unitId !== this._workbook.getUnitId())
966
+ return c(this._commandService.beforeCommandExecuted((t, i) => {
967
+ const r = t.params;
968
+ if (t.id === A.id) {
969
+ if (r.unitId !== this._workbook.getUnitId())
948
970
  return;
949
- if (e(a, r) === !1)
971
+ if (e(r, i) === !1)
950
972
  throw new Error("Command is stopped by the hook onBeforeDeleteDataValidation");
951
973
  }
952
974
  }));
953
975
  }
954
976
  onBeforeDeleteAllDataValidation(e) {
955
- return g(this._commandService.beforeCommandExecuted((t, r) => {
956
- const a = t.params;
977
+ return c(this._commandService.beforeCommandExecuted((t, i) => {
978
+ const r = t.params;
957
979
  if (t.id === O.id) {
958
- if (a.unitId !== this._workbook.getUnitId())
980
+ if (r.unitId !== this._workbook.getUnitId())
959
981
  return;
960
- if (e(a, r) === !1)
982
+ if (e(r, i) === !1)
961
983
  throw new Error("Command is stopped by the hook onBeforeDeleteAllDataValidation");
962
984
  }
963
985
  }));
964
986
  }
965
987
  }
966
- M.extend(z);
988
+ x.extend(z);
967
989
  class K extends N {
968
990
  getDataValidations() {
969
- return this._injector.get(b).getRules(this._workbook.getUnitId(), this._worksheet.getSheetId()).map((t) => new m(t, this._worksheet, this._injector));
991
+ return this._injector.get(v).getRules(this._workbook.getUnitId(), this._worksheet.getSheetId()).map((t) => new m(t, this._worksheet, this._injector));
970
992
  }
971
993
  getValidatorStatus() {
972
994
  return this._injector.get(S).validatorWorksheet(
@@ -978,8 +1000,8 @@ class K extends N {
978
1000
  return this.getValidatorStatus();
979
1001
  }
980
1002
  getDataValidation(e) {
981
- const r = this._injector.get(b).getRuleById(this._workbook.getUnitId(), this._worksheet.getSheetId(), e);
982
- return r ? new m(r, this._worksheet, this._injector) : null;
1003
+ const i = this._injector.get(v).getRuleById(this._workbook.getUnitId(), this._worksheet.getSheetId(), e);
1004
+ return i ? new m(i, this._worksheet, this._injector) : null;
983
1005
  }
984
1006
  }
985
1007
  N.extend(K);
@@ -1009,8 +1031,8 @@ class X {
1009
1031
  return "BeforeSheetDataValidationOptionsUpdate";
1010
1032
  }
1011
1033
  }
1012
- $.extend(X);
1034
+ P.extend(X);
1013
1035
  export {
1014
1036
  m as FDataValidation,
1015
- D as FDataValidationBuilder
1037
+ E as FDataValidationBuilder
1016
1038
  };
package/lib/es/index.js CHANGED
@@ -2347,13 +2347,13 @@ let we = class extends wt {
2347
2347
  Va
2348
2348
  ].forEach((s) => {
2349
2349
  this._commandService.registerCommand(s);
2350
- }), this._injector.get(q), this._injector.get(Oe), this._injector.get(Ee), this._injector.get(Fe);
2350
+ }), this._injector.get(q), this._injector.get(Oe), this._injector.get(Ce), this._injector.get(Ee), this._injector.get(Fe);
2351
2351
  }
2352
2352
  onReady() {
2353
2353
  this._injector.get(Ne);
2354
2354
  }
2355
2355
  onRendered() {
2356
- this._injector.get(Ce), this._injector.get(Te);
2356
+ this._injector.get(Te);
2357
2357
  }
2358
2358
  };
2359
2359
  pt(we, "pluginName", Yt);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2023-present DreamNum Inc.
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.