@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,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="rootClass" :style="rootStyle">
|
|
3
|
+
<!-- 每一列 -->
|
|
4
|
+
<slot />
|
|
5
|
+
</view>
|
|
6
|
+
</template>
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
export default {
|
|
9
|
+
name: 'wd-col',
|
|
10
|
+
options: {
|
|
11
|
+
addGlobalClass: true,
|
|
12
|
+
// #ifndef MP-TOUTIAO
|
|
13
|
+
virtualHost: true,
|
|
14
|
+
// #endif
|
|
15
|
+
styleIsolation: 'shared'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script lang="ts" setup>
|
|
21
|
+
import { computed, watch } from 'vue'
|
|
22
|
+
import { useParent } from '../../composables/useParent'
|
|
23
|
+
import { ROW_KEY } from '../wd-row/types'
|
|
24
|
+
import { colProps } from './types'
|
|
25
|
+
import { isDef } from '../../common/util'
|
|
26
|
+
|
|
27
|
+
const props = defineProps(colProps)
|
|
28
|
+
const { parent: row } = useParent(ROW_KEY)
|
|
29
|
+
|
|
30
|
+
const rootClass = computed(() => {
|
|
31
|
+
return `wd-col ${props.customClass}`
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const rootStyle = computed(() => {
|
|
35
|
+
const gutter = isDef(row.value) ? row.value.props.gutter || 0 : 0
|
|
36
|
+
const { span, offset } = props
|
|
37
|
+
const styles: string[] = []
|
|
38
|
+
|
|
39
|
+
// gutter 间距:左右 padding
|
|
40
|
+
if (gutter > 0) {
|
|
41
|
+
const padding = `${gutter / 2}px`
|
|
42
|
+
styles.push(`padding-left: ${padding}`)
|
|
43
|
+
styles.push(`padding-right: ${padding}`)
|
|
44
|
+
styles.push('background-clip: content-box')
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 栅格宽度
|
|
48
|
+
if (span > 0 && span < 24) {
|
|
49
|
+
const width = `${(span / 24) * 100}%`
|
|
50
|
+
styles.push(`width: ${width}`)
|
|
51
|
+
} else if (span === 24) {
|
|
52
|
+
styles.push('width: 100%')
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 栅格偏移
|
|
56
|
+
if (offset > 0) {
|
|
57
|
+
const marginLeft = `${(offset / 24) * 100}%`
|
|
58
|
+
styles.push(`margin-left: ${marginLeft}`)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// 追加用户自定义样式
|
|
62
|
+
if (props.customStyle) {
|
|
63
|
+
styles.push(props.customStyle)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return styles.join(';')
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
watch([() => props.span, () => props.offset], () => {
|
|
70
|
+
check()
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
function check() {
|
|
74
|
+
const { span, offset } = props
|
|
75
|
+
if (span < 0 || offset < 0) {
|
|
76
|
+
console.error('[wot-design] warning(wd-col): attribute span/offset must be greater than or equal to 0')
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<style lang="scss">
|
|
82
|
+
@use './index.scss';
|
|
83
|
+
</style>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@use '../../styles/mixin/mixin.scss'as *;
|
|
2
|
+
@use '../../styles/variable.scss'as *;
|
|
3
|
+
|
|
4
|
+
// 折叠面板背景颜色
|
|
5
|
+
$collapse-bg: var(--wot-collapse-bg, $filled-oppo) !default;
|
|
6
|
+
// 折叠内容文字颜色
|
|
7
|
+
$collapse-body-color: var(--wot-collapse-body-color, $text-auxiliary) !default;
|
|
8
|
+
// 折叠内容文字字号
|
|
9
|
+
$collapse-body-font-size: var(--wot-collapse-body-font-size, $typography-label-size-large) !default;
|
|
10
|
+
// 折叠容器左右内边距
|
|
11
|
+
$collapse-padding: var(--wot-collapse-padding, $padding-loose) !default;
|
|
12
|
+
// 折叠内容区域内边距
|
|
13
|
+
$collapse-body-padding: var(--wot-collapse-body-padding, $padding-extra-loose $padding-loose) !default;
|
|
14
|
+
// 折叠标题文字颜色
|
|
15
|
+
$collapse-title-color: var(--wot-collapse-title-color, $text-main) !default;
|
|
16
|
+
// 折叠标题文字字号
|
|
17
|
+
$collapse-title-font-size: var(--wot-collapse-title-font-size, $typography-body-size-extra-large) !default;
|
|
18
|
+
// 折叠箭头尺寸
|
|
19
|
+
$collapse-arrow-size: var(--wot-collapse-arrow-size, $n-16) !default;
|
|
20
|
+
// 折叠箭头颜色
|
|
21
|
+
$collapse-arrow-color: var(--wot-collapse-arrow-color, $icon-main) !default;
|
|
22
|
+
// 更多按钮文字字号
|
|
23
|
+
$collapse-more-font-size: var(--wot-collapse-more-font-size, $typography-body-size-main) !default;
|
|
24
|
+
// 更多按钮文字颜色
|
|
25
|
+
$collapse-more-color: var(--wot-collapse-more-color, $primary-6) !default;
|
|
26
|
+
// 更多按钮上边距
|
|
27
|
+
$collapse-more-margin-top: var(--wot-collapse-more-margin-top, $spacing-main) !default;
|
|
28
|
+
// 更多按钮文字右侧间距
|
|
29
|
+
$collapse-more-text-margin-right: var(--wot-collapse-more-text-margin-right, $spacing-super-tight) !default;
|
|
30
|
+
|
|
31
|
+
@include b(collapse) {
|
|
32
|
+
background: $collapse-bg;
|
|
33
|
+
|
|
34
|
+
@include when(viewmore) {
|
|
35
|
+
padding: $collapse-padding;
|
|
36
|
+
}
|
|
37
|
+
@include e(content) {
|
|
38
|
+
font-size: $collapse-body-font-size;
|
|
39
|
+
color: $collapse-body-color;
|
|
40
|
+
|
|
41
|
+
@include when(retract) {
|
|
42
|
+
display: -webkit-box;
|
|
43
|
+
-webkit-box-orient: vertical;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
@include e(more) {
|
|
48
|
+
display: inline-block;
|
|
49
|
+
font-size: $collapse-more-font-size;
|
|
50
|
+
margin-top: $collapse-more-margin-top;
|
|
51
|
+
color: $collapse-more-color;
|
|
52
|
+
user-select: none;
|
|
53
|
+
}
|
|
54
|
+
@include e(more-txt) {
|
|
55
|
+
display: inline-block;
|
|
56
|
+
vertical-align: middle;
|
|
57
|
+
margin-right: $collapse-more-text-margin-right;
|
|
58
|
+
}
|
|
59
|
+
@include e(arrow) {
|
|
60
|
+
display: inline-block;
|
|
61
|
+
vertical-align: middle;
|
|
62
|
+
transition: transform 0.1s;
|
|
63
|
+
font-size: $collapse-arrow-size;
|
|
64
|
+
height: $collapse-arrow-size;
|
|
65
|
+
line-height: $collapse-arrow-size;
|
|
66
|
+
|
|
67
|
+
@include when(retract) {
|
|
68
|
+
transform: rotate(-180deg);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type ComponentPublicInstance, type ExtractPropTypes, type InjectionKey, type PropType } from 'vue'
|
|
2
|
+
import { baseProps, makeBooleanProp, makeNumberProp, makeStringProp } from '../../common/props'
|
|
3
|
+
|
|
4
|
+
export type CollapseToggleAllOptions =
|
|
5
|
+
| boolean
|
|
6
|
+
| {
|
|
7
|
+
expanded?: boolean
|
|
8
|
+
skipDisabled?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type CollapseProvide = {
|
|
12
|
+
props: Partial<CollapseProps>
|
|
13
|
+
toggle: (name: string, expanded: boolean) => void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const COLLAPSE_KEY: InjectionKey<CollapseProvide> = Symbol('wd-collapse')
|
|
17
|
+
|
|
18
|
+
export const collapseProps = {
|
|
19
|
+
...baseProps,
|
|
20
|
+
/**
|
|
21
|
+
* 查看更多模式下的插槽外部自定义样式类
|
|
22
|
+
* 类型: string
|
|
23
|
+
*/
|
|
24
|
+
customMoreSlotClass: makeStringProp(''),
|
|
25
|
+
/**
|
|
26
|
+
* 绑定值,手风琴模式下为 string,普通模式下为 array,查看更多模式下为 boolean
|
|
27
|
+
* 类型: string | string[] | boolean
|
|
28
|
+
*/
|
|
29
|
+
modelValue: {
|
|
30
|
+
type: [String, Array, Boolean] as PropType<string | string[] | boolean>
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* 是否开启手风琴模式
|
|
34
|
+
* 类型: boolean
|
|
35
|
+
* 默认值: false
|
|
36
|
+
*/
|
|
37
|
+
accordion: makeBooleanProp(false),
|
|
38
|
+
/**
|
|
39
|
+
* 是否开启查看更多模式
|
|
40
|
+
* 类型: boolean
|
|
41
|
+
* 默认值: false
|
|
42
|
+
*/
|
|
43
|
+
viewmore: makeBooleanProp(false),
|
|
44
|
+
/**
|
|
45
|
+
* 查看更多模式下,是否使用自定义插槽
|
|
46
|
+
* 类型: boolean
|
|
47
|
+
* 默认值: false
|
|
48
|
+
*/
|
|
49
|
+
useMoreSlot: makeBooleanProp(false),
|
|
50
|
+
/**
|
|
51
|
+
* 查看更多模式下,收起时的显示行数
|
|
52
|
+
* 类型: number
|
|
53
|
+
* 默认值: 2
|
|
54
|
+
*/
|
|
55
|
+
lineNum: makeNumberProp(2)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type CollapseProps = ExtractPropTypes<typeof collapseProps>
|
|
59
|
+
|
|
60
|
+
export type CollapseExpose = {
|
|
61
|
+
/**
|
|
62
|
+
* 切换所有面板展开状态,传 true 为全部展开,false 为全部收起,不传参为全部切换
|
|
63
|
+
* @param options 面板状态
|
|
64
|
+
*/
|
|
65
|
+
toggleAll: (options?: CollapseToggleAllOptions) => void
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type CollapseInstance = ComponentPublicInstance<CollapseProps, CollapseExpose>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="`wd-collapse ${viewmore ? 'is-viewmore' : ''} ${customClass}`" :style="customStyle">
|
|
3
|
+
<!-- 普通或手风琴 -->
|
|
4
|
+
<block v-if="!viewmore">
|
|
5
|
+
<slot></slot>
|
|
6
|
+
</block>
|
|
7
|
+
<!-- 查看更多模式 -->
|
|
8
|
+
<view v-else>
|
|
9
|
+
<view
|
|
10
|
+
:class="`wd-collapse__content ${!modelValue ? 'is-retract' : ''} `"
|
|
11
|
+
:style="`-webkit-line-clamp: ${contentLineNum}; -webkit-box-orient: vertical`"
|
|
12
|
+
>
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</view>
|
|
15
|
+
<view class="wd-collapse__more" @click="handleMore">
|
|
16
|
+
<!-- 自定义展开按钮 -->
|
|
17
|
+
<view v-if="useMoreSlot" :class="customMoreSlotClass">
|
|
18
|
+
<slot name="more"></slot>
|
|
19
|
+
</view>
|
|
20
|
+
<!-- 显示展开或折叠按钮 -->
|
|
21
|
+
<block v-else>
|
|
22
|
+
<span class="wd-collapse__more-txt">{{ !modelValue ? translate('expand') : translate('retract') }}</span>
|
|
23
|
+
<view :class="`wd-collapse__arrow ${modelValue ? 'is-retract' : ''}`">
|
|
24
|
+
<wd-icon name="down"></wd-icon>
|
|
25
|
+
</view>
|
|
26
|
+
</block>
|
|
27
|
+
</view>
|
|
28
|
+
</view>
|
|
29
|
+
</view>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script lang="ts">
|
|
33
|
+
export default {
|
|
34
|
+
name: 'wd-collapse',
|
|
35
|
+
options: {
|
|
36
|
+
addGlobalClass: true,
|
|
37
|
+
// #ifndef MP-TOUTIAO
|
|
38
|
+
virtualHost: true,
|
|
39
|
+
// #endif
|
|
40
|
+
styleIsolation: 'shared'
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<script lang="ts" setup>
|
|
46
|
+
import wdIcon from '../wd-icon/wd-icon.vue'
|
|
47
|
+
import { onBeforeMount, ref, watch } from 'vue'
|
|
48
|
+
import { COLLAPSE_KEY, collapseProps, type CollapseExpose, type CollapseToggleAllOptions } from './types'
|
|
49
|
+
import { useChildren } from '../../composables/useChildren'
|
|
50
|
+
import { isArray, isBoolean, isDef } from '../../common/util'
|
|
51
|
+
import { useTranslate } from '../../composables/useTranslate'
|
|
52
|
+
|
|
53
|
+
const props = defineProps(collapseProps)
|
|
54
|
+
const emit = defineEmits<{
|
|
55
|
+
(e: 'change', value: { value: string | string[] | boolean }): void
|
|
56
|
+
(e: 'update:modelValue', value: string | string[] | boolean): void
|
|
57
|
+
}>()
|
|
58
|
+
|
|
59
|
+
const { translate } = useTranslate('collapse')
|
|
60
|
+
const contentLineNum = ref<number>(0) // 查看更多的折叠面板,收起时的显示行数
|
|
61
|
+
|
|
62
|
+
const { linkChildren, children } = useChildren(COLLAPSE_KEY)
|
|
63
|
+
|
|
64
|
+
linkChildren({ props, toggle })
|
|
65
|
+
|
|
66
|
+
watch(
|
|
67
|
+
() => props.modelValue,
|
|
68
|
+
(newVal) => {
|
|
69
|
+
const { viewmore, accordion } = props
|
|
70
|
+
// 手风琴状态下 value 类型只能为 string
|
|
71
|
+
if (accordion && typeof newVal !== 'string') {
|
|
72
|
+
console.error('accordion value must be string')
|
|
73
|
+
} else if (!accordion && !viewmore && !isArray(newVal)) {
|
|
74
|
+
console.error('value must be Array')
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{ deep: true }
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
watch(
|
|
81
|
+
() => props.lineNum,
|
|
82
|
+
(newVal) => {
|
|
83
|
+
if (newVal <= 0) {
|
|
84
|
+
console.error('lineNum must greater than 0')
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{ deep: true, immediate: true }
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
onBeforeMount(() => {
|
|
91
|
+
const { lineNum, viewmore, modelValue } = props
|
|
92
|
+
contentLineNum.value = viewmore && !modelValue ? lineNum : 0
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 更新绑定值
|
|
97
|
+
* @param activeNames 选中的值
|
|
98
|
+
*/
|
|
99
|
+
function updateChange(activeNames: string | string[] | boolean) {
|
|
100
|
+
emit('update:modelValue', activeNames)
|
|
101
|
+
emit('change', {
|
|
102
|
+
value: activeNames
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* 切换选中状态
|
|
108
|
+
* @param name 唯一标识符
|
|
109
|
+
* @param expanded 是否展开
|
|
110
|
+
*/
|
|
111
|
+
function toggle(name: string, expanded: boolean) {
|
|
112
|
+
const { accordion, modelValue } = props
|
|
113
|
+
if (accordion) {
|
|
114
|
+
updateChange(name === modelValue ? '' : name)
|
|
115
|
+
} else if (expanded) {
|
|
116
|
+
updateChange((modelValue as string[]).concat(name))
|
|
117
|
+
} else {
|
|
118
|
+
updateChange((modelValue as string[]).filter((activeName) => activeName !== name))
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* 切换所有面板展开状态,传 true 为全部展开,false 为全部收起,不传参为全部切换
|
|
124
|
+
* @param options 面板状态
|
|
125
|
+
*/
|
|
126
|
+
const toggleAll = (options: CollapseToggleAllOptions = {}) => {
|
|
127
|
+
if (props.accordion) {
|
|
128
|
+
return
|
|
129
|
+
}
|
|
130
|
+
if (isBoolean(options)) {
|
|
131
|
+
options = { expanded: options }
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const { expanded, skipDisabled } = options
|
|
135
|
+
const names: string[] = []
|
|
136
|
+
children.forEach((item, index) => {
|
|
137
|
+
if (item.disabled && skipDisabled) {
|
|
138
|
+
if (item.$.exposed!.getExpanded()) {
|
|
139
|
+
names.push(item.name || index)
|
|
140
|
+
}
|
|
141
|
+
} else if (isDef(expanded) ? expanded : !item.$.exposed!.getExpanded()) {
|
|
142
|
+
names.push(item.name || index)
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
updateChange(names)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* 查看更多点击
|
|
150
|
+
*/
|
|
151
|
+
function handleMore() {
|
|
152
|
+
emit('update:modelValue', !props.modelValue)
|
|
153
|
+
emit('change', {
|
|
154
|
+
value: !props.modelValue
|
|
155
|
+
})
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
defineExpose<CollapseExpose>({
|
|
159
|
+
toggleAll
|
|
160
|
+
})
|
|
161
|
+
</script>
|
|
162
|
+
|
|
163
|
+
<style lang="scss">
|
|
164
|
+
@use './index.scss';
|
|
165
|
+
</style>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
@use '../../styles/mixin/mixin.scss'as *;
|
|
2
|
+
@use '../../styles/variable.scss'as *;
|
|
3
|
+
|
|
4
|
+
// 折叠项头部内边距
|
|
5
|
+
$collapse-item-header-padding: var(--wot-collapse-item-header-padding, $padding-extra-loose) !default;
|
|
6
|
+
// 折叠项标题文字颜色
|
|
7
|
+
$collapse-item-title-color: var(--wot-collapse-item-title-color, $text-main) !default;
|
|
8
|
+
// 折叠项标题文字字号
|
|
9
|
+
$collapse-item-title-font-size: var(--wot-collapse-item-title-font-size, $typography-body-size-extra-large) !default;
|
|
10
|
+
// 折叠项标题文字行高
|
|
11
|
+
$collapse-item-title-line-height: var(--wot-collapse-item-title-line-height, $typography-body-line--height-size-extra-large) !default;
|
|
12
|
+
// 折叠项箭头尺寸
|
|
13
|
+
$collapse-item-arrow-size: var(--wot-collapse-item-arrow-size, $n-16) !default;
|
|
14
|
+
// 折叠项箭头颜色
|
|
15
|
+
$collapse-item-arrow-color: var(--wot-collapse-item-arrow-color, $icon-secondary) !default;
|
|
16
|
+
// 折叠项内容文字颜色
|
|
17
|
+
$collapse-item-body-color: var(--wot-collapse-item-body-color, $text-auxiliary) !default;
|
|
18
|
+
// 折叠项内容文字字号
|
|
19
|
+
$collapse-item-body-font-size: var(--wot-collapse-item-body-font-size, $typography-label-size-large) !default;
|
|
20
|
+
// 折叠项内容文字行高
|
|
21
|
+
$collapse-item-body-line-height: var(--wot-collapse-item-body-line-height, $typography-label-line--height-size-large) !default;
|
|
22
|
+
// 折叠项内容区域内边距
|
|
23
|
+
$collapse-item-body-padding: var(--wot-collapse-item-body-padding, $padding-loose $padding-extra-loose) !default;
|
|
24
|
+
|
|
25
|
+
@include b(collapse-item) {
|
|
26
|
+
position: relative;
|
|
27
|
+
|
|
28
|
+
@include when(border) {
|
|
29
|
+
@include halfPixelBorder('top');
|
|
30
|
+
|
|
31
|
+
.#{$B}__header {
|
|
32
|
+
@include when(expanded) {
|
|
33
|
+
@include halfPixelBorder('bottom');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@include e(header) {
|
|
40
|
+
position: relative;
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
align-items: center;
|
|
44
|
+
padding: $collapse-item-header-padding;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
user-select: none;
|
|
47
|
+
|
|
48
|
+
@include when(custom) {
|
|
49
|
+
display: block;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@include e(title) {
|
|
54
|
+
color: $collapse-item-title-color;
|
|
55
|
+
font-size: $collapse-item-title-font-size;
|
|
56
|
+
line-height: $collapse-item-title-line-height;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@include edeep(arrow) {
|
|
60
|
+
display: block;
|
|
61
|
+
font-size: $collapse-item-arrow-size;
|
|
62
|
+
color: $collapse-item-arrow-color;
|
|
63
|
+
transition: transform 0.3s;
|
|
64
|
+
|
|
65
|
+
@include when(retract) {
|
|
66
|
+
transform: rotate(-180deg);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@include e(wrapper) {
|
|
71
|
+
position: relative;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
will-change: height;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@include e(body) {
|
|
77
|
+
color: $collapse-item-body-color;
|
|
78
|
+
font-size: $collapse-item-body-font-size;
|
|
79
|
+
line-height: $collapse-item-body-line-height;
|
|
80
|
+
padding: $collapse-item-body-padding;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@include when(disabled) {
|
|
84
|
+
opacity: $opacity-disabled;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue'
|
|
2
|
+
import { baseProps, makeBooleanProp, makeRequiredProp, makeStringProp } from '../../common/props'
|
|
3
|
+
|
|
4
|
+
export type CollapseItemBeforeExpand = (name: string) => boolean | Promise<boolean>
|
|
5
|
+
|
|
6
|
+
export const collapseItemProps = {
|
|
7
|
+
...baseProps,
|
|
8
|
+
/**
|
|
9
|
+
* 自定义折叠栏内容容器样式类名
|
|
10
|
+
* 类型: string
|
|
11
|
+
*/
|
|
12
|
+
customBodyClass: makeStringProp(''),
|
|
13
|
+
/**
|
|
14
|
+
* 自定义折叠栏内容容器样式
|
|
15
|
+
* 类型: string
|
|
16
|
+
*/
|
|
17
|
+
customBodyStyle: makeStringProp(''),
|
|
18
|
+
/**
|
|
19
|
+
* 标题,可通过 slot 传递自定义内容
|
|
20
|
+
* 类型: string
|
|
21
|
+
*/
|
|
22
|
+
title: makeStringProp(''),
|
|
23
|
+
/**
|
|
24
|
+
* 是否禁用
|
|
25
|
+
* 类型: boolean
|
|
26
|
+
* 默认值: false
|
|
27
|
+
*/
|
|
28
|
+
disabled: makeBooleanProp(false),
|
|
29
|
+
/**
|
|
30
|
+
* 唯一标识符
|
|
31
|
+
* 类型: string
|
|
32
|
+
* 必填
|
|
33
|
+
*/
|
|
34
|
+
name: makeRequiredProp(String),
|
|
35
|
+
/**
|
|
36
|
+
* 展开前的回调函数,返回 false 可以阻止展开,支持返回 Promise
|
|
37
|
+
* 类型: function
|
|
38
|
+
*/
|
|
39
|
+
beforeExpend: Function as PropType<CollapseItemBeforeExpand>,
|
|
40
|
+
/**
|
|
41
|
+
* 是否显示边框
|
|
42
|
+
* 类型: boolean
|
|
43
|
+
* 默认值: true
|
|
44
|
+
*/
|
|
45
|
+
border: makeBooleanProp(true)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type CollapseItemProps = ExtractPropTypes<typeof collapseItemProps>
|
|
49
|
+
|
|
50
|
+
export type CollapseItemExpose = {
|
|
51
|
+
/**
|
|
52
|
+
* 获取展开状态
|
|
53
|
+
* @returns boolean
|
|
54
|
+
*/
|
|
55
|
+
getExpanded: () => boolean
|
|
56
|
+
/**
|
|
57
|
+
* 更新展开状态
|
|
58
|
+
*/
|
|
59
|
+
updateExpand: () => Promise<void>
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type CollapseItemInstance = ComponentPublicInstance<CollapseItemProps, CollapseItemExpose>
|