@antv/s2
Version:
effective spreadsheet render core lib
121 lines • 4.42 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_OPTIONS = exports.DEFAULT_FROZEN_COUNTS = exports.DEFAULT_STYLE = exports.DEFAULT_CELL_TEXT_WORD_WRAP_STYLE = exports.DEFAULT_CELL_HEIGHT = exports.DEFAULT_CELL_WIDTH = exports.DEFAULT_ROW_CELL_TREE_WIDTH = exports.SPLIT_LINE_WIDTH = exports.LayoutWidthType = exports.MIN_DEVICE_PIXEL_RATIO = void 0;
const resize_1 = require("../../common/constant/resize");
const interaction_1 = require("../constant/interaction");
const s2Options_1 = require("../interface/s2Options");
const basic_1 = require("./basic");
exports.MIN_DEVICE_PIXEL_RATIO = 1;
/**
* 布局类型:
* adaptive: 行列等宽,均分整个 canvas 画布宽度
* colAdaptive:列等宽,行头紧凑布局,列等分画布宽度减去行头宽度的剩余宽度
* compact:行列紧凑布局,指标维度少的时候无法布满整个画布,列头宽度为实际内容宽度(取当前列最大值,采样每一列前 50 条数据
*/
var LayoutWidthType;
(function (LayoutWidthType) {
LayoutWidthType["Adaptive"] = "adaptive";
LayoutWidthType["ColAdaptive"] = "colAdaptive";
LayoutWidthType["Compact"] = "compact";
})(LayoutWidthType || (exports.LayoutWidthType = LayoutWidthType = {}));
exports.SPLIT_LINE_WIDTH = 1;
exports.DEFAULT_ROW_CELL_TREE_WIDTH = 120;
exports.DEFAULT_CELL_WIDTH = 96;
exports.DEFAULT_CELL_HEIGHT = 30;
exports.DEFAULT_CELL_TEXT_WORD_WRAP_STYLE = {
wordWrap: true,
maxLines: 1,
textOverflow: 'ellipsis',
};
exports.DEFAULT_STYLE = {
layoutWidthType: LayoutWidthType.Adaptive,
seriesNumberCell: exports.DEFAULT_CELL_TEXT_WORD_WRAP_STYLE,
cornerCell: exports.DEFAULT_CELL_TEXT_WORD_WRAP_STYLE,
rowCell: Object.assign(Object.assign({}, exports.DEFAULT_CELL_TEXT_WORD_WRAP_STYLE), { showTreeLeafNodeAlignDot: false }),
colCell: Object.assign(Object.assign({}, exports.DEFAULT_CELL_TEXT_WORD_WRAP_STYLE), { height: exports.DEFAULT_CELL_HEIGHT }),
dataCell: Object.assign(Object.assign({}, exports.DEFAULT_CELL_TEXT_WORD_WRAP_STYLE), { width: exports.DEFAULT_CELL_WIDTH, height: exports.DEFAULT_CELL_HEIGHT }),
};
exports.DEFAULT_FROZEN_COUNTS = {
rowCount: 0,
colCount: 0,
trailingRowCount: 0,
trailingColCount: 0,
};
exports.DEFAULT_OPTIONS = {
width: 600,
height: 480,
debug: false,
hierarchyType: 'grid',
device: s2Options_1.DeviceType.PC,
conditions: {},
totals: {},
tooltip: {
enable: false,
autoAdjustBoundary: 'body',
operation: {
hiddenColumns: false,
sort: false,
menu: {
items: [],
},
},
},
interaction: {
copy: {
enable: true,
withFormat: true,
withHeader: false,
},
linkFields: [],
hiddenColumnFields: [],
selectedCellsSpotlight: false,
hoverHighlight: true,
hoverFocus: {
duration: interaction_1.HOVER_FOCUS_DURATION,
},
scrollSpeedRatio: {
horizontal: 1,
vertical: 1,
},
autoResetSheetStyle: true,
brushSelection: {
dataCell: true,
rowCell: true,
colCell: true,
},
multiSelection: true,
rangeSelection: true,
scrollbarPosition: interaction_1.ScrollbarPositionType.CONTENT,
resize: {
rowCellVertical: true,
cornerCellHorizontal: true,
colCellHorizontal: true,
colCellVertical: true,
rowResizeType: resize_1.ResizeType.CURRENT,
colResizeType: resize_1.ResizeType.CURRENT,
minCellWidth: resize_1.RESIZE_MIN_CELL_WIDTH,
minCellHeight: resize_1.RESIZE_MIN_CELL_HEIGHT,
},
eventListenerOptions: false,
selectedCellHighlight: false,
overscrollBehavior: 'auto',
},
seriesNumber: {
enable: false,
},
customSVGIcons: [],
showDefaultHeaderActionIcon: false,
headerActionIcons: [],
style: exports.DEFAULT_STYLE,
frozen: Object.assign({ rowHeader: true }, exports.DEFAULT_FROZEN_COUNTS),
hd: true,
cornerText: '',
cornerExtraFieldText: '',
placeholder: {
cell: basic_1.EMPTY_PLACEHOLDER,
empty: {
icon: 'Empty',
},
},
};
//# sourceMappingURL=options.js.map