@visactor/vtable 0.24.0-alpha.0 → 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 +1 -1
- package/cjs/PivotTable.js +5 -3
- 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/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 +12 -12
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/tree-helper.js +2 -2
- 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/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 +2232 -881
- 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 +1 -1
- package/es/PivotTable.js +5 -3
- 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/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 +12 -12
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/tree-helper.js +2 -2
- 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/theme.d.ts +2 -1
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +6 -6
- 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"]}
|
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.24.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.24.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/
|
|
39
|
-
"@visactor/vrender-
|
|
40
|
-
"@visactor/vrender-
|
|
41
|
-
"@visactor/vrender-components": "0.18.2-alpha.1",
|
|
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",
|
|
42
41
|
"@visactor/vutils-extension": "~1.10.4",
|
|
43
42
|
"@visactor/vutils": "~0.18.1",
|
|
44
43
|
"@visactor/vscale": "~0.18.1",
|
|
45
44
|
"@visactor/vdataset": "~0.18.1",
|
|
46
|
-
"cssfontparser": "^1.2.1"
|
|
45
|
+
"cssfontparser": "^1.2.1",
|
|
46
|
+
"@visactor/vtable-editors": "0.24.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"luxon": "*",
|
|
@@ -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"]}
|