@visactor/vtable-sheet 1.22.7-alpha.4 → 1.22.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/formula/formula-reference-adjustor.js +2 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/styles/menu.js +1 -2
- package/dist/vtable-sheet.js +54 -23
- package/dist/vtable-sheet.min.js +1 -1
- package/es/formula/formula-reference-adjustor.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/styles/menu.js +1 -2
- package/package.json +7 -7
|
@@ -104,4 +104,5 @@ class FormulaReferenceAdjustor {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
exports.FormulaReferenceAdjustor = FormulaReferenceAdjustor, FormulaReferenceAdjustor.CELL_REF_REGEX = /(\$?[A-Z]+\$?\d+(?::\$?[A-Z]+\$?\d+)?)/gi,
|
|
107
|
-
FormulaReferenceAdjustor.SINGLE_CELL_REGEX = /(\$?)([A-Z]+)(\$?)(\d+)/i;
|
|
107
|
+
FormulaReferenceAdjustor.SINGLE_CELL_REGEX = /(\$?)([A-Z]+)(\$?)(\d+)/i;
|
|
108
|
+
//# sourceMappingURL=formula-reference-adjustor.js.map
|
package/cjs/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import VTableSheet from './components/vtable-sheet';
|
|
|
2
2
|
import type { ISheetDefine, IVTableSheetOptions } from './ts-types';
|
|
3
3
|
import * as TYPES from './ts-types';
|
|
4
4
|
import * as VTable from './vtable';
|
|
5
|
-
export declare const version = "1.22.7
|
|
5
|
+
export declare const version = "1.22.7";
|
|
6
6
|
export { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };
|
package/cjs/index.js
CHANGED
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.22.7\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };\n"]}
|
package/cjs/styles/menu.js
CHANGED
package/dist/vtable-sheet.js
CHANGED
|
@@ -47525,7 +47525,7 @@
|
|
|
47525
47525
|
isShowTooltip = rowStart2 !== rowStart;
|
|
47526
47526
|
}
|
|
47527
47527
|
}
|
|
47528
|
-
if (isScatter) null === (_f = (_e = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _f || _f.call(_e, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
47528
|
+
if (isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_f = (_e = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _f || _f.call(_e, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
47529
47529
|
const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
47530
47530
|
absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
|
|
47531
47531
|
hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
@@ -47603,7 +47603,7 @@
|
|
|
47603
47603
|
isShowTooltip = colStart2 !== colStart;
|
|
47604
47604
|
}
|
|
47605
47605
|
}
|
|
47606
|
-
if (isScatter) null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
47606
|
+
if (isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
47607
47607
|
const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
47608
47608
|
absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
|
|
47609
47609
|
hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
@@ -48071,7 +48071,7 @@
|
|
|
48071
48071
|
}
|
|
48072
48072
|
}
|
|
48073
48073
|
function getAxisOption(col, row, orient, layout) {
|
|
48074
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
48074
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
48075
48075
|
const spec = layout.getRawChartSpec(col, row),
|
|
48076
48076
|
axes = null !== (_a = spec.axes) && void 0 !== _a ? _a : [];
|
|
48077
48077
|
if (layout._table.pivotChartAxes.forEach(axis => {
|
|
@@ -48079,6 +48079,7 @@
|
|
|
48079
48079
|
}), spec && isArray$a(axes)) {
|
|
48080
48080
|
const axisOption = axes.find(axis => axis.orient === orient);
|
|
48081
48081
|
if (axisOption) {
|
|
48082
|
+
axisOption.zero && isNumber$4(null === (_b = axisOption.range) || void 0 === _b ? void 0 : _b.min) && (axisOption.zero = !1);
|
|
48082
48083
|
const {
|
|
48083
48084
|
seriesIndex: seriesIndex,
|
|
48084
48085
|
seriesId: seriesId
|
|
@@ -48092,19 +48093,19 @@
|
|
|
48092
48093
|
isZeroAlign: isZeroAlign,
|
|
48093
48094
|
isTickAlign: isTickAlign
|
|
48094
48095
|
} = checkZeroAlign(spec, orient, layout);
|
|
48095
|
-
return axisOption.labelHoverOnAxis || (axisOption.labelHoverOnAxis = null === (
|
|
48096
|
+
return axisOption.labelHoverOnAxis || (axisOption.labelHoverOnAxis = null === (_d = null === (_c = layout._table.options.chartDimensionLinkage) || void 0 === _c ? void 0 : _c.labelHoverOnAxis) || void 0 === _d ? void 0 : _d[orient]), {
|
|
48096
48097
|
axisOption: axisOption,
|
|
48097
48098
|
isPercent: spec.percent,
|
|
48098
48099
|
isZeroAlign: isZeroAlign,
|
|
48099
48100
|
isTickAlign: isTickAlign,
|
|
48100
48101
|
seriesIndice: seriesIndice,
|
|
48101
48102
|
theme: spec.theme,
|
|
48102
|
-
chartType: null !== (
|
|
48103
|
+
chartType: null !== (_e = null == seriesSpec ? void 0 : seriesSpec.type) && void 0 !== _e ? _e : spec.type
|
|
48103
48104
|
};
|
|
48104
48105
|
}
|
|
48105
48106
|
}
|
|
48106
|
-
const axisOption = null !== (
|
|
48107
|
-
axisOption && !axisOption.labelHoverOnAxis && (axisOption.labelHoverOnAxis = null === (
|
|
48107
|
+
const axisOption = null !== (_f = layout._table.pivotChartAxes.find(axisOption => axisOption.orient === orient)) && void 0 !== _f ? _f : {};
|
|
48108
|
+
axisOption.zero && isNumber$4(null === (_g = axisOption.range) || void 0 === _g ? void 0 : _g.min) && (axisOption.zero = !1), axisOption && !axisOption.labelHoverOnAxis && (axisOption.labelHoverOnAxis = null === (_j = null === (_h = layout._table.options.chartDimensionLinkage) || void 0 === _h ? void 0 : _h.labelHoverOnAxis) || void 0 === _j ? void 0 : _j[orient]);
|
|
48108
48109
|
const {
|
|
48109
48110
|
isZeroAlign: isZeroAlign,
|
|
48110
48111
|
isTickAlign: isTickAlign
|
|
@@ -48346,7 +48347,7 @@
|
|
|
48346
48347
|
layer.main && drawParams.clear && hoverColor && (context.beginPath(), context.fillStyle = hoverColor, context.rect(viewBox.x1, viewBox.y1, viewBox.x2 - viewBox.x1, viewBox.y2 - viewBox.y1), context.fill());
|
|
48347
48348
|
}
|
|
48348
48349
|
},
|
|
48349
|
-
componentShowContent: table.options.chartDimensionLinkage ? {
|
|
48350
|
+
componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
|
|
48350
48351
|
tooltip: {
|
|
48351
48352
|
dimension: !1,
|
|
48352
48353
|
mark: !0
|
|
@@ -57253,7 +57254,8 @@
|
|
|
57253
57254
|
} = eventArgsSet;
|
|
57254
57255
|
if (this.table.internalProps.enableTreeStickCell && !eventArgs) return !1;
|
|
57255
57256
|
const resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null == eventArgs ? void 0 : eventArgs.targetCell);
|
|
57256
|
-
|
|
57257
|
+
let useerCustomCanResizeColumn = !0;
|
|
57258
|
+
return this.table.internalProps.canResizeColumn && !this.table.internalProps.canResizeColumn(resizeCol.col, resizeCol.row, this.table) && (useerCustomCanResizeColumn = !1), useerCustomCanResizeColumn && this.table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0 ? (update && this.table.stateManager.startResizeCol(resizeCol.col, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, resizeCol.rightFrozen), !0) : (this.table.stateManager.isResizeCol() && this.table.stateManager.endResizeCol(), !1);
|
|
57257
57259
|
}
|
|
57258
57260
|
checkRowResize(eventArgsSet, update) {
|
|
57259
57261
|
const {
|
|
@@ -59781,7 +59783,7 @@
|
|
|
59781
59783
|
}
|
|
59782
59784
|
constructor(container, options = {}) {
|
|
59783
59785
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
59784
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.7
|
|
59786
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.7", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
59785
59787
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
59786
59788
|
options: options,
|
|
59787
59789
|
container: container
|
|
@@ -59858,7 +59860,7 @@
|
|
|
59858
59860
|
bottom: 0
|
|
59859
59861
|
}, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), (isValid$4(canvasHeight) || isValid$4(canvasWidth)) && (this.canvasSizeSeted = !0), this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.contentOffsetX = null != translateX ? translateX : 0, this.contentOffsetY = null != translateY ? translateY : 0, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0, this.columnWidthComputeMode = null !== (_d = options.columnWidthComputeMode) && void 0 !== _d ? _d : "normal";
|
|
59860
59862
|
const internalProps = this.internalProps = {};
|
|
59861
|
-
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? ("node" !== Env$1.mode && (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative"), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env$1.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_e = options.customConfig) || void 0 === _e ? void 0 : _e.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler(), isNumber$4(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.enableCheckboxCascade = null === (_f = null != enableCheckboxCascade ? enableCheckboxCascade : null == rowSeriesNumber ? void 0 : rowSeriesNumber.enableTreeCheckbox) || void 0 === _f || _f, internalProps.enableHeaderCheckboxCascade = enableCheckboxCascade || null == enableHeaderCheckboxCascade || enableHeaderCheckboxCascade, internalProps.columnResizeMode = null !== (_g = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _g ? _g : columnResizeMode, internalProps.rowResizeMode = null !== (_h = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _h ? _h : rowResizeMode, internalProps.dragHeaderMode = null !== (_k = null !== (_j = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _j ? _j : dragHeaderMode) && void 0 !== _k ? _k : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.groupBy = null !== (_l = null == groupConfig ? void 0 : groupConfig.groupBy) && void 0 !== _l ? _l : groupBy, internalProps.groupTitleCheckbox = null !== (_m = null == groupConfig ? void 0 : groupConfig.titleCheckbox) && void 0 !== _m ? _m : !!(null == rowSeriesNumber ? void 0 : rowSeriesNumber.enableTreeCheckbox), internalProps.groupTitleFieldFormat = null !== (_o = null == groupConfig ? void 0 : groupConfig.titleFieldFormat) && void 0 !== _o ? _o : groupTitleFieldFormat, internalProps.groupTitleCustomLayout = null !== (_p = null == groupConfig ? void 0 : groupConfig.titleCustomLayout) && void 0 !== _p ? _p : groupTitleCustomLayout, internalProps.enableTreeStickCell = null !== (_q = null == groupConfig ? void 0 : groupConfig.enableTreeStickCell) && void 0 !== _q ? _q : enableTreeStickCell, internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {};
|
|
59863
|
+
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? ("node" !== Env$1.mode && (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative"), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env$1.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_e = options.customConfig) || void 0 === _e ? void 0 : _e.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler(), isNumber$4(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.enableCheckboxCascade = null === (_f = null != enableCheckboxCascade ? enableCheckboxCascade : null == rowSeriesNumber ? void 0 : rowSeriesNumber.enableTreeCheckbox) || void 0 === _f || _f, internalProps.enableHeaderCheckboxCascade = enableCheckboxCascade || null == enableHeaderCheckboxCascade || enableHeaderCheckboxCascade, internalProps.columnResizeMode = null !== (_g = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _g ? _g : columnResizeMode, internalProps.canResizeColumn = null == resize ? void 0 : resize.canResizeColumn, internalProps.rowResizeMode = null !== (_h = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _h ? _h : rowResizeMode, internalProps.dragHeaderMode = null !== (_k = null !== (_j = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _j ? _j : dragHeaderMode) && void 0 !== _k ? _k : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.groupBy = null !== (_l = null == groupConfig ? void 0 : groupConfig.groupBy) && void 0 !== _l ? _l : groupBy, internalProps.groupTitleCheckbox = null !== (_m = null == groupConfig ? void 0 : groupConfig.titleCheckbox) && void 0 !== _m ? _m : !!(null == rowSeriesNumber ? void 0 : rowSeriesNumber.enableTreeCheckbox), internalProps.groupTitleFieldFormat = null !== (_o = null == groupConfig ? void 0 : groupConfig.titleFieldFormat) && void 0 !== _o ? _o : groupTitleFieldFormat, internalProps.groupTitleCustomLayout = null !== (_p = null == groupConfig ? void 0 : groupConfig.titleCustomLayout) && void 0 !== _p ? _p : groupTitleCustomLayout, internalProps.enableTreeStickCell = null !== (_q = null == groupConfig ? void 0 : groupConfig.enableTreeStickCell) && void 0 !== _q ? _q : enableTreeStickCell, internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {};
|
|
59862
59864
|
const that = this;
|
|
59863
59865
|
if (internalProps.calcWidthContext = {
|
|
59864
59866
|
_: internalProps,
|
|
@@ -60792,7 +60794,7 @@
|
|
|
60792
60794
|
height: !1
|
|
60793
60795
|
}), this.customRender = customRender, this.contentOffsetX = null != translateX ? translateX : 0, this.contentOffsetY = null != translateY ? translateY : 0, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0;
|
|
60794
60796
|
const internalProps = this.internalProps;
|
|
60795
|
-
if ("node" === Env$1.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_d = options.columnWidthComputeMode) && void 0 !== _d ? _d : "normal", internalProps.frozenColCount = frozenColCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.enableCheckboxCascade = null === (_e = null != enableCheckboxCascade ? enableCheckboxCascade : null == rowSeriesNumber ? void 0 : rowSeriesNumber.enableTreeCheckbox) || void 0 === _e || _e, internalProps.enableHeaderCheckboxCascade = enableCheckboxCascade || null == enableHeaderCheckboxCascade || enableHeaderCheckboxCascade, internalProps.columnResizeMode = null !== (_f = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _f ? _f : columnResizeMode, internalProps.rowResizeMode = null !== (_g = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _g ? _g : rowResizeMode, internalProps.dragHeaderMode = null !== (_j = null !== (_h = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _h ? _h : dragHeaderMode) && void 0 !== _j ? _j : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.cellTextOverflows = {}, internalProps.groupBy = null !== (_k = null == groupConfig ? void 0 : groupConfig.groupBy) && void 0 !== _k ? _k : groupBy, internalProps.groupTitleCheckbox = null == groupConfig ? void 0 : groupConfig.titleCheckbox, internalProps.groupTitleFieldFormat = null !== (_l = null == groupConfig ? void 0 : groupConfig.titleFieldFormat) && void 0 !== _l ? _l : groupTitleFieldFormat, internalProps.groupTitleCustomLayout = null !== (_m = null == groupConfig ? void 0 : groupConfig.titleCustomLayout) && void 0 !== _m ? _m : groupTitleCustomLayout, internalProps.enableTreeStickCell = null !== (_o = null == groupConfig ? void 0 : groupConfig.enableTreeStickCell) && void 0 !== _o ? _o : enableTreeStickCell, (null == updateConfig ? void 0 : updateConfig.clearColWidthCache) && (internalProps._widthResizedColMap.clear(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}), (null == updateConfig ? void 0 : updateConfig.clearRowHeightCache) && (internalProps._heightResizedRowMap.clear(), internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map()), internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (_p = options.theme) && void 0 !== _p ? _p : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_q = options.allowFrozenColCount) && void 0 !== _q ? _q : 0, internalProps.limitMaxAutoWidth = null !== (_r = options.limitMaxAutoWidth) && void 0 !== _r ? _r : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, null === (_s = internalProps.legends) || void 0 === _s || _s.forEach(legend => {
|
|
60797
|
+
if ("node" === Env$1.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_d = options.columnWidthComputeMode) && void 0 !== _d ? _d : "normal", internalProps.frozenColCount = frozenColCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.enableCheckboxCascade = null === (_e = null != enableCheckboxCascade ? enableCheckboxCascade : null == rowSeriesNumber ? void 0 : rowSeriesNumber.enableTreeCheckbox) || void 0 === _e || _e, internalProps.enableHeaderCheckboxCascade = enableCheckboxCascade || null == enableHeaderCheckboxCascade || enableHeaderCheckboxCascade, internalProps.columnResizeMode = null !== (_f = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _f ? _f : columnResizeMode, internalProps.canResizeColumn = null == resize ? void 0 : resize.canResizeColumn, internalProps.rowResizeMode = null !== (_g = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _g ? _g : rowResizeMode, internalProps.dragHeaderMode = null !== (_j = null !== (_h = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _h ? _h : dragHeaderMode) && void 0 !== _j ? _j : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.cellTextOverflows = {}, internalProps.groupBy = null !== (_k = null == groupConfig ? void 0 : groupConfig.groupBy) && void 0 !== _k ? _k : groupBy, internalProps.groupTitleCheckbox = null == groupConfig ? void 0 : groupConfig.titleCheckbox, internalProps.groupTitleFieldFormat = null !== (_l = null == groupConfig ? void 0 : groupConfig.titleFieldFormat) && void 0 !== _l ? _l : groupTitleFieldFormat, internalProps.groupTitleCustomLayout = null !== (_m = null == groupConfig ? void 0 : groupConfig.titleCustomLayout) && void 0 !== _m ? _m : groupTitleCustomLayout, internalProps.enableTreeStickCell = null !== (_o = null == groupConfig ? void 0 : groupConfig.enableTreeStickCell) && void 0 !== _o ? _o : enableTreeStickCell, (null == updateConfig ? void 0 : updateConfig.clearColWidthCache) && (internalProps._widthResizedColMap.clear(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}), (null == updateConfig ? void 0 : updateConfig.clearRowHeightCache) && (internalProps._heightResizedRowMap.clear(), internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map()), internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (_p = options.theme) && void 0 !== _p ? _p : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_q = options.allowFrozenColCount) && void 0 !== _q ? _q : 0, internalProps.limitMaxAutoWidth = null !== (_r = options.limitMaxAutoWidth) && void 0 !== _r ? _r : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, null === (_s = internalProps.legends) || void 0 === _s || _s.forEach(legend => {
|
|
60796
60798
|
null == legend || legend.release();
|
|
60797
60799
|
}), null === (_t = internalProps.title) || void 0 === _t || _t.release(), internalProps.title = null, null === (_u = internalProps.emptyTip) || void 0 === _u || _u.release(), internalProps.emptyTip = null, internalProps.layoutMap.release(), clearChartRenderQueue(), this.scenegraph.clearCells(), this.scenegraph.updateComponent(), this.stateManager.updateOptionSetState(), this._updateSize(), this.eventManager.updateEventBinder(), options.legends) {
|
|
60798
60800
|
internalProps.legends = [];
|
|
@@ -72979,9 +72981,19 @@
|
|
|
72979
72981
|
bodyInfo = this.table.internalProps.layoutMap.getBody(null == headerAddress ? void 0 : headerAddress.col, null == headerAddress ? void 0 : headerAddress.row);
|
|
72980
72982
|
return formatFn = bodyInfo && "fieldFormat" in bodyInfo && "function" == typeof bodyInfo.fieldFormat ? bodyInfo.fieldFormat : bodyInfo && "format" in bodyInfo && "function" == typeof bodyInfo.format ? bodyInfo.format : record => record[fieldId], this.formatFnCache.set(fieldId, formatFn), formatFn;
|
|
72981
72983
|
}
|
|
72984
|
+
getRecords(table, original) {
|
|
72985
|
+
if (!0 === original) return table.internalProps.records;
|
|
72986
|
+
const records = [],
|
|
72987
|
+
stack = [...table.internalProps.dataSource.records];
|
|
72988
|
+
for (; stack.length > 0;) {
|
|
72989
|
+
const item = stack.pop();
|
|
72990
|
+
if (item.vtableMerge && Array.isArray(item.children)) for (let i = item.children.length - 1; i >= 0; i--) stack.push(item.children[i]);else records.push(item);
|
|
72991
|
+
}
|
|
72992
|
+
return records.reverse();
|
|
72993
|
+
}
|
|
72982
72994
|
collectCandidateKeysForUnfilteredColumn(fieldId) {
|
|
72983
72995
|
const countMap = new Map(),
|
|
72984
|
-
records = this.table
|
|
72996
|
+
records = this.getRecords(this.table, !1),
|
|
72985
72997
|
formatFn = this.getFormatFnCache(fieldId),
|
|
72986
72998
|
toUnformatted = new Map();
|
|
72987
72999
|
records.forEach(record => {
|
|
@@ -72999,7 +73011,12 @@
|
|
|
72999
73011
|
toUnformatted = new Map(),
|
|
73000
73012
|
formatFn = this.getFormatFnCache(candidateField),
|
|
73001
73013
|
countMap = new Map();
|
|
73002
|
-
this.table.
|
|
73014
|
+
this.getRecords(this.table, !0).filter(record => filteredFields.every(field => {
|
|
73015
|
+
var _a;
|
|
73016
|
+
const filterType = null === (_a = this.filterStateManager.getFilterState(field)) || void 0 === _a ? void 0 : _a.type;
|
|
73017
|
+
"byValue" !== filterType && null != filterType && this.syncSingleStateFromTableData(field);
|
|
73018
|
+
return this.selectedKeys.get(field).has(record[field]);
|
|
73019
|
+
})).forEach(record => {
|
|
73003
73020
|
const originalValue = record[candidateField],
|
|
73004
73021
|
formattedValue = formatFn(record);
|
|
73005
73022
|
if (countMap.set(formattedValue, (countMap.get(formattedValue) || 0) + 1), null != formattedValue) {
|
|
@@ -73029,8 +73046,7 @@
|
|
|
73029
73046
|
item.itemContainer.style.display = isVisible ? "flex" : "none";
|
|
73030
73047
|
}
|
|
73031
73048
|
}
|
|
73032
|
-
|
|
73033
|
-
if (this.filterStateManager.getActiveFilterFields()) return;
|
|
73049
|
+
syncSingleStateFromTableData(fieldId) {
|
|
73034
73050
|
const selectedValues = new Set(),
|
|
73035
73051
|
originalValues = new Set();
|
|
73036
73052
|
this.table.internalProps.dataSource.records.forEach(record => {
|
|
@@ -73040,10 +73056,9 @@
|
|
|
73040
73056
|
originalValues.add(record[fieldId]);
|
|
73041
73057
|
});
|
|
73042
73058
|
!arrayEqual(Array.from(originalValues), Array.from(selectedValues)) && (this.selectedKeys.set(fieldId, selectedValues), this.filterStateManager.dispatch({
|
|
73043
|
-
type: FilterActionType.
|
|
73059
|
+
type: FilterActionType.UPDATE_FILTER,
|
|
73044
73060
|
payload: {
|
|
73045
73061
|
field: fieldId,
|
|
73046
|
-
type: "byValue",
|
|
73047
73062
|
values: Array.from(selectedValues),
|
|
73048
73063
|
enable: !0
|
|
73049
73064
|
}
|
|
@@ -73135,8 +73150,10 @@
|
|
|
73135
73150
|
}, this.filterByValuePanel.addEventListener("keyup", this._onInputKeyUpHandler), this.filterByValuePanel.addEventListener("change", this._onCheckboxChangeHandler);
|
|
73136
73151
|
}
|
|
73137
73152
|
show() {
|
|
73138
|
-
var _a;
|
|
73139
|
-
(null === (_a = this.filterStateManager.getFilterState(this.selectedField)) || void 0 === _a ? void 0 : _a.enable) ? this.collectCandidateKeysForFilteredColumn(this.selectedField) : this.collectCandidateKeysForUnfilteredColumn(this.selectedField)
|
|
73153
|
+
var _a, _b;
|
|
73154
|
+
(null === (_a = this.filterStateManager.getFilterState(this.selectedField)) || void 0 === _a ? void 0 : _a.enable) ? this.collectCandidateKeysForFilteredColumn(this.selectedField) : this.collectCandidateKeysForUnfilteredColumn(this.selectedField);
|
|
73155
|
+
const filterType = null === (_b = this.filterStateManager.getFilterState(this.selectedField)) || void 0 === _b ? void 0 : _b.type;
|
|
73156
|
+
null != filterType && "byValue" !== filterType && this.syncSingleStateFromTableData(this.selectedField), this.filterByValueSearchInput && (this.filterByValueSearchInput.value = ""), this.renderFilterOptions(this.selectedField), this.filterByValuePanel.style.display = "block";
|
|
73140
73157
|
}
|
|
73141
73158
|
hide() {
|
|
73142
73159
|
this.filterByValuePanel.style.display = "none";
|
|
@@ -73469,7 +73486,7 @@
|
|
|
73469
73486
|
class FilterPlugin {
|
|
73470
73487
|
constructor(pluginOptions) {
|
|
73471
73488
|
var _a, _b, _c;
|
|
73472
|
-
this.id = "filter", this.name = "Filter", this.runTime = [TABLE_EVENT_TYPE.BEFORE_INIT, TABLE_EVENT_TYPE.BEFORE_UPDATE_OPTION, TABLE_EVENT_TYPE.ICON_CLICK, TABLE_EVENT_TYPE.SCROLL], this.id = null !== (_a = null == pluginOptions ? void 0 : pluginOptions.id) && void 0 !== _a ? _a : this.id, this.pluginOptions = pluginOptions, this.pluginOptions.filterIcon = null !== (_b = pluginOptions.filterIcon) && void 0 !== _b ? _b : {
|
|
73489
|
+
this.id = "filter", this.name = "Filter", this.runTime = [TABLE_EVENT_TYPE.BEFORE_INIT, TABLE_EVENT_TYPE.BEFORE_UPDATE_OPTION, TABLE_EVENT_TYPE.ICON_CLICK, TABLE_EVENT_TYPE.SCROLL, TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, TABLE_EVENT_TYPE.UPDATE_RECORD, TABLE_EVENT_TYPE.ADD_RECORD, TABLE_EVENT_TYPE.DELETE_RECORD], this.id = null !== (_a = null == pluginOptions ? void 0 : pluginOptions.id) && void 0 !== _a ? _a : this.id, this.pluginOptions = pluginOptions, this.pluginOptions.filterIcon = null !== (_b = pluginOptions.filterIcon) && void 0 !== _b ? _b : {
|
|
73473
73490
|
name: "filter-icon",
|
|
73474
73491
|
type: "svg",
|
|
73475
73492
|
width: 12,
|
|
@@ -73501,11 +73518,25 @@
|
|
|
73501
73518
|
const col = eventArgs.col,
|
|
73502
73519
|
row = eventArgs.row;
|
|
73503
73520
|
this.filterToolbar.isVisible ? this.filterToolbar.hide() : this.filterToolbar.show(col, row, this.pluginOptions.filterModes);
|
|
73504
|
-
} else runtime === TABLE_EVENT_TYPE.SCROLL
|
|
73521
|
+
} else if (runtime === TABLE_EVENT_TYPE.SCROLL) "horizontal" === eventArgs.scrollDirection && this.filterToolbar.adjustMenuPosition();else if (runtime === TABLE_EVENT_TYPE.CHANGE_CELL_VALUE) {
|
|
73522
|
+
const changedField = this.table.getHeaderField(eventArgs.col, eventArgs.row);
|
|
73523
|
+
this.syncFilterWithTableData(changedField);
|
|
73524
|
+
} else (runtime === TABLE_EVENT_TYPE.UPDATE_RECORD || runtime === TABLE_EVENT_TYPE.ADD_RECORD || runtime === TABLE_EVENT_TYPE.DELETE_RECORD) && this.syncFilterWithTableData();
|
|
73505
73525
|
}
|
|
73506
73526
|
update() {
|
|
73507
73527
|
this.filterStateManager && this.reapplyActiveFilters();
|
|
73508
73528
|
}
|
|
73529
|
+
syncFilterWithTableData(field) {
|
|
73530
|
+
var _a;
|
|
73531
|
+
if ("byValue" === (null === (_a = this.filterStateManager.getFilterState(field)) || void 0 === _a ? void 0 : _a.type)) {
|
|
73532
|
+
if (null != field) return void this.filterToolbar.valueFilter.syncSingleStateFromTableData(field);
|
|
73533
|
+
this.table.dataSource.columns.forEach(({
|
|
73534
|
+
field: field
|
|
73535
|
+
}) => {
|
|
73536
|
+
this.filterToolbar.valueFilter.syncSingleStateFromTableData(field);
|
|
73537
|
+
});
|
|
73538
|
+
}
|
|
73539
|
+
}
|
|
73509
73540
|
handleOptionUpdate(options) {
|
|
73510
73541
|
const currentActiveFields = this.filterStateManager ? this.filterStateManager.getActiveFilterFields() : [];
|
|
73511
73542
|
this.filterStateManager && currentActiveFields.length > 0 && this.validateFilterStatesAfterUpdate(options, currentActiveFields), this.updateFilterIcons(options.columns);
|
|
@@ -81521,7 +81552,7 @@
|
|
|
81521
81552
|
importStyle();
|
|
81522
81553
|
}
|
|
81523
81554
|
|
|
81524
|
-
const version = "1.22.7
|
|
81555
|
+
const version = "1.22.7";
|
|
81525
81556
|
importStyles();
|
|
81526
81557
|
|
|
81527
81558
|
exports.TYPES = index;
|