k-vtable 1.0.32 → 1.0.33
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/README.md +20 -0
- package/cjs/ListTable.d.ts +34 -7
- package/cjs/ListTable.js +152 -28
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +15 -8
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.js +30 -16
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/legend/continue-legend/continue-legend.js +5 -4
- package/cjs/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +5 -4
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/components/title/title.js +4 -4
- package/cjs/components/title/title.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +4 -0
- package/cjs/core/BaseTable.js +32 -18
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
- package/cjs/core/TABLE_EVENT_TYPE.js +1 -0
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/core/index.d.ts +1 -0
- package/cjs/core/index.js +30 -0
- package/cjs/core/index.js.map +1 -0
- package/cjs/core/record-helper.d.ts +4 -2
- package/cjs/core/record-helper.js +120 -47
- package/cjs/core/record-helper.js.map +1 -1
- package/cjs/core/style-helper.js +1 -1
- package/cjs/core/style-helper.js.map +1 -1
- package/cjs/data/DataSource.d.ts +13 -4
- package/cjs/data/DataSource.js +174 -60
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/DataStatistics.js +1 -2
- package/cjs/dataset/dataset-pivot-table.js +2 -1
- package/cjs/dataset/dataset.d.ts +4 -1
- package/cjs/dataset/dataset.js +40 -10
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/edit/edit-manager.js +2 -2
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/EventHandler.js +4 -3
- package/cjs/event/EventHandler.js.map +1 -1
- package/cjs/event/EventTarget.d.ts +1 -1
- package/cjs/event/EventTarget.js +1 -1
- package/cjs/event/EventTarget.js.map +1 -1
- package/cjs/event/event.d.ts +2 -1
- package/cjs/event/event.js +20 -9
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +1 -1
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js +8 -7
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/media-click.js +5 -5
- package/cjs/event/media-click.js.map +1 -1
- package/cjs/header-helper/header-helper.d.ts +2 -2
- package/cjs/header-helper/header-helper.js.map +1 -1
- package/cjs/header-helper/style.js +1 -2
- package/cjs/icons.js +2 -2
- package/cjs/icons.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/index.js +2 -1
- package/cjs/layout/pivot-header-layout.js +2 -1
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/plugins/custom-cell-style.d.ts +5 -0
- package/cjs/plugins/custom-cell-style.js +9 -0
- package/cjs/plugins/custom-cell-style.js.map +1 -1
- package/cjs/plugins/index.js +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +2 -2
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.d.ts +3 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +12 -6
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js +6 -2
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +1 -2
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +9 -7
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +1 -2
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +3 -3
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +5 -5
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +1 -1
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/state/hover/col.js.map +1 -1
- package/cjs/state/hover/is-cell-hover.js.map +1 -1
- package/cjs/state/hover/update-cell.js.map +1 -1
- package/cjs/themes/themes.d.ts +3 -1
- package/cjs/themes/themes.js +30 -1
- package/cjs/themes/themes.js.map +1 -1
- package/cjs/themes.d.ts +2 -0
- package/cjs/themes.js +11 -2
- package/cjs/themes.js.map +1 -1
- package/cjs/tools/join.js +1 -0
- package/cjs/tools/join.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +7 -2
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/events.d.ts +15 -0
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/icon.d.ts +2 -0
- package/cjs/ts-types/icon.js +4 -3
- package/cjs/ts-types/icon.js.map +1 -1
- package/cjs/ts-types/list-table/layout-map/api.d.ts +3 -3
- package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
- package/cjs/ts-types/pivot-table/corner.d.ts +1 -1
- package/cjs/ts-types/pivot-table/corner.js.map +1 -1
- package/cjs/ts-types/pivot-table/dimension/composite-dimension.d.ts +17 -0
- package/cjs/ts-types/pivot-table/dimension/composite-dimension.js +6 -0
- package/cjs/ts-types/pivot-table/dimension/composite-dimension.js.map +1 -0
- package/cjs/ts-types/pivot-table/dimension/index.d.ts +3 -2
- package/cjs/ts-types/pivot-table/dimension/index.js.map +1 -1
- package/cjs/ts-types/pivot-table/indicator/composite-indicator.d.ts +14 -2
- package/cjs/ts-types/pivot-table/indicator/composite-indicator.js.map +1 -1
- package/cjs/ts-types/pivot-table/indicator/index.d.ts +2 -2
- package/cjs/ts-types/pivot-table/indicator/index.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +33 -6
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +1046 -262
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +34 -7
- package/es/ListTable.js +148 -28
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +15 -8
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.js +30 -16
- package/es/PivotTable.js.map +1 -1
- package/es/components/legend/continue-legend/continue-legend.js +5 -4
- package/es/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +5 -4
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/components/title/title.js +4 -4
- package/es/components/title/title.js.map +1 -1
- package/es/core/BaseTable.d.ts +4 -0
- package/es/core/BaseTable.js +32 -18
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
- package/es/core/TABLE_EVENT_TYPE.js +1 -0
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/core/index.d.ts +1 -0
- package/es/core/index.js +2 -0
- package/es/core/index.js.map +1 -0
- package/es/core/record-helper.d.ts +4 -2
- package/es/core/record-helper.js +114 -43
- package/es/core/record-helper.js.map +1 -1
- package/es/core/style-helper.js +1 -1
- package/es/core/style-helper.js.map +1 -1
- package/es/data/DataSource.d.ts +13 -4
- package/es/data/DataSource.js +174 -60
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/DataStatistics.js +1 -2
- package/es/dataset/dataset-pivot-table.js +2 -1
- package/es/dataset/dataset.d.ts +4 -1
- package/es/dataset/dataset.js +40 -10
- package/es/dataset/dataset.js.map +1 -1
- package/es/edit/edit-manager.js +2 -2
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/EventHandler.js +4 -3
- package/es/event/EventHandler.js.map +1 -1
- package/es/event/EventTarget.d.ts +1 -1
- package/es/event/EventTarget.js +1 -1
- package/es/event/EventTarget.js.map +1 -1
- package/es/event/event.d.ts +2 -1
- package/es/event/event.js +20 -9
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +1 -1
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js +8 -7
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/media-click.js +5 -5
- package/es/event/media-click.js.map +1 -1
- package/es/header-helper/header-helper.d.ts +2 -2
- package/es/header-helper/header-helper.js.map +1 -1
- package/es/header-helper/style.js +1 -2
- package/es/icons.js +1 -3
- package/es/icons.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/index.js +2 -1
- package/es/layout/pivot-header-layout.js +2 -1
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/plugins/custom-cell-style.d.ts +5 -0
- package/es/plugins/custom-cell-style.js +9 -0
- package/es/plugins/custom-cell-style.js.map +1 -1
- package/es/plugins/index.js +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +2 -2
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.d.ts +3 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js +11 -7
- package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js +7 -3
- package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +1 -2
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +9 -7
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +1 -2
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +3 -3
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +5 -5
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.js +1 -1
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/state/hover/col.js.map +1 -1
- package/es/state/hover/is-cell-hover.js.map +1 -1
- package/es/state/hover/update-cell.js.map +1 -1
- package/es/themes/themes.d.ts +3 -1
- package/es/themes/themes.js +27 -0
- package/es/themes/themes.js.map +1 -1
- package/es/themes.d.ts +2 -0
- package/es/themes.js +3 -1
- package/es/themes.js.map +1 -1
- package/es/tools/join.js +1 -0
- package/es/tools/join.js.map +1 -1
- package/es/ts-types/base-table.d.ts +7 -2
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/events.d.ts +15 -0
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/icon.d.ts +2 -0
- package/es/ts-types/icon.js +4 -3
- package/es/ts-types/icon.js.map +1 -1
- package/es/ts-types/list-table/layout-map/api.d.ts +3 -3
- package/es/ts-types/list-table/layout-map/api.js.map +1 -1
- package/es/ts-types/pivot-table/corner.d.ts +1 -1
- package/es/ts-types/pivot-table/corner.js.map +1 -1
- package/es/ts-types/pivot-table/dimension/composite-dimension.d.ts +17 -0
- package/es/ts-types/pivot-table/dimension/composite-dimension.js +2 -0
- package/es/ts-types/pivot-table/dimension/composite-dimension.js.map +1 -0
- package/es/ts-types/pivot-table/dimension/index.d.ts +3 -2
- package/es/ts-types/pivot-table/dimension/index.js.map +1 -1
- package/es/ts-types/pivot-table/indicator/composite-indicator.d.ts +14 -2
- package/es/ts-types/pivot-table/indicator/composite-indicator.js.map +1 -1
- package/es/ts-types/pivot-table/indicator/index.d.ts +2 -2
- package/es/ts-types/pivot-table/indicator/index.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +33 -6
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +6 -6
package/dist/vtable.js
CHANGED
|
@@ -24465,7 +24465,7 @@
|
|
|
24465
24465
|
let parsedFromProps = null,
|
|
24466
24466
|
props = params.to,
|
|
24467
24467
|
from = params.from;
|
|
24468
|
-
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from), this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
|
|
24468
|
+
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from), parsedFromProps.attrOutChannel && graphic.setAttributes(parsedFromProps.attrOutChannel), this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
|
|
24469
24469
|
let totalDelay = 0;
|
|
24470
24470
|
oneByOneDelay && (totalDelay = oneByOneDelay * (count - index - 1));
|
|
24471
24471
|
const delayAfterValue = isFunction$3(delayAfter) ? delayAfter(null === (_h = null === (_g = graphic.context) || void 0 === _g ? void 0 : _g.data) || void 0 === _h ? void 0 : _h[0], graphic, {}) : delayAfter;
|
|
@@ -24528,7 +24528,7 @@
|
|
|
24528
24528
|
let parsedFromProps = null,
|
|
24529
24529
|
props = effect.to,
|
|
24530
24530
|
from = effect.from;
|
|
24531
|
-
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from);
|
|
24531
|
+
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from), parsedFromProps.attrOutChannel && graphic.setAttributes(parsedFromProps.attrOutChannel);
|
|
24532
24532
|
const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
|
|
24533
24533
|
customType = effect.custom ? effect.customType : getCustomType(custom);
|
|
24534
24534
|
this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
|
|
@@ -24547,22 +24547,31 @@
|
|
|
24547
24547
|
animate.play(customAnimate);
|
|
24548
24548
|
}
|
|
24549
24549
|
createPropsFromChannel(channel, graphic) {
|
|
24550
|
+
var _a;
|
|
24550
24551
|
const props = {};
|
|
24551
24552
|
let from = null;
|
|
24552
|
-
|
|
24553
|
-
|
|
24554
|
-
|
|
24555
|
-
|
|
24556
|
-
}
|
|
24553
|
+
if (!channel) return {
|
|
24554
|
+
from: from,
|
|
24555
|
+
props: props,
|
|
24556
|
+
attrOutChannel: null
|
|
24557
|
+
};
|
|
24558
|
+
const attrOutChannel = {};
|
|
24559
|
+
let hasAttrs = !1;
|
|
24560
|
+
const diffAttrs = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.diffAttrs;
|
|
24561
|
+
if (Array.isArray(channel) && (channel = channel.reduce((res, key) => (void 0 === diffAttrs[key] || (res[key] = {
|
|
24562
|
+
to: diffAttrs[key]
|
|
24563
|
+
}), res), {})), Object.keys(channel).forEach(key => {
|
|
24557
24564
|
var _a, _b, _c, _d;
|
|
24558
24565
|
const config = channel[key];
|
|
24559
24566
|
void 0 !== config.to && ("function" == typeof config.to ? props[key] = config.to(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {}) : props[key] = config.to), void 0 !== config.from && (from || (from = {}), "function" == typeof config.from ? from[key] = config.from(null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, {}) : from[key] = config.from);
|
|
24560
|
-
}), {
|
|
24561
|
-
|
|
24562
|
-
props
|
|
24563
|
-
}
|
|
24567
|
+
}), diffAttrs) for (const key in diffAttrs) {
|
|
24568
|
+
const value = diffAttrs[key];
|
|
24569
|
+
void 0 !== value && (props.hasOwnProperty(key) || (attrOutChannel[key] = value, hasAttrs = !0));
|
|
24570
|
+
}
|
|
24571
|
+
return {
|
|
24564
24572
|
from: from,
|
|
24565
|
-
props: props
|
|
24573
|
+
props: props,
|
|
24574
|
+
attrOutChannel: hasAttrs ? attrOutChannel : null
|
|
24566
24575
|
};
|
|
24567
24576
|
}
|
|
24568
24577
|
resolveValue(value, graphic, defaultValue) {
|
|
@@ -33712,6 +33721,8 @@
|
|
|
33712
33721
|
IconFuncTypeEnum["dropDownState"] = "dropDownState";
|
|
33713
33722
|
IconFuncTypeEnum["play"] = "play";
|
|
33714
33723
|
IconFuncTypeEnum["damagePic"] = "damagePic";
|
|
33724
|
+
IconFuncTypeEnum["imageDamagePic"] = "imageDamagePic";
|
|
33725
|
+
IconFuncTypeEnum["videoDamagePic"] = "videoDamagePic";
|
|
33715
33726
|
IconFuncTypeEnum["expand"] = "expand";
|
|
33716
33727
|
IconFuncTypeEnum["collapse"] = "collapse";
|
|
33717
33728
|
IconFuncTypeEnum["drillDown"] = "drillDown";
|
|
@@ -34911,7 +34922,7 @@
|
|
|
34911
34922
|
addEventListener(type, listener, option) {
|
|
34912
34923
|
this.on(type, listener);
|
|
34913
34924
|
}
|
|
34914
|
-
removeEventListener(type, listener) {
|
|
34925
|
+
removeEventListener(type, listener, useCapture) {
|
|
34915
34926
|
if (!this.listenersData) {
|
|
34916
34927
|
return;
|
|
34917
34928
|
}
|
|
@@ -36467,6 +36478,7 @@
|
|
|
36467
36478
|
AFTER_UPDATE_CELL_CONTENT_WIDTH: 'after_update_cell_content_width',
|
|
36468
36479
|
AFTER_UPDATE_SELECT_BORDER_HEIGHT: 'after_update_select_border_height',
|
|
36469
36480
|
CHANGE_CELL_VALUE: 'change_cell_value',
|
|
36481
|
+
CHANGE_CELL_VALUES: 'change_cell_values',
|
|
36470
36482
|
DRAG_FILL_HANDLE_END: 'drag_fill_handle_end',
|
|
36471
36483
|
MOUSEDOWN_FILL_HANDLE: 'mousedown_fill_handle',
|
|
36472
36484
|
DBLCLICK_FILL_HANDLE: 'dblclick_fill_handle',
|
|
@@ -36741,7 +36753,7 @@
|
|
|
36741
36753
|
}
|
|
36742
36754
|
delete this.listeners[id];
|
|
36743
36755
|
if (obj.target.removeEventListener) {
|
|
36744
|
-
obj.target.removeEventListener(obj.type, obj.listener,
|
|
36756
|
+
obj.target.removeEventListener(obj.type, obj.listener, obj.options?.length > 0 ? !!obj.options[0] : false);
|
|
36745
36757
|
}
|
|
36746
36758
|
}
|
|
36747
36759
|
fire(target, type, ...args) {
|
|
@@ -36775,7 +36787,7 @@
|
|
|
36775
36787
|
for (const key in this.listeners) {
|
|
36776
36788
|
const listener = this.listeners[key];
|
|
36777
36789
|
if (listener.target.removeEventListener) {
|
|
36778
|
-
listener.target.removeEventListener(listener.type, listener.listener,
|
|
36790
|
+
listener.target.removeEventListener(listener.type, listener.listener, listener.options?.length > 0 ? !!listener.options[0] : false);
|
|
36779
36791
|
}
|
|
36780
36792
|
}
|
|
36781
36793
|
for (const key in this.reseizeListeners) {
|
|
@@ -37496,6 +37508,42 @@
|
|
|
37496
37508
|
};
|
|
37497
37509
|
|
|
37498
37510
|
const themes$2 = {};
|
|
37511
|
+
function isTableTheme(theme) {
|
|
37512
|
+
return !!theme && typeof theme.getExtendTheme === 'function';
|
|
37513
|
+
}
|
|
37514
|
+
function getThemeComparableConfig(theme) {
|
|
37515
|
+
if (isTableTheme(theme)) {
|
|
37516
|
+
const extend = theme.getExtendTheme();
|
|
37517
|
+
const internal = theme
|
|
37518
|
+
.internalTheme;
|
|
37519
|
+
const superTheme = internal?.superTheme;
|
|
37520
|
+
return {
|
|
37521
|
+
name: theme.name,
|
|
37522
|
+
extend,
|
|
37523
|
+
superTheme: superTheme ? getThemeComparableConfig(superTheme) : undefined
|
|
37524
|
+
};
|
|
37525
|
+
}
|
|
37526
|
+
return theme;
|
|
37527
|
+
}
|
|
37528
|
+
function tableThemeIsChanged(prevTableTheme, newTableTheme) {
|
|
37529
|
+
if (!prevTableTheme && !newTableTheme) {
|
|
37530
|
+
return false;
|
|
37531
|
+
}
|
|
37532
|
+
if (!prevTableTheme && newTableTheme) {
|
|
37533
|
+
return true;
|
|
37534
|
+
}
|
|
37535
|
+
if (prevTableTheme && !newTableTheme) {
|
|
37536
|
+
return true;
|
|
37537
|
+
}
|
|
37538
|
+
if (prevTableTheme === newTableTheme) {
|
|
37539
|
+
return false;
|
|
37540
|
+
}
|
|
37541
|
+
const prev = prevTableTheme;
|
|
37542
|
+
const next = newTableTheme;
|
|
37543
|
+
const prevConfig = getThemeComparableConfig(prev);
|
|
37544
|
+
const newConfig = getThemeComparableConfig(next);
|
|
37545
|
+
return !isEqual(prevConfig, newConfig);
|
|
37546
|
+
}
|
|
37499
37547
|
|
|
37500
37548
|
const DEFAULTFONTSIZE = 16;
|
|
37501
37549
|
const DEFAULTFONTFAMILY = 'Arial,sans-serif';
|
|
@@ -38430,6 +38478,7 @@
|
|
|
38430
38478
|
default: themes,
|
|
38431
38479
|
get: get$5,
|
|
38432
38480
|
of: of$1,
|
|
38481
|
+
tableThemeIsChanged: tableThemeIsChanged,
|
|
38433
38482
|
theme: theme$1
|
|
38434
38483
|
});
|
|
38435
38484
|
|
|
@@ -38564,6 +38613,7 @@
|
|
|
38564
38613
|
_sourceLength;
|
|
38565
38614
|
_source;
|
|
38566
38615
|
sortedIndexMap;
|
|
38616
|
+
_forceVisibleRecords;
|
|
38567
38617
|
lastSortStates;
|
|
38568
38618
|
currentIndexedData = [];
|
|
38569
38619
|
userPagination;
|
|
@@ -38991,6 +39041,48 @@
|
|
|
38991
39041
|
}
|
|
38992
39042
|
}
|
|
38993
39043
|
}
|
|
39044
|
+
changeFieldValueByRecordIndex(value, recordIndex, field, table) {
|
|
39045
|
+
if (field === null) {
|
|
39046
|
+
return undefined;
|
|
39047
|
+
}
|
|
39048
|
+
if (recordIndex === undefined || recordIndex === null) {
|
|
39049
|
+
return;
|
|
39050
|
+
}
|
|
39051
|
+
const rawKey = recordIndex.toString();
|
|
39052
|
+
if (!this.beforeChangedRecordsMap.has(rawKey)) {
|
|
39053
|
+
const rawRecords = Array.isArray(this.dataSourceObj?.records)
|
|
39054
|
+
? this.dataSourceObj.records
|
|
39055
|
+
: null;
|
|
39056
|
+
const originRecord = rawRecords
|
|
39057
|
+
? Array.isArray(recordIndex)
|
|
39058
|
+
? getValueFromDeepArray(rawRecords, recordIndex)
|
|
39059
|
+
: rawRecords[recordIndex]
|
|
39060
|
+
: undefined;
|
|
39061
|
+
this.beforeChangedRecordsMap.set(rawKey, cloneDeep(originRecord, undefined, ['vtable_gantt_linkedFrom', 'vtable_gantt_linkedTo']) ?? {});
|
|
39062
|
+
}
|
|
39063
|
+
if (typeof field === 'string' || typeof field === 'number') {
|
|
39064
|
+
const beforeChangedValue = this.beforeChangedRecordsMap.get(rawKey)?.[field];
|
|
39065
|
+
const rawRecords = Array.isArray(this.dataSourceObj?.records)
|
|
39066
|
+
? this.dataSourceObj.records
|
|
39067
|
+
: null;
|
|
39068
|
+
const record = rawRecords
|
|
39069
|
+
? Array.isArray(recordIndex)
|
|
39070
|
+
? getValueFromDeepArray(rawRecords, recordIndex)
|
|
39071
|
+
: rawRecords[recordIndex]
|
|
39072
|
+
: undefined;
|
|
39073
|
+
let formatValue = value;
|
|
39074
|
+
if (typeof beforeChangedValue === 'number' && isAllDigits(value)) {
|
|
39075
|
+
formatValue = parseFloat(value);
|
|
39076
|
+
}
|
|
39077
|
+
if (record) {
|
|
39078
|
+
record[field] = formatValue;
|
|
39079
|
+
}
|
|
39080
|
+
else if (rawRecords && typeof recordIndex === 'number') {
|
|
39081
|
+
rawRecords[recordIndex] = this.addRecordRule === 'Array' ? [] : {};
|
|
39082
|
+
rawRecords[recordIndex][field] = formatValue;
|
|
39083
|
+
}
|
|
39084
|
+
}
|
|
39085
|
+
}
|
|
38994
39086
|
cacheBeforeChangedRecord(dataIndex, table) {
|
|
38995
39087
|
if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
|
|
38996
39088
|
const originRecord = this.getOriginalRecord(dataIndex);
|
|
@@ -39016,70 +39108,166 @@
|
|
|
39016
39108
|
}
|
|
39017
39109
|
}
|
|
39018
39110
|
}
|
|
39019
|
-
|
|
39020
|
-
|
|
39021
|
-
|
|
39022
|
-
|
|
39023
|
-
|
|
39024
|
-
|
|
39025
|
-
|
|
39026
|
-
|
|
39027
|
-
|
|
39028
|
-
|
|
39029
|
-
|
|
39030
|
-
|
|
39031
|
-
|
|
39032
|
-
|
|
39033
|
-
|
|
39034
|
-
|
|
39035
|
-
|
|
39036
|
-
|
|
39111
|
+
_getRawRecordsArray() {
|
|
39112
|
+
const rawRecords = this.dataSourceObj?.records;
|
|
39113
|
+
return Array.isArray(rawRecords) ? rawRecords : null;
|
|
39114
|
+
}
|
|
39115
|
+
_hasFilterInEffect() {
|
|
39116
|
+
return (this.dataConfig?.filterRules?.length ?? 0) >= 1 || (this.lastFilterRules?.length ?? 0) >= 1;
|
|
39117
|
+
}
|
|
39118
|
+
_normalizeInsertIndex(index, length) {
|
|
39119
|
+
if (index === undefined || index === null) {
|
|
39120
|
+
return length;
|
|
39121
|
+
}
|
|
39122
|
+
if (index > length) {
|
|
39123
|
+
return length;
|
|
39124
|
+
}
|
|
39125
|
+
if (index < 0) {
|
|
39126
|
+
return 0;
|
|
39127
|
+
}
|
|
39128
|
+
return index;
|
|
39129
|
+
}
|
|
39130
|
+
_mapViewInsertIndexToRawInsertIndex(rawRecords, viewIndex) {
|
|
39131
|
+
if (this.records.length === 0) {
|
|
39132
|
+
return rawRecords.length;
|
|
39133
|
+
}
|
|
39134
|
+
if (viewIndex <= 0) {
|
|
39135
|
+
const firstVisibleRecord = this.records[0];
|
|
39136
|
+
const rawIndex = rawRecords.indexOf(firstVisibleRecord);
|
|
39137
|
+
return rawIndex >= 0 ? rawIndex : 0;
|
|
39138
|
+
}
|
|
39139
|
+
if (viewIndex >= this.records.length) {
|
|
39140
|
+
const lastVisibleRecord = this.records[this.records.length - 1];
|
|
39141
|
+
const rawIndex = rawRecords.indexOf(lastVisibleRecord);
|
|
39142
|
+
return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
|
|
39143
|
+
}
|
|
39144
|
+
const prevRecord = this.records[viewIndex - 1];
|
|
39145
|
+
const rawIndex = rawRecords.indexOf(prevRecord);
|
|
39146
|
+
return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
|
|
39147
|
+
}
|
|
39148
|
+
_resetIndexingFromViewRecords() {
|
|
39149
|
+
this._sourceLength = this.records.length;
|
|
39150
|
+
this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);
|
|
39151
|
+
if (this.rowHierarchyType === 'tree') {
|
|
39152
|
+
this.initTreeHierarchyState();
|
|
39153
|
+
}
|
|
39154
|
+
if (this.userPagination) {
|
|
39155
|
+
this.pagination.totalCount = this._sourceLength;
|
|
39156
|
+
this.updatePagerData();
|
|
39157
|
+
return;
|
|
39158
|
+
}
|
|
39159
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
39160
|
+
this.pagination.totalCount = this._sourceLength;
|
|
39161
|
+
this.updatePagerData();
|
|
39162
|
+
}
|
|
39163
|
+
addRecord(record, index, syncToOriginalRecords = false) {
|
|
39164
|
+
if (!syncToOriginalRecords) {
|
|
39165
|
+
if (Array.isArray(this.records)) {
|
|
39166
|
+
this.records.splice(index, 0, record);
|
|
39167
|
+
this.adjustBeforeChangedRecordsMap(index, 1);
|
|
39168
|
+
this.currentIndexedData.push(this.currentIndexedData.length);
|
|
39169
|
+
this._sourceLength += 1;
|
|
39170
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) {
|
|
39171
|
+
this.fieldAggregators[i].push(record);
|
|
39172
|
+
}
|
|
39173
|
+
if (this.rowHierarchyType === 'tree') {
|
|
39174
|
+
this.initTreeHierarchyState();
|
|
39175
|
+
}
|
|
39176
|
+
if (this.userPagination) {
|
|
39177
|
+
this.pagination.totalCount = this._sourceLength;
|
|
39178
|
+
const { perPageCount, currentPage } = this.pagination;
|
|
39179
|
+
const startIndex = perPageCount * (currentPage || 0);
|
|
39180
|
+
const endIndex = startIndex + perPageCount;
|
|
39181
|
+
if (index < endIndex) {
|
|
39182
|
+
this.updatePagerData();
|
|
39183
|
+
}
|
|
39184
|
+
}
|
|
39185
|
+
else {
|
|
39186
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
39187
|
+
this.pagination.totalCount = this._sourceLength;
|
|
39037
39188
|
this.updatePagerData();
|
|
39038
39189
|
}
|
|
39190
|
+
if (this.dataSourceObj?.added) {
|
|
39191
|
+
this.dataSourceObj.added(index, 1);
|
|
39192
|
+
}
|
|
39039
39193
|
}
|
|
39040
|
-
|
|
39041
|
-
|
|
39042
|
-
|
|
39043
|
-
|
|
39044
|
-
|
|
39045
|
-
|
|
39046
|
-
|
|
39047
|
-
|
|
39194
|
+
return;
|
|
39195
|
+
}
|
|
39196
|
+
const rawRecords = this._getRawRecordsArray();
|
|
39197
|
+
if (!rawRecords) {
|
|
39198
|
+
return;
|
|
39199
|
+
}
|
|
39200
|
+
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length);
|
|
39201
|
+
const rawInsertIndex = this._hasFilterInEffect()
|
|
39202
|
+
? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex)
|
|
39203
|
+
: this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
39204
|
+
rawRecords.splice(rawInsertIndex, 0, record);
|
|
39205
|
+
if (syncToOriginalRecords && this._hasFilterInEffect()) {
|
|
39206
|
+
this.markForceVisibleRecord(record);
|
|
39207
|
+
}
|
|
39208
|
+
this.beforeChangedRecordsMap.clear();
|
|
39209
|
+
this.sortedIndexMap.clear();
|
|
39210
|
+
this.updateFilterRules(this.dataConfig?.filterRules);
|
|
39211
|
+
if (this.dataSourceObj?.added) {
|
|
39212
|
+
this.dataSourceObj.added(rawInsertIndex, 1);
|
|
39048
39213
|
}
|
|
39049
39214
|
}
|
|
39050
|
-
addRecords(recordArr, index) {
|
|
39051
|
-
if (
|
|
39052
|
-
if (Array.isArray(
|
|
39053
|
-
|
|
39054
|
-
|
|
39055
|
-
|
|
39056
|
-
|
|
39215
|
+
addRecords(recordArr, index, syncToOriginalRecords = false) {
|
|
39216
|
+
if (!syncToOriginalRecords) {
|
|
39217
|
+
if (Array.isArray(this.records)) {
|
|
39218
|
+
if (Array.isArray(recordArr)) {
|
|
39219
|
+
this.records.splice(index, 0, ...recordArr);
|
|
39220
|
+
this.adjustBeforeChangedRecordsMap(index, recordArr.length);
|
|
39221
|
+
for (let i = 0; i < recordArr.length; i++) {
|
|
39222
|
+
this.currentIndexedData.push(this.currentIndexedData.length);
|
|
39223
|
+
}
|
|
39224
|
+
this._sourceLength += recordArr.length;
|
|
39225
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) {
|
|
39226
|
+
for (let j = 0; j < recordArr.length; j++) {
|
|
39227
|
+
this.fieldAggregators[i].push(recordArr[j]);
|
|
39228
|
+
}
|
|
39229
|
+
}
|
|
39057
39230
|
}
|
|
39058
|
-
this.
|
|
39059
|
-
|
|
39060
|
-
|
|
39061
|
-
|
|
39231
|
+
if (this.userPagination) {
|
|
39232
|
+
this.pagination.totalCount = this._sourceLength;
|
|
39233
|
+
const { perPageCount, currentPage } = this.pagination;
|
|
39234
|
+
const startIndex = perPageCount * (currentPage || 0);
|
|
39235
|
+
const endIndex = startIndex + perPageCount;
|
|
39236
|
+
if (index < endIndex) {
|
|
39237
|
+
this.updatePagerData();
|
|
39062
39238
|
}
|
|
39063
39239
|
}
|
|
39064
|
-
|
|
39065
|
-
|
|
39066
|
-
|
|
39067
|
-
const { perPageCount, currentPage } = this.pagination;
|
|
39068
|
-
const startIndex = perPageCount * (currentPage || 0);
|
|
39069
|
-
const endIndex = startIndex + perPageCount;
|
|
39070
|
-
if (index < endIndex) {
|
|
39240
|
+
else {
|
|
39241
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
39242
|
+
this.pagination.totalCount = this._sourceLength;
|
|
39071
39243
|
this.updatePagerData();
|
|
39072
39244
|
}
|
|
39245
|
+
if (this.dataSourceObj?.added) {
|
|
39246
|
+
this.dataSourceObj.added(index, recordArr.length);
|
|
39247
|
+
}
|
|
39073
39248
|
}
|
|
39074
|
-
|
|
39075
|
-
|
|
39076
|
-
|
|
39077
|
-
|
|
39078
|
-
|
|
39079
|
-
|
|
39080
|
-
|
|
39249
|
+
return;
|
|
39250
|
+
}
|
|
39251
|
+
const rawRecords = this._getRawRecordsArray();
|
|
39252
|
+
if (!rawRecords || !Array.isArray(recordArr) || recordArr.length === 0) {
|
|
39253
|
+
return;
|
|
39254
|
+
}
|
|
39255
|
+
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length);
|
|
39256
|
+
const rawInsertIndex = this._hasFilterInEffect()
|
|
39257
|
+
? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex)
|
|
39258
|
+
: this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
39259
|
+
rawRecords.splice(rawInsertIndex, 0, ...recordArr);
|
|
39260
|
+
if (syncToOriginalRecords && this._hasFilterInEffect()) {
|
|
39261
|
+
for (let i = 0; i < recordArr.length; i++) {
|
|
39262
|
+
this.markForceVisibleRecord(recordArr[i]);
|
|
39081
39263
|
}
|
|
39082
39264
|
}
|
|
39265
|
+
this.beforeChangedRecordsMap.clear();
|
|
39266
|
+
this.sortedIndexMap.clear();
|
|
39267
|
+
this.updateFilterRules(this.dataConfig?.filterRules);
|
|
39268
|
+
if (this.dataSourceObj?.added) {
|
|
39269
|
+
this.dataSourceObj.added(rawInsertIndex, recordArr.length);
|
|
39270
|
+
}
|
|
39083
39271
|
}
|
|
39084
39272
|
addRecordForSorted(record) {
|
|
39085
39273
|
if (Array.isArray(this.records)) {
|
|
@@ -39112,46 +39300,84 @@
|
|
|
39112
39300
|
}
|
|
39113
39301
|
}
|
|
39114
39302
|
adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = 'add') {
|
|
39115
|
-
const
|
|
39116
|
-
|
|
39303
|
+
const delta = type === 'add' ? insertCount : -insertCount;
|
|
39304
|
+
const numericKeys = [];
|
|
39305
|
+
this.beforeChangedRecordsMap.forEach((_, key) => {
|
|
39306
|
+
const numKey = Number(key);
|
|
39307
|
+
if (Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex) {
|
|
39308
|
+
numericKeys.push(numKey);
|
|
39309
|
+
}
|
|
39310
|
+
});
|
|
39311
|
+
numericKeys.sort((a, b) => (type === 'add' ? b - a : a - b));
|
|
39312
|
+
for (let i = 0; i < numericKeys.length; i++) {
|
|
39313
|
+
const key = numericKeys[i];
|
|
39117
39314
|
const record = this.beforeChangedRecordsMap.get(key.toString());
|
|
39118
39315
|
this.beforeChangedRecordsMap.delete(key.toString());
|
|
39119
|
-
this.beforeChangedRecordsMap.set((key +
|
|
39316
|
+
this.beforeChangedRecordsMap.set((key + delta).toString(), record);
|
|
39120
39317
|
}
|
|
39121
39318
|
}
|
|
39122
|
-
deleteRecords(recordIndexs) {
|
|
39123
|
-
if (
|
|
39124
|
-
|
|
39125
|
-
|
|
39126
|
-
|
|
39127
|
-
|
|
39128
|
-
|
|
39129
|
-
|
|
39319
|
+
deleteRecords(recordIndexs, syncToOriginalRecords = false) {
|
|
39320
|
+
if (!syncToOriginalRecords) {
|
|
39321
|
+
if (Array.isArray(this.records)) {
|
|
39322
|
+
const realDeletedRecordIndexs = [];
|
|
39323
|
+
const recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
39324
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
39325
|
+
const recordIndex = recordIndexsMaxToMin[index];
|
|
39326
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) {
|
|
39327
|
+
continue;
|
|
39328
|
+
}
|
|
39329
|
+
this.adjustBeforeChangedRecordsMap(recordIndex, 1, 'delete');
|
|
39330
|
+
realDeletedRecordIndexs.push(recordIndex);
|
|
39331
|
+
const deletedRecord = this.records[recordIndex];
|
|
39332
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) {
|
|
39333
|
+
this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
39334
|
+
}
|
|
39335
|
+
this.records.splice(recordIndex, 1);
|
|
39336
|
+
this.currentIndexedData.pop();
|
|
39337
|
+
this._sourceLength -= 1;
|
|
39130
39338
|
}
|
|
39131
|
-
this.
|
|
39132
|
-
|
|
39133
|
-
const deletedRecord = this.records[recordIndex];
|
|
39134
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) {
|
|
39135
|
-
this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
39339
|
+
if (this.userPagination) {
|
|
39340
|
+
this.updatePagerData();
|
|
39136
39341
|
}
|
|
39137
|
-
|
|
39138
|
-
|
|
39139
|
-
|
|
39140
|
-
|
|
39141
|
-
|
|
39142
|
-
this.
|
|
39342
|
+
else {
|
|
39343
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
39344
|
+
this.pagination.totalCount = this._sourceLength;
|
|
39345
|
+
this.updatePagerData();
|
|
39346
|
+
}
|
|
39347
|
+
if (this.dataSourceObj?.deleted) {
|
|
39348
|
+
this.dataSourceObj.deleted(realDeletedRecordIndexs);
|
|
39349
|
+
}
|
|
39350
|
+
return realDeletedRecordIndexs;
|
|
39143
39351
|
}
|
|
39144
|
-
|
|
39145
|
-
|
|
39146
|
-
|
|
39147
|
-
|
|
39352
|
+
return [];
|
|
39353
|
+
}
|
|
39354
|
+
const rawRecords = this._getRawRecordsArray();
|
|
39355
|
+
if (!rawRecords || !Array.isArray(this.records)) {
|
|
39356
|
+
return [];
|
|
39357
|
+
}
|
|
39358
|
+
const realDeletedRecordIndexs = [];
|
|
39359
|
+
const recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a);
|
|
39360
|
+
const rawDeletedIndexs = [];
|
|
39361
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
39362
|
+
const viewIndex = recordIndexsMaxToMin[index];
|
|
39363
|
+
if (viewIndex >= this.records.length || viewIndex < 0) {
|
|
39364
|
+
continue;
|
|
39148
39365
|
}
|
|
39149
|
-
|
|
39150
|
-
|
|
39366
|
+
const deletedRecord = this.records[viewIndex];
|
|
39367
|
+
const rawIndex = rawRecords.indexOf(deletedRecord);
|
|
39368
|
+
if (rawIndex >= 0) {
|
|
39369
|
+
rawRecords.splice(rawIndex, 1);
|
|
39370
|
+
rawDeletedIndexs.push(rawIndex);
|
|
39151
39371
|
}
|
|
39152
|
-
|
|
39372
|
+
realDeletedRecordIndexs.push(viewIndex);
|
|
39153
39373
|
}
|
|
39154
|
-
|
|
39374
|
+
this.beforeChangedRecordsMap.clear();
|
|
39375
|
+
this.sortedIndexMap.clear();
|
|
39376
|
+
this.updateFilterRules(this.dataConfig?.filterRules);
|
|
39377
|
+
if (this.dataSourceObj?.deleted) {
|
|
39378
|
+
this.dataSourceObj.deleted(rawDeletedIndexs);
|
|
39379
|
+
}
|
|
39380
|
+
return realDeletedRecordIndexs;
|
|
39155
39381
|
}
|
|
39156
39382
|
deleteRecordsForSorted(recordIndexs) {
|
|
39157
39383
|
if (Array.isArray(this.records)) {
|
|
@@ -39173,36 +39399,71 @@
|
|
|
39173
39399
|
this.beforeChangedRecordsMap.clear();
|
|
39174
39400
|
}
|
|
39175
39401
|
}
|
|
39176
|
-
updateRecords(records, recordIndexs) {
|
|
39177
|
-
|
|
39402
|
+
updateRecords(records, recordIndexs, syncToOriginalRecords = false) {
|
|
39403
|
+
if (!syncToOriginalRecords) {
|
|
39404
|
+
const realDeletedRecordIndexs = [];
|
|
39405
|
+
for (let index = 0; index < recordIndexs.length; index++) {
|
|
39406
|
+
const recordIndex = recordIndexs[index];
|
|
39407
|
+
if (Array.isArray(recordIndex)) {
|
|
39408
|
+
this.beforeChangedRecordsMap.delete(recordIndex.toString());
|
|
39409
|
+
realDeletedRecordIndexs.push(recordIndex);
|
|
39410
|
+
recordIndex.slice(0, -1).reduce((acc, key) => {
|
|
39411
|
+
if (acc[key] === undefined) {
|
|
39412
|
+
acc[key] = {};
|
|
39413
|
+
}
|
|
39414
|
+
return acc[key].children;
|
|
39415
|
+
}, this.records)[recordIndex[recordIndex.length - 1]] = records[index];
|
|
39416
|
+
}
|
|
39417
|
+
else {
|
|
39418
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) {
|
|
39419
|
+
continue;
|
|
39420
|
+
}
|
|
39421
|
+
this.beforeChangedRecordsMap.delete(recordIndex.toString());
|
|
39422
|
+
realDeletedRecordIndexs.push(recordIndex);
|
|
39423
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) {
|
|
39424
|
+
this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
39425
|
+
}
|
|
39426
|
+
this.records[recordIndex] = records[index];
|
|
39427
|
+
}
|
|
39428
|
+
}
|
|
39429
|
+
if (this.userPagination) {
|
|
39430
|
+
this.updatePagerData();
|
|
39431
|
+
}
|
|
39432
|
+
return realDeletedRecordIndexs;
|
|
39433
|
+
}
|
|
39434
|
+
const rawRecords = this._getRawRecordsArray();
|
|
39435
|
+
if (!rawRecords || !Array.isArray(this.records)) {
|
|
39436
|
+
return [];
|
|
39437
|
+
}
|
|
39438
|
+
const realUpdatedIndexs = [];
|
|
39178
39439
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
39179
39440
|
const recordIndex = recordIndexs[index];
|
|
39180
39441
|
if (Array.isArray(recordIndex)) {
|
|
39181
39442
|
this.beforeChangedRecordsMap.delete(recordIndex.toString());
|
|
39182
|
-
|
|
39443
|
+
realUpdatedIndexs.push(recordIndex);
|
|
39183
39444
|
recordIndex.slice(0, -1).reduce((acc, key) => {
|
|
39184
39445
|
if (acc[key] === undefined) {
|
|
39185
39446
|
acc[key] = {};
|
|
39186
39447
|
}
|
|
39187
39448
|
return acc[key].children;
|
|
39188
|
-
},
|
|
39449
|
+
}, rawRecords)[recordIndex[recordIndex.length - 1]] = records[index];
|
|
39189
39450
|
}
|
|
39190
39451
|
else {
|
|
39191
|
-
if (recordIndex >= this.
|
|
39452
|
+
if (recordIndex >= this.records.length || recordIndex < 0) {
|
|
39192
39453
|
continue;
|
|
39193
39454
|
}
|
|
39194
|
-
this.
|
|
39195
|
-
|
|
39196
|
-
|
|
39197
|
-
|
|
39455
|
+
const oldRecord = this.records[recordIndex];
|
|
39456
|
+
const rawIndex = rawRecords.indexOf(oldRecord);
|
|
39457
|
+
if (rawIndex >= 0) {
|
|
39458
|
+
rawRecords[rawIndex] = records[index];
|
|
39198
39459
|
}
|
|
39199
|
-
|
|
39460
|
+
realUpdatedIndexs.push(recordIndex);
|
|
39200
39461
|
}
|
|
39201
39462
|
}
|
|
39202
|
-
|
|
39203
|
-
|
|
39204
|
-
|
|
39205
|
-
return
|
|
39463
|
+
this.beforeChangedRecordsMap.clear();
|
|
39464
|
+
this.sortedIndexMap.clear();
|
|
39465
|
+
this.updateFilterRules(this.dataConfig?.filterRules);
|
|
39466
|
+
return realUpdatedIndexs;
|
|
39206
39467
|
}
|
|
39207
39468
|
updateRecordsForSorted(records, recordIndexs) {
|
|
39208
39469
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
@@ -39283,7 +39544,11 @@
|
|
|
39283
39544
|
}
|
|
39284
39545
|
}
|
|
39285
39546
|
if (!filedMapArray.length) {
|
|
39286
|
-
filedMapArray = states.map(() => ({
|
|
39547
|
+
filedMapArray = states.map(() => ({
|
|
39548
|
+
asc: [],
|
|
39549
|
+
desc: [],
|
|
39550
|
+
normal: []
|
|
39551
|
+
}));
|
|
39287
39552
|
for (let index = 0; index < states.length; index++) {
|
|
39288
39553
|
this.sortedIndexMap.set(states[index].field, filedMapArray[index]);
|
|
39289
39554
|
}
|
|
@@ -39298,6 +39563,16 @@
|
|
|
39298
39563
|
setSortedIndexMap(field, filedMap) {
|
|
39299
39564
|
this.sortedIndexMap.set(field, filedMap);
|
|
39300
39565
|
}
|
|
39566
|
+
markForceVisibleRecord(record) {
|
|
39567
|
+
if (!record || (typeof record !== 'object' && typeof record !== 'function')) {
|
|
39568
|
+
return;
|
|
39569
|
+
}
|
|
39570
|
+
this._forceVisibleRecords ||= new WeakSet();
|
|
39571
|
+
this._forceVisibleRecords.add(record);
|
|
39572
|
+
}
|
|
39573
|
+
clearForceVisibleRecords() {
|
|
39574
|
+
this._forceVisibleRecords = undefined;
|
|
39575
|
+
}
|
|
39301
39576
|
clearFilteredChildren(record) {
|
|
39302
39577
|
record.filteredChildren = undefined;
|
|
39303
39578
|
for (let i = 0; i < (record.children?.length ?? 0); i++) {
|
|
@@ -39305,6 +39580,9 @@
|
|
|
39305
39580
|
}
|
|
39306
39581
|
}
|
|
39307
39582
|
filterRecord(record) {
|
|
39583
|
+
if (this._forceVisibleRecords?.has(record)) {
|
|
39584
|
+
return true;
|
|
39585
|
+
}
|
|
39308
39586
|
let isReserved = true;
|
|
39309
39587
|
for (let i = 0; i < this.dataConfig.filterRules?.length; i++) {
|
|
39310
39588
|
const filterRule = this.dataConfig?.filterRules[i];
|
|
@@ -44930,8 +45208,18 @@
|
|
|
44930
45208
|
}
|
|
44931
45209
|
image.failCallback = () => {
|
|
44932
45210
|
const regedIcons = get$2();
|
|
44933
|
-
image.image = regedIcons.
|
|
45211
|
+
image.image = regedIcons.image_damage_pic
|
|
45212
|
+
? regedIcons.image_damage_pic.svg
|
|
45213
|
+
: regedIcons.damage_pic.svg;
|
|
44934
45214
|
};
|
|
45215
|
+
if (typeof value === 'string') {
|
|
45216
|
+
if (!(value.startsWith('<svg') || isValidUrl$1(value) || value.includes('/') || isBase64$1(value))) {
|
|
45217
|
+
const regedIcons = get$2();
|
|
45218
|
+
image.image = regedIcons.image_damage_pic
|
|
45219
|
+
? regedIcons.image_damage_pic.svg
|
|
45220
|
+
: regedIcons.damage_pic.svg;
|
|
45221
|
+
}
|
|
45222
|
+
}
|
|
44935
45223
|
cellGroup.appendChild(image);
|
|
44936
45224
|
return cellGroup;
|
|
44937
45225
|
}
|
|
@@ -45141,7 +45429,9 @@
|
|
|
45141
45429
|
}
|
|
45142
45430
|
function isDamagePic(image) {
|
|
45143
45431
|
const regedIcons = get$2();
|
|
45144
|
-
return image.attribute.image === regedIcons.damage_pic.svg
|
|
45432
|
+
return (image.attribute.image === regedIcons.damage_pic.svg ||
|
|
45433
|
+
(regedIcons.image_damage_pic && image.attribute.image === regedIcons.image_damage_pic.svg) ||
|
|
45434
|
+
(regedIcons.video_damage_pic && image.attribute.image === regedIcons.video_damage_pic.svg));
|
|
45145
45435
|
}
|
|
45146
45436
|
|
|
45147
45437
|
function dealPromiseData(dataPromise, tabel, callback) {
|
|
@@ -45485,11 +45775,7 @@
|
|
|
45485
45775
|
if (!addNew && oldCellGroup.role === 'empty') {
|
|
45486
45776
|
return undefined;
|
|
45487
45777
|
}
|
|
45488
|
-
const type = isVtableMerge || isCustomMerge
|
|
45489
|
-
? 'text'
|
|
45490
|
-
: table.isHeader(col, row)
|
|
45491
|
-
? table._getHeaderLayoutMap(col, row).headerType ?? 'text'
|
|
45492
|
-
: table.getBodyColumnType(col, row) ?? 'text';
|
|
45778
|
+
const type = isVtableMerge || isCustomMerge ? 'text' : table.getCellType(col, row);
|
|
45493
45779
|
const padding = cellTheme._vtable.padding;
|
|
45494
45780
|
const textAlign = cellTheme.text.textAlign;
|
|
45495
45781
|
const textBaseline = cellTheme.text.textBaseline;
|
|
@@ -46381,9 +46667,7 @@
|
|
|
46381
46667
|
(table.isRightFrozenColumn(col) && table.isBottomFrozenRow(row)))) {
|
|
46382
46668
|
continue;
|
|
46383
46669
|
}
|
|
46384
|
-
const cellType = table.
|
|
46385
|
-
? table._getHeaderLayoutMap(col, row)?.headerType
|
|
46386
|
-
: table.getBodyColumnType(col, row);
|
|
46670
|
+
const cellType = table.getCellType(col, row);
|
|
46387
46671
|
const textHeight = computeTextHeight(col, row, cellType, table);
|
|
46388
46672
|
maxHeight = isValid$1(maxHeight) ? Math.max(textHeight, maxHeight) : textHeight;
|
|
46389
46673
|
}
|
|
@@ -46812,11 +47096,7 @@
|
|
|
46812
47096
|
cell.setAttribute('height', distHeight);
|
|
46813
47097
|
const isVtableMerge = scene.table.getCellRawRecord(col, row)?.vtableMerge;
|
|
46814
47098
|
const isCustomMerge = !!scene.table.getCustomMerge(col, row);
|
|
46815
|
-
const type = isVtableMerge || isCustomMerge
|
|
46816
|
-
? 'text'
|
|
46817
|
-
: scene.table.isHeader(col, row)
|
|
46818
|
-
? scene.table._getHeaderLayoutMap(col, row).headerType ?? 'text'
|
|
46819
|
-
: scene.table.getBodyColumnType(col, row) ?? 'text';
|
|
47099
|
+
const type = isVtableMerge || isCustomMerge ? 'text' : scene.table.getCellType(col, row);
|
|
46820
47100
|
if (type === 'progressbar') {
|
|
46821
47101
|
const columnDefine = scene.table.getBodyColumnDefine(col, row);
|
|
46822
47102
|
const style = scene.table._getCellStyle(col, row);
|
|
@@ -47155,11 +47435,7 @@
|
|
|
47155
47435
|
const autoRowHeight = scene.table.isAutoRowHeight(row);
|
|
47156
47436
|
const isVtableMerge = scene.table.getCellRawRecord(col, row)?.vtableMerge;
|
|
47157
47437
|
const isCustomMerge = !!scene.table.getCustomMerge(col, row);
|
|
47158
|
-
const type = isVtableMerge || isCustomMerge
|
|
47159
|
-
? 'text'
|
|
47160
|
-
: scene.table.isHeader(col, row)
|
|
47161
|
-
? scene.table._getHeaderLayoutMap(col, row).headerType ?? 'text'
|
|
47162
|
-
: scene.table.getBodyColumnType(col, row) ?? 'text';
|
|
47438
|
+
const type = isVtableMerge || isCustomMerge ? 'text' : scene.table.getCellType(col, row);
|
|
47163
47439
|
let isHeightChange = false;
|
|
47164
47440
|
if (type === 'progressbar') {
|
|
47165
47441
|
const columnDefine = scene.table.getBodyColumnDefine(col, row);
|
|
@@ -49150,7 +49426,9 @@
|
|
|
49150
49426
|
if (isHeader) {
|
|
49151
49427
|
const define = table.getHeaderDefine(col, row);
|
|
49152
49428
|
cellDisable = define?.disableHeaderHover;
|
|
49153
|
-
if (cellGroup.firstChild &&
|
|
49429
|
+
if (cellGroup.firstChild &&
|
|
49430
|
+
cellGroup.firstChild.name === 'axis' &&
|
|
49431
|
+
table.options.hover?.disableAxisHover) {
|
|
49154
49432
|
cellDisable = true;
|
|
49155
49433
|
}
|
|
49156
49434
|
}
|
|
@@ -52937,9 +53215,7 @@
|
|
|
52937
53215
|
maxWidth = Math.max(indicatorWidth, maxWidth);
|
|
52938
53216
|
continue;
|
|
52939
53217
|
}
|
|
52940
|
-
const cellType = table.
|
|
52941
|
-
? table._getHeaderLayoutMap(col, row)?.headerType
|
|
52942
|
-
: table.getBodyColumnType(col, row);
|
|
53218
|
+
const cellType = table.getCellType(col, row);
|
|
52943
53219
|
if (isValid$1(cellType) &&
|
|
52944
53220
|
cellType !== 'text' &&
|
|
52945
53221
|
cellType !== 'link' &&
|
|
@@ -53381,6 +53657,13 @@
|
|
|
53381
53657
|
table.internalProps._widthResizedColMap.add(cell.col);
|
|
53382
53658
|
}
|
|
53383
53659
|
}
|
|
53660
|
+
else if ((!dimensions || dimensions.length === 0) &&
|
|
53661
|
+
(table.internalProps.layoutMap.columnTree?.length ?? 0) === 0) {
|
|
53662
|
+
if (!table.internalProps._widthResizedColMap.has(table.rowHeaderLevelCount)) {
|
|
53663
|
+
table._setColWidth(table.rowHeaderLevelCount, width);
|
|
53664
|
+
table.internalProps._widthResizedColMap.add(table.rowHeaderLevelCount);
|
|
53665
|
+
}
|
|
53666
|
+
}
|
|
53384
53667
|
}
|
|
53385
53668
|
}
|
|
53386
53669
|
function _parseColumnWidthConfigForPivotRowHeader(table, columnWidthConfig) {
|
|
@@ -53502,11 +53785,7 @@
|
|
|
53502
53785
|
}
|
|
53503
53786
|
}
|
|
53504
53787
|
}
|
|
53505
|
-
const type = isVtableMerge || isCustomMerge
|
|
53506
|
-
? 'text'
|
|
53507
|
-
: (table.isHeader(col, row)
|
|
53508
|
-
? table._getHeaderLayoutMap(col, row).headerType ?? 'text'
|
|
53509
|
-
: table.getBodyColumnType(col, row)) ?? 'text';
|
|
53788
|
+
const type = isVtableMerge || isCustomMerge ? 'text' : table.getCellType(col, row);
|
|
53510
53789
|
if (isPromise(value)) {
|
|
53511
53790
|
createEmptyCellGroup(col, row, 0, y, cellWidth, cellHeight, columnGroup);
|
|
53512
53791
|
dealPromiseData(value, table, callCreateCellForPromiseValue.bind(null, {
|
|
@@ -59772,11 +60051,7 @@
|
|
|
59772
60051
|
}
|
|
59773
60052
|
updateCellContentWhileResize(col, row) {
|
|
59774
60053
|
const isVtableMerge = this.table.getCellRawRecord(col, row)?.vtableMerge;
|
|
59775
|
-
const type = isVtableMerge
|
|
59776
|
-
? 'text'
|
|
59777
|
-
: this.table.isHeader(col, row)
|
|
59778
|
-
? this.table._getHeaderLayoutMap(col, row).headerType
|
|
59779
|
-
: this.table.getBodyColumnType(col, row);
|
|
60054
|
+
const type = isVtableMerge ? 'text' : this.table.getCellType(col, row);
|
|
59780
60055
|
const cellGroup = this.getCell(col, row);
|
|
59781
60056
|
if (type === 'image' || type === 'video') {
|
|
59782
60057
|
updateImageCellContentWhileResize(cellGroup, col, row, 0, 0, this.table);
|
|
@@ -63683,15 +63958,7 @@
|
|
|
63683
63958
|
if (e.target.type === 'image' && e.target.role && e.target.role.startsWith('icon')) {
|
|
63684
63959
|
return;
|
|
63685
63960
|
}
|
|
63686
|
-
|
|
63687
|
-
if (table.internalProps.layoutMap.isHeader(col, row)) {
|
|
63688
|
-
cellType = table.isPivotTable()
|
|
63689
|
-
? table._getHeaderLayoutMap(col, row).headerType
|
|
63690
|
-
: table.getHeaderDefine(col, row).headerType;
|
|
63691
|
-
}
|
|
63692
|
-
else {
|
|
63693
|
-
cellType = table.getBodyColumnType(col, row);
|
|
63694
|
-
}
|
|
63961
|
+
const cellType = table.getCellType(col, row);
|
|
63695
63962
|
const columnDefine = table.isHeader(col, row)
|
|
63696
63963
|
? table.getHeaderDefine(col, row)
|
|
63697
63964
|
: table.getBodyColumnDefine(col, row);
|
|
@@ -63728,7 +63995,9 @@
|
|
|
63728
63995
|
}
|
|
63729
63996
|
const data = Object.assign({
|
|
63730
63997
|
__value: cellValue,
|
|
63731
|
-
__dataValue: cellOriginValue
|
|
63998
|
+
__dataValue: cellOriginValue,
|
|
63999
|
+
value: cellValue,
|
|
64000
|
+
dataValue: cellOriginValue
|
|
63732
64001
|
}, rowData);
|
|
63733
64002
|
if (isFunction$3(templateLink)) {
|
|
63734
64003
|
url = templateLink(data, col, row, table);
|
|
@@ -63782,6 +64051,7 @@
|
|
|
63782
64051
|
image.src = cellValue;
|
|
63783
64052
|
image.style.maxWidth = '80%';
|
|
63784
64053
|
image.style.maxHeight = '80%';
|
|
64054
|
+
image.style.backgroundColor = '#FFF';
|
|
63785
64055
|
overlay.appendChild(image);
|
|
63786
64056
|
document.body.appendChild(overlay);
|
|
63787
64057
|
}
|
|
@@ -64533,7 +64803,7 @@
|
|
|
64533
64803
|
}
|
|
64534
64804
|
}
|
|
64535
64805
|
const disableSelectOnContextMenu = table.options.select?.disableSelectOnContextMenu;
|
|
64536
|
-
if (!cellInRange && !disableSelectOnContextMenu) {
|
|
64806
|
+
if (!cellInRange && !disableSelectOnContextMenu && eventArgsSet?.eventArgs?.target.type !== 'chart') {
|
|
64537
64807
|
table.selectCell(col, row);
|
|
64538
64808
|
}
|
|
64539
64809
|
if (table.hasListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL)) {
|
|
@@ -65107,6 +65377,7 @@
|
|
|
65107
65377
|
selectedRanges[0].start.col === selectedRanges[0].end.col &&
|
|
65108
65378
|
selectedRanges[0].start.row === selectedRanges[0].end.row;
|
|
65109
65379
|
const editor = justOneCellSelected &&
|
|
65380
|
+
table.getEditor &&
|
|
65110
65381
|
table.getEditor(table.stateManager.select.cellPos.col, table.stateManager.select.cellPos.row);
|
|
65111
65382
|
const editorInput = editor?.getInputElement?.();
|
|
65112
65383
|
if (editorInput === relatedTarget) {
|
|
@@ -66234,6 +66505,7 @@
|
|
|
66234
66505
|
cutOperationTime = 0;
|
|
66235
66506
|
lastClipboardContent = '';
|
|
66236
66507
|
cutCellRange = null;
|
|
66508
|
+
cutRanges = null;
|
|
66237
66509
|
copySourceRange = null;
|
|
66238
66510
|
constructor(table) {
|
|
66239
66511
|
this.table = table;
|
|
@@ -66753,6 +67025,10 @@
|
|
|
66753
67025
|
this.handleCopy(e, true);
|
|
66754
67026
|
this.cutWaitPaste = true;
|
|
66755
67027
|
this.cutCellRange = this.table.getSelectedCellInfos();
|
|
67028
|
+
this.cutRanges = this.table.stateManager.select.ranges?.map(r => ({
|
|
67029
|
+
start: { col: r.start.col, row: r.start.row },
|
|
67030
|
+
end: { col: r.end.col, row: r.end.row }
|
|
67031
|
+
}));
|
|
66756
67032
|
if (this.clipboardCheckTimer) {
|
|
66757
67033
|
clearTimeout(this.clipboardCheckTimer);
|
|
66758
67034
|
}
|
|
@@ -66760,6 +67036,7 @@
|
|
|
66760
67036
|
if (this.cutWaitPaste) {
|
|
66761
67037
|
this.cutWaitPaste = false;
|
|
66762
67038
|
this.cutCellRange = null;
|
|
67039
|
+
this.cutRanges = null;
|
|
66763
67040
|
this.clipboardCheckTimer = null;
|
|
66764
67041
|
}
|
|
66765
67042
|
}, 30000);
|
|
@@ -66779,6 +67056,7 @@
|
|
|
66779
67056
|
if (this.cutWaitPaste) {
|
|
66780
67057
|
this.cutWaitPaste = false;
|
|
66781
67058
|
this.cutCellRange = null;
|
|
67059
|
+
this.cutRanges = null;
|
|
66782
67060
|
if (this.clipboardCheckTimer) {
|
|
66783
67061
|
clearTimeout(this.clipboardCheckTimer);
|
|
66784
67062
|
this.clipboardCheckTimer = null;
|
|
@@ -66894,17 +67172,11 @@
|
|
|
66894
67172
|
}
|
|
66895
67173
|
clearCutArea(table) {
|
|
66896
67174
|
try {
|
|
66897
|
-
const
|
|
66898
|
-
if (!
|
|
67175
|
+
const ranges = this.cutRanges;
|
|
67176
|
+
if (!ranges || ranges.length === 0) {
|
|
66899
67177
|
return;
|
|
66900
67178
|
}
|
|
66901
|
-
|
|
66902
|
-
for (let j = 0; j < selectCells[i].length; j++) {
|
|
66903
|
-
if (selectCells[i][j]) {
|
|
66904
|
-
table.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, undefined);
|
|
66905
|
-
}
|
|
66906
|
-
}
|
|
66907
|
-
}
|
|
67179
|
+
table.changeCellValuesByRanges(ranges, '');
|
|
66908
67180
|
}
|
|
66909
67181
|
catch (error) {
|
|
66910
67182
|
}
|
|
@@ -70472,6 +70744,15 @@
|
|
|
70472
70744
|
this.customCellStyleArrangement.push(...compacted);
|
|
70473
70745
|
this._rebuildCustomCellStyleArrangementIndex();
|
|
70474
70746
|
}
|
|
70747
|
+
clearCustomCellStyleArrangement() {
|
|
70748
|
+
this.customCellStyleArrangement = [];
|
|
70749
|
+
}
|
|
70750
|
+
addCustomCellStyleArrangement(cellPosition, customStyleId) {
|
|
70751
|
+
this.customCellStyleArrangement.push({
|
|
70752
|
+
cellPosition,
|
|
70753
|
+
customStyleId
|
|
70754
|
+
});
|
|
70755
|
+
}
|
|
70475
70756
|
getCustomCellStyle(col, row) {
|
|
70476
70757
|
const customStyleIds = this.getCustomCellStyleIds(col, row);
|
|
70477
70758
|
if (customStyleIds.length) {
|
|
@@ -70737,7 +71018,7 @@
|
|
|
70737
71018
|
layoutMap.isRightTopCorner(col, row))) {
|
|
70738
71019
|
return EMPTY_STYLE;
|
|
70739
71020
|
}
|
|
70740
|
-
const styleClass = table.internalProps.headerHelper.getStyleClass(
|
|
71021
|
+
const styleClass = table.internalProps.headerHelper.getStyleClass(table.getCellType(col, row));
|
|
70741
71022
|
if (layoutMap.isBottomFrozenRow(col, row) && table.theme.bottomFrozenStyle) {
|
|
70742
71023
|
cacheStyle = of(paddingForAxis ? { padding: paddingForAxis } : {}, table.theme.bottomFrozenStyle, {
|
|
70743
71024
|
col,
|
|
@@ -71022,6 +71303,10 @@
|
|
|
71022
71303
|
tableNoFrameHeight;
|
|
71023
71304
|
tableX;
|
|
71024
71305
|
tableY;
|
|
71306
|
+
_tableBorderWidth_left = 0;
|
|
71307
|
+
_tableBorderWidth_right = 0;
|
|
71308
|
+
_tableBorderWidth_top = 0;
|
|
71309
|
+
_tableBorderWidth_bottom = 0;
|
|
71025
71310
|
_widthMode;
|
|
71026
71311
|
_heightMode;
|
|
71027
71312
|
_autoFillWidth;
|
|
@@ -71046,7 +71331,7 @@
|
|
|
71046
71331
|
return TABLE_EVENT_TYPE;
|
|
71047
71332
|
}
|
|
71048
71333
|
options;
|
|
71049
|
-
version = "1.0.
|
|
71334
|
+
version = "1.0.33";
|
|
71050
71335
|
pagination;
|
|
71051
71336
|
id = `VTable${Date.now()}`;
|
|
71052
71337
|
headerStyleCache;
|
|
@@ -71381,12 +71666,37 @@
|
|
|
71381
71666
|
}
|
|
71382
71667
|
resize() {
|
|
71383
71668
|
this._updateSize();
|
|
71384
|
-
this.
|
|
71385
|
-
|
|
71669
|
+
const layoutOrder = this.options.componentLayoutOrder ?? ['legend', 'title'];
|
|
71670
|
+
layoutOrder.forEach(component => {
|
|
71671
|
+
if (component === 'legend') {
|
|
71672
|
+
this.internalProps.legends?.forEach(legend => {
|
|
71673
|
+
if (legend.orient === 'bottom' || legend.orient === 'right') {
|
|
71674
|
+
legend?.resize();
|
|
71675
|
+
}
|
|
71676
|
+
});
|
|
71677
|
+
}
|
|
71678
|
+
else if (component === 'title') {
|
|
71679
|
+
if (this.internalProps.title?._titleOption.orient === 'bottom' ||
|
|
71680
|
+
this.internalProps.title?._titleOption.orient === 'right') {
|
|
71681
|
+
this.internalProps.title?.resize();
|
|
71682
|
+
}
|
|
71683
|
+
}
|
|
71684
|
+
});
|
|
71685
|
+
layoutOrder.forEach(component => {
|
|
71686
|
+
if (component === 'legend') {
|
|
71687
|
+
this.internalProps.legends?.forEach(legend => {
|
|
71688
|
+
if (legend.orient === 'top' || legend.orient === 'left') {
|
|
71689
|
+
legend?.resize();
|
|
71690
|
+
}
|
|
71691
|
+
});
|
|
71692
|
+
}
|
|
71693
|
+
else if (component === 'title') {
|
|
71694
|
+
if (this.internalProps.title?._titleOption.orient === 'top' ||
|
|
71695
|
+
this.internalProps.title?._titleOption.orient === 'left') {
|
|
71696
|
+
this.internalProps.title?.resize();
|
|
71697
|
+
}
|
|
71698
|
+
}
|
|
71386
71699
|
});
|
|
71387
|
-
if (this.internalProps.title) {
|
|
71388
|
-
this.internalProps.title.resize();
|
|
71389
|
-
}
|
|
71390
71700
|
if (this.internalProps.emptyTip) {
|
|
71391
71701
|
this.internalProps.emptyTip.resize();
|
|
71392
71702
|
}
|
|
@@ -71772,6 +72082,10 @@
|
|
|
71772
72082
|
if (this.internalProps.theme?.frameStyle) {
|
|
71773
72083
|
const lineWidths = toBoxArray(this.internalProps.theme.frameStyle?.borderLineWidth ?? [null]);
|
|
71774
72084
|
const shadowWidths = toBoxArray(this.internalProps.theme.frameStyle?.shadowBlur ?? [0]);
|
|
72085
|
+
this._tableBorderWidth_left = (lineWidths[3] ?? 0) + (shadowWidths[3] ?? 0);
|
|
72086
|
+
this._tableBorderWidth_right = (lineWidths[1] ?? 0) + (shadowWidths[1] ?? 0);
|
|
72087
|
+
this._tableBorderWidth_top = (lineWidths[0] ?? 0) + (shadowWidths[0] ?? 0);
|
|
72088
|
+
this._tableBorderWidth_bottom = (lineWidths[2] ?? 0) + (shadowWidths[2] ?? 0);
|
|
71775
72089
|
if (this.theme.frameStyle?.innerBorder) {
|
|
71776
72090
|
this.tableX += this.contentOffsetX;
|
|
71777
72091
|
this.tableY += this.contentOffsetY;
|
|
@@ -71779,19 +72093,19 @@
|
|
|
71779
72093
|
this.tableNoFrameHeight = height - (shadowWidths[2] ?? 0) - this.contentOffsetY;
|
|
71780
72094
|
}
|
|
71781
72095
|
else {
|
|
71782
|
-
this.tableX +=
|
|
71783
|
-
this.tableY +=
|
|
71784
|
-
const rightBorder =
|
|
72096
|
+
this.tableX += this._tableBorderWidth_left;
|
|
72097
|
+
this.tableY += this._tableBorderWidth_top;
|
|
72098
|
+
const rightBorder = this._tableBorderWidth_right;
|
|
71785
72099
|
this.tableNoFrameWidth =
|
|
71786
72100
|
width -
|
|
71787
72101
|
(rightBorder > vScrollBarWidth ? rightBorder - vScrollBarWidth : 0) -
|
|
71788
|
-
|
|
72102
|
+
this._tableBorderWidth_left -
|
|
71789
72103
|
this.contentOffsetX;
|
|
71790
|
-
const bottomBorder =
|
|
72104
|
+
const bottomBorder = this._tableBorderWidth_bottom;
|
|
71791
72105
|
this.tableNoFrameHeight =
|
|
71792
72106
|
height -
|
|
71793
72107
|
(bottomBorder > hScrollBarWidth ? bottomBorder - hScrollBarWidth : 0) -
|
|
71794
|
-
|
|
72108
|
+
this._tableBorderWidth_top -
|
|
71795
72109
|
this.contentOffsetY;
|
|
71796
72110
|
}
|
|
71797
72111
|
}
|
|
@@ -77108,9 +77422,10 @@
|
|
|
77108
77422
|
return { addRecordRule, customDealGroupData };
|
|
77109
77423
|
}
|
|
77110
77424
|
|
|
77111
|
-
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
|
|
77425
|
+
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, noTriggerChangeCellValuesEvent) {
|
|
77112
77426
|
if ((workOnEditableCell && table.isHasEditorDefine(col, row)) || workOnEditableCell === false) {
|
|
77113
|
-
const
|
|
77427
|
+
const recordShowIndex = table.getRecordShowIndexByCell(col, row);
|
|
77428
|
+
const recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : undefined;
|
|
77114
77429
|
const { field } = table.internalProps.layoutMap.getBody(col, row);
|
|
77115
77430
|
const beforeChangeValue = table.getCellRawValue(col, row);
|
|
77116
77431
|
const oldValue = table.getCellOriginValue(col, row);
|
|
@@ -77118,7 +77433,7 @@
|
|
|
77118
77433
|
table.internalProps.layoutMap.updateColumnTitle(col, row, value);
|
|
77119
77434
|
}
|
|
77120
77435
|
else {
|
|
77121
|
-
table.dataSource.changeFieldValue(value,
|
|
77436
|
+
table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
|
|
77122
77437
|
}
|
|
77123
77438
|
const range = table.getCellRange(col, row);
|
|
77124
77439
|
const aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
@@ -77171,18 +77486,24 @@
|
|
|
77171
77486
|
}
|
|
77172
77487
|
const changedValue = table.getCellOriginValue(col, row);
|
|
77173
77488
|
if (oldValue !== changedValue && triggerEvent) {
|
|
77174
|
-
|
|
77489
|
+
const changeValue = {
|
|
77175
77490
|
col,
|
|
77176
77491
|
row,
|
|
77492
|
+
recordIndex,
|
|
77493
|
+
field,
|
|
77177
77494
|
rawValue: beforeChangeValue,
|
|
77178
77495
|
currentValue: oldValue,
|
|
77179
77496
|
changedValue
|
|
77180
|
-
}
|
|
77497
|
+
};
|
|
77498
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
|
|
77499
|
+
if (!noTriggerChangeCellValuesEvent) {
|
|
77500
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: [changeValue] });
|
|
77501
|
+
}
|
|
77181
77502
|
}
|
|
77182
77503
|
table.scenegraph.updateNextFrame();
|
|
77183
77504
|
}
|
|
77184
77505
|
}
|
|
77185
|
-
async function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
77506
|
+
async function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, noTriggerChangeCellValuesEvent) {
|
|
77186
77507
|
const changedCellResults = [];
|
|
77187
77508
|
let pasteColEnd = startCol;
|
|
77188
77509
|
let pasteRowEnd = startRow;
|
|
@@ -77209,6 +77530,7 @@
|
|
|
77209
77530
|
oldRowValues.push(oldValue);
|
|
77210
77531
|
}
|
|
77211
77532
|
}
|
|
77533
|
+
const resultChangeValues = [];
|
|
77212
77534
|
for (let i = 0; i < values.length; i++) {
|
|
77213
77535
|
if (startRow + i > table.rowCount - 1) {
|
|
77214
77536
|
break;
|
|
@@ -77248,7 +77570,8 @@
|
|
|
77248
77570
|
if (isCanChange) {
|
|
77249
77571
|
changedCellResults[i][j] = true;
|
|
77250
77572
|
const value = rowValues[j];
|
|
77251
|
-
const
|
|
77573
|
+
const recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i);
|
|
77574
|
+
const recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : undefined;
|
|
77252
77575
|
const { field } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i);
|
|
77253
77576
|
const beforeChangeValue = beforeChangeValues[i][j];
|
|
77254
77577
|
const oldValue = oldValues[i][j];
|
|
@@ -77256,17 +77579,21 @@
|
|
|
77256
77579
|
table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value);
|
|
77257
77580
|
}
|
|
77258
77581
|
else {
|
|
77259
|
-
table.dataSource.changeFieldValue(value,
|
|
77582
|
+
table.dataSource.changeFieldValue(value, recordShowIndex, field, startCol + j, startRow + i, table);
|
|
77260
77583
|
}
|
|
77261
77584
|
const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
|
|
77262
77585
|
if (oldValue !== changedValue && triggerEvent) {
|
|
77263
|
-
|
|
77586
|
+
const changeValue = {
|
|
77264
77587
|
col: startCol + j,
|
|
77265
77588
|
row: startRow + i,
|
|
77589
|
+
recordIndex,
|
|
77590
|
+
field,
|
|
77266
77591
|
rawValue: beforeChangeValue,
|
|
77267
77592
|
currentValue: oldValue,
|
|
77268
77593
|
changedValue
|
|
77269
|
-
}
|
|
77594
|
+
};
|
|
77595
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
|
|
77596
|
+
resultChangeValues.push(changeValue);
|
|
77270
77597
|
}
|
|
77271
77598
|
}
|
|
77272
77599
|
else {
|
|
@@ -77275,6 +77602,9 @@
|
|
|
77275
77602
|
}
|
|
77276
77603
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
77277
77604
|
}
|
|
77605
|
+
if (!noTriggerChangeCellValuesEvent) {
|
|
77606
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: resultChangeValues });
|
|
77607
|
+
}
|
|
77278
77608
|
const startRange = table.getCellRange(startCol, startRow);
|
|
77279
77609
|
const range = table.getCellRange(pasteColEnd, pasteRowEnd);
|
|
77280
77610
|
const aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
@@ -77347,6 +77677,68 @@
|
|
|
77347
77677
|
table.scenegraph.updateNextFrame();
|
|
77348
77678
|
return changedCellResults;
|
|
77349
77679
|
}
|
|
77680
|
+
async function listTableChangeCellValuesByRanges(ranges, value, workOnEditableCell, triggerEvent, table, noTriggerChangeCellValuesEvent) {
|
|
77681
|
+
const resultChangeValues = [];
|
|
77682
|
+
const processed = new Set();
|
|
77683
|
+
const nextValue = (value ?? '');
|
|
77684
|
+
for (let i = 0; i < (ranges?.length ?? 0); i++) {
|
|
77685
|
+
const range = ranges[i];
|
|
77686
|
+
const startCol = Math.min(range.start.col, range.end.col);
|
|
77687
|
+
const endCol = Math.max(range.start.col, range.end.col);
|
|
77688
|
+
const startRow = Math.min(range.start.row, range.end.row);
|
|
77689
|
+
const endRow = Math.max(range.start.row, range.end.row);
|
|
77690
|
+
if (startCol > endCol || startRow > endRow) {
|
|
77691
|
+
continue;
|
|
77692
|
+
}
|
|
77693
|
+
const values = [];
|
|
77694
|
+
const oldValues = [];
|
|
77695
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
77696
|
+
const rowValues = [];
|
|
77697
|
+
const rowOldValues = [];
|
|
77698
|
+
for (let col = startCol; col <= endCol; col++) {
|
|
77699
|
+
rowValues.push(nextValue);
|
|
77700
|
+
rowOldValues.push(table.getCellOriginValue(col, row));
|
|
77701
|
+
}
|
|
77702
|
+
values.push(rowValues);
|
|
77703
|
+
oldValues.push(rowOldValues);
|
|
77704
|
+
}
|
|
77705
|
+
const changedCellResults = await listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, true);
|
|
77706
|
+
for (let r = 0; r < values.length; r++) {
|
|
77707
|
+
for (let c = 0; c < values[r].length; c++) {
|
|
77708
|
+
const col = startCol + c;
|
|
77709
|
+
const row = startRow + r;
|
|
77710
|
+
const key = `${col},${row}`;
|
|
77711
|
+
if (processed.has(key)) {
|
|
77712
|
+
continue;
|
|
77713
|
+
}
|
|
77714
|
+
processed.add(key);
|
|
77715
|
+
if (!triggerEvent || !changedCellResults?.[r]?.[c]) {
|
|
77716
|
+
continue;
|
|
77717
|
+
}
|
|
77718
|
+
const oldValue = oldValues[r][c];
|
|
77719
|
+
const changedValue = table.getCellOriginValue(col, row);
|
|
77720
|
+
if (oldValue === changedValue) {
|
|
77721
|
+
continue;
|
|
77722
|
+
}
|
|
77723
|
+
const recordShowIndex = table.getRecordShowIndexByCell(col, row);
|
|
77724
|
+
const recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : undefined;
|
|
77725
|
+
const { field } = table.internalProps.layoutMap.getBody(col, row);
|
|
77726
|
+
resultChangeValues.push({
|
|
77727
|
+
col,
|
|
77728
|
+
row,
|
|
77729
|
+
recordIndex,
|
|
77730
|
+
field,
|
|
77731
|
+
rawValue: oldValue,
|
|
77732
|
+
currentValue: oldValue,
|
|
77733
|
+
changedValue
|
|
77734
|
+
});
|
|
77735
|
+
}
|
|
77736
|
+
}
|
|
77737
|
+
}
|
|
77738
|
+
if (!noTriggerChangeCellValuesEvent && triggerEvent) {
|
|
77739
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: resultChangeValues });
|
|
77740
|
+
}
|
|
77741
|
+
}
|
|
77350
77742
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
77351
77743
|
if (oldCellUpdateType === 'group') {
|
|
77352
77744
|
return oldCellUpdateType;
|
|
@@ -77400,7 +77792,13 @@
|
|
|
77400
77792
|
table.scenegraph.createSceneGraph();
|
|
77401
77793
|
}
|
|
77402
77794
|
else if (table.sortState) {
|
|
77403
|
-
table.
|
|
77795
|
+
const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
|
|
77796
|
+
if (syncToOriginalRecords) {
|
|
77797
|
+
table.dataSource.addRecord(record, table.dataSource.records.length, true);
|
|
77798
|
+
}
|
|
77799
|
+
else {
|
|
77800
|
+
table.dataSource.addRecordForSorted(record);
|
|
77801
|
+
}
|
|
77404
77802
|
table.stateManager.checkedState.clear();
|
|
77405
77803
|
sortRecords(table);
|
|
77406
77804
|
table.refreshRowColCount();
|
|
@@ -77413,8 +77811,16 @@
|
|
|
77413
77811
|
recordIndex = table.dataSource.sourceLength;
|
|
77414
77812
|
}
|
|
77415
77813
|
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
77416
|
-
table.
|
|
77814
|
+
const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
|
|
77815
|
+
table.dataSource.addRecord(record, recordIndex, syncToOriginalRecords);
|
|
77417
77816
|
adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
|
|
77817
|
+
if (syncToOriginalRecords) {
|
|
77818
|
+
table.refreshRowColCount();
|
|
77819
|
+
table.internalProps.layoutMap.clearCellRangeMap();
|
|
77820
|
+
table.scenegraph.clearCells();
|
|
77821
|
+
table.scenegraph.createSceneGraph();
|
|
77822
|
+
return true;
|
|
77823
|
+
}
|
|
77418
77824
|
const oldRowCount = table.rowCount;
|
|
77419
77825
|
table.refreshRowColCount();
|
|
77420
77826
|
if (table.scenegraph.proxy.totalActualBodyRowCount === 0) {
|
|
@@ -77526,7 +77932,13 @@
|
|
|
77526
77932
|
table.scenegraph.createSceneGraph();
|
|
77527
77933
|
}
|
|
77528
77934
|
else if (table.sortState) {
|
|
77529
|
-
table.
|
|
77935
|
+
const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
|
|
77936
|
+
if (syncToOriginalRecords) {
|
|
77937
|
+
table.dataSource.addRecords(records, table.dataSource.records.length, true);
|
|
77938
|
+
}
|
|
77939
|
+
else {
|
|
77940
|
+
table.dataSource.addRecordsForSorted(records);
|
|
77941
|
+
}
|
|
77530
77942
|
sortRecords(table);
|
|
77531
77943
|
table.refreshRowColCount();
|
|
77532
77944
|
table.scenegraph.clearCells();
|
|
@@ -77541,8 +77953,16 @@
|
|
|
77541
77953
|
recordIndex = 0;
|
|
77542
77954
|
}
|
|
77543
77955
|
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
77544
|
-
table.
|
|
77956
|
+
const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
|
|
77957
|
+
table.dataSource.addRecords(records, recordIndex, syncToOriginalRecords);
|
|
77545
77958
|
adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
|
|
77959
|
+
if (syncToOriginalRecords) {
|
|
77960
|
+
table.refreshRowColCount();
|
|
77961
|
+
table.internalProps.layoutMap.clearCellRangeMap();
|
|
77962
|
+
table.scenegraph.clearCells();
|
|
77963
|
+
table.scenegraph.createSceneGraph();
|
|
77964
|
+
return true;
|
|
77965
|
+
}
|
|
77546
77966
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
77547
77967
|
table.refreshRowColCount();
|
|
77548
77968
|
if (table.scenegraph.proxy.totalActualBodyRowCount === 0) {
|
|
@@ -77658,20 +78078,34 @@
|
|
|
77658
78078
|
table.scenegraph.createSceneGraph();
|
|
77659
78079
|
}
|
|
77660
78080
|
else if (table.sortState) {
|
|
77661
|
-
table.
|
|
78081
|
+
const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
|
|
78082
|
+
if (syncToOriginalRecords) {
|
|
78083
|
+
table.dataSource.deleteRecords(recordIndexs, true);
|
|
78084
|
+
}
|
|
78085
|
+
else {
|
|
78086
|
+
table.dataSource.deleteRecordsForSorted(recordIndexs);
|
|
78087
|
+
}
|
|
77662
78088
|
sortRecords(table);
|
|
77663
78089
|
table.refreshRowColCount();
|
|
77664
78090
|
table.scenegraph.clearCells();
|
|
77665
78091
|
table.scenegraph.createSceneGraph();
|
|
77666
78092
|
}
|
|
77667
78093
|
else {
|
|
77668
|
-
const
|
|
78094
|
+
const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
|
|
78095
|
+
const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
|
|
77669
78096
|
if (deletedRecordIndexs.length === 0) {
|
|
77670
78097
|
return;
|
|
77671
78098
|
}
|
|
77672
78099
|
for (let index = 0; index < deletedRecordIndexs.length; index++) {
|
|
77673
78100
|
adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
77674
78101
|
}
|
|
78102
|
+
if (syncToOriginalRecords) {
|
|
78103
|
+
table.refreshRowColCount();
|
|
78104
|
+
table.internalProps.layoutMap.clearCellRangeMap();
|
|
78105
|
+
table.scenegraph.clearCells();
|
|
78106
|
+
table.scenegraph.createSceneGraph();
|
|
78107
|
+
return;
|
|
78108
|
+
}
|
|
77675
78109
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
77676
78110
|
table.refreshRowColCount();
|
|
77677
78111
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -77789,18 +78223,32 @@
|
|
|
77789
78223
|
table.scenegraph.createSceneGraph();
|
|
77790
78224
|
}
|
|
77791
78225
|
else if (table.sortState) {
|
|
77792
|
-
table.
|
|
78226
|
+
const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
|
|
78227
|
+
if (syncToOriginalRecords) {
|
|
78228
|
+
table.dataSource.updateRecords(records, recordIndexs, true);
|
|
78229
|
+
}
|
|
78230
|
+
else {
|
|
78231
|
+
table.dataSource.updateRecordsForSorted(records, recordIndexs);
|
|
78232
|
+
}
|
|
77793
78233
|
sortRecords(table);
|
|
77794
78234
|
table.refreshRowColCount();
|
|
77795
78235
|
table.scenegraph.clearCells();
|
|
77796
78236
|
table.scenegraph.createSceneGraph();
|
|
77797
78237
|
}
|
|
77798
78238
|
else {
|
|
77799
|
-
const
|
|
78239
|
+
const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
|
|
78240
|
+
const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
|
|
77800
78241
|
if (updateRecordIndexs.length === 0) {
|
|
77801
78242
|
return;
|
|
77802
78243
|
}
|
|
77803
|
-
|
|
78244
|
+
if (syncToOriginalRecords) {
|
|
78245
|
+
table.refreshRowColCount();
|
|
78246
|
+
table.internalProps.layoutMap.clearCellRangeMap();
|
|
78247
|
+
table.scenegraph.clearCells();
|
|
78248
|
+
table.scenegraph.createSceneGraph();
|
|
78249
|
+
return;
|
|
78250
|
+
}
|
|
78251
|
+
const bodyRowIndex = updateRecordIndexs.map((index) => table.getBodyRowIndexByRecordIndex(index));
|
|
77804
78252
|
const recordIndexsMinToMax = bodyRowIndex.sort((a, b) => a - b);
|
|
77805
78253
|
if (table.pagination) {
|
|
77806
78254
|
const { perPageCount, currentPage } = table.pagination;
|
|
@@ -78175,11 +78623,11 @@
|
|
|
78175
78623
|
const ListTreeStickCellPlugin = Factory.getComponent('listTreeStickCellPlugin');
|
|
78176
78624
|
this.listTreeStickCellPlugin = new ListTreeStickCellPlugin(this);
|
|
78177
78625
|
}
|
|
78626
|
+
this.resize();
|
|
78178
78627
|
setTimeout(() => {
|
|
78179
78628
|
if (this.isReleased) {
|
|
78180
78629
|
return;
|
|
78181
78630
|
}
|
|
78182
|
-
this.resize();
|
|
78183
78631
|
this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
78184
78632
|
}, 0);
|
|
78185
78633
|
}
|
|
@@ -78575,7 +79023,6 @@
|
|
|
78575
79023
|
if (options.title) {
|
|
78576
79024
|
const Title = Factory.getComponent('title');
|
|
78577
79025
|
internalProps.title = new Title(options.title, this);
|
|
78578
|
-
this.scenegraph.resize();
|
|
78579
79026
|
}
|
|
78580
79027
|
if (this.options.emptyTip) {
|
|
78581
79028
|
if (this.internalProps.emptyTip) {
|
|
@@ -78588,6 +79035,7 @@
|
|
|
78588
79035
|
}
|
|
78589
79036
|
}
|
|
78590
79037
|
this.pluginManager.updatePlugins(options.plugins);
|
|
79038
|
+
this.resize();
|
|
78591
79039
|
setTimeout(() => {
|
|
78592
79040
|
this.fireListeners(TABLE_EVENT_TYPE.UPDATED, null);
|
|
78593
79041
|
}, 0);
|
|
@@ -78977,6 +79425,7 @@
|
|
|
78977
79425
|
}
|
|
78978
79426
|
updateFilterRules(filterRules, options = { clearRowHeightCache: true }) {
|
|
78979
79427
|
this.scenegraph.clearCells();
|
|
79428
|
+
this.dataSource.clearForceVisibleRecords?.();
|
|
78980
79429
|
if (this.sortState) {
|
|
78981
79430
|
this.dataSource.updateFilterRulesForSorted(filterRules);
|
|
78982
79431
|
sortRecords(this);
|
|
@@ -79107,9 +79556,17 @@
|
|
|
79107
79556
|
this.scenegraph.createSceneGraph();
|
|
79108
79557
|
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
79109
79558
|
this._updateSize();
|
|
79110
|
-
|
|
79111
|
-
|
|
79112
|
-
|
|
79559
|
+
const layoutOrder = this.options.componentLayoutOrder ?? ['legend', 'title'];
|
|
79560
|
+
layoutOrder.forEach(component => {
|
|
79561
|
+
if (component === 'legend') {
|
|
79562
|
+
this.internalProps.legends?.forEach(legend => {
|
|
79563
|
+
legend?.resize();
|
|
79564
|
+
});
|
|
79565
|
+
}
|
|
79566
|
+
else if (component === 'title') {
|
|
79567
|
+
this.internalProps.title?.resize();
|
|
79568
|
+
}
|
|
79569
|
+
});
|
|
79113
79570
|
this.scenegraph.resize();
|
|
79114
79571
|
if (this.options.emptyTip) {
|
|
79115
79572
|
if (this.internalProps.emptyTip) {
|
|
@@ -79200,17 +79657,182 @@
|
|
|
79200
79657
|
}
|
|
79201
79658
|
return isValid$1(editorDefine);
|
|
79202
79659
|
}
|
|
79203
|
-
changeCellValue(col, row, value, workOnEditableCell = false, triggerEvent = true) {
|
|
79204
|
-
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
|
|
79660
|
+
changeCellValue(col, row, value, workOnEditableCell = false, triggerEvent = true, noTriggerChangeCellValuesEvent) {
|
|
79661
|
+
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, noTriggerChangeCellValuesEvent);
|
|
79205
79662
|
}
|
|
79206
|
-
changeCellValues(startCol, startRow, values, workOnEditableCell = false, triggerEvent = true) {
|
|
79207
|
-
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
|
|
79663
|
+
changeCellValues(startCol, startRow, values, workOnEditableCell = false, triggerEvent = true, noTriggerChangeCellValuesEvent) {
|
|
79664
|
+
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, noTriggerChangeCellValuesEvent);
|
|
79208
79665
|
}
|
|
79209
|
-
|
|
79666
|
+
changeCellValuesByRanges(ranges, value, workOnEditableCell = false, triggerEvent = true, noTriggerChangeCellValuesEvent) {
|
|
79667
|
+
return listTableChangeCellValuesByRanges(ranges, value, workOnEditableCell, triggerEvent, this, noTriggerChangeCellValuesEvent);
|
|
79668
|
+
}
|
|
79669
|
+
changeSourceCellValue(recordIndex, field, value) {
|
|
79670
|
+
const tableIndex = this.getTableIndexByRecordIndex(recordIndex);
|
|
79671
|
+
const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
|
|
79672
|
+
if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) {
|
|
79673
|
+
return;
|
|
79674
|
+
}
|
|
79675
|
+
this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
|
|
79676
|
+
const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row);
|
|
79677
|
+
const oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
|
|
79678
|
+
const changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
|
|
79679
|
+
if (oldValue !== changedValue) {
|
|
79680
|
+
const changeValue = {
|
|
79681
|
+
col: cellAddr.col,
|
|
79682
|
+
row: cellAddr.row,
|
|
79683
|
+
recordIndex,
|
|
79684
|
+
field,
|
|
79685
|
+
rawValue: beforeChangeValue,
|
|
79686
|
+
currentValue: oldValue,
|
|
79687
|
+
changedValue
|
|
79688
|
+
};
|
|
79689
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
|
|
79690
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: [changeValue] });
|
|
79691
|
+
}
|
|
79692
|
+
}
|
|
79693
|
+
changeCellValueByRecord(recordIndex, field, value, options) {
|
|
79694
|
+
const triggerEvent = options?.triggerEvent ?? true;
|
|
79695
|
+
const noTriggerChangeCellValuesEvent = options?.noTriggerChangeCellValuesEvent;
|
|
79696
|
+
const autoRefresh = options?.autoRefresh ?? true;
|
|
79697
|
+
const records = this.dataSource.dataSourceObj?.records;
|
|
79698
|
+
let record;
|
|
79699
|
+
let oldValue;
|
|
79700
|
+
if (Array.isArray(records) && (typeof field === 'string' || typeof field === 'number')) {
|
|
79701
|
+
record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex];
|
|
79702
|
+
oldValue = record?.[field];
|
|
79703
|
+
}
|
|
79704
|
+
this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this);
|
|
79705
|
+
if (!triggerEvent) {
|
|
79706
|
+
return;
|
|
79707
|
+
}
|
|
79708
|
+
const changedValue = record && (typeof field === 'string' || typeof field === 'number') ? record?.[field] : value;
|
|
79709
|
+
if (oldValue !== changedValue) {
|
|
79710
|
+
const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
|
|
79711
|
+
const changeValue = {
|
|
79712
|
+
col: cellAddr?.col ?? -1,
|
|
79713
|
+
row: cellAddr?.row ?? -1,
|
|
79714
|
+
recordIndex,
|
|
79715
|
+
field,
|
|
79716
|
+
rawValue: oldValue,
|
|
79717
|
+
currentValue: oldValue,
|
|
79718
|
+
changedValue
|
|
79719
|
+
};
|
|
79720
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
|
|
79721
|
+
if (!noTriggerChangeCellValuesEvent) {
|
|
79722
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: [changeValue] });
|
|
79723
|
+
}
|
|
79724
|
+
}
|
|
79725
|
+
if (autoRefresh) {
|
|
79726
|
+
this.refreshAfterSourceChange();
|
|
79727
|
+
}
|
|
79728
|
+
}
|
|
79729
|
+
changeCellValueBySource(recordIndex, field, value, triggerEvent = true, noTriggerChangeCellValuesEvent) {
|
|
79730
|
+
return this.changeCellValueByRecord(recordIndex, field, value, {
|
|
79731
|
+
triggerEvent,
|
|
79732
|
+
noTriggerChangeCellValuesEvent,
|
|
79733
|
+
autoRefresh: true
|
|
79734
|
+
});
|
|
79735
|
+
}
|
|
79736
|
+
changeCellValuesByRecords(changeValues, options) {
|
|
79737
|
+
const triggerEvent = options?.triggerEvent ?? true;
|
|
79738
|
+
const noTriggerChangeCellValuesEvent = options?.noTriggerChangeCellValuesEvent;
|
|
79739
|
+
const autoRefresh = options?.autoRefresh ?? true;
|
|
79740
|
+
const resultChangeValues = [];
|
|
79741
|
+
for (let i = 0; i < changeValues.length; i++) {
|
|
79742
|
+
const { recordIndex, field, value } = changeValues[i];
|
|
79743
|
+
const records = this.dataSource.dataSourceObj?.records;
|
|
79744
|
+
let record;
|
|
79745
|
+
let oldValue;
|
|
79746
|
+
if (Array.isArray(records) && (typeof field === 'string' || typeof field === 'number')) {
|
|
79747
|
+
record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex];
|
|
79748
|
+
oldValue = record?.[field];
|
|
79749
|
+
}
|
|
79750
|
+
this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this);
|
|
79751
|
+
if (triggerEvent) {
|
|
79752
|
+
const changedValue = record && (typeof field === 'string' || typeof field === 'number') ? record?.[field] : value;
|
|
79753
|
+
if (oldValue !== changedValue) {
|
|
79754
|
+
const changeValue = {
|
|
79755
|
+
col: (this.getCellAddrByFieldRecord(field, recordIndex)?.col ?? -1),
|
|
79756
|
+
row: (this.getCellAddrByFieldRecord(field, recordIndex)?.row ?? -1),
|
|
79757
|
+
recordIndex,
|
|
79758
|
+
field,
|
|
79759
|
+
rawValue: oldValue,
|
|
79760
|
+
currentValue: oldValue,
|
|
79761
|
+
changedValue
|
|
79762
|
+
};
|
|
79763
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
|
|
79764
|
+
resultChangeValues.push(changeValue);
|
|
79765
|
+
}
|
|
79766
|
+
}
|
|
79767
|
+
}
|
|
79768
|
+
if (!noTriggerChangeCellValuesEvent && resultChangeValues.length && triggerEvent) {
|
|
79769
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: resultChangeValues });
|
|
79770
|
+
}
|
|
79771
|
+
if (autoRefresh) {
|
|
79772
|
+
this.refreshAfterSourceChange();
|
|
79773
|
+
}
|
|
79774
|
+
}
|
|
79775
|
+
changeCellValuesBySource(changeValues, triggerEvent = true, noTriggerChangeCellValuesEvent) {
|
|
79776
|
+
return this.changeCellValuesByRecords(changeValues, {
|
|
79777
|
+
triggerEvent,
|
|
79778
|
+
noTriggerChangeCellValuesEvent,
|
|
79779
|
+
autoRefresh: true
|
|
79780
|
+
});
|
|
79781
|
+
}
|
|
79782
|
+
refreshAfterSourceChange(options) {
|
|
79783
|
+
const reapplyFilter = options?.reapplyFilter ?? true;
|
|
79784
|
+
const reapplySort = options?.reapplySort ?? true;
|
|
79785
|
+
const clearRowHeightCache = options?.clearRowHeightCache ?? true;
|
|
79786
|
+
this.scenegraph.clearCells();
|
|
79787
|
+
if (this.sortState && reapplySort) {
|
|
79788
|
+
this.dataSource.clearSortedIndexMap?.();
|
|
79789
|
+
this.dataSource.sortedIndexMap?.clear?.();
|
|
79790
|
+
}
|
|
79791
|
+
if (reapplyFilter) {
|
|
79792
|
+
if (this.sortState && reapplySort) {
|
|
79793
|
+
this.dataSource.updateFilterRulesForSorted(this.dataSource.dataConfig?.filterRules);
|
|
79794
|
+
sortRecords(this);
|
|
79795
|
+
}
|
|
79796
|
+
else {
|
|
79797
|
+
this.dataSource.updateFilterRules(this.dataSource.dataConfig?.filterRules);
|
|
79798
|
+
}
|
|
79799
|
+
}
|
|
79800
|
+
else if (this.sortState && reapplySort) {
|
|
79801
|
+
sortRecords(this);
|
|
79802
|
+
}
|
|
79803
|
+
const traverseColumns = (columns) => {
|
|
79804
|
+
for (let i = 0; i < (columns?.length ?? 0); i++) {
|
|
79805
|
+
const column = columns[i];
|
|
79806
|
+
const aggregators = column?.vtable_aggregator;
|
|
79807
|
+
if (aggregators) {
|
|
79808
|
+
if (Array.isArray(aggregators)) {
|
|
79809
|
+
for (let j = 0; j < aggregators.length; j++) {
|
|
79810
|
+
aggregators[j]?.recalculate?.();
|
|
79811
|
+
}
|
|
79812
|
+
}
|
|
79813
|
+
else {
|
|
79814
|
+
aggregators?.recalculate?.();
|
|
79815
|
+
}
|
|
79816
|
+
}
|
|
79817
|
+
if (column?.columns) {
|
|
79818
|
+
traverseColumns(column.columns);
|
|
79819
|
+
}
|
|
79820
|
+
}
|
|
79821
|
+
};
|
|
79822
|
+
traverseColumns(this.internalProps.columns);
|
|
79823
|
+
this.refreshRowColCount();
|
|
79824
|
+
this.internalProps.layoutMap.clearCellRangeMap();
|
|
79825
|
+
this.internalProps.useOneRowHeightFillAll = false;
|
|
79826
|
+
this.stateManager.initCheckedState(this.records);
|
|
79827
|
+
this.scenegraph.createSceneGraph(!clearRowHeightCache);
|
|
79828
|
+
this.internalProps.emptyTip?.resetVisible();
|
|
79829
|
+
this.resize();
|
|
79830
|
+
}
|
|
79831
|
+
addRecord(record, recordIndex, triggerEvent = true) {
|
|
79210
79832
|
const success = listTableAddRecord(record, recordIndex, this);
|
|
79211
79833
|
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]);
|
|
79212
79834
|
this.internalProps.emptyTip?.resetVisible();
|
|
79213
|
-
if (success) {
|
|
79835
|
+
if (triggerEvent && success) {
|
|
79214
79836
|
this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
79215
79837
|
records: [record],
|
|
79216
79838
|
recordIndex,
|
|
@@ -79218,13 +79840,13 @@
|
|
|
79218
79840
|
});
|
|
79219
79841
|
}
|
|
79220
79842
|
}
|
|
79221
|
-
addRecords(records, recordIndex) {
|
|
79843
|
+
addRecords(records, recordIndex, triggerEvent = true) {
|
|
79222
79844
|
const success = listTableAddRecords(records, recordIndex, this);
|
|
79223
79845
|
if (typeof recordIndex === 'number') {
|
|
79224
79846
|
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records);
|
|
79225
79847
|
}
|
|
79226
79848
|
this.internalProps.emptyTip?.resetVisible();
|
|
79227
|
-
if (success) {
|
|
79849
|
+
if (triggerEvent && success) {
|
|
79228
79850
|
this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
79229
79851
|
records,
|
|
79230
79852
|
recordIndex,
|
|
@@ -79232,7 +79854,20 @@
|
|
|
79232
79854
|
});
|
|
79233
79855
|
}
|
|
79234
79856
|
}
|
|
79235
|
-
deleteRecords(recordIndexs) {
|
|
79857
|
+
deleteRecords(recordIndexs, triggerEvent = true) {
|
|
79858
|
+
const deletedRecords = [];
|
|
79859
|
+
if (recordIndexs?.length > 0) {
|
|
79860
|
+
recordIndexs.forEach(index => {
|
|
79861
|
+
let record = null;
|
|
79862
|
+
if (typeof index === 'number') {
|
|
79863
|
+
record = this.dataSource.get(index);
|
|
79864
|
+
}
|
|
79865
|
+
else {
|
|
79866
|
+
record = [];
|
|
79867
|
+
}
|
|
79868
|
+
deletedRecords.push(record);
|
|
79869
|
+
});
|
|
79870
|
+
}
|
|
79236
79871
|
listTableDeleteRecords(recordIndexs, this);
|
|
79237
79872
|
adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs);
|
|
79238
79873
|
this.internalProps.emptyTip?.resetVisible();
|
|
@@ -79240,21 +79875,26 @@
|
|
|
79240
79875
|
for (let i = 0; i < recordIndexs.length; i++) {
|
|
79241
79876
|
rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
|
|
79242
79877
|
}
|
|
79243
|
-
|
|
79244
|
-
|
|
79245
|
-
|
|
79246
|
-
|
|
79247
|
-
|
|
79248
|
-
: recordIndexs
|
|
79249
|
-
|
|
79878
|
+
if (triggerEvent) {
|
|
79879
|
+
this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
79880
|
+
recordIndexs,
|
|
79881
|
+
records: deletedRecords,
|
|
79882
|
+
rowIndexs,
|
|
79883
|
+
deletedCount: Array.isArray(recordIndexs[0])
|
|
79884
|
+
? recordIndexs.length
|
|
79885
|
+
: recordIndexs.length
|
|
79886
|
+
});
|
|
79887
|
+
}
|
|
79250
79888
|
}
|
|
79251
|
-
updateRecords(records, recordIndexs) {
|
|
79889
|
+
updateRecords(records, recordIndexs, triggerEvent = true) {
|
|
79252
79890
|
listTableUpdateRecords(records, recordIndexs, this);
|
|
79253
|
-
|
|
79254
|
-
|
|
79255
|
-
|
|
79256
|
-
|
|
79257
|
-
|
|
79891
|
+
if (triggerEvent) {
|
|
79892
|
+
this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
79893
|
+
records,
|
|
79894
|
+
recordIndexs,
|
|
79895
|
+
updateCount: records.length
|
|
79896
|
+
});
|
|
79897
|
+
}
|
|
79258
79898
|
}
|
|
79259
79899
|
_hasCustomRenderOrLayout() {
|
|
79260
79900
|
const { headerObjects } = this.internalProps.layoutMap;
|
|
@@ -80663,22 +81303,22 @@
|
|
|
80663
81303
|
let x = 0;
|
|
80664
81304
|
let y = 0;
|
|
80665
81305
|
if (this.orient === 'left') {
|
|
80666
|
-
x = padding[3];
|
|
80667
|
-
y = 0;
|
|
81306
|
+
x = padding[3] + this.table.tableX - this.table._tableBorderWidth_left;
|
|
81307
|
+
y = 0 + this.table.tableY - this.table._tableBorderWidth_top;
|
|
80668
81308
|
width += padding[1] + padding[3];
|
|
80669
81309
|
}
|
|
80670
81310
|
else if (this.orient === 'top') {
|
|
80671
|
-
x = 0;
|
|
80672
|
-
y = padding[0];
|
|
81311
|
+
x = 0 + this.table.tableX - this.table._tableBorderWidth_left;
|
|
81312
|
+
y = padding[0] + this.table.tableY - this.table._tableBorderWidth_top;
|
|
80673
81313
|
height += padding[0] + padding[2];
|
|
80674
81314
|
}
|
|
80675
81315
|
else if (this.orient === 'right') {
|
|
80676
81316
|
x = rectWidth - width - padding[1];
|
|
80677
|
-
y = 0;
|
|
81317
|
+
y = 0 + this.table.tableY - this.table._tableBorderWidth_top;
|
|
80678
81318
|
width += padding[1] + padding[3];
|
|
80679
81319
|
}
|
|
80680
81320
|
else if (this.orient === 'bottom') {
|
|
80681
|
-
x = 0;
|
|
81321
|
+
x = 0 + this.table.tableX - this.table._tableBorderWidth_left;
|
|
80682
81322
|
y = rectHeight - height - padding[2];
|
|
80683
81323
|
height += padding[0] + padding[2];
|
|
80684
81324
|
}
|
|
@@ -80985,22 +81625,22 @@
|
|
|
80985
81625
|
let x = 0;
|
|
80986
81626
|
let y = 0;
|
|
80987
81627
|
if (this.orient === 'left') {
|
|
80988
|
-
x = padding[3];
|
|
80989
|
-
y = 0;
|
|
81628
|
+
x = padding[3] + this.table.tableX - this.table._tableBorderWidth_left;
|
|
81629
|
+
y = 0 + this.table.tableY - this.table._tableBorderWidth_top;
|
|
80990
81630
|
width += padding[1] + padding[3];
|
|
80991
81631
|
}
|
|
80992
81632
|
else if (this.orient === 'top') {
|
|
80993
|
-
x = 0;
|
|
80994
|
-
y = padding[0];
|
|
81633
|
+
x = 0 + this.table.tableX - this.table._tableBorderWidth_left;
|
|
81634
|
+
y = padding[0] + this.table.tableY - this.table._tableBorderWidth_top;
|
|
80995
81635
|
height += padding[0] + padding[2];
|
|
80996
81636
|
}
|
|
80997
81637
|
else if (this.orient === 'right') {
|
|
80998
81638
|
x = rectWidth - width - padding[1];
|
|
80999
|
-
y = 0;
|
|
81639
|
+
y = 0 + this.table.tableY - this.table._tableBorderWidth_top;
|
|
81000
81640
|
width += padding[1] + padding[3];
|
|
81001
81641
|
}
|
|
81002
81642
|
else if (this.orient === 'bottom') {
|
|
81003
|
-
x = 0;
|
|
81643
|
+
x = 0 + this.table.tableX - this.table._tableBorderWidth_left;
|
|
81004
81644
|
y = rectHeight - height - padding[2];
|
|
81005
81645
|
height += padding[0] + padding[2];
|
|
81006
81646
|
}
|
|
@@ -81583,11 +82223,13 @@
|
|
|
81583
82223
|
padding[2];
|
|
81584
82224
|
this._titleComponent.setAttributes({
|
|
81585
82225
|
x: this._titleOption.x ?? this._titleOption.orient === 'right'
|
|
81586
|
-
? this.table.tableX +
|
|
81587
|
-
|
|
82226
|
+
? this.table.tableX +
|
|
82227
|
+
Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) -
|
|
82228
|
+
this.table._tableBorderWidth_left
|
|
82229
|
+
: this.table.tableX - this.table._tableBorderWidth_left,
|
|
81588
82230
|
y: this._titleOption.y ?? this._titleOption.orient === 'bottom'
|
|
81589
|
-
? this.table.tableY + this.table.tableNoFrameHeight
|
|
81590
|
-
: this.table.tableY,
|
|
82231
|
+
? this.table.tableY + this.table.tableNoFrameHeight - this.table._tableBorderWidth_top
|
|
82232
|
+
: this.table.tableY - this.table._tableBorderWidth_top,
|
|
81591
82233
|
width: this._titleOption.orient === 'top' || this._titleOption.orient === 'bottom'
|
|
81592
82234
|
? realWidth
|
|
81593
82235
|
: this._titleOption.width,
|
|
@@ -81650,11 +82292,13 @@
|
|
|
81650
82292
|
text: this._titleOption.text ?? '',
|
|
81651
82293
|
subtext: this._titleOption.subtext ?? '',
|
|
81652
82294
|
x: this._titleOption.x ?? this._titleOption.orient === 'right'
|
|
81653
|
-
? this.table.tableX +
|
|
81654
|
-
|
|
82295
|
+
? this.table.tableX +
|
|
82296
|
+
Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) -
|
|
82297
|
+
this.table._tableBorderWidth_left
|
|
82298
|
+
: this.table.tableX - this.table._tableBorderWidth_left,
|
|
81655
82299
|
y: this._titleOption.y ?? this._titleOption.orient === 'bottom'
|
|
81656
|
-
? this.table.tableY + this.table.tableNoFrameHeight
|
|
81657
|
-
: this.table.tableY,
|
|
82300
|
+
? this.table.tableY + this.table.tableNoFrameHeight - this.table._tableBorderWidth_top
|
|
82301
|
+
: this.table.tableY - this.table._tableBorderWidth_top,
|
|
81658
82302
|
width: this._titleOption.orient === 'top' || this._titleOption.orient === 'bottom'
|
|
81659
82303
|
? realWidth
|
|
81660
82304
|
: this._titleOption.width,
|
|
@@ -83980,7 +84624,10 @@
|
|
|
83980
84624
|
table.scenegraph.updateNextFrame();
|
|
83981
84625
|
});
|
|
83982
84626
|
video.onerror = () => {
|
|
83983
|
-
|
|
84627
|
+
const regedIcons = get$2();
|
|
84628
|
+
image.image = regedIcons.video_damage_pic
|
|
84629
|
+
? regedIcons.video_damage_pic.svg
|
|
84630
|
+
: regedIcons.damage_pic.svg;
|
|
83984
84631
|
};
|
|
83985
84632
|
video.src = value;
|
|
83986
84633
|
video.setAttribute('preload', 'auto');
|
|
@@ -83997,6 +84644,12 @@
|
|
|
83997
84644
|
image.textAlign = textAlign;
|
|
83998
84645
|
image.textBaseline = textBaseline;
|
|
83999
84646
|
cellGroup.appendChild(image);
|
|
84647
|
+
image.successCallback = () => {
|
|
84648
|
+
if (isDamagePic(image)) {
|
|
84649
|
+
updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table);
|
|
84650
|
+
table.scenegraph.updateNextFrame();
|
|
84651
|
+
}
|
|
84652
|
+
};
|
|
84000
84653
|
return cellGroup;
|
|
84001
84654
|
}
|
|
84002
84655
|
|
|
@@ -87709,8 +88362,8 @@
|
|
|
87709
88362
|
(this.rowDimensionKeys.indexOf(this.indicatorDimensionKey) >= 0 && path.indicatorKey));
|
|
87710
88363
|
}
|
|
87711
88364
|
else {
|
|
87712
|
-
colHeaderPaths = dimensionPaths
|
|
87713
|
-
rowHeaderPaths = dimensionPaths
|
|
88365
|
+
colHeaderPaths = dimensionPaths?.colHeaderPaths;
|
|
88366
|
+
rowHeaderPaths = dimensionPaths?.rowHeaderPaths;
|
|
87714
88367
|
if (dimensionPaths?.cellLocation === 'body' && this._table.isPivotTable()) {
|
|
87715
88368
|
forceBody = true;
|
|
87716
88369
|
}
|
|
@@ -89068,6 +89721,9 @@
|
|
|
89068
89721
|
}
|
|
89069
89722
|
|
|
89070
89723
|
function join(strArr, joinChar) {
|
|
89724
|
+
if (strArr.length === 0) {
|
|
89725
|
+
return undefined;
|
|
89726
|
+
}
|
|
89071
89727
|
let str = '';
|
|
89072
89728
|
for (let i = 0; i < strArr.length; i++) {
|
|
89073
89729
|
str += strArr[i];
|
|
@@ -90511,21 +91167,71 @@
|
|
|
90511
91167
|
}
|
|
90512
91168
|
}
|
|
90513
91169
|
}
|
|
90514
|
-
changeTreeNodeValue(rowKey = [], colKey = [], indicator, newValue) {
|
|
91170
|
+
changeTreeNodeValue(rowKey = [], colKey = [], indicator, newValue, indicatorPosition) {
|
|
90515
91171
|
const indicatorIndex = this.indicatorKeys.indexOf(indicator);
|
|
91172
|
+
let rowDimensionKey;
|
|
91173
|
+
if (indicatorPosition?.position === 'row') {
|
|
91174
|
+
rowDimensionKey = rowKey.length >= 2 ? this.rows[rowKey.length - 2] : undefined;
|
|
91175
|
+
}
|
|
91176
|
+
else {
|
|
91177
|
+
const rowIndex = rowKey.length - 1;
|
|
91178
|
+
rowDimensionKey = rowIndex >= 0 && rowIndex < this.rows.length ? this.rows[rowIndex] : undefined;
|
|
91179
|
+
}
|
|
91180
|
+
let colDimensionKey;
|
|
91181
|
+
if (indicatorPosition?.position === 'col') {
|
|
91182
|
+
colDimensionKey = colKey.length >= 2 ? this.columns[colKey.length - 2] : undefined;
|
|
91183
|
+
}
|
|
91184
|
+
else {
|
|
91185
|
+
const colIndex = colKey.length - 1;
|
|
91186
|
+
colDimensionKey = colIndex >= 0 && colIndex < this.columns.length ? this.columns[colIndex] : undefined;
|
|
91187
|
+
}
|
|
90516
91188
|
let flatRowKey;
|
|
90517
91189
|
let flatColKey;
|
|
90518
91190
|
if (typeof rowKey === 'string') {
|
|
90519
91191
|
flatRowKey = rowKey;
|
|
90520
91192
|
}
|
|
90521
91193
|
else {
|
|
90522
|
-
|
|
91194
|
+
if (!indicatorPosition || indicatorPosition.position === 'row') {
|
|
91195
|
+
rowKey.map((key, i) => {
|
|
91196
|
+
if (key === indicator && (!isValid$1(indicatorPosition?.index) || i === indicatorPosition.index)) {
|
|
91197
|
+
rowKey.splice(i, 1);
|
|
91198
|
+
}
|
|
91199
|
+
});
|
|
91200
|
+
}
|
|
91201
|
+
if (rowKey.length < this.rows.length && this.rowHierarchyType === 'grid-tree') {
|
|
91202
|
+
if (rowKey[0] === this.rowGrandTotalLabel) ;
|
|
91203
|
+
else if (((this.totals?.row?.subTotalsDimensions &&
|
|
91204
|
+
this.totals?.row?.subTotalsDimensions?.length >= 1 &&
|
|
91205
|
+
this.totals.row.subTotalsDimensions.find((dimension) => dimension === rowDimensionKey)) ||
|
|
91206
|
+
this.totals?.row?.showSubTotalsOnTreeNode) &&
|
|
91207
|
+
rowKey[rowKey.length - 1] !== this.rowSubTotalLabel) {
|
|
91208
|
+
rowKey.push(this.rowSubTotalLabel);
|
|
91209
|
+
}
|
|
91210
|
+
}
|
|
91211
|
+
flatRowKey = join(rowKey, this.stringJoinChar);
|
|
90523
91212
|
}
|
|
90524
91213
|
if (typeof colKey === 'string') {
|
|
90525
91214
|
flatColKey = colKey;
|
|
90526
91215
|
}
|
|
90527
91216
|
else {
|
|
90528
|
-
|
|
91217
|
+
if (!indicatorPosition || indicatorPosition.position === 'col') {
|
|
91218
|
+
colKey.map((key, i) => {
|
|
91219
|
+
if (key === indicator && (!isValid$1(indicatorPosition?.index) || i === indicatorPosition.index)) {
|
|
91220
|
+
colKey.splice(i, 1);
|
|
91221
|
+
}
|
|
91222
|
+
});
|
|
91223
|
+
}
|
|
91224
|
+
if (colKey.length < this.columns.length && this.columnHierarchyType === 'grid-tree') {
|
|
91225
|
+
if (colKey[0] === this.colGrandTotalLabel) ;
|
|
91226
|
+
else if (((this.totals?.column?.subTotalsDimensions &&
|
|
91227
|
+
this.totals?.column?.subTotalsDimensions?.length >= 1 &&
|
|
91228
|
+
this.totals.column.subTotalsDimensions.find((dimension) => dimension === colDimensionKey)) ||
|
|
91229
|
+
this.totals?.column?.showSubTotalsOnTreeNode) &&
|
|
91230
|
+
colKey[colKey.length - 1] !== this.colSubTotalLabel) {
|
|
91231
|
+
colKey.push(this.colSubTotalLabel);
|
|
91232
|
+
}
|
|
91233
|
+
}
|
|
91234
|
+
flatColKey = join(colKey, this.stringJoinChar);
|
|
90529
91235
|
}
|
|
90530
91236
|
if (typeof newValue === 'string') {
|
|
90531
91237
|
if (!isNaN(parseFloat(newValue))) {
|
|
@@ -90703,10 +91409,47 @@
|
|
|
90703
91409
|
}
|
|
90704
91410
|
}
|
|
90705
91411
|
}
|
|
91412
|
+
const newChangedTree = {};
|
|
91413
|
+
for (const flatRowKey in this.changedTree) {
|
|
91414
|
+
const rowKeyParts = flatRowKey.split(this.stringJoinChar);
|
|
91415
|
+
let rowKeyUpdated = false;
|
|
91416
|
+
const newRowKeyParts = rowKeyParts.map(part => {
|
|
91417
|
+
if (part === String(oldValue)) {
|
|
91418
|
+
rowKeyUpdated = true;
|
|
91419
|
+
return String(value);
|
|
91420
|
+
}
|
|
91421
|
+
return part;
|
|
91422
|
+
});
|
|
91423
|
+
const newFlatRowKey = rowKeyUpdated ? join(newRowKeyParts, this.stringJoinChar) : flatRowKey;
|
|
91424
|
+
const colKeysMap = this.changedTree[flatRowKey];
|
|
91425
|
+
if (!newChangedTree[newFlatRowKey]) {
|
|
91426
|
+
newChangedTree[newFlatRowKey] = {};
|
|
91427
|
+
}
|
|
91428
|
+
for (const flatColKey in colKeysMap) {
|
|
91429
|
+
const colKeyParts = flatColKey.split(this.stringJoinChar);
|
|
91430
|
+
let colKeyUpdated = false;
|
|
91431
|
+
const newColKeyParts = colKeyParts.map(part => {
|
|
91432
|
+
if (part === String(oldValue)) {
|
|
91433
|
+
colKeyUpdated = true;
|
|
91434
|
+
return String(value);
|
|
91435
|
+
}
|
|
91436
|
+
return part;
|
|
91437
|
+
});
|
|
91438
|
+
const newFlatColKey = colKeyUpdated ? join(newColKeyParts, this.stringJoinChar) : flatColKey;
|
|
91439
|
+
newChangedTree[newFlatRowKey][newFlatColKey] = colKeysMap[flatColKey];
|
|
91440
|
+
}
|
|
91441
|
+
}
|
|
91442
|
+
this.changedTree = newChangedTree;
|
|
90706
91443
|
this.rowFlatKeys = {};
|
|
90707
91444
|
this.colFlatKeys = {};
|
|
90708
91445
|
this.tree = {};
|
|
90709
91446
|
this.processRecords();
|
|
91447
|
+
this.processCollectedValuesWithSumBy();
|
|
91448
|
+
this.processCollectedValuesWithSortBy();
|
|
91449
|
+
this.totalStatistics();
|
|
91450
|
+
if (this.dataConfig?.isPivotChart) {
|
|
91451
|
+
this.cacheDeminsionCollectedValues();
|
|
91452
|
+
}
|
|
90710
91453
|
}
|
|
90711
91454
|
}
|
|
90712
91455
|
_rowTreeHasChanged() {
|
|
@@ -90948,11 +91691,11 @@
|
|
|
90948
91691
|
this.internalProps.emptyTip?.resetVisible();
|
|
90949
91692
|
}
|
|
90950
91693
|
}
|
|
91694
|
+
this.resize();
|
|
90951
91695
|
setTimeout(() => {
|
|
90952
91696
|
if (this.isReleased) {
|
|
90953
91697
|
return;
|
|
90954
91698
|
}
|
|
90955
|
-
this.resize();
|
|
90956
91699
|
this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
90957
91700
|
}, 0);
|
|
90958
91701
|
}
|
|
@@ -91114,7 +91857,6 @@
|
|
|
91114
91857
|
if (options.title) {
|
|
91115
91858
|
const Title = Factory.getComponent('title');
|
|
91116
91859
|
this.internalProps.title = new Title(options.title, this);
|
|
91117
|
-
this.scenegraph.resize();
|
|
91118
91860
|
}
|
|
91119
91861
|
if (this.options.emptyTip) {
|
|
91120
91862
|
if (this.internalProps.emptyTip) {
|
|
@@ -91126,6 +91868,7 @@
|
|
|
91126
91868
|
this.internalProps.emptyTip?.resetVisible();
|
|
91127
91869
|
}
|
|
91128
91870
|
}
|
|
91871
|
+
this.resize();
|
|
91129
91872
|
setTimeout(() => {
|
|
91130
91873
|
this.fireListeners(TABLE_EVENT_TYPE.UPDATED, null);
|
|
91131
91874
|
}, 0);
|
|
@@ -92000,9 +92743,23 @@
|
|
|
92000
92743
|
this.clearCellStyleCache();
|
|
92001
92744
|
this.scenegraph.createSceneGraph();
|
|
92002
92745
|
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
92003
|
-
|
|
92746
|
+
let isHasComponent = false;
|
|
92747
|
+
if (this.internalProps.title || this.internalProps.legends) {
|
|
92004
92748
|
this._updateSize();
|
|
92005
|
-
|
|
92749
|
+
isHasComponent = true;
|
|
92750
|
+
}
|
|
92751
|
+
const layoutOrder = this.options.componentLayoutOrder ?? ['legend', 'title'];
|
|
92752
|
+
layoutOrder.forEach(component => {
|
|
92753
|
+
if (component === 'legend') {
|
|
92754
|
+
this.internalProps.legends?.forEach(legend => {
|
|
92755
|
+
legend?.resize();
|
|
92756
|
+
});
|
|
92757
|
+
}
|
|
92758
|
+
else if (component === 'title') {
|
|
92759
|
+
this.internalProps.title?.resize();
|
|
92760
|
+
}
|
|
92761
|
+
});
|
|
92762
|
+
if (isHasComponent) {
|
|
92006
92763
|
this.scenegraph.resize();
|
|
92007
92764
|
}
|
|
92008
92765
|
this.eventManager.updateEventBinder();
|
|
@@ -92279,21 +93036,34 @@
|
|
|
92279
93036
|
cellDimensionPath.rowHeaderPaths[cellDimensionPath.rowHeaderPaths.length - 1].dimensionKey, oldValue, newValue);
|
|
92280
93037
|
}
|
|
92281
93038
|
else {
|
|
93039
|
+
let indicatorPosition;
|
|
92282
93040
|
const colKeys = cellDimensionPath.colHeaderPaths
|
|
92283
93041
|
?.filter((path) => {
|
|
92284
93042
|
return !path.virtual;
|
|
92285
93043
|
})
|
|
92286
|
-
.map((colPath) => {
|
|
93044
|
+
.map((colPath, index) => {
|
|
93045
|
+
if (colPath.indicatorKey) {
|
|
93046
|
+
indicatorPosition = {
|
|
93047
|
+
position: 'col',
|
|
93048
|
+
index
|
|
93049
|
+
};
|
|
93050
|
+
}
|
|
92287
93051
|
return colPath.indicatorKey ?? colPath.value;
|
|
92288
93052
|
});
|
|
92289
93053
|
const rowKeys = cellDimensionPath.rowHeaderPaths
|
|
92290
93054
|
?.filter((path) => {
|
|
92291
93055
|
return !path.virtual;
|
|
92292
93056
|
})
|
|
92293
|
-
.map((rowPath) => {
|
|
93057
|
+
.map((rowPath, index) => {
|
|
93058
|
+
if (rowPath.indicatorKey) {
|
|
93059
|
+
indicatorPosition = {
|
|
93060
|
+
position: 'row',
|
|
93061
|
+
index
|
|
93062
|
+
};
|
|
93063
|
+
}
|
|
92294
93064
|
return rowPath.indicatorKey ?? rowPath.value;
|
|
92295
93065
|
});
|
|
92296
|
-
this.dataset.changeTreeNodeValue(
|
|
93066
|
+
this.dataset.changeTreeNodeValue(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), newValue, indicatorPosition);
|
|
92297
93067
|
}
|
|
92298
93068
|
}
|
|
92299
93069
|
else if (this.flatDataToObjects) {
|
|
@@ -92669,11 +93439,11 @@
|
|
|
92669
93439
|
this.internalProps.emptyTip?.resetVisible();
|
|
92670
93440
|
}
|
|
92671
93441
|
}
|
|
93442
|
+
this.resize();
|
|
92672
93443
|
setTimeout(() => {
|
|
92673
93444
|
if (this.isReleased) {
|
|
92674
93445
|
return;
|
|
92675
93446
|
}
|
|
92676
|
-
this.resize();
|
|
92677
93447
|
this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
92678
93448
|
}, 0);
|
|
92679
93449
|
}
|
|
@@ -92833,7 +93603,6 @@
|
|
|
92833
93603
|
if (options.title) {
|
|
92834
93604
|
const Title = Factory.getComponent('title');
|
|
92835
93605
|
this.internalProps.title = new Title(options.title, this);
|
|
92836
|
-
this.scenegraph.resize();
|
|
92837
93606
|
}
|
|
92838
93607
|
if (this.options.emptyTip) {
|
|
92839
93608
|
if (this.internalProps.emptyTip) {
|
|
@@ -92845,6 +93614,7 @@
|
|
|
92845
93614
|
this.internalProps.emptyTip?.resetVisible();
|
|
92846
93615
|
}
|
|
92847
93616
|
}
|
|
93617
|
+
this.resize();
|
|
92848
93618
|
setTimeout(() => {
|
|
92849
93619
|
this.fireListeners(TABLE_EVENT_TYPE.UPDATED, null);
|
|
92850
93620
|
}, 0);
|
|
@@ -93672,9 +94442,23 @@
|
|
|
93672
94442
|
this.clearCellStyleCache();
|
|
93673
94443
|
this.scenegraph.createSceneGraph();
|
|
93674
94444
|
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
93675
|
-
|
|
94445
|
+
let isHasComponent = false;
|
|
94446
|
+
if (this.internalProps.title || this.internalProps.legends) {
|
|
93676
94447
|
this._updateSize();
|
|
93677
|
-
|
|
94448
|
+
isHasComponent = true;
|
|
94449
|
+
}
|
|
94450
|
+
const layoutOrder = this.options.componentLayoutOrder ?? ['legend', 'title'];
|
|
94451
|
+
layoutOrder.forEach(component => {
|
|
94452
|
+
if (component === 'legend') {
|
|
94453
|
+
this.internalProps.legends?.forEach(legend => {
|
|
94454
|
+
legend?.resize();
|
|
94455
|
+
});
|
|
94456
|
+
}
|
|
94457
|
+
else if (component === 'title') {
|
|
94458
|
+
this.internalProps.title?.resize();
|
|
94459
|
+
}
|
|
94460
|
+
});
|
|
94461
|
+
if (isHasComponent) {
|
|
93678
94462
|
this.scenegraph.resize();
|
|
93679
94463
|
}
|
|
93680
94464
|
this.eventManager.updateEventBinder();
|
|
@@ -94310,7 +95094,7 @@
|
|
|
94310
95094
|
}
|
|
94311
95095
|
|
|
94312
95096
|
registerForVrender();
|
|
94313
|
-
const version = "1.0.
|
|
95097
|
+
const version = "1.0.33";
|
|
94314
95098
|
function getIcons() {
|
|
94315
95099
|
return get$2();
|
|
94316
95100
|
}
|