@visactor/vtable 1.2.1-alpha.2 → 1.3.0
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/ListTable.js +2 -1
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +1 -5
- package/cjs/PivotChart.js +7 -30
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +7 -2
- package/cjs/PivotTable.js +85 -17
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/body-helper/style/Style.d.ts +3 -0
- package/cjs/body-helper/style/Style.js +32 -25
- package/cjs/body-helper/style/Style.js.map +1 -1
- package/cjs/components/tooltip/TooltipHandler.js +4 -2
- package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElement.d.ts +2 -0
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js +18 -4
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +1 -1
- package/cjs/core/BaseTable.js +7 -7
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/tableHelper.js +2 -1
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/event/listener/container-dom.js +9 -6
- 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/header-helper/header-helper.d.ts +1 -0
- package/cjs/header-helper/header-helper.js +12 -2
- package/cjs/header-helper/header-helper.js.map +1 -1
- package/cjs/header-helper/style/Style.d.ts +3 -0
- package/cjs/header-helper/style/Style.js +34 -27
- package/cjs/header-helper/style/Style.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +2 -2
- package/cjs/index.js.map +1 -1
- package/cjs/layout/pivot-header-layout.js +26 -8
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/tree-helper.js +4 -1
- package/cjs/layout/tree-helper.js.map +1 -1
- package/cjs/scenegraph/icon/icon-update.js +1 -0
- package/cjs/scenegraph/icon/icon-update.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/select/update-position.js +1 -1
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/state/state.js +7 -5
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme.js +3 -0
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +3 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/column/style.d.ts +1 -0
- package/cjs/ts-types/column/style.js.map +1 -1
- package/cjs/ts-types/common.d.ts +4 -13
- package/cjs/ts-types/common.js.map +1 -1
- package/cjs/ts-types/icon.d.ts +1 -0
- package/cjs/ts-types/icon.js.map +1 -1
- package/cjs/ts-types/list-table/layout-map/api.d.ts +2 -1
- package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
- package/cjs/ts-types/pivot-table/dimension/basic-dimension.d.ts +3 -1
- package/cjs/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
- package/cjs/ts-types/pivot-table/indicator/basic-indicator.d.ts +1 -0
- package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
- package/cjs/ts-types/style-define.d.ts +1 -0
- package/cjs/ts-types/style-define.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +4 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/tooltip.d.ts +1 -0
- package/cjs/ts-types/tooltip.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +354 -91
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +2 -1
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +1 -5
- package/es/PivotChart.js +6 -31
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +7 -2
- package/es/PivotTable.js +87 -19
- package/es/PivotTable.js.map +1 -1
- package/es/body-helper/style/Style.d.ts +3 -0
- package/es/body-helper/style/Style.js +32 -25
- package/es/body-helper/style/Style.js.map +1 -1
- package/es/components/tooltip/TooltipHandler.js +4 -2
- package/es/components/tooltip/TooltipHandler.js.map +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElement.d.ts +2 -0
- package/es/components/tooltip/logic/BubbleTooltipElement.js +18 -4
- package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
- package/es/core/BaseTable.d.ts +1 -1
- package/es/core/BaseTable.js +7 -7
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/tableHelper.js +2 -1
- package/es/core/tableHelper.js.map +1 -1
- package/es/event/listener/container-dom.js +9 -6
- 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/header-helper/header-helper.d.ts +1 -0
- package/es/header-helper/header-helper.js +12 -2
- package/es/header-helper/header-helper.js.map +1 -1
- package/es/header-helper/style/Style.d.ts +3 -0
- package/es/header-helper/style/Style.js +34 -27
- package/es/header-helper/style/Style.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/pivot-header-layout.js +26 -8
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/tree-helper.js +4 -1
- package/es/layout/tree-helper.js.map +1 -1
- package/es/scenegraph/icon/icon-update.js +1 -0
- package/es/scenegraph/icon/icon-update.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +1 -1
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/select/update-position.js +1 -1
- package/es/state/select/update-position.js.map +1 -1
- package/es/state/state.js +7 -5
- package/es/state/state.js.map +1 -1
- package/es/themes/theme.js +3 -0
- package/es/themes/theme.js.map +1 -1
- package/es/ts-types/base-table.d.ts +3 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/column/style.d.ts +1 -0
- package/es/ts-types/column/style.js.map +1 -1
- package/es/ts-types/common.d.ts +4 -13
- package/es/ts-types/common.js.map +1 -1
- package/es/ts-types/icon.d.ts +1 -0
- package/es/ts-types/icon.js.map +1 -1
- package/es/ts-types/list-table/layout-map/api.d.ts +2 -1
- package/es/ts-types/list-table/layout-map/api.js.map +1 -1
- package/es/ts-types/pivot-table/dimension/basic-dimension.d.ts +3 -1
- package/es/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
- package/es/ts-types/pivot-table/indicator/basic-indicator.d.ts +1 -0
- package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
- package/es/ts-types/style-define.d.ts +1 -0
- package/es/ts-types/style-define.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +4 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/tooltip.d.ts +1 -0
- package/es/ts-types/tooltip.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/es/ts-types/icon.d.ts
CHANGED
package/es/ts-types/icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ts-types/icon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/icon.ts"],"names":[],"mappings":"AAgHA,MAAM,CAAN,IAAY,YAsBX;AAtBD,WAAY,YAAY;IAEtB,2CAA2B,CAAA;IAE3B,uCAAuB,CAAA;IAEvB,6BAAa,CAAA;IAEb,+BAAe,CAAA;IAEf,+CAA+B,CAAA;IAM/B,2CAA2B,CAAA;IAE3B,6CAA6B,CAAA;IAG7B,qCAAqB,CAAA;AACvB,CAAC,EAtBW,YAAY,KAAZ,YAAY,QAsBvB;AAMD,MAAM,CAAN,IAAY,gBAYX;AAZD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,iCAAa,CAAA;IACb,yCAAqB,CAAA;IACrB,mDAA+B,CAAA;IAC/B,iCAAa,CAAA;IACb,2CAAuB,CAAA;IACvB,qCAAiB,CAAA;IACjB,yCAAqB,CAAA;IACrB,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;IACnB,+CAA2B,CAAA;AAC7B,CAAC,EAZW,gBAAgB,KAAhB,gBAAgB,QAY3B;AACD,MAAM,CAAN,IAAY,gBAaX;AAbD,WAAY,gBAAgB;IAC1B,kDAA8B,CAAA;IAC9B,sDAAkC,CAAA;IAClC,kDAA8B,CAAA;IAE9B,6CAAyB,CAAA;IACzB,6CAAyB,CAAA;IACzB,2DAAuC,CAAA;IACvC,qDAAiC,CAAA;IAEjC,6CAAyB,CAAA;IACzB,iDAA6B,CAAA;IAC7B,uDAAmC,CAAA;AACrC,CAAC,EAbW,gBAAgB,KAAhB,gBAAgB,QAa3B","file":"icon.js","sourcesContent":["// ****** Icon配置信息,header ,以及列Icon *******9\n\nimport type { Placement } from './table-engine';\n\nexport interface IIconBase {\n /**\n * icon 是何种内容类型,如svg font。可用来约束不同类型的属性定义\n */\n type: 'font' | 'svg' | 'path' | 'image';\n /** icon的高度 */\n width?: number;\n /** icon的高度 */\n height?: number; // 如果是font图标 不设的话默认是字体高度\n /**\n * IconPosition枚举类型\n */\n positionType: IconPosition;\n /**\n * 和右侧元素间隔距离, 或者与单元格边界的间隔距离\n */\n marginRight?: number;\n /**\n * 和左侧元素间隔距离, 或者与单元格边界的间隔距离\n */\n marginLeft?: number;\n /**\n * icon名称,会作为内部缓存的key\n */\n name: string;\n /**\n * 重置VTable内部icon 指定icon的功能类型\n * 具有切换状态的功能性的图标请务必配置上, 如排序功能funcType配置sort,name配置sort_normal或ort_downward,或sort_upward\n */\n funcType?: IconFuncTypeEnum | string;\n /**\n * 响应hover 热区大小,及hover效果背景色\n */\n hover?: {\n width?: number;\n height?: number;\n bgColor: string;\n image?: string;\n };\n /** 鼠标hover到图标上后出现的具体鼠标样式 */\n cursor?: string;\n /**是否可见 默认'always' 可选:'always' | 'mouseenter_cell' | 'click_cell',常驻|hover到单元格时|选中单元格时。\n * 建议:如需使用 'mouseenter_cell' | 'click_cell',建议将positionTyle设为absoluteRight【即不占位】,否则占位的类型会影响视觉展示\n */\n visibleTime?: 'always' | 'mouseenter_cell' | 'click_cell';\n /**\n * 气泡框,按钮的的解释信息, 目前只支持hover行为触发\n */\n tooltip?: {\n title: string;\n /**气泡框位置,可选 top left right bottom */\n placement?: Placement;\n /** 气泡框的样式 不配的话会使用theme中的样式 */\n style?: {\n // font?: string;\n fontSize?: number;\n fontFamily?: string;\n color?: string;\n padding?: number[];\n bgColor?: string;\n arrowMark?: boolean;\n };\n disappearDelay?: number;\n };\n /**\n * 是否可交互 默认为true 目前已知不可交互按钮:下拉菜单状态\n */\n interactive?: boolean;\n}\n\n// ****** Column Icon Options *******\nexport interface FontIcon extends IIconBase {\n type: 'font';\n font?: string;\n content: string;\n color?: string;\n}\nexport interface ImageIcon extends IIconBase {\n type: 'image';\n src: string;\n /** 图片裁切形状 */\n shape?: 'circle' | 'square';\n}\n\nexport interface PathIcon extends IIconBase {\n type: 'path';\n path: string;\n color?: string;\n}\n\nexport interface SvgIcon extends IIconBase {\n type: 'svg';\n /**\n * svg内容,支持url或者path\n */\n svg: string;\n}\n\n// export interface NamedIcon extends IIconBase {\n// type: 'name';\n// color?: string;\n// }\n/**\n * icon 的位置\n * inlineFront:文本内容的前面,\n * inlineEnd:文本内容后面\n *\n */\nexport enum IconPosition {\n /**文本行内容前面的图标,跟随文本定位,随文本折行 */\n inlineFront = 'inlineFront',\n /**文本行内容后面的图标,跟随文本定位,随文本折行。如sort图表 放在文本内容的第一行 */\n inlineEnd = 'inlineEnd',\n /**单元格左侧按钮 且受padding影响 */\n left = 'left',\n /**单元格右侧按钮 受padding影响 如pin图表 */\n right = 'right',\n /**固定在右侧的图标,不占位,不受padding影响,可能压盖内容 如 dropDown */\n absoluteRight = 'absoluteRight',\n\n // todo 增加更丰富的配置\n // cellLeft = 'cellLeft', //cell内靠左侧布局的图标(占位但是不受padding影响?)\n // cellRight = 'cellRight', //cell内靠右侧布局的图标\n /**在单元格内容块的左侧的图标,跟随文本定位,不随文本折行 */\n contentLeft = 'contentLeft',\n /**在单元格内容块的右侧的图标,跟随文本定位,不随文本折行 */\n contentRight = 'contentRight',\n\n /**在单元格中自由定位 */\n absolute = 'absolute'\n}\n/**\n * 图标类型\n * frozen 固定列图标\n * sort 排序图标\n */\nexport enum IconFuncTypeEnum {\n frozen = 'frozen',\n sort = 'sort',\n dropDown = 'dropDown',\n dropDownState = 'dropDownState',\n play = 'play',\n damagePic = 'damagePic',\n expand = 'expand',\n collapse = 'collapse',\n drillDown = 'drillDown',\n drillUp = 'drillUp',\n dragReorder = 'dragReorder'\n}\nexport enum InternalIconName {\n upwardIconName = 'sort_upward',\n downwardIconName = 'sort_downward',\n normalIconName = 'sort_normal',\n //冻结列 图钉按钮的几种状态\n freezeIconName = 'freeze',\n frozenIconName = 'frozen',\n frozenCurrentIconName = 'frozenCurrent',\n dropdownIconName = 'dropdownIcon',\n // dropdownHoverIconName = 'dropdownIcon_hover',\n expandIconName = 'expand',\n collapseIconName = 'collapse',\n dragReorderIconName = 'dragReorder'\n}\n// 目前暂不支持FontIcon&PathIcon\nexport type ColumnIconOption = ImageIcon | SvgIcon;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CellAddress, CellRange, ColumnIconOption, ColumnStyle, ColumnStyleOption, FieldDef, FieldFormat, HeaderStyleOption, LayoutObjectId, MenuListItem, CellInfo, PivotInfo, CustomRenderFunctionArg, SparklineSpec, HierarchyState, Aggregation, IRowSeriesNumber } from '../../';
|
|
1
|
+
import type { CellAddress, CellRange, ColumnIconOption, ColumnStyle, ColumnStyleOption, FieldDef, FieldFormat, HeaderStyleOption, LayoutObjectId, MenuListItem, CellInfo, PivotInfo, CustomRenderFunctionArg, SparklineSpec, HierarchyState, Aggregation, IRowSeriesNumber, SortOption } from '../../';
|
|
2
2
|
import type { Aggregator } from '../../../dataset/statistics-helper';
|
|
3
3
|
import type { BaseTableAPI } from '../../base-table';
|
|
4
4
|
import type { HeaderDefine, ColumnDefine, ColumnBodyDefine } from '../define';
|
|
@@ -20,6 +20,7 @@ export interface HeaderData extends WidthData {
|
|
|
20
20
|
hierarchyState?: HierarchyState;
|
|
21
21
|
columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';
|
|
22
22
|
showSort?: boolean;
|
|
23
|
+
sort?: SortOption;
|
|
23
24
|
description?: string | ((args: CellInfo) => string);
|
|
24
25
|
isEmpty?: boolean;
|
|
25
26
|
parentCellId?: LayoutObjectId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ts-types/list-table/layout-map/api.ts"],"names":[],"mappings":"","file":"api.js","sourcesContent":["import type {\n CellAddress,\n CellRange,\n ColumnIconOption,\n ColumnStyle,\n ColumnStyleOption,\n // ColumnTypeOption,\n FieldDef,\n FieldFormat,\n HeaderStyleOption,\n LayoutObjectId,\n MenuListItem,\n IPivotTableCellHeaderPaths,\n CellInfo,\n // ICustomRenderFuc,\n // ICustomRenderObj,\n PivotInfo,\n FieldKeyDef,\n CustomRenderFunctionArg,\n SparklineSpec,\n HierarchyState,\n Aggregation,\n IRowSeriesNumber\n} from '../../';\nimport type { Aggregator } from '../../../dataset/statistics-helper';\nimport type { BaseTableAPI } from '../../base-table';\n\nimport type { HeaderDefine, ColumnDefine, ColumnBodyDefine } from '../define';\n\n// todo: 修改引用这些类型的路径\nexport type {\n HeaderDefine,\n ColumnDefine,\n ColumnBodyDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine\n} from '../define';\n\n/**\n * layout中组织表头的信息类 和HeaderDefine对应\n */\nexport interface HeaderData extends WidthData {\n id: LayoutObjectId;\n title?: string | (() => string);\n // captionIcon?: ColumnIconOption;\n headerIcon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n icons?: (string | ColumnIconOption)[] | ((args: CellInfo) => (string | ColumnIconOption)[]);\n\n field: FieldDef;\n fieldFormat?: FieldFormat;\n style?: HeaderStyleOption | ColumnStyle | null | undefined;\n headerType: 'text' | 'link' | 'image' | 'video' | 'checkbox'; // headerType.BaseHeader;\n define: ColumnDefine;\n // sortIconPosition?: RectProps;\n // freezeIconPosition?: RectProps;\n /**存储图标的位置 坐标及宽高 是包括了boxWidth boxWidth 共getHitIcon方法使用 计算是否命中图标*/\n // iconPositionList?: { [key in IconFuncTypeEnum]?: RectProps & { icon: ColumnIconOption } };\n dropDownMenu?: MenuListItem[];\n pivotInfo?: PivotInfo;\n /**\n * 维度层级level 从0开始:第0层 第1层\n */\n hierarchyLevel?: number;\n /**\n * 维度总层级数\n */\n dimensionTotalLevel?: number;\n /**\n * 层级展开or折叠状态\n */\n hierarchyState?: HierarchyState;\n columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';\n\n showSort?: boolean;\n\n /**\n * 表头描述 鼠标hover会提示该信息\n */\n description?: string | ((args: CellInfo) => string);\n\n // header内容为空\n isEmpty?: boolean;\n\n /** 记录当前表头节点的上级表头结点的cellId */\n parentCellId?: LayoutObjectId;\n}\n\nexport interface WidthData {\n width?: number | string;\n minWidth?: number | string;\n maxWidth?: number | string;\n columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';\n}\n/**\n * layout中组织body列的信息类 和ColumnDefine对应\n */\nexport interface ColumnData extends WidthData {\n id: LayoutObjectId;\n field: FieldDef;\n // fieldKey?: FieldKeyDef;\n fieldFormat?: FieldFormat;\n // icon?: ColumnIconOption | ColumnIconOption[];\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n\n cellType: 'text' | 'link' | 'image' | 'video' | 'sparkline' | 'progressbar' | 'chart' | 'checkbox' | 'radio';\n /** 如果是绘制图表库组件的图表类型 需要将注入的组件名称 写到chartType */\n chartModule?: string;\n /** 如果是绘制图表库组件的图表类型 统一图表配置chartSpec */\n chartSpec?: any | ((arg0: CellInfo) => any);\n chartInstance?: any;\n sparklineSpec?: SparklineSpec | ((arg0: CellInfo) => SparklineSpec);\n style: ColumnStyleOption | null | undefined;\n define: ColumnDefine;\n templateLink?: string;\n columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';\n /**存储图标的位置 坐标及宽高 是包括了boxWidth boxWidth 共getHitIcon方法使用 计算是否命中图标*/\n // iconPositionList?: { [key in IconFuncTypeEnum]?: RectProps & { icon: ColumnIconOption } };\n /**\n * 是否禁用调整列宽,如果是转置表格或者是透视表的指标是行方向指定 那该配置不生效\n */\n disableColumnResize?: boolean;\n aggregation?: Aggregation | Aggregation[];\n aggregator?: Aggregator | Aggregator[];\n /** 是否为子节点 即上层还有父节点 */\n isChildNode?: boolean;\n}\n\nexport interface IndicatorData extends WidthData {\n id: LayoutObjectId;\n field: string | number;\n /**\n * 唯一标识一种指标\n */\n indicatorKey: string;\n // fieldKey: FieldKeyDef;\n fieldFormat?: FieldFormat;\n cellType: 'text' | 'link' | 'image' | 'video' | 'sparkline' | 'progressbar' | 'chart'; //BaseColumn<T, any>;\n chartModule?: string;\n chartSpec?: any | ((arg0: CustomRenderFunctionArg) => any);\n chartInstance?: any;\n style?: ColumnStyleOption | null | undefined;\n define: ColumnDefine;\n // headerIcon?:\n // | (string | ColumnIconOption)[]\n // | ((args: CellInfo) => (string | ColumnIconOption)[]);\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n sparklineSpec?: SparklineSpec | ((arg0: CustomRenderFunctionArg) => SparklineSpec);\n /**\n * 是否禁用调整列宽,如果是转置表格或者是透视表的指标是行方向指定 那该配置不生效\n */\n disableColumnResize?: boolean;\n}\n\n/**\n * 序号列定义\n */\nexport interface SeriesNumberColumnData extends WidthData {\n id: LayoutObjectId;\n title?: string | (() => string);\n field?: FieldDef;\n // fieldKey?: FieldKeyDef;\n format?: (col?: number, row?: number, table?: BaseTableAPI) => any;\n // icon?: ColumnIconOption | ColumnIconOption[];\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n headerIcon?: string | ColumnIconOption | (string | ColumnIconOption)[];\n cellType: 'text' | 'link' | 'image' | 'video' | 'checkbox';\n style: ColumnStyleOption | null | undefined;\n define: IRowSeriesNumber;\n isChildNode?: false;\n}\n// Simple header\n\n// export interface GroupHeaderDefine extends HeaderDefine {\n// columns: HeadersDefine;\n// hideColumnsSubHeader?: boolean;\n// dropDownMenu?: MenuListItem[];\n// }\n// type Either<X, Y> =\n// | ({\n// [KX in keyof X]: X[KX];\n// } & {\n// [KY in Exclude<keyof Y, keyof X>]?: never;\n// })\n// | ({\n// [KY in keyof Y]: Y[KY];\n// } & {\n// [KX in Exclude<keyof X, keyof Y>]?: never;\n// });\n// export type HeaderColumnDefine = Either<GroupHeaderDefine, ColumnDefine>;\n// export type HeadersDefine = HeaderColumnDefine[];\n\n// Advanced layout\n\n// export interface HeaderCellDefine extends HeaderDefine {\n// colSpan?: number;\n// rowSpan?: number;\n// }\nexport type HeaderCellDefine = HeaderDefine & {\n colSpan?: number;\n rowSpan?: number;\n};\n\n// export interface CellDefine extends ColumnDefine {\n// colSpan?: number;\n// rowSpan?: number;\n// }\n\nexport type CellDefine = ColumnBodyDefine & {\n colSpan?: number;\n rowSpan?: number;\n};\n\nexport type ArrayLayoutDefine = CellDefine[][];\n/** @internal */\ninterface LayoutMapAPI {\n readonly headerLevelCount: number;\n readonly rowHeaderLevelCount: number;\n readonly columnHeaderLevelCount: number;\n readonly bodyRowSpanCount: number;\n readonly colCount: number | undefined;\n readonly rowCount: number | undefined;\n readonly columnWidths: WidthData[];\n readonly headerObjects: HeaderData[];\n readonly columnObjects: ColumnData[] | IndicatorData[];\n // transpose: boolean;\n // showHeader: boolean;\n isHeader: (col: number, row: number) => boolean;\n // isHeaderNode(col: number, row: number): boolean; //是否为叶子表头\n /**获取单元格header对象 包括field style type 等 */\n getHeader: (col: number, row: number) => HeaderData | SeriesNumberColumnData;\n /**获取对应header的field */\n getHeaderField: (col: number, row: number) => FieldDef;\n // getHeaderFieldKey(col: number, row: number): FieldKeyDef;\n /**获取单元格column对象 包括field style type 等 */\n getBody: (col: number, row: number) => ColumnData | IndicatorData | SeriesNumberColumnData;\n /**获取单元格标识key */\n getCellId: (col: number, row: number) => LayoutObjectId;\n getCellRange: (col: number, row: number) => CellRange;\n // getCellRangeTranspose(col: number, row: number): CellRange;\n // getBodyLayoutRangeById: (id: LayoutObjectId) => CellRange;\n getHeaderCellAdressById: (id: number) => CellAddress | undefined;\n getHeaderCellAddressByField: (field: string) => CellAddress | undefined;\n getRecordShowIndexByCell: (col: number, row: number) => number;\n getRecordStartRowByRecordIndex: (index: number) => number;\n /** 从定义中获取一列配置项width的定义值 */\n getColumnWidthDefined: (col: number) => WidthData;\n release: () => void;\n\n isFrozenColumn: (col: number, row?: number) => boolean;\n isRightFrozenColumn: (col: number, row?: number) => boolean;\n isFrozenRow: (col: number, row?: number) => boolean;\n isBottomFrozenRow: (col: number, row?: number) => boolean;\n}\n\nexport type { LayoutMapAPI };\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/list-table/layout-map/api.ts"],"names":[],"mappings":"","file":"api.js","sourcesContent":["import type {\n CellAddress,\n CellRange,\n ColumnIconOption,\n ColumnStyle,\n ColumnStyleOption,\n // ColumnTypeOption,\n FieldDef,\n FieldFormat,\n HeaderStyleOption,\n LayoutObjectId,\n MenuListItem,\n IPivotTableCellHeaderPaths,\n CellInfo,\n // ICustomRenderFuc,\n // ICustomRenderObj,\n PivotInfo,\n FieldKeyDef,\n CustomRenderFunctionArg,\n SparklineSpec,\n HierarchyState,\n Aggregation,\n IRowSeriesNumber,\n SortOption\n} from '../../';\nimport type { Aggregator } from '../../../dataset/statistics-helper';\nimport type { BaseTableAPI } from '../../base-table';\n\nimport type { HeaderDefine, ColumnDefine, ColumnBodyDefine } from '../define';\n\n// todo: 修改引用这些类型的路径\nexport type {\n HeaderDefine,\n ColumnDefine,\n ColumnBodyDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine\n} from '../define';\n\n/**\n * layout中组织表头的信息类 和HeaderDefine对应\n */\nexport interface HeaderData extends WidthData {\n id: LayoutObjectId;\n title?: string | (() => string);\n // captionIcon?: ColumnIconOption;\n headerIcon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n icons?: (string | ColumnIconOption)[] | ((args: CellInfo) => (string | ColumnIconOption)[]);\n\n field: FieldDef;\n fieldFormat?: FieldFormat;\n style?: HeaderStyleOption | ColumnStyle | null | undefined;\n headerType: 'text' | 'link' | 'image' | 'video' | 'checkbox'; // headerType.BaseHeader;\n define: ColumnDefine;\n // sortIconPosition?: RectProps;\n // freezeIconPosition?: RectProps;\n /**存储图标的位置 坐标及宽高 是包括了boxWidth boxWidth 共getHitIcon方法使用 计算是否命中图标*/\n // iconPositionList?: { [key in IconFuncTypeEnum]?: RectProps & { icon: ColumnIconOption } };\n dropDownMenu?: MenuListItem[];\n pivotInfo?: PivotInfo;\n /**\n * 维度层级level 从0开始:第0层 第1层\n */\n hierarchyLevel?: number;\n /**\n * 维度总层级数\n */\n dimensionTotalLevel?: number;\n /**\n * 层级展开or折叠状态\n */\n hierarchyState?: HierarchyState;\n columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';\n\n showSort?: boolean;\n sort?: SortOption;\n\n /**\n * 表头描述 鼠标hover会提示该信息\n */\n description?: string | ((args: CellInfo) => string);\n\n // header内容为空\n isEmpty?: boolean;\n\n /** 记录当前表头节点的上级表头结点的cellId */\n parentCellId?: LayoutObjectId;\n}\n\nexport interface WidthData {\n width?: number | string;\n minWidth?: number | string;\n maxWidth?: number | string;\n columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';\n}\n/**\n * layout中组织body列的信息类 和ColumnDefine对应\n */\nexport interface ColumnData extends WidthData {\n id: LayoutObjectId;\n field: FieldDef;\n // fieldKey?: FieldKeyDef;\n fieldFormat?: FieldFormat;\n // icon?: ColumnIconOption | ColumnIconOption[];\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n\n cellType: 'text' | 'link' | 'image' | 'video' | 'sparkline' | 'progressbar' | 'chart' | 'checkbox' | 'radio';\n /** 如果是绘制图表库组件的图表类型 需要将注入的组件名称 写到chartType */\n chartModule?: string;\n /** 如果是绘制图表库组件的图表类型 统一图表配置chartSpec */\n chartSpec?: any | ((arg0: CellInfo) => any);\n chartInstance?: any;\n sparklineSpec?: SparklineSpec | ((arg0: CellInfo) => SparklineSpec);\n style: ColumnStyleOption | null | undefined;\n define: ColumnDefine;\n templateLink?: string;\n columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';\n /**存储图标的位置 坐标及宽高 是包括了boxWidth boxWidth 共getHitIcon方法使用 计算是否命中图标*/\n // iconPositionList?: { [key in IconFuncTypeEnum]?: RectProps & { icon: ColumnIconOption } };\n /**\n * 是否禁用调整列宽,如果是转置表格或者是透视表的指标是行方向指定 那该配置不生效\n */\n disableColumnResize?: boolean;\n aggregation?: Aggregation | Aggregation[];\n aggregator?: Aggregator | Aggregator[];\n /** 是否为子节点 即上层还有父节点 */\n isChildNode?: boolean;\n}\n\nexport interface IndicatorData extends WidthData {\n id: LayoutObjectId;\n field: string | number;\n /**\n * 唯一标识一种指标\n */\n indicatorKey: string;\n // fieldKey: FieldKeyDef;\n fieldFormat?: FieldFormat;\n cellType: 'text' | 'link' | 'image' | 'video' | 'sparkline' | 'progressbar' | 'chart'; //BaseColumn<T, any>;\n chartModule?: string;\n chartSpec?: any | ((arg0: CustomRenderFunctionArg) => any);\n chartInstance?: any;\n style?: ColumnStyleOption | null | undefined;\n define: ColumnDefine;\n // headerIcon?:\n // | (string | ColumnIconOption)[]\n // | ((args: CellInfo) => (string | ColumnIconOption)[]);\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n sparklineSpec?: SparklineSpec | ((arg0: CustomRenderFunctionArg) => SparklineSpec);\n /**\n * 是否禁用调整列宽,如果是转置表格或者是透视表的指标是行方向指定 那该配置不生效\n */\n disableColumnResize?: boolean;\n}\n\n/**\n * 序号列定义\n */\nexport interface SeriesNumberColumnData extends WidthData {\n id: LayoutObjectId;\n title?: string | (() => string);\n field?: FieldDef;\n // fieldKey?: FieldKeyDef;\n format?: (col?: number, row?: number, table?: BaseTableAPI) => any;\n // icon?: ColumnIconOption | ColumnIconOption[];\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n headerIcon?: string | ColumnIconOption | (string | ColumnIconOption)[];\n cellType: 'text' | 'link' | 'image' | 'video' | 'checkbox';\n style: ColumnStyleOption | null | undefined;\n define: IRowSeriesNumber;\n isChildNode?: false;\n}\n// Simple header\n\n// export interface GroupHeaderDefine extends HeaderDefine {\n// columns: HeadersDefine;\n// hideColumnsSubHeader?: boolean;\n// dropDownMenu?: MenuListItem[];\n// }\n// type Either<X, Y> =\n// | ({\n// [KX in keyof X]: X[KX];\n// } & {\n// [KY in Exclude<keyof Y, keyof X>]?: never;\n// })\n// | ({\n// [KY in keyof Y]: Y[KY];\n// } & {\n// [KX in Exclude<keyof X, keyof Y>]?: never;\n// });\n// export type HeaderColumnDefine = Either<GroupHeaderDefine, ColumnDefine>;\n// export type HeadersDefine = HeaderColumnDefine[];\n\n// Advanced layout\n\n// export interface HeaderCellDefine extends HeaderDefine {\n// colSpan?: number;\n// rowSpan?: number;\n// }\nexport type HeaderCellDefine = HeaderDefine & {\n colSpan?: number;\n rowSpan?: number;\n};\n\n// export interface CellDefine extends ColumnDefine {\n// colSpan?: number;\n// rowSpan?: number;\n// }\n\nexport type CellDefine = ColumnBodyDefine & {\n colSpan?: number;\n rowSpan?: number;\n};\n\nexport type ArrayLayoutDefine = CellDefine[][];\n/** @internal */\ninterface LayoutMapAPI {\n readonly headerLevelCount: number;\n readonly rowHeaderLevelCount: number;\n readonly columnHeaderLevelCount: number;\n readonly bodyRowSpanCount: number;\n readonly colCount: number | undefined;\n readonly rowCount: number | undefined;\n readonly columnWidths: WidthData[];\n readonly headerObjects: HeaderData[];\n readonly columnObjects: ColumnData[] | IndicatorData[];\n // transpose: boolean;\n // showHeader: boolean;\n isHeader: (col: number, row: number) => boolean;\n // isHeaderNode(col: number, row: number): boolean; //是否为叶子表头\n /**获取单元格header对象 包括field style type 等 */\n getHeader: (col: number, row: number) => HeaderData | SeriesNumberColumnData;\n /**获取对应header的field */\n getHeaderField: (col: number, row: number) => FieldDef;\n // getHeaderFieldKey(col: number, row: number): FieldKeyDef;\n /**获取单元格column对象 包括field style type 等 */\n getBody: (col: number, row: number) => ColumnData | IndicatorData | SeriesNumberColumnData;\n /**获取单元格标识key */\n getCellId: (col: number, row: number) => LayoutObjectId;\n getCellRange: (col: number, row: number) => CellRange;\n // getCellRangeTranspose(col: number, row: number): CellRange;\n // getBodyLayoutRangeById: (id: LayoutObjectId) => CellRange;\n getHeaderCellAdressById: (id: number) => CellAddress | undefined;\n getHeaderCellAddressByField: (field: string) => CellAddress | undefined;\n getRecordShowIndexByCell: (col: number, row: number) => number;\n getRecordStartRowByRecordIndex: (index: number) => number;\n /** 从定义中获取一列配置项width的定义值 */\n getColumnWidthDefined: (col: number) => WidthData;\n release: () => void;\n\n isFrozenColumn: (col: number, row?: number) => boolean;\n isRightFrozenColumn: (col: number, row?: number) => boolean;\n isFrozenRow: (col: number, row?: number) => boolean;\n isBottomFrozenRow: (col: number, row?: number) => boolean;\n}\n\nexport type { LayoutMapAPI };\n"]}
|
|
@@ -3,7 +3,7 @@ import type { ICustomLayout } from '../../customLayout';
|
|
|
3
3
|
import type { FieldFormat } from '../../table-engine';
|
|
4
4
|
import type { ColumnIconOption } from '../../icon';
|
|
5
5
|
import type { MenuListItem } from '../../menu';
|
|
6
|
-
import type { BaseCellInfo, CellInfo } from '../../common';
|
|
6
|
+
import type { BaseCellInfo, CellInfo, SortOption } from '../../common';
|
|
7
7
|
import type { IEditor } from '@visactor/vtable-editors';
|
|
8
8
|
import type { BaseTableAPI } from '../../base-table';
|
|
9
9
|
export interface IBasicDimension {
|
|
@@ -18,7 +18,9 @@ export interface IBasicDimension {
|
|
|
18
18
|
drillUp?: boolean;
|
|
19
19
|
dropDownMenu?: MenuListItem[];
|
|
20
20
|
cornerDropDownMenu?: MenuListItem[];
|
|
21
|
+
sort?: SortOption;
|
|
21
22
|
showSort?: boolean;
|
|
23
|
+
showSortInCorner?: boolean;
|
|
22
24
|
dragHeader?: boolean;
|
|
23
25
|
headerCustomRender?: ICustomRender;
|
|
24
26
|
headerCustomLayout?: ICustomLayout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ts-types/pivot-table/dimension/basic-dimension.ts"],"names":[],"mappings":"","file":"basic-dimension.js","sourcesContent":["import type { ICustomRender, ICustomRenderFuc } from '../../customElement';\nimport type { ICustomLayout } from '../../customLayout';\nimport type { FieldFormat } from '../../table-engine';\nimport type { ColumnIconOption } from '../../icon';\nimport type { MenuListItem } from '../../menu';\nimport type { BaseCellInfo, CellInfo } from '../../common';\nimport type { IEditor } from '@visactor/vtable-editors';\nimport type { BaseTableAPI } from '../../base-table';\n\nexport interface IBasicDimension {\n /** 维度的唯一标识 对应数据集的字段名称 */\n dimensionKey: string; //\n /** 维度名称 角头可配置显示维度名称 */\n title: string;\n /** 维度值的format */\n headerFormat?: FieldFormat;\n /** 定义表头上的icon */\n headerIcon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n /** 维度作为行表头时起作用,表示该维度单元格的宽度 */\n width?: number | string;\n /** 维度作为行表头时起作用,表示该维度单元格的最小宽度 */\n minWidth?: number | string;\n /** 维度作为行表头时起作用,表示该维度单元格的最大宽度 */\n maxWidth?: number | string;\n\n // indicators?: IIndicator[]; //维度下的指标具体展示配置\n\n /** 显示向下钻取图标 点击后会有对应事件 */\n drillDown?: boolean;\n /** 显示向上钻取图标 点击后会有对应事件 */\n drillUp?: boolean;\n /** 单元格显示下拉按钮及下拉菜单*/\n dropDownMenu?: MenuListItem[];\n /** 角头单元格显示下拉按钮及下拉菜单*/\n cornerDropDownMenu?: MenuListItem[];\n /**
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/pivot-table/dimension/basic-dimension.ts"],"names":[],"mappings":"","file":"basic-dimension.js","sourcesContent":["import type { ICustomRender, ICustomRenderFuc } from '../../customElement';\nimport type { ICustomLayout } from '../../customLayout';\nimport type { FieldFormat } from '../../table-engine';\nimport type { ColumnIconOption } from '../../icon';\nimport type { MenuListItem } from '../../menu';\nimport type { BaseCellInfo, CellInfo, SortOption } from '../../common';\nimport type { IEditor } from '@visactor/vtable-editors';\nimport type { BaseTableAPI } from '../../base-table';\n\nexport interface IBasicDimension {\n /** 维度的唯一标识 对应数据集的字段名称 */\n dimensionKey: string; //\n /** 维度名称 角头可配置显示维度名称 */\n title: string;\n /** 维度值的format */\n headerFormat?: FieldFormat;\n /** 定义表头上的icon */\n headerIcon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n /** 维度作为行表头时起作用,表示该维度单元格的宽度 */\n width?: number | string;\n /** 维度作为行表头时起作用,表示该维度单元格的最小宽度 */\n minWidth?: number | string;\n /** 维度作为行表头时起作用,表示该维度单元格的最大宽度 */\n maxWidth?: number | string;\n\n // indicators?: IIndicator[]; //维度下的指标具体展示配置\n\n /** 显示向下钻取图标 点击后会有对应事件 */\n drillDown?: boolean;\n /** 显示向上钻取图标 点击后会有对应事件 */\n drillUp?: boolean;\n /** 单元格显示下拉按钮及下拉菜单*/\n dropDownMenu?: MenuListItem[];\n /** 角头单元格显示下拉按钮及下拉菜单*/\n cornerDropDownMenu?: MenuListItem[];\n /** sort排序规则 */\n sort?: SortOption;\n /** 显示sort排序icon。为了仅仅显示图标,无排序逻辑 */\n showSort?: boolean;\n /** 在角头的维度名称单元格中是否显示排序 */\n showSortInCorner?: boolean;\n /** 是否可以拖拽表头换位置 */\n dragHeader?: boolean;\n /** 表头自定义渲染内容定义 */\n headerCustomRender?: ICustomRender;\n /** 表头自定义布局元素 */\n headerCustomLayout?: ICustomLayout;\n\n /**\n * 描述信息 hover时提示信息\n */\n description?: string | ((args: CellInfo) => string);\n /**\n * 描述信息 hover时提示信息\n */\n cornerDescription?: string;\n\n // /** 点击表头单元格时连带body整行或整列选中 或仅选中当前单元格,默认或整行或整列选中*/\n // headerSelectMode?: 'inline' | 'cell';\n /** 该维度单元格不支持hover交互行为 */\n disableHeaderHover?: boolean;\n /** 该维度单元格不支持选中 */\n disableHeaderSelect?: boolean;\n /** 设置表头编辑器 */\n headerEditor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n}\n"]}
|
|
@@ -11,6 +11,7 @@ export interface IBasicHeaderIndicator {
|
|
|
11
11
|
title?: string;
|
|
12
12
|
headerIcon?: (string | ColumnIconOption)[] | ((args: CellInfo) => (string | ColumnIconOption)[]);
|
|
13
13
|
dropDownMenu?: MenuListItem[];
|
|
14
|
+
sort?: boolean;
|
|
14
15
|
showSort?: boolean;
|
|
15
16
|
disableColumnResize?: boolean;
|
|
16
17
|
headerCustomRender?: ICustomRender;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ts-types/pivot-table/indicator/basic-indicator.ts"],"names":[],"mappings":"","file":"basic-indicator.js","sourcesContent":["import type { ICustomRender } from '../../customElement';\nimport type { ICustomLayout } from '../../customLayout';\nimport type { FieldFormat } from '../../table-engine';\nimport type { ColumnIconOption } from '../../icon';\nimport type { MenuListItem } from '../../menu';\nimport type { BaseCellInfo, CellInfo } from '../../common';\nimport type { IEditor } from '@visactor/vtable-editors';\nimport type { BaseTableAPI } from '../../base-table';\n\nexport interface IBasicHeaderIndicator {\n // 单种指标属性配置\n indicatorKey: string; // 指标的唯一标识 用处对应到具体数据查询阶段 flat数据\n title?: string; // 指标名\n // headerType?: HeaderTypeOption | null; //指标表头类型\n // headerStyle?: HeaderStyleOption | null; //指标名称在表头部分显示类型\n headerIcon?: (string | ColumnIconOption)[] | ((args: CellInfo) => (string | ColumnIconOption)[]);\n\n // linkJump?: boolean;\n // linkDetect?: boolean;\n // templateLink?: string;\n\n // chartSpec?: any | ((arg0: CustomRenderFunctionArg) => any);\n // chartModule?: string; // 如果配置了columnType未chart,chartType来指定图表组件类型 如'vchart' 需要从预先register的图表类型获取\n // sparklineSpec?: SparklineSpec | ((arg0: CustomRenderFunctionArg) => SparklineSpec);\n\n dropDownMenu?: MenuListItem[]; // 针对单独指标上配置下拉按钮\n
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/pivot-table/indicator/basic-indicator.ts"],"names":[],"mappings":"","file":"basic-indicator.js","sourcesContent":["import type { ICustomRender } from '../../customElement';\nimport type { ICustomLayout } from '../../customLayout';\nimport type { FieldFormat } from '../../table-engine';\nimport type { ColumnIconOption } from '../../icon';\nimport type { MenuListItem } from '../../menu';\nimport type { BaseCellInfo, CellInfo } from '../../common';\nimport type { IEditor } from '@visactor/vtable-editors';\nimport type { BaseTableAPI } from '../../base-table';\n\nexport interface IBasicHeaderIndicator {\n // 单种指标属性配置\n indicatorKey: string; // 指标的唯一标识 用处对应到具体数据查询阶段 flat数据\n title?: string; // 指标名\n // headerType?: HeaderTypeOption | null; //指标表头类型\n // headerStyle?: HeaderStyleOption | null; //指标名称在表头部分显示类型\n headerIcon?: (string | ColumnIconOption)[] | ((args: CellInfo) => (string | ColumnIconOption)[]);\n\n // linkJump?: boolean;\n // linkDetect?: boolean;\n // templateLink?: string;\n\n // chartSpec?: any | ((arg0: CustomRenderFunctionArg) => any);\n // chartModule?: string; // 如果配置了columnType未chart,chartType来指定图表组件类型 如'vchart' 需要从预先register的图表类型获取\n // sparklineSpec?: SparklineSpec | ((arg0: CustomRenderFunctionArg) => SparklineSpec);\n\n dropDownMenu?: MenuListItem[]; // 针对单独指标上配置下拉按钮\n /** sort排序规则 */\n sort?: boolean;\n /** 显示sort排序icon。为了仅仅显示图标,无排序逻辑 */\n showSort?: boolean;\n disableColumnResize?: boolean; // 是否禁用调整列宽,如果是转置表格或者是透视表的指标是行方向指定 那该配置不生效\n\n /** 指标名称表头自定义渲染内容定义 */\n headerCustomRender?: ICustomRender; // header单元格的自定义内容\n /** 指标名称表头自定义布局元素 */\n headerCustomLayout?: ICustomLayout;\n editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n\n // /** 点击表头单元格时连带body整行或整列选中 或仅选中当前单元格,默认或整行或整列选中*/\n // headerSelectMode?: 'inline' | 'cell';\n /** 该指标表头单元格不支持hover交互行为 */\n disableHeaderHover?: boolean;\n /** 该指标表头单元格不支持选中 */\n disableHeaderSelect?: boolean;\n /** 设置表头编辑器 */\n headerEditor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n}\n\nexport interface IBasicColumnIndicator {\n width?: string | number;\n minWidth?: number | string;\n maxWidth?: number | string;\n format?: FieldFormat; // 指标值格式化\n headerFormat?: FieldFormat; // 指标名称格式化\n // cellType?: ColumnTypeOption | BaseColumn<any, any> | null; // body指标值显示类型\n // style?: ColumnStyleOption | null; // body部分指标值显示样式\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n\n /** 指标值body单元格自定义渲染内容定义 */\n customRender?: ICustomRender; // body单元格的自定义内容\n /** 指标值body单元格自定义布局元素 */\n customLayout?: ICustomLayout;\n\n /** 该指标内容不支持hover交互行为 */\n disableHover?: boolean;\n /** 该指标内容不支持选中 */\n disableSelect?: boolean;\n}\n"]}
|
|
@@ -39,6 +39,7 @@ export type CellStyle = {
|
|
|
39
39
|
padding: PaddingsDef;
|
|
40
40
|
textBaseline: CanvasTextBaseline;
|
|
41
41
|
color: CanvasRenderingContext2D['fillStyle'];
|
|
42
|
+
strokeColor?: CanvasRenderingContext2D['fillStyle'];
|
|
42
43
|
bgColor: CanvasRenderingContext2D['fillStyle'];
|
|
43
44
|
fontSize: number;
|
|
44
45
|
fontFamily: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ts-types/style-define.ts"],"names":[],"mappings":"","file":"style-define.js","sourcesContent":["import type { BaseTableAPI } from './base-table';\nimport type { ColorsDef, ICellHeaderPaths, LineDashsDef, LineWidthsDef, PaddingsDef } from './common';\nimport type { ColumnIconOption } from './icon';\nimport type { FieldData } from './table-engine';\n\n// ****** TextStyle Options *******\nexport type TextOverflow = string /* a char */; //设置一行的省略形式,另外还有clip。如果autoWrapText设置了自动换行,这个无效\nexport type LineClamp = number | 'auto'; //设置单元格显示的行数,如果不设置的话 默认全部展示直到超过了显示范围,会截断暂时文本,如果设置了auto,显示不了的文本会出现省略号\nexport type TextAlignType = 'center' | 'end' | 'left' | 'right' | 'start'; // 设置单元格内文字的水平对齐方式\nexport type TextBaselineType = 'alphabetic' | 'bottom' | 'middle' | 'top'; // 设置单元格内文字的垂直对齐方式\n\nexport interface StylePropertyFunctionArg {\n row: number;\n col: number;\n /** 表格实例 */\n table: BaseTableAPI;\n /**有format的话 格式化后或者计算后的值 */\n value?: FieldData;\n /**原始值 */\n dataValue?: FieldData;\n /** progressbar类型特有,表示当前数值在总体数据范围的比例 */\n percentile?: number;\n /** 单元格的表头路径信息 */\n cellHeaderPaths: ICellHeaderPaths;\n}\nexport type ColorPropertyDefine =\n | string\n | ((args: StylePropertyFunctionArg) => string)\n | ((args: StylePropertyFunctionArg) => CanvasGradient)\n | ((args: StylePropertyFunctionArg) => CanvasPattern);\n\nexport type ColorsPropertyDefine =\n | ColorPropertyDefine\n | (string | null)[]\n | ((args: StylePropertyFunctionArg) => (string | null)[]);\n\nexport type LineWidthPropertyDefine = number | ((args: StylePropertyFunctionArg) => number);\n\nexport type LineWidthsPropertyDefine =\n | LineWidthPropertyDefine\n | (number | null)[]\n | ((args: StylePropertyFunctionArg) => (number | null)[]);\n\nexport type LineDashPropertyDefine = Array<number> | ((args: StylePropertyFunctionArg) => Array<number>);\n\nexport type LineDashsPropertyDefine =\n | LineDashPropertyDefine\n | (Array<number> | null)[]\n | ((args: StylePropertyFunctionArg) => (Array<number> | null)[]);\n\n// export type FontPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\nexport type FontSizePropertyDefine = number | ((args: StylePropertyFunctionArg) => number);\nexport type FontFamilyPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\nexport type FontWeightPropertyDefine = string | number | ((args: StylePropertyFunctionArg) => string | number);\nexport type FontVariantPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\nexport type FontStylePropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\n\nexport type TagPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\n\nexport type CursorPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\n\nexport type IconPropertyDefine =\n | string\n | ColumnIconOption\n | ((args: StylePropertyFunctionArg) => string | ColumnIconOption);\n\nexport type UnderlinePropertyDefine = boolean | ((args: StylePropertyFunctionArg) => boolean);\nexport type LineThroughPropertyDefine = boolean | ((args: StylePropertyFunctionArg) => boolean);\n\nexport type PaddingPropertyDefine = number | ((args: StylePropertyFunctionArg) => number);\n\nexport type PaddingsPropertyDefine =\n | PaddingPropertyDefine\n | (number | null)[]\n | ((args: StylePropertyFunctionArg) => (number | null)[]);\n\nexport type MarkedPropertyDefine = boolean | ((args: StylePropertyFunctionArg) => boolean);\n\nexport type CellStyle = {\n textAlign: CanvasTextAlign;\n padding: PaddingsDef;\n textBaseline: CanvasTextBaseline;\n color: CanvasRenderingContext2D['fillStyle'];\n bgColor: CanvasRenderingContext2D['fillStyle'];\n // font: string;\n fontSize: number;\n fontFamily: string;\n fontWeight: string | number;\n fontVariant: string;\n fontStyle: string;\n // lineHeight: string | number;\n lineHeight: number;\n autoWrapText: boolean;\n lineClamp: LineClamp;\n textOverflow: TextOverflow;\n borderColor: ColorsDef;\n borderLineWidth: LineWidthsDef;\n borderLineDash: LineDashsDef;\n underline: boolean;\n // underlineColor: CanvasRenderingContext2D['strokeStyle'];\n underlineWidth: number;\n underlineDash: number[];\n underlineOffset: number;\n lineThrough: boolean;\n // lineThroughColor: CanvasRenderingContext2D['strokeStyle'];\n // lineThroughDash: number[];\n lineThroughLineWidth: number;\n\n _strokeArrayWidth: number[];\n _strokeArrayColor: string[];\n _linkColor: CanvasRenderingContext2D['fillStyle'];\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/style-define.ts"],"names":[],"mappings":"","file":"style-define.js","sourcesContent":["import type { BaseTableAPI } from './base-table';\nimport type { ColorsDef, ICellHeaderPaths, LineDashsDef, LineWidthsDef, PaddingsDef } from './common';\nimport type { ColumnIconOption } from './icon';\nimport type { FieldData } from './table-engine';\n\n// ****** TextStyle Options *******\nexport type TextOverflow = string /* a char */; //设置一行的省略形式,另外还有clip。如果autoWrapText设置了自动换行,这个无效\nexport type LineClamp = number | 'auto'; //设置单元格显示的行数,如果不设置的话 默认全部展示直到超过了显示范围,会截断暂时文本,如果设置了auto,显示不了的文本会出现省略号\nexport type TextAlignType = 'center' | 'end' | 'left' | 'right' | 'start'; // 设置单元格内文字的水平对齐方式\nexport type TextBaselineType = 'alphabetic' | 'bottom' | 'middle' | 'top'; // 设置单元格内文字的垂直对齐方式\n\nexport interface StylePropertyFunctionArg {\n row: number;\n col: number;\n /** 表格实例 */\n table: BaseTableAPI;\n /**有format的话 格式化后或者计算后的值 */\n value?: FieldData;\n /**原始值 */\n dataValue?: FieldData;\n /** progressbar类型特有,表示当前数值在总体数据范围的比例 */\n percentile?: number;\n /** 单元格的表头路径信息 */\n cellHeaderPaths: ICellHeaderPaths;\n}\nexport type ColorPropertyDefine =\n | string\n | ((args: StylePropertyFunctionArg) => string)\n | ((args: StylePropertyFunctionArg) => CanvasGradient)\n | ((args: StylePropertyFunctionArg) => CanvasPattern);\n\nexport type ColorsPropertyDefine =\n | ColorPropertyDefine\n | (string | null)[]\n | ((args: StylePropertyFunctionArg) => (string | null)[]);\n\nexport type LineWidthPropertyDefine = number | ((args: StylePropertyFunctionArg) => number);\n\nexport type LineWidthsPropertyDefine =\n | LineWidthPropertyDefine\n | (number | null)[]\n | ((args: StylePropertyFunctionArg) => (number | null)[]);\n\nexport type LineDashPropertyDefine = Array<number> | ((args: StylePropertyFunctionArg) => Array<number>);\n\nexport type LineDashsPropertyDefine =\n | LineDashPropertyDefine\n | (Array<number> | null)[]\n | ((args: StylePropertyFunctionArg) => (Array<number> | null)[]);\n\n// export type FontPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\nexport type FontSizePropertyDefine = number | ((args: StylePropertyFunctionArg) => number);\nexport type FontFamilyPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\nexport type FontWeightPropertyDefine = string | number | ((args: StylePropertyFunctionArg) => string | number);\nexport type FontVariantPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\nexport type FontStylePropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\n\nexport type TagPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\n\nexport type CursorPropertyDefine = string | ((args: StylePropertyFunctionArg) => string);\n\nexport type IconPropertyDefine =\n | string\n | ColumnIconOption\n | ((args: StylePropertyFunctionArg) => string | ColumnIconOption);\n\nexport type UnderlinePropertyDefine = boolean | ((args: StylePropertyFunctionArg) => boolean);\nexport type LineThroughPropertyDefine = boolean | ((args: StylePropertyFunctionArg) => boolean);\n\nexport type PaddingPropertyDefine = number | ((args: StylePropertyFunctionArg) => number);\n\nexport type PaddingsPropertyDefine =\n | PaddingPropertyDefine\n | (number | null)[]\n | ((args: StylePropertyFunctionArg) => (number | null)[]);\n\nexport type MarkedPropertyDefine = boolean | ((args: StylePropertyFunctionArg) => boolean);\n\nexport type CellStyle = {\n textAlign: CanvasTextAlign;\n padding: PaddingsDef;\n textBaseline: CanvasTextBaseline;\n color: CanvasRenderingContext2D['fillStyle'];\n strokeColor?: CanvasRenderingContext2D['fillStyle'];\n bgColor: CanvasRenderingContext2D['fillStyle'];\n // font: string;\n fontSize: number;\n fontFamily: string;\n fontWeight: string | number;\n fontVariant: string;\n fontStyle: string;\n // lineHeight: string | number;\n lineHeight: number;\n autoWrapText: boolean;\n lineClamp: LineClamp;\n textOverflow: TextOverflow;\n borderColor: ColorsDef;\n borderLineWidth: LineWidthsDef;\n borderLineDash: LineDashsDef;\n underline: boolean;\n // underlineColor: CanvasRenderingContext2D['strokeStyle'];\n underlineWidth: number;\n underlineDash: number[];\n underlineOffset: number;\n lineThrough: boolean;\n // lineThroughColor: CanvasRenderingContext2D['strokeStyle'];\n // lineThroughDash: number[];\n lineThroughLineWidth: number;\n\n _strokeArrayWidth: number[];\n _strokeArrayColor: string[];\n _linkColor: CanvasRenderingContext2D['fillStyle'];\n};\n"]}
|
|
@@ -228,7 +228,10 @@ export interface PivotTableAPI extends BaseTableAPI {
|
|
|
228
228
|
records?: any;
|
|
229
229
|
options: PivotTableConstructorOptions;
|
|
230
230
|
editorManager: EditManeger;
|
|
231
|
-
pivotSortState:
|
|
231
|
+
pivotSortState: {
|
|
232
|
+
dimensions: IDimensionInfo[];
|
|
233
|
+
order: SortOrder;
|
|
234
|
+
}[];
|
|
232
235
|
isListTable: () => false;
|
|
233
236
|
isPivotTable: () => true;
|
|
234
237
|
getPivotSortState: (col: number, row: number) => SortOrder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ts-types/table-engine.ts"],"names":[],"mappings":"AAoeA,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,4BAAe,CAAA;AACjB,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB","file":"table-engine.js","sourcesContent":["import type { RectProps, MaybePromiseOrUndefined, IDimensionInfo, SortOrder, BaseCellInfo, CellInfo } from './common';\nimport type { ColumnIconOption, SvgIcon } from './icon';\nexport type { HeaderData } from './list-table/layout-map/api';\nexport type LayoutObjectId = number | string;\nimport type { Rect } from '../tools/Rect';\nimport type { BaseTableAPI, BaseTableConstructorOptions, ListTableProtected } from './base-table';\nimport type {\n Aggregation,\n AggregationType,\n CustomAggregation,\n FilterRules,\n IPivotTableDataConfig\n} from './new-data-set';\nimport type { Either } from '../tools/helper';\nimport type {\n IChartIndicator,\n IColumnDimension,\n ICornerDefine,\n IDimension,\n IIndicator,\n IRowDimension,\n ITitleDefine\n} from './pivot-table';\nimport type { ColumnsDefine } from './list-table';\nimport type { ICellAxisOption, ITableAxisOption } from './component/axis';\nimport type { IEditor } from '@visactor/vtable-editors';\nimport type { ITextStyleOption } from '../body-helper/style';\nimport type { DataSource } from '../data';\nimport type { EditManeger } from '../edit/edit-manager';\nimport type { ICustomRender } from './customElement';\nimport type { ICustomLayout } from './customLayout';\nimport type { StylePropertyFunctionArg } from './style-define';\n\nexport interface CellAddress {\n col: number;\n row: number;\n}\nexport interface CellAddressWithBound {\n col: number;\n row: number;\n rect?: RectProps;\n x?: number;\n y?: number;\n}\nexport interface CellRange {\n start: CellAddress;\n end: CellAddress;\n}\n\nexport type FieldGetter = (record: any, col?: number, row?: number, table?: BaseTableAPI) => any;\nexport type FieldSetter = (record: any, value: any) => void;\nexport interface FieldAssessor {\n get: FieldGetter;\n set: FieldSetter;\n}\n\nexport type FieldDef = string | number | string[];\nexport type FieldKeyDef = string | number;\nexport type FieldFormat = FieldGetter | FieldAssessor;\n\nexport type FieldData = MaybePromiseOrUndefined;\n\nexport type WidthModeDef = 'standard' | 'adaptive' | 'autoWidth';\nexport type HeightModeDef = 'standard' | 'adaptive' | 'autoHeight';\nexport type WidthAdaptiveModeDef = 'only-body' | 'all';\nexport type HeightAdaptiveModeDef = 'only-body' | 'all';\nexport type ShowColumnRowType = 'column' | 'row' | 'none';\n/** 单元格所处表格哪部分 */\nexport type CellLocation = 'body' | 'rowHeader' | 'columnHeader' | 'cornerHeader';\nexport type CellSubLocation =\n | 'body'\n | 'rowHeader'\n | 'columnHeader'\n | 'cornerHeader'\n | 'bottomFrozen'\n | 'rightFrozen'\n | 'rightTopCorner'\n | 'leftBottomCorner'\n | 'rightBottomCorner'\n | 'rowSeriesNumber'\n | 'colSeriesNumber';\n\nexport interface SelectAllOnCtrlAOption {\n disableHeaderSelect?: boolean;\n disableRowSeriesNumberSelect?: boolean;\n}\n\nexport interface TableKeyboardOptions {\n /** tab键 默认为true。开启tab键移动选中单元格,如果当前是在编辑单元格 则移动到下一个单元格也是编辑状态 */\n moveFocusCellOnTab?: boolean;\n /** enter键 默认true 如果选中单元格可编辑则进入单元格编辑*/\n editCellOnEnter?: boolean;\n /** 默认不开启即false。开启这个配置的话,如果当前是在编辑中的单元格,方向键可以移动到下个单元格并进入编辑状态,而不是编辑文本内字符串的光标移动。上下左右方向键切换选中单元格不受该配置影响,*/\n moveEditCellOnArrowKeys?: boolean;\n /** 开启快捷键全选 默认:false */\n selectAllOnCtrlA?: boolean | SelectAllOnCtrlAOption;\n /** 快捷键复制 默认:false*/\n copySelected?: boolean; //这个copy是和浏览器的快捷键一致的\n /** 快捷键粘贴,默认:false 。粘贴内容到指定位置(即粘贴前要有选中的单元格);支持批量粘贴;粘贴生效仅针对配置了编辑 editor 的单元格;*/\n pasteValueToCell?: boolean; //paste是和浏览器的快捷键一致的\n}\nexport interface TableEventOptions {\n /** 是否阻止右键的默认行为, 默认为true。*/\n preventDefaultContextMenu?: boolean;\n}\n\nexport interface IRowSeriesNumber {\n width?: number | 'auto';\n // align?: 'left' | 'right';\n // span?: number | 'dependOnNear';\n title?: string;\n // field?: FieldDef;\n format?: (col?: number, row?: number, table?: BaseTableAPI) => any;\n cellType?: 'text' | 'link' | 'image' | 'video' | 'checkbox';\n style?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n headerStyle?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n headerIcon?: string | ColumnIconOption | (string | ColumnIconOption)[];\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n // /** 选中整行或者全选时 是否包括序号部分 */\n // selectRangeInclude?: boolean;\n /** 是否可拖拽顺序 */\n dragOrder?: boolean;\n /** 是否禁止列宽调整 */\n disableColumnResize?: boolean;\n}\n\nexport interface ColumnSeriesNumber {\n enable: boolean;\n align?: 'top' | 'bottom';\n span?: number | 'dependOnNear';\n title?: string;\n field?: FieldDef;\n format?: (col?: number, row?: number, table?: BaseTableAPI) => any;\n cellType?: 'text' | 'link' | 'image' | 'video' | 'checkbox';\n style?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n headerStyle?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n /** 选中整行或者全选时 是否包括序号部分 */\n selectRangeInclude?: boolean;\n /** 是否可拖拽顺序 */\n dragOrder?: boolean;\n /** 是否显示调换顺序的图标 */\n showDragOrderIcon?: boolean;\n}\nexport interface DataSourceAPI {\n clearCurrentIndexedData: () => void;\n length: number;\n get: (index: number) => MaybePromiseOrUndefined;\n getField: <F extends FieldDef>(index: number, field: F, col: number, row: number, table: BaseTableAPI) => FieldData;\n hasField: (index: number, field: FieldDef) => boolean;\n sort: (field: FieldDef, order: SortOrder, orderFn: (v1: any, v2: any, order: SortOrder) => -1 | 0 | 1) => void;\n clearSortedMap: () => void;\n updatePagination: (pagination: IPagination) => void;\n getIndexKey: (index: number) => number | number[];\n /** 数据是否为树形结构 且可以展开收起 */\n hierarchyExpandLevel: number;\n}\n\nexport interface SortState {\n /** 排序依据字段 */\n field: FieldDef;\n /** 排序规则 */\n order: SortOrder;\n}\nexport interface PivotSortState {\n col: number;\n row: number;\n order: SortOrder;\n}\n\n/**\n * 分页配置\n */\nexport interface IPagination {\n /** 数据总条数 透视表中这个数据会自动加上 不需用户传入*/\n totalCount?: number;\n /** 每页显示数据条数 */\n perPageCount: number;\n /** 每页显示条数 */\n currentPage?: number;\n}\nexport type HeaderValues = Map<any, any>;\nexport interface ListTableConstructorOptions extends BaseTableConstructorOptions {\n /**\n * 数据集合\n */\n records?: any[];\n /**\n * 传入用户实例化的数据对象 目前不完善\n */\n dataSource?: DataSource;\n /**\n * 是否显示表头\n */\n showHeader?: boolean;\n /**\n * Simple header property\n */\n columns?: ColumnsDefine; //请不要再这个上面修改配置,这里相当于是一个原始值备份,有一个内部专用的protectspace.columns\n /**\n *@deprecated 已废弃 请使用columns\n */\n header?: ColumnsDefine;\n\n transpose?: boolean; //是否转置\n /**\n * 展示为tree的列 层级缩进值\n */\n hierarchyIndent?: number;\n /** 展开层数 默认为1只显示根节点*/\n hierarchyExpandLevel?: number;\n /** 同层级的结点是否按文字对齐 如没有收起展开图标的节点和有图标的节点文字对齐 默认false */\n hierarchyTextStartAlignment?: boolean;\n /** 分页配置 */\n pagination?: IPagination;\n\n /**\n * 排序状态\n */\n sortState?: SortState | SortState[];\n\n /** 全局设置表头编辑器 */\n headerEditor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 全局设置编辑器 */\n editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 编辑触发时机 双击事件 单击事件 api手动开启编辑。默认为双击'doubleclick' */\n editCellTrigger?: 'doubleclick' | 'click' | 'api';\n /** 拖拽表头移动位置 针对冻结部分的规则 默认为fixedFrozenCount\n * \"disabled\"(禁止调整冻结列位置):不允许其他列的表头移入冻结列,也不允许冻结列移出,冻结列保持不变。\n * \"adjustFrozenCount\"(根据交互结果调整冻结数量):允许其他列的表头移入冻结列,及冻结列移出,并根据拖拽的动作调整冻结列的数量。当其他列的表头被拖拽进入冻结列位置时,冻结列数量增加;当其他列的表头被拖拽移出冻结列位置时,冻结列数量减少。\n * \"fixedFrozenCount\"(可调整冻结列,并维持冻结数量不变):允许自由拖拽其他列的表头移入或移出冻结列位置,同时保持冻结列的数量不变。\n */\n frozenColDragHeaderMode?: 'disabled' | 'adjustFrozenCount' | 'fixedFrozenCount';\n aggregation?:\n | Aggregation\n | CustomAggregation\n | (Aggregation | CustomAggregation)[]\n | ((args: {\n col: number;\n field: string;\n }) => Aggregation | CustomAggregation | (Aggregation | CustomAggregation)[] | null);\n}\n\nexport interface ListTableAPI extends BaseTableAPI {\n options: ListTableConstructorOptions;\n editorManager: EditManeger;\n sortState: SortState[] | SortState | null;\n // /** 数据分析相关配置 */\n // dataConfig?: IListTableDataConfig;\n internalProps: ListTableProtected;\n isListTable: () => true;\n isPivotTable: () => false;\n /** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */\n changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell?: boolean) => void;\n /**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n * @param workOnEditableCell 是否仅更改可编辑单元格\n */\n changeCellValues: (col: number, row: number, values: (string | number)[][], workOnEditableCell?: boolean) => void;\n getFieldData: (field: FieldDef | FieldFormat | undefined, col: number, row: number) => FieldData;\n //#region 编辑器相关demo\n /** 获取单元格配置的编辑器 */\n getEditor: (col: number, row: number) => IEditor;\n /** 开启单元格编辑 */\n startEditCell: (col?: number, row?: number) => void;\n /** 结束编辑 */\n completeEditCell: () => void;\n //#endregion\n addRecord: (record: any, recordIndex?: number) => void;\n addRecords: (records: any[], recordIndex?: number) => void;\n deleteRecords: (recordIndexs: number[]) => void;\n updateRecords: (records: any[], recordIndexs: number[]) => void;\n updateFilterRules: (filterRules: FilterRules) => void;\n getAggregateValuesByField: (field: string | number) => {\n col: number;\n aggregateValue: { aggregationType: AggregationType; value: number | string }[];\n }[];\n}\nexport interface PivotTableConstructorOptions extends BaseTableConstructorOptions {\n /**\n * 数据集合\n */\n records?: any[];\n /**\n * 调整列宽的生效范围:'column' | 'indicator' | 'all' | 'indicatorGroup',单列|按指标|所有列|属于同一维度值的多个指标\n */\n columnResizeType?: 'column' | 'indicator' | 'all' | 'indicatorGroup';\n rowResizeType?: 'row' | 'indicator' | 'all' | 'indicatorGroup';\n /** 设置排序状态,只对应按钮展示效果 无数据排序逻辑 */\n pivotSortState?: {\n dimensions: IDimensionInfo[];\n order: SortOrder;\n }[];\n\n //#region layout中挪到外层的属性\n /**层级维度结构显示形式 */\n rowHierarchyType?: 'grid' | 'tree';\n /**展开层数 */\n rowExpandLevel?: number;\n /**子层级维度缩进距离 */\n rowHierarchyIndent?: number;\n /** 同层级的结点是否按文字对齐 如没有收起展开图标的节点和有图标的节点文字对齐 默认false */\n rowHierarchyTextStartAlignment?: boolean;\n /** 列表头维度结构 */\n columnTree?: IHeaderTreeDefine[];\n /** 行表头维度结构 */\n rowTree?: IHeaderTreeDefine[];\n /** 定义各个维度和各个指标的具体配置项和样式定义 rows 和 dimension 代替掉 */\n // dimensions?: IDimension[];\n\n /** 定义行上各个维度具体配置项和样式定义 */\n rows?: (IRowDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IColumnDimension | string)[]; // (string | IDimension)[];\n /** 定义指标具体配置项和样式定义 包含表头和body的定义*/\n indicators?: (IIndicator | string)[]; // (string | IIndicator)[];\n\n /** 指标以列展示 ———有数据分析的透视表才需要配置这个 */\n indicatorsAsCol?: boolean;\n /** 指标在具体维度展示的层级顺序,从0开始 ———有数据分析的透视表才需要配置这个 */\n indicatorIndex?: number;\n /** 是否隐藏指标名称 */\n hideIndicatorName?: boolean; //\n /** 指标维度key 注意非具体指标key 数据分析的透视表才需要配置这个 */\n // indicatorDimensionKey?: string;\n /** 角头单元格配置项和样式定义 */\n corner?: ICornerDefine;\n /**\n * boolean 是否显示列维度值表头\n */\n showColumnHeader?: boolean;\n /**\n * boolean 是否显示行维度值表头\n */\n showRowHeader?: boolean;\n /**\n * 列表头增加一行来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n columnHeaderTitle?: ITitleDefine;\n /**\n * 行表头的增加一列来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n rowHeaderTitle?: ITitleDefine;\n //#endregion\n /** 数据分析相关配置 */\n dataConfig?: IPivotTableDataConfig;\n\n /** 指标标题 用于显示到角头的值*/\n indicatorTitle?: string;\n /** 分页配置 */\n pagination?: IPagination;\n\n extensionRows?: IExtensionRowDefine[];\n editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 全局设置表头编辑器 */\n headerEditor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 是否需要补充指标节点到对应的自定义表头中如rowTree或者columnTree. 默认为true */\n supplementIndicatorNodes?: boolean;\n}\nexport interface PivotChartConstructorOptions extends BaseTableConstructorOptions {\n /**\n * 数据集合, 平坦数据集合。另外一种特殊方式是传入分组后的数据,分组依据为指标\n */\n records?: any[] | Record<string, any[]>;\n /**\n * 调整列宽的生效范围:'column' | 'indicator' | 'all' | 'indicatorGroup',单列|按指标|所有列|属于同一维度值的多个指标\n */\n columnResizeType?: 'column' | 'indicator' | 'all' | 'indicatorGroup';\n rowResizeType?: 'row' | 'indicator' | 'all' | 'indicatorGroup';\n /** 列表头维度结构 */\n columnTree?: IHeaderTreeDefine[];\n /** 行表头维度结构 */\n rowTree?: IHeaderTreeDefine[];\n /** 定义各个维度和各个指标的具体配置项和样式定义 rows 和 dimension 代替掉 */\n // dimensions?: IDimension[];\n\n /** 定义行上各个维度具体配置项和样式定义 */\n rows?: (IRowDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IColumnDimension | string)[]; // (string | IDimension)[];\n /** 定义指标具体配置项和样式定义 包含表头和body的定义*/\n indicators?: (IChartIndicator | string)[]; // (string | IIndicator)[];\n\n /** 指标以列展示 ———有数据分析的透视表才需要配置这个 */\n indicatorsAsCol?: boolean;\n /** 是否隐藏指标名称 */\n hideIndicatorName?: boolean; //\n /** 角头单元格配置项和样式定义 */\n corner?: ICornerDefine;\n /**\n * boolean 是否显示列维度值表头\n */\n showColumnHeader?: boolean;\n /**\n * boolean 是否显示行维度值表头\n */\n showRowHeader?: boolean;\n /**\n * 列表头增加一行来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n columnHeaderTitle?: ITitleDefine;\n /**\n * 行表头的增加一列来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n rowHeaderTitle?: ITitleDefine;\n /** 指标标题 用于显示到角头的值*/\n indicatorTitle?: string;\n\n axes?: ITableAxisOption[];\n}\nexport interface PivotTableAPI extends BaseTableAPI {\n records?: any;\n options: PivotTableConstructorOptions;\n editorManager: EditManeger;\n // internalProps: PivotTableProtected;\n pivotSortState: PivotSortState[];\n isListTable: () => false;\n isPivotTable: () => true;\n getPivotSortState: (col: number, row: number) => SortOrder;\n toggleHierarchyState: (col: number, row: number) => void;\n /** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */\n changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell: boolean) => void;\n /**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n */\n changeCellValues: (col: number, row: number, values: (string | number)[][], workOnEditableCell: boolean) => void;\n}\nexport interface PivotChartAPI extends BaseTableAPI {\n records?: any | Record<string, any[]>;\n options: PivotChartConstructorOptions;\n // internalProps: PivotTableProtected;\n isListTable: () => false;\n isPivotTable: () => true;\n}\nexport type SetPasteValueTestData = CellAddress & {\n table: BaseTableAPI;\n record: any;\n value: string;\n\n oldValue: any;\n};\n\nexport interface InlineAPI {\n width: (arg: { ctx: CanvasRenderingContext2D }) => number;\n font: () => string | null;\n color: () => string | null;\n canDraw: () => boolean;\n onReady: (callback: Function) => void;\n\n draw: (opt: any) => void;\n canBreak: () => boolean;\n}\n\nexport interface CellContext {\n readonly col: number;\n readonly row: number;\n /**format之后的值 */\n readonly value: FieldData;\n /**原始值 */\n readonly dataValue: FieldData;\n showIcon?: SvgIcon;\n getContext: () => CanvasRenderingContext2D;\n toCurrentContext: () => CellContext;\n getDrawRect: () => RectProps | null;\n getRect: () => RectProps;\n setRectFilter: (rectFilter: (base: RectProps) => RectProps) => void;\n updateRect: (rect: Rect | RectProps) => void;\n updateDrawRect: (rect: Rect | RectProps) => void;\n}\n\nexport enum Placement {\n top = 'top',\n bottom = 'bottom',\n left = 'left',\n right = 'right'\n}\n\nexport enum HierarchyState {\n expand = 'expand',\n collapse = 'collapse',\n none = 'none'\n}\nexport type IHeaderTreeDefine = Either<IDimensionHeaderNode, IIndicatorHeaderNode>;\nexport interface IIndicatorHeaderNode {\n /**\n * 指标的key值 对应数据集的字段名\n */\n indicatorKey: string | number;\n /**\n * 指标名称 如:“销售额”,“例如”, 对应到单元格显示的值。可不填,不填的话 从indicators的对应配置中取值显示\n */\n value?: string;\n /** 维度成员下的子维度树结构 */\n children?: IHeaderTreeDefine[] | null;\n}\nexport interface IDimensionHeaderNode {\n /**\n * 维度的唯一标识,对应数据集的字段名称\n */\n dimensionKey: string | number;\n /** 维度成员值 */\n value: string;\n /** 维度成员下的子维度树结构 */\n children?: IHeaderTreeDefine[] | true;\n /** 折叠状态 TODO */\n hierarchyState?: HierarchyState;\n /** 是否为虚拟节点 在基于records数据做分析时忽略该维度字段 */\n virtual?: boolean;\n}\n\nexport interface IExtensionRowDefine {\n rows: (IRowDimension | string)[];\n rowTree: IHeaderTreeDefine[] | ((args: { dimensionKey: string | number; value: string }[]) => IHeaderTreeDefine[]);\n}\n\nexport type StickCell = { col: number; row: number; dx: number; dy: number };\n\nexport type CustomMergeCell = (col: number, row: number, table: BaseTableAPI) => undefined | CustomMerge;\nexport type CustomMerge = {\n range: CellRange;\n text?: string;\n style?: ITextStyleOption;\n customLayout?: ICustomLayout;\n customRender?: ICustomRender;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/table-engine.ts"],"names":[],"mappings":"AAueA,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,4BAAe,CAAA;AACjB,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB","file":"table-engine.js","sourcesContent":["import type { RectProps, MaybePromiseOrUndefined, IDimensionInfo, SortOrder, BaseCellInfo, CellInfo } from './common';\nimport type { ColumnIconOption, SvgIcon } from './icon';\nexport type { HeaderData } from './list-table/layout-map/api';\nexport type LayoutObjectId = number | string;\nimport type { Rect } from '../tools/Rect';\nimport type { BaseTableAPI, BaseTableConstructorOptions, ListTableProtected } from './base-table';\nimport type {\n Aggregation,\n AggregationType,\n CustomAggregation,\n FilterRules,\n IPivotTableDataConfig\n} from './new-data-set';\nimport type { Either } from '../tools/helper';\nimport type {\n IChartIndicator,\n IColumnDimension,\n ICornerDefine,\n IDimension,\n IIndicator,\n IRowDimension,\n ITitleDefine\n} from './pivot-table';\nimport type { ColumnsDefine } from './list-table';\nimport type { ICellAxisOption, ITableAxisOption } from './component/axis';\nimport type { IEditor } from '@visactor/vtable-editors';\nimport type { ITextStyleOption } from '../body-helper/style';\nimport type { DataSource } from '../data';\nimport type { EditManeger } from '../edit/edit-manager';\nimport type { ICustomRender } from './customElement';\nimport type { ICustomLayout } from './customLayout';\nimport type { StylePropertyFunctionArg } from './style-define';\n\nexport interface CellAddress {\n col: number;\n row: number;\n}\nexport interface CellAddressWithBound {\n col: number;\n row: number;\n rect?: RectProps;\n x?: number;\n y?: number;\n}\nexport interface CellRange {\n start: CellAddress;\n end: CellAddress;\n}\n\nexport type FieldGetter = (record: any, col?: number, row?: number, table?: BaseTableAPI) => any;\nexport type FieldSetter = (record: any, value: any) => void;\nexport interface FieldAssessor {\n get: FieldGetter;\n set: FieldSetter;\n}\n\nexport type FieldDef = string | number | string[];\nexport type FieldKeyDef = string | number;\nexport type FieldFormat = FieldGetter | FieldAssessor;\n\nexport type FieldData = MaybePromiseOrUndefined;\n\nexport type WidthModeDef = 'standard' | 'adaptive' | 'autoWidth';\nexport type HeightModeDef = 'standard' | 'adaptive' | 'autoHeight';\nexport type WidthAdaptiveModeDef = 'only-body' | 'all';\nexport type HeightAdaptiveModeDef = 'only-body' | 'all';\nexport type ShowColumnRowType = 'column' | 'row' | 'none';\n/** 单元格所处表格哪部分 */\nexport type CellLocation = 'body' | 'rowHeader' | 'columnHeader' | 'cornerHeader';\nexport type CellSubLocation =\n | 'body'\n | 'rowHeader'\n | 'columnHeader'\n | 'cornerHeader'\n | 'bottomFrozen'\n | 'rightFrozen'\n | 'rightTopCorner'\n | 'leftBottomCorner'\n | 'rightBottomCorner'\n | 'rowSeriesNumber'\n | 'colSeriesNumber';\n\nexport interface SelectAllOnCtrlAOption {\n disableHeaderSelect?: boolean;\n disableRowSeriesNumberSelect?: boolean;\n}\n\nexport interface TableKeyboardOptions {\n /** tab键 默认为true。开启tab键移动选中单元格,如果当前是在编辑单元格 则移动到下一个单元格也是编辑状态 */\n moveFocusCellOnTab?: boolean;\n /** enter键 默认true 如果选中单元格可编辑则进入单元格编辑*/\n editCellOnEnter?: boolean;\n /** 默认不开启即false。开启这个配置的话,如果当前是在编辑中的单元格,方向键可以移动到下个单元格并进入编辑状态,而不是编辑文本内字符串的光标移动。上下左右方向键切换选中单元格不受该配置影响,*/\n moveEditCellOnArrowKeys?: boolean;\n /** 开启快捷键全选 默认:false */\n selectAllOnCtrlA?: boolean | SelectAllOnCtrlAOption;\n /** 快捷键复制 默认:false*/\n copySelected?: boolean; //这个copy是和浏览器的快捷键一致的\n /** 快捷键粘贴,默认:false 。粘贴内容到指定位置(即粘贴前要有选中的单元格);支持批量粘贴;粘贴生效仅针对配置了编辑 editor 的单元格;*/\n pasteValueToCell?: boolean; //paste是和浏览器的快捷键一致的\n}\nexport interface TableEventOptions {\n /** 是否阻止右键的默认行为, 默认为true。*/\n preventDefaultContextMenu?: boolean;\n}\n\nexport interface IRowSeriesNumber {\n width?: number | 'auto';\n // align?: 'left' | 'right';\n // span?: number | 'dependOnNear';\n title?: string;\n // field?: FieldDef;\n format?: (col?: number, row?: number, table?: BaseTableAPI) => any;\n cellType?: 'text' | 'link' | 'image' | 'video' | 'checkbox';\n style?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n headerStyle?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n headerIcon?: string | ColumnIconOption | (string | ColumnIconOption)[];\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n // /** 选中整行或者全选时 是否包括序号部分 */\n // selectRangeInclude?: boolean;\n /** 是否可拖拽顺序 */\n dragOrder?: boolean;\n /** 是否禁止列宽调整 */\n disableColumnResize?: boolean;\n}\n\nexport interface ColumnSeriesNumber {\n enable: boolean;\n align?: 'top' | 'bottom';\n span?: number | 'dependOnNear';\n title?: string;\n field?: FieldDef;\n format?: (col?: number, row?: number, table?: BaseTableAPI) => any;\n cellType?: 'text' | 'link' | 'image' | 'video' | 'checkbox';\n style?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n headerStyle?: ITextStyleOption | ((styleArg: StylePropertyFunctionArg) => ITextStyleOption);\n icon?:\n | string\n | ColumnIconOption\n | (string | ColumnIconOption)[]\n | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);\n /** 选中整行或者全选时 是否包括序号部分 */\n selectRangeInclude?: boolean;\n /** 是否可拖拽顺序 */\n dragOrder?: boolean;\n /** 是否显示调换顺序的图标 */\n showDragOrderIcon?: boolean;\n}\nexport interface DataSourceAPI {\n clearCurrentIndexedData: () => void;\n length: number;\n get: (index: number) => MaybePromiseOrUndefined;\n getField: <F extends FieldDef>(index: number, field: F, col: number, row: number, table: BaseTableAPI) => FieldData;\n hasField: (index: number, field: FieldDef) => boolean;\n sort: (field: FieldDef, order: SortOrder, orderFn: (v1: any, v2: any, order: SortOrder) => -1 | 0 | 1) => void;\n clearSortedMap: () => void;\n updatePagination: (pagination: IPagination) => void;\n getIndexKey: (index: number) => number | number[];\n /** 数据是否为树形结构 且可以展开收起 */\n hierarchyExpandLevel: number;\n}\n\nexport interface SortState {\n /** 排序依据字段 */\n field: FieldDef;\n /** 排序规则 */\n order: SortOrder;\n}\nexport interface PivotSortState {\n col: number;\n row: number;\n order: SortOrder;\n}\n\n/**\n * 分页配置\n */\nexport interface IPagination {\n /** 数据总条数 透视表中这个数据会自动加上 不需用户传入*/\n totalCount?: number;\n /** 每页显示数据条数 */\n perPageCount: number;\n /** 每页显示条数 */\n currentPage?: number;\n}\nexport type HeaderValues = Map<any, any>;\nexport interface ListTableConstructorOptions extends BaseTableConstructorOptions {\n /**\n * 数据集合\n */\n records?: any[];\n /**\n * 传入用户实例化的数据对象 目前不完善\n */\n dataSource?: DataSource;\n /**\n * 是否显示表头\n */\n showHeader?: boolean;\n /**\n * Simple header property\n */\n columns?: ColumnsDefine; //请不要再这个上面修改配置,这里相当于是一个原始值备份,有一个内部专用的protectspace.columns\n /**\n *@deprecated 已废弃 请使用columns\n */\n header?: ColumnsDefine;\n\n transpose?: boolean; //是否转置\n /**\n * 展示为tree的列 层级缩进值\n */\n hierarchyIndent?: number;\n /** 展开层数 默认为1只显示根节点*/\n hierarchyExpandLevel?: number;\n /** 同层级的结点是否按文字对齐 如没有收起展开图标的节点和有图标的节点文字对齐 默认false */\n hierarchyTextStartAlignment?: boolean;\n /** 分页配置 */\n pagination?: IPagination;\n\n /**\n * 排序状态\n */\n sortState?: SortState | SortState[];\n\n /** 全局设置表头编辑器 */\n headerEditor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 全局设置编辑器 */\n editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 编辑触发时机 双击事件 单击事件 api手动开启编辑。默认为双击'doubleclick' */\n editCellTrigger?: 'doubleclick' | 'click' | 'api';\n /** 拖拽表头移动位置 针对冻结部分的规则 默认为fixedFrozenCount\n * \"disabled\"(禁止调整冻结列位置):不允许其他列的表头移入冻结列,也不允许冻结列移出,冻结列保持不变。\n * \"adjustFrozenCount\"(根据交互结果调整冻结数量):允许其他列的表头移入冻结列,及冻结列移出,并根据拖拽的动作调整冻结列的数量。当其他列的表头被拖拽进入冻结列位置时,冻结列数量增加;当其他列的表头被拖拽移出冻结列位置时,冻结列数量减少。\n * \"fixedFrozenCount\"(可调整冻结列,并维持冻结数量不变):允许自由拖拽其他列的表头移入或移出冻结列位置,同时保持冻结列的数量不变。\n */\n frozenColDragHeaderMode?: 'disabled' | 'adjustFrozenCount' | 'fixedFrozenCount';\n aggregation?:\n | Aggregation\n | CustomAggregation\n | (Aggregation | CustomAggregation)[]\n | ((args: {\n col: number;\n field: string;\n }) => Aggregation | CustomAggregation | (Aggregation | CustomAggregation)[] | null);\n}\n\nexport interface ListTableAPI extends BaseTableAPI {\n options: ListTableConstructorOptions;\n editorManager: EditManeger;\n sortState: SortState[] | SortState | null;\n // /** 数据分析相关配置 */\n // dataConfig?: IListTableDataConfig;\n internalProps: ListTableProtected;\n isListTable: () => true;\n isPivotTable: () => false;\n /** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */\n changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell?: boolean) => void;\n /**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n * @param workOnEditableCell 是否仅更改可编辑单元格\n */\n changeCellValues: (col: number, row: number, values: (string | number)[][], workOnEditableCell?: boolean) => void;\n getFieldData: (field: FieldDef | FieldFormat | undefined, col: number, row: number) => FieldData;\n //#region 编辑器相关demo\n /** 获取单元格配置的编辑器 */\n getEditor: (col: number, row: number) => IEditor;\n /** 开启单元格编辑 */\n startEditCell: (col?: number, row?: number) => void;\n /** 结束编辑 */\n completeEditCell: () => void;\n //#endregion\n addRecord: (record: any, recordIndex?: number) => void;\n addRecords: (records: any[], recordIndex?: number) => void;\n deleteRecords: (recordIndexs: number[]) => void;\n updateRecords: (records: any[], recordIndexs: number[]) => void;\n updateFilterRules: (filterRules: FilterRules) => void;\n getAggregateValuesByField: (field: string | number) => {\n col: number;\n aggregateValue: { aggregationType: AggregationType; value: number | string }[];\n }[];\n}\nexport interface PivotTableConstructorOptions extends BaseTableConstructorOptions {\n /**\n * 数据集合\n */\n records?: any[];\n /**\n * 调整列宽的生效范围:'column' | 'indicator' | 'all' | 'indicatorGroup',单列|按指标|所有列|属于同一维度值的多个指标\n */\n columnResizeType?: 'column' | 'indicator' | 'all' | 'indicatorGroup';\n rowResizeType?: 'row' | 'indicator' | 'all' | 'indicatorGroup';\n /** 设置排序状态,只对应按钮展示效果 无数据排序逻辑 */\n pivotSortState?: {\n dimensions: IDimensionInfo[];\n order: SortOrder;\n }[];\n\n //#region layout中挪到外层的属性\n /**层级维度结构显示形式 */\n rowHierarchyType?: 'grid' | 'tree';\n /**展开层数 */\n rowExpandLevel?: number;\n /**子层级维度缩进距离 */\n rowHierarchyIndent?: number;\n /** 同层级的结点是否按文字对齐 如没有收起展开图标的节点和有图标的节点文字对齐 默认false */\n rowHierarchyTextStartAlignment?: boolean;\n /** 列表头维度结构 */\n columnTree?: IHeaderTreeDefine[];\n /** 行表头维度结构 */\n rowTree?: IHeaderTreeDefine[];\n /** 定义各个维度和各个指标的具体配置项和样式定义 rows 和 dimension 代替掉 */\n // dimensions?: IDimension[];\n\n /** 定义行上各个维度具体配置项和样式定义 */\n rows?: (IRowDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IColumnDimension | string)[]; // (string | IDimension)[];\n /** 定义指标具体配置项和样式定义 包含表头和body的定义*/\n indicators?: (IIndicator | string)[]; // (string | IIndicator)[];\n\n /** 指标以列展示 ———有数据分析的透视表才需要配置这个 */\n indicatorsAsCol?: boolean;\n /** 指标在具体维度展示的层级顺序,从0开始 ———有数据分析的透视表才需要配置这个 */\n indicatorIndex?: number;\n /** 是否隐藏指标名称 */\n hideIndicatorName?: boolean; //\n /** 指标维度key 注意非具体指标key 数据分析的透视表才需要配置这个 */\n // indicatorDimensionKey?: string;\n /** 角头单元格配置项和样式定义 */\n corner?: ICornerDefine;\n /**\n * boolean 是否显示列维度值表头\n */\n showColumnHeader?: boolean;\n /**\n * boolean 是否显示行维度值表头\n */\n showRowHeader?: boolean;\n /**\n * 列表头增加一行来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n columnHeaderTitle?: ITitleDefine;\n /**\n * 行表头的增加一列来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n rowHeaderTitle?: ITitleDefine;\n //#endregion\n /** 数据分析相关配置 */\n dataConfig?: IPivotTableDataConfig;\n\n /** 指标标题 用于显示到角头的值*/\n indicatorTitle?: string;\n /** 分页配置 */\n pagination?: IPagination;\n\n extensionRows?: IExtensionRowDefine[];\n editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 全局设置表头编辑器 */\n headerEditor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);\n /** 是否需要补充指标节点到对应的自定义表头中如rowTree或者columnTree. 默认为true */\n supplementIndicatorNodes?: boolean;\n}\nexport interface PivotChartConstructorOptions extends BaseTableConstructorOptions {\n /**\n * 数据集合, 平坦数据集合。另外一种特殊方式是传入分组后的数据,分组依据为指标\n */\n records?: any[] | Record<string, any[]>;\n /**\n * 调整列宽的生效范围:'column' | 'indicator' | 'all' | 'indicatorGroup',单列|按指标|所有列|属于同一维度值的多个指标\n */\n columnResizeType?: 'column' | 'indicator' | 'all' | 'indicatorGroup';\n rowResizeType?: 'row' | 'indicator' | 'all' | 'indicatorGroup';\n /** 列表头维度结构 */\n columnTree?: IHeaderTreeDefine[];\n /** 行表头维度结构 */\n rowTree?: IHeaderTreeDefine[];\n /** 定义各个维度和各个指标的具体配置项和样式定义 rows 和 dimension 代替掉 */\n // dimensions?: IDimension[];\n\n /** 定义行上各个维度具体配置项和样式定义 */\n rows?: (IRowDimension | string)[]; // (string | IDimension)[]; 后续支持数据分析的透视表 支持string配置\n /** 定义列上各个维度具体配置项和样式定义 */\n columns?: (IColumnDimension | string)[]; // (string | IDimension)[];\n /** 定义指标具体配置项和样式定义 包含表头和body的定义*/\n indicators?: (IChartIndicator | string)[]; // (string | IIndicator)[];\n\n /** 指标以列展示 ———有数据分析的透视表才需要配置这个 */\n indicatorsAsCol?: boolean;\n /** 是否隐藏指标名称 */\n hideIndicatorName?: boolean; //\n /** 角头单元格配置项和样式定义 */\n corner?: ICornerDefine;\n /**\n * boolean 是否显示列维度值表头\n */\n showColumnHeader?: boolean;\n /**\n * boolean 是否显示行维度值表头\n */\n showRowHeader?: boolean;\n /**\n * 列表头增加一行来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n columnHeaderTitle?: ITitleDefine;\n /**\n * 行表头的增加一列来显示维度名称 可以自定义或者显示dimension.title组合名\n */\n rowHeaderTitle?: ITitleDefine;\n /** 指标标题 用于显示到角头的值*/\n indicatorTitle?: string;\n\n axes?: ITableAxisOption[];\n}\nexport interface PivotTableAPI extends BaseTableAPI {\n records?: any;\n options: PivotTableConstructorOptions;\n editorManager: EditManeger;\n // internalProps: PivotTableProtected;\n pivotSortState: {\n dimensions: IDimensionInfo[];\n order: SortOrder;\n }[];\n isListTable: () => false;\n isPivotTable: () => true;\n getPivotSortState: (col: number, row: number) => SortOrder;\n toggleHierarchyState: (col: number, row: number) => void;\n /** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */\n changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell: boolean) => void;\n /**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n */\n changeCellValues: (col: number, row: number, values: (string | number)[][], workOnEditableCell: boolean) => void;\n}\nexport interface PivotChartAPI extends BaseTableAPI {\n records?: any | Record<string, any[]>;\n options: PivotChartConstructorOptions;\n // internalProps: PivotTableProtected;\n isListTable: () => false;\n isPivotTable: () => true;\n}\nexport type SetPasteValueTestData = CellAddress & {\n table: BaseTableAPI;\n record: any;\n value: string;\n\n oldValue: any;\n};\n\nexport interface InlineAPI {\n width: (arg: { ctx: CanvasRenderingContext2D }) => number;\n font: () => string | null;\n color: () => string | null;\n canDraw: () => boolean;\n onReady: (callback: Function) => void;\n\n draw: (opt: any) => void;\n canBreak: () => boolean;\n}\n\nexport interface CellContext {\n readonly col: number;\n readonly row: number;\n /**format之后的值 */\n readonly value: FieldData;\n /**原始值 */\n readonly dataValue: FieldData;\n showIcon?: SvgIcon;\n getContext: () => CanvasRenderingContext2D;\n toCurrentContext: () => CellContext;\n getDrawRect: () => RectProps | null;\n getRect: () => RectProps;\n setRectFilter: (rectFilter: (base: RectProps) => RectProps) => void;\n updateRect: (rect: Rect | RectProps) => void;\n updateDrawRect: (rect: Rect | RectProps) => void;\n}\n\nexport enum Placement {\n top = 'top',\n bottom = 'bottom',\n left = 'left',\n right = 'right'\n}\n\nexport enum HierarchyState {\n expand = 'expand',\n collapse = 'collapse',\n none = 'none'\n}\nexport type IHeaderTreeDefine = Either<IDimensionHeaderNode, IIndicatorHeaderNode>;\nexport interface IIndicatorHeaderNode {\n /**\n * 指标的key值 对应数据集的字段名\n */\n indicatorKey: string | number;\n /**\n * 指标名称 如:“销售额”,“例如”, 对应到单元格显示的值。可不填,不填的话 从indicators的对应配置中取值显示\n */\n value?: string;\n /** 维度成员下的子维度树结构 */\n children?: IHeaderTreeDefine[] | null;\n}\nexport interface IDimensionHeaderNode {\n /**\n * 维度的唯一标识,对应数据集的字段名称\n */\n dimensionKey: string | number;\n /** 维度成员值 */\n value: string;\n /** 维度成员下的子维度树结构 */\n children?: IHeaderTreeDefine[] | true;\n /** 折叠状态 TODO */\n hierarchyState?: HierarchyState;\n /** 是否为虚拟节点 在基于records数据做分析时忽略该维度字段 */\n virtual?: boolean;\n}\n\nexport interface IExtensionRowDefine {\n rows: (IRowDimension | string)[];\n rowTree: IHeaderTreeDefine[] | ((args: { dimensionKey: string | number; value: string }[]) => IHeaderTreeDefine[]);\n}\n\nexport type StickCell = { col: number; row: number; dx: number; dy: number };\n\nexport type CustomMergeCell = (col: number, row: number, table: BaseTableAPI) => undefined | CustomMerge;\nexport type CustomMerge = {\n range: CellRange;\n text?: string;\n style?: ITextStyleOption;\n customLayout?: ICustomLayout;\n customRender?: ICustomRender;\n};\n"]}
|
package/es/ts-types/tooltip.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ts-types/tooltip.ts"],"names":[],"mappings":"","file":"tooltip.js","sourcesContent":["import type { RectProps } from './common';\nimport type { Placement } from './table-engine';\n\nexport type TooltipType = 'bubble-tooltip' | 'tooltip' | 'container';\n\n/** 显示弹出提示内容 */\nexport type TooltipOptions = {\n /** tooltip内容 */\n content: string;\n /** tooltip框的位置 优先级高于referencePosition */\n position?: { x: number; y: number };\n /** tooltip框的参考位置 如果设置了position则该配置不生效 */\n referencePosition?: {\n /** 参考位置设置为一个矩形边界 设置placement来指定处于边界位置的方位*/\n rect: RectProps;\n /** 指定处于边界位置的方位 */\n placement?: Placement;\n };\n /** 需要自定义样式指定className dom的tooltip生效 */\n className?: string;\n /** 设置tooltip的样式 */\n style?: {\n bgColor?: string;\n fontSize?: number;\n fontFamily?: string;\n color?: string;\n padding?: number[];\n arrowMark?: boolean;\n };\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/tooltip.ts"],"names":[],"mappings":"","file":"tooltip.js","sourcesContent":["import type { RectProps } from './common';\nimport type { Placement } from './table-engine';\n\nexport type TooltipType = 'bubble-tooltip' | 'tooltip' | 'container';\n\n/** 显示弹出提示内容 */\nexport type TooltipOptions = {\n /** tooltip内容 */\n content: string;\n /** tooltip框的位置 优先级高于referencePosition */\n position?: { x: number; y: number };\n /** tooltip框的参考位置 如果设置了position则该配置不生效 */\n referencePosition?: {\n /** 参考位置设置为一个矩形边界 设置placement来指定处于边界位置的方位*/\n rect: RectProps;\n /** 指定处于边界位置的方位 */\n placement?: Placement;\n };\n /** 需要自定义样式指定className dom的tooltip生效 */\n className?: string;\n /** 设置tooltip的样式 */\n style?: {\n bgColor?: string;\n fontSize?: number;\n fontFamily?: string;\n color?: string;\n padding?: number[];\n arrowMark?: boolean;\n };\n /** 设置tooltip的消失时间 */\n disappearDelay?: number;\n};\n"]}
|
package/es/vrender.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,MAAM,UAAU,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,gBAAgB,EAAE,CAAC;IAEnB,IAAI,YAAY,EAAE,EAAE;QAClB,cAAc,CAAC,SAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,SAAS,EAAE,EAAE;QACtB,WAAW,CAAC,SAAS,CAAC,CAAC;KACxB;IACD,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;IACf,eAAe,EAAE,CAAC;IAClB,iBAAiB,EAAE,CAAC;IACpB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,CAAC;IACnB,kBAAkB,EAAE,CAAC;IACrB,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;IACf,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC","file":"vrender.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\n// export const version = \"1.
|
|
1
|
+
{"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,MAAM,UAAU,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,gBAAgB,EAAE,CAAC;IAEnB,IAAI,YAAY,EAAE,EAAE;QAClB,cAAc,CAAC,SAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,SAAS,EAAE,EAAE;QACtB,WAAW,CAAC,SAAS,CAAC,CAAC;KACxB;IACD,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;IACf,eAAe,EAAE,CAAC;IAClB,iBAAiB,EAAE,CAAC;IACpB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,CAAC;IACnB,kBAAkB,EAAE,CAAC;IACrB,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;IACf,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC","file":"vrender.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\n// export const version = \"1.3.0\";\n\nlet registed = false;\nexport function registerForVrender() {\n if (registed) {\n return;\n }\n registed = true;\n // 注册内置组件\n preLoadAllModule();\n\n if (isBrowserEnv()) {\n loadBrowserEnv(container);\n } else if (isNodeEnv()) {\n loadNodeEnv(container);\n }\n registerArc();\n registerArc3d();\n registerArea();\n registerCircle();\n registerGlyph();\n registerGroup();\n registerImage();\n registerLine();\n registerPath();\n registerPolygon();\n registerPyramid3d();\n registerRect();\n registerRect3d();\n registerRichtext();\n registerShadowRoot();\n registerSymbol();\n registerText();\n registerWrapText();\n}\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vtable",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "canvas table width high performance",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"grid",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@visactor/vtable-editors": "1.2.1-alpha.2",
|
|
39
38
|
"@visactor/vrender-core": "0.19.10-beta.1",
|
|
40
39
|
"@visactor/vrender-kits": "0.19.10-beta.1",
|
|
41
40
|
"@visactor/vrender-components": "0.19.10-beta.1",
|
|
42
41
|
"@visactor/vutils": "~0.18.9",
|
|
43
42
|
"@visactor/vscale": "~0.18.1",
|
|
44
43
|
"@visactor/vdataset": "~0.18.1",
|
|
45
|
-
"cssfontparser": "^1.2.1"
|
|
44
|
+
"cssfontparser": "^1.2.1",
|
|
45
|
+
"@visactor/vtable-editors": "1.3.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"luxon": "*",
|
|
@@ -92,9 +92,9 @@
|
|
|
92
92
|
"d3-hierarchy": "^3.1.1",
|
|
93
93
|
"@resvg/resvg-js": "^2.5.0",
|
|
94
94
|
"pikaday": "1.8.2",
|
|
95
|
-
"@internal/
|
|
95
|
+
"@internal/bundler": "0.0.1",
|
|
96
96
|
"@internal/eslint-config": "0.0.1",
|
|
97
|
-
"@internal/
|
|
97
|
+
"@internal/ts-config": "0.0.1"
|
|
98
98
|
},
|
|
99
99
|
"unpkg": "latest",
|
|
100
100
|
"unpkgFiles": [
|