@progress/kendo-spreadsheet-common 1.0.0-develop.3 → 1.0.0-develop.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.
package/dist/index-esm.js CHANGED
@@ -956,7 +956,7 @@ const options = {
956
956
  headerHeight: 20,
957
957
  headerWidth: 32,
958
958
  excel: {
959
- fileName: "Spreadsheet.xslx",
959
+ fileName: "Workbook.xlsx",
960
960
  forceProxy: false,
961
961
  proxyURL: "",
962
962
  },
@@ -23161,6 +23161,14 @@ class View extends Observable {
23161
23161
 
23162
23162
  destroy() {
23163
23163
  this.unbind();
23164
+
23165
+ [this.tree, this.clipboardContents].forEach(el => {
23166
+ while (el && el.root && el.root.lastChild) {
23167
+ el.root.removeChild(el.root.lastChild);
23168
+ }
23169
+ });
23170
+ this.tree = this.clipboardContents = null;
23171
+
23164
23172
  // this._dialogs.forEach(function(dialog) {
23165
23173
  // dialog.destroy();
23166
23174
  // });
@@ -27406,8 +27414,10 @@ class Workbook extends Observable {
27406
27414
  }
27407
27415
 
27408
27416
  fromFile(file) {
27409
- this._clearSheets();
27410
- readExcel(file, this);
27417
+ if (file && !this.trigger("excelImport", { file })) {
27418
+ this._clearSheets();
27419
+ readExcel(file, this);
27420
+ }
27411
27421
  }
27412
27422
 
27413
27423
  saveAsExcel(options) {
@@ -27739,10 +27749,6 @@ class Spreadsheet extends Widget {
27739
27749
  this.events = events;
27740
27750
  this.bind(this.events, this.options);
27741
27751
 
27742
- this.element.classList.add('k-widget');
27743
- this.element.classList.add('k-spreadsheet');
27744
- this.element.setAttribute("role", "application");
27745
-
27746
27752
  locale(this.options.locale);
27747
27753
 
27748
27754
  this._view = new View(this.element, {
@@ -27754,11 +27760,6 @@ class Spreadsheet extends Widget {
27754
27760
  nameBoxRef: this.options.nameBoxRef
27755
27761
  });
27756
27762
 
27757
- // element.querySelector('.k-spreadsheet-cell-context-menu').style.display = 'none';
27758
- // element.querySelector('.k-spreadsheet-row-header-context-menu').style.display = 'none';
27759
- // element.querySelector('.k-spreadsheet-col-header-context-menu').style.display = 'none';
27760
- // element.querySelector('.k-spreadsheet-drawing-context-menu').style.display = 'none';
27761
-
27762
27763
  this._workbook = new Workbook(this.options, this._view);
27763
27764
 
27764
27765
  this._controller = new Controller(this._view, this._workbook);
package/dist/index.js CHANGED
@@ -956,7 +956,7 @@
956
956
  headerHeight: 20,
957
957
  headerWidth: 32,
958
958
  excel: {
959
- fileName: "Spreadsheet.xslx",
959
+ fileName: "Workbook.xlsx",
960
960
  forceProxy: false,
961
961
  proxyURL: "",
962
962
  },
@@ -23161,6 +23161,14 @@
23161
23161
 
23162
23162
  destroy() {
23163
23163
  this.unbind();
23164
+
23165
+ [this.tree, this.clipboardContents].forEach(el => {
23166
+ while (el && el.root && el.root.lastChild) {
23167
+ el.root.removeChild(el.root.lastChild);
23168
+ }
23169
+ });
23170
+ this.tree = this.clipboardContents = null;
23171
+
23164
23172
  // this._dialogs.forEach(function(dialog) {
23165
23173
  // dialog.destroy();
23166
23174
  // });
@@ -27406,8 +27414,10 @@
27406
27414
  }
27407
27415
 
27408
27416
  fromFile(file) {
27409
- this._clearSheets();
27410
- readExcel(file, this);
27417
+ if (file && !this.trigger("excelImport", { file })) {
27418
+ this._clearSheets();
27419
+ readExcel(file, this);
27420
+ }
27411
27421
  }
27412
27422
 
27413
27423
  saveAsExcel(options) {
@@ -27739,10 +27749,6 @@
27739
27749
  this.events = events;
27740
27750
  this.bind(this.events, this.options);
27741
27751
 
27742
- this.element.classList.add('k-widget');
27743
- this.element.classList.add('k-spreadsheet');
27744
- this.element.setAttribute("role", "application");
27745
-
27746
27752
  locale(this.options.locale);
27747
27753
 
27748
27754
  this._view = new View(this.element, {
@@ -27754,11 +27760,6 @@
27754
27760
  nameBoxRef: this.options.nameBoxRef
27755
27761
  });
27756
27762
 
27757
- // element.querySelector('.k-spreadsheet-cell-context-menu').style.display = 'none';
27758
- // element.querySelector('.k-spreadsheet-row-header-context-menu').style.display = 'none';
27759
- // element.querySelector('.k-spreadsheet-col-header-context-menu').style.display = 'none';
27760
- // element.querySelector('.k-spreadsheet-drawing-context-menu').style.display = 'none';
27761
-
27762
27763
  this._workbook = new Workbook(this.options, this._view);
27763
27764
 
27764
27765
  this._controller = new Controller(this._view, this._workbook);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-spreadsheet-common",
3
3
  "description": "Kendo UI platform-independent Spreadsheet library",
4
- "version": "1.0.0-develop.3",
4
+ "version": "1.0.0-develop.5",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],
package/src/index.d.ts CHANGED
@@ -303,26 +303,53 @@ export interface DocumentDescriptor {
303
303
 
304
304
  export class View {
305
305
  constructor(element: HTMLElement, options: any);
306
- enableClipboard(enable: boolean): void;
307
- workbook(workbook?: Workbook): void | Workbook;
308
- sheet(sheet: Sheet): void;
309
- refresh(reason: any): void;
306
+ enableClipboard(enable: boolean): void;
307
+ workbook(workbook?: Workbook): void | Workbook;
308
+ sheet(sheet: Sheet): void;
309
+ refresh(reason: any): void;
310
310
  nameEditor: any;
311
311
  bind(eventName: string, handler: any, one?: boolean): void;
312
312
  }
313
313
 
314
314
  export class Workbook {
315
315
  constructor(options: any, view: View);
316
- execute(options: any): any;
317
- refresh(reason: any): void;
318
- undoRedoStack: any;
316
+ execute(options: any): any;
317
+ refresh(reason: any): void;
318
+ undoRedoStack: any;
319
319
  }
320
+
321
+ export class Range {
322
+ background(value?: string): string;
323
+ bold(value?: boolean): boolean;
324
+ borderBottom(value?: CellBorder): CellBorder;
325
+ borderLeft(value?: CellBorder): CellBorder;
326
+ borderRight(value?: CellBorder): CellBorder;
327
+ borderTop(value?: CellBorder): CellBorder;
328
+ color(value?: string): string;
329
+ clear(value?: { contentsOnly?: boolean; formatOnly: boolean }): void;
330
+ enable(value?: boolean): boolean;
331
+ fontFamily(value?: string): string;
332
+ fontSize(value?: number): number;
333
+ forEachCell(value: (rowIndex: number, columnIndex: number, cellProperties: Cell) => void): void;
334
+ format(value?: string): string;
335
+ formula(value?: string): string;
336
+ input(value?: string | number | Date): any;
337
+ italic(value?: boolean): boolean;
338
+ link(value?: string): any;
339
+ select(): void;
340
+ textAlign(value?: string): string;
341
+ value(value?: string | number | Date): any;
342
+ verticalAlign(value?: string): string;
343
+ wrap(value?: boolean): boolean;
344
+ }
345
+
320
346
  export class Sheet {
321
347
  constructor();
322
- resize(newRows: number, newCols: number): void;
323
- name(): string;
324
- range(cell: any): any;
348
+ resize(newRows: number, newCols: number): void;
349
+ name(): string;
350
+ range(cell: string): Range;
325
351
  activeCell(): any;
352
+ showGridLines(value?: any): any;
326
353
  }
327
354
 
328
355
  export interface ExternalRef<T> {
@@ -350,6 +377,7 @@ export class Spreadsheet {
350
377
  constructor(element: HTMLElement, options: SpreadsheetOptions);
351
378
  get view(): View;
352
379
  get workbook(): Workbook;
380
+ get options(): SpreadsheetOptions;
353
381
 
354
382
  executeCommand(options: any): void;
355
383
 
@@ -397,5 +425,7 @@ export class Spreadsheet {
397
425
  */
398
426
  refresh(): void;
399
427
 
428
+ bind(eventName: string, handler: any, one?: boolean): void;
429
+
400
430
  destroy(): void;
401
431
  }