@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.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 (
|
|
1229
|
-
|
|
1230
|
-
} else {
|
|
1231
|
-
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
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
|
}
|
|
@@ -1369,6 +1362,14 @@
|
|
|
1369
1362
|
const isString = (value) => typeof value === "string";
|
|
1370
1363
|
const isNumeric = (value) => !isNaN(value - parseFloat(value));
|
|
1371
1364
|
const isFunction = (fn) => typeof fn === "function";
|
|
1365
|
+
const isPlainObject = function(obj) {
|
|
1366
|
+
if (!obj || toString.call(obj) !== "[object Object]") {
|
|
1367
|
+
return false;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
const proto = Object.getPrototypeOf(obj);
|
|
1371
|
+
return proto === null || proto.constructor === Object;
|
|
1372
|
+
};
|
|
1372
1373
|
|
|
1373
1374
|
class CalcError {
|
|
1374
1375
|
|
|
@@ -1407,6 +1408,9 @@
|
|
|
1407
1408
|
}
|
|
1408
1409
|
|
|
1409
1410
|
/* eslint-disable max-params */
|
|
1411
|
+
/* eslint-disable complexity */
|
|
1412
|
+
/* eslint-disable no-unused-vars */
|
|
1413
|
+
|
|
1410
1414
|
|
|
1411
1415
|
let calc = {
|
|
1412
1416
|
runtime: {
|
|
@@ -2942,7 +2946,7 @@
|
|
|
2942
2946
|
}
|
|
2943
2947
|
Element.prototype = new Node();
|
|
2944
2948
|
Element.prototype.appendTo = function(parent) {
|
|
2945
|
-
let node = document.createElement(this.nodeName);
|
|
2949
|
+
let node = typeof(this.nodeName) === "string" ? document.createElement(this.nodeName) : this.nodeName;
|
|
2946
2950
|
let children = this.children;
|
|
2947
2951
|
for (let index = 0; index < children.length; index++) {
|
|
2948
2952
|
children[index].render(node, NULL_NODE);
|
|
@@ -3163,6 +3167,7 @@
|
|
|
3163
3167
|
|
|
3164
3168
|
//--------------------------------------------------- custom number format.
|
|
3165
3169
|
|
|
3170
|
+
|
|
3166
3171
|
let RX_COLORS = /^\[(black|green|white|blue|magenta|yellow|cyan|red)\]/i;
|
|
3167
3172
|
let RX_CONDITION = /^\[(<=|>=|<>|<|>|=)(-?[0-9.]+)\]/;
|
|
3168
3173
|
|
|
@@ -4128,6 +4133,28 @@
|
|
|
4128
4133
|
};
|
|
4129
4134
|
|
|
4130
4135
|
/* eslint-disable no-nested-ternary */
|
|
4136
|
+
/* eslint-disable space-infix-ops */
|
|
4137
|
+
/* eslint-disable indent */
|
|
4138
|
+
/* eslint-disable no-empty */
|
|
4139
|
+
/* eslint-disable no-loop-func */
|
|
4140
|
+
/* eslint-disable consistent-return */
|
|
4141
|
+
/* eslint-disable block-scoped-var */
|
|
4142
|
+
/* eslint-disable no-redeclare */
|
|
4143
|
+
/* eslint-disable no-var */
|
|
4144
|
+
/* eslint-disable eqeqeq */
|
|
4145
|
+
/* eslint-disable complexity */
|
|
4146
|
+
/* eslint-disable max-params */
|
|
4147
|
+
/* eslint-disable no-implicit-coercion */
|
|
4148
|
+
/* eslint-disable key-spacing */
|
|
4149
|
+
/* eslint-disable default-case */
|
|
4150
|
+
/* eslint-disable camelcase */
|
|
4151
|
+
/* eslint-disable brace-style */
|
|
4152
|
+
/* eslint-disable no-else-return */
|
|
4153
|
+
/* eslint-disable no-constant-condition */
|
|
4154
|
+
/* eslint-disable no-param-reassign */
|
|
4155
|
+
/* eslint-disable space-before-blocks */
|
|
4156
|
+
/* eslint-disable no-unused-labels */
|
|
4157
|
+
|
|
4131
4158
|
|
|
4132
4159
|
const kendo = createKendoObj(calc, CalcError, Ref, CellRef, RangeRef);
|
|
4133
4160
|
calc.kendo = kendo; // XXX
|
|
@@ -5933,6 +5960,12 @@
|
|
|
5933
5960
|
}
|
|
5934
5961
|
|
|
5935
5962
|
/* eslint-disable default-case */
|
|
5963
|
+
/* eslint-disable no-else-return */
|
|
5964
|
+
/* eslint-disable key-spacing */
|
|
5965
|
+
/* eslint-disable eqeqeq */
|
|
5966
|
+
/* eslint-disable brace-style */
|
|
5967
|
+
/* eslint-disable consistent-return */
|
|
5968
|
+
|
|
5936
5969
|
|
|
5937
5970
|
let alphaNumRegExp = /:alphanum$/;
|
|
5938
5971
|
|
|
@@ -6558,6 +6591,7 @@
|
|
|
6558
6591
|
this._workbook.trigger("contextmenu", {
|
|
6559
6592
|
objectRef: object.ref,
|
|
6560
6593
|
targetType: object.type,
|
|
6594
|
+
isComposite,
|
|
6561
6595
|
showUnhide,
|
|
6562
6596
|
showUnmerge,
|
|
6563
6597
|
originalEvent: event
|
|
@@ -7072,7 +7106,7 @@
|
|
|
7072
7106
|
this.clipboardElement.focus();
|
|
7073
7107
|
this.navigator.navigateInSelection(ENTRY_ACTIONS[action]);
|
|
7074
7108
|
}
|
|
7075
|
-
|
|
7109
|
+
|
|
7076
7110
|
if (action === 'tab') {
|
|
7077
7111
|
e.preventDefault();
|
|
7078
7112
|
}
|
|
@@ -7775,6 +7809,9 @@
|
|
|
7775
7809
|
}
|
|
7776
7810
|
|
|
7777
7811
|
/* eslint-disable default-case */
|
|
7812
|
+
/* eslint-disable camelcase */
|
|
7813
|
+
/* eslint-disable no-param-reassign */
|
|
7814
|
+
|
|
7778
7815
|
|
|
7779
7816
|
class Property {
|
|
7780
7817
|
constructor(list) {
|
|
@@ -8098,6 +8135,10 @@
|
|
|
8098
8135
|
}, [ "borderTop", "borderRight", "borderBottom", "borderLeft" ]);
|
|
8099
8136
|
|
|
8100
8137
|
/* eslint-disable no-param-reassign */
|
|
8138
|
+
/* eslint-disable no-useless-call */
|
|
8139
|
+
/* eslint-disable camelcase */
|
|
8140
|
+
/* eslint-disable default-case */
|
|
8141
|
+
|
|
8101
8142
|
|
|
8102
8143
|
let TRANSPOSE_FORMAT = "_matrix({0})";
|
|
8103
8144
|
let DATE_FORMAT = 'DATEVALUE("{0}")';
|
|
@@ -8429,6 +8470,28 @@
|
|
|
8429
8470
|
validationExport.Validation = Validation;
|
|
8430
8471
|
|
|
8431
8472
|
/* eslint-disable no-nested-ternary */
|
|
8473
|
+
/* eslint-disable curly */
|
|
8474
|
+
/* eslint-disable space-infix-ops */
|
|
8475
|
+
/* eslint-disable indent */
|
|
8476
|
+
/* eslint-disable no-empty */
|
|
8477
|
+
/* eslint-disable no-loop-func */
|
|
8478
|
+
/* eslint-disable consistent-return */
|
|
8479
|
+
/* eslint-disable block-scoped-var */
|
|
8480
|
+
/* eslint-disable no-redeclare */
|
|
8481
|
+
/* eslint-disable no-var */
|
|
8482
|
+
/* eslint-disable eqeqeq */
|
|
8483
|
+
/* eslint-disable complexity */
|
|
8484
|
+
/* eslint-disable max-params */
|
|
8485
|
+
/* eslint-disable no-implicit-coercion */
|
|
8486
|
+
/* eslint-disable key-spacing */
|
|
8487
|
+
/* eslint-disable default-case */
|
|
8488
|
+
/* eslint-disable camelcase */
|
|
8489
|
+
/* eslint-disable brace-style */
|
|
8490
|
+
/* eslint-disable no-else-return */
|
|
8491
|
+
/* eslint-disable no-constant-condition */
|
|
8492
|
+
/* eslint-disable no-param-reassign */
|
|
8493
|
+
/* eslint-disable space-before-blocks */
|
|
8494
|
+
|
|
8432
8495
|
const { measureText } = kendoDrawing.drawing.util;
|
|
8433
8496
|
|
|
8434
8497
|
let PROPERTIES = [
|
|
@@ -10488,6 +10551,7 @@
|
|
|
10488
10551
|
}
|
|
10489
10552
|
|
|
10490
10553
|
/* eslint-disable no-param-reassign */
|
|
10554
|
+
/* eslint-disable camelcase */
|
|
10491
10555
|
|
|
10492
10556
|
class Rectangle {
|
|
10493
10557
|
constructor(left, top, width, height) {
|
|
@@ -10875,6 +10939,9 @@
|
|
|
10875
10939
|
};
|
|
10876
10940
|
|
|
10877
10941
|
/* eslint-disable no-constant-condition */
|
|
10942
|
+
/* eslint-disable key-spacing */
|
|
10943
|
+
/* eslint-disable no-param-reassign */
|
|
10944
|
+
|
|
10878
10945
|
|
|
10879
10946
|
class AxisManager {
|
|
10880
10947
|
constructor(sheet) {
|
|
@@ -11185,6 +11252,21 @@
|
|
|
11185
11252
|
}
|
|
11186
11253
|
|
|
11187
11254
|
/* eslint-disable max-params */
|
|
11255
|
+
/* eslint-disable no-empty */
|
|
11256
|
+
/* eslint-disable no-loop-func */
|
|
11257
|
+
/* eslint-disable consistent-return */
|
|
11258
|
+
/* eslint-disable block-scoped-var */
|
|
11259
|
+
/* eslint-disable no-redeclare */
|
|
11260
|
+
/* eslint-disable no-var */
|
|
11261
|
+
/* eslint-disable eqeqeq */
|
|
11262
|
+
/* eslint-disable complexity */
|
|
11263
|
+
/* eslint-disable no-implicit-coercion */
|
|
11264
|
+
/* eslint-disable brace-style */
|
|
11265
|
+
/* eslint-disable key-spacing */
|
|
11266
|
+
/* eslint-disable no-else-return */
|
|
11267
|
+
/* eslint-disable default-case */
|
|
11268
|
+
/* eslint-disable no-param-reassign */
|
|
11269
|
+
|
|
11188
11270
|
|
|
11189
11271
|
class EdgeNavigator {
|
|
11190
11272
|
constructor(field, axis, rangeGetter, union) {
|
|
@@ -11859,16 +11941,41 @@
|
|
|
11859
11941
|
}
|
|
11860
11942
|
|
|
11861
11943
|
/* eslint-disable max-params */
|
|
11944
|
+
/* eslint-disable no-empty */
|
|
11945
|
+
/* eslint-disable no-loop-func */
|
|
11946
|
+
/* eslint-disable consistent-return */
|
|
11947
|
+
/* eslint-disable block-scoped-var */
|
|
11948
|
+
/* eslint-disable no-redeclare */
|
|
11949
|
+
/* eslint-disable no-var */
|
|
11950
|
+
/* eslint-disable eqeqeq */
|
|
11951
|
+
/* eslint-disable complexity */
|
|
11952
|
+
/* eslint-disable no-implicit-coercion */
|
|
11953
|
+
/* eslint-disable brace-style */
|
|
11954
|
+
/* eslint-disable key-spacing */
|
|
11955
|
+
/* eslint-disable no-else-return */
|
|
11956
|
+
/* eslint-disable default-case */
|
|
11957
|
+
/* eslint-disable no-param-reassign */
|
|
11958
|
+
|
|
11862
11959
|
|
|
11863
11960
|
function numberToDate(val) {
|
|
11864
11961
|
return val == null ? null : calc.runtime.serialToDate(val);
|
|
11865
11962
|
}
|
|
11866
11963
|
|
|
11867
|
-
|
|
11964
|
+
function dateToNumber(val) {
|
|
11965
|
+
return val == null ? null : calc.runtime.dateToSerial(val);
|
|
11966
|
+
}
|
|
11967
|
+
|
|
11968
|
+
var identity = function (o) { return o; };
|
|
11868
11969
|
|
|
11869
11970
|
class SheetDataSourceBinder {
|
|
11870
11971
|
constructor(options) {
|
|
11871
|
-
this.options = Object.assign({ columns: [] }, this.options,
|
|
11972
|
+
this.options = Object.assign({ columns: [] }, this.options,
|
|
11973
|
+
// skip undefined properties in options
|
|
11974
|
+
Object.keys(options).reduce((acc, key) => {
|
|
11975
|
+
if (options[key] !== undefined) acc[key] = options[key];
|
|
11976
|
+
return acc;
|
|
11977
|
+
}, {})
|
|
11978
|
+
);
|
|
11872
11979
|
|
|
11873
11980
|
this.columns = this._normalizeColumns(this.options.columns);
|
|
11874
11981
|
|
|
@@ -11912,9 +12019,9 @@
|
|
|
11912
12019
|
}
|
|
11913
12020
|
|
|
11914
12021
|
_header() {
|
|
11915
|
-
this.sheet.batch(function() {
|
|
11916
|
-
this.columns.forEach(function(column, index) {
|
|
11917
|
-
this.sheet.range(0,index).value(column.title);
|
|
12022
|
+
this.sheet.batch(function () {
|
|
12023
|
+
this.columns.forEach(function (column, index) {
|
|
12024
|
+
this.sheet.range(0, index).value(column.title);
|
|
11918
12025
|
}.bind(this));
|
|
11919
12026
|
}.bind(this));
|
|
11920
12027
|
}
|
|
@@ -11932,7 +12039,7 @@
|
|
|
11932
12039
|
var values = [];
|
|
11933
12040
|
var sheet = this.sheet;
|
|
11934
12041
|
var fields, getters, normalizedRef, i, rangeRef, normalizedRefs;
|
|
11935
|
-
var setValues = function(ref) {
|
|
12042
|
+
var setValues = function (ref) {
|
|
11936
12043
|
ref = ref.toRangeRef();
|
|
11937
12044
|
var record;
|
|
11938
12045
|
var valueIndex = 0;
|
|
@@ -11961,7 +12068,7 @@
|
|
|
11961
12068
|
columns = Object.keys(data[0].toJSON());
|
|
11962
12069
|
}
|
|
11963
12070
|
|
|
11964
|
-
getters = columns.map(function(column) {
|
|
12071
|
+
getters = columns.map(function (column) {
|
|
11965
12072
|
var field = column.field;
|
|
11966
12073
|
if (field && fields && fields[field] && fields[field].type === "date") {
|
|
11967
12074
|
return numberToDate;
|
|
@@ -11978,7 +12085,7 @@
|
|
|
11978
12085
|
|
|
11979
12086
|
normalizedRefs = normalizedRef.refs;
|
|
11980
12087
|
|
|
11981
|
-
normalizedRefs.forEach(function(ref) {
|
|
12088
|
+
normalizedRefs.forEach(function (ref) {
|
|
11982
12089
|
values.push(sheet.range(ref).values());
|
|
11983
12090
|
});
|
|
11984
12091
|
|
|
@@ -11994,7 +12101,7 @@
|
|
|
11994
12101
|
}
|
|
11995
12102
|
|
|
11996
12103
|
_normalizeColumns(columns) {
|
|
11997
|
-
return columns.map(function(column) {
|
|
12104
|
+
return columns.map(function (column) {
|
|
11998
12105
|
var field = column.field || column;
|
|
11999
12106
|
return {
|
|
12000
12107
|
field: field,
|
|
@@ -12006,23 +12113,23 @@
|
|
|
12006
12113
|
_dataSource() {
|
|
12007
12114
|
var options = this.options;
|
|
12008
12115
|
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
12116
|
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
12117
|
+
dataSource = Array.isArray(dataSource) ? { data: dataSource } : dataSource;
|
|
12118
|
+
|
|
12119
|
+
if (this.dataSource && this._changeHandler) {
|
|
12120
|
+
this.dataSource.unbind("change", this._changeHandler)
|
|
12121
|
+
.unbind("progress", this._progressHandler)
|
|
12122
|
+
.unbind("error", this._errorHandler);
|
|
12123
|
+
} else {
|
|
12124
|
+
this._changeHandler = this._change.bind(this);
|
|
12125
|
+
this._progressHandler = this._requestStart.bind(this);
|
|
12126
|
+
this._errorHandler = this._error.bind(this);
|
|
12127
|
+
}
|
|
12128
|
+
|
|
12129
|
+
this.dataSource = this.options.sheet.createSheetDataSource?.(dataSource)
|
|
12130
|
+
.bind("change", this._changeHandler)
|
|
12131
|
+
.bind("progress", this._progressHandler)
|
|
12132
|
+
.bind("error", this._errorHandler);
|
|
12026
12133
|
}
|
|
12027
12134
|
|
|
12028
12135
|
_error() {
|
|
@@ -12056,11 +12163,11 @@
|
|
|
12056
12163
|
this._header();
|
|
12057
12164
|
}
|
|
12058
12165
|
|
|
12059
|
-
var getters = columns.map(function(column) {
|
|
12166
|
+
var getters = columns.map(function (column) {
|
|
12060
12167
|
return getter(column.field);
|
|
12061
12168
|
});
|
|
12062
12169
|
|
|
12063
|
-
this.sheet.batch(function() {
|
|
12170
|
+
this.sheet.batch(function () {
|
|
12064
12171
|
var length = Math.max(data.length, this._boundRowsCount, this.sheet._grid.rowCount - 1);
|
|
12065
12172
|
|
|
12066
12173
|
for (var idx = 0; idx < length; idx++) {
|
|
@@ -12110,6 +12217,10 @@
|
|
|
12110
12217
|
})();
|
|
12111
12218
|
|
|
12112
12219
|
/* eslint-disable no-var */
|
|
12220
|
+
/* eslint-disable no-implicit-coercion */
|
|
12221
|
+
/* eslint-disable no-param-reassign */
|
|
12222
|
+
/* eslint-disable no-loop-func */
|
|
12223
|
+
|
|
12113
12224
|
|
|
12114
12225
|
const logic = {
|
|
12115
12226
|
or: {
|
|
@@ -12239,6 +12350,21 @@
|
|
|
12239
12350
|
};
|
|
12240
12351
|
|
|
12241
12352
|
/* eslint-disable max-params */
|
|
12353
|
+
/* eslint-disable no-empty */
|
|
12354
|
+
/* eslint-disable no-loop-func */
|
|
12355
|
+
/* eslint-disable consistent-return */
|
|
12356
|
+
/* eslint-disable block-scoped-var */
|
|
12357
|
+
/* eslint-disable no-redeclare */
|
|
12358
|
+
/* eslint-disable no-var */
|
|
12359
|
+
/* eslint-disable eqeqeq */
|
|
12360
|
+
/* eslint-disable complexity */
|
|
12361
|
+
/* eslint-disable no-implicit-coercion */
|
|
12362
|
+
/* eslint-disable brace-style */
|
|
12363
|
+
/* eslint-disable key-spacing */
|
|
12364
|
+
/* eslint-disable no-else-return */
|
|
12365
|
+
/* eslint-disable default-case */
|
|
12366
|
+
/* eslint-disable no-param-reassign */
|
|
12367
|
+
|
|
12242
12368
|
|
|
12243
12369
|
let filtersObj = {};
|
|
12244
12370
|
const dateToSerial$1 = calc.runtime.dateToSerial;
|
|
@@ -12689,6 +12815,21 @@
|
|
|
12689
12815
|
}
|
|
12690
12816
|
|
|
12691
12817
|
/* eslint-disable max-params */
|
|
12818
|
+
/* eslint-disable no-empty */
|
|
12819
|
+
/* eslint-disable no-loop-func */
|
|
12820
|
+
/* eslint-disable consistent-return */
|
|
12821
|
+
/* eslint-disable block-scoped-var */
|
|
12822
|
+
/* eslint-disable no-redeclare */
|
|
12823
|
+
/* eslint-disable no-var */
|
|
12824
|
+
/* eslint-disable eqeqeq */
|
|
12825
|
+
/* eslint-disable complexity */
|
|
12826
|
+
/* eslint-disable no-implicit-coercion */
|
|
12827
|
+
/* eslint-disable brace-style */
|
|
12828
|
+
/* eslint-disable key-spacing */
|
|
12829
|
+
/* eslint-disable no-else-return */
|
|
12830
|
+
/* eslint-disable default-case */
|
|
12831
|
+
/* eslint-disable no-param-reassign */
|
|
12832
|
+
|
|
12692
12833
|
|
|
12693
12834
|
// This is a “dynamic variable” (see Greenspun's 10th rule). It's
|
|
12694
12835
|
// bound to an array via sheet._saveModifiedFormulas (which see)
|
|
@@ -12830,6 +12971,12 @@
|
|
|
12830
12971
|
}
|
|
12831
12972
|
}
|
|
12832
12973
|
|
|
12974
|
+
let EDITORS = {};
|
|
12975
|
+
|
|
12976
|
+
function registerEditor(name, editor) {
|
|
12977
|
+
EDITORS[name] = editor;
|
|
12978
|
+
}
|
|
12979
|
+
|
|
12833
12980
|
class Sheet extends Observable {
|
|
12834
12981
|
constructor() {
|
|
12835
12982
|
super();
|
|
@@ -12851,10 +12998,35 @@
|
|
|
12851
12998
|
"dataBound",
|
|
12852
12999
|
"progress"
|
|
12853
13000
|
];
|
|
13001
|
+
|
|
13002
|
+
this.createSheetDataSource = Array.from(arguments).pop();
|
|
13003
|
+
|
|
12854
13004
|
this._reinit.apply(this, arguments);
|
|
12855
13005
|
}
|
|
12856
13006
|
|
|
12857
|
-
activeCellCustomEditor() {
|
|
13007
|
+
activeCellCustomEditor() {
|
|
13008
|
+
let cell = this.activeCell().first();
|
|
13009
|
+
|
|
13010
|
+
if (this.range(cell).enable()) {
|
|
13011
|
+
let val = this.validation(cell);
|
|
13012
|
+
let key = this._properties.get("editor", this._grid.cellRefIndex(cell));
|
|
13013
|
+
let editor;
|
|
13014
|
+
|
|
13015
|
+
if (key != null) {
|
|
13016
|
+
editor = EDITORS[key];
|
|
13017
|
+
}
|
|
13018
|
+
else if (val && val.showButton) {
|
|
13019
|
+
key = "_validation_" + val.dataType;
|
|
13020
|
+
editor = EDITORS[key];
|
|
13021
|
+
}
|
|
13022
|
+
|
|
13023
|
+
if (typeof editor == "function") {
|
|
13024
|
+
editor = EDITORS[key] = editor();
|
|
13025
|
+
}
|
|
13026
|
+
|
|
13027
|
+
return editor;
|
|
13028
|
+
}
|
|
13029
|
+
}
|
|
12858
13030
|
|
|
12859
13031
|
_reinit(rowCount, columnCount, rowHeight, columnWidth, headerHeight, headerWidth, defaultCellStyle) {
|
|
12860
13032
|
defaultCellStyle = defaultCellStyle || {};
|
|
@@ -13056,7 +13228,8 @@
|
|
|
13056
13228
|
this.dataSourceBinder = new SheetDataSourceBinder({
|
|
13057
13229
|
dataSource: dataSource,
|
|
13058
13230
|
sheet: this,
|
|
13059
|
-
columns: columns
|
|
13231
|
+
columns: columns,
|
|
13232
|
+
createSheetDataSource: this.createSheetDataSource
|
|
13060
13233
|
});
|
|
13061
13234
|
|
|
13062
13235
|
this.dataSource = this.dataSourceBinder.dataSource;
|
|
@@ -14861,6 +15034,13 @@
|
|
|
14861
15034
|
}
|
|
14862
15035
|
|
|
14863
15036
|
/* eslint-disable no-nested-ternary */
|
|
15037
|
+
/* eslint-disable default-case */
|
|
15038
|
+
/* eslint-disable no-implicit-coercion */
|
|
15039
|
+
/* eslint-disable no-else-return */
|
|
15040
|
+
/* eslint-disable key-spacing */
|
|
15041
|
+
/* eslint-disable eqeqeq */
|
|
15042
|
+
/* eslint-disable no-param-reassign */
|
|
15043
|
+
|
|
14864
15044
|
|
|
14865
15045
|
let GUIDELINE_WIDTH = 0.8;
|
|
14866
15046
|
|
|
@@ -15502,7 +15682,7 @@
|
|
|
15502
15682
|
}
|
|
15503
15683
|
if (vtrans < 0) { vtrans = 0; }
|
|
15504
15684
|
|
|
15505
|
-
let textGroup = kendoDrawing.
|
|
15685
|
+
let textGroup = kendoDrawing.drawText(CONT);
|
|
15506
15686
|
textGroup.transform(kendoDrawing.geometry.Matrix.translate(cell.left, cell.top + vtrans));
|
|
15507
15687
|
group.append(textGroup);
|
|
15508
15688
|
}
|
|
@@ -15905,7 +16085,7 @@
|
|
|
15905
16085
|
horizontalResize: "k-horizontal-resize",
|
|
15906
16086
|
verticalResize: "k-vertical-resize",
|
|
15907
16087
|
icon: "k-icon",
|
|
15908
|
-
iconFilterDefault: "k-i-
|
|
16088
|
+
iconFilterDefault: "k-i-caret-alt-down",
|
|
15909
16089
|
sheetsBar: "k-spreadsheet-sheets-bar",
|
|
15910
16090
|
sheetsBarActive: "k-spreadsheet-sheets-bar-active",
|
|
15911
16091
|
sheetsBarInactive: "k-spreadsheet-sheets-bar-inactive",
|
|
@@ -15956,6 +16136,7 @@
|
|
|
15956
16136
|
|
|
15957
16137
|
/* eslint-disable complexity */
|
|
15958
16138
|
|
|
16139
|
+
|
|
15959
16140
|
function cellBorder(value) {
|
|
15960
16141
|
return (value.size || 1) + "px solid " + (value.color || "#000");
|
|
15961
16142
|
}
|
|
@@ -16167,9 +16348,10 @@
|
|
|
16167
16348
|
}
|
|
16168
16349
|
|
|
16169
16350
|
class Pane {
|
|
16170
|
-
constructor(sheet, grid) {
|
|
16351
|
+
constructor(sheet, grid, getIconHTMLString) {
|
|
16171
16352
|
this._sheet = sheet;
|
|
16172
16353
|
this._grid = grid;
|
|
16354
|
+
this.getIconHTMLString = getIconHTMLString;
|
|
16173
16355
|
}
|
|
16174
16356
|
|
|
16175
16357
|
refresh(width, height) {
|
|
@@ -16525,18 +16707,23 @@
|
|
|
16525
16707
|
);
|
|
16526
16708
|
}
|
|
16527
16709
|
|
|
16710
|
+
icon(className) {
|
|
16711
|
+
if (typeof this.getIconHTMLString === "function") {
|
|
16712
|
+
return dom.element(this.getIconHTMLString(className));
|
|
16713
|
+
}
|
|
16714
|
+
|
|
16715
|
+
return dom.element("span", {
|
|
16716
|
+
className: viewClassNames.icon + " " + className
|
|
16717
|
+
});
|
|
16718
|
+
}
|
|
16719
|
+
|
|
16528
16720
|
renderFilterHeaders() {
|
|
16721
|
+
let pane = this;
|
|
16529
16722
|
let sheet = this._sheet;
|
|
16530
16723
|
let children = [];
|
|
16531
16724
|
let classNames = viewClassNames;
|
|
16532
16725
|
let filter = sheet.filter();
|
|
16533
16726
|
|
|
16534
|
-
function icon(className) {
|
|
16535
|
-
return dom.element("span", {
|
|
16536
|
-
className: classNames.icon + " " + className
|
|
16537
|
-
});
|
|
16538
|
-
}
|
|
16539
|
-
|
|
16540
16727
|
function filterButton(classNames, position, index) {
|
|
16541
16728
|
let style = {
|
|
16542
16729
|
left: position.left + "px",
|
|
@@ -16554,7 +16741,7 @@
|
|
|
16554
16741
|
let button = dom.element(
|
|
16555
16742
|
"span",
|
|
16556
16743
|
{ className: classes, style: style },
|
|
16557
|
-
[ icon(classNames.iconFilterDefault) ]
|
|
16744
|
+
[ pane.icon(classNames.iconFilterDefault) ]
|
|
16558
16745
|
);
|
|
16559
16746
|
|
|
16560
16747
|
return button;
|
|
@@ -16711,11 +16898,11 @@
|
|
|
16711
16898
|
height : cell.height + "px"
|
|
16712
16899
|
}
|
|
16713
16900
|
});
|
|
16901
|
+
|
|
16714
16902
|
if (ed.icon) {
|
|
16715
|
-
btn.children.push(
|
|
16716
|
-
className: "k-icon " + ed.icon
|
|
16717
|
-
}));
|
|
16903
|
+
btn.children.push(self.icon(ed.icon));
|
|
16718
16904
|
}
|
|
16905
|
+
|
|
16719
16906
|
collection.push(btn);
|
|
16720
16907
|
});
|
|
16721
16908
|
}
|
|
@@ -16790,6 +16977,11 @@
|
|
|
16790
16977
|
}
|
|
16791
16978
|
|
|
16792
16979
|
/* eslint-disable no-unused-vars */
|
|
16980
|
+
/* eslint-disable no-param-reassign */
|
|
16981
|
+
/* eslint-disable no-else-return */
|
|
16982
|
+
/* eslint-disable no-multi-spaces */
|
|
16983
|
+
/* eslint-disable no-nested-ternary */
|
|
16984
|
+
|
|
16793
16985
|
|
|
16794
16986
|
let styles = [
|
|
16795
16987
|
"font-family",
|
|
@@ -17121,8 +17313,9 @@
|
|
|
17121
17313
|
return true;
|
|
17122
17314
|
}
|
|
17123
17315
|
if (key === keys.ENTER || key === keys.TAB) {
|
|
17124
|
-
|
|
17125
|
-
|
|
17316
|
+
let focusIndex = typeof list.focusIndex === "function" ? list.focusIndex() : list.focus();
|
|
17317
|
+
if (list.data()[focusIndex]) {
|
|
17318
|
+
this._formulaListChange(list.data()[focusIndex].value);
|
|
17126
17319
|
}
|
|
17127
17320
|
|
|
17128
17321
|
popup.close();
|
|
@@ -17650,6 +17843,13 @@
|
|
|
17650
17843
|
}
|
|
17651
17844
|
|
|
17652
17845
|
/* eslint-disable complexity */
|
|
17846
|
+
/* eslint-disable consistent-return */
|
|
17847
|
+
/* eslint-disable default-case */
|
|
17848
|
+
/* eslint-disable no-implicit-coercion */
|
|
17849
|
+
/* eslint-disable no-nested-ternary */
|
|
17850
|
+
/* eslint-disable key-spacing */
|
|
17851
|
+
/* eslint-disable no-param-reassign */
|
|
17852
|
+
|
|
17653
17853
|
|
|
17654
17854
|
function selectElementContents(el) {
|
|
17655
17855
|
let sel = window.getSelection();
|
|
@@ -17753,7 +17953,7 @@
|
|
|
17753
17953
|
break;
|
|
17754
17954
|
case "boolean":
|
|
17755
17955
|
style.textAlign = "center";
|
|
17756
|
-
|
|
17956
|
+
break;
|
|
17757
17957
|
}
|
|
17758
17958
|
}
|
|
17759
17959
|
|
|
@@ -17844,7 +18044,7 @@
|
|
|
17844
18044
|
text = dom.text(text);
|
|
17845
18045
|
}
|
|
17846
18046
|
|
|
17847
|
-
let children = [
|
|
18047
|
+
let children = [text];
|
|
17848
18048
|
|
|
17849
18049
|
if (validation && !validation.value) {
|
|
17850
18050
|
children.push(dom.element("span", { className: "k-dirty" }));
|
|
@@ -17863,14 +18063,14 @@
|
|
|
17863
18063
|
}
|
|
17864
18064
|
|
|
17865
18065
|
toDomTree(x, y, className) {
|
|
17866
|
-
this.trs = this.trs.filter(function(tr) {
|
|
18066
|
+
this.trs = this.trs.filter(function (tr) {
|
|
17867
18067
|
return tr.visible;
|
|
17868
18068
|
});
|
|
17869
18069
|
|
|
17870
18070
|
let offset = 0;
|
|
17871
|
-
this.cols = this.cols.filter(function(col, ci) {
|
|
18071
|
+
this.cols = this.cols.filter(function (col, ci) {
|
|
17872
18072
|
if (!col.visible) {
|
|
17873
|
-
this.trs.forEach(function(tr) {
|
|
18073
|
+
this.trs.forEach(function (tr) {
|
|
17874
18074
|
tr.children.splice(ci - offset, 1);
|
|
17875
18075
|
});
|
|
17876
18076
|
offset++;
|
|
@@ -17883,7 +18083,7 @@
|
|
|
17883
18083
|
style: { left: x + "px", top: y + "px", height: this._height + "px", width: this._width + "px" },
|
|
17884
18084
|
className: className,
|
|
17885
18085
|
role: "presentation"
|
|
17886
|
-
},[
|
|
18086
|
+
}, [
|
|
17887
18087
|
dom.element("colgroup", null, this.cols),
|
|
17888
18088
|
dom.element("tbody", null, this.trs)
|
|
17889
18089
|
]);
|
|
@@ -17938,6 +18138,8 @@
|
|
|
17938
18138
|
this.editor = new SheetEditor(this);
|
|
17939
18139
|
|
|
17940
18140
|
this._sheetsbar();
|
|
18141
|
+
|
|
18142
|
+
this.options.createContextMenus?.();
|
|
17941
18143
|
}
|
|
17942
18144
|
|
|
17943
18145
|
enableClipboard(enable) {
|
|
@@ -17981,7 +18183,7 @@
|
|
|
17981
18183
|
this.formulaBar = new FormulaBar(formulaBar, { input: this.options.formulaBarInputRef });
|
|
17982
18184
|
|
|
17983
18185
|
// if (this.options.toolbar) {
|
|
17984
|
-
|
|
18186
|
+
this._tabstrip();
|
|
17985
18187
|
// }
|
|
17986
18188
|
}
|
|
17987
18189
|
|
|
@@ -17997,10 +18199,12 @@
|
|
|
17997
18199
|
_sheetsbar() {
|
|
17998
18200
|
if (this.options.sheetsbar) {
|
|
17999
18201
|
this.sheetsbar = new SheetsBar(this.element.querySelector(DOT + View.classNames.sheetsBar), this.options.sheetsbar);
|
|
18202
|
+
this.options.createSheetBar?.(this.options.openDialogCallback);
|
|
18000
18203
|
}
|
|
18001
18204
|
}
|
|
18002
18205
|
|
|
18003
18206
|
_tabstrip() {
|
|
18207
|
+
this.tabstrip = this.options.createTabStrip?.();
|
|
18004
18208
|
// let messages = this.options.messages.tabs;
|
|
18005
18209
|
// let options = $.extend(true, { home: true, insert: true, data: true }, this.options.toolbar);
|
|
18006
18210
|
// let tabs = [];
|
|
@@ -18059,7 +18263,7 @@
|
|
|
18059
18263
|
x += this.scroller.scrollLeft;
|
|
18060
18264
|
}
|
|
18061
18265
|
|
|
18062
|
-
col = this._sheet._grid._columns.locate(0, col, function(w) {
|
|
18266
|
+
col = this._sheet._grid._columns.locate(0, col, function (w) {
|
|
18063
18267
|
return Math.abs(x - w) <= RESIZE_HANDLE_WIDTH / 2;
|
|
18064
18268
|
});
|
|
18065
18269
|
|
|
@@ -18075,7 +18279,7 @@
|
|
|
18075
18279
|
y += this.scroller.scrollTop;
|
|
18076
18280
|
}
|
|
18077
18281
|
|
|
18078
|
-
row = this._sheet._grid._rows.locate(0, row, function(h) {
|
|
18282
|
+
row = this._sheet._grid._rows.locate(0, row, function (h) {
|
|
18079
18283
|
return Math.abs(y - h) <= RESIZE_HANDLE_WIDTH / 2;
|
|
18080
18284
|
});
|
|
18081
18285
|
|
|
@@ -18091,8 +18295,8 @@
|
|
|
18091
18295
|
x -= self._sheet._grid._headerWidth - scrollLeft;
|
|
18092
18296
|
y -= self._sheet._grid._headerHeight - scrollTop;
|
|
18093
18297
|
|
|
18094
|
-
return withExit(function(exit) {
|
|
18095
|
-
self._sheet.forEachFilterHeader(ref, function(ref) {
|
|
18298
|
+
return withExit(function (exit) {
|
|
18299
|
+
self._sheet.forEachFilterHeader(ref, function (ref) {
|
|
18096
18300
|
let rect = self._rectangle(pane, ref);
|
|
18097
18301
|
if (pane.filterIconRect(rect).intersects(x, y)) {
|
|
18098
18302
|
exit(true);
|
|
@@ -18242,7 +18446,7 @@
|
|
|
18242
18446
|
}
|
|
18243
18447
|
|
|
18244
18448
|
containingPane(cell) {
|
|
18245
|
-
return this.panes.filter(function(pane) {
|
|
18449
|
+
return this.panes.filter(function (pane) {
|
|
18246
18450
|
if (pane._grid.contains(cell)) {
|
|
18247
18451
|
return true;
|
|
18248
18452
|
}
|
|
@@ -18267,7 +18471,7 @@
|
|
|
18267
18471
|
// this.tabstrip.refreshTools(sheet.range(sheet.activeCell()));
|
|
18268
18472
|
// }
|
|
18269
18473
|
|
|
18270
|
-
this.trigger('update', { reason, range: sheet.range(sheet.activeCell()) });
|
|
18474
|
+
this.trigger('update', { reason, range: sheet.range(sheet.activeCell()), sheet });
|
|
18271
18475
|
|
|
18272
18476
|
// if (reason.sheetSelection && this.sheetsbar) {
|
|
18273
18477
|
// this.sheetsbar.renderSheets(this._workbook.sheets(), this._workbook.sheetIndex(this._sheet));
|
|
@@ -18284,7 +18488,7 @@
|
|
|
18284
18488
|
let frozenRows = sheet.frozenRows();
|
|
18285
18489
|
|
|
18286
18490
|
// main or bottom or right pane
|
|
18287
|
-
this.panes = [
|
|
18491
|
+
this.panes = [this._pane(frozenRows, frozenColumns)];
|
|
18288
18492
|
|
|
18289
18493
|
// left pane
|
|
18290
18494
|
if (frozenColumns > 0) {
|
|
@@ -18311,19 +18515,18 @@
|
|
|
18311
18515
|
}
|
|
18312
18516
|
}
|
|
18313
18517
|
|
|
18314
|
-
createFilterMenu(
|
|
18315
|
-
|
|
18518
|
+
createFilterMenu(column) {
|
|
18519
|
+
this._destroyFilterMenu();
|
|
18520
|
+
|
|
18521
|
+
let sheet = this._sheet;
|
|
18522
|
+
let ref = sheet.filter().ref;
|
|
18523
|
+
let range = new Range$1(ref, sheet);
|
|
18316
18524
|
|
|
18317
|
-
|
|
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);
|
|
18525
|
+
let options = { column: column, range: range };
|
|
18323
18526
|
|
|
18324
|
-
|
|
18527
|
+
this._filterMenu = this.options.createFilterMenu(options);
|
|
18325
18528
|
|
|
18326
|
-
|
|
18529
|
+
return this._filterMenu;
|
|
18327
18530
|
}
|
|
18328
18531
|
|
|
18329
18532
|
selectClipboardContents() {
|
|
@@ -18376,11 +18579,11 @@
|
|
|
18376
18579
|
let editor = self._sheet.activeCellCustomEditor();
|
|
18377
18580
|
let range = self._sheet.range(cell);
|
|
18378
18581
|
editor.edit({
|
|
18379
|
-
range
|
|
18380
|
-
rect
|
|
18381
|
-
view
|
|
18382
|
-
validation
|
|
18383
|
-
callback
|
|
18582
|
+
range: range,
|
|
18583
|
+
rect: self.activeCellRectangle(),
|
|
18584
|
+
view: this,
|
|
18585
|
+
validation: this._sheet.validation(cell),
|
|
18586
|
+
callback: function (value, parse) {
|
|
18384
18587
|
self._executeCommand({
|
|
18385
18588
|
command: "EditCommand",
|
|
18386
18589
|
options: {
|
|
@@ -18396,10 +18599,12 @@
|
|
|
18396
18599
|
|
|
18397
18600
|
openDialog(name, options) {
|
|
18398
18601
|
let sheet = this._sheet;
|
|
18399
|
-
return sheet.withCultureDecimals(function() {
|
|
18602
|
+
return sheet.withCultureDecimals(function () {
|
|
18400
18603
|
let ref = sheet.activeCell();
|
|
18401
18604
|
let range = new Range$1(ref, sheet);
|
|
18402
|
-
|
|
18605
|
+
let args = { ...options, name, ref, range };
|
|
18606
|
+
this.trigger('message', args);
|
|
18607
|
+
return args.dialog;
|
|
18403
18608
|
}.bind(this));
|
|
18404
18609
|
}
|
|
18405
18610
|
|
|
@@ -18411,7 +18616,7 @@
|
|
|
18411
18616
|
return;
|
|
18412
18617
|
}
|
|
18413
18618
|
|
|
18414
|
-
let onClose = function() {
|
|
18619
|
+
let onClose = function () {
|
|
18415
18620
|
currentDialogs.pop();
|
|
18416
18621
|
// let dlg = e.sender;
|
|
18417
18622
|
this.selectClipboardContents();
|
|
@@ -18457,19 +18662,18 @@
|
|
|
18457
18662
|
// this.colHeaderContextMenu =
|
|
18458
18663
|
// this.drawingContextMenu = null;
|
|
18459
18664
|
|
|
18460
|
-
|
|
18461
|
-
|
|
18462
|
-
|
|
18463
|
-
|
|
18665
|
+
if (this.tabstrip) {
|
|
18666
|
+
this.tabstrip.destroy();
|
|
18667
|
+
this.tabstrip = null;
|
|
18668
|
+
}
|
|
18464
18669
|
|
|
18465
|
-
|
|
18670
|
+
this._destroyFilterMenu();
|
|
18466
18671
|
}
|
|
18467
18672
|
|
|
18468
18673
|
_destroyFilterMenu() {
|
|
18469
18674
|
if (this._filterMenu) {
|
|
18470
18675
|
this._filterMenu.destroy();
|
|
18471
18676
|
this._filterMenu = undefined;
|
|
18472
|
-
this._filterMenuColumn = undefined;
|
|
18473
18677
|
}
|
|
18474
18678
|
}
|
|
18475
18679
|
|
|
@@ -18489,8 +18693,8 @@
|
|
|
18489
18693
|
|
|
18490
18694
|
let resizeDirection =
|
|
18491
18695
|
!sheet.resizingInProgress() ? "none" :
|
|
18492
|
-
|
|
18493
|
-
|
|
18696
|
+
sheet.resizeHandlePosition().col === -Infinity ? "column" :
|
|
18697
|
+
"row";
|
|
18494
18698
|
|
|
18495
18699
|
this.wrapper.classList.toggle(viewClassNames.editContainer, this.editor.isActive());
|
|
18496
18700
|
this.wrapper.classList.toggle(viewClassNames.horizontalResize, resizeDirection === "row");
|
|
@@ -18504,7 +18708,7 @@
|
|
|
18504
18708
|
contentWidth: contentWidth,
|
|
18505
18709
|
contentHeight: contentHeight
|
|
18506
18710
|
};
|
|
18507
|
-
this.panes.forEach(function(pane) {
|
|
18711
|
+
this.panes.forEach(function (pane) {
|
|
18508
18712
|
content.push(pane.render(args));
|
|
18509
18713
|
});
|
|
18510
18714
|
|
|
@@ -18531,11 +18735,11 @@
|
|
|
18531
18735
|
if (this.editor.isActive()) {
|
|
18532
18736
|
this.editor.toggleTooltip(this.activeCellRectangle());
|
|
18533
18737
|
} else if (!(reason.resize ||
|
|
18534
|
-
|
|
18535
|
-
|
|
18536
|
-
|
|
18537
|
-
|
|
18538
|
-
|
|
18738
|
+
reason.comment ||
|
|
18739
|
+
sheet.selectionInProgress() ||
|
|
18740
|
+
sheet.resizingInProgress() ||
|
|
18741
|
+
sheet.draggingInProgress() ||
|
|
18742
|
+
sheet.isInEditMode())) {
|
|
18539
18743
|
this.renderClipboardContents();
|
|
18540
18744
|
}
|
|
18541
18745
|
}
|
|
@@ -18569,7 +18773,7 @@
|
|
|
18569
18773
|
return dom.element("div", {
|
|
18570
18774
|
className: classNames.resizeHint + (!horizontal ? " " + classNames.resizeHintVertical : ""),
|
|
18571
18775
|
style: style
|
|
18572
|
-
},[
|
|
18776
|
+
}, [
|
|
18573
18777
|
dom.element("div", { className: classNames.resizeHintHandle }),
|
|
18574
18778
|
dom.element("div", { className: classNames.resizeHintMarker })
|
|
18575
18779
|
]);
|
|
@@ -18607,11 +18811,11 @@
|
|
|
18607
18811
|
|
|
18608
18812
|
let selectionView = grid.rangeDimensions(selection);
|
|
18609
18813
|
|
|
18610
|
-
selectionView.rows.forEach(function(height) {
|
|
18814
|
+
selectionView.rows.forEach(function (height) {
|
|
18611
18815
|
table.addRow(height);
|
|
18612
18816
|
});
|
|
18613
18817
|
|
|
18614
|
-
selectionView.columns.forEach(function(width) {
|
|
18818
|
+
selectionView.columns.forEach(function (width) {
|
|
18615
18819
|
table.addColumn(width);
|
|
18616
18820
|
});
|
|
18617
18821
|
|
|
@@ -18619,7 +18823,7 @@
|
|
|
18619
18823
|
let primaryMergedCells = tmp.primary;
|
|
18620
18824
|
let secondaryMergedCells = tmp.secondary;
|
|
18621
18825
|
|
|
18622
|
-
sheet.forEach(selection, function(row, col, cell) {
|
|
18826
|
+
sheet.forEach(selection, function (row, col, cell) {
|
|
18623
18827
|
let location = new CellRef(row, col).print();
|
|
18624
18828
|
|
|
18625
18829
|
if (!secondaryMergedCells[location]) {
|
|
@@ -18634,13 +18838,13 @@
|
|
|
18634
18838
|
}
|
|
18635
18839
|
});
|
|
18636
18840
|
|
|
18637
|
-
this.clipboardContents.render([
|
|
18841
|
+
this.clipboardContents.render([table.toDomTree(0, 0, "kendo-clipboard-" + this._workbook.clipboard()._uid)]);
|
|
18638
18842
|
|
|
18639
18843
|
this.selectClipboardContents();
|
|
18640
18844
|
}
|
|
18641
18845
|
|
|
18642
18846
|
_pane(row, column, rowCount, columnCount) {
|
|
18643
|
-
let pane = new Pane(this._sheet, this._sheet._grid.pane({ row: row, column: column, rowCount: rowCount, columnCount: columnCount }));
|
|
18847
|
+
let pane = new Pane(this._sheet, this._sheet._grid.pane({ row: row, column: column, rowCount: rowCount, columnCount: columnCount }), this.options.getIconHTMLString);
|
|
18644
18848
|
pane.refresh(this.scroller.clientWidth, this.scroller.clientHeight);
|
|
18645
18849
|
return pane;
|
|
18646
18850
|
}
|
|
@@ -19038,6 +19242,10 @@
|
|
|
19038
19242
|
}
|
|
19039
19243
|
|
|
19040
19244
|
/* eslint-disable no-else-return */
|
|
19245
|
+
/* eslint-disable consistent-return */
|
|
19246
|
+
/* eslint-disable space-before-blocks */
|
|
19247
|
+
/* eslint-disable no-implicit-coercion */
|
|
19248
|
+
|
|
19041
19249
|
|
|
19042
19250
|
let COMMAND_TYPES = {
|
|
19043
19251
|
AUTO_FILL: "autoFill",
|
|
@@ -20853,6 +21061,13 @@
|
|
|
20853
21061
|
}
|
|
20854
21062
|
|
|
20855
21063
|
/* eslint-disable complexity */
|
|
21064
|
+
/* eslint-disable camelcase */
|
|
21065
|
+
/* eslint-disable key-spacing */
|
|
21066
|
+
/* eslint-disable no-nested-ternary */
|
|
21067
|
+
/* eslint-disable brace-style */
|
|
21068
|
+
/* eslint-disable no-implicit-coercion */
|
|
21069
|
+
/* eslint-disable no-loop-func */
|
|
21070
|
+
/* eslint-disable no-param-reassign */
|
|
20856
21071
|
|
|
20857
21072
|
// WARNING: removing the following jshint declaration and turning
|
|
20858
21073
|
// == into === to make JSHint happy will break functionality.
|
|
@@ -22222,6 +22437,11 @@
|
|
|
22222
22437
|
}
|
|
22223
22438
|
|
|
22224
22439
|
/* eslint-disable no-undef */
|
|
22440
|
+
/* eslint-disable no-nested-ternary */
|
|
22441
|
+
/* eslint-disable key-spacing */
|
|
22442
|
+
/* eslint-disable consistent-return */
|
|
22443
|
+
/* eslint-disable no-param-reassign */
|
|
22444
|
+
|
|
22225
22445
|
|
|
22226
22446
|
const events$1 = [
|
|
22227
22447
|
"cut",
|
|
@@ -22440,7 +22660,13 @@
|
|
|
22440
22660
|
|
|
22441
22661
|
execute(options) {
|
|
22442
22662
|
let commandOptions = Object.assign({}, { workbook: this }, options.options);
|
|
22443
|
-
let command
|
|
22663
|
+
let command;
|
|
22664
|
+
|
|
22665
|
+
if (this.options.getWorkbookCommand) {
|
|
22666
|
+
command = this.options.getWorkbookCommand(options.command, commandOptions);
|
|
22667
|
+
}
|
|
22668
|
+
|
|
22669
|
+
command = command || new commands[options.command](commandOptions);
|
|
22444
22670
|
let sheet = this.activeSheet();
|
|
22445
22671
|
|
|
22446
22672
|
if (commandOptions.origin) {
|
|
@@ -22559,7 +22785,8 @@
|
|
|
22559
22785
|
options.columnWidth || this.options.columnWidth,
|
|
22560
22786
|
options.headerHeight || this.options.headerHeight,
|
|
22561
22787
|
options.headerWidth || this.options.headerWidth,
|
|
22562
|
-
options.defaultCellStyle || this.options.defaultCellStyle
|
|
22788
|
+
options.defaultCellStyle || this.options.defaultCellStyle,
|
|
22789
|
+
options.createSheetDataSource || this.options.createSheetDataSource
|
|
22563
22790
|
);
|
|
22564
22791
|
|
|
22565
22792
|
sheet._workbook = this;
|
|
@@ -23238,7 +23465,10 @@
|
|
|
23238
23465
|
"select",
|
|
23239
23466
|
"changeFormat",
|
|
23240
23467
|
"dataBinding",
|
|
23241
|
-
"dataBound"
|
|
23468
|
+
"dataBound",
|
|
23469
|
+
"update",
|
|
23470
|
+
"message",
|
|
23471
|
+
"contextmenu",
|
|
23242
23472
|
];
|
|
23243
23473
|
|
|
23244
23474
|
class SpreadsheetWidget extends Widget {
|
|
@@ -23256,7 +23486,13 @@
|
|
|
23256
23486
|
sheetsbar: this.options.sheetsbar,
|
|
23257
23487
|
formulaBarInputRef: this.options.formulaBarInputRef,
|
|
23258
23488
|
formulaCellInputRef: this.options.formulaCellInputRef,
|
|
23259
|
-
nameBoxRef: this.options.nameBoxRef
|
|
23489
|
+
nameBoxRef: this.options.nameBoxRef,
|
|
23490
|
+
createTabStrip: this.options.createTabStrip,
|
|
23491
|
+
createFilterMenu: this.options.createFilterMenu,
|
|
23492
|
+
createContextMenus: this.options.createContextMenus,
|
|
23493
|
+
createSheetBar: this.options.createSheetBar,
|
|
23494
|
+
getIconHTMLString: this.options.getIconHTMLString,
|
|
23495
|
+
openDialogCallback: this.openDialog.bind(this),
|
|
23260
23496
|
});
|
|
23261
23497
|
|
|
23262
23498
|
this._workbook = new Workbook(this.options, this._view);
|
|
@@ -23266,6 +23502,7 @@
|
|
|
23266
23502
|
this._autoRefresh = true;
|
|
23267
23503
|
|
|
23268
23504
|
this._bindWorkbookEvents();
|
|
23505
|
+
this._bindViewEvents();
|
|
23269
23506
|
|
|
23270
23507
|
this._view.workbook(this._workbook);
|
|
23271
23508
|
|
|
@@ -23295,35 +23532,29 @@
|
|
|
23295
23532
|
this.trigger("keydown", e);
|
|
23296
23533
|
|
|
23297
23534
|
if (key === keys.F11 && e.shiftKey) {
|
|
23298
|
-
this._view.sheetsbar.
|
|
23535
|
+
this._view.sheetsbar.onAddSelect();
|
|
23299
23536
|
e.preventDefault();
|
|
23300
23537
|
return;
|
|
23301
23538
|
} else if (e.altKey && key === keys.PAGEDOWN) {
|
|
23302
|
-
this.
|
|
23303
|
-
|
|
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;
|
|
23539
|
+
let activeSheetIndex = this.sheetIndex(this.activeSheet());
|
|
23540
|
+
let nextSheetName = this.sheetByIndex(activeSheetIndex + 1)?.name();
|
|
23314
23541
|
|
|
23315
|
-
|
|
23316
|
-
|
|
23317
|
-
|
|
23318
|
-
|
|
23542
|
+
if (nextSheetName){
|
|
23543
|
+
this._view.sheetsbar.onSheetSelect(nextSheetName);
|
|
23544
|
+
}
|
|
23545
|
+
} else if (e.altKey && key === keys.PAGEUP) {
|
|
23546
|
+
let activeSheetIndex = this.sheetIndex(this.activeSheet());
|
|
23547
|
+
let prevSheetName = this.sheetByIndex(activeSheetIndex - 1)?.name();
|
|
23319
23548
|
|
|
23320
|
-
|
|
23321
|
-
|
|
23322
|
-
}
|
|
23549
|
+
if (prevSheetName) {
|
|
23550
|
+
this._view.sheetsbar.onSheetSelect(prevSheetName);
|
|
23551
|
+
}
|
|
23552
|
+
} else if (e.altKey && key === keys.DELETE) {
|
|
23553
|
+
this._view.sheetsbar.onSheetRemove(this.activeSheet()._name());
|
|
23323
23554
|
e.preventDefault();
|
|
23324
23555
|
return;
|
|
23325
23556
|
} else if (e.altKey && key === keys.R) {
|
|
23326
|
-
this.
|
|
23557
|
+
this.options.createSheetEditor?.();
|
|
23327
23558
|
e.preventDefault();
|
|
23328
23559
|
return;
|
|
23329
23560
|
} else if (controlKey && key === keys.B) {
|
|
@@ -23333,17 +23564,20 @@
|
|
|
23333
23564
|
} else if (controlKey && key === keys.U) {
|
|
23334
23565
|
this._handleTypographicalEmphasis('underline');
|
|
23335
23566
|
} else if (e.altKey && key === keys.H) {
|
|
23336
|
-
this._view.tabstrip
|
|
23567
|
+
this._view.tabstrip?.select(0);
|
|
23337
23568
|
e.preventDefault();
|
|
23338
23569
|
return;
|
|
23339
23570
|
} else if (e.altKey && key === keys.N) {
|
|
23340
|
-
this._view.tabstrip
|
|
23571
|
+
this._view.tabstrip?.select(1);
|
|
23341
23572
|
e.preventDefault();
|
|
23342
23573
|
return;
|
|
23343
23574
|
} else if (e.altKey && key === keys.A) {
|
|
23344
|
-
this._view.tabstrip
|
|
23575
|
+
this._view.tabstrip?.select(2);
|
|
23345
23576
|
e.preventDefault();
|
|
23346
23577
|
return;
|
|
23578
|
+
} else if (key === keys.F10) {
|
|
23579
|
+
e.preventDefault();
|
|
23580
|
+
this._view.tabstrip?.wrapper?.find(".k-tabstrip-content.k-active .k-toolbar [tabindex=0]").trigger("focus");
|
|
23347
23581
|
}
|
|
23348
23582
|
}
|
|
23349
23583
|
|
|
@@ -23654,6 +23888,14 @@
|
|
|
23654
23888
|
// kendo.ui.progress(this.element, e.toggle);
|
|
23655
23889
|
}
|
|
23656
23890
|
|
|
23891
|
+
_viewUpdate(e) {
|
|
23892
|
+
this.trigger("update", e);
|
|
23893
|
+
}
|
|
23894
|
+
|
|
23895
|
+
_viewMessage(e) {
|
|
23896
|
+
this.trigger("message", e);
|
|
23897
|
+
}
|
|
23898
|
+
|
|
23657
23899
|
_onContextMenu(e) {
|
|
23658
23900
|
this.trigger("contextmenu", e);
|
|
23659
23901
|
}
|
|
@@ -23687,6 +23929,11 @@
|
|
|
23687
23929
|
this._workbook.bind("contextmenu", this._onContextMenu.bind(this));
|
|
23688
23930
|
}
|
|
23689
23931
|
|
|
23932
|
+
_bindViewEvents() {
|
|
23933
|
+
this._view.bind("update", this._viewUpdate.bind(this));
|
|
23934
|
+
this._view.bind("message", this._viewMessage.bind(this));
|
|
23935
|
+
}
|
|
23936
|
+
|
|
23690
23937
|
destroy() {
|
|
23691
23938
|
window.removeEventListener('resize', this._resizeHandler);
|
|
23692
23939
|
this.element.removeEventListener("keydown", this._keyDownHandler);
|
|
@@ -23737,6 +23984,7 @@
|
|
|
23737
23984
|
|
|
23738
23985
|
/* -----[ Excel operators ]----- */
|
|
23739
23986
|
|
|
23987
|
+
|
|
23740
23988
|
const {
|
|
23741
23989
|
FUNCS,
|
|
23742
23990
|
defineBuiltinFunction,
|
|
@@ -43884,29 +44132,119 @@
|
|
|
43884
44132
|
defineAlias
|
|
43885
44133
|
} = calc.runtime;
|
|
43886
44134
|
|
|
44135
|
+
exports.ALL_PROPERTIES = ALL_PROPERTIES;
|
|
44136
|
+
exports.ALL_REASONS = ALL_REASONS;
|
|
44137
|
+
exports.AddColumnCommand = AddColumnCommand;
|
|
44138
|
+
exports.AddCommand = AddCommand;
|
|
44139
|
+
exports.AddRowCommand = AddRowCommand;
|
|
44140
|
+
exports.AdjustDecimalsCommand = AdjustDecimalsCommand;
|
|
44141
|
+
exports.AdjustRowHeightCommand = AdjustRowHeightCommand;
|
|
44142
|
+
exports.ApplyFilterCommand = ApplyFilterCommand;
|
|
44143
|
+
exports.AutoFillCalculator = AutoFillCalculator;
|
|
44144
|
+
exports.AutoFillCommand = AutoFillCommand;
|
|
44145
|
+
exports.Axis = Axis;
|
|
44146
|
+
exports.AxisManager = AxisManager;
|
|
44147
|
+
exports.BorderChangeCommand = BorderChangeCommand;
|
|
44148
|
+
exports.BringToFrontCommand = BringToFrontCommand;
|
|
43887
44149
|
exports.CalcError = CalcError;
|
|
43888
44150
|
exports.CellRef = CellRef;
|
|
44151
|
+
exports.ClearContentCommand = ClearContentCommand;
|
|
44152
|
+
exports.ClearFilterCommand = ClearFilterCommand;
|
|
44153
|
+
exports.Clipboard = Clipboard;
|
|
44154
|
+
exports.ColumnWidthCommand = ColumnWidthCommand;
|
|
44155
|
+
exports.Command = Command;
|
|
43889
44156
|
exports.Context = Context;
|
|
44157
|
+
exports.Controller = Controller;
|
|
44158
|
+
exports.CopyCommand = CopyCommand;
|
|
44159
|
+
exports.CustomFilter = CustomFilter;
|
|
44160
|
+
exports.CutCommand = CutCommand;
|
|
43890
44161
|
exports.Deferred = Deferred;
|
|
44162
|
+
exports.DefineNameCommand = DefineNameCommand;
|
|
44163
|
+
exports.DeleteColumnCommand = DeleteColumnCommand;
|
|
44164
|
+
exports.DeleteCommand = DeleteCommand;
|
|
44165
|
+
exports.DeleteDrawingCommand = DeleteDrawingCommand;
|
|
44166
|
+
exports.DeleteNameCommand = DeleteNameCommand;
|
|
44167
|
+
exports.DeleteRowCommand = DeleteRowCommand;
|
|
44168
|
+
exports.Drawing = Drawing;
|
|
44169
|
+
exports.DrawingCommand = DrawingCommand;
|
|
44170
|
+
exports.DrawingUpdateCommand = DrawingUpdateCommand;
|
|
44171
|
+
exports.DynamicFilter = DynamicFilter;
|
|
44172
|
+
exports.EditCommand = EditCommand;
|
|
44173
|
+
exports.EditValidationCommand = EditValidationCommand;
|
|
44174
|
+
exports.EventListener = EventListener;
|
|
44175
|
+
exports.FIRSTREF = FIRSTREF;
|
|
44176
|
+
exports.Filter = Filter;
|
|
44177
|
+
exports.FilterCommand = FilterCommand;
|
|
44178
|
+
exports.FormulaBar = FormulaBar;
|
|
44179
|
+
exports.FormulaContext = FormulaContext;
|
|
44180
|
+
exports.FormulaInput = FormulaInput;
|
|
44181
|
+
exports.FreezePanesCommand = FreezePanesCommand;
|
|
44182
|
+
exports.Grid = Grid;
|
|
44183
|
+
exports.GridLinesChangeCommand = GridLinesChangeCommand;
|
|
44184
|
+
exports.HideLineCommand = HideLineCommand;
|
|
44185
|
+
exports.HyperlinkCommand = HyperlinkCommand;
|
|
44186
|
+
exports.InsertCommentCommand = InsertCommentCommand;
|
|
44187
|
+
exports.InsertImageCommand = InsertImageCommand;
|
|
43891
44188
|
exports.Matrix = Matrix;
|
|
44189
|
+
exports.MergeCellCommand = MergeCellCommand;
|
|
43892
44190
|
exports.NULLREF = NULLREF;
|
|
44191
|
+
exports.NameCommand = NameCommand;
|
|
44192
|
+
exports.NameEditor = NameEditor;
|
|
43893
44193
|
exports.NameRef = NameRef;
|
|
44194
|
+
exports.OpenCommand = OpenCommand;
|
|
44195
|
+
exports.Pane = Pane;
|
|
44196
|
+
exports.PaneAxis = PaneAxis;
|
|
44197
|
+
exports.PaneGrid = PaneGrid;
|
|
44198
|
+
exports.PasteCommand = PasteCommand;
|
|
44199
|
+
exports.PropertyBag = PropertyBag;
|
|
44200
|
+
exports.PropertyChangeCommand = PropertyChangeCommand;
|
|
44201
|
+
exports.PropertyCleanCommand = PropertyCleanCommand;
|
|
43894
44202
|
exports.Range = Range$1;
|
|
44203
|
+
exports.RangeList = RangeList;
|
|
43895
44204
|
exports.RangeRef = RangeRef;
|
|
44205
|
+
exports.RangeTree = RangeTree;
|
|
43896
44206
|
exports.Ref = Ref;
|
|
44207
|
+
exports.ReorderDrawingsCommand = ReorderDrawingsCommand;
|
|
44208
|
+
exports.RowHeightCommand = RowHeightCommand;
|
|
44209
|
+
exports.SHEETREF = SHEETREF;
|
|
44210
|
+
exports.SaveAsCommand = SaveAsCommand;
|
|
44211
|
+
exports.SendToBackCommand = SendToBackCommand;
|
|
43897
44212
|
exports.Sheet = Sheet;
|
|
44213
|
+
exports.SheetDataSourceBinder = SheetDataSourceBinder;
|
|
44214
|
+
exports.SheetEditor = SheetEditor;
|
|
44215
|
+
exports.SheetNavigator = SheetNavigator;
|
|
44216
|
+
exports.SortCommand = SortCommand;
|
|
44217
|
+
exports.Sorter = Sorter;
|
|
43898
44218
|
exports.SpreadsheetWidget = SpreadsheetWidget;
|
|
44219
|
+
exports.TargetValueCommand = TargetValueCommand;
|
|
44220
|
+
exports.TextWrapCommand = TextWrapCommand;
|
|
44221
|
+
exports.ToolbarCopyCommand = ToolbarCopyCommand;
|
|
44222
|
+
exports.ToolbarCutCommand = ToolbarCutCommand;
|
|
44223
|
+
exports.ToolbarPasteCommand = ToolbarPasteCommand;
|
|
44224
|
+
exports.TopFilter = TopFilter;
|
|
44225
|
+
exports.UnHideLineCommand = UnHideLineCommand;
|
|
43899
44226
|
exports.UnionRef = UnionRef;
|
|
44227
|
+
exports.ValidationFormulaContext = ValidationFormulaContext;
|
|
44228
|
+
exports.ValueFilter = ValueFilter;
|
|
43900
44229
|
exports.View = View;
|
|
43901
44230
|
exports.Workbook = Workbook;
|
|
43902
44231
|
exports.calc = calc;
|
|
44232
|
+
exports.dateToNumber = dateToNumber;
|
|
43903
44233
|
exports.dateToSerial = dateToSerial;
|
|
43904
44234
|
exports.defineAlias = defineAlias;
|
|
43905
44235
|
exports.defineFunction = defineFunction;
|
|
44236
|
+
exports.draw = draw;
|
|
44237
|
+
exports.drawCell = drawCell;
|
|
44238
|
+
exports.formatting = formatting;
|
|
44239
|
+
exports.initDynamicFilter = initDynamicFilter;
|
|
44240
|
+
exports.intl = intl;
|
|
44241
|
+
exports.numberToDate = numberToDate;
|
|
43906
44242
|
exports.packDate = packDate;
|
|
43907
44243
|
exports.packTime = packTime;
|
|
44244
|
+
exports.registerEditor = registerEditor;
|
|
43908
44245
|
exports.serialToDate = serialToDate;
|
|
43909
44246
|
exports.unpackDate = unpackDate;
|
|
43910
44247
|
exports.unpackTime = unpackTime;
|
|
44248
|
+
exports.validation = validationExport;
|
|
43911
44249
|
|
|
43912
44250
|
}));
|