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/render/index.js
CHANGED
|
@@ -1,1548 +1,1588 @@
|
|
|
1
|
-
import { h, resolveComponent } from
|
|
2
|
-
import XEUtils from
|
|
3
|
-
import { VxeUI } from
|
|
4
|
-
import { getCellValue, setCellValue } from
|
|
5
|
-
import { getFuncText, formatText, isEmptyValue, hasEnableConf } from
|
|
6
|
-
import { getOnName, getModelEvent, getChangeEvent, hasInputType } from
|
|
7
|
-
import { createComponentLog } from
|
|
8
|
-
const { errLog } = createComponentLog(
|
|
1
|
+
import { h, resolveComponent } from "vue";
|
|
2
|
+
import XEUtils from "xe-utils";
|
|
3
|
+
import { VxeUI } from "../../ui";
|
|
4
|
+
import { getCellValue, setCellValue } from "../../table/src/util";
|
|
5
|
+
import { getFuncText, formatText, isEmptyValue, hasEnableConf } from "../../ui/src/utils";
|
|
6
|
+
import { getOnName, getModelEvent, getChangeEvent, hasInputType } from "../../ui/src/vn";
|
|
7
|
+
import { createComponentLog } from "../../ui/src/log";
|
|
8
|
+
const { errLog } = createComponentLog("table");
|
|
9
9
|
const { getConfig, renderer, getI18n, getComponent } = VxeUI;
|
|
10
|
-
const componentDefaultModelProp =
|
|
10
|
+
const componentDefaultModelProp = "modelValue";
|
|
11
11
|
const defaultCompProps = {};
|
|
12
12
|
function handleDefaultValue(value, defaultVal, initVal) {
|
|
13
|
-
|
|
13
|
+
return XEUtils.eqNull(value) ? XEUtils.eqNull(defaultVal) ? initVal : defaultVal : value;
|
|
14
14
|
}
|
|
15
15
|
function parseDate(value, props) {
|
|
16
|
-
|
|
16
|
+
return value && props.valueFormat ? XEUtils.toStringDate(value, props.valueFormat) : value;
|
|
17
17
|
}
|
|
18
18
|
function getFormatDate(value, props, defaultFormat) {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const { dateConfig = {} } = props;
|
|
20
|
+
return XEUtils.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
|
|
21
21
|
}
|
|
22
22
|
function getLabelFormatDate(value, props) {
|
|
23
|
-
|
|
23
|
+
return getFormatDate(value, props, getI18n(`vxe.input.date.labelFormat.${props.type || "date"}`));
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
26
|
-
* 已废弃
|
|
27
|
-
* @deprecated
|
|
28
|
-
*/
|
|
29
25
|
function getOldComponentName(name) {
|
|
30
|
-
|
|
26
|
+
return `vxe-${name.replace("$", "")}`;
|
|
31
27
|
}
|
|
32
28
|
function getDefaultComponent({ name }) {
|
|
33
|
-
|
|
29
|
+
return getComponent(name);
|
|
34
30
|
}
|
|
35
|
-
/**
|
|
36
|
-
* 已废弃
|
|
37
|
-
* @deprecated
|
|
38
|
-
*/
|
|
39
31
|
function getOldComponent({ name }) {
|
|
40
|
-
|
|
32
|
+
return resolveComponent(getOldComponentName(name));
|
|
41
33
|
}
|
|
42
34
|
function updateFilterChangeOption(params, checked, option) {
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
const { $table } = params;
|
|
36
|
+
$table.updateFilterOptionStatus(option, checked);
|
|
45
37
|
}
|
|
46
38
|
function saveFilterEvent(params) {
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
const { $table, column } = params;
|
|
40
|
+
$table.saveFilterByEvent(new Event("change"), column);
|
|
49
41
|
}
|
|
50
42
|
function getNativeAttrs(renderOpts) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
let { name, attrs } = renderOpts;
|
|
44
|
+
if (name === "input") {
|
|
45
|
+
attrs = Object.assign({ type: "text" }, attrs);
|
|
46
|
+
}
|
|
47
|
+
return attrs;
|
|
56
48
|
}
|
|
57
49
|
function getInputImmediateModel(renderOpts) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
return true;
|
|
50
|
+
const { name, immediate, props } = renderOpts;
|
|
51
|
+
if (!immediate) {
|
|
52
|
+
if (name === "VxeInput" || name === "$input") {
|
|
53
|
+
const { type } = props || {};
|
|
54
|
+
return !(!type || type === "text" || type === "number" || type === "integer" || type === "float");
|
|
55
|
+
}
|
|
56
|
+
if (name === "input" || name === "textarea" || name === "$textarea") {
|
|
57
|
+
return false;
|
|
68
58
|
}
|
|
69
|
-
return
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
return immediate;
|
|
70
62
|
}
|
|
71
63
|
function getCellEditProps(renderOpts, params, value, defaultProps) {
|
|
72
|
-
|
|
64
|
+
return XEUtils.assign({ immediate: getInputImmediateModel(renderOpts) }, defaultCompProps, defaultProps, renderOpts.props, { [componentDefaultModelProp]: value });
|
|
73
65
|
}
|
|
74
66
|
function getCellEditFilterProps(renderOpts, params, value, defaultProps) {
|
|
75
|
-
|
|
67
|
+
return XEUtils.assign({}, defaultCompProps, defaultProps, renderOpts.props, { [componentDefaultModelProp]: value });
|
|
76
68
|
}
|
|
77
69
|
function isImmediateCell(renderOpts, params) {
|
|
78
|
-
|
|
70
|
+
return params.$type === "cell" || getInputImmediateModel(renderOpts);
|
|
79
71
|
}
|
|
80
72
|
function getCellLabelVNs(renderOpts, params, cellLabel, opts) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
: formatText(cellLabel, 1))
|
|
93
|
-
];
|
|
73
|
+
const { placeholder } = renderOpts;
|
|
74
|
+
return [
|
|
75
|
+
h("span", {
|
|
76
|
+
key: 1,
|
|
77
|
+
class: ["vxe-cell--label", opts ? opts.class : ""]
|
|
78
|
+
}, placeholder && isEmptyValue(cellLabel) ? [
|
|
79
|
+
h("span", {
|
|
80
|
+
class: "vxe-cell--placeholder"
|
|
81
|
+
}, formatText(getFuncText(placeholder), 1))
|
|
82
|
+
] : formatText(cellLabel, 1))
|
|
83
|
+
];
|
|
94
84
|
}
|
|
95
|
-
/**
|
|
96
|
-
* 原生事件处理
|
|
97
|
-
* @param renderOpts
|
|
98
|
-
* @param params
|
|
99
|
-
* @param modelFunc
|
|
100
|
-
* @param changeFunc
|
|
101
|
-
*/
|
|
102
85
|
function getNativeElementOns(renderOpts, params, eFns) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
XEUtils.objectEach(events, (func, key) => {
|
|
111
|
-
ons[getOnName(key)] = function (...args) {
|
|
112
|
-
func(params, ...args);
|
|
113
|
-
};
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
if (modelFunc) {
|
|
117
|
-
ons[getOnName(modelEvent)] = function (targetEvnt) {
|
|
118
|
-
modelFunc(targetEvnt);
|
|
119
|
-
if (isSameEvent && changeFunc) {
|
|
120
|
-
changeFunc(targetEvnt);
|
|
121
|
-
}
|
|
122
|
-
if (events && events[modelEvent]) {
|
|
123
|
-
events[modelEvent](params, targetEvnt);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
if (!isSameEvent && changeFunc) {
|
|
128
|
-
ons[getOnName(changeEvent)] = function (evnt) {
|
|
129
|
-
changeFunc(evnt);
|
|
130
|
-
if (events && events[changeEvent]) {
|
|
131
|
-
events[changeEvent](params, evnt);
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
if (blurFunc) {
|
|
136
|
-
ons[getOnName(blurEvent)] = function (evnt) {
|
|
137
|
-
blurFunc(evnt);
|
|
138
|
-
if (events && events[blurEvent]) {
|
|
139
|
-
events[blurEvent](params, evnt);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
return ons;
|
|
144
|
-
}
|
|
145
|
-
const blurEvent = 'blur';
|
|
146
|
-
const clearEvent = 'clear';
|
|
147
|
-
/**
|
|
148
|
-
* 组件事件处理
|
|
149
|
-
* @param renderOpts
|
|
150
|
-
* @param params
|
|
151
|
-
* @param modelFunc
|
|
152
|
-
* @param changeFunc
|
|
153
|
-
*/
|
|
154
|
-
function getComponentOns(renderOpts, params, eFns, eventOns) {
|
|
155
|
-
const { events } = renderOpts;
|
|
156
|
-
const modelEvent = getModelEvent(renderOpts);
|
|
157
|
-
const changeEvent = getChangeEvent(renderOpts);
|
|
158
|
-
const { model: modelFunc, change: changeFunc, blur: blurFunc, clear: clearFunc } = eFns || {};
|
|
159
|
-
const ons = {};
|
|
86
|
+
const { events } = renderOpts;
|
|
87
|
+
const modelEvent = getModelEvent(renderOpts);
|
|
88
|
+
const changeEvent = getChangeEvent(renderOpts);
|
|
89
|
+
const { model: modelFunc, change: changeFunc, blur: blurFunc } = eFns || {};
|
|
90
|
+
const isSameEvent = changeEvent === modelEvent;
|
|
91
|
+
const ons = {};
|
|
92
|
+
if (events) {
|
|
160
93
|
XEUtils.objectEach(events, (func, key) => {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
func(params, ...args);
|
|
166
|
-
};
|
|
94
|
+
ons[getOnName(key)] = function(...args) {
|
|
95
|
+
func(params, ...args);
|
|
96
|
+
};
|
|
167
97
|
});
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
98
|
+
}
|
|
99
|
+
if (modelFunc) {
|
|
100
|
+
ons[getOnName(modelEvent)] = function(targetEvnt) {
|
|
101
|
+
modelFunc(targetEvnt);
|
|
102
|
+
if (isSameEvent && changeFunc) {
|
|
103
|
+
changeFunc(targetEvnt);
|
|
104
|
+
}
|
|
105
|
+
if (events && events[modelEvent]) {
|
|
106
|
+
events[modelEvent](params, targetEvnt);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
if (!isSameEvent && changeFunc) {
|
|
111
|
+
ons[getOnName(changeEvent)] = function(evnt) {
|
|
112
|
+
changeFunc(evnt);
|
|
113
|
+
if (events && events[changeEvent]) {
|
|
114
|
+
events[changeEvent](params, evnt);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (blurFunc) {
|
|
119
|
+
ons[getOnName(blurEvent)] = function(evnt) {
|
|
120
|
+
blurFunc(evnt);
|
|
121
|
+
if (events && events[blurEvent]) {
|
|
122
|
+
events[blurEvent](params, evnt);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return ons;
|
|
127
|
+
}
|
|
128
|
+
const blurEvent = "blur";
|
|
129
|
+
const clearEvent = "clear";
|
|
130
|
+
function getComponentOns(renderOpts, params, eFns, eventOns) {
|
|
131
|
+
const { events } = renderOpts;
|
|
132
|
+
const modelEvent = getModelEvent(renderOpts);
|
|
133
|
+
const changeEvent = getChangeEvent(renderOpts);
|
|
134
|
+
const { model: modelFunc, change: changeFunc, blur: blurFunc, clear: clearFunc } = eFns || {};
|
|
135
|
+
const ons = {};
|
|
136
|
+
XEUtils.objectEach(events, (func, key) => {
|
|
137
|
+
ons[getOnName(key)] = function(...args) {
|
|
138
|
+
if (!XEUtils.isFunction(func)) {
|
|
139
|
+
errLog("vxe.error.errFunc", [func]);
|
|
140
|
+
}
|
|
141
|
+
func(params, ...args);
|
|
142
|
+
};
|
|
143
|
+
});
|
|
144
|
+
if (modelFunc) {
|
|
145
|
+
ons[getOnName(modelEvent)] = function(targetEvnt) {
|
|
146
|
+
modelFunc(targetEvnt);
|
|
147
|
+
if (events && events[modelEvent]) {
|
|
148
|
+
events[modelEvent](params, targetEvnt);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
if (changeFunc) {
|
|
153
|
+
ons[getOnName(changeEvent)] = function(...args) {
|
|
154
|
+
changeFunc(...args);
|
|
155
|
+
if (events && events[changeEvent]) {
|
|
156
|
+
events[changeEvent](params, ...args);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
if (blurFunc) {
|
|
161
|
+
ons[getOnName(blurEvent)] = function(...args) {
|
|
162
|
+
blurFunc(...args);
|
|
163
|
+
if (events && events[blurEvent]) {
|
|
164
|
+
events[blurEvent](params, ...args);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
if (clearFunc) {
|
|
169
|
+
ons[getOnName(clearEvent)] = function(...args) {
|
|
170
|
+
clearFunc(...args);
|
|
171
|
+
if (events && events[clearEvent]) {
|
|
172
|
+
events[clearEvent](params, ...args);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
return eventOns ? Object.assign(ons, eventOns) : ons;
|
|
201
177
|
}
|
|
202
178
|
function getEditOns(renderOpts, params) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
$table.handleCellRuleUpdateStatus('blur', params, model.value);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
});
|
|
179
|
+
const { $table, row, column } = params;
|
|
180
|
+
const { name } = renderOpts;
|
|
181
|
+
const { model } = column;
|
|
182
|
+
const isImmediate = isImmediateCell(renderOpts, params);
|
|
183
|
+
return getComponentOns(renderOpts, params, {
|
|
184
|
+
model(cellValue) {
|
|
185
|
+
model.update = true;
|
|
186
|
+
model.value = cellValue;
|
|
187
|
+
if (isImmediate) {
|
|
188
|
+
setCellValue(row, column, cellValue);
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
change(eventParams) {
|
|
192
|
+
if (!isImmediate && name && ["VxeInput", "VxeNumberInput", "VxeTextarea", "$input", "$textarea"].includes(name)) {
|
|
193
|
+
const cellValue = eventParams.value;
|
|
194
|
+
model.update = true;
|
|
195
|
+
model.value = cellValue;
|
|
196
|
+
$table.updateStatus(params, cellValue);
|
|
197
|
+
} else {
|
|
198
|
+
$table.updateStatus(params);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
blur() {
|
|
202
|
+
if (isImmediate) {
|
|
203
|
+
$table.handleCellRuleUpdateStatus("blur", params);
|
|
204
|
+
} else {
|
|
205
|
+
$table.handleCellRuleUpdateStatus("blur", params, model.value);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
});
|
|
237
209
|
}
|
|
238
210
|
function getFilterOns(renderOpts, params, option) {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
});
|
|
211
|
+
return getComponentOns(renderOpts, params, {
|
|
212
|
+
model(value) {
|
|
213
|
+
option.data = value;
|
|
214
|
+
},
|
|
215
|
+
change() {
|
|
216
|
+
updateFilterChangeOption(params, !isEmptyValue(option.data), option);
|
|
217
|
+
},
|
|
218
|
+
blur() {
|
|
219
|
+
updateFilterChangeOption(params, !isEmptyValue(option.data), option);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
251
222
|
}
|
|
252
223
|
function getFloatingFilterOns(renderOpts, params, option) {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
return getComponentOns(renderOpts, params, {
|
|
256
|
-
model(value) {
|
|
257
|
-
// 处理 model 值双向绑定
|
|
258
|
-
option.data = value;
|
|
259
|
-
},
|
|
260
|
-
change() {
|
|
261
|
-
updateFilterChangeOption(params, !isEmptyValue(option.data), option);
|
|
262
|
-
},
|
|
263
|
-
clear() {
|
|
264
|
-
updateFilterChangeOption(params, !isEmptyValue(option.data), option);
|
|
265
|
-
saveFilterEvent(params);
|
|
266
|
-
},
|
|
267
|
-
blur() {
|
|
268
|
-
$table.saveFilterByEvent(new Event('change'), column);
|
|
269
|
-
}
|
|
270
|
-
}, renderOpts.name === 'VxeNumberInput'
|
|
271
|
-
? {
|
|
272
|
-
[getOnName('plus-number')]() {
|
|
273
|
-
updateFilterChangeOption(params, !isEmptyValue(option.data), option);
|
|
274
|
-
saveFilterEvent(params);
|
|
275
|
-
},
|
|
276
|
-
[getOnName('minus-number')]() {
|
|
277
|
-
updateFilterChangeOption(params, !isEmptyValue(option.data), option);
|
|
278
|
-
saveFilterEvent(params);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
: {});
|
|
282
|
-
}
|
|
224
|
+
const { $table, column } = params;
|
|
225
|
+
if (hasInputType(renderOpts)) {
|
|
283
226
|
return getComponentOns(renderOpts, params, {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
227
|
+
model(value) {
|
|
228
|
+
option.data = value;
|
|
229
|
+
},
|
|
230
|
+
change() {
|
|
231
|
+
updateFilterChangeOption(params, !isEmptyValue(option.data), option);
|
|
232
|
+
},
|
|
233
|
+
clear() {
|
|
234
|
+
updateFilterChangeOption(params, !isEmptyValue(option.data), option);
|
|
235
|
+
saveFilterEvent(params);
|
|
236
|
+
},
|
|
237
|
+
blur() {
|
|
238
|
+
$table.saveFilterByEvent(new Event("change"), column);
|
|
239
|
+
}
|
|
240
|
+
}, renderOpts.name === "VxeNumberInput" ? {
|
|
241
|
+
[getOnName("plus-number")]() {
|
|
242
|
+
updateFilterChangeOption(params, !isEmptyValue(option.data), option);
|
|
243
|
+
saveFilterEvent(params);
|
|
244
|
+
},
|
|
245
|
+
[getOnName("minus-number")]() {
|
|
246
|
+
updateFilterChangeOption(params, !isEmptyValue(option.data), option);
|
|
247
|
+
saveFilterEvent(params);
|
|
248
|
+
}
|
|
249
|
+
} : {});
|
|
250
|
+
}
|
|
251
|
+
return getComponentOns(renderOpts, params, {
|
|
252
|
+
model(value) {
|
|
253
|
+
option.data = value;
|
|
254
|
+
},
|
|
255
|
+
clear() {
|
|
256
|
+
updateFilterChangeOption(params, !isEmptyValue(option.data), option);
|
|
257
|
+
$table.saveFilterByEvent(new Event("change"), column);
|
|
258
|
+
},
|
|
259
|
+
change() {
|
|
260
|
+
updateFilterChangeOption(params, !isEmptyValue(option.data), option);
|
|
261
|
+
$table.saveFilterByEvent(new Event("change"), column);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
297
264
|
}
|
|
298
265
|
function getNativeEditOns(renderOpts, params) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
model.update = true;
|
|
312
|
-
model.value = cellValue;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
|
-
change(evnt) {
|
|
317
|
-
// 处理 change 事件相关逻辑
|
|
318
|
-
const targetEl = evnt.target;
|
|
319
|
-
if (targetEl) {
|
|
320
|
-
const cellValue = targetEl.value;
|
|
321
|
-
$table.updateStatus(params, cellValue);
|
|
322
|
-
}
|
|
323
|
-
},
|
|
324
|
-
blur(evnt) {
|
|
325
|
-
const targetEl = evnt.target;
|
|
326
|
-
if (targetEl) {
|
|
327
|
-
const cellValue = targetEl.value;
|
|
328
|
-
$table.updateStatus(params, cellValue);
|
|
329
|
-
}
|
|
266
|
+
const { $table, row, column } = params;
|
|
267
|
+
const { model } = column;
|
|
268
|
+
return getNativeElementOns(renderOpts, params, {
|
|
269
|
+
model(evnt) {
|
|
270
|
+
const targetEl = evnt.target;
|
|
271
|
+
if (targetEl) {
|
|
272
|
+
const cellValue = targetEl.value;
|
|
273
|
+
if (isImmediateCell(renderOpts, params)) {
|
|
274
|
+
setCellValue(row, column, cellValue);
|
|
275
|
+
} else {
|
|
276
|
+
model.update = true;
|
|
277
|
+
model.value = cellValue;
|
|
330
278
|
}
|
|
331
|
-
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
change(evnt) {
|
|
282
|
+
const targetEl = evnt.target;
|
|
283
|
+
if (targetEl) {
|
|
284
|
+
const cellValue = targetEl.value;
|
|
285
|
+
$table.updateStatus(params, cellValue);
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
blur(evnt) {
|
|
289
|
+
const targetEl = evnt.target;
|
|
290
|
+
if (targetEl) {
|
|
291
|
+
const cellValue = targetEl.value;
|
|
292
|
+
$table.updateStatus(params, cellValue);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
});
|
|
332
296
|
}
|
|
333
297
|
function getNativeFilterOns(renderOpts, params, option) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
});
|
|
298
|
+
return getNativeElementOns(renderOpts, params, {
|
|
299
|
+
model(evnt) {
|
|
300
|
+
const targetEl = evnt.target;
|
|
301
|
+
if (targetEl) {
|
|
302
|
+
option.data = targetEl.value;
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
change() {
|
|
306
|
+
updateFilterChangeOption(params, !XEUtils.eqNull(option.data), option);
|
|
307
|
+
},
|
|
308
|
+
blur() {
|
|
309
|
+
updateFilterChangeOption(params, !XEUtils.eqNull(option.data), option);
|
|
310
|
+
}
|
|
311
|
+
});
|
|
349
312
|
}
|
|
350
313
|
function nativeInputCellRender(renderOpts, renderParams) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
314
|
+
const { row, column } = renderParams;
|
|
315
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
316
|
+
const cellVNs = [
|
|
317
|
+
h("span", {
|
|
318
|
+
key: 1
|
|
319
|
+
}, cellValue)
|
|
320
|
+
];
|
|
321
|
+
return getNativeInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
|
|
359
322
|
}
|
|
360
|
-
/**
|
|
361
|
-
* 单元格可编辑渲染-原生的标签
|
|
362
|
-
* input、textarea
|
|
363
|
-
*/
|
|
364
323
|
function nativeInputEditRender(renderOpts, renderParams) {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
324
|
+
const { row, column } = renderParams;
|
|
325
|
+
const { name } = renderOpts;
|
|
326
|
+
const cellValue = isImmediateCell(renderOpts, renderParams) ? getCellValue(row, column) : column.model.value;
|
|
327
|
+
return [
|
|
328
|
+
h("" + name, {
|
|
329
|
+
key: 2,
|
|
330
|
+
class: `vxe-default-${name}`,
|
|
331
|
+
...getNativeAttrs(renderOpts),
|
|
332
|
+
value: cellValue,
|
|
333
|
+
...getNativeEditOns(renderOpts, renderParams)
|
|
334
|
+
})
|
|
335
|
+
];
|
|
371
336
|
}
|
|
372
337
|
function buttonCellRender(renderOpts, params) {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
338
|
+
return [
|
|
339
|
+
h(getDefaultComponent(renderOpts), {
|
|
340
|
+
...getCellEditProps(renderOpts, params, null),
|
|
341
|
+
...getComponentOns(renderOpts, params)
|
|
342
|
+
})
|
|
343
|
+
];
|
|
376
344
|
}
|
|
377
345
|
function defaultInputEditRender(renderOpts, params) {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
346
|
+
const { row, column } = params;
|
|
347
|
+
const cellValue = getCellValue(row, column);
|
|
348
|
+
return [
|
|
349
|
+
h(getDefaultComponent(renderOpts), {
|
|
350
|
+
key: 2,
|
|
351
|
+
...getCellEditProps(renderOpts, params, cellValue),
|
|
352
|
+
...getEditOns(renderOpts, params)
|
|
353
|
+
})
|
|
354
|
+
];
|
|
383
355
|
}
|
|
384
356
|
function defaultEditRender(renderOpts, params) {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
357
|
+
const { row, column } = params;
|
|
358
|
+
const cellValue = getCellValue(row, column);
|
|
359
|
+
return [
|
|
360
|
+
h(getDefaultComponent(renderOpts), {
|
|
361
|
+
...getCellEditProps(renderOpts, params, cellValue),
|
|
362
|
+
...getEditOns(renderOpts, params)
|
|
363
|
+
})
|
|
364
|
+
];
|
|
390
365
|
}
|
|
391
366
|
function checkboxEditRender(renderOpts, params) {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
367
|
+
const { row, column } = params;
|
|
368
|
+
const cellValue = getCellValue(row, column);
|
|
369
|
+
return [
|
|
370
|
+
h(getDefaultComponent(renderOpts), {
|
|
371
|
+
...getCellEditProps(renderOpts, params, cellValue),
|
|
372
|
+
...getEditOns(renderOpts, params)
|
|
373
|
+
})
|
|
374
|
+
];
|
|
397
375
|
}
|
|
398
376
|
function radioAndCheckboxGroupEditRender(renderOpts, params) {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
377
|
+
const { options } = renderOpts;
|
|
378
|
+
const { row, column } = params;
|
|
379
|
+
const cellValue = getCellValue(row, column);
|
|
380
|
+
return [
|
|
381
|
+
h(getDefaultComponent(renderOpts), {
|
|
382
|
+
options,
|
|
383
|
+
...getCellEditProps(renderOpts, params, cellValue),
|
|
384
|
+
...getEditOns(renderOpts, params)
|
|
385
|
+
})
|
|
386
|
+
];
|
|
405
387
|
}
|
|
406
|
-
/**
|
|
407
|
-
* 已废弃
|
|
408
|
-
* @deprecated
|
|
409
|
-
*/
|
|
410
388
|
function oldEditRender(renderOpts, params) {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
389
|
+
const { row, column } = params;
|
|
390
|
+
const cellValue = getCellValue(row, column);
|
|
391
|
+
return [
|
|
392
|
+
h(getOldComponent(renderOpts), {
|
|
393
|
+
...getCellEditProps(renderOpts, params, cellValue),
|
|
394
|
+
...getEditOns(renderOpts, params)
|
|
395
|
+
})
|
|
396
|
+
];
|
|
416
397
|
}
|
|
417
|
-
/**
|
|
418
|
-
* 已废弃
|
|
419
|
-
* @deprecated
|
|
420
|
-
*/
|
|
421
398
|
function oldButtonEditRender(renderOpts, params) {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
399
|
+
return [
|
|
400
|
+
h(getComponent("vxe-button"), {
|
|
401
|
+
...getCellEditProps(renderOpts, params, null),
|
|
402
|
+
...getComponentOns(renderOpts, params)
|
|
403
|
+
})
|
|
404
|
+
];
|
|
425
405
|
}
|
|
426
|
-
/**
|
|
427
|
-
* 已废弃
|
|
428
|
-
* @deprecated
|
|
429
|
-
*/
|
|
430
406
|
function oldButtonsEditRender(renderOpts, params) {
|
|
431
|
-
|
|
432
|
-
|
|
407
|
+
const { children } = renderOpts;
|
|
408
|
+
return children ? children.map((childRenderOpts) => oldButtonEditRender(childRenderOpts, params)[0]) : [];
|
|
433
409
|
}
|
|
434
410
|
function renderNativeOptgroups(renderOpts, params, renderOptionsMethods) {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
411
|
+
const { optionGroups, optionGroupProps = {} } = renderOpts;
|
|
412
|
+
const groupOptions = optionGroupProps.options || "options";
|
|
413
|
+
const groupLabel = optionGroupProps.label || "label";
|
|
414
|
+
if (optionGroups) {
|
|
415
|
+
return optionGroups.map((group, gIndex) => {
|
|
416
|
+
return h("optgroup", {
|
|
417
|
+
key: gIndex,
|
|
418
|
+
label: group[groupLabel]
|
|
419
|
+
}, renderOptionsMethods(group[groupOptions], renderOpts, params));
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
return [];
|
|
447
423
|
}
|
|
448
|
-
/**
|
|
449
|
-
* 渲染原生的 option 标签
|
|
450
|
-
*/
|
|
451
424
|
function renderNativeOptions(options, renderOpts, params) {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
425
|
+
const { optionProps = {} } = renderOpts;
|
|
426
|
+
const { row, column } = params;
|
|
427
|
+
const labelProp = optionProps.label || "label";
|
|
428
|
+
const valueProp = optionProps.value || "value";
|
|
429
|
+
const disabledProp = optionProps.disabled || "disabled";
|
|
430
|
+
const cellValue = isImmediateCell(renderOpts, params) ? getCellValue(row, column) : column.model.value;
|
|
431
|
+
if (options) {
|
|
432
|
+
return options.map((option, oIndex) => {
|
|
433
|
+
return h("option", {
|
|
434
|
+
key: oIndex,
|
|
435
|
+
value: option[valueProp],
|
|
436
|
+
disabled: option[disabledProp],
|
|
437
|
+
/* eslint-disable eqeqeq */
|
|
438
|
+
selected: option[valueProp] == cellValue
|
|
439
|
+
}, option[labelProp]);
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
return [];
|
|
470
443
|
}
|
|
471
444
|
function nativeFilterRender(renderOpts, params) {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
445
|
+
const { column } = params;
|
|
446
|
+
const { name } = renderOpts;
|
|
447
|
+
const attrs = getNativeAttrs(renderOpts);
|
|
448
|
+
return column.filters.map((option, oIndex) => {
|
|
449
|
+
return h(`${name}`, {
|
|
450
|
+
key: oIndex,
|
|
451
|
+
class: `vxe-default-${name}`,
|
|
452
|
+
...attrs,
|
|
453
|
+
value: option.data,
|
|
454
|
+
...getNativeFilterOns(renderOpts, params, option)
|
|
477
455
|
});
|
|
456
|
+
});
|
|
478
457
|
}
|
|
479
458
|
function defaultFilterRender(renderOpts, params) {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
459
|
+
const { column } = params;
|
|
460
|
+
return column.filters.map((option, oIndex) => {
|
|
461
|
+
const optionValue = option.data;
|
|
462
|
+
return h(getDefaultComponent(renderOpts), {
|
|
463
|
+
key: oIndex,
|
|
464
|
+
...getCellEditFilterProps(renderOpts, renderOpts, optionValue),
|
|
465
|
+
...getFilterOns(renderOpts, params, option)
|
|
484
466
|
});
|
|
467
|
+
});
|
|
485
468
|
}
|
|
486
469
|
function defaultFloatingFilterRender(renderOpts, params) {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
470
|
+
const { option } = params;
|
|
471
|
+
const optionValue = option.data;
|
|
472
|
+
return [
|
|
473
|
+
h(getDefaultComponent(renderOpts), {
|
|
474
|
+
...getCellEditFilterProps(renderOpts, renderOpts, optionValue),
|
|
475
|
+
...getFloatingFilterOns(renderOpts, params, option)
|
|
476
|
+
})
|
|
477
|
+
];
|
|
492
478
|
}
|
|
493
479
|
function defaultFilterOptions() {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
480
|
+
return [
|
|
481
|
+
{ data: null }
|
|
482
|
+
];
|
|
497
483
|
}
|
|
498
|
-
/**
|
|
499
|
-
* 已废弃
|
|
500
|
-
* @deprecated
|
|
501
|
-
*/
|
|
502
484
|
function oldFilterRender(renderOpts, params) {
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
485
|
+
const { column } = params;
|
|
486
|
+
return column.filters.map((option, oIndex) => {
|
|
487
|
+
const optionValue = option.data;
|
|
488
|
+
return h(getOldComponent(renderOpts), {
|
|
489
|
+
key: oIndex,
|
|
490
|
+
...getCellEditFilterProps(renderOpts, renderOpts, optionValue),
|
|
491
|
+
...getFilterOns(renderOpts, params, option)
|
|
507
492
|
});
|
|
493
|
+
});
|
|
508
494
|
}
|
|
509
495
|
function handleFilterMethod({ option, row, column }) {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
return cellValue == data;
|
|
496
|
+
const { data } = option;
|
|
497
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
498
|
+
return cellValue == data;
|
|
514
499
|
}
|
|
515
500
|
function handleInputFilterMethod({ option, row, column }) {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
return XEUtils.toValueString(cellValue).indexOf(data) > -1;
|
|
501
|
+
const { data } = option;
|
|
502
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
503
|
+
return XEUtils.toValueString(cellValue).indexOf(data) > -1;
|
|
520
504
|
}
|
|
521
505
|
function nativeSelectEditRender(renderOpts, params) {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
506
|
+
return [
|
|
507
|
+
h(
|
|
508
|
+
"select",
|
|
509
|
+
{
|
|
510
|
+
class: "vxe-default-select",
|
|
511
|
+
...getNativeAttrs(renderOpts),
|
|
512
|
+
...getNativeEditOns(renderOpts, params)
|
|
513
|
+
},
|
|
514
|
+
renderOpts.optionGroups ? renderNativeOptgroups(renderOpts, params, renderNativeOptions) : renderNativeOptions(renderOpts.options, renderOpts, params)
|
|
515
|
+
)
|
|
516
|
+
];
|
|
525
517
|
}
|
|
526
518
|
function defaultSelectEditRender(renderOpts, params) {
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
519
|
+
const { row, column } = params;
|
|
520
|
+
const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
|
|
521
|
+
const cellValue = getCellValue(row, column);
|
|
522
|
+
return [
|
|
523
|
+
h(getDefaultComponent(renderOpts), {
|
|
524
|
+
...getCellEditProps(renderOpts, params, cellValue, { options, optionProps, optionGroups, optionGroupProps }),
|
|
525
|
+
...getEditOns(renderOpts, params)
|
|
526
|
+
})
|
|
527
|
+
];
|
|
533
528
|
}
|
|
534
529
|
function defaultTableOrTreeSelectEditRender(renderOpts, params) {
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
530
|
+
const { row, column } = params;
|
|
531
|
+
const { options, optionProps } = renderOpts;
|
|
532
|
+
const cellValue = getCellValue(row, column);
|
|
533
|
+
return [
|
|
534
|
+
h(getDefaultComponent(renderOpts), {
|
|
535
|
+
...getCellEditProps(renderOpts, params, cellValue, { options, optionProps }),
|
|
536
|
+
...getEditOns(renderOpts, params)
|
|
537
|
+
})
|
|
538
|
+
];
|
|
541
539
|
}
|
|
542
|
-
/**
|
|
543
|
-
* 已废弃
|
|
544
|
-
* @deprecated
|
|
545
|
-
*/
|
|
546
540
|
function oldSelectEditRender(renderOpts, params) {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
541
|
+
const { row, column } = params;
|
|
542
|
+
const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
|
|
543
|
+
const cellValue = getCellValue(row, column);
|
|
544
|
+
return [
|
|
545
|
+
h(getOldComponent(renderOpts), {
|
|
546
|
+
...getCellEditProps(renderOpts, params, cellValue, { options, optionProps, optionGroups, optionGroupProps }),
|
|
547
|
+
...getEditOns(renderOpts, params)
|
|
548
|
+
})
|
|
549
|
+
];
|
|
553
550
|
}
|
|
554
551
|
function handleSelectCellValue(cellValue, renderOpts) {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
vals = [cellValue];
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
return XEUtils.map(vals, optionGroups
|
|
573
|
-
? (value) => {
|
|
574
|
-
const groupOptions = optionGroupProps.options || 'options';
|
|
575
|
-
for (let index = 0; index < optionGroups.length; index++) {
|
|
576
|
-
/* eslint-disable eqeqeq */
|
|
577
|
-
selectItem = XEUtils.find(optionGroups[index][groupOptions], item => item[valueProp] == value);
|
|
578
|
-
if (selectItem) {
|
|
579
|
-
break;
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
return selectItem ? selectItem[labelProp] : value;
|
|
583
|
-
}
|
|
584
|
-
: (value) => {
|
|
585
|
-
/* eslint-disable eqeqeq */
|
|
586
|
-
selectItem = XEUtils.find(options, item => item[valueProp] == value);
|
|
587
|
-
return selectItem ? selectItem[labelProp] : value;
|
|
588
|
-
}).join(', ');
|
|
552
|
+
const { options, optionGroups, optionProps = {}, optionGroupProps = {}, props = {} } = renderOpts;
|
|
553
|
+
let selectItem;
|
|
554
|
+
const labelProp = optionProps.label || "label";
|
|
555
|
+
const valueProp = optionProps.value || "value";
|
|
556
|
+
if (!(cellValue === null || cellValue === void 0)) {
|
|
557
|
+
let vals = [];
|
|
558
|
+
if (XEUtils.isArray(cellValue)) {
|
|
559
|
+
vals = cellValue;
|
|
560
|
+
} else {
|
|
561
|
+
if (props.multiple && `${cellValue}`.indexOf(",") > -1) {
|
|
562
|
+
vals = `${cellValue}`.split(",");
|
|
563
|
+
} else {
|
|
564
|
+
vals = [cellValue];
|
|
565
|
+
}
|
|
589
566
|
}
|
|
590
|
-
return
|
|
567
|
+
return XEUtils.map(
|
|
568
|
+
vals,
|
|
569
|
+
optionGroups ? (value) => {
|
|
570
|
+
const groupOptions = optionGroupProps.options || "options";
|
|
571
|
+
for (let index = 0; index < optionGroups.length; index++) {
|
|
572
|
+
selectItem = XEUtils.find(optionGroups[index][groupOptions], (item) => item[valueProp] == value);
|
|
573
|
+
if (selectItem) {
|
|
574
|
+
break;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return selectItem ? selectItem[labelProp] : value;
|
|
578
|
+
} : (value) => {
|
|
579
|
+
selectItem = XEUtils.find(options, (item) => item[valueProp] == value);
|
|
580
|
+
return selectItem ? selectItem[labelProp] : value;
|
|
581
|
+
}
|
|
582
|
+
).join(", ");
|
|
583
|
+
}
|
|
584
|
+
return "";
|
|
591
585
|
}
|
|
592
586
|
function getSelectCellValue(renderOpts, { row, column }) {
|
|
593
|
-
|
|
594
|
-
|
|
587
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
588
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
595
589
|
}
|
|
596
590
|
function handleExportSelectMethod(params) {
|
|
597
|
-
|
|
598
|
-
|
|
591
|
+
const { row, column, options } = params;
|
|
592
|
+
return options.original ? getCellValue(row, column) : getSelectCellValue(column.editRender || column.cellRender, params);
|
|
599
593
|
}
|
|
600
594
|
function handleTreeSelectCellValue(cellValue, renderOpts) {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
595
|
+
const { options, optionProps = {} } = renderOpts;
|
|
596
|
+
const labelProp = optionProps.label || "label";
|
|
597
|
+
const valueProp = optionProps.value || "value";
|
|
598
|
+
const childrenProp = optionProps.children || "children";
|
|
599
|
+
if (!(cellValue === null || cellValue === void 0)) {
|
|
600
|
+
const keyMaps = {};
|
|
601
|
+
XEUtils.eachTree(options, (item) => {
|
|
602
|
+
keyMaps[XEUtils.get(item, valueProp)] = item;
|
|
603
|
+
}, { children: childrenProp });
|
|
604
|
+
return XEUtils.map(
|
|
605
|
+
XEUtils.isArray(cellValue) ? cellValue : [cellValue],
|
|
606
|
+
(value) => {
|
|
607
|
+
const item = keyMaps[value];
|
|
608
|
+
return item ? XEUtils.get(item, labelProp) : item;
|
|
609
|
+
}
|
|
610
|
+
).join(", ");
|
|
611
|
+
}
|
|
612
|
+
return "";
|
|
616
613
|
}
|
|
617
614
|
function getTreeSelectCellValue(renderOpts, { row, column }) {
|
|
618
|
-
|
|
619
|
-
|
|
615
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
616
|
+
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
620
617
|
}
|
|
621
618
|
function handleExportTreeSelectMethod(params) {
|
|
622
|
-
|
|
623
|
-
|
|
619
|
+
const { row, column, options } = params;
|
|
620
|
+
return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
|
|
624
621
|
}
|
|
625
622
|
function handleNumberCell(cellValue, renderOpts, params) {
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
}
|
|
642
|
-
}
|
|
623
|
+
const { props = {}, showNegativeStatus } = renderOpts;
|
|
624
|
+
const { type } = props;
|
|
625
|
+
let isNegative = false;
|
|
626
|
+
if (!isEmptyValue(cellValue)) {
|
|
627
|
+
const numberInputConfig = getConfig().numberInput || {};
|
|
628
|
+
if (type === "float") {
|
|
629
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
630
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
631
|
+
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
632
|
+
if (!autoFill) {
|
|
633
|
+
cellValue = XEUtils.toNumber(cellValue);
|
|
634
|
+
}
|
|
635
|
+
if (showNegativeStatus) {
|
|
636
|
+
if (cellValue < 0) {
|
|
637
|
+
isNegative = true;
|
|
643
638
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
}
|
|
654
|
-
cellValue = XEUtils.commafy(cellValue, { digits });
|
|
655
|
-
if (!autoFill) {
|
|
656
|
-
const [iStr, dStr] = cellValue.split('.');
|
|
657
|
-
if (dStr) {
|
|
658
|
-
const dRest = dStr.replace(/0+$/, '');
|
|
659
|
-
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
if (showCurrency) {
|
|
663
|
-
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
|
|
664
|
-
}
|
|
639
|
+
}
|
|
640
|
+
} else if (type === "amount") {
|
|
641
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
642
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
643
|
+
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
644
|
+
cellValue = XEUtils.toNumber(cellValue);
|
|
645
|
+
if (showNegativeStatus) {
|
|
646
|
+
if (cellValue < 0) {
|
|
647
|
+
isNegative = true;
|
|
665
648
|
}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
}
|
|
674
|
-
}
|
|
649
|
+
}
|
|
650
|
+
cellValue = XEUtils.commafy(cellValue, { digits });
|
|
651
|
+
if (!autoFill) {
|
|
652
|
+
const [iStr, dStr] = cellValue.split(".");
|
|
653
|
+
if (dStr) {
|
|
654
|
+
const dRest = dStr.replace(/0+$/, "");
|
|
655
|
+
cellValue = dRest ? [iStr, ".", dRest].join("") : iStr;
|
|
675
656
|
}
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
657
|
+
}
|
|
658
|
+
if (showCurrency) {
|
|
659
|
+
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n("vxe.numberInput.currencySymbol") || ""}${cellValue}`;
|
|
660
|
+
}
|
|
661
|
+
} else {
|
|
662
|
+
if (type === "integer") {
|
|
663
|
+
cellValue = XEUtils.toInteger(cellValue);
|
|
664
|
+
}
|
|
665
|
+
if (showNegativeStatus) {
|
|
666
|
+
if (XEUtils.toNumber(cellValue) < 0) {
|
|
667
|
+
isNegative = true;
|
|
680
668
|
}
|
|
681
|
-
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
return getCellLabelVNs(renderOpts, params, cellValue, isNegative ? {
|
|
673
|
+
class: "is--negative"
|
|
674
|
+
} : {});
|
|
682
675
|
}
|
|
683
676
|
function handleFormatDatePicker(renderOpts, renderParams) {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
}
|
|
677
|
+
const { props = {} } = renderOpts;
|
|
678
|
+
const { cellValue } = renderParams;
|
|
679
|
+
if (cellValue) {
|
|
680
|
+
if (props.type !== "time") {
|
|
681
|
+
return getLabelFormatDate(cellValue, props);
|
|
690
682
|
}
|
|
691
|
-
|
|
683
|
+
}
|
|
684
|
+
return cellValue;
|
|
692
685
|
}
|
|
693
686
|
function handleFormatSelect(renderOpts, renderParams) {
|
|
694
|
-
|
|
695
|
-
|
|
687
|
+
const { cellValue } = renderParams;
|
|
688
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
696
689
|
}
|
|
697
690
|
function handleSetSelectValue(renderOpts, renderParams) {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
691
|
+
const { row, column, cellValue } = renderParams;
|
|
692
|
+
const { field } = column;
|
|
693
|
+
if (field) {
|
|
694
|
+
const { options, optionGroups, optionProps = {}, optionGroupProps = {}, props } = renderOpts;
|
|
695
|
+
if (isEmptyValue(cellValue)) {
|
|
696
|
+
XEUtils.set(row, field, props && props.multiple ? [] : null);
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
const isMultiVal = XEUtils.indexOf(`${cellValue}`, ",") > -1;
|
|
700
|
+
const labelProp = optionProps.label || "label";
|
|
701
|
+
const valueProp = optionProps.value || "value";
|
|
702
|
+
const labelMpas = {};
|
|
703
|
+
if (optionGroups && optionGroups.length) {
|
|
704
|
+
const groupOptions = optionGroupProps.options || "options";
|
|
705
|
+
for (let i = 0; i < optionGroups.length; i++) {
|
|
706
|
+
const opts = optionGroups[i][groupOptions] || {};
|
|
707
|
+
for (let j = 0; j < opts.length; j++) {
|
|
708
|
+
const item = opts[j];
|
|
709
|
+
if (isMultiVal) {
|
|
710
|
+
labelMpas[item[labelProp]] = item;
|
|
711
|
+
} else if (item[labelProp] == cellValue) {
|
|
712
|
+
XEUtils.set(row, field, item[valueProp]);
|
|
704
713
|
return;
|
|
714
|
+
}
|
|
705
715
|
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
labelMpas[item[labelProp]] = item;
|
|
718
|
-
/* eslint-disable eqeqeq */
|
|
719
|
-
}
|
|
720
|
-
else if (item[labelProp] == cellValue) {
|
|
721
|
-
XEUtils.set(row, field, item[valueProp]);
|
|
722
|
-
return;
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
else {
|
|
728
|
-
if (options) {
|
|
729
|
-
for (let i = 0; i < options.length; i++) {
|
|
730
|
-
const item = options[i];
|
|
731
|
-
if (isMultiVal) {
|
|
732
|
-
labelMpas[item[labelProp]] = item;
|
|
733
|
-
/* eslint-disable eqeqeq */
|
|
734
|
-
}
|
|
735
|
-
else if (item[labelProp] == cellValue) {
|
|
736
|
-
XEUtils.set(row, field, item[valueProp]);
|
|
737
|
-
return;
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
if (isMultiVal) {
|
|
743
|
-
XEUtils.set(row, field, (isMultiVal
|
|
744
|
-
? cellValue.split(',')
|
|
745
|
-
: [cellValue]).map((label) => {
|
|
746
|
-
const item = labelMpas[label];
|
|
747
|
-
return item ? item[valueProp] : label;
|
|
748
|
-
}));
|
|
749
|
-
}
|
|
750
|
-
else {
|
|
751
|
-
XEUtils.set(row, field, cellValue);
|
|
716
|
+
}
|
|
717
|
+
} else {
|
|
718
|
+
if (options) {
|
|
719
|
+
for (let i = 0; i < options.length; i++) {
|
|
720
|
+
const item = options[i];
|
|
721
|
+
if (isMultiVal) {
|
|
722
|
+
labelMpas[item[labelProp]] = item;
|
|
723
|
+
} else if (item[labelProp] == cellValue) {
|
|
724
|
+
XEUtils.set(row, field, item[valueProp]);
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
752
727
|
}
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
if (isMultiVal) {
|
|
731
|
+
XEUtils.set(row, field, (isMultiVal ? cellValue.split(",") : [cellValue]).map((label) => {
|
|
732
|
+
const item = labelMpas[label];
|
|
733
|
+
return item ? item[valueProp] : label;
|
|
734
|
+
}));
|
|
735
|
+
} else {
|
|
736
|
+
XEUtils.set(row, field, cellValue);
|
|
753
737
|
}
|
|
738
|
+
}
|
|
754
739
|
}
|
|
755
740
|
function handleFormatTreeSelect(renderOpts, params) {
|
|
756
|
-
|
|
757
|
-
|
|
741
|
+
const { cellValue } = params;
|
|
742
|
+
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
758
743
|
}
|
|
759
744
|
function handleSetTreeSelectValue(renderOpts, params) {
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
}
|
|
775
|
-
XEUtils.set(row, field, cellValue);
|
|
745
|
+
const { row, column, cellValue } = params;
|
|
746
|
+
const { field } = column;
|
|
747
|
+
if (field) {
|
|
748
|
+
const { options, optionProps = {} } = renderOpts;
|
|
749
|
+
const labelProp = optionProps.label || "label";
|
|
750
|
+
const valueProp = optionProps.value || "value";
|
|
751
|
+
const childrenProp = optionProps.children || "children";
|
|
752
|
+
const matchRest = XEUtils.findTree(options || [], (item) => XEUtils.get(item, labelProp) === cellValue, { children: childrenProp });
|
|
753
|
+
if (matchRest) {
|
|
754
|
+
const selectItem = matchRest.item;
|
|
755
|
+
if (selectItem) {
|
|
756
|
+
XEUtils.set(row, field, selectItem[valueProp]);
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
776
759
|
}
|
|
760
|
+
XEUtils.set(row, field, cellValue);
|
|
761
|
+
}
|
|
777
762
|
}
|
|
778
763
|
function getNativeInputRenderCellVNs(cellValue, labelVNs, renderOpts, renderParams) {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
const cellVNs = labelVNs;
|
|
800
|
-
if (isActiveCellArea || isColSelected) {
|
|
801
|
-
cellVNs.push(h('' + name, Object.assign(Object.assign({ key: 2, class: `vxe-default-${name} vxe-reusekeep-control`, value: cellValue }, getNativeAttrs(renderOpts)), getNativeEditOns(renderOpts, renderParams))));
|
|
764
|
+
const { $table, row, column } = renderParams;
|
|
765
|
+
const { name } = renderOpts;
|
|
766
|
+
const tableProps = $table.props;
|
|
767
|
+
const { editConfig, mouseConfig } = tableProps;
|
|
768
|
+
const { computeMouseOpts } = $table.getComputeMaps();
|
|
769
|
+
const mouseOpts = computeMouseOpts.value;
|
|
770
|
+
let isColSelected = false;
|
|
771
|
+
let isActiveCellArea = false;
|
|
772
|
+
if (editConfig && hasEnableConf(mouseConfig, mouseOpts)) {
|
|
773
|
+
const tableReactData = $table.reactData;
|
|
774
|
+
const { editStore } = tableReactData;
|
|
775
|
+
const { selected } = editStore;
|
|
776
|
+
isColSelected = row === selected.row && column === selected.column;
|
|
777
|
+
if ($table.getActiveCellArea) {
|
|
778
|
+
const activeCellArea = $table.getActiveCellArea();
|
|
779
|
+
if (activeCellArea) {
|
|
780
|
+
isActiveCellArea = row === activeCellArea.row && column === activeCellArea.column;
|
|
781
|
+
}
|
|
802
782
|
}
|
|
803
|
-
|
|
783
|
+
}
|
|
784
|
+
const cellVNs = labelVNs;
|
|
785
|
+
if (isActiveCellArea || isColSelected) {
|
|
786
|
+
cellVNs.push(
|
|
787
|
+
h("" + name, {
|
|
788
|
+
key: 2,
|
|
789
|
+
class: `vxe-default-${name} vxe-reusekeep-control`,
|
|
790
|
+
value: cellValue,
|
|
791
|
+
...getNativeAttrs(renderOpts),
|
|
792
|
+
...getNativeEditOns(renderOpts, renderParams)
|
|
793
|
+
})
|
|
794
|
+
);
|
|
795
|
+
}
|
|
796
|
+
return cellVNs;
|
|
804
797
|
}
|
|
805
798
|
function getInputRenderCellVNs(cellValue, labelVNs, renderOpts, renderParams) {
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
}
|
|
825
|
-
}
|
|
799
|
+
const { $table, row, column } = renderParams;
|
|
800
|
+
const tableProps = $table.props;
|
|
801
|
+
const { editConfig, mouseConfig } = tableProps;
|
|
802
|
+
const { computeEditOpts, computeMouseOpts } = $table.getComputeMaps();
|
|
803
|
+
const mouseOpts = computeMouseOpts.value;
|
|
804
|
+
let isColSelected = false;
|
|
805
|
+
let isActiveCellArea = false;
|
|
806
|
+
if (editConfig && hasEnableConf(mouseConfig, mouseOpts)) {
|
|
807
|
+
const tableReactData = $table.reactData;
|
|
808
|
+
const { editStore } = tableReactData;
|
|
809
|
+
const editOpts = computeEditOpts.value;
|
|
810
|
+
if (editOpts.isReuseKeep) {
|
|
811
|
+
const { selected } = editStore;
|
|
812
|
+
isColSelected = row === selected.row && column === selected.column;
|
|
813
|
+
if ($table.getActiveCellArea) {
|
|
814
|
+
const activeCellArea = $table.getActiveCellArea();
|
|
815
|
+
if (activeCellArea) {
|
|
816
|
+
isActiveCellArea = row === activeCellArea.row && column === activeCellArea.column;
|
|
826
817
|
}
|
|
818
|
+
}
|
|
827
819
|
}
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
820
|
+
}
|
|
821
|
+
const cellVNs = labelVNs;
|
|
822
|
+
if (isActiveCellArea || isColSelected) {
|
|
823
|
+
const compProps = getCellEditProps(renderOpts, renderParams, cellValue);
|
|
824
|
+
const { className, inputClassName } = compProps;
|
|
825
|
+
cellVNs.push(
|
|
826
|
+
h(getDefaultComponent(renderOpts), {
|
|
827
|
+
key: 2,
|
|
828
|
+
...compProps,
|
|
829
|
+
className: "vxe-reusekeep-control" + (className ? " " + className : ""),
|
|
830
|
+
inputClassName: "vxe-reusekeep-control" + (inputClassName ? " " + inputClassName : ""),
|
|
831
|
+
...getEditOns(renderOpts, renderParams)
|
|
832
|
+
})
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
return cellVNs;
|
|
835
836
|
}
|
|
836
|
-
/**
|
|
837
|
-
* 表格 - 渲染器
|
|
838
|
-
*/
|
|
839
837
|
renderer.mixin({
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
},
|
|
868
|
-
setValue({ cellValue }) {
|
|
869
|
-
return [cellValue, opSize, ogSize];
|
|
870
|
-
},
|
|
871
|
-
getResult({ cellValue }) {
|
|
872
|
-
return handleSelectCellValue(cellValue, renderOpts);
|
|
873
|
-
}
|
|
874
|
-
});
|
|
875
|
-
// const cellResult = getSelectCellValue(renderOpts, params)
|
|
876
|
-
return getCellLabelVNs(renderOpts, params, cellResult);
|
|
838
|
+
input: {
|
|
839
|
+
tableAutoFocus: true,
|
|
840
|
+
renderTableEdit: nativeInputEditRender,
|
|
841
|
+
renderTableCell: nativeInputCellRender,
|
|
842
|
+
renderTableDefault: nativeInputEditRender,
|
|
843
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
844
|
+
renderTableFilter: nativeFilterRender,
|
|
845
|
+
tableFilterDefaultMethod: handleInputFilterMethod
|
|
846
|
+
},
|
|
847
|
+
textarea: {
|
|
848
|
+
tableAutoFocus: true,
|
|
849
|
+
renderTableEdit: nativeInputEditRender,
|
|
850
|
+
renderTableCell: nativeInputCellRender,
|
|
851
|
+
renderTableDefault: nativeInputEditRender
|
|
852
|
+
},
|
|
853
|
+
select: {
|
|
854
|
+
renderTableEdit: nativeSelectEditRender,
|
|
855
|
+
renderTableDefault: nativeSelectEditRender,
|
|
856
|
+
renderTableCell(renderOpts, params) {
|
|
857
|
+
const { options, optionGroups } = renderOpts;
|
|
858
|
+
const { $table, row, column } = params;
|
|
859
|
+
const opSize = options ? options.length : null;
|
|
860
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
861
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
862
|
+
key: "render_table_cell",
|
|
863
|
+
isChanged({ oldValue, cellValue }) {
|
|
864
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
877
865
|
},
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
const { column } = params;
|
|
881
|
-
return column.filters.map((option, oIndex) => {
|
|
882
|
-
return h('select', Object.assign(Object.assign({ key: oIndex, class: 'vxe-default-select' }, getNativeAttrs(renderOpts)), getNativeFilterOns(renderOpts, params, option)), renderOpts.optionGroups ? renderNativeOptgroups(renderOpts, params, renderNativeOptions) : renderNativeOptions(renderOpts.options, renderOpts, params));
|
|
883
|
-
});
|
|
866
|
+
setValue({ cellValue }) {
|
|
867
|
+
return [cellValue, opSize, ogSize];
|
|
884
868
|
},
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
869
|
+
getResult({ cellValue }) {
|
|
870
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
return getCellLabelVNs(renderOpts, params, cellResult);
|
|
890
874
|
},
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
case 'year':
|
|
907
|
-
cellValue = getLabelFormatDate(cellValue, props);
|
|
908
|
-
break;
|
|
909
|
-
case 'float':
|
|
910
|
-
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
911
|
-
break;
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
const cellVNs = getCellLabelVNs(renderOpts, renderParams, cellValue);
|
|
915
|
-
return getInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
|
|
916
|
-
},
|
|
917
|
-
renderTableDefault: defaultInputEditRender,
|
|
918
|
-
createTableFilterOptions: defaultFilterOptions,
|
|
919
|
-
renderTableFilter: defaultFilterRender,
|
|
920
|
-
renderTableFloatingFilter: defaultFloatingFilterRender,
|
|
921
|
-
tableFilterDefaultMethod: handleInputFilterMethod
|
|
875
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
876
|
+
renderTableFilter(renderOpts, params) {
|
|
877
|
+
const { column } = params;
|
|
878
|
+
return column.filters.map((option, oIndex) => {
|
|
879
|
+
return h(
|
|
880
|
+
"select",
|
|
881
|
+
{
|
|
882
|
+
key: oIndex,
|
|
883
|
+
class: "vxe-default-select",
|
|
884
|
+
...getNativeAttrs(renderOpts),
|
|
885
|
+
...getNativeFilterOns(renderOpts, params, option)
|
|
886
|
+
},
|
|
887
|
+
renderOpts.optionGroups ? renderNativeOptgroups(renderOpts, params, renderNativeOptions) : renderNativeOptions(renderOpts.options, renderOpts, params)
|
|
888
|
+
);
|
|
889
|
+
});
|
|
922
890
|
},
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
891
|
+
tableCellFormatter: handleFormatSelect,
|
|
892
|
+
tableCellCopyMethod: handleFormatSelect,
|
|
893
|
+
tableCellPasteMethod: handleSetSelectValue,
|
|
894
|
+
tableFilterDefaultMethod: handleFilterMethod,
|
|
895
|
+
tableExportMethod: handleExportSelectMethod
|
|
896
|
+
},
|
|
897
|
+
VxeInput: {
|
|
898
|
+
tableAutoFocus: true,
|
|
899
|
+
renderTableEdit: defaultInputEditRender,
|
|
900
|
+
renderTableCell(renderOpts, renderParams) {
|
|
901
|
+
const { props = {} } = renderOpts;
|
|
902
|
+
const { row, column } = renderParams;
|
|
903
|
+
const inputConfig = getConfig().input || {};
|
|
904
|
+
const digits = props.digits || inputConfig.digits || 2;
|
|
905
|
+
let cellValue = XEUtils.get(row, column.field);
|
|
906
|
+
if (cellValue) {
|
|
907
|
+
switch (props.type) {
|
|
908
|
+
case "date":
|
|
909
|
+
case "week":
|
|
910
|
+
case "month":
|
|
911
|
+
case "quarter":
|
|
912
|
+
case "year":
|
|
913
|
+
cellValue = getLabelFormatDate(cellValue, props);
|
|
914
|
+
break;
|
|
915
|
+
case "float":
|
|
916
|
+
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
917
|
+
break;
|
|
939
918
|
}
|
|
919
|
+
}
|
|
920
|
+
const cellVNs = getCellLabelVNs(renderOpts, renderParams, cellValue);
|
|
921
|
+
return getInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
|
|
940
922
|
},
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
923
|
+
renderTableDefault: defaultInputEditRender,
|
|
924
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
925
|
+
renderTableFilter: defaultFilterRender,
|
|
926
|
+
renderTableFloatingFilter: defaultFloatingFilterRender,
|
|
927
|
+
tableFilterDefaultMethod: handleInputFilterMethod
|
|
928
|
+
},
|
|
929
|
+
FormatNumberInput: {
|
|
930
|
+
renderTableDefault(renderOpts, renderParams) {
|
|
931
|
+
const { row, column } = renderParams;
|
|
932
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
933
|
+
return handleNumberCell(cellValue, renderOpts, renderParams);
|
|
934
|
+
},
|
|
935
|
+
tableFilterDefaultMethod({ option, row, column }) {
|
|
936
|
+
const { data } = option;
|
|
937
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
938
|
+
return cellValue == data;
|
|
939
|
+
},
|
|
940
|
+
tableExportMethod(params) {
|
|
941
|
+
const { row, column } = params;
|
|
942
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
943
|
+
return cellValue;
|
|
944
|
+
}
|
|
945
|
+
},
|
|
946
|
+
VxeNumberInput: {
|
|
947
|
+
tableAutoFocus: true,
|
|
948
|
+
renderTableEdit: defaultInputEditRender,
|
|
949
|
+
renderTableCell(renderOpts, renderParams) {
|
|
950
|
+
const { row, column } = renderParams;
|
|
951
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
952
|
+
const cellVNs = handleNumberCell(cellValue, renderOpts, renderParams);
|
|
953
|
+
return getInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
|
|
954
|
+
},
|
|
955
|
+
renderTableFooter(renderOpts, params) {
|
|
956
|
+
const { props = {} } = renderOpts;
|
|
957
|
+
const { row, column, _columnIndex } = params;
|
|
958
|
+
const { type } = props;
|
|
959
|
+
const itemValue = XEUtils.isArray(row) ? row[_columnIndex] : XEUtils.get(row, column.field);
|
|
960
|
+
if (XEUtils.isNumber(itemValue)) {
|
|
961
|
+
const numberInputConfig = getConfig().numberInput || {};
|
|
962
|
+
if (type === "float") {
|
|
963
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
964
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
965
|
+
let amountLabel = XEUtils.toFixed(XEUtils.floor(itemValue, digits), digits);
|
|
966
|
+
if (!autoFill) {
|
|
967
|
+
amountLabel = "" + XEUtils.toNumber(amountLabel);
|
|
968
|
+
}
|
|
969
|
+
return amountLabel;
|
|
970
|
+
} else if (type === "amount") {
|
|
971
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
972
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
973
|
+
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
974
|
+
let amountLabel = XEUtils.commafy(XEUtils.toNumber(itemValue), { digits });
|
|
975
|
+
if (!autoFill) {
|
|
976
|
+
const [iStr, dStr] = amountLabel.split(".");
|
|
977
|
+
if (dStr) {
|
|
978
|
+
const dRest = dStr.replace(/0+$/, "");
|
|
979
|
+
amountLabel = dRest ? [iStr, ".", dRest].join("") : iStr;
|
|
984
980
|
}
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
renderTableFloatingFilter: defaultFloatingFilterRender,
|
|
991
|
-
tableFilterDefaultMethod({ option, row, column }) {
|
|
992
|
-
const { data } = option;
|
|
993
|
-
const cellValue = XEUtils.get(row, column.field);
|
|
994
|
-
/* eslint-disable eqeqeq */
|
|
995
|
-
return cellValue == data;
|
|
996
|
-
},
|
|
997
|
-
tableExportMethod(params) {
|
|
998
|
-
const { row, column } = params;
|
|
999
|
-
const cellValue = XEUtils.get(row, column.field);
|
|
1000
|
-
return cellValue;
|
|
981
|
+
}
|
|
982
|
+
if (showCurrency) {
|
|
983
|
+
amountLabel = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n("vxe.numberInput.currencySymbol") || ""}${amountLabel}`;
|
|
984
|
+
}
|
|
985
|
+
return amountLabel;
|
|
1001
986
|
}
|
|
987
|
+
}
|
|
988
|
+
return getFuncText(itemValue, 1);
|
|
1002
989
|
},
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
getResult({ cellValue }) {
|
|
1012
|
-
if (cellValue) {
|
|
1013
|
-
if (props.type !== 'time') {
|
|
1014
|
-
return getLabelFormatDate(cellValue, props);
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
return cellValue;
|
|
1018
|
-
}
|
|
1019
|
-
});
|
|
1020
|
-
return getCellLabelVNs(renderOpts, params, cellResult);
|
|
1021
|
-
},
|
|
1022
|
-
tableCellFormatter: handleFormatDatePicker,
|
|
1023
|
-
renderTableDefault: defaultEditRender,
|
|
1024
|
-
createTableFilterOptions: defaultFilterOptions,
|
|
1025
|
-
renderTableFilter: defaultFilterRender,
|
|
1026
|
-
renderTableFloatingFilter: defaultFloatingFilterRender,
|
|
1027
|
-
tableFilterDefaultMethod: handleFilterMethod
|
|
990
|
+
renderTableDefault: defaultInputEditRender,
|
|
991
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
992
|
+
renderTableFilter: defaultFilterRender,
|
|
993
|
+
renderTableFloatingFilter: defaultFloatingFilterRender,
|
|
994
|
+
tableFilterDefaultMethod({ option, row, column }) {
|
|
995
|
+
const { data } = option;
|
|
996
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
997
|
+
return cellValue == data;
|
|
1028
998
|
},
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
if (endField) {
|
|
1048
|
-
XEUtils.set(row, endField, value);
|
|
1049
|
-
}
|
|
1050
|
-
};
|
|
1051
|
-
}
|
|
1052
|
-
return [
|
|
1053
|
-
h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, cellValue, seProps)), getComponentOns(renderOpts, params, {
|
|
1054
|
-
model(cellValue) {
|
|
1055
|
-
model.update = true;
|
|
1056
|
-
model.value = cellValue;
|
|
1057
|
-
setCellValue(row, column, cellValue);
|
|
1058
|
-
},
|
|
1059
|
-
change() {
|
|
1060
|
-
$table.updateStatus(params);
|
|
1061
|
-
},
|
|
1062
|
-
blur() {
|
|
1063
|
-
$table.handleCellRuleUpdateStatus('blur', params);
|
|
1064
|
-
}
|
|
1065
|
-
}, seOs)))
|
|
1066
|
-
];
|
|
1067
|
-
},
|
|
1068
|
-
renderTableDefault(renderOpts, params) {
|
|
1069
|
-
const { startField, endField } = renderOpts;
|
|
1070
|
-
const { row, column } = params;
|
|
1071
|
-
const { model } = column;
|
|
1072
|
-
const cellValue = getCellValue(row, column);
|
|
1073
|
-
const seProps = {};
|
|
1074
|
-
const seOs = {};
|
|
1075
|
-
if (startField && endField) {
|
|
1076
|
-
seProps.startValue = XEUtils.get(row, startField);
|
|
1077
|
-
seProps.endValue = XEUtils.get(row, endField);
|
|
1078
|
-
seOs['onUpdate:startValue'] = (value) => {
|
|
1079
|
-
if (startField) {
|
|
1080
|
-
XEUtils.set(row, startField, value);
|
|
1081
|
-
}
|
|
1082
|
-
};
|
|
1083
|
-
seOs['onUpdate:endValue'] = (value) => {
|
|
1084
|
-
if (endField) {
|
|
1085
|
-
XEUtils.set(row, endField, value);
|
|
1086
|
-
}
|
|
1087
|
-
};
|
|
1088
|
-
}
|
|
1089
|
-
return [
|
|
1090
|
-
h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, cellValue, seProps)), getComponentOns(renderOpts, params, {
|
|
1091
|
-
model(cellValue) {
|
|
1092
|
-
model.update = true;
|
|
1093
|
-
model.value = cellValue;
|
|
1094
|
-
setCellValue(row, column, cellValue);
|
|
1095
|
-
}
|
|
1096
|
-
}, seOs)))
|
|
1097
|
-
];
|
|
1098
|
-
},
|
|
1099
|
-
renderTableCell(renderOpts, params) {
|
|
1100
|
-
const { startField, endField } = renderOpts;
|
|
1101
|
-
const { row, column } = params;
|
|
1102
|
-
let startValue = '';
|
|
1103
|
-
let endValue = '';
|
|
1104
|
-
if (startField && endField) {
|
|
1105
|
-
startValue = XEUtils.get(row, startField);
|
|
1106
|
-
endValue = XEUtils.get(row, endField);
|
|
1107
|
-
}
|
|
1108
|
-
else {
|
|
1109
|
-
const cellValue = XEUtils.get(row, column.field);
|
|
1110
|
-
if (cellValue) {
|
|
1111
|
-
if (XEUtils.isArray(cellValue)) {
|
|
1112
|
-
startValue = cellValue[0];
|
|
1113
|
-
endValue = cellValue[1];
|
|
1114
|
-
}
|
|
1115
|
-
else {
|
|
1116
|
-
const strs = `${cellValue}`.split(',');
|
|
1117
|
-
startValue = strs[0];
|
|
1118
|
-
endValue = strs[1];
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
let cellLabel = '';
|
|
1123
|
-
if (startValue && endValue) {
|
|
1124
|
-
cellLabel = `${startValue} ~ ${endValue}`;
|
|
999
|
+
tableExportMethod(params) {
|
|
1000
|
+
const { row, column } = params;
|
|
1001
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
1002
|
+
return cellValue;
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
VxeDatePicker: {
|
|
1006
|
+
tableAutoFocus: true,
|
|
1007
|
+
renderTableEdit: defaultEditRender,
|
|
1008
|
+
renderTableCell(renderOpts, params) {
|
|
1009
|
+
const props = renderOpts.props || {};
|
|
1010
|
+
const { $table, row, column } = params;
|
|
1011
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
1012
|
+
key: "render_table_cell",
|
|
1013
|
+
getResult({ cellValue }) {
|
|
1014
|
+
if (cellValue) {
|
|
1015
|
+
if (props.type !== "time") {
|
|
1016
|
+
return getLabelFormatDate(cellValue, props);
|
|
1125
1017
|
}
|
|
1126
|
-
|
|
1018
|
+
}
|
|
1019
|
+
return cellValue;
|
|
1127
1020
|
}
|
|
1021
|
+
});
|
|
1022
|
+
return getCellLabelVNs(renderOpts, params, cellResult);
|
|
1128
1023
|
},
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1024
|
+
tableCellFormatter: handleFormatDatePicker,
|
|
1025
|
+
renderTableDefault: defaultEditRender,
|
|
1026
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
1027
|
+
renderTableFilter: defaultFilterRender,
|
|
1028
|
+
renderTableFloatingFilter: defaultFloatingFilterRender,
|
|
1029
|
+
tableFilterDefaultMethod: handleFilterMethod
|
|
1030
|
+
},
|
|
1031
|
+
VxeDateRangePicker: {
|
|
1032
|
+
tableAutoFocus: true,
|
|
1033
|
+
renderTableEdit(renderOpts, params) {
|
|
1034
|
+
const { startField, endField } = renderOpts;
|
|
1035
|
+
const { $table, row, column } = params;
|
|
1036
|
+
const { model } = column;
|
|
1037
|
+
const cellValue = getCellValue(row, column);
|
|
1038
|
+
const seProps = {};
|
|
1039
|
+
const seOs = {};
|
|
1040
|
+
if (startField && endField) {
|
|
1041
|
+
seProps.startValue = XEUtils.get(row, startField);
|
|
1042
|
+
seProps.endValue = XEUtils.get(row, endField);
|
|
1043
|
+
seOs["onUpdate:startValue"] = (value) => {
|
|
1044
|
+
if (startField) {
|
|
1045
|
+
XEUtils.set(row, startField, value);
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
seOs["onUpdate:endValue"] = (value) => {
|
|
1049
|
+
if (endField) {
|
|
1050
|
+
XEUtils.set(row, endField, value);
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
return [
|
|
1055
|
+
h(getDefaultComponent(renderOpts), {
|
|
1056
|
+
...getCellEditProps(renderOpts, params, cellValue, seProps),
|
|
1057
|
+
...getComponentOns(renderOpts, params, {
|
|
1058
|
+
model(cellValue2) {
|
|
1059
|
+
model.update = true;
|
|
1060
|
+
model.value = cellValue2;
|
|
1061
|
+
setCellValue(row, column, cellValue2);
|
|
1062
|
+
},
|
|
1063
|
+
change() {
|
|
1064
|
+
$table.updateStatus(params);
|
|
1065
|
+
},
|
|
1066
|
+
blur() {
|
|
1067
|
+
$table.handleCellRuleUpdateStatus("blur", params);
|
|
1068
|
+
}
|
|
1069
|
+
}, seOs)
|
|
1070
|
+
})
|
|
1071
|
+
];
|
|
1139
1072
|
},
|
|
1140
|
-
|
|
1141
|
-
|
|
1073
|
+
renderTableDefault(renderOpts, params) {
|
|
1074
|
+
const { startField, endField } = renderOpts;
|
|
1075
|
+
const { row, column } = params;
|
|
1076
|
+
const { model } = column;
|
|
1077
|
+
const cellValue = getCellValue(row, column);
|
|
1078
|
+
const seProps = {};
|
|
1079
|
+
const seOs = {};
|
|
1080
|
+
if (startField && endField) {
|
|
1081
|
+
seProps.startValue = XEUtils.get(row, startField);
|
|
1082
|
+
seProps.endValue = XEUtils.get(row, endField);
|
|
1083
|
+
seOs["onUpdate:startValue"] = (value) => {
|
|
1084
|
+
if (startField) {
|
|
1085
|
+
XEUtils.set(row, startField, value);
|
|
1086
|
+
}
|
|
1087
|
+
};
|
|
1088
|
+
seOs["onUpdate:endValue"] = (value) => {
|
|
1089
|
+
if (endField) {
|
|
1090
|
+
XEUtils.set(row, endField, value);
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1094
|
+
return [
|
|
1095
|
+
h(getDefaultComponent(renderOpts), {
|
|
1096
|
+
...getCellEditProps(renderOpts, params, cellValue, seProps),
|
|
1097
|
+
...getComponentOns(renderOpts, params, {
|
|
1098
|
+
model(cellValue2) {
|
|
1099
|
+
model.update = true;
|
|
1100
|
+
model.value = cellValue2;
|
|
1101
|
+
setCellValue(row, column, cellValue2);
|
|
1102
|
+
}
|
|
1103
|
+
}, seOs)
|
|
1104
|
+
})
|
|
1105
|
+
];
|
|
1142
1106
|
},
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1107
|
+
renderTableCell(renderOpts, params) {
|
|
1108
|
+
const { startField, endField } = renderOpts;
|
|
1109
|
+
const { row, column } = params;
|
|
1110
|
+
let startValue = "";
|
|
1111
|
+
let endValue = "";
|
|
1112
|
+
if (startField && endField) {
|
|
1113
|
+
startValue = XEUtils.get(row, startField);
|
|
1114
|
+
endValue = XEUtils.get(row, endField);
|
|
1115
|
+
} else {
|
|
1116
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
1117
|
+
if (cellValue) {
|
|
1118
|
+
if (XEUtils.isArray(cellValue)) {
|
|
1119
|
+
startValue = cellValue[0];
|
|
1120
|
+
endValue = cellValue[1];
|
|
1121
|
+
} else {
|
|
1122
|
+
const strs = `${cellValue}`.split(",");
|
|
1123
|
+
startValue = strs[0];
|
|
1124
|
+
endValue = strs[1];
|
|
1125
|
+
}
|
|
1149
1126
|
}
|
|
1127
|
+
}
|
|
1128
|
+
let cellLabel = "";
|
|
1129
|
+
if (startValue && endValue) {
|
|
1130
|
+
cellLabel = `${startValue} ~ ${endValue}`;
|
|
1131
|
+
}
|
|
1132
|
+
return getCellLabelVNs(renderOpts, params, cellLabel);
|
|
1133
|
+
}
|
|
1134
|
+
},
|
|
1135
|
+
VxeTextarea: {
|
|
1136
|
+
tableAutoFocus: true,
|
|
1137
|
+
renderTableDefault: defaultInputEditRender,
|
|
1138
|
+
renderTableCell(renderOpts, renderParams) {
|
|
1139
|
+
const { row, column } = renderParams;
|
|
1140
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
1141
|
+
const cellVNs = getCellLabelVNs(renderOpts, renderParams, cellValue);
|
|
1142
|
+
return getInputRenderCellVNs(cellValue, cellVNs, renderOpts, renderParams);
|
|
1150
1143
|
},
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
return h(getDefaultComponent(renderOpts), Object.assign(Object.assign({ key: oIndex }, getCellEditFilterProps(renderOpts, params, optionValue, { options, optionProps, optionGroups, optionGroupProps })), getFilterOns(renderOpts, params, option)));
|
|
1182
|
-
});
|
|
1144
|
+
renderTableEdit: defaultInputEditRender
|
|
1145
|
+
},
|
|
1146
|
+
VxeButton: {
|
|
1147
|
+
renderTableDefault: buttonCellRender
|
|
1148
|
+
},
|
|
1149
|
+
VxeButtonGroup: {
|
|
1150
|
+
renderTableDefault(renderOpts, params) {
|
|
1151
|
+
const { options } = renderOpts;
|
|
1152
|
+
return [
|
|
1153
|
+
h(getDefaultComponent(renderOpts), {
|
|
1154
|
+
options,
|
|
1155
|
+
...getCellEditProps(renderOpts, params, null),
|
|
1156
|
+
...getComponentOns(renderOpts, params)
|
|
1157
|
+
})
|
|
1158
|
+
];
|
|
1159
|
+
}
|
|
1160
|
+
},
|
|
1161
|
+
VxeSelect: {
|
|
1162
|
+
tableAutoFocus: true,
|
|
1163
|
+
renderTableEdit: defaultSelectEditRender,
|
|
1164
|
+
renderTableDefault: defaultSelectEditRender,
|
|
1165
|
+
renderTableCell(renderOpts, params) {
|
|
1166
|
+
const { options, optionGroups } = renderOpts;
|
|
1167
|
+
const { $table, row, column } = params;
|
|
1168
|
+
const opSize = options ? options.length : null;
|
|
1169
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
1170
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
1171
|
+
key: "render_table_cell",
|
|
1172
|
+
isChanged({ oldValue, cellValue }) {
|
|
1173
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
1183
1174
|
},
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
|
|
1187
|
-
const optionValue = option.data;
|
|
1188
|
-
return h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditFilterProps(renderOpts, params, optionValue, { options, optionProps, optionGroups, optionGroupProps })), getFloatingFilterOns(renderOpts, params, option)));
|
|
1175
|
+
setValue({ cellValue }) {
|
|
1176
|
+
return [cellValue, opSize, ogSize];
|
|
1189
1177
|
},
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
tableCellPasteMethod: handleSetSelectValue,
|
|
1193
|
-
tableFilterDefaultMethod: handleFilterMethod,
|
|
1194
|
-
tableExportMethod: handleExportSelectMethod
|
|
1195
|
-
},
|
|
1196
|
-
VxeText: {
|
|
1197
|
-
renderTableDefault(renderOpts, params) {
|
|
1198
|
-
const { $table, row, column } = params;
|
|
1199
|
-
const { props } = renderOpts;
|
|
1200
|
-
const cellLabel = $table.getCellLabel(row, column);
|
|
1201
|
-
return [
|
|
1202
|
-
h(getDefaultComponent(renderOpts), Object.assign(Object.assign(Object.assign({}, (props || {})), { content: cellLabel }), getComponentOns(renderOpts, params)))
|
|
1203
|
-
];
|
|
1178
|
+
getResult({ cellValue }) {
|
|
1179
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
1204
1180
|
}
|
|
1181
|
+
});
|
|
1182
|
+
return getCellLabelVNs(renderOpts, params, cellResult);
|
|
1205
1183
|
},
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1184
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
1185
|
+
renderTableFilter(renderOpts, params) {
|
|
1186
|
+
const { column } = params;
|
|
1187
|
+
const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
|
|
1188
|
+
return column.filters.map((option, oIndex) => {
|
|
1189
|
+
const optionValue = option.data;
|
|
1190
|
+
return h(getDefaultComponent(renderOpts), {
|
|
1191
|
+
key: oIndex,
|
|
1192
|
+
...getCellEditFilterProps(renderOpts, params, optionValue, { options, optionProps, optionGroups, optionGroupProps }),
|
|
1193
|
+
...getFilterOns(renderOpts, params, option)
|
|
1194
|
+
});
|
|
1195
|
+
});
|
|
1216
1196
|
},
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1197
|
+
renderTableFloatingFilter(renderOpts, params) {
|
|
1198
|
+
const { option } = params;
|
|
1199
|
+
const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
|
|
1200
|
+
const optionValue = option.data;
|
|
1201
|
+
return h(getDefaultComponent(renderOpts), {
|
|
1202
|
+
...getCellEditFilterProps(renderOpts, params, optionValue, { options, optionProps, optionGroups, optionGroupProps }),
|
|
1203
|
+
...getFloatingFilterOns(renderOpts, params, option)
|
|
1204
|
+
});
|
|
1225
1205
|
},
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1206
|
+
tableCellFormatter: handleFormatSelect,
|
|
1207
|
+
tableCellCopyMethod: handleFormatSelect,
|
|
1208
|
+
tableCellPasteMethod: handleSetSelectValue,
|
|
1209
|
+
tableFilterDefaultMethod: handleFilterMethod,
|
|
1210
|
+
tableExportMethod: handleExportSelectMethod
|
|
1211
|
+
},
|
|
1212
|
+
VxeText: {
|
|
1213
|
+
renderTableDefault(renderOpts, params) {
|
|
1214
|
+
const { $table, row, column } = params;
|
|
1215
|
+
const { props } = renderOpts;
|
|
1216
|
+
const cellLabel = $table.getCellLabel(row, column);
|
|
1217
|
+
return [
|
|
1218
|
+
h(getDefaultComponent(renderOpts), {
|
|
1219
|
+
...props || {},
|
|
1220
|
+
content: cellLabel,
|
|
1221
|
+
...getComponentOns(renderOpts, params)
|
|
1222
|
+
})
|
|
1223
|
+
];
|
|
1224
|
+
}
|
|
1225
|
+
},
|
|
1226
|
+
VxeLink: {
|
|
1227
|
+
renderTableDefault(renderOpts, params) {
|
|
1228
|
+
const { $table, row, column } = params;
|
|
1229
|
+
const { props } = renderOpts;
|
|
1230
|
+
const { href } = props || {};
|
|
1231
|
+
const cellLabel = $table.getCellLabel(row, column);
|
|
1232
|
+
return [
|
|
1233
|
+
h(getDefaultComponent(renderOpts), {
|
|
1234
|
+
...props || {},
|
|
1235
|
+
content: cellLabel,
|
|
1236
|
+
href: XEUtils.toFormatString(href, params),
|
|
1237
|
+
...getComponentOns(renderOpts, params)
|
|
1238
|
+
})
|
|
1239
|
+
];
|
|
1240
|
+
}
|
|
1241
|
+
},
|
|
1242
|
+
/**
|
|
1243
|
+
* 已废弃,被 FormatSelect 替换
|
|
1244
|
+
* @deprecated
|
|
1245
|
+
*/
|
|
1246
|
+
formatOption: {
|
|
1247
|
+
renderTableDefault(renderOpts, params) {
|
|
1248
|
+
return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
1249
|
+
}
|
|
1250
|
+
},
|
|
1251
|
+
FormatSelect: {
|
|
1252
|
+
renderTableDefault(renderOpts, params) {
|
|
1253
|
+
const { options, optionGroups } = renderOpts;
|
|
1254
|
+
const { $table, row, column } = params;
|
|
1255
|
+
const opSize = options ? options.length : null;
|
|
1256
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
1257
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
1258
|
+
key: "render_table_cell",
|
|
1259
|
+
isChanged({ oldValue, cellValue }) {
|
|
1260
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
1246
1261
|
},
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
tableCellPasteMethod: handleSetSelectValue,
|
|
1250
|
-
tableFilterDefaultMethod: handleFilterMethod,
|
|
1251
|
-
tableExportMethod: handleExportSelectMethod
|
|
1252
|
-
},
|
|
1253
|
-
VxeTreeSelect: {
|
|
1254
|
-
tableAutoFocus: true,
|
|
1255
|
-
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
1256
|
-
renderTableCell(renderOpts, params) {
|
|
1257
|
-
const { options, optionGroups } = renderOpts;
|
|
1258
|
-
const { $table, row, column } = params;
|
|
1259
|
-
const opSize = options ? options.length : null;
|
|
1260
|
-
const ogSize = optionGroups ? optionGroups.length : null;
|
|
1261
|
-
const { cellResult } = $table.effectCellData(row, column, {
|
|
1262
|
-
key: 'render_table_cell',
|
|
1263
|
-
isChanged({ oldValue, cellValue }) {
|
|
1264
|
-
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
1265
|
-
},
|
|
1266
|
-
setValue({ cellValue }) {
|
|
1267
|
-
return [cellValue, opSize, ogSize];
|
|
1268
|
-
},
|
|
1269
|
-
getResult({ cellValue }) {
|
|
1270
|
-
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
1271
|
-
}
|
|
1272
|
-
});
|
|
1273
|
-
// const cellResult = getTreeSelectCellValue(renderOpts, params)
|
|
1274
|
-
return getCellLabelVNs(renderOpts, params, cellResult);
|
|
1262
|
+
setValue({ cellValue }) {
|
|
1263
|
+
return [cellValue, opSize, ogSize];
|
|
1275
1264
|
},
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
tableCellPasteMethod: handleSetTreeSelectValue,
|
|
1279
|
-
tableExportMethod: handleExportTreeSelectMethod
|
|
1280
|
-
},
|
|
1281
|
-
/**
|
|
1282
|
-
* 已废弃,被 FormatTreeSelect 替换
|
|
1283
|
-
* @deprecated
|
|
1284
|
-
*/
|
|
1285
|
-
formatTree: {
|
|
1286
|
-
renderTableDefault(renderOpts, params) {
|
|
1287
|
-
return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params));
|
|
1265
|
+
getResult({ cellValue }) {
|
|
1266
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
1288
1267
|
}
|
|
1268
|
+
});
|
|
1269
|
+
return getCellLabelVNs(renderOpts, params, cellResult);
|
|
1289
1270
|
},
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
// const cellResult = getTreeSelectCellValue(renderOpts, params)
|
|
1309
|
-
return getCellLabelVNs(renderOpts, params, cellResult);
|
|
1271
|
+
tableCellFormatter: handleFormatSelect,
|
|
1272
|
+
tableCellCopyMethod: handleFormatSelect,
|
|
1273
|
+
tableCellPasteMethod: handleSetSelectValue,
|
|
1274
|
+
tableFilterDefaultMethod: handleFilterMethod,
|
|
1275
|
+
tableExportMethod: handleExportSelectMethod
|
|
1276
|
+
},
|
|
1277
|
+
VxeTreeSelect: {
|
|
1278
|
+
tableAutoFocus: true,
|
|
1279
|
+
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
1280
|
+
renderTableCell(renderOpts, params) {
|
|
1281
|
+
const { options, optionGroups } = renderOpts;
|
|
1282
|
+
const { $table, row, column } = params;
|
|
1283
|
+
const opSize = options ? options.length : null;
|
|
1284
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
1285
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
1286
|
+
key: "render_table_cell",
|
|
1287
|
+
isChanged({ oldValue, cellValue }) {
|
|
1288
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
1310
1289
|
},
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
tableCellPasteMethod: handleSetTreeSelectValue,
|
|
1314
|
-
tableExportMethod: handleExportTreeSelectMethod
|
|
1315
|
-
},
|
|
1316
|
-
VxeCascader: {
|
|
1317
|
-
tableAutoFocus: true,
|
|
1318
|
-
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
1319
|
-
renderTableCell(renderOpts, params) {
|
|
1320
|
-
const { options, optionGroups } = renderOpts;
|
|
1321
|
-
const { $table, row, column } = params;
|
|
1322
|
-
const opSize = options ? options.length : null;
|
|
1323
|
-
const ogSize = optionGroups ? optionGroups.length : null;
|
|
1324
|
-
const { cellResult } = $table.effectCellData(row, column, {
|
|
1325
|
-
key: 'render_table_cell',
|
|
1326
|
-
isChanged({ oldValue, cellValue }) {
|
|
1327
|
-
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
1328
|
-
},
|
|
1329
|
-
setValue({ cellValue }) {
|
|
1330
|
-
return [cellValue, opSize, ogSize];
|
|
1331
|
-
},
|
|
1332
|
-
getResult({ cellValue }) {
|
|
1333
|
-
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
1334
|
-
}
|
|
1335
|
-
});
|
|
1336
|
-
// const cellResult = getTreeSelectCellValue(renderOpts, params)
|
|
1337
|
-
return getCellLabelVNs(renderOpts, params, cellResult);
|
|
1290
|
+
setValue({ cellValue }) {
|
|
1291
|
+
return [cellValue, opSize, ogSize];
|
|
1338
1292
|
},
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1293
|
+
getResult({ cellValue }) {
|
|
1294
|
+
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
return getCellLabelVNs(renderOpts, params, cellResult);
|
|
1343
1298
|
},
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1299
|
+
tableCellFormatter: handleFormatTreeSelect,
|
|
1300
|
+
tableCellCopyMethod: handleFormatTreeSelect,
|
|
1301
|
+
tableCellPasteMethod: handleSetTreeSelectValue,
|
|
1302
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
1303
|
+
},
|
|
1304
|
+
/**
|
|
1305
|
+
* 已废弃,被 FormatTreeSelect 替换
|
|
1306
|
+
* @deprecated
|
|
1307
|
+
*/
|
|
1308
|
+
formatTree: {
|
|
1309
|
+
renderTableDefault(renderOpts, params) {
|
|
1310
|
+
return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params));
|
|
1311
|
+
}
|
|
1312
|
+
},
|
|
1313
|
+
FormatTreeSelect: {
|
|
1314
|
+
renderTableDefault(renderOpts, params) {
|
|
1315
|
+
const { options, optionGroups } = renderOpts;
|
|
1316
|
+
const { $table, row, column } = params;
|
|
1317
|
+
const opSize = options ? options.length : null;
|
|
1318
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
1319
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
1320
|
+
key: "render_table_cell",
|
|
1321
|
+
isChanged({ oldValue, cellValue }) {
|
|
1322
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
1366
1323
|
},
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
tableCellPasteMethod: handleSetTreeSelectValue,
|
|
1370
|
-
tableExportMethod: handleExportTreeSelectMethod
|
|
1371
|
-
},
|
|
1372
|
-
VxeColorPicker: {
|
|
1373
|
-
tableAutoFocus: true,
|
|
1374
|
-
renderTableEdit(renderOpts, params) {
|
|
1375
|
-
const { row, column } = params;
|
|
1376
|
-
const { options } = renderOpts;
|
|
1377
|
-
const cellValue = getCellValue(row, column);
|
|
1378
|
-
return [
|
|
1379
|
-
h(getDefaultComponent(renderOpts), Object.assign(Object.assign({}, getCellEditProps(renderOpts, params, cellValue, { colors: options })), getEditOns(renderOpts, params)))
|
|
1380
|
-
];
|
|
1324
|
+
setValue({ cellValue }) {
|
|
1325
|
+
return [cellValue, opSize, ogSize];
|
|
1381
1326
|
},
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
const { props } = renderOpts;
|
|
1385
|
-
const { computeSize } = $table.getComputeMaps();
|
|
1386
|
-
const customSize = props ? props.size : null;
|
|
1387
|
-
const vSize = customSize || computeSize.value;
|
|
1388
|
-
const cellValue = XEUtils.get(row, column.field);
|
|
1389
|
-
return h('span', {
|
|
1390
|
-
class: ['vxe-color-picker--readonly', {
|
|
1391
|
-
[`size--${vSize}`]: vSize
|
|
1392
|
-
}]
|
|
1393
|
-
}, [
|
|
1394
|
-
h('div', {
|
|
1395
|
-
class: ['vxe-color-picker--readonly-color', {
|
|
1396
|
-
'is--empty': !cellValue
|
|
1397
|
-
}],
|
|
1398
|
-
style: cellValue
|
|
1399
|
-
? {
|
|
1400
|
-
backgroundColor: cellValue
|
|
1401
|
-
}
|
|
1402
|
-
: undefined
|
|
1403
|
-
})
|
|
1404
|
-
]);
|
|
1327
|
+
getResult({ cellValue }) {
|
|
1328
|
+
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
1405
1329
|
}
|
|
1330
|
+
});
|
|
1331
|
+
return getCellLabelVNs(renderOpts, params, cellResult);
|
|
1406
1332
|
},
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1333
|
+
tableCellFormatter: handleFormatTreeSelect,
|
|
1334
|
+
tableCellCopyMethod: handleFormatTreeSelect,
|
|
1335
|
+
tableCellPasteMethod: handleSetTreeSelectValue,
|
|
1336
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
1337
|
+
},
|
|
1338
|
+
VxeCascader: {
|
|
1339
|
+
tableAutoFocus: true,
|
|
1340
|
+
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
1341
|
+
renderTableCell(renderOpts, params) {
|
|
1342
|
+
const { options, optionGroups } = renderOpts;
|
|
1343
|
+
const { $table, row, column } = params;
|
|
1344
|
+
const opSize = options ? options.length : null;
|
|
1345
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
1346
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
1347
|
+
key: "render_table_cell",
|
|
1348
|
+
isChanged({ oldValue, cellValue }) {
|
|
1349
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
1416
1350
|
},
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
});
|
|
1423
|
-
}
|
|
1424
|
-
},
|
|
1425
|
-
VxeRadioGroup: {
|
|
1426
|
-
renderTableDefault: radioAndCheckboxGroupEditRender
|
|
1427
|
-
},
|
|
1428
|
-
VxeCheckbox: {
|
|
1429
|
-
renderTableDefault: checkboxEditRender
|
|
1430
|
-
},
|
|
1431
|
-
VxeCheckboxGroup: {
|
|
1432
|
-
renderTableDefault: radioAndCheckboxGroupEditRender
|
|
1433
|
-
},
|
|
1434
|
-
VxeSwitch: {
|
|
1435
|
-
tableAutoFocus: 'button',
|
|
1436
|
-
renderTableEdit: defaultEditRender,
|
|
1437
|
-
renderTableDefault: defaultEditRender
|
|
1438
|
-
},
|
|
1439
|
-
VxeUpload: {
|
|
1440
|
-
renderTableEdit: defaultEditRender,
|
|
1441
|
-
renderTableCell: defaultEditRender,
|
|
1442
|
-
renderTableDefault: defaultEditRender
|
|
1443
|
-
},
|
|
1444
|
-
VxeImage: {
|
|
1445
|
-
renderTableDefault(renderOpts, params) {
|
|
1446
|
-
const { row, column } = params;
|
|
1447
|
-
const { props } = renderOpts;
|
|
1448
|
-
const cellValue = getCellValue(row, column);
|
|
1449
|
-
return [
|
|
1450
|
-
h(getDefaultComponent(renderOpts), Object.assign(Object.assign(Object.assign({}, props), { src: cellValue }), getEditOns(renderOpts, params)))
|
|
1451
|
-
];
|
|
1452
|
-
}
|
|
1453
|
-
},
|
|
1454
|
-
VxeImageGroup: {
|
|
1455
|
-
renderTableDefault(renderOpts, params) {
|
|
1456
|
-
const { row, column } = params;
|
|
1457
|
-
const { props } = renderOpts;
|
|
1458
|
-
const cellValue = getCellValue(row, column);
|
|
1459
|
-
return [
|
|
1460
|
-
h(getDefaultComponent(renderOpts), Object.assign(Object.assign(Object.assign({}, props), { urlList: cellValue }), getEditOns(renderOpts, params)))
|
|
1461
|
-
];
|
|
1462
|
-
}
|
|
1463
|
-
},
|
|
1464
|
-
VxeTextEllipsis: {
|
|
1465
|
-
renderTableDefault(renderOpts, params) {
|
|
1466
|
-
const { row, column } = params;
|
|
1467
|
-
const { props } = renderOpts;
|
|
1468
|
-
const cellValue = getCellValue(row, column);
|
|
1469
|
-
return [
|
|
1470
|
-
h(getDefaultComponent(renderOpts), Object.assign(Object.assign(Object.assign({}, props), { content: cellValue }), getEditOns(renderOpts, params)))
|
|
1471
|
-
];
|
|
1351
|
+
setValue({ cellValue }) {
|
|
1352
|
+
return [cellValue, opSize, ogSize];
|
|
1353
|
+
},
|
|
1354
|
+
getResult({ cellValue }) {
|
|
1355
|
+
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
1472
1356
|
}
|
|
1357
|
+
});
|
|
1358
|
+
return getCellLabelVNs(renderOpts, params, cellResult);
|
|
1473
1359
|
},
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
switch (props.type) {
|
|
1492
|
-
case 'date':
|
|
1493
|
-
case 'week':
|
|
1494
|
-
case 'month':
|
|
1495
|
-
case 'year':
|
|
1496
|
-
cellValue = getLabelFormatDate(cellValue, props);
|
|
1497
|
-
break;
|
|
1498
|
-
case 'float':
|
|
1499
|
-
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
1500
|
-
break;
|
|
1501
|
-
}
|
|
1502
|
-
}
|
|
1503
|
-
return getCellLabelVNs(renderOpts, params, cellValue);
|
|
1360
|
+
tableCellFormatter: handleFormatTreeSelect,
|
|
1361
|
+
tableCellCopyMethod: handleFormatTreeSelect,
|
|
1362
|
+
tableCellPasteMethod: handleSetTreeSelectValue,
|
|
1363
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
1364
|
+
},
|
|
1365
|
+
VxeTableSelect: {
|
|
1366
|
+
tableAutoFocus: true,
|
|
1367
|
+
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
1368
|
+
renderTableCell(renderOpts, params) {
|
|
1369
|
+
const { options, optionGroups } = renderOpts;
|
|
1370
|
+
const { $table, row, column } = params;
|
|
1371
|
+
const opSize = options ? options.length : null;
|
|
1372
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
1373
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
1374
|
+
key: "render_table_cell",
|
|
1375
|
+
isChanged({ oldValue, cellValue }) {
|
|
1376
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
1504
1377
|
},
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1378
|
+
setValue({ cellValue }) {
|
|
1379
|
+
return [cellValue, opSize, ogSize];
|
|
1380
|
+
},
|
|
1381
|
+
getResult({ cellValue }) {
|
|
1382
|
+
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
1383
|
+
}
|
|
1384
|
+
});
|
|
1385
|
+
return getCellLabelVNs(renderOpts, params, cellResult);
|
|
1511
1386
|
},
|
|
1512
|
-
|
|
1513
|
-
|
|
1387
|
+
tableCellFormatter: handleFormatTreeSelect,
|
|
1388
|
+
tableCellCopyMethod: handleFormatTreeSelect,
|
|
1389
|
+
tableCellPasteMethod: handleSetTreeSelectValue,
|
|
1390
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
1391
|
+
},
|
|
1392
|
+
VxeColorPicker: {
|
|
1393
|
+
tableAutoFocus: true,
|
|
1394
|
+
renderTableEdit(renderOpts, params) {
|
|
1395
|
+
const { row, column } = params;
|
|
1396
|
+
const { options } = renderOpts;
|
|
1397
|
+
const cellValue = getCellValue(row, column);
|
|
1398
|
+
return [
|
|
1399
|
+
h(getDefaultComponent(renderOpts), {
|
|
1400
|
+
...getCellEditProps(renderOpts, params, cellValue, { colors: options }),
|
|
1401
|
+
...getEditOns(renderOpts, params)
|
|
1402
|
+
})
|
|
1403
|
+
];
|
|
1514
1404
|
},
|
|
1515
|
-
|
|
1516
|
-
|
|
1405
|
+
renderTableCell(renderOpts, params) {
|
|
1406
|
+
const { $table, row, column } = params;
|
|
1407
|
+
const { props } = renderOpts;
|
|
1408
|
+
const { computeSize } = $table.getComputeMaps();
|
|
1409
|
+
const customSize = props ? props.size : null;
|
|
1410
|
+
const vSize = customSize || computeSize.value;
|
|
1411
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
1412
|
+
return h("span", {
|
|
1413
|
+
class: ["vxe-color-picker--readonly", {
|
|
1414
|
+
[`size--${vSize}`]: vSize
|
|
1415
|
+
}]
|
|
1416
|
+
}, [
|
|
1417
|
+
h("div", {
|
|
1418
|
+
class: ["vxe-color-picker--readonly-color", {
|
|
1419
|
+
"is--empty": !cellValue
|
|
1420
|
+
}],
|
|
1421
|
+
style: cellValue ? {
|
|
1422
|
+
backgroundColor: cellValue
|
|
1423
|
+
} : void 0
|
|
1424
|
+
})
|
|
1425
|
+
]);
|
|
1426
|
+
}
|
|
1427
|
+
},
|
|
1428
|
+
VxeIconPicker: {
|
|
1429
|
+
tableAutoFocus: true,
|
|
1430
|
+
renderTableEdit(renderOpts, params) {
|
|
1431
|
+
const { row, column } = params;
|
|
1432
|
+
const { options } = renderOpts;
|
|
1433
|
+
const cellValue = getCellValue(row, column);
|
|
1434
|
+
return [
|
|
1435
|
+
h(getDefaultComponent(renderOpts), {
|
|
1436
|
+
...getCellEditProps(renderOpts, params, cellValue, { icons: options }),
|
|
1437
|
+
...getEditOns(renderOpts, params)
|
|
1438
|
+
})
|
|
1439
|
+
];
|
|
1517
1440
|
},
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1441
|
+
renderTableCell(renderOpts, params) {
|
|
1442
|
+
const { row, column } = params;
|
|
1443
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
1444
|
+
return h("i", {
|
|
1445
|
+
class: cellValue
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
},
|
|
1449
|
+
VxeRadioGroup: {
|
|
1450
|
+
renderTableDefault: radioAndCheckboxGroupEditRender
|
|
1451
|
+
},
|
|
1452
|
+
VxeCheckbox: {
|
|
1453
|
+
renderTableDefault: checkboxEditRender
|
|
1454
|
+
},
|
|
1455
|
+
VxeCheckboxGroup: {
|
|
1456
|
+
renderTableDefault: radioAndCheckboxGroupEditRender
|
|
1457
|
+
},
|
|
1458
|
+
VxeSwitch: {
|
|
1459
|
+
tableAutoFocus: "button",
|
|
1460
|
+
renderTableEdit: defaultEditRender,
|
|
1461
|
+
renderTableDefault: defaultEditRender
|
|
1462
|
+
},
|
|
1463
|
+
VxeUpload: {
|
|
1464
|
+
renderTableEdit: defaultEditRender,
|
|
1465
|
+
renderTableCell: defaultEditRender,
|
|
1466
|
+
renderTableDefault: defaultEditRender
|
|
1467
|
+
},
|
|
1468
|
+
VxeImage: {
|
|
1469
|
+
renderTableDefault(renderOpts, params) {
|
|
1470
|
+
const { row, column } = params;
|
|
1471
|
+
const { props } = renderOpts;
|
|
1472
|
+
const cellValue = getCellValue(row, column);
|
|
1473
|
+
return [
|
|
1474
|
+
h(getDefaultComponent(renderOpts), {
|
|
1475
|
+
...props,
|
|
1476
|
+
src: cellValue,
|
|
1477
|
+
...getEditOns(renderOpts, params)
|
|
1478
|
+
})
|
|
1479
|
+
];
|
|
1480
|
+
}
|
|
1481
|
+
},
|
|
1482
|
+
VxeImageGroup: {
|
|
1483
|
+
renderTableDefault(renderOpts, params) {
|
|
1484
|
+
const { row, column } = params;
|
|
1485
|
+
const { props } = renderOpts;
|
|
1486
|
+
const cellValue = getCellValue(row, column);
|
|
1487
|
+
return [
|
|
1488
|
+
h(getDefaultComponent(renderOpts), {
|
|
1489
|
+
...props,
|
|
1490
|
+
urlList: cellValue,
|
|
1491
|
+
...getEditOns(renderOpts, params)
|
|
1492
|
+
})
|
|
1493
|
+
];
|
|
1494
|
+
}
|
|
1495
|
+
},
|
|
1496
|
+
VxeTextEllipsis: {
|
|
1497
|
+
renderTableDefault(renderOpts, params) {
|
|
1498
|
+
const { row, column } = params;
|
|
1499
|
+
const { props } = renderOpts;
|
|
1500
|
+
const cellValue = getCellValue(row, column);
|
|
1501
|
+
return [
|
|
1502
|
+
h(getDefaultComponent(renderOpts), {
|
|
1503
|
+
...props,
|
|
1504
|
+
content: cellValue,
|
|
1505
|
+
...getEditOns(renderOpts, params)
|
|
1506
|
+
})
|
|
1507
|
+
];
|
|
1508
|
+
}
|
|
1509
|
+
},
|
|
1510
|
+
VxeRate: {
|
|
1511
|
+
renderTableDefault: defaultEditRender
|
|
1512
|
+
},
|
|
1513
|
+
VxeSlider: {
|
|
1514
|
+
renderTableDefault: defaultEditRender
|
|
1515
|
+
},
|
|
1516
|
+
// 以下已废弃
|
|
1517
|
+
$input: {
|
|
1518
|
+
tableAutoFocus: "input",
|
|
1519
|
+
renderTableEdit: oldEditRender,
|
|
1520
|
+
renderTableCell(renderOpts, params) {
|
|
1521
|
+
var _a;
|
|
1522
|
+
const { props = {} } = renderOpts;
|
|
1523
|
+
const { row, column } = params;
|
|
1524
|
+
const digits = props.digits || ((_a = getConfig().input) == null ? void 0 : _a.digits) || 2;
|
|
1525
|
+
let cellValue = XEUtils.get(row, column.field);
|
|
1526
|
+
if (cellValue) {
|
|
1527
|
+
switch (props.type) {
|
|
1528
|
+
case "date":
|
|
1529
|
+
case "week":
|
|
1530
|
+
case "month":
|
|
1531
|
+
case "year":
|
|
1532
|
+
cellValue = getLabelFormatDate(cellValue, props);
|
|
1533
|
+
break;
|
|
1534
|
+
case "float":
|
|
1535
|
+
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
1536
|
+
break;
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
return getCellLabelVNs(renderOpts, params, cellValue);
|
|
1535
1540
|
},
|
|
1536
|
-
|
|
1537
|
-
|
|
1541
|
+
renderTableDefault: oldEditRender,
|
|
1542
|
+
renderTableFilter: oldFilterRender,
|
|
1543
|
+
tableFilterDefaultMethod: handleInputFilterMethod
|
|
1544
|
+
},
|
|
1545
|
+
$textarea: {
|
|
1546
|
+
tableAutoFocus: "textarea"
|
|
1547
|
+
},
|
|
1548
|
+
$button: {
|
|
1549
|
+
renderTableDefault: oldButtonEditRender
|
|
1550
|
+
},
|
|
1551
|
+
$buttons: {
|
|
1552
|
+
renderTableDefault: oldButtonsEditRender
|
|
1553
|
+
},
|
|
1554
|
+
$select: {
|
|
1555
|
+
tableAutoFocus: "input",
|
|
1556
|
+
renderTableEdit: oldSelectEditRender,
|
|
1557
|
+
renderTableDefault: oldSelectEditRender,
|
|
1558
|
+
renderTableCell(renderOpts, params) {
|
|
1559
|
+
return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
1538
1560
|
},
|
|
1539
|
-
|
|
1540
|
-
|
|
1561
|
+
renderTableFilter(renderOpts, params) {
|
|
1562
|
+
const { column } = params;
|
|
1563
|
+
const { options, optionProps, optionGroups, optionGroupProps } = renderOpts;
|
|
1564
|
+
return column.filters.map((option, oIndex) => {
|
|
1565
|
+
const optionValue = option.data;
|
|
1566
|
+
return h(getOldComponent(renderOpts), {
|
|
1567
|
+
key: oIndex,
|
|
1568
|
+
...getCellEditFilterProps(renderOpts, params, optionValue, { options, optionProps, optionGroups, optionGroupProps }),
|
|
1569
|
+
...getFilterOns(renderOpts, params, option)
|
|
1570
|
+
});
|
|
1571
|
+
});
|
|
1541
1572
|
},
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1573
|
+
tableFilterDefaultMethod: handleFilterMethod,
|
|
1574
|
+
tableExportMethod: handleExportSelectMethod
|
|
1575
|
+
},
|
|
1576
|
+
$radio: {
|
|
1577
|
+
tableAutoFocus: "input"
|
|
1578
|
+
},
|
|
1579
|
+
$checkbox: {
|
|
1580
|
+
tableAutoFocus: "input"
|
|
1581
|
+
},
|
|
1582
|
+
$switch: {
|
|
1583
|
+
tableAutoFocus: "button",
|
|
1584
|
+
renderTableEdit: oldEditRender,
|
|
1585
|
+
renderTableDefault: oldEditRender
|
|
1586
|
+
}
|
|
1587
|
+
// 以上已废弃
|
|
1548
1588
|
});
|