@wot-ui/ui 1.0.0 → 2.0.0-alpha.4
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 +134 -0
- package/attributes.json +1 -0
- package/changelog.md +63 -0
- package/common/AbortablePromise.ts +28 -0
- package/common/canvasHelper.ts +49 -0
- package/common/clickoutside.ts +25 -0
- package/common/event.ts +8 -0
- package/common/formatDate.ts +68 -0
- package/common/interceptor.ts +43 -0
- package/common/props.ts +53 -0
- package/common/util.ts +836 -0
- package/components/wd-action-sheet/index.scss +232 -0
- package/components/wd-action-sheet/types.ts +155 -0
- package/components/wd-action-sheet/wd-action-sheet.vue +176 -0
- package/components/wd-avatar/index.scss +150 -0
- package/components/wd-avatar/types.ts +98 -0
- package/components/wd-avatar/wd-avatar.vue +184 -0
- package/components/wd-avatar-group/index.scss +11 -0
- package/components/wd-avatar-group/types.ts +61 -0
- package/components/wd-avatar-group/wd-avatar-group.vue +115 -0
- package/components/wd-backtop/index.scss +67 -0
- package/components/wd-backtop/types.ts +66 -0
- package/components/wd-backtop/wd-backtop.vue +57 -0
- package/components/wd-badge/index.scss +116 -0
- package/components/wd-badge/types.ts +94 -0
- package/components/wd-badge/wd-badge.vue +78 -0
- package/components/wd-button/index.scss +436 -0
- package/components/wd-button/types.ts +204 -0
- package/components/wd-button/wd-button.vue +210 -0
- package/components/wd-calendar/index.scss +97 -0
- package/components/wd-calendar/types.ts +221 -0
- package/components/wd-calendar/wd-calendar.vue +339 -0
- package/components/wd-calendar-view/index.scss +41 -0
- package/components/wd-calendar-view/month/index.scss +144 -0
- package/components/wd-calendar-view/month/month.vue +389 -0
- package/components/wd-calendar-view/month/types.ts +70 -0
- package/components/wd-calendar-view/monthPanel/index.scss +84 -0
- package/components/wd-calendar-view/monthPanel/month-panel.vue +541 -0
- package/components/wd-calendar-view/monthPanel/types.ts +151 -0
- package/components/wd-calendar-view/types.ts +166 -0
- package/components/wd-calendar-view/utils.ts +318 -0
- package/components/wd-calendar-view/wd-calendar-view.vue +117 -0
- package/components/wd-calendar-view/year/index.scss +148 -0
- package/components/wd-calendar-view/year/types.ts +74 -0
- package/components/wd-calendar-view/year/year.vue +206 -0
- package/components/wd-calendar-view/yearPanel/index.scss +42 -0
- package/components/wd-calendar-view/yearPanel/types.ts +96 -0
- package/components/wd-calendar-view/yearPanel/year-panel.vue +249 -0
- package/components/wd-card/index.scss +104 -0
- package/components/wd-card/types.ts +47 -0
- package/components/wd-card/wd-card.vue +38 -0
- package/components/wd-cascader/index.scss +154 -0
- package/components/wd-cascader/types.ts +191 -0
- package/components/wd-cascader/wd-cascader.vue +589 -0
- package/components/wd-cell/index.scss +244 -0
- package/components/wd-cell/types.ts +205 -0
- package/components/wd-cell/wd-cell.vue +172 -0
- package/components/wd-cell-group/index.scss +53 -0
- package/components/wd-cell-group/types.ts +97 -0
- package/components/wd-cell-group/wd-cell-group.vue +48 -0
- package/components/wd-checkbox/index.scss +166 -0
- package/components/wd-checkbox/types.ts +118 -0
- package/components/wd-checkbox/wd-checkbox.vue +216 -0
- package/components/wd-checkbox-group/index.scss +5 -0
- package/components/wd-checkbox-group/types.ts +93 -0
- package/components/wd-checkbox-group/wd-checkbox-group.vue +148 -0
- package/components/wd-circle/index.scss +28 -0
- package/components/wd-circle/types.ts +54 -0
- package/components/wd-circle/wd-circle.vue +306 -0
- package/components/wd-col/index.scss +5 -0
- package/components/wd-col/types.ts +16 -0
- package/components/wd-col/wd-col.vue +83 -0
- package/components/wd-collapse/index.scss +71 -0
- package/components/wd-collapse/types.ts +68 -0
- package/components/wd-collapse/wd-collapse.vue +165 -0
- package/components/wd-collapse-item/index.scss +86 -0
- package/components/wd-collapse-item/types.ts +62 -0
- package/components/wd-collapse-item/wd-collapse-item.vue +184 -0
- package/components/wd-config-provider/index.scss +10 -0
- package/components/wd-config-provider/types.ts +2061 -0
- package/components/wd-config-provider/wd-config-provider.vue +61 -0
- package/components/wd-count-down/index.scss +16 -0
- package/components/wd-count-down/types.ts +58 -0
- package/components/wd-count-down/utils.ts +52 -0
- package/components/wd-count-down/wd-count-down.vue +62 -0
- package/components/wd-count-to/index.scss +25 -0
- package/components/wd-count-to/types.ts +121 -0
- package/components/wd-count-to/wd-count-to.vue +126 -0
- package/components/wd-curtain/index.scss +96 -0
- package/components/wd-curtain/types.ts +82 -0
- package/components/wd-curtain/wd-curtain.vue +172 -0
- package/components/wd-datetime-picker/index.scss +133 -0
- package/components/wd-datetime-picker/types.ts +198 -0
- package/components/wd-datetime-picker/wd-datetime-picker.vue +526 -0
- package/components/wd-datetime-picker-view/types.ts +171 -0
- package/components/wd-datetime-picker-view/util.ts +30 -0
- package/components/wd-datetime-picker-view/wd-datetime-picker-view.vue +402 -0
- package/components/wd-dialog/index.scss +281 -0
- package/components/wd-dialog/index.ts +168 -0
- package/components/wd-dialog/types.ts +452 -0
- package/components/wd-dialog/wd-dialog.vue +586 -0
- package/components/wd-divider/index.scss +122 -0
- package/components/wd-divider/types.ts +50 -0
- package/components/wd-divider/wd-divider.vue +54 -0
- package/components/wd-drop-menu/index.scss +90 -0
- package/components/wd-drop-menu/types.ts +38 -0
- package/components/wd-drop-menu/wd-drop-menu.vue +168 -0
- package/components/wd-drop-menu-item/index.scss +96 -0
- package/components/wd-drop-menu-item/types.ts +93 -0
- package/components/wd-drop-menu-item/wd-drop-menu-item.vue +205 -0
- package/components/wd-empty/index.scss +46 -0
- package/components/wd-empty/types.ts +37 -0
- package/components/wd-empty/wd-empty.vue +47 -0
- package/components/wd-fab/index.scss +124 -0
- package/components/wd-fab/types.ts +119 -0
- package/components/wd-fab/wd-fab.vue +322 -0
- package/components/wd-floating-panel/index.scss +73 -0
- package/components/wd-floating-panel/type.ts +32 -0
- package/components/wd-floating-panel/wd-floating-panel.vue +142 -0
- package/components/wd-form/adapters/zod.ts +56 -0
- package/components/wd-form/index.ts +2 -0
- package/components/wd-form/types.ts +133 -0
- package/components/wd-form/wd-form.vue +121 -0
- package/components/wd-form-item/index.scss +26 -0
- package/components/wd-form-item/types.ts +134 -0
- package/components/wd-form-item/wd-form-item.vue +182 -0
- package/components/wd-gap/index.scss +9 -0
- package/components/wd-gap/types.ts +26 -0
- package/components/wd-gap/wd-gap.vue +38 -0
- package/components/wd-grid/index.scss +11 -0
- package/components/wd-grid/types.ts +97 -0
- package/components/wd-grid/wd-grid.vue +48 -0
- package/components/wd-grid-item/index.scss +187 -0
- package/components/wd-grid-item/types.ts +98 -0
- package/components/wd-grid-item/wd-grid-item.vue +295 -0
- package/components/wd-icon/index.scss +46 -0
- package/components/wd-icon/types.ts +44 -0
- package/components/wd-icon/wd-icon.vue +66 -0
- package/components/wd-image-preview/index.scss +94 -0
- package/components/wd-image-preview/index.ts +95 -0
- package/components/wd-image-preview/types.ts +165 -0
- package/components/wd-image-preview/wd-image-preview.vue +233 -0
- package/components/wd-img/index.scss +82 -0
- package/components/wd-img/types.ts +96 -0
- package/components/wd-img/wd-img.vue +91 -0
- package/components/wd-img-cropper/index.scss +259 -0
- package/components/wd-img-cropper/types.ts +101 -0
- package/components/wd-img-cropper/wd-img-cropper.vue +653 -0
- package/components/wd-index-anchor/index.scss +34 -0
- package/components/wd-index-anchor/type.ts +9 -0
- package/components/wd-index-anchor/wd-index-anchor.vue +55 -0
- package/components/wd-index-bar/index.scss +68 -0
- package/components/wd-index-bar/type.ts +23 -0
- package/components/wd-index-bar/wd-index-bar.vue +157 -0
- package/components/wd-input/index.scss +129 -0
- package/components/wd-input/types.ts +165 -0
- package/components/wd-input/wd-input.vue +237 -0
- package/components/wd-input-number/index.scss +233 -0
- package/components/wd-input-number/types.ts +131 -0
- package/components/wd-input-number/wd-input-number.vue +473 -0
- package/components/wd-keyboard/constants.ts +81 -0
- package/components/wd-keyboard/index.scss +104 -0
- package/components/wd-keyboard/key/index.scss +103 -0
- package/components/wd-keyboard/key/index.vue +84 -0
- package/components/wd-keyboard/key/types.ts +44 -0
- package/components/wd-keyboard/types.ts +138 -0
- package/components/wd-keyboard/wd-keyboard.vue +236 -0
- package/components/wd-loading/index.scss +205 -0
- package/components/wd-loading/types.ts +61 -0
- package/components/wd-loading/wd-loading.vue +70 -0
- package/components/wd-loadmore/index.scss +62 -0
- package/components/wd-loadmore/types.ts +42 -0
- package/components/wd-loadmore/wd-loadmore.vue +68 -0
- package/components/wd-navbar/index.scss +96 -0
- package/components/wd-navbar/types.ts +74 -0
- package/components/wd-navbar/wd-navbar.vue +136 -0
- package/components/wd-navbar-capsule/index.scss +70 -0
- package/components/wd-navbar-capsule/types.ts +11 -0
- package/components/wd-navbar-capsule/wd-navbar-capsule.vue +48 -0
- package/components/wd-notice-bar/index.scss +94 -0
- package/components/wd-notice-bar/types.ts +97 -0
- package/components/wd-notice-bar/wd-notice-bar.vue +270 -0
- package/components/wd-notify/index.scss +114 -0
- package/components/wd-notify/index.ts +63 -0
- package/components/wd-notify/types.ts +130 -0
- package/components/wd-notify/wd-notify.vue +162 -0
- package/components/wd-overlay/index.scss +14 -0
- package/components/wd-overlay/types.ts +42 -0
- package/components/wd-overlay/wd-overlay.vue +55 -0
- package/components/wd-pagination/index.scss +71 -0
- package/components/wd-pagination/types.ts +69 -0
- package/components/wd-pagination/wd-pagination.vue +118 -0
- package/components/wd-password-input/index.scss +134 -0
- package/components/wd-password-input/types.ts +42 -0
- package/components/wd-password-input/wd-password-input.vue +51 -0
- package/components/wd-picker/index.scss +72 -0
- package/components/wd-picker/types.ts +141 -0
- package/components/wd-picker/wd-picker.vue +220 -0
- package/components/wd-picker-view/index.scss +93 -0
- package/components/wd-picker-view/types.ts +145 -0
- package/components/wd-picker-view/useSelection.ts +385 -0
- package/components/wd-picker-view/wd-picker-view.vue +227 -0
- package/components/wd-popover/index.scss +117 -0
- package/components/wd-popover/types.ts +106 -0
- package/components/wd-popover/wd-popover.vue +212 -0
- package/components/wd-popup/index.scss +89 -0
- package/components/wd-popup/types.ts +110 -0
- package/components/wd-popup/wd-popup.vue +174 -0
- package/components/wd-progress/index.scss +155 -0
- package/components/wd-progress/types.ts +94 -0
- package/components/wd-progress/wd-progress.vue +249 -0
- package/components/wd-radio/index.scss +189 -0
- package/components/wd-radio/types.ts +64 -0
- package/components/wd-radio/wd-radio.vue +164 -0
- package/components/wd-radio-group/index.scss +5 -0
- package/components/wd-radio-group/types.ts +70 -0
- package/components/wd-radio-group/wd-radio-group.vue +53 -0
- package/components/wd-rate/index.scss +57 -0
- package/components/wd-rate/types.ts +86 -0
- package/components/wd-rate/wd-rate.vue +168 -0
- package/components/wd-resize/index.scss +31 -0
- package/components/wd-resize/types.ts +14 -0
- package/components/wd-resize/wd-resize.vue +157 -0
- package/components/wd-root-portal/wd-root-portal.vue +77 -0
- package/components/wd-row/index.scss +6 -0
- package/components/wd-row/types.ts +36 -0
- package/components/wd-row/wd-row.vue +88 -0
- package/components/wd-search/index.scss +171 -0
- package/components/wd-search/types.ts +107 -0
- package/components/wd-search/wd-search.vue +198 -0
- package/components/wd-segmented/index.scss +155 -0
- package/components/wd-segmented/types.ts +81 -0
- package/components/wd-segmented/wd-segmented.vue +169 -0
- package/components/wd-select-picker/index.scss +72 -0
- package/components/wd-select-picker/types.ts +72 -0
- package/components/wd-select-picker/wd-select-picker.vue +371 -0
- package/components/wd-sidebar/index.scss +25 -0
- package/components/wd-sidebar/types.ts +34 -0
- package/components/wd-sidebar/wd-sidebar.vue +57 -0
- package/components/wd-sidebar-item/index.scss +91 -0
- package/components/wd-sidebar-item/types.ts +28 -0
- package/components/wd-sidebar-item/wd-sidebar-item.vue +118 -0
- package/components/wd-signature/index.scss +42 -0
- package/components/wd-signature/types.ts +295 -0
- package/components/wd-signature/wd-signature.vue +664 -0
- package/components/wd-skeleton/index.scss +112 -0
- package/components/wd-skeleton/types.ts +124 -0
- package/components/wd-skeleton/wd-skeleton.vue +110 -0
- package/components/wd-slide-verify/index.scss +112 -0
- package/components/wd-slide-verify/types.ts +98 -0
- package/components/wd-slide-verify/wd-slide-verify.vue +222 -0
- package/components/wd-slider/index.scss +485 -0
- package/components/wd-slider/types.ts +166 -0
- package/components/wd-slider/wd-slider.vue +529 -0
- package/components/wd-sort-button/index.scss +126 -0
- package/components/wd-sort-button/types.ts +68 -0
- package/components/wd-sort-button/wd-sort-button.vue +67 -0
- package/components/wd-step/index.scss +366 -0
- package/components/wd-step/types.ts +43 -0
- package/components/wd-step/wd-step.vue +181 -0
- package/components/wd-steps/index.scss +7 -0
- package/components/wd-steps/types.ts +50 -0
- package/components/wd-steps/wd-steps.vue +39 -0
- package/components/wd-sticky/index.scss +9 -0
- package/components/wd-sticky/types.ts +13 -0
- package/components/wd-sticky/wd-sticky.vue +192 -0
- package/components/wd-sticky-box/index.scss +6 -0
- package/components/wd-sticky-box/types.ts +20 -0
- package/components/wd-sticky-box/wd-sticky-box.vue +157 -0
- package/components/wd-swipe-action/index.scss +22 -0
- package/components/wd-swipe-action/types.ts +87 -0
- package/components/wd-swipe-action/wd-swipe-action.vue +320 -0
- package/components/wd-swiper/index.scss +69 -0
- package/components/wd-swiper/types.ts +275 -0
- package/components/wd-swiper/wd-swiper.vue +332 -0
- package/components/wd-swiper-nav/index.scss +179 -0
- package/components/wd-swiper-nav/types.ts +42 -0
- package/components/wd-swiper-nav/wd-swiper-nav.vue +42 -0
- package/components/wd-switch/index.scss +177 -0
- package/components/wd-switch/types.ts +93 -0
- package/components/wd-switch/wd-switch.vue +107 -0
- package/components/wd-tab/index.scss +16 -0
- package/components/wd-tab/types.ts +45 -0
- package/components/wd-tab/wd-tab.vue +99 -0
- package/components/wd-tabbar/index.scss +71 -0
- package/components/wd-tabbar/types.ts +79 -0
- package/components/wd-tabbar/wd-tabbar.vue +109 -0
- package/components/wd-tabbar-item/index.scss +50 -0
- package/components/wd-tabbar-item/types.ts +45 -0
- package/components/wd-tabbar-item/wd-tabbar-item.vue +101 -0
- package/components/wd-table/index.scss +128 -0
- package/components/wd-table/types.ts +160 -0
- package/components/wd-table/wd-table.vue +331 -0
- package/components/wd-table-column/index.scss +15 -0
- package/components/wd-table-column/types.ts +81 -0
- package/components/wd-table-column/wd-table-column.vue +198 -0
- package/components/wd-tabs/index.scss +332 -0
- package/components/wd-tabs/types.ts +155 -0
- package/components/wd-tabs/wd-tabs.vue +508 -0
- package/components/wd-tag/index.scss +325 -0
- package/components/wd-tag/types.ts +90 -0
- package/components/wd-tag/wd-tag.vue +158 -0
- package/components/wd-text/index.scss +52 -0
- package/components/wd-text/types.ts +107 -0
- package/components/wd-text/wd-text.vue +141 -0
- package/components/wd-textarea/index.scss +112 -0
- package/components/wd-textarea/types.ts +151 -0
- package/components/wd-textarea/wd-textarea.vue +212 -0
- package/components/wd-toast/index.scss +92 -0
- package/components/wd-toast/index.ts +97 -0
- package/components/wd-toast/types.ts +190 -0
- package/components/wd-toast/wd-toast.vue +158 -0
- package/components/wd-tooltip/index.scss +77 -0
- package/components/wd-tooltip/types.ts +105 -0
- package/components/wd-tooltip/wd-tooltip.vue +169 -0
- package/components/wd-tour/index.scss +106 -0
- package/components/wd-tour/types.ts +268 -0
- package/components/wd-tour/wd-tour.vue +518 -0
- package/components/wd-transition/index.scss +67 -0
- package/components/wd-transition/types.ts +106 -0
- package/components/wd-transition/wd-transition.vue +238 -0
- package/components/wd-upload/index.scss +204 -0
- package/components/wd-upload/types.ts +390 -0
- package/components/wd-upload/wd-upload.vue +565 -0
- package/components/wd-video-preview/index.scss +54 -0
- package/components/wd-video-preview/index.ts +64 -0
- package/components/wd-video-preview/types.ts +66 -0
- package/components/wd-video-preview/wd-video-preview.vue +141 -0
- package/components/wd-watermark/index.scss +21 -0
- package/components/wd-watermark/types.ts +130 -0
- package/components/wd-watermark/wd-watermark.vue +718 -0
- package/components/wot-ui/wot-ui.vue +5 -0
- package/composables/index.ts +16 -0
- package/composables/useCell.ts +34 -0
- package/composables/useChildren.ts +120 -0
- package/composables/useConfigProvider.ts +45 -0
- package/composables/useCountDown.ts +138 -0
- package/composables/useDeviceInfo.ts +136 -0
- package/composables/useLockScroll.ts +37 -0
- package/composables/useParent.ts +51 -0
- package/composables/usePopover.ts +212 -0
- package/composables/useQueue.ts +52 -0
- package/composables/useRaf.ts +37 -0
- package/composables/useTouch.ts +43 -0
- package/composables/useTranslate.ts +12 -0
- package/composables/useUpload.ts +366 -0
- package/global.d.ts +106 -0
- package/index.ts +6 -0
- package/locale/index.ts +32 -0
- package/locale/lang/ar-SA.ts +150 -0
- package/locale/lang/de-DE.ts +150 -0
- package/locale/lang/en-US.ts +150 -0
- package/locale/lang/es-ES.ts +150 -0
- package/locale/lang/fr-FR.ts +150 -0
- package/locale/lang/ja-JP.ts +150 -0
- package/locale/lang/ko-KR.ts +150 -0
- package/locale/lang/pt-PT.ts +150 -0
- package/locale/lang/ru-RU.ts +150 -0
- package/locale/lang/th-TH.ts +150 -0
- package/locale/lang/tr-TR.ts +155 -0
- package/locale/lang/ug-CN.ts +154 -0
- package/locale/lang/vi-VN.ts +89 -0
- package/locale/lang/zh-CN.ts +154 -0
- package/locale/lang/zh-HK.ts +78 -0
- package/locale/lang/zh-TW.ts +78 -0
- package/package.json +1 -11
- package/styles/iconfont/iconfont.scss +1243 -0
- package/styles/mixin/_config.scss +7 -0
- package/styles/mixin/_function.scss +44 -0
- package/styles/mixin/_mixin.scss +473 -0
- package/styles/theme/base/color.scss +210 -0
- package/styles/theme/base/font.scss +13 -0
- package/styles/theme/base/index.scss +8 -0
- package/styles/theme/base/insets.scss +32 -0
- package/styles/theme/base/number.scss +36 -0
- package/styles/theme/base/opacity.scss +9 -0
- package/styles/theme/base/radius.scss +13 -0
- package/styles/theme/base/stroke.scss +9 -0
- package/styles/theme/base/typography.scss +44 -0
- package/styles/theme/dark.scss +101 -0
- package/styles/theme/index.scss +16 -0
- package/styles/theme/light.scss +101 -0
- package/styles/variable.scss +472 -0
- package/tags.json +1 -0
- package/web-types.json +1 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view v-if="showWrapper" :class="`wd-drop-item ${customClass}`" :style="`z-index: ${zIndex}; ${positionStyle};${customStyle}`">
|
|
3
|
+
<wd-popup
|
|
4
|
+
v-model="showPop"
|
|
5
|
+
:z-index="zIndex"
|
|
6
|
+
:duration="duration"
|
|
7
|
+
:position="position"
|
|
8
|
+
:custom-style="`max-height: ${popupHeight ? popupHeight : '80%'}; ${customPopupStyle}`"
|
|
9
|
+
:custom-class="`${customPopupClass} wd-drop-item__popup`"
|
|
10
|
+
:modal="false"
|
|
11
|
+
:close-on-click-modal="false"
|
|
12
|
+
:root-portal="rootPortal"
|
|
13
|
+
@before-enter="beforeEnter"
|
|
14
|
+
@after-enter="afterEnter"
|
|
15
|
+
@before-leave="beforeLeave"
|
|
16
|
+
@after-leave="afterLeave"
|
|
17
|
+
>
|
|
18
|
+
<slot>
|
|
19
|
+
<scroll-view :style="popupHeight ? { height: popupHeight } : ''" scroll-y scroll-with-animation :show-scrollbar="true">
|
|
20
|
+
<view
|
|
21
|
+
v-for="(item, index) in options"
|
|
22
|
+
:key="index"
|
|
23
|
+
@click="choose(index)"
|
|
24
|
+
:class="`wd-drop-item__option ${(item[valueKey] !== '' ? item[valueKey] : item) === modelValue ? 'is-active' : ''}`"
|
|
25
|
+
>
|
|
26
|
+
<view class="wd-drop-item__title">
|
|
27
|
+
<text class="wd-drop-item__title-text">{{ item[labelKey] ? item[labelKey] : item }}</text>
|
|
28
|
+
<text v-if="item[tipKey]" class="wd-drop-item__tip">{{ item[tipKey] }}</text>
|
|
29
|
+
</view>
|
|
30
|
+
<wd-icon v-if="(item[valueKey] !== '' ? item[valueKey] : item) === modelValue" :name="iconName" custom-class="wd-drop-item__icon" />
|
|
31
|
+
</view>
|
|
32
|
+
</scroll-view>
|
|
33
|
+
</slot>
|
|
34
|
+
</wd-popup>
|
|
35
|
+
</view>
|
|
36
|
+
</template>
|
|
37
|
+
<script lang="ts">
|
|
38
|
+
export default {
|
|
39
|
+
name: 'wd-drop-menu-item',
|
|
40
|
+
options: {
|
|
41
|
+
// #ifndef MP-TOUTIAO
|
|
42
|
+
virtualHost: true,
|
|
43
|
+
// #endif
|
|
44
|
+
addGlobalClass: true,
|
|
45
|
+
styleIsolation: 'shared'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<script lang="ts" setup>
|
|
51
|
+
import wdPopup from '../wd-popup/wd-popup.vue'
|
|
52
|
+
import wdIcon from '../wd-icon/wd-icon.vue'
|
|
53
|
+
import { computed, getCurrentInstance, inject, onBeforeMount, onBeforeUnmount, ref, watch } from 'vue'
|
|
54
|
+
import { pushToQueue, removeFromQueue } from '../../common/clickoutside'
|
|
55
|
+
import { type Queue, queueKey } from '../../composables/useQueue'
|
|
56
|
+
import type { PopupType } from '../wd-popup/types'
|
|
57
|
+
import { useParent } from '../../composables/useParent'
|
|
58
|
+
import { DROP_MENU_KEY } from '../wd-drop-menu/types'
|
|
59
|
+
import { isDef } from '../../common/util'
|
|
60
|
+
import { callInterceptor } from '../../common/interceptor'
|
|
61
|
+
import { dorpMenuItemProps, type DropMenuItemExpose } from './types'
|
|
62
|
+
|
|
63
|
+
const props = defineProps(dorpMenuItemProps)
|
|
64
|
+
const emit = defineEmits<{
|
|
65
|
+
(e: 'update:modelValue', value: string | number): void
|
|
66
|
+
(e: 'change', event: { value: string | number; selectedItem: Record<string, any> }): void
|
|
67
|
+
(e: 'open'): void
|
|
68
|
+
(e: 'opened'): void
|
|
69
|
+
(e: 'close'): void
|
|
70
|
+
(e: 'closed'): void
|
|
71
|
+
}>()
|
|
72
|
+
|
|
73
|
+
const queue = inject<Queue | null>(queueKey, null)
|
|
74
|
+
const showWrapper = ref<boolean>(false)
|
|
75
|
+
const showPop = ref<boolean>(false)
|
|
76
|
+
const position = ref<PopupType>()
|
|
77
|
+
const zIndex = ref<number>(12)
|
|
78
|
+
const duration = ref<number>(0)
|
|
79
|
+
|
|
80
|
+
const { parent: dropMenu } = useParent(DROP_MENU_KEY)
|
|
81
|
+
|
|
82
|
+
const { proxy } = getCurrentInstance() as any
|
|
83
|
+
|
|
84
|
+
const positionStyle = computed(() => {
|
|
85
|
+
let style: string = ''
|
|
86
|
+
if (showWrapper.value && dropMenu.value) {
|
|
87
|
+
style =
|
|
88
|
+
dropMenu.value.props.direction === 'down'
|
|
89
|
+
? `top: calc(var(--window-top) + ${dropMenu.value.offset.value}px); bottom: 0;`
|
|
90
|
+
: `top: 0; bottom: calc(var(--window-bottom) + ${dropMenu.value.offset.value}px)`
|
|
91
|
+
} else {
|
|
92
|
+
style = ''
|
|
93
|
+
}
|
|
94
|
+
return style
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
watch(
|
|
98
|
+
() => props.modelValue,
|
|
99
|
+
(newValue) => {
|
|
100
|
+
if (isDef(newValue) && typeof newValue !== 'number' && typeof newValue !== 'string') {
|
|
101
|
+
console.error('[wot-design] warning(wd-drop-menu-item): the type of value should be a number or a string.')
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
deep: true,
|
|
106
|
+
immediate: true
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
onBeforeMount(() => {
|
|
111
|
+
if (queue && queue.pushToQueue) {
|
|
112
|
+
queue.pushToQueue(proxy)
|
|
113
|
+
} else {
|
|
114
|
+
pushToQueue(proxy)
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
onBeforeUnmount(() => {
|
|
119
|
+
if (queue && queue.removeFromQueue) {
|
|
120
|
+
queue.removeFromQueue(proxy)
|
|
121
|
+
} else {
|
|
122
|
+
removeFromQueue(proxy)
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
function getShowPop() {
|
|
127
|
+
return showPop.value
|
|
128
|
+
}
|
|
129
|
+
// 模拟单选操作 默认根据 value 选中操作
|
|
130
|
+
function choose(index: number) {
|
|
131
|
+
if (props.disabled) return
|
|
132
|
+
const { valueKey } = props
|
|
133
|
+
const item = props.options[index]
|
|
134
|
+
const newValue = item[valueKey] !== undefined ? item[valueKey] : item
|
|
135
|
+
emit('update:modelValue', newValue)
|
|
136
|
+
emit('change', {
|
|
137
|
+
value: newValue,
|
|
138
|
+
selectedItem: item
|
|
139
|
+
})
|
|
140
|
+
close()
|
|
141
|
+
}
|
|
142
|
+
// 外部关闭弹出框
|
|
143
|
+
function close() {
|
|
144
|
+
if (!showPop.value) {
|
|
145
|
+
return
|
|
146
|
+
}
|
|
147
|
+
callInterceptor(props.beforeToggle, {
|
|
148
|
+
args: [{ status: false }],
|
|
149
|
+
done: handleClose
|
|
150
|
+
})
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function handleClose() {
|
|
154
|
+
if (showPop.value) {
|
|
155
|
+
showPop.value = false
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function open() {
|
|
160
|
+
if (showPop.value) {
|
|
161
|
+
return
|
|
162
|
+
}
|
|
163
|
+
callInterceptor(props.beforeToggle, {
|
|
164
|
+
args: [{ status: true }],
|
|
165
|
+
done: handleOpen
|
|
166
|
+
})
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function handleOpen() {
|
|
170
|
+
showWrapper.value = true
|
|
171
|
+
showPop.value = true
|
|
172
|
+
if (dropMenu.value) {
|
|
173
|
+
duration.value = Number(dropMenu.value.props.duration)
|
|
174
|
+
position.value = dropMenu.value.props.direction === 'down' ? 'top' : 'bottom'
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function toggle() {
|
|
179
|
+
if (showPop.value) {
|
|
180
|
+
close()
|
|
181
|
+
} else {
|
|
182
|
+
open()
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function afterLeave() {
|
|
187
|
+
showWrapper.value = false
|
|
188
|
+
emit('closed')
|
|
189
|
+
}
|
|
190
|
+
function beforeEnter() {
|
|
191
|
+
emit('open')
|
|
192
|
+
}
|
|
193
|
+
function afterEnter() {
|
|
194
|
+
emit('opened')
|
|
195
|
+
}
|
|
196
|
+
function beforeLeave() {
|
|
197
|
+
emit('close')
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
defineExpose<DropMenuItemExpose>({ getShowPop, open, close, toggle })
|
|
201
|
+
</script>
|
|
202
|
+
|
|
203
|
+
<style lang="scss">
|
|
204
|
+
@use './index.scss';
|
|
205
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@use '../../styles/mixin/mixin.scss' as *;
|
|
2
|
+
@use '../../styles/variable.scss' as *;
|
|
3
|
+
|
|
4
|
+
// 图标颜色
|
|
5
|
+
$empty-icon-color: var(--wot-empty-icon-color, $icon-disabled) !default;
|
|
6
|
+
// 文案字号
|
|
7
|
+
$empty-text-font-size: var(--wot-empty-text-font-size, $typography-body-size-extra-large) !default;
|
|
8
|
+
// 文案行高
|
|
9
|
+
$empty-text-line-height: var(--wot-empty-text-line-height, $typography-body-line--height-size-extra-large) !default;
|
|
10
|
+
// 文案字重
|
|
11
|
+
$empty-text-font-weight: var(--wot-empty-text-font-weight, $typography-body-font-weight-strong) !default;
|
|
12
|
+
// 文案颜色
|
|
13
|
+
$empty-text-color: var(--wot-empty-text-color, $text-main) !default;
|
|
14
|
+
// 文案顶部间距
|
|
15
|
+
$empty-text-margin-top: var(--wot-empty-text-margin-top, $spacing-loose) !default;
|
|
16
|
+
// 图标尺寸
|
|
17
|
+
$empty-icon-size: var(--wot-empty-icon-size, $n-98) !default;
|
|
18
|
+
// 组件底部内边距
|
|
19
|
+
$empty-padding-bottom: var(--wot-empty-padding-bottom, $spacing-ultra-loose) !default;
|
|
20
|
+
|
|
21
|
+
@include b(empty) {
|
|
22
|
+
width: 100%;
|
|
23
|
+
margin: 0 auto;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
align-items: center;
|
|
28
|
+
padding-bottom: $empty-padding-bottom;
|
|
29
|
+
|
|
30
|
+
@include edeep(icon) {
|
|
31
|
+
margin: 0 auto;
|
|
32
|
+
width: $empty-icon-size;
|
|
33
|
+
height: $empty-icon-size;
|
|
34
|
+
font-size: $empty-icon-size;
|
|
35
|
+
color: $empty-icon-color;
|
|
36
|
+
}
|
|
37
|
+
@include e(text) {
|
|
38
|
+
margin-top: $empty-text-margin-top;
|
|
39
|
+
font-size: $empty-text-font-size;
|
|
40
|
+
line-height: $empty-text-line-height;
|
|
41
|
+
font-weight: $empty-text-font-weight;
|
|
42
|
+
color: $empty-text-color;
|
|
43
|
+
text-align: center;
|
|
44
|
+
word-break: break-all;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: weisheng
|
|
3
|
+
* @Date: 2024-03-15 13:49:00
|
|
4
|
+
* @LastEditTime: 2026-03-19 17:28:17
|
|
5
|
+
* @LastEditors: weisheng
|
|
6
|
+
* @Description:
|
|
7
|
+
* @FilePath: /wot-ui/src/uni_modules/wot-ui/components/wd-empty/types.ts
|
|
8
|
+
* 记得注释
|
|
9
|
+
*/
|
|
10
|
+
import type { ExtractPropTypes, PropType } from 'vue'
|
|
11
|
+
import { baseProps, makeStringProp } from '../../common/props'
|
|
12
|
+
|
|
13
|
+
export const emptyProps = {
|
|
14
|
+
...baseProps,
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 缺省图片类型,支持传入图片 URL。
|
|
18
|
+
* 类型: string
|
|
19
|
+
* 可选值: 图标名或URL
|
|
20
|
+
* 默认值: empty
|
|
21
|
+
*/
|
|
22
|
+
icon: makeStringProp('empty'),
|
|
23
|
+
/**
|
|
24
|
+
* 图片大小,默认单位为 `px`。
|
|
25
|
+
* 类型: string 或 number
|
|
26
|
+
* 默认值: 空字符串
|
|
27
|
+
*/
|
|
28
|
+
iconSize: [String, Number],
|
|
29
|
+
/**
|
|
30
|
+
* 提示文案。
|
|
31
|
+
* 类型: string
|
|
32
|
+
* 默认值: 空字符串
|
|
33
|
+
*/
|
|
34
|
+
tip: makeStringProp('')
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type EmptyProps = ExtractPropTypes<typeof emptyProps>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="`wd-empty ${customClass}`" :style="customStyle">
|
|
3
|
+
<slot name="image">
|
|
4
|
+
<wd-icon :name="icon" custom-class="wd-empty__icon" :custom-style="iconStyle"></wd-icon>
|
|
5
|
+
</slot>
|
|
6
|
+
<view v-if="tip" class="wd-empty__text">{{ tip }}</view>
|
|
7
|
+
<slot name="bottom" />
|
|
8
|
+
</view>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
export default {
|
|
13
|
+
name: 'wd-empty',
|
|
14
|
+
options: {
|
|
15
|
+
addGlobalClass: true,
|
|
16
|
+
// #ifndef MP-TOUTIAO
|
|
17
|
+
virtualHost: true,
|
|
18
|
+
// #endif
|
|
19
|
+
styleIsolation: 'shared'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<script lang="ts" setup>
|
|
25
|
+
import wdIcon from '../wd-icon/wd-icon.vue'
|
|
26
|
+
import { computed, type CSSProperties } from 'vue'
|
|
27
|
+
import { addUnit, objToStyle } from '../../common/util'
|
|
28
|
+
import { emptyProps } from './types'
|
|
29
|
+
|
|
30
|
+
const props = defineProps(emptyProps)
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 图标样式
|
|
34
|
+
*/
|
|
35
|
+
const iconStyle = computed(() => {
|
|
36
|
+
let style: CSSProperties = {}
|
|
37
|
+
if (props.iconSize) {
|
|
38
|
+
style['font-size'] = addUnit(props.iconSize)
|
|
39
|
+
style['width'] = addUnit(props.iconSize)
|
|
40
|
+
style['height'] = addUnit(props.iconSize)
|
|
41
|
+
}
|
|
42
|
+
return `${objToStyle(style)}`
|
|
43
|
+
})
|
|
44
|
+
</script>
|
|
45
|
+
<style lang="scss">
|
|
46
|
+
@use './index.scss';
|
|
47
|
+
</style>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
@use '../../styles/mixin/mixin.scss'as *;
|
|
2
|
+
@use '../../styles/variable.scss'as *;
|
|
3
|
+
|
|
4
|
+
// 浮动按钮触发器宽度
|
|
5
|
+
$fab-trigger-width: var(--wot-fab-trigger-width, $n-60) !default;
|
|
6
|
+
// 浮动按钮触发器高度
|
|
7
|
+
$fab-trigger-height: var(--wot-fab-trigger-height, $n-60) !default;
|
|
8
|
+
// 动作列表主轴内边距
|
|
9
|
+
$fab-actions-padding: var(--wot-fab-actions-padding, $padding-extra-loose) !default;
|
|
10
|
+
// 浮动按钮层级
|
|
11
|
+
$fab-z-index: var(--wot-fab-z-index, 99) !default;
|
|
12
|
+
// 动作按钮展开/收起动画偏移距离
|
|
13
|
+
$fab-transition-offset: var(--wot-fab-transition-offset, $n-40) !default;
|
|
14
|
+
// 浮动按钮触发器图标大小
|
|
15
|
+
$fab-trigger-icon-size: var(--wot-fab-trigger-icon-size, $n-32) !default;
|
|
16
|
+
|
|
17
|
+
@include b(fab) {
|
|
18
|
+
position: fixed;
|
|
19
|
+
z-index: $fab-z-index;
|
|
20
|
+
|
|
21
|
+
@include edeep(trigger) {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
width: $fab-trigger-width;
|
|
26
|
+
height: $fab-trigger-height;
|
|
27
|
+
|
|
28
|
+
.wd-button__icon {
|
|
29
|
+
font-size: $fab-trigger-icon-size;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:deep() {
|
|
34
|
+
@include e(actions) {
|
|
35
|
+
position: absolute;
|
|
36
|
+
z-index: 0;
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
align-items: center;
|
|
40
|
+
padding: $fab-actions-padding 0;
|
|
41
|
+
|
|
42
|
+
@include m(left, right) {
|
|
43
|
+
height: 100%;
|
|
44
|
+
top: 0;
|
|
45
|
+
padding: 0 $fab-actions-padding;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@include m(left) {
|
|
49
|
+
flex-direction: row-reverse;
|
|
50
|
+
right: 100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@include m(right) {
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
left: 100%;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@include m(top, bottom) {
|
|
59
|
+
width: 100%;
|
|
60
|
+
left: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@include m(top) {
|
|
64
|
+
flex-direction: column-reverse;
|
|
65
|
+
bottom: 100%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@include m(bottom) {
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
top: 100%;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// 动画
|
|
75
|
+
@include e(transition-enter-active, transition-leave-active) {
|
|
76
|
+
transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@include e(transition-enter) {
|
|
81
|
+
@include m(top) {
|
|
82
|
+
opacity: 0;
|
|
83
|
+
transform: translateY($fab-transition-offset);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@include m(bottom) {
|
|
87
|
+
opacity: 0;
|
|
88
|
+
transform: translateY(calc(-1 * $fab-transition-offset));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@include m(left) {
|
|
92
|
+
opacity: 0;
|
|
93
|
+
transform: translateX($fab-transition-offset);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@include m(right) {
|
|
97
|
+
opacity: 0;
|
|
98
|
+
transform: translateX(calc(-1 * $fab-transition-offset));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@include e(transition-leave-to) {
|
|
103
|
+
@include m(top) {
|
|
104
|
+
opacity: 0;
|
|
105
|
+
transform: translateY($fab-transition-offset);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@include m(bottom) {
|
|
109
|
+
opacity: 0;
|
|
110
|
+
transform: translateY(calc(-1 * $fab-transition-offset));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@include m(left) {
|
|
114
|
+
opacity: 0;
|
|
115
|
+
transform: translateX($fab-transition-offset);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@include m(right) {
|
|
119
|
+
opacity: 0;
|
|
120
|
+
transform: translateX(calc(-1 * $fab-transition-offset));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { ComponentPublicInstance, ExtractPropTypes } from 'vue'
|
|
2
|
+
import { baseProps, makeBooleanProp, makeNumberProp, makeStringProp } from '../../common/props'
|
|
3
|
+
import type { PropType } from 'vue'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 浮动按钮类型
|
|
7
|
+
*/
|
|
8
|
+
export type FabType = 'primary' | 'success' | 'info' | 'warning' | 'danger'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 浮动按钮位置
|
|
12
|
+
*/
|
|
13
|
+
export type FabPosition = 'left-top' | 'right-top' | 'left-bottom' | 'right-bottom' | 'left-center' | 'right-center' | 'top-center' | 'bottom-center'
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 浮动按钮菜单弹出方向
|
|
17
|
+
*/
|
|
18
|
+
export type FabDirection = 'top' | 'right' | 'bottom' | 'left'
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 浮动按钮边界间距配置
|
|
22
|
+
*/
|
|
23
|
+
export type FabGap = Partial<Record<FabDirection, number>>
|
|
24
|
+
export const fabProps = {
|
|
25
|
+
...baseProps,
|
|
26
|
+
/**
|
|
27
|
+
* 是否激活展开菜单
|
|
28
|
+
* 类型: boolean
|
|
29
|
+
* 默认值: false
|
|
30
|
+
*/
|
|
31
|
+
active: makeBooleanProp(false),
|
|
32
|
+
/**
|
|
33
|
+
* 按钮类型
|
|
34
|
+
* 类型: FabType
|
|
35
|
+
* 可选值: 'primary' | 'success' | 'info' | 'warning' | 'danger'
|
|
36
|
+
* 默认值: 'primary'
|
|
37
|
+
*/
|
|
38
|
+
type: makeStringProp<FabType>('primary'),
|
|
39
|
+
/**
|
|
40
|
+
* 悬浮按钮位置
|
|
41
|
+
* 类型: FabPosition
|
|
42
|
+
* 可选值: 'left-top' | 'right-top' | 'left-bottom' | 'right-bottom' | 'left-center' | 'right-center' | 'top-center' | 'bottom-center'
|
|
43
|
+
* 默认值: 'right-bottom'
|
|
44
|
+
*/
|
|
45
|
+
position: makeStringProp<FabPosition>('right-bottom'),
|
|
46
|
+
/**
|
|
47
|
+
* 菜单弹出方向
|
|
48
|
+
* 类型: FabDirection
|
|
49
|
+
* 可选值: 'top' | 'right' | 'bottom' | 'left'
|
|
50
|
+
* 默认值: 'top'
|
|
51
|
+
*/
|
|
52
|
+
direction: makeStringProp<FabDirection>('top'),
|
|
53
|
+
/**
|
|
54
|
+
* 是否禁用
|
|
55
|
+
* 类型: boolean
|
|
56
|
+
* 默认值: false
|
|
57
|
+
*/
|
|
58
|
+
disabled: makeBooleanProp(false),
|
|
59
|
+
/**
|
|
60
|
+
* 未展开时的图标名称
|
|
61
|
+
* 类型: string
|
|
62
|
+
* 默认值: 'plus'
|
|
63
|
+
*/
|
|
64
|
+
inactiveIcon: makeStringProp('plus'),
|
|
65
|
+
/**
|
|
66
|
+
* 展开时的图标名称
|
|
67
|
+
* 类型: string
|
|
68
|
+
* 默认值: 'close'
|
|
69
|
+
*/
|
|
70
|
+
activeIcon: makeStringProp('close'),
|
|
71
|
+
/**
|
|
72
|
+
* 自定义 z-index 层级
|
|
73
|
+
* 类型: number
|
|
74
|
+
* 默认值: 99
|
|
75
|
+
*/
|
|
76
|
+
zIndex: makeNumberProp(99),
|
|
77
|
+
/**
|
|
78
|
+
* 是否可拖动
|
|
79
|
+
* 类型: boolean
|
|
80
|
+
* 默认值: false
|
|
81
|
+
*/
|
|
82
|
+
draggable: makeBooleanProp(false),
|
|
83
|
+
/**
|
|
84
|
+
* 距离屏幕边界的间距,可分别设置上下左右
|
|
85
|
+
* 类型: FabGap
|
|
86
|
+
* 默认值: { top: 16, right: 16, bottom: 16, left: 16 }
|
|
87
|
+
*/
|
|
88
|
+
gap: {
|
|
89
|
+
type: Object as PropType<FabGap>,
|
|
90
|
+
default: () => ({})
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* 点击时是否展开菜单
|
|
94
|
+
* 类型: boolean
|
|
95
|
+
* 默认值: true
|
|
96
|
+
*/
|
|
97
|
+
expandable: makeBooleanProp(true)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type FabProps = ExtractPropTypes<typeof fabProps>
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Fab 组件暴露的方法
|
|
104
|
+
*/
|
|
105
|
+
export type FabExpose = {
|
|
106
|
+
/**
|
|
107
|
+
* 展开菜单
|
|
108
|
+
*/
|
|
109
|
+
open: () => void
|
|
110
|
+
/**
|
|
111
|
+
* 收起菜单
|
|
112
|
+
*/
|
|
113
|
+
close: () => void
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Fab 组件实例类型
|
|
118
|
+
*/
|
|
119
|
+
export type FabInstance = ComponentPublicInstance<FabProps, FabExpose>
|