jspreadsheet 9.2.6 → 9.2.8

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/dist/index.d.ts CHANGED
@@ -55,6 +55,54 @@ declare namespace jspreadsheet {
55
55
  /** Get the current version */
56
56
  function version(): object;
57
57
 
58
+ /** Only available with the Validations extension */
59
+ interface Validation {
60
+ /** Excel-like range format Sheet1!A1:A6 */
61
+ range: string;
62
+ /** Validation type */
63
+ type: 'number' | 'text' | 'date' | 'list' | 'textLength' | 'empty' | 'notEmpty';
64
+ /** Validation action can be a warning or reject when the condition are not match or a format when the condition matches */
65
+ action: 'warning' | 'reject' | 'format';
66
+ /** Criteria to be match */
67
+ criteria:
68
+ | '='
69
+ | '!='
70
+ | '>='
71
+ | '>'
72
+ | '<='
73
+ | '<'
74
+ | 'between'
75
+ | 'not between'
76
+ | 'valid date'
77
+ | 'valid email'
78
+ | 'valid url'
79
+ | 'contains'
80
+ | 'not contains'
81
+ | 'begins with'
82
+ | 'ends with'
83
+ /** Custom message to the user */
84
+ text?: string;
85
+ /** Ignore blank cells */
86
+ allowBlank?: boolean;
87
+ /** For type: format you can apply some CSS when condition is matched */
88
+ format?: {
89
+ color: string;
90
+ 'background-color': string;
91
+ 'font-weight': number;
92
+ 'font-style': string;
93
+ }
94
+ /** For type: format you can add a class when condition is matched */
95
+ className?: string;
96
+ }
97
+
98
+ /** Only available with the Validations extension */
99
+ interface Validations {
100
+ // Index position in the array of validations
101
+ index?: number | null;
102
+ // The validation definition object
103
+ value: Validation;
104
+ }
105
+
58
106
  /** Native editors */
59
107
  interface Editors {
60
108
  // Create a DOM element for a cell edition
@@ -537,6 +585,8 @@ declare namespace jspreadsheet {
537
585
  onchangefooter?: (worksheet: worksheetInstance, newValue: string, oldValue: string) => void;
538
586
  /** When the value in a cell footer is changed. */
539
587
  onchangefootervalue?: (worksheet: worksheetInstance, x: number, y: number, value: string) => void;
588
+ /** When the footer cell is rendered */
589
+ onrenderfootercell?: (worksheet: worksheetInstance, x: number, y: number, value: string, td: HTMLElement) => void;
540
590
  /** On change nested headers */
541
591
  onchangenested?: (worksheet: worksheetInstance, options: object) => void;
542
592
  /** On change nested cell properties */
@@ -636,7 +686,7 @@ declare namespace jspreadsheet {
636
686
  /** Worksheets */
637
687
  worksheets?: Array<Worksheet>;
638
688
  /** Validations */
639
- validations?: any;
689
+ validations?: Validation[];
640
690
  /** Plugins */
641
691
  plugins?: Record<string, Function>
642
692
  }
@@ -1317,6 +1367,12 @@ declare namespace jspreadsheet {
1317
1367
  getWorksheetActive: () => number;
1318
1368
  /** Delete an existing worksheet by its position */
1319
1369
  deleteWorksheet: (position: number) => void;
1370
+ /** Get a validation object. Require the extension Validations. */
1371
+ getValidations: (validationIndex: number | null) => Validation | Validation[];
1372
+ /** Insert or update existing validations by index. Require the extension Validations. */
1373
+ setValidations: (validations: Validations[]) => void;
1374
+ /** Reset validations by validation indexes. Require the extension Validations. */
1375
+ resetValidations: (validationIndex: number | number[]) => void;
1320
1376
  }
1321
1377
  }
1322
1378