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
|
@@ -1,625 +1,617 @@
|
|
|
1
|
-
import { h, ref, computed, inject, createCommentVNode, reactive, nextTick, onBeforeUnmount } from
|
|
2
|
-
import { defineVxeComponent } from
|
|
3
|
-
import XEUtils from
|
|
4
|
-
import { VxeUI } from
|
|
5
|
-
import { getSlotVNs } from
|
|
6
|
-
import { createComponentLog } from
|
|
7
|
-
const { warnLog, errLog } = createComponentLog(
|
|
1
|
+
import { h, ref, computed, inject, createCommentVNode, reactive, nextTick, onBeforeUnmount } from "vue";
|
|
2
|
+
import { defineVxeComponent } from "../../ui/src/comp";
|
|
3
|
+
import XEUtils from "xe-utils";
|
|
4
|
+
import { VxeUI } from "../../ui";
|
|
5
|
+
import { getSlotVNs } from "../../ui/src/vn";
|
|
6
|
+
import { createComponentLog } from "../../ui/src/log";
|
|
7
|
+
const { warnLog, errLog } = createComponentLog("toolbar");
|
|
8
8
|
const { getConfig, getIcon, getI18n, renderer, commands, createEvent, useFns } = VxeUI;
|
|
9
9
|
function createReactData() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
return {
|
|
11
|
+
isRefresh: false,
|
|
12
|
+
connectFlag: 0,
|
|
13
|
+
columns: []
|
|
14
|
+
};
|
|
15
15
|
}
|
|
16
16
|
function createInternalData() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
return {
|
|
18
|
+
connectTable: null
|
|
19
|
+
};
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
tools: {
|
|
42
|
-
type: Array,
|
|
43
|
-
default: () => getConfig().toolbar.tools
|
|
44
|
-
},
|
|
45
|
-
perfect: {
|
|
46
|
-
type: Boolean,
|
|
47
|
-
default: () => getConfig().toolbar.perfect
|
|
48
|
-
},
|
|
49
|
-
size: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: () => getConfig().toolbar.size || getConfig().size
|
|
52
|
-
},
|
|
53
|
-
className: [String, Function]
|
|
21
|
+
var toolbar_default = defineVxeComponent({
|
|
22
|
+
name: "VxeToolbar",
|
|
23
|
+
props: {
|
|
24
|
+
loading: Boolean,
|
|
25
|
+
refresh: [Boolean, Object],
|
|
26
|
+
refreshOptions: Object,
|
|
27
|
+
import: [Boolean, Object],
|
|
28
|
+
importOptions: Object,
|
|
29
|
+
export: [Boolean, Object],
|
|
30
|
+
exportOptions: Object,
|
|
31
|
+
print: [Boolean, Object],
|
|
32
|
+
printOptions: Object,
|
|
33
|
+
zoom: [Boolean, Object],
|
|
34
|
+
zoomOptions: Object,
|
|
35
|
+
custom: [Boolean, Object],
|
|
36
|
+
customOptions: Object,
|
|
37
|
+
buttons: {
|
|
38
|
+
type: Array,
|
|
39
|
+
default: () => getConfig().toolbar.buttons
|
|
54
40
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
41
|
+
tools: {
|
|
42
|
+
type: Array,
|
|
43
|
+
default: () => getConfig().toolbar.tools
|
|
44
|
+
},
|
|
45
|
+
perfect: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: () => getConfig().toolbar.perfect
|
|
48
|
+
},
|
|
49
|
+
size: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: () => getConfig().toolbar.size || getConfig().size
|
|
52
|
+
},
|
|
53
|
+
className: [String, Function]
|
|
54
|
+
},
|
|
55
|
+
emits: [
|
|
56
|
+
"button-click",
|
|
57
|
+
"tool-click"
|
|
58
|
+
],
|
|
59
|
+
setup(props, context) {
|
|
60
|
+
const { slots, emit } = context;
|
|
61
|
+
const xID = XEUtils.uniqueId();
|
|
62
|
+
const VxeUIButtonComponent = VxeUI.getComponent("VxeButton");
|
|
63
|
+
const $xeGrid = inject("$xeGrid", null);
|
|
64
|
+
const $xeGantt = inject("$xeGantt", null);
|
|
65
|
+
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
66
|
+
const { computeSize } = useFns.useSize(props);
|
|
67
|
+
const reactData = reactive(createReactData());
|
|
68
|
+
const internalData = createInternalData();
|
|
69
|
+
const refElem = ref();
|
|
70
|
+
const refMaps = {
|
|
71
|
+
refElem
|
|
72
|
+
};
|
|
73
|
+
const $xeToolbar = {
|
|
74
|
+
xID,
|
|
75
|
+
props,
|
|
76
|
+
context,
|
|
77
|
+
reactData,
|
|
78
|
+
internalData,
|
|
79
|
+
getRefMaps: () => refMaps
|
|
80
|
+
};
|
|
81
|
+
let toolbarMethods = {};
|
|
82
|
+
const computeRefreshOpts = computed(() => {
|
|
83
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.refresh, true), props.refreshOptions, props.refresh);
|
|
84
|
+
});
|
|
85
|
+
const computeImportOpts = computed(() => {
|
|
86
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.import, true), props.importOptions, props.import);
|
|
87
|
+
});
|
|
88
|
+
const computeExportOpts = computed(() => {
|
|
89
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.export, true), props.exportOptions, props.export);
|
|
90
|
+
});
|
|
91
|
+
const computePrintOpts = computed(() => {
|
|
92
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.print, true), props.printOptions, props.print);
|
|
93
|
+
});
|
|
94
|
+
const computeZoomOpts = computed(() => {
|
|
95
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.zoom, true), props.zoomOptions, props.zoom);
|
|
96
|
+
});
|
|
97
|
+
const computeCustomOpts = computed(() => {
|
|
98
|
+
return Object.assign({}, XEUtils.clone(getConfig().toolbar.custom, true), props.customOptions, props.custom);
|
|
99
|
+
});
|
|
100
|
+
const computeTableCustomOpts = computed(() => {
|
|
101
|
+
const { connectTable } = internalData;
|
|
102
|
+
const $table = connectTable;
|
|
103
|
+
if (reactData.connectFlag || $table) {
|
|
104
|
+
if ($table) {
|
|
105
|
+
const { computeCustomOpts: computeCustomOpts2 } = $table.getComputeMaps();
|
|
106
|
+
return computeCustomOpts2.value;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return { trigger: "" };
|
|
110
|
+
});
|
|
111
|
+
const computeTrigger = computed(() => {
|
|
112
|
+
const tableCustomOpts = computeTableCustomOpts.value;
|
|
113
|
+
return tableCustomOpts.trigger;
|
|
114
|
+
});
|
|
115
|
+
const checkTable = () => {
|
|
116
|
+
const { connectTable } = internalData;
|
|
117
|
+
const $table = connectTable;
|
|
118
|
+
if ($table) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
errLog("vxe.error.barUnableLink");
|
|
122
|
+
};
|
|
123
|
+
const handleClickSettingEvent = ({ $event }) => {
|
|
124
|
+
const { connectTable } = internalData;
|
|
125
|
+
const $table = connectTable;
|
|
126
|
+
if ($table) {
|
|
127
|
+
if ($table.triggerCustomEvent) {
|
|
128
|
+
$table.triggerCustomEvent($event);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const handleMouseenterSettingEvent = ({ $event }) => {
|
|
133
|
+
const { connectTable } = internalData;
|
|
134
|
+
const $table = connectTable;
|
|
135
|
+
if ($table) {
|
|
136
|
+
$table.customOpenEvent($event);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const handleMouseleaveSettingEvent = ({ $event }) => {
|
|
140
|
+
const { connectTable } = internalData;
|
|
141
|
+
const $table = connectTable;
|
|
142
|
+
if ($table) {
|
|
143
|
+
const { customStore } = $table.reactData;
|
|
144
|
+
customStore.activeBtn = false;
|
|
145
|
+
setTimeout(() => {
|
|
146
|
+
if (!customStore.activeBtn && !customStore.activeWrapper) {
|
|
147
|
+
$table.customCloseEvent($event);
|
|
148
|
+
}
|
|
149
|
+
}, 350);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
const refreshEvent = ({ $event }) => {
|
|
153
|
+
const { isRefresh } = reactData;
|
|
154
|
+
const refreshOpts = computeRefreshOpts.value;
|
|
155
|
+
if (!isRefresh) {
|
|
156
|
+
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
157
|
+
if (queryMethod) {
|
|
158
|
+
reactData.isRefresh = true;
|
|
159
|
+
try {
|
|
160
|
+
Promise.resolve(queryMethod({})).catch((e) => e).then(() => {
|
|
161
|
+
reactData.isRefresh = false;
|
|
162
|
+
});
|
|
163
|
+
} catch (e) {
|
|
164
|
+
reactData.isRefresh = false;
|
|
165
|
+
}
|
|
166
|
+
} else if ($xeGGWrapper) {
|
|
167
|
+
reactData.isRefresh = true;
|
|
168
|
+
$xeGGWrapper.triggerToolbarCommitEvent({ code: refreshOpts.code || "reload" }, $event).catch(() => {
|
|
169
|
+
}).then(() => {
|
|
170
|
+
reactData.isRefresh = false;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
const zoomEvent = ({ $event }) => {
|
|
176
|
+
if ($xeGGWrapper) {
|
|
177
|
+
$xeGGWrapper.triggerZoomEvent($event);
|
|
178
|
+
} else {
|
|
179
|
+
warnLog("vxe.error.notProp", ["zoom"]);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
const importEvent = () => {
|
|
183
|
+
if (checkTable()) {
|
|
184
|
+
const { connectTable } = internalData;
|
|
185
|
+
const $table = connectTable;
|
|
186
|
+
if ($table) {
|
|
187
|
+
$table.importData();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
const openImportEvent = () => {
|
|
192
|
+
if (checkTable()) {
|
|
193
|
+
const { connectTable } = internalData;
|
|
194
|
+
const $table = connectTable;
|
|
195
|
+
if ($table) {
|
|
196
|
+
$table.openImport();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
const exportEvent = () => {
|
|
201
|
+
if (checkTable()) {
|
|
202
|
+
const { connectTable } = internalData;
|
|
203
|
+
const $table = connectTable;
|
|
204
|
+
if ($table) {
|
|
205
|
+
$table.exportData();
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
const openExportEvent = () => {
|
|
210
|
+
if (checkTable()) {
|
|
211
|
+
const { connectTable } = internalData;
|
|
212
|
+
const $table = connectTable;
|
|
213
|
+
if ($table) {
|
|
214
|
+
$table.openExport();
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
const printEvent = () => {
|
|
219
|
+
if (checkTable()) {
|
|
220
|
+
const { connectTable } = internalData;
|
|
221
|
+
const $table = connectTable;
|
|
222
|
+
if ($table) {
|
|
223
|
+
$table.print();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
const openPrintEvent = () => {
|
|
228
|
+
if (checkTable()) {
|
|
229
|
+
const { connectTable } = internalData;
|
|
230
|
+
const $table = connectTable;
|
|
231
|
+
if ($table) {
|
|
232
|
+
$table.openPrint();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
const handleDefaultCodeEvent = (eventParams, item, cb) => {
|
|
237
|
+
switch (item.code) {
|
|
238
|
+
case "print":
|
|
239
|
+
printEvent();
|
|
240
|
+
break;
|
|
241
|
+
case "open_print":
|
|
242
|
+
openPrintEvent();
|
|
243
|
+
break;
|
|
244
|
+
case "custom":
|
|
245
|
+
handleClickSettingEvent(eventParams);
|
|
246
|
+
break;
|
|
247
|
+
case "export":
|
|
248
|
+
exportEvent();
|
|
249
|
+
break;
|
|
250
|
+
case "open_export":
|
|
251
|
+
openExportEvent();
|
|
252
|
+
break;
|
|
253
|
+
case "import":
|
|
254
|
+
importEvent();
|
|
255
|
+
break;
|
|
256
|
+
case "open_import":
|
|
257
|
+
openImportEvent();
|
|
258
|
+
break;
|
|
259
|
+
case "zoom":
|
|
260
|
+
zoomEvent(eventParams);
|
|
261
|
+
break;
|
|
262
|
+
case "refresh":
|
|
263
|
+
refreshEvent(eventParams);
|
|
264
|
+
break;
|
|
265
|
+
default:
|
|
266
|
+
cb();
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
const btnEvent = (eventParams, item) => {
|
|
271
|
+
const { $event } = eventParams;
|
|
272
|
+
const { connectTable } = internalData;
|
|
273
|
+
const $table = connectTable;
|
|
274
|
+
const { code } = item;
|
|
275
|
+
if (code) {
|
|
276
|
+
handleDefaultCodeEvent(eventParams, item, () => {
|
|
277
|
+
if ($xeGGWrapper) {
|
|
278
|
+
$xeGGWrapper.triggerToolbarBtnEvent(item, $event);
|
|
279
|
+
} else {
|
|
280
|
+
const gCommandOpts = commands.get(code);
|
|
281
|
+
const params = { code, button: item, $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
|
|
282
|
+
if (gCommandOpts) {
|
|
283
|
+
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
284
|
+
if (tCommandMethod) {
|
|
285
|
+
tCommandMethod(params);
|
|
286
|
+
} else {
|
|
287
|
+
errLog("vxe.error.notCommands", [code]);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
$xeToolbar.dispatchEvent("button-click", params, $event);
|
|
291
|
+
}
|
|
100
292
|
});
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
const tolEvent = (eventParams, item) => {
|
|
296
|
+
const { $event } = eventParams;
|
|
297
|
+
const { connectTable } = internalData;
|
|
298
|
+
const $table = connectTable;
|
|
299
|
+
const { code } = item;
|
|
300
|
+
if (code) {
|
|
301
|
+
handleDefaultCodeEvent(eventParams, item, () => {
|
|
302
|
+
if ($xeGGWrapper) {
|
|
303
|
+
$xeGGWrapper.triggerToolbarTolEvent(item, $event);
|
|
304
|
+
} else {
|
|
305
|
+
const gCommandOpts = commands.get(code);
|
|
306
|
+
const params = { code, button: null, tool: item, $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
|
|
307
|
+
if (gCommandOpts) {
|
|
308
|
+
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
309
|
+
if (tCommandMethod) {
|
|
310
|
+
tCommandMethod(params);
|
|
311
|
+
} else {
|
|
312
|
+
errLog("vxe.error.notCommands", [code]);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
$xeToolbar.dispatchEvent("tool-click", params, $event);
|
|
316
|
+
}
|
|
111
317
|
});
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
321
|
+
emit(type, createEvent(evnt, { $toolbar: $xeToolbar }, params));
|
|
322
|
+
};
|
|
323
|
+
toolbarMethods = {
|
|
324
|
+
dispatchEvent,
|
|
325
|
+
syncUpdate(params) {
|
|
326
|
+
internalData.connectTable = params.$table;
|
|
327
|
+
reactData.columns = params.collectColumn;
|
|
328
|
+
reactData.connectFlag++;
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
Object.assign($xeToolbar, toolbarMethods);
|
|
332
|
+
const renderDropdowns = (item, isBtn) => {
|
|
333
|
+
const { dropdowns } = item;
|
|
334
|
+
const downVNs = [];
|
|
335
|
+
if (dropdowns) {
|
|
336
|
+
return dropdowns.map((child, index) => {
|
|
337
|
+
if (child.visible === false) {
|
|
338
|
+
return createCommentVNode();
|
|
339
|
+
}
|
|
340
|
+
return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
341
|
+
key: index,
|
|
342
|
+
...Object.assign({}, child, {
|
|
343
|
+
content: child.content || child.name,
|
|
344
|
+
options: void 0
|
|
345
|
+
}),
|
|
346
|
+
onClick: (eventParams) => isBtn ? btnEvent(eventParams, child) : tolEvent(eventParams, child)
|
|
347
|
+
}) : createCommentVNode();
|
|
115
348
|
});
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
try {
|
|
161
|
-
Promise.resolve(queryMethod({})).catch((e) => e).then(() => {
|
|
162
|
-
reactData.isRefresh = false;
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
catch (e) {
|
|
166
|
-
reactData.isRefresh = false;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
else if ($xeGGWrapper) {
|
|
170
|
-
reactData.isRefresh = true;
|
|
171
|
-
$xeGGWrapper.triggerToolbarCommitEvent({ code: refreshOpts.code || 'reload' }, $event).catch(() => { }).then(() => {
|
|
172
|
-
reactData.isRefresh = false;
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
const zoomEvent = ({ $event }) => {
|
|
178
|
-
if ($xeGGWrapper) {
|
|
179
|
-
$xeGGWrapper.triggerZoomEvent($event);
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
warnLog('vxe.error.notProp', ['zoom']);
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
const importEvent = () => {
|
|
186
|
-
if (checkTable()) {
|
|
187
|
-
const { connectTable } = internalData;
|
|
188
|
-
const $table = connectTable;
|
|
189
|
-
if ($table) {
|
|
190
|
-
$table.importData();
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
const openImportEvent = () => {
|
|
195
|
-
if (checkTable()) {
|
|
196
|
-
const { connectTable } = internalData;
|
|
197
|
-
const $table = connectTable;
|
|
198
|
-
if ($table) {
|
|
199
|
-
$table.openImport();
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
const exportEvent = () => {
|
|
204
|
-
if (checkTable()) {
|
|
205
|
-
const { connectTable } = internalData;
|
|
206
|
-
const $table = connectTable;
|
|
207
|
-
if ($table) {
|
|
208
|
-
$table.exportData();
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
const openExportEvent = () => {
|
|
213
|
-
if (checkTable()) {
|
|
214
|
-
const { connectTable } = internalData;
|
|
215
|
-
const $table = connectTable;
|
|
216
|
-
if ($table) {
|
|
217
|
-
$table.openExport();
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
const printEvent = () => {
|
|
222
|
-
if (checkTable()) {
|
|
223
|
-
const { connectTable } = internalData;
|
|
224
|
-
const $table = connectTable;
|
|
225
|
-
if ($table) {
|
|
226
|
-
$table.print();
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
const openPrintEvent = () => {
|
|
231
|
-
if (checkTable()) {
|
|
232
|
-
const { connectTable } = internalData;
|
|
233
|
-
const $table = connectTable;
|
|
234
|
-
if ($table) {
|
|
235
|
-
$table.openPrint();
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
const handleDefaultCodeEvent = (eventParams, item, cb) => {
|
|
240
|
-
switch (item.code) {
|
|
241
|
-
case 'print':
|
|
242
|
-
printEvent();
|
|
243
|
-
break;
|
|
244
|
-
case 'open_print':
|
|
245
|
-
openPrintEvent();
|
|
246
|
-
break;
|
|
247
|
-
case 'custom':
|
|
248
|
-
handleClickSettingEvent(eventParams);
|
|
249
|
-
break;
|
|
250
|
-
case 'export':
|
|
251
|
-
exportEvent();
|
|
252
|
-
break;
|
|
253
|
-
case 'open_export':
|
|
254
|
-
openExportEvent();
|
|
255
|
-
break;
|
|
256
|
-
case 'import':
|
|
257
|
-
importEvent();
|
|
258
|
-
break;
|
|
259
|
-
case 'open_import':
|
|
260
|
-
openImportEvent();
|
|
261
|
-
break;
|
|
262
|
-
case 'zoom':
|
|
263
|
-
zoomEvent(eventParams);
|
|
264
|
-
break;
|
|
265
|
-
case 'refresh':
|
|
266
|
-
refreshEvent(eventParams);
|
|
267
|
-
break;
|
|
268
|
-
default:
|
|
269
|
-
cb();
|
|
270
|
-
break;
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
const btnEvent = (eventParams, item) => {
|
|
274
|
-
const { $event } = eventParams;
|
|
275
|
-
const { connectTable } = internalData;
|
|
276
|
-
const $table = connectTable;
|
|
277
|
-
const { code } = item;
|
|
278
|
-
if (code) {
|
|
279
|
-
handleDefaultCodeEvent(eventParams, item, () => {
|
|
280
|
-
if ($xeGGWrapper) {
|
|
281
|
-
$xeGGWrapper.triggerToolbarBtnEvent(item, $event);
|
|
282
|
-
}
|
|
283
|
-
else {
|
|
284
|
-
const gCommandOpts = commands.get(code);
|
|
285
|
-
const params = { code, button: item, $table: $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
|
|
286
|
-
if (gCommandOpts) {
|
|
287
|
-
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
288
|
-
if (tCommandMethod) {
|
|
289
|
-
tCommandMethod(params);
|
|
290
|
-
}
|
|
291
|
-
else {
|
|
292
|
-
errLog('vxe.error.notCommands', [code]);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
$xeToolbar.dispatchEvent('button-click', params, $event);
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
const tolEvent = (eventParams, item) => {
|
|
301
|
-
const { $event } = eventParams;
|
|
302
|
-
const { connectTable } = internalData;
|
|
303
|
-
const $table = connectTable;
|
|
304
|
-
const { code } = item;
|
|
305
|
-
if (code) {
|
|
306
|
-
handleDefaultCodeEvent(eventParams, item, () => {
|
|
307
|
-
if ($xeGGWrapper) {
|
|
308
|
-
$xeGGWrapper.triggerToolbarTolEvent(item, $event);
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
const gCommandOpts = commands.get(code);
|
|
312
|
-
const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $gantt: $xeGantt, $event };
|
|
313
|
-
if (gCommandOpts) {
|
|
314
|
-
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
315
|
-
if (tCommandMethod) {
|
|
316
|
-
tCommandMethod(params);
|
|
317
|
-
}
|
|
318
|
-
else {
|
|
319
|
-
errLog('vxe.error.notCommands', [code]);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
$xeToolbar.dispatchEvent('tool-click', params, $event);
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
const dispatchEvent = (type, params, evnt) => {
|
|
328
|
-
emit(type, createEvent(evnt, { $toolbar: $xeToolbar }, params));
|
|
329
|
-
};
|
|
330
|
-
toolbarMethods = {
|
|
331
|
-
dispatchEvent,
|
|
332
|
-
syncUpdate(params) {
|
|
333
|
-
internalData.connectTable = params.$table;
|
|
334
|
-
reactData.columns = params.collectColumn;
|
|
335
|
-
reactData.connectFlag++;
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
Object.assign($xeToolbar, toolbarMethods);
|
|
339
|
-
const renderDropdowns = (item, isBtn) => {
|
|
340
|
-
const { dropdowns } = item;
|
|
341
|
-
const downVNs = [];
|
|
342
|
-
if (dropdowns) {
|
|
343
|
-
return dropdowns.map((child, index) => {
|
|
344
|
-
if (child.visible === false) {
|
|
345
|
-
return createCommentVNode();
|
|
346
|
-
}
|
|
347
|
-
return VxeUIButtonComponent
|
|
348
|
-
? h(VxeUIButtonComponent, Object.assign(Object.assign({ key: index }, Object.assign({}, child, {
|
|
349
|
-
content: child.content || child.name,
|
|
350
|
-
options: undefined
|
|
351
|
-
})), { onClick: (eventParams) => isBtn ? btnEvent(eventParams, child) : tolEvent(eventParams, child) }))
|
|
352
|
-
: createCommentVNode();
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
return downVNs;
|
|
356
|
-
};
|
|
357
|
-
/**
|
|
358
|
-
* 渲染按钮
|
|
359
|
-
*/
|
|
360
|
-
const renderLeftBtns = () => {
|
|
361
|
-
const { buttons } = props;
|
|
362
|
-
const { connectTable } = internalData;
|
|
363
|
-
const $table = connectTable;
|
|
364
|
-
const buttonsSlot = slots.buttons;
|
|
365
|
-
const buttonPrefixSlot = slots.buttonPrefix || slots['button-prefix'];
|
|
366
|
-
const buttonSuffixSlot = slots.buttonSuffix || slots['button-suffix'];
|
|
367
|
-
const btnVNs = [];
|
|
368
|
-
if (buttons) {
|
|
369
|
-
const { computeRendererOpts } = $table ? $table.getComputeMaps() : {};
|
|
370
|
-
const rendererOpts = (computeRendererOpts ? computeRendererOpts.value : null) || {};
|
|
371
|
-
buttons.forEach((item, index) => {
|
|
372
|
-
const { dropdowns, buttonRender } = item;
|
|
373
|
-
if (item.visible !== false) {
|
|
374
|
-
const compConf = buttonRender && buttonRender.name ? (rendererOpts[buttonRender.name] || renderer.get(buttonRender.name)) : null;
|
|
375
|
-
if (buttonRender && compConf && compConf.renderToolbarButton) {
|
|
376
|
-
const toolbarButtonClassName = compConf.toolbarButtonClassName;
|
|
377
|
-
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, button: item };
|
|
378
|
-
btnVNs.push(h('span', {
|
|
379
|
-
key: `br${item.code || index}`,
|
|
380
|
-
class: ['vxe-button--item', toolbarButtonClassName ? (XEUtils.isFunction(toolbarButtonClassName) ? toolbarButtonClassName(params) : toolbarButtonClassName) : '']
|
|
381
|
-
}, getSlotVNs(compConf.renderToolbarButton(buttonRender, params))));
|
|
382
|
-
}
|
|
383
|
-
else {
|
|
384
|
-
if (VxeUIButtonComponent) {
|
|
385
|
-
btnVNs.push(h(VxeUIButtonComponent, Object.assign(Object.assign({ key: `bd${item.code || index}` }, Object.assign({}, item, {
|
|
386
|
-
content: item.content || item.name,
|
|
387
|
-
options: undefined
|
|
388
|
-
})), { onClick: (eventParams) => btnEvent(eventParams, item) }), dropdowns && dropdowns.length
|
|
389
|
-
? {
|
|
390
|
-
dropdowns: () => renderDropdowns(item, true)
|
|
391
|
-
}
|
|
392
|
-
: {}));
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
return [
|
|
399
|
-
h('div', {
|
|
400
|
-
class: 'vxe-button--prefix-wrapper'
|
|
401
|
-
}, buttonPrefixSlot ? getSlotVNs(buttonPrefixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : []),
|
|
402
|
-
h('div', {
|
|
403
|
-
class: 'vxe-button--item-wrapper'
|
|
404
|
-
}, buttonsSlot ? getSlotVNs(buttonsSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : btnVNs),
|
|
405
|
-
h('div', {
|
|
406
|
-
class: 'vxe-button--suffix-wrapper'
|
|
407
|
-
}, buttonSuffixSlot ? getSlotVNs(buttonSuffixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : [])
|
|
408
|
-
];
|
|
409
|
-
};
|
|
410
|
-
/**
|
|
411
|
-
* 渲染右侧工具
|
|
412
|
-
*/
|
|
413
|
-
const renderRightTools = () => {
|
|
414
|
-
const { tools } = props;
|
|
415
|
-
const { connectTable } = internalData;
|
|
416
|
-
const $table = connectTable;
|
|
417
|
-
const toolsSlot = slots.tools;
|
|
418
|
-
const toolPrefixSlot = slots.toolPrefix || slots['tool-prefix'];
|
|
419
|
-
const toolSuffixSlot = slots.toolSuffix || slots['tool-suffix'];
|
|
420
|
-
const btnVNs = [];
|
|
421
|
-
if (tools) {
|
|
422
|
-
const { computeRendererOpts } = $table ? $table.getComputeMaps() : {};
|
|
423
|
-
const rendererOpts = (computeRendererOpts ? computeRendererOpts.value : null) || {};
|
|
424
|
-
tools.forEach((item, tIndex) => {
|
|
425
|
-
const { dropdowns, toolRender } = item;
|
|
426
|
-
if (item.visible !== false) {
|
|
427
|
-
const compConf = toolRender && toolRender.name ? (rendererOpts[toolRender.name] || renderer.get(toolRender.name)) : null;
|
|
428
|
-
if (toolRender && compConf && compConf.renderToolbarTool) {
|
|
429
|
-
const toolbarToolClassName = compConf.toolbarToolClassName;
|
|
430
|
-
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table: $table, tool: item };
|
|
431
|
-
btnVNs.push(h('span', {
|
|
432
|
-
key: tIndex,
|
|
433
|
-
class: ['vxe-tool--item', toolbarToolClassName ? (XEUtils.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName) : '']
|
|
434
|
-
}, getSlotVNs(compConf.renderToolbarTool(toolRender, params))));
|
|
435
|
-
}
|
|
436
|
-
else {
|
|
437
|
-
if (VxeUIButtonComponent) {
|
|
438
|
-
btnVNs.push(h(VxeUIButtonComponent, Object.assign(Object.assign({ key: tIndex }, Object.assign({}, item, {
|
|
439
|
-
content: item.content || item.name,
|
|
440
|
-
options: undefined
|
|
441
|
-
})), { onClick: (eventParams) => tolEvent(eventParams, item) }), dropdowns && dropdowns.length
|
|
442
|
-
? {
|
|
443
|
-
dropdowns: () => renderDropdowns(item, false)
|
|
444
|
-
}
|
|
445
|
-
: {}));
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
|
-
return [
|
|
452
|
-
h('div', {
|
|
453
|
-
class: 'vxe-tool--prefix-wrapper'
|
|
454
|
-
}, toolPrefixSlot ? getSlotVNs(toolPrefixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : []),
|
|
455
|
-
h('div', {
|
|
456
|
-
class: 'vxe-tool--item-wrapper'
|
|
457
|
-
}, toolsSlot ? getSlotVNs(toolsSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : btnVNs),
|
|
458
|
-
h('div', {
|
|
459
|
-
class: 'vxe-tool--suffix-wrapper'
|
|
460
|
-
}, toolSuffixSlot ? getSlotVNs(toolSuffixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table: $table })) : [])
|
|
461
|
-
];
|
|
462
|
-
};
|
|
463
|
-
const renderToolImport = () => {
|
|
464
|
-
const importOpts = computeImportOpts.value;
|
|
465
|
-
return VxeUIButtonComponent
|
|
466
|
-
? h(VxeUIButtonComponent, {
|
|
467
|
-
key: 'import',
|
|
468
|
-
circle: true,
|
|
469
|
-
icon: importOpts.icon || getIcon().TOOLBAR_TOOLS_IMPORT,
|
|
470
|
-
title: getI18n('vxe.toolbar.import'),
|
|
471
|
-
onClick: openImportEvent
|
|
472
|
-
})
|
|
473
|
-
: createCommentVNode();
|
|
474
|
-
};
|
|
475
|
-
const renderToolExport = () => {
|
|
476
|
-
const exportOpts = computeExportOpts.value;
|
|
477
|
-
return VxeUIButtonComponent
|
|
478
|
-
? h(VxeUIButtonComponent, {
|
|
479
|
-
key: 'export',
|
|
480
|
-
circle: true,
|
|
481
|
-
icon: exportOpts.icon || getIcon().TOOLBAR_TOOLS_EXPORT,
|
|
482
|
-
title: getI18n('vxe.toolbar.export'),
|
|
483
|
-
onClick: openExportEvent
|
|
484
|
-
})
|
|
485
|
-
: createCommentVNode();
|
|
486
|
-
};
|
|
487
|
-
const renderToolPrint = () => {
|
|
488
|
-
const printOpts = computePrintOpts.value;
|
|
489
|
-
return VxeUIButtonComponent
|
|
490
|
-
? h(VxeUIButtonComponent, {
|
|
491
|
-
key: 'print',
|
|
492
|
-
circle: true,
|
|
493
|
-
icon: printOpts.icon || getIcon().TOOLBAR_TOOLS_PRINT,
|
|
494
|
-
title: getI18n('vxe.toolbar.print'),
|
|
495
|
-
onClick: openPrintEvent
|
|
496
|
-
})
|
|
497
|
-
: createCommentVNode();
|
|
498
|
-
};
|
|
499
|
-
const renderToolRefresh = () => {
|
|
500
|
-
const refreshOpts = computeRefreshOpts.value;
|
|
501
|
-
return VxeUIButtonComponent
|
|
502
|
-
? h(VxeUIButtonComponent, {
|
|
503
|
-
key: 'refresh',
|
|
504
|
-
circle: true,
|
|
505
|
-
icon: reactData.isRefresh ? (refreshOpts.iconLoading || getIcon().TOOLBAR_TOOLS_REFRESH_LOADING) : (refreshOpts.icon || getIcon().TOOLBAR_TOOLS_REFRESH),
|
|
506
|
-
title: getI18n('vxe.toolbar.refresh'),
|
|
507
|
-
onClick: refreshEvent
|
|
508
|
-
})
|
|
509
|
-
: createCommentVNode();
|
|
510
|
-
};
|
|
511
|
-
const renderToolZoom = () => {
|
|
512
|
-
const zoomOpts = computeZoomOpts.value;
|
|
513
|
-
return $xeGGWrapper && VxeUIButtonComponent
|
|
514
|
-
? h(VxeUIButtonComponent, {
|
|
515
|
-
key: 'zoom',
|
|
516
|
-
circle: true,
|
|
517
|
-
icon: $xeGGWrapper.isMaximized() ? (zoomOpts.iconOut || getIcon().TOOLBAR_TOOLS_MINIMIZE) : (zoomOpts.iconIn || getIcon().TOOLBAR_TOOLS_FULLSCREEN),
|
|
518
|
-
title: getI18n(`vxe.toolbar.zoom${$xeGGWrapper.isMaximized() ? 'Out' : 'In'}`),
|
|
519
|
-
onClick: zoomEvent
|
|
520
|
-
})
|
|
521
|
-
: createCommentVNode();
|
|
522
|
-
};
|
|
523
|
-
const renderToolCustom = () => {
|
|
524
|
-
const customOpts = computeCustomOpts.value;
|
|
525
|
-
const btnTrigger = computeTrigger.value;
|
|
526
|
-
const customBtnOns = {};
|
|
527
|
-
if (btnTrigger === 'manual') {
|
|
528
|
-
// 手动触发
|
|
529
|
-
}
|
|
530
|
-
else if (btnTrigger === 'hover') {
|
|
531
|
-
// hover 触发
|
|
532
|
-
customBtnOns.onMouseenter = handleMouseenterSettingEvent;
|
|
533
|
-
customBtnOns.onMouseleave = handleMouseleaveSettingEvent;
|
|
534
|
-
}
|
|
535
|
-
else {
|
|
536
|
-
// 点击触发
|
|
537
|
-
customBtnOns.onClick = handleClickSettingEvent;
|
|
538
|
-
}
|
|
539
|
-
return VxeUIButtonComponent
|
|
540
|
-
? h(VxeUIButtonComponent, Object.assign({ key: 'custom', circle: true, icon: customOpts.icon || getIcon().TOOLBAR_TOOLS_CUSTOM, title: getI18n('vxe.toolbar.custom'), className: 'vxe-toolbar-custom-target' }, customBtnOns))
|
|
541
|
-
: createCommentVNode();
|
|
542
|
-
};
|
|
543
|
-
const renderVN = () => {
|
|
544
|
-
const { perfect, loading, refresh, zoom, custom, className } = props;
|
|
545
|
-
const vSize = computeSize.value;
|
|
546
|
-
return h('div', {
|
|
547
|
-
ref: refElem,
|
|
548
|
-
class: ['vxe-toolbar', className ? (XEUtils.isFunction(className) ? className({ $toolbar: $xeToolbar }) : className) : '', {
|
|
549
|
-
[`size--${vSize}`]: vSize,
|
|
550
|
-
'is--perfect': perfect,
|
|
551
|
-
'is--loading': loading
|
|
552
|
-
}]
|
|
553
|
-
}, [
|
|
554
|
-
h('div', {
|
|
555
|
-
class: 'vxe-buttons--wrapper'
|
|
556
|
-
}, renderLeftBtns()),
|
|
557
|
-
h('div', {
|
|
558
|
-
class: 'vxe-tools--wrapper'
|
|
559
|
-
}, renderRightTools()),
|
|
560
|
-
h('div', {
|
|
561
|
-
class: 'vxe-tools--operate'
|
|
562
|
-
}, [
|
|
563
|
-
props.import ? renderToolImport() : createCommentVNode(),
|
|
564
|
-
props.export ? renderToolExport() : createCommentVNode(),
|
|
565
|
-
props.print ? renderToolPrint() : createCommentVNode(),
|
|
566
|
-
refresh ? renderToolRefresh() : createCommentVNode(),
|
|
567
|
-
zoom && $xeGGWrapper ? renderToolZoom() : createCommentVNode(),
|
|
568
|
-
custom ? renderToolCustom() : createCommentVNode()
|
|
569
|
-
])
|
|
570
|
-
]);
|
|
571
|
-
};
|
|
572
|
-
$xeToolbar.renderVN = renderVN;
|
|
573
|
-
nextTick(() => {
|
|
574
|
-
const refreshOpts = computeRefreshOpts.value;
|
|
575
|
-
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
576
|
-
if (props.refresh && !$xeGGWrapper && !queryMethod) {
|
|
577
|
-
warnLog('vxe.error.notFunc', ['queryMethod']);
|
|
578
|
-
}
|
|
579
|
-
if (XEUtils.isPlainObject(props.custom)) {
|
|
580
|
-
warnLog('vxe.error.delProp', ['custom={...}', 'custom=boolean & custom-options={...}']);
|
|
581
|
-
}
|
|
582
|
-
if (XEUtils.isPlainObject(props.print)) {
|
|
583
|
-
warnLog('vxe.error.delProp', ['print={...}', 'print=boolean & print-options={...}']);
|
|
584
|
-
}
|
|
585
|
-
if (XEUtils.isPlainObject(props.export)) {
|
|
586
|
-
warnLog('vxe.error.delProp', ['export={...}', 'export=boolean & export-options={...}']);
|
|
587
|
-
}
|
|
588
|
-
if (XEUtils.isPlainObject(props.import)) {
|
|
589
|
-
warnLog('vxe.error.delProp', ['import={...}', 'import=boolean & import-options={...}']);
|
|
590
|
-
}
|
|
591
|
-
if (XEUtils.isPlainObject(props.refresh)) {
|
|
592
|
-
warnLog('vxe.error.delProp', ['refresh={...}', 'refresh=boolean & refresh-options={...}']);
|
|
593
|
-
}
|
|
594
|
-
if (XEUtils.isPlainObject(props.refresh)) {
|
|
595
|
-
warnLog('vxe.error.delProp', ['zoom={...}', 'zoom=boolean & zoom-options={...}']);
|
|
596
|
-
}
|
|
597
|
-
const customOpts = computeCustomOpts.value;
|
|
598
|
-
if (customOpts.isFooter) {
|
|
599
|
-
warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter']);
|
|
600
|
-
}
|
|
601
|
-
if (customOpts.showFooter) {
|
|
602
|
-
warnLog('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter']);
|
|
603
|
-
}
|
|
604
|
-
if (customOpts.immediate) {
|
|
605
|
-
warnLog('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate']);
|
|
606
|
-
}
|
|
607
|
-
if (customOpts.trigger) {
|
|
608
|
-
warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger']);
|
|
609
|
-
}
|
|
610
|
-
if (props.refresh || props.import || props.export || props.print || props.zoom) {
|
|
611
|
-
if (!VxeUIButtonComponent) {
|
|
612
|
-
errLog('vxe.error.reqComp', ['vxe-button']);
|
|
613
|
-
}
|
|
614
|
-
}
|
|
349
|
+
}
|
|
350
|
+
return downVNs;
|
|
351
|
+
};
|
|
352
|
+
const renderLeftBtns = () => {
|
|
353
|
+
const { buttons } = props;
|
|
354
|
+
const { connectTable } = internalData;
|
|
355
|
+
const $table = connectTable;
|
|
356
|
+
const buttonsSlot = slots.buttons;
|
|
357
|
+
const buttonPrefixSlot = slots.buttonPrefix || slots["button-prefix"];
|
|
358
|
+
const buttonSuffixSlot = slots.buttonSuffix || slots["button-suffix"];
|
|
359
|
+
const btnVNs = [];
|
|
360
|
+
if (buttons) {
|
|
361
|
+
const { computeRendererOpts } = $table ? $table.getComputeMaps() : {};
|
|
362
|
+
const rendererOpts = (computeRendererOpts ? computeRendererOpts.value : null) || {};
|
|
363
|
+
buttons.forEach((item, index) => {
|
|
364
|
+
const { dropdowns, buttonRender } = item;
|
|
365
|
+
if (item.visible !== false) {
|
|
366
|
+
const compConf = buttonRender && buttonRender.name ? rendererOpts[buttonRender.name] || renderer.get(buttonRender.name) : null;
|
|
367
|
+
if (buttonRender && compConf && compConf.renderToolbarButton) {
|
|
368
|
+
const toolbarButtonClassName = compConf.toolbarButtonClassName;
|
|
369
|
+
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table, button: item };
|
|
370
|
+
btnVNs.push(
|
|
371
|
+
h("span", {
|
|
372
|
+
key: `br${item.code || index}`,
|
|
373
|
+
class: ["vxe-button--item", toolbarButtonClassName ? XEUtils.isFunction(toolbarButtonClassName) ? toolbarButtonClassName(params) : toolbarButtonClassName : ""]
|
|
374
|
+
}, getSlotVNs(compConf.renderToolbarButton(buttonRender, params)))
|
|
375
|
+
);
|
|
376
|
+
} else {
|
|
377
|
+
if (VxeUIButtonComponent) {
|
|
378
|
+
btnVNs.push(
|
|
379
|
+
h(VxeUIButtonComponent, {
|
|
380
|
+
key: `bd${item.code || index}`,
|
|
381
|
+
...Object.assign({}, item, {
|
|
382
|
+
content: item.content || item.name,
|
|
383
|
+
options: void 0
|
|
384
|
+
}),
|
|
385
|
+
onClick: (eventParams) => btnEvent(eventParams, item)
|
|
386
|
+
}, dropdowns && dropdowns.length ? {
|
|
387
|
+
dropdowns: () => renderDropdowns(item, true)
|
|
388
|
+
} : {})
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
615
393
|
});
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
394
|
+
}
|
|
395
|
+
return [
|
|
396
|
+
h("div", {
|
|
397
|
+
class: "vxe-button--prefix-wrapper"
|
|
398
|
+
}, buttonPrefixSlot ? getSlotVNs(buttonPrefixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : []),
|
|
399
|
+
h("div", {
|
|
400
|
+
class: "vxe-button--item-wrapper"
|
|
401
|
+
}, buttonsSlot ? getSlotVNs(buttonsSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : btnVNs),
|
|
402
|
+
h("div", {
|
|
403
|
+
class: "vxe-button--suffix-wrapper"
|
|
404
|
+
}, buttonSuffixSlot ? getSlotVNs(buttonSuffixSlot({ buttons: buttons || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : [])
|
|
405
|
+
];
|
|
406
|
+
};
|
|
407
|
+
const renderRightTools = () => {
|
|
408
|
+
const { tools } = props;
|
|
409
|
+
const { connectTable } = internalData;
|
|
410
|
+
const $table = connectTable;
|
|
411
|
+
const toolsSlot = slots.tools;
|
|
412
|
+
const toolPrefixSlot = slots.toolPrefix || slots["tool-prefix"];
|
|
413
|
+
const toolSuffixSlot = slots.toolSuffix || slots["tool-suffix"];
|
|
414
|
+
const btnVNs = [];
|
|
415
|
+
if (tools) {
|
|
416
|
+
const { computeRendererOpts } = $table ? $table.getComputeMaps() : {};
|
|
417
|
+
const rendererOpts = (computeRendererOpts ? computeRendererOpts.value : null) || {};
|
|
418
|
+
tools.forEach((item, tIndex) => {
|
|
419
|
+
const { dropdowns, toolRender } = item;
|
|
420
|
+
if (item.visible !== false) {
|
|
421
|
+
const compConf = toolRender && toolRender.name ? rendererOpts[toolRender.name] || renderer.get(toolRender.name) : null;
|
|
422
|
+
if (toolRender && compConf && compConf.renderToolbarTool) {
|
|
423
|
+
const toolbarToolClassName = compConf.toolbarToolClassName;
|
|
424
|
+
const params = { $grid: $xeGrid, $gantt: $xeGantt, $table, tool: item };
|
|
425
|
+
btnVNs.push(
|
|
426
|
+
h("span", {
|
|
427
|
+
key: tIndex,
|
|
428
|
+
class: ["vxe-tool--item", toolbarToolClassName ? XEUtils.isFunction(toolbarToolClassName) ? toolbarToolClassName(params) : toolbarToolClassName : ""]
|
|
429
|
+
}, getSlotVNs(compConf.renderToolbarTool(toolRender, params)))
|
|
430
|
+
);
|
|
431
|
+
} else {
|
|
432
|
+
if (VxeUIButtonComponent) {
|
|
433
|
+
btnVNs.push(
|
|
434
|
+
h(VxeUIButtonComponent, {
|
|
435
|
+
key: tIndex,
|
|
436
|
+
...Object.assign({}, item, {
|
|
437
|
+
content: item.content || item.name,
|
|
438
|
+
options: void 0
|
|
439
|
+
}),
|
|
440
|
+
onClick: (eventParams) => tolEvent(eventParams, item)
|
|
441
|
+
}, dropdowns && dropdowns.length ? {
|
|
442
|
+
dropdowns: () => renderDropdowns(item, false)
|
|
443
|
+
} : {})
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
619
448
|
});
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
449
|
+
}
|
|
450
|
+
return [
|
|
451
|
+
h("div", {
|
|
452
|
+
class: "vxe-tool--prefix-wrapper"
|
|
453
|
+
}, toolPrefixSlot ? getSlotVNs(toolPrefixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : []),
|
|
454
|
+
h("div", {
|
|
455
|
+
class: "vxe-tool--item-wrapper"
|
|
456
|
+
}, toolsSlot ? getSlotVNs(toolsSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : btnVNs),
|
|
457
|
+
h("div", {
|
|
458
|
+
class: "vxe-tool--suffix-wrapper"
|
|
459
|
+
}, toolSuffixSlot ? getSlotVNs(toolSuffixSlot({ tools: tools || [], $grid: $xeGrid, $gantt: $xeGantt, $table })) : [])
|
|
460
|
+
];
|
|
461
|
+
};
|
|
462
|
+
const renderToolImport = () => {
|
|
463
|
+
const importOpts = computeImportOpts.value;
|
|
464
|
+
return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
465
|
+
key: "import",
|
|
466
|
+
circle: true,
|
|
467
|
+
icon: importOpts.icon || getIcon().TOOLBAR_TOOLS_IMPORT,
|
|
468
|
+
title: getI18n("vxe.toolbar.import"),
|
|
469
|
+
onClick: openImportEvent
|
|
470
|
+
}) : createCommentVNode();
|
|
471
|
+
};
|
|
472
|
+
const renderToolExport = () => {
|
|
473
|
+
const exportOpts = computeExportOpts.value;
|
|
474
|
+
return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
475
|
+
key: "export",
|
|
476
|
+
circle: true,
|
|
477
|
+
icon: exportOpts.icon || getIcon().TOOLBAR_TOOLS_EXPORT,
|
|
478
|
+
title: getI18n("vxe.toolbar.export"),
|
|
479
|
+
onClick: openExportEvent
|
|
480
|
+
}) : createCommentVNode();
|
|
481
|
+
};
|
|
482
|
+
const renderToolPrint = () => {
|
|
483
|
+
const printOpts = computePrintOpts.value;
|
|
484
|
+
return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
485
|
+
key: "print",
|
|
486
|
+
circle: true,
|
|
487
|
+
icon: printOpts.icon || getIcon().TOOLBAR_TOOLS_PRINT,
|
|
488
|
+
title: getI18n("vxe.toolbar.print"),
|
|
489
|
+
onClick: openPrintEvent
|
|
490
|
+
}) : createCommentVNode();
|
|
491
|
+
};
|
|
492
|
+
const renderToolRefresh = () => {
|
|
493
|
+
const refreshOpts = computeRefreshOpts.value;
|
|
494
|
+
return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
495
|
+
key: "refresh",
|
|
496
|
+
circle: true,
|
|
497
|
+
icon: reactData.isRefresh ? refreshOpts.iconLoading || getIcon().TOOLBAR_TOOLS_REFRESH_LOADING : refreshOpts.icon || getIcon().TOOLBAR_TOOLS_REFRESH,
|
|
498
|
+
title: getI18n("vxe.toolbar.refresh"),
|
|
499
|
+
onClick: refreshEvent
|
|
500
|
+
}) : createCommentVNode();
|
|
501
|
+
};
|
|
502
|
+
const renderToolZoom = () => {
|
|
503
|
+
const zoomOpts = computeZoomOpts.value;
|
|
504
|
+
return $xeGGWrapper && VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
505
|
+
key: "zoom",
|
|
506
|
+
circle: true,
|
|
507
|
+
icon: $xeGGWrapper.isMaximized() ? zoomOpts.iconOut || getIcon().TOOLBAR_TOOLS_MINIMIZE : zoomOpts.iconIn || getIcon().TOOLBAR_TOOLS_FULLSCREEN,
|
|
508
|
+
title: getI18n(`vxe.toolbar.zoom${$xeGGWrapper.isMaximized() ? "Out" : "In"}`),
|
|
509
|
+
onClick: zoomEvent
|
|
510
|
+
}) : createCommentVNode();
|
|
511
|
+
};
|
|
512
|
+
const renderToolCustom = () => {
|
|
513
|
+
const customOpts = computeCustomOpts.value;
|
|
514
|
+
const btnTrigger = computeTrigger.value;
|
|
515
|
+
const customBtnOns = {};
|
|
516
|
+
if (btnTrigger === "manual") {
|
|
517
|
+
} else if (btnTrigger === "hover") {
|
|
518
|
+
customBtnOns.onMouseenter = handleMouseenterSettingEvent;
|
|
519
|
+
customBtnOns.onMouseleave = handleMouseleaveSettingEvent;
|
|
520
|
+
} else {
|
|
521
|
+
customBtnOns.onClick = handleClickSettingEvent;
|
|
522
|
+
}
|
|
523
|
+
return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
524
|
+
key: "custom",
|
|
525
|
+
circle: true,
|
|
526
|
+
icon: customOpts.icon || getIcon().TOOLBAR_TOOLS_CUSTOM,
|
|
527
|
+
title: getI18n("vxe.toolbar.custom"),
|
|
528
|
+
className: "vxe-toolbar-custom-target",
|
|
529
|
+
...customBtnOns
|
|
530
|
+
}) : createCommentVNode();
|
|
531
|
+
};
|
|
532
|
+
const renderVN = () => {
|
|
533
|
+
const { perfect, loading, refresh, zoom, custom, className } = props;
|
|
534
|
+
const vSize = computeSize.value;
|
|
535
|
+
return h("div", {
|
|
536
|
+
ref: refElem,
|
|
537
|
+
class: ["vxe-toolbar", className ? XEUtils.isFunction(className) ? className({ $toolbar: $xeToolbar }) : className : "", {
|
|
538
|
+
[`size--${vSize}`]: vSize,
|
|
539
|
+
"is--perfect": perfect,
|
|
540
|
+
"is--loading": loading
|
|
541
|
+
}]
|
|
542
|
+
}, [
|
|
543
|
+
h("div", {
|
|
544
|
+
class: "vxe-buttons--wrapper"
|
|
545
|
+
}, renderLeftBtns()),
|
|
546
|
+
h("div", {
|
|
547
|
+
class: "vxe-tools--wrapper"
|
|
548
|
+
}, renderRightTools()),
|
|
549
|
+
h("div", {
|
|
550
|
+
class: "vxe-tools--operate"
|
|
551
|
+
}, [
|
|
552
|
+
props.import ? renderToolImport() : createCommentVNode(),
|
|
553
|
+
props.export ? renderToolExport() : createCommentVNode(),
|
|
554
|
+
props.print ? renderToolPrint() : createCommentVNode(),
|
|
555
|
+
refresh ? renderToolRefresh() : createCommentVNode(),
|
|
556
|
+
zoom && $xeGGWrapper ? renderToolZoom() : createCommentVNode(),
|
|
557
|
+
custom ? renderToolCustom() : createCommentVNode()
|
|
558
|
+
])
|
|
559
|
+
]);
|
|
560
|
+
};
|
|
561
|
+
$xeToolbar.renderVN = renderVN;
|
|
562
|
+
nextTick(() => {
|
|
563
|
+
const refreshOpts = computeRefreshOpts.value;
|
|
564
|
+
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
565
|
+
if (props.refresh && !$xeGGWrapper && !queryMethod) {
|
|
566
|
+
warnLog("vxe.error.notFunc", ["queryMethod"]);
|
|
567
|
+
}
|
|
568
|
+
if (XEUtils.isPlainObject(props.custom)) {
|
|
569
|
+
warnLog("vxe.error.delProp", ["custom={...}", "custom=boolean & custom-options={...}"]);
|
|
570
|
+
}
|
|
571
|
+
if (XEUtils.isPlainObject(props.print)) {
|
|
572
|
+
warnLog("vxe.error.delProp", ["print={...}", "print=boolean & print-options={...}"]);
|
|
573
|
+
}
|
|
574
|
+
if (XEUtils.isPlainObject(props.export)) {
|
|
575
|
+
warnLog("vxe.error.delProp", ["export={...}", "export=boolean & export-options={...}"]);
|
|
576
|
+
}
|
|
577
|
+
if (XEUtils.isPlainObject(props.import)) {
|
|
578
|
+
warnLog("vxe.error.delProp", ["import={...}", "import=boolean & import-options={...}"]);
|
|
579
|
+
}
|
|
580
|
+
if (XEUtils.isPlainObject(props.refresh)) {
|
|
581
|
+
warnLog("vxe.error.delProp", ["refresh={...}", "refresh=boolean & refresh-options={...}"]);
|
|
582
|
+
}
|
|
583
|
+
if (XEUtils.isPlainObject(props.refresh)) {
|
|
584
|
+
warnLog("vxe.error.delProp", ["zoom={...}", "zoom=boolean & zoom-options={...}"]);
|
|
585
|
+
}
|
|
586
|
+
const customOpts = computeCustomOpts.value;
|
|
587
|
+
if (customOpts.isFooter) {
|
|
588
|
+
warnLog("vxe.error.delProp", ["toolbar.custom.isFooter", "table.custom-config.showFooter"]);
|
|
589
|
+
}
|
|
590
|
+
if (customOpts.showFooter) {
|
|
591
|
+
warnLog("vxe.error.delProp", ["toolbar.custom.showFooter", "table.custom-config.showFooter"]);
|
|
592
|
+
}
|
|
593
|
+
if (customOpts.immediate) {
|
|
594
|
+
warnLog("vxe.error.delProp", ["toolbar.custom.immediate", "table.custom-config.immediate"]);
|
|
595
|
+
}
|
|
596
|
+
if (customOpts.trigger) {
|
|
597
|
+
warnLog("vxe.error.delProp", ["toolbar.custom.trigger", "table.custom-config.trigger"]);
|
|
598
|
+
}
|
|
599
|
+
if (props.refresh || props.import || props.export || props.print || props.zoom) {
|
|
600
|
+
if (!VxeUIButtonComponent) {
|
|
601
|
+
errLog("vxe.error.reqComp", ["vxe-button"]);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
onBeforeUnmount(() => {
|
|
606
|
+
XEUtils.assign(reactData, createReactData());
|
|
607
|
+
XEUtils.assign(internalData, createInternalData());
|
|
608
|
+
});
|
|
609
|
+
return $xeToolbar;
|
|
610
|
+
},
|
|
611
|
+
render() {
|
|
612
|
+
return this.renderVN();
|
|
613
|
+
}
|
|
625
614
|
});
|
|
615
|
+
export {
|
|
616
|
+
toolbar_default as default
|
|
617
|
+
};
|