vxe-table 4.23.5 → 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 +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/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.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 +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.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.1792977622800.ttf} +0 -0
- /package/{es/iconfont.1792838769925.woff → dist/iconfont.1792977622800.woff} +0 -0
- /package/{es/iconfont.1792838769925.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.1792838769925.ttf → es/iconfont.1792977622800.ttf} +0 -0
- /package/{lib/iconfont.1792838769925.woff → es/iconfont.1792977622800.woff} +0 -0
- /package/{lib/iconfont.1792838769925.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/ui/src/dom.js
CHANGED
|
@@ -1,415 +1,412 @@
|
|
|
1
|
-
import XEUtils from
|
|
1
|
+
import XEUtils from "xe-utils";
|
|
2
2
|
const reClsMap = {};
|
|
3
3
|
let tpImgEl;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
function initTpImg() {
|
|
5
|
+
if (!tpImgEl) {
|
|
6
|
+
tpImgEl = new Image();
|
|
7
|
+
tpImgEl.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";
|
|
8
|
+
}
|
|
9
|
+
return tpImgEl;
|
|
10
|
+
}
|
|
11
|
+
function getTpImg() {
|
|
12
|
+
if (!tpImgEl) {
|
|
13
|
+
return initTpImg();
|
|
14
|
+
}
|
|
15
|
+
return tpImgEl;
|
|
16
|
+
}
|
|
17
|
+
function getPropClass(property, params) {
|
|
18
|
+
return property ? (XEUtils.isFunction(property) ? property(params) : property) || "" : "";
|
|
19
19
|
}
|
|
20
20
|
function getClsRE(cls) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
if (!reClsMap[cls]) {
|
|
22
|
+
reClsMap[cls] = new RegExp(`(?:^|\\s)${cls}(?!\\S)`, "g");
|
|
23
|
+
}
|
|
24
|
+
return reClsMap[cls];
|
|
25
25
|
}
|
|
26
26
|
function getNodeOffset(elem, container, rest) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
if (container && (elem === container || elem.offsetParent === container) ? 0 : elem.offsetParent) {
|
|
36
|
-
return getNodeOffset(elem.offsetParent, container, rest);
|
|
37
|
-
}
|
|
27
|
+
if (elem) {
|
|
28
|
+
const parentElem = elem.parentNode;
|
|
29
|
+
rest.top += elem.offsetTop;
|
|
30
|
+
rest.left += elem.offsetLeft;
|
|
31
|
+
if (parentElem && parentElem !== document.documentElement && parentElem !== document.body) {
|
|
32
|
+
rest.top -= parentElem.scrollTop;
|
|
33
|
+
rest.left -= parentElem.scrollLeft;
|
|
38
34
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export function isPx(val) {
|
|
42
|
-
return val && /^\d+(\.\d+)?(px)?$/.test(val);
|
|
43
|
-
}
|
|
44
|
-
export function isScale(val) {
|
|
45
|
-
return val && /^\d+(\.\d+)?%$/.test(val);
|
|
46
|
-
}
|
|
47
|
-
export function hasClass(elem, cls) {
|
|
48
|
-
if (elem) {
|
|
49
|
-
if (elem.classList) {
|
|
50
|
-
return elem.classList.contains(cls);
|
|
51
|
-
}
|
|
52
|
-
return !!(elem.className && elem.className.match && elem.className.match(getClsRE(cls)));
|
|
35
|
+
if (container && (elem === container || elem.offsetParent === container) ? 0 : elem.offsetParent) {
|
|
36
|
+
return getNodeOffset(elem.offsetParent, container, rest);
|
|
53
37
|
}
|
|
54
|
-
|
|
38
|
+
}
|
|
39
|
+
return rest;
|
|
55
40
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
elem.className = elem.className.replace(getClsRE(cls), '');
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
export function addClass(elem, cls) {
|
|
62
|
-
if (elem && !hasClass(elem, cls)) {
|
|
63
|
-
removeClass(elem, cls);
|
|
64
|
-
elem.className = `${elem.className} ${cls}`;
|
|
65
|
-
}
|
|
41
|
+
function isPx(val) {
|
|
42
|
+
return val && /^\d+(\.\d+)?(px)?$/.test(val);
|
|
66
43
|
}
|
|
67
|
-
|
|
68
|
-
|
|
44
|
+
function isScale(val) {
|
|
45
|
+
return val && /^\d+(\.\d+)?%$/.test(val);
|
|
69
46
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
47
|
+
function hasClass(elem, cls) {
|
|
48
|
+
if (elem) {
|
|
49
|
+
if (elem.classList) {
|
|
50
|
+
return elem.classList.contains(cls);
|
|
73
51
|
}
|
|
74
|
-
return
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
52
|
+
return !!(elem.className && elem.className.match && elem.className.match(getClsRE(cls)));
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
function removeClass(elem, cls) {
|
|
57
|
+
if (elem && hasClass(elem, cls)) {
|
|
58
|
+
elem.className = elem.className.replace(getClsRE(cls), "");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function addClass(elem, cls) {
|
|
62
|
+
if (elem && !hasClass(elem, cls)) {
|
|
63
|
+
removeClass(elem, cls);
|
|
64
|
+
elem.className = `${elem.className} ${cls}`;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function hasControlKey(evnt) {
|
|
68
|
+
return evnt.ctrlKey || evnt.metaKey;
|
|
69
|
+
}
|
|
70
|
+
function toCssUnit(val, unit = "px") {
|
|
71
|
+
if (XEUtils.isNumber(val) || /^\d+$/.test(`${val}`)) {
|
|
72
|
+
return `${val}${unit}`;
|
|
73
|
+
}
|
|
74
|
+
return `${val || ""}`;
|
|
75
|
+
}
|
|
76
|
+
function queryElement(elem, selector) {
|
|
77
|
+
if (elem) {
|
|
78
|
+
return elem.querySelector(selector);
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
function getDomNode() {
|
|
83
|
+
const documentElement = document.documentElement;
|
|
84
|
+
const bodyElem = document.body;
|
|
85
|
+
return {
|
|
86
|
+
scrollTop: documentElement.scrollTop || bodyElem.scrollTop,
|
|
87
|
+
scrollLeft: documentElement.scrollLeft || bodyElem.scrollLeft,
|
|
88
|
+
visibleHeight: documentElement.clientHeight || bodyElem.clientHeight,
|
|
89
|
+
visibleWidth: documentElement.clientWidth || bodyElem.clientWidth
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function getOffsetHeight(elem) {
|
|
93
|
+
return elem ? elem.offsetHeight : 0;
|
|
94
|
+
}
|
|
95
|
+
function getPaddingTopBottomSize(elem) {
|
|
96
|
+
if (elem) {
|
|
97
|
+
const computedStyle = getComputedStyle(elem);
|
|
98
|
+
const paddingTop = XEUtils.toNumber(computedStyle.paddingTop);
|
|
99
|
+
const paddingBottom = XEUtils.toNumber(computedStyle.paddingBottom);
|
|
100
|
+
return paddingTop + paddingBottom;
|
|
101
|
+
}
|
|
102
|
+
return 0;
|
|
103
|
+
}
|
|
104
|
+
function setScrollTop(elem, scrollTop) {
|
|
105
|
+
if (elem) {
|
|
106
|
+
elem.scrollTop = scrollTop;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function setScrollLeft(elem, scrollLeft) {
|
|
110
|
+
if (elem) {
|
|
111
|
+
elem.scrollLeft = scrollLeft;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function updateCellTitle(overflowElem, column) {
|
|
115
|
+
const content = column.type === "html" ? overflowElem.innerText : overflowElem.textContent;
|
|
116
|
+
if (overflowElem.getAttribute("title") !== content) {
|
|
117
|
+
overflowElem.setAttribute("title", content);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function checkTargetElement(target, exEls, endEl) {
|
|
121
|
+
let targetEl = target;
|
|
122
|
+
if (!exEls || !exEls.length) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
const [exEl1, exEl2, exEl3] = exEls;
|
|
126
|
+
while (targetEl) {
|
|
127
|
+
if (exEl1 === targetEl || exEl2 && targetEl === exEl2 || exEl3 && targetEl === exEl3) {
|
|
128
|
+
return true;
|
|
79
129
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
export function getDomNode() {
|
|
83
|
-
const documentElement = document.documentElement;
|
|
84
|
-
const bodyElem = document.body;
|
|
85
|
-
return {
|
|
86
|
-
scrollTop: documentElement.scrollTop || bodyElem.scrollTop,
|
|
87
|
-
scrollLeft: documentElement.scrollLeft || bodyElem.scrollLeft,
|
|
88
|
-
visibleHeight: documentElement.clientHeight || bodyElem.clientHeight,
|
|
89
|
-
visibleWidth: documentElement.clientWidth || bodyElem.clientWidth
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
export function getOffsetHeight(elem) {
|
|
93
|
-
return elem ? elem.offsetHeight : 0;
|
|
94
|
-
}
|
|
95
|
-
export function getPaddingTopBottomSize(elem) {
|
|
96
|
-
if (elem) {
|
|
97
|
-
const computedStyle = getComputedStyle(elem);
|
|
98
|
-
const paddingTop = XEUtils.toNumber(computedStyle.paddingTop);
|
|
99
|
-
const paddingBottom = XEUtils.toNumber(computedStyle.paddingBottom);
|
|
100
|
-
return paddingTop + paddingBottom;
|
|
130
|
+
if (endEl && targetEl === endEl) {
|
|
131
|
+
return false;
|
|
101
132
|
}
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
133
|
+
targetEl = targetEl.parentElement;
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
function getEventTargetNode(evnt, container, queryCls, queryMethod) {
|
|
138
|
+
let targetElem;
|
|
139
|
+
let target = evnt.target.shadowRoot && evnt.composed ? evnt.composedPath()[0] || evnt.target : evnt.target;
|
|
140
|
+
while (target && target.nodeType && target !== document) {
|
|
141
|
+
if (queryCls && hasClass(target, queryCls) && (!queryMethod || queryMethod(target))) {
|
|
142
|
+
targetElem = target;
|
|
143
|
+
} else if (target === container) {
|
|
144
|
+
return { flag: queryCls ? !!targetElem : true, container, targetElem };
|
|
107
145
|
}
|
|
146
|
+
target = target.parentNode;
|
|
147
|
+
}
|
|
148
|
+
return { flag: false };
|
|
108
149
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
elem.scrollLeft = scrollLeft;
|
|
112
|
-
}
|
|
150
|
+
function getOffsetPos(elem, container) {
|
|
151
|
+
return getNodeOffset(elem, container, { left: 0, top: 0 });
|
|
113
152
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
export function updateCellTitle(overflowElem, column) {
|
|
121
|
-
const content = column.type === 'html' ? overflowElem.innerText : overflowElem.textContent;
|
|
122
|
-
if (overflowElem.getAttribute('title') !== content) {
|
|
123
|
-
overflowElem.setAttribute('title', content);
|
|
124
|
-
}
|
|
153
|
+
function getAbsolutePos(elem) {
|
|
154
|
+
const bounding = elem.getBoundingClientRect();
|
|
155
|
+
const boundingTop = bounding.top;
|
|
156
|
+
const boundingLeft = bounding.left;
|
|
157
|
+
const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode();
|
|
158
|
+
return { boundingTop, top: scrollTop + boundingTop, boundingLeft, left: scrollLeft + boundingLeft, visibleHeight, visibleWidth };
|
|
125
159
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
const [exEl1, exEl2, exEl3] = exEls;
|
|
132
|
-
while (targetEl) {
|
|
133
|
-
if (exEl1 === targetEl || (exEl2 && targetEl === exEl2) || (exEl3 && targetEl === exEl3)) {
|
|
134
|
-
return true;
|
|
135
|
-
}
|
|
136
|
-
if (endEl && targetEl === endEl) {
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
targetEl = targetEl.parentElement;
|
|
140
|
-
}
|
|
141
|
-
return false;
|
|
160
|
+
function hasEventInputTarget(target) {
|
|
161
|
+
const tagName = target ? target.tagName : "";
|
|
162
|
+
return tagName && ["input", "textarea"].includes(tagName.toLowerCase());
|
|
142
163
|
}
|
|
143
|
-
/**
|
|
144
|
-
* 检查触发源是否属于目标节点
|
|
145
|
-
*/
|
|
146
|
-
export function getEventTargetNode(evnt, container, queryCls, queryMethod) {
|
|
147
|
-
let targetElem;
|
|
148
|
-
let target = (evnt.target.shadowRoot && evnt.composed) ? (evnt.composedPath()[0] || evnt.target) : evnt.target;
|
|
149
|
-
while (target && target.nodeType && target !== document) {
|
|
150
|
-
if (queryCls && hasClass(target, queryCls) && (!queryMethod || queryMethod(target))) {
|
|
151
|
-
targetElem = target;
|
|
152
|
-
}
|
|
153
|
-
else if (target === container) {
|
|
154
|
-
return { flag: queryCls ? !!targetElem : true, container, targetElem: targetElem };
|
|
155
|
-
}
|
|
156
|
-
target = target.parentNode;
|
|
157
|
-
}
|
|
158
|
-
return { flag: false };
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* 获取元素相对于 document 的位置
|
|
162
|
-
*/
|
|
163
|
-
export function getOffsetPos(elem, container) {
|
|
164
|
-
return getNodeOffset(elem, container, { left: 0, top: 0 });
|
|
165
|
-
}
|
|
166
|
-
export function getAbsolutePos(elem) {
|
|
167
|
-
const bounding = elem.getBoundingClientRect();
|
|
168
|
-
const boundingTop = bounding.top;
|
|
169
|
-
const boundingLeft = bounding.left;
|
|
170
|
-
const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode();
|
|
171
|
-
return { boundingTop, top: scrollTop + boundingTop, boundingLeft, left: scrollLeft + boundingLeft, visibleHeight, visibleWidth };
|
|
172
|
-
}
|
|
173
|
-
export function hasEventInputTarget(target) {
|
|
174
|
-
const tagName = target ? target.tagName : '';
|
|
175
|
-
return tagName && ['input', 'textarea'].includes((tagName.toLowerCase()));
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* 判断是否由内部可复用控件触发,输入框带有 vxe-reusekeep-control
|
|
179
|
-
*/
|
|
180
164
|
function hasReusekeepControl(elem) {
|
|
181
|
-
|
|
182
|
-
|
|
165
|
+
if (elem) {
|
|
166
|
+
return hasClass(elem, "vxe-reusekeep-control");
|
|
167
|
+
}
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
function hasAxternalInputTarget(target) {
|
|
171
|
+
return hasEventInputTarget(target) ? !hasReusekeepControl(target) : false;
|
|
172
|
+
}
|
|
173
|
+
const scrollIntoViewIfNeeded = "scrollIntoViewIfNeeded";
|
|
174
|
+
const scrollIntoView = "scrollIntoView";
|
|
175
|
+
function scrollToView(elem) {
|
|
176
|
+
if (elem) {
|
|
177
|
+
if (elem[scrollIntoViewIfNeeded]) {
|
|
178
|
+
elem[scrollIntoViewIfNeeded]();
|
|
179
|
+
} else if (elem[scrollIntoView]) {
|
|
180
|
+
elem[scrollIntoView]();
|
|
183
181
|
}
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function triggerEvent(targetElem, type) {
|
|
185
|
+
if (targetElem) {
|
|
186
|
+
targetElem.dispatchEvent(new Event(type));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function isNodeElement(elem) {
|
|
190
|
+
return elem && elem.nodeType === 1;
|
|
191
|
+
}
|
|
192
|
+
function scrollTopTo(diffNum, cb) {
|
|
193
|
+
const duration = Math.abs(diffNum);
|
|
194
|
+
const startTime = performance.now();
|
|
195
|
+
let countTop = 0;
|
|
196
|
+
const step = (timestamp) => {
|
|
197
|
+
let progress = (timestamp - startTime) / duration;
|
|
198
|
+
if (progress < 0) {
|
|
199
|
+
progress = 0;
|
|
200
|
+
} else if (progress > 1) {
|
|
201
|
+
progress = 1;
|
|
199
202
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
203
|
+
const easedProgress = Math.pow(progress, 2);
|
|
204
|
+
const offsetTop = Math.floor(diffNum * easedProgress) - countTop;
|
|
205
|
+
countTop += offsetTop;
|
|
206
|
+
cb(offsetTop);
|
|
207
|
+
if (progress < 1) {
|
|
208
|
+
requestAnimationFrame(step);
|
|
204
209
|
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return elem && elem.nodeType === 1;
|
|
208
|
-
}
|
|
209
|
-
export function scrollTopTo(diffNum, cb) {
|
|
210
|
-
const duration = Math.abs(diffNum);
|
|
211
|
-
const startTime = performance.now();
|
|
212
|
-
let countTop = 0;
|
|
213
|
-
const step = (timestamp) => {
|
|
214
|
-
let progress = (timestamp - startTime) / duration;
|
|
215
|
-
if (progress < 0) {
|
|
216
|
-
progress = 0;
|
|
217
|
-
}
|
|
218
|
-
else if (progress > 1) {
|
|
219
|
-
progress = 1;
|
|
220
|
-
}
|
|
221
|
-
const easedProgress = Math.pow(progress, 2);
|
|
222
|
-
const offsetTop = Math.floor((diffNum * easedProgress)) - countTop;
|
|
223
|
-
countTop += offsetTop;
|
|
224
|
-
cb(offsetTop);
|
|
225
|
-
if (progress < 1) {
|
|
226
|
-
requestAnimationFrame(step);
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
requestAnimationFrame(step);
|
|
210
|
+
};
|
|
211
|
+
requestAnimationFrame(step);
|
|
230
212
|
}
|
|
231
213
|
let wtlFrame;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
214
|
+
function wheelScrollLeftTo(scrollLeft, cb) {
|
|
215
|
+
if (wtlFrame) {
|
|
216
|
+
cancelAnimationFrame(wtlFrame);
|
|
217
|
+
}
|
|
218
|
+
wtlFrame = requestAnimationFrame(() => {
|
|
219
|
+
cb(scrollLeft);
|
|
220
|
+
wtlFrame = null;
|
|
221
|
+
});
|
|
240
222
|
}
|
|
241
223
|
let wtaFrame;
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
if (
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
if (defaultPlacement === 'top') {
|
|
298
|
-
panelPlacement = 'top';
|
|
299
|
-
if (!defaultTop) {
|
|
300
|
-
top = targetTop - panelHeight;
|
|
301
|
-
}
|
|
302
|
-
// 如果上面不够放,则向下
|
|
303
|
-
if (top < marginSize) {
|
|
304
|
-
panelPlacement = 'bottom';
|
|
305
|
-
top = targetTop + targetHeight;
|
|
306
|
-
}
|
|
307
|
-
// 如果下面不够放,则向上(优先)
|
|
308
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
309
|
-
panelPlacement = 'top';
|
|
310
|
-
top = targetTop - panelHeight;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
else {
|
|
314
|
-
// 如果下面不够放,则向上
|
|
315
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
316
|
-
panelPlacement = 'top';
|
|
317
|
-
top = targetTop - panelHeight;
|
|
318
|
-
}
|
|
319
|
-
// 如果上面不够放,则向下(优先)
|
|
320
|
-
if (top < marginSize) {
|
|
321
|
-
panelPlacement = 'bottom';
|
|
322
|
-
top = targetTop + targetHeight;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
// 如果溢出右边
|
|
327
|
-
if (left + panelWidth + marginSize > visibleWidth) {
|
|
328
|
-
left -= left + panelWidth + marginSize - visibleWidth;
|
|
329
|
-
}
|
|
330
|
-
// 如果溢出左边
|
|
331
|
-
if (left < marginSize) {
|
|
332
|
-
left = marginSize;
|
|
333
|
-
}
|
|
334
|
-
// 偏移
|
|
335
|
-
top -= parentWrapperOffsetTop;
|
|
336
|
-
left -= parentWrapperOffsetLeft;
|
|
337
|
-
}
|
|
338
|
-
else {
|
|
339
|
-
if (placement === 'top') {
|
|
340
|
-
panelPlacement = 'top';
|
|
341
|
-
bottom = targetHeight;
|
|
342
|
-
}
|
|
343
|
-
else if (!placement) {
|
|
344
|
-
// 如果下面不够放,则向上
|
|
345
|
-
top = targetHeight;
|
|
346
|
-
if (targetTop + targetHeight + panelHeight + marginSize > visibleHeight) {
|
|
347
|
-
// 如果上面不够放,则向下(优先)
|
|
348
|
-
if (targetTop - targetHeight - panelHeight > marginSize) {
|
|
349
|
-
panelPlacement = 'top';
|
|
350
|
-
top = '';
|
|
351
|
-
bottom = targetHeight;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
// 是否超出右侧
|
|
356
|
-
if (panelRect.left + panelRect.width + marginSize > visibleWidth) {
|
|
357
|
-
left = -(panelRect.left + panelRect.width + marginSize - visibleWidth);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
if (XEUtils.isNumber(top)) {
|
|
361
|
-
stys.top = toCssUnit(top);
|
|
224
|
+
function wheelScrollTopTo(diffNum, cb) {
|
|
225
|
+
if (wtaFrame) {
|
|
226
|
+
cancelAnimationFrame(wtaFrame);
|
|
227
|
+
}
|
|
228
|
+
wtaFrame = requestAnimationFrame(() => {
|
|
229
|
+
const offsetTop = diffNum;
|
|
230
|
+
cb(offsetTop);
|
|
231
|
+
wtaFrame = null;
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
function updatePanelPlacement(targetElem, panelElem, options) {
|
|
235
|
+
const { defaultTop, defaultLeft, placement, defaultPlacement, appendTo, teleportTo, marginSize, isMinWidth } = Object.assign({
|
|
236
|
+
appendTo: "",
|
|
237
|
+
teleportTo: false,
|
|
238
|
+
marginSize: 18,
|
|
239
|
+
isMinWidth: true
|
|
240
|
+
}, options);
|
|
241
|
+
let panelPlacement = "bottom";
|
|
242
|
+
let top = "";
|
|
243
|
+
let bottom = "";
|
|
244
|
+
let left = 0;
|
|
245
|
+
let minWidth = "";
|
|
246
|
+
let arrowLeft = "";
|
|
247
|
+
const stys = {};
|
|
248
|
+
if (panelElem && targetElem) {
|
|
249
|
+
const bodyEl = document.body;
|
|
250
|
+
const parentWrapperEl = getPopupWrapperElement(teleportTo ? getPopupAppendElement(appendTo) : panelElem);
|
|
251
|
+
if (parentWrapperEl) {
|
|
252
|
+
const targetWidth = targetElem.offsetWidth;
|
|
253
|
+
const targetHeight = targetElem.offsetHeight;
|
|
254
|
+
const panelWidth = panelElem.offsetWidth;
|
|
255
|
+
const panelHeight = panelElem.offsetHeight;
|
|
256
|
+
const parentWrapperRect = parentWrapperEl.getBoundingClientRect();
|
|
257
|
+
const panelRect = panelElem.getBoundingClientRect();
|
|
258
|
+
const targetRect = targetElem.getBoundingClientRect();
|
|
259
|
+
const visibleHeight = bodyEl.clientHeight;
|
|
260
|
+
const visibleWidth = bodyEl.clientWidth;
|
|
261
|
+
const parentWrapperScrollLeft = parentWrapperEl.scrollLeft;
|
|
262
|
+
const parentWrapperScrollTop = parentWrapperEl.scrollTop;
|
|
263
|
+
const parentWrapperOffsetLeft = parentWrapperRect.left;
|
|
264
|
+
const parentWrapperOffsetTop = parentWrapperRect.top;
|
|
265
|
+
const targetLeft = targetRect.left;
|
|
266
|
+
const targetTop = targetRect.top;
|
|
267
|
+
minWidth = targetElem.offsetWidth;
|
|
268
|
+
if (teleportTo) {
|
|
269
|
+
left = (defaultLeft || targetLeft - (panelWidth - targetWidth) / 2) - parentWrapperScrollLeft;
|
|
270
|
+
top = (defaultTop || targetTop + targetHeight) - parentWrapperScrollTop;
|
|
271
|
+
if (placement === "top") {
|
|
272
|
+
panelPlacement = "top";
|
|
273
|
+
top = targetTop - panelHeight;
|
|
274
|
+
} else if (!placement) {
|
|
275
|
+
if (defaultPlacement === "top") {
|
|
276
|
+
panelPlacement = "top";
|
|
277
|
+
if (!defaultTop) {
|
|
278
|
+
top = targetTop - panelHeight;
|
|
362
279
|
}
|
|
363
|
-
if (
|
|
364
|
-
|
|
280
|
+
if (top < marginSize) {
|
|
281
|
+
panelPlacement = "bottom";
|
|
282
|
+
top = targetTop + targetHeight;
|
|
365
283
|
}
|
|
366
|
-
if (
|
|
367
|
-
|
|
284
|
+
if (top + panelHeight + marginSize > visibleHeight) {
|
|
285
|
+
panelPlacement = "top";
|
|
286
|
+
top = targetTop - panelHeight;
|
|
368
287
|
}
|
|
369
|
-
|
|
370
|
-
|
|
288
|
+
} else {
|
|
289
|
+
if (top + panelHeight + marginSize > visibleHeight) {
|
|
290
|
+
panelPlacement = "top";
|
|
291
|
+
top = targetTop - panelHeight;
|
|
371
292
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
arrowLeft = targetWidth / 2;
|
|
376
|
-
}
|
|
293
|
+
if (top < marginSize) {
|
|
294
|
+
panelPlacement = "bottom";
|
|
295
|
+
top = targetTop + targetHeight;
|
|
377
296
|
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
if (left + panelWidth + marginSize > visibleWidth) {
|
|
300
|
+
left -= left + panelWidth + marginSize - visibleWidth;
|
|
301
|
+
}
|
|
302
|
+
if (left < marginSize) {
|
|
303
|
+
left = marginSize;
|
|
304
|
+
}
|
|
305
|
+
top -= parentWrapperOffsetTop;
|
|
306
|
+
left -= parentWrapperOffsetLeft;
|
|
307
|
+
} else {
|
|
308
|
+
if (placement === "top") {
|
|
309
|
+
panelPlacement = "top";
|
|
310
|
+
bottom = targetHeight;
|
|
311
|
+
} else if (!placement) {
|
|
312
|
+
top = targetHeight;
|
|
313
|
+
if (targetTop + targetHeight + panelHeight + marginSize > visibleHeight) {
|
|
314
|
+
if (targetTop - targetHeight - panelHeight > marginSize) {
|
|
315
|
+
panelPlacement = "top";
|
|
316
|
+
top = "";
|
|
317
|
+
bottom = targetHeight;
|
|
385
318
|
}
|
|
319
|
+
}
|
|
386
320
|
}
|
|
321
|
+
if (panelRect.left + panelRect.width + marginSize > visibleWidth) {
|
|
322
|
+
left = -(panelRect.left + panelRect.width + marginSize - visibleWidth);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (XEUtils.isNumber(top)) {
|
|
326
|
+
stys.top = toCssUnit(top);
|
|
327
|
+
}
|
|
328
|
+
if (XEUtils.isNumber(bottom)) {
|
|
329
|
+
stys.bottom = toCssUnit(bottom);
|
|
330
|
+
}
|
|
331
|
+
if (XEUtils.isNumber(left)) {
|
|
332
|
+
stys.left = toCssUnit(left);
|
|
333
|
+
}
|
|
334
|
+
if (isMinWidth && XEUtils.isNumber(minWidth)) {
|
|
335
|
+
stys.minWidth = toCssUnit(minWidth);
|
|
336
|
+
}
|
|
337
|
+
if (left === targetLeft) {
|
|
338
|
+
if (targetWidth <= panelWidth) {
|
|
339
|
+
arrowLeft = targetWidth / 2;
|
|
340
|
+
}
|
|
341
|
+
} else if (left < targetLeft) {
|
|
342
|
+
if (left + panelWidth > targetLeft + targetWidth) {
|
|
343
|
+
arrowLeft = targetLeft - left + targetWidth / 2;
|
|
344
|
+
} else {
|
|
345
|
+
arrowLeft = targetLeft - left + (panelWidth - (targetLeft - left)) / 2;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
387
348
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
349
|
+
}
|
|
350
|
+
return {
|
|
351
|
+
top: top || 0,
|
|
352
|
+
bottom: bottom || 0,
|
|
353
|
+
left: left || 0,
|
|
354
|
+
arrowLeft: arrowLeft || 0,
|
|
355
|
+
style: stys,
|
|
356
|
+
placement: panelPlacement
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
function getPopupWrapperElement(panelElem) {
|
|
360
|
+
if (!panelElem) {
|
|
361
|
+
return null;
|
|
362
|
+
}
|
|
363
|
+
const bodyEl = document.body;
|
|
364
|
+
const parentEl = panelElem.parentElement;
|
|
365
|
+
return (parentEl === bodyEl ? document.documentElement : parentEl) || null;
|
|
366
|
+
}
|
|
367
|
+
function getPopupContainer(appendTo) {
|
|
368
|
+
const selectElem = appendTo && XEUtils.isFunction(appendTo) ? appendTo({}) : appendTo;
|
|
369
|
+
return selectElem || "body";
|
|
370
|
+
}
|
|
371
|
+
function getPopupAppendElement(appendTo) {
|
|
372
|
+
const selectElem = getPopupContainer(appendTo);
|
|
373
|
+
if (XEUtils.isString(selectElem)) {
|
|
374
|
+
return document.querySelector(selectElem) || document.body;
|
|
375
|
+
}
|
|
376
|
+
return selectElem;
|
|
377
|
+
}
|
|
378
|
+
export {
|
|
379
|
+
addClass,
|
|
380
|
+
checkTargetElement,
|
|
381
|
+
getAbsolutePos,
|
|
382
|
+
getDomNode,
|
|
383
|
+
getEventTargetNode,
|
|
384
|
+
getOffsetHeight,
|
|
385
|
+
getOffsetPos,
|
|
386
|
+
getPaddingTopBottomSize,
|
|
387
|
+
getPopupAppendElement,
|
|
388
|
+
getPopupContainer,
|
|
389
|
+
getPopupWrapperElement,
|
|
390
|
+
getPropClass,
|
|
391
|
+
getTpImg,
|
|
392
|
+
hasAxternalInputTarget,
|
|
393
|
+
hasClass,
|
|
394
|
+
hasControlKey,
|
|
395
|
+
hasEventInputTarget,
|
|
396
|
+
initTpImg,
|
|
397
|
+
isNodeElement,
|
|
398
|
+
isPx,
|
|
399
|
+
isScale,
|
|
400
|
+
queryElement,
|
|
401
|
+
removeClass,
|
|
402
|
+
scrollToView,
|
|
403
|
+
scrollTopTo,
|
|
404
|
+
setScrollLeft,
|
|
405
|
+
setScrollTop,
|
|
406
|
+
toCssUnit,
|
|
407
|
+
triggerEvent,
|
|
408
|
+
updateCellTitle,
|
|
409
|
+
updatePanelPlacement,
|
|
410
|
+
wheelScrollLeftTo,
|
|
411
|
+
wheelScrollTopTo
|
|
412
|
+
};
|