@progress/kendo-spreadsheet-common 1.1.3-develop.3 → 1.2.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-esm.js +400 -152
- package/dist/index.js +488 -150
- package/package.json +1 -1
package/dist/index-esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { drawing, parseColor, geometry,
|
|
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 (
|
|
1228
|
-
|
|
1229
|
-
} else {
|
|
1230
|
-
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
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
|
}
|
|
@@ -1368,6 +1361,14 @@ const isDate = (value) => value && value.getTime;
|
|
|
1368
1361
|
const isString = (value) => typeof value === "string";
|
|
1369
1362
|
const isNumeric = (value) => !isNaN(value - parseFloat(value));
|
|
1370
1363
|
const isFunction = (fn) => typeof fn === "function";
|
|
1364
|
+
const isPlainObject = function(obj) {
|
|
1365
|
+
if (!obj || toString.call(obj) !== "[object Object]") {
|
|
1366
|
+
return false;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
const proto = Object.getPrototypeOf(obj);
|
|
1370
|
+
return proto === null || proto.constructor === Object;
|
|
1371
|
+
};
|
|
1371
1372
|
|
|
1372
1373
|
class CalcError {
|
|
1373
1374
|
|
|
@@ -1406,6 +1407,9 @@ function createKendoObj(calc, CalcError, Ref, CellRef, RangeRef) {
|
|
|
1406
1407
|
}
|
|
1407
1408
|
|
|
1408
1409
|
/* eslint-disable max-params */
|
|
1410
|
+
/* eslint-disable complexity */
|
|
1411
|
+
/* eslint-disable no-unused-vars */
|
|
1412
|
+
|
|
1409
1413
|
|
|
1410
1414
|
let calc = {
|
|
1411
1415
|
runtime: {
|
|
@@ -2941,7 +2945,7 @@ function Element(nodeName, attr, children) {
|
|
|
2941
2945
|
}
|
|
2942
2946
|
Element.prototype = new Node();
|
|
2943
2947
|
Element.prototype.appendTo = function(parent) {
|
|
2944
|
-
let node = document.createElement(this.nodeName);
|
|
2948
|
+
let node = typeof(this.nodeName) === "string" ? document.createElement(this.nodeName) : this.nodeName;
|
|
2945
2949
|
let children = this.children;
|
|
2946
2950
|
for (let index = 0; index < children.length; index++) {
|
|
2947
2951
|
children[index].render(node, NULL_NODE);
|
|
@@ -3162,6 +3166,7 @@ const dom = {
|
|
|
3162
3166
|
|
|
3163
3167
|
//--------------------------------------------------- custom number format.
|
|
3164
3168
|
|
|
3169
|
+
|
|
3165
3170
|
let RX_COLORS = /^\[(black|green|white|blue|magenta|yellow|cyan|red)\]/i;
|
|
3166
3171
|
let RX_CONDITION = /^\[(<=|>=|<>|<|>|=)(-?[0-9.]+)\]/;
|
|
3167
3172
|
|
|
@@ -4127,6 +4132,28 @@ const formatting = {
|
|
|
4127
4132
|
};
|
|
4128
4133
|
|
|
4129
4134
|
/* eslint-disable no-nested-ternary */
|
|
4135
|
+
/* eslint-disable space-infix-ops */
|
|
4136
|
+
/* eslint-disable indent */
|
|
4137
|
+
/* eslint-disable no-empty */
|
|
4138
|
+
/* eslint-disable no-loop-func */
|
|
4139
|
+
/* eslint-disable consistent-return */
|
|
4140
|
+
/* eslint-disable block-scoped-var */
|
|
4141
|
+
/* eslint-disable no-redeclare */
|
|
4142
|
+
/* eslint-disable no-var */
|
|
4143
|
+
/* eslint-disable eqeqeq */
|
|
4144
|
+
/* eslint-disable complexity */
|
|
4145
|
+
/* eslint-disable max-params */
|
|
4146
|
+
/* eslint-disable no-implicit-coercion */
|
|
4147
|
+
/* eslint-disable key-spacing */
|
|
4148
|
+
/* eslint-disable default-case */
|
|
4149
|
+
/* eslint-disable camelcase */
|
|
4150
|
+
/* eslint-disable brace-style */
|
|
4151
|
+
/* eslint-disable no-else-return */
|
|
4152
|
+
/* eslint-disable no-constant-condition */
|
|
4153
|
+
/* eslint-disable no-param-reassign */
|
|
4154
|
+
/* eslint-disable space-before-blocks */
|
|
4155
|
+
/* eslint-disable no-unused-labels */
|
|
4156
|
+
|
|
4130
4157
|
|
|
4131
4158
|
const kendo = createKendoObj(calc, CalcError, Ref, CellRef, RangeRef);
|
|
4132
4159
|
calc.kendo = kendo; // XXX
|
|
@@ -5932,6 +5959,12 @@ class EventListener {
|
|
|
5932
5959
|
}
|
|
5933
5960
|
|
|
5934
5961
|
/* eslint-disable default-case */
|
|
5962
|
+
/* eslint-disable no-else-return */
|
|
5963
|
+
/* eslint-disable key-spacing */
|
|
5964
|
+
/* eslint-disable eqeqeq */
|
|
5965
|
+
/* eslint-disable brace-style */
|
|
5966
|
+
/* eslint-disable consistent-return */
|
|
5967
|
+
|
|
5935
5968
|
|
|
5936
5969
|
let alphaNumRegExp = /:alphanum$/;
|
|
5937
5970
|
|
|
@@ -6557,6 +6590,7 @@ class Controller {
|
|
|
6557
6590
|
this._workbook.trigger("contextmenu", {
|
|
6558
6591
|
objectRef: object.ref,
|
|
6559
6592
|
targetType: object.type,
|
|
6593
|
+
isComposite,
|
|
6560
6594
|
showUnhide,
|
|
6561
6595
|
showUnmerge,
|
|
6562
6596
|
originalEvent: event
|
|
@@ -7071,7 +7105,7 @@ class Controller {
|
|
|
7071
7105
|
this.clipboardElement.focus();
|
|
7072
7106
|
this.navigator.navigateInSelection(ENTRY_ACTIONS[action]);
|
|
7073
7107
|
}
|
|
7074
|
-
|
|
7108
|
+
|
|
7075
7109
|
if (action === 'tab') {
|
|
7076
7110
|
e.preventDefault();
|
|
7077
7111
|
}
|
|
@@ -7774,6 +7808,9 @@ class SparseRangeList extends RangeList {
|
|
|
7774
7808
|
}
|
|
7775
7809
|
|
|
7776
7810
|
/* eslint-disable default-case */
|
|
7811
|
+
/* eslint-disable camelcase */
|
|
7812
|
+
/* eslint-disable no-param-reassign */
|
|
7813
|
+
|
|
7777
7814
|
|
|
7778
7815
|
class Property {
|
|
7779
7816
|
constructor(list) {
|
|
@@ -8097,6 +8134,10 @@ const ALL_PROPERTIES = propertyBagSpec.reduce(function(a, spec) {
|
|
|
8097
8134
|
}, [ "borderTop", "borderRight", "borderBottom", "borderLeft" ]);
|
|
8098
8135
|
|
|
8099
8136
|
/* eslint-disable no-param-reassign */
|
|
8137
|
+
/* eslint-disable no-useless-call */
|
|
8138
|
+
/* eslint-disable camelcase */
|
|
8139
|
+
/* eslint-disable default-case */
|
|
8140
|
+
|
|
8100
8141
|
|
|
8101
8142
|
let TRANSPOSE_FORMAT = "_matrix({0})";
|
|
8102
8143
|
let DATE_FORMAT = 'DATEVALUE("{0}")';
|
|
@@ -8428,6 +8469,28 @@ validationExport.validationComparers = {
|
|
|
8428
8469
|
validationExport.Validation = Validation;
|
|
8429
8470
|
|
|
8430
8471
|
/* eslint-disable no-nested-ternary */
|
|
8472
|
+
/* eslint-disable curly */
|
|
8473
|
+
/* eslint-disable space-infix-ops */
|
|
8474
|
+
/* eslint-disable indent */
|
|
8475
|
+
/* eslint-disable no-empty */
|
|
8476
|
+
/* eslint-disable no-loop-func */
|
|
8477
|
+
/* eslint-disable consistent-return */
|
|
8478
|
+
/* eslint-disable block-scoped-var */
|
|
8479
|
+
/* eslint-disable no-redeclare */
|
|
8480
|
+
/* eslint-disable no-var */
|
|
8481
|
+
/* eslint-disable eqeqeq */
|
|
8482
|
+
/* eslint-disable complexity */
|
|
8483
|
+
/* eslint-disable max-params */
|
|
8484
|
+
/* eslint-disable no-implicit-coercion */
|
|
8485
|
+
/* eslint-disable key-spacing */
|
|
8486
|
+
/* eslint-disable default-case */
|
|
8487
|
+
/* eslint-disable camelcase */
|
|
8488
|
+
/* eslint-disable brace-style */
|
|
8489
|
+
/* eslint-disable no-else-return */
|
|
8490
|
+
/* eslint-disable no-constant-condition */
|
|
8491
|
+
/* eslint-disable no-param-reassign */
|
|
8492
|
+
/* eslint-disable space-before-blocks */
|
|
8493
|
+
|
|
8431
8494
|
const { measureText } = drawing.util;
|
|
8432
8495
|
|
|
8433
8496
|
let PROPERTIES = [
|
|
@@ -10487,6 +10550,7 @@ class PaneAxis {
|
|
|
10487
10550
|
}
|
|
10488
10551
|
|
|
10489
10552
|
/* eslint-disable no-param-reassign */
|
|
10553
|
+
/* eslint-disable camelcase */
|
|
10490
10554
|
|
|
10491
10555
|
class Rectangle {
|
|
10492
10556
|
constructor(left, top, width, height) {
|
|
@@ -10874,6 +10938,9 @@ Sorter.descendingComparer = function(a, b) {
|
|
|
10874
10938
|
};
|
|
10875
10939
|
|
|
10876
10940
|
/* eslint-disable no-constant-condition */
|
|
10941
|
+
/* eslint-disable key-spacing */
|
|
10942
|
+
/* eslint-disable no-param-reassign */
|
|
10943
|
+
|
|
10877
10944
|
|
|
10878
10945
|
class AxisManager {
|
|
10879
10946
|
constructor(sheet) {
|
|
@@ -11184,6 +11251,21 @@ class AutoFillCalculator {
|
|
|
11184
11251
|
}
|
|
11185
11252
|
|
|
11186
11253
|
/* eslint-disable max-params */
|
|
11254
|
+
/* eslint-disable no-empty */
|
|
11255
|
+
/* eslint-disable no-loop-func */
|
|
11256
|
+
/* eslint-disable consistent-return */
|
|
11257
|
+
/* eslint-disable block-scoped-var */
|
|
11258
|
+
/* eslint-disable no-redeclare */
|
|
11259
|
+
/* eslint-disable no-var */
|
|
11260
|
+
/* eslint-disable eqeqeq */
|
|
11261
|
+
/* eslint-disable complexity */
|
|
11262
|
+
/* eslint-disable no-implicit-coercion */
|
|
11263
|
+
/* eslint-disable brace-style */
|
|
11264
|
+
/* eslint-disable key-spacing */
|
|
11265
|
+
/* eslint-disable no-else-return */
|
|
11266
|
+
/* eslint-disable default-case */
|
|
11267
|
+
/* eslint-disable no-param-reassign */
|
|
11268
|
+
|
|
11187
11269
|
|
|
11188
11270
|
class EdgeNavigator {
|
|
11189
11271
|
constructor(field, axis, rangeGetter, union) {
|
|
@@ -11858,16 +11940,41 @@ function makeWordMovement(sheet, pivot, isCol) {
|
|
|
11858
11940
|
}
|
|
11859
11941
|
|
|
11860
11942
|
/* eslint-disable max-params */
|
|
11943
|
+
/* eslint-disable no-empty */
|
|
11944
|
+
/* eslint-disable no-loop-func */
|
|
11945
|
+
/* eslint-disable consistent-return */
|
|
11946
|
+
/* eslint-disable block-scoped-var */
|
|
11947
|
+
/* eslint-disable no-redeclare */
|
|
11948
|
+
/* eslint-disable no-var */
|
|
11949
|
+
/* eslint-disable eqeqeq */
|
|
11950
|
+
/* eslint-disable complexity */
|
|
11951
|
+
/* eslint-disable no-implicit-coercion */
|
|
11952
|
+
/* eslint-disable brace-style */
|
|
11953
|
+
/* eslint-disable key-spacing */
|
|
11954
|
+
/* eslint-disable no-else-return */
|
|
11955
|
+
/* eslint-disable default-case */
|
|
11956
|
+
/* eslint-disable no-param-reassign */
|
|
11957
|
+
|
|
11861
11958
|
|
|
11862
11959
|
function numberToDate(val) {
|
|
11863
11960
|
return val == null ? null : calc.runtime.serialToDate(val);
|
|
11864
11961
|
}
|
|
11865
11962
|
|
|
11866
|
-
|
|
11963
|
+
function dateToNumber(val) {
|
|
11964
|
+
return val == null ? null : calc.runtime.dateToSerial(val);
|
|
11965
|
+
}
|
|
11966
|
+
|
|
11967
|
+
var identity = function (o) { return o; };
|
|
11867
11968
|
|
|
11868
11969
|
class SheetDataSourceBinder {
|
|
11869
11970
|
constructor(options) {
|
|
11870
|
-
this.options = Object.assign({ columns: [] }, this.options,
|
|
11971
|
+
this.options = Object.assign({ columns: [] }, this.options,
|
|
11972
|
+
// skip undefined properties in options
|
|
11973
|
+
Object.keys(options).reduce((acc, key) => {
|
|
11974
|
+
if (options[key] !== undefined) acc[key] = options[key];
|
|
11975
|
+
return acc;
|
|
11976
|
+
}, {})
|
|
11977
|
+
);
|
|
11871
11978
|
|
|
11872
11979
|
this.columns = this._normalizeColumns(this.options.columns);
|
|
11873
11980
|
|
|
@@ -11911,9 +12018,9 @@ class SheetDataSourceBinder {
|
|
|
11911
12018
|
}
|
|
11912
12019
|
|
|
11913
12020
|
_header() {
|
|
11914
|
-
this.sheet.batch(function() {
|
|
11915
|
-
this.columns.forEach(function(column, index) {
|
|
11916
|
-
this.sheet.range(0,index).value(column.title);
|
|
12021
|
+
this.sheet.batch(function () {
|
|
12022
|
+
this.columns.forEach(function (column, index) {
|
|
12023
|
+
this.sheet.range(0, index).value(column.title);
|
|
11917
12024
|
}.bind(this));
|
|
11918
12025
|
}.bind(this));
|
|
11919
12026
|
}
|
|
@@ -11931,7 +12038,7 @@ class SheetDataSourceBinder {
|
|
|
11931
12038
|
var values = [];
|
|
11932
12039
|
var sheet = this.sheet;
|
|
11933
12040
|
var fields, getters, normalizedRef, i, rangeRef, normalizedRefs;
|
|
11934
|
-
var setValues = function(ref) {
|
|
12041
|
+
var setValues = function (ref) {
|
|
11935
12042
|
ref = ref.toRangeRef();
|
|
11936
12043
|
var record;
|
|
11937
12044
|
var valueIndex = 0;
|
|
@@ -11960,7 +12067,7 @@ class SheetDataSourceBinder {
|
|
|
11960
12067
|
columns = Object.keys(data[0].toJSON());
|
|
11961
12068
|
}
|
|
11962
12069
|
|
|
11963
|
-
getters = columns.map(function(column) {
|
|
12070
|
+
getters = columns.map(function (column) {
|
|
11964
12071
|
var field = column.field;
|
|
11965
12072
|
if (field && fields && fields[field] && fields[field].type === "date") {
|
|
11966
12073
|
return numberToDate;
|
|
@@ -11977,7 +12084,7 @@ class SheetDataSourceBinder {
|
|
|
11977
12084
|
|
|
11978
12085
|
normalizedRefs = normalizedRef.refs;
|
|
11979
12086
|
|
|
11980
|
-
normalizedRefs.forEach(function(ref) {
|
|
12087
|
+
normalizedRefs.forEach(function (ref) {
|
|
11981
12088
|
values.push(sheet.range(ref).values());
|
|
11982
12089
|
});
|
|
11983
12090
|
|
|
@@ -11993,7 +12100,7 @@ class SheetDataSourceBinder {
|
|
|
11993
12100
|
}
|
|
11994
12101
|
|
|
11995
12102
|
_normalizeColumns(columns) {
|
|
11996
|
-
return columns.map(function(column) {
|
|
12103
|
+
return columns.map(function (column) {
|
|
11997
12104
|
var field = column.field || column;
|
|
11998
12105
|
return {
|
|
11999
12106
|
field: field,
|
|
@@ -12005,23 +12112,23 @@ class SheetDataSourceBinder {
|
|
|
12005
12112
|
_dataSource() {
|
|
12006
12113
|
var options = this.options;
|
|
12007
12114
|
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
12115
|
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12116
|
+
dataSource = Array.isArray(dataSource) ? { data: dataSource } : dataSource;
|
|
12117
|
+
|
|
12118
|
+
if (this.dataSource && this._changeHandler) {
|
|
12119
|
+
this.dataSource.unbind("change", this._changeHandler)
|
|
12120
|
+
.unbind("progress", this._progressHandler)
|
|
12121
|
+
.unbind("error", this._errorHandler);
|
|
12122
|
+
} else {
|
|
12123
|
+
this._changeHandler = this._change.bind(this);
|
|
12124
|
+
this._progressHandler = this._requestStart.bind(this);
|
|
12125
|
+
this._errorHandler = this._error.bind(this);
|
|
12126
|
+
}
|
|
12127
|
+
|
|
12128
|
+
this.dataSource = this.options.sheet.createSheetDataSource?.(dataSource)
|
|
12129
|
+
.bind("change", this._changeHandler)
|
|
12130
|
+
.bind("progress", this._progressHandler)
|
|
12131
|
+
.bind("error", this._errorHandler);
|
|
12025
12132
|
}
|
|
12026
12133
|
|
|
12027
12134
|
_error() {
|
|
@@ -12055,11 +12162,11 @@ class SheetDataSourceBinder {
|
|
|
12055
12162
|
this._header();
|
|
12056
12163
|
}
|
|
12057
12164
|
|
|
12058
|
-
var getters = columns.map(function(column) {
|
|
12165
|
+
var getters = columns.map(function (column) {
|
|
12059
12166
|
return getter(column.field);
|
|
12060
12167
|
});
|
|
12061
12168
|
|
|
12062
|
-
this.sheet.batch(function() {
|
|
12169
|
+
this.sheet.batch(function () {
|
|
12063
12170
|
var length = Math.max(data.length, this._boundRowsCount, this.sheet._grid.rowCount - 1);
|
|
12064
12171
|
|
|
12065
12172
|
for (var idx = 0; idx < length; idx++) {
|
|
@@ -12109,6 +12216,10 @@ const kendoDate = (function() {
|
|
|
12109
12216
|
})();
|
|
12110
12217
|
|
|
12111
12218
|
/* eslint-disable no-var */
|
|
12219
|
+
/* eslint-disable no-implicit-coercion */
|
|
12220
|
+
/* eslint-disable no-param-reassign */
|
|
12221
|
+
/* eslint-disable no-loop-func */
|
|
12222
|
+
|
|
12112
12223
|
|
|
12113
12224
|
const logic = {
|
|
12114
12225
|
or: {
|
|
@@ -12238,6 +12349,21 @@ const transformCompositeFilter = function (filter) {
|
|
|
12238
12349
|
};
|
|
12239
12350
|
|
|
12240
12351
|
/* eslint-disable max-params */
|
|
12352
|
+
/* eslint-disable no-empty */
|
|
12353
|
+
/* eslint-disable no-loop-func */
|
|
12354
|
+
/* eslint-disable consistent-return */
|
|
12355
|
+
/* eslint-disable block-scoped-var */
|
|
12356
|
+
/* eslint-disable no-redeclare */
|
|
12357
|
+
/* eslint-disable no-var */
|
|
12358
|
+
/* eslint-disable eqeqeq */
|
|
12359
|
+
/* eslint-disable complexity */
|
|
12360
|
+
/* eslint-disable no-implicit-coercion */
|
|
12361
|
+
/* eslint-disable brace-style */
|
|
12362
|
+
/* eslint-disable key-spacing */
|
|
12363
|
+
/* eslint-disable no-else-return */
|
|
12364
|
+
/* eslint-disable default-case */
|
|
12365
|
+
/* eslint-disable no-param-reassign */
|
|
12366
|
+
|
|
12241
12367
|
|
|
12242
12368
|
let filtersObj = {};
|
|
12243
12369
|
const dateToSerial$1 = calc.runtime.dateToSerial;
|
|
@@ -12688,6 +12814,21 @@ function sameWeek(a, b) {
|
|
|
12688
12814
|
}
|
|
12689
12815
|
|
|
12690
12816
|
/* eslint-disable max-params */
|
|
12817
|
+
/* eslint-disable no-empty */
|
|
12818
|
+
/* eslint-disable no-loop-func */
|
|
12819
|
+
/* eslint-disable consistent-return */
|
|
12820
|
+
/* eslint-disable block-scoped-var */
|
|
12821
|
+
/* eslint-disable no-redeclare */
|
|
12822
|
+
/* eslint-disable no-var */
|
|
12823
|
+
/* eslint-disable eqeqeq */
|
|
12824
|
+
/* eslint-disable complexity */
|
|
12825
|
+
/* eslint-disable no-implicit-coercion */
|
|
12826
|
+
/* eslint-disable brace-style */
|
|
12827
|
+
/* eslint-disable key-spacing */
|
|
12828
|
+
/* eslint-disable no-else-return */
|
|
12829
|
+
/* eslint-disable default-case */
|
|
12830
|
+
/* eslint-disable no-param-reassign */
|
|
12831
|
+
|
|
12691
12832
|
|
|
12692
12833
|
// This is a “dynamic variable” (see Greenspun's 10th rule). It's
|
|
12693
12834
|
// bound to an array via sheet._saveModifiedFormulas (which see)
|
|
@@ -12829,6 +12970,12 @@ class Selection {
|
|
|
12829
12970
|
}
|
|
12830
12971
|
}
|
|
12831
12972
|
|
|
12973
|
+
let EDITORS = {};
|
|
12974
|
+
|
|
12975
|
+
function registerEditor(name, editor) {
|
|
12976
|
+
EDITORS[name] = editor;
|
|
12977
|
+
}
|
|
12978
|
+
|
|
12832
12979
|
class Sheet extends Observable {
|
|
12833
12980
|
constructor() {
|
|
12834
12981
|
super();
|
|
@@ -12850,10 +12997,35 @@ class Sheet extends Observable {
|
|
|
12850
12997
|
"dataBound",
|
|
12851
12998
|
"progress"
|
|
12852
12999
|
];
|
|
13000
|
+
|
|
13001
|
+
this.createSheetDataSource = Array.from(arguments).pop();
|
|
13002
|
+
|
|
12853
13003
|
this._reinit.apply(this, arguments);
|
|
12854
13004
|
}
|
|
12855
13005
|
|
|
12856
|
-
activeCellCustomEditor() {
|
|
13006
|
+
activeCellCustomEditor() {
|
|
13007
|
+
let cell = this.activeCell().first();
|
|
13008
|
+
|
|
13009
|
+
if (this.range(cell).enable()) {
|
|
13010
|
+
let val = this.validation(cell);
|
|
13011
|
+
let key = this._properties.get("editor", this._grid.cellRefIndex(cell));
|
|
13012
|
+
let editor;
|
|
13013
|
+
|
|
13014
|
+
if (key != null) {
|
|
13015
|
+
editor = EDITORS[key];
|
|
13016
|
+
}
|
|
13017
|
+
else if (val && val.showButton) {
|
|
13018
|
+
key = "_validation_" + val.dataType;
|
|
13019
|
+
editor = EDITORS[key];
|
|
13020
|
+
}
|
|
13021
|
+
|
|
13022
|
+
if (typeof editor == "function") {
|
|
13023
|
+
editor = EDITORS[key] = editor();
|
|
13024
|
+
}
|
|
13025
|
+
|
|
13026
|
+
return editor;
|
|
13027
|
+
}
|
|
13028
|
+
}
|
|
12857
13029
|
|
|
12858
13030
|
_reinit(rowCount, columnCount, rowHeight, columnWidth, headerHeight, headerWidth, defaultCellStyle) {
|
|
12859
13031
|
defaultCellStyle = defaultCellStyle || {};
|
|
@@ -13055,7 +13227,8 @@ class Sheet extends Observable {
|
|
|
13055
13227
|
this.dataSourceBinder = new SheetDataSourceBinder({
|
|
13056
13228
|
dataSource: dataSource,
|
|
13057
13229
|
sheet: this,
|
|
13058
|
-
columns: columns
|
|
13230
|
+
columns: columns,
|
|
13231
|
+
createSheetDataSource: this.createSheetDataSource
|
|
13059
13232
|
});
|
|
13060
13233
|
|
|
13061
13234
|
this.dataSource = this.dataSourceBinder.dataSource;
|
|
@@ -14860,6 +15033,13 @@ function getPaperOptions(getOption) {
|
|
|
14860
15033
|
}
|
|
14861
15034
|
|
|
14862
15035
|
/* eslint-disable no-nested-ternary */
|
|
15036
|
+
/* eslint-disable default-case */
|
|
15037
|
+
/* eslint-disable no-implicit-coercion */
|
|
15038
|
+
/* eslint-disable no-else-return */
|
|
15039
|
+
/* eslint-disable key-spacing */
|
|
15040
|
+
/* eslint-disable eqeqeq */
|
|
15041
|
+
/* eslint-disable no-param-reassign */
|
|
15042
|
+
|
|
14863
15043
|
|
|
14864
15044
|
let GUIDELINE_WIDTH = 0.8;
|
|
14865
15045
|
|
|
@@ -15501,7 +15681,7 @@ function drawText(text, color, cell, group) {
|
|
|
15501
15681
|
}
|
|
15502
15682
|
if (vtrans < 0) { vtrans = 0; }
|
|
15503
15683
|
|
|
15504
|
-
let textGroup =
|
|
15684
|
+
let textGroup = drawText$1(CONT);
|
|
15505
15685
|
textGroup.transform(geometry.Matrix.translate(cell.left, cell.top + vtrans));
|
|
15506
15686
|
group.append(textGroup);
|
|
15507
15687
|
}
|
|
@@ -15904,7 +16084,7 @@ const viewClassNames = {
|
|
|
15904
16084
|
horizontalResize: "k-horizontal-resize",
|
|
15905
16085
|
verticalResize: "k-vertical-resize",
|
|
15906
16086
|
icon: "k-icon",
|
|
15907
|
-
iconFilterDefault: "k-i-
|
|
16087
|
+
iconFilterDefault: "k-i-caret-alt-down",
|
|
15908
16088
|
sheetsBar: "k-spreadsheet-sheets-bar",
|
|
15909
16089
|
sheetsBarActive: "k-spreadsheet-sheets-bar-active",
|
|
15910
16090
|
sheetsBarInactive: "k-spreadsheet-sheets-bar-inactive",
|
|
@@ -15955,6 +16135,7 @@ const paneClassNames = {
|
|
|
15955
16135
|
|
|
15956
16136
|
/* eslint-disable complexity */
|
|
15957
16137
|
|
|
16138
|
+
|
|
15958
16139
|
function cellBorder(value) {
|
|
15959
16140
|
return (value.size || 1) + "px solid " + (value.color || "#000");
|
|
15960
16141
|
}
|
|
@@ -16166,9 +16347,10 @@ function drawCell(collection, cell, cls, showGrid) {
|
|
|
16166
16347
|
}
|
|
16167
16348
|
|
|
16168
16349
|
class Pane {
|
|
16169
|
-
constructor(sheet, grid) {
|
|
16350
|
+
constructor(sheet, grid, getIconHTMLString) {
|
|
16170
16351
|
this._sheet = sheet;
|
|
16171
16352
|
this._grid = grid;
|
|
16353
|
+
this.getIconHTMLString = getIconHTMLString;
|
|
16172
16354
|
}
|
|
16173
16355
|
|
|
16174
16356
|
refresh(width, height) {
|
|
@@ -16524,18 +16706,23 @@ class Pane {
|
|
|
16524
16706
|
);
|
|
16525
16707
|
}
|
|
16526
16708
|
|
|
16709
|
+
icon(className) {
|
|
16710
|
+
if (typeof this.getIconHTMLString === "function") {
|
|
16711
|
+
return dom.element(this.getIconHTMLString(className));
|
|
16712
|
+
}
|
|
16713
|
+
|
|
16714
|
+
return dom.element("span", {
|
|
16715
|
+
className: viewClassNames.icon + " " + className
|
|
16716
|
+
});
|
|
16717
|
+
}
|
|
16718
|
+
|
|
16527
16719
|
renderFilterHeaders() {
|
|
16720
|
+
let pane = this;
|
|
16528
16721
|
let sheet = this._sheet;
|
|
16529
16722
|
let children = [];
|
|
16530
16723
|
let classNames = viewClassNames;
|
|
16531
16724
|
let filter = sheet.filter();
|
|
16532
16725
|
|
|
16533
|
-
function icon(className) {
|
|
16534
|
-
return dom.element("span", {
|
|
16535
|
-
className: classNames.icon + " " + className
|
|
16536
|
-
});
|
|
16537
|
-
}
|
|
16538
|
-
|
|
16539
16726
|
function filterButton(classNames, position, index) {
|
|
16540
16727
|
let style = {
|
|
16541
16728
|
left: position.left + "px",
|
|
@@ -16553,7 +16740,7 @@ class Pane {
|
|
|
16553
16740
|
let button = dom.element(
|
|
16554
16741
|
"span",
|
|
16555
16742
|
{ className: classes, style: style },
|
|
16556
|
-
[ icon(classNames.iconFilterDefault) ]
|
|
16743
|
+
[ pane.icon(classNames.iconFilterDefault) ]
|
|
16557
16744
|
);
|
|
16558
16745
|
|
|
16559
16746
|
return button;
|
|
@@ -16710,11 +16897,11 @@ class Pane {
|
|
|
16710
16897
|
height : cell.height + "px"
|
|
16711
16898
|
}
|
|
16712
16899
|
});
|
|
16900
|
+
|
|
16713
16901
|
if (ed.icon) {
|
|
16714
|
-
btn.children.push(
|
|
16715
|
-
className: "k-icon " + ed.icon
|
|
16716
|
-
}));
|
|
16902
|
+
btn.children.push(self.icon(ed.icon));
|
|
16717
16903
|
}
|
|
16904
|
+
|
|
16718
16905
|
collection.push(btn);
|
|
16719
16906
|
});
|
|
16720
16907
|
}
|
|
@@ -16789,6 +16976,11 @@ function drawingResizeHandles(container) {
|
|
|
16789
16976
|
}
|
|
16790
16977
|
|
|
16791
16978
|
/* eslint-disable no-unused-vars */
|
|
16979
|
+
/* eslint-disable no-param-reassign */
|
|
16980
|
+
/* eslint-disable no-else-return */
|
|
16981
|
+
/* eslint-disable no-multi-spaces */
|
|
16982
|
+
/* eslint-disable no-nested-ternary */
|
|
16983
|
+
|
|
16792
16984
|
|
|
16793
16985
|
let styles = [
|
|
16794
16986
|
"font-family",
|
|
@@ -17120,8 +17312,9 @@ class FormulaInput extends Widget {
|
|
|
17120
17312
|
return true;
|
|
17121
17313
|
}
|
|
17122
17314
|
if (key === keys.ENTER || key === keys.TAB) {
|
|
17123
|
-
|
|
17124
|
-
|
|
17315
|
+
let focusIndex = typeof list.focusIndex === "function" ? list.focusIndex() : list.focus();
|
|
17316
|
+
if (list.data()[focusIndex]) {
|
|
17317
|
+
this._formulaListChange(list.data()[focusIndex].value);
|
|
17125
17318
|
}
|
|
17126
17319
|
|
|
17127
17320
|
popup.close();
|
|
@@ -17649,6 +17842,13 @@ class SheetsBar extends Widget {
|
|
|
17649
17842
|
}
|
|
17650
17843
|
|
|
17651
17844
|
/* eslint-disable complexity */
|
|
17845
|
+
/* eslint-disable consistent-return */
|
|
17846
|
+
/* eslint-disable default-case */
|
|
17847
|
+
/* eslint-disable no-implicit-coercion */
|
|
17848
|
+
/* eslint-disable no-nested-ternary */
|
|
17849
|
+
/* eslint-disable key-spacing */
|
|
17850
|
+
/* eslint-disable no-param-reassign */
|
|
17851
|
+
|
|
17652
17852
|
|
|
17653
17853
|
function selectElementContents(el) {
|
|
17654
17854
|
let sel = window.getSelection();
|
|
@@ -17752,7 +17952,7 @@ function addCell(table, row, cell) {
|
|
|
17752
17952
|
break;
|
|
17753
17953
|
case "boolean":
|
|
17754
17954
|
style.textAlign = "center";
|
|
17755
|
-
|
|
17955
|
+
break;
|
|
17756
17956
|
}
|
|
17757
17957
|
}
|
|
17758
17958
|
|
|
@@ -17843,7 +18043,7 @@ class HtmlTable {
|
|
|
17843
18043
|
text = dom.text(text);
|
|
17844
18044
|
}
|
|
17845
18045
|
|
|
17846
|
-
let children = [
|
|
18046
|
+
let children = [text];
|
|
17847
18047
|
|
|
17848
18048
|
if (validation && !validation.value) {
|
|
17849
18049
|
children.push(dom.element("span", { className: "k-dirty" }));
|
|
@@ -17862,14 +18062,14 @@ class HtmlTable {
|
|
|
17862
18062
|
}
|
|
17863
18063
|
|
|
17864
18064
|
toDomTree(x, y, className) {
|
|
17865
|
-
this.trs = this.trs.filter(function(tr) {
|
|
18065
|
+
this.trs = this.trs.filter(function (tr) {
|
|
17866
18066
|
return tr.visible;
|
|
17867
18067
|
});
|
|
17868
18068
|
|
|
17869
18069
|
let offset = 0;
|
|
17870
|
-
this.cols = this.cols.filter(function(col, ci) {
|
|
18070
|
+
this.cols = this.cols.filter(function (col, ci) {
|
|
17871
18071
|
if (!col.visible) {
|
|
17872
|
-
this.trs.forEach(function(tr) {
|
|
18072
|
+
this.trs.forEach(function (tr) {
|
|
17873
18073
|
tr.children.splice(ci - offset, 1);
|
|
17874
18074
|
});
|
|
17875
18075
|
offset++;
|
|
@@ -17882,7 +18082,7 @@ class HtmlTable {
|
|
|
17882
18082
|
style: { left: x + "px", top: y + "px", height: this._height + "px", width: this._width + "px" },
|
|
17883
18083
|
className: className,
|
|
17884
18084
|
role: "presentation"
|
|
17885
|
-
},[
|
|
18085
|
+
}, [
|
|
17886
18086
|
dom.element("colgroup", null, this.cols),
|
|
17887
18087
|
dom.element("tbody", null, this.trs)
|
|
17888
18088
|
]);
|
|
@@ -17937,6 +18137,8 @@ class View extends Observable {
|
|
|
17937
18137
|
this.editor = new SheetEditor(this);
|
|
17938
18138
|
|
|
17939
18139
|
this._sheetsbar();
|
|
18140
|
+
|
|
18141
|
+
this.options.createContextMenus?.();
|
|
17940
18142
|
}
|
|
17941
18143
|
|
|
17942
18144
|
enableClipboard(enable) {
|
|
@@ -17980,7 +18182,7 @@ class View extends Observable {
|
|
|
17980
18182
|
this.formulaBar = new FormulaBar(formulaBar, { input: this.options.formulaBarInputRef });
|
|
17981
18183
|
|
|
17982
18184
|
// if (this.options.toolbar) {
|
|
17983
|
-
|
|
18185
|
+
this._tabstrip();
|
|
17984
18186
|
// }
|
|
17985
18187
|
}
|
|
17986
18188
|
|
|
@@ -17996,10 +18198,12 @@ class View extends Observable {
|
|
|
17996
18198
|
_sheetsbar() {
|
|
17997
18199
|
if (this.options.sheetsbar) {
|
|
17998
18200
|
this.sheetsbar = new SheetsBar(this.element.querySelector(DOT + View.classNames.sheetsBar), this.options.sheetsbar);
|
|
18201
|
+
this.options.createSheetBar?.(this.options.openDialogCallback);
|
|
17999
18202
|
}
|
|
18000
18203
|
}
|
|
18001
18204
|
|
|
18002
18205
|
_tabstrip() {
|
|
18206
|
+
this.tabstrip = this.options.createTabStrip?.();
|
|
18003
18207
|
// let messages = this.options.messages.tabs;
|
|
18004
18208
|
// let options = $.extend(true, { home: true, insert: true, data: true }, this.options.toolbar);
|
|
18005
18209
|
// let tabs = [];
|
|
@@ -18058,7 +18262,7 @@ class View extends Observable {
|
|
|
18058
18262
|
x += this.scroller.scrollLeft;
|
|
18059
18263
|
}
|
|
18060
18264
|
|
|
18061
|
-
col = this._sheet._grid._columns.locate(0, col, function(w) {
|
|
18265
|
+
col = this._sheet._grid._columns.locate(0, col, function (w) {
|
|
18062
18266
|
return Math.abs(x - w) <= RESIZE_HANDLE_WIDTH / 2;
|
|
18063
18267
|
});
|
|
18064
18268
|
|
|
@@ -18074,7 +18278,7 @@ class View extends Observable {
|
|
|
18074
18278
|
y += this.scroller.scrollTop;
|
|
18075
18279
|
}
|
|
18076
18280
|
|
|
18077
|
-
row = this._sheet._grid._rows.locate(0, row, function(h) {
|
|
18281
|
+
row = this._sheet._grid._rows.locate(0, row, function (h) {
|
|
18078
18282
|
return Math.abs(y - h) <= RESIZE_HANDLE_WIDTH / 2;
|
|
18079
18283
|
});
|
|
18080
18284
|
|
|
@@ -18090,8 +18294,8 @@ class View extends Observable {
|
|
|
18090
18294
|
x -= self._sheet._grid._headerWidth - scrollLeft;
|
|
18091
18295
|
y -= self._sheet._grid._headerHeight - scrollTop;
|
|
18092
18296
|
|
|
18093
|
-
return withExit(function(exit) {
|
|
18094
|
-
self._sheet.forEachFilterHeader(ref, function(ref) {
|
|
18297
|
+
return withExit(function (exit) {
|
|
18298
|
+
self._sheet.forEachFilterHeader(ref, function (ref) {
|
|
18095
18299
|
let rect = self._rectangle(pane, ref);
|
|
18096
18300
|
if (pane.filterIconRect(rect).intersects(x, y)) {
|
|
18097
18301
|
exit(true);
|
|
@@ -18241,7 +18445,7 @@ class View extends Observable {
|
|
|
18241
18445
|
}
|
|
18242
18446
|
|
|
18243
18447
|
containingPane(cell) {
|
|
18244
|
-
return this.panes.filter(function(pane) {
|
|
18448
|
+
return this.panes.filter(function (pane) {
|
|
18245
18449
|
if (pane._grid.contains(cell)) {
|
|
18246
18450
|
return true;
|
|
18247
18451
|
}
|
|
@@ -18266,7 +18470,7 @@ class View extends Observable {
|
|
|
18266
18470
|
// this.tabstrip.refreshTools(sheet.range(sheet.activeCell()));
|
|
18267
18471
|
// }
|
|
18268
18472
|
|
|
18269
|
-
this.trigger('update', { reason, range: sheet.range(sheet.activeCell()) });
|
|
18473
|
+
this.trigger('update', { reason, range: sheet.range(sheet.activeCell()), sheet });
|
|
18270
18474
|
|
|
18271
18475
|
// if (reason.sheetSelection && this.sheetsbar) {
|
|
18272
18476
|
// this.sheetsbar.renderSheets(this._workbook.sheets(), this._workbook.sheetIndex(this._sheet));
|
|
@@ -18283,7 +18487,7 @@ class View extends Observable {
|
|
|
18283
18487
|
let frozenRows = sheet.frozenRows();
|
|
18284
18488
|
|
|
18285
18489
|
// main or bottom or right pane
|
|
18286
|
-
this.panes = [
|
|
18490
|
+
this.panes = [this._pane(frozenRows, frozenColumns)];
|
|
18287
18491
|
|
|
18288
18492
|
// left pane
|
|
18289
18493
|
if (frozenColumns > 0) {
|
|
@@ -18310,19 +18514,18 @@ class View extends Observable {
|
|
|
18310
18514
|
}
|
|
18311
18515
|
}
|
|
18312
18516
|
|
|
18313
|
-
createFilterMenu(
|
|
18314
|
-
|
|
18517
|
+
createFilterMenu(column) {
|
|
18518
|
+
this._destroyFilterMenu();
|
|
18519
|
+
|
|
18520
|
+
let sheet = this._sheet;
|
|
18521
|
+
let ref = sheet.filter().ref;
|
|
18522
|
+
let range = new Range$1(ref, sheet);
|
|
18315
18523
|
|
|
18316
|
-
|
|
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);
|
|
18524
|
+
let options = { column: column, range: range };
|
|
18322
18525
|
|
|
18323
|
-
|
|
18526
|
+
this._filterMenu = this.options.createFilterMenu(options);
|
|
18324
18527
|
|
|
18325
|
-
|
|
18528
|
+
return this._filterMenu;
|
|
18326
18529
|
}
|
|
18327
18530
|
|
|
18328
18531
|
selectClipboardContents() {
|
|
@@ -18375,11 +18578,11 @@ class View extends Observable {
|
|
|
18375
18578
|
let editor = self._sheet.activeCellCustomEditor();
|
|
18376
18579
|
let range = self._sheet.range(cell);
|
|
18377
18580
|
editor.edit({
|
|
18378
|
-
range
|
|
18379
|
-
rect
|
|
18380
|
-
view
|
|
18381
|
-
validation
|
|
18382
|
-
callback
|
|
18581
|
+
range: range,
|
|
18582
|
+
rect: self.activeCellRectangle(),
|
|
18583
|
+
view: this,
|
|
18584
|
+
validation: this._sheet.validation(cell),
|
|
18585
|
+
callback: function (value, parse) {
|
|
18383
18586
|
self._executeCommand({
|
|
18384
18587
|
command: "EditCommand",
|
|
18385
18588
|
options: {
|
|
@@ -18395,10 +18598,12 @@ class View extends Observable {
|
|
|
18395
18598
|
|
|
18396
18599
|
openDialog(name, options) {
|
|
18397
18600
|
let sheet = this._sheet;
|
|
18398
|
-
return sheet.withCultureDecimals(function() {
|
|
18601
|
+
return sheet.withCultureDecimals(function () {
|
|
18399
18602
|
let ref = sheet.activeCell();
|
|
18400
18603
|
let range = new Range$1(ref, sheet);
|
|
18401
|
-
|
|
18604
|
+
let args = { ...options, name, ref, range };
|
|
18605
|
+
this.trigger('message', args);
|
|
18606
|
+
return args.dialog;
|
|
18402
18607
|
}.bind(this));
|
|
18403
18608
|
}
|
|
18404
18609
|
|
|
@@ -18410,7 +18615,7 @@ class View extends Observable {
|
|
|
18410
18615
|
return;
|
|
18411
18616
|
}
|
|
18412
18617
|
|
|
18413
|
-
let onClose = function() {
|
|
18618
|
+
let onClose = function () {
|
|
18414
18619
|
currentDialogs.pop();
|
|
18415
18620
|
// let dlg = e.sender;
|
|
18416
18621
|
this.selectClipboardContents();
|
|
@@ -18456,19 +18661,18 @@ class View extends Observable {
|
|
|
18456
18661
|
// this.colHeaderContextMenu =
|
|
18457
18662
|
// this.drawingContextMenu = null;
|
|
18458
18663
|
|
|
18459
|
-
|
|
18460
|
-
|
|
18461
|
-
|
|
18462
|
-
|
|
18664
|
+
if (this.tabstrip) {
|
|
18665
|
+
this.tabstrip.destroy();
|
|
18666
|
+
this.tabstrip = null;
|
|
18667
|
+
}
|
|
18463
18668
|
|
|
18464
|
-
|
|
18669
|
+
this._destroyFilterMenu();
|
|
18465
18670
|
}
|
|
18466
18671
|
|
|
18467
18672
|
_destroyFilterMenu() {
|
|
18468
18673
|
if (this._filterMenu) {
|
|
18469
18674
|
this._filterMenu.destroy();
|
|
18470
18675
|
this._filterMenu = undefined;
|
|
18471
|
-
this._filterMenuColumn = undefined;
|
|
18472
18676
|
}
|
|
18473
18677
|
}
|
|
18474
18678
|
|
|
@@ -18488,8 +18692,8 @@ class View extends Observable {
|
|
|
18488
18692
|
|
|
18489
18693
|
let resizeDirection =
|
|
18490
18694
|
!sheet.resizingInProgress() ? "none" :
|
|
18491
|
-
|
|
18492
|
-
|
|
18695
|
+
sheet.resizeHandlePosition().col === -Infinity ? "column" :
|
|
18696
|
+
"row";
|
|
18493
18697
|
|
|
18494
18698
|
this.wrapper.classList.toggle(viewClassNames.editContainer, this.editor.isActive());
|
|
18495
18699
|
this.wrapper.classList.toggle(viewClassNames.horizontalResize, resizeDirection === "row");
|
|
@@ -18503,7 +18707,7 @@ class View extends Observable {
|
|
|
18503
18707
|
contentWidth: contentWidth,
|
|
18504
18708
|
contentHeight: contentHeight
|
|
18505
18709
|
};
|
|
18506
|
-
this.panes.forEach(function(pane) {
|
|
18710
|
+
this.panes.forEach(function (pane) {
|
|
18507
18711
|
content.push(pane.render(args));
|
|
18508
18712
|
});
|
|
18509
18713
|
|
|
@@ -18530,11 +18734,11 @@ class View extends Observable {
|
|
|
18530
18734
|
if (this.editor.isActive()) {
|
|
18531
18735
|
this.editor.toggleTooltip(this.activeCellRectangle());
|
|
18532
18736
|
} else if (!(reason.resize ||
|
|
18533
|
-
|
|
18534
|
-
|
|
18535
|
-
|
|
18536
|
-
|
|
18537
|
-
|
|
18737
|
+
reason.comment ||
|
|
18738
|
+
sheet.selectionInProgress() ||
|
|
18739
|
+
sheet.resizingInProgress() ||
|
|
18740
|
+
sheet.draggingInProgress() ||
|
|
18741
|
+
sheet.isInEditMode())) {
|
|
18538
18742
|
this.renderClipboardContents();
|
|
18539
18743
|
}
|
|
18540
18744
|
}
|
|
@@ -18568,7 +18772,7 @@ class View extends Observable {
|
|
|
18568
18772
|
return dom.element("div", {
|
|
18569
18773
|
className: classNames.resizeHint + (!horizontal ? " " + classNames.resizeHintVertical : ""),
|
|
18570
18774
|
style: style
|
|
18571
|
-
},[
|
|
18775
|
+
}, [
|
|
18572
18776
|
dom.element("div", { className: classNames.resizeHintHandle }),
|
|
18573
18777
|
dom.element("div", { className: classNames.resizeHintMarker })
|
|
18574
18778
|
]);
|
|
@@ -18606,11 +18810,11 @@ class View extends Observable {
|
|
|
18606
18810
|
|
|
18607
18811
|
let selectionView = grid.rangeDimensions(selection);
|
|
18608
18812
|
|
|
18609
|
-
selectionView.rows.forEach(function(height) {
|
|
18813
|
+
selectionView.rows.forEach(function (height) {
|
|
18610
18814
|
table.addRow(height);
|
|
18611
18815
|
});
|
|
18612
18816
|
|
|
18613
|
-
selectionView.columns.forEach(function(width) {
|
|
18817
|
+
selectionView.columns.forEach(function (width) {
|
|
18614
18818
|
table.addColumn(width);
|
|
18615
18819
|
});
|
|
18616
18820
|
|
|
@@ -18618,7 +18822,7 @@ class View extends Observable {
|
|
|
18618
18822
|
let primaryMergedCells = tmp.primary;
|
|
18619
18823
|
let secondaryMergedCells = tmp.secondary;
|
|
18620
18824
|
|
|
18621
|
-
sheet.forEach(selection, function(row, col, cell) {
|
|
18825
|
+
sheet.forEach(selection, function (row, col, cell) {
|
|
18622
18826
|
let location = new CellRef(row, col).print();
|
|
18623
18827
|
|
|
18624
18828
|
if (!secondaryMergedCells[location]) {
|
|
@@ -18633,13 +18837,13 @@ class View extends Observable {
|
|
|
18633
18837
|
}
|
|
18634
18838
|
});
|
|
18635
18839
|
|
|
18636
|
-
this.clipboardContents.render([
|
|
18840
|
+
this.clipboardContents.render([table.toDomTree(0, 0, "kendo-clipboard-" + this._workbook.clipboard()._uid)]);
|
|
18637
18841
|
|
|
18638
18842
|
this.selectClipboardContents();
|
|
18639
18843
|
}
|
|
18640
18844
|
|
|
18641
18845
|
_pane(row, column, rowCount, columnCount) {
|
|
18642
|
-
let pane = new Pane(this._sheet, this._sheet._grid.pane({ row: row, column: column, rowCount: rowCount, columnCount: columnCount }));
|
|
18846
|
+
let pane = new Pane(this._sheet, this._sheet._grid.pane({ row: row, column: column, rowCount: rowCount, columnCount: columnCount }), this.options.getIconHTMLString);
|
|
18643
18847
|
pane.refresh(this.scroller.clientWidth, this.scroller.clientHeight);
|
|
18644
18848
|
return pane;
|
|
18645
18849
|
}
|
|
@@ -19037,6 +19241,10 @@ function parseTSV(data) {
|
|
|
19037
19241
|
}
|
|
19038
19242
|
|
|
19039
19243
|
/* eslint-disable no-else-return */
|
|
19244
|
+
/* eslint-disable consistent-return */
|
|
19245
|
+
/* eslint-disable space-before-blocks */
|
|
19246
|
+
/* eslint-disable no-implicit-coercion */
|
|
19247
|
+
|
|
19040
19248
|
|
|
19041
19249
|
let COMMAND_TYPES = {
|
|
19042
19250
|
AUTO_FILL: "autoFill",
|
|
@@ -20852,6 +21060,13 @@ class Deferred {
|
|
|
20852
21060
|
}
|
|
20853
21061
|
|
|
20854
21062
|
/* eslint-disable complexity */
|
|
21063
|
+
/* eslint-disable camelcase */
|
|
21064
|
+
/* eslint-disable key-spacing */
|
|
21065
|
+
/* eslint-disable no-nested-ternary */
|
|
21066
|
+
/* eslint-disable brace-style */
|
|
21067
|
+
/* eslint-disable no-implicit-coercion */
|
|
21068
|
+
/* eslint-disable no-loop-func */
|
|
21069
|
+
/* eslint-disable no-param-reassign */
|
|
20855
21070
|
|
|
20856
21071
|
// WARNING: removing the following jshint declaration and turning
|
|
20857
21072
|
// == into === to make JSHint happy will break functionality.
|
|
@@ -22221,6 +22436,11 @@ function excelToPixels(val) {
|
|
|
22221
22436
|
}
|
|
22222
22437
|
|
|
22223
22438
|
/* eslint-disable no-undef */
|
|
22439
|
+
/* eslint-disable no-nested-ternary */
|
|
22440
|
+
/* eslint-disable key-spacing */
|
|
22441
|
+
/* eslint-disable consistent-return */
|
|
22442
|
+
/* eslint-disable no-param-reassign */
|
|
22443
|
+
|
|
22224
22444
|
|
|
22225
22445
|
const events$1 = [
|
|
22226
22446
|
"cut",
|
|
@@ -22439,7 +22659,13 @@ class Workbook extends Observable {
|
|
|
22439
22659
|
|
|
22440
22660
|
execute(options) {
|
|
22441
22661
|
let commandOptions = Object.assign({}, { workbook: this }, options.options);
|
|
22442
|
-
let command
|
|
22662
|
+
let command;
|
|
22663
|
+
|
|
22664
|
+
if (this.options.getWorkbookCommand) {
|
|
22665
|
+
command = this.options.getWorkbookCommand(options.command, commandOptions);
|
|
22666
|
+
}
|
|
22667
|
+
|
|
22668
|
+
command = command || new commands[options.command](commandOptions);
|
|
22443
22669
|
let sheet = this.activeSheet();
|
|
22444
22670
|
|
|
22445
22671
|
if (commandOptions.origin) {
|
|
@@ -22558,7 +22784,8 @@ class Workbook extends Observable {
|
|
|
22558
22784
|
options.columnWidth || this.options.columnWidth,
|
|
22559
22785
|
options.headerHeight || this.options.headerHeight,
|
|
22560
22786
|
options.headerWidth || this.options.headerWidth,
|
|
22561
|
-
options.defaultCellStyle || this.options.defaultCellStyle
|
|
22787
|
+
options.defaultCellStyle || this.options.defaultCellStyle,
|
|
22788
|
+
options.createSheetDataSource || this.options.createSheetDataSource
|
|
22562
22789
|
);
|
|
22563
22790
|
|
|
22564
22791
|
sheet._workbook = this;
|
|
@@ -23237,7 +23464,10 @@ const events = [
|
|
|
23237
23464
|
"select",
|
|
23238
23465
|
"changeFormat",
|
|
23239
23466
|
"dataBinding",
|
|
23240
|
-
"dataBound"
|
|
23467
|
+
"dataBound",
|
|
23468
|
+
"update",
|
|
23469
|
+
"message",
|
|
23470
|
+
"contextmenu",
|
|
23241
23471
|
];
|
|
23242
23472
|
|
|
23243
23473
|
class SpreadsheetWidget extends Widget {
|
|
@@ -23255,7 +23485,13 @@ class SpreadsheetWidget extends Widget {
|
|
|
23255
23485
|
sheetsbar: this.options.sheetsbar,
|
|
23256
23486
|
formulaBarInputRef: this.options.formulaBarInputRef,
|
|
23257
23487
|
formulaCellInputRef: this.options.formulaCellInputRef,
|
|
23258
|
-
nameBoxRef: this.options.nameBoxRef
|
|
23488
|
+
nameBoxRef: this.options.nameBoxRef,
|
|
23489
|
+
createTabStrip: this.options.createTabStrip,
|
|
23490
|
+
createFilterMenu: this.options.createFilterMenu,
|
|
23491
|
+
createContextMenus: this.options.createContextMenus,
|
|
23492
|
+
createSheetBar: this.options.createSheetBar,
|
|
23493
|
+
getIconHTMLString: this.options.getIconHTMLString,
|
|
23494
|
+
openDialogCallback: this.openDialog.bind(this),
|
|
23259
23495
|
});
|
|
23260
23496
|
|
|
23261
23497
|
this._workbook = new Workbook(this.options, this._view);
|
|
@@ -23265,6 +23501,7 @@ class SpreadsheetWidget extends Widget {
|
|
|
23265
23501
|
this._autoRefresh = true;
|
|
23266
23502
|
|
|
23267
23503
|
this._bindWorkbookEvents();
|
|
23504
|
+
this._bindViewEvents();
|
|
23268
23505
|
|
|
23269
23506
|
this._view.workbook(this._workbook);
|
|
23270
23507
|
|
|
@@ -23294,35 +23531,29 @@ class SpreadsheetWidget extends Widget {
|
|
|
23294
23531
|
this.trigger("keydown", e);
|
|
23295
23532
|
|
|
23296
23533
|
if (key === keys.F11 && e.shiftKey) {
|
|
23297
|
-
this._view.sheetsbar.
|
|
23534
|
+
this._view.sheetsbar.onAddSelect();
|
|
23298
23535
|
e.preventDefault();
|
|
23299
23536
|
return;
|
|
23300
23537
|
} else if (e.altKey && key === keys.PAGEDOWN) {
|
|
23301
|
-
this.
|
|
23302
|
-
|
|
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;
|
|
23538
|
+
let activeSheetIndex = this.sheetIndex(this.activeSheet());
|
|
23539
|
+
let nextSheetName = this.sheetByIndex(activeSheetIndex + 1)?.name();
|
|
23313
23540
|
|
|
23314
|
-
|
|
23315
|
-
|
|
23316
|
-
|
|
23317
|
-
|
|
23541
|
+
if (nextSheetName){
|
|
23542
|
+
this._view.sheetsbar.onSheetSelect(nextSheetName);
|
|
23543
|
+
}
|
|
23544
|
+
} else if (e.altKey && key === keys.PAGEUP) {
|
|
23545
|
+
let activeSheetIndex = this.sheetIndex(this.activeSheet());
|
|
23546
|
+
let prevSheetName = this.sheetByIndex(activeSheetIndex - 1)?.name();
|
|
23318
23547
|
|
|
23319
|
-
|
|
23320
|
-
|
|
23321
|
-
}
|
|
23548
|
+
if (prevSheetName) {
|
|
23549
|
+
this._view.sheetsbar.onSheetSelect(prevSheetName);
|
|
23550
|
+
}
|
|
23551
|
+
} else if (e.altKey && key === keys.DELETE) {
|
|
23552
|
+
this._view.sheetsbar.onSheetRemove(this.activeSheet()._name());
|
|
23322
23553
|
e.preventDefault();
|
|
23323
23554
|
return;
|
|
23324
23555
|
} else if (e.altKey && key === keys.R) {
|
|
23325
|
-
this.
|
|
23556
|
+
this.options.createSheetEditor?.();
|
|
23326
23557
|
e.preventDefault();
|
|
23327
23558
|
return;
|
|
23328
23559
|
} else if (controlKey && key === keys.B) {
|
|
@@ -23332,17 +23563,20 @@ class SpreadsheetWidget extends Widget {
|
|
|
23332
23563
|
} else if (controlKey && key === keys.U) {
|
|
23333
23564
|
this._handleTypographicalEmphasis('underline');
|
|
23334
23565
|
} else if (e.altKey && key === keys.H) {
|
|
23335
|
-
this._view.tabstrip
|
|
23566
|
+
this._view.tabstrip?.select(0);
|
|
23336
23567
|
e.preventDefault();
|
|
23337
23568
|
return;
|
|
23338
23569
|
} else if (e.altKey && key === keys.N) {
|
|
23339
|
-
this._view.tabstrip
|
|
23570
|
+
this._view.tabstrip?.select(1);
|
|
23340
23571
|
e.preventDefault();
|
|
23341
23572
|
return;
|
|
23342
23573
|
} else if (e.altKey && key === keys.A) {
|
|
23343
|
-
this._view.tabstrip
|
|
23574
|
+
this._view.tabstrip?.select(2);
|
|
23344
23575
|
e.preventDefault();
|
|
23345
23576
|
return;
|
|
23577
|
+
} else if (key === keys.F10) {
|
|
23578
|
+
e.preventDefault();
|
|
23579
|
+
this._view.tabstrip?.wrapper?.find(".k-tabstrip-content.k-active .k-toolbar [tabindex=0]").trigger("focus");
|
|
23346
23580
|
}
|
|
23347
23581
|
}
|
|
23348
23582
|
|
|
@@ -23653,6 +23887,14 @@ class SpreadsheetWidget extends Widget {
|
|
|
23653
23887
|
// kendo.ui.progress(this.element, e.toggle);
|
|
23654
23888
|
}
|
|
23655
23889
|
|
|
23890
|
+
_viewUpdate(e) {
|
|
23891
|
+
this.trigger("update", e);
|
|
23892
|
+
}
|
|
23893
|
+
|
|
23894
|
+
_viewMessage(e) {
|
|
23895
|
+
this.trigger("message", e);
|
|
23896
|
+
}
|
|
23897
|
+
|
|
23656
23898
|
_onContextMenu(e) {
|
|
23657
23899
|
this.trigger("contextmenu", e);
|
|
23658
23900
|
}
|
|
@@ -23686,6 +23928,11 @@ class SpreadsheetWidget extends Widget {
|
|
|
23686
23928
|
this._workbook.bind("contextmenu", this._onContextMenu.bind(this));
|
|
23687
23929
|
}
|
|
23688
23930
|
|
|
23931
|
+
_bindViewEvents() {
|
|
23932
|
+
this._view.bind("update", this._viewUpdate.bind(this));
|
|
23933
|
+
this._view.bind("message", this._viewMessage.bind(this));
|
|
23934
|
+
}
|
|
23935
|
+
|
|
23689
23936
|
destroy() {
|
|
23690
23937
|
window.removeEventListener('resize', this._resizeHandler);
|
|
23691
23938
|
this.element.removeEventListener("keydown", this._keyDownHandler);
|
|
@@ -23736,6 +23983,7 @@ class SpreadsheetWidget extends Widget {
|
|
|
23736
23983
|
|
|
23737
23984
|
/* -----[ Excel operators ]----- */
|
|
23738
23985
|
|
|
23986
|
+
|
|
23739
23987
|
const {
|
|
23740
23988
|
FUNCS,
|
|
23741
23989
|
defineBuiltinFunction,
|
|
@@ -43883,4 +44131,4 @@ const {
|
|
|
43883
44131
|
defineAlias
|
|
43884
44132
|
} = calc.runtime;
|
|
43885
44133
|
|
|
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 };
|
|
44134
|
+
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 };
|