vxe-table 4.23.4 → 4.23.6
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/dist/all.esm.js +32459 -33908
- package/dist/style.css +4501 -1
- package/dist/style.mini.css +1 -0
- package/es/colgroup/index.d.ts +760 -0
- package/es/colgroup/index.js +16 -13
- package/es/column/index.d.ts +760 -0
- package/es/column/index.js +16 -13
- package/es/components.d.ts +9 -0
- package/es/components.js +29 -29
- package/es/grid/index.d.ts +2824 -0
- package/es/grid/index.js +14 -9
- package/es/grid/src/emits.d.ts +2 -0
- package/es/grid/src/emits.js +18 -15
- package/es/grid/src/grid.d.ts +556 -0
- package/es/grid/src/grid.js +1695 -1758
- package/es/grid/src/props.d.ts +200 -0
- package/es/grid/src/props.js +19 -6
- package/es/{vxe-grid/style.min.css → grid/style.mini.css} +1 -1
- package/es/index.d.ts +3 -0
- package/es/index.esm.js +6 -3
- package/es/index.js +6 -0
- package/es/locale/lang/ar-EG.d.ts +908 -2
- package/es/locale/lang/ar-EG.js +906 -903
- package/es/locale/lang/de-DE.d.ts +908 -2
- package/es/locale/lang/de-DE.js +906 -903
- package/es/locale/lang/en-US.d.ts +908 -2
- package/es/locale/lang/en-US.js +906 -903
- package/es/locale/lang/es-ES.d.ts +908 -2
- package/es/locale/lang/es-ES.js +906 -903
- package/es/locale/lang/fr-FR.d.ts +908 -2
- package/es/locale/lang/fr-FR.js +906 -903
- package/es/locale/lang/hu-HU.d.ts +908 -2
- package/es/locale/lang/hu-HU.js +906 -903
- package/es/locale/lang/hy-AM.d.ts +908 -2
- package/es/locale/lang/hy-AM.js +906 -903
- package/es/locale/lang/id-ID.d.ts +908 -2
- package/es/locale/lang/id-ID.js +906 -903
- package/es/locale/lang/it-IT.d.ts +908 -2
- package/es/locale/lang/it-IT.js +906 -903
- package/es/locale/lang/ja-JP.d.ts +908 -2
- package/es/locale/lang/ja-JP.js +906 -903
- package/es/locale/lang/ko-KR.d.ts +908 -2
- package/es/locale/lang/ko-KR.js +906 -903
- package/es/locale/lang/ms-MY.d.ts +908 -2
- package/es/locale/lang/ms-MY.js +906 -903
- package/es/locale/lang/nb-NO.d.ts +908 -2
- package/es/locale/lang/nb-NO.js +906 -903
- package/es/locale/lang/pt-BR.d.ts +908 -2
- package/es/locale/lang/pt-BR.js +906 -903
- package/es/locale/lang/ru-RU.d.ts +908 -2
- package/es/locale/lang/ru-RU.js +906 -903
- package/es/locale/lang/th-TH.d.ts +908 -2
- package/es/locale/lang/th-TH.js +906 -903
- package/es/locale/lang/ug-CN.d.ts +908 -2
- package/es/locale/lang/ug-CN.js +906 -903
- package/es/locale/lang/uk-UA.d.ts +908 -2
- package/es/locale/lang/uk-UA.js +906 -903
- package/es/locale/lang/uz-UZ.d.ts +908 -2
- package/es/locale/lang/uz-UZ.js +906 -903
- package/es/locale/lang/vi-VN.d.ts +908 -2
- package/es/locale/lang/vi-VN.js +906 -903
- package/es/locale/lang/zh-CHT.d.ts +908 -2
- package/es/locale/lang/zh-CHT.js +906 -903
- package/es/locale/lang/zh-CN.d.ts +908 -2
- package/es/locale/lang/zh-CN.js +906 -903
- package/es/locale/lang/zh-HK.d.ts +908 -2
- package/es/locale/lang/zh-HK.js +910 -2
- package/es/locale/lang/zh-MO.d.ts +908 -2
- package/es/locale/lang/zh-MO.js +910 -2
- package/es/locale/lang/zh-TC.d.ts +908 -0
- package/es/locale/lang/zh-TC.js +910 -2
- package/es/locale/lang/zh-TW.d.ts +908 -2
- package/es/locale/lang/zh-TW.js +910 -2
- package/es/table/index.d.ts +2672 -0
- package/es/table/index.js +16 -11
- package/es/table/module/custom/hook.d.ts +1 -0
- package/es/table/module/custom/hook.js +462 -483
- package/es/table/module/custom/panel.d.ts +17 -0
- package/es/table/module/custom/panel.js +1482 -1559
- package/es/table/module/edit/hook.d.ts +1 -0
- package/es/table/module/edit/hook.js +1008 -1078
- package/es/table/module/export/export-panel.d.ts +27 -0
- package/es/table/module/export/export-panel.js +523 -575
- package/es/table/module/export/hook.d.ts +1 -0
- package/es/table/module/export/hook.js +1805 -1884
- package/es/table/module/export/import-panel.d.ts +27 -0
- package/es/table/module/export/import-panel.js +244 -252
- package/es/table/module/export/util.d.ts +5 -0
- package/es/table/module/export/util.js +20 -17
- package/es/table/module/filter/hook.d.ts +1 -0
- package/es/table/module/filter/hook.js +472 -487
- package/es/table/module/filter/panel.d.ts +16 -0
- package/es/table/module/filter/panel.js +251 -275
- package/es/table/module/keyboard/hook.d.ts +1 -0
- package/es/table/module/keyboard/hook.js +445 -497
- package/es/table/module/menu/hook.d.ts +1 -0
- package/es/table/module/menu/hook.js +295 -315
- package/es/table/module/menu/panel.d.ts +2 -0
- package/es/table/module/menu/panel.js +164 -183
- package/es/table/module/validator/hook.d.ts +1 -0
- package/es/table/module/validator/hook.js +522 -571
- package/es/table/render/index.d.ts +1 -0
- package/es/table/render/index.js +1402 -1362
- package/es/table/src/body.d.ts +24 -0
- package/es/table/src/body.js +850 -865
- package/es/table/src/cell.d.ts +192 -0
- package/es/table/src/cell.js +1209 -1207
- package/es/table/src/column.d.ts +263 -0
- package/es/table/src/column.js +178 -174
- package/es/table/src/columnInfo.d.ts +13 -0
- package/es/table/src/columnInfo.js +202 -196
- package/es/table/src/emits.d.ts +2 -0
- package/es/table/src/emits.js +126 -119
- package/es/table/src/footer.d.ts +45 -0
- package/es/table/src/footer.js +336 -340
- package/es/table/src/group.d.ts +178 -0
- package/es/table/src/group.js +49 -46
- package/es/table/src/header.d.ts +26 -0
- package/es/table/src/header.js +517 -519
- package/es/table/src/props.d.ts +238 -0
- package/es/table/src/props.js +331 -328
- package/es/table/src/store.d.ts +6 -0
- package/es/table/src/store.js +9 -6
- package/es/table/src/table.d.ts +539 -0
- package/es/table/src/table.js +14064 -15041
- package/es/table/src/use/cell-view.d.ts +10 -0
- package/es/table/src/use/cell-view.js +36 -33
- package/es/table/src/use/index.d.ts +1 -0
- package/es/table/src/use/index.js +1 -1
- package/es/table/src/util.d.ts +74 -0
- package/es/table/src/util.js +1038 -1026
- package/es/table/style.css +1 -1
- package/es/table/style.mini.css +1 -0
- package/es/toolbar/index.d.ts +340 -0
- package/es/toolbar/index.js +14 -9
- package/es/toolbar/src/toolbar.d.ts +75 -0
- package/es/toolbar/src/toolbar.js +605 -613
- package/es/toolbar/{style.min.css → style.mini.css} +1 -1
- package/es/ui/index.d.ts +86 -0
- package/es/ui/index.js +457 -501
- package/es/ui/src/anime.d.ts +10 -0
- package/es/ui/src/anime.js +40 -40
- package/es/ui/src/comp.d.ts +2 -0
- package/es/ui/src/comp.js +5 -2
- package/es/ui/src/dom.d.ts +80 -0
- package/es/ui/src/dom.js +377 -380
- package/es/ui/src/log.d.ts +6 -0
- package/es/ui/src/log.js +18 -13
- package/es/ui/src/utils.d.ts +23 -0
- package/es/ui/src/utils.js +57 -53
- package/es/ui/src/vn.d.ts +7 -0
- package/es/ui/src/vn.js +49 -42
- package/es/v-x-e-table/index.d.ts +3 -0
- package/es/v-x-e-table/index.js +6 -3
- package/es/vxe-colgroup/index.d.ts +3 -0
- package/es/vxe-colgroup/index.js +6 -3
- package/es/vxe-column/index.d.ts +3 -0
- package/es/vxe-column/index.js +6 -3
- package/es/vxe-grid/index.d.ts +3 -0
- package/es/vxe-grid/index.js +6 -3
- package/{lib/grid/style/style.min.css → es/vxe-grid/style.mini.css} +1 -1
- package/es/vxe-table/index.d.ts +3 -0
- package/es/vxe-table/index.js +6 -3
- package/es/vxe-table/style.css +1 -1
- package/es/vxe-table/style.mini.css +1 -0
- package/es/vxe-toolbar/index.d.ts +3 -0
- package/es/vxe-toolbar/index.js +6 -3
- package/es/vxe-toolbar/{style.min.css → style.mini.css} +1 -1
- package/es/vxe-ui/index.d.ts +3 -0
- package/es/vxe-ui/index.js +6 -3
- package/lib/colgroup/index.js +44 -18
- package/lib/colgroup/style/index.js +1 -1
- package/lib/column/index.js +44 -18
- package/lib/column/style/index.js +1 -1
- package/lib/components.js +58 -92
- package/lib/grid/index.js +42 -14
- package/lib/grid/src/emits.js +37 -6
- package/lib/grid/src/grid.js +850 -1195
- package/lib/grid/src/props.js +27 -11
- package/lib/grid/style/index.js +1 -1
- package/lib/{vxe-grid/style/style.min.css → grid/style/style.mini.css} +1 -1
- package/lib/iconfont.1792977622800.ttf +0 -0
- package/lib/iconfont.1792977622800.woff +0 -0
- package/lib/iconfont.1792977622800.woff2 +0 -0
- package/lib/index.common.js +35 -19
- package/lib/index.js +37 -0
- package/lib/index.umd.js +30586 -24322
- package/lib/index.umd.min.js +3 -1
- package/lib/locale/ar-EG.umd.js +948 -0
- package/lib/locale/de-DE.umd.js +948 -0
- package/lib/locale/en-US.umd.js +948 -0
- package/lib/locale/es-ES.umd.js +948 -0
- package/lib/locale/fr-FR.umd.js +948 -0
- package/lib/locale/hu-HU.umd.js +948 -0
- package/lib/locale/hy-AM.umd.js +948 -0
- package/lib/locale/id-ID.umd.js +948 -0
- package/lib/locale/it-IT.umd.js +948 -0
- package/lib/locale/ja-JP.umd.js +948 -0
- package/lib/locale/ko-KR.umd.js +948 -0
- package/lib/locale/lang/ar-EG.js +681 -664
- package/lib/locale/lang/ar-EG.umd.js +913 -892
- package/lib/locale/lang/de-DE.js +681 -664
- package/lib/locale/lang/de-DE.umd.js +913 -892
- package/lib/locale/lang/en-US.js +678 -661
- package/lib/locale/lang/en-US.umd.js +913 -892
- package/lib/locale/lang/es-ES.js +681 -664
- package/lib/locale/lang/es-ES.umd.js +913 -892
- package/lib/locale/lang/fr-FR.js +654 -637
- package/lib/locale/lang/fr-FR.umd.js +913 -892
- package/lib/locale/lang/hu-HU.js +681 -664
- package/lib/locale/lang/hu-HU.umd.js +913 -892
- package/lib/locale/lang/hy-AM.js +681 -664
- package/lib/locale/lang/hy-AM.umd.js +913 -892
- package/lib/locale/lang/id-ID.js +681 -664
- package/lib/locale/lang/id-ID.umd.js +913 -892
- package/lib/locale/lang/it-IT.js +661 -644
- package/lib/locale/lang/it-IT.umd.js +912 -891
- package/lib/locale/lang/ja-JP.js +710 -693
- package/lib/locale/lang/ja-JP.umd.js +913 -892
- package/lib/locale/lang/ko-KR.js +681 -664
- package/lib/locale/lang/ko-KR.umd.js +913 -892
- package/lib/locale/lang/ms-MY.js +681 -664
- package/lib/locale/lang/ms-MY.umd.js +913 -892
- package/lib/locale/lang/nb-NO.js +681 -664
- package/lib/locale/lang/nb-NO.umd.js +913 -892
- package/lib/locale/lang/pt-BR.js +681 -664
- package/lib/locale/lang/pt-BR.umd.js +913 -892
- package/lib/locale/lang/ru-RU.js +690 -673
- package/lib/locale/lang/ru-RU.umd.js +913 -892
- package/lib/locale/lang/th-TH.js +681 -664
- package/lib/locale/lang/th-TH.umd.js +913 -892
- package/lib/locale/lang/ug-CN.js +681 -664
- package/lib/locale/lang/ug-CN.umd.js +913 -892
- package/lib/locale/lang/uk-UA.js +674 -657
- package/lib/locale/lang/uk-UA.umd.js +913 -892
- package/lib/locale/lang/uz-UZ.js +583 -566
- package/lib/locale/lang/uz-UZ.umd.js +908 -887
- package/lib/locale/lang/vi-VN.js +681 -664
- package/lib/locale/lang/vi-VN.umd.js +913 -892
- package/lib/locale/lang/zh-CHT.js +681 -664
- package/lib/locale/lang/zh-CHT.umd.js +913 -892
- package/lib/locale/lang/zh-CN.js +681 -664
- package/lib/locale/lang/zh-CN.umd.js +913 -892
- package/lib/locale/lang/zh-HK.js +928 -7
- package/lib/locale/lang/zh-HK.umd.js +945 -20
- package/lib/locale/lang/zh-MO.js +928 -7
- package/lib/locale/lang/zh-MO.umd.js +945 -20
- package/lib/locale/lang/zh-TC.js +928 -7
- package/lib/locale/lang/zh-TC.umd.js +948 -0
- package/lib/locale/lang/zh-TW.js +928 -7
- package/lib/locale/lang/zh-TW.umd.js +945 -20
- package/lib/locale/ms-MY.umd.js +948 -0
- package/lib/locale/nb-NO.umd.js +948 -0
- package/lib/locale/pt-BR.umd.js +948 -0
- package/lib/locale/ru-RU.umd.js +948 -0
- package/lib/locale/th-TH.umd.js +948 -0
- package/lib/locale/ug-CN.umd.js +948 -0
- package/lib/locale/uk-UA.umd.js +948 -0
- package/lib/locale/uz-UZ.umd.js +948 -0
- package/lib/locale/vi-VN.umd.js +948 -0
- package/lib/locale/zh-CHT.umd.js +948 -0
- package/lib/locale/zh-CN.umd.js +948 -0
- package/lib/locale/zh-HK.umd.js +948 -0
- package/lib/locale/zh-MO.umd.js +948 -0
- package/lib/locale/zh-TC.umd.js +948 -0
- package/lib/locale/zh-TW.umd.js +948 -0
- package/lib/style.css +4501 -1
- package/lib/style.mini.css +1 -0
- package/lib/table/index.js +45 -17
- package/lib/table/module/custom/hook.js +132 -252
- package/lib/table/module/custom/panel.js +919 -970
- package/lib/table/module/edit/hook.js +250 -620
- package/lib/table/module/export/export-panel.js +390 -347
- package/lib/table/module/export/hook.js +745 -1179
- package/lib/table/module/export/import-panel.js +170 -136
- package/lib/table/module/export/util.js +37 -14
- package/lib/table/module/filter/hook.js +127 -227
- package/lib/table/module/filter/panel.js +177 -208
- package/lib/table/module/keyboard/hook.js +93 -172
- package/lib/table/module/menu/hook.js +86 -165
- package/lib/table/module/menu/panel.js +176 -141
- package/lib/table/module/validator/hook.js +164 -271
- package/lib/table/render/index.js +700 -1147
- package/lib/table/src/body.js +426 -559
- package/lib/table/src/cell.js +619 -987
- package/lib/table/src/column.js +55 -30
- package/lib/table/src/columnInfo.js +88 -110
- package/lib/table/src/emits.js +145 -13
- package/lib/table/src/footer.js +181 -240
- package/lib/table/src/group.js +56 -34
- package/lib/table/src/header.js +292 -367
- package/lib/table/src/props.js +27 -12
- package/lib/table/src/store.js +25 -9
- package/lib/table/src/table.js +14179 -1019
- package/lib/table/src/use/cell-view.js +47 -37
- package/lib/table/src/use/index.js +17 -15
- package/lib/table/src/util.js +236 -337
- package/lib/table/style/index.js +1 -1
- package/lib/table/style/style.css +1 -1
- package/lib/table/style/style.mini.css +1 -0
- package/lib/toolbar/index.js +42 -14
- package/lib/toolbar/src/toolbar.js +271 -379
- package/lib/toolbar/style/index.js +1 -1
- package/lib/toolbar/style/{style.min.css → style.mini.css} +1 -1
- package/lib/ui/index.js +153 -195
- package/lib/ui/src/anime.js +49 -29
- package/lib/ui/src/comp.js +23 -6
- package/lib/ui/src/dom.js +114 -147
- package/lib/ui/src/log.js +34 -18
- package/lib/ui/src/utils.js +57 -45
- package/lib/ui/src/vn.js +60 -34
- package/lib/ui/style/index.js +1 -1
- package/lib/v-x-e-table/index.js +35 -19
- package/lib/vxe-colgroup/index.js +35 -19
- package/lib/vxe-colgroup/style/index.js +1 -1
- package/lib/vxe-column/index.js +35 -19
- package/lib/vxe-column/style/index.js +1 -1
- package/lib/vxe-grid/index.js +35 -19
- package/lib/vxe-grid/style/index.js +1 -1
- package/{es/grid/style.min.css → lib/vxe-grid/style/style.mini.css} +1 -1
- package/lib/vxe-table/index.js +35 -19
- package/lib/vxe-table/style/index.js +1 -1
- package/lib/vxe-table/style/style.css +1 -1
- package/lib/vxe-table/style/style.mini.css +1 -0
- package/lib/vxe-toolbar/index.js +35 -19
- package/lib/vxe-toolbar/style/index.js +1 -1
- package/lib/vxe-toolbar/style/{style.min.css → style.mini.css} +1 -1
- package/lib/vxe-ui/index.js +35 -19
- package/lib/vxe-ui/style/index.js +1 -1
- package/package.json +8 -4
- package/packages/locale/lang/zh-HK.ts +907 -3
- package/packages/locale/lang/zh-MO.ts +907 -3
- package/packages/locale/lang/zh-TC.ts +907 -3
- package/packages/locale/lang/zh-TW.ts +907 -3
- package/packages/table/module/edit/hook.ts +2 -2
- package/packages/table/src/table.ts +64 -28
- package/packages/ui/index.ts +1 -28
- package/dist/style.min.css +0 -1
- package/es/index.css +0 -1
- package/es/index.min.css +0 -1
- package/es/style.css +0 -1
- package/es/style.min.css +0 -1
- package/es/table/style.min.css +0 -1
- package/es/vxe-table/style.min.css +0 -1
- package/es/vxe-v-x-e-table/index.js +0 -3
- package/lib/colgroup/index.min.js +0 -1
- package/lib/column/index.min.js +0 -1
- package/lib/components.min.js +0 -1
- package/lib/grid/index.min.js +0 -1
- package/lib/grid/src/emits.min.js +0 -1
- package/lib/grid/src/grid.min.js +0 -1
- package/lib/grid/src/props.min.js +0 -1
- package/lib/index.css +0 -1
- package/lib/index.min.css +0 -1
- package/lib/locale/lang/ar-EG.d.ts +0 -2
- package/lib/locale/lang/ar-EG.min.js +0 -1
- package/lib/locale/lang/de-DE.d.ts +0 -2
- package/lib/locale/lang/de-DE.min.js +0 -1
- package/lib/locale/lang/en-US.d.ts +0 -2
- package/lib/locale/lang/en-US.min.js +0 -1
- package/lib/locale/lang/es-ES.d.ts +0 -2
- package/lib/locale/lang/es-ES.min.js +0 -1
- package/lib/locale/lang/fr-FR.d.ts +0 -2
- package/lib/locale/lang/fr-FR.min.js +0 -1
- package/lib/locale/lang/hu-HU.d.ts +0 -2
- package/lib/locale/lang/hu-HU.min.js +0 -1
- package/lib/locale/lang/hy-AM.d.ts +0 -2
- package/lib/locale/lang/hy-AM.min.js +0 -1
- package/lib/locale/lang/id-ID.d.ts +0 -2
- package/lib/locale/lang/id-ID.min.js +0 -1
- package/lib/locale/lang/it-IT.d.ts +0 -2
- package/lib/locale/lang/it-IT.min.js +0 -1
- package/lib/locale/lang/ja-JP.d.ts +0 -2
- package/lib/locale/lang/ja-JP.min.js +0 -1
- package/lib/locale/lang/ko-KR.d.ts +0 -2
- package/lib/locale/lang/ko-KR.min.js +0 -1
- package/lib/locale/lang/ms-MY.d.ts +0 -2
- package/lib/locale/lang/ms-MY.min.js +0 -1
- package/lib/locale/lang/nb-NO.d.ts +0 -2
- package/lib/locale/lang/nb-NO.min.js +0 -1
- package/lib/locale/lang/pt-BR.d.ts +0 -2
- package/lib/locale/lang/pt-BR.min.js +0 -1
- package/lib/locale/lang/ru-RU.d.ts +0 -2
- package/lib/locale/lang/ru-RU.min.js +0 -1
- package/lib/locale/lang/th-TH.d.ts +0 -2
- package/lib/locale/lang/th-TH.min.js +0 -1
- package/lib/locale/lang/ug-CN.d.ts +0 -2
- package/lib/locale/lang/ug-CN.min.js +0 -1
- package/lib/locale/lang/uk-UA.d.ts +0 -2
- package/lib/locale/lang/uk-UA.min.js +0 -1
- package/lib/locale/lang/uz-UZ.d.ts +0 -2
- package/lib/locale/lang/uz-UZ.min.js +0 -1
- package/lib/locale/lang/vi-VN.d.ts +0 -2
- package/lib/locale/lang/vi-VN.min.js +0 -1
- package/lib/locale/lang/zh-CHT.d.ts +0 -2
- package/lib/locale/lang/zh-CHT.min.js +0 -1
- package/lib/locale/lang/zh-CN.d.ts +0 -2
- package/lib/locale/lang/zh-CN.min.js +0 -1
- package/lib/locale/lang/zh-HK.d.ts +0 -2
- package/lib/locale/lang/zh-HK.min.js +0 -1
- package/lib/locale/lang/zh-MO.d.ts +0 -2
- package/lib/locale/lang/zh-MO.min.js +0 -1
- package/lib/locale/lang/zh-TC.min.js +0 -1
- package/lib/locale/lang/zh-TW.d.ts +0 -2
- package/lib/locale/lang/zh-TW.min.js +0 -1
- package/lib/style.min.css +0 -1
- package/lib/table/index.min.js +0 -1
- package/lib/table/module/custom/hook.min.js +0 -1
- package/lib/table/module/custom/panel.min.js +0 -1
- package/lib/table/module/edit/hook.min.js +0 -1
- package/lib/table/module/export/export-panel.min.js +0 -1
- package/lib/table/module/export/hook.min.js +0 -1
- package/lib/table/module/export/import-panel.min.js +0 -1
- package/lib/table/module/export/util.min.js +0 -1
- package/lib/table/module/filter/hook.min.js +0 -1
- package/lib/table/module/filter/panel.min.js +0 -1
- package/lib/table/module/keyboard/hook.min.js +0 -1
- package/lib/table/module/menu/hook.min.js +0 -1
- package/lib/table/module/menu/panel.min.js +0 -1
- package/lib/table/module/validator/hook.min.js +0 -1
- package/lib/table/render/index.min.js +0 -1
- package/lib/table/src/body.min.js +0 -1
- package/lib/table/src/cell.min.js +0 -1
- package/lib/table/src/column.min.js +0 -1
- package/lib/table/src/columnInfo.min.js +0 -1
- package/lib/table/src/emits.min.js +0 -1
- package/lib/table/src/footer.min.js +0 -1
- package/lib/table/src/group.min.js +0 -1
- package/lib/table/src/header.min.js +0 -1
- package/lib/table/src/props.min.js +0 -1
- package/lib/table/src/store.min.js +0 -1
- package/lib/table/src/table.min.js +0 -1
- package/lib/table/src/use/cell-view.min.js +0 -1
- package/lib/table/src/use/index.min.js +0 -1
- package/lib/table/src/util.min.js +0 -1
- package/lib/table/style/style.min.css +0 -1
- package/lib/toolbar/index.min.js +0 -1
- package/lib/toolbar/src/toolbar.min.js +0 -1
- package/lib/ui/index.min.js +0 -1
- package/lib/ui/src/anime.min.js +0 -1
- package/lib/ui/src/comp.min.js +0 -1
- package/lib/ui/src/dom.min.js +0 -1
- package/lib/ui/src/log.min.js +0 -1
- package/lib/ui/src/utils.min.js +0 -1
- package/lib/ui/src/vn.min.js +0 -1
- package/lib/ui/style/style.min.css +0 -0
- package/lib/v-x-e-table/index.min.js +0 -1
- package/lib/v-x-e-table/style/index.js +0 -1
- package/lib/v-x-e-table/style/style.css +0 -0
- package/lib/v-x-e-table/style/style.min.css +0 -0
- package/lib/vxe-colgroup/index.min.js +0 -1
- package/lib/vxe-colgroup/style/style.min.css +0 -0
- package/lib/vxe-column/index.min.js +0 -1
- package/lib/vxe-column/style/style.min.css +0 -0
- package/lib/vxe-grid/index.min.js +0 -1
- package/lib/vxe-table/index.min.js +0 -1
- package/lib/vxe-table/style/style.min.css +0 -1
- package/lib/vxe-toolbar/index.min.js +0 -1
- package/lib/vxe-ui/index.min.js +0 -1
- package/lib/vxe-ui/style/style.min.css +0 -0
- package/lib/vxe-v-x-e-table/index.js +0 -21
- package/lib/vxe-v-x-e-table/index.min.js +0 -1
- package/lib/vxe-v-x-e-table/style/index.js +0 -1
- package/lib/vxe-v-x-e-table/style/style.css +0 -0
- package/lib/vxe-v-x-e-table/style/style.min.css +0 -0
- /package/{es/iconfont.1792740941484.ttf → dist/iconfont.1792977622800.ttf} +0 -0
- /package/{es/iconfont.1792740941484.woff → dist/iconfont.1792977622800.woff} +0 -0
- /package/{es/iconfont.1792740941484.woff2 → dist/iconfont.1792977622800.woff2} +0 -0
- /package/es/colgroup/{style.min.css → style.mini.css} +0 -0
- /package/es/column/{style.min.css → style.mini.css} +0 -0
- /package/{lib/iconfont.1792740941484.ttf → es/iconfont.1792977622800.ttf} +0 -0
- /package/{lib/iconfont.1792740941484.woff → es/iconfont.1792977622800.woff} +0 -0
- /package/{lib/iconfont.1792740941484.woff2 → es/iconfont.1792977622800.woff2} +0 -0
- /package/es/ui/{style.min.css → style.mini.css} +0 -0
- /package/es/{v-x-e-table/style.css → vxe-colgroup/style.mini.css} +0 -0
- /package/es/{v-x-e-table/style.min.css → vxe-column/style.mini.css} +0 -0
- /package/es/{vxe-colgroup/style.min.css → vxe-ui/style.mini.css} +0 -0
- /package/{es/vxe-column/style.min.css → lib/colgroup/style/style.mini.css} +0 -0
- /package/{es/vxe-ui/style.min.css → lib/column/style/style.mini.css} +0 -0
- /package/{es/vxe-v-x-e-table/style.css → lib/ui/style/style.mini.css} +0 -0
- /package/{es/vxe-v-x-e-table/style.min.css → lib/vxe-colgroup/style/style.mini.css} +0 -0
- /package/lib/{colgroup/style/style.min.css → vxe-column/style/style.mini.css} +0 -0
- /package/lib/{column/style/style.min.css → vxe-ui/style/style.mini.css} +0 -0
package/es/table/src/header.js
CHANGED
|
@@ -1,531 +1,529 @@
|
|
|
1
|
-
import { h, ref, inject, nextTick, watch, onMounted, onUnmounted } from
|
|
2
|
-
import { defineVxeComponent } from
|
|
3
|
-
import XEUtils from
|
|
4
|
-
import { VxeUI } from
|
|
5
|
-
import { getDefaultConfig, hasEnableConf, isEnableConf } from
|
|
6
|
-
import { getCalcHeight, convertHeaderColumnToRows, convertHeaderToGridRows } from
|
|
7
|
-
import { getSlotVNs } from
|
|
1
|
+
import { h, ref, inject, nextTick, watch, onMounted, onUnmounted } from "vue";
|
|
2
|
+
import { defineVxeComponent } from "../../ui/src/comp";
|
|
3
|
+
import XEUtils from "xe-utils";
|
|
4
|
+
import { VxeUI } from "../../ui";
|
|
5
|
+
import { getDefaultConfig, hasEnableConf, isEnableConf } from "../../ui/src/utils";
|
|
6
|
+
import { getCalcHeight, convertHeaderColumnToRows, convertHeaderToGridRows } from "./util";
|
|
7
|
+
import { getSlotVNs } from "../../ui/src/vn";
|
|
8
8
|
const { renderer, renderEmptyElement } = VxeUI;
|
|
9
|
-
const sourceType =
|
|
10
|
-
const renderType =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
const sourceType = "table";
|
|
10
|
+
const renderType = "header";
|
|
11
|
+
var header_default = defineVxeComponent({
|
|
12
|
+
name: "VxeTableHeader",
|
|
13
|
+
props: {
|
|
14
|
+
tableData: Array,
|
|
15
|
+
tableColumn: Array,
|
|
16
|
+
tableGroupColumn: Array,
|
|
17
|
+
fixedColumn: Array,
|
|
18
|
+
fixedType: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: null
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
setup(props) {
|
|
24
|
+
const $xeTable = inject("$xeTable", {});
|
|
25
|
+
const { xID, props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable;
|
|
26
|
+
const { computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeMouseOpts, computeHeaderCellOpts, computeDefaultRowHeight, computeVirtualXOpts, computeFloatingFilterOpts, computeIsHeaderRenderOptimize, computeHeaderTooltipOpts, computeRendererOpts } = $xeTable.getComputeMaps();
|
|
27
|
+
const headerColumn = ref([]);
|
|
28
|
+
const refElem = ref();
|
|
29
|
+
const refHeaderScroll = ref();
|
|
30
|
+
const refHeaderTable = ref();
|
|
31
|
+
const refHeaderColgroup = ref();
|
|
32
|
+
const refHeaderTHead = ref();
|
|
33
|
+
const refHeaderXSpace = ref();
|
|
34
|
+
const refHeaderBorderRepair = ref();
|
|
35
|
+
const uploadColumn = () => {
|
|
36
|
+
const { showCustomHeader } = tableProps;
|
|
37
|
+
const { collectColumn, visibleColumn } = tableInternalData;
|
|
38
|
+
const { tableGroupColumn } = props;
|
|
39
|
+
const { isGroup } = tableReactData;
|
|
40
|
+
let spanColumns = isGroup ? convertHeaderColumnToRows(tableGroupColumn) : [];
|
|
41
|
+
let visibleColgroups = [];
|
|
42
|
+
if (showCustomHeader && spanColumns.length > 1) {
|
|
43
|
+
visibleColgroups = convertHeaderToGridRows(spanColumns);
|
|
44
|
+
spanColumns = visibleColgroups;
|
|
45
|
+
}
|
|
46
|
+
headerColumn.value = spanColumns;
|
|
47
|
+
nextTick(() => {
|
|
48
|
+
$xeTable.dispatchEvent("columns-change", { visibleColgroups, collectColumn, visibleColumn }, null);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
const renderRows = (isGroup, isOptimizeMode, headerGroups, _rowIndex, cols) => {
|
|
52
|
+
const $xeGrid = $xeTable.xeGrid;
|
|
53
|
+
const $xeGantt = $xeTable.xeGantt;
|
|
54
|
+
const { fixedType } = props;
|
|
55
|
+
const { resizable: allResizable, columnKey, showCustomHeader, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps;
|
|
56
|
+
const { dragCol, scrollXLoad, scrollYLoad, overflowX, mergeHeadFlag, tableColumn, currColFlag } = tableReactData;
|
|
57
|
+
const { fullColumnIdData, scrollXStore, mergeHeaderList, mergeHeaderCellMaps, currentCol } = tableInternalData;
|
|
58
|
+
const virtualXOpts = computeVirtualXOpts.value;
|
|
59
|
+
const columnOpts = computeColumnOpts.value;
|
|
60
|
+
const columnDragOpts = computeColumnDragOpts.value;
|
|
61
|
+
const headerTooltipOpts = computeHeaderTooltipOpts.value;
|
|
62
|
+
const cellOpts = computeCellOpts.value;
|
|
63
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
64
|
+
const headerCellOpts = computeHeaderCellOpts.value;
|
|
65
|
+
const rendererOpts = computeRendererOpts.value;
|
|
66
|
+
const mouseOpts = computeMouseOpts.value;
|
|
67
|
+
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight;
|
|
68
|
+
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts;
|
|
69
|
+
const isLastRow = _rowIndex === headerGroups.length - 1;
|
|
70
|
+
return cols.map((column, $columnIndex) => {
|
|
71
|
+
const { type, showHeaderOverflow, headerAlign, align, filters, headerClassName, editRender, cellRender } = column;
|
|
72
|
+
const colid = column.id;
|
|
73
|
+
const colRest = fullColumnIdData[colid] || {};
|
|
74
|
+
const renderOpts = editRender || cellRender;
|
|
75
|
+
const compConf = renderOpts && renderOpts.name ? rendererOpts[renderOpts.name] || renderer.get(renderOpts.name) : null;
|
|
76
|
+
const isColGroup = column.children && column.children.length;
|
|
77
|
+
const fixedHiddenColumn = overflowX && !isColGroup && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
78
|
+
const cellPadding = getDefaultConfig(headerCellOpts.padding, cellOpts.padding);
|
|
79
|
+
const isAllCellPadding = cellPadding === true;
|
|
80
|
+
const isCellPaddingTop = cellPadding ? isAllCellPadding || cellPadding.top !== false : false;
|
|
81
|
+
const isCellPaddingBottom = cellPadding ? isAllCellPadding || cellPadding.bottom !== false : false;
|
|
82
|
+
const isCellPaddingLeft = cellPadding ? isAllCellPadding || cellPadding.left !== false : false;
|
|
83
|
+
const isCellPaddingRight = cellPadding ? isAllCellPadding || cellPadding.right !== false : false;
|
|
84
|
+
const headOverflow = getDefaultConfig(showHeaderOverflow, allColumnHeaderOverflow);
|
|
85
|
+
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : "") || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : "") || allAlign;
|
|
86
|
+
const showEllipsis = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === "ellipsis";
|
|
87
|
+
const showTitle = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === "title";
|
|
88
|
+
const showTooltip = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === "tooltip";
|
|
89
|
+
const hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
90
|
+
let hasFilter = false;
|
|
91
|
+
let firstFilterOption = null;
|
|
92
|
+
if (filters) {
|
|
93
|
+
firstFilterOption = filters[0];
|
|
94
|
+
hasFilter = filters.some((item) => item.checked);
|
|
21
95
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
let visibleColgroups = [];
|
|
42
|
-
if (showCustomHeader && spanColumns.length > 1) {
|
|
43
|
-
visibleColgroups = convertHeaderToGridRows(spanColumns);
|
|
44
|
-
spanColumns = visibleColgroups;
|
|
45
|
-
}
|
|
46
|
-
headerColumn.value = spanColumns;
|
|
47
|
-
nextTick(() => {
|
|
48
|
-
$xeTable.dispatchEvent('columns-change', { visibleColgroups, collectColumn, visibleColumn }, null);
|
|
49
|
-
});
|
|
96
|
+
const columnIndex = colRest.index;
|
|
97
|
+
const _columnIndex = colRest._index;
|
|
98
|
+
const cellParams = {
|
|
99
|
+
$table: $xeTable,
|
|
100
|
+
$grid: $xeGrid,
|
|
101
|
+
$gantt: $xeGantt,
|
|
102
|
+
rowIndex: _rowIndex,
|
|
103
|
+
_rowIndex,
|
|
104
|
+
$rowIndex: _rowIndex,
|
|
105
|
+
column,
|
|
106
|
+
columnIndex,
|
|
107
|
+
$columnIndex,
|
|
108
|
+
_columnIndex,
|
|
109
|
+
firstFilterOption,
|
|
110
|
+
fixed: fixedType,
|
|
111
|
+
source: sourceType,
|
|
112
|
+
type: renderType,
|
|
113
|
+
isHidden: fixedHiddenColumn,
|
|
114
|
+
hasFilter
|
|
50
115
|
};
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
const $xeGantt = $xeTable.xeGantt;
|
|
54
|
-
const { fixedType } = props;
|
|
55
|
-
const { resizable: allResizable, columnKey, showCustomHeader, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps;
|
|
56
|
-
const { dragCol, scrollXLoad, scrollYLoad, overflowX, mergeHeadFlag, tableColumn, currColFlag } = tableReactData;
|
|
57
|
-
const { fullColumnIdData, scrollXStore, mergeHeaderList, mergeHeaderCellMaps, currentCol } = tableInternalData;
|
|
58
|
-
const virtualXOpts = computeVirtualXOpts.value;
|
|
59
|
-
const columnOpts = computeColumnOpts.value;
|
|
60
|
-
const columnDragOpts = computeColumnDragOpts.value;
|
|
61
|
-
const headerTooltipOpts = computeHeaderTooltipOpts.value;
|
|
62
|
-
const cellOpts = computeCellOpts.value;
|
|
63
|
-
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
64
|
-
const headerCellOpts = computeHeaderCellOpts.value;
|
|
65
|
-
const rendererOpts = computeRendererOpts.value;
|
|
66
|
-
const mouseOpts = computeMouseOpts.value;
|
|
67
|
-
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight;
|
|
68
|
-
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts;
|
|
69
|
-
const isLastRow = _rowIndex === headerGroups.length - 1;
|
|
70
|
-
return cols.map((column, $columnIndex) => {
|
|
71
|
-
const { type, showHeaderOverflow, headerAlign, align, filters, headerClassName, editRender, cellRender } = column;
|
|
72
|
-
const colid = column.id;
|
|
73
|
-
const colRest = fullColumnIdData[colid] || {};
|
|
74
|
-
const renderOpts = editRender || cellRender;
|
|
75
|
-
const compConf = renderOpts && renderOpts.name ? (rendererOpts[renderOpts.name] || renderer.get(renderOpts.name)) : null;
|
|
76
|
-
const isColGroup = column.children && column.children.length;
|
|
77
|
-
const fixedHiddenColumn = overflowX && !isColGroup && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
78
|
-
const cellPadding = getDefaultConfig(headerCellOpts.padding, cellOpts.padding);
|
|
79
|
-
const isAllCellPadding = cellPadding === true;
|
|
80
|
-
const isCellPaddingTop = cellPadding ? (isAllCellPadding || cellPadding.top !== false) : false;
|
|
81
|
-
const isCellPaddingBottom = cellPadding ? (isAllCellPadding || cellPadding.bottom !== false) : false;
|
|
82
|
-
const isCellPaddingLeft = cellPadding ? (isAllCellPadding || cellPadding.left !== false) : false;
|
|
83
|
-
const isCellPaddingRight = cellPadding ? (isAllCellPadding || cellPadding.right !== false) : false;
|
|
84
|
-
const headOverflow = getDefaultConfig(showHeaderOverflow, allColumnHeaderOverflow);
|
|
85
|
-
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
86
|
-
const showEllipsis = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'ellipsis';
|
|
87
|
-
const showTitle = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'title';
|
|
88
|
-
const showTooltip = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'tooltip';
|
|
89
|
-
const hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
90
|
-
let hasFilter = false;
|
|
91
|
-
let firstFilterOption = null;
|
|
92
|
-
if (filters) {
|
|
93
|
-
firstFilterOption = filters[0];
|
|
94
|
-
hasFilter = filters.some((item) => item.checked);
|
|
95
|
-
}
|
|
96
|
-
const columnIndex = colRest.index;
|
|
97
|
-
const _columnIndex = colRest._index;
|
|
98
|
-
const cellParams = {
|
|
99
|
-
$table: $xeTable,
|
|
100
|
-
$grid: $xeGrid,
|
|
101
|
-
$gantt: $xeGantt,
|
|
102
|
-
rowIndex: _rowIndex,
|
|
103
|
-
_rowIndex,
|
|
104
|
-
$rowIndex: _rowIndex,
|
|
105
|
-
column,
|
|
106
|
-
columnIndex,
|
|
107
|
-
$columnIndex,
|
|
108
|
-
_columnIndex,
|
|
109
|
-
firstFilterOption: firstFilterOption,
|
|
110
|
-
fixed: fixedType,
|
|
111
|
-
source: sourceType,
|
|
112
|
-
type: renderType,
|
|
113
|
-
isHidden: fixedHiddenColumn,
|
|
114
|
-
hasFilter
|
|
115
|
-
};
|
|
116
|
-
const thAttrs = {
|
|
117
|
-
colid
|
|
118
|
-
};
|
|
119
|
-
let isMergeCell = false;
|
|
120
|
-
// 合并行或列
|
|
121
|
-
if (!showCustomHeader) {
|
|
122
|
-
thAttrs.colspan = column.colSpan > 1 ? column.colSpan : null;
|
|
123
|
-
thAttrs.rowspan = column.rowSpan > 1 ? column.rowSpan : null;
|
|
124
|
-
}
|
|
125
|
-
if (mergeHeadFlag && mergeHeaderList.length && (showCustomHeader || isLastRow)) {
|
|
126
|
-
const spanRest = mergeHeaderCellMaps[`${_rowIndex}:${showCustomHeader ? $columnIndex : _columnIndex}`];
|
|
127
|
-
if (spanRest) {
|
|
128
|
-
const { rowspan, colspan } = spanRest;
|
|
129
|
-
if (!rowspan || !colspan) {
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
if (rowspan > 1) {
|
|
133
|
-
isMergeCell = true;
|
|
134
|
-
thAttrs.rowspan = rowspan;
|
|
135
|
-
}
|
|
136
|
-
if (colspan > 1) {
|
|
137
|
-
isMergeCell = true;
|
|
138
|
-
thAttrs.colspan = colspan;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
const thOns = {
|
|
143
|
-
onClick: (evnt) => $xeTable.triggerHeaderCellClickEvent(evnt, cellParams),
|
|
144
|
-
onDblclick: (evnt) => $xeTable.triggerHeaderCellDblclickEvent(evnt, cellParams)
|
|
145
|
-
};
|
|
146
|
-
const isColDragCell = columnOpts.drag && columnDragOpts.trigger === 'cell';
|
|
147
|
-
let isDisabledDrag = false;
|
|
148
|
-
if (isColDragCell) {
|
|
149
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
150
|
-
}
|
|
151
|
-
// 按下事件处理
|
|
152
|
-
if (hasEnableConf(mouseConfig, mouseOpts) || isColDragCell) {
|
|
153
|
-
thOns.onMousedown = (evnt) => $xeTable.triggerHeaderCellMousedownEvent(evnt, cellParams);
|
|
154
|
-
}
|
|
155
|
-
// 拖拽列事件
|
|
156
|
-
if (columnOpts.drag) {
|
|
157
|
-
thOns.onDragstart = $xeTable.handleHeaderCellDragDragstartEvent;
|
|
158
|
-
thOns.onDragend = $xeTable.handleHeaderCellDragDragendEvent;
|
|
159
|
-
thOns.onDragover = $xeTable.handleHeaderCellDragDragoverEvent;
|
|
160
|
-
if (isColDragCell) {
|
|
161
|
-
thOns.onMouseup = $xeTable.handleHeaderCellDragMouseupEvent;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
const isLastColumn = $columnIndex === cols.length - 1;
|
|
165
|
-
const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable));
|
|
166
|
-
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
167
|
-
let isVNPreEmptyStatus = false;
|
|
168
|
-
if (isOptimizeMode && overflowX && !isGroup && !isMergeCell) {
|
|
169
|
-
if (!dragCol || dragCol.id !== colid) {
|
|
170
|
-
if (scrollXLoad && tableColumn.length > 10 && !column.fixed && !virtualXOpts.immediate && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
171
|
-
isVNPreEmptyStatus = true;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
const tcStyle = {};
|
|
176
|
-
if (hasEllipsis) {
|
|
177
|
-
tcStyle.height = `${currCellHeight}px`;
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
tcStyle.minHeight = `${currCellHeight}px`;
|
|
181
|
-
}
|
|
182
|
-
if (showCustomHeader) {
|
|
183
|
-
// custom
|
|
184
|
-
}
|
|
185
|
-
else if (isColGroup && !isLastRow) {
|
|
186
|
-
let childWidth = 0;
|
|
187
|
-
XEUtils.eachTree(column.children, (childRow) => {
|
|
188
|
-
if (childRow.visible && (!childRow.children || !childRow.children.length)) {
|
|
189
|
-
childWidth += childRow.renderWidth;
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
tcStyle.width = `${childWidth}px`;
|
|
193
|
-
}
|
|
194
|
-
return h('th', Object.assign(Object.assign(Object.assign({ class: ['vxe-table--column vxe-header--column', colid, fixedHiddenColumn ? 'fixed--hidden' : 'fixed--visible', {
|
|
195
|
-
[`col--${headAlign}`]: headAlign,
|
|
196
|
-
[`col--${type}`]: type,
|
|
197
|
-
'col--last': isLastColumn,
|
|
198
|
-
'col--fixed': column.fixed,
|
|
199
|
-
'col--group': isColGroup,
|
|
200
|
-
'col--ellipsis': hasEllipsis,
|
|
201
|
-
'fixed--width': !isAutoCellWidth,
|
|
202
|
-
'is--pg-top': isCellPaddingTop,
|
|
203
|
-
'is--pg-bottom': isCellPaddingBottom,
|
|
204
|
-
'is--pg-left': isCellPaddingLeft,
|
|
205
|
-
'is--pg-right': isCellPaddingRight,
|
|
206
|
-
'is--sortable': column.sortable,
|
|
207
|
-
'col--filter': !!filters,
|
|
208
|
-
'is--filter-active': hasFilter,
|
|
209
|
-
'is--drag-active': columnOpts.drag && !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
|
|
210
|
-
'is--drag-disabled': columnOpts.drag && isDisabledDrag,
|
|
211
|
-
'col--current': currColFlag && currentCol === column
|
|
212
|
-
},
|
|
213
|
-
headerClassName ? (XEUtils.isFunction(headerClassName) ? headerClassName(cellParams) : headerClassName) : '',
|
|
214
|
-
headerCellClassName ? (XEUtils.isFunction(headerCellClassName) ? headerCellClassName(cellParams) : headerCellClassName) : ''
|
|
215
|
-
], style: headerCellStyle ? (XEUtils.isFunction(headerCellStyle) ? headerCellStyle(cellParams) : headerCellStyle) : null }, thAttrs), thOns), { key: showCustomHeader ? `${colid}${$columnIndex}` : (columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex) }), [
|
|
216
|
-
h('div', {
|
|
217
|
-
class: ['vxe-cell', {
|
|
218
|
-
'c--title': showTitle,
|
|
219
|
-
'c--tooltip': showTooltip,
|
|
220
|
-
'c--ellipsis': showEllipsis
|
|
221
|
-
}],
|
|
222
|
-
style: tcStyle
|
|
223
|
-
}, isVNPreEmptyStatus || (isOptimizeMode && fixedHiddenColumn)
|
|
224
|
-
? []
|
|
225
|
-
: [
|
|
226
|
-
h('div', {
|
|
227
|
-
colid,
|
|
228
|
-
class: 'vxe-cell--wrapper vxe-header-cell--wrapper'
|
|
229
|
-
}, column.renderHeader(cellParams))
|
|
230
|
-
]),
|
|
231
|
-
/**
|
|
232
|
-
* 列宽拖动
|
|
233
|
-
*/
|
|
234
|
-
!fixedHiddenColumn && showResizable && (!showCustomHeader || isLastRow)
|
|
235
|
-
? h('div', {
|
|
236
|
-
class: 'vxe-cell--col-resizable',
|
|
237
|
-
onMousedown: (evnt) => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
238
|
-
onDblclick: (evnt) => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
239
|
-
})
|
|
240
|
-
: renderEmptyElement($xeTable)
|
|
241
|
-
]);
|
|
242
|
-
});
|
|
116
|
+
const thAttrs = {
|
|
117
|
+
colid
|
|
243
118
|
};
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
const isPadding = XEUtils.isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding;
|
|
270
|
-
const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
271
|
-
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
272
|
-
const showEllipsis = headOverflow === 'ellipsis';
|
|
273
|
-
const showTitle = headOverflow === 'title';
|
|
274
|
-
const showTooltip = headOverflow === true ? headerTooltipOpts.mode === 'tooltip' : headOverflow === 'tooltip';
|
|
275
|
-
const hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
276
|
-
let hasFilter = false;
|
|
277
|
-
let firstFilterOption = null;
|
|
278
|
-
if (filters) {
|
|
279
|
-
firstFilterOption = filters[0];
|
|
280
|
-
hasFilter = filters.some((item) => item.checked);
|
|
281
|
-
}
|
|
282
|
-
const columnIndex = colRest.index;
|
|
283
|
-
const _columnIndex = colRest._index;
|
|
284
|
-
const cellParams = {
|
|
285
|
-
$table: $xeTable,
|
|
286
|
-
$grid: $xeGrid,
|
|
287
|
-
$gantt: $xeGantt,
|
|
288
|
-
column,
|
|
289
|
-
columnIndex,
|
|
290
|
-
$columnIndex,
|
|
291
|
-
_columnIndex,
|
|
292
|
-
option: firstFilterOption,
|
|
293
|
-
fixed: fixedType,
|
|
294
|
-
source: sourceType,
|
|
295
|
-
type: renderType,
|
|
296
|
-
isHidden: fixedHiddenColumn,
|
|
297
|
-
hasFilter
|
|
298
|
-
};
|
|
299
|
-
const thAttrs = {
|
|
300
|
-
colid
|
|
301
|
-
};
|
|
302
|
-
const isLastColumn = $columnIndex === cols.length - 1;
|
|
303
|
-
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
304
|
-
const tcStyle = {};
|
|
305
|
-
if (hasEllipsis) {
|
|
306
|
-
tcStyle.height = `${currCellHeight}px`;
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
tcStyle.minHeight = `${currCellHeight}px`;
|
|
310
|
-
}
|
|
311
|
-
return h('th', Object.assign({ class: ['vxe-table--column vxe-header--column is--floating-filters', colid, fixedHiddenColumn ? 'fixed--hidden' : 'fixed--visible', {
|
|
312
|
-
[`col--${headAlign}`]: headAlign,
|
|
313
|
-
[`col--${type}`]: type,
|
|
314
|
-
'col--last': isLastColumn,
|
|
315
|
-
'col--fixed': column.fixed,
|
|
316
|
-
'col--ellipsis': hasEllipsis,
|
|
317
|
-
'fixed--width': !isAutoCellWidth,
|
|
318
|
-
'is--padding': isPadding,
|
|
319
|
-
'is--sortable': column.sortable,
|
|
320
|
-
'col--current': currColFlag && currentCol === column
|
|
321
|
-
}
|
|
322
|
-
], key: colid }, thAttrs), [
|
|
323
|
-
h('div', {
|
|
324
|
-
class: ['vxe-cell', '' + (cellClassName || ''), {
|
|
325
|
-
'c--title': showTitle,
|
|
326
|
-
'c--tooltip': showTooltip,
|
|
327
|
-
'c--ellipsis': showEllipsis
|
|
328
|
-
}],
|
|
329
|
-
style: tcStyle
|
|
330
|
-
}, isOptimizeMode && fixedHiddenColumn && !floatingFilters
|
|
331
|
-
? []
|
|
332
|
-
: [
|
|
333
|
-
h('div', {
|
|
334
|
-
colid,
|
|
335
|
-
class: 'vxe-cell--wrapper vxe-header-cell--wrapper'
|
|
336
|
-
}, flSlot
|
|
337
|
-
? $xeTable.callSlot(flSlot, cellParams)
|
|
338
|
-
: (rtFloatingFilter && firstFilterOption
|
|
339
|
-
? getSlotVNs(rtFloatingFilter(filterRender, cellParams))
|
|
340
|
-
: []))
|
|
341
|
-
])
|
|
342
|
-
]);
|
|
343
|
-
});
|
|
119
|
+
let isMergeCell = false;
|
|
120
|
+
if (!showCustomHeader) {
|
|
121
|
+
thAttrs.colspan = column.colSpan > 1 ? column.colSpan : null;
|
|
122
|
+
thAttrs.rowspan = column.rowSpan > 1 ? column.rowSpan : null;
|
|
123
|
+
}
|
|
124
|
+
if (mergeHeadFlag && mergeHeaderList.length && (showCustomHeader || isLastRow)) {
|
|
125
|
+
const spanRest = mergeHeaderCellMaps[`${_rowIndex}:${showCustomHeader ? $columnIndex : _columnIndex}`];
|
|
126
|
+
if (spanRest) {
|
|
127
|
+
const { rowspan, colspan } = spanRest;
|
|
128
|
+
if (!rowspan || !colspan) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
if (rowspan > 1) {
|
|
132
|
+
isMergeCell = true;
|
|
133
|
+
thAttrs.rowspan = rowspan;
|
|
134
|
+
}
|
|
135
|
+
if (colspan > 1) {
|
|
136
|
+
isMergeCell = true;
|
|
137
|
+
thAttrs.colspan = colspan;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const thOns = {
|
|
142
|
+
onClick: (evnt) => $xeTable.triggerHeaderCellClickEvent(evnt, cellParams),
|
|
143
|
+
onDblclick: (evnt) => $xeTable.triggerHeaderCellDblclickEvent(evnt, cellParams)
|
|
344
144
|
};
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
145
|
+
const isColDragCell = columnOpts.drag && columnDragOpts.trigger === "cell";
|
|
146
|
+
let isDisabledDrag = false;
|
|
147
|
+
if (isColDragCell) {
|
|
148
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
149
|
+
}
|
|
150
|
+
if (hasEnableConf(mouseConfig, mouseOpts) || isColDragCell) {
|
|
151
|
+
thOns.onMousedown = (evnt) => $xeTable.triggerHeaderCellMousedownEvent(evnt, cellParams);
|
|
152
|
+
}
|
|
153
|
+
if (columnOpts.drag) {
|
|
154
|
+
thOns.onDragstart = $xeTable.handleHeaderCellDragDragstartEvent;
|
|
155
|
+
thOns.onDragend = $xeTable.handleHeaderCellDragDragendEvent;
|
|
156
|
+
thOns.onDragover = $xeTable.handleHeaderCellDragDragoverEvent;
|
|
157
|
+
if (isColDragCell) {
|
|
158
|
+
thOns.onMouseup = $xeTable.handleHeaderCellDragMouseupEvent;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const isLastColumn = $columnIndex === cols.length - 1;
|
|
162
|
+
const showResizable = XEUtils.isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
163
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === "auto" || column.width === "auto");
|
|
164
|
+
let isVNPreEmptyStatus = false;
|
|
165
|
+
if (isOptimizeMode && overflowX && !isGroup && !isMergeCell) {
|
|
166
|
+
if (!dragCol || dragCol.id !== colid) {
|
|
167
|
+
if (scrollXLoad && tableColumn.length > 10 && !column.fixed && !virtualXOpts.immediate && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
168
|
+
isVNPreEmptyStatus = true;
|
|
368
169
|
}
|
|
369
|
-
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const tcStyle = {};
|
|
173
|
+
if (hasEllipsis) {
|
|
174
|
+
tcStyle.height = `${currCellHeight}px`;
|
|
175
|
+
} else {
|
|
176
|
+
tcStyle.minHeight = `${currCellHeight}px`;
|
|
177
|
+
}
|
|
178
|
+
if (showCustomHeader) {
|
|
179
|
+
} else if (isColGroup && !isLastRow) {
|
|
180
|
+
let childWidth = 0;
|
|
181
|
+
XEUtils.eachTree(column.children, (childRow) => {
|
|
182
|
+
if (childRow.visible && (!childRow.children || !childRow.children.length)) {
|
|
183
|
+
childWidth += childRow.renderWidth;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
tcStyle.width = `${childWidth}px`;
|
|
187
|
+
}
|
|
188
|
+
return h("th", {
|
|
189
|
+
class: [
|
|
190
|
+
"vxe-table--column vxe-header--column",
|
|
191
|
+
colid,
|
|
192
|
+
fixedHiddenColumn ? "fixed--hidden" : "fixed--visible",
|
|
193
|
+
{
|
|
194
|
+
[`col--${headAlign}`]: headAlign,
|
|
195
|
+
[`col--${type}`]: type,
|
|
196
|
+
"col--last": isLastColumn,
|
|
197
|
+
"col--fixed": column.fixed,
|
|
198
|
+
"col--group": isColGroup,
|
|
199
|
+
"col--ellipsis": hasEllipsis,
|
|
200
|
+
"fixed--width": !isAutoCellWidth,
|
|
201
|
+
"is--pg-top": isCellPaddingTop,
|
|
202
|
+
"is--pg-bottom": isCellPaddingBottom,
|
|
203
|
+
"is--pg-left": isCellPaddingLeft,
|
|
204
|
+
"is--pg-right": isCellPaddingRight,
|
|
205
|
+
"is--sortable": column.sortable,
|
|
206
|
+
"col--filter": !!filters,
|
|
207
|
+
"is--filter-active": hasFilter,
|
|
208
|
+
"is--drag-active": columnOpts.drag && !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
|
|
209
|
+
"is--drag-disabled": columnOpts.drag && isDisabledDrag,
|
|
210
|
+
"col--current": currColFlag && currentCol === column
|
|
211
|
+
},
|
|
212
|
+
headerClassName ? XEUtils.isFunction(headerClassName) ? headerClassName(cellParams) : headerClassName : "",
|
|
213
|
+
headerCellClassName ? XEUtils.isFunction(headerCellClassName) ? headerCellClassName(cellParams) : headerCellClassName : ""
|
|
214
|
+
],
|
|
215
|
+
style: headerCellStyle ? XEUtils.isFunction(headerCellStyle) ? headerCellStyle(cellParams) : headerCellStyle : null,
|
|
216
|
+
...thAttrs,
|
|
217
|
+
...thOns,
|
|
218
|
+
key: showCustomHeader ? `${colid}${$columnIndex}` : columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
219
|
+
}, [
|
|
220
|
+
h("div", {
|
|
221
|
+
class: ["vxe-cell", {
|
|
222
|
+
"c--title": showTitle,
|
|
223
|
+
"c--tooltip": showTooltip,
|
|
224
|
+
"c--ellipsis": showEllipsis
|
|
225
|
+
}],
|
|
226
|
+
style: tcStyle
|
|
227
|
+
}, isVNPreEmptyStatus || isOptimizeMode && fixedHiddenColumn ? [] : [
|
|
228
|
+
h("div", {
|
|
229
|
+
colid,
|
|
230
|
+
class: "vxe-cell--wrapper vxe-header-cell--wrapper"
|
|
231
|
+
}, column.renderHeader(cellParams))
|
|
232
|
+
]),
|
|
233
|
+
/**
|
|
234
|
+
* 列宽拖动
|
|
235
|
+
*/
|
|
236
|
+
!fixedHiddenColumn && showResizable && (!showCustomHeader || isLastRow) ? h("div", {
|
|
237
|
+
class: "vxe-cell--col-resizable",
|
|
238
|
+
onMousedown: (evnt) => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
239
|
+
onDblclick: (evnt) => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
240
|
+
}) : renderEmptyElement($xeTable)
|
|
241
|
+
]);
|
|
242
|
+
});
|
|
243
|
+
};
|
|
244
|
+
const renderFilterRows = (isOptimizeMode, cols) => {
|
|
245
|
+
const $xeGrid = $xeTable.xeGrid;
|
|
246
|
+
const $xeGantt = $xeTable.xeGantt;
|
|
247
|
+
const { fixedType } = props;
|
|
248
|
+
const { showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign } = tableProps;
|
|
249
|
+
const { overflowX, currColFlag } = tableReactData;
|
|
250
|
+
const { fullColumnIdData, currentCol } = tableInternalData;
|
|
251
|
+
const headerTooltipOpts = computeHeaderTooltipOpts.value;
|
|
252
|
+
const cellOpts = computeCellOpts.value;
|
|
253
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
254
|
+
const headerCellOpts = computeHeaderCellOpts.value;
|
|
255
|
+
const floatingFilterOpts = computeFloatingFilterOpts.value;
|
|
256
|
+
const rendererOpts = computeRendererOpts.value;
|
|
257
|
+
const { cellClassName } = floatingFilterOpts;
|
|
258
|
+
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight;
|
|
259
|
+
return cols.map((column, $columnIndex) => {
|
|
260
|
+
const { type, showHeaderOverflow, headerAlign, align, filters, editRender, cellRender, floatingFilters, filterRender, slots } = column;
|
|
261
|
+
const colid = column.id;
|
|
262
|
+
const colRest = fullColumnIdData[colid] || {};
|
|
263
|
+
const renderOpts = editRender || cellRender;
|
|
264
|
+
const flSlot = slots ? slots.floatingFilter || slots["floating-filter"] : null;
|
|
265
|
+
const compConf = renderOpts && renderOpts.name ? rendererOpts[renderOpts.name] || renderer.get(renderOpts.name) : null;
|
|
266
|
+
const flCompConf = isEnableConf(filterRender) && filterRender.name ? rendererOpts[filterRender.name] || renderer.get(filterRender.name) : null;
|
|
267
|
+
const rtFloatingFilter = flCompConf ? flCompConf.renderTableFloatingFilter : null;
|
|
268
|
+
const fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
269
|
+
const isPadding = XEUtils.isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding;
|
|
270
|
+
const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
271
|
+
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : "") || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : "") || allAlign;
|
|
272
|
+
const showEllipsis = headOverflow === "ellipsis";
|
|
273
|
+
const showTitle = headOverflow === "title";
|
|
274
|
+
const showTooltip = headOverflow === true ? headerTooltipOpts.mode === "tooltip" : headOverflow === "tooltip";
|
|
275
|
+
const hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
276
|
+
let hasFilter = false;
|
|
277
|
+
let firstFilterOption = null;
|
|
278
|
+
if (filters) {
|
|
279
|
+
firstFilterOption = filters[0];
|
|
280
|
+
hasFilter = filters.some((item) => item.checked);
|
|
281
|
+
}
|
|
282
|
+
const columnIndex = colRest.index;
|
|
283
|
+
const _columnIndex = colRest._index;
|
|
284
|
+
const cellParams = {
|
|
285
|
+
$table: $xeTable,
|
|
286
|
+
$grid: $xeGrid,
|
|
287
|
+
$gantt: $xeGantt,
|
|
288
|
+
column,
|
|
289
|
+
columnIndex,
|
|
290
|
+
$columnIndex,
|
|
291
|
+
_columnIndex,
|
|
292
|
+
option: firstFilterOption,
|
|
293
|
+
fixed: fixedType,
|
|
294
|
+
source: sourceType,
|
|
295
|
+
type: renderType,
|
|
296
|
+
isHidden: fixedHiddenColumn,
|
|
297
|
+
hasFilter
|
|
370
298
|
};
|
|
371
|
-
const
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
299
|
+
const thAttrs = {
|
|
300
|
+
colid
|
|
301
|
+
};
|
|
302
|
+
const isLastColumn = $columnIndex === cols.length - 1;
|
|
303
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === "auto" || column.width === "auto");
|
|
304
|
+
const tcStyle = {};
|
|
305
|
+
if (hasEllipsis) {
|
|
306
|
+
tcStyle.height = `${currCellHeight}px`;
|
|
307
|
+
} else {
|
|
308
|
+
tcStyle.minHeight = `${currCellHeight}px`;
|
|
309
|
+
}
|
|
310
|
+
return h("th", {
|
|
311
|
+
class: [
|
|
312
|
+
"vxe-table--column vxe-header--column is--floating-filters",
|
|
313
|
+
colid,
|
|
314
|
+
fixedHiddenColumn ? "fixed--hidden" : "fixed--visible",
|
|
315
|
+
{
|
|
316
|
+
[`col--${headAlign}`]: headAlign,
|
|
317
|
+
[`col--${type}`]: type,
|
|
318
|
+
"col--last": isLastColumn,
|
|
319
|
+
"col--fixed": column.fixed,
|
|
320
|
+
"col--ellipsis": hasEllipsis,
|
|
321
|
+
"fixed--width": !isAutoCellWidth,
|
|
322
|
+
"is--padding": isPadding,
|
|
323
|
+
"is--sortable": column.sortable,
|
|
324
|
+
"col--current": currColFlag && currentCol === column
|
|
383
325
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
326
|
+
],
|
|
327
|
+
key: colid,
|
|
328
|
+
...thAttrs
|
|
329
|
+
}, [
|
|
330
|
+
h("div", {
|
|
331
|
+
class: ["vxe-cell", "" + (cellClassName || ""), {
|
|
332
|
+
"c--title": showTitle,
|
|
333
|
+
"c--tooltip": showTooltip,
|
|
334
|
+
"c--ellipsis": showEllipsis
|
|
335
|
+
}],
|
|
336
|
+
style: tcStyle
|
|
337
|
+
}, isOptimizeMode && fixedHiddenColumn && !floatingFilters ? [] : [
|
|
338
|
+
h("div", {
|
|
339
|
+
colid,
|
|
340
|
+
class: "vxe-cell--wrapper vxe-header-cell--wrapper"
|
|
341
|
+
}, flSlot ? $xeTable.callSlot(flSlot, cellParams) : rtFloatingFilter && firstFilterOption ? getSlotVNs(rtFloatingFilter(filterRender, cellParams)) : [])
|
|
342
|
+
])
|
|
343
|
+
]);
|
|
344
|
+
});
|
|
345
|
+
};
|
|
346
|
+
const renderHeads = (isGroup, isOptimizeMode, headerGroups, renderColumnList) => {
|
|
347
|
+
const { fixedType } = props;
|
|
348
|
+
const { headerRowClassName, headerRowStyle } = tableProps;
|
|
349
|
+
const floatingFilterOpts = computeFloatingFilterOpts.value;
|
|
350
|
+
const rowVNs = headerGroups.map((cols, _rowIndex) => {
|
|
351
|
+
const params = { $table: $xeTable, rowIndex: _rowIndex, _rowIndex, $rowIndex: _rowIndex, fixed: fixedType, type: renderType };
|
|
352
|
+
return h("tr", {
|
|
353
|
+
key: _rowIndex,
|
|
354
|
+
class: [
|
|
355
|
+
"vxe-header--row",
|
|
356
|
+
headerRowClassName ? XEUtils.isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ""
|
|
357
|
+
],
|
|
358
|
+
style: headerRowStyle ? XEUtils.isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle : null
|
|
359
|
+
}, renderRows(isGroup, isOptimizeMode, headerGroups, _rowIndex, cols));
|
|
360
|
+
});
|
|
361
|
+
if (floatingFilterOpts.enabled) {
|
|
362
|
+
rowVNs.push(
|
|
363
|
+
h("tr", {
|
|
364
|
+
key: "ff",
|
|
365
|
+
class: [
|
|
366
|
+
"vxe-header--row is--floating-filters",
|
|
367
|
+
"" + (floatingFilterOpts.rowClassName || "")
|
|
368
|
+
]
|
|
369
|
+
}, renderFilterRows(isOptimizeMode, renderColumnList))
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
return rowVNs;
|
|
373
|
+
};
|
|
374
|
+
const renderVN = () => {
|
|
375
|
+
const { fixedType, fixedColumn, tableColumn } = props;
|
|
376
|
+
const { mouseConfig } = tableProps;
|
|
377
|
+
const { isGroup, isColLoading, overflowX, scrollXLoad, dragCol } = tableReactData;
|
|
378
|
+
const { visibleColumn, fullColumnIdData } = tableInternalData;
|
|
379
|
+
const mouseOpts = computeMouseOpts.value;
|
|
380
|
+
const isHeaderRenderOptimize = computeIsHeaderRenderOptimize.value;
|
|
381
|
+
let renderHeaderList = headerColumn.value || [];
|
|
382
|
+
let renderColumnList = tableColumn;
|
|
383
|
+
const isOptimizeMode = isHeaderRenderOptimize;
|
|
384
|
+
if (isGroup) {
|
|
385
|
+
renderColumnList = visibleColumn;
|
|
386
|
+
} else {
|
|
387
|
+
if (!isOptimizeMode || !isColLoading && (fixedType || !overflowX)) {
|
|
388
|
+
renderColumnList = visibleColumn;
|
|
389
|
+
}
|
|
390
|
+
if (fixedType) {
|
|
391
|
+
if (isOptimizeMode) {
|
|
392
|
+
renderColumnList = fixedColumn || [];
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
renderHeaderList = [renderColumnList];
|
|
396
|
+
}
|
|
397
|
+
if (!fixedType && !isGroup) {
|
|
398
|
+
if (scrollXLoad && dragCol) {
|
|
399
|
+
if (renderColumnList.length > 2) {
|
|
400
|
+
const dCowRest = fullColumnIdData[dragCol.id];
|
|
401
|
+
if (dCowRest) {
|
|
402
|
+
const dcIndex = dCowRest._index;
|
|
403
|
+
const firstCol = renderColumnList[0];
|
|
404
|
+
const lastCol = renderColumnList[renderColumnList.length - 1];
|
|
405
|
+
const firstColRest = fullColumnIdData[firstCol.id];
|
|
406
|
+
const lastColRest = fullColumnIdData[lastCol.id];
|
|
407
|
+
if (firstColRest && lastColRest) {
|
|
408
|
+
const fcIndex = firstColRest._index;
|
|
409
|
+
const lcIndex = lastColRest._index;
|
|
410
|
+
if (dcIndex < fcIndex) {
|
|
411
|
+
renderColumnList = [dragCol].concat(renderColumnList);
|
|
412
|
+
renderHeaderList = [[dragCol].concat(renderHeaderList[0])].concat(renderHeaderList.slice(1));
|
|
413
|
+
} else if (dcIndex > lcIndex) {
|
|
414
|
+
renderColumnList = renderColumnList.concat([dragCol]);
|
|
415
|
+
renderHeaderList = [renderHeaderList[0].concat([dragCol])].concat(renderHeaderList.slice(1));
|
|
393
416
|
}
|
|
394
|
-
|
|
417
|
+
}
|
|
395
418
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
return h("div", {
|
|
423
|
+
ref: refElem,
|
|
424
|
+
class: ["vxe-table--header-wrapper", fixedType ? `fixed-${fixedType}--wrapper` : "body--wrapper"],
|
|
425
|
+
xid: xID
|
|
426
|
+
}, [
|
|
427
|
+
h("div", {
|
|
428
|
+
ref: refHeaderScroll,
|
|
429
|
+
class: "vxe-table--header-inner-wrapper",
|
|
430
|
+
onScroll(evnt) {
|
|
431
|
+
$xeTable.triggerHeaderScrollEvent(evnt, fixedType);
|
|
432
|
+
}
|
|
433
|
+
}, [
|
|
434
|
+
fixedType ? renderEmptyElement($xeTable) : h("div", {
|
|
435
|
+
ref: refHeaderXSpace,
|
|
436
|
+
class: "vxe-body--x-space"
|
|
437
|
+
}),
|
|
438
|
+
h("table", {
|
|
439
|
+
ref: refHeaderTable,
|
|
440
|
+
class: "vxe-table--header",
|
|
441
|
+
xid: xID,
|
|
442
|
+
cellspacing: 0,
|
|
443
|
+
cellpadding: 0,
|
|
444
|
+
border: 0,
|
|
445
|
+
xvm: isOptimizeMode ? "1" : null
|
|
446
|
+
}, [
|
|
447
|
+
/**
|
|
448
|
+
* 列宽
|
|
449
|
+
*/
|
|
450
|
+
h("colgroup", {
|
|
451
|
+
ref: refHeaderColgroup
|
|
452
|
+
}, renderColumnList.map((column, $columnIndex) => {
|
|
453
|
+
return h("col", {
|
|
454
|
+
name: column.id,
|
|
455
|
+
key: $columnIndex,
|
|
456
|
+
style: {
|
|
457
|
+
width: `${column.renderWidth}px`
|
|
421
458
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
class: 'vxe-table--cell-active-area'
|
|
490
|
-
}),
|
|
491
|
-
h('span', {
|
|
492
|
-
class: 'vxe-table--cell-col-status-area'
|
|
493
|
-
})
|
|
494
|
-
])
|
|
495
|
-
: renderEmptyElement($xeTable)
|
|
496
|
-
])
|
|
497
|
-
]);
|
|
498
|
-
};
|
|
499
|
-
watch(() => props.tableColumn, uploadColumn);
|
|
500
|
-
onMounted(() => {
|
|
501
|
-
nextTick(() => {
|
|
502
|
-
const { fixedType } = props;
|
|
503
|
-
const { internalData } = $xeTable;
|
|
504
|
-
const { elemStore } = internalData;
|
|
505
|
-
const prefix = `${fixedType || 'main'}-header-`;
|
|
506
|
-
elemStore[`${prefix}wrapper`] = refElem;
|
|
507
|
-
elemStore[`${prefix}scroll`] = refHeaderScroll;
|
|
508
|
-
elemStore[`${prefix}table`] = refHeaderTable;
|
|
509
|
-
elemStore[`${prefix}colgroup`] = refHeaderColgroup;
|
|
510
|
-
elemStore[`${prefix}list`] = refHeaderTHead;
|
|
511
|
-
elemStore[`${prefix}xSpace`] = refHeaderXSpace;
|
|
512
|
-
elemStore[`${prefix}repair`] = refHeaderBorderRepair;
|
|
513
|
-
uploadColumn();
|
|
514
|
-
});
|
|
515
|
-
});
|
|
516
|
-
onUnmounted(() => {
|
|
517
|
-
const { fixedType } = props;
|
|
518
|
-
const { internalData } = $xeTable;
|
|
519
|
-
const { elemStore } = internalData;
|
|
520
|
-
const prefix = `${fixedType || 'main'}-header-`;
|
|
521
|
-
elemStore[`${prefix}wrapper`] = null;
|
|
522
|
-
elemStore[`${prefix}scroll`] = null;
|
|
523
|
-
elemStore[`${prefix}table`] = null;
|
|
524
|
-
elemStore[`${prefix}colgroup`] = null;
|
|
525
|
-
elemStore[`${prefix}list`] = null;
|
|
526
|
-
elemStore[`${prefix}xSpace`] = null;
|
|
527
|
-
elemStore[`${prefix}repair`] = null;
|
|
528
|
-
});
|
|
529
|
-
return renderVN;
|
|
530
|
-
}
|
|
459
|
+
});
|
|
460
|
+
})),
|
|
461
|
+
/**
|
|
462
|
+
* 头部
|
|
463
|
+
*/
|
|
464
|
+
h("thead", {
|
|
465
|
+
ref: refHeaderTHead
|
|
466
|
+
}, renderHeads(isGroup, isOptimizeMode, renderHeaderList, renderColumnList))
|
|
467
|
+
]),
|
|
468
|
+
hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? h("div", {
|
|
469
|
+
class: "vxe-table--cell-area",
|
|
470
|
+
xid: xID
|
|
471
|
+
}, [
|
|
472
|
+
h("span", {
|
|
473
|
+
class: "vxe-table--cell-main-area"
|
|
474
|
+
}),
|
|
475
|
+
h("span", {
|
|
476
|
+
class: "vxe-table--cell-clip-area"
|
|
477
|
+
}),
|
|
478
|
+
h("span", {
|
|
479
|
+
class: "vxe-table--cell-extend-area"
|
|
480
|
+
}),
|
|
481
|
+
h("span", {
|
|
482
|
+
class: "vxe-table--cell-multi-area"
|
|
483
|
+
}),
|
|
484
|
+
h("span", {
|
|
485
|
+
class: "vxe-table--cell-active-area"
|
|
486
|
+
}),
|
|
487
|
+
h("span", {
|
|
488
|
+
class: "vxe-table--cell-col-status-area"
|
|
489
|
+
})
|
|
490
|
+
]) : renderEmptyElement($xeTable)
|
|
491
|
+
])
|
|
492
|
+
]);
|
|
493
|
+
};
|
|
494
|
+
watch(() => props.tableColumn, uploadColumn);
|
|
495
|
+
onMounted(() => {
|
|
496
|
+
nextTick(() => {
|
|
497
|
+
const { fixedType } = props;
|
|
498
|
+
const { internalData } = $xeTable;
|
|
499
|
+
const { elemStore } = internalData;
|
|
500
|
+
const prefix = `${fixedType || "main"}-header-`;
|
|
501
|
+
elemStore[`${prefix}wrapper`] = refElem;
|
|
502
|
+
elemStore[`${prefix}scroll`] = refHeaderScroll;
|
|
503
|
+
elemStore[`${prefix}table`] = refHeaderTable;
|
|
504
|
+
elemStore[`${prefix}colgroup`] = refHeaderColgroup;
|
|
505
|
+
elemStore[`${prefix}list`] = refHeaderTHead;
|
|
506
|
+
elemStore[`${prefix}xSpace`] = refHeaderXSpace;
|
|
507
|
+
elemStore[`${prefix}repair`] = refHeaderBorderRepair;
|
|
508
|
+
uploadColumn();
|
|
509
|
+
});
|
|
510
|
+
});
|
|
511
|
+
onUnmounted(() => {
|
|
512
|
+
const { fixedType } = props;
|
|
513
|
+
const { internalData } = $xeTable;
|
|
514
|
+
const { elemStore } = internalData;
|
|
515
|
+
const prefix = `${fixedType || "main"}-header-`;
|
|
516
|
+
elemStore[`${prefix}wrapper`] = null;
|
|
517
|
+
elemStore[`${prefix}scroll`] = null;
|
|
518
|
+
elemStore[`${prefix}table`] = null;
|
|
519
|
+
elemStore[`${prefix}colgroup`] = null;
|
|
520
|
+
elemStore[`${prefix}list`] = null;
|
|
521
|
+
elemStore[`${prefix}xSpace`] = null;
|
|
522
|
+
elemStore[`${prefix}repair`] = null;
|
|
523
|
+
});
|
|
524
|
+
return renderVN;
|
|
525
|
+
}
|
|
531
526
|
});
|
|
527
|
+
export {
|
|
528
|
+
header_default as default
|
|
529
|
+
};
|