jspreadsheet 12.0.4 → 12.0.5

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 (2) hide show
  1. package/dist/index.d.ts +24 -14
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -144,9 +144,22 @@ declare namespace jspreadsheet {
144
144
  translate: (text: string, substitutions: string[]) => string;
145
145
  }
146
146
 
147
+ interface Shortcut {
148
+ key?: string,
149
+ code?: string,
150
+ handler: (event: KeyboardEvent, internalEvent: object) => void,
151
+ ctrlKey?: boolean,
152
+ altKey?: boolean,
153
+ shiftKey?: boolean,
154
+ }
155
+
147
156
  interface Shortcuts {
148
- get: (event: object) => Function | null;
149
- set: (shortcut: string, method: Function | null) => void;
157
+ // Get the first shortcut based on the event properties
158
+ get: (event: Shortcut | KeyboardEvent) => Function | null;
159
+ // Create a new shortcut with the defined properties
160
+ set: (shortcut: Shortcut) => void;
161
+ // Remove the shortcut that matches the defined properties
162
+ reset: (shortcut: Shortcut) => void;
150
163
  }
151
164
 
152
165
  interface PickerOptions {
@@ -621,24 +634,26 @@ declare namespace jspreadsheet {
621
634
  }
622
635
 
623
636
  interface ContextmenuItem {
624
- /** Context menu item type: line | divisor | default */
625
- type?: 'line' | 'divisor' | 'default';
637
+ /** Context menu item type: line | default */
638
+ type?: 'line' | 'default';
626
639
  /** Context menu item title */
627
640
  title: string;
628
641
  /** Context menu icon key. (Material icon key icon identification) */
629
642
  icon?: string;
630
- /** HTML id property of the item DOM element */
631
- id?: string;
632
643
  /** Item is disabled */
633
644
  disabled?: boolean;
634
- /** Onclick event for the contextmenu item */
635
- onclick?: (instance: object, e: MouseEvent) => void;
636
645
  /** A short description or instruction for the item. Normally a shortcut. Ex. CTRL + C */
637
646
  shortcut?: string;
638
647
  /** Show this text when the user mouse over the element */
639
648
  tooltip?: string;
640
649
  /** Submenu */
641
650
  submenu?: Array<ContextmenuItem>;
651
+ /** Onclick event for the contextmenu item */
652
+ onclick?: (e: MouseEvent, element: HTMLElement) => void;
653
+ /** onopen event */
654
+ onopen?: (self: object) => void;
655
+ /** onclose event */
656
+ onclose?: (self: object) => void;
642
657
  }
643
658
 
644
659
  interface Contextmenu {
@@ -1536,8 +1551,6 @@ declare namespace jspreadsheet {
1536
1551
  getOptions: (x: number, y?: number) => Cell | ColumnInstance | undefined;
1537
1552
  /** Get processed data by the coordinates of the cell. Extended process a color, progressbar and rating as raw. */
1538
1553
  getProcessed: (x: number, y: number, extended?: boolean) => any;
1539
- /** Get the properties for one column when only x is present or the cell when x and y is defined. */
1540
- getProperties: (x: number, y?: number) => Cell | ColumnInstance | undefined;
1541
1554
  /** Deprecated. Legacy alias to getProperties */
1542
1555
  getProperty: (x: number, y?: number) => Cell | ColumnInstance | undefined;
1543
1556
  /** Get the selection in a range format */
@@ -1804,11 +1817,8 @@ declare namespace jspreadsheet {
1804
1817
  /** Add a new configuration setting for a column or cell */
1805
1818
  setProperty(columnNumber: number, rowNumber: number, cellSettings?: Cell): boolean;
1806
1819
  setProperty(columnNumber: number, columnSettings: Column): boolean;
1807
- setProperty(changes: ({ x: number, value: Column } | { x: number, y: number, value: Cell })[]): boolean;
1820
+ setProperty(changes: ({ x: number, value: Column } | { x: number, y: number, value: Cell, update?: boolean })[]): boolean;
1808
1821
  setProperty(changes: Record<string, Cell>): boolean;
1809
- /** Add new properties to the existing column or cell settings */
1810
- updateProperty(columnNumber: number, rowNumber: number, cellSettings?: Cell, ignoreDOM?: boolean): void;
1811
- updateProperty(columnNumber: ({ x: number, value: Column } | { x: number, y: number, value: Cell })[], rowNumber?: undefined, cellSettings?: undefined, ignoreDOM?: boolean): void;
1812
1822
  /** Set or reset the cell as readonly */
1813
1823
  setReadOnly: (cellName: string|HTMLElement, state: boolean) => void;
1814
1824
  /** Set the data from one row */
package/package.json CHANGED
@@ -49,5 +49,5 @@
49
49
  },
50
50
  "main": "dist/index.js",
51
51
  "types": "dist/index.d.ts",
52
- "version": "12.0.4"
52
+ "version": "12.0.5"
53
53
  }