@visactor/vtable 1.26.5 → 1.26.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/ListTable-all.js +5 -5
- package/cjs/ListTable-all.js.map +1 -1
- package/cjs/ListTable.d.ts +5 -2
- package/cjs/ListTable.js +22 -6
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +5 -4
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable-all.js +4 -3
- package/cjs/PivotTable-all.js.map +1 -1
- package/cjs/body-helper/body-helper.d.ts +2 -1
- package/cjs/body-helper/body-helper.js +5 -3
- package/cjs/body-helper/body-helper.js.map +1 -1
- package/cjs/components/index.js +2 -1
- package/cjs/components/tooltip/TooltipHandler.d.ts +4 -0
- package/cjs/components/tooltip/TooltipHandler.js +32 -7
- package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +1 -0
- package/cjs/core/BaseTable.js +26 -13
- 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/core/row-series-number-helper.d.ts +1 -0
- package/cjs/core/row-series-number-helper.js +3 -1
- package/cjs/core/row-series-number-helper.js.map +1 -1
- package/cjs/core/tableHelper.js +1 -2
- package/cjs/data/CachedDataSource.js +5 -3
- package/cjs/data/CachedDataSource.js.map +1 -1
- package/cjs/data/DataSource.js +2 -1
- package/cjs/event/event.js +1 -1
- package/cjs/event/helper.js +1 -1
- package/cjs/event/media-click.js +145 -13
- package/cjs/event/media-click.js.map +1 -1
- package/cjs/event/scroll.js +1 -1
- package/cjs/event/sparkline-event.js +1 -1
- package/cjs/event/util.js +1 -1
- package/cjs/header-helper/header-helper.d.ts +1 -0
- package/cjs/header-helper/header-helper.js +4 -1
- package/cjs/header-helper/header-helper.js.map +1 -1
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/index.js +2 -1
- package/cjs/plugins/custom-cell-style.js +1 -1
- package/cjs/plugins/index.js +1 -2
- package/cjs/plugins/interface.d.ts +2 -1
- package/cjs/plugins/interface.js +1 -1
- package/cjs/plugins/interface.js.map +1 -1
- package/cjs/plugins/invert-highlight.js +1 -1
- package/cjs/plugins/list-tree-stick-cell.js +1 -1
- package/cjs/plugins/plugin-manager.d.ts +1 -1
- package/cjs/plugins/plugin-manager.js +12 -7
- package/cjs/plugins/plugin-manager.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.d.ts +4 -2
- package/cjs/scenegraph/group-creater/cell-helper.js +67 -42
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/audio-cell.d.ts +7 -0
- package/cjs/scenegraph/group-creater/cell-type/audio-cell.js +83 -0
- package/cjs/scenegraph/group-creater/cell-type/audio-cell.js.map +1 -0
- package/cjs/scenegraph/group-creater/cell-type/button-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/button-cell.js +5 -4
- package/cjs/scenegraph/group-creater/cell-type/button-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -2
- 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 +5 -4
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +43 -15
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/index.d.ts +1 -0
- package/cjs/scenegraph/group-creater/cell-type/index.js +8 -2
- package/cjs/scenegraph/group-creater/cell-type/index.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/media-cell-helper.d.ts +13 -0
- package/cjs/scenegraph/group-creater/cell-type/media-cell-helper.js +64 -0
- package/cjs/scenegraph/group-creater/cell-type/media-cell-helper.js.map +1 -0
- package/cjs/scenegraph/group-creater/cell-type/radio-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/radio-cell.js +23 -7
- package/cjs/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
- 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 +6 -5
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/switch-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/switch-cell.js +5 -4
- package/cjs/scenegraph/group-creater/cell-type/switch-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 +44 -23
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +14 -7
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +24 -8
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -0
- package/cjs/scenegraph/group-creater/progress/proxy.js +11 -5
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/icon/icon-update.js +1 -0
- package/cjs/scenegraph/icon/icon-update.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +8 -3
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +33 -9
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +1 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.js +24 -3
- package/cjs/scenegraph/layout/update-row.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.d.ts +1 -0
- package/cjs/scenegraph/scenegraph.js +93 -64
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/stick-text/index.js +46 -20
- package/cjs/scenegraph/stick-text/index.js.map +1 -1
- package/cjs/scenegraph/utils/deal-promise-data.d.ts +1 -1
- package/cjs/scenegraph/utils/deal-promise-data.js +2 -2
- package/cjs/scenegraph/utils/deal-promise-data.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +4 -3
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/cell-move/index.js +6 -3
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/checkbox/checkbox.d.ts +6 -1
- package/cjs/state/checkbox/checkbox.js +191 -36
- package/cjs/state/checkbox/checkbox.js.map +1 -1
- package/cjs/state/radio/radio.d.ts +3 -1
- package/cjs/state/radio/radio.js +69 -12
- package/cjs/state/radio/radio.js.map +1 -1
- package/cjs/state/state.d.ts +3 -2
- package/cjs/state/state.js +6 -3
- package/cjs/state/state.js.map +1 -1
- package/cjs/tools/media.d.ts +1 -0
- package/cjs/tools/media.js +19 -0
- package/cjs/tools/media.js.map +1 -0
- package/cjs/ts-types/base-table.d.ts +2 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/column/type.d.ts +2 -2
- package/cjs/ts-types/column/type.js.map +1 -1
- package/cjs/ts-types/events.d.ts +3 -1
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/icon.d.ts +1 -0
- package/cjs/ts-types/icon.js.map +1 -1
- package/cjs/ts-types/list-table/define/image-define.d.ts +10 -0
- package/cjs/ts-types/list-table/define/image-define.js.map +1 -1
- package/cjs/ts-types/list-table/define/index.d.ts +5 -4
- package/cjs/ts-types/list-table/define/index.js.map +1 -1
- package/cjs/ts-types/list-table/layout-map/api.d.ts +4 -4
- package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
- package/cjs/ts-types/list-table/layout-map/index.d.ts +1 -1
- package/cjs/ts-types/list-table/layout-map/index.js.map +1 -1
- package/cjs/ts-types/menu.d.ts +12 -0
- package/cjs/ts-types/menu.js.map +1 -1
- package/cjs/ts-types/pivot-table/dimension/image-dimension.d.ts +5 -0
- package/cjs/ts-types/pivot-table/dimension/image-dimension.js.map +1 -1
- package/cjs/ts-types/pivot-table/dimension/index.d.ts +5 -3
- package/cjs/ts-types/pivot-table/dimension/index.js.map +1 -1
- package/cjs/ts-types/pivot-table/indicator/image-indicator.d.ts +10 -0
- package/cjs/ts-types/pivot-table/indicator/image-indicator.js.map +1 -1
- package/cjs/ts-types/pivot-table/indicator/index.d.ts +3 -3
- package/cjs/ts-types/pivot-table/indicator/index.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +13 -4
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/tooltip.d.ts +1 -0
- package/cjs/ts-types/tooltip.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +1528 -367
- package/dist/vtable.min.js +1 -1
- package/es/ListTable-all.js +4 -4
- package/es/ListTable-all.js.map +1 -1
- package/es/ListTable.d.ts +5 -2
- package/es/ListTable.js +22 -7
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +4 -4
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable-all.js +4 -4
- package/es/PivotTable-all.js.map +1 -1
- package/es/body-helper/body-helper.d.ts +2 -1
- package/es/body-helper/body-helper.js +5 -3
- package/es/body-helper/body-helper.js.map +1 -1
- package/es/components/index.js +2 -1
- package/es/components/tooltip/TooltipHandler.d.ts +4 -0
- package/es/components/tooltip/TooltipHandler.js +32 -7
- package/es/components/tooltip/TooltipHandler.js.map +1 -1
- package/es/core/BaseTable.d.ts +1 -0
- package/es/core/BaseTable.js +28 -15
- 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/core/row-series-number-helper.d.ts +1 -0
- package/es/core/row-series-number-helper.js +3 -1
- package/es/core/row-series-number-helper.js.map +1 -1
- package/es/core/tableHelper.js +1 -2
- package/es/data/CachedDataSource.js +5 -3
- package/es/data/CachedDataSource.js.map +1 -1
- package/es/data/DataSource.js +2 -1
- package/es/event/event.js +1 -1
- package/es/event/helper.js +1 -1
- package/es/event/media-click.js +148 -12
- package/es/event/media-click.js.map +1 -1
- package/es/event/scroll.js +1 -1
- package/es/event/sparkline-event.js +1 -1
- package/es/event/util.js +1 -1
- package/es/header-helper/header-helper.d.ts +1 -0
- package/es/header-helper/header-helper.js +4 -1
- package/es/header-helper/header-helper.js.map +1 -1
- package/es/index.d.ts +3 -3
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/index.js +2 -1
- package/es/plugins/custom-cell-style.js +1 -1
- package/es/plugins/index.js +1 -2
- package/es/plugins/interface.d.ts +2 -1
- package/es/plugins/interface.js +1 -1
- package/es/plugins/interface.js.map +1 -1
- package/es/plugins/invert-highlight.js +1 -1
- package/es/plugins/list-tree-stick-cell.js +1 -1
- package/es/plugins/plugin-manager.d.ts +1 -1
- package/es/plugins/plugin-manager.js +12 -7
- package/es/plugins/plugin-manager.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.d.ts +4 -2
- package/es/scenegraph/group-creater/cell-helper.js +67 -40
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/audio-cell.d.ts +7 -0
- package/es/scenegraph/group-creater/cell-type/audio-cell.js +89 -0
- package/es/scenegraph/group-creater/cell-type/audio-cell.js.map +1 -0
- package/es/scenegraph/group-creater/cell-type/button-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/button-cell.js +5 -4
- package/es/scenegraph/group-creater/cell-type/button-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -2
- 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 +5 -4
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js +43 -14
- package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/index.d.ts +1 -0
- package/es/scenegraph/group-creater/cell-type/index.js +6 -0
- package/es/scenegraph/group-creater/cell-type/index.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/media-cell-helper.d.ts +13 -0
- package/es/scenegraph/group-creater/cell-type/media-cell-helper.js +56 -0
- package/es/scenegraph/group-creater/cell-type/media-cell-helper.js.map +1 -0
- package/es/scenegraph/group-creater/cell-type/radio-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/radio-cell.js +23 -7
- package/es/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
- 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 +6 -5
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/switch-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/switch-cell.js +5 -4
- package/es/scenegraph/group-creater/cell-type/switch-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 +47 -22
- package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +14 -8
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +24 -8
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -0
- package/es/scenegraph/group-creater/progress/proxy.js +11 -5
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/icon/icon-update.js +1 -0
- package/es/scenegraph/icon/icon-update.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +8 -3
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +32 -9
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +1 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +25 -2
- package/es/scenegraph/layout/update-row.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.d.ts +1 -0
- package/es/scenegraph/scenegraph.js +93 -64
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/stick-text/index.js +46 -18
- package/es/scenegraph/stick-text/index.js.map +1 -1
- package/es/scenegraph/utils/deal-promise-data.d.ts +1 -1
- package/es/scenegraph/utils/deal-promise-data.js +2 -2
- package/es/scenegraph/utils/deal-promise-data.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +7 -6
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/cell-move/index.js +6 -3
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/checkbox/checkbox.d.ts +6 -1
- package/es/state/checkbox/checkbox.js +186 -34
- package/es/state/checkbox/checkbox.js.map +1 -1
- package/es/state/radio/radio.d.ts +3 -1
- package/es/state/radio/radio.js +70 -13
- package/es/state/radio/radio.js.map +1 -1
- package/es/state/state.d.ts +3 -2
- package/es/state/state.js +6 -2
- package/es/state/state.js.map +1 -1
- package/es/tools/media.d.ts +1 -0
- package/es/tools/media.js +11 -0
- package/es/tools/media.js.map +1 -0
- package/es/ts-types/base-table.d.ts +2 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/column/type.d.ts +2 -2
- package/es/ts-types/column/type.js.map +1 -1
- package/es/ts-types/events.d.ts +3 -1
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/icon.d.ts +1 -0
- package/es/ts-types/icon.js.map +1 -1
- package/es/ts-types/list-table/define/image-define.d.ts +10 -0
- package/es/ts-types/list-table/define/image-define.js.map +1 -1
- package/es/ts-types/list-table/define/index.d.ts +5 -4
- package/es/ts-types/list-table/define/index.js.map +1 -1
- package/es/ts-types/list-table/layout-map/api.d.ts +4 -4
- package/es/ts-types/list-table/layout-map/api.js.map +1 -1
- package/es/ts-types/list-table/layout-map/index.d.ts +1 -1
- package/es/ts-types/list-table/layout-map/index.js.map +1 -1
- package/es/ts-types/menu.d.ts +12 -0
- package/es/ts-types/menu.js.map +1 -1
- package/es/ts-types/pivot-table/dimension/image-dimension.d.ts +5 -0
- package/es/ts-types/pivot-table/dimension/image-dimension.js.map +1 -1
- package/es/ts-types/pivot-table/dimension/index.d.ts +5 -3
- package/es/ts-types/pivot-table/dimension/index.js.map +1 -1
- package/es/ts-types/pivot-table/indicator/image-indicator.d.ts +10 -0
- package/es/ts-types/pivot-table/indicator/image-indicator.js.map +1 -1
- package/es/ts-types/pivot-table/indicator/index.d.ts +3 -3
- package/es/ts-types/pivot-table/indicator/index.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +13 -4
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/tooltip.d.ts +1 -0
- package/es/ts-types/tooltip.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -4
package/dist/vtable.js
CHANGED
|
@@ -44946,6 +44946,7 @@
|
|
|
44946
44946
|
MOUSELEAVE_CELL: 'mouseleave_cell',
|
|
44947
44947
|
CONTEXTMENU_CELL: 'contextmenu_cell',
|
|
44948
44948
|
CONTEXTMENU_CANVAS: 'contextmenu_canvas',
|
|
44949
|
+
CONTEXT_MENU_CLICK: 'context_menu_click',
|
|
44949
44950
|
RESIZE_COLUMN: 'resize_column',
|
|
44950
44951
|
RESIZE_COLUMN_END: 'resize_column_end',
|
|
44951
44952
|
RESIZE_ROW: 'resize_row',
|
|
@@ -54828,6 +54829,9 @@
|
|
|
54828
54829
|
continue;
|
|
54829
54830
|
}
|
|
54830
54831
|
const originRecordIndex = this.getOriginRecordIndexForGroup(recordIndex);
|
|
54832
|
+
if (!isValid$1(originRecordIndex)) {
|
|
54833
|
+
continue;
|
|
54834
|
+
}
|
|
54831
54835
|
this.beforeChangedRecordsMap.delete(originRecordIndex.toString());
|
|
54832
54836
|
this.dataSourceObj.records.splice(originRecordIndex, 1);
|
|
54833
54837
|
this.sourceLength -= 1;
|
|
@@ -54842,6 +54846,9 @@
|
|
|
54842
54846
|
continue;
|
|
54843
54847
|
}
|
|
54844
54848
|
const originRecordIndex = this.getOriginRecordIndexForGroup(recordIndex);
|
|
54849
|
+
if (!isValid$1(originRecordIndex)) {
|
|
54850
|
+
continue;
|
|
54851
|
+
}
|
|
54845
54852
|
this.beforeChangedRecordsMap.delete(originRecordIndex.toString());
|
|
54846
54853
|
this.dataSourceObj.records[originRecordIndex] = records[index];
|
|
54847
54854
|
}
|
|
@@ -57743,17 +57750,25 @@
|
|
|
57743
57750
|
if ('shape' in icon && icon.shape === 'circle') {
|
|
57744
57751
|
iconAttribute.shape = icon.shape;
|
|
57745
57752
|
}
|
|
57753
|
+
if (icon.type === 'text') {
|
|
57754
|
+
iconAttribute.text = icon.content;
|
|
57755
|
+
merge(iconAttribute, icon.style);
|
|
57756
|
+
}
|
|
57757
|
+
if (isNil$1(iconAttribute.opacity)) {
|
|
57758
|
+
iconAttribute.opacity =
|
|
57759
|
+
iconAttribute.visibleTime === 'mouseenter_cell' || iconAttribute.visibleTime === 'click_cell' ? 0 : 1;
|
|
57760
|
+
}
|
|
57746
57761
|
if (mark) {
|
|
57747
57762
|
mark.setAttributes(iconAttribute);
|
|
57748
|
-
|
|
57763
|
+
if (iconAttribute.image) {
|
|
57764
|
+
mark.loadImage(iconAttribute.image);
|
|
57765
|
+
}
|
|
57749
57766
|
mark.tooltip = icon.tooltip;
|
|
57750
57767
|
mark.name = icon.name;
|
|
57751
57768
|
return mark;
|
|
57752
57769
|
}
|
|
57753
57770
|
let iconMark;
|
|
57754
57771
|
if (icon.type === 'text') {
|
|
57755
|
-
iconAttribute.text = icon.content;
|
|
57756
|
-
merge(iconAttribute, icon.style);
|
|
57757
57772
|
iconMark = new TextIcon(iconAttribute);
|
|
57758
57773
|
iconMark.tooltip = icon.tooltip;
|
|
57759
57774
|
iconMark.name = icon.name;
|
|
@@ -58128,7 +58143,80 @@
|
|
|
58128
58143
|
}
|
|
58129
58144
|
}
|
|
58130
58145
|
|
|
58131
|
-
|
|
58146
|
+
const CELL_MEDIA_KEY = '__vtable_cell_media__';
|
|
58147
|
+
const CELL_MEDIA_KIND_KEY = '__vtable_cell_media_kind__';
|
|
58148
|
+
function markCellMedia(graphic, kind) {
|
|
58149
|
+
graphic[CELL_MEDIA_KEY] = true;
|
|
58150
|
+
graphic[CELL_MEDIA_KIND_KEY] = kind;
|
|
58151
|
+
return graphic;
|
|
58152
|
+
}
|
|
58153
|
+
function isCellMedia(graphic) {
|
|
58154
|
+
return graphic?.[CELL_MEDIA_KEY] === true;
|
|
58155
|
+
}
|
|
58156
|
+
function getCellMediaChildren(cellGroup) {
|
|
58157
|
+
const mediaChildren = [];
|
|
58158
|
+
cellGroup.forEachChildren((child) => {
|
|
58159
|
+
if (isCellMedia(child)) {
|
|
58160
|
+
mediaChildren.push(child);
|
|
58161
|
+
}
|
|
58162
|
+
});
|
|
58163
|
+
return mediaChildren;
|
|
58164
|
+
}
|
|
58165
|
+
function getCellMediaByKind(cellGroup, kind) {
|
|
58166
|
+
let graphic;
|
|
58167
|
+
cellGroup.forEachChildren((child) => {
|
|
58168
|
+
if (isCellMedia(child) && child[CELL_MEDIA_KIND_KEY] === kind) {
|
|
58169
|
+
graphic = child;
|
|
58170
|
+
return true;
|
|
58171
|
+
}
|
|
58172
|
+
return false;
|
|
58173
|
+
});
|
|
58174
|
+
return graphic;
|
|
58175
|
+
}
|
|
58176
|
+
function getCellMediaImage(cellGroup) {
|
|
58177
|
+
return getCellMediaByKind(cellGroup, 'image');
|
|
58178
|
+
}
|
|
58179
|
+
function getCellMediaPlayIcon(cellGroup) {
|
|
58180
|
+
return getCellMediaByKind(cellGroup, 'play-icon');
|
|
58181
|
+
}
|
|
58182
|
+
function releaseVideoResource(video) {
|
|
58183
|
+
try {
|
|
58184
|
+
video.pause();
|
|
58185
|
+
}
|
|
58186
|
+
catch (err) {
|
|
58187
|
+
}
|
|
58188
|
+
video.removeAttribute('src');
|
|
58189
|
+
try {
|
|
58190
|
+
video.load();
|
|
58191
|
+
}
|
|
58192
|
+
catch (err) {
|
|
58193
|
+
}
|
|
58194
|
+
}
|
|
58195
|
+
function releaseGraphicMediaResource(graphic) {
|
|
58196
|
+
const source = graphic?.attribute?.image;
|
|
58197
|
+
if (typeof HTMLVideoElement !== 'undefined' && source instanceof HTMLVideoElement) {
|
|
58198
|
+
releaseVideoResource(source);
|
|
58199
|
+
}
|
|
58200
|
+
}
|
|
58201
|
+
function removeCellMediaChildren(cellGroup) {
|
|
58202
|
+
const mediaChildren = getCellMediaChildren(cellGroup);
|
|
58203
|
+
mediaChildren.forEach(child => {
|
|
58204
|
+
releaseGraphicMediaResource(child);
|
|
58205
|
+
cellGroup.removeChild(child);
|
|
58206
|
+
child.release?.();
|
|
58207
|
+
});
|
|
58208
|
+
}
|
|
58209
|
+
|
|
58210
|
+
function hasCellMedia(cellGroup) {
|
|
58211
|
+
return getCellMediaChildren(cellGroup).length > 0;
|
|
58212
|
+
}
|
|
58213
|
+
function getResizeImage(cellGroup) {
|
|
58214
|
+
return hasCellMedia(cellGroup) ? getCellMediaImage(cellGroup) : undefined;
|
|
58215
|
+
}
|
|
58216
|
+
function getResizePlayIcon(cellGroup) {
|
|
58217
|
+
return hasCellMedia(cellGroup) ? getCellMediaPlayIcon(cellGroup) : undefined;
|
|
58218
|
+
}
|
|
58219
|
+
function createImageCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync, cellValue) {
|
|
58132
58220
|
const headerStyle = table._getCellStyle(col, row);
|
|
58133
58221
|
const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
|
|
58134
58222
|
if (table.options.customConfig?.imageMargin) {
|
|
@@ -58228,18 +58316,19 @@
|
|
|
58228
58316
|
child.setAttribute('y', padding[0]);
|
|
58229
58317
|
}
|
|
58230
58318
|
});
|
|
58231
|
-
cellGroup._cellLeftIconWidth = cellLeftIconWidth;
|
|
58232
|
-
cellGroup._cellRightIconWidth = cellRightIconWidth;
|
|
58233
58319
|
}
|
|
58234
|
-
|
|
58235
|
-
|
|
58320
|
+
cellGroup._cellLeftIconWidth = cellLeftIconWidth;
|
|
58321
|
+
cellGroup._cellRightIconWidth = cellRightIconWidth;
|
|
58322
|
+
const value = arguments.length >= 18 ? cellValue : table.getCellValue(col, row);
|
|
58323
|
+
removeCellMediaChildren(cellGroup);
|
|
58324
|
+
const image = markCellMedia(createImage({
|
|
58236
58325
|
x: padding[3],
|
|
58237
58326
|
y: padding[0],
|
|
58238
58327
|
width: width - padding[1] - padding[3] - iconWidth,
|
|
58239
58328
|
height: height - padding[0] - padding[2],
|
|
58240
58329
|
image: value,
|
|
58241
58330
|
cursor: 'pointer'
|
|
58242
|
-
});
|
|
58331
|
+
}), 'image');
|
|
58243
58332
|
image.name = 'image';
|
|
58244
58333
|
image.keepAspectRatio = keepAspectRatio;
|
|
58245
58334
|
image.textAlign = textAlign;
|
|
@@ -58331,13 +58420,13 @@
|
|
|
58331
58420
|
return false;
|
|
58332
58421
|
}
|
|
58333
58422
|
function updateImageCellContentWhileResize(cellGroup, col, row, deltaX, deltaY, table) {
|
|
58334
|
-
const image = cellGroup
|
|
58423
|
+
const image = getResizeImage(cellGroup);
|
|
58335
58424
|
if (!image) {
|
|
58336
58425
|
return;
|
|
58337
58426
|
}
|
|
58338
58427
|
const originImage = (typeof image.attribute.image !== 'string' && image.attribute.image) ||
|
|
58339
58428
|
image.resources?.get(image.attribute.image).data;
|
|
58340
|
-
if (!originImage) {
|
|
58429
|
+
if (!originImage && !image.isAudioIcon) {
|
|
58341
58430
|
return;
|
|
58342
58431
|
}
|
|
58343
58432
|
const headerStyle = table._getCellStyle(col, row);
|
|
@@ -58354,16 +58443,34 @@
|
|
|
58354
58443
|
const colStart = cellGroup.mergeStartCol ?? cellGroup.col;
|
|
58355
58444
|
const rowStart = cellGroup.mergeStartRow ?? cellGroup.row;
|
|
58356
58445
|
const colEnd = cellGroup.mergeEndCol ?? cellGroup.col;
|
|
58357
|
-
const rowEnd = cellGroup.
|
|
58446
|
+
const rowEnd = cellGroup.mergeEndRow ?? cellGroup.row;
|
|
58358
58447
|
const leftIconWidth = cellGroup._cellLeftIconWidth ?? 0;
|
|
58359
58448
|
const rightIconWidth = cellGroup._cellRightIconWidth ?? 0;
|
|
58360
|
-
if (image.
|
|
58449
|
+
if (image.isAudioIcon) {
|
|
58450
|
+
const availableWidth = Math.max(1, cellWidth - padding[1] - padding[3] - leftIconWidth - rightIconWidth);
|
|
58451
|
+
const availableHeight = Math.max(1, cellHeight - padding[0] - padding[2]);
|
|
58452
|
+
const iconSize = Math.max(1, Math.min(availableWidth, availableHeight, 32));
|
|
58453
|
+
const pos = calcStartPosition(leftIconWidth, 0, cellWidth - leftIconWidth - rightIconWidth, cellHeight, iconSize, iconSize, textAlign, textBaseline, padding);
|
|
58454
|
+
for (let col = colStart; col <= colEnd; col++) {
|
|
58455
|
+
for (let row = rowStart; row <= rowEnd; row++) {
|
|
58456
|
+
const cellGroup = table.scenegraph.getCell(col, row);
|
|
58457
|
+
const image = getResizeImage(cellGroup);
|
|
58458
|
+
image?.setAttributes({
|
|
58459
|
+
x: pos.x,
|
|
58460
|
+
y: pos.y,
|
|
58461
|
+
width: iconSize,
|
|
58462
|
+
height: iconSize
|
|
58463
|
+
});
|
|
58464
|
+
}
|
|
58465
|
+
}
|
|
58466
|
+
}
|
|
58467
|
+
else if (image.keepAspectRatio || isDamagePic(image)) {
|
|
58361
58468
|
const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(originImage.width || originImage.videoWidth, originImage.height || originImage.videoHeight, cellWidth - (padding[1] + padding[3]), cellHeight - (padding[0] + padding[2]));
|
|
58362
58469
|
const pos = calcStartPosition(0, 0, cellWidth, cellHeight, imageWidth, imageHeight, textAlign, textBaseline, padding);
|
|
58363
58470
|
for (let col = colStart; col <= colEnd; col++) {
|
|
58364
58471
|
for (let row = rowStart; row <= rowEnd; row++) {
|
|
58365
58472
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
58366
|
-
const image = cellGroup
|
|
58473
|
+
const image = getResizeImage(cellGroup);
|
|
58367
58474
|
image?.setAttributes({
|
|
58368
58475
|
x: pos.x,
|
|
58369
58476
|
y: pos.y,
|
|
@@ -58377,7 +58484,7 @@
|
|
|
58377
58484
|
for (let col = colStart; col <= colEnd; col++) {
|
|
58378
58485
|
for (let row = rowStart; row <= rowEnd; row++) {
|
|
58379
58486
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
58380
|
-
const image = cellGroup
|
|
58487
|
+
const image = getResizeImage(cellGroup);
|
|
58381
58488
|
image?.setAttributes({
|
|
58382
58489
|
x: leftIconWidth + padding[3],
|
|
58383
58490
|
y: padding[0],
|
|
@@ -58387,7 +58494,7 @@
|
|
|
58387
58494
|
}
|
|
58388
58495
|
}
|
|
58389
58496
|
}
|
|
58390
|
-
const playIcon = cellGroup
|
|
58497
|
+
const playIcon = getResizePlayIcon(cellGroup);
|
|
58391
58498
|
if (playIcon) {
|
|
58392
58499
|
const left = 0;
|
|
58393
58500
|
const top = 0;
|
|
@@ -58398,8 +58505,8 @@
|
|
|
58398
58505
|
for (let col = colStart; col <= colEnd; col++) {
|
|
58399
58506
|
for (let row = rowStart; row <= rowEnd; row++) {
|
|
58400
58507
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
58401
|
-
const playIcon = cellGroup
|
|
58402
|
-
playIcon
|
|
58508
|
+
const playIcon = getResizePlayIcon(cellGroup);
|
|
58509
|
+
playIcon?.setAttributes({
|
|
58403
58510
|
x: anchorX - iconSize / 2,
|
|
58404
58511
|
y: anchorY - iconSize / 2,
|
|
58405
58512
|
width: iconSize,
|
|
@@ -58456,14 +58563,14 @@
|
|
|
58456
58563
|
for (let row = startRow; row <= endRow; row++) {
|
|
58457
58564
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
58458
58565
|
if (cellGroup) {
|
|
58459
|
-
const image = cellGroup
|
|
58566
|
+
const image = getResizeImage(cellGroup);
|
|
58460
58567
|
if (image) {
|
|
58461
58568
|
image.setAttributes({
|
|
58462
58569
|
dx: -table.getColsWidth(cellGroup.mergeStartCol, col - 1),
|
|
58463
58570
|
dy: -table.getRowsHeight(cellGroup.mergeStartRow, row - 1)
|
|
58464
58571
|
});
|
|
58465
58572
|
}
|
|
58466
|
-
const playIcon = cellGroup
|
|
58573
|
+
const playIcon = getResizePlayIcon(cellGroup);
|
|
58467
58574
|
if (playIcon) {
|
|
58468
58575
|
playIcon.setAttributes({
|
|
58469
58576
|
dx: -table.getColsWidth(cellGroup.mergeStartCol, col - 1),
|
|
@@ -58504,8 +58611,8 @@
|
|
|
58504
58611
|
|
|
58505
58612
|
function dealPromiseData(dataPromise, tabel, callback) {
|
|
58506
58613
|
dataPromise
|
|
58507
|
-
.then(
|
|
58508
|
-
callback();
|
|
58614
|
+
.then(value => {
|
|
58615
|
+
callback(value);
|
|
58509
58616
|
tabel.scenegraph.updateNextFrame();
|
|
58510
58617
|
})
|
|
58511
58618
|
.catch((err) => {
|
|
@@ -58525,19 +58632,34 @@
|
|
|
58525
58632
|
}
|
|
58526
58633
|
}
|
|
58527
58634
|
|
|
58528
|
-
|
|
58635
|
+
const PROMISE_CELL_UPDATE_TOKEN_KEY = '__vtable_promise_cell_update_token__';
|
|
58636
|
+
function nextPromiseCellUpdateToken(cellGroup) {
|
|
58637
|
+
const token = (cellGroup[PROMISE_CELL_UPDATE_TOKEN_KEY] ?? 0) + 1;
|
|
58638
|
+
cellGroup[PROMISE_CELL_UPDATE_TOKEN_KEY] = token;
|
|
58639
|
+
return token;
|
|
58640
|
+
}
|
|
58641
|
+
function isPromiseCellUpdateCurrent(table, col, row, cellGroup, token) {
|
|
58642
|
+
const currentCellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);
|
|
58643
|
+
return currentCellGroup === cellGroup && cellGroup[PROMISE_CELL_UPDATE_TOKEN_KEY] === token;
|
|
58644
|
+
}
|
|
58645
|
+
function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult, cellValue) {
|
|
58529
58646
|
let isAsync = false;
|
|
58530
58647
|
let cellGroup;
|
|
58648
|
+
const hasCellValue = arguments.length >= 19;
|
|
58649
|
+
let renderValue = hasCellValue ? cellValue : value;
|
|
58531
58650
|
if (isPromise(value)) {
|
|
58532
58651
|
if (table.scenegraph.highPerformanceGetCell(col, row).role !== 'cell') {
|
|
58533
58652
|
return cellGroup;
|
|
58534
58653
|
}
|
|
58535
|
-
|
|
58654
|
+
if (!hasCellValue) {
|
|
58655
|
+
renderValue = table.getCellValue(col, row);
|
|
58656
|
+
}
|
|
58536
58657
|
isAsync = true;
|
|
58537
58658
|
}
|
|
58659
|
+
value = renderValue;
|
|
58538
58660
|
if (type === 'checkbox' && define.tree) {
|
|
58539
58661
|
const createCheckboxCellGroup = Factory.getFunction('createCheckboxCellGroup');
|
|
58540
|
-
cellGroup = createCheckboxCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, true);
|
|
58662
|
+
cellGroup = createCheckboxCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, true, value);
|
|
58541
58663
|
}
|
|
58542
58664
|
else if (type === 'text' || type === 'link' || customResult) {
|
|
58543
58665
|
if (type === 'link') {
|
|
@@ -58596,11 +58718,15 @@
|
|
|
58596
58718
|
}
|
|
58597
58719
|
else if (type === 'image') {
|
|
58598
58720
|
const createImageCellGroup = Factory.getFunction('createImageCellGroup');
|
|
58599
|
-
cellGroup = createImageCellGroup(columnGroup, 0, y, col, row, cellWidth, cellHeight, define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync);
|
|
58721
|
+
cellGroup = createImageCellGroup(columnGroup, 0, y, col, row, cellWidth, cellHeight, define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync, value);
|
|
58722
|
+
}
|
|
58723
|
+
else if (type === 'audio') {
|
|
58724
|
+
const createAudioCellGroup = Factory.getFunction('createAudioCellGroup');
|
|
58725
|
+
cellGroup = createAudioCellGroup(columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync, value);
|
|
58600
58726
|
}
|
|
58601
58727
|
else if (type === 'video') {
|
|
58602
58728
|
const createVideoCellGroup = Factory.getFunction('createVideoCellGroup');
|
|
58603
|
-
cellGroup = createVideoCellGroup(columnGroup, 0, y, col, row, cellWidth, cellHeight, define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync);
|
|
58729
|
+
cellGroup = createVideoCellGroup(columnGroup, 0, y, col, row, cellWidth, cellHeight, define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync, value);
|
|
58604
58730
|
}
|
|
58605
58731
|
else if (type === 'chart') {
|
|
58606
58732
|
const chartInstance = table.internalProps.layoutMap.getChartInstance(col, row);
|
|
@@ -58624,7 +58750,7 @@
|
|
|
58624
58750
|
}
|
|
58625
58751
|
else if (type === 'sparkline') {
|
|
58626
58752
|
const createSparkLineCellGroup = Factory.getFunction('createSparkLineCellGroup');
|
|
58627
|
-
cellGroup = createSparkLineCellGroup(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme, isAsync);
|
|
58753
|
+
cellGroup = createSparkLineCellGroup(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme, isAsync, value);
|
|
58628
58754
|
}
|
|
58629
58755
|
else if (type === 'checkbox') {
|
|
58630
58756
|
const isAggregation = 'isAggregation' in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row);
|
|
@@ -58634,7 +58760,7 @@
|
|
|
58634
58760
|
}
|
|
58635
58761
|
else {
|
|
58636
58762
|
const createCheckboxCellGroup = Factory.getFunction('createCheckboxCellGroup');
|
|
58637
|
-
cellGroup = createCheckboxCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, false);
|
|
58763
|
+
cellGroup = createCheckboxCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, false, value);
|
|
58638
58764
|
}
|
|
58639
58765
|
}
|
|
58640
58766
|
else if (type === 'radio') {
|
|
@@ -58645,16 +58771,16 @@
|
|
|
58645
58771
|
}
|
|
58646
58772
|
else {
|
|
58647
58773
|
const createRadioCellGroup = Factory.getFunction('createRadioCellGroup');
|
|
58648
|
-
cellGroup = createRadioCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
|
|
58774
|
+
cellGroup = createRadioCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range, isAsync, value);
|
|
58649
58775
|
}
|
|
58650
58776
|
}
|
|
58651
58777
|
else if (type === 'switch') {
|
|
58652
58778
|
const createSwitchCellGroup = Factory.getFunction('createSwitchCellGroup');
|
|
58653
|
-
cellGroup = createSwitchCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
|
|
58779
|
+
cellGroup = createSwitchCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, value);
|
|
58654
58780
|
}
|
|
58655
58781
|
else if (type === 'button') {
|
|
58656
58782
|
const createButtonCellGroup = Factory.getFunction('createButtonCellGroup');
|
|
58657
|
-
cellGroup = createButtonCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
|
|
58783
|
+
cellGroup = createButtonCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, value);
|
|
58658
58784
|
}
|
|
58659
58785
|
cellGroup.onBeforeAttributeUpdate = onBeforeAttributeUpdateForInvertHighlight;
|
|
58660
58786
|
return cellGroup;
|
|
@@ -58866,10 +58992,11 @@
|
|
|
58866
58992
|
cellHeight = table.getRowHeight(row);
|
|
58867
58993
|
}
|
|
58868
58994
|
if (isPromise(value)) {
|
|
58995
|
+
const updateToken = nextPromiseCellUpdateToken(oldCellGroup);
|
|
58996
|
+
removeCellMediaChildren(oldCellGroup);
|
|
58869
58997
|
oldCellGroup.removeAllChild();
|
|
58870
58998
|
dealPromiseData(value, table, callUpdateCellContentForPromiseValue.bind(null, {
|
|
58871
58999
|
type,
|
|
58872
|
-
value,
|
|
58873
59000
|
define,
|
|
58874
59001
|
table,
|
|
58875
59002
|
col,
|
|
@@ -58884,7 +59011,9 @@
|
|
|
58884
59011
|
addNew,
|
|
58885
59012
|
range,
|
|
58886
59013
|
customResult,
|
|
58887
|
-
customStyle
|
|
59014
|
+
customStyle,
|
|
59015
|
+
promiseValue: value,
|
|
59016
|
+
updateToken
|
|
58888
59017
|
}));
|
|
58889
59018
|
}
|
|
58890
59019
|
else {
|
|
@@ -58904,10 +59033,8 @@
|
|
|
58904
59033
|
}
|
|
58905
59034
|
return newCellGroup;
|
|
58906
59035
|
}
|
|
58907
|
-
function updateCellContent(type, value, define, table, col, row, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult) {
|
|
58908
|
-
|
|
58909
|
-
value = table.getCellValue(col, row);
|
|
58910
|
-
}
|
|
59036
|
+
function updateCellContent(type, value, define, table, col, row, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult, cellValue) {
|
|
59037
|
+
const hasCellValue = arguments.length >= 18;
|
|
58911
59038
|
if (!addNew && (oldCellGroup.row !== row || oldCellGroup.col !== col)) {
|
|
58912
59039
|
return null;
|
|
58913
59040
|
}
|
|
@@ -58922,10 +59049,34 @@
|
|
|
58922
59049
|
}
|
|
58923
59050
|
}
|
|
58924
59051
|
}
|
|
58925
|
-
const
|
|
58926
|
-
|
|
59052
|
+
const createCellArgs = [
|
|
59053
|
+
type,
|
|
59054
|
+
value,
|
|
59055
|
+
define,
|
|
59056
|
+
table,
|
|
59057
|
+
col,
|
|
59058
|
+
row,
|
|
59059
|
+
table.getColWidth(col),
|
|
59060
|
+
cellWidth,
|
|
59061
|
+
cellHeight,
|
|
59062
|
+
addNew ? table.scenegraph.getColGroup(col) : oldCellGroup.parent,
|
|
59063
|
+
addNew ? 0 : table.scenegraph.getCellGroupY(row),
|
|
59064
|
+
padding,
|
|
59065
|
+
textAlign,
|
|
59066
|
+
textBaseline,
|
|
59067
|
+
mayHaveIcon,
|
|
59068
|
+
cellTheme,
|
|
59069
|
+
range,
|
|
59070
|
+
customResult
|
|
59071
|
+
];
|
|
59072
|
+
if (hasCellValue) {
|
|
59073
|
+
createCellArgs.push(cellValue);
|
|
59074
|
+
}
|
|
59075
|
+
const newCellGroup = createCell(...createCellArgs);
|
|
59076
|
+
if (!addNew && oldCellGroup.parent && newCellGroup !== oldCellGroup) {
|
|
58927
59077
|
oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
|
|
58928
59078
|
oldCellGroup.parent.removeChild(oldCellGroup);
|
|
59079
|
+
removeCellMediaChildren(oldCellGroup);
|
|
58929
59080
|
oldCellGroup.release(true);
|
|
58930
59081
|
if (table.scenegraph?.proxy.cellCache.get(col)) {
|
|
58931
59082
|
table.scenegraph?.proxy.cellCache.set(col, newCellGroup);
|
|
@@ -58949,12 +59100,15 @@
|
|
|
58949
59100
|
}
|
|
58950
59101
|
return false;
|
|
58951
59102
|
}
|
|
58952
|
-
function callUpdateCellContentForPromiseValue(updateCellArgs) {
|
|
58953
|
-
const { type,
|
|
59103
|
+
function callUpdateCellContentForPromiseValue(updateCellArgs, resolvedValue) {
|
|
59104
|
+
const { type, define, table, col, row, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, range, customResult, customStyle, promiseValue, updateToken } = updateCellArgs;
|
|
59105
|
+
if (!isPromiseCellUpdateCurrent(table, col, row, oldCellGroup, updateToken)) {
|
|
59106
|
+
return;
|
|
59107
|
+
}
|
|
58954
59108
|
const cellStyle = customStyle || table._getCellStyle(range ? range.start.col : col, range ? range.start.row : row);
|
|
58955
59109
|
const cellTheme = getStyleTheme(cellStyle, table, range ? range.start.col : col, range ? range.start.row : row, getProp).theme;
|
|
58956
59110
|
cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);
|
|
58957
|
-
updateCellContent(type,
|
|
59111
|
+
updateCellContent(type, promiseValue, define, table, col, row, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult, resolvedValue);
|
|
58958
59112
|
}
|
|
58959
59113
|
function dealWithMergeCellSize(range, cellWidth, cellHeight, padding, textAlign, textBaseline, table) {
|
|
58960
59114
|
for (let col = range.start.col; col <= range.end.col; col++) {
|
|
@@ -59497,22 +59651,41 @@
|
|
|
59497
59651
|
}
|
|
59498
59652
|
}
|
|
59499
59653
|
function computeRowHeight(row, startCol, endCol, table) {
|
|
59654
|
+
return computeRowHeightInternal(row, startCol, endCol, table, true);
|
|
59655
|
+
}
|
|
59656
|
+
function computeRowHeightInternal(row, startCol, endCol, table, enableCustomCompute) {
|
|
59500
59657
|
const isAllRowsAuto = table.isAutoRowHeight(row) || (table.heightMode === 'adaptive' && table.options.autoHeightInAdaptiveMode !== false);
|
|
59501
59658
|
if (!isAllRowsAuto && table.getDefaultRowHeight(row) !== 'auto') {
|
|
59502
59659
|
return table.getDefaultRowHeight(row);
|
|
59503
59660
|
}
|
|
59504
59661
|
let maxHeight;
|
|
59505
|
-
if (table.options.customComputeRowHeight) {
|
|
59506
|
-
|
|
59662
|
+
if (enableCustomCompute && table.options.customComputeRowHeight) {
|
|
59663
|
+
let realHeight;
|
|
59664
|
+
let hasRealHeight = false;
|
|
59665
|
+
const getRealHeight = () => {
|
|
59666
|
+
if (!hasRealHeight) {
|
|
59667
|
+
realHeight = computeRowHeightInternal(row, startCol, endCol, table, false);
|
|
59668
|
+
hasRealHeight = true;
|
|
59669
|
+
}
|
|
59670
|
+
return realHeight;
|
|
59671
|
+
};
|
|
59672
|
+
const computeArgs = {
|
|
59507
59673
|
row,
|
|
59508
59674
|
table
|
|
59675
|
+
};
|
|
59676
|
+
Object.defineProperty(computeArgs, 'realHeight', {
|
|
59677
|
+
get: getRealHeight,
|
|
59678
|
+
enumerable: false,
|
|
59679
|
+
configurable: true
|
|
59509
59680
|
});
|
|
59681
|
+
const customRowHeight = table.options.customComputeRowHeight(computeArgs);
|
|
59510
59682
|
if (typeof customRowHeight === 'number') {
|
|
59511
59683
|
return customRowHeight;
|
|
59512
59684
|
}
|
|
59513
|
-
else if (customRowHeight
|
|
59514
|
-
return
|
|
59685
|
+
else if (customRowHeight === 'auto') {
|
|
59686
|
+
return getRealHeight();
|
|
59515
59687
|
}
|
|
59688
|
+
return table.getDefaultRowHeight(row);
|
|
59516
59689
|
}
|
|
59517
59690
|
if (table.internalProps.rowHeightConfig) {
|
|
59518
59691
|
const rowHeightConfig = table.internalProps.rowHeightConfig.find((item) => item.key === row);
|
|
@@ -59687,11 +59860,12 @@
|
|
|
59687
59860
|
cellRange = table.getCellRange(col, row);
|
|
59688
59861
|
spanRow = cellRange.end.row - cellRange.start.row + 1;
|
|
59689
59862
|
}
|
|
59863
|
+
const skipCellValue = shouldSkipCustomRenderCellValueForComputation$1(col, row, table);
|
|
59690
59864
|
const arg = {
|
|
59691
59865
|
col: cellRange?.start.col ?? col,
|
|
59692
59866
|
row: cellRange?.start.row ?? row,
|
|
59693
|
-
dataValue: table.getCellOriginValue(col, row),
|
|
59694
|
-
value: table.getCellValue(col, row),
|
|
59867
|
+
dataValue: skipCellValue ? undefined : table.getCellOriginValue(col, row),
|
|
59868
|
+
value: skipCellValue ? undefined : table.getCellValue(col, row),
|
|
59695
59869
|
rect: getCellRect$1(col, row, table),
|
|
59696
59870
|
table,
|
|
59697
59871
|
originCol: col,
|
|
@@ -59732,12 +59906,15 @@
|
|
|
59732
59906
|
height += padding[0] + padding[2];
|
|
59733
59907
|
}
|
|
59734
59908
|
return {
|
|
59735
|
-
height: height / spanRow,
|
|
59909
|
+
height: getMergedCellSingleRowHeight(height / spanRow, spanRow, table),
|
|
59736
59910
|
renderDefault
|
|
59737
59911
|
};
|
|
59738
59912
|
}
|
|
59739
59913
|
return undefined;
|
|
59740
59914
|
}
|
|
59915
|
+
function shouldSkipCustomRenderCellValueForComputation$1(col, row, table) {
|
|
59916
|
+
return (table.isListTable() && !table.isHeader(col, row) && !table.internalProps.dataSource?.dataSourceObj?.records);
|
|
59917
|
+
}
|
|
59741
59918
|
function computeTextHeight(col, row, cellType, table) {
|
|
59742
59919
|
let maxHeight = 0;
|
|
59743
59920
|
const cellValue = table.getCellValue(col, row);
|
|
@@ -59890,7 +60067,15 @@
|
|
|
59890
60067
|
}
|
|
59891
60068
|
}
|
|
59892
60069
|
}
|
|
59893
|
-
return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;
|
|
60070
|
+
return getMergedCellSingleRowHeight((Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow, spanRow, table);
|
|
60071
|
+
}
|
|
60072
|
+
function getMergedCellSingleRowHeight(height, spanRow, table) {
|
|
60073
|
+
if (spanRow <= 1) {
|
|
60074
|
+
return height;
|
|
60075
|
+
}
|
|
60076
|
+
const configuredMinHeight = table.options.customConfig?.minSingleRowHeight;
|
|
60077
|
+
const minSingleRowHeight = isNumber$3(configuredMinHeight) && configuredMinHeight > 0 ? configuredMinHeight : 2;
|
|
60078
|
+
return Math.max(height, minSingleRowHeight);
|
|
59894
60079
|
}
|
|
59895
60080
|
function getCellRect$1(col, row, table) {
|
|
59896
60081
|
return {
|
|
@@ -59986,7 +60171,7 @@
|
|
|
59986
60171
|
const createSparkLineCellGroup = Factory.getFunction('createSparkLineCellGroup');
|
|
59987
60172
|
createSparkLineCellGroup(cell, cell.parent, cell.attribute.x, cell.attribute.y, col, row, cell.attribute.width, cell.attribute.height, padding, scene.table, getStyleTheme(headerStyle, scene.table, col, row, getProp).theme, false);
|
|
59988
60173
|
}
|
|
59989
|
-
else if (type === 'image' || type === 'video') {
|
|
60174
|
+
else if (type === 'image' || type === 'video' || type === 'audio') {
|
|
59990
60175
|
updateImageCellContentWhileResize(cell, col, row, 0, detaY, scene.table);
|
|
59991
60176
|
}
|
|
59992
60177
|
else if (cell.firstChild?.name === 'axis') {
|
|
@@ -60327,7 +60512,7 @@
|
|
|
60327
60512
|
const createSparkLineCellGroup = Factory.getFunction('createSparkLineCellGroup');
|
|
60328
60513
|
createSparkLineCellGroup(cellGroup, cellGroup.parent, cellGroup.attribute.x, cellGroup.attribute.y, col, row, cellGroup.attribute.width, cellGroup.attribute.height, padding, scene.table, getStyleTheme(headerStyle, scene.table, col, row, getProp).theme, false);
|
|
60329
60514
|
}
|
|
60330
|
-
else if (type === 'image' || type === 'video') {
|
|
60515
|
+
else if (type === 'image' || type === 'video' || type === 'audio') {
|
|
60331
60516
|
updateImageCellContentWhileResize(cellGroup, col, row, detaX, 0, scene.table);
|
|
60332
60517
|
}
|
|
60333
60518
|
else if (cellGroup.firstChild?.name === 'axis') {
|
|
@@ -62494,11 +62679,12 @@
|
|
|
62494
62679
|
cellRange = table.getCellRange(col, row);
|
|
62495
62680
|
spanCol = cellRange.end.col - cellRange.start.col + 1;
|
|
62496
62681
|
}
|
|
62682
|
+
const skipCellValue = shouldSkipCustomRenderCellValueForComputation(col, row, table);
|
|
62497
62683
|
const arg = {
|
|
62498
62684
|
col: cellRange?.start.col ?? col,
|
|
62499
62685
|
row: cellRange?.start.row ?? row,
|
|
62500
|
-
dataValue: table.getCellOriginValue(col, row),
|
|
62501
|
-
value: table.getCellValue(col, row),
|
|
62686
|
+
dataValue: skipCellValue ? undefined : table.getCellOriginValue(col, row),
|
|
62687
|
+
value: skipCellValue ? undefined : table.getCellValue(col, row),
|
|
62502
62688
|
rect: getCellRect(col, row, table),
|
|
62503
62689
|
table,
|
|
62504
62690
|
originCol: col,
|
|
@@ -62547,6 +62733,11 @@
|
|
|
62547
62733
|
}
|
|
62548
62734
|
return undefined;
|
|
62549
62735
|
}
|
|
62736
|
+
function shouldSkipCustomRenderCellValueForComputation(col, row, table) {
|
|
62737
|
+
return (table.isListTable() &&
|
|
62738
|
+
!table.isHeader(col, row) &&
|
|
62739
|
+
!table.internalProps.dataSource?.dataSourceObj?.records);
|
|
62740
|
+
}
|
|
62550
62741
|
function computeTextWidth(col, row, cellType, table) {
|
|
62551
62742
|
let maxWidth = 0;
|
|
62552
62743
|
const cellValue = table.getCellValue(col, row);
|
|
@@ -62981,10 +63172,10 @@
|
|
|
62981
63172
|
}
|
|
62982
63173
|
const type = isVtableMerge || isCustomMerge ? 'text' : table.getCellType(col, row);
|
|
62983
63174
|
if (isPromise(value)) {
|
|
62984
|
-
createEmptyCellGroup(col, row, 0, y, cellWidth, cellHeight, columnGroup);
|
|
63175
|
+
const cellGroup = createEmptyCellGroup(col, row, 0, y, cellWidth, cellHeight, columnGroup);
|
|
63176
|
+
const updateToken = nextPromiseCellUpdateToken(cellGroup);
|
|
62985
63177
|
dealPromiseData(value, table, callCreateCellForPromiseValue.bind(null, {
|
|
62986
63178
|
type,
|
|
62987
|
-
value,
|
|
62988
63179
|
define,
|
|
62989
63180
|
table,
|
|
62990
63181
|
col,
|
|
@@ -62999,7 +63190,10 @@
|
|
|
62999
63190
|
cellLocation,
|
|
63000
63191
|
range,
|
|
63001
63192
|
customResult,
|
|
63002
|
-
defaultRowHeight
|
|
63193
|
+
defaultRowHeight,
|
|
63194
|
+
promiseValue: value,
|
|
63195
|
+
oldCellGroup: cellGroup,
|
|
63196
|
+
updateToken
|
|
63003
63197
|
}));
|
|
63004
63198
|
columnGroup.updateColumnRowNumber(row);
|
|
63005
63199
|
const height = table.getRowHeight(row);
|
|
@@ -63052,11 +63246,14 @@
|
|
|
63052
63246
|
height: y
|
|
63053
63247
|
};
|
|
63054
63248
|
}
|
|
63055
|
-
function callCreateCellForPromiseValue(createCellArgs) {
|
|
63249
|
+
function callCreateCellForPromiseValue(createCellArgs, resolvedValue) {
|
|
63056
63250
|
let padding;
|
|
63057
63251
|
let textAlign;
|
|
63058
63252
|
let textBaseline;
|
|
63059
|
-
const { type,
|
|
63253
|
+
const { type, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, cellLocation, mayHaveIcon, customStyle, range, customResult, defaultRowHeight, promiseValue, oldCellGroup, updateToken } = createCellArgs;
|
|
63254
|
+
if (!isPromiseCellUpdateCurrent(table, col, row, oldCellGroup, updateToken)) {
|
|
63255
|
+
return;
|
|
63256
|
+
}
|
|
63060
63257
|
const cellStyle = customStyle || table._getCellStyle(range ? range.start.col : col, range ? range.start.row : row);
|
|
63061
63258
|
const cellTheme = getStyleTheme(cellStyle, table, range ? range.start.col : col, range ? range.start.row : row, getProp).theme;
|
|
63062
63259
|
cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);
|
|
@@ -63074,7 +63271,7 @@
|
|
|
63074
63271
|
if (cellLocation !== 'body' && !cellTheme.group.fill) {
|
|
63075
63272
|
cellTheme.group.fill = '#fff';
|
|
63076
63273
|
}
|
|
63077
|
-
createCell(type,
|
|
63274
|
+
createCell(type, promiseValue, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult, resolvedValue);
|
|
63078
63275
|
}
|
|
63079
63276
|
function dealMerge(range, mergeMap, table, forceUpdate) {
|
|
63080
63277
|
let cellWidth = 0;
|
|
@@ -63112,6 +63309,7 @@
|
|
|
63112
63309
|
cellGroup.col = col;
|
|
63113
63310
|
cellGroup.row = row;
|
|
63114
63311
|
columnGroup.addChild(cellGroup);
|
|
63312
|
+
return cellGroup;
|
|
63115
63313
|
}
|
|
63116
63314
|
|
|
63117
63315
|
function createColGroup(containerGroup, xOrigin, yOrigin, colStart, colEnd, rowStart, rowEnd, cellLocation, table, rowLimit) {
|
|
@@ -63146,6 +63344,25 @@
|
|
|
63146
63344
|
containerGroup.setAttribute('height', heightMax);
|
|
63147
63345
|
}
|
|
63148
63346
|
|
|
63347
|
+
function fillVisibleBodyRows$1(proxy, distRow) {
|
|
63348
|
+
const { table } = proxy;
|
|
63349
|
+
const bodyBottomRow = table.rowCount - 1 - table.bottomFrozenRowCount;
|
|
63350
|
+
const visibleBodyHeight = table.tableNoFrameHeight - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();
|
|
63351
|
+
let targetRow = distRow;
|
|
63352
|
+
while (targetRow < bodyBottomRow && table.getRowsHeight(table.frozenRowCount, targetRow) < visibleBodyHeight) {
|
|
63353
|
+
const nextRow = targetRow + 1;
|
|
63354
|
+
computeRowsHeight(table, nextRow, nextRow, false);
|
|
63355
|
+
targetRow = nextRow;
|
|
63356
|
+
}
|
|
63357
|
+
return targetRow;
|
|
63358
|
+
}
|
|
63359
|
+
function syncVisibleBodyRows(proxy, targetRow) {
|
|
63360
|
+
if (targetRow <= proxy.totalRow) {
|
|
63361
|
+
return;
|
|
63362
|
+
}
|
|
63363
|
+
proxy.totalRow = targetRow;
|
|
63364
|
+
proxy.totalActualBodyRowCount = Math.max(proxy.totalActualBodyRowCount, targetRow - proxy.bodyTopRow + 1);
|
|
63365
|
+
}
|
|
63149
63366
|
function createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin, proxy) {
|
|
63150
63367
|
const { table } = proxy;
|
|
63151
63368
|
const { leftBottomCornerGroup, rightTopCornerGroup, rightBottomCornerGroup } = table.scenegraph;
|
|
@@ -63171,6 +63388,7 @@
|
|
|
63171
63388
|
else {
|
|
63172
63389
|
distRow = Math.min(proxy.firstScreenRowLimit - 1, table.rowCount - 1);
|
|
63173
63390
|
}
|
|
63391
|
+
let bodyDistRow = Math.min(proxy.bodyBottomRow, distRow - table.bottomFrozenRowCount);
|
|
63174
63392
|
if (table.internalProps._widthResizedColMap.size === 0) {
|
|
63175
63393
|
computeColsWidth(table, 0, distColForCompute ?? distCol);
|
|
63176
63394
|
}
|
|
@@ -63178,6 +63396,10 @@
|
|
|
63178
63396
|
computeRowsHeight(table, 0, table.options.canvasHeight === 'auto' || table.options.customConfig?.forceComputeAllRowHeight
|
|
63179
63397
|
? table.rowCount - 1
|
|
63180
63398
|
: distRowForCompute ?? distRow);
|
|
63399
|
+
if (table.heightMode === 'autoHeight') {
|
|
63400
|
+
bodyDistRow = fillVisibleBodyRows$1(proxy, bodyDistRow);
|
|
63401
|
+
syncVisibleBodyRows(proxy, bodyDistRow);
|
|
63402
|
+
}
|
|
63181
63403
|
}
|
|
63182
63404
|
if (distCol < table.colCount - table.rightFrozenColCount) {
|
|
63183
63405
|
if (table.colCount - table.rightFrozenColCount <= table.colCount - 1) {
|
|
@@ -63202,13 +63424,13 @@
|
|
|
63202
63424
|
createColGroup(colHeaderGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, 0, table.frozenRowCount - 1, 'columnHeader', table);
|
|
63203
63425
|
if (table.frozenColCount > 0) {
|
|
63204
63426
|
if (table.leftRowSeriesNumberCount > 0) {
|
|
63205
|
-
createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.leftRowSeriesNumberCount - 1, table.frozenRowCount,
|
|
63427
|
+
createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.leftRowSeriesNumberCount - 1, table.frozenRowCount, bodyDistRow, 'rowHeader', table);
|
|
63206
63428
|
}
|
|
63207
63429
|
if (table.frozenColCount > table.leftRowSeriesNumberCount) {
|
|
63208
|
-
createColGroup(rowHeaderGroup, xOrigin, yOrigin, table.leftRowSeriesNumberCount, Math.min(table.frozenColCount - 1, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount - 1), table.frozenRowCount,
|
|
63430
|
+
createColGroup(rowHeaderGroup, xOrigin, yOrigin, table.leftRowSeriesNumberCount, Math.min(table.frozenColCount - 1, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount - 1), table.frozenRowCount, bodyDistRow, 'rowHeader', table);
|
|
63209
63431
|
}
|
|
63210
63432
|
if (table.frozenColCount > table.rowHeaderLevelCount + table.leftRowSeriesNumberCount) {
|
|
63211
|
-
createColGroup(rowHeaderGroup, xOrigin, yOrigin, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, table.frozenColCount - 1, table.frozenRowCount,
|
|
63433
|
+
createColGroup(rowHeaderGroup, xOrigin, yOrigin, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, table.frozenColCount - 1, table.frozenRowCount, bodyDistRow, 'body', table);
|
|
63212
63434
|
}
|
|
63213
63435
|
}
|
|
63214
63436
|
if (table.bottomFrozenRowCount > 0) {
|
|
@@ -63228,13 +63450,13 @@
|
|
|
63228
63450
|
}
|
|
63229
63451
|
if (table.rightFrozenColCount > 0) {
|
|
63230
63452
|
createColGroup(rightTopCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, 0, table.frozenRowCount - 1, 'columnHeader', table);
|
|
63231
|
-
createColGroup(rightFrozenGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.frozenRowCount,
|
|
63453
|
+
createColGroup(rightFrozenGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.frozenRowCount, bodyDistRow, table.isPivotChart() ? 'rowHeader' : 'body', table);
|
|
63232
63454
|
}
|
|
63233
63455
|
if (table.bottomFrozenRowCount > 0 && table.rightFrozenColCount > 0) {
|
|
63234
63456
|
createColGroup(rightBottomCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, 'body', table);
|
|
63235
63457
|
}
|
|
63236
63458
|
distCol - table.rightFrozenColCount >= table.frozenColCount &&
|
|
63237
|
-
createColGroup(bodyGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, table.frozenRowCount,
|
|
63459
|
+
createColGroup(bodyGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, table.frozenRowCount, bodyDistRow, 'body', table);
|
|
63238
63460
|
if (!bodyGroup.firstChild &&
|
|
63239
63461
|
!colHeaderGroup.firstChild &&
|
|
63240
63462
|
!cornerHeaderGroup.firstChild &&
|
|
@@ -64015,6 +64237,7 @@
|
|
|
64015
64237
|
await proxy.progress();
|
|
64016
64238
|
}
|
|
64017
64239
|
|
|
64240
|
+
let stickTextUpdateId = 0;
|
|
64018
64241
|
function resetTextStick(table) {
|
|
64019
64242
|
const { changedCells } = table.internalProps.stick;
|
|
64020
64243
|
changedCells.forEach((cellPos) => {
|
|
@@ -64031,6 +64254,8 @@
|
|
|
64031
64254
|
}
|
|
64032
64255
|
function handleTextStick(table) {
|
|
64033
64256
|
const changedCells = resetTextStick(table);
|
|
64257
|
+
const horizontalUpdateId = ++stickTextUpdateId;
|
|
64258
|
+
const verticalUpdateId = ++stickTextUpdateId;
|
|
64034
64259
|
const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;
|
|
64035
64260
|
const frozenRowsHeight = table.getFrozenRowsHeight();
|
|
64036
64261
|
const frozenColsWidth = table.getFrozenColsWidth();
|
|
@@ -64055,7 +64280,7 @@
|
|
|
64055
64280
|
const style = table._getCellStyle(col, row);
|
|
64056
64281
|
if (style?.textStick && style?.textStick !== 'vertical') {
|
|
64057
64282
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
64058
|
-
adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table);
|
|
64283
|
+
adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table, horizontalUpdateId, { colStart, colEnd, rowStart: row, rowEnd: row });
|
|
64059
64284
|
}
|
|
64060
64285
|
});
|
|
64061
64286
|
}
|
|
@@ -64065,10 +64290,9 @@
|
|
|
64065
64290
|
}
|
|
64066
64291
|
[rowStart, rowEnd].forEach((row) => {
|
|
64067
64292
|
const style = table._getCellStyle(col, row);
|
|
64068
|
-
if (style?.textStick &&
|
|
64069
|
-
style?.textStick !== 'horizontal') {
|
|
64293
|
+
if (style?.textStick && style?.textStick !== 'horizontal') {
|
|
64070
64294
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
64071
|
-
adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table);
|
|
64295
|
+
adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table, verticalUpdateId, { colStart: col, colEnd: col, rowStart, rowEnd });
|
|
64072
64296
|
}
|
|
64073
64297
|
});
|
|
64074
64298
|
}
|
|
@@ -64080,7 +64304,7 @@
|
|
|
64080
64304
|
const style = table._getCellStyle(col, row);
|
|
64081
64305
|
if (style?.textStick && style?.textStick !== 'horizontal') {
|
|
64082
64306
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
64083
|
-
adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table);
|
|
64307
|
+
adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table, verticalUpdateId, { colStart: col, colEnd: col, rowStart, rowEnd });
|
|
64084
64308
|
}
|
|
64085
64309
|
});
|
|
64086
64310
|
}
|
|
@@ -64092,30 +64316,15 @@
|
|
|
64092
64316
|
const style = table._getCellStyle(col, row);
|
|
64093
64317
|
if (style?.textStick && style?.textStick !== 'vertical') {
|
|
64094
64318
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
64095
|
-
adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table);
|
|
64319
|
+
adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table, horizontalUpdateId, { colStart, colEnd, rowStart: row, rowEnd: row });
|
|
64096
64320
|
}
|
|
64097
64321
|
});
|
|
64098
64322
|
}
|
|
64099
64323
|
}
|
|
64100
|
-
function adjustCellContentVerticalLayout(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign, table) {
|
|
64101
|
-
|
|
64102
|
-
|
|
64103
|
-
|
|
64104
|
-
isNumber$3(cellGroup.mergeEndRow)) {
|
|
64105
|
-
const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
|
|
64106
|
-
for (let col = colStart; col <= colEnd; col++) {
|
|
64107
|
-
for (let row = rowStart; row <= rowEnd; row++) {
|
|
64108
|
-
const singleCellGroup = table.scenegraph.getCell(col, row);
|
|
64109
|
-
if (singleCellGroup.role !== 'cell') {
|
|
64110
|
-
continue;
|
|
64111
|
-
}
|
|
64112
|
-
dealVertical(singleCellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
|
|
64113
|
-
}
|
|
64114
|
-
}
|
|
64115
|
-
}
|
|
64116
|
-
else {
|
|
64117
|
-
dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
|
|
64118
|
-
}
|
|
64324
|
+
function adjustCellContentVerticalLayout(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign, table, updateId, visibleRange) {
|
|
64325
|
+
dealMergedCellGroups(cellGroup, table, visibleRange, updateId, 'verticalStickUpdateId', singleCellGroup => {
|
|
64326
|
+
dealVertical(singleCellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
|
|
64327
|
+
});
|
|
64119
64328
|
}
|
|
64120
64329
|
function dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign) {
|
|
64121
64330
|
const graphic = cellGroup.getChildByName('text', true) || cellGroup.getChildByName('image', true);
|
|
@@ -64182,24 +64391,38 @@
|
|
|
64182
64391
|
});
|
|
64183
64392
|
}
|
|
64184
64393
|
}
|
|
64185
|
-
function adjustCellContentHorizontalLayout(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign, table) {
|
|
64394
|
+
function adjustCellContentHorizontalLayout(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign, table, updateId, visibleRange) {
|
|
64395
|
+
dealMergedCellGroups(cellGroup, table, visibleRange, updateId, 'horizontalStickUpdateId', singleCellGroup => {
|
|
64396
|
+
dealHorizontal(singleCellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);
|
|
64397
|
+
});
|
|
64398
|
+
}
|
|
64399
|
+
function dealMergedCellGroups(cellGroup, table, visibleRange, updateId, updateIdKey, dealCell) {
|
|
64186
64400
|
if (isNumber$3(cellGroup.mergeStartCol) &&
|
|
64187
64401
|
isNumber$3(cellGroup.mergeStartRow) &&
|
|
64188
64402
|
isNumber$3(cellGroup.mergeEndCol) &&
|
|
64189
64403
|
isNumber$3(cellGroup.mergeEndRow)) {
|
|
64190
64404
|
const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
|
|
64191
|
-
|
|
64192
|
-
|
|
64405
|
+
const visibleColStart = Math.max(colStart, visibleRange.colStart);
|
|
64406
|
+
const visibleColEnd = Math.min(colEnd, visibleRange.colEnd);
|
|
64407
|
+
const visibleRowStart = Math.max(rowStart, visibleRange.rowStart);
|
|
64408
|
+
const visibleRowEnd = Math.min(rowEnd, visibleRange.rowEnd);
|
|
64409
|
+
for (let col = visibleColStart; col <= visibleColEnd; col++) {
|
|
64410
|
+
for (let row = visibleRowStart; row <= visibleRowEnd; row++) {
|
|
64193
64411
|
const singleCellGroup = table.scenegraph.getCell(col, row);
|
|
64194
|
-
if (singleCellGroup.role !== 'cell') {
|
|
64412
|
+
if (singleCellGroup.role !== 'cell' || singleCellGroup[updateIdKey] === updateId) {
|
|
64195
64413
|
continue;
|
|
64196
64414
|
}
|
|
64197
|
-
|
|
64415
|
+
singleCellGroup[updateIdKey] = updateId;
|
|
64416
|
+
dealCell(singleCellGroup);
|
|
64198
64417
|
}
|
|
64199
64418
|
}
|
|
64200
64419
|
}
|
|
64201
64420
|
else {
|
|
64202
|
-
|
|
64421
|
+
if (cellGroup[updateIdKey] === updateId) {
|
|
64422
|
+
return;
|
|
64423
|
+
}
|
|
64424
|
+
cellGroup[updateIdKey] = updateId;
|
|
64425
|
+
dealCell(cellGroup);
|
|
64203
64426
|
}
|
|
64204
64427
|
}
|
|
64205
64428
|
function dealHorizontal(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign) {
|
|
@@ -64333,12 +64556,13 @@
|
|
|
64333
64556
|
cellCache = new Map();
|
|
64334
64557
|
constructor(table) {
|
|
64335
64558
|
this.table = table;
|
|
64559
|
+
const defaultRowHeight = this.getEstimatedRowHeightForProxy();
|
|
64336
64560
|
if (this.table.isPivotChart()) {
|
|
64337
|
-
this.rowLimit = Math.max(100, Math.ceil((table.tableNoFrameHeight * 2) /
|
|
64561
|
+
this.rowLimit = Math.max(100, Math.ceil((table.tableNoFrameHeight * 2) / defaultRowHeight));
|
|
64338
64562
|
this.colLimit = Math.max(100, Math.ceil((table.tableNoFrameWidth * 2) / table.defaultColWidth));
|
|
64339
64563
|
}
|
|
64340
64564
|
else if (this.table.isAutoRowHeight(table.columnHeaderLevelCount)) {
|
|
64341
|
-
this.rowLimit = Math.max(100, Math.ceil((table.tableNoFrameHeight * 2) /
|
|
64565
|
+
this.rowLimit = Math.max(100, Math.ceil((table.tableNoFrameHeight * 2) / defaultRowHeight));
|
|
64342
64566
|
}
|
|
64343
64567
|
else if (this.table.widthMode === 'autoWidth') {
|
|
64344
64568
|
this.colLimit = Math.max(100, Math.ceil((table.tableNoFrameWidth * 2) / table.defaultColWidth));
|
|
@@ -64397,7 +64621,7 @@
|
|
|
64397
64621
|
this.totalRow = this.bodyTopRow + totalActualBodyRowCount - 1;
|
|
64398
64622
|
this.rowStart = this.bodyTopRow;
|
|
64399
64623
|
this.rowEnd = this.totalRow;
|
|
64400
|
-
const defaultRowHeight = this.
|
|
64624
|
+
const defaultRowHeight = this.getEstimatedRowHeightForProxy();
|
|
64401
64625
|
this.taskRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight) * 1;
|
|
64402
64626
|
const totalBodyHeight = defaultRowHeight * totalActualBodyRowCount;
|
|
64403
64627
|
const totalHeight = defaultRowHeight * (this.bodyBottomRow - this.bodyTopRow + 1);
|
|
@@ -64428,12 +64652,19 @@
|
|
|
64428
64652
|
const widthLimit = this.table.tableNoFrameWidth * 5;
|
|
64429
64653
|
this.screenColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth);
|
|
64430
64654
|
this.firstScreenColLimit = this.bodyLeftCol + Math.min(this.colLimit, Math.ceil(widthLimit / defaultColWidth));
|
|
64431
|
-
const defaultRowHeight = this.
|
|
64655
|
+
const defaultRowHeight = this.getEstimatedRowHeightForProxy();
|
|
64432
64656
|
this.taskRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight) * 1;
|
|
64433
64657
|
const heightLimit = this.table.tableNoFrameHeight * 5;
|
|
64434
64658
|
this.screenRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);
|
|
64435
64659
|
this.firstScreenRowLimit = this.bodyTopRow + Math.min(this.rowLimit, Math.ceil(heightLimit / defaultRowHeight));
|
|
64436
64660
|
}
|
|
64661
|
+
getEstimatedRowHeightForProxy() {
|
|
64662
|
+
const minSingleRowHeight = this.table.options.customConfig?.minSingleRowHeight;
|
|
64663
|
+
if (this.table.heightMode === 'autoHeight') {
|
|
64664
|
+
return isNumber$3(minSingleRowHeight) && minSingleRowHeight > 0 ? minSingleRowHeight : 2;
|
|
64665
|
+
}
|
|
64666
|
+
return this.table.defaultRowHeight;
|
|
64667
|
+
}
|
|
64437
64668
|
createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin) {
|
|
64438
64669
|
createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin, this);
|
|
64439
64670
|
}
|
|
@@ -65468,6 +65699,11 @@
|
|
|
65468
65699
|
updateAfter = updateAfter ?? needUpdateAfter;
|
|
65469
65700
|
rowHeightsMap.insert(row);
|
|
65470
65701
|
});
|
|
65702
|
+
const filledVisibleRowStart = fillVisibleBodyRows(scene);
|
|
65703
|
+
if (isNumber$3(filledVisibleRowStart)) {
|
|
65704
|
+
updateAfter = updateAfter ?? filledVisibleRowStart;
|
|
65705
|
+
rowUpdatePos = isValid$1(rowUpdatePos) ? Math.min(rowUpdatePos, filledVisibleRowStart) : filledVisibleRowStart;
|
|
65706
|
+
}
|
|
65471
65707
|
resetRowNumberAndY(scene);
|
|
65472
65708
|
if (addRows.length) {
|
|
65473
65709
|
const beforeRow = addRows[0] - 1;
|
|
@@ -65612,6 +65848,34 @@
|
|
|
65612
65848
|
}
|
|
65613
65849
|
return row;
|
|
65614
65850
|
}
|
|
65851
|
+
function fillVisibleBodyRows(scene) {
|
|
65852
|
+
const { table, proxy } = scene;
|
|
65853
|
+
if (table.heightMode !== 'autoHeight') {
|
|
65854
|
+
return undefined;
|
|
65855
|
+
}
|
|
65856
|
+
const bodyBottomRow = table.rowCount - 1 - table.bottomFrozenRowCount;
|
|
65857
|
+
const visibleBodyHeight = table.tableNoFrameHeight - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();
|
|
65858
|
+
let targetRow = Math.min(proxy.rowEnd, bodyBottomRow);
|
|
65859
|
+
computeRowsHeight(table, proxy.rowStart, targetRow, false);
|
|
65860
|
+
while (targetRow < bodyBottomRow && table.getRowsHeight(table.frozenRowCount, targetRow) < visibleBodyHeight) {
|
|
65861
|
+
const nextRow = targetRow + 1;
|
|
65862
|
+
computeRowsHeight(table, nextRow, nextRow, false);
|
|
65863
|
+
targetRow = nextRow;
|
|
65864
|
+
}
|
|
65865
|
+
if (targetRow <= proxy.rowEnd) {
|
|
65866
|
+
return undefined;
|
|
65867
|
+
}
|
|
65868
|
+
const startRow = proxy.rowEnd + 1;
|
|
65869
|
+
for (let row = startRow; row <= targetRow; row++) {
|
|
65870
|
+
addRowCellGroup(row, scene);
|
|
65871
|
+
}
|
|
65872
|
+
proxy.rowEnd = targetRow;
|
|
65873
|
+
proxy.currentRow = Math.max(proxy.currentRow, targetRow);
|
|
65874
|
+
proxy.totalRow = Math.max(proxy.totalRow, targetRow);
|
|
65875
|
+
proxy.totalActualBodyRowCount = Math.max(proxy.totalActualBodyRowCount, targetRow - proxy.rowStart + 1);
|
|
65876
|
+
proxy.rowUpdatePos = Math.min(proxy.rowUpdatePos, startRow);
|
|
65877
|
+
return startRow;
|
|
65878
|
+
}
|
|
65615
65879
|
function resetRowNumber(scene) {
|
|
65616
65880
|
scene.bodyGroup.forEachChildren((colGroup) => {
|
|
65617
65881
|
let rowIndex = scene.bodyRowStart;
|
|
@@ -67140,6 +67404,7 @@
|
|
|
67140
67404
|
},
|
|
67141
67405
|
placement: baseIcon.tooltip.placement
|
|
67142
67406
|
},
|
|
67407
|
+
appearDelay: baseIcon.tooltip.appearDelay,
|
|
67143
67408
|
disappearDelay: baseIcon.tooltip.disappearDelay,
|
|
67144
67409
|
style: Object.assign({}, scene.table.internalProps.theme?.tooltipStyle, baseIcon.tooltip?.style)
|
|
67145
67410
|
};
|
|
@@ -68629,111 +68894,154 @@
|
|
|
68629
68894
|
width: tableWidth,
|
|
68630
68895
|
height: tableHeight
|
|
68631
68896
|
});
|
|
68632
|
-
|
|
68633
|
-
|
|
68634
|
-
|
|
68635
|
-
|
|
68636
|
-
|
|
68637
|
-
|
|
68638
|
-
|
|
68639
|
-
|
|
68640
|
-
|
|
68641
|
-
|
|
68642
|
-
|
|
68643
|
-
|
|
68644
|
-
|
|
68645
|
-
|
|
68646
|
-
|
|
68647
|
-
|
|
68648
|
-
|
|
68649
|
-
|
|
68650
|
-
|
|
68651
|
-
|
|
68652
|
-
|
|
68653
|
-
|
|
68654
|
-
|
|
68655
|
-
borderBottom = rectAttributes?.lineWidth ?? 0;
|
|
68656
|
-
borderLeft = rectAttributes?.lineWidth ?? 0;
|
|
68657
|
-
}
|
|
68658
|
-
if (this.tableGroup.border.type === 'rect') {
|
|
68659
|
-
if (this.table.theme.frameStyle?.innerBorder) {
|
|
68660
|
-
this.tableGroup.border.setAttributes({
|
|
68661
|
-
x: this.table.tableX + borderLeft / 2,
|
|
68662
|
-
y: this.table.tableY + borderTop / 2,
|
|
68663
|
-
width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
68664
|
-
height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
|
|
68665
|
-
});
|
|
68666
|
-
}
|
|
68667
|
-
else {
|
|
68668
|
-
this.tableGroup.border.setAttributes({
|
|
68669
|
-
x: this.table.tableX - borderLeft / 2,
|
|
68670
|
-
y: this.table.tableY - borderTop / 2,
|
|
68671
|
-
width: this.tableGroup.attribute.width + borderLeft / 2 + borderRight / 2,
|
|
68672
|
-
height: this.tableGroup.attribute.height + borderTop / 2 + borderBottom / 2
|
|
68673
|
-
});
|
|
68674
|
-
}
|
|
68675
|
-
}
|
|
68676
|
-
else if (this.tableGroup.border.type === 'group') {
|
|
68677
|
-
if (this.table.theme.frameStyle?.innerBorder) {
|
|
68678
|
-
this.tableGroup.border.setAttributes({
|
|
68679
|
-
x: this.table.tableX + borderLeft / 2,
|
|
68680
|
-
y: this.table.tableY + borderTop / 2,
|
|
68681
|
-
width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
68682
|
-
height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
|
|
68683
|
-
});
|
|
68684
|
-
this.tableGroup.border.firstChild?.setAttributes({
|
|
68685
|
-
x: 0,
|
|
68686
|
-
y: 0,
|
|
68687
|
-
width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
68688
|
-
height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
|
|
68689
|
-
});
|
|
68690
|
-
}
|
|
68691
|
-
else {
|
|
68692
|
-
this.tableGroup.border.setAttributes({
|
|
68693
|
-
x: this.table.tableX - borderLeft / 2,
|
|
68694
|
-
y: this.table.tableY - borderTop / 2,
|
|
68695
|
-
width: this.tableGroup.attribute.width + borderLeft / 2 + borderRight / 2,
|
|
68696
|
-
height: this.tableGroup.attribute.height + borderTop / 2 + borderBottom / 2
|
|
68697
|
-
});
|
|
68698
|
-
this.tableGroup.border.firstChild?.setAttributes({
|
|
68699
|
-
x: borderLeft / 2,
|
|
68700
|
-
y: borderTop / 2,
|
|
68701
|
-
width: this.tableGroup.attribute.width,
|
|
68702
|
-
height: this.tableGroup.attribute.height
|
|
68703
|
-
});
|
|
68704
|
-
}
|
|
68705
|
-
}
|
|
68897
|
+
const hasFrozenCols = this.table.frozenColCount > 0;
|
|
68898
|
+
const hasRightFrozenCols = this.table.rightFrozenColCount > 0;
|
|
68899
|
+
const hasFrozenRows = this.table.frozenRowCount > 0;
|
|
68900
|
+
const hasBottomFrozenRows = this.table.bottomFrozenRowCount > 0;
|
|
68901
|
+
if (hasBottomFrozenRows) {
|
|
68902
|
+
const bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight();
|
|
68903
|
+
const topFrozenBottom = Math.max(this.colHeaderGroup.attribute.y + this.colHeaderGroup.attribute.height, this.cornerHeaderGroup.attribute.y + this.cornerHeaderGroup.attribute.height, this.rightTopCornerGroup.attribute.y + this.rightTopCornerGroup.attribute.height);
|
|
68904
|
+
const middleContentBottom = Math.max(this.rowHeaderGroup.attribute.y + this.rowHeaderGroup.attribute.height, this.bodyGroup.attribute.y + this.bodyGroup.attribute.height, this.rightFrozenGroup.attribute.y + this.rightFrozenGroup.attribute.height, topFrozenBottom);
|
|
68905
|
+
const bottomFrozenY = Math.min(this.tableGroup.attribute.height - bottomFrozenRowsHeight, middleContentBottom);
|
|
68906
|
+
this.bottomFrozenGroup.setAttribute('y', bottomFrozenY);
|
|
68907
|
+
this.leftBottomCornerGroup.setAttributes({
|
|
68908
|
+
visible: hasFrozenCols,
|
|
68909
|
+
y: bottomFrozenY,
|
|
68910
|
+
height: bottomFrozenRowsHeight,
|
|
68911
|
+
width: hasFrozenCols ? this.table.getFrozenColsWidth() : 0
|
|
68912
|
+
});
|
|
68913
|
+
this.rightBottomCornerGroup.setAttributes({
|
|
68914
|
+
visible: hasRightFrozenCols,
|
|
68915
|
+
x: 0,
|
|
68916
|
+
y: bottomFrozenY,
|
|
68917
|
+
width: 0,
|
|
68918
|
+
height: bottomFrozenRowsHeight
|
|
68919
|
+
});
|
|
68706
68920
|
}
|
|
68707
|
-
|
|
68708
|
-
this.bottomFrozenGroup.setAttribute('y', this.tableGroup.attribute.height - this.table.getBottomFrozenRowsHeight());
|
|
68921
|
+
else {
|
|
68709
68922
|
this.leftBottomCornerGroup.setAttributes({
|
|
68710
|
-
visible:
|
|
68711
|
-
|
|
68712
|
-
height:
|
|
68713
|
-
width: this.table.getFrozenColsWidth()
|
|
68923
|
+
visible: false,
|
|
68924
|
+
width: 0,
|
|
68925
|
+
height: 0
|
|
68714
68926
|
});
|
|
68715
68927
|
this.rightBottomCornerGroup.setAttributes({
|
|
68716
|
-
visible:
|
|
68717
|
-
|
|
68718
|
-
height:
|
|
68928
|
+
visible: false,
|
|
68929
|
+
width: 0,
|
|
68930
|
+
height: 0
|
|
68719
68931
|
});
|
|
68720
68932
|
}
|
|
68721
|
-
if (
|
|
68722
|
-
|
|
68933
|
+
if (hasRightFrozenCols) {
|
|
68934
|
+
const rightFrozenColsWidth = this.table.getRightFrozenColsWidth();
|
|
68935
|
+
const middleContentRight = Math.max(this.colHeaderGroup.attribute.x + this.colHeaderGroup.attribute.width, this.bodyGroup.attribute.x + this.bodyGroup.attribute.width, this.bottomFrozenGroup.attribute.x + this.bottomFrozenGroup.attribute.width);
|
|
68936
|
+
const rightFrozenX = Math.min(this.tableGroup.attribute.width - rightFrozenColsWidth, middleContentRight);
|
|
68937
|
+
this.rightFrozenGroup.setAttribute('x', rightFrozenX);
|
|
68723
68938
|
this.rightTopCornerGroup.setAttributes({
|
|
68724
|
-
visible:
|
|
68725
|
-
x:
|
|
68726
|
-
width:
|
|
68727
|
-
height: this.table.getFrozenRowsHeight()
|
|
68939
|
+
visible: hasFrozenRows,
|
|
68940
|
+
x: rightFrozenX,
|
|
68941
|
+
width: hasFrozenRows ? rightFrozenColsWidth : 0,
|
|
68942
|
+
height: hasFrozenRows ? this.table.getFrozenRowsHeight() : 0
|
|
68728
68943
|
});
|
|
68729
68944
|
this.rightBottomCornerGroup.setAttributes({
|
|
68730
|
-
visible:
|
|
68731
|
-
x:
|
|
68732
|
-
width:
|
|
68945
|
+
visible: hasBottomFrozenRows,
|
|
68946
|
+
x: rightFrozenX,
|
|
68947
|
+
width: hasBottomFrozenRows ? rightFrozenColsWidth : 0,
|
|
68948
|
+
height: hasBottomFrozenRows ? this.table.getBottomFrozenRowsHeight() : 0
|
|
68949
|
+
});
|
|
68950
|
+
}
|
|
68951
|
+
else {
|
|
68952
|
+
this.rightTopCornerGroup.setAttributes({
|
|
68953
|
+
visible: false,
|
|
68954
|
+
width: 0,
|
|
68955
|
+
height: 0
|
|
68733
68956
|
});
|
|
68734
68957
|
}
|
|
68958
|
+
if (hasBottomFrozenRows && !this.table.containerFit?.height) {
|
|
68959
|
+
const actualContentBottom = Math.max(this.colHeaderGroup.attribute.y + this.colHeaderGroup.attribute.height, this.cornerHeaderGroup.attribute.y + this.cornerHeaderGroup.attribute.height, this.rightTopCornerGroup.attribute.y + this.rightTopCornerGroup.attribute.height, this.rowHeaderGroup.attribute.y + this.rowHeaderGroup.attribute.height, this.bodyGroup.attribute.y + this.bodyGroup.attribute.height, this.rightFrozenGroup.attribute.y + this.rightFrozenGroup.attribute.height, this.leftBottomCornerGroup.attribute.y + this.leftBottomCornerGroup.attribute.height, this.bottomFrozenGroup.attribute.y + this.bottomFrozenGroup.attribute.height, this.rightBottomCornerGroup.attribute.y + this.rightBottomCornerGroup.attribute.height);
|
|
68960
|
+
if (actualContentBottom > 0 && actualContentBottom < this.tableGroup.attribute.height) {
|
|
68961
|
+
this.tableGroup.setAttribute('height', actualContentBottom);
|
|
68962
|
+
}
|
|
68963
|
+
}
|
|
68964
|
+
this.updateTableGroupBorder();
|
|
68735
68965
|
this.updateDomContainer();
|
|
68736
68966
|
}
|
|
68967
|
+
updateTableGroupBorder() {
|
|
68968
|
+
if (!this.tableGroup.border) {
|
|
68969
|
+
return;
|
|
68970
|
+
}
|
|
68971
|
+
const rectAttributes = this.tableGroup.border?.attribute;
|
|
68972
|
+
let borderTop;
|
|
68973
|
+
let borderRight;
|
|
68974
|
+
let borderBottom;
|
|
68975
|
+
let borderLeft;
|
|
68976
|
+
if (rectAttributes?.strokeArrayWidth) {
|
|
68977
|
+
borderTop = rectAttributes.strokeArrayWidth
|
|
68978
|
+
? rectAttributes.strokeArrayWidth[0]
|
|
68979
|
+
: rectAttributes.lineWidth ?? 0;
|
|
68980
|
+
borderRight = rectAttributes.strokeArrayWidth
|
|
68981
|
+
? rectAttributes.strokeArrayWidth[1]
|
|
68982
|
+
: rectAttributes.lineWidth ?? 0;
|
|
68983
|
+
borderBottom = rectAttributes.strokeArrayWidth
|
|
68984
|
+
? rectAttributes.strokeArrayWidth[2]
|
|
68985
|
+
: rectAttributes.lineWidth ?? 0;
|
|
68986
|
+
borderLeft = rectAttributes.strokeArrayWidth
|
|
68987
|
+
? rectAttributes.strokeArrayWidth[3]
|
|
68988
|
+
: rectAttributes.lineWidth ?? 0;
|
|
68989
|
+
}
|
|
68990
|
+
else {
|
|
68991
|
+
borderTop = rectAttributes?.lineWidth ?? 0;
|
|
68992
|
+
borderRight = rectAttributes?.lineWidth ?? 0;
|
|
68993
|
+
borderBottom = rectAttributes?.lineWidth ?? 0;
|
|
68994
|
+
borderLeft = rectAttributes?.lineWidth ?? 0;
|
|
68995
|
+
}
|
|
68996
|
+
if (this.tableGroup.border.type === 'rect') {
|
|
68997
|
+
if (this.table.theme.frameStyle?.innerBorder) {
|
|
68998
|
+
this.tableGroup.border.setAttributes({
|
|
68999
|
+
x: this.table.tableX + borderLeft / 2,
|
|
69000
|
+
y: this.table.tableY + borderTop / 2,
|
|
69001
|
+
width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
69002
|
+
height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
|
|
69003
|
+
});
|
|
69004
|
+
}
|
|
69005
|
+
else {
|
|
69006
|
+
this.tableGroup.border.setAttributes({
|
|
69007
|
+
x: this.table.tableX - borderLeft / 2,
|
|
69008
|
+
y: this.table.tableY - borderTop / 2,
|
|
69009
|
+
width: this.tableGroup.attribute.width + borderLeft / 2 + borderRight / 2,
|
|
69010
|
+
height: this.tableGroup.attribute.height + borderTop / 2 + borderBottom / 2
|
|
69011
|
+
});
|
|
69012
|
+
}
|
|
69013
|
+
}
|
|
69014
|
+
else if (this.tableGroup.border.type === 'group') {
|
|
69015
|
+
if (this.table.theme.frameStyle?.innerBorder) {
|
|
69016
|
+
this.tableGroup.border.setAttributes({
|
|
69017
|
+
x: this.table.tableX + borderLeft / 2,
|
|
69018
|
+
y: this.table.tableY + borderTop / 2,
|
|
69019
|
+
width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
69020
|
+
height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
|
|
69021
|
+
});
|
|
69022
|
+
this.tableGroup.border.firstChild?.setAttributes({
|
|
69023
|
+
x: 0,
|
|
69024
|
+
y: 0,
|
|
69025
|
+
width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
69026
|
+
height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
|
|
69027
|
+
});
|
|
69028
|
+
}
|
|
69029
|
+
else {
|
|
69030
|
+
this.tableGroup.border.setAttributes({
|
|
69031
|
+
x: this.table.tableX - borderLeft / 2,
|
|
69032
|
+
y: this.table.tableY - borderTop / 2,
|
|
69033
|
+
width: this.tableGroup.attribute.width + borderLeft / 2 + borderRight / 2,
|
|
69034
|
+
height: this.tableGroup.attribute.height + borderTop / 2 + borderBottom / 2
|
|
69035
|
+
});
|
|
69036
|
+
this.tableGroup.border.firstChild?.setAttributes({
|
|
69037
|
+
x: borderLeft / 2,
|
|
69038
|
+
y: borderTop / 2,
|
|
69039
|
+
width: this.tableGroup.attribute.width,
|
|
69040
|
+
height: this.tableGroup.attribute.height
|
|
69041
|
+
});
|
|
69042
|
+
}
|
|
69043
|
+
}
|
|
69044
|
+
}
|
|
68737
69045
|
updateRowHeight(row, detaY, skipTableHeightMap) {
|
|
68738
69046
|
detaY = Math.round(detaY);
|
|
68739
69047
|
updateRowHeight(this, row, detaY, skipTableHeightMap);
|
|
@@ -69342,7 +69650,7 @@
|
|
|
69342
69650
|
const isVtableMerge = this.table.getCellRawRecord(col, row)?.vtableMerge;
|
|
69343
69651
|
const type = isVtableMerge ? 'text' : this.table.getCellType(col, row);
|
|
69344
69652
|
const cellGroup = this.getCell(col, row);
|
|
69345
|
-
if (type === 'image' || type === 'video') {
|
|
69653
|
+
if (type === 'image' || type === 'video' || type === 'audio') {
|
|
69346
69654
|
updateImageCellContentWhileResize(cellGroup, col, row, 0, 0, this.table);
|
|
69347
69655
|
}
|
|
69348
69656
|
}
|
|
@@ -70866,11 +71174,15 @@
|
|
|
70866
71174
|
rowMax = rowMax + moveContext.sourceSize - 1;
|
|
70867
71175
|
}
|
|
70868
71176
|
}
|
|
70869
|
-
if (
|
|
71177
|
+
if (state.table.isListTable() &&
|
|
71178
|
+
!state.table.transpose &&
|
|
70870
71179
|
(state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource) ||
|
|
70871
71180
|
state.columnMove.movingColumnOrRow === 'row')) {
|
|
71181
|
+
const sourceRecordPath = state.table.getRecordIndexByCell(0, moveContext.sourceIndex);
|
|
71182
|
+
const targetRecordPath = state.table.getRecordIndexByCell(0, moveContext.targetIndex);
|
|
70872
71183
|
state.table.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex);
|
|
70873
|
-
state.
|
|
71184
|
+
state.changeCheckboxOrder(sourceRecordPath, targetRecordPath);
|
|
71185
|
+
state.changeRadioOrder(sourceRecordPath, targetRecordPath);
|
|
70874
71186
|
}
|
|
70875
71187
|
if (moveContext.moveType === 'column') {
|
|
70876
71188
|
clearWidthsAndHeightsCache(colMin, colMax, 0, -1, state.table);
|
|
@@ -71313,30 +71625,89 @@
|
|
|
71313
71625
|
radio?._handlePointerUp();
|
|
71314
71626
|
}
|
|
71315
71627
|
}
|
|
71316
|
-
function
|
|
71317
|
-
|
|
71318
|
-
|
|
71319
|
-
|
|
71320
|
-
|
|
71628
|
+
function normalizeRecordPath$1(recordPath) {
|
|
71629
|
+
return Array.isArray(recordPath) ? recordPath : [recordPath];
|
|
71630
|
+
}
|
|
71631
|
+
function parseRecordPathKey(key) {
|
|
71632
|
+
return isNumber$3(key) ? [key] : key.split(',').map(item => Number(item));
|
|
71633
|
+
}
|
|
71634
|
+
function isSameRecordPath$1(source, target) {
|
|
71635
|
+
return source.length === target.length && source.every((item, index) => item === target[index]);
|
|
71636
|
+
}
|
|
71637
|
+
function isSameParentPath$1(source, target) {
|
|
71638
|
+
if (source.length !== target.length) {
|
|
71639
|
+
return false;
|
|
71321
71640
|
}
|
|
71322
|
-
|
|
71323
|
-
|
|
71324
|
-
|
|
71641
|
+
return source.slice(0, -1).every((item, index) => item === target[index]);
|
|
71642
|
+
}
|
|
71643
|
+
function isDescendantPath$1(path, ancestor) {
|
|
71644
|
+
return ancestor.length <= path.length && ancestor.every((item, index) => item === path[index]);
|
|
71645
|
+
}
|
|
71646
|
+
function getMovedRecordPath$1(path, source, target) {
|
|
71647
|
+
return target.concat(path.slice(source.length));
|
|
71648
|
+
}
|
|
71649
|
+
function getShiftedSiblingPath$1(path, parent, sourceIndex, targetIndex) {
|
|
71650
|
+
if (path.length <= parent.length || !isDescendantPath$1(path.slice(0, parent.length), parent)) {
|
|
71651
|
+
return path;
|
|
71325
71652
|
}
|
|
71326
|
-
|
|
71327
|
-
|
|
71328
|
-
|
|
71329
|
-
|
|
71330
|
-
|
|
71331
|
-
radioState[targetIndex] = sourceRecord;
|
|
71653
|
+
const siblingIndex = path[parent.length];
|
|
71654
|
+
if (sourceIndex < targetIndex && siblingIndex > sourceIndex && siblingIndex <= targetIndex) {
|
|
71655
|
+
const shifted = [...path];
|
|
71656
|
+
shifted[parent.length] = siblingIndex - 1;
|
|
71657
|
+
return shifted;
|
|
71332
71658
|
}
|
|
71333
|
-
|
|
71334
|
-
const
|
|
71335
|
-
|
|
71336
|
-
|
|
71337
|
-
|
|
71338
|
-
|
|
71659
|
+
if (sourceIndex > targetIndex && siblingIndex >= targetIndex && siblingIndex < sourceIndex) {
|
|
71660
|
+
const shifted = [...path];
|
|
71661
|
+
shifted[parent.length] = siblingIndex + 1;
|
|
71662
|
+
return shifted;
|
|
71663
|
+
}
|
|
71664
|
+
return path;
|
|
71665
|
+
}
|
|
71666
|
+
function getChangedRecordPath(path, sourcePath, targetPath) {
|
|
71667
|
+
const parentPath = sourcePath.slice(0, -1);
|
|
71668
|
+
const sourceIndex = sourcePath[sourcePath.length - 1];
|
|
71669
|
+
const targetIndex = targetPath[targetPath.length - 1];
|
|
71670
|
+
if (isDescendantPath$1(path, sourcePath)) {
|
|
71671
|
+
return getMovedRecordPath$1(path, sourcePath, targetPath);
|
|
71672
|
+
}
|
|
71673
|
+
return getShiftedSiblingPath$1(path, parentPath, sourceIndex, targetIndex);
|
|
71674
|
+
}
|
|
71675
|
+
function getRadioStateValue(recordPath) {
|
|
71676
|
+
return recordPath.length === 1 ? recordPath[0] : recordPath;
|
|
71677
|
+
}
|
|
71678
|
+
function getRadioStateKey(recordPath) {
|
|
71679
|
+
return recordPath.toString();
|
|
71680
|
+
}
|
|
71681
|
+
function changeRadioStateValue(value, sourcePath, targetPath) {
|
|
71682
|
+
if (isNumber$3(value)) {
|
|
71683
|
+
return getRadioStateValue(getChangedRecordPath([value], sourcePath, targetPath));
|
|
71684
|
+
}
|
|
71685
|
+
if (Array.isArray(value)) {
|
|
71686
|
+
return getRadioStateValue(getChangedRecordPath(value, sourcePath, targetPath));
|
|
71687
|
+
}
|
|
71688
|
+
if (isString$2(value)) {
|
|
71689
|
+
return getRadioStateKey(getChangedRecordPath(parseRecordPathKey(value), sourcePath, targetPath));
|
|
71690
|
+
}
|
|
71691
|
+
if (isObject$7(value)) {
|
|
71692
|
+
const nextValue = {};
|
|
71693
|
+
Object.keys(value).forEach(key => {
|
|
71694
|
+
const nextPath = getChangedRecordPath(parseRecordPathKey(key), sourcePath, targetPath);
|
|
71695
|
+
nextValue[getRadioStateKey(nextPath)] = value[key];
|
|
71696
|
+
});
|
|
71697
|
+
return nextValue;
|
|
71698
|
+
}
|
|
71699
|
+
return value;
|
|
71700
|
+
}
|
|
71701
|
+
function changeRadioOrder(sourceRecordPath, targetRecordPath, state) {
|
|
71702
|
+
const { radioState } = state;
|
|
71703
|
+
const sourcePath = normalizeRecordPath$1(sourceRecordPath);
|
|
71704
|
+
const targetPath = normalizeRecordPath$1(targetRecordPath);
|
|
71705
|
+
if (isSameRecordPath$1(sourcePath, targetPath) || !isSameParentPath$1(sourcePath, targetPath)) {
|
|
71706
|
+
return;
|
|
71339
71707
|
}
|
|
71708
|
+
Object.keys(radioState).forEach(field => {
|
|
71709
|
+
radioState[field] = changeRadioStateValue(radioState[field], sourcePath, targetPath);
|
|
71710
|
+
});
|
|
71340
71711
|
}
|
|
71341
71712
|
|
|
71342
71713
|
function setCheckedState(col, row, field, checked, state) {
|
|
@@ -71573,6 +71944,25 @@
|
|
|
71573
71944
|
}
|
|
71574
71945
|
}
|
|
71575
71946
|
}
|
|
71947
|
+
function setCheckboxStateByRecordIndex(recordIndex, field, checked, table) {
|
|
71948
|
+
setRecordCheckboxState(recordIndex, field, checked, table.stateManager.checkedState);
|
|
71949
|
+
if (table.internalProps.enableCheckboxCascade && checked !== 'indeterminate') {
|
|
71950
|
+
updateChildrenCheckboxStateByRecordIndex(recordIndex, field, checked, table);
|
|
71951
|
+
updateParentCheckboxStateByRecordIndex(recordIndex, field, table);
|
|
71952
|
+
}
|
|
71953
|
+
updateVisibleCheckboxCellByRecordIndex(recordIndex, field, checked, table);
|
|
71954
|
+
updateHeaderCheckboxStateByField(field, table);
|
|
71955
|
+
renderCheckboxStateUpdate(table);
|
|
71956
|
+
}
|
|
71957
|
+
function clearCheckboxState(field, table) {
|
|
71958
|
+
if (!isValid$1(field)) {
|
|
71959
|
+
return;
|
|
71960
|
+
}
|
|
71961
|
+
clearRecordCheckboxState(table.records, field, table);
|
|
71962
|
+
updateVisibleCheckboxCellsByField(field, false, table);
|
|
71963
|
+
updateHeaderCheckboxStateByField(field, table);
|
|
71964
|
+
renderCheckboxStateUpdate(table);
|
|
71965
|
+
}
|
|
71576
71966
|
function setCellCheckboxStateByAttribute(col, row, checked, table) {
|
|
71577
71967
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
71578
71968
|
const checkbox = cellGroup?.getChildByName('checkbox') ||
|
|
@@ -71588,62 +71978,73 @@
|
|
|
71588
71978
|
}
|
|
71589
71979
|
}
|
|
71590
71980
|
}
|
|
71591
|
-
function
|
|
71592
|
-
|
|
71593
|
-
|
|
71594
|
-
|
|
71595
|
-
|
|
71596
|
-
|
|
71597
|
-
|
|
71981
|
+
function normalizeRecordPath(recordPath) {
|
|
71982
|
+
return isArray$5(recordPath) ? recordPath : [recordPath];
|
|
71983
|
+
}
|
|
71984
|
+
function parseCheckboxStateKey(key) {
|
|
71985
|
+
return isNumber$3(key) ? [key] : key.split(',').map(item => Number(item));
|
|
71986
|
+
}
|
|
71987
|
+
function stringifyRecordPath(recordPath) {
|
|
71988
|
+
return recordPath.toString();
|
|
71989
|
+
}
|
|
71990
|
+
function isSameRecordPath(source, target) {
|
|
71991
|
+
return source.length === target.length && source.every((item, index) => item === target[index]);
|
|
71992
|
+
}
|
|
71993
|
+
function isSameParentPath(source, target) {
|
|
71994
|
+
if (source.length !== target.length) {
|
|
71995
|
+
return false;
|
|
71598
71996
|
}
|
|
71599
|
-
|
|
71600
|
-
|
|
71601
|
-
|
|
71997
|
+
return source.slice(0, -1).every((item, index) => item === target[index]);
|
|
71998
|
+
}
|
|
71999
|
+
function isDescendantPath(path, ancestor) {
|
|
72000
|
+
return ancestor.length <= path.length && ancestor.every((item, index) => item === path[index]);
|
|
72001
|
+
}
|
|
72002
|
+
function getMovedRecordPath(path, source, target) {
|
|
72003
|
+
return target.concat(path.slice(source.length));
|
|
72004
|
+
}
|
|
72005
|
+
function getShiftedSiblingPath(path, parent, sourceIndex, targetIndex) {
|
|
72006
|
+
if (path.length <= parent.length || !isDescendantPath(path.slice(0, parent.length), parent)) {
|
|
72007
|
+
return path;
|
|
71602
72008
|
}
|
|
71603
|
-
|
|
71604
|
-
|
|
71605
|
-
|
|
71606
|
-
|
|
71607
|
-
|
|
71608
|
-
for (let i = sourceIndex; i > targetIndex; i--) {
|
|
71609
|
-
checkedState.set(i.toString(), checkedState.get((i - 1).toString()));
|
|
71610
|
-
}
|
|
71611
|
-
checkedState.set(targetIndex.toString(), sourceRecord);
|
|
71612
|
-
}
|
|
71613
|
-
else if (sourceIndex < targetIndex) {
|
|
71614
|
-
const sourceRecord = checkedState.get(sourceIndex.toString());
|
|
71615
|
-
for (let i = sourceIndex; i < targetIndex; i++) {
|
|
71616
|
-
checkedState.set(i.toString(), checkedState.get((i + 1).toString()));
|
|
71617
|
-
}
|
|
71618
|
-
checkedState.set(targetIndex.toString(), sourceRecord);
|
|
71619
|
-
}
|
|
72009
|
+
const siblingIndex = path[parent.length];
|
|
72010
|
+
if (sourceIndex < targetIndex && siblingIndex > sourceIndex && siblingIndex <= targetIndex) {
|
|
72011
|
+
const shifted = [...path];
|
|
72012
|
+
shifted[parent.length] = siblingIndex - 1;
|
|
72013
|
+
return shifted;
|
|
71620
72014
|
}
|
|
71621
|
-
|
|
71622
|
-
|
|
71623
|
-
|
|
71624
|
-
|
|
71625
|
-
|
|
71626
|
-
|
|
71627
|
-
|
|
71628
|
-
|
|
71629
|
-
|
|
71630
|
-
|
|
71631
|
-
|
|
71632
|
-
|
|
71633
|
-
|
|
72015
|
+
if (sourceIndex > targetIndex && siblingIndex >= targetIndex && siblingIndex < sourceIndex) {
|
|
72016
|
+
const shifted = [...path];
|
|
72017
|
+
shifted[parent.length] = siblingIndex + 1;
|
|
72018
|
+
return shifted;
|
|
72019
|
+
}
|
|
72020
|
+
return path;
|
|
72021
|
+
}
|
|
72022
|
+
function changeCheckboxOrder(sourceRecordPath, targetRecordPath, state) {
|
|
72023
|
+
const { checkedState } = state;
|
|
72024
|
+
const sourcePath = normalizeRecordPath(sourceRecordPath);
|
|
72025
|
+
const targetPath = normalizeRecordPath(targetRecordPath);
|
|
72026
|
+
if (isSameRecordPath(sourcePath, targetPath) || !isSameParentPath(sourcePath, targetPath)) {
|
|
72027
|
+
return;
|
|
72028
|
+
}
|
|
72029
|
+
const parentPath = sourcePath.slice(0, -1);
|
|
72030
|
+
const sourceIndex = sourcePath[sourcePath.length - 1];
|
|
72031
|
+
const targetIndex = targetPath[targetPath.length - 1];
|
|
72032
|
+
const nextCheckedState = new Map();
|
|
72033
|
+
checkedState.forEach((value, key) => {
|
|
72034
|
+
const keyPath = parseCheckboxStateKey(key);
|
|
72035
|
+
let nextPath;
|
|
72036
|
+
if (isDescendantPath(keyPath, sourcePath)) {
|
|
72037
|
+
nextPath = getMovedRecordPath(keyPath, sourcePath, targetPath);
|
|
71634
72038
|
}
|
|
71635
|
-
else
|
|
71636
|
-
|
|
71637
|
-
for (let i = sourceIndex; i < targetIndex; i++) {
|
|
71638
|
-
const now = [...source];
|
|
71639
|
-
now[now.length - 1] = i;
|
|
71640
|
-
const next = [...source];
|
|
71641
|
-
next[next.length - 1] = i + 1;
|
|
71642
|
-
checkedState.set(now.toString(), checkedState.get(next.toString()));
|
|
71643
|
-
}
|
|
71644
|
-
checkedState.set(target.toString(), sourceRecord);
|
|
72039
|
+
else {
|
|
72040
|
+
nextPath = getShiftedSiblingPath(keyPath, parentPath, sourceIndex, targetIndex);
|
|
71645
72041
|
}
|
|
71646
|
-
|
|
72042
|
+
nextCheckedState.set(stringifyRecordPath(nextPath), value);
|
|
72043
|
+
});
|
|
72044
|
+
checkedState.clear();
|
|
72045
|
+
nextCheckedState.forEach((value, key) => {
|
|
72046
|
+
checkedState.set(key, value);
|
|
72047
|
+
});
|
|
71647
72048
|
}
|
|
71648
72049
|
function getGroupCheckboxState(table) {
|
|
71649
72050
|
const result = [];
|
|
@@ -71657,6 +72058,186 @@
|
|
|
71657
72058
|
});
|
|
71658
72059
|
return result;
|
|
71659
72060
|
}
|
|
72061
|
+
function normalizeRecordIndex(recordIndex) {
|
|
72062
|
+
if (isArray$5(recordIndex) && recordIndex.length === 1) {
|
|
72063
|
+
return recordIndex[0];
|
|
72064
|
+
}
|
|
72065
|
+
return recordIndex;
|
|
72066
|
+
}
|
|
72067
|
+
function setRecordCheckboxState(recordIndex, field, checked, checkedState) {
|
|
72068
|
+
const dataIndex = normalizeRecordIndex(recordIndex).toString();
|
|
72069
|
+
if (checkedState.get(dataIndex)) {
|
|
72070
|
+
checkedState.get(dataIndex)[field] = checked;
|
|
72071
|
+
}
|
|
72072
|
+
else {
|
|
72073
|
+
checkedState.set(dataIndex, {
|
|
72074
|
+
[field]: checked
|
|
72075
|
+
});
|
|
72076
|
+
}
|
|
72077
|
+
}
|
|
72078
|
+
function clearRecordCheckboxState(records, field, table, parentIndex = []) {
|
|
72079
|
+
if (!isArray$5(records)) {
|
|
72080
|
+
return;
|
|
72081
|
+
}
|
|
72082
|
+
records.forEach((record, index) => {
|
|
72083
|
+
const recordIndex = parentIndex.length ? parentIndex.concat(index) : [index];
|
|
72084
|
+
const currentState = getRecordCheckboxState(recordIndex, record, field, table);
|
|
72085
|
+
if (currentState !== false) {
|
|
72086
|
+
setRecordCheckboxState(recordIndex, field, false, table.stateManager.checkedState);
|
|
72087
|
+
}
|
|
72088
|
+
if (isArray$5(record?.children)) {
|
|
72089
|
+
clearRecordCheckboxState(record.children, field, table, recordIndex);
|
|
72090
|
+
}
|
|
72091
|
+
});
|
|
72092
|
+
}
|
|
72093
|
+
function updateVisibleCheckboxCellByRecordIndex(recordIndex, field, checked, table) {
|
|
72094
|
+
const bodyRowIndex = table.getBodyRowIndexByRecordIndex?.(recordIndex);
|
|
72095
|
+
if (!isNumber$3(bodyRowIndex) || bodyRowIndex < 0) {
|
|
72096
|
+
return;
|
|
72097
|
+
}
|
|
72098
|
+
const row = bodyRowIndex + table.columnHeaderLevelCount;
|
|
72099
|
+
const cols = getCheckboxColsByField(field, row, table);
|
|
72100
|
+
cols.forEach(col => {
|
|
72101
|
+
setCellCheckboxStateByAttribute(col, row, checked, table);
|
|
72102
|
+
});
|
|
72103
|
+
}
|
|
72104
|
+
function updateVisibleCheckboxCellsByField(field, checked, table) {
|
|
72105
|
+
const bodyStartRow = table.columnHeaderLevelCount;
|
|
72106
|
+
const cols = getCheckboxColsByField(field, bodyStartRow, table);
|
|
72107
|
+
for (let row = table.columnHeaderLevelCount; row < table.rowCount; row++) {
|
|
72108
|
+
cols.forEach(col => {
|
|
72109
|
+
setCellCheckboxStateByAttribute(col, row, checked, table);
|
|
72110
|
+
});
|
|
72111
|
+
}
|
|
72112
|
+
}
|
|
72113
|
+
function renderCheckboxStateUpdate(table) {
|
|
72114
|
+
const renderAsync = table.renderAsync;
|
|
72115
|
+
if (isFunction$3(renderAsync)) {
|
|
72116
|
+
renderAsync.call(table);
|
|
72117
|
+
}
|
|
72118
|
+
else {
|
|
72119
|
+
table.render();
|
|
72120
|
+
}
|
|
72121
|
+
}
|
|
72122
|
+
function updateHeaderCheckboxStateByField(field, table) {
|
|
72123
|
+
const fieldKey = field;
|
|
72124
|
+
let hasChecked = false;
|
|
72125
|
+
let hasUnchecked = false;
|
|
72126
|
+
let hasRecord = false;
|
|
72127
|
+
traverseRecords(table.records, (record, recordIndex) => {
|
|
72128
|
+
const state = getRecordCheckboxState(recordIndex, record, field, table);
|
|
72129
|
+
hasRecord = true;
|
|
72130
|
+
if (state === true) {
|
|
72131
|
+
hasChecked = true;
|
|
72132
|
+
}
|
|
72133
|
+
else if (state === 'indeterminate') {
|
|
72134
|
+
hasChecked = true;
|
|
72135
|
+
hasUnchecked = true;
|
|
72136
|
+
}
|
|
72137
|
+
else {
|
|
72138
|
+
hasUnchecked = true;
|
|
72139
|
+
}
|
|
72140
|
+
});
|
|
72141
|
+
const checked = hasRecord && hasChecked && !hasUnchecked ? true : hasChecked ? 'indeterminate' : false;
|
|
72142
|
+
table.stateManager.headerCheckedState[fieldKey] = checked;
|
|
72143
|
+
updateVisibleHeaderCheckboxCellByField(field, checked, table);
|
|
72144
|
+
}
|
|
72145
|
+
function updateVisibleHeaderCheckboxCellByField(field, checked, table) {
|
|
72146
|
+
for (let row = 0; row < table.columnHeaderLevelCount; row++) {
|
|
72147
|
+
for (let col = 0; col < table.colCount; col++) {
|
|
72148
|
+
if (table.getHeaderField(col, row) === field && table.getCellType(col, row) === 'checkbox') {
|
|
72149
|
+
table.scenegraph.updateHeaderCheckboxCellState(col, row, checked);
|
|
72150
|
+
}
|
|
72151
|
+
}
|
|
72152
|
+
}
|
|
72153
|
+
}
|
|
72154
|
+
function getCheckboxColsByField(field, row, table) {
|
|
72155
|
+
const cols = [];
|
|
72156
|
+
for (let col = 0; col < table.colCount; col++) {
|
|
72157
|
+
if (table.isHeader(col, row)) {
|
|
72158
|
+
continue;
|
|
72159
|
+
}
|
|
72160
|
+
const define = table.getBodyColumnDefine(col, row);
|
|
72161
|
+
if (define?.field === field && table.getCellType(col, row) === 'checkbox') {
|
|
72162
|
+
cols.push(col);
|
|
72163
|
+
}
|
|
72164
|
+
}
|
|
72165
|
+
return cols;
|
|
72166
|
+
}
|
|
72167
|
+
function updateChildrenCheckboxStateByRecordIndex(recordIndex, field, checked, table) {
|
|
72168
|
+
const record = getRecordByRecordIndex(table.records, recordIndex);
|
|
72169
|
+
if (!record?.children?.length) {
|
|
72170
|
+
return;
|
|
72171
|
+
}
|
|
72172
|
+
record.children.forEach((child, childIndex) => {
|
|
72173
|
+
const childRecordIndex = normalizeRecordIndexToArray(recordIndex).concat(childIndex);
|
|
72174
|
+
setRecordCheckboxState(childRecordIndex, field, checked, table.stateManager.checkedState);
|
|
72175
|
+
updateVisibleCheckboxCellByRecordIndex(childRecordIndex, field, checked, table);
|
|
72176
|
+
updateChildrenCheckboxStateByRecordIndex(childRecordIndex, field, checked, table);
|
|
72177
|
+
});
|
|
72178
|
+
}
|
|
72179
|
+
function updateParentCheckboxStateByRecordIndex(recordIndex, field, table) {
|
|
72180
|
+
const recordIndexPath = normalizeRecordIndexToArray(recordIndex);
|
|
72181
|
+
for (let level = recordIndexPath.length - 1; level > 0; level--) {
|
|
72182
|
+
const parentIndex = recordIndexPath.slice(0, level);
|
|
72183
|
+
const parentRecord = getRecordByRecordIndex(table.records, parentIndex);
|
|
72184
|
+
if (!parentRecord?.children?.length) {
|
|
72185
|
+
continue;
|
|
72186
|
+
}
|
|
72187
|
+
const childStates = parentRecord.children.map((child, childIndex) => {
|
|
72188
|
+
const childRecordIndex = parentIndex.concat(childIndex);
|
|
72189
|
+
const childState = getRecordCheckboxState(childRecordIndex, child, field, table);
|
|
72190
|
+
setRecordCheckboxState(childRecordIndex, field, childState, table.stateManager.checkedState);
|
|
72191
|
+
return childState;
|
|
72192
|
+
});
|
|
72193
|
+
const allChecked = childStates.every(state => state === true);
|
|
72194
|
+
const allUnchecked = childStates.every(state => state !== true && state !== 'indeterminate');
|
|
72195
|
+
const parentState = allChecked ? true : allUnchecked ? false : 'indeterminate';
|
|
72196
|
+
setRecordCheckboxState(parentIndex, field, parentState, table.stateManager.checkedState);
|
|
72197
|
+
updateVisibleCheckboxCellByRecordIndex(parentIndex, field, parentState, table);
|
|
72198
|
+
}
|
|
72199
|
+
}
|
|
72200
|
+
function getRecordCheckboxState(recordIndex, record, field, table) {
|
|
72201
|
+
const fieldKey = field;
|
|
72202
|
+
const dataIndex = normalizeRecordIndex(recordIndex).toString();
|
|
72203
|
+
const cachedState = table.stateManager.checkedState.get(dataIndex)?.[fieldKey];
|
|
72204
|
+
if (isValid$1(cachedState)) {
|
|
72205
|
+
return cachedState;
|
|
72206
|
+
}
|
|
72207
|
+
const value = record?.[fieldKey];
|
|
72208
|
+
if (isObject$7(value) && isValid$1(value.checked)) {
|
|
72209
|
+
return value.checked;
|
|
72210
|
+
}
|
|
72211
|
+
if (typeof value === 'boolean') {
|
|
72212
|
+
return value;
|
|
72213
|
+
}
|
|
72214
|
+
return false;
|
|
72215
|
+
}
|
|
72216
|
+
function getRecordByRecordIndex(records, recordIndex) {
|
|
72217
|
+
const recordIndexPath = normalizeRecordIndexToArray(recordIndex);
|
|
72218
|
+
let currentRecords = records;
|
|
72219
|
+
let record;
|
|
72220
|
+
for (let i = 0; i < recordIndexPath.length; i++) {
|
|
72221
|
+
record = currentRecords?.[recordIndexPath[i]];
|
|
72222
|
+
currentRecords = record?.children;
|
|
72223
|
+
}
|
|
72224
|
+
return record;
|
|
72225
|
+
}
|
|
72226
|
+
function normalizeRecordIndexToArray(recordIndex) {
|
|
72227
|
+
return isArray$5(recordIndex) ? recordIndex : [recordIndex];
|
|
72228
|
+
}
|
|
72229
|
+
function traverseRecords(records, handler, parentIndex = []) {
|
|
72230
|
+
if (!isArray$5(records)) {
|
|
72231
|
+
return;
|
|
72232
|
+
}
|
|
72233
|
+
records.forEach((record, index) => {
|
|
72234
|
+
const recordIndex = parentIndex.length ? parentIndex.concat(index) : index;
|
|
72235
|
+
handler(record, recordIndex);
|
|
72236
|
+
if (isArray$5(record?.children)) {
|
|
72237
|
+
traverseRecords(record.children, handler, isArray$5(recordIndex) ? recordIndex : [recordIndex]);
|
|
72238
|
+
}
|
|
72239
|
+
});
|
|
72240
|
+
}
|
|
71660
72241
|
function initRecordCheckState(records, state) {
|
|
71661
72242
|
const table = state.table;
|
|
71662
72243
|
const start = table.isPivotTable()
|
|
@@ -72377,6 +72958,7 @@
|
|
|
72377
72958
|
placement: inlineIcon.attribute.tooltip.placement
|
|
72378
72959
|
},
|
|
72379
72960
|
style: Object.assign({}, this.table.internalProps.theme?.tooltipStyle, inlineIcon.tooltip?.style, inlineIcon.attribute?.tooltip?.style),
|
|
72961
|
+
appearDelay: inlineIcon.attribute.tooltip.appearDelay,
|
|
72380
72962
|
disappearDelay: inlineIcon.attribute.tooltip.disappearDelay
|
|
72381
72963
|
};
|
|
72382
72964
|
if (!this.table.internalProps.tooltipHandler.isBinded(tooltipOptions)) {
|
|
@@ -73278,12 +73860,14 @@
|
|
|
73278
73860
|
syncRadioState(col, row, field, radioType, indexInCell, isChecked) {
|
|
73279
73861
|
return syncRadioState(col, row, field, radioType, indexInCell, isChecked, this);
|
|
73280
73862
|
}
|
|
73281
|
-
|
|
73863
|
+
changeCheckboxOrder(sourceRecordPath, targetRecordPath) {
|
|
73282
73864
|
if (this.checkedState.size) {
|
|
73283
|
-
changeCheckboxOrder(
|
|
73865
|
+
changeCheckboxOrder(sourceRecordPath, targetRecordPath, this);
|
|
73284
73866
|
}
|
|
73285
|
-
|
|
73286
|
-
|
|
73867
|
+
}
|
|
73868
|
+
changeRadioOrder(sourceRecordPath, targetRecordPath) {
|
|
73869
|
+
if (Object.keys(this.radioState).length) {
|
|
73870
|
+
changeRadioOrder(sourceRecordPath, targetRecordPath, this);
|
|
73287
73871
|
}
|
|
73288
73872
|
}
|
|
73289
73873
|
setCustomSelectRanges(customSelectRanges) {
|
|
@@ -73292,8 +73876,243 @@
|
|
|
73292
73876
|
}
|
|
73293
73877
|
}
|
|
73294
73878
|
|
|
73879
|
+
const AUDIO_EXTENSIONS = new Set(['mp3', 'wav', 'oga', 'm4a', 'aac', 'flac', 'opus']);
|
|
73880
|
+
function isAudioUrl(value) {
|
|
73881
|
+
if (typeof value !== 'string') {
|
|
73882
|
+
return false;
|
|
73883
|
+
}
|
|
73884
|
+
const trimmedValue = value.trim();
|
|
73885
|
+
const queryIndex = trimmedValue.indexOf('?');
|
|
73886
|
+
const hashIndex = trimmedValue.indexOf('#');
|
|
73887
|
+
let endIndex = trimmedValue.length;
|
|
73888
|
+
if (queryIndex >= 0) {
|
|
73889
|
+
endIndex = queryIndex;
|
|
73890
|
+
}
|
|
73891
|
+
if (hashIndex >= 0 && hashIndex < endIndex) {
|
|
73892
|
+
endIndex = hashIndex;
|
|
73893
|
+
}
|
|
73894
|
+
const path = trimmedValue.slice(0, endIndex);
|
|
73895
|
+
const dotIndex = path.lastIndexOf('.');
|
|
73896
|
+
if (dotIndex < 0 || dotIndex === path.length - 1) {
|
|
73897
|
+
return false;
|
|
73898
|
+
}
|
|
73899
|
+
return AUDIO_EXTENSIONS.has(path.slice(dotIndex + 1).toLowerCase());
|
|
73900
|
+
}
|
|
73901
|
+
|
|
73902
|
+
const MEDIA_PREVIEW_MANAGER_KEY = '__vtable_media_preview_manager__';
|
|
73903
|
+
function formatAudioTime(time) {
|
|
73904
|
+
if (!Number.isFinite(time) || time < 0) {
|
|
73905
|
+
return '0:00';
|
|
73906
|
+
}
|
|
73907
|
+
const minutes = Math.floor(time / 60);
|
|
73908
|
+
const seconds = Math.floor(time % 60);
|
|
73909
|
+
return `${minutes}:${seconds.toString().padStart(2, '0')}`;
|
|
73910
|
+
}
|
|
73911
|
+
function updateAudioProgressStyle(progress, value) {
|
|
73912
|
+
progress.style.background = `linear-gradient(
|
|
73913
|
+
to right,
|
|
73914
|
+
#2563EB 0%,
|
|
73915
|
+
#2563EB ${value}%,
|
|
73916
|
+
#D1D5DB ${value}%,
|
|
73917
|
+
#D1D5DB 100%
|
|
73918
|
+
)`;
|
|
73919
|
+
}
|
|
73920
|
+
function ensureAudioPreviewStyle() {
|
|
73921
|
+
const styleId = 'vtable-audio-preview-style';
|
|
73922
|
+
if (document.getElementById(styleId)) {
|
|
73923
|
+
return;
|
|
73924
|
+
}
|
|
73925
|
+
const style = document.createElement('style');
|
|
73926
|
+
style.id = styleId;
|
|
73927
|
+
style.textContent = `
|
|
73928
|
+
.vtable-audio-preview-progress {
|
|
73929
|
+
-webkit-appearance: none;
|
|
73930
|
+
appearance: none;
|
|
73931
|
+
}
|
|
73932
|
+
.vtable-audio-preview-progress::-webkit-slider-runnable-track {
|
|
73933
|
+
height: 4px;
|
|
73934
|
+
border-radius: 999px;
|
|
73935
|
+
background: transparent;
|
|
73936
|
+
}
|
|
73937
|
+
.vtable-audio-preview-progress::-webkit-slider-thumb {
|
|
73938
|
+
-webkit-appearance: none;
|
|
73939
|
+
appearance: none;
|
|
73940
|
+
width: 12px;
|
|
73941
|
+
height: 12px;
|
|
73942
|
+
margin-top: -4px;
|
|
73943
|
+
border-radius: 50%;
|
|
73944
|
+
border: 0;
|
|
73945
|
+
background: #2563EB;
|
|
73946
|
+
}
|
|
73947
|
+
.vtable-audio-preview-progress::-moz-range-track {
|
|
73948
|
+
height: 4px;
|
|
73949
|
+
border-radius: 999px;
|
|
73950
|
+
background: transparent;
|
|
73951
|
+
}
|
|
73952
|
+
.vtable-audio-preview-progress::-moz-range-thumb {
|
|
73953
|
+
width: 12px;
|
|
73954
|
+
height: 12px;
|
|
73955
|
+
border-radius: 50%;
|
|
73956
|
+
border: 0;
|
|
73957
|
+
background: #2563EB;
|
|
73958
|
+
}
|
|
73959
|
+
`;
|
|
73960
|
+
document.head.appendChild(style);
|
|
73961
|
+
}
|
|
73962
|
+
function createAudioPreview(cellValue) {
|
|
73963
|
+
ensureAudioPreviewStyle();
|
|
73964
|
+
const audio = document.createElement('audio');
|
|
73965
|
+
audio.src = cellValue;
|
|
73966
|
+
audio.preload = 'auto';
|
|
73967
|
+
let released = false;
|
|
73968
|
+
const wrapper = document.createElement('div');
|
|
73969
|
+
wrapper.style.width = '80%';
|
|
73970
|
+
wrapper.style.maxWidth = '640px';
|
|
73971
|
+
wrapper.style.height = '54px';
|
|
73972
|
+
wrapper.style.boxSizing = 'border-box';
|
|
73973
|
+
wrapper.style.padding = '0 16px';
|
|
73974
|
+
wrapper.style.borderRadius = '27px';
|
|
73975
|
+
wrapper.style.background = '#F8FAFC';
|
|
73976
|
+
wrapper.style.display = 'flex';
|
|
73977
|
+
wrapper.style.alignItems = 'center';
|
|
73978
|
+
wrapper.style.gap = '10px';
|
|
73979
|
+
wrapper.style.boxShadow = '0 8px 24px rgba(15, 23, 42, 0.16)';
|
|
73980
|
+
const playButton = document.createElement('button');
|
|
73981
|
+
playButton.type = 'button';
|
|
73982
|
+
playButton.textContent = '▶';
|
|
73983
|
+
playButton.style.width = '34px';
|
|
73984
|
+
playButton.style.height = '34px';
|
|
73985
|
+
playButton.style.border = '1px solid #CBD5E1';
|
|
73986
|
+
playButton.style.borderRadius = '8px';
|
|
73987
|
+
playButton.style.background = '#EFF6FF';
|
|
73988
|
+
playButton.style.color = '#0F172A';
|
|
73989
|
+
playButton.style.cursor = 'pointer';
|
|
73990
|
+
playButton.style.flex = '0 0 auto';
|
|
73991
|
+
playButton.style.fontSize = '14px';
|
|
73992
|
+
const timeLabel = document.createElement('span');
|
|
73993
|
+
timeLabel.textContent = '0:00 / 0:00';
|
|
73994
|
+
timeLabel.style.color = '#0F172A';
|
|
73995
|
+
timeLabel.style.font = '14px sans-serif';
|
|
73996
|
+
timeLabel.style.whiteSpace = 'nowrap';
|
|
73997
|
+
const progress = document.createElement('input');
|
|
73998
|
+
progress.className = 'vtable-audio-preview-progress';
|
|
73999
|
+
progress.type = 'range';
|
|
74000
|
+
progress.min = '0';
|
|
74001
|
+
progress.max = '100';
|
|
74002
|
+
progress.value = '0';
|
|
74003
|
+
progress.step = '0.1';
|
|
74004
|
+
progress.style.flex = '1 1 auto';
|
|
74005
|
+
progress.style.height = '4px';
|
|
74006
|
+
progress.style.borderRadius = '999px';
|
|
74007
|
+
progress.style.outline = 'none';
|
|
74008
|
+
progress.style.cursor = 'pointer';
|
|
74009
|
+
progress.style.accentColor = '#2563EB';
|
|
74010
|
+
updateAudioProgressStyle(progress, 0);
|
|
74011
|
+
const updateProgress = () => {
|
|
74012
|
+
const duration = Number.isFinite(audio.duration) ? audio.duration : 0;
|
|
74013
|
+
const currentTime = audio.currentTime || 0;
|
|
74014
|
+
const value = duration > 0 ? Math.min(100, (currentTime / duration) * 100) : 0;
|
|
74015
|
+
progress.disabled = duration <= 0;
|
|
74016
|
+
progress.style.cursor = duration > 0 ? 'pointer' : 'default';
|
|
74017
|
+
progress.value = `${value}`;
|
|
74018
|
+
timeLabel.textContent = `${formatAudioTime(currentTime)} / ${formatAudioTime(duration)}`;
|
|
74019
|
+
updateAudioProgressStyle(progress, value);
|
|
74020
|
+
};
|
|
74021
|
+
playButton.addEventListener('click', e => {
|
|
74022
|
+
e.stopPropagation();
|
|
74023
|
+
if (audio.paused) {
|
|
74024
|
+
const playPromise = audio.play();
|
|
74025
|
+
if (playPromise) {
|
|
74026
|
+
playPromise.catch(error => {
|
|
74027
|
+
if (released || error?.name === 'AbortError') {
|
|
74028
|
+
return;
|
|
74029
|
+
}
|
|
74030
|
+
playButton.textContent = '▶';
|
|
74031
|
+
});
|
|
74032
|
+
}
|
|
74033
|
+
}
|
|
74034
|
+
else {
|
|
74035
|
+
audio.pause();
|
|
74036
|
+
}
|
|
74037
|
+
});
|
|
74038
|
+
progress.addEventListener('click', e => {
|
|
74039
|
+
e.stopPropagation();
|
|
74040
|
+
});
|
|
74041
|
+
progress.addEventListener('input', () => {
|
|
74042
|
+
const duration = Number.isFinite(audio.duration) ? audio.duration : 0;
|
|
74043
|
+
const value = Number(progress.value);
|
|
74044
|
+
if (duration > 0 && Number.isFinite(value)) {
|
|
74045
|
+
audio.currentTime = (duration * value) / 100;
|
|
74046
|
+
}
|
|
74047
|
+
updateProgress();
|
|
74048
|
+
});
|
|
74049
|
+
audio.addEventListener('loadedmetadata', updateProgress);
|
|
74050
|
+
audio.addEventListener('durationchange', updateProgress);
|
|
74051
|
+
audio.addEventListener('timeupdate', updateProgress);
|
|
74052
|
+
audio.addEventListener('play', () => {
|
|
74053
|
+
playButton.textContent = '❚❚';
|
|
74054
|
+
});
|
|
74055
|
+
audio.addEventListener('pause', () => {
|
|
74056
|
+
playButton.textContent = '▶';
|
|
74057
|
+
});
|
|
74058
|
+
audio.addEventListener('ended', () => {
|
|
74059
|
+
audio.currentTime = 0;
|
|
74060
|
+
playButton.textContent = '▶';
|
|
74061
|
+
updateProgress();
|
|
74062
|
+
});
|
|
74063
|
+
wrapper.appendChild(playButton);
|
|
74064
|
+
wrapper.appendChild(timeLabel);
|
|
74065
|
+
wrapper.appendChild(progress);
|
|
74066
|
+
wrapper.appendChild(audio);
|
|
74067
|
+
return {
|
|
74068
|
+
element: wrapper,
|
|
74069
|
+
destroy: () => {
|
|
74070
|
+
released = true;
|
|
74071
|
+
audio.pause();
|
|
74072
|
+
audio.removeAttribute('src');
|
|
74073
|
+
audio.load();
|
|
74074
|
+
}
|
|
74075
|
+
};
|
|
74076
|
+
}
|
|
74077
|
+
function createMediaPreviewManager(table) {
|
|
74078
|
+
const manager = {
|
|
74079
|
+
closePreview: null,
|
|
74080
|
+
registered: false,
|
|
74081
|
+
close() {
|
|
74082
|
+
const closePreview = manager.closePreview;
|
|
74083
|
+
manager.closePreview = null;
|
|
74084
|
+
closePreview?.();
|
|
74085
|
+
},
|
|
74086
|
+
open(closePreview) {
|
|
74087
|
+
manager.close();
|
|
74088
|
+
manager.closePreview = closePreview;
|
|
74089
|
+
},
|
|
74090
|
+
release() {
|
|
74091
|
+
manager.close();
|
|
74092
|
+
manager.registered = false;
|
|
74093
|
+
},
|
|
74094
|
+
ensureRegistered() {
|
|
74095
|
+
if (manager.registered) {
|
|
74096
|
+
return;
|
|
74097
|
+
}
|
|
74098
|
+
table.addReleaseObj(manager);
|
|
74099
|
+
manager.registered = true;
|
|
74100
|
+
}
|
|
74101
|
+
};
|
|
74102
|
+
return manager;
|
|
74103
|
+
}
|
|
74104
|
+
function getMediaPreviewManager(table) {
|
|
74105
|
+
const tableWithManager = table;
|
|
74106
|
+
if (!tableWithManager[MEDIA_PREVIEW_MANAGER_KEY]) {
|
|
74107
|
+
tableWithManager[MEDIA_PREVIEW_MANAGER_KEY] = createMediaPreviewManager(table);
|
|
74108
|
+
}
|
|
74109
|
+
const manager = tableWithManager[MEDIA_PREVIEW_MANAGER_KEY];
|
|
74110
|
+
manager.ensureRegistered();
|
|
74111
|
+
return manager;
|
|
74112
|
+
}
|
|
73295
74113
|
function bindMediaClick(table) {
|
|
73296
74114
|
if (Env.mode === 'browser') {
|
|
74115
|
+
getMediaPreviewManager(table);
|
|
73297
74116
|
table.on(TABLE_EVENT_TYPE.CLICK_CELL, (e) => {
|
|
73298
74117
|
const { col, row } = e;
|
|
73299
74118
|
if (e.target.type === 'image' && e.target.role && e.target.role.startsWith('icon')) {
|
|
@@ -73371,6 +74190,7 @@
|
|
|
73371
74190
|
if (clickToPreview === false) {
|
|
73372
74191
|
return;
|
|
73373
74192
|
}
|
|
74193
|
+
const previewManager = getMediaPreviewManager(table);
|
|
73374
74194
|
const overlay = document.createElement('div');
|
|
73375
74195
|
overlay.style.width = '100%';
|
|
73376
74196
|
overlay.style.height = '100%';
|
|
@@ -73383,9 +74203,15 @@
|
|
|
73383
74203
|
overlay.style.alignItems = 'center';
|
|
73384
74204
|
overlay.style.overflow = 'hidden';
|
|
73385
74205
|
overlay.style.zIndex = '9999';
|
|
74206
|
+
const closeOverlay = () => {
|
|
74207
|
+
if (overlay.parentNode) {
|
|
74208
|
+
document.body.removeChild(overlay);
|
|
74209
|
+
}
|
|
74210
|
+
};
|
|
74211
|
+
previewManager.open(closeOverlay);
|
|
73386
74212
|
overlay.addEventListener('click', e => {
|
|
73387
74213
|
if (e.target === overlay) {
|
|
73388
|
-
|
|
74214
|
+
previewManager.close();
|
|
73389
74215
|
}
|
|
73390
74216
|
});
|
|
73391
74217
|
const image = new Image();
|
|
@@ -73396,11 +74222,12 @@
|
|
|
73396
74222
|
overlay.appendChild(image);
|
|
73397
74223
|
document.body.appendChild(overlay);
|
|
73398
74224
|
}
|
|
73399
|
-
else if (cellType === 'video') {
|
|
74225
|
+
else if (cellType === 'audio' || (cellType === 'video' && isAudioUrl(cellValue))) {
|
|
73400
74226
|
const { clickToPreview } = columnDefine;
|
|
73401
74227
|
if (clickToPreview === false) {
|
|
73402
74228
|
return;
|
|
73403
74229
|
}
|
|
74230
|
+
const previewManager = getMediaPreviewManager(table);
|
|
73404
74231
|
const overlay = document.createElement('div');
|
|
73405
74232
|
overlay.style.width = '100%';
|
|
73406
74233
|
overlay.style.height = '100%';
|
|
@@ -73413,18 +74240,69 @@
|
|
|
73413
74240
|
overlay.style.alignItems = 'center';
|
|
73414
74241
|
overlay.style.overflow = 'hidden';
|
|
73415
74242
|
overlay.style.zIndex = '9999';
|
|
74243
|
+
const audioPreview = createAudioPreview(cellValue);
|
|
74244
|
+
const closeOverlay = () => {
|
|
74245
|
+
audioPreview.destroy();
|
|
74246
|
+
if (overlay.parentNode) {
|
|
74247
|
+
document.body.removeChild(overlay);
|
|
74248
|
+
}
|
|
74249
|
+
};
|
|
74250
|
+
previewManager.open(closeOverlay);
|
|
73416
74251
|
overlay.addEventListener('click', e => {
|
|
73417
74252
|
if (e.target === overlay) {
|
|
73418
|
-
|
|
74253
|
+
previewManager.close();
|
|
73419
74254
|
}
|
|
73420
74255
|
});
|
|
74256
|
+
overlay.appendChild(audioPreview.element);
|
|
74257
|
+
document.body.appendChild(overlay);
|
|
74258
|
+
}
|
|
74259
|
+
else if (cellType === 'video') {
|
|
74260
|
+
const { clickToPreview } = columnDefine;
|
|
74261
|
+
if (clickToPreview === false) {
|
|
74262
|
+
return;
|
|
74263
|
+
}
|
|
74264
|
+
const previewManager = getMediaPreviewManager(table);
|
|
74265
|
+
const overlay = document.createElement('div');
|
|
74266
|
+
overlay.style.width = '100%';
|
|
74267
|
+
overlay.style.height = '100%';
|
|
74268
|
+
overlay.style.position = 'fixed';
|
|
74269
|
+
overlay.style.top = '0';
|
|
74270
|
+
overlay.style.left = '0';
|
|
74271
|
+
overlay.style.backgroundColor = 'rgba(30, 30, 30, 0.4)';
|
|
74272
|
+
overlay.style.display = 'flex';
|
|
74273
|
+
overlay.style.justifyContent = 'center';
|
|
74274
|
+
overlay.style.alignItems = 'center';
|
|
74275
|
+
overlay.style.overflow = 'hidden';
|
|
74276
|
+
overlay.style.zIndex = '9999';
|
|
73421
74277
|
const video = document.createElement('video');
|
|
73422
74278
|
video.src = cellValue;
|
|
73423
74279
|
video.style.maxWidth = '80%';
|
|
73424
74280
|
video.style.maxHeight = '80%';
|
|
73425
74281
|
video.setAttribute('preload', 'auto');
|
|
73426
74282
|
video.setAttribute('controls', 'true');
|
|
74283
|
+
const closeOverlay = () => {
|
|
74284
|
+
try {
|
|
74285
|
+
video.pause();
|
|
74286
|
+
}
|
|
74287
|
+
catch (err) {
|
|
74288
|
+
}
|
|
74289
|
+
video.removeAttribute('src');
|
|
74290
|
+
try {
|
|
74291
|
+
video.load();
|
|
74292
|
+
}
|
|
74293
|
+
catch (err) {
|
|
74294
|
+
}
|
|
74295
|
+
if (overlay.parentNode) {
|
|
74296
|
+
document.body.removeChild(overlay);
|
|
74297
|
+
}
|
|
74298
|
+
};
|
|
74299
|
+
previewManager.open(closeOverlay);
|
|
73427
74300
|
overlay.appendChild(video);
|
|
74301
|
+
overlay.addEventListener('click', e => {
|
|
74302
|
+
if (e.target === overlay) {
|
|
74303
|
+
previewManager.close();
|
|
74304
|
+
}
|
|
74305
|
+
});
|
|
73428
74306
|
document.body.appendChild(overlay);
|
|
73429
74307
|
}
|
|
73430
74308
|
});
|
|
@@ -77253,6 +78131,9 @@
|
|
|
77253
78131
|
_table;
|
|
77254
78132
|
constructor(_table) {
|
|
77255
78133
|
this._table = _table;
|
|
78134
|
+
this.updateIcons();
|
|
78135
|
+
}
|
|
78136
|
+
updateIcons() {
|
|
77256
78137
|
const regedIcons = get$4();
|
|
77257
78138
|
this.expandIcon = regedIcons[InternalIconName.expandIconName];
|
|
77258
78139
|
this.collapseIcon = regedIcons[InternalIconName.collapseIconName];
|
|
@@ -77314,8 +78195,8 @@
|
|
|
77314
78195
|
case 'text':
|
|
77315
78196
|
return TextStyle;
|
|
77316
78197
|
case 'image':
|
|
77317
|
-
return ImageStyle$1;
|
|
77318
78198
|
case 'video':
|
|
78199
|
+
case 'audio':
|
|
77319
78200
|
return ImageStyle$1;
|
|
77320
78201
|
case 'link':
|
|
77321
78202
|
return TextStyle;
|
|
@@ -78455,6 +79336,9 @@
|
|
|
78455
79336
|
_table;
|
|
78456
79337
|
constructor(_table) {
|
|
78457
79338
|
this._table = _table;
|
|
79339
|
+
this.updateIcons();
|
|
79340
|
+
}
|
|
79341
|
+
updateIcons() {
|
|
78458
79342
|
const regedIcons = get$4();
|
|
78459
79343
|
this.freezeIcon = regedIcons[InternalIconName.freezeIconName];
|
|
78460
79344
|
this.frozenIcon = regedIcons[InternalIconName.frozenIconName];
|
|
@@ -78792,8 +79676,8 @@
|
|
|
78792
79676
|
case 'text':
|
|
78793
79677
|
return TextHeaderStyle;
|
|
78794
79678
|
case 'image':
|
|
78795
|
-
return ImageStyle;
|
|
78796
79679
|
case 'video':
|
|
79680
|
+
case 'audio':
|
|
78797
79681
|
return ImageStyle;
|
|
78798
79682
|
case 'link':
|
|
78799
79683
|
return TextHeaderStyle;
|
|
@@ -79166,6 +80050,9 @@
|
|
|
79166
80050
|
_table;
|
|
79167
80051
|
constructor(_table) {
|
|
79168
80052
|
this._table = _table;
|
|
80053
|
+
this.updateIcons();
|
|
80054
|
+
}
|
|
80055
|
+
updateIcons() {
|
|
79169
80056
|
const regedIcons = get$4();
|
|
79170
80057
|
this.dragReorderIconName = regedIcons[InternalIconName.dragReorderIconName];
|
|
79171
80058
|
}
|
|
@@ -80935,8 +81822,9 @@
|
|
|
80935
81822
|
pluginEventMap = new Map();
|
|
80936
81823
|
constructor(table, options) {
|
|
80937
81824
|
this.table = table;
|
|
80938
|
-
options.plugins?.
|
|
81825
|
+
options.plugins?.forEach(plugin => {
|
|
80939
81826
|
this.register(plugin);
|
|
81827
|
+
plugin.init?.(this.table, options);
|
|
80940
81828
|
this._bindTableEventForPlugin(plugin);
|
|
80941
81829
|
});
|
|
80942
81830
|
}
|
|
@@ -80960,18 +81848,20 @@
|
|
|
80960
81848
|
this.pluginEventMap.set(plugin.id, [...(this.pluginEventMap.get(plugin.id) || []), id]);
|
|
80961
81849
|
});
|
|
80962
81850
|
}
|
|
80963
|
-
removeOrAddPlugins(plugins) {
|
|
81851
|
+
removeOrAddPlugins(plugins, options = this.table.options) {
|
|
80964
81852
|
const removedPlugins = Array.from(this.plugins.values()).filter(plugin => !plugins?.some(p => p.id === plugin.id));
|
|
80965
81853
|
removedPlugins.forEach(plugin => {
|
|
80966
81854
|
this.pluginEventMap.get(plugin.id)?.forEach(id => {
|
|
80967
81855
|
this.table.off(id);
|
|
80968
81856
|
});
|
|
80969
|
-
this.
|
|
81857
|
+
this.pluginEventMap.delete(plugin.id);
|
|
81858
|
+
plugin.release?.(this.table);
|
|
80970
81859
|
this.plugins.delete(plugin.id);
|
|
80971
81860
|
});
|
|
80972
81861
|
const addedPlugins = plugins?.filter(plugin => !this.plugins.has(plugin.id));
|
|
80973
81862
|
addedPlugins?.forEach(plugin => {
|
|
80974
81863
|
this.register(plugin);
|
|
81864
|
+
plugin.init?.(this.table, options);
|
|
80975
81865
|
this._bindTableEventForPlugin(plugin);
|
|
80976
81866
|
});
|
|
80977
81867
|
}
|
|
@@ -80993,6 +81883,9 @@
|
|
|
80993
81883
|
const { isTouchEvent } = event;
|
|
80994
81884
|
const rangeReg = /^\$(\d+)\$(\d+)$/;
|
|
80995
81885
|
importStyle$2();
|
|
81886
|
+
function normalizeCellType(cellType) {
|
|
81887
|
+
return isValid$1(cellType) ? cellType : 'text';
|
|
81888
|
+
}
|
|
80996
81889
|
class BaseTable extends EventTarget$1 {
|
|
80997
81890
|
internalProps;
|
|
80998
81891
|
showFrozenIcon = true;
|
|
@@ -81031,7 +81924,7 @@
|
|
|
81031
81924
|
return TABLE_EVENT_TYPE;
|
|
81032
81925
|
}
|
|
81033
81926
|
options;
|
|
81034
|
-
version = "1.26.
|
|
81927
|
+
version = "1.26.7";
|
|
81035
81928
|
pagination;
|
|
81036
81929
|
id = `VTable${Date.now()}`;
|
|
81037
81930
|
headerStyleCache;
|
|
@@ -81224,7 +82117,7 @@
|
|
|
81224
82117
|
internalProps.focusedTable = false;
|
|
81225
82118
|
internalProps.theme = themes.of(options.theme ?? themes.DEFAULT);
|
|
81226
82119
|
internalProps.theme.isPivot = this.isPivotTable();
|
|
81227
|
-
|
|
82120
|
+
this._updateFunctionalIcons();
|
|
81228
82121
|
if (container) {
|
|
81229
82122
|
if (clearDOM) {
|
|
81230
82123
|
container.innerHTML = '';
|
|
@@ -82859,7 +83752,7 @@
|
|
|
82859
83752
|
internalProps.stick.changedCells.clear();
|
|
82860
83753
|
internalProps.theme = themes.of(options.theme ?? themes.DEFAULT);
|
|
82861
83754
|
internalProps.theme.isPivot = this.isPivotTable();
|
|
82862
|
-
|
|
83755
|
+
this._updateFunctionalIcons();
|
|
82863
83756
|
this.scenegraph.updateStageBackground();
|
|
82864
83757
|
internalProps.autoWrapText = options.autoWrapText;
|
|
82865
83758
|
internalProps.enableLineBreak = options.enableLineBreak;
|
|
@@ -83250,10 +84143,15 @@
|
|
|
83250
84143
|
rowMax = rowMax + moveContext.sourceSize - 1;
|
|
83251
84144
|
}
|
|
83252
84145
|
}
|
|
83253
|
-
if (
|
|
84146
|
+
if (this.isListTable() &&
|
|
84147
|
+
!this.transpose &&
|
|
83254
84148
|
(this.isSeriesNumberInBody(args.source.col, args.source.row) || args.movingColumnOrRow === 'row')) {
|
|
84149
|
+
const listTable = this;
|
|
84150
|
+
const sourceRecordPath = listTable.getRecordIndexByCell(args.source.col, moveContext.sourceIndex);
|
|
84151
|
+
const targetRecordPath = listTable.getRecordIndexByCell(args.target.col, moveContext.targetIndex);
|
|
83255
84152
|
this.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex);
|
|
83256
|
-
this.stateManager.
|
|
84153
|
+
this.stateManager.changeCheckboxOrder(sourceRecordPath, targetRecordPath);
|
|
84154
|
+
this.stateManager.changeRadioOrder(sourceRecordPath, targetRecordPath);
|
|
83257
84155
|
}
|
|
83258
84156
|
if (moveContext.moveType === 'column') {
|
|
83259
84157
|
for (let col = colMin; col <= colMax; col++) {
|
|
@@ -83346,6 +84244,12 @@
|
|
|
83346
84244
|
this.scenegraph.createSceneGraph();
|
|
83347
84245
|
this.render();
|
|
83348
84246
|
}
|
|
84247
|
+
_updateFunctionalIcons() {
|
|
84248
|
+
setIconColor(this.internalProps.theme.functionalIconsStyle);
|
|
84249
|
+
this.internalProps.headerHelper?.updateIcons();
|
|
84250
|
+
this.internalProps.bodyHelper?.updateIcons();
|
|
84251
|
+
this.internalProps.rowSeriesNumberHelper?.updateIcons();
|
|
84252
|
+
}
|
|
83349
84253
|
get theme() {
|
|
83350
84254
|
return this.internalProps.theme;
|
|
83351
84255
|
}
|
|
@@ -83353,13 +84257,13 @@
|
|
|
83353
84257
|
this.internalProps.theme = themes.of(theme ?? themes.DEFAULT);
|
|
83354
84258
|
this.internalProps.theme.isPivot = this.isPivotTable();
|
|
83355
84259
|
this.options.theme = theme;
|
|
83356
|
-
|
|
84260
|
+
this._updateFunctionalIcons();
|
|
83357
84261
|
}
|
|
83358
84262
|
updateTheme(theme) {
|
|
83359
84263
|
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
83360
84264
|
this.internalProps.theme = themes.of(theme ?? themes.DEFAULT);
|
|
83361
84265
|
this.internalProps.theme.isPivot = this.isPivotTable();
|
|
83362
|
-
|
|
84266
|
+
this._updateFunctionalIcons();
|
|
83363
84267
|
this.options.theme = theme;
|
|
83364
84268
|
this.scenegraph.updateComponent();
|
|
83365
84269
|
this.scenegraph.updateStageBackground();
|
|
@@ -83378,13 +84282,13 @@
|
|
|
83378
84282
|
}
|
|
83379
84283
|
getBodyColumnType(col, row) {
|
|
83380
84284
|
const cellType = this.internalProps.layoutMap.getBody(col, row)?.cellType ?? 'text';
|
|
83381
|
-
return getProp('cellType', { cellType }, col, row, this);
|
|
84285
|
+
return normalizeCellType(getProp('cellType', { cellType }, col, row, this));
|
|
83382
84286
|
}
|
|
83383
84287
|
getCellType(col, row) {
|
|
83384
84288
|
let cellType;
|
|
83385
84289
|
if (this.isSeriesNumberInHeader(col, row)) {
|
|
83386
84290
|
const seriesHeaderCellType = this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
|
|
83387
|
-
return seriesHeaderCellType === 'radio' ? 'text' : seriesHeaderCellType;
|
|
84291
|
+
return normalizeCellType(seriesHeaderCellType === 'radio' ? 'text' : seriesHeaderCellType);
|
|
83388
84292
|
}
|
|
83389
84293
|
else if (this.isHeader(col, row)) {
|
|
83390
84294
|
cellType = this.internalProps.layoutMap.getHeader(col, row).headerType;
|
|
@@ -83392,7 +84296,7 @@
|
|
|
83392
84296
|
else {
|
|
83393
84297
|
cellType = this.internalProps.layoutMap.getBody(col, row).cellType;
|
|
83394
84298
|
}
|
|
83395
|
-
return getProp('cellType', { cellType }, col, row, this);
|
|
84299
|
+
return normalizeCellType(getProp('cellType', { cellType }, col, row, this));
|
|
83396
84300
|
}
|
|
83397
84301
|
getHeaderField(col, row) {
|
|
83398
84302
|
return this.internalProps.layoutMap.getHeaderField(col, row);
|
|
@@ -89011,6 +89915,9 @@
|
|
|
89011
89915
|
const { title } = table.internalProps.layoutMap.getSeriesNumberHeader(col, row);
|
|
89012
89916
|
return title;
|
|
89013
89917
|
}
|
|
89918
|
+
if (table.internalProps.layoutMap.isAggregation(col, row)) {
|
|
89919
|
+
return '';
|
|
89920
|
+
}
|
|
89014
89921
|
let value;
|
|
89015
89922
|
if (this.internalProps.groupBy) {
|
|
89016
89923
|
const record = table.getCellRawRecord(col, row);
|
|
@@ -89064,6 +89971,9 @@
|
|
|
89064
89971
|
const { title } = table.internalProps.layoutMap.getSeriesNumberHeader(col, row);
|
|
89065
89972
|
return title;
|
|
89066
89973
|
}
|
|
89974
|
+
if (table.internalProps.layoutMap.isAggregation(col, row)) {
|
|
89975
|
+
return '';
|
|
89976
|
+
}
|
|
89067
89977
|
const { format } = table.internalProps.layoutMap.getSeriesNumberBody(col, row);
|
|
89068
89978
|
return typeof format === 'function' ? format(col, row, this) : row - this.columnHeaderLevelCount;
|
|
89069
89979
|
}
|
|
@@ -89165,7 +90075,7 @@
|
|
|
89165
90075
|
clearRowHeightCache: true
|
|
89166
90076
|
}) {
|
|
89167
90077
|
const internalProps = this.internalProps;
|
|
89168
|
-
this.pluginManager.removeOrAddPlugins(options.plugins);
|
|
90078
|
+
this.pluginManager.removeOrAddPlugins(options.plugins, options);
|
|
89169
90079
|
super.updateOption(options, updateConfig);
|
|
89170
90080
|
internalProps.frozenColDragHeaderMode =
|
|
89171
90081
|
options.dragOrder?.frozenColDragHeaderMode ?? options.frozenColDragHeaderMode;
|
|
@@ -89720,6 +90630,15 @@
|
|
|
89720
90630
|
setCellCheckboxState(col, row, checked) {
|
|
89721
90631
|
setCellCheckboxState(col, row, checked, this);
|
|
89722
90632
|
}
|
|
90633
|
+
setCellCheckboxStateByRecordIndex(recordIndex, field, checked) {
|
|
90634
|
+
setCheckboxStateByRecordIndex(recordIndex, field, checked, this);
|
|
90635
|
+
}
|
|
90636
|
+
clearCheckboxState(field) {
|
|
90637
|
+
clearCheckboxState(field, this);
|
|
90638
|
+
}
|
|
90639
|
+
clearAllCheckboxState(field) {
|
|
90640
|
+
this.clearCheckboxState(field);
|
|
90641
|
+
}
|
|
89723
90642
|
setCellRadioState(col, row, index) {
|
|
89724
90643
|
setCellRadioState(col, row, index, this);
|
|
89725
90644
|
}
|
|
@@ -89750,6 +90669,8 @@
|
|
|
89750
90669
|
}
|
|
89751
90670
|
typeof window !== 'undefined' ? window.performance.now() : 0;
|
|
89752
90671
|
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
90672
|
+
const oldScrollLeft = this.stateManager.scroll.horizontalBarPos;
|
|
90673
|
+
const oldScrollTop = this.stateManager.scroll.verticalBarPos;
|
|
89753
90674
|
this.scenegraph.clearCells();
|
|
89754
90675
|
if (sort !== undefined) {
|
|
89755
90676
|
if (sort === null || (!Array.isArray(sort) && isValid$1(sort.field)) || Array.isArray(sort)) {
|
|
@@ -89782,6 +90703,8 @@
|
|
|
89782
90703
|
}
|
|
89783
90704
|
this.stateManager.initCheckedState(records);
|
|
89784
90705
|
this.clearCellStyleCache();
|
|
90706
|
+
this.stateManager.scroll.horizontalBarPos = 0;
|
|
90707
|
+
this.stateManager.scroll.verticalBarPos = 0;
|
|
89785
90708
|
this.scenegraph.createSceneGraph();
|
|
89786
90709
|
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
89787
90710
|
this._updateSize();
|
|
@@ -89797,6 +90720,12 @@
|
|
|
89797
90720
|
}
|
|
89798
90721
|
});
|
|
89799
90722
|
this.scenegraph.resize();
|
|
90723
|
+
if (oldScrollLeft) {
|
|
90724
|
+
this.stateManager.setScrollLeft(oldScrollLeft, undefined, false);
|
|
90725
|
+
}
|
|
90726
|
+
if (oldScrollTop) {
|
|
90727
|
+
this.stateManager.setScrollTop(oldScrollTop, undefined, false);
|
|
90728
|
+
}
|
|
89800
90729
|
if (this.options.emptyTip) {
|
|
89801
90730
|
if (this.internalProps.emptyTip) {
|
|
89802
90731
|
this.internalProps.emptyTip?.resetVisible();
|
|
@@ -90329,11 +91258,12 @@
|
|
|
90329
91258
|
}
|
|
90330
91259
|
}
|
|
90331
91260
|
updateRecords(records, recordIndexs, triggerEvent = true) {
|
|
90332
|
-
|
|
91261
|
+
const updateRecordIndexs = recordIndexs ?? records?.map((_, index) => index) ?? [];
|
|
91262
|
+
listTableUpdateRecords(records, updateRecordIndexs, this);
|
|
90333
91263
|
if (triggerEvent) {
|
|
90334
91264
|
this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
90335
91265
|
records,
|
|
90336
|
-
recordIndexs,
|
|
91266
|
+
recordIndexs: updateRecordIndexs,
|
|
90337
91267
|
updateCount: records.length
|
|
90338
91268
|
});
|
|
90339
91269
|
}
|
|
@@ -93218,6 +94148,7 @@
|
|
|
93218
94148
|
_table;
|
|
93219
94149
|
_tooltipInstances;
|
|
93220
94150
|
_attachInfo;
|
|
94151
|
+
_pendingInfo;
|
|
93221
94152
|
confine;
|
|
93222
94153
|
constructor(table, confine) {
|
|
93223
94154
|
this._table = table;
|
|
@@ -93226,14 +94157,39 @@
|
|
|
93226
94157
|
this.confine = confine;
|
|
93227
94158
|
}
|
|
93228
94159
|
release() {
|
|
94160
|
+
this._clearPendingBind();
|
|
93229
94161
|
const tooltipInstances = this._tooltipInstances;
|
|
93230
94162
|
for (const k in tooltipInstances) {
|
|
93231
94163
|
tooltipInstances[k]?.release?.();
|
|
93232
94164
|
}
|
|
93233
94165
|
delete this._tooltipInstances;
|
|
93234
94166
|
this._attachInfo = null;
|
|
94167
|
+
this._pendingInfo = null;
|
|
93235
94168
|
}
|
|
93236
94169
|
_bindToCell(col, row, tooltipOptions) {
|
|
94170
|
+
this._clearPendingBind();
|
|
94171
|
+
const appearDelay = tooltipOptions?.appearDelay;
|
|
94172
|
+
if (tooltipOptions && appearDelay && appearDelay > 0) {
|
|
94173
|
+
this._unbindAttachedTooltip();
|
|
94174
|
+
const id = setTimeout(() => {
|
|
94175
|
+
this._pendingInfo = null;
|
|
94176
|
+
this._bindToCellImmediately(col, row, tooltipOptions);
|
|
94177
|
+
}, appearDelay);
|
|
94178
|
+
this._pendingInfo = {
|
|
94179
|
+
id,
|
|
94180
|
+
col,
|
|
94181
|
+
row,
|
|
94182
|
+
tooltipOptions
|
|
94183
|
+
};
|
|
94184
|
+
return;
|
|
94185
|
+
}
|
|
94186
|
+
this._bindToCellImmediately(col, row, tooltipOptions);
|
|
94187
|
+
}
|
|
94188
|
+
_bindToCellImmediately(col, row, tooltipOptions) {
|
|
94189
|
+
if (!tooltipOptions) {
|
|
94190
|
+
this._unbindAttachedTooltip();
|
|
94191
|
+
return;
|
|
94192
|
+
}
|
|
93237
94193
|
const info = this._attachInfo;
|
|
93238
94194
|
const instance = this._getTooltipInstanceInfo(col, row);
|
|
93239
94195
|
if (info && (!instance || info.instance !== instance)) {
|
|
@@ -93249,6 +94205,21 @@
|
|
|
93249
94205
|
this._attachInfo = { range, instance, tooltipOptions };
|
|
93250
94206
|
}
|
|
93251
94207
|
}
|
|
94208
|
+
_clearPendingBind() {
|
|
94209
|
+
if (this._pendingInfo) {
|
|
94210
|
+
clearTimeout(this._pendingInfo.id);
|
|
94211
|
+
this._pendingInfo = null;
|
|
94212
|
+
}
|
|
94213
|
+
}
|
|
94214
|
+
_unbindAttachedTooltip() {
|
|
94215
|
+
const info = this._attachInfo;
|
|
94216
|
+
if (!info) {
|
|
94217
|
+
return;
|
|
94218
|
+
}
|
|
94219
|
+
const { instance } = info;
|
|
94220
|
+
instance?.unbindTooltipElement();
|
|
94221
|
+
this._attachInfo = null;
|
|
94222
|
+
}
|
|
93252
94223
|
_move(col, row, tooltipOptions) {
|
|
93253
94224
|
const info = this._attachInfo;
|
|
93254
94225
|
if (!info || !cellInRange(info.range, col, row)) {
|
|
@@ -93268,15 +94239,13 @@
|
|
|
93268
94239
|
instance?.locateTooltipElement(col, row, position, referencePosition, this.confine);
|
|
93269
94240
|
}
|
|
93270
94241
|
_unbindFromCell() {
|
|
93271
|
-
|
|
93272
|
-
|
|
93273
|
-
return;
|
|
93274
|
-
}
|
|
93275
|
-
const { instance } = info;
|
|
93276
|
-
instance?.unbindTooltipElement();
|
|
93277
|
-
this._attachInfo = null;
|
|
94242
|
+
this._clearPendingBind();
|
|
94243
|
+
this._unbindAttachedTooltip();
|
|
93278
94244
|
}
|
|
93279
94245
|
_isBindCell(col, row) {
|
|
94246
|
+
if (this._pendingInfo && this._pendingInfo.col === col && this._pendingInfo.row === row) {
|
|
94247
|
+
return true;
|
|
94248
|
+
}
|
|
93280
94249
|
const info = this._attachInfo;
|
|
93281
94250
|
if (!info) {
|
|
93282
94251
|
return false;
|
|
@@ -93389,7 +94358,8 @@
|
|
|
93389
94358
|
return instance;
|
|
93390
94359
|
}
|
|
93391
94360
|
isBinded(tooltipOptions) {
|
|
93392
|
-
if (JSON.stringify(tooltipOptions) === JSON.stringify(this._attachInfo?.tooltipOptions)
|
|
94361
|
+
if (JSON.stringify(tooltipOptions) === JSON.stringify(this._attachInfo?.tooltipOptions) ||
|
|
94362
|
+
JSON.stringify(tooltipOptions) === JSON.stringify(this._pendingInfo?.tooltipOptions)) {
|
|
93393
94363
|
return true;
|
|
93394
94364
|
}
|
|
93395
94365
|
return false;
|
|
@@ -93754,7 +94724,7 @@
|
|
|
93754
94724
|
}
|
|
93755
94725
|
}
|
|
93756
94726
|
cellGroup.AABBBounds.width();
|
|
93757
|
-
if ((isNoChartDataRenderNothing && Array.isArray(
|
|
94727
|
+
if ((isNoChartDataRenderNothing && Array.isArray(dataValue)) || !isNoChartDataRenderNothing) {
|
|
93758
94728
|
const chartGroup = new Chart(isShareChartSpec, {
|
|
93759
94729
|
stroke: false,
|
|
93760
94730
|
x: padding[3],
|
|
@@ -93768,7 +94738,7 @@
|
|
|
93768
94738
|
height: height - padding[2] - padding[0],
|
|
93769
94739
|
chartInstance,
|
|
93770
94740
|
dataId,
|
|
93771
|
-
data:
|
|
94741
|
+
data: dataValue || [],
|
|
93772
94742
|
cellPadding: padding,
|
|
93773
94743
|
dpr: table.internalProps.pixelRatio,
|
|
93774
94744
|
detectPickChartItem: table.options.customConfig?.detectPickChartItem,
|
|
@@ -93931,7 +94901,8 @@
|
|
|
93931
94901
|
}
|
|
93932
94902
|
}
|
|
93933
94903
|
|
|
93934
|
-
function createCheckboxCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, isCheckboxTree) {
|
|
94904
|
+
function createCheckboxCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, isCheckboxTree, cellValue) {
|
|
94905
|
+
const value = arguments.length >= 20 ? cellValue : table.getCellValue(col, row);
|
|
93935
94906
|
if (!cellGroup) {
|
|
93936
94907
|
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
93937
94908
|
if (isAsync) {
|
|
@@ -94023,7 +94994,7 @@
|
|
|
94023
94994
|
}
|
|
94024
94995
|
});
|
|
94025
94996
|
}
|
|
94026
|
-
const checkboxComponent = createCheckbox(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table, isCheckboxTree);
|
|
94997
|
+
const checkboxComponent = createCheckbox(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table, isCheckboxTree, value);
|
|
94027
94998
|
if (cellContentLeftIcons.length === 1 &&
|
|
94028
94999
|
(cellContentLeftIcons[0].name === InternalIconName.expandIconName ||
|
|
94029
95000
|
cellContentLeftIcons[0].name === InternalIconName.collapseIconName)) {
|
|
@@ -94128,7 +95099,7 @@
|
|
|
94128
95099
|
}
|
|
94129
95100
|
return cellGroup;
|
|
94130
95101
|
}
|
|
94131
|
-
function createCheckbox(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table, isCheckboxTree) {
|
|
95102
|
+
function createCheckbox(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table, isCheckboxTree, cellValue) {
|
|
94132
95103
|
const style = table._getCellStyle(col, row);
|
|
94133
95104
|
const size = getProp('size', style, col, row, table);
|
|
94134
95105
|
const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', style, col, row, table);
|
|
@@ -94141,7 +95112,7 @@
|
|
|
94141
95112
|
const disableCheckedStroke = getProp('disableCheckedStroke', style, col, row, table);
|
|
94142
95113
|
const checkIconImage = getProp('checkIconImage', style, col, row, table);
|
|
94143
95114
|
const indeterminateIconImage = getProp('indeterminateIconImage', style, col, row, table);
|
|
94144
|
-
const value =
|
|
95115
|
+
const value = cellValue;
|
|
94145
95116
|
const dataValue = table.getCellOriginValue(col, row);
|
|
94146
95117
|
let isChecked;
|
|
94147
95118
|
let isDisabled;
|
|
@@ -94249,31 +95220,55 @@
|
|
|
94249
95220
|
return checkbox;
|
|
94250
95221
|
}
|
|
94251
95222
|
|
|
94252
|
-
function createRadioCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, table, cellTheme, define, range) {
|
|
95223
|
+
function createRadioCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, table, cellTheme, define, range, isAsync, cellValue) {
|
|
95224
|
+
const value = arguments.length >= 18 ? cellValue : table.getCellValue(col, row);
|
|
94253
95225
|
if (!cellGroup) {
|
|
94254
95226
|
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
94255
|
-
|
|
94256
|
-
|
|
94257
|
-
|
|
94258
|
-
|
|
94259
|
-
|
|
94260
|
-
|
|
94261
|
-
|
|
94262
|
-
|
|
94263
|
-
|
|
94264
|
-
|
|
94265
|
-
|
|
94266
|
-
|
|
94267
|
-
|
|
94268
|
-
|
|
94269
|
-
|
|
94270
|
-
|
|
94271
|
-
|
|
94272
|
-
|
|
94273
|
-
|
|
94274
|
-
|
|
95227
|
+
if (isAsync) {
|
|
95228
|
+
cellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);
|
|
95229
|
+
if (cellGroup && cellGroup.role === 'cell') {
|
|
95230
|
+
cellGroup.setAttributes({
|
|
95231
|
+
x: xOrigin,
|
|
95232
|
+
y: yOrigin,
|
|
95233
|
+
width,
|
|
95234
|
+
height,
|
|
95235
|
+
lineWidth: cellTheme?.group?.lineWidth ?? undefined,
|
|
95236
|
+
fill: cellTheme?.group?.fill ?? undefined,
|
|
95237
|
+
stroke: cellTheme?.group?.stroke ?? undefined,
|
|
95238
|
+
strokeArrayWidth: strokeArrayWidth,
|
|
95239
|
+
strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
|
|
95240
|
+
cursor: cellTheme?.group?.cursor ?? undefined,
|
|
95241
|
+
lineDash: cellTheme?.group?.lineDash ?? undefined,
|
|
95242
|
+
lineCap: 'butt',
|
|
95243
|
+
clip: true,
|
|
95244
|
+
cornerRadius: cellTheme.group.cornerRadius
|
|
95245
|
+
});
|
|
95246
|
+
}
|
|
95247
|
+
}
|
|
95248
|
+
if (!cellGroup || cellGroup.role !== 'cell') {
|
|
95249
|
+
cellGroup = new Group$1({
|
|
95250
|
+
x: xOrigin,
|
|
95251
|
+
y: yOrigin,
|
|
95252
|
+
width,
|
|
95253
|
+
height,
|
|
95254
|
+
lineWidth: cellTheme?.group?.lineWidth ?? undefined,
|
|
95255
|
+
fill: cellTheme?.group?.fill ?? undefined,
|
|
95256
|
+
stroke: cellTheme?.group?.stroke ?? undefined,
|
|
95257
|
+
strokeArrayWidth: strokeArrayWidth,
|
|
95258
|
+
strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
|
|
95259
|
+
cursor: cellTheme?.group?.cursor ?? undefined,
|
|
95260
|
+
lineDash: cellTheme?.group?.lineDash ?? undefined,
|
|
95261
|
+
lineCap: 'butt',
|
|
95262
|
+
clip: true,
|
|
95263
|
+
cornerRadius: cellTheme.group.cornerRadius
|
|
95264
|
+
});
|
|
95265
|
+
cellGroup.role = 'cell';
|
|
95266
|
+
cellGroup.col = col;
|
|
95267
|
+
cellGroup.row = row;
|
|
95268
|
+
cellGroup = columnGroup?.addCellGroup(cellGroup) ?? cellGroup;
|
|
95269
|
+
}
|
|
94275
95270
|
}
|
|
94276
|
-
const { width: radioWidth, height: radioHeight } = createRadio(col, row, colWidth, width, height, padding, cellTheme, define, cellGroup, range, table);
|
|
95271
|
+
const { width: radioWidth, height: radioHeight } = createRadio(col, row, colWidth, width, height, padding, cellTheme, define, cellGroup, range, table, value);
|
|
94277
95272
|
width -= padding[1] + padding[3];
|
|
94278
95273
|
height -= padding[0] + padding[2];
|
|
94279
95274
|
cellGroup.forEachChildren((radioComponent) => {
|
|
@@ -94298,7 +95293,7 @@
|
|
|
94298
95293
|
});
|
|
94299
95294
|
return cellGroup;
|
|
94300
95295
|
}
|
|
94301
|
-
function createRadio(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, cellGroup, range, table) {
|
|
95296
|
+
function createRadio(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, cellGroup, range, table, cellValue) {
|
|
94302
95297
|
const style = table._getCellStyle(col, row);
|
|
94303
95298
|
let size = getProp('size', style, col, row, table);
|
|
94304
95299
|
let innerRadius = getProp('innerRadius', style, col, row, table);
|
|
@@ -94321,7 +95316,7 @@
|
|
|
94321
95316
|
if (!isNumber$3(innerRadius) || innerRadius < 0) {
|
|
94322
95317
|
innerRadius = Math.round((outerRadius / 7) * 3);
|
|
94323
95318
|
}
|
|
94324
|
-
const value =
|
|
95319
|
+
const value = cellValue;
|
|
94325
95320
|
const dataValue = table.getCellOriginValue(col, row);
|
|
94326
95321
|
const hierarchyOffset = getHierarchyOffset(col, row, table);
|
|
94327
95322
|
const cellStyle = table._getCellStyle(col, row);
|
|
@@ -94454,7 +95449,8 @@
|
|
|
94454
95449
|
return isDisabled ?? globalDisable ?? false;
|
|
94455
95450
|
}
|
|
94456
95451
|
|
|
94457
|
-
function createSwitchCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync) {
|
|
95452
|
+
function createSwitchCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, cellValue) {
|
|
95453
|
+
const value = arguments.length >= 19 ? cellValue : table.getCellValue(col, row);
|
|
94458
95454
|
if (!cellGroup) {
|
|
94459
95455
|
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
94460
95456
|
if (isAsync) {
|
|
@@ -94540,7 +95536,7 @@
|
|
|
94540
95536
|
}
|
|
94541
95537
|
});
|
|
94542
95538
|
}
|
|
94543
|
-
const switchComponent = createSwitch(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table);
|
|
95539
|
+
const switchComponent = createSwitch(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table, value);
|
|
94544
95540
|
if (switchComponent) {
|
|
94545
95541
|
cellGroup.appendChild(switchComponent);
|
|
94546
95542
|
}
|
|
@@ -94567,7 +95563,7 @@
|
|
|
94567
95563
|
}
|
|
94568
95564
|
return cellGroup;
|
|
94569
95565
|
}
|
|
94570
|
-
function createSwitch(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table) {
|
|
95566
|
+
function createSwitch(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table, cellValue) {
|
|
94571
95567
|
const style = table._getCellStyle(col, row);
|
|
94572
95568
|
const spaceBetweenTextAndCircle = getProp('spaceBetweenTextAndCircle', style, col, row, table);
|
|
94573
95569
|
const circleRadius = getProp('circleRadius', style, col, row, table);
|
|
@@ -94578,7 +95574,7 @@
|
|
|
94578
95574
|
const disableCheckedFill = getProp('disableCheckedFill', style, col, row, table);
|
|
94579
95575
|
const disableUncheckedFill = getProp('disableUncheckedFill', style, col, row, table);
|
|
94580
95576
|
const circleFill = getProp('circleFill', style, col, row, table);
|
|
94581
|
-
const value =
|
|
95577
|
+
const value = cellValue;
|
|
94582
95578
|
const dataValue = table.getCellOriginValue(col, row);
|
|
94583
95579
|
let isChecked;
|
|
94584
95580
|
let isDisabled;
|
|
@@ -94680,7 +95676,8 @@
|
|
|
94680
95676
|
|
|
94681
95677
|
const xScale = new PointScale();
|
|
94682
95678
|
const yScale = new LinearScale();
|
|
94683
|
-
function createSparkLineCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, width, height, padding, table, cellTheme, isAsync) {
|
|
95679
|
+
function createSparkLineCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, width, height, padding, table, cellTheme, isAsync, cellValue) {
|
|
95680
|
+
const value = arguments.length >= 13 ? cellValue : table.getCellValue(col, row);
|
|
94684
95681
|
if (!cellGroup) {
|
|
94685
95682
|
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
94686
95683
|
if (isAsync) {
|
|
@@ -94727,17 +95724,17 @@
|
|
|
94727
95724
|
cellGroup = columnGroup?.addCellGroup(cellGroup) ?? cellGroup;
|
|
94728
95725
|
}
|
|
94729
95726
|
}
|
|
94730
|
-
const chartGroup = createSparkLine(col, row, width, height, padding, table);
|
|
95727
|
+
const chartGroup = createSparkLine(col, row, width, height, padding, table, value);
|
|
94731
95728
|
if (chartGroup) {
|
|
94732
95729
|
cellGroup.appendChild(chartGroup);
|
|
94733
95730
|
}
|
|
94734
95731
|
return cellGroup;
|
|
94735
95732
|
}
|
|
94736
|
-
function createSparkLine(col, row, width, height, padding, table) {
|
|
95733
|
+
function createSparkLine(col, row, width, height, padding, table, cellValue) {
|
|
94737
95734
|
let sparklineSpec;
|
|
94738
95735
|
let chartGroup;
|
|
94739
95736
|
const chartSpecRaw = table.internalProps.layoutMap.getBody(col, row).sparklineSpec;
|
|
94740
|
-
const dataValue =
|
|
95737
|
+
const dataValue = cellValue;
|
|
94741
95738
|
if (!Array.isArray(dataValue)) {
|
|
94742
95739
|
return undefined;
|
|
94743
95740
|
}
|
|
@@ -94752,7 +95749,7 @@
|
|
|
94752
95749
|
col,
|
|
94753
95750
|
row,
|
|
94754
95751
|
dataValue: table.getCellOriginValue(col, row) || '',
|
|
94755
|
-
value:
|
|
95752
|
+
value: dataValue || '',
|
|
94756
95753
|
rect: table.getCellRangeRelativeRect(table.getCellRange(col, row)),
|
|
94757
95754
|
table
|
|
94758
95755
|
};
|
|
@@ -94944,18 +95941,146 @@
|
|
|
94944
95941
|
return numbers;
|
|
94945
95942
|
}
|
|
94946
95943
|
|
|
94947
|
-
const
|
|
94948
|
-
function
|
|
94949
|
-
|
|
94950
|
-
|
|
95944
|
+
const audioIconSvg = '<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="42" height="42" rx="10" fill="#F8FAFF" fill-opacity="0.92"/><rect x="3.75" y="3.75" width="40.5" height="40.5" rx="9.25" stroke="#1D4ED8" stroke-opacity="0.22" stroke-width="1.5"/><path d="M16 30H12C10.8954 30 10 29.1046 10 28V20C10 18.8954 10.8954 18 12 18H16L26 10V38L16 30Z" fill="#EAF1FF" stroke="#0F172A" stroke-opacity="0.24" stroke-width="5.5" stroke-linejoin="round"/><path d="M31.5 18.5C33.3 21.3 33.3 26.7 31.5 29.5" stroke="#0F172A" stroke-opacity="0.24" stroke-width="5.5" stroke-linecap="round"/><path d="M36 15C39.2 20.4 39.2 27.6 36 33" stroke="#0F172A" stroke-opacity="0.24" stroke-width="5.5" stroke-linecap="round"/><path d="M16 30H12C10.8954 30 10 29.1046 10 28V20C10 18.8954 10.8954 18 12 18H16L26 10V38L16 30Z" fill="#EAF1FF" stroke="#2563EB" stroke-width="3.2" stroke-linejoin="round"/><path d="M31.5 18.5C33.3 21.3 33.3 26.7 31.5 29.5" stroke="#2563EB" stroke-width="3.2" stroke-linecap="round"/><path d="M36 15C39.2 20.4 39.2 27.6 36 33" stroke="#2563EB" stroke-width="3.2" stroke-linecap="round"/></svg>';
|
|
95945
|
+
function createAudioCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync, _cellValue) {
|
|
95946
|
+
const headerStyle = table._getCellStyle(col, row);
|
|
95947
|
+
const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
|
|
95948
|
+
if (table.options.customConfig?.imageMargin) {
|
|
95949
|
+
padding = getQuadProps(table.options.customConfig?.imageMargin);
|
|
94951
95950
|
}
|
|
94952
|
-
|
|
95951
|
+
else if (isValid$1(functionalPadding)) {
|
|
95952
|
+
padding = functionalPadding;
|
|
94953
95953
|
}
|
|
94954
|
-
|
|
94955
|
-
|
|
94956
|
-
video.load();
|
|
95954
|
+
if (cellTheme?.text?.textAlign) {
|
|
95955
|
+
textAlign = cellTheme.text.textAlign;
|
|
94957
95956
|
}
|
|
94958
|
-
|
|
95957
|
+
if (cellTheme?.text?.textBaseline) {
|
|
95958
|
+
textBaseline = cellTheme.text.textBaseline;
|
|
95959
|
+
}
|
|
95960
|
+
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
95961
|
+
let cellGroup;
|
|
95962
|
+
if (isAsync) {
|
|
95963
|
+
cellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);
|
|
95964
|
+
if (cellGroup && cellGroup.role === 'cell') {
|
|
95965
|
+
cellGroup.setAttributes({
|
|
95966
|
+
x: xOrigin,
|
|
95967
|
+
y: yOrigin,
|
|
95968
|
+
width,
|
|
95969
|
+
height,
|
|
95970
|
+
lineWidth: cellTheme?.group?.lineWidth ?? undefined,
|
|
95971
|
+
fill: cellTheme?.group?.fill ?? undefined,
|
|
95972
|
+
stroke: cellTheme?.group?.stroke ?? undefined,
|
|
95973
|
+
strokeArrayWidth,
|
|
95974
|
+
strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
|
|
95975
|
+
cursor: cellTheme?.group?.cursor ?? undefined,
|
|
95976
|
+
lineDash: cellTheme?.group?.lineDash ?? undefined,
|
|
95977
|
+
lineCap: 'butt',
|
|
95978
|
+
clip: true,
|
|
95979
|
+
cornerRadius: cellTheme.group.cornerRadius
|
|
95980
|
+
});
|
|
95981
|
+
}
|
|
95982
|
+
}
|
|
95983
|
+
if (!cellGroup || cellGroup.role !== 'cell') {
|
|
95984
|
+
cellGroup = new Group$1({
|
|
95985
|
+
x: xOrigin,
|
|
95986
|
+
y: yOrigin,
|
|
95987
|
+
width,
|
|
95988
|
+
height,
|
|
95989
|
+
lineWidth: cellTheme?.group?.lineWidth ?? undefined,
|
|
95990
|
+
fill: cellTheme?.group?.fill ?? undefined,
|
|
95991
|
+
stroke: cellTheme?.group?.stroke ?? undefined,
|
|
95992
|
+
strokeArrayWidth,
|
|
95993
|
+
strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
|
|
95994
|
+
cursor: cellTheme?.group?.cursor ?? undefined,
|
|
95995
|
+
lineDash: cellTheme?.group?.lineDash ?? undefined,
|
|
95996
|
+
lineCap: 'butt',
|
|
95997
|
+
clip: true,
|
|
95998
|
+
cornerRadius: cellTheme.group.cornerRadius
|
|
95999
|
+
});
|
|
96000
|
+
cellGroup.role = 'cell';
|
|
96001
|
+
cellGroup.col = col;
|
|
96002
|
+
cellGroup.row = row;
|
|
96003
|
+
cellGroup = columnGroup?.addCellGroup(cellGroup) ?? cellGroup;
|
|
96004
|
+
}
|
|
96005
|
+
let cellIcons;
|
|
96006
|
+
if (mayHaveIcon) {
|
|
96007
|
+
let iconCol = col;
|
|
96008
|
+
let iconRow = row;
|
|
96009
|
+
if (range) {
|
|
96010
|
+
iconCol = range.start.col;
|
|
96011
|
+
iconRow = range.start.row;
|
|
96012
|
+
}
|
|
96013
|
+
cellIcons = table.getCellIcons(iconCol, iconRow);
|
|
96014
|
+
}
|
|
96015
|
+
let cellLeftIconWidth = 0;
|
|
96016
|
+
let cellRightIconWidth = 0;
|
|
96017
|
+
if (Array.isArray(cellIcons) && cellIcons.length !== 0) {
|
|
96018
|
+
const { leftIconWidth, rightIconWidth, absoluteRightIconWidth } = dealWithIconLayout(cellIcons, cellGroup, range, table);
|
|
96019
|
+
cellLeftIconWidth = leftIconWidth;
|
|
96020
|
+
cellRightIconWidth = rightIconWidth;
|
|
96021
|
+
cellGroup.forEachChildren((child) => {
|
|
96022
|
+
if (child.role === 'icon-left') {
|
|
96023
|
+
child.setAttribute('x', child.attribute.x + padding[3]);
|
|
96024
|
+
}
|
|
96025
|
+
else if (child.role === 'icon-right') {
|
|
96026
|
+
child.setAttribute('x', child.attribute.x + width - rightIconWidth - padding[1]);
|
|
96027
|
+
}
|
|
96028
|
+
else if (child.role === 'icon-absolute-right') {
|
|
96029
|
+
child.setAttribute('x', child.attribute.x + width - absoluteRightIconWidth - padding[1]);
|
|
96030
|
+
}
|
|
96031
|
+
});
|
|
96032
|
+
cellGroup.forEachChildren((child) => {
|
|
96033
|
+
if (textBaseline === 'middle') {
|
|
96034
|
+
child.setAttribute('y', (height - child.AABBBounds.height()) / 2);
|
|
96035
|
+
}
|
|
96036
|
+
else if (textBaseline === 'bottom') {
|
|
96037
|
+
child.setAttribute('y', height - child.AABBBounds.height() - padding[2]);
|
|
96038
|
+
}
|
|
96039
|
+
else {
|
|
96040
|
+
child.setAttribute('y', padding[0]);
|
|
96041
|
+
}
|
|
96042
|
+
});
|
|
96043
|
+
}
|
|
96044
|
+
cellGroup._cellLeftIconWidth = cellLeftIconWidth;
|
|
96045
|
+
cellGroup._cellRightIconWidth = cellRightIconWidth;
|
|
96046
|
+
const availableWidth = Math.max(1, width - padding[1] - padding[3] - cellLeftIconWidth - cellRightIconWidth);
|
|
96047
|
+
const availableHeight = Math.max(1, height - padding[0] - padding[2]);
|
|
96048
|
+
const iconSize = Math.max(1, Math.min(availableWidth, availableHeight, 32));
|
|
96049
|
+
const pos = calcStartPosition(cellLeftIconWidth, 0, width - cellLeftIconWidth - cellRightIconWidth, height, iconSize, iconSize, textAlign, textBaseline, padding);
|
|
96050
|
+
removeCellMediaChildren(cellGroup);
|
|
96051
|
+
const image = markCellMedia(createImage({
|
|
96052
|
+
x: pos.x,
|
|
96053
|
+
y: pos.y,
|
|
96054
|
+
width: iconSize,
|
|
96055
|
+
height: iconSize,
|
|
96056
|
+
image: audioIconSvg,
|
|
96057
|
+
cursor: 'pointer'
|
|
96058
|
+
}), 'image');
|
|
96059
|
+
image.name = 'image';
|
|
96060
|
+
image.keepAspectRatio = true;
|
|
96061
|
+
image.isAudioIcon = true;
|
|
96062
|
+
image.textAlign = textAlign;
|
|
96063
|
+
image.textBaseline = textBaseline;
|
|
96064
|
+
cellGroup.appendChild(image);
|
|
96065
|
+
return cellGroup;
|
|
96066
|
+
}
|
|
96067
|
+
|
|
96068
|
+
const regedIcons = get$4();
|
|
96069
|
+
function updateVideoMediaDxDy(startCol, endCol, startRow, endRow, table) {
|
|
96070
|
+
for (let col = startCol; col <= endCol; col++) {
|
|
96071
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
96072
|
+
const cellGroup = table.scenegraph.getCell(col, row);
|
|
96073
|
+
if (cellGroup) {
|
|
96074
|
+
cellGroup.forEachChildren((child) => {
|
|
96075
|
+
if (isCellMedia(child)) {
|
|
96076
|
+
child.setAttributes({
|
|
96077
|
+
dx: -table.getColsWidth(cellGroup.mergeStartCol, col - 1),
|
|
96078
|
+
dy: -table.getRowsHeight(cellGroup.mergeStartRow, row - 1)
|
|
96079
|
+
});
|
|
96080
|
+
}
|
|
96081
|
+
});
|
|
96082
|
+
}
|
|
96083
|
+
}
|
|
94959
96084
|
}
|
|
94960
96085
|
}
|
|
94961
96086
|
function getVideoFirstFrameTimeout(table) {
|
|
@@ -94969,7 +96094,9 @@
|
|
|
94969
96094
|
function snapshotVideoFirstFrame(video, image, table) {
|
|
94970
96095
|
const displayWidth = image.attribute.width;
|
|
94971
96096
|
const displayHeight = image.attribute.height;
|
|
94972
|
-
if (
|
|
96097
|
+
if (video.videoWidth <= 0 ||
|
|
96098
|
+
video.videoHeight <= 0 ||
|
|
96099
|
+
typeof displayWidth !== 'number' ||
|
|
94973
96100
|
typeof displayHeight !== 'number' ||
|
|
94974
96101
|
displayWidth <= 0 ||
|
|
94975
96102
|
displayHeight <= 0) {
|
|
@@ -95016,7 +96143,7 @@
|
|
|
95016
96143
|
}
|
|
95017
96144
|
return undefined;
|
|
95018
96145
|
}
|
|
95019
|
-
function createVideoCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync) {
|
|
96146
|
+
function createVideoCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync, cellValue) {
|
|
95020
96147
|
const headerStyle = table._getCellStyle(col, row);
|
|
95021
96148
|
const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
|
|
95022
96149
|
if (table.options.customConfig?.imageMargin) {
|
|
@@ -95114,10 +96241,32 @@
|
|
|
95114
96241
|
child.setAttribute('y', padding[0]);
|
|
95115
96242
|
}
|
|
95116
96243
|
});
|
|
95117
|
-
cellGroup._cellLeftIconWidth = cellLeftIconWidth;
|
|
95118
|
-
cellGroup._cellRightIconWidth = cellRightIconWidth;
|
|
95119
96244
|
}
|
|
95120
|
-
|
|
96245
|
+
cellGroup._cellLeftIconWidth = cellLeftIconWidth;
|
|
96246
|
+
cellGroup._cellRightIconWidth = cellRightIconWidth;
|
|
96247
|
+
const value = arguments.length >= 18 ? cellValue : table.getCellValue(col, row);
|
|
96248
|
+
removeCellMediaChildren(cellGroup);
|
|
96249
|
+
if (isAudioUrl(value)) {
|
|
96250
|
+
const availableWidth = Math.max(1, width - padding[1] - padding[3] - cellLeftIconWidth - cellRightIconWidth);
|
|
96251
|
+
const availableHeight = Math.max(1, height - padding[0] - padding[2]);
|
|
96252
|
+
const iconSize = Math.max(1, Math.min(availableWidth, availableHeight, 32));
|
|
96253
|
+
const pos = calcStartPosition(cellLeftIconWidth, 0, width - cellLeftIconWidth - cellRightIconWidth, height, iconSize, iconSize, textAlign, textBaseline, padding);
|
|
96254
|
+
const image = markCellMedia(createImage({
|
|
96255
|
+
x: pos.x,
|
|
96256
|
+
y: pos.y,
|
|
96257
|
+
width: iconSize,
|
|
96258
|
+
height: iconSize,
|
|
96259
|
+
image: audioIconSvg,
|
|
96260
|
+
cursor: 'pointer'
|
|
96261
|
+
}), 'image');
|
|
96262
|
+
image.name = 'image';
|
|
96263
|
+
image.keepAspectRatio = true;
|
|
96264
|
+
image.isAudioIcon = true;
|
|
96265
|
+
image.textAlign = textAlign;
|
|
96266
|
+
image.textBaseline = textBaseline;
|
|
96267
|
+
cellGroup.appendChild(image);
|
|
96268
|
+
return cellGroup;
|
|
96269
|
+
}
|
|
95121
96270
|
const video = document.createElement('video');
|
|
95122
96271
|
video.muted = true;
|
|
95123
96272
|
video.playsInline = true;
|
|
@@ -95138,7 +96287,7 @@
|
|
|
95138
96287
|
clearVideoLoadTimer();
|
|
95139
96288
|
releaseVideoResource(video);
|
|
95140
96289
|
};
|
|
95141
|
-
const isCurrentImage = () => cellGroup
|
|
96290
|
+
const isCurrentImage = () => getCellMediaImage(cellGroup) === image;
|
|
95142
96291
|
const setVideoDamageImage = () => {
|
|
95143
96292
|
const regedIcons = get$4();
|
|
95144
96293
|
const damageIcon = regedIcons.video_damage_pic || regedIcons.damage_pic;
|
|
@@ -95163,7 +96312,7 @@
|
|
|
95163
96312
|
height: imageHeight
|
|
95164
96313
|
});
|
|
95165
96314
|
if (isMerge) {
|
|
95166
|
-
|
|
96315
|
+
updateVideoMediaDxDy(cellGroup.mergeStartCol, cellGroup.mergeEndCol, cellGroup.mergeStartRow, cellGroup.mergeEndRow, table);
|
|
95167
96316
|
}
|
|
95168
96317
|
}
|
|
95169
96318
|
};
|
|
@@ -95192,6 +96341,10 @@
|
|
|
95192
96341
|
if (!scenegraph) {
|
|
95193
96342
|
return;
|
|
95194
96343
|
}
|
|
96344
|
+
if (video.videoWidth <= 0 || video.videoHeight <= 0) {
|
|
96345
|
+
handleVideoLoadFail();
|
|
96346
|
+
return;
|
|
96347
|
+
}
|
|
95195
96348
|
if (imageAutoSizing) {
|
|
95196
96349
|
_adjustWidthHeight(col, row, video.videoWidth, video.videoHeight, scenegraph, padding, cellGroup);
|
|
95197
96350
|
}
|
|
@@ -95217,7 +96370,7 @@
|
|
|
95217
96370
|
});
|
|
95218
96371
|
}
|
|
95219
96372
|
if (isMerge) {
|
|
95220
|
-
|
|
96373
|
+
updateVideoMediaDxDy(cellGroup.mergeStartCol, cellGroup.mergeEndCol, cellGroup.mergeStartRow, cellGroup.mergeEndRow, table);
|
|
95221
96374
|
}
|
|
95222
96375
|
const left = 0;
|
|
95223
96376
|
const top = 0;
|
|
@@ -95225,8 +96378,7 @@
|
|
|
95225
96378
|
const iconSize = Math.floor(Math.min(width - padding[1] - padding[3], height - padding[2] - padding[0]) / 2);
|
|
95226
96379
|
const anchorX = left + (width > image.attribute.width ? image.attribute.x - left + image.attribute.width / 2 : width / 2);
|
|
95227
96380
|
const anchorY = top + (height > image.attribute.height ? image.attribute.y - top + image.attribute.height / 2 : height / 2);
|
|
95228
|
-
const
|
|
95229
|
-
const { dx, dy } = imageGraphic.attribute;
|
|
96381
|
+
const { dx, dy } = image.attribute;
|
|
95230
96382
|
const playIcon = new Icon$1({
|
|
95231
96383
|
x: anchorX - iconSize / 2,
|
|
95232
96384
|
y: anchorY - iconSize / 2,
|
|
@@ -95237,6 +96389,7 @@
|
|
|
95237
96389
|
dx,
|
|
95238
96390
|
dy
|
|
95239
96391
|
});
|
|
96392
|
+
markCellMedia(playIcon, 'play-icon');
|
|
95240
96393
|
playIcon.name = 'play-icon';
|
|
95241
96394
|
cellGroup.appendChild(playIcon);
|
|
95242
96395
|
if (shouldSnapshot && snapshotVideoFirstFrame(video, image, table)) {
|
|
@@ -95246,14 +96399,14 @@
|
|
|
95246
96399
|
});
|
|
95247
96400
|
video.addEventListener('error', handleVideoLoadFail);
|
|
95248
96401
|
video.addEventListener('abort', handleVideoLoadFail);
|
|
95249
|
-
const image = createImage({
|
|
96402
|
+
const image = markCellMedia(createImage({
|
|
95250
96403
|
x: padding[3],
|
|
95251
96404
|
y: padding[0],
|
|
95252
|
-
width: width - padding[1] - padding[3],
|
|
95253
|
-
height: height - padding[2] - padding[0],
|
|
96405
|
+
width: Math.max(1, width - padding[1] - padding[3]),
|
|
96406
|
+
height: Math.max(1, height - padding[2] - padding[0]),
|
|
95254
96407
|
image: video,
|
|
95255
96408
|
cursor: 'pointer'
|
|
95256
|
-
});
|
|
96409
|
+
}), 'image');
|
|
95257
96410
|
image.name = 'image';
|
|
95258
96411
|
image.keepAspectRatio = keepAspectRatio;
|
|
95259
96412
|
image.textAlign = textAlign;
|
|
@@ -96086,7 +97239,8 @@
|
|
|
96086
97239
|
scale.niceMax(target.targetTicks.length);
|
|
96087
97240
|
}
|
|
96088
97241
|
|
|
96089
|
-
function createButtonCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync) {
|
|
97242
|
+
function createButtonCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, cellValue) {
|
|
97243
|
+
const value = arguments.length >= 19 ? cellValue : table.getCellValue(col, row);
|
|
96090
97244
|
if (!cellGroup) {
|
|
96091
97245
|
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
96092
97246
|
if (isAsync) {
|
|
@@ -96172,7 +97326,7 @@
|
|
|
96172
97326
|
}
|
|
96173
97327
|
});
|
|
96174
97328
|
}
|
|
96175
|
-
const buttonComponent = createButton(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table);
|
|
97329
|
+
const buttonComponent = createButton(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table, value);
|
|
96176
97330
|
if (buttonComponent) {
|
|
96177
97331
|
cellGroup.appendChild(buttonComponent);
|
|
96178
97332
|
}
|
|
@@ -96198,7 +97352,7 @@
|
|
|
96198
97352
|
}
|
|
96199
97353
|
return cellGroup;
|
|
96200
97354
|
}
|
|
96201
|
-
function createButton(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table) {
|
|
97355
|
+
function createButton(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table, cellValue) {
|
|
96202
97356
|
const style = table._getCellStyle(col, row);
|
|
96203
97357
|
const buttonColor = getProp('buttonColor', style, col, row, table);
|
|
96204
97358
|
const buttonBorderColor = getProp('buttonBorderColor', style, col, row, table);
|
|
@@ -96211,7 +97365,7 @@
|
|
|
96211
97365
|
const buttonDisableColor = getProp('buttonDisableColor', style, col, row, table);
|
|
96212
97366
|
const buttonDisableBorderColor = getProp('buttonDisableBorderColor', style, col, row, table);
|
|
96213
97367
|
const buttonTextDisableColor = getProp('buttonTextDisableColor', style, col, row, table);
|
|
96214
|
-
const value =
|
|
97368
|
+
const value = cellValue;
|
|
96215
97369
|
const dataValue = table.getCellOriginValue(col, row);
|
|
96216
97370
|
const hierarchyOffset = getHierarchyOffset(col, row, table);
|
|
96217
97371
|
const cellStyle = table._getCellStyle(col, row);
|
|
@@ -96326,6 +97480,9 @@
|
|
|
96326
97480
|
const registerVideoCell = () => {
|
|
96327
97481
|
Factory.registerFunction('createVideoCellGroup', createVideoCellGroup);
|
|
96328
97482
|
};
|
|
97483
|
+
const registerAudioCell = () => {
|
|
97484
|
+
Factory.registerFunction('createAudioCellGroup', createAudioCellGroup);
|
|
97485
|
+
};
|
|
96329
97486
|
|
|
96330
97487
|
registerAxis();
|
|
96331
97488
|
registerEmptyTip();
|
|
@@ -96336,6 +97493,7 @@
|
|
|
96336
97493
|
registerListTreeStickCellPlugin();
|
|
96337
97494
|
registerCustomCellStylePlugin();
|
|
96338
97495
|
registerAnimation();
|
|
97496
|
+
registerAudioCell();
|
|
96339
97497
|
registerChartCell();
|
|
96340
97498
|
registerCheckboxCell();
|
|
96341
97499
|
registerImageCell();
|
|
@@ -104040,6 +105198,7 @@
|
|
|
104040
105198
|
registerTooltip();
|
|
104041
105199
|
registerCustomCellStylePlugin();
|
|
104042
105200
|
registerAnimation();
|
|
105201
|
+
registerAudioCell();
|
|
104043
105202
|
registerCheckboxCell();
|
|
104044
105203
|
registerImageCell();
|
|
104045
105204
|
registerProgressBarCell();
|
|
@@ -104061,6 +105220,7 @@
|
|
|
104061
105220
|
registerTitle();
|
|
104062
105221
|
registerTooltip();
|
|
104063
105222
|
registerAnimation();
|
|
105223
|
+
registerAudioCell();
|
|
104064
105224
|
registerChartCell();
|
|
104065
105225
|
registerCheckboxCell();
|
|
104066
105226
|
registerImageCell();
|
|
@@ -105862,7 +107022,7 @@
|
|
|
105862
107022
|
}
|
|
105863
107023
|
|
|
105864
107024
|
registerForVrender();
|
|
105865
|
-
const version = "1.26.
|
|
107025
|
+
const version = "1.26.7";
|
|
105866
107026
|
function getIcons() {
|
|
105867
107027
|
return get$4();
|
|
105868
107028
|
}
|
|
@@ -105914,6 +107074,7 @@
|
|
|
105914
107074
|
exports.pluginsDefinition = index$1;
|
|
105915
107075
|
exports.register = register$1;
|
|
105916
107076
|
exports.registerAnimation = registerAnimation;
|
|
107077
|
+
exports.registerAudioCell = registerAudioCell;
|
|
105917
107078
|
exports.registerAxis = registerAxis;
|
|
105918
107079
|
exports.registerButtonCell = registerButtonCell;
|
|
105919
107080
|
exports.registerChartCell = registerChartCell;
|