vxe-table 4.23.5 → 4.23.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.esm.js +32456 -33938
- 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/style.css +4501 -1
- package/es/style.mini.css +1 -0
- 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 +14061 -15071
- 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.1792979665397.ttf +0 -0
- package/lib/iconfont.1792979665397.woff +0 -0
- package/lib/iconfont.1792979665397.woff2 +0 -0
- package/lib/index.common.js +35 -19
- package/lib/index.js +37 -0
- package/lib/index.umd.js +30584 -24324
- 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 +248 -618
- 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 -1023
- 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/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.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.1792838769925.ttf → dist/iconfont.1792979665397.ttf} +0 -0
- /package/{es/iconfont.1792838769925.woff → dist/iconfont.1792979665397.woff} +0 -0
- /package/{es/iconfont.1792838769925.woff2 → dist/iconfont.1792979665397.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.1792838769925.ttf → es/iconfont.1792979665397.ttf} +0 -0
- /package/{lib/iconfont.1792838769925.woff → es/iconfont.1792979665397.woff} +0 -0
- /package/{lib/iconfont.1792838769925.woff2 → es/iconfont.1792979665397.woff2} +0 -0
- /package/es/ui/{style.min.css → style.mini.css} +0 -0
- /package/es/{v-x-e-table/style.css → vxe-colgroup/style.mini.css} +0 -0
- /package/es/{v-x-e-table/style.min.css → vxe-column/style.mini.css} +0 -0
- /package/es/{vxe-colgroup/style.min.css → vxe-ui/style.mini.css} +0 -0
- /package/{es/vxe-column/style.min.css → lib/colgroup/style/style.mini.css} +0 -0
- /package/{es/vxe-ui/style.min.css → lib/column/style/style.mini.css} +0 -0
- /package/{es/vxe-v-x-e-table/style.css → lib/ui/style/style.mini.css} +0 -0
- /package/{es/vxe-v-x-e-table/style.min.css → lib/vxe-colgroup/style/style.mini.css} +0 -0
- /package/lib/{colgroup/style/style.min.css → vxe-column/style/style.mini.css} +0 -0
- /package/lib/{column/style/style.min.css → vxe-ui/style/style.mini.css} +0 -0
|
@@ -1,25 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var import_vue = require("vue");
|
|
25
|
+
var import_xe_utils = __toESM(require("xe-utils"));
|
|
26
|
+
var import_ui = require("../../../ui");
|
|
27
|
+
var import_utils = require("../../../ui/src/utils");
|
|
28
|
+
var import_dom = require("../../../ui/src/dom");
|
|
29
|
+
var import_util = require("../../src/util");
|
|
30
|
+
var import_log = require("../../../ui/src/log");
|
|
31
|
+
const { warnLog, errLog } = (0, import_log.createComponentLog)("table");
|
|
32
|
+
const { getConfig, validators, hooks } = import_ui.VxeUI;
|
|
23
33
|
class Rule {
|
|
24
34
|
constructor(rule) {
|
|
25
35
|
Object.assign(this, {
|
|
@@ -39,49 +49,41 @@ class Rule {
|
|
|
39
49
|
* 支持国际化翻译
|
|
40
50
|
*/
|
|
41
51
|
get content() {
|
|
42
|
-
return (0,
|
|
52
|
+
return (0, import_utils.getFuncText)(this.$options.content || this.$options.message);
|
|
43
53
|
}
|
|
44
54
|
get message() {
|
|
45
55
|
return this.content;
|
|
46
56
|
}
|
|
47
57
|
}
|
|
48
|
-
// 如果存在 pattern,判断正则
|
|
49
58
|
function validREValue(pattern, val) {
|
|
50
|
-
if (pattern && !(
|
|
59
|
+
if (pattern && !(import_xe_utils.default.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
|
|
51
60
|
return false;
|
|
52
61
|
}
|
|
53
62
|
return true;
|
|
54
63
|
}
|
|
55
|
-
// 如果存在 max,判断最大值
|
|
56
64
|
function validMaxValue(max, num) {
|
|
57
|
-
if (!
|
|
65
|
+
if (!import_xe_utils.default.eqNull(max) && num > import_xe_utils.default.toNumber(max)) {
|
|
58
66
|
return false;
|
|
59
67
|
}
|
|
60
68
|
return true;
|
|
61
69
|
}
|
|
62
|
-
// 如果存在 min,判断最小值
|
|
63
70
|
function validMinValue(min, num) {
|
|
64
|
-
if (!
|
|
71
|
+
if (!import_xe_utils.default.eqNull(min) && num < import_xe_utils.default.toNumber(min)) {
|
|
65
72
|
return false;
|
|
66
73
|
}
|
|
67
74
|
return true;
|
|
68
75
|
}
|
|
69
76
|
function validRuleValue(rule, val, required) {
|
|
70
|
-
const {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
pattern
|
|
75
|
-
} = rule;
|
|
76
|
-
const isArrType = type === 'array';
|
|
77
|
-
const isNumType = type === 'number';
|
|
78
|
-
const isStrType = type === 'string';
|
|
77
|
+
const { type, min, max, pattern } = rule;
|
|
78
|
+
const isArrType = type === "array";
|
|
79
|
+
const isNumType = type === "number";
|
|
80
|
+
const isStrType = type === "string";
|
|
79
81
|
const strVal = `${val}`;
|
|
80
82
|
if (!validREValue(pattern, strVal)) {
|
|
81
83
|
return false;
|
|
82
84
|
}
|
|
83
85
|
if (isArrType) {
|
|
84
|
-
if (!
|
|
86
|
+
if (!import_xe_utils.default.isArray(val)) {
|
|
85
87
|
return false;
|
|
86
88
|
}
|
|
87
89
|
if (required) {
|
|
@@ -108,7 +110,7 @@ function validRuleValue(rule, val, required) {
|
|
|
108
110
|
}
|
|
109
111
|
} else {
|
|
110
112
|
if (isStrType) {
|
|
111
|
-
if (!
|
|
113
|
+
if (!import_xe_utils.default.isString(val)) {
|
|
112
114
|
return false;
|
|
113
115
|
}
|
|
114
116
|
}
|
|
@@ -127,12 +129,9 @@ function validRuleValue(rule, val, required) {
|
|
|
127
129
|
return true;
|
|
128
130
|
}
|
|
129
131
|
function checkRuleStatus(rule, row, val) {
|
|
130
|
-
const {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
} = rule;
|
|
134
|
-
const currVal = field ? _xeUtils.default.get(row, field) : val;
|
|
135
|
-
const isEmptyVal = _xeUtils.default.isArray(currVal) ? !currVal.length : (0, _utils.eqEmptyValue)(currVal);
|
|
132
|
+
const { required, field } = rule;
|
|
133
|
+
const currVal = field ? import_xe_utils.default.get(row, field) : val;
|
|
134
|
+
const isEmptyVal = import_xe_utils.default.isArray(currVal) ? !currVal.length : (0, import_utils.eqEmptyValue)(currVal);
|
|
136
135
|
if (required) {
|
|
137
136
|
if (isEmptyVal) {
|
|
138
137
|
return false;
|
|
@@ -149,56 +148,42 @@ function checkRuleStatus(rule, row, val) {
|
|
|
149
148
|
}
|
|
150
149
|
return true;
|
|
151
150
|
}
|
|
152
|
-
const tableValidatorMethodKeys = [
|
|
153
|
-
hooks.add(
|
|
151
|
+
const tableValidatorMethodKeys = ["fullValidate", "validate", "fullValidateField", "validateField", "clearValidate"];
|
|
152
|
+
hooks.add("tableValidatorModule", {
|
|
154
153
|
setupTable($xeTable) {
|
|
155
|
-
const {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
internalData
|
|
159
|
-
} = $xeTable;
|
|
160
|
-
const {
|
|
161
|
-
refValidTooltip
|
|
162
|
-
} = $xeTable.getRefMaps();
|
|
163
|
-
const {
|
|
164
|
-
computeValidOpts,
|
|
165
|
-
computeTreeOpts,
|
|
166
|
-
computeEditOpts,
|
|
167
|
-
computeAggregateOpts
|
|
168
|
-
} = $xeTable.getComputeMaps();
|
|
154
|
+
const { props, reactData, internalData } = $xeTable;
|
|
155
|
+
const { refValidTooltip } = $xeTable.getRefMaps();
|
|
156
|
+
const { computeValidOpts, computeTreeOpts, computeEditOpts, computeAggregateOpts } = $xeTable.getComputeMaps();
|
|
169
157
|
let validatorMethods = {};
|
|
170
158
|
let validatorPrivateMethods = {};
|
|
171
159
|
const handleClearValid = (rows, fieldOrColumn) => {
|
|
172
|
-
const {
|
|
173
|
-
validErrorMaps
|
|
174
|
-
} = reactData;
|
|
160
|
+
const { validErrorMaps } = reactData;
|
|
175
161
|
const validOpts = computeValidOpts.value;
|
|
176
|
-
const rowList =
|
|
177
|
-
const colList = (
|
|
162
|
+
const rowList = import_xe_utils.default.isArray(rows) ? rows : rows ? [rows] : [];
|
|
163
|
+
const colList = (import_xe_utils.default.isArray(fieldOrColumn) ? fieldOrColumn : fieldOrColumn ? [fieldOrColumn] : []).map((column) => (0, import_util.handleFieldOrColumn)($xeTable, column));
|
|
178
164
|
let validErrMaps = {};
|
|
179
|
-
|
|
180
|
-
if (validOpts.msgMode === 'full') {
|
|
165
|
+
if (validOpts.msgMode === "full") {
|
|
181
166
|
validErrMaps = Object.assign({}, validErrorMaps);
|
|
182
167
|
if (rowList.length && colList.length) {
|
|
183
|
-
rowList.forEach(row => {
|
|
184
|
-
colList.forEach(column => {
|
|
185
|
-
const validKey = `${(0,
|
|
168
|
+
rowList.forEach((row) => {
|
|
169
|
+
colList.forEach((column) => {
|
|
170
|
+
const validKey = `${(0, import_util.getRowid)($xeTable, row)}:${column.id}`;
|
|
186
171
|
if (validErrMaps[validKey]) {
|
|
187
172
|
delete validErrMaps[validKey];
|
|
188
173
|
}
|
|
189
174
|
});
|
|
190
175
|
});
|
|
191
176
|
} else if (rowList.length) {
|
|
192
|
-
const rowIdList = rowList.map(row => `${(0,
|
|
193
|
-
|
|
194
|
-
if (rowIdList.indexOf(key.split(
|
|
177
|
+
const rowIdList = rowList.map((row) => `${(0, import_util.getRowid)($xeTable, row)}`);
|
|
178
|
+
import_xe_utils.default.each(validErrorMaps, (item, key) => {
|
|
179
|
+
if (rowIdList.indexOf(key.split(":")[0]) > -1) {
|
|
195
180
|
delete validErrMaps[key];
|
|
196
181
|
}
|
|
197
182
|
});
|
|
198
183
|
} else if (colList.length) {
|
|
199
|
-
const colidList = colList.map(column => `${column.id}`);
|
|
200
|
-
|
|
201
|
-
if (colidList.indexOf(key.split(
|
|
184
|
+
const colidList = colList.map((column) => `${column.id}`);
|
|
185
|
+
import_xe_utils.default.each(validErrorMaps, (item, key) => {
|
|
186
|
+
if (colidList.indexOf(key.split(":")[1]) > -1) {
|
|
202
187
|
delete validErrMaps[key];
|
|
203
188
|
}
|
|
204
189
|
});
|
|
@@ -206,28 +191,22 @@ hooks.add('tableValidatorModule', {
|
|
|
206
191
|
}
|
|
207
192
|
return validErrMaps;
|
|
208
193
|
};
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
*/
|
|
212
|
-
const handleValidError = params => {
|
|
213
|
-
return new Promise(resolve => {
|
|
194
|
+
const handleValidError = (params) => {
|
|
195
|
+
return new Promise((resolve) => {
|
|
214
196
|
const validOpts = computeValidOpts.value;
|
|
215
197
|
if (validOpts.autoPos === false) {
|
|
216
|
-
$xeTable.dispatchEvent(
|
|
198
|
+
$xeTable.dispatchEvent("valid-error", params, null);
|
|
217
199
|
resolve();
|
|
218
200
|
} else {
|
|
219
|
-
$xeTable.handleEdit(params, {
|
|
220
|
-
type: 'valid-error',
|
|
221
|
-
trigger: 'call'
|
|
222
|
-
}).then(() => {
|
|
201
|
+
$xeTable.handleEdit(params, { type: "valid-error", trigger: "call" }).then(() => {
|
|
223
202
|
resolve($xeTable.showValidTooltip(params));
|
|
224
203
|
});
|
|
225
204
|
}
|
|
226
205
|
});
|
|
227
206
|
};
|
|
228
|
-
const handleErrMsgMode = validErrMaps => {
|
|
207
|
+
const handleErrMsgMode = (validErrMaps) => {
|
|
229
208
|
const validOpts = computeValidOpts.value;
|
|
230
|
-
if (validOpts.msgMode ===
|
|
209
|
+
if (validOpts.msgMode === "single") {
|
|
231
210
|
const keys = Object.keys(validErrMaps);
|
|
232
211
|
const resMaps = {};
|
|
233
212
|
if (keys.length) {
|
|
@@ -238,29 +217,11 @@ hooks.add('tableValidatorModule', {
|
|
|
238
217
|
}
|
|
239
218
|
return validErrMaps;
|
|
240
219
|
};
|
|
241
|
-
/**
|
|
242
|
-
* 对表格数据进行校验
|
|
243
|
-
* 如果不指定数据,则默认只校验临时变动的数据,例如新增或修改
|
|
244
|
-
* 如果传 true 则校验当前表格数据
|
|
245
|
-
* 如果传 row 指定行记录,则只验证传入的行
|
|
246
|
-
* 如果传 rows 为多行记录,则只验证传入的行
|
|
247
|
-
* 如果只传 callback 否则默认验证整个表格数据
|
|
248
|
-
* 返回 Promise 对象,或者使用回调方式
|
|
249
|
-
*/
|
|
250
220
|
const beginValidate = (rows, cols, cb, isFull) => {
|
|
251
221
|
const validRest = {};
|
|
252
|
-
const {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
} = props;
|
|
256
|
-
const {
|
|
257
|
-
isRowGroupStatus
|
|
258
|
-
} = reactData;
|
|
259
|
-
const {
|
|
260
|
-
afterFullData,
|
|
261
|
-
pendingRowMaps,
|
|
262
|
-
removeRowMaps
|
|
263
|
-
} = internalData;
|
|
222
|
+
const { editRules, treeConfig } = props;
|
|
223
|
+
const { isRowGroupStatus } = reactData;
|
|
224
|
+
const { afterFullData, pendingRowMaps, removeRowMaps } = internalData;
|
|
264
225
|
const treeOpts = computeTreeOpts.value;
|
|
265
226
|
const aggregateOpts = computeAggregateOpts.value;
|
|
266
227
|
const validOpts = computeValidOpts.value;
|
|
@@ -268,10 +229,10 @@ hooks.add('tableValidatorModule', {
|
|
|
268
229
|
if (rows === true) {
|
|
269
230
|
validList = afterFullData;
|
|
270
231
|
} else if (rows) {
|
|
271
|
-
if (
|
|
232
|
+
if (import_xe_utils.default.isFunction(rows)) {
|
|
272
233
|
cb = rows;
|
|
273
234
|
} else {
|
|
274
|
-
validList =
|
|
235
|
+
validList = import_xe_utils.default.isArray(rows) ? rows : [rows];
|
|
275
236
|
}
|
|
276
237
|
}
|
|
277
238
|
if (!validList) {
|
|
@@ -283,18 +244,16 @@ hooks.add('tableValidatorModule', {
|
|
|
283
244
|
}
|
|
284
245
|
const rowValidErrs = [];
|
|
285
246
|
internalData._lastCallTime = Date.now();
|
|
286
|
-
internalData.validRuleErr = false;
|
|
247
|
+
internalData.validRuleErr = false;
|
|
287
248
|
$xeTable.clearValidate();
|
|
288
249
|
const validErrMaps = {};
|
|
289
250
|
if (editRules) {
|
|
290
251
|
const columns = cols && cols.length ? cols : $xeTable.getColumns();
|
|
291
|
-
const handleVaild = row => {
|
|
292
|
-
const rowid = (0,
|
|
293
|
-
// 是否删除
|
|
252
|
+
const handleVaild = (row) => {
|
|
253
|
+
const rowid = (0, import_util.getRowid)($xeTable, row);
|
|
294
254
|
if (removeRowMaps[rowid]) {
|
|
295
255
|
return;
|
|
296
256
|
}
|
|
297
|
-
// 是否标记删除
|
|
298
257
|
if (pendingRowMaps[rowid]) {
|
|
299
258
|
return;
|
|
300
259
|
}
|
|
@@ -303,59 +262,54 @@ hooks.add('tableValidatorModule', {
|
|
|
303
262
|
}
|
|
304
263
|
if (isFull || !internalData.validRuleErr) {
|
|
305
264
|
const colVailds = [];
|
|
306
|
-
columns.forEach(column => {
|
|
307
|
-
const field =
|
|
308
|
-
if ((isFull || !internalData.validRuleErr) &&
|
|
309
|
-
colVailds.push(
|
|
310
|
-
rule,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}));
|
|
265
|
+
columns.forEach((column) => {
|
|
266
|
+
const field = import_xe_utils.default.isString(column) ? column : column.field;
|
|
267
|
+
if ((isFull || !internalData.validRuleErr) && import_xe_utils.default.has(editRules, field)) {
|
|
268
|
+
colVailds.push(
|
|
269
|
+
validatorPrivateMethods.validCellRules("all", row, column).catch(({ rule, rules }) => {
|
|
270
|
+
const rest = {
|
|
271
|
+
rule,
|
|
272
|
+
rules,
|
|
273
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
274
|
+
row,
|
|
275
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
276
|
+
column,
|
|
277
|
+
field,
|
|
278
|
+
$table: $xeTable
|
|
279
|
+
};
|
|
280
|
+
if (!validRest[field]) {
|
|
281
|
+
validRest[field] = [];
|
|
282
|
+
}
|
|
283
|
+
validErrMaps[`${(0, import_util.getRowid)($xeTable, row)}:${column.id}`] = {
|
|
284
|
+
column,
|
|
285
|
+
row,
|
|
286
|
+
rule,
|
|
287
|
+
content: rule.content
|
|
288
|
+
};
|
|
289
|
+
validRest[field].push(rest);
|
|
290
|
+
if (!isFull) {
|
|
291
|
+
internalData.validRuleErr = true;
|
|
292
|
+
return Promise.reject(rest);
|
|
293
|
+
}
|
|
294
|
+
})
|
|
295
|
+
);
|
|
338
296
|
}
|
|
339
297
|
});
|
|
340
298
|
rowValidErrs.push(Promise.all(colVailds));
|
|
341
299
|
}
|
|
342
300
|
};
|
|
343
301
|
if (isRowGroupStatus) {
|
|
344
|
-
|
|
345
|
-
children: aggregateOpts.mapChildrenField
|
|
346
|
-
});
|
|
302
|
+
import_xe_utils.default.eachTree(validList, handleVaild, { children: aggregateOpts.mapChildrenField });
|
|
347
303
|
} else if (treeConfig) {
|
|
348
304
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
349
|
-
|
|
350
|
-
children: childrenField
|
|
351
|
-
});
|
|
305
|
+
import_xe_utils.default.eachTree(validList, handleVaild, { children: childrenField });
|
|
352
306
|
} else {
|
|
353
307
|
validList.forEach(handleVaild);
|
|
354
308
|
}
|
|
355
309
|
return Promise.all(rowValidErrs).then(() => {
|
|
356
310
|
const ruleProps = Object.keys(validRest);
|
|
357
311
|
reactData.validErrorMaps = Object.assign(handleClearValid(rows, columns), handleErrMsgMode(validErrMaps));
|
|
358
|
-
return (0,
|
|
312
|
+
return (0, import_vue.nextTick)().then(() => {
|
|
359
313
|
if (ruleProps.length) {
|
|
360
314
|
return Promise.reject(validRest[ruleProps[0]][0]);
|
|
361
315
|
}
|
|
@@ -363,16 +317,15 @@ hooks.add('tableValidatorModule', {
|
|
|
363
317
|
cb();
|
|
364
318
|
}
|
|
365
319
|
});
|
|
366
|
-
}).catch(firstErrParams => {
|
|
320
|
+
}).catch((firstErrParams) => {
|
|
367
321
|
return new Promise((resolve, reject) => {
|
|
368
322
|
const finish = () => {
|
|
369
|
-
(0,
|
|
323
|
+
(0, import_vue.nextTick)(() => {
|
|
370
324
|
if (cb) {
|
|
371
325
|
cb(validRest);
|
|
372
326
|
resolve();
|
|
373
327
|
} else {
|
|
374
|
-
if (getConfig().validToReject ===
|
|
375
|
-
// 已废弃,校验失败将不会执行catch
|
|
328
|
+
if (getConfig().validToReject === "obsolete") {
|
|
376
329
|
reject(validRest);
|
|
377
330
|
} else {
|
|
378
331
|
resolve(validRest);
|
|
@@ -382,14 +335,9 @@ hooks.add('tableValidatorModule', {
|
|
|
382
335
|
};
|
|
383
336
|
const posAndFinish = () => {
|
|
384
337
|
firstErrParams.cell = $xeTable.getCellElement(firstErrParams.row, firstErrParams.column);
|
|
385
|
-
(0,
|
|
338
|
+
(0, import_dom.scrollToView)(firstErrParams.cell);
|
|
386
339
|
handleValidError(firstErrParams).then(finish);
|
|
387
340
|
};
|
|
388
|
-
/**
|
|
389
|
-
* 当校验不通过时
|
|
390
|
-
* 将表格滚动到可视区
|
|
391
|
-
* 由于提示信息至少需要占一行,定位向上偏移一行
|
|
392
|
-
*/
|
|
393
341
|
if (validOpts.autoPos === false) {
|
|
394
342
|
finish();
|
|
395
343
|
} else {
|
|
@@ -402,7 +350,7 @@ hooks.add('tableValidatorModule', {
|
|
|
402
350
|
} else {
|
|
403
351
|
reactData.validErrorMaps = {};
|
|
404
352
|
}
|
|
405
|
-
return (0,
|
|
353
|
+
return (0, import_vue.nextTick)().then(() => {
|
|
406
354
|
if (cb) {
|
|
407
355
|
cb();
|
|
408
356
|
}
|
|
@@ -413,8 +361,8 @@ hooks.add('tableValidatorModule', {
|
|
|
413
361
|
* 完整校验行,和 validate 的区别就是会给有效数据中的每一行进行校验
|
|
414
362
|
*/
|
|
415
363
|
fullValidate(rows, cb) {
|
|
416
|
-
if (
|
|
417
|
-
warnLog(
|
|
364
|
+
if (import_xe_utils.default.isFunction(cb)) {
|
|
365
|
+
warnLog("vxe.error.notValidators", ["fullValidate(rows, callback)", "fullValidate(rows)"]);
|
|
418
366
|
}
|
|
419
367
|
return beginValidate(rows, null, cb, true);
|
|
420
368
|
},
|
|
@@ -428,21 +376,21 @@ hooks.add('tableValidatorModule', {
|
|
|
428
376
|
* 完整校验单元格,和 validateField 的区别就是会给有效数据中的每一行进行校验
|
|
429
377
|
*/
|
|
430
378
|
fullValidateField(rows, fieldOrColumn) {
|
|
431
|
-
const colList = (
|
|
379
|
+
const colList = (import_xe_utils.default.isArray(fieldOrColumn) ? fieldOrColumn : fieldOrColumn ? [fieldOrColumn] : []).map((column) => (0, import_util.handleFieldOrColumn)($xeTable, column));
|
|
432
380
|
if (colList.length) {
|
|
433
381
|
return beginValidate(rows, colList, null, true);
|
|
434
382
|
}
|
|
435
|
-
return (0,
|
|
383
|
+
return (0, import_vue.nextTick)();
|
|
436
384
|
},
|
|
437
385
|
/**
|
|
438
386
|
* 快速校验单元格,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
|
|
439
387
|
*/
|
|
440
388
|
validateField(rows, fieldOrColumn) {
|
|
441
|
-
const colList = (
|
|
389
|
+
const colList = (import_xe_utils.default.isArray(fieldOrColumn) ? fieldOrColumn : fieldOrColumn ? [fieldOrColumn] : []).map((column) => (0, import_util.handleFieldOrColumn)($xeTable, column));
|
|
442
390
|
if (colList.length) {
|
|
443
391
|
return beginValidate(rows, colList, null);
|
|
444
392
|
}
|
|
445
|
-
return (0,
|
|
393
|
+
return (0, import_vue.nextTick)();
|
|
446
394
|
},
|
|
447
395
|
clearValidate(rows, fieldOrColumn) {
|
|
448
396
|
const validTip = refValidTooltip.value;
|
|
@@ -450,7 +398,7 @@ hooks.add('tableValidatorModule', {
|
|
|
450
398
|
validTip.close();
|
|
451
399
|
}
|
|
452
400
|
reactData.validErrorMaps = handleClearValid(rows, fieldOrColumn);
|
|
453
|
-
return (0,
|
|
401
|
+
return (0, import_vue.nextTick)();
|
|
454
402
|
}
|
|
455
403
|
};
|
|
456
404
|
validatorPrivateMethods = {
|
|
@@ -471,24 +419,17 @@ hooks.add('tableValidatorModule', {
|
|
|
471
419
|
validCellRules(validType, row, column, val) {
|
|
472
420
|
const $xeGrid = $xeTable.xeGrid;
|
|
473
421
|
const $xeGantt = $xeTable.xeGantt;
|
|
474
|
-
const {
|
|
475
|
-
|
|
476
|
-
} = props;
|
|
477
|
-
const {
|
|
478
|
-
field
|
|
479
|
-
} = column;
|
|
422
|
+
const { editRules } = props;
|
|
423
|
+
const { field } = column;
|
|
480
424
|
const errorRules = [];
|
|
481
425
|
const syncValidList = [];
|
|
482
426
|
if (field && editRules) {
|
|
483
|
-
const rules = column.rules ? column.rules :
|
|
427
|
+
const rules = column.rules ? column.rules : import_xe_utils.default.get(editRules, field);
|
|
484
428
|
if (rules) {
|
|
485
|
-
const cellValue =
|
|
486
|
-
rules.forEach(rule => {
|
|
487
|
-
const {
|
|
488
|
-
|
|
489
|
-
validator
|
|
490
|
-
} = rule;
|
|
491
|
-
if (validType === 'all' || !trigger || validType === trigger) {
|
|
429
|
+
const cellValue = import_xe_utils.default.isUndefined(val) ? import_xe_utils.default.get(row, field) : val;
|
|
430
|
+
rules.forEach((rule) => {
|
|
431
|
+
const { trigger, validator } = rule;
|
|
432
|
+
if (validType === "all" || !trigger || validType === trigger) {
|
|
492
433
|
if (validator) {
|
|
493
434
|
const validParams = {
|
|
494
435
|
cellValue,
|
|
@@ -504,41 +445,32 @@ hooks.add('tableValidatorModule', {
|
|
|
504
445
|
$gantt: $xeGantt
|
|
505
446
|
};
|
|
506
447
|
let customValid;
|
|
507
|
-
if (
|
|
448
|
+
if (import_xe_utils.default.isString(validator)) {
|
|
508
449
|
const gvItem = validators.get(validator);
|
|
509
450
|
if (gvItem) {
|
|
510
451
|
const tcvMethod = gvItem.tableCellValidatorMethod || gvItem.cellValidatorMethod;
|
|
511
452
|
if (tcvMethod) {
|
|
512
453
|
customValid = tcvMethod(validParams);
|
|
513
454
|
} else {
|
|
514
|
-
errLog(
|
|
455
|
+
errLog("vxe.error.notValidators", [validator]);
|
|
515
456
|
}
|
|
516
457
|
} else {
|
|
517
|
-
errLog(
|
|
458
|
+
errLog("vxe.error.notValidators", [validator]);
|
|
518
459
|
}
|
|
519
460
|
} else {
|
|
520
461
|
customValid = validator(validParams);
|
|
521
462
|
}
|
|
522
463
|
if (customValid) {
|
|
523
|
-
if (
|
|
464
|
+
if (import_xe_utils.default.isError(customValid)) {
|
|
524
465
|
internalData.validRuleErr = true;
|
|
525
|
-
errorRules.push(new Rule({
|
|
526
|
-
type: 'custom',
|
|
527
|
-
trigger,
|
|
528
|
-
content: customValid.message,
|
|
529
|
-
rule: new Rule(rule)
|
|
530
|
-
}));
|
|
466
|
+
errorRules.push(new Rule({ type: "custom", trigger, content: customValid.message, rule: new Rule(rule) }));
|
|
531
467
|
} else if (customValid.catch) {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
content: e && e.message ? e.message : rule.content || rule.message,
|
|
539
|
-
rule: new Rule(rule)
|
|
540
|
-
}));
|
|
541
|
-
}));
|
|
468
|
+
syncValidList.push(
|
|
469
|
+
customValid.catch((e) => {
|
|
470
|
+
internalData.validRuleErr = true;
|
|
471
|
+
errorRules.push(new Rule({ type: "custom", trigger, content: e && e.message ? e.message : rule.content || rule.message, rule: new Rule(rule) }));
|
|
472
|
+
})
|
|
473
|
+
);
|
|
542
474
|
}
|
|
543
475
|
}
|
|
544
476
|
} else {
|
|
@@ -553,24 +485,17 @@ hooks.add('tableValidatorModule', {
|
|
|
553
485
|
}
|
|
554
486
|
return Promise.all(syncValidList).then(() => {
|
|
555
487
|
if (errorRules.length) {
|
|
556
|
-
const rest = {
|
|
557
|
-
rules: errorRules,
|
|
558
|
-
rule: errorRules[0]
|
|
559
|
-
};
|
|
488
|
+
const rest = { rules: errorRules, rule: errorRules[0] };
|
|
560
489
|
return Promise.reject(rest);
|
|
561
490
|
}
|
|
562
491
|
});
|
|
563
492
|
},
|
|
564
493
|
hasCellRules(type, row, column) {
|
|
565
|
-
const {
|
|
566
|
-
|
|
567
|
-
} = props;
|
|
568
|
-
const {
|
|
569
|
-
field
|
|
570
|
-
} = column;
|
|
494
|
+
const { editRules } = props;
|
|
495
|
+
const { field } = column;
|
|
571
496
|
if (field && editRules) {
|
|
572
|
-
const rules = column.rules ? column.rules :
|
|
573
|
-
return rules && !!
|
|
497
|
+
const rules = column.rules ? column.rules : import_xe_utils.default.get(editRules, field);
|
|
498
|
+
return rules && !!import_xe_utils.default.find(rules, (rule) => type === "all" || !rule.trigger || type === rule.trigger);
|
|
574
499
|
}
|
|
575
500
|
return false;
|
|
576
501
|
},
|
|
@@ -578,45 +503,24 @@ hooks.add('tableValidatorModule', {
|
|
|
578
503
|
* 触发校验
|
|
579
504
|
*/
|
|
580
505
|
triggerValidate(type) {
|
|
581
|
-
const {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
} = props;
|
|
585
|
-
const {
|
|
586
|
-
editStore
|
|
587
|
-
} = reactData;
|
|
588
|
-
const {
|
|
589
|
-
actived
|
|
590
|
-
} = editStore;
|
|
506
|
+
const { editConfig, editRules } = props;
|
|
507
|
+
const { editStore } = reactData;
|
|
508
|
+
const { actived } = editStore;
|
|
591
509
|
const editOpts = computeEditOpts.value;
|
|
592
510
|
const validOpts = computeValidOpts.value;
|
|
593
|
-
|
|
594
|
-
if (editRules && validOpts.msgMode === 'single') {
|
|
511
|
+
if (editRules && validOpts.msgMode === "single") {
|
|
595
512
|
reactData.validErrorMaps = {};
|
|
596
513
|
}
|
|
597
|
-
// 校验单元格
|
|
598
514
|
if (editConfig && editRules && actived.row) {
|
|
599
|
-
const {
|
|
600
|
-
row,
|
|
601
|
-
column,
|
|
602
|
-
cell
|
|
603
|
-
} = actived.args;
|
|
515
|
+
const { row, column, cell } = actived.args;
|
|
604
516
|
if ($xeTable.hasCellRules(type, row, column)) {
|
|
605
517
|
return $xeTable.validCellRules(type, row, column).then(() => {
|
|
606
|
-
if (editOpts.mode ===
|
|
518
|
+
if (editOpts.mode === "row") {
|
|
607
519
|
validatorMethods.clearValidate(row, column);
|
|
608
520
|
}
|
|
609
|
-
}).catch(({
|
|
610
|
-
rule
|
|
611
|
-
}) => {
|
|
612
|
-
// 如果校验不通过与触发方式一致,则聚焦提示错误,否则跳过并不作任何处理
|
|
521
|
+
}).catch(({ rule }) => {
|
|
613
522
|
if (!rule.trigger || type === rule.trigger) {
|
|
614
|
-
const rest = {
|
|
615
|
-
rule,
|
|
616
|
-
row,
|
|
617
|
-
column,
|
|
618
|
-
cell
|
|
619
|
-
};
|
|
523
|
+
const rest = { rule, row, column, cell };
|
|
620
524
|
$xeTable.showValidTooltip(rest);
|
|
621
525
|
return Promise.reject(rest);
|
|
622
526
|
}
|
|
@@ -630,27 +534,16 @@ hooks.add('tableValidatorModule', {
|
|
|
630
534
|
* 弹出校验错误提示
|
|
631
535
|
*/
|
|
632
536
|
showValidTooltip(params) {
|
|
633
|
-
const {
|
|
634
|
-
|
|
635
|
-
} =
|
|
636
|
-
const {
|
|
637
|
-
tableData,
|
|
638
|
-
validStore,
|
|
639
|
-
validErrorMaps
|
|
640
|
-
} = reactData;
|
|
641
|
-
const {
|
|
642
|
-
rule,
|
|
643
|
-
row,
|
|
644
|
-
column,
|
|
645
|
-
cell
|
|
646
|
-
} = params;
|
|
537
|
+
const { height } = props;
|
|
538
|
+
const { tableData, validStore, validErrorMaps } = reactData;
|
|
539
|
+
const { rule, row, column, cell } = params;
|
|
647
540
|
const validOpts = computeValidOpts.value;
|
|
648
541
|
const validTip = refValidTooltip.value;
|
|
649
542
|
const content = rule.content;
|
|
650
543
|
validStore.visible = true;
|
|
651
|
-
if (validOpts.msgMode ===
|
|
544
|
+
if (validOpts.msgMode === "single") {
|
|
652
545
|
reactData.validErrorMaps = {
|
|
653
|
-
[`${(0,
|
|
546
|
+
[`${(0, import_util.getRowid)($xeTable, row)}:${column.id}`]: {
|
|
654
547
|
column,
|
|
655
548
|
row,
|
|
656
549
|
rule,
|
|
@@ -659,7 +552,7 @@ hooks.add('tableValidatorModule', {
|
|
|
659
552
|
};
|
|
660
553
|
} else {
|
|
661
554
|
reactData.validErrorMaps = Object.assign({}, validErrorMaps, {
|
|
662
|
-
[`${(0,
|
|
555
|
+
[`${(0, import_util.getRowid)($xeTable, row)}:${column.id}`]: {
|
|
663
556
|
column,
|
|
664
557
|
row,
|
|
665
558
|
rule,
|
|
@@ -667,16 +560,16 @@ hooks.add('tableValidatorModule', {
|
|
|
667
560
|
}
|
|
668
561
|
});
|
|
669
562
|
}
|
|
670
|
-
$xeTable.dispatchEvent(
|
|
563
|
+
$xeTable.dispatchEvent("valid-error", params, null);
|
|
671
564
|
if (validTip) {
|
|
672
|
-
if (validTip && (validOpts.message ===
|
|
565
|
+
if (validTip && (validOpts.message === "tooltip" || validOpts.message === "default" && !height && tableData.length < 2)) {
|
|
673
566
|
return validTip.open(cell, content);
|
|
674
567
|
}
|
|
675
568
|
}
|
|
676
|
-
return (0,
|
|
569
|
+
return (0, import_vue.nextTick)();
|
|
677
570
|
}
|
|
678
571
|
};
|
|
679
|
-
return
|
|
572
|
+
return { ...validatorMethods, ...validatorPrivateMethods };
|
|
680
573
|
},
|
|
681
574
|
setupGrid($xeGrid) {
|
|
682
575
|
return $xeGrid.extendTableMethods(tableValidatorMethodKeys);
|
|
@@ -684,4 +577,4 @@ hooks.add('tableValidatorModule', {
|
|
|
684
577
|
setupGantt($xeGantt) {
|
|
685
578
|
return $xeGantt.extendTableMethods(tableValidatorMethodKeys);
|
|
686
579
|
}
|
|
687
|
-
});
|
|
580
|
+
});
|