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