vxe-pc-ui 0.0.1 → 0.0.2
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/LICENSE +21 -0
- package/README.md +48 -5
- package/es/anchor/index.js +8 -0
- package/es/anchor/src/anchor.js +202 -0
- package/es/anchor/style.css +40 -0
- package/es/anchor/style.min.css +1 -0
- package/es/anchor-link/index.js +8 -0
- package/es/anchor-link/src/anchor-link.js +94 -0
- package/es/anchor-link/src/util.js +19 -0
- package/es/anchor-link/style.css +0 -0
- package/es/anchor-link/style.min.css +0 -0
- package/es/breadcrumb/index.js +8 -0
- package/es/breadcrumb/src/breadcrumb.js +44 -0
- package/es/breadcrumb/style.css +19 -0
- package/es/breadcrumb/style.min.css +1 -0
- package/es/breadcrumb-item/index.js +8 -0
- package/es/breadcrumb-item/src/breadcrumb-item.js +54 -0
- package/es/breadcrumb-item/style.css +0 -0
- package/es/breadcrumb-item/style.min.css +0 -0
- package/es/button/index.js +8 -0
- package/es/button/src/button.js +487 -0
- package/es/button/style.css +513 -0
- package/es/button/style.min.css +1 -0
- package/es/button-group/index.js +8 -0
- package/es/button-group/src/button-group.js +66 -0
- package/es/button-group/style.css +0 -0
- package/es/button-group/style.min.css +0 -0
- package/es/col/index.js +8 -0
- package/es/col/src/col.js +80 -0
- package/es/col/style.css +95 -0
- package/es/col/style.min.css +1 -0
- package/es/components.js +57 -0
- package/es/design/index.js +8 -0
- package/es/design/src/design.js +41 -0
- package/es/design/style.css +0 -0
- package/es/design/style.min.css +0 -0
- package/es/hooks/size.js +10 -0
- package/es/icon/index.js +8 -0
- package/es/icon/src/icon.js +24 -0
- package/es/icon/style.css +766 -0
- package/es/icon/style.min.css +1 -0
- package/es/index.esm.js +3 -0
- package/es/layout-aside/index.js +8 -0
- package/es/layout-aside/src/layout-aside.js +68 -0
- package/es/layout-aside/style.css +12 -0
- package/es/layout-aside/style.min.css +1 -0
- package/es/layout-body/index.js +8 -0
- package/es/layout-body/src/layout-body.js +37 -0
- package/es/layout-body/style.css +3 -0
- package/es/layout-body/style.min.css +1 -0
- package/es/layout-container/index.js +8 -0
- package/es/layout-container/src/layout-container.js +41 -0
- package/es/layout-container/style.css +10 -0
- package/es/layout-container/style.min.css +1 -0
- package/es/layout-footer/index.js +8 -0
- package/es/layout-footer/src/layout-footer.js +41 -0
- package/es/layout-footer/style.css +10 -0
- package/es/layout-footer/style.min.css +1 -0
- package/es/layout-header/index.js +8 -0
- package/es/layout-header/src/layout-header.js +41 -0
- package/es/layout-header/style.css +10 -0
- package/es/layout-header/style.min.css +1 -0
- package/es/locale/lang/en-US.d.ts +2 -0
- package/es/locale/lang/en-US.js +463 -0
- package/es/locale/lang/es-ES.d.ts +2 -0
- package/es/locale/lang/es-ES.js +463 -0
- package/es/locale/lang/ja-JP.d.ts +2 -0
- package/es/locale/lang/ja-JP.js +463 -0
- package/es/locale/lang/pt-BR.d.ts +2 -0
- package/es/locale/lang/pt-BR.js +463 -0
- package/es/locale/lang/zh-CN.d.ts +2 -0
- package/es/locale/lang/zh-CN.js +463 -0
- package/es/locale/lang/zh-HK.d.ts +2 -0
- package/es/locale/lang/zh-HK.js +2 -0
- package/es/locale/lang/zh-MO.d.ts +2 -0
- package/es/locale/lang/zh-MO.js +2 -0
- package/es/locale/lang/zh-TC.d.ts +2 -0
- package/es/locale/lang/zh-TC.js +463 -0
- package/es/locale/lang/zh-TW.d.ts +2 -0
- package/es/locale/lang/zh-TW.js +2 -0
- package/es/row/index.js +8 -0
- package/es/row/src/row.js +69 -0
- package/es/row/style.css +10 -0
- package/es/row/style.min.css +1 -0
- package/es/style.css +1 -0
- package/es/style.min.css +1 -0
- package/es/ui/index.js +4 -0
- package/es/ui/src/core.js +41 -0
- package/es/ui/src/dom.js +90 -0
- package/es/ui/src/event.js +75 -0
- package/es/ui/src/globalStore.js +8 -0
- package/es/ui/src/iconStore.js +76 -0
- package/es/ui/src/log.js +13 -0
- package/es/ui/src/theme.js +10 -0
- package/es/ui/src/utils.js +17 -0
- package/es/ui/style.css +0 -0
- package/es/ui/style.min.css +0 -0
- package/es/vxe-anchor/index.js +3 -0
- package/es/vxe-anchor/style.css +40 -0
- package/es/vxe-anchor/style.min.css +1 -0
- package/es/vxe-anchor-link/index.js +3 -0
- package/es/vxe-anchor-link/style.css +0 -0
- package/es/vxe-anchor-link/style.min.css +0 -0
- package/es/vxe-breadcrumb/index.js +3 -0
- package/es/vxe-breadcrumb/style.css +19 -0
- package/es/vxe-breadcrumb/style.min.css +1 -0
- package/es/vxe-breadcrumb-item/index.js +3 -0
- package/es/vxe-breadcrumb-item/style.css +0 -0
- package/es/vxe-breadcrumb-item/style.min.css +0 -0
- package/es/vxe-button/index.js +3 -0
- package/es/vxe-button/style.css +513 -0
- package/es/vxe-button/style.min.css +1 -0
- package/es/vxe-button-group/index.js +3 -0
- package/es/vxe-button-group/style.css +0 -0
- package/es/vxe-button-group/style.min.css +0 -0
- package/es/vxe-col/index.js +3 -0
- package/es/vxe-col/style.css +95 -0
- package/es/vxe-col/style.min.css +1 -0
- package/es/vxe-design/index.js +3 -0
- package/es/vxe-design/style.css +0 -0
- package/es/vxe-design/style.min.css +0 -0
- package/es/vxe-icon/index.js +3 -0
- package/es/vxe-icon/style.css +766 -0
- package/es/vxe-icon/style.min.css +1 -0
- package/es/vxe-layout-aside/index.js +3 -0
- package/es/vxe-layout-aside/style.css +12 -0
- package/es/vxe-layout-aside/style.min.css +1 -0
- package/es/vxe-layout-body/index.js +3 -0
- package/es/vxe-layout-body/style.css +3 -0
- package/es/vxe-layout-body/style.min.css +1 -0
- package/es/vxe-layout-container/index.js +3 -0
- package/es/vxe-layout-container/style.css +10 -0
- package/es/vxe-layout-container/style.min.css +1 -0
- package/es/vxe-layout-footer/index.js +3 -0
- package/es/vxe-layout-footer/style.css +10 -0
- package/es/vxe-layout-footer/style.min.css +1 -0
- package/es/vxe-layout-header/index.js +3 -0
- package/es/vxe-layout-header/style.css +10 -0
- package/es/vxe-layout-header/style.min.css +1 -0
- package/es/vxe-row/index.js +3 -0
- package/es/vxe-row/style.css +10 -0
- package/es/vxe-row/style.min.css +1 -0
- package/es/vxe-ui/index.js +3 -0
- package/es/vxe-ui/style.css +0 -0
- package/es/vxe-ui/style.min.css +0 -0
- package/lib/anchor/index.js +15 -0
- package/lib/anchor/index.min.js +1 -0
- package/lib/anchor/src/anchor.js +220 -0
- package/lib/anchor/src/anchor.min.js +1 -0
- package/lib/anchor/style/index.js +1 -0
- package/lib/anchor/style/style.css +40 -0
- package/lib/anchor/style/style.min.css +1 -0
- package/lib/anchor-link/index.js +15 -0
- package/lib/anchor-link/index.min.js +1 -0
- package/lib/anchor-link/src/anchor-link.js +106 -0
- package/lib/anchor-link/src/anchor-link.min.js +1 -0
- package/lib/anchor-link/src/util.js +29 -0
- package/lib/anchor-link/src/util.min.js +1 -0
- package/lib/anchor-link/style/index.js +1 -0
- package/lib/anchor-link/style/style.css +0 -0
- package/lib/anchor-link/style/style.min.css +0 -0
- package/lib/breadcrumb/index.js +15 -0
- package/lib/breadcrumb/index.min.js +1 -0
- package/lib/breadcrumb/src/breadcrumb.js +53 -0
- package/lib/breadcrumb/src/breadcrumb.min.js +1 -0
- package/lib/breadcrumb/style/index.js +1 -0
- package/lib/breadcrumb/style/style.css +19 -0
- package/lib/breadcrumb/style/style.min.css +1 -0
- package/lib/breadcrumb-item/index.js +15 -0
- package/lib/breadcrumb-item/index.min.js +1 -0
- package/lib/breadcrumb-item/src/breadcrumb-item.js +58 -0
- package/lib/breadcrumb-item/src/breadcrumb-item.min.js +1 -0
- package/lib/breadcrumb-item/style/index.js +1 -0
- package/lib/breadcrumb-item/style/style.css +0 -0
- package/lib/breadcrumb-item/style/style.min.css +0 -0
- package/lib/button/index.js +15 -0
- package/lib/button/index.min.js +1 -0
- package/lib/button/src/button.js +540 -0
- package/lib/button/src/button.min.js +1 -0
- package/lib/button/style/index.js +1 -0
- package/lib/button/style/style.css +513 -0
- package/lib/button/style/style.min.css +1 -0
- package/lib/button-group/index.js +15 -0
- package/lib/button-group/index.min.js +1 -0
- package/lib/button-group/src/button-group.js +88 -0
- package/lib/button-group/src/button-group.min.js +1 -0
- package/lib/button-group/style/index.js +1 -0
- package/lib/button-group/style/style.css +0 -0
- package/lib/button-group/style/style.min.css +0 -0
- package/lib/col/index.js +15 -0
- package/lib/col/index.min.js +1 -0
- package/lib/col/src/col.js +96 -0
- package/lib/col/src/col.min.js +1 -0
- package/lib/col/style/index.js +1 -0
- package/lib/col/style/style.css +95 -0
- package/lib/col/style/style.min.css +1 -0
- package/lib/components.js +230 -0
- package/lib/components.min.js +1 -0
- package/lib/design/index.js +15 -0
- package/lib/design/index.min.js +1 -0
- package/lib/design/src/design.js +48 -0
- package/lib/design/src/design.min.js +1 -0
- package/lib/design/style/index.js +1 -0
- package/lib/design/style/style.css +0 -0
- package/lib/design/style/style.min.css +0 -0
- package/lib/hooks/size.js +16 -0
- package/lib/hooks/size.min.js +1 -0
- package/lib/icon/index.js +15 -0
- package/lib/icon/index.min.js +1 -0
- package/lib/icon/src/icon.js +36 -0
- package/lib/icon/src/icon.min.js +1 -0
- package/lib/icon/style/index.js +1 -0
- package/lib/icon/style/style.css +766 -0
- package/lib/icon/style/style.min.css +1 -0
- package/lib/index.common.js +22 -0
- package/lib/index.umd.js +4461 -0
- package/lib/index.umd.min.js +1 -0
- package/lib/layout-aside/index.js +15 -0
- package/lib/layout-aside/index.min.js +1 -0
- package/lib/layout-aside/src/layout-aside.js +80 -0
- package/lib/layout-aside/src/layout-aside.min.js +1 -0
- package/lib/layout-aside/style/index.js +1 -0
- package/lib/layout-aside/style/style.css +12 -0
- package/lib/layout-aside/style/style.min.css +1 -0
- package/lib/layout-body/index.js +15 -0
- package/lib/layout-body/index.min.js +1 -0
- package/lib/layout-body/src/layout-body.js +46 -0
- package/lib/layout-body/src/layout-body.min.js +1 -0
- package/lib/layout-body/style/index.js +1 -0
- package/lib/layout-body/style/style.css +3 -0
- package/lib/layout-body/style/style.min.css +1 -0
- package/lib/layout-container/index.js +15 -0
- package/lib/layout-container/index.min.js +1 -0
- package/lib/layout-container/src/layout-container.js +50 -0
- package/lib/layout-container/src/layout-container.min.js +1 -0
- package/lib/layout-container/style/index.js +1 -0
- package/lib/layout-container/style/style.css +10 -0
- package/lib/layout-container/style/style.min.css +1 -0
- package/lib/layout-footer/index.js +15 -0
- package/lib/layout-footer/index.min.js +1 -0
- package/lib/layout-footer/src/layout-footer.js +50 -0
- package/lib/layout-footer/src/layout-footer.min.js +1 -0
- package/lib/layout-footer/style/index.js +1 -0
- package/lib/layout-footer/style/style.css +10 -0
- package/lib/layout-footer/style/style.min.css +1 -0
- package/lib/layout-header/index.js +15 -0
- package/lib/layout-header/index.min.js +1 -0
- package/lib/layout-header/src/layout-header.js +50 -0
- package/lib/layout-header/src/layout-header.min.js +1 -0
- package/lib/layout-header/style/index.js +1 -0
- package/lib/layout-header/style/style.css +10 -0
- package/lib/layout-header/style/style.min.css +1 -0
- package/lib/locale/lang/en-US.d.ts +2 -0
- package/lib/locale/lang/en-US.js +469 -0
- package/lib/locale/lang/en-US.min.js +1 -0
- package/lib/locale/lang/en-US.umd.js +483 -0
- package/lib/locale/lang/es-ES.d.ts +2 -0
- package/lib/locale/lang/es-ES.js +469 -0
- package/lib/locale/lang/es-ES.min.js +1 -0
- package/lib/locale/lang/es-ES.umd.js +483 -0
- package/lib/locale/lang/ja-JP.d.ts +2 -0
- package/lib/locale/lang/ja-JP.js +469 -0
- package/lib/locale/lang/ja-JP.min.js +1 -0
- package/lib/locale/lang/ja-JP.umd.js +483 -0
- package/lib/locale/lang/pt-BR.d.ts +2 -0
- package/lib/locale/lang/pt-BR.js +469 -0
- package/lib/locale/lang/pt-BR.min.js +1 -0
- package/lib/locale/lang/pt-BR.umd.js +483 -0
- package/lib/locale/lang/zh-CN.d.ts +2 -0
- package/lib/locale/lang/zh-CN.js +469 -0
- package/lib/locale/lang/zh-CN.min.js +1 -0
- package/lib/locale/lang/zh-CN.umd.js +483 -0
- package/lib/locale/lang/zh-HK.d.ts +2 -0
- package/lib/locale/lang/zh-HK.js +9 -0
- package/lib/locale/lang/zh-HK.min.js +1 -0
- package/lib/locale/lang/zh-HK.umd.js +483 -0
- package/lib/locale/lang/zh-MO.d.ts +2 -0
- package/lib/locale/lang/zh-MO.js +9 -0
- package/lib/locale/lang/zh-MO.min.js +1 -0
- package/lib/locale/lang/zh-MO.umd.js +483 -0
- package/lib/locale/lang/zh-TC.d.ts +2 -0
- package/lib/locale/lang/zh-TC.js +469 -0
- package/lib/locale/lang/zh-TC.min.js +1 -0
- package/lib/locale/lang/zh-TC.umd.js +483 -0
- package/lib/locale/lang/zh-TW.d.ts +2 -0
- package/lib/locale/lang/zh-TW.js +9 -0
- package/lib/locale/lang/zh-TW.min.js +1 -0
- package/lib/locale/lang/zh-TW.umd.js +483 -0
- package/lib/row/index.js +15 -0
- package/lib/row/index.min.js +1 -0
- package/lib/row/src/row.js +82 -0
- package/lib/row/src/row.min.js +1 -0
- package/lib/row/style/index.js +1 -0
- package/lib/row/style/style.css +10 -0
- package/lib/row/style/style.min.css +1 -0
- package/lib/style.css +1 -0
- package/lib/style.min.css +1 -0
- package/lib/ui/index.js +25 -0
- package/lib/ui/index.min.js +1 -0
- package/lib/ui/src/core.js +53 -0
- package/lib/ui/src/core.min.js +1 -0
- package/lib/ui/src/dom.js +127 -0
- package/lib/ui/src/dom.min.js +1 -0
- package/lib/ui/src/event.js +100 -0
- package/lib/ui/src/event.min.js +1 -0
- package/lib/ui/src/globalStore.js +14 -0
- package/lib/ui/src/globalStore.min.js +1 -0
- package/lib/ui/src/iconStore.js +82 -0
- package/lib/ui/src/iconStore.min.js +1 -0
- package/lib/ui/src/log.js +22 -0
- package/lib/ui/src/log.min.js +1 -0
- package/lib/ui/src/theme.js +17 -0
- package/lib/ui/src/theme.min.js +1 -0
- package/lib/ui/src/utils.js +28 -0
- package/lib/ui/src/utils.min.js +1 -0
- package/lib/ui/style/index.js +1 -0
- package/lib/ui/style/style.css +0 -0
- package/lib/ui/style/style.min.css +0 -0
- package/lib/vxe-anchor/index.js +22 -0
- package/lib/vxe-anchor/index.min.js +1 -0
- package/lib/vxe-anchor/style/index.js +1 -0
- package/lib/vxe-anchor/style/style.css +40 -0
- package/lib/vxe-anchor/style/style.min.css +1 -0
- package/lib/vxe-anchor-link/index.js +22 -0
- package/lib/vxe-anchor-link/index.min.js +1 -0
- package/lib/vxe-anchor-link/style/index.js +1 -0
- package/lib/vxe-anchor-link/style/style.css +0 -0
- package/lib/vxe-anchor-link/style/style.min.css +0 -0
- package/lib/vxe-breadcrumb/index.js +22 -0
- package/lib/vxe-breadcrumb/index.min.js +1 -0
- package/lib/vxe-breadcrumb/style/index.js +1 -0
- package/lib/vxe-breadcrumb/style/style.css +19 -0
- package/lib/vxe-breadcrumb/style/style.min.css +1 -0
- package/lib/vxe-breadcrumb-item/index.js +22 -0
- package/lib/vxe-breadcrumb-item/index.min.js +1 -0
- package/lib/vxe-breadcrumb-item/style/index.js +1 -0
- package/lib/vxe-breadcrumb-item/style/style.css +0 -0
- package/lib/vxe-breadcrumb-item/style/style.min.css +0 -0
- package/lib/vxe-button/index.js +22 -0
- package/lib/vxe-button/index.min.js +1 -0
- package/lib/vxe-button/style/index.js +1 -0
- package/lib/vxe-button/style/style.css +513 -0
- package/lib/vxe-button/style/style.min.css +1 -0
- package/lib/vxe-button-group/index.js +22 -0
- package/lib/vxe-button-group/index.min.js +1 -0
- package/lib/vxe-button-group/style/index.js +1 -0
- package/lib/vxe-button-group/style/style.css +0 -0
- package/lib/vxe-button-group/style/style.min.css +0 -0
- package/lib/vxe-col/index.js +22 -0
- package/lib/vxe-col/index.min.js +1 -0
- package/lib/vxe-col/style/index.js +1 -0
- package/lib/vxe-col/style/style.css +95 -0
- package/lib/vxe-col/style/style.min.css +1 -0
- package/lib/vxe-design/index.js +22 -0
- package/lib/vxe-design/index.min.js +1 -0
- package/lib/vxe-design/style/index.js +1 -0
- package/lib/vxe-design/style/style.css +0 -0
- package/lib/vxe-design/style/style.min.css +0 -0
- package/lib/vxe-icon/index.js +22 -0
- package/lib/vxe-icon/index.min.js +1 -0
- package/lib/vxe-icon/style/index.js +1 -0
- package/lib/vxe-icon/style/style.css +766 -0
- package/lib/vxe-icon/style/style.min.css +1 -0
- package/lib/vxe-layout-aside/index.js +22 -0
- package/lib/vxe-layout-aside/index.min.js +1 -0
- package/lib/vxe-layout-aside/style/index.js +1 -0
- package/lib/vxe-layout-aside/style/style.css +12 -0
- package/lib/vxe-layout-aside/style/style.min.css +1 -0
- package/lib/vxe-layout-body/index.js +22 -0
- package/lib/vxe-layout-body/index.min.js +1 -0
- package/lib/vxe-layout-body/style/index.js +1 -0
- package/lib/vxe-layout-body/style/style.css +3 -0
- package/lib/vxe-layout-body/style/style.min.css +1 -0
- package/lib/vxe-layout-container/index.js +22 -0
- package/lib/vxe-layout-container/index.min.js +1 -0
- package/lib/vxe-layout-container/style/index.js +1 -0
- package/lib/vxe-layout-container/style/style.css +10 -0
- package/lib/vxe-layout-container/style/style.min.css +1 -0
- package/lib/vxe-layout-footer/index.js +22 -0
- package/lib/vxe-layout-footer/index.min.js +1 -0
- package/lib/vxe-layout-footer/style/index.js +1 -0
- package/lib/vxe-layout-footer/style/style.css +10 -0
- package/lib/vxe-layout-footer/style/style.min.css +1 -0
- package/lib/vxe-layout-header/index.js +22 -0
- package/lib/vxe-layout-header/index.min.js +1 -0
- package/lib/vxe-layout-header/style/index.js +1 -0
- package/lib/vxe-layout-header/style/style.css +10 -0
- package/lib/vxe-layout-header/style/style.min.css +1 -0
- package/lib/vxe-row/index.js +22 -0
- package/lib/vxe-row/index.min.js +1 -0
- package/lib/vxe-row/style/index.js +1 -0
- package/lib/vxe-row/style/style.css +10 -0
- package/lib/vxe-row/style/style.min.css +1 -0
- package/lib/vxe-ui/index.js +22 -0
- package/lib/vxe-ui/index.min.js +1 -0
- package/lib/vxe-ui/style/index.js +1 -0
- package/lib/vxe-ui/style/style.css +0 -0
- package/lib/vxe-ui/style/style.min.css +0 -0
- package/package.json +83 -55
- package/packages/anchor/index.ts +11 -0
- package/packages/anchor/src/anchor.ts +233 -0
- package/packages/anchor-link/index.ts +11 -0
- package/packages/anchor-link/src/anchor-link.ts +118 -0
- package/packages/anchor-link/src/util.ts +23 -0
- package/packages/breadcrumb/index.ts +11 -0
- package/packages/breadcrumb/src/breadcrumb.ts +60 -0
- package/packages/breadcrumb-item/index.ts +11 -0
- package/packages/breadcrumb-item/src/breadcrumb-item.ts +71 -0
- package/packages/button/index.ts +11 -0
- package/packages/button/src/button.ts +526 -0
- package/packages/button-group/index.ts +11 -0
- package/packages/button-group/src/button-group.ts +81 -0
- package/packages/col/index.ts +11 -0
- package/packages/col/src/col.ts +98 -0
- package/packages/components.ts +66 -0
- package/packages/design/index.ts +11 -0
- package/packages/design/src/design.ts +55 -0
- package/packages/hooks/size.ts +14 -0
- package/packages/icon/index.ts +11 -0
- package/packages/icon/src/icon.ts +27 -0
- package/packages/index.ts +4 -0
- package/packages/layout-aside/index.ts +11 -0
- package/packages/layout-aside/src/layout-aside.ts +85 -0
- package/packages/layout-body/index.ts +11 -0
- package/packages/layout-body/src/layout-body.ts +52 -0
- package/packages/layout-container/index.ts +11 -0
- package/packages/layout-container/src/layout-container.ts +56 -0
- package/packages/layout-footer/index.ts +11 -0
- package/packages/layout-footer/src/layout-footer.ts +56 -0
- package/packages/layout-header/index.ts +11 -0
- package/packages/layout-header/src/layout-header.ts +56 -0
- package/packages/locale/lang/en-US.ts +465 -0
- package/packages/locale/lang/es-ES.ts +465 -0
- package/packages/locale/lang/ja-JP.ts +465 -0
- package/packages/locale/lang/pt-BR.ts +465 -0
- package/packages/locale/lang/zh-CN.ts +465 -0
- package/packages/locale/lang/zh-HK.ts +3 -0
- package/packages/locale/lang/zh-MO.ts +3 -0
- package/packages/locale/lang/zh-TC.ts +465 -0
- package/packages/locale/lang/zh-TW.ts +3 -0
- package/packages/row/index.ts +11 -0
- package/packages/row/src/row.ts +86 -0
- package/packages/ui/index.ts +6 -0
- package/packages/ui/src/core.ts +51 -0
- package/packages/ui/src/dom.ts +103 -0
- package/packages/ui/src/event.ts +88 -0
- package/packages/ui/src/globalStore.ts +11 -0
- package/packages/ui/src/iconStore.ts +88 -0
- package/packages/ui/src/log.ts +16 -0
- package/packages/ui/src/theme.ts +13 -0
- package/packages/ui/src/utils.ts +22 -0
- package/styles/all.scss +17 -0
- package/styles/base.scss +16 -0
- package/styles/components/anchor-link.scss +0 -0
- package/styles/components/anchor.scss +42 -0
- package/styles/components/breadcrumb-item.scss +0 -0
- package/styles/components/breadcrumb.scss +20 -0
- package/styles/components/button-group.scss +0 -0
- package/styles/components/button.scss +357 -0
- package/styles/components/col.scss +32 -0
- package/styles/components/design.scss +1 -0
- package/styles/components/icon.scss +785 -0
- package/styles/components/layout-aside.scss +14 -0
- package/styles/components/layout-body.scss +5 -0
- package/styles/components/layout-container.scss +12 -0
- package/styles/components/layout-footer.scss +12 -0
- package/styles/components/layout-header.scss +12 -0
- package/styles/components/row.scss +10 -0
- package/styles/components/ui.scss +0 -0
- package/styles/helpers/mixin.scss +82 -0
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/styles/theme/base.scss +81 -0
- package/styles/theme/dark.scss +7 -0
- package/styles/theme/default.scss +5 -0
- package/types/all.d.ts +67 -0
- package/types/component/anchor-link.d.ts +74 -0
- package/types/component/anchor.d.ts +79 -0
- package/types/component/breadcrumb-item.d.ts +58 -0
- package/types/component/breadcrumb.d.ts +61 -0
- package/types/component/button-group.d.ts +86 -0
- package/types/component/button.d.ts +157 -0
- package/types/component/col.d.ts +58 -0
- package/types/component/design.d.ts +63 -0
- package/types/component/icon.d.ts +67 -0
- package/types/component/layout-aside.d.ts +57 -0
- package/types/component/layout-body.d.ts +58 -0
- package/types/component/layout-container.d.ts +58 -0
- package/types/component/layout-footer.d.ts +58 -0
- package/types/component/layout-header.d.ts +58 -0
- package/types/component/row.d.ts +65 -0
- package/types/index.d.ts +4 -0
- package/types/tool/common.d.ts +52 -0
- package/types/tool/index.d.ts +6 -0
- package/types/ui/global-config.d.ts +15 -0
- package/types/ui/global-icon.d.ts +15 -0
- package/types/ui/index.d.ts +42 -0
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _vue = require("vue");
|
|
8
|
+
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
9
|
+
var _globalStore = _interopRequireDefault(require("../../ui/src/globalStore"));
|
|
10
|
+
var _iconStore = _interopRequireDefault(require("../../ui/src/iconStore"));
|
|
11
|
+
var _size = require("../../hooks/size");
|
|
12
|
+
var _dom = require("../../ui/src/dom");
|
|
13
|
+
var _utils = require("../../ui/src/utils");
|
|
14
|
+
var _event = require("../../ui/src/event");
|
|
15
|
+
var _log = require("../../ui/src/log");
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
var _default = exports.default = (0, _vue.defineComponent)({
|
|
18
|
+
name: 'VxeButton',
|
|
19
|
+
props: {
|
|
20
|
+
/**
|
|
21
|
+
* 按钮类型
|
|
22
|
+
*/
|
|
23
|
+
type: String,
|
|
24
|
+
mode: String,
|
|
25
|
+
className: [String, Function],
|
|
26
|
+
popupClassName: [String, Function],
|
|
27
|
+
/**
|
|
28
|
+
* 按钮尺寸
|
|
29
|
+
*/
|
|
30
|
+
size: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: () => _globalStore.default.button.size || _globalStore.default.size
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* 用来标识这一项
|
|
36
|
+
*/
|
|
37
|
+
name: [String, Number],
|
|
38
|
+
/**
|
|
39
|
+
* 按钮内容
|
|
40
|
+
*/
|
|
41
|
+
content: String,
|
|
42
|
+
/**
|
|
43
|
+
* 固定显示下拉面板的方向
|
|
44
|
+
*/
|
|
45
|
+
placement: String,
|
|
46
|
+
/**
|
|
47
|
+
* 按钮状态
|
|
48
|
+
*/
|
|
49
|
+
status: String,
|
|
50
|
+
/**
|
|
51
|
+
* 标题
|
|
52
|
+
*/
|
|
53
|
+
title: String,
|
|
54
|
+
/**
|
|
55
|
+
* 按钮的图标
|
|
56
|
+
*/
|
|
57
|
+
icon: String,
|
|
58
|
+
/**
|
|
59
|
+
* 圆角边框
|
|
60
|
+
*/
|
|
61
|
+
round: Boolean,
|
|
62
|
+
/**
|
|
63
|
+
* 圆角按钮
|
|
64
|
+
*/
|
|
65
|
+
circle: Boolean,
|
|
66
|
+
/**
|
|
67
|
+
* 是否禁用
|
|
68
|
+
*/
|
|
69
|
+
disabled: Boolean,
|
|
70
|
+
/**
|
|
71
|
+
* 是否加载中
|
|
72
|
+
*/
|
|
73
|
+
loading: Boolean,
|
|
74
|
+
/**
|
|
75
|
+
* 在下拉面板关闭时销毁内容
|
|
76
|
+
*/
|
|
77
|
+
destroyOnClose: Boolean,
|
|
78
|
+
/**
|
|
79
|
+
* 是否将弹框容器插入于 body 内
|
|
80
|
+
*/
|
|
81
|
+
transfer: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: () => _globalStore.default.button.transfer
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
emits: ['click', 'mouseenter', 'mouseleave', 'dropdown-click'],
|
|
87
|
+
setup(props, context) {
|
|
88
|
+
const {
|
|
89
|
+
slots,
|
|
90
|
+
emit
|
|
91
|
+
} = context;
|
|
92
|
+
const xID = _xeUtils.default.uniqueId();
|
|
93
|
+
const computeSize = (0, _size.useSize)(props);
|
|
94
|
+
const reactData = (0, _vue.reactive)({
|
|
95
|
+
inited: false,
|
|
96
|
+
showPanel: false,
|
|
97
|
+
animatVisible: false,
|
|
98
|
+
panelIndex: 0,
|
|
99
|
+
panelStyle: {},
|
|
100
|
+
panelPlacement: ''
|
|
101
|
+
});
|
|
102
|
+
const internalData = {
|
|
103
|
+
showTime: null
|
|
104
|
+
};
|
|
105
|
+
const refElem = (0, _vue.ref)();
|
|
106
|
+
const refButton = (0, _vue.ref)();
|
|
107
|
+
const refBtnPanel = (0, _vue.ref)();
|
|
108
|
+
const refMaps = {
|
|
109
|
+
refElem
|
|
110
|
+
};
|
|
111
|
+
const $xeButton = {
|
|
112
|
+
xID,
|
|
113
|
+
props,
|
|
114
|
+
context,
|
|
115
|
+
reactData,
|
|
116
|
+
internalData,
|
|
117
|
+
getRefMaps: () => refMaps
|
|
118
|
+
};
|
|
119
|
+
const $xeButtonGroup = (0, _vue.inject)('$xeButtonGroup', null);
|
|
120
|
+
let buttonMethods = {};
|
|
121
|
+
const computeIsFormBtn = (0, _vue.computed)(() => {
|
|
122
|
+
const {
|
|
123
|
+
type
|
|
124
|
+
} = props;
|
|
125
|
+
if (type) {
|
|
126
|
+
return ['submit', 'reset', 'button'].indexOf(type) > -1;
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
});
|
|
130
|
+
const computeBtnMode = (0, _vue.computed)(() => {
|
|
131
|
+
const {
|
|
132
|
+
type,
|
|
133
|
+
mode
|
|
134
|
+
} = props;
|
|
135
|
+
if (mode === 'text' || type === 'text' || $xeButtonGroup && $xeButtonGroup.props.mode === 'text') {
|
|
136
|
+
return 'text';
|
|
137
|
+
}
|
|
138
|
+
return 'button';
|
|
139
|
+
});
|
|
140
|
+
const computeBtnStatus = (0, _vue.computed)(() => {
|
|
141
|
+
const {
|
|
142
|
+
status
|
|
143
|
+
} = props;
|
|
144
|
+
if (status) {
|
|
145
|
+
return status;
|
|
146
|
+
}
|
|
147
|
+
if ($xeButtonGroup) {
|
|
148
|
+
return $xeButtonGroup.props.status;
|
|
149
|
+
}
|
|
150
|
+
return '';
|
|
151
|
+
});
|
|
152
|
+
const computeBtnRound = (0, _vue.computed)(() => {
|
|
153
|
+
const {
|
|
154
|
+
round
|
|
155
|
+
} = props;
|
|
156
|
+
if (round) {
|
|
157
|
+
return round;
|
|
158
|
+
}
|
|
159
|
+
if ($xeButtonGroup) {
|
|
160
|
+
return $xeButtonGroup.props.round;
|
|
161
|
+
}
|
|
162
|
+
return false;
|
|
163
|
+
});
|
|
164
|
+
const computeBtnCircle = (0, _vue.computed)(() => {
|
|
165
|
+
const {
|
|
166
|
+
circle
|
|
167
|
+
} = props;
|
|
168
|
+
if (circle) {
|
|
169
|
+
return circle;
|
|
170
|
+
}
|
|
171
|
+
if ($xeButtonGroup) {
|
|
172
|
+
return $xeButtonGroup.props.circle;
|
|
173
|
+
}
|
|
174
|
+
return false;
|
|
175
|
+
});
|
|
176
|
+
const updateZindex = () => {
|
|
177
|
+
if (reactData.panelIndex < (0, _utils.getLastZIndex)()) {
|
|
178
|
+
reactData.panelIndex = (0, _utils.nextZIndex)();
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
const updatePlacement = () => {
|
|
182
|
+
return (0, _vue.nextTick)().then(() => {
|
|
183
|
+
const {
|
|
184
|
+
transfer,
|
|
185
|
+
placement
|
|
186
|
+
} = props;
|
|
187
|
+
const {
|
|
188
|
+
panelIndex
|
|
189
|
+
} = reactData;
|
|
190
|
+
const targetElem = refButton.value;
|
|
191
|
+
const panelElem = refBtnPanel.value;
|
|
192
|
+
if (panelElem && targetElem) {
|
|
193
|
+
const targetHeight = targetElem.offsetHeight;
|
|
194
|
+
const targetWidth = targetElem.offsetWidth;
|
|
195
|
+
const panelHeight = panelElem.offsetHeight;
|
|
196
|
+
const panelWidth = panelElem.offsetWidth;
|
|
197
|
+
const marginSize = 5;
|
|
198
|
+
const panelStyle = {
|
|
199
|
+
zIndex: panelIndex
|
|
200
|
+
};
|
|
201
|
+
const {
|
|
202
|
+
top,
|
|
203
|
+
left,
|
|
204
|
+
boundingTop,
|
|
205
|
+
visibleHeight,
|
|
206
|
+
visibleWidth
|
|
207
|
+
} = (0, _dom.getAbsolutePos)(targetElem);
|
|
208
|
+
let panelPlacement = 'bottom';
|
|
209
|
+
if (transfer) {
|
|
210
|
+
let btnLeft = left + targetWidth - panelWidth;
|
|
211
|
+
let btnTop = top + targetHeight;
|
|
212
|
+
if (placement === 'top') {
|
|
213
|
+
panelPlacement = 'top';
|
|
214
|
+
btnTop = top - panelHeight;
|
|
215
|
+
} else if (!placement) {
|
|
216
|
+
// 如果下面不够放,则向上
|
|
217
|
+
if (boundingTop + targetHeight + panelHeight + marginSize > visibleHeight) {
|
|
218
|
+
panelPlacement = 'top';
|
|
219
|
+
btnTop = top - panelHeight;
|
|
220
|
+
}
|
|
221
|
+
// 如果上面不够放,则向下(优先)
|
|
222
|
+
if (btnTop < marginSize) {
|
|
223
|
+
panelPlacement = 'bottom';
|
|
224
|
+
btnTop = top + targetHeight;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
// 如果溢出右边
|
|
228
|
+
if (btnLeft + panelWidth + marginSize > visibleWidth) {
|
|
229
|
+
btnLeft -= btnLeft + panelWidth + marginSize - visibleWidth;
|
|
230
|
+
}
|
|
231
|
+
// 如果溢出左边
|
|
232
|
+
if (btnLeft < marginSize) {
|
|
233
|
+
btnLeft = marginSize;
|
|
234
|
+
}
|
|
235
|
+
Object.assign(panelStyle, {
|
|
236
|
+
left: `${btnLeft}px`,
|
|
237
|
+
right: 'auto',
|
|
238
|
+
top: `${btnTop}px`,
|
|
239
|
+
minWidth: `${targetWidth}px`
|
|
240
|
+
});
|
|
241
|
+
} else {
|
|
242
|
+
if (placement === 'top') {
|
|
243
|
+
panelPlacement = 'top';
|
|
244
|
+
panelStyle.bottom = `${targetHeight}px`;
|
|
245
|
+
} else if (!placement) {
|
|
246
|
+
// 如果下面不够放,则向上
|
|
247
|
+
if (boundingTop + targetHeight + panelHeight > visibleHeight) {
|
|
248
|
+
// 如果上面不够放,则向下(优先)
|
|
249
|
+
if (boundingTop - targetHeight - panelHeight > marginSize) {
|
|
250
|
+
panelPlacement = 'top';
|
|
251
|
+
panelStyle.bottom = `${targetHeight}px`;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
reactData.panelStyle = panelStyle;
|
|
257
|
+
reactData.panelPlacement = panelPlacement;
|
|
258
|
+
return (0, _vue.nextTick)();
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
const clickEvent = evnt => {
|
|
263
|
+
if ($xeButtonGroup) {
|
|
264
|
+
$xeButtonGroup.handleClick({
|
|
265
|
+
name: props.name
|
|
266
|
+
}, evnt);
|
|
267
|
+
} else {
|
|
268
|
+
buttonMethods.dispatchEvent('click', {
|
|
269
|
+
$event: evnt
|
|
270
|
+
}, evnt);
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
const mousedownDropdownEvent = evnt => {
|
|
274
|
+
const isLeftBtn = evnt.button === 0;
|
|
275
|
+
if (isLeftBtn) {
|
|
276
|
+
evnt.stopPropagation();
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
const clickDropdownEvent = evnt => {
|
|
280
|
+
const dropdownElem = evnt.currentTarget;
|
|
281
|
+
const panelElem = refBtnPanel.value;
|
|
282
|
+
const {
|
|
283
|
+
flag,
|
|
284
|
+
targetElem
|
|
285
|
+
} = (0, _dom.getEventTargetNode)(evnt, dropdownElem, 'vxe-button');
|
|
286
|
+
if (flag) {
|
|
287
|
+
if (panelElem) {
|
|
288
|
+
panelElem.dataset.active = 'N';
|
|
289
|
+
}
|
|
290
|
+
reactData.showPanel = false;
|
|
291
|
+
setTimeout(() => {
|
|
292
|
+
if (!panelElem || panelElem.dataset.active !== 'Y') {
|
|
293
|
+
reactData.animatVisible = false;
|
|
294
|
+
}
|
|
295
|
+
}, 350);
|
|
296
|
+
buttonMethods.dispatchEvent('dropdown-click', {
|
|
297
|
+
name: targetElem.getAttribute('name'),
|
|
298
|
+
$event: evnt
|
|
299
|
+
}, evnt);
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
const mouseenterDropdownEvent = () => {
|
|
303
|
+
const panelElem = refBtnPanel.value;
|
|
304
|
+
if (panelElem) {
|
|
305
|
+
panelElem.dataset.active = 'Y';
|
|
306
|
+
reactData.animatVisible = true;
|
|
307
|
+
setTimeout(() => {
|
|
308
|
+
if (panelElem.dataset.active === 'Y') {
|
|
309
|
+
reactData.showPanel = true;
|
|
310
|
+
updateZindex();
|
|
311
|
+
updatePlacement();
|
|
312
|
+
setTimeout(() => {
|
|
313
|
+
if (reactData.showPanel) {
|
|
314
|
+
updatePlacement();
|
|
315
|
+
}
|
|
316
|
+
}, 50);
|
|
317
|
+
}
|
|
318
|
+
}, 20);
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
const mouseenterTargetEvent = evnt => {
|
|
322
|
+
const panelElem = refBtnPanel.value;
|
|
323
|
+
if (panelElem) {
|
|
324
|
+
panelElem.dataset.active = 'Y';
|
|
325
|
+
if (!reactData.inited) {
|
|
326
|
+
reactData.inited = true;
|
|
327
|
+
}
|
|
328
|
+
internalData.showTime = setTimeout(() => {
|
|
329
|
+
if (panelElem.dataset.active === 'Y') {
|
|
330
|
+
mouseenterDropdownEvent();
|
|
331
|
+
} else {
|
|
332
|
+
reactData.animatVisible = false;
|
|
333
|
+
}
|
|
334
|
+
}, 250);
|
|
335
|
+
}
|
|
336
|
+
mouseenterEvent(evnt);
|
|
337
|
+
};
|
|
338
|
+
const mouseleaveTargetEvent = evnt => {
|
|
339
|
+
closePanel();
|
|
340
|
+
mouseleaveEvent(evnt);
|
|
341
|
+
};
|
|
342
|
+
const mouseenterEvent = evnt => {
|
|
343
|
+
emit('mouseenter', {
|
|
344
|
+
$event: evnt
|
|
345
|
+
});
|
|
346
|
+
};
|
|
347
|
+
const mouseleaveEvent = evnt => {
|
|
348
|
+
emit('mouseleave', {
|
|
349
|
+
$event: evnt
|
|
350
|
+
});
|
|
351
|
+
};
|
|
352
|
+
const closePanel = () => {
|
|
353
|
+
const panelElem = refBtnPanel.value;
|
|
354
|
+
clearTimeout(internalData.showTime);
|
|
355
|
+
if (panelElem) {
|
|
356
|
+
panelElem.dataset.active = 'N';
|
|
357
|
+
setTimeout(() => {
|
|
358
|
+
if (panelElem.dataset.active !== 'Y') {
|
|
359
|
+
reactData.showPanel = false;
|
|
360
|
+
setTimeout(() => {
|
|
361
|
+
if (panelElem.dataset.active !== 'Y') {
|
|
362
|
+
reactData.animatVisible = false;
|
|
363
|
+
}
|
|
364
|
+
}, 350);
|
|
365
|
+
}
|
|
366
|
+
}, 100);
|
|
367
|
+
} else {
|
|
368
|
+
reactData.animatVisible = false;
|
|
369
|
+
reactData.showPanel = false;
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
const mouseleaveDropdownEvent = () => {
|
|
373
|
+
closePanel();
|
|
374
|
+
};
|
|
375
|
+
const renderContent = () => {
|
|
376
|
+
const {
|
|
377
|
+
content,
|
|
378
|
+
icon,
|
|
379
|
+
loading
|
|
380
|
+
} = props;
|
|
381
|
+
const contVNs = [];
|
|
382
|
+
if (loading) {
|
|
383
|
+
contVNs.push((0, _vue.h)('i', {
|
|
384
|
+
class: ['vxe-button--loading-icon', _iconStore.default.BUTTON_LOADING]
|
|
385
|
+
}));
|
|
386
|
+
} else if (slots.icon) {
|
|
387
|
+
contVNs.push((0, _vue.h)('span', {
|
|
388
|
+
class: 'vxe-button--custom-icon'
|
|
389
|
+
}, slots.icon({})));
|
|
390
|
+
} else if (icon) {
|
|
391
|
+
contVNs.push((0, _vue.h)('i', {
|
|
392
|
+
class: ['vxe-button--icon', icon]
|
|
393
|
+
}));
|
|
394
|
+
}
|
|
395
|
+
if (slots.default) {
|
|
396
|
+
contVNs.push((0, _vue.h)('span', {
|
|
397
|
+
class: 'vxe-button--content'
|
|
398
|
+
}, slots.default({})));
|
|
399
|
+
} else if (content) {
|
|
400
|
+
contVNs.push((0, _vue.h)('span', {
|
|
401
|
+
class: 'vxe-button--content'
|
|
402
|
+
}, (0, _utils.getFuncText)(content)));
|
|
403
|
+
}
|
|
404
|
+
return contVNs;
|
|
405
|
+
};
|
|
406
|
+
buttonMethods = {
|
|
407
|
+
dispatchEvent(type, params, evnt) {
|
|
408
|
+
emit(type, Object.assign({
|
|
409
|
+
$button: $xeButton,
|
|
410
|
+
$event: evnt
|
|
411
|
+
}, params));
|
|
412
|
+
},
|
|
413
|
+
focus() {
|
|
414
|
+
const btnElem = refButton.value;
|
|
415
|
+
btnElem.focus();
|
|
416
|
+
return (0, _vue.nextTick)();
|
|
417
|
+
},
|
|
418
|
+
blur() {
|
|
419
|
+
const btnElem = refButton.value;
|
|
420
|
+
btnElem.blur();
|
|
421
|
+
return (0, _vue.nextTick)();
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
Object.assign($xeButton, buttonMethods);
|
|
425
|
+
(0, _vue.onMounted)(() => {
|
|
426
|
+
if (process.env.NODE_ENV === 'development') {
|
|
427
|
+
if (props.type === 'text') {
|
|
428
|
+
(0, _log.warnLog)('vxe.error.delProp', ['type=text', 'mode=text']);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
_event.GlobalEvent.on($xeButton, 'mousewheel', evnt => {
|
|
432
|
+
const panelElem = refBtnPanel.value;
|
|
433
|
+
if (reactData.showPanel && !(0, _dom.getEventTargetNode)(evnt, panelElem).flag) {
|
|
434
|
+
closePanel();
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
});
|
|
438
|
+
(0, _vue.onUnmounted)(() => {
|
|
439
|
+
_event.GlobalEvent.off($xeButton, 'mousewheel');
|
|
440
|
+
});
|
|
441
|
+
const renderVN = () => {
|
|
442
|
+
const {
|
|
443
|
+
className,
|
|
444
|
+
popupClassName,
|
|
445
|
+
transfer,
|
|
446
|
+
title,
|
|
447
|
+
type,
|
|
448
|
+
destroyOnClose,
|
|
449
|
+
name,
|
|
450
|
+
disabled,
|
|
451
|
+
loading
|
|
452
|
+
} = props;
|
|
453
|
+
const {
|
|
454
|
+
inited,
|
|
455
|
+
showPanel
|
|
456
|
+
} = reactData;
|
|
457
|
+
const isFormBtn = computeIsFormBtn.value;
|
|
458
|
+
const btnMode = computeBtnMode.value;
|
|
459
|
+
const btnStatus = computeBtnStatus.value;
|
|
460
|
+
const btnRound = computeBtnRound.value;
|
|
461
|
+
const btnCircle = computeBtnCircle.value;
|
|
462
|
+
const vSize = computeSize.value;
|
|
463
|
+
if (slots.dropdowns) {
|
|
464
|
+
return (0, _vue.h)('div', {
|
|
465
|
+
ref: refElem,
|
|
466
|
+
class: ['vxe-button--dropdown', className ? _xeUtils.default.isFunction(className) ? className({
|
|
467
|
+
$button: $xeButton
|
|
468
|
+
}) : className : '', {
|
|
469
|
+
[`size--${vSize}`]: vSize,
|
|
470
|
+
'is--active': showPanel
|
|
471
|
+
}]
|
|
472
|
+
}, [(0, _vue.h)('button', {
|
|
473
|
+
ref: refButton,
|
|
474
|
+
class: ['vxe-button', `type--${btnMode}`, {
|
|
475
|
+
[`size--${vSize}`]: vSize,
|
|
476
|
+
[`theme--${btnStatus}`]: btnStatus,
|
|
477
|
+
'is--round': btnRound,
|
|
478
|
+
'is--circle': btnCircle,
|
|
479
|
+
'is--disabled': disabled || loading,
|
|
480
|
+
'is--loading': loading
|
|
481
|
+
}],
|
|
482
|
+
title,
|
|
483
|
+
name,
|
|
484
|
+
type: isFormBtn ? type : 'button',
|
|
485
|
+
disabled: disabled || loading,
|
|
486
|
+
onMouseenter: mouseenterTargetEvent,
|
|
487
|
+
onMouseleave: mouseleaveTargetEvent,
|
|
488
|
+
onClick: clickEvent
|
|
489
|
+
}, renderContent().concat([(0, _vue.h)('i', {
|
|
490
|
+
class: `vxe-button--dropdown-arrow ${_iconStore.default.BUTTON_DROPDOWN}`
|
|
491
|
+
})])), (0, _vue.h)(_vue.Teleport, {
|
|
492
|
+
to: 'body',
|
|
493
|
+
disabled: transfer ? !inited : true
|
|
494
|
+
}, [(0, _vue.h)('div', {
|
|
495
|
+
ref: refBtnPanel,
|
|
496
|
+
class: ['vxe-button--dropdown-panel', popupClassName ? _xeUtils.default.isFunction(popupClassName) ? popupClassName({
|
|
497
|
+
$button: $xeButton
|
|
498
|
+
}) : popupClassName : '', {
|
|
499
|
+
[`size--${vSize}`]: vSize,
|
|
500
|
+
'animat--leave': reactData.animatVisible,
|
|
501
|
+
'animat--enter': showPanel
|
|
502
|
+
}],
|
|
503
|
+
placement: reactData.panelPlacement,
|
|
504
|
+
style: reactData.panelStyle
|
|
505
|
+
}, inited ? [(0, _vue.h)('div', {
|
|
506
|
+
class: 'vxe-button--dropdown-wrapper',
|
|
507
|
+
onMousedown: mousedownDropdownEvent,
|
|
508
|
+
onClick: clickDropdownEvent,
|
|
509
|
+
onMouseenter: mouseenterDropdownEvent,
|
|
510
|
+
onMouseleave: mouseleaveDropdownEvent
|
|
511
|
+
}, destroyOnClose && !showPanel ? [] : slots.dropdowns({}))] : [])])]);
|
|
512
|
+
}
|
|
513
|
+
return (0, _vue.h)('button', {
|
|
514
|
+
ref: refButton,
|
|
515
|
+
class: ['vxe-button', `type--${btnMode}`, className ? _xeUtils.default.isFunction(className) ? className({
|
|
516
|
+
$button: $xeButton
|
|
517
|
+
}) : className : '', {
|
|
518
|
+
[`size--${vSize}`]: vSize,
|
|
519
|
+
[`theme--${btnStatus}`]: btnStatus,
|
|
520
|
+
'is--round': btnRound,
|
|
521
|
+
'is--circle': btnCircle,
|
|
522
|
+
'is--disabled': disabled || loading,
|
|
523
|
+
'is--loading': loading
|
|
524
|
+
}],
|
|
525
|
+
title,
|
|
526
|
+
name,
|
|
527
|
+
type: isFormBtn ? type : 'button',
|
|
528
|
+
disabled: disabled || loading,
|
|
529
|
+
onClick: clickEvent,
|
|
530
|
+
onMouseenter: mouseenterEvent,
|
|
531
|
+
onMouseleave: mouseleaveEvent
|
|
532
|
+
}, renderContent());
|
|
533
|
+
};
|
|
534
|
+
$xeButton.renderVN = renderVN;
|
|
535
|
+
return $xeButton;
|
|
536
|
+
},
|
|
537
|
+
render() {
|
|
538
|
+
return this.renderVN();
|
|
539
|
+
}
|
|
540
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_xeUtils=_interopRequireDefault(require("xe-utils")),_globalStore=_interopRequireDefault(require("../../ui/src/globalStore")),_iconStore=_interopRequireDefault(require("../../ui/src/iconStore")),_size=require("../../hooks/size"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_event=require("../../ui/src/event"),_log=require("../../ui/src/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=exports.default=(0,_vue.defineComponent)({name:"VxeButton",props:{type:String,mode:String,className:[String,Function],popupClassName:[String,Function],size:{type:String,default:()=>_globalStore.default.button.size||_globalStore.default.size},name:[String,Number],content:String,placement:String,status:String,title:String,icon:String,round:Boolean,circle:Boolean,disabled:Boolean,loading:Boolean,destroyOnClose:Boolean,transfer:{type:Boolean,default:()=>_globalStore.default.button.transfer}},emits:["click","mouseenter","mouseleave","dropdown-click"],setup(f,e){const{slots:x,emit:o}=e;var t=_xeUtils.default.uniqueId();const g=(0,_size.useSize)(f),h=(0,_vue.reactive)({inited:!1,showPanel:!1,animatVisible:!1,panelIndex:0,panelStyle:{},panelPlacement:""}),n={showTime:null},w=(0,_vue.ref)(),S=(0,_vue.ref)(),T=(0,_vue.ref)(),a={refElem:w},y={xID:t,props:f,context:e,reactData:h,internalData:n,getRefMaps:()=>a},i=(0,_vue.inject)("$xeButtonGroup",null);let u={};const N=(0,_vue.computed)(()=>{var e=f["type"];return!!e&&-1<["submit","reset","button"].indexOf(e)}),P=(0,_vue.computed)(()=>{var{type:e,mode:t}=f;return"text"===t||"text"===e||i&&"text"===i.props.mode?"text":"button"}),q=(0,_vue.computed)(()=>{var e=f["status"];return e||(i?i.props.status:"")}),k=(0,_vue.computed)(()=>{var e=f["round"];return e||!!i&&i.props.round}),O=(0,_vue.computed)(()=>{var e=f["circle"];return e||!!i&&i.props.circle}),s=()=>{h.panelIndex<(0,_utils.getLastZIndex)()&&(h.panelIndex=(0,_utils.nextZIndex)())},l=()=>(0,_vue.nextTick)().then(()=>{var{transfer:e,placement:o}=f,a=h["panelIndex"],i=S.value,u=T.value;if(u&&i){var s=i.offsetHeight,l=i.offsetWidth,r=u.offsetHeight,u=u.offsetWidth,a={zIndex:a},{top:i,left:d,boundingTop:v,visibleHeight:c,visibleWidth:p}=(0,_dom.getAbsolutePos)(i);let n="bottom";if(e){let e=d+l-u,t=i+s;"top"===o?(n="top",t=i-r):o||(c<v+s+r+5&&(n="top",t=i-r),t<5&&(n="bottom",t=i+s)),e+u+5>p&&(e-=e+u+5-p),e<5&&(e=5),Object.assign(a,{left:e+"px",right:"auto",top:t+"px",minWidth:l+"px"})}else"top"===o?(n="top",a.bottom=s+"px"):o||c<v+s+r&&5<v-s-r&&(n="top",a.bottom=s+"px");return h.panelStyle=a,h.panelPlacement=n,(0,_vue.nextTick)()}}),z=e=>{i?i.handleClick({name:f.name},e):u.dispatchEvent("click",{$event:e},e)},D=e=>{0===e.button&&e.stopPropagation()},E=e=>{var t=e.currentTarget;const n=T.value;var{flag:t,targetElem:o}=(0,_dom.getEventTargetNode)(e,t,"vxe-button");t&&(n&&(n.dataset.active="N"),h.showPanel=!1,setTimeout(()=>{n&&"Y"===n.dataset.active||(h.animatVisible=!1)},350),u.dispatchEvent("dropdown-click",{name:o.getAttribute("name"),$event:e},e))},M=()=>{const e=T.value;e&&(e.dataset.active="Y",h.animatVisible=!0,setTimeout(()=>{"Y"===e.dataset.active&&(h.showPanel=!0,s(),l(),setTimeout(()=>{h.showPanel&&l()},50))},20))},V=e=>{const t=T.value;t&&(t.dataset.active="Y",h.inited||(h.inited=!0),n.showTime=setTimeout(()=>{"Y"===t.dataset.active?M():h.animatVisible=!1},250)),I(e)},B=e=>{r(),$(e)},I=e=>{o("mouseenter",{$event:e})},$=e=>{o("mouseleave",{$event:e})},r=()=>{const e=T.value;clearTimeout(n.showTime),e?(e.dataset.active="N",setTimeout(()=>{"Y"!==e.dataset.active&&(h.showPanel=!1,setTimeout(()=>{"Y"!==e.dataset.active&&(h.animatVisible=!1)},350))},100)):(h.animatVisible=!1,h.showPanel=!1)},C=()=>{r()},U=()=>{var{content:e,icon:t,loading:n}=f,o=[];return n?o.push((0,_vue.h)("i",{class:["vxe-button--loading-icon",_iconStore.default.BUTTON_LOADING]})):x.icon?o.push((0,_vue.h)("span",{class:"vxe-button--custom-icon"},x.icon({}))):t&&o.push((0,_vue.h)("i",{class:["vxe-button--icon",t]})),x.default?o.push((0,_vue.h)("span",{class:"vxe-button--content"},x.default({}))):e&&o.push((0,_vue.h)("span",{class:"vxe-button--content"},(0,_utils.getFuncText)(e))),o};u={dispatchEvent(e,t,n){o(e,Object.assign({$button:y,$event:n},t))},focus(){return S.value.focus(),(0,_vue.nextTick)()},blur(){return S.value.blur(),(0,_vue.nextTick)()}},Object.assign(y,u),(0,_vue.onMounted)(()=>{"development"===process.env.NODE_ENV&&"text"===f.type&&(0,_log.warnLog)("vxe.error.delProp",["type=text","mode=text"]),_event.GlobalEvent.on(y,"mousewheel",e=>{var t=T.value;h.showPanel&&!(0,_dom.getEventTargetNode)(e,t).flag&&r()})}),(0,_vue.onUnmounted)(()=>{_event.GlobalEvent.off(y,"mousewheel")});return y.renderVN=()=>{var{className:e,popupClassName:t,transfer:n,title:o,type:a,destroyOnClose:i,name:u,disabled:s,loading:l}=f,{inited:r,showPanel:d}=h,v=N.value,c=P.value,p=q.value,m=k.value,_=O.value,b=g.value;return x.dropdowns?(0,_vue.h)("div",{ref:w,class:["vxe-button--dropdown",e?_xeUtils.default.isFunction(e)?e({$button:y}):e:"",{["size--"+b]:b,"is--active":d}]},[(0,_vue.h)("button",{ref:S,class:["vxe-button","type--"+c,{["size--"+b]:b,["theme--"+p]:p,"is--round":m,"is--circle":_,"is--disabled":s||l,"is--loading":l}],title:o,name:u,type:v?a:"button",disabled:s||l,onMouseenter:V,onMouseleave:B,onClick:z},U().concat([(0,_vue.h)("i",{class:"vxe-button--dropdown-arrow "+_iconStore.default.BUTTON_DROPDOWN})])),(0,_vue.h)(_vue.Teleport,{to:"body",disabled:!n||!r},[(0,_vue.h)("div",{ref:T,class:["vxe-button--dropdown-panel",t?_xeUtils.default.isFunction(t)?t({$button:y}):t:"",{["size--"+b]:b,"animat--leave":h.animatVisible,"animat--enter":d}],placement:h.panelPlacement,style:h.panelStyle},r?[(0,_vue.h)("div",{class:"vxe-button--dropdown-wrapper",onMousedown:D,onClick:E,onMouseenter:M,onMouseleave:C},i&&!d?[]:x.dropdowns({}))]:[])])]):(0,_vue.h)("button",{ref:S,class:["vxe-button","type--"+c,e?_xeUtils.default.isFunction(e)?e({$button:y}):e:"",{["size--"+b]:b,["theme--"+p]:p,"is--round":m,"is--circle":_,"is--disabled":s||l,"is--loading":l}],title:o,name:u,type:v?a:"button",disabled:s||l,onClick:z,onMouseenter:I,onMouseleave:$},U())},y},render(){return this.renderVN()}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./style.css')
|