oxy-uni-ui 1.0.1
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 +13 -0
- package/attributes.json +1 -0
- package/components/common/AbortablePromise.ts +28 -0
- package/components/common/abstracts/_config.scss +7 -0
- package/components/common/abstracts/_function.scss +89 -0
- package/components/common/abstracts/_mixin.scss +385 -0
- package/components/common/abstracts/variable.scss +974 -0
- package/components/common/base64.ts +29 -0
- package/components/common/canvasHelper.ts +49 -0
- package/components/common/clickoutside.ts +25 -0
- package/components/common/event.ts +8 -0
- package/components/common/interceptor.ts +43 -0
- package/components/common/props.ts +51 -0
- package/components/common/util.ts +778 -0
- package/components/composables/index.ts +11 -0
- package/components/composables/useCell.ts +13 -0
- package/components/composables/useChildren.ts +113 -0
- package/components/composables/useCountDown.ts +138 -0
- package/components/composables/useLockScroll.ts +37 -0
- package/components/composables/useParent.ts +41 -0
- package/components/composables/usePopover.ts +176 -0
- package/components/composables/useQueue.ts +52 -0
- package/components/composables/useRaf.ts +37 -0
- package/components/composables/useTouch.ts +43 -0
- package/components/composables/useTranslate.ts +12 -0
- package/components/composables/useUpload.ts +364 -0
- package/components/oxy-action-sheet/index.scss +204 -0
- package/components/oxy-action-sheet/oxy-action-sheet.vue +155 -0
- package/components/oxy-action-sheet/types.ts +118 -0
- package/components/oxy-backtop/index.scss +25 -0
- package/components/oxy-backtop/oxy-backtop.vue +45 -0
- package/components/oxy-backtop/types.ts +37 -0
- package/components/oxy-badge/index.scss +63 -0
- package/components/oxy-badge/oxy-badge.vue +61 -0
- package/components/oxy-badge/types.ts +41 -0
- package/components/oxy-button/index.scss +336 -0
- package/components/oxy-button/oxy-button.vue +195 -0
- package/components/oxy-button/types.ts +133 -0
- package/components/oxy-calendar/index.scss +158 -0
- package/components/oxy-calendar/oxy-calendar.vue +451 -0
- package/components/oxy-calendar/types.ts +217 -0
- package/components/oxy-calendar-view/index.scss +0 -0
- package/components/oxy-calendar-view/month/index.scss +162 -0
- package/components/oxy-calendar-view/month/month.vue +389 -0
- package/components/oxy-calendar-view/month/types.ts +20 -0
- package/components/oxy-calendar-view/monthPanel/index.scss +89 -0
- package/components/oxy-calendar-view/monthPanel/month-panel.vue +374 -0
- package/components/oxy-calendar-view/monthPanel/types.ts +48 -0
- package/components/oxy-calendar-view/oxy-calendar-view.vue +111 -0
- package/components/oxy-calendar-view/types.ts +109 -0
- package/components/oxy-calendar-view/utils.ts +429 -0
- package/components/oxy-calendar-view/year/index.scss +153 -0
- package/components/oxy-calendar-view/year/types.ts +20 -0
- package/components/oxy-calendar-view/year/year.vue +202 -0
- package/components/oxy-calendar-view/yearPanel/index.scss +24 -0
- package/components/oxy-calendar-view/yearPanel/types.ts +38 -0
- package/components/oxy-calendar-view/yearPanel/year-panel.vue +135 -0
- package/components/oxy-card/index.scss +71 -0
- package/components/oxy-card/oxy-card.vue +37 -0
- package/components/oxy-card/types.ts +30 -0
- package/components/oxy-cell/index.scss +206 -0
- package/components/oxy-cell/oxy-cell.vue +140 -0
- package/components/oxy-cell/types.ts +111 -0
- package/components/oxy-cell-group/index.scss +56 -0
- package/components/oxy-cell-group/oxy-cell-group.vue +45 -0
- package/components/oxy-cell-group/types.ts +32 -0
- package/components/oxy-checkbox/index.scss +285 -0
- package/components/oxy-checkbox/oxy-checkbox.vue +177 -0
- package/components/oxy-checkbox/types.ts +68 -0
- package/components/oxy-checkbox-group/index.scss +20 -0
- package/components/oxy-checkbox-group/oxy-checkbox-group.vue +100 -0
- package/components/oxy-checkbox-group/types.ts +59 -0
- package/components/oxy-circle/index.scss +18 -0
- package/components/oxy-circle/oxy-circle.vue +296 -0
- package/components/oxy-circle/types.ts +54 -0
- package/components/oxy-col/index.scss +19 -0
- package/components/oxy-col/oxy-col.vue +49 -0
- package/components/oxy-col/types.ts +15 -0
- package/components/oxy-col-picker/index.scss +168 -0
- package/components/oxy-col-picker/oxy-col-picker.vue +498 -0
- package/components/oxy-col-picker/types.ts +166 -0
- package/components/oxy-collapse/index.scss +55 -0
- package/components/oxy-collapse/oxy-collapse.vue +151 -0
- package/components/oxy-collapse/types.ts +58 -0
- package/components/oxy-collapse-item/index.scss +90 -0
- package/components/oxy-collapse-item/oxy-collapse-item.vue +171 -0
- package/components/oxy-collapse-item/types.ts +48 -0
- package/components/oxy-config-provider/oxy-config-provider.vue +73 -0
- package/components/oxy-config-provider/types.ts +1052 -0
- package/components/oxy-count-down/index.scss +15 -0
- package/components/oxy-count-down/oxy-count-down.vue +60 -0
- package/components/oxy-count-down/types.ts +41 -0
- package/components/oxy-count-down/utils.ts +52 -0
- package/components/oxy-count-to/index.scss +7 -0
- package/components/oxy-count-to/oxy-count-to.vue +125 -0
- package/components/oxy-count-to/types.ts +117 -0
- package/components/oxy-curtain/index.scss +85 -0
- package/components/oxy-curtain/oxy-curtain.vue +172 -0
- package/components/oxy-curtain/types.ts +73 -0
- package/components/oxy-datetime-picker/index.scss +164 -0
- package/components/oxy-datetime-picker/oxy-datetime-picker.vue +801 -0
- package/components/oxy-datetime-picker/types.ts +231 -0
- package/components/oxy-datetime-picker-view/oxy-datetime-picker-view.vue +499 -0
- package/components/oxy-datetime-picker-view/types.ts +120 -0
- package/components/oxy-datetime-picker-view/util.ts +30 -0
- package/components/oxy-design-uni/oxy-design-uni.vue +5 -0
- package/components/oxy-divider/index.scss +100 -0
- package/components/oxy-divider/oxy-divider.vue +52 -0
- package/components/oxy-divider/types.ts +35 -0
- package/components/oxy-drop-menu/index.scss +86 -0
- package/components/oxy-drop-menu/oxy-drop-menu.vue +166 -0
- package/components/oxy-drop-menu/types.ts +38 -0
- package/components/oxy-drop-menu-item/index.scss +66 -0
- package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +221 -0
- package/components/oxy-drop-menu-item/types.ts +94 -0
- package/components/oxy-fab/index.scss +116 -0
- package/components/oxy-fab/oxy-fab.vue +276 -0
- package/components/oxy-fab/types.ts +66 -0
- package/components/oxy-floating-panel/index.scss +64 -0
- package/components/oxy-floating-panel/oxy-floating-panel.vue +140 -0
- package/components/oxy-floating-panel/type.ts +32 -0
- package/components/oxy-form/oxy-form.vue +207 -0
- package/components/oxy-form/types.ts +76 -0
- package/components/oxy-form-item/index.scss +18 -0
- package/components/oxy-form-item/oxy-form-item.vue +56 -0
- package/components/oxy-form-item/types.ts +16 -0
- package/components/oxy-gap/index.scss +9 -0
- package/components/oxy-gap/oxy-gap.vue +36 -0
- package/components/oxy-gap/types.ts +17 -0
- package/components/oxy-grid/index.scss +9 -0
- package/components/oxy-grid/oxy-grid.vue +106 -0
- package/components/oxy-grid/types.ts +50 -0
- package/components/oxy-grid-item/index.scss +148 -0
- package/components/oxy-grid-item/oxy-grid-item.vue +176 -0
- package/components/oxy-grid-item/types.ts +77 -0
- package/components/oxy-icon/index.scss +1230 -0
- package/components/oxy-icon/oxy-icon.vue +53 -0
- package/components/oxy-icon/oxy-icons.ttf +0 -0
- package/components/oxy-icon/types.ts +21 -0
- package/components/oxy-img/index.scss +19 -0
- package/components/oxy-img/oxy-img.vue +81 -0
- package/components/oxy-img/types.ts +61 -0
- package/components/oxy-img-cropper/index.scss +231 -0
- package/components/oxy-img-cropper/oxy-img-cropper.vue +664 -0
- package/components/oxy-img-cropper/types.ts +76 -0
- package/components/oxy-index-anchor/index.scss +35 -0
- package/components/oxy-index-anchor/oxy-index-anchor.vue +55 -0
- package/components/oxy-index-anchor/type.ts +9 -0
- package/components/oxy-index-bar/index.scss +39 -0
- package/components/oxy-index-bar/oxy-index-bar.vue +156 -0
- package/components/oxy-index-bar/type.ts +23 -0
- package/components/oxy-input/index.scss +323 -0
- package/components/oxy-input/oxy-input.vue +300 -0
- package/components/oxy-input/placeholder.scss +21 -0
- package/components/oxy-input/types.ts +189 -0
- package/components/oxy-input-number/index.scss +132 -0
- package/components/oxy-input-number/oxy-input-number.vue +464 -0
- package/components/oxy-input-number/types.ts +101 -0
- package/components/oxy-keyboard/constants.ts +81 -0
- package/components/oxy-keyboard/index.scss +102 -0
- package/components/oxy-keyboard/key/index.scss +79 -0
- package/components/oxy-keyboard/key/index.vue +76 -0
- package/components/oxy-keyboard/key/types.ts +11 -0
- package/components/oxy-keyboard/oxy-keyboard.vue +206 -0
- package/components/oxy-keyboard/types.ts +92 -0
- package/components/oxy-loading/index.scss +37 -0
- package/components/oxy-loading/oxy-loading.vue +90 -0
- package/components/oxy-loading/types.ts +22 -0
- package/components/oxy-loadmore/index.scss +39 -0
- package/components/oxy-loadmore/oxy-loadmore.vue +59 -0
- package/components/oxy-loadmore/types.ts +30 -0
- package/components/oxy-message-box/index.scss +108 -0
- package/components/oxy-message-box/index.ts +87 -0
- package/components/oxy-message-box/oxy-message-box.vue +291 -0
- package/components/oxy-message-box/types.ts +132 -0
- package/components/oxy-navbar/index.scss +93 -0
- package/components/oxy-navbar/oxy-navbar.vue +111 -0
- package/components/oxy-navbar/types.ts +52 -0
- package/components/oxy-navbar-capsule/index.scss +66 -0
- package/components/oxy-navbar-capsule/oxy-navbar-capsule.vue +35 -0
- package/components/oxy-navbar-capsule/types.ts +8 -0
- package/components/oxy-notice-bar/index.scss +68 -0
- package/components/oxy-notice-bar/oxy-notice-bar.vue +266 -0
- package/components/oxy-notice-bar/types.ts +67 -0
- package/components/oxy-notify/index.scss +34 -0
- package/components/oxy-notify/index.ts +61 -0
- package/components/oxy-notify/oxy-notify.vue +85 -0
- package/components/oxy-notify/types.ts +66 -0
- package/components/oxy-number-keyboard/index.scss +78 -0
- package/components/oxy-number-keyboard/key/index.scss +81 -0
- package/components/oxy-number-keyboard/key/index.vue +78 -0
- package/components/oxy-number-keyboard/key/types.ts +11 -0
- package/components/oxy-number-keyboard/oxy-number-keyboard.vue +151 -0
- package/components/oxy-number-keyboard/types.ts +83 -0
- package/components/oxy-overlay/index.scss +17 -0
- package/components/oxy-overlay/oxy-overlay.vue +47 -0
- package/components/oxy-overlay/types.ts +25 -0
- package/components/oxy-pagination/index.scss +57 -0
- package/components/oxy-pagination/oxy-pagination.vue +110 -0
- package/components/oxy-pagination/types.ts +41 -0
- package/components/oxy-password-input/index.scss +124 -0
- package/components/oxy-password-input/oxy-password-input.vue +49 -0
- package/components/oxy-password-input/types.ts +33 -0
- package/components/oxy-picker/index.scss +110 -0
- package/components/oxy-picker/oxy-picker.vue +412 -0
- package/components/oxy-picker/types.ts +189 -0
- package/components/oxy-picker-view/index.scss +92 -0
- package/components/oxy-picker-view/oxy-picker-view.vue +369 -0
- package/components/oxy-picker-view/types.ts +152 -0
- package/components/oxy-popover/index.scss +116 -0
- package/components/oxy-popover/oxy-popover.vue +180 -0
- package/components/oxy-popover/types.ts +69 -0
- package/components/oxy-popup/index.scss +84 -0
- package/components/oxy-popup/oxy-popup.vue +169 -0
- package/components/oxy-popup/types.ts +95 -0
- package/components/oxy-progress/index.scss +68 -0
- package/components/oxy-progress/oxy-progress.vue +197 -0
- package/components/oxy-progress/types.ts +35 -0
- package/components/oxy-radio/index.scss +301 -0
- package/components/oxy-radio/oxy-radio.vue +118 -0
- package/components/oxy-radio/types.ts +42 -0
- package/components/oxy-radio-group/index.scss +23 -0
- package/components/oxy-radio-group/oxy-radio-group.vue +51 -0
- package/components/oxy-radio-group/types.ts +39 -0
- package/components/oxy-rate/index.scss +25 -0
- package/components/oxy-rate/oxy-rate.vue +178 -0
- package/components/oxy-rate/types.ts +103 -0
- package/components/oxy-resize/index.scss +27 -0
- package/components/oxy-resize/oxy-resize.vue +144 -0
- package/components/oxy-resize/types.ts +6 -0
- package/components/oxy-root-portal/oxy-root-portal.vue +50 -0
- package/components/oxy-row/index.scss +10 -0
- package/components/oxy-row/oxy-row.vue +42 -0
- package/components/oxy-row/types.ts +16 -0
- package/components/oxy-search/index.scss +148 -0
- package/components/oxy-search/oxy-search.vue +187 -0
- package/components/oxy-search/types.ts +93 -0
- package/components/oxy-segmented/index.scss +101 -0
- package/components/oxy-segmented/oxy-segmented.vue +143 -0
- package/components/oxy-segmented/types.ts +71 -0
- package/components/oxy-select-picker/index.scss +102 -0
- package/components/oxy-select-picker/oxy-select-picker.vue +432 -0
- package/components/oxy-select-picker/types.ts +123 -0
- package/components/oxy-sidebar/index.scss +25 -0
- package/components/oxy-sidebar/oxy-sidebar.vue +63 -0
- package/components/oxy-sidebar/types.ts +38 -0
- package/components/oxy-sidebar-item/index.scss +97 -0
- package/components/oxy-sidebar-item/oxy-sidebar-item.vue +116 -0
- package/components/oxy-sidebar-item/types.ts +31 -0
- package/components/oxy-signature/index.scss +31 -0
- package/components/oxy-signature/oxy-signature.vue +630 -0
- package/components/oxy-signature/types.ts +108 -0
- package/components/oxy-skeleton/index.scss +96 -0
- package/components/oxy-skeleton/index.ts +1 -0
- package/components/oxy-skeleton/oxy-skeleton.vue +110 -0
- package/components/oxy-skeleton/types.ts +69 -0
- package/components/oxy-slider/index.scss +98 -0
- package/components/oxy-slider/oxy-slider.vue +356 -0
- package/components/oxy-slider/types.ts +138 -0
- package/components/oxy-sort-button/index.scss +89 -0
- package/components/oxy-sort-button/oxy-sort-button.vue +69 -0
- package/components/oxy-sort-button/types.ts +43 -0
- package/components/oxy-status-tip/images/collect.png +0 -0
- package/components/oxy-status-tip/images/content.png +0 -0
- package/components/oxy-status-tip/images/network.png +0 -0
- package/components/oxy-status-tip/images/search.png +0 -0
- package/components/oxy-status-tip/index.scss +37 -0
- package/components/oxy-status-tip/oxy-status-tip.vue +71 -0
- package/components/oxy-status-tip/types.ts +50 -0
- package/components/oxy-step/index.scss +235 -0
- package/components/oxy-step/oxy-step.vue +150 -0
- package/components/oxy-step/types.ts +33 -0
- package/components/oxy-steps/index.scss +10 -0
- package/components/oxy-steps/oxy-steps.vue +28 -0
- package/components/oxy-steps/types.ts +50 -0
- package/components/oxy-sticky/index.scss +9 -0
- package/components/oxy-sticky/oxy-sticky.vue +190 -0
- package/components/oxy-sticky/types.ts +13 -0
- package/components/oxy-sticky-box/index.scss +6 -0
- package/components/oxy-sticky-box/oxy-sticky-box.vue +155 -0
- package/components/oxy-sticky-box/types.ts +11 -0
- package/components/oxy-swipe-action/index.scss +22 -0
- package/components/oxy-swipe-action/oxy-swipe-action.vue +294 -0
- package/components/oxy-swipe-action/types.ts +40 -0
- package/components/oxy-swiper/index.scss +53 -0
- package/components/oxy-swiper/oxy-swiper.vue +318 -0
- package/components/oxy-swiper/types.ts +264 -0
- package/components/oxy-swiper-nav/index.scss +159 -0
- package/components/oxy-swiper-nav/oxy-swiper-nav.vue +37 -0
- package/components/oxy-swiper-nav/types.ts +42 -0
- package/components/oxy-switch/index.scss +58 -0
- package/components/oxy-switch/oxy-switch.vue +83 -0
- package/components/oxy-switch/types.ts +58 -0
- package/components/oxy-tab/index.scss +16 -0
- package/components/oxy-tab/oxy-tab.vue +88 -0
- package/components/oxy-tab/types.ts +30 -0
- package/components/oxy-tabbar/index.scss +62 -0
- package/components/oxy-tabbar/oxy-tabbar.vue +91 -0
- package/components/oxy-tabbar/types.ts +73 -0
- package/components/oxy-tabbar-item/index.scss +55 -0
- package/components/oxy-tabbar-item/oxy-tabbar-item.vue +99 -0
- package/components/oxy-tabbar-item/types.ts +51 -0
- package/components/oxy-table/index.scss +163 -0
- package/components/oxy-table/oxy-table.vue +283 -0
- package/components/oxy-table/types.ts +58 -0
- package/components/oxy-table-col/index.scss +46 -0
- package/components/oxy-table-col/oxy-table-col.vue +149 -0
- package/components/oxy-table-col/types.ts +54 -0
- package/components/oxy-tabs/index.scss +299 -0
- package/components/oxy-tabs/oxy-tabs.vue +443 -0
- package/components/oxy-tabs/types.ts +107 -0
- package/components/oxy-tag/index.scss +115 -0
- package/components/oxy-tag/oxy-tag.vue +148 -0
- package/components/oxy-tag/types.ts +81 -0
- package/components/oxy-text/index.scss +37 -0
- package/components/oxy-text/oxy-text.vue +139 -0
- package/components/oxy-text/types.ts +98 -0
- package/components/oxy-textarea/index.scss +340 -0
- package/components/oxy-textarea/oxy-textarea.vue +296 -0
- package/components/oxy-textarea/placeholder.scss +20 -0
- package/components/oxy-textarea/types.ts +288 -0
- package/components/oxy-toast/index.scss +75 -0
- package/components/oxy-toast/index.ts +92 -0
- package/components/oxy-toast/oxy-toast.vue +198 -0
- package/components/oxy-toast/types.ts +181 -0
- package/components/oxy-tooltip/index.scss +66 -0
- package/components/oxy-tooltip/oxy-tooltip.vue +141 -0
- package/components/oxy-tooltip/types.ts +107 -0
- package/components/oxy-transition/index.scss +95 -0
- package/components/oxy-transition/oxy-transition.vue +232 -0
- package/components/oxy-transition/types.ts +98 -0
- package/components/oxy-upload/index.scss +175 -0
- package/components/oxy-upload/oxy-upload.vue +673 -0
- package/components/oxy-upload/types.ts +391 -0
- package/components/oxy-video-preview/index.scss +34 -0
- package/components/oxy-video-preview/oxy-video-preview.vue +72 -0
- package/components/oxy-video-preview/types.ts +23 -0
- package/components/oxy-watermark/index.scss +18 -0
- package/components/oxy-watermark/oxy-watermark.vue +486 -0
- package/components/oxy-watermark/types.ts +76 -0
- package/dayjs/constant.js +26 -0
- package/dayjs/index.d.ts +430 -0
- package/dayjs/index.js +542 -0
- package/dayjs/locale/en.js +13 -0
- package/dayjs/utils.js +59 -0
- package/global.d.ts +101 -0
- package/index.ts +12 -0
- package/locale/index.ts +32 -0
- package/locale/lang/ar-SA.ts +133 -0
- package/locale/lang/en-US.ts +133 -0
- package/locale/lang/zh-CN.ts +137 -0
- package/package.json +1 -0
- package/tags.json +1 -0
- package/web-types.json +1 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { baseProps, makeStringProp, makeBooleanProp } from '../common/props'
|
|
2
|
+
import type { ButtonProps } from '../oxy-button/types'
|
|
3
|
+
import { type InputSize, type InputType } from '../oxy-input/types'
|
|
4
|
+
|
|
5
|
+
export type MessageType = 'alert' | 'confirm' | 'prompt'
|
|
6
|
+
|
|
7
|
+
export type MessageBeforeConfirmOption = {
|
|
8
|
+
resolve: (isPass: boolean) => void
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type MessageOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* 标题
|
|
14
|
+
*/
|
|
15
|
+
title?: string
|
|
16
|
+
/**
|
|
17
|
+
* 是否展示取消按钮
|
|
18
|
+
*/
|
|
19
|
+
showCancelButton?: boolean
|
|
20
|
+
/**
|
|
21
|
+
* 是否支持点击蒙层进行关闭,点击蒙层回调传入的action为'modal'
|
|
22
|
+
*/
|
|
23
|
+
closeOnClickModal?: boolean
|
|
24
|
+
/**
|
|
25
|
+
* 确定按钮文案
|
|
26
|
+
*/
|
|
27
|
+
confirmButtonText?: string
|
|
28
|
+
/**
|
|
29
|
+
* 取消按钮文案
|
|
30
|
+
*/
|
|
31
|
+
cancelButtonText?: string
|
|
32
|
+
/**
|
|
33
|
+
* 消息文案
|
|
34
|
+
*/
|
|
35
|
+
msg?: string
|
|
36
|
+
/**
|
|
37
|
+
* 弹框类型
|
|
38
|
+
*/
|
|
39
|
+
type?: MessageType
|
|
40
|
+
/**
|
|
41
|
+
* 当type为prompt时,输入框类型
|
|
42
|
+
*/
|
|
43
|
+
inputType?: InputType
|
|
44
|
+
/**
|
|
45
|
+
* 设置输入框大小,可选值:large
|
|
46
|
+
*/
|
|
47
|
+
inputSize?: InputSize
|
|
48
|
+
/**
|
|
49
|
+
* 当type为prompt时,输入框初始值
|
|
50
|
+
*/
|
|
51
|
+
inputValue?: string | number
|
|
52
|
+
/**
|
|
53
|
+
* 当type为prompt时,输入框placeholder
|
|
54
|
+
*/
|
|
55
|
+
inputPlaceholder?: string
|
|
56
|
+
/**
|
|
57
|
+
* 当type为prompt时,输入框正则校验,点击确定按钮时进行校验
|
|
58
|
+
*/
|
|
59
|
+
inputPattern?: RegExp
|
|
60
|
+
/**
|
|
61
|
+
* 当type为prompt时,输入框校验函数,点击确定按钮时进行校验
|
|
62
|
+
*/
|
|
63
|
+
inputValidate?: InputValidate
|
|
64
|
+
/**
|
|
65
|
+
* 当type为prompt时,输入框检验不通过时的错误提示文案
|
|
66
|
+
*/
|
|
67
|
+
inputError?: string
|
|
68
|
+
/**
|
|
69
|
+
* 是否展示错误信息
|
|
70
|
+
*/
|
|
71
|
+
showErr?: boolean
|
|
72
|
+
/**
|
|
73
|
+
* 弹窗层级
|
|
74
|
+
*/
|
|
75
|
+
zIndex?: number
|
|
76
|
+
/**
|
|
77
|
+
* 弹层内容懒渲染,触发展示时才渲染内容
|
|
78
|
+
*/
|
|
79
|
+
lazyRender?: boolean
|
|
80
|
+
/**
|
|
81
|
+
* 确认前钩子
|
|
82
|
+
*/
|
|
83
|
+
beforeConfirm?: (options: MessageBeforeConfirmOption) => void
|
|
84
|
+
/**
|
|
85
|
+
* 取消按钮Props
|
|
86
|
+
*/
|
|
87
|
+
cancelButtonProps?: Partial<ButtonProps>
|
|
88
|
+
/**
|
|
89
|
+
* 确认按钮Props
|
|
90
|
+
*/
|
|
91
|
+
confirmButtonProps?: Partial<ButtonProps>
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type MessageOptionsWithCallBack = MessageOptions & {
|
|
95
|
+
show?: boolean
|
|
96
|
+
success?: (res: MessageResult) => void
|
|
97
|
+
fail?: (res: MessageResult) => void
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type ActionType = 'confirm' | 'cancel' | 'modal'
|
|
101
|
+
|
|
102
|
+
export type InputValidate = (inputValue: string | number) => boolean
|
|
103
|
+
|
|
104
|
+
export interface MessageResult {
|
|
105
|
+
action: ActionType
|
|
106
|
+
value?: string | number
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface Message {
|
|
110
|
+
// 打开Message
|
|
111
|
+
show(toastOptions: MessageOptions | string): Promise<MessageResult>
|
|
112
|
+
// 打开Alert 弹框
|
|
113
|
+
alert(toastOptions: MessageOptions | string): Promise<MessageResult>
|
|
114
|
+
// 打开Confirm 弹框
|
|
115
|
+
confirm(toastOptions: MessageOptions | string): Promise<MessageResult>
|
|
116
|
+
// 打开Prompt 弹框
|
|
117
|
+
prompt(toastOptions: MessageOptions | string): Promise<MessageResult>
|
|
118
|
+
// 关闭Message
|
|
119
|
+
close(): void
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const messageBoxProps = {
|
|
123
|
+
...baseProps,
|
|
124
|
+
/**
|
|
125
|
+
* 指定唯一标识
|
|
126
|
+
*/
|
|
127
|
+
selector: makeStringProp(''),
|
|
128
|
+
/**
|
|
129
|
+
* 是否从页面中脱离出来,用于解决各种 fixed 失效问题 (H5: teleport, APP: renderjs, 小程序: root-portal)
|
|
130
|
+
*/
|
|
131
|
+
rootPortal: makeBooleanProp(false)
|
|
132
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
@import "./../common/abstracts/_mixin.scss";
|
|
2
|
+
@import "./../common/abstracts/variable.scss";
|
|
3
|
+
|
|
4
|
+
.oxy-theme-dark {
|
|
5
|
+
@include b(navbar) {
|
|
6
|
+
background-color: $-dark-background;
|
|
7
|
+
|
|
8
|
+
@include e(title) {
|
|
9
|
+
color: $-dark-color;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@include e(text) {
|
|
13
|
+
color: $-dark-color;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:deep(.oxy-navbar__arrow) {
|
|
17
|
+
color: $-dark-color;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@include b(navbar) {
|
|
24
|
+
position: relative;
|
|
25
|
+
text-align: center;
|
|
26
|
+
user-select: none;
|
|
27
|
+
height: $-navbar-height;
|
|
28
|
+
line-height: $-navbar-height;
|
|
29
|
+
background-color: $-navbar-background;
|
|
30
|
+
box-sizing: content-box;
|
|
31
|
+
|
|
32
|
+
@include e(content) {
|
|
33
|
+
position: relative;
|
|
34
|
+
height: 100%;
|
|
35
|
+
width: 100%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@include e(title) {
|
|
39
|
+
max-width: 60%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
margin: 0 auto;
|
|
42
|
+
color: $-navbar-color;
|
|
43
|
+
font-weight: $-navbar-title-font-weight;
|
|
44
|
+
font-size: $-navbar-title-font-size;
|
|
45
|
+
@include lineEllipsis();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@include e(text) {
|
|
49
|
+
display: inline-block;
|
|
50
|
+
vertical-align: middle;
|
|
51
|
+
color: $-navbar-desc-font-color;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@include e(left, right, capsule) {
|
|
55
|
+
position: absolute;
|
|
56
|
+
top: 0;
|
|
57
|
+
bottom: 0;
|
|
58
|
+
font-size: $-navbar-desc-font-size;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
padding: 0 12px;
|
|
62
|
+
|
|
63
|
+
@include when(disabled) {
|
|
64
|
+
opacity: $-navbar-disabled-opacity;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@include e(left, capsule) {
|
|
69
|
+
left: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@include e(right) {
|
|
73
|
+
right: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@include edeep(arrow) {
|
|
77
|
+
font-size: $-navbar-arrow-size;
|
|
78
|
+
color: $-navbar-color;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
@include when(border) {
|
|
83
|
+
@include halfPixelBorder('bottom');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@include when(fixed) {
|
|
87
|
+
position: fixed;
|
|
88
|
+
top: 0;
|
|
89
|
+
left: 0;
|
|
90
|
+
width: 100%;
|
|
91
|
+
z-index: 500;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :style="{ height: addUnit(height) }">
|
|
3
|
+
<view :class="`oxy-navbar ${customClass} ${fixed ? 'is-fixed' : ''} ${bordered ? 'is-border' : ''}`" :style="rootStyle">
|
|
4
|
+
<view class="oxy-navbar__content">
|
|
5
|
+
<view class="oxy-navbar__capsule" v-if="$slots.capsule">
|
|
6
|
+
<slot name="capsule" />
|
|
7
|
+
</view>
|
|
8
|
+
|
|
9
|
+
<view :class="`oxy-navbar__left ${leftDisabled ? 'is-disabled' : ''}`" @click="handleClickLeft" v-else-if="!$slots.left">
|
|
10
|
+
<oxy-icon v-if="leftArrow" name="arrow-left" custom-class="oxy-navbar__arrow" />
|
|
11
|
+
<view v-if="leftText" class="oxy-navbar__text">{{ leftText }}</view>
|
|
12
|
+
</view>
|
|
13
|
+
|
|
14
|
+
<view v-else :class="`oxy-navbar__left ${leftDisabled ? 'is-disabled' : ''}`" @click="handleClickLeft">
|
|
15
|
+
<slot name="left" />
|
|
16
|
+
</view>
|
|
17
|
+
|
|
18
|
+
<view class="oxy-navbar__title">
|
|
19
|
+
<slot name="title" />
|
|
20
|
+
<block v-if="!$slots.title && title">{{ title }}</block>
|
|
21
|
+
</view>
|
|
22
|
+
<view :class="`oxy-navbar__right ${rightDisabled ? 'is-disabled' : ''}`" @click="handleClickRight" v-if="$slots.right || rightText">
|
|
23
|
+
<slot name="right" />
|
|
24
|
+
|
|
25
|
+
<view v-if="!$slots.right && rightText" class="oxy-navbar__text" hover-class="oxy-navbar__text--hover" :hover-stay-time="70">
|
|
26
|
+
{{ rightText }}
|
|
27
|
+
</view>
|
|
28
|
+
</view>
|
|
29
|
+
</view>
|
|
30
|
+
</view>
|
|
31
|
+
</view>
|
|
32
|
+
</template>
|
|
33
|
+
<script lang="ts">
|
|
34
|
+
export default {
|
|
35
|
+
name: 'oxy-navbar',
|
|
36
|
+
options: {
|
|
37
|
+
virtualHost: true,
|
|
38
|
+
addGlobalClass: true,
|
|
39
|
+
styleIsolation: 'shared'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<script lang="ts" setup>
|
|
45
|
+
import OxyIcon from '../oxy-icon/oxy-icon.vue'
|
|
46
|
+
import { type CSSProperties, computed, getCurrentInstance, nextTick, onMounted, ref, watch } from 'vue'
|
|
47
|
+
import { getRect, addUnit, isDef, objToStyle } from '../common/util'
|
|
48
|
+
import { navbarProps } from './types'
|
|
49
|
+
|
|
50
|
+
const props = defineProps(navbarProps)
|
|
51
|
+
const emit = defineEmits(['click-left', 'click-right'])
|
|
52
|
+
|
|
53
|
+
const height = ref<number | ''>('') // 占位高度
|
|
54
|
+
|
|
55
|
+
const { statusBarHeight } = uni.getSystemInfoSync()
|
|
56
|
+
|
|
57
|
+
watch(
|
|
58
|
+
[() => props.fixed, () => props.placeholder],
|
|
59
|
+
() => {
|
|
60
|
+
setPlaceholderHeight()
|
|
61
|
+
},
|
|
62
|
+
{ deep: true, immediate: false }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
const rootStyle = computed(() => {
|
|
66
|
+
const style: CSSProperties = {}
|
|
67
|
+
if (props.fixed && isDef(props.zIndex)) {
|
|
68
|
+
style['z-index'] = props.zIndex
|
|
69
|
+
}
|
|
70
|
+
if (props.safeAreaInsetTop) {
|
|
71
|
+
style['padding-top'] = addUnit(statusBarHeight || 0)
|
|
72
|
+
}
|
|
73
|
+
return `${objToStyle(style)}${props.customStyle}`
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
onMounted(() => {
|
|
77
|
+
if (props.fixed && props.placeholder) {
|
|
78
|
+
nextTick(() => {
|
|
79
|
+
setPlaceholderHeight()
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
function handleClickLeft() {
|
|
85
|
+
if (!props.leftDisabled) {
|
|
86
|
+
emit('click-left')
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function handleClickRight() {
|
|
91
|
+
if (!props.rightDisabled) {
|
|
92
|
+
emit('click-right')
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const { proxy } = getCurrentInstance() as any
|
|
97
|
+
|
|
98
|
+
function setPlaceholderHeight() {
|
|
99
|
+
if (!props.fixed || !props.placeholder) {
|
|
100
|
+
return
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
getRect('.oxy-navbar', false, proxy).then((res) => {
|
|
104
|
+
height.value = res.height as number
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<style lang="scss">
|
|
110
|
+
@import './index.scss';
|
|
111
|
+
</style>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue'
|
|
2
|
+
import { baseProps, makeBooleanProp, makeNumberProp } from '../common/props'
|
|
3
|
+
|
|
4
|
+
export const navbarProps = {
|
|
5
|
+
...baseProps,
|
|
6
|
+
/**
|
|
7
|
+
* 标题文字
|
|
8
|
+
*/
|
|
9
|
+
title: String,
|
|
10
|
+
/**
|
|
11
|
+
* 左侧文案
|
|
12
|
+
*/
|
|
13
|
+
leftText: String,
|
|
14
|
+
/**
|
|
15
|
+
* 右侧文案
|
|
16
|
+
*/
|
|
17
|
+
rightText: String,
|
|
18
|
+
/**
|
|
19
|
+
* 是否显示左侧箭头
|
|
20
|
+
*/
|
|
21
|
+
leftArrow: makeBooleanProp(false),
|
|
22
|
+
/**
|
|
23
|
+
* 是否显示下边框
|
|
24
|
+
*/
|
|
25
|
+
bordered: makeBooleanProp(true),
|
|
26
|
+
/**
|
|
27
|
+
* 是否固定到顶部
|
|
28
|
+
*/
|
|
29
|
+
fixed: makeBooleanProp(false),
|
|
30
|
+
/**
|
|
31
|
+
* 固定在顶部时,是否在标签位置生成一个等高的占位元素
|
|
32
|
+
*/
|
|
33
|
+
placeholder: makeBooleanProp(false),
|
|
34
|
+
/**
|
|
35
|
+
* 导航栏 z-index
|
|
36
|
+
*/
|
|
37
|
+
zIndex: makeNumberProp(500),
|
|
38
|
+
/**
|
|
39
|
+
* 是否开启顶部安全区适配
|
|
40
|
+
*/
|
|
41
|
+
safeAreaInsetTop: makeBooleanProp(false),
|
|
42
|
+
/**
|
|
43
|
+
* 是否禁用左侧按钮,禁用时透明度降低,且无法点击
|
|
44
|
+
*/
|
|
45
|
+
leftDisabled: makeBooleanProp(false),
|
|
46
|
+
/**
|
|
47
|
+
* 是否禁用右侧按钮,禁用时透明度降低,且无法点击
|
|
48
|
+
*/
|
|
49
|
+
rightDisabled: makeBooleanProp(false)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type NavbarProps = ExtractPropTypes<typeof navbarProps>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
@import "./../common/abstracts/_mixin.scss";
|
|
2
|
+
@import "./../common/abstracts/variable.scss";
|
|
3
|
+
|
|
4
|
+
.oxy-theme-dark {
|
|
5
|
+
@include b(navbar-capsule) {
|
|
6
|
+
&::before {
|
|
7
|
+
border: 2rpx solid $-dark-border-color;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&::after {
|
|
11
|
+
background: $-dark-border-color;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:deep(.oxy-navbar-capsule__icon) {
|
|
15
|
+
color: $-dark-color;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@include b(navbar-capsule) {
|
|
22
|
+
position: relative;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
width: $-navbar-capsule-width;
|
|
25
|
+
height: $-navbar-capsule-height;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
|
|
30
|
+
&::before {
|
|
31
|
+
content: '';
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 0;
|
|
34
|
+
left: 0;
|
|
35
|
+
width: 200%;
|
|
36
|
+
height: 200%;
|
|
37
|
+
transform: scale(0.5);
|
|
38
|
+
transform-origin: 0 0;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
border-radius: calc($-navbar-capsule-border-radius * 2);
|
|
41
|
+
border: 2rpx solid $-navbar-capsule-border-color;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&::after {
|
|
45
|
+
content: '';
|
|
46
|
+
display: block;
|
|
47
|
+
position: absolute;
|
|
48
|
+
left: 50%;
|
|
49
|
+
top: 50%;
|
|
50
|
+
transform: translateY(-50%);
|
|
51
|
+
width: 1px;
|
|
52
|
+
height: 36rpx;
|
|
53
|
+
background: $-navbar-capsule-border-color;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:empty {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@include edeep(icon) {
|
|
61
|
+
flex: 1;
|
|
62
|
+
position: relative;
|
|
63
|
+
color: $-navbar-desc-font-color;
|
|
64
|
+
font-size: $-navbar-capsule-icon-size;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="`oxy-navbar-capsule ${customClass}`" :style="customStyle">
|
|
3
|
+
<oxy-icon @click="handleBack" name="chevron-left" custom-class="oxy-navbar-capsule__icon" />
|
|
4
|
+
<oxy-icon @click="handleBackHome" name="home" custom-class="oxy-navbar-capsule__icon" />
|
|
5
|
+
</view>
|
|
6
|
+
</template>
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
export default {
|
|
9
|
+
name: 'oxy-navbar-capsule',
|
|
10
|
+
options: {
|
|
11
|
+
virtualHost: true,
|
|
12
|
+
addGlobalClass: true,
|
|
13
|
+
styleIsolation: 'shared'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import OxyIcon from '../oxy-icon/oxy-icon.vue'
|
|
20
|
+
import { navbarCapsuleProps } from './types'
|
|
21
|
+
|
|
22
|
+
const emit = defineEmits(['back', 'back-home'])
|
|
23
|
+
defineProps(navbarCapsuleProps)
|
|
24
|
+
|
|
25
|
+
function handleBack() {
|
|
26
|
+
emit('back')
|
|
27
|
+
}
|
|
28
|
+
function handleBackHome() {
|
|
29
|
+
emit('back-home')
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<style lang="scss">
|
|
34
|
+
@import './index.scss';
|
|
35
|
+
</style>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
@import '../common/abstracts/variable';
|
|
2
|
+
@import '../common/abstracts/mixin';
|
|
3
|
+
|
|
4
|
+
@include b(notice-bar) {
|
|
5
|
+
display: flex;
|
|
6
|
+
padding: $-notice-bar-padding;
|
|
7
|
+
align-items: center;
|
|
8
|
+
font-size: $-notice-bar-fs;
|
|
9
|
+
border-radius: $-notice-bar-border-radius;
|
|
10
|
+
position: relative;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
@include when(warning) {
|
|
13
|
+
background: $-notice-bar-warning-bg;
|
|
14
|
+
color: $-notice-bar-warning-color;
|
|
15
|
+
}
|
|
16
|
+
@include when(info) {
|
|
17
|
+
background: $-notice-bar-info-bg;
|
|
18
|
+
color: $-notice-bar-info-color;
|
|
19
|
+
}
|
|
20
|
+
@include when(danger) {
|
|
21
|
+
background: $-notice-bar-danger-bg;
|
|
22
|
+
color: $-notice-bar-danger-color;
|
|
23
|
+
}
|
|
24
|
+
@include edeep(prefix) {
|
|
25
|
+
padding-right: 4px;
|
|
26
|
+
font-size: $-notice-bar-prefix-size;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@include edeep(suffix) {
|
|
30
|
+
text-align: center;
|
|
31
|
+
font-size: $-notice-bar-close-size;
|
|
32
|
+
display: inline-block;
|
|
33
|
+
background-color: $-notice-bar-close-bg;
|
|
34
|
+
color: $-notice-bar-close-color;
|
|
35
|
+
padding: 0;
|
|
36
|
+
border-radius: 0px 8px 0px 4px;
|
|
37
|
+
position: absolute;
|
|
38
|
+
right: 0;
|
|
39
|
+
top: 0;
|
|
40
|
+
}
|
|
41
|
+
@include e(wrap) {
|
|
42
|
+
position: relative;
|
|
43
|
+
flex: 1;
|
|
44
|
+
height: $-notice-bar-line-height;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
line-height: $-notice-bar-line-height;
|
|
47
|
+
}
|
|
48
|
+
@include e(content) {
|
|
49
|
+
position: absolute;
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
}
|
|
52
|
+
@include m(ellipse) {
|
|
53
|
+
.oxy-notice-bar__content {
|
|
54
|
+
position: static;
|
|
55
|
+
@include lineEllipsis;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
@include m(wrap) {
|
|
59
|
+
|
|
60
|
+
.oxy-notice-bar__wrap {
|
|
61
|
+
height: auto;
|
|
62
|
+
}
|
|
63
|
+
.oxy-notice-bar__content {
|
|
64
|
+
position: static;
|
|
65
|
+
white-space: normal;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|