@visactor/vtable-calendar 1.14.4-alpha.3 → 1.14.4-alpha.5
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/cjs/month-calendar.js +1 -0
- package/cjs/month-calendar.js.map +1 -1
- package/cjs/table/table-option.js +21 -17
- package/cjs/table/table-option.js.map +1 -1
- package/dist/vtable-calendar.js +1833 -1696
- package/dist/vtable-calendar.min.js +1 -1
- package/es/month-calendar.js +1 -0
- package/es/month-calendar.js.map +1 -1
- package/es/table/table-option.js +21 -15
- package/es/table/table-option.js.map +1 -1
- package/package.json +4 -4
package/dist/vtable-calendar.js
CHANGED
|
@@ -621,6 +621,12 @@
|
|
|
621
621
|
get env() {
|
|
622
622
|
return this._env;
|
|
623
623
|
}
|
|
624
|
+
get isImageAnonymous() {
|
|
625
|
+
return this._isImageAnonymous;
|
|
626
|
+
}
|
|
627
|
+
set isImageAnonymous(isImageAnonymous) {
|
|
628
|
+
this._isImageAnonymous = isImageAnonymous;
|
|
629
|
+
}
|
|
624
630
|
get devicePixelRatio() {
|
|
625
631
|
return this._env || this.setEnv("browser"), this.envContribution.getDevicePixelRatio();
|
|
626
632
|
}
|
|
@@ -655,7 +661,7 @@
|
|
|
655
661
|
this._env || this.setEnv("browser"), this.envContribution.applyStyles = support;
|
|
656
662
|
}
|
|
657
663
|
constructor(contributions) {
|
|
658
|
-
this.contributions = contributions, this.id = Generator.GenAutoIncrementId(), this.hooks = {
|
|
664
|
+
this.contributions = contributions, this._isImageAnonymous = !0, this.id = Generator.GenAutoIncrementId(), this.hooks = {
|
|
659
665
|
onSetEnv: new SyncHook(["lastEnv", "env", "global"])
|
|
660
666
|
}, this.measureTextMethod = "native", this.optimizeVisible = !1;
|
|
661
667
|
}
|
|
@@ -7629,7 +7635,7 @@
|
|
|
7629
7635
|
}
|
|
7630
7636
|
static GetFile(url, type) {
|
|
7631
7637
|
let data = ResourceLoader.cache.get(url);
|
|
7632
|
-
return data ? "
|
|
7638
|
+
return data ? "fail" === data.loadState ? Promise.reject() : "init" === data.loadState || "loading" === data.loadState ? data.dataPromise.then(data => data.data) : Promise.resolve(data.data) : (data = {
|
|
7633
7639
|
type: type,
|
|
7634
7640
|
loadState: "init"
|
|
7635
7641
|
}, ResourceLoader.cache.set(url, data), "arrayBuffer" === type ? data.dataPromise = application.global.loadArrayBuffer(url) : "blob" === type ? data.dataPromise = application.global.loadBlob(url) : "json" === type && (data.dataPromise = application.global.loadJson(url)), data.dataPromise.then(data => data.data));
|
|
@@ -10382,8 +10388,8 @@
|
|
|
10382
10388
|
constructor() {
|
|
10383
10389
|
super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
|
|
10384
10390
|
}
|
|
10385
|
-
drawShape(
|
|
10386
|
-
return super.drawShape(
|
|
10391
|
+
drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
|
|
10392
|
+
return super.drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
|
|
10387
10393
|
}
|
|
10388
10394
|
}
|
|
10389
10395
|
const defaultImageRenderContribution = new DefaultImageRenderContribution();
|
|
@@ -18615,7 +18621,7 @@
|
|
|
18615
18621
|
function createImageElement(src) {
|
|
18616
18622
|
let isSvg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
18617
18623
|
const img = document.createElement("img");
|
|
18618
|
-
if (img.crossOrigin = "anonymous", isSvg) {
|
|
18624
|
+
if (application.global.isImageAnonymous && (img.crossOrigin = "anonymous"), isSvg) {
|
|
18619
18625
|
const data = new Blob([src], {
|
|
18620
18626
|
type: "image/svg+xml"
|
|
18621
18627
|
});
|
|
@@ -19787,454 +19793,1046 @@
|
|
|
19787
19793
|
loadImagePick || (loadImagePick = !0, bind(CanvasImagePicker).to(DefaultCanvasImagePicker).inSingletonScope(), bind(CanvasPickerContribution).toService(CanvasImagePicker));
|
|
19788
19794
|
});
|
|
19789
19795
|
|
|
19790
|
-
|
|
19796
|
+
var lib$1 = {};
|
|
19791
19797
|
|
|
19792
|
-
|
|
19793
|
-
_registerArc.__loaded || (_registerArc.__loaded = !0, registerArcGraphic(), container.load(arcModule), container.load(browser$1 ? arcCanvasPickModule : arcMathPickModule));
|
|
19794
|
-
}
|
|
19795
|
-
_registerArc.__loaded = !1;
|
|
19796
|
-
const registerArc = _registerArc;
|
|
19798
|
+
var gif = {};
|
|
19797
19799
|
|
|
19798
|
-
|
|
19799
|
-
_registerCircle.__loaded || (_registerCircle.__loaded = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser$1 ? circleCanvasPickModule : circleMathPickModule));
|
|
19800
|
-
}
|
|
19801
|
-
_registerCircle.__loaded = !1;
|
|
19802
|
-
const registerCircle = _registerCircle;
|
|
19800
|
+
var lib = {};
|
|
19803
19801
|
|
|
19804
|
-
|
|
19805
|
-
|
|
19806
|
-
}
|
|
19807
|
-
|
|
19808
|
-
|
|
19802
|
+
Object.defineProperty(lib, "__esModule", {
|
|
19803
|
+
value: true
|
|
19804
|
+
});
|
|
19805
|
+
lib.loop = lib.conditional = lib.parse = void 0;
|
|
19806
|
+
var parse$3 = function parse(stream, schema) {
|
|
19807
|
+
var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
19808
|
+
var parent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : result;
|
|
19809
|
+
if (Array.isArray(schema)) {
|
|
19810
|
+
schema.forEach(function (partSchema) {
|
|
19811
|
+
return parse(stream, partSchema, result, parent);
|
|
19812
|
+
});
|
|
19813
|
+
} else if (typeof schema === 'function') {
|
|
19814
|
+
schema(stream, result, parent, parse);
|
|
19815
|
+
} else {
|
|
19816
|
+
var key = Object.keys(schema)[0];
|
|
19817
|
+
if (Array.isArray(schema[key])) {
|
|
19818
|
+
parent[key] = {};
|
|
19819
|
+
parse(stream, schema[key], result, parent[key]);
|
|
19820
|
+
} else {
|
|
19821
|
+
parent[key] = schema[key](stream, result, parent, parse);
|
|
19822
|
+
}
|
|
19823
|
+
}
|
|
19824
|
+
return result;
|
|
19825
|
+
};
|
|
19826
|
+
lib.parse = parse$3;
|
|
19827
|
+
var conditional = function conditional(schema, conditionFunc) {
|
|
19828
|
+
return function (stream, result, parent, parse) {
|
|
19829
|
+
if (conditionFunc(stream, result, parent)) {
|
|
19830
|
+
parse(stream, schema, result, parent);
|
|
19831
|
+
}
|
|
19832
|
+
};
|
|
19833
|
+
};
|
|
19834
|
+
lib.conditional = conditional;
|
|
19835
|
+
var loop = function loop(schema, continueFunc) {
|
|
19836
|
+
return function (stream, result, parent, parse) {
|
|
19837
|
+
var arr = [];
|
|
19838
|
+
var lastStreamPos = stream.pos;
|
|
19839
|
+
while (continueFunc(stream, result, parent)) {
|
|
19840
|
+
var newParent = {};
|
|
19841
|
+
parse(stream, schema, result, newParent); // cases when whole file is parsed but no termination is there and stream position is not getting updated as well
|
|
19842
|
+
// it falls into infinite recursion, null check to avoid the same
|
|
19809
19843
|
|
|
19810
|
-
|
|
19811
|
-
|
|
19812
|
-
|
|
19813
|
-
|
|
19814
|
-
|
|
19844
|
+
if (stream.pos === lastStreamPos) {
|
|
19845
|
+
break;
|
|
19846
|
+
}
|
|
19847
|
+
lastStreamPos = stream.pos;
|
|
19848
|
+
arr.push(newParent);
|
|
19849
|
+
}
|
|
19850
|
+
return arr;
|
|
19851
|
+
};
|
|
19852
|
+
};
|
|
19853
|
+
lib.loop = loop;
|
|
19815
19854
|
|
|
19816
|
-
|
|
19817
|
-
_registerLine.__loaded || (_registerLine.__loaded = !0, registerLineGraphic(), container.load(lineModule), container.load(browser$1 ? lineCanvasPickModule : lineMathPickModule));
|
|
19818
|
-
}
|
|
19819
|
-
_registerLine.__loaded = !1;
|
|
19820
|
-
const registerLine = _registerLine;
|
|
19855
|
+
var uint8 = {};
|
|
19821
19856
|
|
|
19822
|
-
|
|
19823
|
-
|
|
19824
|
-
}
|
|
19825
|
-
|
|
19826
|
-
const registerPath = _registerPath;
|
|
19857
|
+
Object.defineProperty(uint8, "__esModule", {
|
|
19858
|
+
value: true
|
|
19859
|
+
});
|
|
19860
|
+
uint8.readBits = uint8.readArray = uint8.readUnsigned = uint8.readString = uint8.peekBytes = uint8.readBytes = uint8.peekByte = uint8.readByte = uint8.buildStream = void 0;
|
|
19827
19861
|
|
|
19828
|
-
|
|
19829
|
-
|
|
19830
|
-
|
|
19831
|
-
|
|
19832
|
-
|
|
19862
|
+
// Default stream and parsers for Uint8TypedArray data type
|
|
19863
|
+
var buildStream = function buildStream(uint8Data) {
|
|
19864
|
+
return {
|
|
19865
|
+
data: uint8Data,
|
|
19866
|
+
pos: 0
|
|
19867
|
+
};
|
|
19868
|
+
};
|
|
19869
|
+
uint8.buildStream = buildStream;
|
|
19870
|
+
var readByte = function readByte() {
|
|
19871
|
+
return function (stream) {
|
|
19872
|
+
return stream.data[stream.pos++];
|
|
19873
|
+
};
|
|
19874
|
+
};
|
|
19875
|
+
uint8.readByte = readByte;
|
|
19876
|
+
var peekByte = function peekByte() {
|
|
19877
|
+
var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
19878
|
+
return function (stream) {
|
|
19879
|
+
return stream.data[stream.pos + offset];
|
|
19880
|
+
};
|
|
19881
|
+
};
|
|
19882
|
+
uint8.peekByte = peekByte;
|
|
19883
|
+
var readBytes = function readBytes(length) {
|
|
19884
|
+
return function (stream) {
|
|
19885
|
+
return stream.data.subarray(stream.pos, stream.pos += length);
|
|
19886
|
+
};
|
|
19887
|
+
};
|
|
19888
|
+
uint8.readBytes = readBytes;
|
|
19889
|
+
var peekBytes = function peekBytes(length) {
|
|
19890
|
+
return function (stream) {
|
|
19891
|
+
return stream.data.subarray(stream.pos, stream.pos + length);
|
|
19892
|
+
};
|
|
19893
|
+
};
|
|
19894
|
+
uint8.peekBytes = peekBytes;
|
|
19895
|
+
var readString = function readString(length) {
|
|
19896
|
+
return function (stream) {
|
|
19897
|
+
return Array.from(readBytes(length)(stream)).map(function (value) {
|
|
19898
|
+
return String.fromCharCode(value);
|
|
19899
|
+
}).join('');
|
|
19900
|
+
};
|
|
19901
|
+
};
|
|
19902
|
+
uint8.readString = readString;
|
|
19903
|
+
var readUnsigned = function readUnsigned(littleEndian) {
|
|
19904
|
+
return function (stream) {
|
|
19905
|
+
var bytes = readBytes(2)(stream);
|
|
19906
|
+
return littleEndian ? (bytes[1] << 8) + bytes[0] : (bytes[0] << 8) + bytes[1];
|
|
19907
|
+
};
|
|
19908
|
+
};
|
|
19909
|
+
uint8.readUnsigned = readUnsigned;
|
|
19910
|
+
var readArray = function readArray(byteSize, totalOrFunc) {
|
|
19911
|
+
return function (stream, result, parent) {
|
|
19912
|
+
var total = typeof totalOrFunc === 'function' ? totalOrFunc(stream, result, parent) : totalOrFunc;
|
|
19913
|
+
var parser = readBytes(byteSize);
|
|
19914
|
+
var arr = new Array(total);
|
|
19915
|
+
for (var i = 0; i < total; i++) {
|
|
19916
|
+
arr[i] = parser(stream);
|
|
19917
|
+
}
|
|
19918
|
+
return arr;
|
|
19919
|
+
};
|
|
19920
|
+
};
|
|
19921
|
+
uint8.readArray = readArray;
|
|
19922
|
+
var subBitsTotal = function subBitsTotal(bits, startIndex, length) {
|
|
19923
|
+
var result = 0;
|
|
19924
|
+
for (var i = 0; i < length; i++) {
|
|
19925
|
+
result += bits[startIndex + i] && Math.pow(2, length - i - 1);
|
|
19926
|
+
}
|
|
19927
|
+
return result;
|
|
19928
|
+
};
|
|
19929
|
+
var readBits = function readBits(schema) {
|
|
19930
|
+
return function (stream) {
|
|
19931
|
+
var _byte = readByte()(stream); // convert the byte to bit array
|
|
19833
19932
|
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
|
|
19837
|
-
|
|
19838
|
-
const registerRect = _registerRect;
|
|
19933
|
+
var bits = new Array(8);
|
|
19934
|
+
for (var i = 0; i < 8; i++) {
|
|
19935
|
+
bits[7 - i] = !!(_byte & 1 << i);
|
|
19936
|
+
} // convert the bit array to values based on the schema
|
|
19839
19937
|
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
19843
|
-
|
|
19844
|
-
|
|
19938
|
+
return Object.keys(schema).reduce(function (res, key) {
|
|
19939
|
+
var def = schema[key];
|
|
19940
|
+
if (def.length) {
|
|
19941
|
+
res[key] = subBitsTotal(bits, def.index, def.length);
|
|
19942
|
+
} else {
|
|
19943
|
+
res[key] = bits[def.index];
|
|
19944
|
+
}
|
|
19945
|
+
return res;
|
|
19946
|
+
}, {});
|
|
19947
|
+
};
|
|
19948
|
+
};
|
|
19949
|
+
uint8.readBits = readBits;
|
|
19845
19950
|
|
|
19846
|
-
function
|
|
19847
|
-
_registerShadowRoot.__loaded || (_registerShadowRoot.__loaded = !0, registerShadowRootGraphic());
|
|
19848
|
-
}
|
|
19849
|
-
_registerShadowRoot.__loaded = !1;
|
|
19850
|
-
const registerShadowRoot = _registerShadowRoot;
|
|
19951
|
+
(function (exports) {
|
|
19851
19952
|
|
|
19852
|
-
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
|
|
19953
|
+
Object.defineProperty(exports, "__esModule", {
|
|
19954
|
+
value: true
|
|
19955
|
+
});
|
|
19956
|
+
exports["default"] = void 0;
|
|
19957
|
+
var _ = lib;
|
|
19958
|
+
var _uint = uint8;
|
|
19857
19959
|
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
|
|
19861
|
-
|
|
19862
|
-
|
|
19960
|
+
// a set of 0x00 terminated subblocks
|
|
19961
|
+
var subBlocksSchema = {
|
|
19962
|
+
blocks: function blocks(stream) {
|
|
19963
|
+
var terminator = 0x00;
|
|
19964
|
+
var chunks = [];
|
|
19965
|
+
var streamSize = stream.data.length;
|
|
19966
|
+
var total = 0;
|
|
19967
|
+
for (var size = (0, _uint.readByte)()(stream); size !== terminator; size = (0, _uint.readByte)()(stream)) {
|
|
19968
|
+
// size becomes undefined for some case when file is corrupted and terminator is not proper
|
|
19969
|
+
// null check to avoid recursion
|
|
19970
|
+
if (!size) break; // catch corrupted files with no terminator
|
|
19863
19971
|
|
|
19864
|
-
|
|
19865
|
-
|
|
19866
|
-
|
|
19867
|
-
|
|
19868
|
-
|
|
19972
|
+
if (stream.pos + size >= streamSize) {
|
|
19973
|
+
var availableSize = streamSize - stream.pos;
|
|
19974
|
+
chunks.push((0, _uint.readBytes)(availableSize)(stream));
|
|
19975
|
+
total += availableSize;
|
|
19976
|
+
break;
|
|
19977
|
+
}
|
|
19978
|
+
chunks.push((0, _uint.readBytes)(size)(stream));
|
|
19979
|
+
total += size;
|
|
19980
|
+
}
|
|
19981
|
+
var result = new Uint8Array(total);
|
|
19982
|
+
var offset = 0;
|
|
19983
|
+
for (var i = 0; i < chunks.length; i++) {
|
|
19984
|
+
result.set(chunks[i], offset);
|
|
19985
|
+
offset += chunks[i].length;
|
|
19986
|
+
}
|
|
19987
|
+
return result;
|
|
19988
|
+
}
|
|
19989
|
+
}; // global control extension
|
|
19869
19990
|
|
|
19870
|
-
|
|
19871
|
-
|
|
19872
|
-
|
|
19991
|
+
var gceSchema = (0, _.conditional)({
|
|
19992
|
+
gce: [{
|
|
19993
|
+
codes: (0, _uint.readBytes)(2)
|
|
19994
|
+
}, {
|
|
19995
|
+
byteSize: (0, _uint.readByte)()
|
|
19996
|
+
}, {
|
|
19997
|
+
extras: (0, _uint.readBits)({
|
|
19998
|
+
future: {
|
|
19999
|
+
index: 0,
|
|
20000
|
+
length: 3
|
|
20001
|
+
},
|
|
20002
|
+
disposal: {
|
|
20003
|
+
index: 3,
|
|
20004
|
+
length: 3
|
|
20005
|
+
},
|
|
20006
|
+
userInput: {
|
|
20007
|
+
index: 6
|
|
20008
|
+
},
|
|
20009
|
+
transparentColorGiven: {
|
|
20010
|
+
index: 7
|
|
20011
|
+
}
|
|
20012
|
+
})
|
|
20013
|
+
}, {
|
|
20014
|
+
delay: (0, _uint.readUnsigned)(true)
|
|
20015
|
+
}, {
|
|
20016
|
+
transparentColorIndex: (0, _uint.readByte)()
|
|
20017
|
+
}, {
|
|
20018
|
+
terminator: (0, _uint.readByte)()
|
|
20019
|
+
}]
|
|
20020
|
+
}, function (stream) {
|
|
20021
|
+
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
20022
|
+
return codes[0] === 0x21 && codes[1] === 0xf9;
|
|
20023
|
+
}); // image pipeline block
|
|
19873
20024
|
|
|
19874
|
-
|
|
19875
|
-
|
|
19876
|
-
|
|
19877
|
-
|
|
19878
|
-
|
|
19879
|
-
|
|
19880
|
-
|
|
19881
|
-
|
|
19882
|
-
|
|
19883
|
-
|
|
19884
|
-
|
|
19885
|
-
|
|
19886
|
-
|
|
19887
|
-
|
|
19888
|
-
|
|
19889
|
-
|
|
19890
|
-
|
|
19891
|
-
|
|
19892
|
-
|
|
20025
|
+
var imageSchema = (0, _.conditional)({
|
|
20026
|
+
image: [{
|
|
20027
|
+
code: (0, _uint.readByte)()
|
|
20028
|
+
}, {
|
|
20029
|
+
descriptor: [{
|
|
20030
|
+
left: (0, _uint.readUnsigned)(true)
|
|
20031
|
+
}, {
|
|
20032
|
+
top: (0, _uint.readUnsigned)(true)
|
|
20033
|
+
}, {
|
|
20034
|
+
width: (0, _uint.readUnsigned)(true)
|
|
20035
|
+
}, {
|
|
20036
|
+
height: (0, _uint.readUnsigned)(true)
|
|
20037
|
+
}, {
|
|
20038
|
+
lct: (0, _uint.readBits)({
|
|
20039
|
+
exists: {
|
|
20040
|
+
index: 0
|
|
20041
|
+
},
|
|
20042
|
+
interlaced: {
|
|
20043
|
+
index: 1
|
|
20044
|
+
},
|
|
20045
|
+
sort: {
|
|
20046
|
+
index: 2
|
|
20047
|
+
},
|
|
20048
|
+
future: {
|
|
20049
|
+
index: 3,
|
|
20050
|
+
length: 2
|
|
20051
|
+
},
|
|
20052
|
+
size: {
|
|
20053
|
+
index: 5,
|
|
20054
|
+
length: 3
|
|
20055
|
+
}
|
|
20056
|
+
})
|
|
20057
|
+
}]
|
|
20058
|
+
}, (0, _.conditional)({
|
|
20059
|
+
lct: (0, _uint.readArray)(3, function (stream, result, parent) {
|
|
20060
|
+
return Math.pow(2, parent.descriptor.lct.size + 1);
|
|
20061
|
+
})
|
|
20062
|
+
}, function (stream, result, parent) {
|
|
20063
|
+
return parent.descriptor.lct.exists;
|
|
20064
|
+
}), {
|
|
20065
|
+
data: [{
|
|
20066
|
+
minCodeSize: (0, _uint.readByte)()
|
|
20067
|
+
}, subBlocksSchema]
|
|
20068
|
+
}]
|
|
20069
|
+
}, function (stream) {
|
|
20070
|
+
return (0, _uint.peekByte)()(stream) === 0x2c;
|
|
20071
|
+
}); // plain text block
|
|
19893
20072
|
|
|
19894
|
-
|
|
19895
|
-
|
|
19896
|
-
|
|
19897
|
-
|
|
19898
|
-
|
|
19899
|
-
|
|
19900
|
-
|
|
19901
|
-
|
|
19902
|
-
const {
|
|
19903
|
-
viewX: viewX,
|
|
19904
|
-
viewY: viewY
|
|
19905
|
-
} = e,
|
|
19906
|
-
{
|
|
19907
|
-
direction: direction,
|
|
19908
|
-
width: width,
|
|
19909
|
-
height: height,
|
|
19910
|
-
range: range
|
|
19911
|
-
} = this.attribute,
|
|
19912
|
-
sliderSize = this._sliderSize,
|
|
19913
|
-
[min, max] = this._getScrollRange();
|
|
19914
|
-
let currentScrollValue;
|
|
19915
|
-
if ("vertical" === direction) {
|
|
19916
|
-
const relativeY = viewY - this._viewPosition.y,
|
|
19917
|
-
currentYPos = clamp$3(relativeY - sliderSize / 2, min, max);
|
|
19918
|
-
currentScrollValue = relativeY / height, this._slider.setAttribute("y", currentYPos, !0);
|
|
19919
|
-
} else {
|
|
19920
|
-
const relativeX = viewX - this._viewPosition.x,
|
|
19921
|
-
currentXPos = clamp$3(relativeX - sliderSize / 2, min, max);
|
|
19922
|
-
currentScrollValue = relativeX / width, this._slider.setAttribute("x", currentXPos, !0);
|
|
20073
|
+
var textSchema = (0, _.conditional)({
|
|
20074
|
+
text: [{
|
|
20075
|
+
codes: (0, _uint.readBytes)(2)
|
|
20076
|
+
}, {
|
|
20077
|
+
blockSize: (0, _uint.readByte)()
|
|
20078
|
+
}, {
|
|
20079
|
+
preData: function preData(stream, result, parent) {
|
|
20080
|
+
return (0, _uint.readBytes)(parent.text.blockSize)(stream);
|
|
19923
20081
|
}
|
|
19924
|
-
|
|
19925
|
-
|
|
19926
|
-
|
|
19927
|
-
|
|
19928
|
-
|
|
19929
|
-
|
|
19930
|
-
|
|
19931
|
-
|
|
19932
|
-
|
|
19933
|
-
|
|
19934
|
-
|
|
19935
|
-
|
|
19936
|
-
|
|
19937
|
-
|
|
19938
|
-
pos: this._prePos,
|
|
19939
|
-
event: e
|
|
19940
|
-
}), "browser" === vglobal.env ? (vglobal.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
19941
|
-
capture: !0
|
|
19942
|
-
}), vglobal.addEventListener("pointerup", this._onSliderPointerUp)) : (this.stage.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
19943
|
-
capture: !0
|
|
19944
|
-
}), this.stage.addEventListener("pointerup", this._onSliderPointerUp), this.stage.addEventListener("pointerupoutside", this._onSliderPointerUp));
|
|
19945
|
-
}, this._computeScrollValue = e => {
|
|
19946
|
-
const {
|
|
19947
|
-
direction: direction
|
|
19948
|
-
} = this.attribute,
|
|
19949
|
-
{
|
|
19950
|
-
x: x,
|
|
19951
|
-
y: y
|
|
19952
|
-
} = this.stage.eventPointTransform(e);
|
|
19953
|
-
let currentScrollValue,
|
|
19954
|
-
currentPos,
|
|
19955
|
-
delta = 0;
|
|
19956
|
-
const {
|
|
19957
|
-
width: width,
|
|
19958
|
-
height: height
|
|
19959
|
-
} = this.getSliderRenderBounds();
|
|
19960
|
-
return "vertical" === direction ? (currentPos = y, delta = currentPos - this._prePos, currentScrollValue = delta / height) : (currentPos = x, delta = currentPos - this._prePos, currentScrollValue = delta / width), [currentPos, currentScrollValue];
|
|
19961
|
-
}, this._onSliderPointerMove = e => {
|
|
19962
|
-
const {
|
|
19963
|
-
stopSliderMovePropagation = !0
|
|
19964
|
-
} = this.attribute;
|
|
19965
|
-
stopSliderMovePropagation && e.stopPropagation();
|
|
19966
|
-
const preScrollRange = this.getScrollRange(),
|
|
19967
|
-
[currentPos, currentScrollValue] = this._computeScrollValue(e);
|
|
19968
|
-
this.setScrollRange([preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue], !0), this._prePos = currentPos;
|
|
19969
|
-
}, this._onSliderPointerMoveWithDelay = 0 === this.attribute.delayTime ? this._onSliderPointerMove : delayMap[this.attribute.delayType](this._onSliderPointerMove, this.attribute.delayTime), this._onSliderPointerUp = e => {
|
|
19970
|
-
e.preventDefault();
|
|
19971
|
-
const {
|
|
19972
|
-
realTime = !0,
|
|
19973
|
-
range: preRange,
|
|
19974
|
-
limitRange = [0, 1]
|
|
19975
|
-
} = this.attribute,
|
|
19976
|
-
preScrollRange = this.getScrollRange(),
|
|
19977
|
-
[currentPos, currentScrollValue] = this._computeScrollValue(e),
|
|
19978
|
-
range = [preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue];
|
|
19979
|
-
this._dispatchEvent("scrollUp", {
|
|
19980
|
-
pre: preRange,
|
|
19981
|
-
value: clampRange$1(range, limitRange[0], limitRange[1])
|
|
19982
|
-
}), "browser" === vglobal.env ? (vglobal.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
19983
|
-
capture: !0
|
|
19984
|
-
}), vglobal.removeEventListener("pointerup", this._onSliderPointerUp)) : (this.stage.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
19985
|
-
capture: !0
|
|
19986
|
-
}), this.stage.removeEventListener("pointerup", this._onSliderPointerUp), this.stage.removeEventListener("pointerupoutside", this._onSliderPointerUp));
|
|
19987
|
-
};
|
|
19988
|
-
}
|
|
19989
|
-
setScrollRange(range) {
|
|
19990
|
-
let render = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
19991
|
-
const {
|
|
19992
|
-
direction = "horizontal",
|
|
19993
|
-
limitRange = [0, 1],
|
|
19994
|
-
range: preRange,
|
|
19995
|
-
realTime = !0
|
|
19996
|
-
} = this.attribute,
|
|
19997
|
-
currScrollRange = clampRange$1(range, limitRange[0], limitRange[1]);
|
|
19998
|
-
if (render) {
|
|
19999
|
-
const sliderPos = this._getSliderPos(currScrollRange);
|
|
20000
|
-
if (this._slider) {
|
|
20001
|
-
const sliderSize = sliderPos[1] - sliderPos[0];
|
|
20002
|
-
this._sliderSize = sliderSize, "horizontal" === direction ? this._slider.setAttributes({
|
|
20003
|
-
x: sliderPos[0],
|
|
20004
|
-
width: sliderSize
|
|
20005
|
-
}, !0) : this._slider.setAttributes({
|
|
20006
|
-
y: sliderPos[0],
|
|
20007
|
-
height: sliderSize
|
|
20008
|
-
}, !0), this.stage && !this.stage.autoRender && this.stage.renderNextFrame();
|
|
20082
|
+
}, subBlocksSchema]
|
|
20083
|
+
}, function (stream) {
|
|
20084
|
+
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
20085
|
+
return codes[0] === 0x21 && codes[1] === 0x01;
|
|
20086
|
+
}); // application block
|
|
20087
|
+
|
|
20088
|
+
var applicationSchema = (0, _.conditional)({
|
|
20089
|
+
application: [{
|
|
20090
|
+
codes: (0, _uint.readBytes)(2)
|
|
20091
|
+
}, {
|
|
20092
|
+
blockSize: (0, _uint.readByte)()
|
|
20093
|
+
}, {
|
|
20094
|
+
id: function id(stream, result, parent) {
|
|
20095
|
+
return (0, _uint.readString)(parent.blockSize)(stream);
|
|
20009
20096
|
}
|
|
20097
|
+
}, subBlocksSchema]
|
|
20098
|
+
}, function (stream) {
|
|
20099
|
+
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
20100
|
+
return codes[0] === 0x21 && codes[1] === 0xff;
|
|
20101
|
+
}); // comment block
|
|
20102
|
+
|
|
20103
|
+
var commentSchema = (0, _.conditional)({
|
|
20104
|
+
comment: [{
|
|
20105
|
+
codes: (0, _uint.readBytes)(2)
|
|
20106
|
+
}, subBlocksSchema]
|
|
20107
|
+
}, function (stream) {
|
|
20108
|
+
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
20109
|
+
return codes[0] === 0x21 && codes[1] === 0xfe;
|
|
20110
|
+
});
|
|
20111
|
+
var schema = [{
|
|
20112
|
+
header: [{
|
|
20113
|
+
signature: (0, _uint.readString)(3)
|
|
20114
|
+
}, {
|
|
20115
|
+
version: (0, _uint.readString)(3)
|
|
20116
|
+
}]
|
|
20117
|
+
}, {
|
|
20118
|
+
lsd: [{
|
|
20119
|
+
width: (0, _uint.readUnsigned)(true)
|
|
20120
|
+
}, {
|
|
20121
|
+
height: (0, _uint.readUnsigned)(true)
|
|
20122
|
+
}, {
|
|
20123
|
+
gct: (0, _uint.readBits)({
|
|
20124
|
+
exists: {
|
|
20125
|
+
index: 0
|
|
20126
|
+
},
|
|
20127
|
+
resolution: {
|
|
20128
|
+
index: 1,
|
|
20129
|
+
length: 3
|
|
20130
|
+
},
|
|
20131
|
+
sort: {
|
|
20132
|
+
index: 4
|
|
20133
|
+
},
|
|
20134
|
+
size: {
|
|
20135
|
+
index: 5,
|
|
20136
|
+
length: 3
|
|
20137
|
+
}
|
|
20138
|
+
})
|
|
20139
|
+
}, {
|
|
20140
|
+
backgroundColorIndex: (0, _uint.readByte)()
|
|
20141
|
+
}, {
|
|
20142
|
+
pixelAspectRatio: (0, _uint.readByte)()
|
|
20143
|
+
}]
|
|
20144
|
+
}, (0, _.conditional)({
|
|
20145
|
+
gct: (0, _uint.readArray)(3, function (stream, result) {
|
|
20146
|
+
return Math.pow(2, result.lsd.gct.size + 1);
|
|
20147
|
+
})
|
|
20148
|
+
}, function (stream, result) {
|
|
20149
|
+
return result.lsd.gct.exists;
|
|
20150
|
+
}),
|
|
20151
|
+
// content frames
|
|
20152
|
+
{
|
|
20153
|
+
frames: (0, _.loop)([gceSchema, applicationSchema, commentSchema, imageSchema, textSchema], function (stream) {
|
|
20154
|
+
var nextCode = (0, _uint.peekByte)()(stream); // rather than check for a terminator, we should check for the existence
|
|
20155
|
+
// of an ext or image block to avoid infinite loops
|
|
20156
|
+
//var terminator = 0x3B;
|
|
20157
|
+
//return nextCode !== terminator;
|
|
20158
|
+
|
|
20159
|
+
return nextCode === 0x21 || nextCode === 0x2c;
|
|
20160
|
+
})
|
|
20161
|
+
}];
|
|
20162
|
+
var _default = schema;
|
|
20163
|
+
exports["default"] = _default;
|
|
20164
|
+
})(gif);
|
|
20165
|
+
|
|
20166
|
+
var deinterlace$1 = {};
|
|
20167
|
+
|
|
20168
|
+
Object.defineProperty(deinterlace$1, "__esModule", {
|
|
20169
|
+
value: true
|
|
20170
|
+
});
|
|
20171
|
+
deinterlace$1.deinterlace = void 0;
|
|
20172
|
+
|
|
20173
|
+
/**
|
|
20174
|
+
* Deinterlace function from https://github.com/shachaf/jsgif
|
|
20175
|
+
*/
|
|
20176
|
+
var deinterlace = function deinterlace(pixels, width) {
|
|
20177
|
+
var newPixels = new Array(pixels.length);
|
|
20178
|
+
var rows = pixels.length / width;
|
|
20179
|
+
var cpRow = function cpRow(toRow, fromRow) {
|
|
20180
|
+
var fromPixels = pixels.slice(fromRow * width, (fromRow + 1) * width);
|
|
20181
|
+
newPixels.splice.apply(newPixels, [toRow * width, width].concat(fromPixels));
|
|
20182
|
+
}; // See appendix E.
|
|
20183
|
+
|
|
20184
|
+
var offsets = [0, 4, 2, 1];
|
|
20185
|
+
var steps = [8, 8, 4, 2];
|
|
20186
|
+
var fromRow = 0;
|
|
20187
|
+
for (var pass = 0; pass < 4; pass++) {
|
|
20188
|
+
for (var toRow = offsets[pass]; toRow < rows; toRow += steps[pass]) {
|
|
20189
|
+
cpRow(toRow, fromRow);
|
|
20190
|
+
fromRow++;
|
|
20010
20191
|
}
|
|
20011
|
-
this.attribute.range = currScrollRange, realTime && this._dispatchEvent(SCROLLBAR_EVENT, {
|
|
20012
|
-
pre: preRange,
|
|
20013
|
-
value: currScrollRange
|
|
20014
|
-
});
|
|
20015
|
-
}
|
|
20016
|
-
getScrollRange() {
|
|
20017
|
-
return this.attribute.range;
|
|
20018
|
-
}
|
|
20019
|
-
bindEvents() {
|
|
20020
|
-
if (this.attribute.disableTriggerEvent) return;
|
|
20021
|
-
const {
|
|
20022
|
-
delayType = "throttle",
|
|
20023
|
-
delayTime = 0
|
|
20024
|
-
} = this.attribute;
|
|
20025
|
-
this._rail && this._rail.addEventListener("pointerdown", delayMap[delayType](this._onRailPointerDown, delayTime)), this._slider && this._slider.addEventListener("pointerdown", this._onSliderPointerDown);
|
|
20026
|
-
}
|
|
20027
|
-
render() {
|
|
20028
|
-
this._reset();
|
|
20029
|
-
const {
|
|
20030
|
-
direction = "horizontal",
|
|
20031
|
-
width: width,
|
|
20032
|
-
height: height,
|
|
20033
|
-
range: range,
|
|
20034
|
-
limitRange = [0, 1],
|
|
20035
|
-
railStyle: railStyle,
|
|
20036
|
-
sliderStyle: sliderStyle,
|
|
20037
|
-
padding = 2
|
|
20038
|
-
} = this.attribute,
|
|
20039
|
-
group = this.createOrUpdateChild("scrollbar-container", {}, "group"),
|
|
20040
|
-
rail = group.createOrUpdateChild("scrollbar-rail", Object.assign({
|
|
20041
|
-
x: 0,
|
|
20042
|
-
y: 0,
|
|
20043
|
-
width: width,
|
|
20044
|
-
height: height
|
|
20045
|
-
}, railStyle), "rect");
|
|
20046
|
-
this._rail = rail;
|
|
20047
|
-
const sliderRenderBounds = this.getSliderRenderBounds(),
|
|
20048
|
-
sliderPos = this._getSliderPos(clampRange$1(range, limitRange[0], limitRange[1])),
|
|
20049
|
-
sliderSize = sliderPos[1] - sliderPos[0];
|
|
20050
|
-
let sliderAttribute;
|
|
20051
|
-
this._sliderSize = sliderSize, sliderAttribute = "horizontal" === direction ? {
|
|
20052
|
-
x: sliderPos[0],
|
|
20053
|
-
y: sliderRenderBounds.y1,
|
|
20054
|
-
width: sliderSize,
|
|
20055
|
-
height: sliderRenderBounds.height
|
|
20056
|
-
} : {
|
|
20057
|
-
x: sliderRenderBounds.x1,
|
|
20058
|
-
y: sliderPos[0],
|
|
20059
|
-
width: sliderRenderBounds.width,
|
|
20060
|
-
height: sliderSize
|
|
20061
|
-
};
|
|
20062
|
-
const slider = group.createOrUpdateChild("slider", Object.assign(Object.assign(Object.assign(Object.assign({}, sliderAttribute), {
|
|
20063
|
-
cornerRadius: this._getDefaultSliderCornerRadius()
|
|
20064
|
-
}), sliderStyle), {
|
|
20065
|
-
boundsPadding: normalizePadding(padding),
|
|
20066
|
-
pickMode: "imprecise"
|
|
20067
|
-
}), "rect");
|
|
20068
|
-
this._slider = slider, this._container = group;
|
|
20069
|
-
const containerAABBBounds = this._container.AABBBounds;
|
|
20070
|
-
this._viewPosition = {
|
|
20071
|
-
x: containerAABBBounds.x1,
|
|
20072
|
-
y: containerAABBBounds.y1
|
|
20073
|
-
};
|
|
20074
|
-
}
|
|
20075
|
-
getSliderRenderBounds() {
|
|
20076
|
-
if (this._sliderRenderBounds) return this._sliderRenderBounds;
|
|
20077
|
-
const {
|
|
20078
|
-
width: width,
|
|
20079
|
-
height: height,
|
|
20080
|
-
padding = 2
|
|
20081
|
-
} = this.attribute,
|
|
20082
|
-
[top, right, bottom, left] = normalizePadding(padding),
|
|
20083
|
-
renderBounds = {
|
|
20084
|
-
x1: left,
|
|
20085
|
-
y1: top,
|
|
20086
|
-
x2: width - right,
|
|
20087
|
-
y2: height - bottom,
|
|
20088
|
-
width: Math.max(0, width - (left + right)),
|
|
20089
|
-
height: Math.max(0, height - (top + bottom))
|
|
20090
|
-
};
|
|
20091
|
-
return this._sliderRenderBounds = renderBounds, renderBounds;
|
|
20092
|
-
}
|
|
20093
|
-
_getDefaultSliderCornerRadius() {
|
|
20094
|
-
const {
|
|
20095
|
-
direction: direction,
|
|
20096
|
-
round: round
|
|
20097
|
-
} = this.attribute;
|
|
20098
|
-
if (round) {
|
|
20099
|
-
const {
|
|
20100
|
-
width: width,
|
|
20101
|
-
height: height
|
|
20102
|
-
} = this.getSliderRenderBounds();
|
|
20103
|
-
return "horizontal" === direction ? height : width;
|
|
20104
|
-
}
|
|
20105
|
-
return 0;
|
|
20106
|
-
}
|
|
20107
|
-
_getSliderPos(range) {
|
|
20108
|
-
const {
|
|
20109
|
-
direction: direction
|
|
20110
|
-
} = this.attribute,
|
|
20111
|
-
{
|
|
20112
|
-
width: width,
|
|
20113
|
-
height: height,
|
|
20114
|
-
x1: x1,
|
|
20115
|
-
y1: y1
|
|
20116
|
-
} = this.getSliderRenderBounds();
|
|
20117
|
-
return "horizontal" === direction ? [width * range[0] + x1, width * range[1] + x1] : [height * range[0] + y1, height * range[1] + y1];
|
|
20118
20192
|
}
|
|
20119
|
-
|
|
20120
|
-
|
|
20121
|
-
|
|
20122
|
-
|
|
20123
|
-
|
|
20124
|
-
|
|
20125
|
-
|
|
20126
|
-
|
|
20127
|
-
|
|
20128
|
-
|
|
20129
|
-
|
|
20130
|
-
|
|
20131
|
-
|
|
20132
|
-
|
|
20133
|
-
|
|
20193
|
+
return newPixels;
|
|
20194
|
+
};
|
|
20195
|
+
deinterlace$1.deinterlace = deinterlace;
|
|
20196
|
+
|
|
20197
|
+
var lzw$1 = {};
|
|
20198
|
+
|
|
20199
|
+
Object.defineProperty(lzw$1, "__esModule", {
|
|
20200
|
+
value: true
|
|
20201
|
+
});
|
|
20202
|
+
lzw$1.lzw = void 0;
|
|
20203
|
+
|
|
20204
|
+
/**
|
|
20205
|
+
* javascript port of java LZW decompression
|
|
20206
|
+
* Original java author url: https://gist.github.com/devunwired/4479231
|
|
20207
|
+
*/
|
|
20208
|
+
var lzw = function lzw(minCodeSize, data, pixelCount) {
|
|
20209
|
+
var MAX_STACK_SIZE = 4096;
|
|
20210
|
+
var nullCode = -1;
|
|
20211
|
+
var npix = pixelCount;
|
|
20212
|
+
var available, clear, code_mask, code_size, end_of_information, in_code, old_code, bits, code, i, datum, data_size, first, top, bi, pi;
|
|
20213
|
+
var dstPixels = new Array(pixelCount);
|
|
20214
|
+
var prefix = new Array(MAX_STACK_SIZE);
|
|
20215
|
+
var suffix = new Array(MAX_STACK_SIZE);
|
|
20216
|
+
var pixelStack = new Array(MAX_STACK_SIZE + 1); // Initialize GIF data stream decoder.
|
|
20217
|
+
|
|
20218
|
+
data_size = minCodeSize;
|
|
20219
|
+
clear = 1 << data_size;
|
|
20220
|
+
end_of_information = clear + 1;
|
|
20221
|
+
available = clear + 2;
|
|
20222
|
+
old_code = nullCode;
|
|
20223
|
+
code_size = data_size + 1;
|
|
20224
|
+
code_mask = (1 << code_size) - 1;
|
|
20225
|
+
for (code = 0; code < clear; code++) {
|
|
20226
|
+
prefix[code] = 0;
|
|
20227
|
+
suffix[code] = code;
|
|
20228
|
+
} // Decode GIF pixel stream.
|
|
20229
|
+
|
|
20230
|
+
var datum, bits, first, top, pi, bi;
|
|
20231
|
+
datum = bits = first = top = pi = bi = 0;
|
|
20232
|
+
for (i = 0; i < npix;) {
|
|
20233
|
+
if (top === 0) {
|
|
20234
|
+
if (bits < code_size) {
|
|
20235
|
+
// get the next byte
|
|
20236
|
+
datum += data[bi] << bits;
|
|
20237
|
+
bits += 8;
|
|
20238
|
+
bi++;
|
|
20239
|
+
continue;
|
|
20240
|
+
} // Get the next code.
|
|
20241
|
+
|
|
20242
|
+
code = datum & code_mask;
|
|
20243
|
+
datum >>= code_size;
|
|
20244
|
+
bits -= code_size; // Interpret the code
|
|
20245
|
+
|
|
20246
|
+
if (code > available || code == end_of_information) {
|
|
20247
|
+
break;
|
|
20248
|
+
}
|
|
20249
|
+
if (code == clear) {
|
|
20250
|
+
// Reset decoder.
|
|
20251
|
+
code_size = data_size + 1;
|
|
20252
|
+
code_mask = (1 << code_size) - 1;
|
|
20253
|
+
available = clear + 2;
|
|
20254
|
+
old_code = nullCode;
|
|
20255
|
+
continue;
|
|
20256
|
+
}
|
|
20257
|
+
if (old_code == nullCode) {
|
|
20258
|
+
pixelStack[top++] = suffix[code];
|
|
20259
|
+
old_code = code;
|
|
20260
|
+
first = code;
|
|
20261
|
+
continue;
|
|
20262
|
+
}
|
|
20263
|
+
in_code = code;
|
|
20264
|
+
if (code == available) {
|
|
20265
|
+
pixelStack[top++] = first;
|
|
20266
|
+
code = old_code;
|
|
20267
|
+
}
|
|
20268
|
+
while (code > clear) {
|
|
20269
|
+
pixelStack[top++] = suffix[code];
|
|
20270
|
+
code = prefix[code];
|
|
20271
|
+
}
|
|
20272
|
+
first = suffix[code] & 0xff;
|
|
20273
|
+
pixelStack[top++] = first; // add a new string to the table, but only if space is available
|
|
20274
|
+
// if not, just continue with current table until a clear code is found
|
|
20275
|
+
// (deferred clear code implementation as per GIF spec)
|
|
20276
|
+
|
|
20277
|
+
if (available < MAX_STACK_SIZE) {
|
|
20278
|
+
prefix[available] = old_code;
|
|
20279
|
+
suffix[available] = first;
|
|
20280
|
+
available++;
|
|
20281
|
+
if ((available & code_mask) === 0 && available < MAX_STACK_SIZE) {
|
|
20282
|
+
code_size++;
|
|
20283
|
+
code_mask += available;
|
|
20284
|
+
}
|
|
20285
|
+
}
|
|
20286
|
+
old_code = in_code;
|
|
20287
|
+
} // Pop a pixel off the pixel stack.
|
|
20288
|
+
|
|
20289
|
+
top--;
|
|
20290
|
+
dstPixels[pi++] = pixelStack[top];
|
|
20291
|
+
i++;
|
|
20134
20292
|
}
|
|
20135
|
-
|
|
20136
|
-
|
|
20293
|
+
for (i = pi; i < npix; i++) {
|
|
20294
|
+
dstPixels[i] = 0; // clear missing pixels
|
|
20137
20295
|
}
|
|
20296
|
+
|
|
20297
|
+
return dstPixels;
|
|
20298
|
+
};
|
|
20299
|
+
lzw$1.lzw = lzw;
|
|
20300
|
+
|
|
20301
|
+
Object.defineProperty(lib$1, "__esModule", {
|
|
20302
|
+
value: true
|
|
20303
|
+
});
|
|
20304
|
+
var decompressFrames_1 = lib$1.decompressFrames = lib$1.decompressFrame = parseGIF_1 = lib$1.parseGIF = void 0;
|
|
20305
|
+
var _gif = _interopRequireDefault(gif);
|
|
20306
|
+
var _jsBinarySchemaParser = lib;
|
|
20307
|
+
var _uint = uint8;
|
|
20308
|
+
var _deinterlace = deinterlace$1;
|
|
20309
|
+
var _lzw = lzw$1;
|
|
20310
|
+
function _interopRequireDefault(obj) {
|
|
20311
|
+
return obj && obj.__esModule ? obj : {
|
|
20312
|
+
"default": obj
|
|
20313
|
+
};
|
|
20138
20314
|
}
|
|
20139
|
-
|
|
20140
|
-
|
|
20141
|
-
|
|
20142
|
-
|
|
20143
|
-
|
|
20144
|
-
|
|
20145
|
-
|
|
20146
|
-
|
|
20147
|
-
|
|
20148
|
-
|
|
20149
|
-
|
|
20150
|
-
|
|
20151
|
-
|
|
20152
|
-
|
|
20153
|
-
|
|
20315
|
+
var parseGIF = function parseGIF(arrayBuffer) {
|
|
20316
|
+
var byteData = new Uint8Array(arrayBuffer);
|
|
20317
|
+
return (0, _jsBinarySchemaParser.parse)((0, _uint.buildStream)(byteData), _gif["default"]);
|
|
20318
|
+
};
|
|
20319
|
+
var parseGIF_1 = lib$1.parseGIF = parseGIF;
|
|
20320
|
+
var generatePatch = function generatePatch(image) {
|
|
20321
|
+
var totalPixels = image.pixels.length;
|
|
20322
|
+
var patchData = new Uint8ClampedArray(totalPixels * 4);
|
|
20323
|
+
for (var i = 0; i < totalPixels; i++) {
|
|
20324
|
+
var pos = i * 4;
|
|
20325
|
+
var colorIndex = image.pixels[i];
|
|
20326
|
+
var color = image.colorTable[colorIndex] || [0, 0, 0];
|
|
20327
|
+
patchData[pos] = color[0];
|
|
20328
|
+
patchData[pos + 1] = color[1];
|
|
20329
|
+
patchData[pos + 2] = color[2];
|
|
20330
|
+
patchData[pos + 3] = colorIndex !== image.transparentIndex ? 255 : 0;
|
|
20331
|
+
}
|
|
20332
|
+
return patchData;
|
|
20154
20333
|
};
|
|
20334
|
+
var decompressFrame = function decompressFrame(frame, gct, buildImagePatch) {
|
|
20335
|
+
if (!frame.image) {
|
|
20336
|
+
return;
|
|
20337
|
+
}
|
|
20338
|
+
var image = frame.image; // get the number of pixels
|
|
20155
20339
|
|
|
20156
|
-
|
|
20157
|
-
|
|
20158
|
-
|
|
20159
|
-
|
|
20340
|
+
var totalPixels = image.descriptor.width * image.descriptor.height; // do lzw decompression
|
|
20341
|
+
|
|
20342
|
+
var pixels = (0, _lzw.lzw)(image.data.minCodeSize, image.data.blocks, totalPixels); // deal with interlacing if necessary
|
|
20343
|
+
|
|
20344
|
+
if (image.descriptor.lct.interlaced) {
|
|
20345
|
+
pixels = (0, _deinterlace.deinterlace)(pixels, image.descriptor.width);
|
|
20346
|
+
}
|
|
20347
|
+
var resultImage = {
|
|
20348
|
+
pixels: pixels,
|
|
20349
|
+
dims: {
|
|
20350
|
+
top: frame.image.descriptor.top,
|
|
20351
|
+
left: frame.image.descriptor.left,
|
|
20352
|
+
width: frame.image.descriptor.width,
|
|
20353
|
+
height: frame.image.descriptor.height
|
|
20354
|
+
}
|
|
20355
|
+
}; // color table
|
|
20356
|
+
|
|
20357
|
+
if (image.descriptor.lct && image.descriptor.lct.exists) {
|
|
20358
|
+
resultImage.colorTable = image.lct;
|
|
20359
|
+
} else {
|
|
20360
|
+
resultImage.colorTable = gct;
|
|
20361
|
+
} // add per frame relevant gce information
|
|
20362
|
+
|
|
20363
|
+
if (frame.gce) {
|
|
20364
|
+
resultImage.delay = (frame.gce.delay || 10) * 10; // convert to ms
|
|
20365
|
+
|
|
20366
|
+
resultImage.disposalType = frame.gce.extras.disposal; // transparency
|
|
20367
|
+
|
|
20368
|
+
if (frame.gce.extras.transparentColorGiven) {
|
|
20369
|
+
resultImage.transparentIndex = frame.gce.transparentColorIndex;
|
|
20370
|
+
}
|
|
20371
|
+
} // create canvas usable imagedata if desired
|
|
20372
|
+
|
|
20373
|
+
if (buildImagePatch) {
|
|
20374
|
+
resultImage.patch = generatePatch(resultImage);
|
|
20375
|
+
}
|
|
20376
|
+
return resultImage;
|
|
20377
|
+
};
|
|
20378
|
+
lib$1.decompressFrame = decompressFrame;
|
|
20379
|
+
var decompressFrames = function decompressFrames(parsedGif, buildImagePatches) {
|
|
20380
|
+
return parsedGif.frames.filter(function (f) {
|
|
20381
|
+
return f.image;
|
|
20382
|
+
}).map(function (f) {
|
|
20383
|
+
return decompressFrame(f, parsedGif.gct, buildImagePatches);
|
|
20160
20384
|
});
|
|
20385
|
+
};
|
|
20386
|
+
decompressFrames_1 = lib$1.decompressFrames = decompressFrames;
|
|
20387
|
+
|
|
20388
|
+
const browser$1 = isBrowserEnv();
|
|
20389
|
+
|
|
20390
|
+
function _registerArc() {
|
|
20391
|
+
_registerArc.__loaded || (_registerArc.__loaded = !0, registerArcGraphic(), container.load(arcModule), container.load(browser$1 ? arcCanvasPickModule : arcMathPickModule));
|
|
20161
20392
|
}
|
|
20393
|
+
_registerArc.__loaded = !1;
|
|
20394
|
+
const registerArc = _registerArc;
|
|
20162
20395
|
|
|
20163
|
-
function
|
|
20164
|
-
|
|
20396
|
+
function _registerCircle() {
|
|
20397
|
+
_registerCircle.__loaded || (_registerCircle.__loaded = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser$1 ? circleCanvasPickModule : circleMathPickModule));
|
|
20165
20398
|
}
|
|
20166
|
-
|
|
20167
|
-
|
|
20168
|
-
|
|
20399
|
+
_registerCircle.__loaded = !1;
|
|
20400
|
+
const registerCircle = _registerCircle;
|
|
20401
|
+
|
|
20402
|
+
function _registerGroup() {
|
|
20403
|
+
_registerGroup.__loaded || (_registerGroup.__loaded = !0, registerGroupGraphic());
|
|
20169
20404
|
}
|
|
20170
|
-
|
|
20171
|
-
|
|
20172
|
-
|
|
20405
|
+
_registerGroup.__loaded = !1;
|
|
20406
|
+
const registerGroup = _registerGroup;
|
|
20407
|
+
|
|
20408
|
+
function _registerImage() {
|
|
20409
|
+
_registerImage.__loaded || (_registerImage.__loaded = !0, registerImageGraphic(), container.load(imageModule), container.load(browser$1 ? imageCanvasPickModule : imageMathPickModule));
|
|
20173
20410
|
}
|
|
20174
|
-
|
|
20175
|
-
|
|
20176
|
-
|
|
20177
|
-
|
|
20178
|
-
|
|
20179
|
-
return Math.acos(Math.min(Math.max(cosine, -1), 1));
|
|
20411
|
+
_registerImage.__loaded = !1;
|
|
20412
|
+
const registerImage = _registerImage;
|
|
20413
|
+
|
|
20414
|
+
function _registerLine() {
|
|
20415
|
+
_registerLine.__loaded || (_registerLine.__loaded = !0, registerLineGraphic(), container.load(lineModule), container.load(browser$1 ? lineCanvasPickModule : lineMathPickModule));
|
|
20180
20416
|
}
|
|
20181
|
-
|
|
20182
|
-
|
|
20183
|
-
|
|
20184
|
-
|
|
20417
|
+
_registerLine.__loaded = !1;
|
|
20418
|
+
const registerLine = _registerLine;
|
|
20419
|
+
|
|
20420
|
+
function _registerPath() {
|
|
20421
|
+
_registerPath.__loaded || (_registerPath.__loaded = !0, registerPathGraphic(), container.load(pathModule), container.load(browser$1 ? pathCanvasPickModule : pathMathPickModule));
|
|
20185
20422
|
}
|
|
20423
|
+
_registerPath.__loaded = !1;
|
|
20424
|
+
const registerPath = _registerPath;
|
|
20186
20425
|
|
|
20187
|
-
|
|
20188
|
-
|
|
20189
|
-
fontFamily: DEFAULT_TEXT_FONT_FAMILY$1,
|
|
20190
|
-
fontSize: DEFAULT_TEXT_FONT_SIZE$1
|
|
20191
|
-
}, defaultFontParams),
|
|
20192
|
-
getTextBounds: useNaiveCanvas ? void 0 : getTextBounds,
|
|
20193
|
-
specialCharSet: "-/: .,@%'\"~" + TextMeasure$1.ALPHABET_CHAR_SET + TextMeasure$1.ALPHABET_CHAR_SET.toUpperCase()
|
|
20194
|
-
}, null != option ? option : {}), textSpec);
|
|
20195
|
-
function measureTextSize(text, textSpec) {
|
|
20196
|
-
let defaultTextTheme = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
20197
|
-
if (!text) return {
|
|
20198
|
-
width: 0,
|
|
20199
|
-
height: 0
|
|
20200
|
-
};
|
|
20201
|
-
const bounds = getTextBounds({
|
|
20202
|
-
text: text,
|
|
20203
|
-
fontFamily: textSpec.fontFamily || defaultTextTheme.fontFamily || DEFAULT_TEXT_FONT_FAMILY$1,
|
|
20204
|
-
fontSize: textSpec.fontSize || defaultTextTheme.fontSize || 12,
|
|
20205
|
-
fontWeight: textSpec.fontWeight || defaultTextTheme.fontWeight,
|
|
20206
|
-
textAlign: textSpec.textAlign || "center",
|
|
20207
|
-
textBaseline: textSpec.textBaseline,
|
|
20208
|
-
ellipsis: !!textSpec.ellipsis,
|
|
20209
|
-
maxLineWidth: textSpec.maxLineWidth || 1 / 0,
|
|
20210
|
-
lineHeight: textSpec.fontSize || defaultTextTheme.fontSize || 12
|
|
20211
|
-
});
|
|
20212
|
-
return {
|
|
20213
|
-
width: bounds.width(),
|
|
20214
|
-
height: bounds.height()
|
|
20215
|
-
};
|
|
20426
|
+
function _registerPolygon() {
|
|
20427
|
+
_registerPolygon.__loaded || (_registerPolygon.__loaded = !0, registerPolygonGraphic(), container.load(polygonModule), container.load(browser$1 ? polygonCanvasPickModule : polygonMathPickModule));
|
|
20216
20428
|
}
|
|
20217
|
-
|
|
20218
|
-
|
|
20219
|
-
|
|
20429
|
+
_registerPolygon.__loaded = !1;
|
|
20430
|
+
const registerPolygon = _registerPolygon;
|
|
20431
|
+
|
|
20432
|
+
function _registerRect() {
|
|
20433
|
+
_registerRect.__loaded || (_registerRect.__loaded = !0, registerRectGraphic(), container.load(rectModule), container.load(browser$1 ? rectCanvasPickModule : rectMathPickModule));
|
|
20220
20434
|
}
|
|
20221
|
-
|
|
20222
|
-
|
|
20223
|
-
|
|
20224
|
-
|
|
20435
|
+
_registerRect.__loaded = !1;
|
|
20436
|
+
const registerRect = _registerRect;
|
|
20437
|
+
|
|
20438
|
+
function _registerRichtext() {
|
|
20439
|
+
_registerRichtext.__loaded || (_registerRichtext.__loaded = !0, registerRichtextGraphic(), container.load(richtextModule), container.load(browser$1 ? richtextCanvasPickModule : richTextMathPickModule));
|
|
20225
20440
|
}
|
|
20226
|
-
|
|
20227
|
-
|
|
20228
|
-
|
|
20441
|
+
_registerRichtext.__loaded = !1;
|
|
20442
|
+
const registerRichtext = _registerRichtext;
|
|
20443
|
+
|
|
20444
|
+
function _registerShadowRoot() {
|
|
20445
|
+
_registerShadowRoot.__loaded || (_registerShadowRoot.__loaded = !0, registerShadowRootGraphic());
|
|
20229
20446
|
}
|
|
20230
|
-
|
|
20231
|
-
|
|
20232
|
-
|
|
20233
|
-
|
|
20234
|
-
|
|
20235
|
-
|
|
20236
|
-
|
|
20237
|
-
|
|
20447
|
+
_registerShadowRoot.__loaded = !1;
|
|
20448
|
+
const registerShadowRoot = _registerShadowRoot;
|
|
20449
|
+
|
|
20450
|
+
function _registerSymbol() {
|
|
20451
|
+
_registerSymbol.__loaded || (_registerSymbol.__loaded = !0, registerSymbolGraphic(), container.load(symbolModule), container.load(browser$1 ? symbolCanvasPickModule : symbolMathPickModule));
|
|
20452
|
+
}
|
|
20453
|
+
_registerSymbol.__loaded = !1;
|
|
20454
|
+
const registerSymbol = _registerSymbol;
|
|
20455
|
+
|
|
20456
|
+
function _registerText() {
|
|
20457
|
+
_registerText.__loaded || (_registerText.__loaded = !0, registerTextGraphic(), container.load(textModule), container.load(browser$1 ? textCanvasPickModule : textMathPickModule));
|
|
20458
|
+
}
|
|
20459
|
+
_registerText.__loaded = !1;
|
|
20460
|
+
const registerText = _registerText;
|
|
20461
|
+
|
|
20462
|
+
function _registerWrapText() {
|
|
20463
|
+
_registerWrapText.__loaded || (_registerWrapText.__loaded = !0, registerWrapTextGraphic());
|
|
20464
|
+
}
|
|
20465
|
+
_registerWrapText.__loaded = !1;
|
|
20466
|
+
const registerWrapText = _registerWrapText;
|
|
20467
|
+
|
|
20468
|
+
function loadScrollbarComponent() {
|
|
20469
|
+
registerGroup(), registerRect();
|
|
20470
|
+
}
|
|
20471
|
+
|
|
20472
|
+
const DEFAULT_TEXT_FONT_FAMILY$1 = "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";
|
|
20473
|
+
const DEFAULT_TEXT_FONT_SIZE$1 = 14;
|
|
20474
|
+
var StateValue;
|
|
20475
|
+
!function (StateValue) {
|
|
20476
|
+
StateValue.selected = "selected", StateValue.selectedReverse = "selected_reverse", StateValue.hover = "hover", StateValue.hoverReverse = "hover_reverse";
|
|
20477
|
+
}(StateValue || (StateValue = {}));
|
|
20478
|
+
const DEFAULT_STATES$2 = {
|
|
20479
|
+
[StateValue.selectedReverse]: {},
|
|
20480
|
+
[StateValue.selected]: {},
|
|
20481
|
+
[StateValue.hover]: {},
|
|
20482
|
+
[StateValue.hoverReverse]: {}
|
|
20483
|
+
};
|
|
20484
|
+
const DEFAULT_HTML_TEXT_SPEC = {
|
|
20485
|
+
container: "",
|
|
20486
|
+
width: 30,
|
|
20487
|
+
height: 30,
|
|
20488
|
+
style: {}
|
|
20489
|
+
};
|
|
20490
|
+
const SCROLLBAR_EVENT = "scrollDrag";
|
|
20491
|
+
|
|
20492
|
+
const delayMap = {
|
|
20493
|
+
debounce: debounce$1,
|
|
20494
|
+
throttle: throttle$1
|
|
20495
|
+
};
|
|
20496
|
+
loadScrollbarComponent();
|
|
20497
|
+
class ScrollBar extends AbstractComponent {
|
|
20498
|
+
constructor(attributes, options) {
|
|
20499
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, ScrollBar.defaultAttributes, attributes)), this.name = "scrollbar", this._onRailPointerDown = e => {
|
|
20500
|
+
const {
|
|
20501
|
+
viewX: viewX,
|
|
20502
|
+
viewY: viewY
|
|
20503
|
+
} = e,
|
|
20504
|
+
{
|
|
20505
|
+
direction: direction,
|
|
20506
|
+
width: width,
|
|
20507
|
+
height: height,
|
|
20508
|
+
range: range
|
|
20509
|
+
} = this.attribute,
|
|
20510
|
+
sliderSize = this._sliderSize,
|
|
20511
|
+
[min, max] = this._getScrollRange();
|
|
20512
|
+
let currentScrollValue;
|
|
20513
|
+
if ("vertical" === direction) {
|
|
20514
|
+
const relativeY = viewY - this._viewPosition.y,
|
|
20515
|
+
currentYPos = clamp$3(relativeY - sliderSize / 2, min, max);
|
|
20516
|
+
currentScrollValue = relativeY / height, this._slider.setAttribute("y", currentYPos, !0);
|
|
20517
|
+
} else {
|
|
20518
|
+
const relativeX = viewX - this._viewPosition.x,
|
|
20519
|
+
currentXPos = clamp$3(relativeX - sliderSize / 2, min, max);
|
|
20520
|
+
currentScrollValue = relativeX / width, this._slider.setAttribute("x", currentXPos, !0);
|
|
20521
|
+
}
|
|
20522
|
+
this.setScrollRange([currentScrollValue - (range[1] - range[0]) / 2, currentScrollValue + (range[1] - range[0]) / 2], !1), this.stage && !this.stage.autoRender && this.stage.renderNextFrame();
|
|
20523
|
+
}, this._onSliderPointerDown = e => {
|
|
20524
|
+
const {
|
|
20525
|
+
stopSliderDownPropagation = !0
|
|
20526
|
+
} = this.attribute;
|
|
20527
|
+
stopSliderDownPropagation && e.stopPropagation();
|
|
20528
|
+
const {
|
|
20529
|
+
direction: direction
|
|
20530
|
+
} = this.attribute,
|
|
20531
|
+
{
|
|
20532
|
+
x: x,
|
|
20533
|
+
y: y
|
|
20534
|
+
} = this.stage.eventPointTransform(e);
|
|
20535
|
+
this._prePos = "horizontal" === direction ? x : y, this._dispatchEvent("scrollDown", {
|
|
20536
|
+
pos: this._prePos,
|
|
20537
|
+
event: e
|
|
20538
|
+
}), "browser" === vglobal.env ? (vglobal.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
20539
|
+
capture: !0
|
|
20540
|
+
}), vglobal.addEventListener("pointerup", this._onSliderPointerUp)) : (this.stage.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
20541
|
+
capture: !0
|
|
20542
|
+
}), this.stage.addEventListener("pointerup", this._onSliderPointerUp), this.stage.addEventListener("pointerupoutside", this._onSliderPointerUp));
|
|
20543
|
+
}, this._computeScrollValue = e => {
|
|
20544
|
+
const {
|
|
20545
|
+
direction: direction
|
|
20546
|
+
} = this.attribute,
|
|
20547
|
+
{
|
|
20548
|
+
x: x,
|
|
20549
|
+
y: y
|
|
20550
|
+
} = this.stage.eventPointTransform(e);
|
|
20551
|
+
let currentScrollValue,
|
|
20552
|
+
currentPos,
|
|
20553
|
+
delta = 0;
|
|
20554
|
+
const {
|
|
20555
|
+
width: width,
|
|
20556
|
+
height: height
|
|
20557
|
+
} = this.getSliderRenderBounds();
|
|
20558
|
+
return "vertical" === direction ? (currentPos = y, delta = currentPos - this._prePos, currentScrollValue = delta / height) : (currentPos = x, delta = currentPos - this._prePos, currentScrollValue = delta / width), [currentPos, currentScrollValue];
|
|
20559
|
+
}, this._onSliderPointerMove = e => {
|
|
20560
|
+
const {
|
|
20561
|
+
stopSliderMovePropagation = !0
|
|
20562
|
+
} = this.attribute;
|
|
20563
|
+
stopSliderMovePropagation && e.stopPropagation();
|
|
20564
|
+
const preScrollRange = this.getScrollRange(),
|
|
20565
|
+
[currentPos, currentScrollValue] = this._computeScrollValue(e);
|
|
20566
|
+
this.setScrollRange([preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue], !0), this._prePos = currentPos;
|
|
20567
|
+
}, this._onSliderPointerMoveWithDelay = 0 === this.attribute.delayTime ? this._onSliderPointerMove : delayMap[this.attribute.delayType](this._onSliderPointerMove, this.attribute.delayTime), this._onSliderPointerUp = e => {
|
|
20568
|
+
e.preventDefault();
|
|
20569
|
+
const {
|
|
20570
|
+
realTime = !0,
|
|
20571
|
+
range: preRange,
|
|
20572
|
+
limitRange = [0, 1]
|
|
20573
|
+
} = this.attribute,
|
|
20574
|
+
preScrollRange = this.getScrollRange(),
|
|
20575
|
+
[currentPos, currentScrollValue] = this._computeScrollValue(e),
|
|
20576
|
+
range = [preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue];
|
|
20577
|
+
this._dispatchEvent("scrollUp", {
|
|
20578
|
+
pre: preRange,
|
|
20579
|
+
value: clampRange$1(range, limitRange[0], limitRange[1])
|
|
20580
|
+
}), "browser" === vglobal.env ? (vglobal.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
20581
|
+
capture: !0
|
|
20582
|
+
}), vglobal.removeEventListener("pointerup", this._onSliderPointerUp)) : (this.stage.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
20583
|
+
capture: !0
|
|
20584
|
+
}), this.stage.removeEventListener("pointerup", this._onSliderPointerUp), this.stage.removeEventListener("pointerupoutside", this._onSliderPointerUp));
|
|
20585
|
+
};
|
|
20586
|
+
}
|
|
20587
|
+
setScrollRange(range) {
|
|
20588
|
+
let render = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
20589
|
+
const {
|
|
20590
|
+
direction = "horizontal",
|
|
20591
|
+
limitRange = [0, 1],
|
|
20592
|
+
range: preRange,
|
|
20593
|
+
realTime = !0
|
|
20594
|
+
} = this.attribute,
|
|
20595
|
+
currScrollRange = clampRange$1(range, limitRange[0], limitRange[1]);
|
|
20596
|
+
if (render) {
|
|
20597
|
+
const sliderPos = this._getSliderPos(currScrollRange);
|
|
20598
|
+
if (this._slider) {
|
|
20599
|
+
const sliderSize = sliderPos[1] - sliderPos[0];
|
|
20600
|
+
this._sliderSize = sliderSize, "horizontal" === direction ? this._slider.setAttributes({
|
|
20601
|
+
x: sliderPos[0],
|
|
20602
|
+
width: sliderSize
|
|
20603
|
+
}, !0) : this._slider.setAttributes({
|
|
20604
|
+
y: sliderPos[0],
|
|
20605
|
+
height: sliderSize
|
|
20606
|
+
}, !0), this.stage && !this.stage.autoRender && this.stage.renderNextFrame();
|
|
20607
|
+
}
|
|
20608
|
+
}
|
|
20609
|
+
this.attribute.range = currScrollRange, realTime && this._dispatchEvent(SCROLLBAR_EVENT, {
|
|
20610
|
+
pre: preRange,
|
|
20611
|
+
value: currScrollRange
|
|
20612
|
+
});
|
|
20613
|
+
}
|
|
20614
|
+
getScrollRange() {
|
|
20615
|
+
return this.attribute.range;
|
|
20616
|
+
}
|
|
20617
|
+
bindEvents() {
|
|
20618
|
+
if (this.attribute.disableTriggerEvent) return;
|
|
20619
|
+
const {
|
|
20620
|
+
delayType = "throttle",
|
|
20621
|
+
delayTime = 0
|
|
20622
|
+
} = this.attribute;
|
|
20623
|
+
this._rail && this._rail.addEventListener("pointerdown", delayMap[delayType](this._onRailPointerDown, delayTime)), this._slider && this._slider.addEventListener("pointerdown", this._onSliderPointerDown);
|
|
20624
|
+
}
|
|
20625
|
+
render() {
|
|
20626
|
+
this._reset();
|
|
20627
|
+
const {
|
|
20628
|
+
direction = "horizontal",
|
|
20629
|
+
width: width,
|
|
20630
|
+
height: height,
|
|
20631
|
+
range: range,
|
|
20632
|
+
limitRange = [0, 1],
|
|
20633
|
+
railStyle: railStyle,
|
|
20634
|
+
sliderStyle: sliderStyle,
|
|
20635
|
+
padding = 2
|
|
20636
|
+
} = this.attribute,
|
|
20637
|
+
group = this.createOrUpdateChild("scrollbar-container", {}, "group"),
|
|
20638
|
+
rail = group.createOrUpdateChild("scrollbar-rail", Object.assign({
|
|
20639
|
+
x: 0,
|
|
20640
|
+
y: 0,
|
|
20641
|
+
width: width,
|
|
20642
|
+
height: height
|
|
20643
|
+
}, railStyle), "rect");
|
|
20644
|
+
this._rail = rail;
|
|
20645
|
+
const sliderRenderBounds = this.getSliderRenderBounds(),
|
|
20646
|
+
sliderPos = this._getSliderPos(clampRange$1(range, limitRange[0], limitRange[1])),
|
|
20647
|
+
sliderSize = sliderPos[1] - sliderPos[0];
|
|
20648
|
+
let sliderAttribute;
|
|
20649
|
+
this._sliderSize = sliderSize, sliderAttribute = "horizontal" === direction ? {
|
|
20650
|
+
x: sliderPos[0],
|
|
20651
|
+
y: sliderRenderBounds.y1,
|
|
20652
|
+
width: sliderSize,
|
|
20653
|
+
height: sliderRenderBounds.height
|
|
20654
|
+
} : {
|
|
20655
|
+
x: sliderRenderBounds.x1,
|
|
20656
|
+
y: sliderPos[0],
|
|
20657
|
+
width: sliderRenderBounds.width,
|
|
20658
|
+
height: sliderSize
|
|
20659
|
+
};
|
|
20660
|
+
const slider = group.createOrUpdateChild("slider", Object.assign(Object.assign(Object.assign(Object.assign({}, sliderAttribute), {
|
|
20661
|
+
cornerRadius: this._getDefaultSliderCornerRadius()
|
|
20662
|
+
}), sliderStyle), {
|
|
20663
|
+
boundsPadding: normalizePadding(padding),
|
|
20664
|
+
pickMode: "imprecise"
|
|
20665
|
+
}), "rect");
|
|
20666
|
+
this._slider = slider, this._container = group;
|
|
20667
|
+
const containerAABBBounds = this._container.AABBBounds;
|
|
20668
|
+
this._viewPosition = {
|
|
20669
|
+
x: containerAABBBounds.x1,
|
|
20670
|
+
y: containerAABBBounds.y1
|
|
20671
|
+
};
|
|
20672
|
+
}
|
|
20673
|
+
getSliderRenderBounds() {
|
|
20674
|
+
if (this._sliderRenderBounds) return this._sliderRenderBounds;
|
|
20675
|
+
const {
|
|
20676
|
+
width: width,
|
|
20677
|
+
height: height,
|
|
20678
|
+
padding = 2
|
|
20679
|
+
} = this.attribute,
|
|
20680
|
+
[top, right, bottom, left] = normalizePadding(padding),
|
|
20681
|
+
renderBounds = {
|
|
20682
|
+
x1: left,
|
|
20683
|
+
y1: top,
|
|
20684
|
+
x2: width - right,
|
|
20685
|
+
y2: height - bottom,
|
|
20686
|
+
width: Math.max(0, width - (left + right)),
|
|
20687
|
+
height: Math.max(0, height - (top + bottom))
|
|
20688
|
+
};
|
|
20689
|
+
return this._sliderRenderBounds = renderBounds, renderBounds;
|
|
20690
|
+
}
|
|
20691
|
+
_getDefaultSliderCornerRadius() {
|
|
20692
|
+
const {
|
|
20693
|
+
direction: direction,
|
|
20694
|
+
round: round
|
|
20695
|
+
} = this.attribute;
|
|
20696
|
+
if (round) {
|
|
20697
|
+
const {
|
|
20698
|
+
width: width,
|
|
20699
|
+
height: height
|
|
20700
|
+
} = this.getSliderRenderBounds();
|
|
20701
|
+
return "horizontal" === direction ? height : width;
|
|
20702
|
+
}
|
|
20703
|
+
return 0;
|
|
20704
|
+
}
|
|
20705
|
+
_getSliderPos(range) {
|
|
20706
|
+
const {
|
|
20707
|
+
direction: direction
|
|
20708
|
+
} = this.attribute,
|
|
20709
|
+
{
|
|
20710
|
+
width: width,
|
|
20711
|
+
height: height,
|
|
20712
|
+
x1: x1,
|
|
20713
|
+
y1: y1
|
|
20714
|
+
} = this.getSliderRenderBounds();
|
|
20715
|
+
return "horizontal" === direction ? [width * range[0] + x1, width * range[1] + x1] : [height * range[0] + y1, height * range[1] + y1];
|
|
20716
|
+
}
|
|
20717
|
+
_getScrollRange() {
|
|
20718
|
+
if (this._sliderLimitRange) return this._sliderLimitRange;
|
|
20719
|
+
const {
|
|
20720
|
+
limitRange = [0, 1],
|
|
20721
|
+
direction: direction
|
|
20722
|
+
} = this.attribute,
|
|
20723
|
+
[min, max] = clampRange$1(limitRange, 0, 1),
|
|
20724
|
+
{
|
|
20725
|
+
width: width,
|
|
20726
|
+
height: height,
|
|
20727
|
+
x1: x1,
|
|
20728
|
+
y1: y1
|
|
20729
|
+
} = this.getSliderRenderBounds(),
|
|
20730
|
+
sliderSize = this._sliderSize;
|
|
20731
|
+
return "horizontal" === direction ? clampRange$1([x1 + min * width, x1 + max * width], x1, width - sliderSize) : clampRange$1([y1 + min * height, y1 + max * height], y1, height - sliderSize);
|
|
20732
|
+
}
|
|
20733
|
+
_reset() {
|
|
20734
|
+
this._sliderRenderBounds = null, this._sliderLimitRange = null;
|
|
20735
|
+
}
|
|
20736
|
+
}
|
|
20737
|
+
ScrollBar.defaultAttributes = {
|
|
20738
|
+
direction: "horizontal",
|
|
20739
|
+
round: !0,
|
|
20740
|
+
sliderSize: 20,
|
|
20741
|
+
sliderStyle: {
|
|
20742
|
+
fill: "rgba(0, 0, 0, .5)"
|
|
20743
|
+
},
|
|
20744
|
+
railStyle: {
|
|
20745
|
+
fill: "rgba(0, 0, 0, .0)"
|
|
20746
|
+
},
|
|
20747
|
+
padding: 2,
|
|
20748
|
+
scrollRange: [0, 1],
|
|
20749
|
+
delayType: "throttle",
|
|
20750
|
+
delayTime: 0,
|
|
20751
|
+
realTime: !0
|
|
20752
|
+
};
|
|
20753
|
+
|
|
20754
|
+
function traverseGroup(group, cb) {
|
|
20755
|
+
group.forEachChildren(node => {
|
|
20756
|
+
const stopped = cb(node);
|
|
20757
|
+
node.isContainer && !stopped && traverseGroup(node, cb);
|
|
20758
|
+
});
|
|
20759
|
+
}
|
|
20760
|
+
|
|
20761
|
+
function scale(vector, scale) {
|
|
20762
|
+
return [vector[0] * scale, vector[1] * scale];
|
|
20763
|
+
}
|
|
20764
|
+
function length(vector) {
|
|
20765
|
+
const [x, y] = vector;
|
|
20766
|
+
return Math.sqrt(x * x + y * y);
|
|
20767
|
+
}
|
|
20768
|
+
function normalize$2(vector) {
|
|
20769
|
+
let len = length(vector);
|
|
20770
|
+
return len > 0 && (len = 1 / len), [vector[0] * len, vector[1] * len];
|
|
20771
|
+
}
|
|
20772
|
+
function angle(vector1, vector2) {
|
|
20773
|
+
const [x1, y1] = vector1,
|
|
20774
|
+
[x2, y2] = vector2,
|
|
20775
|
+
mag = Math.sqrt((x1 * x1 + y1 * y1) * (x2 * x2 + y2 * y2)),
|
|
20776
|
+
cosine = mag && (x1 * x2 + y1 * y2) / mag;
|
|
20777
|
+
return Math.acos(Math.min(Math.max(cosine, -1), 1));
|
|
20778
|
+
}
|
|
20779
|
+
function angleTo(v1, v2, direct) {
|
|
20780
|
+
const ang = angle(v1, v2),
|
|
20781
|
+
angleLargeThanPI = crossProduct(v1, v2) >= 0;
|
|
20782
|
+
return direct ? angleLargeThanPI ? 2 * Math.PI - ang : ang : angleLargeThanPI ? ang : 2 * Math.PI - ang;
|
|
20783
|
+
}
|
|
20784
|
+
|
|
20785
|
+
const initTextMeasure = (textSpec, option, useNaiveCanvas, defaultFontParams) => new TextMeasure$1(Object.assign({
|
|
20786
|
+
defaultFontParams: Object.assign({
|
|
20787
|
+
fontFamily: DEFAULT_TEXT_FONT_FAMILY$1,
|
|
20788
|
+
fontSize: DEFAULT_TEXT_FONT_SIZE$1
|
|
20789
|
+
}, defaultFontParams),
|
|
20790
|
+
getTextBounds: useNaiveCanvas ? void 0 : getTextBounds,
|
|
20791
|
+
specialCharSet: "-/: .,@%'\"~" + TextMeasure$1.ALPHABET_CHAR_SET + TextMeasure$1.ALPHABET_CHAR_SET.toUpperCase()
|
|
20792
|
+
}, null != option ? option : {}), textSpec);
|
|
20793
|
+
function measureTextSize(text, textSpec) {
|
|
20794
|
+
let defaultTextTheme = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
20795
|
+
if (!text) return {
|
|
20796
|
+
width: 0,
|
|
20797
|
+
height: 0
|
|
20798
|
+
};
|
|
20799
|
+
const bounds = getTextBounds({
|
|
20800
|
+
text: text,
|
|
20801
|
+
fontFamily: textSpec.fontFamily || defaultTextTheme.fontFamily || DEFAULT_TEXT_FONT_FAMILY$1,
|
|
20802
|
+
fontSize: textSpec.fontSize || defaultTextTheme.fontSize || 12,
|
|
20803
|
+
fontWeight: textSpec.fontWeight || defaultTextTheme.fontWeight,
|
|
20804
|
+
textAlign: textSpec.textAlign || "center",
|
|
20805
|
+
textBaseline: textSpec.textBaseline,
|
|
20806
|
+
ellipsis: !!textSpec.ellipsis,
|
|
20807
|
+
maxLineWidth: textSpec.maxLineWidth || 1 / 0,
|
|
20808
|
+
lineHeight: textSpec.fontSize || defaultTextTheme.fontSize || 12
|
|
20809
|
+
});
|
|
20810
|
+
return {
|
|
20811
|
+
width: bounds.width(),
|
|
20812
|
+
height: bounds.height()
|
|
20813
|
+
};
|
|
20814
|
+
}
|
|
20815
|
+
function isRichText(attributes) {
|
|
20816
|
+
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
20817
|
+
return "rich" === getTextType(attributes, typeKey);
|
|
20818
|
+
}
|
|
20819
|
+
function getTextType(attributes) {
|
|
20820
|
+
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
20821
|
+
var _a, _b;
|
|
20822
|
+
return isObject$6(attributes.text) && "type" in attributes.text ? null !== (_a = attributes.text.type) && void 0 !== _a ? _a : "text" : typeKey in attributes && null !== (_b = attributes[typeKey]) && void 0 !== _b ? _b : "text";
|
|
20823
|
+
}
|
|
20824
|
+
function richTextAttributeTransform(attributes) {
|
|
20825
|
+
var _a, _b;
|
|
20826
|
+
return isValid$3(attributes.maxLineWidth) && (attributes.maxWidth = attributes.maxLineWidth, delete attributes.maxLineWidth), attributes.width = null !== (_a = attributes.width) && void 0 !== _a ? _a : 0, attributes.height = null !== (_b = attributes.height) && void 0 !== _b ? _b : 0, attributes.textConfig = attributes.text.text || attributes.text, attributes;
|
|
20827
|
+
}
|
|
20828
|
+
function htmlAttributeTransform(attributes) {
|
|
20829
|
+
const {
|
|
20830
|
+
text: text,
|
|
20831
|
+
_originText: _originText
|
|
20832
|
+
} = attributes,
|
|
20833
|
+
{
|
|
20834
|
+
text: html
|
|
20835
|
+
} = text;
|
|
20238
20836
|
return attributes.html = html, attributes.text = _originText, attributes.renderable = !1, attributes;
|
|
20239
20837
|
}
|
|
20240
20838
|
function reactAttributeTransform(attributes) {
|
|
@@ -25183,7 +25781,7 @@
|
|
|
25183
25781
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Title.defaultAttributes, attributes)), this.name = "title";
|
|
25184
25782
|
}
|
|
25185
25783
|
render() {
|
|
25186
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
25784
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
25187
25785
|
const {
|
|
25188
25786
|
textType: textType,
|
|
25189
25787
|
text: text,
|
|
@@ -25206,11 +25804,11 @@
|
|
|
25206
25804
|
x: parsedPadding[3],
|
|
25207
25805
|
y: parsedPadding[0],
|
|
25208
25806
|
zIndex: 1
|
|
25209
|
-
}, "group")
|
|
25807
|
+
}, "group"),
|
|
25808
|
+
fixedMainTitleHeight = null !== (_a = textStyle.height) && void 0 !== _a ? _a : height;
|
|
25210
25809
|
if (!1 !== this.attribute.visible && !1 !== textStyle.visible) {
|
|
25211
25810
|
const {
|
|
25212
25811
|
width: mainTitleWidth,
|
|
25213
|
-
height: mainTitleHeight,
|
|
25214
25812
|
maxHeight: mainTitleMaxHeight,
|
|
25215
25813
|
maxWidth: mainTitleMaxWidth,
|
|
25216
25814
|
x = 0,
|
|
@@ -25224,8 +25822,8 @@
|
|
|
25224
25822
|
const attr = Object.assign({
|
|
25225
25823
|
x: x,
|
|
25226
25824
|
y: y,
|
|
25227
|
-
width: null !== (
|
|
25228
|
-
height: null
|
|
25825
|
+
width: null !== (_b = null != mainTitleWidth ? mainTitleWidth : width) && void 0 !== _b ? _b : 0,
|
|
25826
|
+
height: null != fixedMainTitleHeight ? fixedMainTitleHeight : 0,
|
|
25229
25827
|
ellipsis: null == ellipsis || ellipsis,
|
|
25230
25828
|
wordBreak: null != wordBreak ? wordBreak : "break-word",
|
|
25231
25829
|
maxHeight: null != mainTitleMaxHeight ? mainTitleMaxHeight : maxHeight,
|
|
@@ -25241,7 +25839,7 @@
|
|
|
25241
25839
|
x: x,
|
|
25242
25840
|
y: y,
|
|
25243
25841
|
width: null !== (_d = null != mainTitleWidth ? mainTitleWidth : width) && void 0 !== _d ? _d : 0,
|
|
25244
|
-
height: null
|
|
25842
|
+
height: null != fixedMainTitleHeight ? fixedMainTitleHeight : 0,
|
|
25245
25843
|
ellipsis: ellipsis,
|
|
25246
25844
|
wordBreak: wordBreak,
|
|
25247
25845
|
maxHeight: null != mainTitleMaxHeight ? mainTitleMaxHeight : maxHeight,
|
|
@@ -25253,16 +25851,16 @@
|
|
|
25253
25851
|
text: isArray$3(text) ? text : [text],
|
|
25254
25852
|
whiteSpace: "normal"
|
|
25255
25853
|
}, textStyle), {
|
|
25256
|
-
maxLineWidth: null !== (
|
|
25257
|
-
heightLimit: null
|
|
25854
|
+
maxLineWidth: null !== (_f = null !== (_e = textStyle.maxLineWidth) && void 0 !== _e ? _e : mainTitleWidth) && void 0 !== _f ? _f : width,
|
|
25855
|
+
heightLimit: null !== (_g = textStyle.height) && void 0 !== _g ? _g : maxHeight,
|
|
25258
25856
|
lineClamp: lineClamp,
|
|
25259
25857
|
ellipsis: ellipsis,
|
|
25260
25858
|
x: x,
|
|
25261
25859
|
y: y
|
|
25262
25860
|
}), "text"));
|
|
25263
25861
|
}
|
|
25264
|
-
const
|
|
25265
|
-
|
|
25862
|
+
const mainTextBoundsHeight = this._mainTitle ? this._mainTitle.AABBBounds.height() : 0,
|
|
25863
|
+
mainTextBoundsWidth = this._mainTitle ? this._mainTitle.AABBBounds.width() : 0;
|
|
25266
25864
|
if (!1 !== this.attribute.visible && !1 !== subtextStyle.visible) {
|
|
25267
25865
|
const {
|
|
25268
25866
|
width: subTitleWidth,
|
|
@@ -25275,7 +25873,7 @@
|
|
|
25275
25873
|
wordBreak = "break-word",
|
|
25276
25874
|
lineClamp: lineClamp
|
|
25277
25875
|
} = subtextStyle,
|
|
25278
|
-
maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight -
|
|
25876
|
+
maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight - mainTextBoundsHeight);
|
|
25279
25877
|
if ("rich" === subtextType || isValid$3(subtextStyle.character)) {
|
|
25280
25878
|
const attr = Object.assign({
|
|
25281
25879
|
x: x,
|
|
@@ -25314,36 +25912,35 @@
|
|
|
25314
25912
|
lineClamp: lineClamp,
|
|
25315
25913
|
ellipsis: ellipsis,
|
|
25316
25914
|
x: 0,
|
|
25317
|
-
y:
|
|
25915
|
+
y: mainTextBoundsHeight
|
|
25318
25916
|
}), "text"));
|
|
25319
25917
|
}
|
|
25320
|
-
const
|
|
25321
|
-
|
|
25322
|
-
let
|
|
25323
|
-
|
|
25324
|
-
if (isValid$3(width) && (
|
|
25918
|
+
const subTextBoundsHeight = this._subTitle ? this._subTitle.AABBBounds.height() : 0,
|
|
25919
|
+
subTextBoundsWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;
|
|
25920
|
+
let totalWidth = Math.max(mainTextBoundsWidth, subTextBoundsWidth),
|
|
25921
|
+
totalHeight = mainTextBoundsHeight + (null !== (_q = subtextStyle.height) && void 0 !== _q ? _q : subTextBoundsHeight);
|
|
25922
|
+
if (isValid$3(width) && (totalWidth = width), isValid$3(height) && (totalHeight = height), isValid$3(minWidth) && totalWidth < minWidth && (totalWidth = minWidth), isValid$3(maxWidth) && totalWidth > maxWidth && (totalWidth = maxWidth), isValid$3(minHeight) && totalHeight < minHeight && (totalHeight = minHeight), isValid$3(maxHeight) && totalHeight > maxHeight && (totalHeight = maxHeight), group.attribute.width = totalWidth, group.attribute.height = totalHeight, group.attribute.boundsPadding = parsedPadding, this._mainTitle) {
|
|
25325
25923
|
if (isValid$3(align) || isValid$3(textStyle.align)) {
|
|
25326
25924
|
const mainTitleAlign = textStyle.align ? textStyle.align : align,
|
|
25327
|
-
mainTitleWidth = null !== (_r = textStyle.width) && void 0 !== _r ? _r :
|
|
25328
|
-
"
|
|
25925
|
+
mainTitleWidth = null !== (_r = textStyle.width) && void 0 !== _r ? _r : totalWidth;
|
|
25926
|
+
"center" === mainTitleAlign ? (this._mainTitle.setAttribute("x", mainTitleWidth / 2), this._mainTitle.setAttribute("textAlign", "center")) : "right" === mainTitleAlign ? (this._mainTitle.setAttribute("x", mainTitleWidth), this._mainTitle.setAttribute("textAlign", "right")) : (this._mainTitle.setAttribute("x", 0), this._mainTitle.setAttribute("textAlign", "left"));
|
|
25329
25927
|
}
|
|
25330
25928
|
if (isValid$3(verticalAlign) || isValid$3(textStyle.verticalAlign)) {
|
|
25331
|
-
const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign
|
|
25332
|
-
|
|
25333
|
-
"top" === mainTitleVerticalAlign ? (this._mainTitle.setAttribute("y", 0), this._mainTitle.setAttribute("textBaseline", "top")) : "middle" === mainTitleVerticalAlign ? (this._mainTitle.setAttribute("y", mainTitleHeight / 2), this._mainTitle.setAttribute("textBaseline", "middle")) : "bottom" === mainTitleVerticalAlign && (this._mainTitle.setAttribute("y", mainTitleHeight), this._mainTitle.setAttribute("textBaseline", "bottom"));
|
|
25929
|
+
const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign;
|
|
25930
|
+
"middle" === mainTitleVerticalAlign && isValid$3(fixedMainTitleHeight) ? (this._mainTitle.setAttribute("y", fixedMainTitleHeight / 2), this._mainTitle.setAttribute("textBaseline", "middle")) : "bottom" === mainTitleVerticalAlign && isValid$3(fixedMainTitleHeight) ? (this._mainTitle.setAttribute("y", fixedMainTitleHeight), this._mainTitle.setAttribute("textBaseline", "bottom")) : (this._mainTitle.setAttribute("y", 0), this._mainTitle.setAttribute("textBaseline", "top"));
|
|
25334
25931
|
}
|
|
25335
25932
|
}
|
|
25336
25933
|
if (this._subTitle) {
|
|
25337
25934
|
if (isValid$3(align) || isValid$3(subtextStyle.align)) {
|
|
25338
25935
|
const subTitleAlign = subtextStyle.align ? subtextStyle.align : align,
|
|
25339
|
-
subTitleWidth = null !== (_s = subtextStyle.width) && void 0 !== _s ? _s :
|
|
25340
|
-
"
|
|
25936
|
+
subTitleWidth = null !== (_t = null !== (_s = subtextStyle.width) && void 0 !== _s ? _s : textStyle.width) && void 0 !== _t ? _t : totalWidth;
|
|
25937
|
+
"center" === subTitleAlign ? (this._subTitle.setAttribute("x", subTitleWidth / 2), this._subTitle.setAttribute("textAlign", "center")) : "right" === subTitleAlign ? (this._subTitle.setAttribute("x", subTitleWidth), this._subTitle.setAttribute("textAlign", "right")) : (this._subTitle.setAttribute("x", 0), this._subTitle.setAttribute("textAlign", "left"));
|
|
25341
25938
|
}
|
|
25342
25939
|
if (isValid$3(verticalAlign) || isValid$3(textStyle.verticalAlign)) {
|
|
25343
25940
|
const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign,
|
|
25344
|
-
subTitleYStart =
|
|
25345
|
-
subTitleHeight = null !== (
|
|
25346
|
-
"
|
|
25941
|
+
subTitleYStart = this._mainTitle ? isValid$3(fixedMainTitleHeight) ? this._mainTitle.AABBBounds.y1 + Math.max(this._mainTitle.AABBBounds.height(), fixedMainTitleHeight) : this._mainTitle.AABBBounds.y2 : 0,
|
|
25942
|
+
subTitleHeight = null !== (_u = subtextStyle.height) && void 0 !== _u ? _u : height;
|
|
25943
|
+
"middle" === subTitleVerticalAlign && isValid$3(subTitleHeight) ? (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight / 2), this._subTitle.setAttribute("textBaseline", "middle")) : "bottom" === subTitleVerticalAlign && isValid$3(subTitleHeight) ? (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight), this._subTitle.setAttribute("textBaseline", "bottom")) : (this._subTitle.setAttribute("y", subTitleYStart), this._subTitle.setAttribute("textBaseline", "top"));
|
|
25347
25944
|
}
|
|
25348
25945
|
}
|
|
25349
25946
|
}
|
|
@@ -26908,6 +27505,258 @@
|
|
|
26908
27505
|
}
|
|
26909
27506
|
}
|
|
26910
27507
|
|
|
27508
|
+
class Aggregator {
|
|
27509
|
+
constructor(config) {
|
|
27510
|
+
var _a;
|
|
27511
|
+
this.isAggregator = !0, this.isRecord = !0, this.records = [], this.key = config.key, this.field = config.field, this.formatFun = config.formatFun, this.isRecord = null !== (_a = config.isRecord) && void 0 !== _a ? _a : this.isRecord;
|
|
27512
|
+
}
|
|
27513
|
+
clearCacheValue() {
|
|
27514
|
+
this._formatedValue = void 0;
|
|
27515
|
+
}
|
|
27516
|
+
formatValue(col, row, table) {
|
|
27517
|
+
return this._formatedValue || (this.formatFun ? this._formatedValue = this.formatFun(this.value(), col, row, table) : this._formatedValue = this.value()), this._formatedValue;
|
|
27518
|
+
}
|
|
27519
|
+
reset() {
|
|
27520
|
+
this.records = [], this.clearCacheValue();
|
|
27521
|
+
}
|
|
27522
|
+
}
|
|
27523
|
+
class RecordAggregator extends Aggregator {
|
|
27524
|
+
constructor() {
|
|
27525
|
+
super(...arguments), this.type = AggregationType.RECORD, this.isRecord = !0;
|
|
27526
|
+
}
|
|
27527
|
+
push(record) {
|
|
27528
|
+
record && this.isRecord && this.records && (record.isAggregator ? this.records.push(...record.records) : this.records.push(record)), this.clearCacheValue();
|
|
27529
|
+
}
|
|
27530
|
+
deleteRecord(record) {
|
|
27531
|
+
record && this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), this.clearCacheValue();
|
|
27532
|
+
}
|
|
27533
|
+
updateRecord(oldRecord, newRecord) {
|
|
27534
|
+
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), this.clearCacheValue());
|
|
27535
|
+
}
|
|
27536
|
+
value() {
|
|
27537
|
+
return this.records;
|
|
27538
|
+
}
|
|
27539
|
+
reset() {
|
|
27540
|
+
this.records = [];
|
|
27541
|
+
}
|
|
27542
|
+
recalculate() {}
|
|
27543
|
+
}
|
|
27544
|
+
class NoneAggregator extends Aggregator {
|
|
27545
|
+
constructor() {
|
|
27546
|
+
super(...arguments), this.type = AggregationType.NONE, this.isRecord = !0;
|
|
27547
|
+
}
|
|
27548
|
+
push(record) {
|
|
27549
|
+
record && (this.isRecord && (this.records = [record]), this.field && (this.fieldValue = record[this.field])), this.clearCacheValue();
|
|
27550
|
+
}
|
|
27551
|
+
deleteRecord(record) {
|
|
27552
|
+
record && (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), this.field && this.records.length && (this.fieldValue = this.records[this.records.length - 1][this.field])), this.clearCacheValue();
|
|
27553
|
+
}
|
|
27554
|
+
updateRecord(oldRecord, newRecord) {
|
|
27555
|
+
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), this.field && this.records.length && (this.fieldValue = this.records[this.records.length - 1][this.field]), this.clearCacheValue());
|
|
27556
|
+
}
|
|
27557
|
+
value() {
|
|
27558
|
+
return this.fieldValue;
|
|
27559
|
+
}
|
|
27560
|
+
reset() {
|
|
27561
|
+
this.records = [], this.fieldValue = void 0;
|
|
27562
|
+
}
|
|
27563
|
+
recalculate() {}
|
|
27564
|
+
}
|
|
27565
|
+
class CustomAggregator extends Aggregator {
|
|
27566
|
+
constructor(config) {
|
|
27567
|
+
super(config), this.type = AggregationType.CUSTOM, this.isRecord = !0, this.values = [], this.aggregationFun = config.aggregationFun;
|
|
27568
|
+
}
|
|
27569
|
+
push(record) {
|
|
27570
|
+
record && (this.isRecord && this.records && (record.isAggregator ? this.records.push(...record.records) : this.records.push(record)), this.field && this.values.push(record[this.field])), this.clearCacheValue();
|
|
27571
|
+
}
|
|
27572
|
+
updateRecord(oldRecord, newRecord) {
|
|
27573
|
+
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), this.field && this.records.length && (this.values = this.records.map(item => item[this.field])), this.clearCacheValue());
|
|
27574
|
+
}
|
|
27575
|
+
deleteRecord(record) {
|
|
27576
|
+
record && (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), this.field && this.records.length && (this.values = this.records.map(item => item[this.field]))), this.clearCacheValue();
|
|
27577
|
+
}
|
|
27578
|
+
value() {
|
|
27579
|
+
var _a;
|
|
27580
|
+
return this.fieldValue || (this.fieldValue = null === (_a = this.aggregationFun) || void 0 === _a ? void 0 : _a.call(this, this.values, this.records, this.field)), this.fieldValue;
|
|
27581
|
+
}
|
|
27582
|
+
reset() {
|
|
27583
|
+
this.records = [], this.fieldValue = void 0;
|
|
27584
|
+
}
|
|
27585
|
+
recalculate() {}
|
|
27586
|
+
}
|
|
27587
|
+
class SumAggregator extends Aggregator {
|
|
27588
|
+
constructor(config) {
|
|
27589
|
+
var _a;
|
|
27590
|
+
super(config), this.type = AggregationType.SUM, this.sum = 0, this.positiveSum = 0, this.nagetiveSum = 0, this.needSplitPositiveAndNegativeForSum = !1, this.needSplitPositiveAndNegativeForSum = null !== (_a = config.needSplitPositiveAndNegative) && void 0 !== _a && _a;
|
|
27591
|
+
}
|
|
27592
|
+
push(record) {
|
|
27593
|
+
if (record) if (this.isRecord && this.records && (record.isAggregator ? this.records.push(...record.records) : this.records.push(record)), record.isAggregator) {
|
|
27594
|
+
const value = record.value();
|
|
27595
|
+
this.sum += null != value ? value : 0, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum += value : value < 0 && (this.nagetiveSum += value));
|
|
27596
|
+
} else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
27597
|
+
const value = parseFloat(record[this.field]);
|
|
27598
|
+
this.sum += value, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum += value : value < 0 && (this.nagetiveSum += value));
|
|
27599
|
+
}
|
|
27600
|
+
this.clearCacheValue();
|
|
27601
|
+
}
|
|
27602
|
+
deleteRecord(record) {
|
|
27603
|
+
if (record) if (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), record.isAggregator) {
|
|
27604
|
+
const value = record.value();
|
|
27605
|
+
this.sum -= null != value ? value : 0, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum -= value : value < 0 && (this.nagetiveSum -= value));
|
|
27606
|
+
} else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
27607
|
+
const value = parseFloat(record[this.field]);
|
|
27608
|
+
this.sum -= value, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum -= value : value < 0 && (this.nagetiveSum -= value));
|
|
27609
|
+
}
|
|
27610
|
+
this.clearCacheValue();
|
|
27611
|
+
}
|
|
27612
|
+
updateRecord(oldRecord, newRecord) {
|
|
27613
|
+
if (oldRecord && newRecord) {
|
|
27614
|
+
if (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), oldRecord.isAggregator) {
|
|
27615
|
+
const oldValue = oldRecord.value(),
|
|
27616
|
+
newValue = newRecord.value();
|
|
27617
|
+
this.sum += newValue - oldValue, this.needSplitPositiveAndNegativeForSum && (oldValue > 0 ? this.positiveSum -= oldValue : oldValue < 0 && (this.nagetiveSum -= oldValue), newValue > 0 ? this.positiveSum += newValue : newValue < 0 && (this.nagetiveSum += newValue));
|
|
27618
|
+
} else if (this.field && !isNaN(parseFloat(oldRecord[this.field]))) {
|
|
27619
|
+
const oldValue = parseFloat(oldRecord[this.field]),
|
|
27620
|
+
newValue = parseFloat(newRecord[this.field]);
|
|
27621
|
+
this.sum += newValue - oldValue, this.needSplitPositiveAndNegativeForSum && (oldValue > 0 ? this.positiveSum -= oldValue : oldValue < 0 && (this.nagetiveSum -= oldValue), newValue > 0 ? this.positiveSum += newValue : newValue < 0 && (this.nagetiveSum += newValue));
|
|
27622
|
+
}
|
|
27623
|
+
this.clearCacheValue();
|
|
27624
|
+
}
|
|
27625
|
+
}
|
|
27626
|
+
value() {
|
|
27627
|
+
var _a;
|
|
27628
|
+
return (null === (_a = this.records) || void 0 === _a ? void 0 : _a.length) >= 1 ? this.sum : void 0;
|
|
27629
|
+
}
|
|
27630
|
+
positiveValue() {
|
|
27631
|
+
return this.positiveSum;
|
|
27632
|
+
}
|
|
27633
|
+
negativeValue() {
|
|
27634
|
+
return this.nagetiveSum;
|
|
27635
|
+
}
|
|
27636
|
+
reset() {
|
|
27637
|
+
super.reset(), this.records = [], this.sum = 0;
|
|
27638
|
+
}
|
|
27639
|
+
recalculate() {
|
|
27640
|
+
if (this.sum = 0, this._formatedValue = void 0, this.records) for (let i = 0; i < this.records.length; i++) {
|
|
27641
|
+
const record = this.records[i];
|
|
27642
|
+
if (record.isAggregator) {
|
|
27643
|
+
const value = record.value();
|
|
27644
|
+
this.sum += null != value ? value : 0, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum += value : value < 0 && (this.nagetiveSum += value));
|
|
27645
|
+
} else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
27646
|
+
const value = parseFloat(record[this.field]);
|
|
27647
|
+
this.sum += value, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum += value : value < 0 && (this.nagetiveSum += value));
|
|
27648
|
+
}
|
|
27649
|
+
}
|
|
27650
|
+
}
|
|
27651
|
+
}
|
|
27652
|
+
class CountAggregator extends Aggregator {
|
|
27653
|
+
constructor() {
|
|
27654
|
+
super(...arguments), this.type = AggregationType.COUNT, this.count = 0;
|
|
27655
|
+
}
|
|
27656
|
+
push(record) {
|
|
27657
|
+
record && (this.isRecord && this.records && (record.isAggregator ? this.records.push(...record.records) : this.records.push(record)), record.isAggregator ? this.count += record.value() : this.count++), this.clearCacheValue();
|
|
27658
|
+
}
|
|
27659
|
+
deleteRecord(record) {
|
|
27660
|
+
record && (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), record.isAggregator ? this.count -= record.value() : this.count--), this.clearCacheValue();
|
|
27661
|
+
}
|
|
27662
|
+
updateRecord(oldRecord, newRecord) {
|
|
27663
|
+
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), oldRecord.isAggregator && (this.count += newRecord.value() - oldRecord.value()));
|
|
27664
|
+
}
|
|
27665
|
+
value() {
|
|
27666
|
+
return this.count;
|
|
27667
|
+
}
|
|
27668
|
+
reset() {
|
|
27669
|
+
this.records = [], this.count = 0;
|
|
27670
|
+
}
|
|
27671
|
+
recalculate() {
|
|
27672
|
+
if (this.count = 0, this._formatedValue = void 0, this.records) for (let i = 0; i < this.records.length; i++) {
|
|
27673
|
+
const record = this.records[i];
|
|
27674
|
+
record.isAggregator ? this.count += record.value() : this.count++;
|
|
27675
|
+
}
|
|
27676
|
+
}
|
|
27677
|
+
}
|
|
27678
|
+
class AvgAggregator extends Aggregator {
|
|
27679
|
+
constructor() {
|
|
27680
|
+
super(...arguments), this.type = AggregationType.AVG, this.sum = 0, this.count = 0;
|
|
27681
|
+
}
|
|
27682
|
+
push(record) {
|
|
27683
|
+
record && (this.isRecord && this.records && (record.isAggregator ? this.records.push(...record.records) : this.records.push(record)), record.isAggregator && record.type === AggregationType.AVG ? (this.sum += record.sum, this.count += record.count) : this.field && !isNaN(parseFloat(record[this.field])) && (this.sum += parseFloat(record[this.field]), this.count++)), this.clearCacheValue();
|
|
27684
|
+
}
|
|
27685
|
+
deleteRecord(record) {
|
|
27686
|
+
record && (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), record.isAggregator && record.type === AggregationType.AVG ? (this.sum -= record.sum, this.count -= record.count) : this.field && !isNaN(parseFloat(record[this.field])) && (this.sum -= parseFloat(record[this.field]), this.count--)), this.clearCacheValue();
|
|
27687
|
+
}
|
|
27688
|
+
updateRecord(oldRecord, newRecord) {
|
|
27689
|
+
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), oldRecord.isAggregator && oldRecord.type === AggregationType.AVG ? (this.sum += newRecord.sum - oldRecord.sum, this.count += newRecord.count - oldRecord.count) : this.field && !isNaN(parseFloat(oldRecord[this.field])) && (this.sum += parseFloat(newRecord[this.field]) - parseFloat(oldRecord[this.field])), this.clearCacheValue());
|
|
27690
|
+
}
|
|
27691
|
+
value() {
|
|
27692
|
+
var _a;
|
|
27693
|
+
return (null === (_a = this.records) || void 0 === _a ? void 0 : _a.length) >= 1 ? this.sum / this.count : void 0;
|
|
27694
|
+
}
|
|
27695
|
+
reset() {
|
|
27696
|
+
this.records = [], this.sum = 0, this.count = 0;
|
|
27697
|
+
}
|
|
27698
|
+
recalculate() {
|
|
27699
|
+
if (this.sum = 0, this.count = 0, this._formatedValue = void 0, this.records) for (let i = 0; i < this.records.length; i++) {
|
|
27700
|
+
const record = this.records[i];
|
|
27701
|
+
record.isAggregator && record.type === AggregationType.AVG ? (this.sum += record.sum, this.count += record.count) : this.field && !isNaN(parseFloat(record[this.field])) && (this.sum += parseFloat(record[this.field]), this.count++);
|
|
27702
|
+
}
|
|
27703
|
+
}
|
|
27704
|
+
}
|
|
27705
|
+
class MaxAggregator extends Aggregator {
|
|
27706
|
+
constructor() {
|
|
27707
|
+
super(...arguments), this.type = AggregationType.MAX, this.max = Number.MIN_SAFE_INTEGER;
|
|
27708
|
+
}
|
|
27709
|
+
push(record) {
|
|
27710
|
+
record && (this.isRecord && this.records && (record.isAggregator ? this.records.push(...record.records) : this.records.push(record)), record.isAggregator ? this.max = record.max > this.max ? record.max : this.max : "number" == typeof record ? this.max = record > this.max ? record : this.max : this.field && "number" == typeof record[this.field] ? this.max = record[this.field] > this.max ? record[this.field] : this.max : this.field && !isNaN(record[this.field]) && (this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max)), this.clearCacheValue();
|
|
27711
|
+
}
|
|
27712
|
+
deleteRecord(record) {
|
|
27713
|
+
record && (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), this.recalculate());
|
|
27714
|
+
}
|
|
27715
|
+
updateRecord(oldRecord, newRecord) {
|
|
27716
|
+
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), this.recalculate());
|
|
27717
|
+
}
|
|
27718
|
+
value() {
|
|
27719
|
+
var _a;
|
|
27720
|
+
return (null === (_a = this.records) || void 0 === _a ? void 0 : _a.length) >= 1 ? this.max : void 0;
|
|
27721
|
+
}
|
|
27722
|
+
reset() {
|
|
27723
|
+
this.records = [], this.max = Number.MIN_SAFE_INTEGER;
|
|
27724
|
+
}
|
|
27725
|
+
recalculate() {
|
|
27726
|
+
if (this.max = Number.MIN_SAFE_INTEGER, this._formatedValue = void 0, this.records) for (let i = 0; i < this.records.length; i++) {
|
|
27727
|
+
const record = this.records[i];
|
|
27728
|
+
record.isAggregator ? this.max = record.max > this.max ? record.max : this.max : "number" == typeof record ? this.max = record > this.max ? record : this.max : this.field && "number" == typeof record[this.field] ? this.max = record[this.field] > this.max ? record[this.field] : this.max : this.field && !isNaN(record[this.field]) && (this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max);
|
|
27729
|
+
}
|
|
27730
|
+
}
|
|
27731
|
+
}
|
|
27732
|
+
class MinAggregator extends Aggregator {
|
|
27733
|
+
constructor() {
|
|
27734
|
+
super(...arguments), this.type = AggregationType.MIN, this.min = Number.MAX_SAFE_INTEGER;
|
|
27735
|
+
}
|
|
27736
|
+
push(record) {
|
|
27737
|
+
record && (this.isRecord && this.records && (record.isAggregator ? this.records.push(...record.records) : this.records.push(record)), record.isAggregator ? this.min = record.min < this.min ? record.min : this.min : "number" == typeof record ? this.min = record < this.min ? record : this.min : this.field && "number" == typeof record[this.field] ? this.min = record[this.field] < this.min ? record[this.field] : this.min : this.field && !isNaN(record[this.field]) && (this.min = parseFloat(record[this.field]) < this.min ? parseFloat(record[this.field]) : this.min)), this.clearCacheValue();
|
|
27738
|
+
}
|
|
27739
|
+
deleteRecord(record) {
|
|
27740
|
+
record && (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), this.recalculate());
|
|
27741
|
+
}
|
|
27742
|
+
updateRecord(oldRecord, newRecord) {
|
|
27743
|
+
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), this.recalculate());
|
|
27744
|
+
}
|
|
27745
|
+
value() {
|
|
27746
|
+
var _a;
|
|
27747
|
+
return (null === (_a = this.records) || void 0 === _a ? void 0 : _a.length) >= 1 ? this.min : void 0;
|
|
27748
|
+
}
|
|
27749
|
+
reset() {
|
|
27750
|
+
this.records = [], this.min = Number.MAX_SAFE_INTEGER;
|
|
27751
|
+
}
|
|
27752
|
+
recalculate() {
|
|
27753
|
+
if (this.min = Number.MAX_SAFE_INTEGER, this._formatedValue = void 0, this.records) for (let i = 0; i < this.records.length; i++) {
|
|
27754
|
+
const record = this.records[i];
|
|
27755
|
+
record.isAggregator ? this.min = record.min < this.min ? record.min : this.min : "number" == typeof record ? this.min = record < this.min ? record : this.min : this.field && "number" == typeof record[this.field] ? this.min = record[this.field] < this.min ? record[this.field] : this.min : this.field && !isNaN(record[this.field]) && (this.min = parseFloat(record[this.field]) < this.min ? parseFloat(record[this.field]) : this.min);
|
|
27756
|
+
}
|
|
27757
|
+
}
|
|
27758
|
+
}
|
|
27759
|
+
|
|
26911
27760
|
let idCount$1 = 1;
|
|
26912
27761
|
let EventTarget$1 = class EventTarget {
|
|
26913
27762
|
constructor() {
|
|
@@ -29572,258 +30421,6 @@
|
|
|
29572
30421
|
for (let i = 0; i < length; i++) set(i, old[i]);
|
|
29573
30422
|
}
|
|
29574
30423
|
|
|
29575
|
-
class Aggregator {
|
|
29576
|
-
constructor(config) {
|
|
29577
|
-
var _a;
|
|
29578
|
-
this.className = "Aggregator", this.isRecord = !0, this.records = [], this.key = config.key, this.field = config.dimension, this.formatFun = config.formatFun, this.isRecord = null !== (_a = config.isRecord) && void 0 !== _a ? _a : this.isRecord;
|
|
29579
|
-
}
|
|
29580
|
-
clearCacheValue() {
|
|
29581
|
-
this._formatedValue = void 0;
|
|
29582
|
-
}
|
|
29583
|
-
formatValue(col, row, table) {
|
|
29584
|
-
return this._formatedValue || (this.formatFun ? this._formatedValue = this.formatFun(this.value(), col, row, table) : this._formatedValue = this.value()), this._formatedValue;
|
|
29585
|
-
}
|
|
29586
|
-
reset() {
|
|
29587
|
-
this.records = [], this.clearCacheValue();
|
|
29588
|
-
}
|
|
29589
|
-
}
|
|
29590
|
-
class RecordAggregator extends Aggregator {
|
|
29591
|
-
constructor() {
|
|
29592
|
-
super(...arguments), this.type = AggregationType.RECORD, this.isRecord = !0;
|
|
29593
|
-
}
|
|
29594
|
-
push(record) {
|
|
29595
|
-
record && this.isRecord && this.records && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)), this.clearCacheValue();
|
|
29596
|
-
}
|
|
29597
|
-
deleteRecord(record) {
|
|
29598
|
-
record && this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), this.clearCacheValue();
|
|
29599
|
-
}
|
|
29600
|
-
updateRecord(oldRecord, newRecord) {
|
|
29601
|
-
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), this.clearCacheValue());
|
|
29602
|
-
}
|
|
29603
|
-
value() {
|
|
29604
|
-
return this.records;
|
|
29605
|
-
}
|
|
29606
|
-
reset() {
|
|
29607
|
-
this.records = [];
|
|
29608
|
-
}
|
|
29609
|
-
recalculate() {}
|
|
29610
|
-
}
|
|
29611
|
-
class NoneAggregator extends Aggregator {
|
|
29612
|
-
constructor() {
|
|
29613
|
-
super(...arguments), this.type = AggregationType.NONE, this.isRecord = !0;
|
|
29614
|
-
}
|
|
29615
|
-
push(record) {
|
|
29616
|
-
record && (this.isRecord && (this.records = [record]), this.field && (this.fieldValue = record[this.field])), this.clearCacheValue();
|
|
29617
|
-
}
|
|
29618
|
-
deleteRecord(record) {
|
|
29619
|
-
record && (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), this.field && this.records.length && (this.fieldValue = this.records[this.records.length - 1][this.field])), this.clearCacheValue();
|
|
29620
|
-
}
|
|
29621
|
-
updateRecord(oldRecord, newRecord) {
|
|
29622
|
-
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), this.field && this.records.length && (this.fieldValue = this.records[this.records.length - 1][this.field]), this.clearCacheValue());
|
|
29623
|
-
}
|
|
29624
|
-
value() {
|
|
29625
|
-
return this.fieldValue;
|
|
29626
|
-
}
|
|
29627
|
-
reset() {
|
|
29628
|
-
this.records = [], this.fieldValue = void 0;
|
|
29629
|
-
}
|
|
29630
|
-
recalculate() {}
|
|
29631
|
-
}
|
|
29632
|
-
class CustomAggregator extends Aggregator {
|
|
29633
|
-
constructor(config) {
|
|
29634
|
-
super(config), this.type = AggregationType.CUSTOM, this.isRecord = !0, this.values = [], this.aggregationFun = config.aggregationFun;
|
|
29635
|
-
}
|
|
29636
|
-
push(record) {
|
|
29637
|
-
record && (this.isRecord && this.records && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)), this.field && this.values.push(record[this.field])), this.clearCacheValue();
|
|
29638
|
-
}
|
|
29639
|
-
updateRecord(oldRecord, newRecord) {
|
|
29640
|
-
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), this.field && this.records.length && (this.values = this.records.map(item => item[this.field])), this.clearCacheValue());
|
|
29641
|
-
}
|
|
29642
|
-
deleteRecord(record) {
|
|
29643
|
-
record && (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), this.field && this.records.length && (this.values = this.records.map(item => item[this.field]))), this.clearCacheValue();
|
|
29644
|
-
}
|
|
29645
|
-
value() {
|
|
29646
|
-
var _a;
|
|
29647
|
-
return this.fieldValue || (this.fieldValue = null === (_a = this.aggregationFun) || void 0 === _a ? void 0 : _a.call(this, this.values, this.records, this.field)), this.fieldValue;
|
|
29648
|
-
}
|
|
29649
|
-
reset() {
|
|
29650
|
-
this.records = [], this.fieldValue = void 0;
|
|
29651
|
-
}
|
|
29652
|
-
recalculate() {}
|
|
29653
|
-
}
|
|
29654
|
-
class SumAggregator extends Aggregator {
|
|
29655
|
-
constructor(config) {
|
|
29656
|
-
var _a;
|
|
29657
|
-
super(config), this.type = AggregationType.SUM, this.sum = 0, this.positiveSum = 0, this.nagetiveSum = 0, this.needSplitPositiveAndNegativeForSum = !1, this.needSplitPositiveAndNegativeForSum = null !== (_a = config.needSplitPositiveAndNegative) && void 0 !== _a && _a;
|
|
29658
|
-
}
|
|
29659
|
-
push(record) {
|
|
29660
|
-
if (record) if (this.isRecord && this.records && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)), "Aggregator" === record.className) {
|
|
29661
|
-
const value = record.value();
|
|
29662
|
-
this.sum += null != value ? value : 0, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum += value : value < 0 && (this.nagetiveSum += value));
|
|
29663
|
-
} else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
29664
|
-
const value = parseFloat(record[this.field]);
|
|
29665
|
-
this.sum += value, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum += value : value < 0 && (this.nagetiveSum += value));
|
|
29666
|
-
}
|
|
29667
|
-
this.clearCacheValue();
|
|
29668
|
-
}
|
|
29669
|
-
deleteRecord(record) {
|
|
29670
|
-
if (record) if (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), "Aggregator" === record.className) {
|
|
29671
|
-
const value = record.value();
|
|
29672
|
-
this.sum -= null != value ? value : 0, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum -= value : value < 0 && (this.nagetiveSum -= value));
|
|
29673
|
-
} else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
29674
|
-
const value = parseFloat(record[this.field]);
|
|
29675
|
-
this.sum -= value, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum -= value : value < 0 && (this.nagetiveSum -= value));
|
|
29676
|
-
}
|
|
29677
|
-
this.clearCacheValue();
|
|
29678
|
-
}
|
|
29679
|
-
updateRecord(oldRecord, newRecord) {
|
|
29680
|
-
if (oldRecord && newRecord) {
|
|
29681
|
-
if (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), "Aggregator" === oldRecord.className) {
|
|
29682
|
-
const oldValue = oldRecord.value(),
|
|
29683
|
-
newValue = newRecord.value();
|
|
29684
|
-
this.sum += newValue - oldValue, this.needSplitPositiveAndNegativeForSum && (oldValue > 0 ? this.positiveSum -= oldValue : oldValue < 0 && (this.nagetiveSum -= oldValue), newValue > 0 ? this.positiveSum += newValue : newValue < 0 && (this.nagetiveSum += newValue));
|
|
29685
|
-
} else if (this.field && !isNaN(parseFloat(oldRecord[this.field]))) {
|
|
29686
|
-
const oldValue = parseFloat(oldRecord[this.field]),
|
|
29687
|
-
newValue = parseFloat(newRecord[this.field]);
|
|
29688
|
-
this.sum += newValue - oldValue, this.needSplitPositiveAndNegativeForSum && (oldValue > 0 ? this.positiveSum -= oldValue : oldValue < 0 && (this.nagetiveSum -= oldValue), newValue > 0 ? this.positiveSum += newValue : newValue < 0 && (this.nagetiveSum += newValue));
|
|
29689
|
-
}
|
|
29690
|
-
this.clearCacheValue();
|
|
29691
|
-
}
|
|
29692
|
-
}
|
|
29693
|
-
value() {
|
|
29694
|
-
var _a;
|
|
29695
|
-
return (null === (_a = this.records) || void 0 === _a ? void 0 : _a.length) >= 1 ? this.sum : void 0;
|
|
29696
|
-
}
|
|
29697
|
-
positiveValue() {
|
|
29698
|
-
return this.positiveSum;
|
|
29699
|
-
}
|
|
29700
|
-
negativeValue() {
|
|
29701
|
-
return this.nagetiveSum;
|
|
29702
|
-
}
|
|
29703
|
-
reset() {
|
|
29704
|
-
super.reset(), this.records = [], this.sum = 0;
|
|
29705
|
-
}
|
|
29706
|
-
recalculate() {
|
|
29707
|
-
if (this.sum = 0, this._formatedValue = void 0, this.records) for (let i = 0; i < this.records.length; i++) {
|
|
29708
|
-
const record = this.records[i];
|
|
29709
|
-
if ("Aggregator" === record.className) {
|
|
29710
|
-
const value = record.value();
|
|
29711
|
-
this.sum += null != value ? value : 0, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum += value : value < 0 && (this.nagetiveSum += value));
|
|
29712
|
-
} else if (this.field && !isNaN(parseFloat(record[this.field]))) {
|
|
29713
|
-
const value = parseFloat(record[this.field]);
|
|
29714
|
-
this.sum += value, this.needSplitPositiveAndNegativeForSum && (value > 0 ? this.positiveSum += value : value < 0 && (this.nagetiveSum += value));
|
|
29715
|
-
}
|
|
29716
|
-
}
|
|
29717
|
-
}
|
|
29718
|
-
}
|
|
29719
|
-
class CountAggregator extends Aggregator {
|
|
29720
|
-
constructor() {
|
|
29721
|
-
super(...arguments), this.type = AggregationType.COUNT, this.count = 0;
|
|
29722
|
-
}
|
|
29723
|
-
push(record) {
|
|
29724
|
-
record && (this.isRecord && this.records && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)), "Aggregator" === record.className ? this.count += record.value() : this.count++), this.clearCacheValue();
|
|
29725
|
-
}
|
|
29726
|
-
deleteRecord(record) {
|
|
29727
|
-
record && (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), "Aggregator" === record.className ? this.count -= record.value() : this.count--), this.clearCacheValue();
|
|
29728
|
-
}
|
|
29729
|
-
updateRecord(oldRecord, newRecord) {
|
|
29730
|
-
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), "Aggregator" === oldRecord.className && (this.count += newRecord.value() - oldRecord.value()));
|
|
29731
|
-
}
|
|
29732
|
-
value() {
|
|
29733
|
-
return this.count;
|
|
29734
|
-
}
|
|
29735
|
-
reset() {
|
|
29736
|
-
this.records = [], this.count = 0;
|
|
29737
|
-
}
|
|
29738
|
-
recalculate() {
|
|
29739
|
-
if (this.count = 0, this._formatedValue = void 0, this.records) for (let i = 0; i < this.records.length; i++) {
|
|
29740
|
-
const record = this.records[i];
|
|
29741
|
-
"Aggregator" === record.className ? this.count += record.value() : this.count++;
|
|
29742
|
-
}
|
|
29743
|
-
}
|
|
29744
|
-
}
|
|
29745
|
-
class AvgAggregator extends Aggregator {
|
|
29746
|
-
constructor() {
|
|
29747
|
-
super(...arguments), this.type = AggregationType.AVG, this.sum = 0, this.count = 0;
|
|
29748
|
-
}
|
|
29749
|
-
push(record) {
|
|
29750
|
-
record && (this.isRecord && this.records && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)), "Aggregator" === record.className && record.type === AggregationType.AVG ? (this.sum += record.sum, this.count += record.count) : this.field && !isNaN(parseFloat(record[this.field])) && (this.sum += parseFloat(record[this.field]), this.count++)), this.clearCacheValue();
|
|
29751
|
-
}
|
|
29752
|
-
deleteRecord(record) {
|
|
29753
|
-
record && (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), "Aggregator" === record.className && record.type === AggregationType.AVG ? (this.sum -= record.sum, this.count -= record.count) : this.field && !isNaN(parseFloat(record[this.field])) && (this.sum -= parseFloat(record[this.field]), this.count--)), this.clearCacheValue();
|
|
29754
|
-
}
|
|
29755
|
-
updateRecord(oldRecord, newRecord) {
|
|
29756
|
-
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), "Aggregator" === oldRecord.className && oldRecord.type === AggregationType.AVG ? (this.sum += newRecord.sum - oldRecord.sum, this.count += newRecord.count - oldRecord.count) : this.field && !isNaN(parseFloat(oldRecord[this.field])) && (this.sum += parseFloat(newRecord[this.field]) - parseFloat(oldRecord[this.field])), this.clearCacheValue());
|
|
29757
|
-
}
|
|
29758
|
-
value() {
|
|
29759
|
-
var _a;
|
|
29760
|
-
return (null === (_a = this.records) || void 0 === _a ? void 0 : _a.length) >= 1 ? this.sum / this.count : void 0;
|
|
29761
|
-
}
|
|
29762
|
-
reset() {
|
|
29763
|
-
this.records = [], this.sum = 0, this.count = 0;
|
|
29764
|
-
}
|
|
29765
|
-
recalculate() {
|
|
29766
|
-
if (this.sum = 0, this.count = 0, this._formatedValue = void 0, this.records) for (let i = 0; i < this.records.length; i++) {
|
|
29767
|
-
const record = this.records[i];
|
|
29768
|
-
"Aggregator" === record.className && record.type === AggregationType.AVG ? (this.sum += record.sum, this.count += record.count) : this.field && !isNaN(parseFloat(record[this.field])) && (this.sum += parseFloat(record[this.field]), this.count++);
|
|
29769
|
-
}
|
|
29770
|
-
}
|
|
29771
|
-
}
|
|
29772
|
-
class MaxAggregator extends Aggregator {
|
|
29773
|
-
constructor() {
|
|
29774
|
-
super(...arguments), this.type = AggregationType.MAX, this.max = Number.MIN_SAFE_INTEGER;
|
|
29775
|
-
}
|
|
29776
|
-
push(record) {
|
|
29777
|
-
record && (this.isRecord && this.records && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)), "Aggregator" === record.className ? this.max = record.max > this.max ? record.max : this.max : "number" == typeof record ? this.max = record > this.max ? record : this.max : this.field && "number" == typeof record[this.field] ? this.max = record[this.field] > this.max ? record[this.field] : this.max : this.field && !isNaN(record[this.field]) && (this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max)), this.clearCacheValue();
|
|
29778
|
-
}
|
|
29779
|
-
deleteRecord(record) {
|
|
29780
|
-
record && (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), this.recalculate());
|
|
29781
|
-
}
|
|
29782
|
-
updateRecord(oldRecord, newRecord) {
|
|
29783
|
-
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), this.recalculate());
|
|
29784
|
-
}
|
|
29785
|
-
value() {
|
|
29786
|
-
var _a;
|
|
29787
|
-
return (null === (_a = this.records) || void 0 === _a ? void 0 : _a.length) >= 1 ? this.max : void 0;
|
|
29788
|
-
}
|
|
29789
|
-
reset() {
|
|
29790
|
-
this.records = [], this.max = Number.MIN_SAFE_INTEGER;
|
|
29791
|
-
}
|
|
29792
|
-
recalculate() {
|
|
29793
|
-
if (this.max = Number.MIN_SAFE_INTEGER, this._formatedValue = void 0, this.records) for (let i = 0; i < this.records.length; i++) {
|
|
29794
|
-
const record = this.records[i];
|
|
29795
|
-
"Aggregator" === record.className ? this.max = record.max > this.max ? record.max : this.max : "number" == typeof record ? this.max = record > this.max ? record : this.max : this.field && "number" == typeof record[this.field] ? this.max = record[this.field] > this.max ? record[this.field] : this.max : this.field && !isNaN(record[this.field]) && (this.max = parseFloat(record[this.field]) > this.max ? parseFloat(record[this.field]) : this.max);
|
|
29796
|
-
}
|
|
29797
|
-
}
|
|
29798
|
-
}
|
|
29799
|
-
class MinAggregator extends Aggregator {
|
|
29800
|
-
constructor() {
|
|
29801
|
-
super(...arguments), this.type = AggregationType.MIN, this.min = Number.MAX_SAFE_INTEGER;
|
|
29802
|
-
}
|
|
29803
|
-
push(record) {
|
|
29804
|
-
record && (this.isRecord && this.records && ("Aggregator" === record.className ? this.records.push(...record.records) : this.records.push(record)), "Aggregator" === record.className ? this.min = record.min < this.min ? record.min : this.min : "number" == typeof record ? this.min = record < this.min ? record : this.min : this.field && "number" == typeof record[this.field] ? this.min = record[this.field] < this.min ? record[this.field] : this.min : this.field && !isNaN(record[this.field]) && (this.min = parseFloat(record[this.field]) < this.min ? parseFloat(record[this.field]) : this.min)), this.clearCacheValue();
|
|
29805
|
-
}
|
|
29806
|
-
deleteRecord(record) {
|
|
29807
|
-
record && (this.isRecord && this.records && (this.records = this.records.filter(item => item !== record)), this.recalculate());
|
|
29808
|
-
}
|
|
29809
|
-
updateRecord(oldRecord, newRecord) {
|
|
29810
|
-
oldRecord && newRecord && (this.isRecord && this.records && (this.records = this.records.map(item => item === oldRecord ? newRecord : item)), this.recalculate());
|
|
29811
|
-
}
|
|
29812
|
-
value() {
|
|
29813
|
-
var _a;
|
|
29814
|
-
return (null === (_a = this.records) || void 0 === _a ? void 0 : _a.length) >= 1 ? this.min : void 0;
|
|
29815
|
-
}
|
|
29816
|
-
reset() {
|
|
29817
|
-
this.records = [], this.min = Number.MAX_SAFE_INTEGER;
|
|
29818
|
-
}
|
|
29819
|
-
recalculate() {
|
|
29820
|
-
if (this.min = Number.MAX_SAFE_INTEGER, this._formatedValue = void 0, this.records) for (let i = 0; i < this.records.length; i++) {
|
|
29821
|
-
const record = this.records[i];
|
|
29822
|
-
"Aggregator" === record.className ? this.min = record.min < this.min ? record.min : this.min : "number" == typeof record ? this.min = record < this.min ? record : this.min : this.field && "number" == typeof record[this.field] ? this.min = record[this.field] < this.min ? record[this.field] : this.min : this.field && !isNaN(record[this.field]) && (this.min = parseFloat(record[this.field]) < this.min ? parseFloat(record[this.field]) : this.min);
|
|
29823
|
-
}
|
|
29824
|
-
}
|
|
29825
|
-
}
|
|
29826
|
-
|
|
29827
30424
|
function isFieldAssessor(field) {
|
|
29828
30425
|
if (obj.isObject(field)) {
|
|
29829
30426
|
const a = field;
|
|
@@ -29917,7 +30514,7 @@
|
|
|
29917
30514
|
if (aggragation) if (Array.isArray(aggragation)) for (let j = 0; j < aggragation.length; j++) {
|
|
29918
30515
|
const item = aggragation[j],
|
|
29919
30516
|
aggregator = new this.registedAggregators[item.aggregationType]({
|
|
29920
|
-
|
|
30517
|
+
field: field,
|
|
29921
30518
|
formatFun: item.formatFun,
|
|
29922
30519
|
isRecord: !0,
|
|
29923
30520
|
aggregationFun: item.aggregationFun
|
|
@@ -29925,7 +30522,7 @@
|
|
|
29925
30522
|
this.fieldAggregators.push(aggregator), columnObjs[i].vtable_aggregator || (columnObjs[i].vtable_aggregator = []), columnObjs[i].vtable_aggregator.push(aggregator);
|
|
29926
30523
|
} else {
|
|
29927
30524
|
const aggregator = new this.registedAggregators[aggragation.aggregationType]({
|
|
29928
|
-
|
|
30525
|
+
field: field,
|
|
29929
30526
|
formatFun: aggragation.formatFun,
|
|
29930
30527
|
isRecord: !0,
|
|
29931
30528
|
aggregationFun: aggragation.aggregationFun
|
|
@@ -30663,14 +31260,14 @@
|
|
|
30663
31260
|
fantasy: 1,
|
|
30664
31261
|
monospace: 1
|
|
30665
31262
|
};
|
|
30666
|
-
var parse$
|
|
31263
|
+
var parse$1 = cssfontparser.exports = function (str, existing, dpi) {
|
|
30667
31264
|
var cacheKey = str + '-' + (existing || 'null') + '@' + dpi;
|
|
30668
31265
|
dpi = dpi || 96.0;
|
|
30669
31266
|
if (typeof cache[cacheKey] !== 'undefined') {
|
|
30670
31267
|
return cache[cacheKey];
|
|
30671
31268
|
}
|
|
30672
31269
|
if (existing) {
|
|
30673
|
-
existing = parse$
|
|
31270
|
+
existing = parse$1(existing, null, dpi);
|
|
30674
31271
|
}
|
|
30675
31272
|
if (str === 'inherit') {
|
|
30676
31273
|
return existing;
|
|
@@ -30755,10 +31352,10 @@
|
|
|
30755
31352
|
};
|
|
30756
31353
|
cssfontparser.exports.generics = generics;
|
|
30757
31354
|
var cssfontparserExports = cssfontparser.exports;
|
|
30758
|
-
var parse$
|
|
31355
|
+
var parse$2 = /*@__PURE__*/getDefaultExportFromCjs(cssfontparserExports);
|
|
30759
31356
|
|
|
30760
31357
|
function parseFont(font) {
|
|
30761
|
-
return parse$
|
|
31358
|
+
return parse$2(font);
|
|
30762
31359
|
}
|
|
30763
31360
|
|
|
30764
31361
|
function getQuadProps(paddingOrigin) {
|
|
@@ -30817,978 +31414,395 @@
|
|
|
30817
31414
|
function tokenize(calc) {
|
|
30818
31415
|
const exp = calc.replace(/calc\(/g, "(").trim(),
|
|
30819
31416
|
tokens = [],
|
|
30820
|
-
len = exp.length;
|
|
30821
|
-
for (let index = 0; index < len; index++) {
|
|
30822
|
-
const c = exp[index],
|
|
30823
|
-
cp = c.charCodeAt(0);
|
|
30824
|
-
if ("(" === c || ")" === c) tokens.push({
|
|
30825
|
-
value: c,
|
|
30826
|
-
type: TYPE_PAREN
|
|
30827
|
-
});else if ("*" === c || "/" === c) tokens.push({
|
|
30828
|
-
value: c,
|
|
30829
|
-
type: TYPE_OPERATOR
|
|
30830
|
-
});else if ("+" === c || "-" === c) index = parseSign(c, index + 1) - 1;else if (isDigit(cp) || isDot(cp)) index = parseNum(c, index + 1) - 1;else if (!isWhitespace(cp)) throw createError(calc);
|
|
30831
|
-
}
|
|
30832
|
-
function parseSign(sign, start) {
|
|
30833
|
-
if (start < len) {
|
|
30834
|
-
const c = exp[start],
|
|
30835
|
-
cp = c.charCodeAt(0);
|
|
30836
|
-
if (isDigit(cp) || isDot(cp)) return parseNum(sign + c, start + 1);
|
|
30837
|
-
}
|
|
30838
|
-
return tokens.push({
|
|
30839
|
-
value: sign,
|
|
30840
|
-
type: TYPE_OPERATOR
|
|
30841
|
-
}), start;
|
|
30842
|
-
}
|
|
30843
|
-
function parseNum(num, start) {
|
|
30844
|
-
let index = start;
|
|
30845
|
-
for (; index < len; index++) {
|
|
30846
|
-
const c = exp[index],
|
|
30847
|
-
cp = c.charCodeAt(0);
|
|
30848
|
-
if (isDigit(cp)) num += c;else {
|
|
30849
|
-
if ("." !== c) {
|
|
30850
|
-
if (isUnit(cp)) return parseUnit(num, c, index + 1);
|
|
30851
|
-
break;
|
|
30852
|
-
}
|
|
30853
|
-
if (num.indexOf(".") >= 0) throw createError(calc);
|
|
30854
|
-
num += c;
|
|
30855
|
-
}
|
|
30856
|
-
}
|
|
30857
|
-
if ("." === num) throw createError(calc);
|
|
30858
|
-
return tokens.push({
|
|
30859
|
-
value: parseFloat(num),
|
|
30860
|
-
type: TYPE_NUMBER
|
|
30861
|
-
}), index;
|
|
30862
|
-
}
|
|
30863
|
-
function parseUnit(num, unit, start) {
|
|
30864
|
-
let index = start;
|
|
30865
|
-
for (; index < len; index++) {
|
|
30866
|
-
const c = exp[index];
|
|
30867
|
-
if (!isUnit(c.charCodeAt(0))) break;
|
|
30868
|
-
unit += c;
|
|
30869
|
-
}
|
|
30870
|
-
return tokens.push({
|
|
30871
|
-
value: parseFloat(num),
|
|
30872
|
-
unit: unit,
|
|
30873
|
-
type: TYPE_UNIT
|
|
30874
|
-
}), index;
|
|
30875
|
-
}
|
|
30876
|
-
return tokens;
|
|
30877
|
-
}
|
|
30878
|
-
const PRECEDENCE = {
|
|
30879
|
-
"*": 3,
|
|
30880
|
-
"/": 3,
|
|
30881
|
-
"+": 2,
|
|
30882
|
-
"-": 2
|
|
30883
|
-
};
|
|
30884
|
-
function lex(tokens, calc) {
|
|
30885
|
-
function buildBinaryExpNode(stack) {
|
|
30886
|
-
const right = stack.pop(),
|
|
30887
|
-
op = stack.pop(),
|
|
30888
|
-
left = stack.pop();
|
|
30889
|
-
if (!(left && left.nodeType && op && op.type === TYPE_OPERATOR && right && right.nodeType)) throw createError(calc);
|
|
30890
|
-
return {
|
|
30891
|
-
nodeType: NODE_TYPE_BINARY_EXPRESSION,
|
|
30892
|
-
left: left,
|
|
30893
|
-
op: op,
|
|
30894
|
-
right: right
|
|
30895
|
-
};
|
|
30896
|
-
}
|
|
30897
|
-
const stack = [];
|
|
30898
|
-
for (; tokens.length;) {
|
|
30899
|
-
const token = tokens.shift();
|
|
30900
|
-
if (token.type === TYPE_PAREN && "(" === token.value) {
|
|
30901
|
-
let deep = 0;
|
|
30902
|
-
const closeIndex = array.findIndex(tokens, t => {
|
|
30903
|
-
if (t.type === TYPE_PAREN && "(" === t.value) deep++;else if (t.type === TYPE_PAREN && ")" === t.value) {
|
|
30904
|
-
if (!deep) return !0;
|
|
30905
|
-
deep--;
|
|
30906
|
-
}
|
|
30907
|
-
return !1;
|
|
30908
|
-
});
|
|
30909
|
-
if (-1 === closeIndex) throw createError(calc);
|
|
30910
|
-
stack.push(lex(tokens.splice(0, closeIndex), calc)), tokens.shift();
|
|
30911
|
-
} else if (token.type === TYPE_OPERATOR) {
|
|
30912
|
-
if (stack.length >= 3) {
|
|
30913
|
-
const beforeOp = stack[stack.length - 2].value;
|
|
30914
|
-
PRECEDENCE[token.value] <= PRECEDENCE[beforeOp] && stack.push(buildBinaryExpNode(stack));
|
|
30915
|
-
}
|
|
30916
|
-
stack.push(token);
|
|
30917
|
-
} else if (token.type === TYPE_UNIT) {
|
|
30918
|
-
const {
|
|
30919
|
-
value: num,
|
|
30920
|
-
unit: unit
|
|
30921
|
-
} = token;
|
|
30922
|
-
stack.push({
|
|
30923
|
-
nodeType: NODE_TYPE_UNIT,
|
|
30924
|
-
value: num,
|
|
30925
|
-
unit: unit
|
|
30926
|
-
});
|
|
30927
|
-
} else token.type === TYPE_NUMBER && stack.push({
|
|
30928
|
-
nodeType: NODE_TYPE_NUMBER,
|
|
30929
|
-
value: token.value
|
|
30930
|
-
});
|
|
30931
|
-
}
|
|
30932
|
-
for (; stack.length > 1;) stack.push(buildBinaryExpNode(stack));
|
|
30933
|
-
return stack[0];
|
|
30934
|
-
}
|
|
30935
|
-
function parse$1(calcStr) {
|
|
30936
|
-
return lex(tokenize(calcStr), calcStr);
|
|
30937
|
-
}
|
|
30938
|
-
function calcNode(node, context) {
|
|
30939
|
-
if (node.nodeType === NODE_TYPE_BINARY_EXPRESSION) {
|
|
30940
|
-
const left = calcNode(node.left, context),
|
|
30941
|
-
right = calcNode(node.right, context);
|
|
30942
|
-
switch (node.op.value) {
|
|
30943
|
-
case "+":
|
|
30944
|
-
return left + right;
|
|
30945
|
-
case "-":
|
|
30946
|
-
return left - right;
|
|
30947
|
-
case "*":
|
|
30948
|
-
return left * right;
|
|
30949
|
-
case "/":
|
|
30950
|
-
return left / right;
|
|
30951
|
-
default:
|
|
30952
|
-
throw new Error(`calc error. unknown operator: ${node.op.value}`);
|
|
30953
|
-
}
|
|
30954
|
-
} else if (node.nodeType === NODE_TYPE_UNIT) switch (node.unit) {
|
|
30955
|
-
case "%":
|
|
30956
|
-
return node.value * context.full / 100;
|
|
30957
|
-
case "px":
|
|
30958
|
-
return node.value;
|
|
30959
|
-
default:
|
|
30960
|
-
throw new Error(`calc error. unknown unit: ${node.unit}`);
|
|
30961
|
-
} else if (node.nodeType === NODE_TYPE_NUMBER) return node.value;
|
|
30962
|
-
throw new Error("calc error.");
|
|
30963
|
-
}
|
|
30964
|
-
function toPxInternal(value, context) {
|
|
30965
|
-
return calcNode(parse$1(value), context);
|
|
30966
|
-
}
|
|
30967
|
-
function toPx(value, context) {
|
|
30968
|
-
return "string" == typeof value ? toPxInternal(value.trim(), context) : value - 0;
|
|
30969
|
-
}
|
|
30970
|
-
function couldBeValidNumber(v) {
|
|
30971
|
-
return !isNil$1(v) && (!!isNumber$2(v) || +v == +v);
|
|
30972
|
-
}
|
|
30973
|
-
function isPercent(v) {
|
|
30974
|
-
return !!isString$2(v) && !!v.endsWith("%") && couldBeValidNumber(v.substring(0, v.length - 1));
|
|
30975
|
-
}
|
|
30976
|
-
|
|
30977
|
-
function createRootElement(padding) {
|
|
30978
|
-
let className = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "vtable";
|
|
30979
|
-
var _a, _b;
|
|
30980
|
-
const element = document.createElement("div");
|
|
30981
|
-
element.setAttribute("tabindex", "0"), element.classList.add(className), element.style.outline = "none", element.style.margin = `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px`;
|
|
30982
|
-
const width = (element.offsetWidth || (null === (_a = element.parentElement) || void 0 === _a ? void 0 : _a.offsetWidth) || 1) - 1,
|
|
30983
|
-
height = (element.offsetHeight || (null === (_b = element.parentElement) || void 0 === _b ? void 0 : _b.offsetHeight) || 1) - 1;
|
|
30984
|
-
return element.style.width = width && width - padding.left - padding.right + "px" || "0px", element.style.height = height && height - padding.top - padding.bottom + "px" || "0px", element;
|
|
30985
|
-
}
|
|
30986
|
-
function updateRootElementPadding(element, padding) {
|
|
30987
|
-
var _a, _b;
|
|
30988
|
-
element.style.margin = `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px`;
|
|
30989
|
-
const width = (element.offsetWidth || (null === (_a = element.parentElement) || void 0 === _a ? void 0 : _a.offsetWidth) || 1) - 1,
|
|
30990
|
-
height = (element.offsetHeight || (null === (_b = element.parentElement) || void 0 === _b ? void 0 : _b.offsetHeight) || 1) - 1;
|
|
30991
|
-
element.style.width = width && width - padding.left - padding.right + "px" || "0px", element.style.height = height && height - padding.top - padding.bottom + "px" || "0px";
|
|
30992
|
-
}
|
|
30993
|
-
function _dealWithUpdateDataSource(table, fn) {
|
|
30994
|
-
const {
|
|
30995
|
-
dataSourceEventIds: dataSourceEventIds
|
|
30996
|
-
} = table.internalProps;
|
|
30997
|
-
dataSourceEventIds && dataSourceEventIds.forEach(id => table.internalProps.handler.off(id)), fn(table), table.internalProps.dataSourceEventIds = [table.internalProps.handler.on(table.internalProps.dataSource, DataSource.EVENT_TYPE.CHANGE_ORDER, () => {
|
|
30998
|
-
table.dataSource.hierarchyExpandLevel && table.refreshRowColCount(), table.render();
|
|
30999
|
-
})];
|
|
31000
|
-
}
|
|
31001
|
-
function _setRecords(table) {
|
|
31002
|
-
let records = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
31003
|
-
_dealWithUpdateDataSource(table, () => {
|
|
31004
|
-
table.internalProps.records = records;
|
|
31005
|
-
const newDataSource = table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.columns, table.internalProps.layoutMap.rowHierarchyType, getHierarchyExpandLevel(table));
|
|
31006
|
-
table.addReleaseObj(newDataSource);
|
|
31007
|
-
});
|
|
31008
|
-
}
|
|
31009
|
-
function getHierarchyExpandLevel(table) {
|
|
31010
|
-
var _a;
|
|
31011
|
-
return table.options.hierarchyExpandLevel ? table.options.hierarchyExpandLevel : table.options.groupBy ? 1 / 0 : (null === (_a = table._hasHierarchyTreeHeader) || void 0 === _a ? void 0 : _a.call(table)) ? 1 : void 0;
|
|
31012
|
-
}
|
|
31013
|
-
function _setDataSource(table, dataSource) {
|
|
31014
|
-
_dealWithUpdateDataSource(table, () => {
|
|
31015
|
-
if (dataSource) {
|
|
31016
|
-
if (dataSource instanceof DataSource) table.internalProps.dataSource = dataSource;else {
|
|
31017
|
-
const newDataSource = table.internalProps.dataSource = new CachedDataSource(dataSource);
|
|
31018
|
-
table.addReleaseObj(newDataSource);
|
|
31019
|
-
}
|
|
31020
|
-
} else table.internalProps.dataSource = DataSource.EMPTY;
|
|
31021
|
-
table.internalProps.records = null;
|
|
31022
|
-
});
|
|
31023
|
-
}
|
|
31024
|
-
function _getTargetFrozenRowAt(table, absoluteY) {
|
|
31025
|
-
if (!table.internalProps.frozenRowCount) return null;
|
|
31026
|
-
let {
|
|
31027
|
-
scrollTop: scrollTop
|
|
31028
|
-
} = table;
|
|
31029
|
-
const rowCount = table.internalProps.frozenRowCount;
|
|
31030
|
-
for (let row = 0; row < rowCount; row++) {
|
|
31031
|
-
const height = table.getRowHeight(row),
|
|
31032
|
-
bottom = scrollTop + height;
|
|
31033
|
-
if (bottom > absoluteY) return {
|
|
31034
|
-
top: scrollTop,
|
|
31035
|
-
row: row,
|
|
31036
|
-
bottom: bottom,
|
|
31037
|
-
height: height
|
|
31038
|
-
};
|
|
31039
|
-
scrollTop = bottom;
|
|
31040
|
-
}
|
|
31041
|
-
return null;
|
|
31042
|
-
}
|
|
31043
|
-
function _getTargetFrozenColAt(table, absoluteX) {
|
|
31044
|
-
if (!table.internalProps.frozenColCount) return null;
|
|
31045
|
-
let {
|
|
31046
|
-
scrollLeft: scrollLeft
|
|
31047
|
-
} = table;
|
|
31048
|
-
const colCount = table.internalProps.frozenColCount;
|
|
31049
|
-
for (let col = 0; col < colCount; col++) {
|
|
31050
|
-
const width = table.getColWidth(col),
|
|
31051
|
-
right = scrollLeft + width;
|
|
31052
|
-
if (right > absoluteX) return {
|
|
31053
|
-
left: scrollLeft,
|
|
31054
|
-
col: col,
|
|
31055
|
-
right: right,
|
|
31056
|
-
width: width
|
|
31057
|
-
};
|
|
31058
|
-
scrollLeft = right;
|
|
31059
|
-
}
|
|
31060
|
-
return null;
|
|
31061
|
-
}
|
|
31062
|
-
function _toPxWidth(table, width) {
|
|
31063
|
-
return Math.round(toPx(width, table.internalProps.calcWidthContext));
|
|
31064
|
-
}
|
|
31065
|
-
function _applyColWidthLimits(limits, orgWidth) {
|
|
31066
|
-
return limits ? limits.min && limits.min > orgWidth ? limits.min : limits.max && limits.max < orgWidth ? limits.max : orgWidth : orgWidth;
|
|
31067
|
-
}
|
|
31068
|
-
function _getScrollableVisibleRect(table) {
|
|
31069
|
-
let frozenColsWidth = 0,
|
|
31070
|
-
rightFrozenColsWidth = 0;
|
|
31071
|
-
table.frozenColCount > 0 && (frozenColsWidth = table.getFrozenColsWidth()), table.rightFrozenColCount > 0 && (rightFrozenColsWidth = table.getRightFrozenColsWidth());
|
|
31072
|
-
let frozenRowsHeight = 0,
|
|
31073
|
-
bottomFrozenRowsHeight = 0;
|
|
31074
|
-
return table.frozenRowCount > 0 && (frozenRowsHeight = table.getFrozenRowsHeight()), table.bottomFrozenRowCount > 0 && (bottomFrozenRowsHeight = table.getBottomFrozenRowsHeight()), new Rect(table.scrollLeft + frozenColsWidth, table.scrollTop + frozenRowsHeight, table.tableNoFrameWidth - frozenColsWidth - rightFrozenColsWidth, table.tableNoFrameHeight - frozenRowsHeight - bottomFrozenRowsHeight);
|
|
31075
|
-
}
|
|
31076
|
-
function getStyleTheme(headerStyle, table, col, row, getProp) {
|
|
31077
|
-
let needGetTheme = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !0;
|
|
31078
|
-
const padding = getQuadProps(getProp("padding", headerStyle, col, row, table)),
|
|
31079
|
-
bgColor = getProp("bgColor", headerStyle, col, row, table),
|
|
31080
|
-
font = getProp("font", headerStyle, col, row, table);
|
|
31081
|
-
let fontFamily, fontSize, fontWeight, fontStyle, fontVariant;
|
|
31082
|
-
if (font) {
|
|
31083
|
-
const {
|
|
31084
|
-
family: family,
|
|
31085
|
-
size: size,
|
|
31086
|
-
weight: weight,
|
|
31087
|
-
style: style,
|
|
31088
|
-
variant: variant
|
|
31089
|
-
} = parseFont(font);
|
|
31090
|
-
fontFamily = family.join(" "), fontSize = size, fontWeight = weight, fontStyle = style, fontStyle = variant;
|
|
31091
|
-
} else fontFamily = getProp("fontFamily", headerStyle, col, row, table), fontSize = getProp("fontSize", headerStyle, col, row, table), fontWeight = getProp("fontWeight", headerStyle, col, row, table), fontStyle = getProp("fontStyle", headerStyle, col, row, table), fontVariant = getProp("fontVariant", headerStyle, col, row, table);
|
|
31092
|
-
const textAlign = getProp("textAlign", headerStyle, col, row, table),
|
|
31093
|
-
textBaseline = getProp("textBaseline", headerStyle, col, row, table),
|
|
31094
|
-
color = getProp("color", headerStyle, col, row, table),
|
|
31095
|
-
strokeColor = getProp("strokeColor", headerStyle, col, row, table),
|
|
31096
|
-
lineHeight = getProp("lineHeight", headerStyle, col, row, table),
|
|
31097
|
-
underline = getProp("underline", headerStyle, col, row, table),
|
|
31098
|
-
underlineDash = getProp("underlineDash", headerStyle, col, row, table),
|
|
31099
|
-
underlineOffset = getProp("underlineOffset", headerStyle, col, row, table),
|
|
31100
|
-
lineThrough = getProp("lineThrough", headerStyle, col, row, table),
|
|
31101
|
-
textDecorationWidth = Math.max(1, Math.floor(fontSize / 10)),
|
|
31102
|
-
textOverflow = getProp("textOverflow", headerStyle, col, row, table),
|
|
31103
|
-
borderColor = getProp("borderColor", headerStyle, col, row, table),
|
|
31104
|
-
borderLineWidth = getProp("borderLineWidth", headerStyle, col, row, table),
|
|
31105
|
-
borderLineDash = getProp("borderLineDash", headerStyle, col, row, table),
|
|
31106
|
-
marked = getProp("marked", headerStyle, col, row, table),
|
|
31107
|
-
cursor = getProp("cursor", headerStyle, col, row, table),
|
|
31108
|
-
hasFunctionPros = !(padding && bgColor && font && textAlign && textBaseline && color && textOverflow && borderColor && borderLineWidth && borderLineDash && "boolean" == typeof underline && "boolean" == typeof lineThrough && "boolean" == typeof marked);
|
|
31109
|
-
if (!needGetTheme) return {
|
|
31110
|
-
hasFunctionPros: hasFunctionPros
|
|
31111
|
-
};
|
|
31112
|
-
const theme = {
|
|
31113
|
-
text: {
|
|
31114
|
-
fontFamily: fontFamily,
|
|
31115
|
-
fontSize: fontSize,
|
|
31116
|
-
fontWeight: fontWeight,
|
|
31117
|
-
fontStyle: fontStyle,
|
|
31118
|
-
fontVariant: fontVariant,
|
|
31119
|
-
fill: color,
|
|
31120
|
-
stroke: null != strokeColor && strokeColor,
|
|
31121
|
-
textAlign: textAlign,
|
|
31122
|
-
textBaseline: textBaseline,
|
|
31123
|
-
lineHeight: null != lineHeight ? lineHeight : fontSize,
|
|
31124
|
-
underline: underline ? textDecorationWidth : void 0,
|
|
31125
|
-
underlineDash: underlineDash,
|
|
31126
|
-
underlineOffset: underlineOffset,
|
|
31127
|
-
lineThrough: lineThrough ? textDecorationWidth : void 0,
|
|
31128
|
-
ellipsis: "clip" === textOverflow ? "" : "ellipsis" === textOverflow ? "..." : isValid$1(textOverflow) ? textOverflow : void 0
|
|
31129
|
-
},
|
|
31130
|
-
group: {
|
|
31131
|
-
fill: bgColor,
|
|
31132
|
-
lineDash: borderLineDash,
|
|
31133
|
-
lineWidth: borderLineWidth,
|
|
31134
|
-
stroke: borderColor,
|
|
31135
|
-
cursor: "auto" === cursor || "default" === cursor ? void 0 : cursor
|
|
31136
|
-
},
|
|
31137
|
-
_vtable: {
|
|
31138
|
-
padding: padding,
|
|
31139
|
-
marked: marked
|
|
31140
|
-
}
|
|
31141
|
-
};
|
|
31142
|
-
if (Array.isArray(borderLineWidth) && (theme.group.strokeArrayWidth = getQuadProps(borderLineWidth)), Array.isArray(borderColor)) {
|
|
31143
|
-
const strokeColors = getQuadProps(borderColor);
|
|
31144
|
-
theme.group.stroke = !strokeColors.every(color => !color) && strokeColors, theme.group.strokeArrayColor = getQuadProps(borderColor);
|
|
31145
|
-
}
|
|
31146
|
-
return {
|
|
31147
|
-
theme: theme,
|
|
31148
|
-
hasFunctionPros: hasFunctionPros
|
|
31149
|
-
};
|
|
31150
|
-
}
|
|
31151
|
-
function getCellCornerRadius(col, row, table) {
|
|
31152
|
-
const tableCornerRadius = table.theme.frameStyle.cornerRadius;
|
|
31153
|
-
if (Array.isArray(tableCornerRadius)) {
|
|
31154
|
-
if (0 === col && 0 === row) return [tableCornerRadius[0], 0, 0, 0];
|
|
31155
|
-
if (col === table.colCount - 1 && 0 === row) return [0, tableCornerRadius[1], 0, 0];
|
|
31156
|
-
if (0 === col && row === table.rowCount - 1) return [0, 0, 0, tableCornerRadius[3]];
|
|
31157
|
-
if (col === table.colCount - 1 && row === table.rowCount - 1) return [0, 0, tableCornerRadius[2], 0];
|
|
31158
|
-
} else if (tableCornerRadius) {
|
|
31159
|
-
if (0 === col && 0 === row) return [tableCornerRadius, 0, 0, 0];
|
|
31160
|
-
if (col === table.colCount - 1 && 0 === row) return [0, tableCornerRadius, 0, 0];
|
|
31161
|
-
if (0 === col && row === table.rowCount - 1) return [0, 0, 0, tableCornerRadius];
|
|
31162
|
-
if (col === table.colCount - 1 && row === table.rowCount - 1) return [0, 0, tableCornerRadius, 0];
|
|
31163
|
-
}
|
|
31164
|
-
return 0;
|
|
31165
|
-
}
|
|
31166
|
-
function generateAggregationForColumn(table) {
|
|
31167
|
-
for (let col = 0; col < table.internalProps.columns.length; col++) {
|
|
31168
|
-
const colDef = table.internalProps.columns[col];
|
|
31169
|
-
if (colDef.aggregation) ;else if (table.options.aggregation) {
|
|
31170
|
-
let aggregation;
|
|
31171
|
-
if (aggregation = "function" == typeof table.options.aggregation ? table.options.aggregation({
|
|
31172
|
-
col: col,
|
|
31173
|
-
field: colDef.field
|
|
31174
|
-
}) : table.options.aggregation, aggregation) if (Array.isArray(aggregation)) {
|
|
31175
|
-
const aggregations = [];
|
|
31176
|
-
aggregation.forEach(item => {
|
|
31177
|
-
aggregations.push(Object.assign({
|
|
31178
|
-
showOnTop: !1
|
|
31179
|
-
}, item));
|
|
31180
|
-
}), colDef.aggregation = aggregations;
|
|
31181
|
-
} else colDef.aggregation = Object.assign({
|
|
31182
|
-
showOnTop: !1
|
|
31183
|
-
}, aggregation);
|
|
31184
|
-
}
|
|
31185
|
-
}
|
|
31186
|
-
}
|
|
31187
|
-
function checkHasAggregationOnColumnDefine(colDefs) {
|
|
31188
|
-
for (let i = 0; i < colDefs.length; i++) {
|
|
31189
|
-
if (colDefs[i].aggregation) return !0;
|
|
31190
|
-
}
|
|
31191
|
-
return !1;
|
|
31192
|
-
}
|
|
31193
|
-
|
|
31194
|
-
var lib$1 = {};
|
|
31195
|
-
|
|
31196
|
-
var gif = {};
|
|
31197
|
-
|
|
31198
|
-
var lib = {};
|
|
31199
|
-
|
|
31200
|
-
Object.defineProperty(lib, "__esModule", {
|
|
31201
|
-
value: true
|
|
31202
|
-
});
|
|
31203
|
-
lib.loop = lib.conditional = lib.parse = void 0;
|
|
31204
|
-
var parse = function parse(stream, schema) {
|
|
31205
|
-
var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
31206
|
-
var parent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : result;
|
|
31207
|
-
if (Array.isArray(schema)) {
|
|
31208
|
-
schema.forEach(function (partSchema) {
|
|
31209
|
-
return parse(stream, partSchema, result, parent);
|
|
31210
|
-
});
|
|
31211
|
-
} else if (typeof schema === 'function') {
|
|
31212
|
-
schema(stream, result, parent, parse);
|
|
31213
|
-
} else {
|
|
31214
|
-
var key = Object.keys(schema)[0];
|
|
31215
|
-
if (Array.isArray(schema[key])) {
|
|
31216
|
-
parent[key] = {};
|
|
31217
|
-
parse(stream, schema[key], result, parent[key]);
|
|
31218
|
-
} else {
|
|
31219
|
-
parent[key] = schema[key](stream, result, parent, parse);
|
|
31220
|
-
}
|
|
31221
|
-
}
|
|
31222
|
-
return result;
|
|
31223
|
-
};
|
|
31224
|
-
lib.parse = parse;
|
|
31225
|
-
var conditional = function conditional(schema, conditionFunc) {
|
|
31226
|
-
return function (stream, result, parent, parse) {
|
|
31227
|
-
if (conditionFunc(stream, result, parent)) {
|
|
31228
|
-
parse(stream, schema, result, parent);
|
|
31229
|
-
}
|
|
31230
|
-
};
|
|
31231
|
-
};
|
|
31232
|
-
lib.conditional = conditional;
|
|
31233
|
-
var loop = function loop(schema, continueFunc) {
|
|
31234
|
-
return function (stream, result, parent, parse) {
|
|
31235
|
-
var arr = [];
|
|
31236
|
-
var lastStreamPos = stream.pos;
|
|
31237
|
-
while (continueFunc(stream, result, parent)) {
|
|
31238
|
-
var newParent = {};
|
|
31239
|
-
parse(stream, schema, result, newParent); // cases when whole file is parsed but no termination is there and stream position is not getting updated as well
|
|
31240
|
-
// it falls into infinite recursion, null check to avoid the same
|
|
31241
|
-
|
|
31242
|
-
if (stream.pos === lastStreamPos) {
|
|
31243
|
-
break;
|
|
31244
|
-
}
|
|
31245
|
-
lastStreamPos = stream.pos;
|
|
31246
|
-
arr.push(newParent);
|
|
31247
|
-
}
|
|
31248
|
-
return arr;
|
|
31249
|
-
};
|
|
31250
|
-
};
|
|
31251
|
-
lib.loop = loop;
|
|
31252
|
-
|
|
31253
|
-
var uint8 = {};
|
|
31254
|
-
|
|
31255
|
-
Object.defineProperty(uint8, "__esModule", {
|
|
31256
|
-
value: true
|
|
31257
|
-
});
|
|
31258
|
-
uint8.readBits = uint8.readArray = uint8.readUnsigned = uint8.readString = uint8.peekBytes = uint8.readBytes = uint8.peekByte = uint8.readByte = uint8.buildStream = void 0;
|
|
31259
|
-
|
|
31260
|
-
// Default stream and parsers for Uint8TypedArray data type
|
|
31261
|
-
var buildStream = function buildStream(uint8Data) {
|
|
31262
|
-
return {
|
|
31263
|
-
data: uint8Data,
|
|
31264
|
-
pos: 0
|
|
31265
|
-
};
|
|
31266
|
-
};
|
|
31267
|
-
uint8.buildStream = buildStream;
|
|
31268
|
-
var readByte = function readByte() {
|
|
31269
|
-
return function (stream) {
|
|
31270
|
-
return stream.data[stream.pos++];
|
|
31271
|
-
};
|
|
31272
|
-
};
|
|
31273
|
-
uint8.readByte = readByte;
|
|
31274
|
-
var peekByte = function peekByte() {
|
|
31275
|
-
var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
31276
|
-
return function (stream) {
|
|
31277
|
-
return stream.data[stream.pos + offset];
|
|
31278
|
-
};
|
|
31279
|
-
};
|
|
31280
|
-
uint8.peekByte = peekByte;
|
|
31281
|
-
var readBytes = function readBytes(length) {
|
|
31282
|
-
return function (stream) {
|
|
31283
|
-
return stream.data.subarray(stream.pos, stream.pos += length);
|
|
31284
|
-
};
|
|
31285
|
-
};
|
|
31286
|
-
uint8.readBytes = readBytes;
|
|
31287
|
-
var peekBytes = function peekBytes(length) {
|
|
31288
|
-
return function (stream) {
|
|
31289
|
-
return stream.data.subarray(stream.pos, stream.pos + length);
|
|
31290
|
-
};
|
|
31291
|
-
};
|
|
31292
|
-
uint8.peekBytes = peekBytes;
|
|
31293
|
-
var readString = function readString(length) {
|
|
31294
|
-
return function (stream) {
|
|
31295
|
-
return Array.from(readBytes(length)(stream)).map(function (value) {
|
|
31296
|
-
return String.fromCharCode(value);
|
|
31297
|
-
}).join('');
|
|
31298
|
-
};
|
|
31299
|
-
};
|
|
31300
|
-
uint8.readString = readString;
|
|
31301
|
-
var readUnsigned = function readUnsigned(littleEndian) {
|
|
31302
|
-
return function (stream) {
|
|
31303
|
-
var bytes = readBytes(2)(stream);
|
|
31304
|
-
return littleEndian ? (bytes[1] << 8) + bytes[0] : (bytes[0] << 8) + bytes[1];
|
|
31305
|
-
};
|
|
31306
|
-
};
|
|
31307
|
-
uint8.readUnsigned = readUnsigned;
|
|
31308
|
-
var readArray = function readArray(byteSize, totalOrFunc) {
|
|
31309
|
-
return function (stream, result, parent) {
|
|
31310
|
-
var total = typeof totalOrFunc === 'function' ? totalOrFunc(stream, result, parent) : totalOrFunc;
|
|
31311
|
-
var parser = readBytes(byteSize);
|
|
31312
|
-
var arr = new Array(total);
|
|
31313
|
-
for (var i = 0; i < total; i++) {
|
|
31314
|
-
arr[i] = parser(stream);
|
|
31315
|
-
}
|
|
31316
|
-
return arr;
|
|
31317
|
-
};
|
|
31318
|
-
};
|
|
31319
|
-
uint8.readArray = readArray;
|
|
31320
|
-
var subBitsTotal = function subBitsTotal(bits, startIndex, length) {
|
|
31321
|
-
var result = 0;
|
|
31322
|
-
for (var i = 0; i < length; i++) {
|
|
31323
|
-
result += bits[startIndex + i] && Math.pow(2, length - i - 1);
|
|
31324
|
-
}
|
|
31325
|
-
return result;
|
|
31326
|
-
};
|
|
31327
|
-
var readBits = function readBits(schema) {
|
|
31328
|
-
return function (stream) {
|
|
31329
|
-
var _byte = readByte()(stream); // convert the byte to bit array
|
|
31330
|
-
|
|
31331
|
-
var bits = new Array(8);
|
|
31332
|
-
for (var i = 0; i < 8; i++) {
|
|
31333
|
-
bits[7 - i] = !!(_byte & 1 << i);
|
|
31334
|
-
} // convert the bit array to values based on the schema
|
|
31335
|
-
|
|
31336
|
-
return Object.keys(schema).reduce(function (res, key) {
|
|
31337
|
-
var def = schema[key];
|
|
31338
|
-
if (def.length) {
|
|
31339
|
-
res[key] = subBitsTotal(bits, def.index, def.length);
|
|
31340
|
-
} else {
|
|
31341
|
-
res[key] = bits[def.index];
|
|
31342
|
-
}
|
|
31343
|
-
return res;
|
|
31344
|
-
}, {});
|
|
31345
|
-
};
|
|
31346
|
-
};
|
|
31347
|
-
uint8.readBits = readBits;
|
|
31348
|
-
|
|
31349
|
-
(function (exports) {
|
|
31350
|
-
|
|
31351
|
-
Object.defineProperty(exports, "__esModule", {
|
|
31352
|
-
value: true
|
|
31353
|
-
});
|
|
31354
|
-
exports["default"] = void 0;
|
|
31355
|
-
var _ = lib;
|
|
31356
|
-
var _uint = uint8;
|
|
31357
|
-
|
|
31358
|
-
// a set of 0x00 terminated subblocks
|
|
31359
|
-
var subBlocksSchema = {
|
|
31360
|
-
blocks: function blocks(stream) {
|
|
31361
|
-
var terminator = 0x00;
|
|
31362
|
-
var chunks = [];
|
|
31363
|
-
var streamSize = stream.data.length;
|
|
31364
|
-
var total = 0;
|
|
31365
|
-
for (var size = (0, _uint.readByte)()(stream); size !== terminator; size = (0, _uint.readByte)()(stream)) {
|
|
31366
|
-
// size becomes undefined for some case when file is corrupted and terminator is not proper
|
|
31367
|
-
// null check to avoid recursion
|
|
31368
|
-
if (!size) break; // catch corrupted files with no terminator
|
|
31369
|
-
|
|
31370
|
-
if (stream.pos + size >= streamSize) {
|
|
31371
|
-
var availableSize = streamSize - stream.pos;
|
|
31372
|
-
chunks.push((0, _uint.readBytes)(availableSize)(stream));
|
|
31373
|
-
total += availableSize;
|
|
31374
|
-
break;
|
|
31375
|
-
}
|
|
31376
|
-
chunks.push((0, _uint.readBytes)(size)(stream));
|
|
31377
|
-
total += size;
|
|
31378
|
-
}
|
|
31379
|
-
var result = new Uint8Array(total);
|
|
31380
|
-
var offset = 0;
|
|
31381
|
-
for (var i = 0; i < chunks.length; i++) {
|
|
31382
|
-
result.set(chunks[i], offset);
|
|
31383
|
-
offset += chunks[i].length;
|
|
31384
|
-
}
|
|
31385
|
-
return result;
|
|
31386
|
-
}
|
|
31387
|
-
}; // global control extension
|
|
31388
|
-
|
|
31389
|
-
var gceSchema = (0, _.conditional)({
|
|
31390
|
-
gce: [{
|
|
31391
|
-
codes: (0, _uint.readBytes)(2)
|
|
31392
|
-
}, {
|
|
31393
|
-
byteSize: (0, _uint.readByte)()
|
|
31394
|
-
}, {
|
|
31395
|
-
extras: (0, _uint.readBits)({
|
|
31396
|
-
future: {
|
|
31397
|
-
index: 0,
|
|
31398
|
-
length: 3
|
|
31399
|
-
},
|
|
31400
|
-
disposal: {
|
|
31401
|
-
index: 3,
|
|
31402
|
-
length: 3
|
|
31403
|
-
},
|
|
31404
|
-
userInput: {
|
|
31405
|
-
index: 6
|
|
31406
|
-
},
|
|
31407
|
-
transparentColorGiven: {
|
|
31408
|
-
index: 7
|
|
31409
|
-
}
|
|
31410
|
-
})
|
|
31411
|
-
}, {
|
|
31412
|
-
delay: (0, _uint.readUnsigned)(true)
|
|
31413
|
-
}, {
|
|
31414
|
-
transparentColorIndex: (0, _uint.readByte)()
|
|
31415
|
-
}, {
|
|
31416
|
-
terminator: (0, _uint.readByte)()
|
|
31417
|
-
}]
|
|
31418
|
-
}, function (stream) {
|
|
31419
|
-
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
31420
|
-
return codes[0] === 0x21 && codes[1] === 0xf9;
|
|
31421
|
-
}); // image pipeline block
|
|
31422
|
-
|
|
31423
|
-
var imageSchema = (0, _.conditional)({
|
|
31424
|
-
image: [{
|
|
31425
|
-
code: (0, _uint.readByte)()
|
|
31426
|
-
}, {
|
|
31427
|
-
descriptor: [{
|
|
31428
|
-
left: (0, _uint.readUnsigned)(true)
|
|
31429
|
-
}, {
|
|
31430
|
-
top: (0, _uint.readUnsigned)(true)
|
|
31431
|
-
}, {
|
|
31432
|
-
width: (0, _uint.readUnsigned)(true)
|
|
31433
|
-
}, {
|
|
31434
|
-
height: (0, _uint.readUnsigned)(true)
|
|
31435
|
-
}, {
|
|
31436
|
-
lct: (0, _uint.readBits)({
|
|
31437
|
-
exists: {
|
|
31438
|
-
index: 0
|
|
31439
|
-
},
|
|
31440
|
-
interlaced: {
|
|
31441
|
-
index: 1
|
|
31442
|
-
},
|
|
31443
|
-
sort: {
|
|
31444
|
-
index: 2
|
|
31445
|
-
},
|
|
31446
|
-
future: {
|
|
31447
|
-
index: 3,
|
|
31448
|
-
length: 2
|
|
31449
|
-
},
|
|
31450
|
-
size: {
|
|
31451
|
-
index: 5,
|
|
31452
|
-
length: 3
|
|
31453
|
-
}
|
|
31454
|
-
})
|
|
31455
|
-
}]
|
|
31456
|
-
}, (0, _.conditional)({
|
|
31457
|
-
lct: (0, _uint.readArray)(3, function (stream, result, parent) {
|
|
31458
|
-
return Math.pow(2, parent.descriptor.lct.size + 1);
|
|
31459
|
-
})
|
|
31460
|
-
}, function (stream, result, parent) {
|
|
31461
|
-
return parent.descriptor.lct.exists;
|
|
31462
|
-
}), {
|
|
31463
|
-
data: [{
|
|
31464
|
-
minCodeSize: (0, _uint.readByte)()
|
|
31465
|
-
}, subBlocksSchema]
|
|
31466
|
-
}]
|
|
31467
|
-
}, function (stream) {
|
|
31468
|
-
return (0, _uint.peekByte)()(stream) === 0x2c;
|
|
31469
|
-
}); // plain text block
|
|
31470
|
-
|
|
31471
|
-
var textSchema = (0, _.conditional)({
|
|
31472
|
-
text: [{
|
|
31473
|
-
codes: (0, _uint.readBytes)(2)
|
|
31474
|
-
}, {
|
|
31475
|
-
blockSize: (0, _uint.readByte)()
|
|
31476
|
-
}, {
|
|
31477
|
-
preData: function preData(stream, result, parent) {
|
|
31478
|
-
return (0, _uint.readBytes)(parent.text.blockSize)(stream);
|
|
31479
|
-
}
|
|
31480
|
-
}, subBlocksSchema]
|
|
31481
|
-
}, function (stream) {
|
|
31482
|
-
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
31483
|
-
return codes[0] === 0x21 && codes[1] === 0x01;
|
|
31484
|
-
}); // application block
|
|
31485
|
-
|
|
31486
|
-
var applicationSchema = (0, _.conditional)({
|
|
31487
|
-
application: [{
|
|
31488
|
-
codes: (0, _uint.readBytes)(2)
|
|
31489
|
-
}, {
|
|
31490
|
-
blockSize: (0, _uint.readByte)()
|
|
31491
|
-
}, {
|
|
31492
|
-
id: function id(stream, result, parent) {
|
|
31493
|
-
return (0, _uint.readString)(parent.blockSize)(stream);
|
|
31494
|
-
}
|
|
31495
|
-
}, subBlocksSchema]
|
|
31496
|
-
}, function (stream) {
|
|
31497
|
-
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
31498
|
-
return codes[0] === 0x21 && codes[1] === 0xff;
|
|
31499
|
-
}); // comment block
|
|
31500
|
-
|
|
31501
|
-
var commentSchema = (0, _.conditional)({
|
|
31502
|
-
comment: [{
|
|
31503
|
-
codes: (0, _uint.readBytes)(2)
|
|
31504
|
-
}, subBlocksSchema]
|
|
31505
|
-
}, function (stream) {
|
|
31506
|
-
var codes = (0, _uint.peekBytes)(2)(stream);
|
|
31507
|
-
return codes[0] === 0x21 && codes[1] === 0xfe;
|
|
31508
|
-
});
|
|
31509
|
-
var schema = [{
|
|
31510
|
-
header: [{
|
|
31511
|
-
signature: (0, _uint.readString)(3)
|
|
31512
|
-
}, {
|
|
31513
|
-
version: (0, _uint.readString)(3)
|
|
31514
|
-
}]
|
|
31515
|
-
}, {
|
|
31516
|
-
lsd: [{
|
|
31517
|
-
width: (0, _uint.readUnsigned)(true)
|
|
31518
|
-
}, {
|
|
31519
|
-
height: (0, _uint.readUnsigned)(true)
|
|
31520
|
-
}, {
|
|
31521
|
-
gct: (0, _uint.readBits)({
|
|
31522
|
-
exists: {
|
|
31523
|
-
index: 0
|
|
31524
|
-
},
|
|
31525
|
-
resolution: {
|
|
31526
|
-
index: 1,
|
|
31527
|
-
length: 3
|
|
31528
|
-
},
|
|
31529
|
-
sort: {
|
|
31530
|
-
index: 4
|
|
31531
|
-
},
|
|
31532
|
-
size: {
|
|
31533
|
-
index: 5,
|
|
31534
|
-
length: 3
|
|
31535
|
-
}
|
|
31536
|
-
})
|
|
31537
|
-
}, {
|
|
31538
|
-
backgroundColorIndex: (0, _uint.readByte)()
|
|
31539
|
-
}, {
|
|
31540
|
-
pixelAspectRatio: (0, _uint.readByte)()
|
|
31541
|
-
}]
|
|
31542
|
-
}, (0, _.conditional)({
|
|
31543
|
-
gct: (0, _uint.readArray)(3, function (stream, result) {
|
|
31544
|
-
return Math.pow(2, result.lsd.gct.size + 1);
|
|
31545
|
-
})
|
|
31546
|
-
}, function (stream, result) {
|
|
31547
|
-
return result.lsd.gct.exists;
|
|
31548
|
-
}),
|
|
31549
|
-
// content frames
|
|
31550
|
-
{
|
|
31551
|
-
frames: (0, _.loop)([gceSchema, applicationSchema, commentSchema, imageSchema, textSchema], function (stream) {
|
|
31552
|
-
var nextCode = (0, _uint.peekByte)()(stream); // rather than check for a terminator, we should check for the existence
|
|
31553
|
-
// of an ext or image block to avoid infinite loops
|
|
31554
|
-
//var terminator = 0x3B;
|
|
31555
|
-
//return nextCode !== terminator;
|
|
31556
|
-
|
|
31557
|
-
return nextCode === 0x21 || nextCode === 0x2c;
|
|
31558
|
-
})
|
|
31559
|
-
}];
|
|
31560
|
-
var _default = schema;
|
|
31561
|
-
exports["default"] = _default;
|
|
31562
|
-
})(gif);
|
|
31563
|
-
|
|
31564
|
-
var deinterlace$1 = {};
|
|
31565
|
-
|
|
31566
|
-
Object.defineProperty(deinterlace$1, "__esModule", {
|
|
31567
|
-
value: true
|
|
31568
|
-
});
|
|
31569
|
-
deinterlace$1.deinterlace = void 0;
|
|
31570
|
-
|
|
31571
|
-
/**
|
|
31572
|
-
* Deinterlace function from https://github.com/shachaf/jsgif
|
|
31573
|
-
*/
|
|
31574
|
-
var deinterlace = function deinterlace(pixels, width) {
|
|
31575
|
-
var newPixels = new Array(pixels.length);
|
|
31576
|
-
var rows = pixels.length / width;
|
|
31577
|
-
var cpRow = function cpRow(toRow, fromRow) {
|
|
31578
|
-
var fromPixels = pixels.slice(fromRow * width, (fromRow + 1) * width);
|
|
31579
|
-
newPixels.splice.apply(newPixels, [toRow * width, width].concat(fromPixels));
|
|
31580
|
-
}; // See appendix E.
|
|
31581
|
-
|
|
31582
|
-
var offsets = [0, 4, 2, 1];
|
|
31583
|
-
var steps = [8, 8, 4, 2];
|
|
31584
|
-
var fromRow = 0;
|
|
31585
|
-
for (var pass = 0; pass < 4; pass++) {
|
|
31586
|
-
for (var toRow = offsets[pass]; toRow < rows; toRow += steps[pass]) {
|
|
31587
|
-
cpRow(toRow, fromRow);
|
|
31588
|
-
fromRow++;
|
|
31589
|
-
}
|
|
31590
|
-
}
|
|
31591
|
-
return newPixels;
|
|
31592
|
-
};
|
|
31593
|
-
deinterlace$1.deinterlace = deinterlace;
|
|
31594
|
-
|
|
31595
|
-
var lzw$1 = {};
|
|
31596
|
-
|
|
31597
|
-
Object.defineProperty(lzw$1, "__esModule", {
|
|
31598
|
-
value: true
|
|
31599
|
-
});
|
|
31600
|
-
lzw$1.lzw = void 0;
|
|
31601
|
-
|
|
31602
|
-
/**
|
|
31603
|
-
* javascript port of java LZW decompression
|
|
31604
|
-
* Original java author url: https://gist.github.com/devunwired/4479231
|
|
31605
|
-
*/
|
|
31606
|
-
var lzw = function lzw(minCodeSize, data, pixelCount) {
|
|
31607
|
-
var MAX_STACK_SIZE = 4096;
|
|
31608
|
-
var nullCode = -1;
|
|
31609
|
-
var npix = pixelCount;
|
|
31610
|
-
var available, clear, code_mask, code_size, end_of_information, in_code, old_code, bits, code, i, datum, data_size, first, top, bi, pi;
|
|
31611
|
-
var dstPixels = new Array(pixelCount);
|
|
31612
|
-
var prefix = new Array(MAX_STACK_SIZE);
|
|
31613
|
-
var suffix = new Array(MAX_STACK_SIZE);
|
|
31614
|
-
var pixelStack = new Array(MAX_STACK_SIZE + 1); // Initialize GIF data stream decoder.
|
|
31615
|
-
|
|
31616
|
-
data_size = minCodeSize;
|
|
31617
|
-
clear = 1 << data_size;
|
|
31618
|
-
end_of_information = clear + 1;
|
|
31619
|
-
available = clear + 2;
|
|
31620
|
-
old_code = nullCode;
|
|
31621
|
-
code_size = data_size + 1;
|
|
31622
|
-
code_mask = (1 << code_size) - 1;
|
|
31623
|
-
for (code = 0; code < clear; code++) {
|
|
31624
|
-
prefix[code] = 0;
|
|
31625
|
-
suffix[code] = code;
|
|
31626
|
-
} // Decode GIF pixel stream.
|
|
31627
|
-
|
|
31628
|
-
var datum, bits, first, top, pi, bi;
|
|
31629
|
-
datum = bits = first = top = pi = bi = 0;
|
|
31630
|
-
for (i = 0; i < npix;) {
|
|
31631
|
-
if (top === 0) {
|
|
31632
|
-
if (bits < code_size) {
|
|
31633
|
-
// get the next byte
|
|
31634
|
-
datum += data[bi] << bits;
|
|
31635
|
-
bits += 8;
|
|
31636
|
-
bi++;
|
|
31637
|
-
continue;
|
|
31638
|
-
} // Get the next code.
|
|
31639
|
-
|
|
31640
|
-
code = datum & code_mask;
|
|
31641
|
-
datum >>= code_size;
|
|
31642
|
-
bits -= code_size; // Interpret the code
|
|
31643
|
-
|
|
31644
|
-
if (code > available || code == end_of_information) {
|
|
31645
|
-
break;
|
|
31646
|
-
}
|
|
31647
|
-
if (code == clear) {
|
|
31648
|
-
// Reset decoder.
|
|
31649
|
-
code_size = data_size + 1;
|
|
31650
|
-
code_mask = (1 << code_size) - 1;
|
|
31651
|
-
available = clear + 2;
|
|
31652
|
-
old_code = nullCode;
|
|
31653
|
-
continue;
|
|
31654
|
-
}
|
|
31655
|
-
if (old_code == nullCode) {
|
|
31656
|
-
pixelStack[top++] = suffix[code];
|
|
31657
|
-
old_code = code;
|
|
31658
|
-
first = code;
|
|
31659
|
-
continue;
|
|
31660
|
-
}
|
|
31661
|
-
in_code = code;
|
|
31662
|
-
if (code == available) {
|
|
31663
|
-
pixelStack[top++] = first;
|
|
31664
|
-
code = old_code;
|
|
31665
|
-
}
|
|
31666
|
-
while (code > clear) {
|
|
31667
|
-
pixelStack[top++] = suffix[code];
|
|
31668
|
-
code = prefix[code];
|
|
31669
|
-
}
|
|
31670
|
-
first = suffix[code] & 0xff;
|
|
31671
|
-
pixelStack[top++] = first; // add a new string to the table, but only if space is available
|
|
31672
|
-
// if not, just continue with current table until a clear code is found
|
|
31673
|
-
// (deferred clear code implementation as per GIF spec)
|
|
31674
|
-
|
|
31675
|
-
if (available < MAX_STACK_SIZE) {
|
|
31676
|
-
prefix[available] = old_code;
|
|
31677
|
-
suffix[available] = first;
|
|
31678
|
-
available++;
|
|
31679
|
-
if ((available & code_mask) === 0 && available < MAX_STACK_SIZE) {
|
|
31680
|
-
code_size++;
|
|
31681
|
-
code_mask += available;
|
|
31417
|
+
len = exp.length;
|
|
31418
|
+
for (let index = 0; index < len; index++) {
|
|
31419
|
+
const c = exp[index],
|
|
31420
|
+
cp = c.charCodeAt(0);
|
|
31421
|
+
if ("(" === c || ")" === c) tokens.push({
|
|
31422
|
+
value: c,
|
|
31423
|
+
type: TYPE_PAREN
|
|
31424
|
+
});else if ("*" === c || "/" === c) tokens.push({
|
|
31425
|
+
value: c,
|
|
31426
|
+
type: TYPE_OPERATOR
|
|
31427
|
+
});else if ("+" === c || "-" === c) index = parseSign(c, index + 1) - 1;else if (isDigit(cp) || isDot(cp)) index = parseNum(c, index + 1) - 1;else if (!isWhitespace(cp)) throw createError(calc);
|
|
31428
|
+
}
|
|
31429
|
+
function parseSign(sign, start) {
|
|
31430
|
+
if (start < len) {
|
|
31431
|
+
const c = exp[start],
|
|
31432
|
+
cp = c.charCodeAt(0);
|
|
31433
|
+
if (isDigit(cp) || isDot(cp)) return parseNum(sign + c, start + 1);
|
|
31434
|
+
}
|
|
31435
|
+
return tokens.push({
|
|
31436
|
+
value: sign,
|
|
31437
|
+
type: TYPE_OPERATOR
|
|
31438
|
+
}), start;
|
|
31439
|
+
}
|
|
31440
|
+
function parseNum(num, start) {
|
|
31441
|
+
let index = start;
|
|
31442
|
+
for (; index < len; index++) {
|
|
31443
|
+
const c = exp[index],
|
|
31444
|
+
cp = c.charCodeAt(0);
|
|
31445
|
+
if (isDigit(cp)) num += c;else {
|
|
31446
|
+
if ("." !== c) {
|
|
31447
|
+
if (isUnit(cp)) return parseUnit(num, c, index + 1);
|
|
31448
|
+
break;
|
|
31682
31449
|
}
|
|
31450
|
+
if (num.indexOf(".") >= 0) throw createError(calc);
|
|
31451
|
+
num += c;
|
|
31683
31452
|
}
|
|
31684
|
-
|
|
31685
|
-
|
|
31686
|
-
|
|
31687
|
-
|
|
31688
|
-
|
|
31689
|
-
|
|
31453
|
+
}
|
|
31454
|
+
if ("." === num) throw createError(calc);
|
|
31455
|
+
return tokens.push({
|
|
31456
|
+
value: parseFloat(num),
|
|
31457
|
+
type: TYPE_NUMBER
|
|
31458
|
+
}), index;
|
|
31690
31459
|
}
|
|
31691
|
-
|
|
31692
|
-
|
|
31460
|
+
function parseUnit(num, unit, start) {
|
|
31461
|
+
let index = start;
|
|
31462
|
+
for (; index < len; index++) {
|
|
31463
|
+
const c = exp[index];
|
|
31464
|
+
if (!isUnit(c.charCodeAt(0))) break;
|
|
31465
|
+
unit += c;
|
|
31466
|
+
}
|
|
31467
|
+
return tokens.push({
|
|
31468
|
+
value: parseFloat(num),
|
|
31469
|
+
unit: unit,
|
|
31470
|
+
type: TYPE_UNIT
|
|
31471
|
+
}), index;
|
|
31693
31472
|
}
|
|
31694
|
-
|
|
31695
|
-
return dstPixels;
|
|
31696
|
-
};
|
|
31697
|
-
lzw$1.lzw = lzw;
|
|
31698
|
-
|
|
31699
|
-
Object.defineProperty(lib$1, "__esModule", {
|
|
31700
|
-
value: true
|
|
31701
|
-
});
|
|
31702
|
-
var decompressFrames_1 = lib$1.decompressFrames = lib$1.decompressFrame = parseGIF_1 = lib$1.parseGIF = void 0;
|
|
31703
|
-
var _gif = _interopRequireDefault(gif);
|
|
31704
|
-
var _jsBinarySchemaParser = lib;
|
|
31705
|
-
var _uint = uint8;
|
|
31706
|
-
var _deinterlace = deinterlace$1;
|
|
31707
|
-
var _lzw = lzw$1;
|
|
31708
|
-
function _interopRequireDefault(obj) {
|
|
31709
|
-
return obj && obj.__esModule ? obj : {
|
|
31710
|
-
"default": obj
|
|
31711
|
-
};
|
|
31473
|
+
return tokens;
|
|
31712
31474
|
}
|
|
31713
|
-
|
|
31714
|
-
|
|
31715
|
-
|
|
31475
|
+
const PRECEDENCE = {
|
|
31476
|
+
"*": 3,
|
|
31477
|
+
"/": 3,
|
|
31478
|
+
"+": 2,
|
|
31479
|
+
"-": 2
|
|
31716
31480
|
};
|
|
31717
|
-
|
|
31718
|
-
|
|
31719
|
-
|
|
31720
|
-
|
|
31721
|
-
|
|
31722
|
-
|
|
31723
|
-
|
|
31724
|
-
|
|
31725
|
-
|
|
31726
|
-
|
|
31727
|
-
|
|
31728
|
-
|
|
31481
|
+
function lex(tokens, calc) {
|
|
31482
|
+
function buildBinaryExpNode(stack) {
|
|
31483
|
+
const right = stack.pop(),
|
|
31484
|
+
op = stack.pop(),
|
|
31485
|
+
left = stack.pop();
|
|
31486
|
+
if (!(left && left.nodeType && op && op.type === TYPE_OPERATOR && right && right.nodeType)) throw createError(calc);
|
|
31487
|
+
return {
|
|
31488
|
+
nodeType: NODE_TYPE_BINARY_EXPRESSION,
|
|
31489
|
+
left: left,
|
|
31490
|
+
op: op,
|
|
31491
|
+
right: right
|
|
31492
|
+
};
|
|
31729
31493
|
}
|
|
31730
|
-
|
|
31731
|
-
|
|
31732
|
-
|
|
31733
|
-
|
|
31734
|
-
|
|
31494
|
+
const stack = [];
|
|
31495
|
+
for (; tokens.length;) {
|
|
31496
|
+
const token = tokens.shift();
|
|
31497
|
+
if (token.type === TYPE_PAREN && "(" === token.value) {
|
|
31498
|
+
let deep = 0;
|
|
31499
|
+
const closeIndex = array.findIndex(tokens, t => {
|
|
31500
|
+
if (t.type === TYPE_PAREN && "(" === t.value) deep++;else if (t.type === TYPE_PAREN && ")" === t.value) {
|
|
31501
|
+
if (!deep) return !0;
|
|
31502
|
+
deep--;
|
|
31503
|
+
}
|
|
31504
|
+
return !1;
|
|
31505
|
+
});
|
|
31506
|
+
if (-1 === closeIndex) throw createError(calc);
|
|
31507
|
+
stack.push(lex(tokens.splice(0, closeIndex), calc)), tokens.shift();
|
|
31508
|
+
} else if (token.type === TYPE_OPERATOR) {
|
|
31509
|
+
if (stack.length >= 3) {
|
|
31510
|
+
const beforeOp = stack[stack.length - 2].value;
|
|
31511
|
+
PRECEDENCE[token.value] <= PRECEDENCE[beforeOp] && stack.push(buildBinaryExpNode(stack));
|
|
31512
|
+
}
|
|
31513
|
+
stack.push(token);
|
|
31514
|
+
} else if (token.type === TYPE_UNIT) {
|
|
31515
|
+
const {
|
|
31516
|
+
value: num,
|
|
31517
|
+
unit: unit
|
|
31518
|
+
} = token;
|
|
31519
|
+
stack.push({
|
|
31520
|
+
nodeType: NODE_TYPE_UNIT,
|
|
31521
|
+
value: num,
|
|
31522
|
+
unit: unit
|
|
31523
|
+
});
|
|
31524
|
+
} else token.type === TYPE_NUMBER && stack.push({
|
|
31525
|
+
nodeType: NODE_TYPE_NUMBER,
|
|
31526
|
+
value: token.value
|
|
31527
|
+
});
|
|
31735
31528
|
}
|
|
31736
|
-
|
|
31737
|
-
|
|
31738
|
-
|
|
31739
|
-
|
|
31740
|
-
|
|
31529
|
+
for (; stack.length > 1;) stack.push(buildBinaryExpNode(stack));
|
|
31530
|
+
return stack[0];
|
|
31531
|
+
}
|
|
31532
|
+
function parse(calcStr) {
|
|
31533
|
+
return lex(tokenize(calcStr), calcStr);
|
|
31534
|
+
}
|
|
31535
|
+
function calcNode(node, context) {
|
|
31536
|
+
if (node.nodeType === NODE_TYPE_BINARY_EXPRESSION) {
|
|
31537
|
+
const left = calcNode(node.left, context),
|
|
31538
|
+
right = calcNode(node.right, context);
|
|
31539
|
+
switch (node.op.value) {
|
|
31540
|
+
case "+":
|
|
31541
|
+
return left + right;
|
|
31542
|
+
case "-":
|
|
31543
|
+
return left - right;
|
|
31544
|
+
case "*":
|
|
31545
|
+
return left * right;
|
|
31546
|
+
case "/":
|
|
31547
|
+
return left / right;
|
|
31548
|
+
default:
|
|
31549
|
+
throw new Error(`calc error. unknown operator: ${node.op.value}`);
|
|
31550
|
+
}
|
|
31551
|
+
} else if (node.nodeType === NODE_TYPE_UNIT) switch (node.unit) {
|
|
31552
|
+
case "%":
|
|
31553
|
+
return node.value * context.full / 100;
|
|
31554
|
+
case "px":
|
|
31555
|
+
return node.value;
|
|
31556
|
+
default:
|
|
31557
|
+
throw new Error(`calc error. unknown unit: ${node.unit}`);
|
|
31558
|
+
} else if (node.nodeType === NODE_TYPE_NUMBER) return node.value;
|
|
31559
|
+
throw new Error("calc error.");
|
|
31560
|
+
}
|
|
31561
|
+
function toPxInternal(value, context) {
|
|
31562
|
+
return calcNode(parse(value), context);
|
|
31563
|
+
}
|
|
31564
|
+
function toPx(value, context) {
|
|
31565
|
+
return "string" == typeof value ? toPxInternal(value.trim(), context) : value - 0;
|
|
31566
|
+
}
|
|
31567
|
+
function couldBeValidNumber(v) {
|
|
31568
|
+
return !isNil$1(v) && (!!isNumber$2(v) || +v == +v);
|
|
31569
|
+
}
|
|
31570
|
+
function isPercent(v) {
|
|
31571
|
+
return !!isString$2(v) && !!v.endsWith("%") && couldBeValidNumber(v.substring(0, v.length - 1));
|
|
31572
|
+
}
|
|
31741
31573
|
|
|
31742
|
-
|
|
31743
|
-
|
|
31574
|
+
function createRootElement(padding) {
|
|
31575
|
+
let className = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "vtable";
|
|
31576
|
+
var _a, _b;
|
|
31577
|
+
const element = document.createElement("div");
|
|
31578
|
+
element.setAttribute("tabindex", "0"), element.classList.add(className), element.style.outline = "none", element.style.margin = `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px`;
|
|
31579
|
+
const width = (element.offsetWidth || (null === (_a = element.parentElement) || void 0 === _a ? void 0 : _a.offsetWidth) || 1) - 1,
|
|
31580
|
+
height = (element.offsetHeight || (null === (_b = element.parentElement) || void 0 === _b ? void 0 : _b.offsetHeight) || 1) - 1;
|
|
31581
|
+
return element.style.width = width && width - padding.left - padding.right + "px" || "0px", element.style.height = height && height - padding.top - padding.bottom + "px" || "0px", element;
|
|
31582
|
+
}
|
|
31583
|
+
function updateRootElementPadding(element, padding) {
|
|
31584
|
+
var _a, _b;
|
|
31585
|
+
element.style.margin = `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px`;
|
|
31586
|
+
const width = (element.offsetWidth || (null === (_a = element.parentElement) || void 0 === _a ? void 0 : _a.offsetWidth) || 1) - 1,
|
|
31587
|
+
height = (element.offsetHeight || (null === (_b = element.parentElement) || void 0 === _b ? void 0 : _b.offsetHeight) || 1) - 1;
|
|
31588
|
+
element.style.width = width && width - padding.left - padding.right + "px" || "0px", element.style.height = height && height - padding.top - padding.bottom + "px" || "0px";
|
|
31589
|
+
}
|
|
31590
|
+
function _dealWithUpdateDataSource(table, fn) {
|
|
31591
|
+
const {
|
|
31592
|
+
dataSourceEventIds: dataSourceEventIds
|
|
31593
|
+
} = table.internalProps;
|
|
31594
|
+
dataSourceEventIds && dataSourceEventIds.forEach(id => table.internalProps.handler.off(id)), fn(table), table.internalProps.dataSourceEventIds = [table.internalProps.handler.on(table.internalProps.dataSource, DataSource.EVENT_TYPE.CHANGE_ORDER, () => {
|
|
31595
|
+
table.dataSource.hierarchyExpandLevel && table.refreshRowColCount(), table.render();
|
|
31596
|
+
})];
|
|
31597
|
+
}
|
|
31598
|
+
function _setRecords(table) {
|
|
31599
|
+
let records = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
31600
|
+
_dealWithUpdateDataSource(table, () => {
|
|
31601
|
+
table.internalProps.records = records;
|
|
31602
|
+
const newDataSource = table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.columns, table.internalProps.layoutMap.rowHierarchyType, getHierarchyExpandLevel(table));
|
|
31603
|
+
table.addReleaseObj(newDataSource);
|
|
31604
|
+
});
|
|
31605
|
+
}
|
|
31606
|
+
function getHierarchyExpandLevel(table) {
|
|
31607
|
+
var _a;
|
|
31608
|
+
return table.options.hierarchyExpandLevel ? table.options.hierarchyExpandLevel : table.options.groupBy ? 1 / 0 : (null === (_a = table._hasHierarchyTreeHeader) || void 0 === _a ? void 0 : _a.call(table)) ? 1 : void 0;
|
|
31609
|
+
}
|
|
31610
|
+
function _setDataSource(table, dataSource) {
|
|
31611
|
+
_dealWithUpdateDataSource(table, () => {
|
|
31612
|
+
if (dataSource) {
|
|
31613
|
+
if (dataSource instanceof DataSource) table.internalProps.dataSource = dataSource;else {
|
|
31614
|
+
const newDataSource = table.internalProps.dataSource = new CachedDataSource(dataSource);
|
|
31615
|
+
table.addReleaseObj(newDataSource);
|
|
31616
|
+
}
|
|
31617
|
+
} else table.internalProps.dataSource = DataSource.EMPTY;
|
|
31618
|
+
table.internalProps.records = null;
|
|
31619
|
+
});
|
|
31620
|
+
}
|
|
31621
|
+
function _getTargetFrozenRowAt(table, absoluteY) {
|
|
31622
|
+
if (!table.internalProps.frozenRowCount) return null;
|
|
31623
|
+
let {
|
|
31624
|
+
scrollTop: scrollTop
|
|
31625
|
+
} = table;
|
|
31626
|
+
const rowCount = table.internalProps.frozenRowCount;
|
|
31627
|
+
for (let row = 0; row < rowCount; row++) {
|
|
31628
|
+
const height = table.getRowHeight(row),
|
|
31629
|
+
bottom = scrollTop + height;
|
|
31630
|
+
if (bottom > absoluteY) return {
|
|
31631
|
+
top: scrollTop,
|
|
31632
|
+
row: row,
|
|
31633
|
+
bottom: bottom,
|
|
31634
|
+
height: height
|
|
31635
|
+
};
|
|
31636
|
+
scrollTop = bottom;
|
|
31744
31637
|
}
|
|
31745
|
-
|
|
31746
|
-
|
|
31747
|
-
|
|
31748
|
-
|
|
31749
|
-
|
|
31750
|
-
|
|
31751
|
-
|
|
31638
|
+
return null;
|
|
31639
|
+
}
|
|
31640
|
+
function _getTargetFrozenColAt(table, absoluteX) {
|
|
31641
|
+
if (!table.internalProps.frozenColCount) return null;
|
|
31642
|
+
let {
|
|
31643
|
+
scrollLeft: scrollLeft
|
|
31644
|
+
} = table;
|
|
31645
|
+
const colCount = table.internalProps.frozenColCount;
|
|
31646
|
+
for (let col = 0; col < colCount; col++) {
|
|
31647
|
+
const width = table.getColWidth(col),
|
|
31648
|
+
right = scrollLeft + width;
|
|
31649
|
+
if (right > absoluteX) return {
|
|
31650
|
+
left: scrollLeft,
|
|
31651
|
+
col: col,
|
|
31652
|
+
right: right,
|
|
31653
|
+
width: width
|
|
31654
|
+
};
|
|
31655
|
+
scrollLeft = right;
|
|
31656
|
+
}
|
|
31657
|
+
return null;
|
|
31658
|
+
}
|
|
31659
|
+
function _toPxWidth(table, width) {
|
|
31660
|
+
return Math.round(toPx(width, table.internalProps.calcWidthContext));
|
|
31661
|
+
}
|
|
31662
|
+
function _applyColWidthLimits(limits, orgWidth) {
|
|
31663
|
+
return limits ? limits.min && limits.min > orgWidth ? limits.min : limits.max && limits.max < orgWidth ? limits.max : orgWidth : orgWidth;
|
|
31664
|
+
}
|
|
31665
|
+
function _getScrollableVisibleRect(table) {
|
|
31666
|
+
let frozenColsWidth = 0,
|
|
31667
|
+
rightFrozenColsWidth = 0;
|
|
31668
|
+
table.frozenColCount > 0 && (frozenColsWidth = table.getFrozenColsWidth()), table.rightFrozenColCount > 0 && (rightFrozenColsWidth = table.getRightFrozenColsWidth());
|
|
31669
|
+
let frozenRowsHeight = 0,
|
|
31670
|
+
bottomFrozenRowsHeight = 0;
|
|
31671
|
+
return table.frozenRowCount > 0 && (frozenRowsHeight = table.getFrozenRowsHeight()), table.bottomFrozenRowCount > 0 && (bottomFrozenRowsHeight = table.getBottomFrozenRowsHeight()), new Rect(table.scrollLeft + frozenColsWidth, table.scrollTop + frozenRowsHeight, table.tableNoFrameWidth - frozenColsWidth - rightFrozenColsWidth, table.tableNoFrameHeight - frozenRowsHeight - bottomFrozenRowsHeight);
|
|
31672
|
+
}
|
|
31673
|
+
function getStyleTheme(headerStyle, table, col, row, getProp) {
|
|
31674
|
+
let needGetTheme = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !0;
|
|
31675
|
+
const padding = getQuadProps(getProp("padding", headerStyle, col, row, table)),
|
|
31676
|
+
bgColor = getProp("bgColor", headerStyle, col, row, table),
|
|
31677
|
+
font = getProp("font", headerStyle, col, row, table);
|
|
31678
|
+
let fontFamily, fontSize, fontWeight, fontStyle, fontVariant;
|
|
31679
|
+
if (font) {
|
|
31680
|
+
const {
|
|
31681
|
+
family: family,
|
|
31682
|
+
size: size,
|
|
31683
|
+
weight: weight,
|
|
31684
|
+
style: style,
|
|
31685
|
+
variant: variant
|
|
31686
|
+
} = parseFont(font);
|
|
31687
|
+
fontFamily = family.join(" "), fontSize = size, fontWeight = weight, fontStyle = style, fontStyle = variant;
|
|
31688
|
+
} else fontFamily = getProp("fontFamily", headerStyle, col, row, table), fontSize = getProp("fontSize", headerStyle, col, row, table), fontWeight = getProp("fontWeight", headerStyle, col, row, table), fontStyle = getProp("fontStyle", headerStyle, col, row, table), fontVariant = getProp("fontVariant", headerStyle, col, row, table);
|
|
31689
|
+
const textAlign = getProp("textAlign", headerStyle, col, row, table),
|
|
31690
|
+
textBaseline = getProp("textBaseline", headerStyle, col, row, table),
|
|
31691
|
+
color = getProp("color", headerStyle, col, row, table),
|
|
31692
|
+
strokeColor = getProp("strokeColor", headerStyle, col, row, table),
|
|
31693
|
+
lineHeight = getProp("lineHeight", headerStyle, col, row, table),
|
|
31694
|
+
underline = getProp("underline", headerStyle, col, row, table),
|
|
31695
|
+
underlineDash = getProp("underlineDash", headerStyle, col, row, table),
|
|
31696
|
+
underlineOffset = getProp("underlineOffset", headerStyle, col, row, table),
|
|
31697
|
+
lineThrough = getProp("lineThrough", headerStyle, col, row, table),
|
|
31698
|
+
textDecorationWidth = Math.max(1, Math.floor(fontSize / 10)),
|
|
31699
|
+
textOverflow = getProp("textOverflow", headerStyle, col, row, table),
|
|
31700
|
+
borderColor = getProp("borderColor", headerStyle, col, row, table),
|
|
31701
|
+
borderLineWidth = getProp("borderLineWidth", headerStyle, col, row, table),
|
|
31702
|
+
borderLineDash = getProp("borderLineDash", headerStyle, col, row, table),
|
|
31703
|
+
marked = getProp("marked", headerStyle, col, row, table),
|
|
31704
|
+
cursor = getProp("cursor", headerStyle, col, row, table),
|
|
31705
|
+
hasFunctionPros = !(padding && bgColor && font && textAlign && textBaseline && color && textOverflow && borderColor && borderLineWidth && borderLineDash && "boolean" == typeof underline && "boolean" == typeof lineThrough && "boolean" == typeof marked);
|
|
31706
|
+
if (!needGetTheme) return {
|
|
31707
|
+
hasFunctionPros: hasFunctionPros
|
|
31708
|
+
};
|
|
31709
|
+
const theme = {
|
|
31710
|
+
text: {
|
|
31711
|
+
fontFamily: fontFamily,
|
|
31712
|
+
fontSize: fontSize,
|
|
31713
|
+
fontWeight: fontWeight,
|
|
31714
|
+
fontStyle: fontStyle,
|
|
31715
|
+
fontVariant: fontVariant,
|
|
31716
|
+
fill: color,
|
|
31717
|
+
stroke: null != strokeColor && strokeColor,
|
|
31718
|
+
textAlign: textAlign,
|
|
31719
|
+
textBaseline: textBaseline,
|
|
31720
|
+
lineHeight: null != lineHeight ? lineHeight : fontSize,
|
|
31721
|
+
underline: underline ? textDecorationWidth : void 0,
|
|
31722
|
+
underlineDash: underlineDash,
|
|
31723
|
+
underlineOffset: underlineOffset,
|
|
31724
|
+
lineThrough: lineThrough ? textDecorationWidth : void 0,
|
|
31725
|
+
ellipsis: "clip" === textOverflow ? "" : "ellipsis" === textOverflow ? "..." : isValid$1(textOverflow) ? textOverflow : void 0
|
|
31726
|
+
},
|
|
31727
|
+
group: {
|
|
31728
|
+
fill: bgColor,
|
|
31729
|
+
lineDash: borderLineDash,
|
|
31730
|
+
lineWidth: borderLineWidth,
|
|
31731
|
+
stroke: borderColor,
|
|
31732
|
+
cursor: "auto" === cursor || "default" === cursor ? void 0 : cursor
|
|
31733
|
+
},
|
|
31734
|
+
_vtable: {
|
|
31735
|
+
padding: padding,
|
|
31736
|
+
marked: marked
|
|
31752
31737
|
}
|
|
31753
|
-
};
|
|
31754
|
-
|
|
31755
|
-
|
|
31756
|
-
|
|
31757
|
-
}
|
|
31758
|
-
|
|
31759
|
-
|
|
31760
|
-
|
|
31761
|
-
|
|
31762
|
-
|
|
31763
|
-
|
|
31764
|
-
|
|
31765
|
-
|
|
31766
|
-
if (
|
|
31767
|
-
|
|
31738
|
+
};
|
|
31739
|
+
if (Array.isArray(borderLineWidth) && (theme.group.strokeArrayWidth = getQuadProps(borderLineWidth)), Array.isArray(borderColor)) {
|
|
31740
|
+
const strokeColors = getQuadProps(borderColor);
|
|
31741
|
+
theme.group.stroke = !strokeColors.every(color => !color) && strokeColors, theme.group.strokeArrayColor = getQuadProps(borderColor);
|
|
31742
|
+
}
|
|
31743
|
+
return {
|
|
31744
|
+
theme: theme,
|
|
31745
|
+
hasFunctionPros: hasFunctionPros
|
|
31746
|
+
};
|
|
31747
|
+
}
|
|
31748
|
+
function getCellCornerRadius(col, row, table) {
|
|
31749
|
+
const tableCornerRadius = table.theme.frameStyle.cornerRadius;
|
|
31750
|
+
if (Array.isArray(tableCornerRadius)) {
|
|
31751
|
+
if (0 === col && 0 === row) return [tableCornerRadius[0], 0, 0, 0];
|
|
31752
|
+
if (col === table.colCount - 1 && 0 === row) return [0, tableCornerRadius[1], 0, 0];
|
|
31753
|
+
if (0 === col && row === table.rowCount - 1) return [0, 0, 0, tableCornerRadius[3]];
|
|
31754
|
+
if (col === table.colCount - 1 && row === table.rowCount - 1) return [0, 0, tableCornerRadius[2], 0];
|
|
31755
|
+
} else if (tableCornerRadius) {
|
|
31756
|
+
if (0 === col && 0 === row) return [tableCornerRadius, 0, 0, 0];
|
|
31757
|
+
if (col === table.colCount - 1 && 0 === row) return [0, tableCornerRadius, 0, 0];
|
|
31758
|
+
if (0 === col && row === table.rowCount - 1) return [0, 0, 0, tableCornerRadius];
|
|
31759
|
+
if (col === table.colCount - 1 && row === table.rowCount - 1) return [0, 0, tableCornerRadius, 0];
|
|
31760
|
+
}
|
|
31761
|
+
return 0;
|
|
31762
|
+
}
|
|
31763
|
+
function generateAggregationForColumn(table) {
|
|
31764
|
+
for (let col = 0; col < table.internalProps.columns.length; col++) {
|
|
31765
|
+
const colDef = table.internalProps.columns[col];
|
|
31766
|
+
if (colDef.aggregation) ;else if (table.options.aggregation) {
|
|
31767
|
+
let aggregation;
|
|
31768
|
+
if (aggregation = "function" == typeof table.options.aggregation ? table.options.aggregation({
|
|
31769
|
+
col: col,
|
|
31770
|
+
field: colDef.field
|
|
31771
|
+
}) : table.options.aggregation, aggregation) if (Array.isArray(aggregation)) {
|
|
31772
|
+
const aggregations = [];
|
|
31773
|
+
aggregation.forEach(item => {
|
|
31774
|
+
aggregations.push(Object.assign({
|
|
31775
|
+
showOnTop: !1
|
|
31776
|
+
}, item));
|
|
31777
|
+
}), colDef.aggregation = aggregations;
|
|
31778
|
+
} else colDef.aggregation = Object.assign({
|
|
31779
|
+
showOnTop: !1
|
|
31780
|
+
}, aggregation);
|
|
31768
31781
|
}
|
|
31769
|
-
} // create canvas usable imagedata if desired
|
|
31770
|
-
|
|
31771
|
-
if (buildImagePatch) {
|
|
31772
|
-
resultImage.patch = generatePatch(resultImage);
|
|
31773
31782
|
}
|
|
31774
|
-
|
|
31775
|
-
|
|
31776
|
-
|
|
31777
|
-
|
|
31778
|
-
|
|
31779
|
-
|
|
31780
|
-
|
|
31781
|
-
|
|
31782
|
-
|
|
31783
|
-
|
|
31784
|
-
|
|
31783
|
+
}
|
|
31784
|
+
function checkHasAggregationOnColumnDefine(colDefs) {
|
|
31785
|
+
for (let i = 0; i < colDefs.length; i++) {
|
|
31786
|
+
if (colDefs[i].aggregation) return !0;
|
|
31787
|
+
}
|
|
31788
|
+
return !1;
|
|
31789
|
+
}
|
|
31790
|
+
function checkHasColumnAutoWidth(table) {
|
|
31791
|
+
if ("autoWidth" === table.options.widthMode) return !0;
|
|
31792
|
+
if ("auto" === table.options.defaultHeaderColWidth || Array.isArray(table.options.defaultHeaderColWidth) && table.options.defaultHeaderColWidth.includes("auto")) return !0;
|
|
31793
|
+
const columnObjects = table.internalProps.layoutMap.columnObjects;
|
|
31794
|
+
for (let i = 0; i < columnObjects.length; i++) {
|
|
31795
|
+
if ("auto" === columnObjects[i].width) return !0;
|
|
31796
|
+
}
|
|
31797
|
+
return !1;
|
|
31798
|
+
}
|
|
31785
31799
|
|
|
31786
31800
|
class Icon extends Image$1 {
|
|
31787
31801
|
constructor(params) {
|
|
31788
31802
|
super(params), "mouseenter_cell" !== this.attribute.visibleTime && "click_cell" !== this.attribute.visibleTime || (this.attribute.opacity = 0), this.attribute.hoverImage && (this.attribute.originImage = this.attribute.image), this.attribute.isGif && this.attribute.gif && this.loadGif();
|
|
31789
31803
|
}
|
|
31790
31804
|
loadGif() {
|
|
31791
|
-
this.playing = !1, ResourceLoader.GetFile(this.attribute.gif + "?role=gif"
|
|
31805
|
+
this.playing = !1, ResourceLoader.GetFile(this.attribute.gif + "?role=gif" + `&radom=${Math.random()}`, "arrayBuffer").then(res => {
|
|
31792
31806
|
const gif = parseGIF_1(res),
|
|
31793
31807
|
frames = decompressFrames_1(gif, !0);
|
|
31794
31808
|
this.renderGIF(frames), this.resources.set(this.attribute.image, {
|
|
@@ -37028,7 +37042,7 @@
|
|
|
37028
37042
|
|
|
37029
37043
|
function computeColsWidth(table, colStart, colEnd, update) {
|
|
37030
37044
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
37031
|
-
table.internalProps.columnWidthConfig && table._parseColumnWidthConfig(table.internalProps.columnWidthConfig), colStart = null != colStart ? colStart : 0, colEnd = null != colEnd ? colEnd : table.colCount - 1, 0 === colStart && colEnd === table.colCount - 1 && table._clearColRangeWidthsMap();
|
|
37045
|
+
table.internalProps.columnWidthConfig && table._parseColumnWidthConfig(table.internalProps.columnWidthConfig), table.isPivotTable() && table.internalProps.columnWidthConfigForRowHeader && table._parseColumnWidthConfigForRowHeader(table.internalProps.columnWidthConfigForRowHeader), colStart = null != colStart ? colStart : 0, colEnd = null != colEnd ? colEnd : table.colCount - 1, 0 === colStart && colEnd === table.colCount - 1 && table._clearColRangeWidthsMap();
|
|
37032
37046
|
const layoutMap = table.internalProps.layoutMap;
|
|
37033
37047
|
table.isPivotTable() && (layoutMap.enableUseGetBodyCache(), layoutMap.enableUseHeaderPathCache());
|
|
37034
37048
|
const oldColWidths = [],
|
|
@@ -37507,7 +37521,7 @@
|
|
|
37507
37521
|
proxy.setParamsForRow(), proxy.setParamsForColumn(), "adaptive" === table.widthMode || table.options.autoWrapText && ("adaptive" === table.heightMode || table.isAutoRowHeight()) ? (distColForCompute = table.colCount - 1, distCol = Math.min(proxy.firstScreenColLimit - 1, table.colCount - 1)) : distCol = Math.min(proxy.firstScreenColLimit - 1, table.colCount - 1), "adaptive" === table.heightMode ? (distRowForCompute = table.rowCount - 1, distRow = Math.min(proxy.firstScreenRowLimit - 1, table.rowCount - 1)) : distRow = Math.min(proxy.firstScreenRowLimit - 1, table.rowCount - 1), 0 === table.internalProps._widthResizedColMap.size && computeColsWidth(table, 0, null != distColForCompute ? distColForCompute : distCol), 0 === table.internalProps._heightResizedRowMap.size && computeRowsHeight(table, 0, null != distRowForCompute ? distRowForCompute : distRow), distCol < table.colCount - table.rightFrozenColCount && computeColsWidth(table, table.colCount - table.rightFrozenColCount, table.colCount - 1), distRow < table.rowCount - table.bottomFrozenRowCount && computeRowsHeight(table, table.rowCount - table.bottomFrozenRowCount, table.rowCount - 1), table.scenegraph.colHeaderGroup.setAttribute("x", table.getFrozenColsWidth()), table.scenegraph.rowHeaderGroup.setAttribute("y", table.getFrozenRowsHeight()), table.scenegraph.bottomFrozenGroup.setAttribute("x", table.getFrozenColsWidth()), table.scenegraph.rightFrozenGroup.setAttribute("y", table.getFrozenRowsHeight()), table.scenegraph.bodyGroup.setAttributes({
|
|
37508
37522
|
x: table.getFrozenColsWidth(),
|
|
37509
37523
|
y: table.getFrozenRowsHeight()
|
|
37510
|
-
}), createColGroup(cornerHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, 0, table.frozenRowCount - 1, table.isListTable() ? "columnHeader" : "cornerHeader", table), distCol - table.rightFrozenColCount >= table.frozenColCount && createColGroup(colHeaderGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, 0, table.frozenRowCount - 1, "columnHeader", table), table.frozenColCount > 0 && (table.leftRowSeriesNumberCount > 0 && createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.leftRowSeriesNumberCount - 1, table.frozenRowCount, distRow - table.bottomFrozenRowCount, "rowHeader", table), table.
|
|
37524
|
+
}), createColGroup(cornerHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, 0, table.frozenRowCount - 1, table.isListTable() ? "columnHeader" : "cornerHeader", table), distCol - table.rightFrozenColCount >= table.frozenColCount && createColGroup(colHeaderGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, 0, table.frozenRowCount - 1, "columnHeader", table), table.frozenColCount > 0 && (table.leftRowSeriesNumberCount > 0 && createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.leftRowSeriesNumberCount - 1, table.frozenRowCount, distRow - table.bottomFrozenRowCount, "rowHeader", table), table.frozenColCount > table.leftRowSeriesNumberCount && createColGroup(rowHeaderGroup, xOrigin, yOrigin, table.leftRowSeriesNumberCount, Math.min(table.frozenColCount - 1, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount - 1), table.frozenRowCount, distRow - table.bottomFrozenRowCount, "rowHeader", table), table.frozenColCount > table.rowHeaderLevelCount + table.leftRowSeriesNumberCount && createColGroup(rowHeaderGroup, xOrigin, yOrigin, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, table.frozenColCount - 1, table.frozenRowCount, distRow - table.bottomFrozenRowCount, "body", table)), table.bottomFrozenRowCount > 0 && (table.frozenColCount > 0 && (table.leftRowSeriesNumberCount > 0 && createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, 0, table.leftRowSeriesNumberCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, "rowHeader", table), table.rowHeaderLevelCount > 0 && createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, table.leftRowSeriesNumberCount, table.leftRowSeriesNumberCount + table.rowHeaderLevelCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, "rowHeader", table), table.frozenColCount > table.rowHeaderLevelCount + table.leftRowSeriesNumberCount && createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, table.frozenColCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, "body", table)), distCol - table.rightFrozenColCount >= table.frozenColCount && createColGroup(bottomFrozenGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, table.isPivotChart() ? "rowHeader" : "body", table)), table.rightFrozenColCount > 0 && (createColGroup(rightTopCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, 0, table.frozenRowCount - 1, "columnHeader", table), createColGroup(rightFrozenGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.frozenRowCount, distRow - table.bottomFrozenRowCount, table.isPivotChart() ? "rowHeader" : "body", table)), table.bottomFrozenRowCount > 0 && table.rightFrozenColCount > 0 && createColGroup(rightBottomCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, "body", table), distCol - table.rightFrozenColCount >= table.frozenColCount && createColGroup(bodyGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, table.frozenRowCount, distRow - table.bottomFrozenRowCount, "body", table), bodyGroup.firstChild || colHeaderGroup.firstChild || cornerHeaderGroup.firstChild || rowHeaderGroup.firstChild ? (proxy.currentRow = null !== (_d = null !== (_b = null === (_a = bodyGroup.firstChild) || void 0 === _a ? void 0 : _a.rowNumber) && void 0 !== _b ? _b : null === (_c = rowHeaderGroup.firstChild) || void 0 === _c ? void 0 : _c.rowNumber) && void 0 !== _d ? _d : proxy.totalRow, proxy.rowEnd = proxy.currentRow, proxy.rowUpdatePos = proxy.rowEnd + 1, proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2), proxy.currentCol = null !== (_m = null !== (_k = null !== (_h = null !== (_f = null === (_e = bodyGroup.lastChild) || void 0 === _e ? void 0 : _e.col) && void 0 !== _f ? _f : null === (_g = colHeaderGroup.lastChild) || void 0 === _g ? void 0 : _g.col) && void 0 !== _h ? _h : null === (_j = rowHeaderGroup.lastChild) || void 0 === _j ? void 0 : _j.col) && void 0 !== _k ? _k : null === (_l = cornerHeaderGroup.lastChild) || void 0 === _l ? void 0 : _l.col) && void 0 !== _m ? _m : proxy.totalCol, proxy.colEnd = proxy.currentCol, proxy.colUpdatePos = proxy.colEnd + 1, proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2), proxy.progress()) : (proxy.currentRow = proxy.totalRow, proxy.rowEnd = proxy.currentRow, proxy.rowUpdatePos = proxy.rowEnd + 1, proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2), proxy.currentCol = proxy.totalCol, proxy.colEnd = proxy.currentCol, proxy.colUpdatePos = proxy.colEnd + 1, proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2));
|
|
37511
37525
|
}
|
|
37512
37526
|
|
|
37513
37527
|
function getFirstChild(containerGroup) {
|
|
@@ -39178,26 +39192,33 @@
|
|
|
39178
39192
|
} = scene,
|
|
39179
39193
|
plugin = stage.pluginService.findPluginsByName("ReactAttributePlugin")[0],
|
|
39180
39194
|
{
|
|
39181
|
-
htmlMap: htmlMap
|
|
39195
|
+
htmlMap: htmlMap,
|
|
39196
|
+
renderId: stageRenderId
|
|
39182
39197
|
} = plugin;
|
|
39183
39198
|
for (const key in htmlMap) {
|
|
39184
39199
|
const item = htmlMap[key],
|
|
39185
39200
|
{
|
|
39186
39201
|
graphic: graphic,
|
|
39187
|
-
wrapContainer: wrapContainer
|
|
39202
|
+
wrapContainer: wrapContainer,
|
|
39203
|
+
renderId: renderId
|
|
39188
39204
|
} = item;
|
|
39205
|
+
if (renderId !== stageRenderId) continue;
|
|
39189
39206
|
let targetContainer;
|
|
39190
39207
|
if (scene.frozenColCount > table.frozenColCount) {
|
|
39208
|
+
const targetCell = getTargetCell(graphic);
|
|
39209
|
+
if (!targetCell) continue;
|
|
39191
39210
|
const {
|
|
39192
39211
|
col: col,
|
|
39193
39212
|
row: row
|
|
39194
|
-
} =
|
|
39213
|
+
} = targetCell;
|
|
39195
39214
|
row >= table.rowCount - table.bottomFrozenRowCount && col < scene.frozenColCount && col >= table.frozenColCount && graphic.attribute.react.container === table.frozenBottomDomContainer ? targetContainer = table.bottomDomContainer : row >= table.frozenRowCount && col < scene.frozenColCount && col >= table.frozenColCount && graphic.attribute.react.container === table.frozenBodyDomContainer ? targetContainer = table.bodyDomContainer : row < table.frozenRowCount && col < scene.frozenColCount && col >= table.frozenColCount && graphic.attribute.react.container === table.frozenHeaderDomContainer && (targetContainer = table.headerDomContainer);
|
|
39196
39215
|
} else if (scene.frozenColCount < table.frozenColCount) {
|
|
39216
|
+
const targetCell = getTargetCell(graphic);
|
|
39217
|
+
if (!targetCell) continue;
|
|
39197
39218
|
const {
|
|
39198
39219
|
col: col,
|
|
39199
39220
|
row: row
|
|
39200
|
-
} =
|
|
39221
|
+
} = targetCell;
|
|
39201
39222
|
row >= table.rowCount - table.bottomFrozenRowCount && col < table.frozenColCount && col >= scene.frozenColCount && graphic.attribute.react.container === table.bottomDomContainer ? targetContainer = table.frozenBottomDomContainer : row >= table.frozenRowCount && col < table.frozenColCount && col >= scene.frozenColCount && graphic.attribute.react.container === table.bodyDomContainer ? targetContainer = table.frozenBodyDomContainer : row < table.frozenRowCount && col < table.frozenColCount && col >= scene.frozenColCount && graphic.attribute.react.container === table.headerDomContainer && (targetContainer = table.frozenHeaderDomContainer);
|
|
39202
39223
|
}
|
|
39203
39224
|
targetContainer && (targetContainer.appendChild(wrapContainer), item.nativeContainer = targetContainer, item.container = targetContainer, graphic.attribute.react.container = targetContainer, plugin.updateStyleOfWrapContainer(graphic, stage, wrapContainer, targetContainer, graphic.attribute.react));
|
|
@@ -41679,7 +41700,7 @@
|
|
|
41679
41700
|
const tableIndex = state.table.getTableIndexByRecordIndex(index),
|
|
41680
41701
|
mergeCell = state.table.transpose ? state.table.getCustomMerge(tableIndex, row) : state.table.getCustomMerge(col, tableIndex),
|
|
41681
41702
|
data = null === (_a = state.table.dataSource) || void 0 === _a ? void 0 : _a.get(index);
|
|
41682
|
-
mergeCell || !(null === (_b = state.table.internalProps.rowSeriesNumber) || void 0 === _b ? void 0 : _b.enableTreeCheckbox) && data.vtableMerge || (!0 !== (null == check_state ? void 0 : check_state[field]) ? allChecked = !1 : (allUnChecked = !1, hasChecked = !0));
|
|
41703
|
+
mergeCell || !(null === (_b = state.table.internalProps.rowSeriesNumber) || void 0 === _b ? void 0 : _b.enableTreeCheckbox) && (null == data ? void 0 : data.vtableMerge) || (!0 !== (null == check_state ? void 0 : check_state[field]) ? allChecked = !1 : (allUnChecked = !1, hasChecked = !0));
|
|
41683
41704
|
}), allChecked ? (state.headerCheckedState[field] = !0, allChecked) : allUnChecked ? (state.headerCheckedState[field] = !1, !1) : !!hasChecked && (state.headerCheckedState[field] = "indeterminate", "indeterminate");
|
|
41684
41705
|
}
|
|
41685
41706
|
function initLeftRecordsCheckState(records, state) {
|
|
@@ -42215,13 +42236,18 @@
|
|
|
42215
42236
|
return endMoveCol(this);
|
|
42216
42237
|
}
|
|
42217
42238
|
checkFrozen() {
|
|
42218
|
-
var _a
|
|
42219
|
-
let originalFrozenColCount = this.table.
|
|
42239
|
+
var _a;
|
|
42240
|
+
let originalFrozenColCount = this.table.options.frozenColCount ? this.table.options.frozenColCount : this.table.isPivotTable() || this.table.isListTable() && this.table.internalProps.transpose ? (null !== (_a = this.table.rowHeaderLevelCount) && void 0 !== _a ? _a : 0) + this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount : 0;
|
|
42220
42241
|
if (originalFrozenColCount) {
|
|
42221
|
-
|
|
42222
|
-
|
|
42242
|
+
originalFrozenColCount > this.table.colCount && (originalFrozenColCount = this.table.colCount);
|
|
42243
|
+
const maxFrozenWidth = this.table._getMaxFrozenWidth();
|
|
42244
|
+
if (this.table.getColsWidth(0, originalFrozenColCount - 1) > maxFrozenWidth) {
|
|
42245
|
+
if (this.table.internalProps.unfreezeAllOnExceedsMaxWidth) this.table._setFrozenColCount(0), this.setFrozenCol(-1);else {
|
|
42246
|
+
const computedFrozenColCount = this.table._getComputedFrozenColCount(originalFrozenColCount);
|
|
42247
|
+
this.table._setFrozenColCount(computedFrozenColCount), this.setFrozenCol(computedFrozenColCount);
|
|
42248
|
+
}
|
|
42249
|
+
} else this.table.frozenColCount !== originalFrozenColCount && (this.table._setFrozenColCount(originalFrozenColCount), this.setFrozenCol(originalFrozenColCount));
|
|
42223
42250
|
}
|
|
42224
|
-
return !0;
|
|
42225
42251
|
}
|
|
42226
42252
|
setFrozenCol(col) {
|
|
42227
42253
|
col !== this.frozen.col ? (this.frozen.col = col, this.table.scenegraph.updateFrozen(), this.table.scenegraph.updateFrozenIcon(0, this.table.colCount - 1)) : this.table.scenegraph.updateFrozenIcon(0, this.table.colCount - 1);
|
|
@@ -43834,8 +43860,8 @@
|
|
|
43834
43860
|
titleShowIndex = table.getRecordShowIndexByCell(col, row);
|
|
43835
43861
|
let titleIndex = indexedData[titleShowIndex];
|
|
43836
43862
|
if (isNumber$2(titleIndex) && (titleIndex = [titleIndex]), record.vtableMerge) {
|
|
43837
|
-
if (checked) setAllChildrenCheckboxState(!0, titleShowIndex, titleIndex, indexedData, table), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);else {
|
|
43838
|
-
setAllChildrenCheckboxState(!1, titleShowIndex, titleIndex, indexedData, table), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);
|
|
43863
|
+
if (checked) table.getHierarchyState(col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!0, titleIndex, table) : setAllChildrenCheckboxState(!0, titleShowIndex, titleIndex, indexedData, table), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);else {
|
|
43864
|
+
table.getHierarchyState(col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!1, titleIndex, table) : setAllChildrenCheckboxState(!1, titleShowIndex, titleIndex, indexedData, table), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);
|
|
43839
43865
|
const oldHeaderCheckedState = table.stateManager.headerCheckedState._vtable_rowSeries_number,
|
|
43840
43866
|
newHeaderCheckedState = table.stateManager.updateHeaderCheckedState("_vtable_rowSeries_number", col, row);
|
|
43841
43867
|
oldHeaderCheckedState !== newHeaderCheckedState && table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);
|
|
@@ -43882,6 +43908,20 @@
|
|
|
43882
43908
|
allUnChecked = result.every(item => !item);
|
|
43883
43909
|
allChecked ? (table.stateManager.setCheckedState(col, row, "_vtable_rowSeries_number", !0), setCellCheckboxStateByAttribute(col, row, !0, table)) : allUnChecked ? (table.stateManager.setCheckedState(col, row, "_vtable_rowSeries_number", !1), setCellCheckboxStateByAttribute(col, row, !1, table)) : (table.stateManager.setCheckedState(col, row, "_vtable_rowSeries_number", "indeterminate"), setCellCheckboxStateByAttribute(col, row, "indeterminate", table));
|
|
43884
43910
|
}
|
|
43911
|
+
function updateChildrenCheckboxState(state, currentIndex, table) {
|
|
43912
|
+
const {
|
|
43913
|
+
checkedState: checkedState
|
|
43914
|
+
} = table.stateManager,
|
|
43915
|
+
key = currentIndex.toString(),
|
|
43916
|
+
currentIndexLength = isArray$1(currentIndex) ? currentIndex.length : 1;
|
|
43917
|
+
let start = !1;
|
|
43918
|
+
checkedState.forEach((value, index) => {
|
|
43919
|
+
if (start) {
|
|
43920
|
+
index.split(",").length === currentIndexLength ? start = !1 : value._vtable_rowSeries_number = state;
|
|
43921
|
+
}
|
|
43922
|
+
index === key && (start = !0);
|
|
43923
|
+
});
|
|
43924
|
+
}
|
|
43885
43925
|
|
|
43886
43926
|
class EventManager {
|
|
43887
43927
|
constructor(table) {
|
|
@@ -46622,6 +46662,10 @@
|
|
|
46622
46662
|
}
|
|
46623
46663
|
}
|
|
46624
46664
|
|
|
46665
|
+
function getCustomMergeCellFunc(customMergeCell) {
|
|
46666
|
+
return isFunction$1(customMergeCell) ? customMergeCell : isArray$1(customMergeCell) ? (col, row) => customMergeCell.find(item => item.range.start.col <= col && item.range.end.col >= col && item.range.start.row <= row && item.range.end.row >= row) : void 0;
|
|
46667
|
+
}
|
|
46668
|
+
|
|
46625
46669
|
const {
|
|
46626
46670
|
toBoxArray: toBoxArray
|
|
46627
46671
|
} = style,
|
|
@@ -46636,10 +46680,12 @@
|
|
|
46636
46680
|
}
|
|
46637
46681
|
constructor(container) {
|
|
46638
46682
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
46639
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
46640
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.14.4-alpha.
|
|
46683
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
46684
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.14.4-alpha.5", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
46685
|
+
!1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
|
|
46641
46686
|
const {
|
|
46642
46687
|
frozenColCount = 0,
|
|
46688
|
+
unfreezeAllOnExceedsMaxWidth: unfreezeAllOnExceedsMaxWidth,
|
|
46643
46689
|
frozenRowCount: frozenRowCount,
|
|
46644
46690
|
defaultRowHeight = 40,
|
|
46645
46691
|
defaultHeaderRowHeight: defaultHeaderRowHeight,
|
|
@@ -46681,15 +46727,15 @@
|
|
|
46681
46727
|
right: 0,
|
|
46682
46728
|
left: 0,
|
|
46683
46729
|
bottom: 0
|
|
46684
|
-
}, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), isValid$1(canvasHeight) && isValid$1(canvasWidth) && (this.canvasSizeSeted = !0), this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight, this.columnWidthComputeMode = null !== (
|
|
46730
|
+
}, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), isValid$1(canvasHeight) && isValid$1(canvasWidth) && (this.canvasSizeSeted = !0), this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight, this.columnWidthComputeMode = null !== (_b = options.columnWidthComputeMode) && void 0 !== _b ? _b : "normal";
|
|
46685
46731
|
const internalProps = this.internalProps = {};
|
|
46686
|
-
if (void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative", internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (
|
|
46732
|
+
if (void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative", internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_c = options.customConfig) || void 0 === _c ? void 0 : _c.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler(), isNumber$2(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = columnResizeMode, internalProps.rowResizeMode = rowResizeMode, internalProps.dragHeaderMode = null != dragHeaderMode ? dragHeaderMode : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}, internalProps.calcWidthContext = {
|
|
46687
46733
|
_: internalProps,
|
|
46688
46734
|
get full() {
|
|
46689
46735
|
var _a;
|
|
46690
46736
|
return "node" === Env.mode ? canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
|
|
46691
46737
|
}
|
|
46692
|
-
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (
|
|
46738
|
+
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_d = options.theme) && void 0 !== _d ? _d : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), container ? (clearDOM && (container.innerHTML = ""), container.appendChild(internalProps.element), this._updateSize()) : this._updateSize(), internalProps.bodyHelper = new BodyHelper(this), internalProps.headerHelper = new HeaderHelper(this), internalProps.rowSeriesNumberHelper = new RowSeriesNumberHelper(this), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_e = options.allowFrozenColCount) && void 0 !== _e ? _e : 0, internalProps.limitMaxAutoWidth = null !== (_f = options.limitMaxAutoWidth) && void 0 !== _f ? _f : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, this.scenegraph = new Scenegraph(this), this.stateManager = new StateManager(this), this.eventManager = new EventManager(this), this.animationManager = new TableAnimationManager(this), options.legends) {
|
|
46693
46739
|
internalProps.legends = [];
|
|
46694
46740
|
const createLegend = Factory.getFunction("createLegend");
|
|
46695
46741
|
if (Array.isArray(options.legends)) {
|
|
@@ -46715,15 +46761,15 @@
|
|
|
46715
46761
|
}
|
|
46716
46762
|
if (internalProps.menu = Object.assign({
|
|
46717
46763
|
renderMode: "html"
|
|
46718
|
-
}, options.menu), Array.isArray(null === (
|
|
46764
|
+
}, options.menu), Array.isArray(null === (_g = options.menu) || void 0 === _g ? void 0 : _g.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_h = options.menu) || void 0 === _h ? void 0 : _h.dropDownMenuHighlight), Array.isArray(null === (_j = options.menu) || void 0 === _j ? void 0 : _j.defaultHeaderMenuItems) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems), "html" === internalProps.menu.renderMode) {
|
|
46719
46765
|
const MenuHandler = Factory.getComponent("menuHandler");
|
|
46720
46766
|
internalProps.menuHandler = new MenuHandler(this);
|
|
46721
46767
|
}
|
|
46722
46768
|
this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyMergeTitleCache = new Map(), this.bodyBottomStyleCache = new Map(), internalProps.stick = {
|
|
46723
46769
|
changedCells: new Map()
|
|
46724
|
-
}, internalProps.customMergeCell = options.customMergeCell;
|
|
46770
|
+
}, internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell);
|
|
46725
46771
|
const CustomCellStylePlugin = Factory.getComponent("customCellStylePlugin");
|
|
46726
|
-
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (
|
|
46772
|
+
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_k = options.customCellStyle) && void 0 !== _k ? _k : [], null !== (_l = options.customCellStyleArrangement) && void 0 !== _l ? _l : []));
|
|
46727
46773
|
}
|
|
46728
46774
|
getContainer() {
|
|
46729
46775
|
return this.container;
|
|
@@ -46761,10 +46807,22 @@
|
|
|
46761
46807
|
return null !== (_e = null !== (_c = null === (_b = null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.layoutMap) || void 0 === _b ? void 0 : _b.frozenColCount) && void 0 !== _c ? _c : null === (_d = this.internalProps) || void 0 === _d ? void 0 : _d.frozenColCount) && void 0 !== _e ? _e : 0;
|
|
46762
46808
|
}
|
|
46763
46809
|
set frozenColCount(frozenColCount) {
|
|
46764
|
-
frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount, this.options.frozenColCount = frozenColCount
|
|
46810
|
+
frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount, this.options.frozenColCount = frozenColCount;
|
|
46811
|
+
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
46812
|
+
if (this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0;else {
|
|
46813
|
+
const computedFrozenColCount = this._getComputedFrozenColCount(frozenColCount);
|
|
46814
|
+
this.internalProps.frozenColCount = computedFrozenColCount;
|
|
46815
|
+
}
|
|
46816
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
46765
46817
|
}
|
|
46766
46818
|
setFrozenColCount(frozenColCount) {
|
|
46767
|
-
frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount, this.options.frozenColCount = frozenColCount
|
|
46819
|
+
frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount, this.options.frozenColCount = frozenColCount;
|
|
46820
|
+
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
46821
|
+
if (this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0;else {
|
|
46822
|
+
const computedFrozenColCount = this._getComputedFrozenColCount(frozenColCount);
|
|
46823
|
+
this.internalProps.frozenColCount = computedFrozenColCount;
|
|
46824
|
+
}
|
|
46825
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
46768
46826
|
}
|
|
46769
46827
|
_setFrozenColCount(frozenColCount) {
|
|
46770
46828
|
frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount;
|
|
@@ -46906,6 +46964,17 @@
|
|
|
46906
46964
|
_colWidthDefineToPxWidth(width) {
|
|
46907
46965
|
return "auto" === width ? 0 : _toPxWidth(this, width);
|
|
46908
46966
|
}
|
|
46967
|
+
_getMaxFrozenWidth() {
|
|
46968
|
+
var _a;
|
|
46969
|
+
const maxFrozenWidth = null !== (_a = this.options.maxFrozenWidth) && void 0 !== _a ? _a : "80%";
|
|
46970
|
+
return _toPxWidth(this, maxFrozenWidth);
|
|
46971
|
+
}
|
|
46972
|
+
_getComputedFrozenColCount(frozenColCount) {
|
|
46973
|
+
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
46974
|
+
let computedfrozenColCount = frozenColCount;
|
|
46975
|
+
for (; this.getColsWidth(0, computedfrozenColCount - 1) > maxFrozenWidth && (computedfrozenColCount--, !(computedfrozenColCount <= 0)););
|
|
46976
|
+
return computedfrozenColCount;
|
|
46977
|
+
}
|
|
46909
46978
|
_getColWidthLimits(col) {
|
|
46910
46979
|
const limit = this.colWidthsLimit[col];
|
|
46911
46980
|
if (!limit) return null;
|
|
@@ -46916,6 +46985,9 @@
|
|
|
46916
46985
|
const limits = this._getColWidthLimits(col);
|
|
46917
46986
|
return Math.max(_applyColWidthLimits(limits, orgWidth), 0);
|
|
46918
46987
|
}
|
|
46988
|
+
get pixelRatio() {
|
|
46989
|
+
return this.internalProps.pixelRatio;
|
|
46990
|
+
}
|
|
46919
46991
|
setPixelRatio(pixelRatio) {
|
|
46920
46992
|
if (pixelRatio !== this.internalProps.pixelRatio) {
|
|
46921
46993
|
this.internalProps.pixelRatio = pixelRatio;
|
|
@@ -47408,6 +47480,7 @@
|
|
|
47408
47480
|
this.options = options, this._hasAutoImageColumn = void 0;
|
|
47409
47481
|
const {
|
|
47410
47482
|
frozenColCount = 0,
|
|
47483
|
+
unfreezeAllOnExceedsMaxWidth: unfreezeAllOnExceedsMaxWidth,
|
|
47411
47484
|
defaultRowHeight = 40,
|
|
47412
47485
|
defaultHeaderRowHeight: defaultHeaderRowHeight,
|
|
47413
47486
|
defaultColWidth = 80,
|
|
@@ -47442,7 +47515,7 @@
|
|
|
47442
47515
|
} = options;
|
|
47443
47516
|
pixelRatio && pixelRatio !== this.internalProps.pixelRatio && (this.internalProps.pixelRatio = pixelRatio), padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), this.showFrozenIcon = "boolean" != typeof showFrozenIcon || showFrozenIcon, "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.widthMode = null != widthMode ? widthMode : "standard", this.heightMode = null != heightMode ? heightMode : "standard", this._widthAdaptiveMode = null != widthAdaptiveMode ? widthAdaptiveMode : "only-body", this._heightAdaptiveMode = null != heightAdaptiveMode ? heightAdaptiveMode : "only-body", this.autoFillWidth = null != autoFillWidth && autoFillWidth, this.autoFillHeight = null != autoFillHeight && autoFillHeight, this.customRender = customRender, this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight;
|
|
47444
47517
|
const internalProps = this.internalProps;
|
|
47445
|
-
if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal", internalProps.frozenColCount = frozenColCount, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = columnResizeMode, internalProps.rowResizeMode = rowResizeMode, internalProps.dragHeaderMode = null != dragHeaderMode ? dragHeaderMode : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.cellTextOverflows = {}, internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}, internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (_b = options.theme) && void 0 !== _b ? _b : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_c = options.allowFrozenColCount) && void 0 !== _c ? _c : 0, internalProps.limitMaxAutoWidth = null !== (_d = options.limitMaxAutoWidth) && void 0 !== _d ? _d : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, null === (_e = internalProps.legends) || void 0 === _e || _e.forEach(legend => {
|
|
47518
|
+
if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal", internalProps.frozenColCount = frozenColCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = columnResizeMode, internalProps.rowResizeMode = rowResizeMode, internalProps.dragHeaderMode = null != dragHeaderMode ? dragHeaderMode : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.cellTextOverflows = {}, internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}, internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (_b = options.theme) && void 0 !== _b ? _b : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_c = options.allowFrozenColCount) && void 0 !== _c ? _c : 0, internalProps.limitMaxAutoWidth = null !== (_d = options.limitMaxAutoWidth) && void 0 !== _d ? _d : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, null === (_e = internalProps.legends) || void 0 === _e || _e.forEach(legend => {
|
|
47446
47519
|
null == legend || legend.release();
|
|
47447
47520
|
}), null === (_f = internalProps.title) || void 0 === _f || _f.release(), internalProps.title = null, null === (_g = internalProps.emptyTip) || void 0 === _g || _g.release(), internalProps.emptyTip = null, internalProps.layoutMap.release(), this.scenegraph.clearCells(), this.scenegraph.updateComponent(), this.stateManager.updateOptionSetState(), this._updateSize(), this.eventManager.updateEventBinder(), options.legends) {
|
|
47448
47521
|
internalProps.legends = [];
|
|
@@ -47474,7 +47547,7 @@
|
|
|
47474
47547
|
const MenuHandler = Factory.getComponent("menuHandler");
|
|
47475
47548
|
internalProps.menuHandler = new MenuHandler(this);
|
|
47476
47549
|
}
|
|
47477
|
-
this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = options.customMergeCell, null === (_l = this.customCellStylePlugin) || void 0 === _l || _l.updateCustomCell(null !== (_m = options.customCellStyle) && void 0 !== _m ? _m : [], null !== (_o = options.customCellStyleArrangement) && void 0 !== _o ? _o : []);
|
|
47550
|
+
this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell), null === (_l = this.customCellStylePlugin) || void 0 === _l || _l.updateCustomCell(null !== (_m = options.customCellStyle) && void 0 !== _m ? _m : [], null !== (_o = options.customCellStyleArrangement) && void 0 !== _o ? _o : []);
|
|
47478
47551
|
}
|
|
47479
47552
|
renderWithRecreateCells() {
|
|
47480
47553
|
const oldHoverState = {
|
|
@@ -48437,6 +48510,9 @@
|
|
|
48437
48510
|
}
|
|
48438
48511
|
this.render();
|
|
48439
48512
|
}
|
|
48513
|
+
checkHasColumnAutoWidth() {
|
|
48514
|
+
return checkHasColumnAutoWidth(this);
|
|
48515
|
+
}
|
|
48440
48516
|
}
|
|
48441
48517
|
|
|
48442
48518
|
const chartTypes = {};
|
|
@@ -49643,7 +49719,9 @@
|
|
|
49643
49719
|
};
|
|
49644
49720
|
results[id] = cell;
|
|
49645
49721
|
for (let r = row - 1; r >= 0; r--) this._headerCellIds[r] && (this._headerCellIds[r][col] = roots[r]);
|
|
49646
|
-
if (hideColumnsSubHeader ? this._headerCellIds[row - 1] && (rowCells[col] = this._headerCellIds[row - 1][col]) : rowCells[col] = id, hd.columns)
|
|
49722
|
+
if (hideColumnsSubHeader ? this._headerCellIds[row - 1] && (rowCells[col] = this._headerCellIds[row - 1][col]) : rowCells[col] = id, hd.columns) {
|
|
49723
|
+
!hd.columns.every(c => c.hide) && this._addHeaders(row + 1, hd.columns, [...roots, id], hd.hideColumnsSubHeader || hideColumnsSubHeader).forEach(c => results.push(c));
|
|
49724
|
+
} else {
|
|
49647
49725
|
const colDef = {
|
|
49648
49726
|
id: this.seqId++,
|
|
49649
49727
|
field: hd.field,
|
|
@@ -49857,6 +49935,17 @@
|
|
|
49857
49935
|
columnDefine: cur
|
|
49858
49936
|
}), pre), []);
|
|
49859
49937
|
}
|
|
49938
|
+
getColumnByKey(key) {
|
|
49939
|
+
var _a;
|
|
49940
|
+
let col;
|
|
49941
|
+
return {
|
|
49942
|
+
columnDefine: null === (_a = this.columnObjects) || void 0 === _a ? void 0 : _a.find((columnData, index) => {
|
|
49943
|
+
var _a;
|
|
49944
|
+
return (null === (_a = columnData.define) || void 0 === _a ? void 0 : _a.key) === key && (col = index, !0);
|
|
49945
|
+
}),
|
|
49946
|
+
col: col
|
|
49947
|
+
};
|
|
49948
|
+
}
|
|
49860
49949
|
getColumnDefine(col, row) {
|
|
49861
49950
|
if (col >= 0) return col < this.leftRowSeriesNumberColumnCount ? this.leftRowSeriesNumberColumn[col].define : this.transpose ? this._columns[row].define : this._columns[col - this.leftRowSeriesNumberColumnCount].define;
|
|
49862
49951
|
}
|
|
@@ -50476,7 +50565,7 @@
|
|
|
50476
50565
|
var _a, _b, _c, _d, _e, _f;
|
|
50477
50566
|
"node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), super(container, options), this.showHeader = !0;
|
|
50478
50567
|
const internalProps = this.internalProps;
|
|
50479
|
-
if (internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.multipleSort = !!options.multipleSort, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_b = null !== (_a = options.enableTreeNodeMerge) && void 0 !== _a ? _a : isValid$1(options.groupBy)) && void 0 !== _b && _b, this.internalProps.headerHelper.setTableColumnsEditor(), this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d, "node" !== Env.mode && (this.editorManager = new EditManager(this)), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, options.dataSource ? _setDataSource(this, options.dataSource) : options.records ? this.setRecords(options.records, {
|
|
50568
|
+
if (internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.multipleSort = !!options.multipleSort, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_b = null !== (_a = options.enableTreeNodeMerge) && void 0 !== _a ? _a : isValid$1(options.groupBy)) && void 0 !== _b && _b, this.internalProps.headerHelper.setTableColumnsEditor(), this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, this.internalProps.columnWidthConfig = options.columnWidthConfig, this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d, "node" !== Env.mode && (this.editorManager = new EditManager(this)), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, options.dataSource ? _setDataSource(this, options.dataSource) : options.records ? this.setRecords(options.records, {
|
|
50480
50569
|
sortState: internalProps.sortState
|
|
50481
50570
|
}) : this.setRecords([]), options.title) {
|
|
50482
50571
|
const Title = Factory.getComponent("title");
|
|
@@ -50689,7 +50778,7 @@
|
|
|
50689
50778
|
updateOption(options) {
|
|
50690
50779
|
var _a, _b, _c, _d, _e, _f;
|
|
50691
50780
|
const internalProps = this.internalProps;
|
|
50692
|
-
if (super.updateOption(options), internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, this.showHeader = null === (_a = options.showHeader) || void 0 === _a || _a, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_c = null !== (_b = options.enableTreeNodeMerge) && void 0 !== _b ? _b : isValid$1(options.groupBy)) && void 0 !== _c && _c, this.internalProps.headerHelper.setTableColumnsEditor(), this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d, this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, internalProps.releaseList && (internalProps.releaseList.forEach(releaseObj => {
|
|
50781
|
+
if (super.updateOption(options), internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, this.showHeader = null === (_a = options.showHeader) || void 0 === _a || _a, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_c = null !== (_b = options.enableTreeNodeMerge) && void 0 !== _b ? _b : isValid$1(options.groupBy)) && void 0 !== _c && _c, this.internalProps.headerHelper.setTableColumnsEditor(), this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d, this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.columnWidthConfig = options.columnWidthConfig, internalProps.releaseList && (internalProps.releaseList.forEach(releaseObj => {
|
|
50693
50782
|
var _a;
|
|
50694
50783
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
50695
50784
|
}), internalProps.releaseList = null), options.dataSource ? _setDataSource(this, options.dataSource) : options.records ? this.setRecords(options.records, {
|
|
@@ -50890,7 +50979,7 @@
|
|
|
50890
50979
|
getCheckboxState(field) {
|
|
50891
50980
|
if (this.stateManager.checkedState.size < this.rowCount - this.columnHeaderLevelCount && this.stateManager.initLeftRecordsCheckState(this.records), isValid$1(field)) {
|
|
50892
50981
|
let stateArr = this.stateManager.checkedState.values();
|
|
50893
|
-
return this.options.groupBy && (stateArr = getGroupCheckboxState(this)),
|
|
50982
|
+
return this.options.groupBy && (stateArr = getGroupCheckboxState(this)), Array.from(stateArr, state => state[field]);
|
|
50894
50983
|
}
|
|
50895
50984
|
return new Array(...this.stateManager.checkedState.values());
|
|
50896
50985
|
}
|
|
@@ -51070,6 +51159,20 @@
|
|
|
51070
51159
|
getBodyRowIndexByRecordIndex(index) {
|
|
51071
51160
|
return Array.isArray(index) && 1 === index.length && (index = index[0]), this.dataSource.getTableIndex(index);
|
|
51072
51161
|
}
|
|
51162
|
+
_parseColumnWidthConfig(columnWidthConfig) {
|
|
51163
|
+
for (let i = 0; i < (null == columnWidthConfig ? void 0 : columnWidthConfig.length); i++) {
|
|
51164
|
+
const item = columnWidthConfig[i],
|
|
51165
|
+
key = item.key,
|
|
51166
|
+
width = item.width,
|
|
51167
|
+
columnData = this.internalProps.layoutMap.getColumnByKey(key);
|
|
51168
|
+
if (columnData.columnDefine) {
|
|
51169
|
+
const {
|
|
51170
|
+
col: col
|
|
51171
|
+
} = columnData;
|
|
51172
|
+
this.internalProps._widthResizedColMap.has(col) || (this._setColWidth(col, width), this.internalProps._widthResizedColMap.add(col));
|
|
51173
|
+
}
|
|
51174
|
+
}
|
|
51175
|
+
}
|
|
51073
51176
|
}
|
|
51074
51177
|
|
|
51075
51178
|
function isXAxis(orient) {
|
|
@@ -52634,7 +52737,7 @@
|
|
|
52634
52737
|
width: 100,
|
|
52635
52738
|
height: 100
|
|
52636
52739
|
}
|
|
52637
|
-
}, this.isReleased = !1, this.table = table, this._emptyTipOption = Object.assign(this._emptyTipOption, !0 === emptyTipOption ? {} : emptyTipOption), this._emptyTipComponent = this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs());
|
|
52740
|
+
}, this.isReleased = !1, this.table = table, isBoolean$2(emptyTipOption) || isValid$1(emptyTipOption.displayMode) || (this.table.isListTable() ? emptyTipOption.displayMode = "basedOnTable" : emptyTipOption.displayMode = "basedOnContainer"), this._emptyTipOption = Object.assign(this._emptyTipOption, !0 === emptyTipOption ? {} : emptyTipOption), this._emptyTipComponent = this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs());
|
|
52638
52741
|
}
|
|
52639
52742
|
_createOrUpdateEmptyTipComponent(attrs) {
|
|
52640
52743
|
if (this._emptyTipComponent) isEqual(attrs, this._cacheAttrs) || this._emptyTipComponent.setAttributes(attrs);else {
|
|
@@ -52674,8 +52777,8 @@
|
|
|
52674
52777
|
var _a;
|
|
52675
52778
|
const leftHeaderWidth = this.table.transpose || !1 === this.table.options.indicatorsAsCol ? this.table.getFrozenColsWidth() : 0,
|
|
52676
52779
|
topHeaderHeight = !this.table.transpose || this.table.options.indicatorsAsCol ? this.table.getFrozenRowsHeight() : 0,
|
|
52677
|
-
width = (this.table.columnHeaderLevelCount > 0 && this.table.
|
|
52678
|
-
height = (this.table.rowHeaderLevelCount > 0 && this.table.
|
|
52780
|
+
width = ("basedOnContainer" !== this._emptyTipOption.displayMode && this.table.columnHeaderLevelCount > 0 && this.table.colCount > this.table.rowHeaderLevelCount ? this.table.getDrawRange().width : this.table.tableNoFrameWidth) - leftHeaderWidth - this.table.getTheme().scrollStyle.width,
|
|
52781
|
+
height = ("basedOnContainer" !== this._emptyTipOption.displayMode && this.table.rowHeaderLevelCount > 0 && this.table.rowCount > this.table.columnHeaderLevelCount ? this.table.getDrawRange().height : this.table.tableNoFrameHeight) - topHeaderHeight - this.table.getTheme().scrollStyle.width;
|
|
52679
52782
|
return {
|
|
52680
52783
|
spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,
|
|
52681
52784
|
x: this.table.tableX + leftHeaderWidth,
|
|
@@ -55689,6 +55792,42 @@
|
|
|
55689
55792
|
return result || new Date(NaN);
|
|
55690
55793
|
}
|
|
55691
55794
|
|
|
55795
|
+
/**
|
|
55796
|
+
* @name isSameDay
|
|
55797
|
+
* @category Day Helpers
|
|
55798
|
+
* @summary Are the given dates in the same day (and year and month)?
|
|
55799
|
+
*
|
|
55800
|
+
* @description
|
|
55801
|
+
* Are the given dates in the same day (and year and month)?
|
|
55802
|
+
*
|
|
55803
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
55804
|
+
*
|
|
55805
|
+
* @param dateLeft - The first date to check
|
|
55806
|
+
* @param dateRight - The second date to check
|
|
55807
|
+
|
|
55808
|
+
* @returns The dates are in the same day (and year and month)
|
|
55809
|
+
*
|
|
55810
|
+
* @example
|
|
55811
|
+
* // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
|
|
55812
|
+
* const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
|
|
55813
|
+
* //=> true
|
|
55814
|
+
*
|
|
55815
|
+
* @example
|
|
55816
|
+
* // Are 4 September and 4 October in the same day?
|
|
55817
|
+
* const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
|
|
55818
|
+
* //=> false
|
|
55819
|
+
*
|
|
55820
|
+
* @example
|
|
55821
|
+
* // Are 4 September, 2014 and 4 September, 2015 in the same day?
|
|
55822
|
+
* const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
|
|
55823
|
+
* //=> false
|
|
55824
|
+
*/
|
|
55825
|
+
function isSameDay(dateLeft, dateRight) {
|
|
55826
|
+
const dateLeftStartOfDay = startOfDay(dateLeft);
|
|
55827
|
+
const dateRightStartOfDay = startOfDay(dateRight);
|
|
55828
|
+
return +dateLeftStartOfDay === +dateRightStartOfDay;
|
|
55829
|
+
}
|
|
55830
|
+
|
|
55692
55831
|
/**
|
|
55693
55832
|
* @name differenceInDays
|
|
55694
55833
|
* @category Day Helpers
|
|
@@ -56283,9 +56422,7 @@
|
|
|
56283
56422
|
field: defaultDayTitles[index],
|
|
56284
56423
|
title: item,
|
|
56285
56424
|
fieldFormat: (record) => {
|
|
56286
|
-
if (record.year
|
|
56287
|
-
record.month === currentDate.getMonth() &&
|
|
56288
|
-
record[item] === currentDate.getDate()) {
|
|
56425
|
+
if (isSameDay(addDays(new Date(record.year, record.month, record.Sun), index), currentDate)) {
|
|
56289
56426
|
return `${record[item]}\nToday`;
|
|
56290
56427
|
}
|
|
56291
56428
|
else if (record[item] === 1) {
|
|
@@ -56295,7 +56432,7 @@
|
|
|
56295
56432
|
}
|
|
56296
56433
|
return record[item];
|
|
56297
56434
|
},
|
|
56298
|
-
customLayout: calendarCustomLayout
|
|
56435
|
+
customLayout: config.tableOptions?.customLayout ?? calendarCustomLayout
|
|
56299
56436
|
};
|
|
56300
56437
|
});
|
|
56301
56438
|
const rowHeight = Math.floor((config.containerHeight -
|
|
@@ -56319,12 +56456,9 @@
|
|
|
56319
56456
|
bgColor: args => {
|
|
56320
56457
|
const { col, row, dataValue, table } = args;
|
|
56321
56458
|
const record = table.getCellRawRecord(col, row);
|
|
56322
|
-
|
|
56323
|
-
|
|
56324
|
-
|
|
56325
|
-
if (year === currentDate.getFullYear() &&
|
|
56326
|
-
month === currentDate.getMonth() &&
|
|
56327
|
-
date === currentDate.getDate()) {
|
|
56459
|
+
record.Sun > dataValue ? record.month + 1 : record.month;
|
|
56460
|
+
record.month === 11 && record.Sun > dataValue ? record.year + 1 : record.year;
|
|
56461
|
+
if (isSameDay(addDays(new Date(record.year, record.month, record.Sun), col), currentDate)) {
|
|
56328
56462
|
return '#f0f0f0';
|
|
56329
56463
|
}
|
|
56330
56464
|
return '#fff';
|
|
@@ -56627,6 +56761,9 @@
|
|
|
56627
56761
|
this.table = tableInstance;
|
|
56628
56762
|
tableInstance.addEventListener('scroll', () => {
|
|
56629
56763
|
const record = this.getYearAndMonth();
|
|
56764
|
+
if (!record) {
|
|
56765
|
+
return;
|
|
56766
|
+
}
|
|
56630
56767
|
if (!record.Sun) {
|
|
56631
56768
|
this._updateMonthCustomStyle(this.startDate.getFullYear(), this.startDate.getMonth());
|
|
56632
56769
|
return;
|