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,233 @@
|
|
|
1
|
+
import { defineComponent, ref, h, reactive, PropType, VNode, provide, nextTick, onBeforeUnmount, onMounted, watch, createCommentVNode, computed } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
import { getOffsetPos } from '../../ui/src/dom'
|
|
4
|
+
import VxeAnchorLinkComponent from '../../anchor-link/src/anchor-link'
|
|
5
|
+
|
|
6
|
+
import { VxeAnchorPropTypes, AnchorReactData, AnchorPrivateRef, VxeAnchorPrivateComputed, VxeAnchorConstructor, VxeAnchorPrivateMethods, AnchorMethods, AnchorPrivateMethods } from '../../../types'
|
|
7
|
+
|
|
8
|
+
export default defineComponent({
|
|
9
|
+
name: 'VxeAnchor',
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: String as PropType<VxeAnchorPropTypes.ModelValue>,
|
|
12
|
+
options: Array as PropType<VxeAnchorPropTypes.Options>,
|
|
13
|
+
container: [String, Object, Function] as PropType<VxeAnchorPropTypes.Options>,
|
|
14
|
+
showMarker: {
|
|
15
|
+
type: Boolean as PropType<VxeAnchorPropTypes.ShowMarker>,
|
|
16
|
+
default: true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
emits: [
|
|
20
|
+
'update:modelValue',
|
|
21
|
+
'change',
|
|
22
|
+
'click'
|
|
23
|
+
],
|
|
24
|
+
setup (props, context) {
|
|
25
|
+
const { slots, emit } = context
|
|
26
|
+
|
|
27
|
+
const xID = XEUtils.uniqueId()
|
|
28
|
+
|
|
29
|
+
const refElem = ref<HTMLDivElement>()
|
|
30
|
+
const refMarkerElem = ref<HTMLDivElement>()
|
|
31
|
+
|
|
32
|
+
const reactData = reactive<AnchorReactData>({
|
|
33
|
+
activeHref: null,
|
|
34
|
+
staticLinks: []
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const refMaps: AnchorPrivateRef = {
|
|
38
|
+
refElem
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const computeAllHrefList = computed(() => {
|
|
42
|
+
const list: VxeAnchorPropTypes.ModelValue[] = []
|
|
43
|
+
XEUtils.eachTree(reactData.staticLinks, item => {
|
|
44
|
+
list.push(item.href)
|
|
45
|
+
}, { children: 'children' })
|
|
46
|
+
return list
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
const computeMaps: VxeAnchorPrivateComputed = {
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let containerElem: HTMLElement | null = null
|
|
53
|
+
|
|
54
|
+
const $xeAnchor = {
|
|
55
|
+
xID,
|
|
56
|
+
props,
|
|
57
|
+
context,
|
|
58
|
+
reactData,
|
|
59
|
+
|
|
60
|
+
getRefMaps: () => refMaps,
|
|
61
|
+
getComputeMaps: () => computeMaps
|
|
62
|
+
} as unknown as VxeAnchorConstructor & VxeAnchorPrivateMethods
|
|
63
|
+
|
|
64
|
+
const anchorMethods: AnchorMethods = {
|
|
65
|
+
dispatchEvent (type, params, evnt) {
|
|
66
|
+
emit(type, Object.assign({ $xeAnchor, $event: evnt }, params))
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const getContainerElem = () => {
|
|
71
|
+
const { container } = props
|
|
72
|
+
if (container) {
|
|
73
|
+
if (XEUtils.isElement(container)) {
|
|
74
|
+
return container
|
|
75
|
+
}
|
|
76
|
+
if (XEUtils.isString(container)) {
|
|
77
|
+
return document.querySelector(container)
|
|
78
|
+
}
|
|
79
|
+
if (XEUtils.isFunction(container)) {
|
|
80
|
+
return container({ $xeAnchor })
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return null
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const emitEvent = (value?: VxeAnchorPropTypes.ModelValue) => {
|
|
87
|
+
reactData.activeHref = value
|
|
88
|
+
emit('update:modelValue', value)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const handleContainerScrollEvent = () => {
|
|
92
|
+
const allHrefList = computeAllHrefList.value
|
|
93
|
+
if (containerElem) {
|
|
94
|
+
const wrapperElList = containerElem.querySelectorAll(allHrefList.map(href => `${href}`).join(','))
|
|
95
|
+
for (let i = 0; i < wrapperElList.length; i++) {
|
|
96
|
+
const wrapperEl = wrapperElList[i]
|
|
97
|
+
const wrapperRect = wrapperEl.getBoundingClientRect()
|
|
98
|
+
if (wrapperRect.top > 0) {
|
|
99
|
+
const href = wrapperEl.id
|
|
100
|
+
reactData.activeHref = `#${href}`
|
|
101
|
+
break
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const removeContainerElemScroll = () => {
|
|
108
|
+
if (containerElem) {
|
|
109
|
+
containerElem.removeEventListener('scroll', handleContainerScrollEvent)
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const updateContainerElem = () => {
|
|
114
|
+
containerElem = getContainerElem()
|
|
115
|
+
if (containerElem) {
|
|
116
|
+
containerElem.addEventListener('scroll', handleContainerScrollEvent, {
|
|
117
|
+
passive: false
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const updateMarkerPos = () => {
|
|
123
|
+
nextTick(() => {
|
|
124
|
+
const { activeHref } = reactData
|
|
125
|
+
const elem = refElem.value
|
|
126
|
+
const markerEl = refMarkerElem.value
|
|
127
|
+
if (elem && markerEl) {
|
|
128
|
+
if (activeHref) {
|
|
129
|
+
const linkEl = elem.querySelector(`[href="${activeHref}"]`)
|
|
130
|
+
if (linkEl) {
|
|
131
|
+
const { top } = getOffsetPos(linkEl, elem)
|
|
132
|
+
markerEl.style.top = `${top}px`
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const anchorPrivateMethods: AnchorPrivateMethods = {
|
|
140
|
+
handleClickLink (evnt, href) {
|
|
141
|
+
evnt.preventDefault()
|
|
142
|
+
const targetEl = document.getElementById(`${href}`.replace('#', ''))
|
|
143
|
+
if (targetEl) {
|
|
144
|
+
targetEl.scrollIntoView({
|
|
145
|
+
behavior: 'smooth'
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
emitEvent(href)
|
|
149
|
+
anchorMethods.dispatchEvent('click', { href }, evnt)
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
Object.assign($xeAnchor, anchorMethods, anchorPrivateMethods)
|
|
154
|
+
|
|
155
|
+
watch(() => props.modelValue, (val) => {
|
|
156
|
+
reactData.activeHref = val
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
watch(() => reactData.activeHref, () => {
|
|
160
|
+
updateMarkerPos()
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
watch(() => props.container, () => {
|
|
164
|
+
removeContainerElemScroll()
|
|
165
|
+
updateContainerElem()
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
onMounted(() => {
|
|
169
|
+
nextTick(() => {
|
|
170
|
+
updateContainerElem()
|
|
171
|
+
})
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
onBeforeUnmount(() => {
|
|
175
|
+
removeContainerElemScroll()
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
const renderSubItems = (options?: VxeAnchorPropTypes.Options) => {
|
|
179
|
+
const itemVNs: VNode[] = []
|
|
180
|
+
if (options) {
|
|
181
|
+
options.forEach(item => {
|
|
182
|
+
const subItems = item.children
|
|
183
|
+
if (subItems && subItems.length) {
|
|
184
|
+
itemVNs.push(h(VxeAnchorLinkComponent, {
|
|
185
|
+
content: item.content,
|
|
186
|
+
title: item.title,
|
|
187
|
+
href: item.href
|
|
188
|
+
}, {
|
|
189
|
+
sub: () => renderSubItems(subItems)
|
|
190
|
+
}))
|
|
191
|
+
} else {
|
|
192
|
+
itemVNs.push(h(VxeAnchorLinkComponent, {
|
|
193
|
+
content: item.content,
|
|
194
|
+
title: item.title,
|
|
195
|
+
href: item.href
|
|
196
|
+
}))
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
}
|
|
200
|
+
return itemVNs
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const renderVN = () => {
|
|
204
|
+
const { options, showMarker } = props
|
|
205
|
+
const defaultSlot = slots.default
|
|
206
|
+
return h('div', {
|
|
207
|
+
ref: refElem,
|
|
208
|
+
class: ['vxe-anchor', {
|
|
209
|
+
'is--marker': showMarker
|
|
210
|
+
}]
|
|
211
|
+
}, [
|
|
212
|
+
h('div', {
|
|
213
|
+
class: 'vxe-anchor--list'
|
|
214
|
+
}, defaultSlot ? defaultSlot({}) : renderSubItems(options)),
|
|
215
|
+
showMarker
|
|
216
|
+
? h('div', {
|
|
217
|
+
ref: refMarkerElem,
|
|
218
|
+
class: 'vxe-anchor--marker'
|
|
219
|
+
})
|
|
220
|
+
: createCommentVNode()
|
|
221
|
+
])
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
$xeAnchor.renderVN = renderVN
|
|
225
|
+
|
|
226
|
+
provide('$xeAnchor', $xeAnchor)
|
|
227
|
+
|
|
228
|
+
return $xeAnchor
|
|
229
|
+
},
|
|
230
|
+
render () {
|
|
231
|
+
return this.renderVN()
|
|
232
|
+
}
|
|
233
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import VxeAnchorLinkComponent from './src/anchor-link'
|
|
3
|
+
|
|
4
|
+
const VxeAnchorLink = Object.assign({}, VxeAnchorLinkComponent, {
|
|
5
|
+
install (app: App) {
|
|
6
|
+
app.component(VxeAnchorLinkComponent.name as string, VxeAnchorLinkComponent)
|
|
7
|
+
}
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export const AnchorLink = VxeAnchorLink
|
|
11
|
+
export default VxeAnchorLink
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { defineComponent, ref, h, computed, reactive, PropType, inject, createCommentVNode, onMounted, onUnmounted, provide, watch } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
import { assemAnchorLink, destroyAnchorLink } from './util'
|
|
4
|
+
|
|
5
|
+
import { VxeAnchorLinkDefines, VxeAnchorLinkPropTypes, AnchorLinkReactData, AnchorLinkPrivateRef, VxeAnchorLinkPrivateComputed, VxeAnchorLinkConstructor, VxeAnchorLinkPrivateMethods, VxeAnchorConstructor, VxeAnchorPrivateMethods } from '../../../types'
|
|
6
|
+
|
|
7
|
+
export default defineComponent({
|
|
8
|
+
name: 'VxeAnchorLink',
|
|
9
|
+
props: {
|
|
10
|
+
content: [String, Number] as PropType<VxeAnchorLinkPropTypes.Content>,
|
|
11
|
+
title: [String, Number] as PropType<VxeAnchorLinkPropTypes.Title>,
|
|
12
|
+
href: String as PropType<VxeAnchorLinkPropTypes.Href>
|
|
13
|
+
},
|
|
14
|
+
emits: [],
|
|
15
|
+
setup (props, context) {
|
|
16
|
+
const { slots } = context
|
|
17
|
+
|
|
18
|
+
const xID = XEUtils.uniqueId()
|
|
19
|
+
|
|
20
|
+
const refElem = ref<HTMLDivElement>()
|
|
21
|
+
|
|
22
|
+
const reactData = reactive<AnchorLinkReactData>({
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const linkConfig = reactive<VxeAnchorLinkDefines.LinkConfig>({
|
|
26
|
+
id: xID,
|
|
27
|
+
href: props.href,
|
|
28
|
+
children: []
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const $xeAnchor = inject<(VxeAnchorConstructor & VxeAnchorPrivateMethods) | null>('$xeAnchor', null)
|
|
32
|
+
const $xeParentAnchorLink = inject<(VxeAnchorLinkConstructor & VxeAnchorLinkPrivateMethods) | null>('$xeAnchorLink', null)
|
|
33
|
+
|
|
34
|
+
const refMaps: AnchorLinkPrivateRef = {
|
|
35
|
+
refElem
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const computeIsActive = computed(() => {
|
|
39
|
+
const { href } = props
|
|
40
|
+
if ($xeAnchor) {
|
|
41
|
+
return $xeAnchor.reactData.activeHref === href
|
|
42
|
+
}
|
|
43
|
+
return null
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const computeMaps: VxeAnchorLinkPrivateComputed = {
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const $xeAnchorLink = {
|
|
50
|
+
xID,
|
|
51
|
+
props,
|
|
52
|
+
context,
|
|
53
|
+
reactData,
|
|
54
|
+
linkConfig,
|
|
55
|
+
|
|
56
|
+
getRefMaps: () => refMaps,
|
|
57
|
+
getComputeMaps: () => computeMaps
|
|
58
|
+
} as unknown as VxeAnchorLinkConstructor & VxeAnchorLinkPrivateMethods
|
|
59
|
+
|
|
60
|
+
const clickEvent = (event: KeyboardEvent) => {
|
|
61
|
+
const { href } = props
|
|
62
|
+
if ($xeAnchor) {
|
|
63
|
+
$xeAnchor.handleClickLink(event, href)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
watch(() => props.href, (val) => {
|
|
68
|
+
linkConfig.href = val
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
onMounted(() => {
|
|
72
|
+
if ($xeAnchor && refElem.value) {
|
|
73
|
+
assemAnchorLink($xeAnchor, refElem.value, linkConfig, $xeParentAnchorLink)
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
onUnmounted(() => {
|
|
78
|
+
if ($xeAnchor) {
|
|
79
|
+
destroyAnchorLink($xeAnchor, linkConfig)
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
const renderVN = () => {
|
|
84
|
+
const { href, content, title } = props
|
|
85
|
+
const defaultSlot = slots.default
|
|
86
|
+
const subSlot = slots.sub
|
|
87
|
+
const isActive = computeIsActive.value
|
|
88
|
+
|
|
89
|
+
return h('div', {
|
|
90
|
+
ref: refElem,
|
|
91
|
+
class: ['vxe-anchor-link', {
|
|
92
|
+
'is--active': isActive
|
|
93
|
+
}]
|
|
94
|
+
}, [
|
|
95
|
+
h('a', {
|
|
96
|
+
class: 'vxe-anchor-link--item',
|
|
97
|
+
href,
|
|
98
|
+
title,
|
|
99
|
+
onClick: clickEvent
|
|
100
|
+
}, defaultSlot ? defaultSlot({}) : (XEUtils.toValueString(content))),
|
|
101
|
+
subSlot
|
|
102
|
+
? h('div', {
|
|
103
|
+
class: 'vxe-anchor-link--sub-items'
|
|
104
|
+
}, subSlot({}))
|
|
105
|
+
: createCommentVNode()
|
|
106
|
+
])
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
$xeAnchorLink.renderVN = renderVN
|
|
110
|
+
|
|
111
|
+
provide('$xeAnchorLink', $xeAnchorLink)
|
|
112
|
+
|
|
113
|
+
return $xeAnchorLink
|
|
114
|
+
},
|
|
115
|
+
render () {
|
|
116
|
+
return this.renderVN()
|
|
117
|
+
}
|
|
118
|
+
})
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import XEUtils from 'xe-utils'
|
|
2
|
+
|
|
3
|
+
import { VxeAnchorLinkDefines, VxeAnchorConstructor, VxeAnchorPrivateMethods, VxeAnchorLinkConstructor, VxeAnchorLinkPrivateMethods } from '../../../types'
|
|
4
|
+
|
|
5
|
+
export function assemAnchorLink ($xeAnchor: VxeAnchorConstructor & VxeAnchorPrivateMethods, elem: HTMLElement, linkConfig: VxeAnchorLinkDefines.LinkConfig, $xeParentAnchorLink: (VxeAnchorLinkConstructor & VxeAnchorLinkPrivateMethods) | null) {
|
|
6
|
+
const staticLinks = $xeAnchor.reactData.staticLinks
|
|
7
|
+
const parentElem = elem.parentNode
|
|
8
|
+
const parentLinkConfig = $xeParentAnchorLink ? $xeParentAnchorLink.linkConfig : null
|
|
9
|
+
const parentLinks = parentLinkConfig ? parentLinkConfig.children : staticLinks
|
|
10
|
+
if (parentElem && parentLinks) {
|
|
11
|
+
parentLinks.splice(XEUtils.arrayIndexOf(parentElem.children, elem), 0, linkConfig)
|
|
12
|
+
$xeAnchor.reactData.staticLinks = staticLinks.slice(0)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function destroyAnchorLink ($xeAnchor: VxeAnchorConstructor & VxeAnchorPrivateMethods, linkConfig: VxeAnchorLinkDefines.LinkConfig) {
|
|
17
|
+
const staticLinks = $xeAnchor.reactData.staticLinks
|
|
18
|
+
const matchObj = XEUtils.findTree(staticLinks, item => item.id === linkConfig.id, { children: 'children' })
|
|
19
|
+
if (matchObj) {
|
|
20
|
+
matchObj.items.splice(matchObj.index, 1)
|
|
21
|
+
}
|
|
22
|
+
$xeAnchor.reactData.staticLinks = staticLinks.slice(0)
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import VxeBreadcrumbComponent from './src/breadcrumb'
|
|
3
|
+
|
|
4
|
+
const VxeBreadcrumb = Object.assign({}, VxeBreadcrumbComponent, {
|
|
5
|
+
install (app: App) {
|
|
6
|
+
app.component(VxeBreadcrumbComponent.name as string, VxeBreadcrumbComponent)
|
|
7
|
+
}
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export const Breadcrumb = VxeBreadcrumb
|
|
11
|
+
export default VxeBreadcrumb
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defineComponent, ref, h, reactive, provide, PropType } from 'vue'
|
|
2
|
+
import VxeUI from '../../ui'
|
|
3
|
+
import XEUtils from 'xe-utils'
|
|
4
|
+
|
|
5
|
+
import { VxeBreadcrumbPropTypes, BreadcrumbReactData, BreadcrumbPrivateRef, VxeBreadcrumbPrivateComputed, VxeBreadcrumbConstructor, VxeBreadcrumbPrivateMethods } from '../../../types'
|
|
6
|
+
|
|
7
|
+
export default defineComponent({
|
|
8
|
+
name: 'VxeBreadcrumb',
|
|
9
|
+
props: {
|
|
10
|
+
separator: {
|
|
11
|
+
type: String as PropType<VxeBreadcrumbPropTypes.Separator>,
|
|
12
|
+
default: () => VxeUI.getConfig('breadcrumb.separator')
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
emits: [],
|
|
16
|
+
setup (props, context) {
|
|
17
|
+
const { slots } = context
|
|
18
|
+
|
|
19
|
+
const xID = XEUtils.uniqueId()
|
|
20
|
+
|
|
21
|
+
const refElem = ref<HTMLDivElement>()
|
|
22
|
+
|
|
23
|
+
const reactData = reactive<BreadcrumbReactData>({
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const refMaps: BreadcrumbPrivateRef = {
|
|
27
|
+
refElem
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const computeMaps: VxeBreadcrumbPrivateComputed = {
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const $xeBreadcrumb = {
|
|
34
|
+
xID,
|
|
35
|
+
props,
|
|
36
|
+
context,
|
|
37
|
+
reactData,
|
|
38
|
+
|
|
39
|
+
getRefMaps: () => refMaps,
|
|
40
|
+
getComputeMaps: () => computeMaps
|
|
41
|
+
} as unknown as VxeBreadcrumbConstructor & VxeBreadcrumbPrivateMethods
|
|
42
|
+
|
|
43
|
+
const renderVN = () => {
|
|
44
|
+
const defaultSlot = slots.default
|
|
45
|
+
return h('div', {
|
|
46
|
+
ref: refElem,
|
|
47
|
+
class: 'vxe-breadcrumb'
|
|
48
|
+
}, defaultSlot ? defaultSlot({}) : [])
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
$xeBreadcrumb.renderVN = renderVN
|
|
52
|
+
|
|
53
|
+
provide('$xeBreadcrumb', $xeBreadcrumb)
|
|
54
|
+
|
|
55
|
+
return $xeBreadcrumb
|
|
56
|
+
},
|
|
57
|
+
render () {
|
|
58
|
+
return this.renderVN()
|
|
59
|
+
}
|
|
60
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import VxeBreadcrumbItemComponent from './src/breadcrumb-item'
|
|
3
|
+
|
|
4
|
+
const VxeBreadcrumbItem = Object.assign({}, VxeBreadcrumbItemComponent, {
|
|
5
|
+
install (app: App) {
|
|
6
|
+
app.component(VxeBreadcrumbItemComponent.name as string, VxeBreadcrumbItemComponent)
|
|
7
|
+
}
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export const BreadcrumbItem = VxeBreadcrumbItem
|
|
11
|
+
export default VxeBreadcrumbItem
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineComponent, ref, h, reactive, computed, inject, createCommentVNode } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
|
|
4
|
+
import { BreadcrumbItemReactData, BreadcrumbItemPrivateRef, VxeBreadcrumbItemPrivateComputed, VxeBreadcrumbItemConstructor, VxeBreadcrumbItemPrivateMethods, VxeBreadcrumbConstructor, VxeBreadcrumbPrivateMethods } from '../../../types'
|
|
5
|
+
|
|
6
|
+
export default defineComponent({
|
|
7
|
+
name: 'VxeBreadcrumbItem',
|
|
8
|
+
props: {},
|
|
9
|
+
emits: [],
|
|
10
|
+
setup (props, context) {
|
|
11
|
+
const { slots } = context
|
|
12
|
+
|
|
13
|
+
const xID = XEUtils.uniqueId()
|
|
14
|
+
|
|
15
|
+
const refElem = ref<HTMLDivElement>()
|
|
16
|
+
|
|
17
|
+
const $xeBreadcrumb = inject<(VxeBreadcrumbConstructor & VxeBreadcrumbPrivateMethods) | null>('$xeBreadcrumb', null)
|
|
18
|
+
|
|
19
|
+
const reactData = reactive<BreadcrumbItemReactData>({
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const refMaps: BreadcrumbItemPrivateRef = {
|
|
23
|
+
refElem
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const computeSeparator = computed(() => {
|
|
27
|
+
if ($xeBreadcrumb) {
|
|
28
|
+
return $xeBreadcrumb.props.separator
|
|
29
|
+
}
|
|
30
|
+
return ''
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const computeMaps: VxeBreadcrumbItemPrivateComputed = {
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const $xeBreadcrumbItem = {
|
|
37
|
+
xID,
|
|
38
|
+
props,
|
|
39
|
+
context,
|
|
40
|
+
reactData,
|
|
41
|
+
|
|
42
|
+
getRefMaps: () => refMaps,
|
|
43
|
+
getComputeMaps: () => computeMaps
|
|
44
|
+
} as unknown as VxeBreadcrumbItemConstructor & VxeBreadcrumbItemPrivateMethods
|
|
45
|
+
|
|
46
|
+
const renderVN = () => {
|
|
47
|
+
const separator = computeSeparator.value
|
|
48
|
+
const defaultSlot = slots.default
|
|
49
|
+
return h('span', {
|
|
50
|
+
ref: refElem,
|
|
51
|
+
class: 'vxe-breadcrumb-item'
|
|
52
|
+
}, [
|
|
53
|
+
h('span', {
|
|
54
|
+
class: 'vxe-breadcrumb-item--content'
|
|
55
|
+
}, defaultSlot ? defaultSlot({}) : []),
|
|
56
|
+
separator
|
|
57
|
+
? h('span', {
|
|
58
|
+
class: 'vxe-breadcrumb-item--separator'
|
|
59
|
+
}, `${separator}`)
|
|
60
|
+
: createCommentVNode()
|
|
61
|
+
])
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
$xeBreadcrumbItem.renderVN = renderVN
|
|
65
|
+
|
|
66
|
+
return $xeBreadcrumbItem
|
|
67
|
+
},
|
|
68
|
+
render () {
|
|
69
|
+
return this.renderVN()
|
|
70
|
+
}
|
|
71
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import VxeButtonComponent from './src/button'
|
|
3
|
+
|
|
4
|
+
const VxeButton = Object.assign({}, VxeButtonComponent, {
|
|
5
|
+
install (app: App) {
|
|
6
|
+
app.component(VxeButtonComponent.name as string, VxeButtonComponent)
|
|
7
|
+
}
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export const Button = VxeButton
|
|
11
|
+
export default VxeButton
|