@progress/kendo-spreadsheet-common 1.0.0-develop.4 → 1.0.0-develop.6

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
@@ -1,4 +1,3 @@
1
- import { localeInfo, parseDate as parseDate$1, format, toString } from '@progress/kendo-intl';
2
1
  import { drawing, parseColor, geometry, drawDOM } from '@progress/kendo-drawing';
3
2
  import { dayOfWeek, getDate, addDays, firstDayOfMonth } from '@progress/kendo-date-math';
4
3
  import { browser } from '@progress/kendo-common';
@@ -945,6 +944,49 @@ SHEETREF.print = function() {
945
944
  return "#SHEET";
946
945
  };
947
946
 
947
+ /* eslint-disable key-spacing */
948
+ const messages = {};
949
+ messages.view = {
950
+ nameBox: "Name Box",
951
+ errors: {
952
+ openUnsupported: "Unsupported format. Please select an .xlsx file.",
953
+ shiftingNonblankCells: "Cannot insert cells due to data loss possibility. Select another insert location or delete the data from the end of your worksheet.",
954
+ insertColumnWhenRowIsSelected: "Cannot insert column when all columns are selected.",
955
+ insertRowWhenColumnIsSelected: "Cannot insert row when all rows are selected.",
956
+ filterRangeContainingMerges: "Cannot create a filter within a range containing merges",
957
+ sortRangeContainingMerges: "Cannot sort a range containing merges",
958
+ cantSortMultipleSelection: "Cannot sort multiple selection",
959
+ cantSortNullRef: "Cannot sort empty selection",
960
+ cantSortMixedCells: "Cannot sort range containing cells of mixed shapes",
961
+ validationError: "The value that you entered violates the validation rules set on the cell.",
962
+ cannotModifyDisabled: "Cannot modify disabled cells.",
963
+ insertRowBelowLastRow: "Cannot insert row below the last row.",
964
+ insertColAfterLastCol: "Cannot insert column to the right of the last column."
965
+ },
966
+ tabs: {
967
+ home: "Home",
968
+ insert: "Insert",
969
+ data: "Data"
970
+ }
971
+ };
972
+
973
+ messages.menus = {
974
+ "cut" : "Cut",
975
+ "copy" : "Copy",
976
+ "paste" : "Paste",
977
+ "merge" : "Merge",
978
+ "unmerge" : "Unmerge",
979
+ "delete" : "Delete",
980
+ "hide" : "Hide",
981
+ "unhide" : "Unhide",
982
+ "bringToFront" : "Bring to front",
983
+ "sendToBack" : "Send to back"
984
+ };
985
+
986
+ messages.workbook = {
987
+ defaultSheetName: "Sheet"
988
+ };
989
+
948
990
  const options = {
949
991
  name: "Spreadsheet",
950
992
  toolbar: true,
@@ -960,7 +1002,7 @@ const options = {
960
1002
  forceProxy: false,
961
1003
  proxyURL: "",
962
1004
  },
963
- messages: {},
1005
+ messages: messages,
964
1006
  pdf: {
965
1007
  // which part of the workbook to be exported
966
1008
  area: "workbook",
@@ -1354,18 +1396,18 @@ class CalcError {
1354
1396
  }
1355
1397
  }
1356
1398
 
1357
- const localeValue = { current: 'en' };
1399
+ let intlValue = {};
1358
1400
 
1359
- const locale = value => {
1401
+ const intl = (value) => {
1360
1402
  if (value) {
1361
- localeValue.current = value;
1403
+ intlValue = value;
1362
1404
  } else {
1363
- return localeValue.current;
1405
+ return intlValue;
1364
1406
  }
1365
1407
  };
1366
1408
 
1367
1409
  const culture = () => {
1368
- return localeInfo(locale())
1410
+ return intl().localeInfo();
1369
1411
  };
1370
1412
 
1371
1413
  function createKendoObj(calc, CalcError, Ref, CellRef, RangeRef) {
@@ -2993,9 +3035,10 @@ function parseDate(str, format) {
2993
3035
  if (format) {
2994
3036
  format = formatting.makeDateFormat(format);
2995
3037
  }
2996
- return parseDate$1(str, format)
2997
- || parseDate$1(str)
2998
- || parseDate$1(str, [
3038
+ const parseExactDate = intl().parseDate;
3039
+ return parseExactDate(str, format)
3040
+ || parseExactDate(str)
3041
+ || parseExactDate(str, [
2999
3042
  "MMMM dd yyyy",
3000
3043
  "MMMM dd yy",
3001
3044
  "MMM dd yyyy",
@@ -12733,10 +12776,6 @@ const ALL_PROPERTIES = propertyBagSpec.reduce(function(a, spec) {
12733
12776
  return a;
12734
12777
  }, [ "borderTop", "borderRight", "borderBottom", "borderLeft" ]);
12735
12778
 
12736
- const kendoFormat = function(fmt, ...values) {
12737
- return format(fmt, values, locale())
12738
- };
12739
-
12740
12779
  /* eslint-disable no-param-reassign */
12741
12780
 
12742
12781
  let TRANSPOSE_FORMAT = "_matrix({0})";
@@ -12756,13 +12795,13 @@ function compileValidation(sheet, row, col, validation) {
12756
12795
  if (validation.from.indexOf("{") > -1) {
12757
12796
  validation.from = validation.from.replace(/\"/g,"").replace("{","\"").replace("}", "\"");
12758
12797
  }
12759
- validation.from = kendoFormat(TRANSPOSE_FORMAT, validation.from);
12798
+ validation.from = intl().format(TRANSPOSE_FORMAT, validation.from);
12760
12799
  validation.fromIsListValue = true;
12761
12800
  }
12762
12801
  if (validation.dataType === "date") {
12763
12802
  parsedFromDate = calc.runtime.parseDate(validation.from);
12764
12803
  if (parsedFromDate) {
12765
- validation.from = kendoFormat(DATE_FORMAT, validation.from);
12804
+ validation.from = intl().format(DATE_FORMAT, validation.from);
12766
12805
  validation.fromIsDateValue = true;
12767
12806
  }
12768
12807
  }
@@ -12772,7 +12811,7 @@ function compileValidation(sheet, row, col, validation) {
12772
12811
  if (validation.dataType === "date") {
12773
12812
  parsedToDate = calc.runtime.parseDate(validation.to);
12774
12813
  if (parsedToDate) {
12775
- validation.to = kendoFormat(DATE_FORMAT, validation.to);
12814
+ validation.to = intl().format(DATE_FORMAT, validation.to);
12776
12815
  validation.toIsDateValue = true;
12777
12816
  }
12778
12817
  }
@@ -12786,7 +12825,7 @@ function compileValidation(sheet, row, col, validation) {
12786
12825
  comparer = validationExport.validationComparers[validation.comparerType];
12787
12826
  }
12788
12827
  if (!comparer) {
12789
- throw kendoFormat("'{0}' comparer is not implemented.", validation.comparerType);
12828
+ throw intl().format("'{0}' comparer is not implemented.", validation.comparerType);
12790
12829
  }
12791
12830
  validationHandler = function(valueToCompare) { //add 'valueFormat' arg when add isDate comparer
12792
12831
  let toValue = this.to && (this.to_value || this.to_value === 0) ? this.to_value : undefined;
@@ -12852,7 +12891,7 @@ class Validation {
12852
12891
  let dataType = this.dataType;
12853
12892
  let type = this.type;
12854
12893
  let comparerType = this.comparerType;
12855
- return kendoFormat(format, from, to, fromFormula, toFormula, dataType, type, comparerType);
12894
+ return intl().format(format, from, to, fromFormula, toFormula, dataType, type, comparerType);
12856
12895
  }
12857
12896
  _setMessages() {
12858
12897
  this.title = "";
@@ -13249,7 +13288,8 @@ let Range$1 = class Range {
13249
13288
  }
13250
13289
  }
13251
13290
  if (type === "date") {
13252
- value = toString(serialToDate(value), culture().calendar.patterns.d, locale());
13291
+ const intlVal = intl();
13292
+ value = intlVal.toString(serialToDate(value), culture().calendar.patterns.d, intlVal.locale);
13253
13293
  } else if (type === "percent") {
13254
13294
  value = calc.runtime.limitPrecision(value * 100) + "%";
13255
13295
  } else if (typeof value == "string" &&
@@ -14736,49 +14776,6 @@ function notEqual(oldRect, newRect) {
14736
14776
  return oldRect && (oldRect.top !== newRect.top || oldRect.left !== newRect.left);
14737
14777
  }
14738
14778
 
14739
- /* eslint-disable key-spacing */
14740
- const messages = {};
14741
- messages.view = {
14742
- nameBox: "Name Box",
14743
- errors: {
14744
- openUnsupported: "Unsupported format. Please select an .xlsx file.",
14745
- shiftingNonblankCells: "Cannot insert cells due to data loss possibility. Select another insert location or delete the data from the end of your worksheet.",
14746
- insertColumnWhenRowIsSelected: "Cannot insert column when all columns are selected.",
14747
- insertRowWhenColumnIsSelected: "Cannot insert row when all rows are selected.",
14748
- filterRangeContainingMerges: "Cannot create a filter within a range containing merges",
14749
- sortRangeContainingMerges: "Cannot sort a range containing merges",
14750
- cantSortMultipleSelection: "Cannot sort multiple selection",
14751
- cantSortNullRef: "Cannot sort empty selection",
14752
- cantSortMixedCells: "Cannot sort range containing cells of mixed shapes",
14753
- validationError: "The value that you entered violates the validation rules set on the cell.",
14754
- cannotModifyDisabled: "Cannot modify disabled cells.",
14755
- insertRowBelowLastRow: "Cannot insert row below the last row.",
14756
- insertColAfterLastCol: "Cannot insert column to the right of the last column."
14757
- },
14758
- tabs: {
14759
- home: "Home",
14760
- insert: "Insert",
14761
- data: "Data"
14762
- }
14763
- };
14764
-
14765
- messages.menus = {
14766
- "cut" : "Cut",
14767
- "copy" : "Copy",
14768
- "paste" : "Paste",
14769
- "merge" : "Merge",
14770
- "unmerge" : "Unmerge",
14771
- "delete" : "Delete",
14772
- "hide" : "Hide",
14773
- "unhide" : "Unhide",
14774
- "bringToFront" : "Bring to front",
14775
- "sendToBack" : "Send to back"
14776
- };
14777
-
14778
- messages.workbook = {
14779
- defaultSheetName: "Sheet"
14780
- };
14781
-
14782
14779
  const ampRegExp = /&/g,
14783
14780
  ltRegExp = /</g,
14784
14781
  quoteRegExp = /"/g,
@@ -17377,15 +17374,17 @@ filtersObj = {
17377
17374
  };
17378
17375
  });
17379
17376
 
17380
- culture().calendar.months.format.wide.forEach(function(month, index) {
17381
- DynamicFilter.prototype[month.toLowerCase()] = function(value) {
17382
- if (value instanceof Date) {
17383
- return value.getMonth() === index;
17384
- }
17377
+ const initDynamicFilter = () => {
17378
+ culture().calendar.months.format.wide.forEach(function(month, index) {
17379
+ DynamicFilter.prototype[month.toLowerCase()] = function(value) {
17380
+ if (value instanceof Date) {
17381
+ return value.getMonth() === index;
17382
+ }
17385
17383
 
17386
- return false;
17387
- };
17388
- });
17384
+ return false;
17385
+ };
17386
+ });
17387
+ };
17389
17388
 
17390
17389
  function quarter(value) {
17391
17390
  var month = value.getMonth() + 1;
@@ -20487,7 +20486,7 @@ function Borders() {
20487
20486
  // if (options.useGridFormat) {
20488
20487
  // if (value != null) {
20489
20488
  // if (col.format) {
20490
- // value = kendoFormat(col.format, value);
20489
+ // value = intl().format(col.format, value);
20491
20490
  // } else {
20492
20491
  // value += "";
20493
20492
  // }
@@ -21785,13 +21784,13 @@ class FormulaInput extends Widget {
21785
21784
  if (this._isFormula() && !this._navigated) {
21786
21785
  value = ((this._tokenContext() || {}).token || {}).value;
21787
21786
 
21788
- this.filter(value);
21787
+ const data = this.filter(value);
21789
21788
 
21790
- if (!value || !this.formulaSource.length) {
21789
+ if (!value || !data.length) {
21791
21790
  popup.close();
21792
21791
  } else {
21793
21792
  popup[popup.visible() ? "position" : "open"]();
21794
- this.list.focusFirst();
21793
+ setTimeout(() => { this.list.focusFirst(); }, 0);
21795
21794
  }
21796
21795
  }
21797
21796
 
@@ -21934,7 +21933,11 @@ class FormulaInput extends Widget {
21934
21933
  return;
21935
21934
  }
21936
21935
 
21937
- this.list.data(this.formulaSource.filter((item) => String(item.value).startsWith(value)));
21936
+ const data = this.formulaSource.filter((item) => String(item.value).startsWith(value.toLowerCase()));
21937
+
21938
+ this.list.data(data);
21939
+
21940
+ return data;
21938
21941
  }
21939
21942
 
21940
21943
  hide() {
@@ -23161,6 +23164,14 @@ class View extends Observable {
23161
23164
 
23162
23165
  destroy() {
23163
23166
  this.unbind();
23167
+
23168
+ [this.tree, this.clipboardContents].forEach(el => {
23169
+ while (el && el.root && el.root.lastChild) {
23170
+ el.root.removeChild(el.root.lastChild);
23171
+ }
23172
+ });
23173
+ this.tree = this.clipboardContents = null;
23174
+
23164
23175
  // this._dialogs.forEach(function(dialog) {
23165
23176
  // dialog.destroy();
23166
23177
  // });
@@ -25896,7 +25907,7 @@ async function readSheet(zip, file, sheet, strings, styles) {
25896
25907
  } else if (type === "b") {
25897
25908
  value = value === "1";
25898
25909
  } else if (type === "d") {
25899
- value = parseDate$1(value);
25910
+ value = intl().parseDate(value);
25900
25911
  }
25901
25912
 
25902
25913
  if (value != null) {
@@ -27054,6 +27065,7 @@ class Workbook extends Observable {
27054
27065
  let insertIndex = typeof options.index === "number" ? options.index : that._sheets.length;
27055
27066
  let sheetName;
27056
27067
  let sheets = that._sheets;
27068
+ const messages = this.options.messages;
27057
27069
 
27058
27070
  let getUniqueSheetName = function(sheetNameSuffix) {
27059
27071
  sheetNameSuffix = sheetNameSuffix ? sheetNameSuffix : 1;
@@ -27406,8 +27418,10 @@ class Workbook extends Observable {
27406
27418
  }
27407
27419
 
27408
27420
  fromFile(file) {
27409
- this._clearSheets();
27410
- readExcel(file, this);
27421
+ if (file && !this.trigger("excelImport", { file })) {
27422
+ this._clearSheets();
27423
+ readExcel(file, this);
27424
+ }
27411
27425
  }
27412
27426
 
27413
27427
  saveAsExcel(options) {
@@ -27735,11 +27749,12 @@ const events = [
27735
27749
 
27736
27750
  class Spreadsheet extends Widget {
27737
27751
  constructor(element, options$1) {
27738
- super(element, Object.assign({}, options, options$1));
27752
+ super(element, deepExtend({}, options, options$1));
27739
27753
  this.events = events;
27740
27754
  this.bind(this.events, this.options);
27741
27755
 
27742
- locale(this.options.locale);
27756
+ intl({ locale: this.options.locale, ...this.options.intl });
27757
+ initDynamicFilter();
27743
27758
 
27744
27759
  this._view = new View(this.element, {
27745
27760
  messages: this.options.messages.view,
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@progress/kendo-intl'), require('@progress/kendo-drawing'), require('@progress/kendo-date-math'), require('@progress/kendo-common'), require('@progress/jszip-esm')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@progress/kendo-intl', '@progress/kendo-drawing', '@progress/kendo-date-math', '@progress/kendo-common', '@progress/jszip-esm'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.KendoSpreadsheetCommon = {}, global.KendoIntl, global.KendoDrawing, global.KendoDateMath, global.KendoCommon, global.JSZip));
5
- })(this, (function (exports, kendoIntl, kendoDrawing, kendoDateMath, kendoCommon, JSZip) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@progress/kendo-drawing'), require('@progress/kendo-date-math'), require('@progress/kendo-common'), require('@progress/jszip-esm')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@progress/kendo-drawing', '@progress/kendo-date-math', '@progress/kendo-common', '@progress/jszip-esm'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.KendoSpreadsheetCommon = {}, global.KendoDrawing, global.KendoDateMath, global.KendoCommon, global.JSZip));
5
+ })(this, (function (exports, kendoDrawing, kendoDateMath, kendoCommon, JSZip) { 'use strict';
6
6
 
7
7
  /* eslint-disable camelcase */
8
8
  /* eslint-disable no-nested-ternary */
@@ -945,6 +945,49 @@
945
945
  return "#SHEET";
946
946
  };
947
947
 
948
+ /* eslint-disable key-spacing */
949
+ const messages = {};
950
+ messages.view = {
951
+ nameBox: "Name Box",
952
+ errors: {
953
+ openUnsupported: "Unsupported format. Please select an .xlsx file.",
954
+ shiftingNonblankCells: "Cannot insert cells due to data loss possibility. Select another insert location or delete the data from the end of your worksheet.",
955
+ insertColumnWhenRowIsSelected: "Cannot insert column when all columns are selected.",
956
+ insertRowWhenColumnIsSelected: "Cannot insert row when all rows are selected.",
957
+ filterRangeContainingMerges: "Cannot create a filter within a range containing merges",
958
+ sortRangeContainingMerges: "Cannot sort a range containing merges",
959
+ cantSortMultipleSelection: "Cannot sort multiple selection",
960
+ cantSortNullRef: "Cannot sort empty selection",
961
+ cantSortMixedCells: "Cannot sort range containing cells of mixed shapes",
962
+ validationError: "The value that you entered violates the validation rules set on the cell.",
963
+ cannotModifyDisabled: "Cannot modify disabled cells.",
964
+ insertRowBelowLastRow: "Cannot insert row below the last row.",
965
+ insertColAfterLastCol: "Cannot insert column to the right of the last column."
966
+ },
967
+ tabs: {
968
+ home: "Home",
969
+ insert: "Insert",
970
+ data: "Data"
971
+ }
972
+ };
973
+
974
+ messages.menus = {
975
+ "cut" : "Cut",
976
+ "copy" : "Copy",
977
+ "paste" : "Paste",
978
+ "merge" : "Merge",
979
+ "unmerge" : "Unmerge",
980
+ "delete" : "Delete",
981
+ "hide" : "Hide",
982
+ "unhide" : "Unhide",
983
+ "bringToFront" : "Bring to front",
984
+ "sendToBack" : "Send to back"
985
+ };
986
+
987
+ messages.workbook = {
988
+ defaultSheetName: "Sheet"
989
+ };
990
+
948
991
  const options = {
949
992
  name: "Spreadsheet",
950
993
  toolbar: true,
@@ -960,7 +1003,7 @@
960
1003
  forceProxy: false,
961
1004
  proxyURL: "",
962
1005
  },
963
- messages: {},
1006
+ messages: messages,
964
1007
  pdf: {
965
1008
  // which part of the workbook to be exported
966
1009
  area: "workbook",
@@ -1354,18 +1397,18 @@
1354
1397
  }
1355
1398
  }
1356
1399
 
1357
- const localeValue = { current: 'en' };
1400
+ let intlValue = {};
1358
1401
 
1359
- const locale = value => {
1402
+ const intl = (value) => {
1360
1403
  if (value) {
1361
- localeValue.current = value;
1404
+ intlValue = value;
1362
1405
  } else {
1363
- return localeValue.current;
1406
+ return intlValue;
1364
1407
  }
1365
1408
  };
1366
1409
 
1367
1410
  const culture = () => {
1368
- return kendoIntl.localeInfo(locale())
1411
+ return intl().localeInfo();
1369
1412
  };
1370
1413
 
1371
1414
  function createKendoObj(calc, CalcError, Ref, CellRef, RangeRef) {
@@ -2993,9 +3036,10 @@
2993
3036
  if (format) {
2994
3037
  format = formatting.makeDateFormat(format);
2995
3038
  }
2996
- return kendoIntl.parseDate(str, format)
2997
- || kendoIntl.parseDate(str)
2998
- || kendoIntl.parseDate(str, [
3039
+ const parseExactDate = intl().parseDate;
3040
+ return parseExactDate(str, format)
3041
+ || parseExactDate(str)
3042
+ || parseExactDate(str, [
2999
3043
  "MMMM dd yyyy",
3000
3044
  "MMMM dd yy",
3001
3045
  "MMM dd yyyy",
@@ -12733,10 +12777,6 @@
12733
12777
  return a;
12734
12778
  }, [ "borderTop", "borderRight", "borderBottom", "borderLeft" ]);
12735
12779
 
12736
- const kendoFormat = function(fmt, ...values) {
12737
- return kendoIntl.format(fmt, values, locale())
12738
- };
12739
-
12740
12780
  /* eslint-disable no-param-reassign */
12741
12781
 
12742
12782
  let TRANSPOSE_FORMAT = "_matrix({0})";
@@ -12756,13 +12796,13 @@
12756
12796
  if (validation.from.indexOf("{") > -1) {
12757
12797
  validation.from = validation.from.replace(/\"/g,"").replace("{","\"").replace("}", "\"");
12758
12798
  }
12759
- validation.from = kendoFormat(TRANSPOSE_FORMAT, validation.from);
12799
+ validation.from = intl().format(TRANSPOSE_FORMAT, validation.from);
12760
12800
  validation.fromIsListValue = true;
12761
12801
  }
12762
12802
  if (validation.dataType === "date") {
12763
12803
  parsedFromDate = calc.runtime.parseDate(validation.from);
12764
12804
  if (parsedFromDate) {
12765
- validation.from = kendoFormat(DATE_FORMAT, validation.from);
12805
+ validation.from = intl().format(DATE_FORMAT, validation.from);
12766
12806
  validation.fromIsDateValue = true;
12767
12807
  }
12768
12808
  }
@@ -12772,7 +12812,7 @@
12772
12812
  if (validation.dataType === "date") {
12773
12813
  parsedToDate = calc.runtime.parseDate(validation.to);
12774
12814
  if (parsedToDate) {
12775
- validation.to = kendoFormat(DATE_FORMAT, validation.to);
12815
+ validation.to = intl().format(DATE_FORMAT, validation.to);
12776
12816
  validation.toIsDateValue = true;
12777
12817
  }
12778
12818
  }
@@ -12786,7 +12826,7 @@
12786
12826
  comparer = validationExport.validationComparers[validation.comparerType];
12787
12827
  }
12788
12828
  if (!comparer) {
12789
- throw kendoFormat("'{0}' comparer is not implemented.", validation.comparerType);
12829
+ throw intl().format("'{0}' comparer is not implemented.", validation.comparerType);
12790
12830
  }
12791
12831
  validationHandler = function(valueToCompare) { //add 'valueFormat' arg when add isDate comparer
12792
12832
  let toValue = this.to && (this.to_value || this.to_value === 0) ? this.to_value : undefined;
@@ -12852,7 +12892,7 @@
12852
12892
  let dataType = this.dataType;
12853
12893
  let type = this.type;
12854
12894
  let comparerType = this.comparerType;
12855
- return kendoFormat(format, from, to, fromFormula, toFormula, dataType, type, comparerType);
12895
+ return intl().format(format, from, to, fromFormula, toFormula, dataType, type, comparerType);
12856
12896
  }
12857
12897
  _setMessages() {
12858
12898
  this.title = "";
@@ -13249,7 +13289,8 @@
13249
13289
  }
13250
13290
  }
13251
13291
  if (type === "date") {
13252
- value = kendoIntl.toString(serialToDate(value), culture().calendar.patterns.d, locale());
13292
+ const intlVal = intl();
13293
+ value = intlVal.toString(serialToDate(value), culture().calendar.patterns.d, intlVal.locale);
13253
13294
  } else if (type === "percent") {
13254
13295
  value = calc.runtime.limitPrecision(value * 100) + "%";
13255
13296
  } else if (typeof value == "string" &&
@@ -14736,49 +14777,6 @@
14736
14777
  return oldRect && (oldRect.top !== newRect.top || oldRect.left !== newRect.left);
14737
14778
  }
14738
14779
 
14739
- /* eslint-disable key-spacing */
14740
- const messages = {};
14741
- messages.view = {
14742
- nameBox: "Name Box",
14743
- errors: {
14744
- openUnsupported: "Unsupported format. Please select an .xlsx file.",
14745
- shiftingNonblankCells: "Cannot insert cells due to data loss possibility. Select another insert location or delete the data from the end of your worksheet.",
14746
- insertColumnWhenRowIsSelected: "Cannot insert column when all columns are selected.",
14747
- insertRowWhenColumnIsSelected: "Cannot insert row when all rows are selected.",
14748
- filterRangeContainingMerges: "Cannot create a filter within a range containing merges",
14749
- sortRangeContainingMerges: "Cannot sort a range containing merges",
14750
- cantSortMultipleSelection: "Cannot sort multiple selection",
14751
- cantSortNullRef: "Cannot sort empty selection",
14752
- cantSortMixedCells: "Cannot sort range containing cells of mixed shapes",
14753
- validationError: "The value that you entered violates the validation rules set on the cell.",
14754
- cannotModifyDisabled: "Cannot modify disabled cells.",
14755
- insertRowBelowLastRow: "Cannot insert row below the last row.",
14756
- insertColAfterLastCol: "Cannot insert column to the right of the last column."
14757
- },
14758
- tabs: {
14759
- home: "Home",
14760
- insert: "Insert",
14761
- data: "Data"
14762
- }
14763
- };
14764
-
14765
- messages.menus = {
14766
- "cut" : "Cut",
14767
- "copy" : "Copy",
14768
- "paste" : "Paste",
14769
- "merge" : "Merge",
14770
- "unmerge" : "Unmerge",
14771
- "delete" : "Delete",
14772
- "hide" : "Hide",
14773
- "unhide" : "Unhide",
14774
- "bringToFront" : "Bring to front",
14775
- "sendToBack" : "Send to back"
14776
- };
14777
-
14778
- messages.workbook = {
14779
- defaultSheetName: "Sheet"
14780
- };
14781
-
14782
14780
  const ampRegExp = /&/g,
14783
14781
  ltRegExp = /</g,
14784
14782
  quoteRegExp = /"/g,
@@ -17377,15 +17375,17 @@
17377
17375
  };
17378
17376
  });
17379
17377
 
17380
- culture().calendar.months.format.wide.forEach(function(month, index) {
17381
- DynamicFilter.prototype[month.toLowerCase()] = function(value) {
17382
- if (value instanceof Date) {
17383
- return value.getMonth() === index;
17384
- }
17378
+ const initDynamicFilter = () => {
17379
+ culture().calendar.months.format.wide.forEach(function(month, index) {
17380
+ DynamicFilter.prototype[month.toLowerCase()] = function(value) {
17381
+ if (value instanceof Date) {
17382
+ return value.getMonth() === index;
17383
+ }
17385
17384
 
17386
- return false;
17387
- };
17388
- });
17385
+ return false;
17386
+ };
17387
+ });
17388
+ };
17389
17389
 
17390
17390
  function quarter(value) {
17391
17391
  var month = value.getMonth() + 1;
@@ -20487,7 +20487,7 @@
20487
20487
  // if (options.useGridFormat) {
20488
20488
  // if (value != null) {
20489
20489
  // if (col.format) {
20490
- // value = kendoFormat(col.format, value);
20490
+ // value = intl().format(col.format, value);
20491
20491
  // } else {
20492
20492
  // value += "";
20493
20493
  // }
@@ -21785,13 +21785,13 @@
21785
21785
  if (this._isFormula() && !this._navigated) {
21786
21786
  value = ((this._tokenContext() || {}).token || {}).value;
21787
21787
 
21788
- this.filter(value);
21788
+ const data = this.filter(value);
21789
21789
 
21790
- if (!value || !this.formulaSource.length) {
21790
+ if (!value || !data.length) {
21791
21791
  popup.close();
21792
21792
  } else {
21793
21793
  popup[popup.visible() ? "position" : "open"]();
21794
- this.list.focusFirst();
21794
+ setTimeout(() => { this.list.focusFirst(); }, 0);
21795
21795
  }
21796
21796
  }
21797
21797
 
@@ -21934,7 +21934,11 @@
21934
21934
  return;
21935
21935
  }
21936
21936
 
21937
- this.list.data(this.formulaSource.filter((item) => String(item.value).startsWith(value)));
21937
+ const data = this.formulaSource.filter((item) => String(item.value).startsWith(value.toLowerCase()));
21938
+
21939
+ this.list.data(data);
21940
+
21941
+ return data;
21938
21942
  }
21939
21943
 
21940
21944
  hide() {
@@ -23161,6 +23165,14 @@
23161
23165
 
23162
23166
  destroy() {
23163
23167
  this.unbind();
23168
+
23169
+ [this.tree, this.clipboardContents].forEach(el => {
23170
+ while (el && el.root && el.root.lastChild) {
23171
+ el.root.removeChild(el.root.lastChild);
23172
+ }
23173
+ });
23174
+ this.tree = this.clipboardContents = null;
23175
+
23164
23176
  // this._dialogs.forEach(function(dialog) {
23165
23177
  // dialog.destroy();
23166
23178
  // });
@@ -25896,7 +25908,7 @@
25896
25908
  } else if (type === "b") {
25897
25909
  value = value === "1";
25898
25910
  } else if (type === "d") {
25899
- value = kendoIntl.parseDate(value);
25911
+ value = intl().parseDate(value);
25900
25912
  }
25901
25913
 
25902
25914
  if (value != null) {
@@ -27054,6 +27066,7 @@
27054
27066
  let insertIndex = typeof options.index === "number" ? options.index : that._sheets.length;
27055
27067
  let sheetName;
27056
27068
  let sheets = that._sheets;
27069
+ const messages = this.options.messages;
27057
27070
 
27058
27071
  let getUniqueSheetName = function(sheetNameSuffix) {
27059
27072
  sheetNameSuffix = sheetNameSuffix ? sheetNameSuffix : 1;
@@ -27406,8 +27419,10 @@
27406
27419
  }
27407
27420
 
27408
27421
  fromFile(file) {
27409
- this._clearSheets();
27410
- readExcel(file, this);
27422
+ if (file && !this.trigger("excelImport", { file })) {
27423
+ this._clearSheets();
27424
+ readExcel(file, this);
27425
+ }
27411
27426
  }
27412
27427
 
27413
27428
  saveAsExcel(options) {
@@ -27735,11 +27750,12 @@
27735
27750
 
27736
27751
  class Spreadsheet extends Widget {
27737
27752
  constructor(element, options$1) {
27738
- super(element, Object.assign({}, options, options$1));
27753
+ super(element, deepExtend({}, options, options$1));
27739
27754
  this.events = events;
27740
27755
  this.bind(this.events, this.options);
27741
27756
 
27742
- locale(this.options.locale);
27757
+ intl({ locale: this.options.locale, ...this.options.intl });
27758
+ initDynamicFilter();
27743
27759
 
27744
27760
  this._view = new View(this.element, {
27745
27761
  messages: this.options.messages.view,
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.4",
4
+ "version": "1.0.0-develop.6",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],
@@ -24,13 +24,13 @@
24
24
  "@progress/kendo-common": "^0.2.2",
25
25
  "@progress/kendo-date-math": "^1.5.10",
26
26
  "@progress/kendo-drawing": "^1.17.5",
27
- "@progress/jszip-esm": "^1.0.3",
28
- "@progress/kendo-intl": "^3.1.1"
27
+ "@progress/jszip-esm": "^1.0.3"
29
28
  },
30
29
  "devDependencies": {
31
30
  "@commitlint/cli": "^17.3.0",
32
31
  "@commitlint/config-conventional": "^17.3.0",
33
32
  "@progress/kendo-e2e": "^1.3.0",
33
+ "@progress/kendo-intl": "^3.1.1",
34
34
  "@types/jest": "^29.0.0",
35
35
  "es-jest": "^2.1.0",
36
36
  "eslint": "^8.28.0",