@progress/kendo-spreadsheet-common 1.1.3-develop.3 → 1.2.0-develop.2

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 (3) hide show
  1. package/dist/index-esm.js +406 -171
  2. package/dist/index.js +494 -169
  3. package/package.json +1 -1
package/dist/index-esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { drawing, parseColor, geometry, drawDOM } from '@progress/kendo-drawing';
1
+ import { drawing, parseColor, geometry, drawText as drawText$1 } from '@progress/kendo-drawing';
2
2
  import { dayOfWeek, getDate, addDays, firstDayOfMonth } from '@progress/kendo-date-math';
3
3
  import { browser } from '@progress/kendo-common';
4
4
  import JSZip from '@progress/jszip-esm';
@@ -1064,13 +1064,18 @@ const keys = {
1064
1064
  PAGEDOWN: 34,
1065
1065
  F2: 113,
1066
1066
  F10: 121,
1067
+ F11: 122,
1067
1068
  F12: 123,
1068
1069
  NUMPAD_PLUS: 107,
1069
1070
  NUMPAD_MINUS: 109,
1070
1071
  NUMPAD_DOT: 110,
1071
1072
  B: 66,
1072
1073
  I: 73,
1073
- U: 85
1074
+ U: 85,
1075
+ N: 78,
1076
+ H: 72,
1077
+ A: 65,
1078
+ R: 82
1074
1079
  };
1075
1080
 
1076
1081
  /* eslint-disable no-nested-ternary */
@@ -1213,7 +1218,6 @@ function deepExtendOne(destination, source) {
1213
1218
  let property,
1214
1219
  propValue,
1215
1220
  propType,
1216
- propInit,
1217
1221
  destProp;
1218
1222
 
1219
1223
  for (property in source) {
@@ -1224,29 +1228,18 @@ function deepExtendOne(destination, source) {
1224
1228
  propValue = source[property];
1225
1229
  propType = typeof propValue;
1226
1230
 
1227
- if (propType === 'object' && propValue !== null) {
1228
- propInit = propValue.constructor;
1229
- } else {
1230
- propInit = null;
1231
- }
1232
-
1233
- if (propInit &&
1234
- propInit !== Array && propInit !== RegExp &&
1235
- (!isFunction(window.ArrayBuffer) || propInit !== ArrayBuffer) && !(propValue instanceof HTMLElement)) {
1236
-
1237
- if (propValue instanceof Date) {
1238
- destination[property] = new Date(propValue.getTime());
1239
- } else if (isFunction(propValue.clone)) {
1240
- destination[property] = propValue.clone();
1241
- } else {
1242
- destProp = destination[property];
1243
- if (typeof (destProp) === 'object') {
1244
- destination[property] = destProp || {};
1245
- } else {
1246
- destination[property] = {};
1247
- }
1248
- deepExtendOne(destination[property], propValue);
1231
+ if (propValue instanceof Date) {
1232
+ destination[property] = new Date(propValue.getTime());
1233
+ } else if (isFunction(propValue?.clone)) {
1234
+ destination[property] = propValue.clone();
1235
+ } else if (propType === 'object' && propValue !== null && isPlainObject(propValue)) {
1236
+ // Check if the property is a plain object before attempting to merge deeply
1237
+ destProp = destination[property];
1238
+ if (typeof destProp !== 'object' || destProp === null) {
1239
+ destination[property] = {};
1249
1240
  }
1241
+
1242
+ deepExtendOne(destination[property], propValue);
1250
1243
  } else if (propType !== 'undefined') {
1251
1244
  destination[property] = propValue;
1252
1245
  }
@@ -1298,13 +1291,6 @@ const scrollbar = function(refresh) {
1298
1291
  return result;
1299
1292
  };
1300
1293
 
1301
- const createFragment = function(content) {
1302
- const template = document.createElement('template');
1303
- template.innerHTML = content;
1304
-
1305
- return template.content;
1306
- };
1307
-
1308
1294
  function toCamelCase(str) {
1309
1295
  return str.replace(/\-(\w)/g, function(strMatch, g1) {
1310
1296
  return g1.toUpperCase();
@@ -1368,6 +1354,14 @@ const isDate = (value) => value && value.getTime;
1368
1354
  const isString = (value) => typeof value === "string";
1369
1355
  const isNumeric = (value) => !isNaN(value - parseFloat(value));
1370
1356
  const isFunction = (fn) => typeof fn === "function";
1357
+ const isPlainObject = function(obj) {
1358
+ if (!obj || toString.call(obj) !== "[object Object]") {
1359
+ return false;
1360
+ }
1361
+
1362
+ const proto = Object.getPrototypeOf(obj);
1363
+ return proto === null || proto.constructor === Object;
1364
+ };
1371
1365
 
1372
1366
  class CalcError {
1373
1367
 
@@ -1406,6 +1400,9 @@ function createKendoObj(calc, CalcError, Ref, CellRef, RangeRef) {
1406
1400
  }
1407
1401
 
1408
1402
  /* eslint-disable max-params */
1403
+ /* eslint-disable complexity */
1404
+ /* eslint-disable no-unused-vars */
1405
+
1409
1406
 
1410
1407
  let calc = {
1411
1408
  runtime: {
@@ -2941,7 +2938,7 @@ function Element(nodeName, attr, children) {
2941
2938
  }
2942
2939
  Element.prototype = new Node();
2943
2940
  Element.prototype.appendTo = function(parent) {
2944
- let node = document.createElement(this.nodeName);
2941
+ let node = typeof(this.nodeName) === "string" ? document.createElement(this.nodeName) : this.nodeName;
2945
2942
  let children = this.children;
2946
2943
  for (let index = 0; index < children.length; index++) {
2947
2944
  children[index].render(node, NULL_NODE);
@@ -3162,6 +3159,7 @@ const dom = {
3162
3159
 
3163
3160
  //--------------------------------------------------- custom number format.
3164
3161
 
3162
+
3165
3163
  let RX_COLORS = /^\[(black|green|white|blue|magenta|yellow|cyan|red)\]/i;
3166
3164
  let RX_CONDITION = /^\[(<=|>=|<>|<|>|=)(-?[0-9.]+)\]/;
3167
3165
 
@@ -4127,6 +4125,28 @@ const formatting = {
4127
4125
  };
4128
4126
 
4129
4127
  /* eslint-disable no-nested-ternary */
4128
+ /* eslint-disable space-infix-ops */
4129
+ /* eslint-disable indent */
4130
+ /* eslint-disable no-empty */
4131
+ /* eslint-disable no-loop-func */
4132
+ /* eslint-disable consistent-return */
4133
+ /* eslint-disable block-scoped-var */
4134
+ /* eslint-disable no-redeclare */
4135
+ /* eslint-disable no-var */
4136
+ /* eslint-disable eqeqeq */
4137
+ /* eslint-disable complexity */
4138
+ /* eslint-disable max-params */
4139
+ /* eslint-disable no-implicit-coercion */
4140
+ /* eslint-disable key-spacing */
4141
+ /* eslint-disable default-case */
4142
+ /* eslint-disable camelcase */
4143
+ /* eslint-disable brace-style */
4144
+ /* eslint-disable no-else-return */
4145
+ /* eslint-disable no-constant-condition */
4146
+ /* eslint-disable no-param-reassign */
4147
+ /* eslint-disable space-before-blocks */
4148
+ /* eslint-disable no-unused-labels */
4149
+
4130
4150
 
4131
4151
  const kendo = createKendoObj(calc, CalcError, Ref, CellRef, RangeRef);
4132
4152
  calc.kendo = kendo; // XXX
@@ -5932,6 +5952,12 @@ class EventListener {
5932
5952
  }
5933
5953
 
5934
5954
  /* eslint-disable default-case */
5955
+ /* eslint-disable no-else-return */
5956
+ /* eslint-disable key-spacing */
5957
+ /* eslint-disable eqeqeq */
5958
+ /* eslint-disable brace-style */
5959
+ /* eslint-disable consistent-return */
5960
+
5935
5961
 
5936
5962
  let alphaNumRegExp = /:alphanum$/;
5937
5963
 
@@ -6557,6 +6583,7 @@ class Controller {
6557
6583
  this._workbook.trigger("contextmenu", {
6558
6584
  objectRef: object.ref,
6559
6585
  targetType: object.type,
6586
+ isComposite,
6560
6587
  showUnhide,
6561
6588
  showUnmerge,
6562
6589
  originalEvent: event
@@ -7071,7 +7098,7 @@ class Controller {
7071
7098
  this.clipboardElement.focus();
7072
7099
  this.navigator.navigateInSelection(ENTRY_ACTIONS[action]);
7073
7100
  }
7074
-
7101
+
7075
7102
  if (action === 'tab') {
7076
7103
  e.preventDefault();
7077
7104
  }
@@ -7774,6 +7801,9 @@ class SparseRangeList extends RangeList {
7774
7801
  }
7775
7802
 
7776
7803
  /* eslint-disable default-case */
7804
+ /* eslint-disable camelcase */
7805
+ /* eslint-disable no-param-reassign */
7806
+
7777
7807
 
7778
7808
  class Property {
7779
7809
  constructor(list) {
@@ -8097,6 +8127,10 @@ const ALL_PROPERTIES = propertyBagSpec.reduce(function(a, spec) {
8097
8127
  }, [ "borderTop", "borderRight", "borderBottom", "borderLeft" ]);
8098
8128
 
8099
8129
  /* eslint-disable no-param-reassign */
8130
+ /* eslint-disable no-useless-call */
8131
+ /* eslint-disable camelcase */
8132
+ /* eslint-disable default-case */
8133
+
8100
8134
 
8101
8135
  let TRANSPOSE_FORMAT = "_matrix({0})";
8102
8136
  let DATE_FORMAT = 'DATEVALUE("{0}")';
@@ -8428,6 +8462,28 @@ validationExport.validationComparers = {
8428
8462
  validationExport.Validation = Validation;
8429
8463
 
8430
8464
  /* eslint-disable no-nested-ternary */
8465
+ /* eslint-disable curly */
8466
+ /* eslint-disable space-infix-ops */
8467
+ /* eslint-disable indent */
8468
+ /* eslint-disable no-empty */
8469
+ /* eslint-disable no-loop-func */
8470
+ /* eslint-disable consistent-return */
8471
+ /* eslint-disable block-scoped-var */
8472
+ /* eslint-disable no-redeclare */
8473
+ /* eslint-disable no-var */
8474
+ /* eslint-disable eqeqeq */
8475
+ /* eslint-disable complexity */
8476
+ /* eslint-disable max-params */
8477
+ /* eslint-disable no-implicit-coercion */
8478
+ /* eslint-disable key-spacing */
8479
+ /* eslint-disable default-case */
8480
+ /* eslint-disable camelcase */
8481
+ /* eslint-disable brace-style */
8482
+ /* eslint-disable no-else-return */
8483
+ /* eslint-disable no-constant-condition */
8484
+ /* eslint-disable no-param-reassign */
8485
+ /* eslint-disable space-before-blocks */
8486
+
8431
8487
  const { measureText } = drawing.util;
8432
8488
 
8433
8489
  let PROPERTIES = [
@@ -10487,6 +10543,7 @@ class PaneAxis {
10487
10543
  }
10488
10544
 
10489
10545
  /* eslint-disable no-param-reassign */
10546
+ /* eslint-disable camelcase */
10490
10547
 
10491
10548
  class Rectangle {
10492
10549
  constructor(left, top, width, height) {
@@ -10874,6 +10931,9 @@ Sorter.descendingComparer = function(a, b) {
10874
10931
  };
10875
10932
 
10876
10933
  /* eslint-disable no-constant-condition */
10934
+ /* eslint-disable key-spacing */
10935
+ /* eslint-disable no-param-reassign */
10936
+
10877
10937
 
10878
10938
  class AxisManager {
10879
10939
  constructor(sheet) {
@@ -11184,6 +11244,21 @@ class AutoFillCalculator {
11184
11244
  }
11185
11245
 
11186
11246
  /* eslint-disable max-params */
11247
+ /* eslint-disable no-empty */
11248
+ /* eslint-disable no-loop-func */
11249
+ /* eslint-disable consistent-return */
11250
+ /* eslint-disable block-scoped-var */
11251
+ /* eslint-disable no-redeclare */
11252
+ /* eslint-disable no-var */
11253
+ /* eslint-disable eqeqeq */
11254
+ /* eslint-disable complexity */
11255
+ /* eslint-disable no-implicit-coercion */
11256
+ /* eslint-disable brace-style */
11257
+ /* eslint-disable key-spacing */
11258
+ /* eslint-disable no-else-return */
11259
+ /* eslint-disable default-case */
11260
+ /* eslint-disable no-param-reassign */
11261
+
11187
11262
 
11188
11263
  class EdgeNavigator {
11189
11264
  constructor(field, axis, rangeGetter, union) {
@@ -11858,16 +11933,41 @@ function makeWordMovement(sheet, pivot, isCol) {
11858
11933
  }
11859
11934
 
11860
11935
  /* eslint-disable max-params */
11936
+ /* eslint-disable no-empty */
11937
+ /* eslint-disable no-loop-func */
11938
+ /* eslint-disable consistent-return */
11939
+ /* eslint-disable block-scoped-var */
11940
+ /* eslint-disable no-redeclare */
11941
+ /* eslint-disable no-var */
11942
+ /* eslint-disable eqeqeq */
11943
+ /* eslint-disable complexity */
11944
+ /* eslint-disable no-implicit-coercion */
11945
+ /* eslint-disable brace-style */
11946
+ /* eslint-disable key-spacing */
11947
+ /* eslint-disable no-else-return */
11948
+ /* eslint-disable default-case */
11949
+ /* eslint-disable no-param-reassign */
11950
+
11861
11951
 
11862
11952
  function numberToDate(val) {
11863
11953
  return val == null ? null : calc.runtime.serialToDate(val);
11864
11954
  }
11865
11955
 
11866
- var identity = function(o) { return o; };
11956
+ function dateToNumber(val) {
11957
+ return val == null ? null : calc.runtime.dateToSerial(val);
11958
+ }
11959
+
11960
+ var identity = function (o) { return o; };
11867
11961
 
11868
11962
  class SheetDataSourceBinder {
11869
11963
  constructor(options) {
11870
- this.options = Object.assign({ columns: [] }, this.options, options);
11964
+ this.options = Object.assign({ columns: [] }, this.options,
11965
+ // skip undefined properties in options
11966
+ Object.keys(options).reduce((acc, key) => {
11967
+ if (options[key] !== undefined) acc[key] = options[key];
11968
+ return acc;
11969
+ }, {})
11970
+ );
11871
11971
 
11872
11972
  this.columns = this._normalizeColumns(this.options.columns);
11873
11973
 
@@ -11911,9 +12011,9 @@ class SheetDataSourceBinder {
11911
12011
  }
11912
12012
 
11913
12013
  _header() {
11914
- this.sheet.batch(function() {
11915
- this.columns.forEach(function(column, index) {
11916
- this.sheet.range(0,index).value(column.title);
12014
+ this.sheet.batch(function () {
12015
+ this.columns.forEach(function (column, index) {
12016
+ this.sheet.range(0, index).value(column.title);
11917
12017
  }.bind(this));
11918
12018
  }.bind(this));
11919
12019
  }
@@ -11931,7 +12031,7 @@ class SheetDataSourceBinder {
11931
12031
  var values = [];
11932
12032
  var sheet = this.sheet;
11933
12033
  var fields, getters, normalizedRef, i, rangeRef, normalizedRefs;
11934
- var setValues = function(ref) {
12034
+ var setValues = function (ref) {
11935
12035
  ref = ref.toRangeRef();
11936
12036
  var record;
11937
12037
  var valueIndex = 0;
@@ -11960,7 +12060,7 @@ class SheetDataSourceBinder {
11960
12060
  columns = Object.keys(data[0].toJSON());
11961
12061
  }
11962
12062
 
11963
- getters = columns.map(function(column) {
12063
+ getters = columns.map(function (column) {
11964
12064
  var field = column.field;
11965
12065
  if (field && fields && fields[field] && fields[field].type === "date") {
11966
12066
  return numberToDate;
@@ -11977,7 +12077,7 @@ class SheetDataSourceBinder {
11977
12077
 
11978
12078
  normalizedRefs = normalizedRef.refs;
11979
12079
 
11980
- normalizedRefs.forEach(function(ref) {
12080
+ normalizedRefs.forEach(function (ref) {
11981
12081
  values.push(sheet.range(ref).values());
11982
12082
  });
11983
12083
 
@@ -11993,7 +12093,7 @@ class SheetDataSourceBinder {
11993
12093
  }
11994
12094
 
11995
12095
  _normalizeColumns(columns) {
11996
- return columns.map(function(column) {
12096
+ return columns.map(function (column) {
11997
12097
  var field = column.field || column;
11998
12098
  return {
11999
12099
  field: field,
@@ -12005,23 +12105,23 @@ class SheetDataSourceBinder {
12005
12105
  _dataSource() {
12006
12106
  var options = this.options;
12007
12107
  var dataSource = options.dataSource;
12008
- this.dataSource = { data: dataSource };
12009
- // dataSource = Array.isArray(dataSource) ? { data: dataSource } : dataSource;
12010
-
12011
- // if (this.dataSource && this._changeHandler) {
12012
- // this.dataSource.unbind("change", this._changeHandler)
12013
- // .unbind("progress", this._progressHandler)
12014
- // .unbind("error", this._errorHandler);
12015
- // } else {
12016
- // this._changeHandler = this._change.bind(this);
12017
- // this._progressHandler = this._requestStart.bind(this);
12018
- // this._errorHandler = this._error.bind(this);
12019
- // }
12020
12108
 
12021
- // this.dataSource = kendo.data.DataSource.create(dataSource)
12022
- // .bind("change", this._changeHandler)
12023
- // .bind("progress", this._progressHandler)
12024
- // .bind("error", this._errorHandler);
12109
+ dataSource = Array.isArray(dataSource) ? { data: dataSource } : dataSource;
12110
+
12111
+ if (this.dataSource && this._changeHandler) {
12112
+ this.dataSource.unbind("change", this._changeHandler)
12113
+ .unbind("progress", this._progressHandler)
12114
+ .unbind("error", this._errorHandler);
12115
+ } else {
12116
+ this._changeHandler = this._change.bind(this);
12117
+ this._progressHandler = this._requestStart.bind(this);
12118
+ this._errorHandler = this._error.bind(this);
12119
+ }
12120
+
12121
+ this.dataSource = this.options.sheet.createSheetDataSource?.(dataSource)
12122
+ .bind("change", this._changeHandler)
12123
+ .bind("progress", this._progressHandler)
12124
+ .bind("error", this._errorHandler);
12025
12125
  }
12026
12126
 
12027
12127
  _error() {
@@ -12055,11 +12155,11 @@ class SheetDataSourceBinder {
12055
12155
  this._header();
12056
12156
  }
12057
12157
 
12058
- var getters = columns.map(function(column) {
12158
+ var getters = columns.map(function (column) {
12059
12159
  return getter(column.field);
12060
12160
  });
12061
12161
 
12062
- this.sheet.batch(function() {
12162
+ this.sheet.batch(function () {
12063
12163
  var length = Math.max(data.length, this._boundRowsCount, this.sheet._grid.rowCount - 1);
12064
12164
 
12065
12165
  for (var idx = 0; idx < length; idx++) {
@@ -12109,6 +12209,10 @@ const kendoDate = (function() {
12109
12209
  })();
12110
12210
 
12111
12211
  /* eslint-disable no-var */
12212
+ /* eslint-disable no-implicit-coercion */
12213
+ /* eslint-disable no-param-reassign */
12214
+ /* eslint-disable no-loop-func */
12215
+
12112
12216
 
12113
12217
  const logic = {
12114
12218
  or: {
@@ -12238,6 +12342,21 @@ const transformCompositeFilter = function (filter) {
12238
12342
  };
12239
12343
 
12240
12344
  /* eslint-disable max-params */
12345
+ /* eslint-disable no-empty */
12346
+ /* eslint-disable no-loop-func */
12347
+ /* eslint-disable consistent-return */
12348
+ /* eslint-disable block-scoped-var */
12349
+ /* eslint-disable no-redeclare */
12350
+ /* eslint-disable no-var */
12351
+ /* eslint-disable eqeqeq */
12352
+ /* eslint-disable complexity */
12353
+ /* eslint-disable no-implicit-coercion */
12354
+ /* eslint-disable brace-style */
12355
+ /* eslint-disable key-spacing */
12356
+ /* eslint-disable no-else-return */
12357
+ /* eslint-disable default-case */
12358
+ /* eslint-disable no-param-reassign */
12359
+
12241
12360
 
12242
12361
  let filtersObj = {};
12243
12362
  const dateToSerial$1 = calc.runtime.dateToSerial;
@@ -12688,6 +12807,21 @@ function sameWeek(a, b) {
12688
12807
  }
12689
12808
 
12690
12809
  /* eslint-disable max-params */
12810
+ /* eslint-disable no-empty */
12811
+ /* eslint-disable no-loop-func */
12812
+ /* eslint-disable consistent-return */
12813
+ /* eslint-disable block-scoped-var */
12814
+ /* eslint-disable no-redeclare */
12815
+ /* eslint-disable no-var */
12816
+ /* eslint-disable eqeqeq */
12817
+ /* eslint-disable complexity */
12818
+ /* eslint-disable no-implicit-coercion */
12819
+ /* eslint-disable brace-style */
12820
+ /* eslint-disable key-spacing */
12821
+ /* eslint-disable no-else-return */
12822
+ /* eslint-disable default-case */
12823
+ /* eslint-disable no-param-reassign */
12824
+
12691
12825
 
12692
12826
  // This is a “dynamic variable” (see Greenspun's 10th rule). It's
12693
12827
  // bound to an array via sheet._saveModifiedFormulas (which see)
@@ -12829,6 +12963,12 @@ class Selection {
12829
12963
  }
12830
12964
  }
12831
12965
 
12966
+ let EDITORS = {};
12967
+
12968
+ function registerEditor(name, editor) {
12969
+ EDITORS[name] = editor;
12970
+ }
12971
+
12832
12972
  class Sheet extends Observable {
12833
12973
  constructor() {
12834
12974
  super();
@@ -12850,10 +12990,35 @@ class Sheet extends Observable {
12850
12990
  "dataBound",
12851
12991
  "progress"
12852
12992
  ];
12993
+
12994
+ this.createSheetDataSource = Array.from(arguments).pop();
12995
+
12853
12996
  this._reinit.apply(this, arguments);
12854
12997
  }
12855
12998
 
12856
- activeCellCustomEditor() {}
12999
+ activeCellCustomEditor() {
13000
+ let cell = this.activeCell().first();
13001
+
13002
+ if (this.range(cell).enable()) {
13003
+ let val = this.validation(cell);
13004
+ let key = this._properties.get("editor", this._grid.cellRefIndex(cell));
13005
+ let editor;
13006
+
13007
+ if (key != null) {
13008
+ editor = EDITORS[key];
13009
+ }
13010
+ else if (val && val.showButton) {
13011
+ key = "_validation_" + val.dataType;
13012
+ editor = EDITORS[key];
13013
+ }
13014
+
13015
+ if (typeof editor == "function") {
13016
+ editor = EDITORS[key] = editor();
13017
+ }
13018
+
13019
+ return editor;
13020
+ }
13021
+ }
12857
13022
 
12858
13023
  _reinit(rowCount, columnCount, rowHeight, columnWidth, headerHeight, headerWidth, defaultCellStyle) {
12859
13024
  defaultCellStyle = defaultCellStyle || {};
@@ -13055,7 +13220,8 @@ class Sheet extends Observable {
13055
13220
  this.dataSourceBinder = new SheetDataSourceBinder({
13056
13221
  dataSource: dataSource,
13057
13222
  sheet: this,
13058
- columns: columns
13223
+ columns: columns,
13224
+ createSheetDataSource: this.createSheetDataSource
13059
13225
  });
13060
13226
 
13061
13227
  this.dataSource = this.dataSourceBinder.dataSource;
@@ -14860,6 +15026,13 @@ function getPaperOptions(getOption) {
14860
15026
  }
14861
15027
 
14862
15028
  /* eslint-disable no-nested-ternary */
15029
+ /* eslint-disable default-case */
15030
+ /* eslint-disable no-implicit-coercion */
15031
+ /* eslint-disable no-else-return */
15032
+ /* eslint-disable key-spacing */
15033
+ /* eslint-disable eqeqeq */
15034
+ /* eslint-disable no-param-reassign */
15035
+
14863
15036
 
14864
15037
  let GUIDELINE_WIDTH = 0.8;
14865
15038
 
@@ -15501,7 +15674,7 @@ function drawText(text, color, cell, group) {
15501
15674
  }
15502
15675
  if (vtrans < 0) { vtrans = 0; }
15503
15676
 
15504
- let textGroup = drawDOM.drawText(CONT);
15677
+ let textGroup = drawText$1(CONT);
15505
15678
  textGroup.transform(geometry.Matrix.translate(cell.left, cell.top + vtrans));
15506
15679
  group.append(textGroup);
15507
15680
  }
@@ -15904,7 +16077,7 @@ const viewClassNames = {
15904
16077
  horizontalResize: "k-horizontal-resize",
15905
16078
  verticalResize: "k-vertical-resize",
15906
16079
  icon: "k-icon",
15907
- iconFilterDefault: "k-i-arrow-60-down",
16080
+ iconFilterDefault: "k-i-caret-alt-down",
15908
16081
  sheetsBar: "k-spreadsheet-sheets-bar",
15909
16082
  sheetsBarActive: "k-spreadsheet-sheets-bar-active",
15910
16083
  sheetsBarInactive: "k-spreadsheet-sheets-bar-inactive",
@@ -15955,6 +16128,7 @@ const paneClassNames = {
15955
16128
 
15956
16129
  /* eslint-disable complexity */
15957
16130
 
16131
+
15958
16132
  function cellBorder(value) {
15959
16133
  return (value.size || 1) + "px solid " + (value.color || "#000");
15960
16134
  }
@@ -16166,9 +16340,10 @@ function drawCell(collection, cell, cls, showGrid) {
16166
16340
  }
16167
16341
 
16168
16342
  class Pane {
16169
- constructor(sheet, grid) {
16343
+ constructor(sheet, grid, getIconHTMLString) {
16170
16344
  this._sheet = sheet;
16171
16345
  this._grid = grid;
16346
+ this.getIconHTMLString = getIconHTMLString;
16172
16347
  }
16173
16348
 
16174
16349
  refresh(width, height) {
@@ -16524,18 +16699,23 @@ class Pane {
16524
16699
  );
16525
16700
  }
16526
16701
 
16702
+ icon(className) {
16703
+ if (typeof this.getIconHTMLString === "function") {
16704
+ return dom.element(this.getIconHTMLString(className));
16705
+ }
16706
+
16707
+ return dom.element("span", {
16708
+ className: viewClassNames.icon + " " + className
16709
+ });
16710
+ }
16711
+
16527
16712
  renderFilterHeaders() {
16713
+ let pane = this;
16528
16714
  let sheet = this._sheet;
16529
16715
  let children = [];
16530
16716
  let classNames = viewClassNames;
16531
16717
  let filter = sheet.filter();
16532
16718
 
16533
- function icon(className) {
16534
- return dom.element("span", {
16535
- className: classNames.icon + " " + className
16536
- });
16537
- }
16538
-
16539
16719
  function filterButton(classNames, position, index) {
16540
16720
  let style = {
16541
16721
  left: position.left + "px",
@@ -16553,7 +16733,7 @@ class Pane {
16553
16733
  let button = dom.element(
16554
16734
  "span",
16555
16735
  { className: classes, style: style },
16556
- [ icon(classNames.iconFilterDefault) ]
16736
+ [ pane.icon(classNames.iconFilterDefault) ]
16557
16737
  );
16558
16738
 
16559
16739
  return button;
@@ -16710,11 +16890,11 @@ class Pane {
16710
16890
  height : cell.height + "px"
16711
16891
  }
16712
16892
  });
16893
+
16713
16894
  if (ed.icon) {
16714
- btn.children.push(dom.element("span", {
16715
- className: "k-icon " + ed.icon
16716
- }));
16895
+ btn.children.push(self.icon(ed.icon));
16717
16896
  }
16897
+
16718
16898
  collection.push(btn);
16719
16899
  });
16720
16900
  }
@@ -16789,6 +16969,11 @@ function drawingResizeHandles(container) {
16789
16969
  }
16790
16970
 
16791
16971
  /* eslint-disable no-unused-vars */
16972
+ /* eslint-disable no-param-reassign */
16973
+ /* eslint-disable no-else-return */
16974
+ /* eslint-disable no-multi-spaces */
16975
+ /* eslint-disable no-nested-ternary */
16976
+
16792
16977
 
16793
16978
  let styles = [
16794
16979
  "font-family",
@@ -17120,8 +17305,9 @@ class FormulaInput extends Widget {
17120
17305
  return true;
17121
17306
  }
17122
17307
  if (key === keys.ENTER || key === keys.TAB) {
17123
- if (list.data()[list.focus()]) {
17124
- this._formulaListChange(list.data()[list.focus()].value);
17308
+ let focusIndex = typeof list.focusIndex === "function" ? list.focusIndex() : list.focus();
17309
+ if (list.data()[focusIndex]) {
17310
+ this._formulaListChange(list.data()[focusIndex].value);
17125
17311
  }
17126
17312
 
17127
17313
  popup.close();
@@ -17649,6 +17835,13 @@ class SheetsBar extends Widget {
17649
17835
  }
17650
17836
 
17651
17837
  /* eslint-disable complexity */
17838
+ /* eslint-disable consistent-return */
17839
+ /* eslint-disable default-case */
17840
+ /* eslint-disable no-implicit-coercion */
17841
+ /* eslint-disable no-nested-ternary */
17842
+ /* eslint-disable key-spacing */
17843
+ /* eslint-disable no-param-reassign */
17844
+
17652
17845
 
17653
17846
  function selectElementContents(el) {
17654
17847
  let sel = window.getSelection();
@@ -17752,7 +17945,7 @@ function addCell(table, row, cell) {
17752
17945
  break;
17753
17946
  case "boolean":
17754
17947
  style.textAlign = "center";
17755
- break;
17948
+ break;
17756
17949
  }
17757
17950
  }
17758
17951
 
@@ -17843,7 +18036,7 @@ class HtmlTable {
17843
18036
  text = dom.text(text);
17844
18037
  }
17845
18038
 
17846
- let children = [ text ];
18039
+ let children = [text];
17847
18040
 
17848
18041
  if (validation && !validation.value) {
17849
18042
  children.push(dom.element("span", { className: "k-dirty" }));
@@ -17862,14 +18055,14 @@ class HtmlTable {
17862
18055
  }
17863
18056
 
17864
18057
  toDomTree(x, y, className) {
17865
- this.trs = this.trs.filter(function(tr) {
18058
+ this.trs = this.trs.filter(function (tr) {
17866
18059
  return tr.visible;
17867
18060
  });
17868
18061
 
17869
18062
  let offset = 0;
17870
- this.cols = this.cols.filter(function(col, ci) {
18063
+ this.cols = this.cols.filter(function (col, ci) {
17871
18064
  if (!col.visible) {
17872
- this.trs.forEach(function(tr) {
18065
+ this.trs.forEach(function (tr) {
17873
18066
  tr.children.splice(ci - offset, 1);
17874
18067
  });
17875
18068
  offset++;
@@ -17882,7 +18075,7 @@ class HtmlTable {
17882
18075
  style: { left: x + "px", top: y + "px", height: this._height + "px", width: this._width + "px" },
17883
18076
  className: className,
17884
18077
  role: "presentation"
17885
- },[
18078
+ }, [
17886
18079
  dom.element("colgroup", null, this.cols),
17887
18080
  dom.element("tbody", null, this.trs)
17888
18081
  ]);
@@ -17910,12 +18103,6 @@ class View extends Observable {
17910
18103
 
17911
18104
  this._dialogs = [];
17912
18105
 
17913
- // const contents = VIEW_CONTENTS({
17914
- // classNames: classNames,
17915
- // messages: messages.menus
17916
- // });
17917
- // element.appendChild(createFragment(contents));
17918
-
17919
18106
  this._formulaInput();
17920
18107
 
17921
18108
  this.wrapper = element.querySelector(DOT + classNames.view);
@@ -17937,6 +18124,8 @@ class View extends Observable {
17937
18124
  this.editor = new SheetEditor(this);
17938
18125
 
17939
18126
  this._sheetsbar();
18127
+
18128
+ this.options.createContextMenus?.();
17940
18129
  }
17941
18130
 
17942
18131
  enableClipboard(enable) {
@@ -17980,7 +18169,7 @@ class View extends Observable {
17980
18169
  this.formulaBar = new FormulaBar(formulaBar, { input: this.options.formulaBarInputRef });
17981
18170
 
17982
18171
  // if (this.options.toolbar) {
17983
- // this._tabstrip();
18172
+ this._tabstrip();
17984
18173
  // }
17985
18174
  }
17986
18175
 
@@ -17996,10 +18185,12 @@ class View extends Observable {
17996
18185
  _sheetsbar() {
17997
18186
  if (this.options.sheetsbar) {
17998
18187
  this.sheetsbar = new SheetsBar(this.element.querySelector(DOT + View.classNames.sheetsBar), this.options.sheetsbar);
18188
+ this.options.createSheetBar?.(this.options.openDialogCallback);
17999
18189
  }
18000
18190
  }
18001
18191
 
18002
18192
  _tabstrip() {
18193
+ this.tabstrip = this.options.createTabStrip?.();
18003
18194
  // let messages = this.options.messages.tabs;
18004
18195
  // let options = $.extend(true, { home: true, insert: true, data: true }, this.options.toolbar);
18005
18196
  // let tabs = [];
@@ -18058,7 +18249,7 @@ class View extends Observable {
18058
18249
  x += this.scroller.scrollLeft;
18059
18250
  }
18060
18251
 
18061
- col = this._sheet._grid._columns.locate(0, col, function(w) {
18252
+ col = this._sheet._grid._columns.locate(0, col, function (w) {
18062
18253
  return Math.abs(x - w) <= RESIZE_HANDLE_WIDTH / 2;
18063
18254
  });
18064
18255
 
@@ -18074,7 +18265,7 @@ class View extends Observable {
18074
18265
  y += this.scroller.scrollTop;
18075
18266
  }
18076
18267
 
18077
- row = this._sheet._grid._rows.locate(0, row, function(h) {
18268
+ row = this._sheet._grid._rows.locate(0, row, function (h) {
18078
18269
  return Math.abs(y - h) <= RESIZE_HANDLE_WIDTH / 2;
18079
18270
  });
18080
18271
 
@@ -18090,8 +18281,8 @@ class View extends Observable {
18090
18281
  x -= self._sheet._grid._headerWidth - scrollLeft;
18091
18282
  y -= self._sheet._grid._headerHeight - scrollTop;
18092
18283
 
18093
- return withExit(function(exit) {
18094
- self._sheet.forEachFilterHeader(ref, function(ref) {
18284
+ return withExit(function (exit) {
18285
+ self._sheet.forEachFilterHeader(ref, function (ref) {
18095
18286
  let rect = self._rectangle(pane, ref);
18096
18287
  if (pane.filterIconRect(rect).intersects(x, y)) {
18097
18288
  exit(true);
@@ -18241,7 +18432,7 @@ class View extends Observable {
18241
18432
  }
18242
18433
 
18243
18434
  containingPane(cell) {
18244
- return this.panes.filter(function(pane) {
18435
+ return this.panes.filter(function (pane) {
18245
18436
  if (pane._grid.contains(cell)) {
18246
18437
  return true;
18247
18438
  }
@@ -18266,7 +18457,7 @@ class View extends Observable {
18266
18457
  // this.tabstrip.refreshTools(sheet.range(sheet.activeCell()));
18267
18458
  // }
18268
18459
 
18269
- this.trigger('update', { reason, range: sheet.range(sheet.activeCell()) });
18460
+ this.trigger('update', { reason, range: sheet.range(sheet.activeCell()), sheet });
18270
18461
 
18271
18462
  // if (reason.sheetSelection && this.sheetsbar) {
18272
18463
  // this.sheetsbar.renderSheets(this._workbook.sheets(), this._workbook.sheetIndex(this._sheet));
@@ -18283,7 +18474,7 @@ class View extends Observable {
18283
18474
  let frozenRows = sheet.frozenRows();
18284
18475
 
18285
18476
  // main or bottom or right pane
18286
- this.panes = [ this._pane(frozenRows, frozenColumns) ];
18477
+ this.panes = [this._pane(frozenRows, frozenColumns)];
18287
18478
 
18288
18479
  // left pane
18289
18480
  if (frozenColumns > 0) {
@@ -18310,19 +18501,18 @@ class View extends Observable {
18310
18501
  }
18311
18502
  }
18312
18503
 
18313
- createFilterMenu() { // createFilterMenu(column) {
18314
- // this._destroyFilterMenu();
18504
+ createFilterMenu(column) {
18505
+ this._destroyFilterMenu();
18315
18506
 
18316
- // let sheet = this._sheet;
18317
- // let ref = sheet.filter().ref;
18318
- // let range = new Range(ref, sheet);
18319
- // let element = $("<div />").appendTo(this.element);
18320
- // let options = { column: column, range: range };
18321
- // let filterMenu = new kendo.spreadsheet.FilterMenu(element, options);
18507
+ let sheet = this._sheet;
18508
+ let ref = sheet.filter().ref;
18509
+ let range = new Range$1(ref, sheet);
18322
18510
 
18323
- // this._filterMenu = filterMenu;
18511
+ let options = { column: column, range: range };
18324
18512
 
18325
- // return filterMenu;
18513
+ this._filterMenu = this.options.createFilterMenu(options);
18514
+
18515
+ return this._filterMenu;
18326
18516
  }
18327
18517
 
18328
18518
  selectClipboardContents() {
@@ -18375,11 +18565,11 @@ class View extends Observable {
18375
18565
  let editor = self._sheet.activeCellCustomEditor();
18376
18566
  let range = self._sheet.range(cell);
18377
18567
  editor.edit({
18378
- range : range,
18379
- rect : self.activeCellRectangle(),
18380
- view : this,
18381
- validation : this._sheet.validation(cell),
18382
- callback : function(value, parse) {
18568
+ range: range,
18569
+ rect: self.activeCellRectangle(),
18570
+ view: this,
18571
+ validation: this._sheet.validation(cell),
18572
+ callback: function (value, parse) {
18383
18573
  self._executeCommand({
18384
18574
  command: "EditCommand",
18385
18575
  options: {
@@ -18395,10 +18585,12 @@ class View extends Observable {
18395
18585
 
18396
18586
  openDialog(name, options) {
18397
18587
  let sheet = this._sheet;
18398
- return sheet.withCultureDecimals(function() {
18588
+ return sheet.withCultureDecimals(function () {
18399
18589
  let ref = sheet.activeCell();
18400
18590
  let range = new Range$1(ref, sheet);
18401
- this.trigger('message', { ...options, name, ref, range });
18591
+ let args = { ...options, name, ref, range };
18592
+ this.trigger('message', args);
18593
+ return args.dialog;
18402
18594
  }.bind(this));
18403
18595
  }
18404
18596
 
@@ -18410,7 +18602,7 @@ class View extends Observable {
18410
18602
  return;
18411
18603
  }
18412
18604
 
18413
- let onClose = function() {
18605
+ let onClose = function () {
18414
18606
  currentDialogs.pop();
18415
18607
  // let dlg = e.sender;
18416
18608
  this.selectClipboardContents();
@@ -18456,19 +18648,18 @@ class View extends Observable {
18456
18648
  // this.colHeaderContextMenu =
18457
18649
  // this.drawingContextMenu = null;
18458
18650
 
18459
- // if (this.tabstrip) {
18460
- // this.tabstrip.destroy();
18461
- // this.tabstrip = null;
18462
- // }
18651
+ if (this.tabstrip) {
18652
+ this.tabstrip.destroy();
18653
+ this.tabstrip = null;
18654
+ }
18463
18655
 
18464
- // this._destroyFilterMenu();
18656
+ this._destroyFilterMenu();
18465
18657
  }
18466
18658
 
18467
18659
  _destroyFilterMenu() {
18468
18660
  if (this._filterMenu) {
18469
18661
  this._filterMenu.destroy();
18470
18662
  this._filterMenu = undefined;
18471
- this._filterMenuColumn = undefined;
18472
18663
  }
18473
18664
  }
18474
18665
 
@@ -18488,8 +18679,8 @@ class View extends Observable {
18488
18679
 
18489
18680
  let resizeDirection =
18490
18681
  !sheet.resizingInProgress() ? "none" :
18491
- sheet.resizeHandlePosition().col === -Infinity ? "column" :
18492
- "row";
18682
+ sheet.resizeHandlePosition().col === -Infinity ? "column" :
18683
+ "row";
18493
18684
 
18494
18685
  this.wrapper.classList.toggle(viewClassNames.editContainer, this.editor.isActive());
18495
18686
  this.wrapper.classList.toggle(viewClassNames.horizontalResize, resizeDirection === "row");
@@ -18503,7 +18694,7 @@ class View extends Observable {
18503
18694
  contentWidth: contentWidth,
18504
18695
  contentHeight: contentHeight
18505
18696
  };
18506
- this.panes.forEach(function(pane) {
18697
+ this.panes.forEach(function (pane) {
18507
18698
  content.push(pane.render(args));
18508
18699
  });
18509
18700
 
@@ -18530,11 +18721,11 @@ class View extends Observable {
18530
18721
  if (this.editor.isActive()) {
18531
18722
  this.editor.toggleTooltip(this.activeCellRectangle());
18532
18723
  } else if (!(reason.resize ||
18533
- reason.comment ||
18534
- sheet.selectionInProgress() ||
18535
- sheet.resizingInProgress() ||
18536
- sheet.draggingInProgress() ||
18537
- sheet.isInEditMode())) {
18724
+ reason.comment ||
18725
+ sheet.selectionInProgress() ||
18726
+ sheet.resizingInProgress() ||
18727
+ sheet.draggingInProgress() ||
18728
+ sheet.isInEditMode())) {
18538
18729
  this.renderClipboardContents();
18539
18730
  }
18540
18731
  }
@@ -18568,7 +18759,7 @@ class View extends Observable {
18568
18759
  return dom.element("div", {
18569
18760
  className: classNames.resizeHint + (!horizontal ? " " + classNames.resizeHintVertical : ""),
18570
18761
  style: style
18571
- },[
18762
+ }, [
18572
18763
  dom.element("div", { className: classNames.resizeHintHandle }),
18573
18764
  dom.element("div", { className: classNames.resizeHintMarker })
18574
18765
  ]);
@@ -18606,11 +18797,11 @@ class View extends Observable {
18606
18797
 
18607
18798
  let selectionView = grid.rangeDimensions(selection);
18608
18799
 
18609
- selectionView.rows.forEach(function(height) {
18800
+ selectionView.rows.forEach(function (height) {
18610
18801
  table.addRow(height);
18611
18802
  });
18612
18803
 
18613
- selectionView.columns.forEach(function(width) {
18804
+ selectionView.columns.forEach(function (width) {
18614
18805
  table.addColumn(width);
18615
18806
  });
18616
18807
 
@@ -18618,7 +18809,7 @@ class View extends Observable {
18618
18809
  let primaryMergedCells = tmp.primary;
18619
18810
  let secondaryMergedCells = tmp.secondary;
18620
18811
 
18621
- sheet.forEach(selection, function(row, col, cell) {
18812
+ sheet.forEach(selection, function (row, col, cell) {
18622
18813
  let location = new CellRef(row, col).print();
18623
18814
 
18624
18815
  if (!secondaryMergedCells[location]) {
@@ -18633,13 +18824,13 @@ class View extends Observable {
18633
18824
  }
18634
18825
  });
18635
18826
 
18636
- this.clipboardContents.render([ table.toDomTree(0, 0, "kendo-clipboard-" + this._workbook.clipboard()._uid) ]);
18827
+ this.clipboardContents.render([table.toDomTree(0, 0, "kendo-clipboard-" + this._workbook.clipboard()._uid)]);
18637
18828
 
18638
18829
  this.selectClipboardContents();
18639
18830
  }
18640
18831
 
18641
18832
  _pane(row, column, rowCount, columnCount) {
18642
- let pane = new Pane(this._sheet, this._sheet._grid.pane({ row: row, column: column, rowCount: rowCount, columnCount: columnCount }));
18833
+ let pane = new Pane(this._sheet, this._sheet._grid.pane({ row: row, column: column, rowCount: rowCount, columnCount: columnCount }), this.options.getIconHTMLString);
18643
18834
  pane.refresh(this.scroller.clientWidth, this.scroller.clientHeight);
18644
18835
  return pane;
18645
18836
  }
@@ -18647,6 +18838,9 @@ class View extends Observable {
18647
18838
 
18648
18839
  View.classNames = viewClassNames;
18649
18840
 
18841
+ const reTable = /<table[^>]+>/gmi;
18842
+ const tables = contentStr => ((contentStr || '').match(reTable) || []);
18843
+
18650
18844
  class Clipboard {
18651
18845
  constructor(workbook) {
18652
18846
  this._content = {};
@@ -18812,13 +19006,10 @@ class Clipboard {
18812
19006
  return true;
18813
19007
  }
18814
19008
 
18815
- let internalHTML = Boolean(createFragment(this._externalContent.html)
18816
- .querySelector("table.kendo-clipboard-" + this._uid));
19009
+ const uid = "kendo-clipboard-" + this._uid;
19010
+ const includeUid = tablesArr => tablesArr.some(table => table.includes(uid));
18817
19011
 
18818
- let internalPlain = Boolean(createFragment(this._externalContent.plain)
18819
- .querySelector("table.kendo-clipboard-" + this._uid));
18820
-
18821
- return (internalHTML || internalPlain);
19012
+ return includeUid(tables(this._externalContent.html)) || includeUid(tables(this._externalContent.plain));
18822
19013
  }
18823
19014
  }
18824
19015
 
@@ -19037,6 +19228,10 @@ function parseTSV(data) {
19037
19228
  }
19038
19229
 
19039
19230
  /* eslint-disable no-else-return */
19231
+ /* eslint-disable consistent-return */
19232
+ /* eslint-disable space-before-blocks */
19233
+ /* eslint-disable no-implicit-coercion */
19234
+
19040
19235
 
19041
19236
  let COMMAND_TYPES = {
19042
19237
  AUTO_FILL: "autoFill",
@@ -20852,6 +21047,13 @@ class Deferred {
20852
21047
  }
20853
21048
 
20854
21049
  /* eslint-disable complexity */
21050
+ /* eslint-disable camelcase */
21051
+ /* eslint-disable key-spacing */
21052
+ /* eslint-disable no-nested-ternary */
21053
+ /* eslint-disable brace-style */
21054
+ /* eslint-disable no-implicit-coercion */
21055
+ /* eslint-disable no-loop-func */
21056
+ /* eslint-disable no-param-reassign */
20855
21057
 
20856
21058
  // WARNING: removing the following jshint declaration and turning
20857
21059
  // == into === to make JSHint happy will break functionality.
@@ -22221,6 +22423,11 @@ function excelToPixels(val) {
22221
22423
  }
22222
22424
 
22223
22425
  /* eslint-disable no-undef */
22426
+ /* eslint-disable no-nested-ternary */
22427
+ /* eslint-disable key-spacing */
22428
+ /* eslint-disable consistent-return */
22429
+ /* eslint-disable no-param-reassign */
22430
+
22224
22431
 
22225
22432
  const events$1 = [
22226
22433
  "cut",
@@ -22439,7 +22646,13 @@ class Workbook extends Observable {
22439
22646
 
22440
22647
  execute(options) {
22441
22648
  let commandOptions = Object.assign({}, { workbook: this }, options.options);
22442
- let command = new commands[options.command](commandOptions);
22649
+ let command;
22650
+
22651
+ if (this.options.getWorkbookCommand) {
22652
+ command = this.options.getWorkbookCommand(options.command, commandOptions);
22653
+ }
22654
+
22655
+ command = command || new commands[options.command](commandOptions);
22443
22656
  let sheet = this.activeSheet();
22444
22657
 
22445
22658
  if (commandOptions.origin) {
@@ -22558,7 +22771,8 @@ class Workbook extends Observable {
22558
22771
  options.columnWidth || this.options.columnWidth,
22559
22772
  options.headerHeight || this.options.headerHeight,
22560
22773
  options.headerWidth || this.options.headerWidth,
22561
- options.defaultCellStyle || this.options.defaultCellStyle
22774
+ options.defaultCellStyle || this.options.defaultCellStyle,
22775
+ options.createSheetDataSource || this.options.createSheetDataSource
22562
22776
  );
22563
22777
 
22564
22778
  sheet._workbook = this;
@@ -23237,7 +23451,10 @@ const events = [
23237
23451
  "select",
23238
23452
  "changeFormat",
23239
23453
  "dataBinding",
23240
- "dataBound"
23454
+ "dataBound",
23455
+ "update",
23456
+ "message",
23457
+ "contextmenu",
23241
23458
  ];
23242
23459
 
23243
23460
  class SpreadsheetWidget extends Widget {
@@ -23255,7 +23472,13 @@ class SpreadsheetWidget extends Widget {
23255
23472
  sheetsbar: this.options.sheetsbar,
23256
23473
  formulaBarInputRef: this.options.formulaBarInputRef,
23257
23474
  formulaCellInputRef: this.options.formulaCellInputRef,
23258
- nameBoxRef: this.options.nameBoxRef
23475
+ nameBoxRef: this.options.nameBoxRef,
23476
+ createTabStrip: this.options.createTabStrip,
23477
+ createFilterMenu: this.options.createFilterMenu,
23478
+ createContextMenus: this.options.createContextMenus,
23479
+ createSheetBar: this.options.createSheetBar,
23480
+ getIconHTMLString: this.options.getIconHTMLString,
23481
+ openDialogCallback: this.openDialog.bind(this),
23259
23482
  });
23260
23483
 
23261
23484
  this._workbook = new Workbook(this.options, this._view);
@@ -23265,6 +23488,7 @@ class SpreadsheetWidget extends Widget {
23265
23488
  this._autoRefresh = true;
23266
23489
 
23267
23490
  this._bindWorkbookEvents();
23491
+ this._bindViewEvents();
23268
23492
 
23269
23493
  this._view.workbook(this._workbook);
23270
23494
 
@@ -23294,35 +23518,29 @@ class SpreadsheetWidget extends Widget {
23294
23518
  this.trigger("keydown", e);
23295
23519
 
23296
23520
  if (key === keys.F11 && e.shiftKey) {
23297
- this._view.sheetsbar._onAddSelect();
23521
+ this._view.sheetsbar.onAddSelect();
23298
23522
  e.preventDefault();
23299
23523
  return;
23300
23524
  } else if (e.altKey && key === keys.PAGEDOWN) {
23301
- this._view.sheetsbar.trigger("select", {
23302
- name: this._view.sheetsbar._sheets[this._view.sheetsbar._selectedIndex + 1].name(),
23303
- isAddButton: false
23304
- });
23305
- } else if (e.altKey && key === keys.PAGEUP) {
23306
- this._view.sheetsbar.trigger("select", {
23307
- name: this._view.sheetsbar._sheets[this._view.sheetsbar._selectedIndex - 1].name(),
23308
- isAddButton: false
23309
- });
23310
- } else if (e.altKey && key === keys.DELETE) {
23311
- let closeCallback = function(e) {
23312
- let dlg = e.sender;
23525
+ let activeSheetIndex = this.sheetIndex(this.activeSheet());
23526
+ let nextSheetName = this.sheetByIndex(activeSheetIndex + 1)?.name();
23313
23527
 
23314
- if (dlg.isConfirmed()) {
23315
- this._view.sheetsbar.trigger("remove", { name: this.activeSheet()._name(), confirmation: true });
23316
- }
23317
- }.bind(this);
23528
+ if (nextSheetName){
23529
+ this._view.sheetsbar.onSheetSelect(nextSheetName);
23530
+ }
23531
+ } else if (e.altKey && key === keys.PAGEUP) {
23532
+ let activeSheetIndex = this.sheetIndex(this.activeSheet());
23533
+ let prevSheetName = this.sheetByIndex(activeSheetIndex - 1)?.name();
23318
23534
 
23319
- this._view.sheetsbar._openDialog("confirmation", {
23320
- close: closeCallback
23321
- });
23535
+ if (prevSheetName) {
23536
+ this._view.sheetsbar.onSheetSelect(prevSheetName);
23537
+ }
23538
+ } else if (e.altKey && key === keys.DELETE) {
23539
+ this._view.sheetsbar.onSheetRemove(this.activeSheet()._name());
23322
23540
  e.preventDefault();
23323
23541
  return;
23324
23542
  } else if (e.altKey && key === keys.R) {
23325
- this._view.sheetsbar._createEditor();
23543
+ this.options.createSheetEditor?.();
23326
23544
  e.preventDefault();
23327
23545
  return;
23328
23546
  } else if (controlKey && key === keys.B) {
@@ -23332,17 +23550,20 @@ class SpreadsheetWidget extends Widget {
23332
23550
  } else if (controlKey && key === keys.U) {
23333
23551
  this._handleTypographicalEmphasis('underline');
23334
23552
  } else if (e.altKey && key === keys.H) {
23335
- this._view.tabstrip.select(0);
23553
+ this._view.tabstrip?.select(0);
23336
23554
  e.preventDefault();
23337
23555
  return;
23338
23556
  } else if (e.altKey && key === keys.N) {
23339
- this._view.tabstrip.select(1);
23557
+ this._view.tabstrip?.select(1);
23340
23558
  e.preventDefault();
23341
23559
  return;
23342
23560
  } else if (e.altKey && key === keys.A) {
23343
- this._view.tabstrip.select(2);
23561
+ this._view.tabstrip?.select(2);
23344
23562
  e.preventDefault();
23345
23563
  return;
23564
+ } else if (key === keys.F10) {
23565
+ e.preventDefault();
23566
+ this._view.tabstrip?.wrapper?.find(".k-tabstrip-content.k-active .k-toolbar [tabindex=0]").trigger("focus");
23346
23567
  }
23347
23568
  }
23348
23569
 
@@ -23653,6 +23874,14 @@ class SpreadsheetWidget extends Widget {
23653
23874
  // kendo.ui.progress(this.element, e.toggle);
23654
23875
  }
23655
23876
 
23877
+ _viewUpdate(e) {
23878
+ this.trigger("update", e);
23879
+ }
23880
+
23881
+ _viewMessage(e) {
23882
+ this.trigger("message", e);
23883
+ }
23884
+
23656
23885
  _onContextMenu(e) {
23657
23886
  this.trigger("contextmenu", e);
23658
23887
  }
@@ -23686,6 +23915,11 @@ class SpreadsheetWidget extends Widget {
23686
23915
  this._workbook.bind("contextmenu", this._onContextMenu.bind(this));
23687
23916
  }
23688
23917
 
23918
+ _bindViewEvents() {
23919
+ this._view.bind("update", this._viewUpdate.bind(this));
23920
+ this._view.bind("message", this._viewMessage.bind(this));
23921
+ }
23922
+
23689
23923
  destroy() {
23690
23924
  window.removeEventListener('resize', this._resizeHandler);
23691
23925
  this.element.removeEventListener("keydown", this._keyDownHandler);
@@ -23736,6 +23970,7 @@ class SpreadsheetWidget extends Widget {
23736
23970
 
23737
23971
  /* -----[ Excel operators ]----- */
23738
23972
 
23973
+
23739
23974
  const {
23740
23975
  FUNCS,
23741
23976
  defineBuiltinFunction,
@@ -43883,4 +44118,4 @@ const {
43883
44118
  defineAlias
43884
44119
  } = calc.runtime;
43885
44120
 
43886
- export { CalcError, CellRef, Context, Deferred, Matrix, NULLREF, NameRef, Range$1 as Range, RangeRef, Ref, Sheet, SpreadsheetWidget, UnionRef, View, Workbook, calc, dateToSerial, defineAlias, defineFunction, packDate, packTime, serialToDate, unpackDate, unpackTime };
44121
+ export { ALL_PROPERTIES, ALL_REASONS, AddColumnCommand, AddCommand, AddRowCommand, AdjustDecimalsCommand, AdjustRowHeightCommand, ApplyFilterCommand, AutoFillCalculator, AutoFillCommand, Axis, AxisManager, BorderChangeCommand, BringToFrontCommand, CalcError, CellRef, ClearContentCommand, ClearFilterCommand, Clipboard, ColumnWidthCommand, Command, Context, Controller, CopyCommand, CustomFilter, CutCommand, Deferred, DefineNameCommand, DeleteColumnCommand, DeleteCommand, DeleteDrawingCommand, DeleteNameCommand, DeleteRowCommand, Drawing, DrawingCommand, DrawingUpdateCommand, DynamicFilter, EditCommand, EditValidationCommand, EventListener, FIRSTREF, Filter, FilterCommand, FormulaBar, FormulaContext, FormulaInput, FreezePanesCommand, Grid, GridLinesChangeCommand, HideLineCommand, HyperlinkCommand, InsertCommentCommand, InsertImageCommand, Matrix, MergeCellCommand, NULLREF, NameCommand, NameEditor, NameRef, OpenCommand, Pane, PaneAxis, PaneGrid, PasteCommand, PropertyBag, PropertyChangeCommand, PropertyCleanCommand, Range$1 as Range, RangeList, RangeRef, RangeTree, Ref, ReorderDrawingsCommand, RowHeightCommand, SHEETREF, SaveAsCommand, SendToBackCommand, Sheet, SheetDataSourceBinder, SheetEditor, SheetNavigator, SortCommand, Sorter, SpreadsheetWidget, TargetValueCommand, TextWrapCommand, ToolbarCopyCommand, ToolbarCutCommand, ToolbarPasteCommand, TopFilter, UnHideLineCommand, UnionRef, ValidationFormulaContext, ValueFilter, View, Workbook, calc, dateToNumber, dateToSerial, defineAlias, defineFunction, draw, drawCell, formatting, initDynamicFilter, intl, numberToDate, packDate, packTime, registerEditor, serialToDate, unpackDate, unpackTime, validationExport as validation };