@visactor/vtable 0.23.4 → 0.24.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.d.ts +5 -1
- package/cjs/ListTable.js +20 -5
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +1 -1
- package/cjs/PivotChart.js +5 -3
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +4 -1
- package/cjs/PivotTable.js +31 -14
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/body-helper/body-helper.d.ts +2 -1
- package/cjs/body-helper/body-helper.js +4 -1
- package/cjs/body-helper/body-helper.js.map +1 -1
- package/cjs/body-helper/style/RadioStyle.d.ts +45 -0
- package/cjs/body-helper/style/RadioStyle.js +111 -0
- package/cjs/body-helper/style/RadioStyle.js.map +1 -0
- package/cjs/body-helper/style.js +3 -3
- package/cjs/body-helper/style.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +3 -1
- package/cjs/core/BaseTable.js +16 -6
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
- package/cjs/core/TABLE_EVENT_TYPE.js +1 -0
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/dataset/dataset.js +1 -1
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/dataset/flatDataToObject.d.ts +1 -0
- package/cjs/dataset/flatDataToObject.js +7 -1
- package/cjs/dataset/flatDataToObject.js.map +1 -1
- package/cjs/edit/edit-manager.js +2 -0
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/event.js +1 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/table-group.js +42 -0
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/util.d.ts +1 -0
- package/cjs/event/util.js +3 -2
- package/cjs/event/util.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +2 -2
- package/cjs/layout/pivot-header-layout.js +8 -11
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/tree-helper.js +6 -6
- package/cjs/layout/tree-helper.js.map +1 -1
- package/cjs/render/jsx/index.d.ts +3 -1
- package/cjs/render/jsx/index.js +10 -2
- package/cjs/render/jsx/index.js.map +1 -1
- package/cjs/render/layout/index.d.ts +1 -0
- package/cjs/render/layout/index.js +20 -6
- package/cjs/render/layout/index.js.map +1 -1
- package/cjs/scenegraph/component/custom.js +3 -3
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +13 -11
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +20 -5
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +24 -9
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.d.ts +5 -5
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +21 -5
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/radio-cell.d.ts +5 -0
- package/cjs/scenegraph/group-creater/cell-type/radio-cell.js +148 -0
- package/cjs/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -0
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +19 -4
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +24 -8
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js +21 -5
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.d.ts +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +12 -2
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +26 -6
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +12 -34
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/height-util.d.ts +5 -0
- package/cjs/scenegraph/layout/height-util.js +88 -0
- package/cjs/scenegraph/layout/height-util.js.map +1 -0
- package/cjs/scenegraph/layout/update-height.js +1 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +1 -1
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +1 -1
- package/cjs/scenegraph/utils/break-string.d.ts +2 -1
- package/cjs/scenegraph/utils/break-string.js +13 -30
- package/cjs/scenegraph/utils/break-string.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +7 -7
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/checkbox/checkbox.d.ts +9 -0
- package/cjs/state/checkbox/checkbox.js +108 -0
- package/cjs/state/checkbox/checkbox.js.map +1 -0
- package/cjs/state/radio/radio.d.ts +6 -0
- package/cjs/state/radio/radio.js +80 -0
- package/cjs/state/radio/radio.js.map +1 -0
- package/cjs/state/state.d.ts +3 -0
- package/cjs/state/state.js +15 -71
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/component.js +1 -1
- package/cjs/themes/theme.d.ts +2 -0
- package/cjs/themes/theme.js +10 -1
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +4 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/column/style.d.ts +20 -0
- package/cjs/ts-types/column/style.js.map +1 -1
- package/cjs/ts-types/column/type.d.ts +1 -1
- package/cjs/ts-types/column/type.js.map +1 -1
- package/cjs/ts-types/events.d.ts +4 -0
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/list-table/define/index.d.ts +4 -2
- package/cjs/ts-types/list-table/define/index.js.map +1 -1
- package/cjs/ts-types/list-table/define/radio-define.d.ts +11 -0
- package/cjs/ts-types/list-table/define/radio-define.js +6 -0
- package/cjs/ts-types/list-table/define/radio-define.js.map +1 -0
- package/cjs/ts-types/list-table/layout-map/api.d.ts +1 -1
- package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +1 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +2 -1
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +2286 -901
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +5 -1
- package/es/ListTable.js +23 -4
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +1 -1
- package/es/PivotChart.js +5 -3
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +4 -1
- package/es/PivotTable.js +31 -14
- package/es/PivotTable.js.map +1 -1
- package/es/body-helper/body-helper.d.ts +2 -1
- package/es/body-helper/body-helper.js +5 -0
- package/es/body-helper/body-helper.js.map +1 -1
- package/es/body-helper/style/RadioStyle.d.ts +45 -0
- package/es/body-helper/style/RadioStyle.js +103 -0
- package/es/body-helper/style/RadioStyle.js.map +1 -0
- package/es/body-helper/style.js +4 -2
- package/es/body-helper/style.js.map +1 -1
- package/es/core/BaseTable.d.ts +3 -1
- package/es/core/BaseTable.js +16 -6
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
- package/es/core/TABLE_EVENT_TYPE.js +1 -0
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/dataset/dataset.js +1 -1
- package/es/dataset/dataset.js.map +1 -1
- package/es/dataset/flatDataToObject.d.ts +1 -0
- package/es/dataset/flatDataToObject.js +7 -1
- package/es/dataset/flatDataToObject.js.map +1 -1
- package/es/edit/edit-manager.js +2 -0
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/event.js +1 -1
- package/es/event/event.js.map +1 -1
- package/es/event/listener/table-group.js +41 -1
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/util.d.ts +1 -0
- package/es/event/util.js +2 -0
- package/es/event/util.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.d.ts +2 -2
- package/es/layout/pivot-header-layout.js +8 -11
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/tree-helper.js +6 -6
- package/es/layout/tree-helper.js.map +1 -1
- package/es/render/jsx/index.d.ts +3 -1
- package/es/render/jsx/index.js +9 -1
- package/es/render/jsx/index.js.map +1 -1
- package/es/render/layout/index.d.ts +1 -0
- package/es/render/layout/index.js +2 -0
- package/es/render/layout/index.js.map +1 -1
- package/es/scenegraph/component/custom.js +3 -3
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +12 -10
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +20 -5
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +23 -8
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.d.ts +5 -5
- package/es/scenegraph/group-creater/cell-type/image-cell.js +21 -5
- package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/radio-cell.d.ts +5 -0
- package/es/scenegraph/group-creater/cell-type/radio-cell.js +141 -0
- package/es/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -0
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +19 -4
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js +24 -8
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js +21 -5
- package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.d.ts +1 -1
- package/es/scenegraph/group-creater/column-helper.js +13 -1
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +22 -7
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +12 -36
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/height-util.d.ts +5 -0
- package/es/scenegraph/layout/height-util.js +83 -0
- package/es/scenegraph/layout/height-util.js.map +1 -0
- package/es/scenegraph/layout/update-height.js +1 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +1 -1
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.js +1 -1
- package/es/scenegraph/utils/break-string.d.ts +2 -1
- package/es/scenegraph/utils/break-string.js +6 -27
- package/es/scenegraph/utils/break-string.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +8 -8
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/checkbox/checkbox.d.ts +9 -0
- package/es/state/checkbox/checkbox.js +99 -0
- package/es/state/checkbox/checkbox.js.map +1 -0
- package/es/state/radio/radio.d.ts +6 -0
- package/es/state/radio/radio.js +65 -0
- package/es/state/radio/radio.js.map +1 -0
- package/es/state/state.d.ts +3 -0
- package/es/state/state.js +18 -71
- package/es/state/state.js.map +1 -1
- package/es/themes/component.js +1 -1
- package/es/themes/theme.d.ts +2 -0
- package/es/themes/theme.js +9 -1
- package/es/themes/theme.js.map +1 -1
- package/es/ts-types/base-table.d.ts +4 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/column/style.d.ts +20 -0
- package/es/ts-types/column/style.js.map +1 -1
- package/es/ts-types/column/type.d.ts +1 -1
- package/es/ts-types/column/type.js.map +1 -1
- package/es/ts-types/events.d.ts +4 -0
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/list-table/define/index.d.ts +4 -2
- package/es/ts-types/list-table/define/index.js.map +1 -1
- package/es/ts-types/list-table/define/radio-define.d.ts +11 -0
- package/es/ts-types/list-table/define/radio-define.js +2 -0
- package/es/ts-types/list-table/define/radio-define.js.map +1 -0
- package/es/ts-types/list-table/layout-map/api.d.ts +1 -1
- package/es/ts-types/list-table/layout-map/api.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +1 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +2 -1
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +7 -7
- package/cjs/scenegraph/layout/auto-height.d.ts +0 -1
- package/cjs/scenegraph/layout/auto-height.js +0 -15
- package/cjs/scenegraph/layout/auto-height.js.map +0 -1
- package/es/scenegraph/layout/auto-height.d.ts +0 -1
- package/es/scenegraph/layout/auto-height.js +0 -11
- package/es/scenegraph/layout/auto-height.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ts-types/events.ts"],"names":[],"mappings":"","file":"events.js","sourcesContent":["import type { CellAddress, CellRange, CellLocation, FieldDef, CellAddressWithBound } from './table-engine';\nimport type { DropDownMenuEventArgs, MenuListItem, PivotInfo } from './menu';\n\nimport type { IDimensionInfo, RectProps, SortOrder } from './common';\nimport type { IconFuncTypeEnum, CellInfo, HierarchyState } from '.';\nimport type { Icon } from '../scenegraph/graphic/icon';\nimport type { FederatedPointerEvent, IEventTarget } from './../vrender';\n\nexport type KeyboardEventListener = (e: KeyboardEvent) => void;\nexport type TableEventListener<TYPE extends keyof TableEventHandlersEventArgumentMap> = (\n args: TableEventHandlersEventArgumentMap[TYPE]\n) => TableEventHandlersReturnMap[TYPE]; //AnyFunction;\nexport type EventListenerId = number;\n\nexport type SelectedCellEvent = CellAddress & {\n ranges: CellRange[];\n};\n\n// export type MouseCellEvent = CellAddress & {\n// event: MouseEvent | PointerEvent | TouchEvent;\n// };\n\nexport type MenuEvent = CellAddress & {\n dropDownMenu: MenuListItem[];\n pivotInfo: PivotInfo;\n};\n\nexport type TouchCellEvent = CellAddress & {\n event: TouchEvent;\n};\n\nexport type KeydownEvent = {\n keyCode: number;\n code: string;\n event: KeyboardEvent;\n stopCellMoving?: () => void;\n scaleRatio?: number;\n};\n\nexport type MousePointerCellEvent = CellAddressWithBound &\n CellInfo & {\n scaleRatio?: number;\n targetIcon?: { name: string; position: RectProps; funcType: string };\n event?: MouseEvent | PointerEvent | TouchEvent;\n federatedEvent?: FederatedPointerEvent;\n target: IEventTarget | undefined;\n };\n// 多单元格的事件传出参数 需要将当前鼠标处的单元格的信息FocusedCellInfo也带着\nexport type MousePointerMultiCellEvent = MousePointerCellEvent & {\n cells: CellInfo[][];\n // menuKey?: string;\n};\n\nexport type MousePointerSparklineEvent = MousePointerCellEvent & {\n sparkline: {\n pointData: any;\n };\n};\n\nexport interface TableEventHandlersEventArgumentMap {\n selected_cell: SelectedCellEvent;\n click_cell: MousePointerCellEvent;\n dblclick_cell: MousePointerCellEvent;\n mouseenter_table: { event?: MouseEvent | PointerEvent | TouchEvent };\n mouseleave_table: { event?: MouseEvent | PointerEvent | TouchEvent };\n mousedown_table: { event?: MouseEvent | PointerEvent | TouchEvent };\n mouseenter_cell: MousePointerCellEvent;\n mouseleave_cell: MousePointerCellEvent;\n mousemove_cell: MousePointerCellEvent;\n mousedown_cell: MousePointerCellEvent;\n mouseup_cell: MousePointerCellEvent;\n contextmenu_cell: MousePointerMultiCellEvent;\n keydown: KeydownEvent;\n scroll: {\n scrollLeft: number;\n scrollTop: number;\n scrollWidth: number;\n scrollHeight: number;\n viewWidth: number;\n viewHeight: number;\n scrollDirection: 'horizontal' | 'vertical';\n scrollRatioX?: number;\n scrollRatioY?: number;\n };\n scroll_vertical_end: {\n scrollLeft: number;\n scrollTop: number;\n scrollWidth: number;\n scrollHeight: number;\n viewWidth: number;\n viewHeight: number;\n };\n scroll_horizontal_end: {\n scrollLeft: number;\n scrollTop: number;\n scrollWidth: number;\n scrollHeight: number;\n viewWidth: number;\n viewHeight: number;\n };\n resize_column: { col: number; colWidth: number };\n resize_column_end: { col: number; colWidths: number[] };\n change_header_position: { source: CellAddress; target: CellAddress };\n sort_click: {\n field: FieldDef;\n order: SortOrder;\n event: Event;\n };\n freeze_click: { col: number; row: number; fields: FieldDef[]; colCount: number };\n dropdown_menu_click: DropDownMenuEventArgs;\n\n mouseover_chart_symbol: MousePointerSparklineEvent;\n\n drag_select_end: MousePointerMultiCellEvent;\n copy_data: { cellRange: CellRange[]; copyData: string };\n drillmenu_click: DrillMenuEventInfo;\n\n dropdown_icon_click: CellAddress & { event: Event };\n dropdown_menu_clear: CellAddress;\n\n show_menu: {\n x: number;\n y: number;\n col: number;\n row: number;\n type: 'dropDown' | 'contextmenu' | 'custom';\n };\n hide_menu: [];\n icon_click: {\n name: string;\n col: number;\n row: number;\n x: number;\n y: number;\n funcType?: IconFuncTypeEnum | string;\n icon: Icon;\n event: Event;\n };\n\n pivot_sort_click: {\n col: number;\n row: number;\n order: SortOrder;\n dimensionInfo: IDimensionInfo[];\n cellLocation: CellLocation;\n event: Event;\n };\n tree_hierarchy_state_change: {\n col: number;\n row: number;\n hierarchyState: HierarchyState;\n dimensionInfo?: IDimensionInfo[];\n /**整条数据-原始数据 */\n originData?: any;\n };\n vchart_event_type: {\n eventName: string;\n col: number;\n row: number;\n chartEventArguments: any;\n };\n //datasource部分的事件\n change_order: [];\n source_length_update: number;\n\n legend_item_click: { model: any; value: any; event: PointerEvent };\n legend_item_hover: { model: any; value: any; event: PointerEvent };\n legend_item_unHover: { model: any; value: any; event: PointerEvent };\n legend_change: { model: any; value: any; event: PointerEvent };\n\n mouseenter_axis: MousePointerCellEvent & { axisPosition: 'left' | 'right' | 'top' | 'bottom' };\n mouseleave_axis: MousePointerCellEvent & { axisPosition: 'left' | 'right' | 'top' | 'bottom' };\n\n checkbox_state_change: MousePointerCellEvent & { checked: boolean };\n after_render: null;\n initialized: null;\n\n change_cell_value: { col: number; row: number; rawValue: string | number; changedValue: string | number };\n\n mousedown_fill_handle: {};\n drag_fill_handle_end: { direction?: 'top' | 'bottom' | 'left' | 'right' };\n dblclick_fill_handle: {};\n}\nexport interface DrillMenuEventInfo {\n dimensionKey: string | number;\n title: string;\n drillDown: boolean;\n drillUp: boolean;\n col: number;\n row: number;\n event: Event;\n}\nexport interface TableEventHandlersReturnMap {\n selected_cell: void;\n click_cell: void;\n dblclick_cell: void;\n mouseenter_table: void;\n mouseleave_table: void;\n mousedown_table: void;\n mouseenter_cell: void;\n mouseleave_cell: void;\n // mouseover_cell: void;\n mouseout_cell: void;\n mousemove_cell: void;\n mousedown_cell: boolean;\n mouseup_cell: void;\n contextmenu_cell: void;\n keydown: void;\n scroll: void;\n focus_table: void;\n blur_table: void;\n resize_column: void;\n resize_column_end: void;\n change_header_position: void;\n sort_click: boolean;\n freeze_click: void;\n dropdown_menu_click: void;\n\n mouseover_chart_symbol: void;\n drag_select_end: void;\n copy_data: void;\n drillmenu_click: void;\n\n dropdown_icon_click: void;\n dropdown_menu_clear: void;\n\n show_menu: void;\n hide_menu: void;\n icon_click: void;\n\n pivot_sort_click: void;\n\n tree_hierarchy_state_change: void;\n\n vchart_event_type: void;\n //datasource部分的事件\n change_order: void;\n source_length_update: void;\n legend_item_click: void;\n legend_item_hover: void;\n legend_item_unHover: void;\n legend_change: void;\n\n mouseenter_axis: void;\n mouseleave_axis: void;\n\n checkbox_state_change: void;\n after_render: void;\n initialized: void;\n\n change_cell_value: void;\n mousedown_fill_handle: void;\n drag_fill_handle_end: void;\n dblclick_fill_handle: void;\n\n scroll_vertical_end: void;\n\n scroll_horizontal_end: void;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/events.ts"],"names":[],"mappings":"","file":"events.js","sourcesContent":["import type { CellAddress, CellRange, CellLocation, FieldDef, CellAddressWithBound } from './table-engine';\nimport type { DropDownMenuEventArgs, MenuListItem, PivotInfo } from './menu';\n\nimport type { IDimensionInfo, RectProps, SortOrder } from './common';\nimport type { IconFuncTypeEnum, CellInfo, HierarchyState } from '.';\nimport type { Icon } from '../scenegraph/graphic/icon';\nimport type { FederatedPointerEvent, IEventTarget } from './../vrender';\n\nexport type KeyboardEventListener = (e: KeyboardEvent) => void;\nexport type TableEventListener<TYPE extends keyof TableEventHandlersEventArgumentMap> = (\n args: TableEventHandlersEventArgumentMap[TYPE]\n) => TableEventHandlersReturnMap[TYPE]; //AnyFunction;\nexport type EventListenerId = number;\n\nexport type SelectedCellEvent = CellAddress & {\n ranges: CellRange[];\n};\n\n// export type MouseCellEvent = CellAddress & {\n// event: MouseEvent | PointerEvent | TouchEvent;\n// };\n\nexport type MenuEvent = CellAddress & {\n dropDownMenu: MenuListItem[];\n pivotInfo: PivotInfo;\n};\n\nexport type TouchCellEvent = CellAddress & {\n event: TouchEvent;\n};\n\nexport type KeydownEvent = {\n keyCode: number;\n code: string;\n event: KeyboardEvent;\n stopCellMoving?: () => void;\n scaleRatio?: number;\n};\n\nexport type MousePointerCellEvent = CellAddressWithBound &\n CellInfo & {\n scaleRatio?: number;\n targetIcon?: { name: string; position: RectProps; funcType: string };\n event?: MouseEvent | PointerEvent | TouchEvent;\n federatedEvent?: FederatedPointerEvent;\n target: IEventTarget | undefined;\n };\n// 多单元格的事件传出参数 需要将当前鼠标处的单元格的信息FocusedCellInfo也带着\nexport type MousePointerMultiCellEvent = MousePointerCellEvent & {\n cells: CellInfo[][];\n // menuKey?: string;\n};\n\nexport type MousePointerSparklineEvent = MousePointerCellEvent & {\n sparkline: {\n pointData: any;\n };\n};\n\nexport interface TableEventHandlersEventArgumentMap {\n selected_cell: SelectedCellEvent;\n click_cell: MousePointerCellEvent;\n dblclick_cell: MousePointerCellEvent;\n mouseenter_table: { event?: MouseEvent | PointerEvent | TouchEvent };\n mouseleave_table: { event?: MouseEvent | PointerEvent | TouchEvent };\n mousedown_table: { event?: MouseEvent | PointerEvent | TouchEvent };\n mouseenter_cell: MousePointerCellEvent;\n mouseleave_cell: MousePointerCellEvent;\n mousemove_cell: MousePointerCellEvent;\n mousedown_cell: MousePointerCellEvent;\n mouseup_cell: MousePointerCellEvent;\n contextmenu_cell: MousePointerMultiCellEvent;\n keydown: KeydownEvent;\n scroll: {\n scrollLeft: number;\n scrollTop: number;\n scrollWidth: number;\n scrollHeight: number;\n viewWidth: number;\n viewHeight: number;\n scrollDirection: 'horizontal' | 'vertical';\n scrollRatioX?: number;\n scrollRatioY?: number;\n };\n scroll_vertical_end: {\n scrollLeft: number;\n scrollTop: number;\n scrollWidth: number;\n scrollHeight: number;\n viewWidth: number;\n viewHeight: number;\n };\n scroll_horizontal_end: {\n scrollLeft: number;\n scrollTop: number;\n scrollWidth: number;\n scrollHeight: number;\n viewWidth: number;\n viewHeight: number;\n };\n resize_column: { col: number; colWidth: number };\n resize_column_end: { col: number; colWidths: number[] };\n change_header_position: { source: CellAddress; target: CellAddress };\n sort_click: {\n field: FieldDef;\n order: SortOrder;\n event: Event;\n };\n freeze_click: { col: number; row: number; fields: FieldDef[]; colCount: number };\n dropdown_menu_click: DropDownMenuEventArgs;\n\n mouseover_chart_symbol: MousePointerSparklineEvent;\n\n drag_select_end: MousePointerMultiCellEvent;\n copy_data: { cellRange: CellRange[]; copyData: string };\n drillmenu_click: DrillMenuEventInfo;\n\n dropdown_icon_click: CellAddress & { event: Event };\n dropdown_menu_clear: CellAddress;\n\n show_menu: {\n x: number;\n y: number;\n col: number;\n row: number;\n type: 'dropDown' | 'contextmenu' | 'custom';\n };\n hide_menu: [];\n icon_click: {\n name: string;\n col: number;\n row: number;\n x: number;\n y: number;\n funcType?: IconFuncTypeEnum | string;\n icon: Icon;\n event: Event;\n };\n\n pivot_sort_click: {\n col: number;\n row: number;\n order: SortOrder;\n dimensionInfo: IDimensionInfo[];\n cellLocation: CellLocation;\n event: Event;\n };\n tree_hierarchy_state_change: {\n col: number;\n row: number;\n hierarchyState: HierarchyState;\n dimensionInfo?: IDimensionInfo[];\n /**整条数据-原始数据 */\n originData?: any;\n };\n vchart_event_type: {\n eventName: string;\n col: number;\n row: number;\n chartEventArguments: any;\n };\n //datasource部分的事件\n change_order: [];\n source_length_update: number;\n\n legend_item_click: { model: any; value: any; event: PointerEvent };\n legend_item_hover: { model: any; value: any; event: PointerEvent };\n legend_item_unHover: { model: any; value: any; event: PointerEvent };\n legend_change: { model: any; value: any; event: PointerEvent };\n\n mouseenter_axis: MousePointerCellEvent & { axisPosition: 'left' | 'right' | 'top' | 'bottom' };\n mouseleave_axis: MousePointerCellEvent & { axisPosition: 'left' | 'right' | 'top' | 'bottom' };\n\n checkbox_state_change: MousePointerCellEvent & { checked: boolean };\n radio_state_change: MousePointerCellEvent & { radioIndexInCell: number | undefined };\n after_render: null;\n initialized: null;\n\n change_cell_value: { col: number; row: number; rawValue: string | number; changedValue: string | number };\n\n mousedown_fill_handle: {};\n drag_fill_handle_end: { direction?: 'top' | 'bottom' | 'left' | 'right' };\n dblclick_fill_handle: {};\n}\nexport interface DrillMenuEventInfo {\n dimensionKey: string | number;\n title: string;\n drillDown: boolean;\n drillUp: boolean;\n col: number;\n row: number;\n event: Event;\n}\nexport interface TableEventHandlersReturnMap {\n selected_cell: void;\n click_cell: void;\n dblclick_cell: void;\n mouseenter_table: void;\n mouseleave_table: void;\n mousedown_table: void;\n mouseenter_cell: void;\n mouseleave_cell: void;\n // mouseover_cell: void;\n mouseout_cell: void;\n mousemove_cell: void;\n mousedown_cell: boolean;\n mouseup_cell: void;\n contextmenu_cell: void;\n keydown: void;\n scroll: void;\n focus_table: void;\n blur_table: void;\n resize_column: void;\n resize_column_end: void;\n change_header_position: void;\n sort_click: boolean;\n freeze_click: void;\n dropdown_menu_click: void;\n\n mouseover_chart_symbol: void;\n drag_select_end: void;\n copy_data: void;\n drillmenu_click: void;\n\n dropdown_icon_click: void;\n dropdown_menu_clear: void;\n\n show_menu: void;\n hide_menu: void;\n icon_click: void;\n\n pivot_sort_click: void;\n\n tree_hierarchy_state_change: void;\n\n vchart_event_type: void;\n //datasource部分的事件\n change_order: void;\n source_length_update: void;\n legend_item_click: void;\n legend_item_hover: void;\n legend_item_unHover: void;\n legend_change: void;\n\n mouseenter_axis: void;\n mouseleave_axis: void;\n\n checkbox_state_change: void;\n radio_state_change: void;\n after_render: void;\n initialized: void;\n\n change_cell_value: void;\n mousedown_fill_handle: void;\n drag_fill_handle_end: void;\n dblclick_fill_handle: void;\n\n scroll_vertical_end: void;\n\n scroll_horizontal_end: void;\n}\n"]}
|
|
@@ -7,19 +7,21 @@ import type { ILinkColumnBodyDefine, ILinkHeaderDefine } from './link-define';
|
|
|
7
7
|
import type { ITextColumnBodyDefine, ITextHeaderDefine } from './multilinetext-define';
|
|
8
8
|
import type { IProgressbarColumnBodyDefine } from './progressbar-define';
|
|
9
9
|
import type { ISparklineColumnBodyDefine } from './sparkline-define';
|
|
10
|
+
import type { IRadioColumnBodyDefine } from './radio-define';
|
|
10
11
|
export type HeaderDefine = IImageHeaderDefine | ILinkHeaderDefine | ICheckboxHeaderDefine | ITextHeaderDefine;
|
|
11
|
-
export type ColumnBodyDefine = ILinkColumnBodyDefine | IImageColumnBodyDefine | ISparklineColumnBodyDefine | IProgressbarColumnBodyDefine | ICheckboxColumnBodyDefine | IChartColumnBodyDefine | ITextColumnBodyDefine;
|
|
12
|
+
export type ColumnBodyDefine = ILinkColumnBodyDefine | IImageColumnBodyDefine | ISparklineColumnBodyDefine | IProgressbarColumnBodyDefine | ICheckboxColumnBodyDefine | IRadioColumnBodyDefine | IChartColumnBodyDefine | ITextColumnBodyDefine;
|
|
12
13
|
export type TextColumnDefine = ITextColumnBodyDefine & HeaderDefine;
|
|
13
14
|
export type LinkColumnDefine = ILinkColumnBodyDefine & HeaderDefine;
|
|
14
15
|
export type ImageColumnDefine = IImageColumnBodyDefine & HeaderDefine;
|
|
15
16
|
export type SparklineColumnDefine = ISparklineColumnBodyDefine & HeaderDefine;
|
|
16
17
|
export type ProgressbarColumnDefine = IProgressbarColumnBodyDefine & HeaderDefine;
|
|
17
18
|
export type CheckboxColumnDefine = ICheckboxColumnBodyDefine & HeaderDefine;
|
|
19
|
+
export type RadioColumnDefine = IRadioColumnBodyDefine & HeaderDefine;
|
|
18
20
|
export type ChartColumnDefine = IChartColumnBodyDefine & HeaderDefine;
|
|
19
21
|
export type CompositeColumnDefine = ICompositeColumnBodyDefine & HeaderDefine;
|
|
20
22
|
export type GroupColumnDefine = HeaderDefine & {
|
|
21
23
|
columns: ColumnsDefine;
|
|
22
24
|
hideColumnsSubHeader?: boolean;
|
|
23
25
|
};
|
|
24
|
-
export type ColumnDefine = Either<LinkColumnDefine | ImageColumnDefine | SparklineColumnDefine | ProgressbarColumnDefine | CheckboxColumnDefine | ChartColumnDefine | TextColumnDefine | CompositeColumnDefine, GroupColumnDefine>;
|
|
26
|
+
export type ColumnDefine = Either<LinkColumnDefine | ImageColumnDefine | SparklineColumnDefine | ProgressbarColumnDefine | CheckboxColumnDefine | RadioColumnDefine | ChartColumnDefine | TextColumnDefine | CompositeColumnDefine, GroupColumnDefine>;
|
|
25
27
|
export type ColumnsDefine = ColumnDefine[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ts-types/list-table/define/index.ts"],"names":[],"mappings":"","file":"index.js","sourcesContent":["import type { Either } from '../../../tools/helper';\nimport type { ICompositeColumnBodyDefine } from './Composite-define';\nimport type { IChartColumnBodyDefine } from './chart-define';\nimport type { ICheckboxColumnBodyDefine, ICheckboxHeaderDefine } from './checkbox-define';\nimport type { IImageColumnBodyDefine, IImageHeaderDefine } from './image-define';\nimport type { ILinkColumnBodyDefine, ILinkHeaderDefine } from './link-define';\nimport type { ITextColumnBodyDefine, ITextHeaderDefine } from './multilinetext-define';\nimport type { IProgressbarColumnBodyDefine } from './progressbar-define';\nimport type { ISparklineColumnBodyDefine } from './sparkline-define';\n\nexport type HeaderDefine = IImageHeaderDefine | ILinkHeaderDefine | ICheckboxHeaderDefine | ITextHeaderDefine;\n\nexport type ColumnBodyDefine =\n | ILinkColumnBodyDefine\n | IImageColumnBodyDefine\n | ISparklineColumnBodyDefine\n | IProgressbarColumnBodyDefine\n | ICheckboxColumnBodyDefine\n | IChartColumnBodyDefine\n | ITextColumnBodyDefine;\nexport type TextColumnDefine = ITextColumnBodyDefine & HeaderDefine;\nexport type LinkColumnDefine = ILinkColumnBodyDefine & HeaderDefine;\nexport type ImageColumnDefine = IImageColumnBodyDefine & HeaderDefine;\nexport type SparklineColumnDefine = ISparklineColumnBodyDefine & HeaderDefine;\nexport type ProgressbarColumnDefine = IProgressbarColumnBodyDefine & HeaderDefine;\nexport type CheckboxColumnDefine = ICheckboxColumnBodyDefine & HeaderDefine;\nexport type ChartColumnDefine = IChartColumnBodyDefine & HeaderDefine;\nexport type CompositeColumnDefine = ICompositeColumnBodyDefine & HeaderDefine;\n// export type GroupColumnDefine = IChartColumnBodyDefine & HeaderDefine;\nexport type GroupColumnDefine = HeaderDefine & {\n columns: ColumnsDefine;\n hideColumnsSubHeader?: boolean;\n};\nexport type ColumnDefine = Either<\n | LinkColumnDefine\n | ImageColumnDefine\n | SparklineColumnDefine\n | ProgressbarColumnDefine\n | CheckboxColumnDefine\n | ChartColumnDefine\n | TextColumnDefine\n | CompositeColumnDefine,\n GroupColumnDefine\n>;\n\n// export type ColumnDefine = HeaderDefine & ColumnBodyDefine;\n\nexport type ColumnsDefine = ColumnDefine[];\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/list-table/define/index.ts"],"names":[],"mappings":"","file":"index.js","sourcesContent":["import type { Either } from '../../../tools/helper';\nimport type { ICompositeColumnBodyDefine } from './Composite-define';\nimport type { IChartColumnBodyDefine } from './chart-define';\nimport type { ICheckboxColumnBodyDefine, ICheckboxHeaderDefine } from './checkbox-define';\nimport type { IImageColumnBodyDefine, IImageHeaderDefine } from './image-define';\nimport type { ILinkColumnBodyDefine, ILinkHeaderDefine } from './link-define';\nimport type { ITextColumnBodyDefine, ITextHeaderDefine } from './multilinetext-define';\nimport type { IProgressbarColumnBodyDefine } from './progressbar-define';\nimport type { ISparklineColumnBodyDefine } from './sparkline-define';\nimport type { IRadioColumnBodyDefine } from './radio-define';\n\nexport type HeaderDefine = IImageHeaderDefine | ILinkHeaderDefine | ICheckboxHeaderDefine | ITextHeaderDefine;\n\nexport type ColumnBodyDefine =\n | ILinkColumnBodyDefine\n | IImageColumnBodyDefine\n | ISparklineColumnBodyDefine\n | IProgressbarColumnBodyDefine\n | ICheckboxColumnBodyDefine\n | IRadioColumnBodyDefine\n | IChartColumnBodyDefine\n | ITextColumnBodyDefine;\nexport type TextColumnDefine = ITextColumnBodyDefine & HeaderDefine;\nexport type LinkColumnDefine = ILinkColumnBodyDefine & HeaderDefine;\nexport type ImageColumnDefine = IImageColumnBodyDefine & HeaderDefine;\nexport type SparklineColumnDefine = ISparklineColumnBodyDefine & HeaderDefine;\nexport type ProgressbarColumnDefine = IProgressbarColumnBodyDefine & HeaderDefine;\nexport type CheckboxColumnDefine = ICheckboxColumnBodyDefine & HeaderDefine;\nexport type RadioColumnDefine = IRadioColumnBodyDefine & HeaderDefine;\nexport type ChartColumnDefine = IChartColumnBodyDefine & HeaderDefine;\nexport type CompositeColumnDefine = ICompositeColumnBodyDefine & HeaderDefine;\n// export type GroupColumnDefine = IChartColumnBodyDefine & HeaderDefine;\nexport type GroupColumnDefine = HeaderDefine & {\n columns: ColumnsDefine;\n hideColumnsSubHeader?: boolean;\n};\nexport type ColumnDefine = Either<\n | LinkColumnDefine\n | ImageColumnDefine\n | SparklineColumnDefine\n | ProgressbarColumnDefine\n | CheckboxColumnDefine\n | RadioColumnDefine\n | ChartColumnDefine\n | TextColumnDefine\n | CompositeColumnDefine,\n GroupColumnDefine\n>;\n\n// export type ColumnDefine = HeaderDefine & ColumnBodyDefine;\n\nexport type ColumnsDefine = ColumnDefine[];\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RadioStyleOption } from '../../column';
|
|
2
|
+
import type { StylePropertyFunctionArg } from '../../style-define';
|
|
3
|
+
import type { IBasicColumnBodyDefine } from './basic-define';
|
|
4
|
+
export interface IRadioColumnBodyDefine extends IBasicColumnBodyDefine {
|
|
5
|
+
style?: RadioStyleOption | ((styleArg: StylePropertyFunctionArg) => RadioStyleOption);
|
|
6
|
+
cellType: 'radio';
|
|
7
|
+
radioCheckType?: 'cell' | 'column';
|
|
8
|
+
radioDirectionInCell?: 'vertical' | 'horizontal';
|
|
9
|
+
checked?: number | boolean | ((args: StylePropertyFunctionArg) => number | boolean);
|
|
10
|
+
disable?: number | boolean | ((args: StylePropertyFunctionArg) => number | boolean);
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/list-table/define/radio-define.ts"],"names":[],"mappings":"","file":"radio-define.js","sourcesContent":["import type { RadioStyleOption } from '../../column';\nimport type { StylePropertyFunctionArg } from '../../style-define';\nimport type { IBasicColumnBodyDefine, IBasicHeaderDefine } from './basic-define';\n\n// export interface IRadioHeaderDefine extends IBasicHeaderDefine {\n// headerStyle?: RadioStyleOption | ((styleArg: StylePropertyFunctionArg) => RadioStyleOption);\n// headerType: 'radio';\n// checked?: boolean | ((args: StylePropertyFunctionArg) => boolean);\n// disable?: boolean | ((args: StylePropertyFunctionArg) => boolean);\n// }\n\nexport interface IRadioColumnBodyDefine extends IBasicColumnBodyDefine {\n style?: RadioStyleOption | ((styleArg: StylePropertyFunctionArg) => RadioStyleOption);\n cellType: 'radio';\n radioCheckType?: 'cell' | 'column';\n radioDirectionInCell?: 'vertical' | 'horizontal';\n checked?: number | boolean | ((args: StylePropertyFunctionArg) => number | boolean);\n disable?: number | boolean | ((args: StylePropertyFunctionArg) => number | boolean);\n}\n"]}
|
|
@@ -35,7 +35,7 @@ export interface ColumnData extends WidthData {
|
|
|
35
35
|
field: FieldDef;
|
|
36
36
|
fieldFormat?: FieldFormat;
|
|
37
37
|
icon?: string | ColumnIconOption | (string | ColumnIconOption)[] | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);
|
|
38
|
-
cellType: 'text' | 'link' | 'image' | 'video' | 'sparkline' | 'progressbar' | 'chart' | 'checkbox';
|
|
38
|
+
cellType: 'text' | 'link' | 'image' | 'video' | 'sparkline' | 'progressbar' | 'chart' | 'checkbox' | 'radio';
|
|
39
39
|
chartModule?: string;
|
|
40
40
|
chartSpec?: any | ((arg0: CellInfo) => any);
|
|
41
41
|
chartInstance?: any;
|
|
@@ -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';\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} 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"]}
|
|
@@ -282,7 +282,7 @@ export interface IIndicatorHeaderNode {
|
|
|
282
282
|
export interface IDimensionHeaderNode {
|
|
283
283
|
dimensionKey: string | number;
|
|
284
284
|
value: string;
|
|
285
|
-
children?: IHeaderTreeDefine[] |
|
|
285
|
+
children?: IHeaderTreeDefine[] | true;
|
|
286
286
|
hierarchyState?: HierarchyState;
|
|
287
287
|
}
|
|
288
288
|
export interface IExtensionRowDefine {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ts-types/table-engine.ts"],"names":[],"mappings":"AAwdA,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 TableKeyboardOptions {\n /** tab键 默认为true。开启tab键移动选中单元格,如果当前是在编辑单元格 则移动到下一个单元格也是编辑状态 */\n moveFocusCellOnTab?: boolean;\n /** enter键 默认true 如果选中单元格可编辑则进入单元格编辑*/\n editCellOnEnter?: boolean;\n /** 默认不开启即false。开启这个配置的话,如果当前是在编辑中的单元格,方向键可以移动到下个单元格并进入编辑状态,而不是编辑文本内字符串的光标移动。上下左右方向键切换选中单元格不受该配置影响,*/\n moveEditCellOnArrowKeys?: boolean;\n /** 开启快捷键全选 默认:false */\n selectAllOnCtrlA?: boolean;\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\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 /** 数据分析相关配置 enableDataAnalysis开启后该配置才会有效 */\n // dataConfig?: IListTableDataConfig;\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 /** 设置排序状态,只对应按钮展示效果 无数据排序逻辑 */\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 /** 数据分析相关配置 enableDataAnalysis开启后该配置才会有效 */\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}\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 /** 列表头维度结构 */\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[] | null;\n /** 折叠状态 TODO */\n hierarchyState?: HierarchyState;\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":"AAwdA,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 TableKeyboardOptions {\n /** tab键 默认为true。开启tab键移动选中单元格,如果当前是在编辑单元格 则移动到下一个单元格也是编辑状态 */\n moveFocusCellOnTab?: boolean;\n /** enter键 默认true 如果选中单元格可编辑则进入单元格编辑*/\n editCellOnEnter?: boolean;\n /** 默认不开启即false。开启这个配置的话,如果当前是在编辑中的单元格,方向键可以移动到下个单元格并进入编辑状态,而不是编辑文本内字符串的光标移动。上下左右方向键切换选中单元格不受该配置影响,*/\n moveEditCellOnArrowKeys?: boolean;\n /** 开启快捷键全选 默认:false */\n selectAllOnCtrlA?: boolean;\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\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 /** 数据分析相关配置 enableDataAnalysis开启后该配置才会有效 */\n // dataConfig?: IListTableDataConfig;\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 /** 设置排序状态,只对应按钮展示效果 无数据排序逻辑 */\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 /** 数据分析相关配置 enableDataAnalysis开启后该配置才会有效 */\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}\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 /** 列表头维度结构 */\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}\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/theme.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ColorsDef, LineDashsDef, LineWidthsDef, LineWidthsPropertyDefine } from '.';
|
|
2
|
-
import type { CheckboxStyle, ITextStyleOption } from './column/style';
|
|
2
|
+
import type { CheckboxStyle, ITextStyleOption, RadioStyle } from './column/style';
|
|
3
3
|
import type { ColorPropertyDefine, ColorsPropertyDefine } from './style-define';
|
|
4
4
|
import type { ICellAxisOption } from './component/axis';
|
|
5
5
|
import type { PopTipAttributes } from '@visactor/vrender-components';
|
|
@@ -109,6 +109,7 @@ export interface ITableThemeDefine {
|
|
|
109
109
|
bottomAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;
|
|
110
110
|
};
|
|
111
111
|
checkboxStyle?: CheckboxStyle;
|
|
112
|
+
radioStyle?: RadioStyle;
|
|
112
113
|
textPopTipStyle?: PopTipAttributes;
|
|
113
114
|
cellInnerBorder?: boolean;
|
|
114
115
|
cellBorderClipDirection?: 'top-left' | 'bottom-right';
|
package/es/ts-types/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ts-types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["/* eslint-disable sort-imports */\nimport type { ColorsDef, LineDashsDef, LineWidthsDef, LineWidthsPropertyDefine, LineDashsPropertyDefine } from '.';\nimport type { CheckboxStyle, ITextStyleOption } from './column/style';\nimport type { ColorPropertyDefine, ColorsPropertyDefine } from './style-define';\nimport type { ColumnIconOption } from './icon';\nimport type { ICellAxisOption } from './component/axis';\nimport type { PopTipAttributes } from '@visactor/vrender-components';\n// ****** Custom Theme *******\nexport type PartialTableThemeDefine = Partial<ITableThemeDefine>;\nexport type ThemeStyle = ITextStyleOption & {\n hover?: Omit<InteractionStyle, 'cellBorderColor' | 'cellBorderLineWidth'>; //鼠标hover到某个单元格\n // click?: Omit<InteractionStyle, 'inlineRowBgColor' | 'inlineColumnBgColor'>; //鼠标点击到某个单元格\n frameStyle?: FrameStyle;\n};\nexport type InteractionStyle = {\n cellBorderColor?: ColorsPropertyDefine; //交互所在单元格的边框颜色\n cellBorderLineWidth?: LineWidthsPropertyDefine;\n // cellBorderLineDash?:LineDashsPropertyDefine,//用到的场景应该不多\n cellBgColor?: ColorPropertyDefine; //交互所在单元格的背景颜色\n // inlineRowBorderColor?: ColorsPropertyDefine,//交互所在整行的边框颜色\n inlineRowBgColor?: ColorPropertyDefine; //交互所在整行的背景颜色\n // inlineColBorderColor?: ColorsPropertyDefine,//交互所在整列的边框颜色\n inlineColumnBgColor?: ColorPropertyDefine; //交互所在整列的背景颜色\n // headerHighlightBorderColor?:ColorPropertyDefine,//表头底部高亮线\n};\nexport type FrameStyle = {\n borderColor?: ColorsDef;\n borderLineWidth?: LineWidthsDef;\n borderLineDash?: LineDashsDef;\n innerBorder?: boolean;\n};\nexport type TableFrameStyle = FrameStyle & {\n shadowBlur?: number; //阴影宽度\n shadowOffsetX?: number; //x方向偏移\n shadowOffsetY?: number; //Y方向偏移\n shadowColor?: string; //阴影颜色\n cornerRadius?: number; //边框圆角半径\n};\nexport type menuStyle = {\n color?: string;\n highlightColor?: string;\n fontSize?: number;\n fontFamily?: string;\n highlightFontSize?: number;\n highlightFontFamily?: string;\n hoverBgColor?: string;\n};\nexport type ScrollStyle = {\n /**滚动条滚动的颜色 */\n scrollRailColor?: string;\n /**滚动条滑块的颜色 */\n scrollSliderColor?: string;\n /**滚动条宽度大小 */\n width?: number;\n /**滚动条是否可见 'always' | 'scrolling' | 'none' | 'focus',常驻|滚动时|不显示|聚焦在画布上时 */\n visible?: 'always' | 'scrolling' | 'none' | 'focus';\n /*** 悬浮与容器上,还是独立于容器外 */\n hoverOn?: boolean;\n /** 是否显示到容器的边缘 尽管内容没有撑满的情况下 默认false */\n barToSide?: boolean;\n};\n/**\n * 气泡框,按钮的的解释信息\n */\nexport type TooltipStyle = {\n fontFamily?: string;\n fontSize?: number;\n color?: string;\n padding?: number[];\n bgColor?: string;\n /** !目前未实现该逻辑。触发行为:hover or click */\n // trigger?: string | string[];\n /**气泡框位置,可选 top left right bottom */\n // placement?: Placement;\n};\nexport interface ITableThemeDefine {\n /** 表格绘制范围外的canvas上填充的颜色 */\n underlayBackgroundColor?: string;\n // selectionBgColor?: ColorPropertyDefine; //多选单元格背景色 手动设置的多选 非框选\n defaultStyle?: ThemeStyle;\n cornerHeaderStyle?: ThemeStyle; //角头样式\n cornerRightTopCellStyle?: ThemeStyle; // 右上角占位单元格样式\n cornerLeftBottomCellStyle?: ThemeStyle; // 左下角占位单元格样式\n cornerRightBottomCellStyle?: ThemeStyle; // 右下角占位单元格样式\n rightFrozenStyle?: ThemeStyle; // 右侧冻结单元格样式\n bottomFrozenStyle?: ThemeStyle; // 下部冻结单元格样式\n headerStyle?: ThemeStyle;\n rowHeaderStyle?: ThemeStyle;\n bodyStyle?: ThemeStyle;\n frameStyle?: TableFrameStyle;\n //列调整宽度的直线\n columnResize?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n labelColor?: string; //label的颜色\n labelFontSize?: number; //label的字体大小\n labelFontFamily?: string; //label的字体\n labelBackgroundFill?: string; //label的背景填充\n labelBackgroundCornerRadius?: number; //label的背景圆角\n };\n //拖拽表格换位分割线的样式\n dragHeaderSplitLine?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n lineWidth: number; //上面线的宽度\n shadowBlockColor?: string; //拖拽时阴影区域的颜色\n };\n //冻结列后面的效果\n frozenColumnLine?: {\n shadow?: {\n //默认效果 会有阴影配置\n width: number; //阴影整体宽度\n startColor: string; //开始颜色\n endColor: string; //结束颜色\n };\n /** TODO 暂未生效 */\n border?: {\n //有些需求要两种效果 这里配置滚动前的边框效果(实现方式是两条线叠加产生),滚动后按上面的阴影效果\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n };\n };\n\n // menuStyle?: menuStyle;\n scrollStyle?: ScrollStyle;\n tooltipStyle?: TooltipStyle;\n // selectHeaderHighlight?: boolean;\n /** 选择框样式 */\n selectionStyle?: //Omit<InteractionStyle, 'inlineRowBgColor' | 'inlineColumnBgColor'>; //鼠标点击到某个单元格\n {\n cellBorderColor?: string; //边框颜色\n cellBorderLineWidth?: number; //边框线宽度\n cellBgColor?: string; //选择框背景颜色\n };\n\n // style for axis\n axisStyle?: {\n defaultAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n leftAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n rightAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n topAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n bottomAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n };\n\n checkboxStyle?: CheckboxStyle;\n\n // style for text pop tip\n textPopTipStyle?: PopTipAttributes;\n\n // senior config for fs\n // 表格四侧单元格,靠近边缘的border是否需要再绘制;如配置false的话,当表格左侧frame未设置情况下左侧单元格不显示左边框,其他方向同理\n cellInnerBorder?: boolean;\n // cell border clip direction\n cellBorderClipDirection?: 'top-left' | 'bottom-right'; // default is 'top-left'\n // text offset, hack for fs\n _contentOffset?: number;\n}\n\nexport type RequiredTableThemeDefine = Required<ITableThemeDefine>;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["/* eslint-disable sort-imports */\nimport type { ColorsDef, LineDashsDef, LineWidthsDef, LineWidthsPropertyDefine, LineDashsPropertyDefine } from '.';\nimport type { CheckboxStyle, ITextStyleOption, RadioStyle } from './column/style';\nimport type { ColorPropertyDefine, ColorsPropertyDefine } from './style-define';\nimport type { ColumnIconOption } from './icon';\nimport type { ICellAxisOption } from './component/axis';\nimport type { PopTipAttributes } from '@visactor/vrender-components';\n// ****** Custom Theme *******\nexport type PartialTableThemeDefine = Partial<ITableThemeDefine>;\nexport type ThemeStyle = ITextStyleOption & {\n hover?: Omit<InteractionStyle, 'cellBorderColor' | 'cellBorderLineWidth'>; //鼠标hover到某个单元格\n // click?: Omit<InteractionStyle, 'inlineRowBgColor' | 'inlineColumnBgColor'>; //鼠标点击到某个单元格\n frameStyle?: FrameStyle;\n};\nexport type InteractionStyle = {\n cellBorderColor?: ColorsPropertyDefine; //交互所在单元格的边框颜色\n cellBorderLineWidth?: LineWidthsPropertyDefine;\n // cellBorderLineDash?:LineDashsPropertyDefine,//用到的场景应该不多\n cellBgColor?: ColorPropertyDefine; //交互所在单元格的背景颜色\n // inlineRowBorderColor?: ColorsPropertyDefine,//交互所在整行的边框颜色\n inlineRowBgColor?: ColorPropertyDefine; //交互所在整行的背景颜色\n // inlineColBorderColor?: ColorsPropertyDefine,//交互所在整列的边框颜色\n inlineColumnBgColor?: ColorPropertyDefine; //交互所在整列的背景颜色\n // headerHighlightBorderColor?:ColorPropertyDefine,//表头底部高亮线\n};\nexport type FrameStyle = {\n borderColor?: ColorsDef;\n borderLineWidth?: LineWidthsDef;\n borderLineDash?: LineDashsDef;\n innerBorder?: boolean;\n};\nexport type TableFrameStyle = FrameStyle & {\n shadowBlur?: number; //阴影宽度\n shadowOffsetX?: number; //x方向偏移\n shadowOffsetY?: number; //Y方向偏移\n shadowColor?: string; //阴影颜色\n cornerRadius?: number; //边框圆角半径\n};\nexport type menuStyle = {\n color?: string;\n highlightColor?: string;\n fontSize?: number;\n fontFamily?: string;\n highlightFontSize?: number;\n highlightFontFamily?: string;\n hoverBgColor?: string;\n};\nexport type ScrollStyle = {\n /**滚动条滚动的颜色 */\n scrollRailColor?: string;\n /**滚动条滑块的颜色 */\n scrollSliderColor?: string;\n /**滚动条宽度大小 */\n width?: number;\n /**滚动条是否可见 'always' | 'scrolling' | 'none' | 'focus',常驻|滚动时|不显示|聚焦在画布上时 */\n visible?: 'always' | 'scrolling' | 'none' | 'focus';\n /*** 悬浮与容器上,还是独立于容器外 */\n hoverOn?: boolean;\n /** 是否显示到容器的边缘 尽管内容没有撑满的情况下 默认false */\n barToSide?: boolean;\n};\n/**\n * 气泡框,按钮的的解释信息\n */\nexport type TooltipStyle = {\n fontFamily?: string;\n fontSize?: number;\n color?: string;\n padding?: number[];\n bgColor?: string;\n /** !目前未实现该逻辑。触发行为:hover or click */\n // trigger?: string | string[];\n /**气泡框位置,可选 top left right bottom */\n // placement?: Placement;\n};\nexport interface ITableThemeDefine {\n /** 表格绘制范围外的canvas上填充的颜色 */\n underlayBackgroundColor?: string;\n // selectionBgColor?: ColorPropertyDefine; //多选单元格背景色 手动设置的多选 非框选\n defaultStyle?: ThemeStyle;\n cornerHeaderStyle?: ThemeStyle; //角头样式\n cornerRightTopCellStyle?: ThemeStyle; // 右上角占位单元格样式\n cornerLeftBottomCellStyle?: ThemeStyle; // 左下角占位单元格样式\n cornerRightBottomCellStyle?: ThemeStyle; // 右下角占位单元格样式\n rightFrozenStyle?: ThemeStyle; // 右侧冻结单元格样式\n bottomFrozenStyle?: ThemeStyle; // 下部冻结单元格样式\n headerStyle?: ThemeStyle;\n rowHeaderStyle?: ThemeStyle;\n bodyStyle?: ThemeStyle;\n frameStyle?: TableFrameStyle;\n //列调整宽度的直线\n columnResize?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n labelColor?: string; //label的颜色\n labelFontSize?: number; //label的字体大小\n labelFontFamily?: string; //label的字体\n labelBackgroundFill?: string; //label的背景填充\n labelBackgroundCornerRadius?: number; //label的背景圆角\n };\n //拖拽表格换位分割线的样式\n dragHeaderSplitLine?: {\n lineColor: ColorPropertyDefine; //上面线的颜色\n lineWidth: number; //上面线的宽度\n shadowBlockColor?: string; //拖拽时阴影区域的颜色\n };\n //冻结列后面的效果\n frozenColumnLine?: {\n shadow?: {\n //默认效果 会有阴影配置\n width: number; //阴影整体宽度\n startColor: string; //开始颜色\n endColor: string; //结束颜色\n };\n /** TODO 暂未生效 */\n border?: {\n //有些需求要两种效果 这里配置滚动前的边框效果(实现方式是两条线叠加产生),滚动后按上面的阴影效果\n lineColor: ColorPropertyDefine; //上面线的颜色\n bgColor?: ColorPropertyDefine; //背景线的颜色\n lineWidth: number; //上面线的宽度\n width?: number; //背景线的宽度\n };\n };\n\n // menuStyle?: menuStyle;\n scrollStyle?: ScrollStyle;\n tooltipStyle?: TooltipStyle;\n // selectHeaderHighlight?: boolean;\n /** 选择框样式 */\n selectionStyle?: //Omit<InteractionStyle, 'inlineRowBgColor' | 'inlineColumnBgColor'>; //鼠标点击到某个单元格\n {\n cellBorderColor?: string; //边框颜色\n cellBorderLineWidth?: number; //边框线宽度\n cellBgColor?: string; //选择框背景颜色\n };\n\n // style for axis\n axisStyle?: {\n defaultAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n leftAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n rightAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n topAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n bottomAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;\n };\n\n checkboxStyle?: CheckboxStyle;\n radioStyle?: RadioStyle;\n\n // style for text pop tip\n textPopTipStyle?: PopTipAttributes;\n\n // senior config for fs\n // 表格四侧单元格,靠近边缘的border是否需要再绘制;如配置false的话,当表格左侧frame未设置情况下左侧单元格不显示左边框,其他方向同理\n cellInnerBorder?: boolean;\n // cell border clip direction\n cellBorderClipDirection?: 'top-left' | 'bottom-right'; // default is 'top-left'\n // text offset, hack for fs\n _contentOffset?: number;\n}\n\nexport type RequiredTableThemeDefine = Required<ITableThemeDefine>;\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 = \"0.
|
|
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 = \"0.24.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": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "canvas table width high performance",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"grid",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@visactor/vrender-core": "0.18.
|
|
39
|
-
"@visactor/vrender-kits": "0.18.
|
|
40
|
-
"@visactor/vrender-components": "0.18.
|
|
38
|
+
"@visactor/vrender-core": "0.18.14-alpha.0",
|
|
39
|
+
"@visactor/vrender-kits": "0.18.14-alpha.0",
|
|
40
|
+
"@visactor/vrender-components": "0.18.14-alpha.0",
|
|
41
41
|
"@visactor/vutils-extension": "~1.10.4",
|
|
42
42
|
"@visactor/vutils": "~0.18.1",
|
|
43
43
|
"@visactor/vscale": "~0.18.1",
|
|
44
44
|
"@visactor/vdataset": "~0.18.1",
|
|
45
45
|
"cssfontparser": "^1.2.1",
|
|
46
|
-
"@visactor/vtable-editors": "0.
|
|
46
|
+
"@visactor/vtable-editors": "0.24.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"luxon": "*",
|
|
@@ -93,9 +93,9 @@
|
|
|
93
93
|
"d3-hierarchy": "^3.1.1",
|
|
94
94
|
"@resvg/resvg-js": "^2.5.0",
|
|
95
95
|
"pikaday": "1.8.2",
|
|
96
|
+
"@internal/bundler": "0.0.1",
|
|
96
97
|
"@internal/eslint-config": "0.0.1",
|
|
97
|
-
"@internal/ts-config": "0.0.1"
|
|
98
|
-
"@internal/bundler": "0.0.1"
|
|
98
|
+
"@internal/ts-config": "0.0.1"
|
|
99
99
|
},
|
|
100
100
|
"unpkg": "latest",
|
|
101
101
|
"unpkgFiles": [
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
const get_cell_merge_1 = require("../utils/get-cell-merge"), update_height_1 = require("./update-height");
|
|
8
|
-
|
|
9
|
-
function updateCellHeight(cell, scene, col, row, maxRowHeight, yTemp, column) {
|
|
10
|
-
const mergeInfo = (0, get_cell_merge_1.getCellMergeInfo)(scene.table, col, row);
|
|
11
|
-
mergeInfo && mergeInfo.end.row - mergeInfo.start.row ? (cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row),
|
|
12
|
-
row === mergeInfo.start.row && cell.setAttribute("y", yTemp), (0, update_height_1.updateCellHeightForColumn)(scene, cell, col, row, maxRowHeight, 0, scene.table.isHeader(col, row))) : "shadow-cell" !== cell.role && (cell.setAttribute("y", yTemp),
|
|
13
|
-
(0, update_height_1.updateCellHeightForColumn)(scene, cell, col, row, maxRowHeight, 0, scene.table.isHeader(col, row)));
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=auto-height.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/layout/auto-height.ts"],"names":[],"mappings":";;AAEA,4DAA2D;AAC3D,mDAA4D;AAoE5D,SAAS,gBAAgB,CACvB,IAAW,EACX,KAAiB,EACjB,GAAW,EACX,GAAW,EACX,YAAoB,EACpB,KAAa,EACb,MAAc;IAEd,MAAM,SAAS,GAAG,IAAA,iCAAgB,EAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC1D,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE;QACxD,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/D,IAAI,GAAG,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE;YAC/B,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC/B;QAED,IAAA,yCAAyB,EAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;KACnG;SAAM,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE;QACtC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAE9B,IAAA,yCAAyB,EAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;KACnG;AACH,CAAC","file":"auto-height.js","sourcesContent":["import type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { updateCellHeightForColumn } from './update-height';\n\n/**\n * @description: 场景树节点生成后,处理自动列宽\n * @param {Scenegraph} scene\n * @param {boolean} clearCellSize 是否重新计算单元格高度,false的话使用目前cell记录的高度,true重新计算当前宽度的情况下单元格内容高度;\n * 在调整列宽时为true,在场景结点生成后为false\n * @return {*}\n */\n// export function updateAutoRowHeight(scene: Scenegraph, clearCellSize?: boolean) {\n// const colHeader = scene.colHeaderGroup;\n// const rowHeader = scene.rowHeaderGroup;\n// const cornerHeader = scene.cornerHeaderGroup;\n// const body = scene.bodyGroup;\n\n// // 获取行高\n// for (let row = 0; row <= scene.bodyRowEnd; row++) {\n// let maxRowHeight = 0;\n// for (let col = 0; col < scene.table.colCount; col++) {\n// const cellGroup = scene.getCell(col, row);\n// // maxRowHeight = Math.max(maxRowHeight, cellGroup.attribute.height);\n// const mergeInfo = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (mergeInfo) {\n// const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n// maxRowHeight = Math.max(\n// maxRowHeight,\n// mergeCell.attribute.height / (mergeInfo.end.row - mergeInfo.start.row + 1)\n// );\n// } else {\n// maxRowHeight = Math.max(maxRowHeight, cellGroup.attribute.height);\n// }\n// }\n// scene.table._setRowHeight(row, maxRowHeight, true);\n// }\n\n// // 设置行高\n// let yTemp = 0;\n// for (let row = 0; row <= scene.bodyRowEnd; row++) {\n// const maxRowHeight = scene.table.getRowHeight(row);\n// if (row === scene.table.columnHeaderLevelCount) {\n// // 更新行表头行高\n// let colHeaderHeight = 0;\n// colHeader?.firstChild?.forEachChildren((cell: Group) => {\n// if (cell.role !== 'shadow-cell') {\n// colHeaderHeight += cell.attribute.height;\n// }\n// });\n// colHeader.setAttribute('height', colHeaderHeight);\n// cornerHeader.setAttribute('height', colHeaderHeight);\n// rowHeader.setAttribute('y', colHeaderHeight);\n// body.setAttribute('y', colHeaderHeight);\n\n// yTemp = 0;\n// }\n\n// for (let col = 0; col < scene.table.colCount; col++) {\n// const cellGroup = scene.getCell(col, row);\n// updateCellHeight(cellGroup, scene, col, row, maxRowHeight, yTemp);\n// }\n// yTemp += maxRowHeight;\n// }\n\n// // 更新容器尺寸\n// rowHeader.setAttribute('height', yTemp);\n// body.setAttribute('height', yTemp);\n// }\n\n// 更新单元格高度信息\nfunction updateCellHeight(\n cell: Group,\n scene: Scenegraph,\n col: number,\n row: number,\n maxRowHeight: number,\n yTemp: number,\n column?: Group\n) {\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n if (row === mergeInfo.start.row) {\n cell.setAttribute('y', yTemp);\n }\n\n updateCellHeightForColumn(scene, cell, col, row, maxRowHeight, 0, scene.table.isHeader(col, row));\n } else if (cell.role !== 'shadow-cell') {\n cell.setAttribute('y', yTemp);\n\n updateCellHeightForColumn(scene, cell, col, row, maxRowHeight, 0, scene.table.isHeader(col, row));\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { getCellMergeInfo } from "../utils/get-cell-merge";
|
|
2
|
-
|
|
3
|
-
import { updateCellHeightForColumn } from "./update-height";
|
|
4
|
-
|
|
5
|
-
function updateCellHeight(cell, scene, col, row, maxRowHeight, yTemp, column) {
|
|
6
|
-
const mergeInfo = getCellMergeInfo(scene.table, col, row);
|
|
7
|
-
mergeInfo && mergeInfo.end.row - mergeInfo.start.row ? (cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row),
|
|
8
|
-
row === mergeInfo.start.row && cell.setAttribute("y", yTemp), updateCellHeightForColumn(scene, cell, col, row, maxRowHeight, 0, scene.table.isHeader(col, row))) : "shadow-cell" !== cell.role && (cell.setAttribute("y", yTemp),
|
|
9
|
-
updateCellHeightForColumn(scene, cell, col, row, maxRowHeight, 0, scene.table.isHeader(col, row)));
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=auto-height.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/layout/auto-height.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAoE5D,SAAS,gBAAgB,CACvB,IAAW,EACX,KAAiB,EACjB,GAAW,EACX,GAAW,EACX,YAAoB,EACpB,KAAa,EACb,MAAc;IAEd,MAAM,SAAS,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC1D,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE;QACxD,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/D,IAAI,GAAG,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE;YAC/B,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC/B;QAED,yBAAyB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;KACnG;SAAM,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE;QACtC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAE9B,yBAAyB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;KACnG;AACH,CAAC","file":"auto-height.js","sourcesContent":["import type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { updateCellHeightForColumn } from './update-height';\n\n/**\n * @description: 场景树节点生成后,处理自动列宽\n * @param {Scenegraph} scene\n * @param {boolean} clearCellSize 是否重新计算单元格高度,false的话使用目前cell记录的高度,true重新计算当前宽度的情况下单元格内容高度;\n * 在调整列宽时为true,在场景结点生成后为false\n * @return {*}\n */\n// export function updateAutoRowHeight(scene: Scenegraph, clearCellSize?: boolean) {\n// const colHeader = scene.colHeaderGroup;\n// const rowHeader = scene.rowHeaderGroup;\n// const cornerHeader = scene.cornerHeaderGroup;\n// const body = scene.bodyGroup;\n\n// // 获取行高\n// for (let row = 0; row <= scene.bodyRowEnd; row++) {\n// let maxRowHeight = 0;\n// for (let col = 0; col < scene.table.colCount; col++) {\n// const cellGroup = scene.getCell(col, row);\n// // maxRowHeight = Math.max(maxRowHeight, cellGroup.attribute.height);\n// const mergeInfo = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (mergeInfo) {\n// const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n// maxRowHeight = Math.max(\n// maxRowHeight,\n// mergeCell.attribute.height / (mergeInfo.end.row - mergeInfo.start.row + 1)\n// );\n// } else {\n// maxRowHeight = Math.max(maxRowHeight, cellGroup.attribute.height);\n// }\n// }\n// scene.table._setRowHeight(row, maxRowHeight, true);\n// }\n\n// // 设置行高\n// let yTemp = 0;\n// for (let row = 0; row <= scene.bodyRowEnd; row++) {\n// const maxRowHeight = scene.table.getRowHeight(row);\n// if (row === scene.table.columnHeaderLevelCount) {\n// // 更新行表头行高\n// let colHeaderHeight = 0;\n// colHeader?.firstChild?.forEachChildren((cell: Group) => {\n// if (cell.role !== 'shadow-cell') {\n// colHeaderHeight += cell.attribute.height;\n// }\n// });\n// colHeader.setAttribute('height', colHeaderHeight);\n// cornerHeader.setAttribute('height', colHeaderHeight);\n// rowHeader.setAttribute('y', colHeaderHeight);\n// body.setAttribute('y', colHeaderHeight);\n\n// yTemp = 0;\n// }\n\n// for (let col = 0; col < scene.table.colCount; col++) {\n// const cellGroup = scene.getCell(col, row);\n// updateCellHeight(cellGroup, scene, col, row, maxRowHeight, yTemp);\n// }\n// yTemp += maxRowHeight;\n// }\n\n// // 更新容器尺寸\n// rowHeader.setAttribute('height', yTemp);\n// body.setAttribute('height', yTemp);\n// }\n\n// 更新单元格高度信息\nfunction updateCellHeight(\n cell: Group,\n scene: Scenegraph,\n col: number,\n row: number,\n maxRowHeight: number,\n yTemp: number,\n column?: Group\n) {\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n if (row === mergeInfo.start.row) {\n cell.setAttribute('y', yTemp);\n }\n\n updateCellHeightForColumn(scene, cell, col, row, maxRowHeight, 0, scene.table.isHeader(col, row));\n } else if (cell.role !== 'shadow-cell') {\n cell.setAttribute('y', yTemp);\n\n updateCellHeightForColumn(scene, cell, col, row, maxRowHeight, 0, scene.table.isHeader(col, row));\n }\n}\n"]}
|