oxy-uni-ui 2.1.1 → 2.1.3
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/attributes.json +1 -1
- package/components/common/AbortablePromise.ts +4 -0
- package/components/common/abstracts/variable.scss +185 -68
- package/components/common/base64.ts +6 -0
- package/components/common/clickoutside.ts +5 -0
- package/components/common/interceptor.ts +9 -0
- package/components/common/path.ts +4 -0
- package/components/common/props.ts +23 -0
- package/components/common/util.ts +18 -1
- package/components/composables/index.ts +2 -0
- package/components/composables/useCell.ts +8 -1
- package/components/composables/useChildren.ts +27 -1
- package/components/composables/useCountDown.ts +10 -1
- package/components/composables/useDynamicVirtualScroll.ts +9 -0
- package/components/composables/useGlobalLoading.ts +6 -0
- package/components/composables/useGlobalMessage.ts +6 -0
- package/components/composables/useGlobalToast.ts +6 -0
- package/components/composables/useLockScroll.ts +9 -0
- package/components/composables/useParent.ts +65 -14
- package/components/composables/usePopover.ts +9 -0
- package/components/composables/useQueue.ts +8 -0
- package/components/composables/useRaf.ts +10 -0
- package/components/composables/useSharedState.ts +284 -0
- package/components/composables/useTouch.ts +8 -0
- package/components/composables/useTranslate.ts +9 -0
- package/components/composables/useUpload.ts +83 -11
- package/components/composables/useVirtualScroll.ts +7 -0
- package/components/composables/useWindowResize.ts +9 -0
- package/components/oxy-action-sheet/index.scss +5 -5
- package/components/oxy-action-sheet/oxy-action-sheet.vue +11 -0
- package/components/oxy-backtop/index.scss +2 -2
- package/components/oxy-backtop/oxy-backtop.vue +2 -0
- package/components/oxy-badge/oxy-badge.vue +2 -0
- package/components/oxy-badge/types.ts +3 -0
- package/components/oxy-button/index.scss +13 -13
- package/components/oxy-button/oxy-button.vue +11 -0
- package/components/oxy-button/types.ts +3 -3
- package/components/oxy-calendar/index.scss +17 -17
- package/components/oxy-calendar/oxy-calendar.vue +31 -0
- package/components/oxy-calendar/types.ts +3 -0
- package/components/oxy-calendar-view/month/month.vue +2 -0
- package/components/oxy-calendar-view/monthPanel/month-panel.vue +3 -1
- package/components/oxy-calendar-view/monthPanel/types.ts +10 -7
- package/components/oxy-calendar-view/oxy-calendar-view.vue +2 -0
- package/components/oxy-calendar-view/types.ts +3 -1
- package/components/oxy-calendar-view/year/types.ts +33 -1
- package/components/oxy-calendar-view/year/year.vue +2 -0
- package/components/oxy-calendar-view/yearPanel/year-panel.vue +2 -0
- package/components/oxy-card/index.scss +1 -1
- package/components/oxy-card/oxy-card.vue +2 -0
- package/components/oxy-cell/index.scss +3 -1
- package/components/oxy-cell/oxy-cell.vue +6 -4
- package/components/oxy-cell-group/oxy-cell-group.vue +2 -0
- package/components/oxy-checkbox/index.scss +41 -6
- package/components/oxy-checkbox/oxy-checkbox.vue +22 -16
- package/components/oxy-checkbox/types.ts +9 -0
- package/components/oxy-checkbox-group/index.scss +1 -1
- package/components/oxy-checkbox-group/oxy-checkbox-group.vue +2 -0
- package/components/oxy-circle/oxy-circle.vue +2 -0
- package/components/oxy-col/oxy-col.vue +3 -1
- package/components/oxy-col-picker/index.scss +3 -3
- package/components/oxy-col-picker/oxy-col-picker.vue +17 -1
- package/components/oxy-col-picker/types.ts +3 -0
- package/components/oxy-collapse/index.scss +2 -2
- package/components/oxy-collapse/oxy-collapse.vue +9 -0
- package/components/oxy-collapse-item/oxy-collapse-item.vue +4 -2
- package/components/oxy-config-provider/oxy-config-provider.vue +18 -0
- package/components/oxy-config-provider/types.ts +18 -0
- package/components/oxy-corner/index.scss +50 -32
- package/components/oxy-corner/oxy-corner.vue +2 -0
- package/components/oxy-count-down/oxy-count-down.vue +2 -0
- package/components/oxy-count-to/oxy-count-to.vue +12 -1
- package/components/oxy-count-to/types.ts +14 -4
- package/components/oxy-curtain/index.scss +10 -9
- package/components/oxy-curtain/oxy-curtain.vue +2 -0
- package/components/oxy-date-strip/oxy-date-strip.vue +22 -1
- package/components/oxy-date-strip-item/index.scss +4 -4
- package/components/oxy-date-strip-item/oxy-date-strip-item.vue +2 -0
- package/components/oxy-datetime-picker/index.scss +3 -3
- package/components/oxy-datetime-picker/oxy-datetime-picker.vue +11 -1
- package/components/oxy-datetime-picker-view/oxy-datetime-picker-view.vue +2 -0
- package/components/oxy-divider/oxy-divider.vue +2 -0
- package/components/oxy-drop-menu/index.scss +2 -2
- package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -0
- package/components/oxy-drop-menu-item/index.scss +1 -1
- package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +17 -9
- package/components/oxy-echarts/oxy-echarts.vue +2 -0
- package/components/oxy-fab/index.scss +1 -1
- package/components/oxy-fab/oxy-fab.vue +27 -0
- package/components/oxy-file-list/index.scss +9 -9
- package/components/oxy-file-list/oxy-file-list.vue +29 -17
- package/components/oxy-floating-panel/oxy-floating-panel.vue +34 -10
- package/components/oxy-footer/index.scss +7 -0
- package/components/oxy-footer/oxy-footer.vue +4 -2
- package/components/oxy-footer/types.ts +9 -6
- package/components/oxy-form/oxy-form.vue +13 -1
- package/components/oxy-form-item/oxy-form-item.vue +5 -3
- package/components/oxy-gap/oxy-gap.vue +2 -0
- package/components/oxy-global-loading/oxy-global-loading.vue +18 -5
- package/components/oxy-global-message/oxy-global-message.vue +30 -17
- package/components/oxy-global-toast/oxy-global-toast.vue +18 -5
- package/components/oxy-grid/oxy-grid.vue +6 -0
- package/components/oxy-grid-item/index.scss +1 -1
- package/components/oxy-grid-item/oxy-grid-item.vue +22 -20
- package/components/oxy-guidance/index.scss +9 -9
- package/components/oxy-guidance/oxy-guidance.vue +22 -16
- package/components/oxy-icon/oxy-icon.vue +2 -0
- package/components/oxy-icon/types.ts +3 -0
- package/components/oxy-image-preview/index.scss +75 -0
- package/components/oxy-image-preview/index.ts +56 -0
- package/components/oxy-image-preview/oxy-image-preview.vue +221 -0
- package/components/oxy-image-preview/types.ts +164 -0
- package/components/oxy-img/oxy-img.vue +2 -0
- package/components/oxy-img-cropper/index.scss +2 -2
- package/components/oxy-img-cropper/oxy-img-cropper.vue +6 -0
- package/components/oxy-img-lazy/oxy-img-lazy.vue +9 -0
- package/components/oxy-index-anchor/index.scss +1 -1
- package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
- package/components/oxy-index-bar/index.scss +1 -1
- package/components/oxy-index-bar/oxy-index-bar.vue +18 -0
- package/components/oxy-input/index.scss +2 -1
- package/components/oxy-input/oxy-input.vue +18 -4
- package/components/oxy-input/types.ts +6 -0
- package/components/oxy-input-number/index.scss +3 -1
- package/components/oxy-input-number/oxy-input-number.vue +2 -0
- package/components/oxy-keyboard/index.scss +3 -3
- package/components/oxy-keyboard/key/index.vue +2 -0
- package/components/oxy-keyboard/oxy-keyboard.vue +11 -2
- package/components/oxy-link/index.scss +8 -4
- package/components/oxy-link/oxy-link.vue +9 -3
- package/components/oxy-link/types.ts +2 -2
- package/components/oxy-list/oxy-list.vue +2 -0
- package/components/oxy-list/types.ts +7 -0
- package/components/oxy-loading/oxy-loading.vue +6 -0
- package/components/oxy-loadmore/index.scss +1 -1
- package/components/oxy-loadmore/oxy-loadmore.vue +2 -0
- package/components/oxy-long-press-menu/index.scss +1 -1
- package/components/oxy-long-press-menu/oxy-long-press-menu.vue +42 -13
- package/components/oxy-message-box/index.scss +223 -36
- package/components/oxy-message-box/index.ts +49 -23
- package/components/oxy-message-box/oxy-message-box.vue +181 -56
- package/components/oxy-message-box/types.ts +60 -2
- package/components/oxy-navbar/index.scss +1 -1
- package/components/oxy-navbar/oxy-navbar.vue +9 -6
- package/components/oxy-navbar-capsule/oxy-navbar-capsule.vue +2 -0
- package/components/oxy-notice-bar/index.scss +1 -1
- package/components/oxy-notice-bar/oxy-notice-bar.vue +29 -0
- package/components/oxy-notify/index.ts +16 -12
- package/components/oxy-notify/oxy-notify.vue +11 -4
- package/components/oxy-overlay/oxy-overlay.vue +34 -2
- package/components/oxy-pagination/oxy-pagination.vue +2 -0
- package/components/oxy-password-input/oxy-password-input.vue +2 -0
- package/components/oxy-picker/index.scss +7 -7
- package/components/oxy-picker/oxy-picker.vue +11 -0
- package/components/oxy-picker-view/index.scss +1 -1
- package/components/oxy-picker-view/oxy-picker-view.vue +2 -0
- package/components/oxy-popover/index.scss +2 -2
- package/components/oxy-popover/oxy-popover.vue +4 -1
- package/components/oxy-popup/oxy-popup.vue +8 -0
- package/components/oxy-progress/index.scss +2 -2
- package/components/oxy-progress/oxy-progress.vue +7 -0
- package/components/oxy-qrcode/draw.ts +15 -1
- package/components/oxy-qrcode/oxy-qrcode.vue +10 -3
- package/components/oxy-radio/index.scss +8 -8
- package/components/oxy-radio/oxy-radio.vue +13 -11
- package/components/oxy-radio-group/index.scss +1 -1
- package/components/oxy-radio-group/oxy-radio-group.vue +2 -0
- package/components/oxy-rate/oxy-rate.vue +5 -0
- package/components/oxy-rate/types.ts +2 -2
- package/components/oxy-resize/oxy-resize.vue +12 -0
- package/components/oxy-rich-text/index.scss +9 -9
- package/components/oxy-rich-text/oxy-rich-text.vue +6 -0
- package/components/oxy-rich-text/types.ts +15 -0
- package/components/oxy-root-portal/oxy-root-portal.vue +23 -15
- package/components/oxy-row/oxy-row.vue +2 -0
- package/components/oxy-search/index.scss +3 -3
- package/components/oxy-search/oxy-search.vue +19 -0
- package/components/oxy-segmented/index.scss +4 -4
- package/components/oxy-segmented/oxy-segmented.vue +2 -0
- package/components/oxy-select/index.scss +25 -25
- package/components/oxy-select/oxy-select.vue +27 -0
- package/components/oxy-select/types.ts +3 -0
- package/components/oxy-select-picker/index.scss +5 -5
- package/components/oxy-select-picker/oxy-select-picker.vue +7 -0
- package/components/oxy-sidebar/oxy-sidebar.vue +2 -0
- package/components/oxy-sidebar-item/index.scss +3 -3
- package/components/oxy-sidebar-item/oxy-sidebar-item.vue +17 -31
- package/components/oxy-signature/oxy-signature.vue +17 -0
- package/components/oxy-skeleton/oxy-skeleton.vue +7 -1
- package/components/oxy-slide-verify/index.scss +95 -0
- package/components/oxy-slide-verify/oxy-slide-verify.vue +244 -0
- package/components/oxy-slide-verify/types.ts +98 -0
- package/components/oxy-slider/oxy-slider.vue +3 -0
- package/components/oxy-sort-button/index.scss +6 -5
- package/components/oxy-sort-button/oxy-sort-button.vue +6 -0
- package/components/oxy-splitter/index.scss +9 -0
- package/components/oxy-splitter/oxy-splitter.vue +23 -2
- package/components/oxy-splitter-panel/index.scss +7 -5
- package/components/oxy-splitter-panel/oxy-splitter-panel.vue +93 -89
- package/components/oxy-status-tip/index.scss +3 -3
- package/components/oxy-status-tip/oxy-status-tip.vue +2 -0
- package/components/oxy-step/index.scss +4 -4
- package/components/oxy-step/oxy-step.vue +15 -13
- package/components/oxy-steps/oxy-steps.vue +2 -0
- package/components/oxy-sticky/oxy-sticky.vue +5 -3
- package/components/oxy-stream-render/oxy-stream-render.vue +29 -0
- package/components/oxy-swipe-action/oxy-swipe-action.vue +8 -0
- package/components/oxy-swiper/oxy-swiper.vue +6 -0
- package/components/oxy-swiper-nav/index.scss +4 -4
- package/components/oxy-switch/index.scss +6 -3
- package/components/oxy-switch/oxy-switch.vue +10 -0
- package/components/oxy-tab/index.scss +1 -7
- package/components/oxy-tab/oxy-tab.vue +12 -10
- package/components/oxy-tabbar/oxy-tabbar.vue +5 -0
- package/components/oxy-tabbar-item/oxy-tabbar-item.vue +11 -9
- package/components/oxy-table/index.scss +1 -1
- package/components/oxy-table/oxy-table.vue +8 -0
- package/components/oxy-table/types.ts +3 -0
- package/components/oxy-table-col/oxy-table-col.vue +21 -19
- package/components/oxy-tabs/index.scss +11 -11
- package/components/oxy-tabs/oxy-tabs.vue +17 -0
- package/components/oxy-tag/index.scss +176 -17
- package/components/oxy-tag/oxy-tag.vue +29 -2
- package/components/oxy-tag/types.ts +16 -0
- package/components/oxy-text/oxy-text.vue +12 -1
- package/components/oxy-textarea/index.scss +3 -2
- package/components/oxy-textarea/oxy-textarea.vue +10 -4
- package/components/oxy-toast/index.ts +21 -20
- package/components/oxy-toast/oxy-toast.vue +30 -5
- package/components/oxy-toast/types.ts +20 -9
- package/components/oxy-tooltip/index.scss +1 -1
- package/components/oxy-tooltip/oxy-tooltip.vue +2 -0
- package/components/oxy-transition/index.scss +3 -1
- package/components/oxy-transition/oxy-transition.vue +14 -0
- package/components/oxy-tree/index.scss +3 -3
- package/components/oxy-tree/oxy-tree.vue +28 -5
- package/components/oxy-tree/types.ts +57 -1
- package/components/oxy-upload/index.scss +9 -9
- package/components/oxy-upload/oxy-upload.vue +5 -3
- package/components/oxy-verification-code/oxy-verification-code.vue +24 -0
- package/components/oxy-video-preview/index.scss +12 -7
- package/components/oxy-video-preview/index.ts +64 -0
- package/components/oxy-video-preview/oxy-video-preview.vue +102 -31
- package/components/oxy-video-preview/types.ts +54 -8
- package/components/oxy-virtual-scroll/index.scss +1 -1
- package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +2 -0
- package/components/oxy-voice-player/index.scss +64 -64
- package/components/oxy-voice-player/oxy-voice-player.vue +38 -10
- package/components/oxy-waterfall/oxy-waterfall.vue +13 -0
- package/components/oxy-waterfall/types.ts +7 -0
- package/components/oxy-waterfall-item/oxy-waterfall-item.vue +9 -0
- package/components/oxy-watermark/oxy-watermark.vue +2 -0
- package/dev-tools.ts +2 -0
- package/devTools/components/DevToolsOverlay.vue +56 -0
- package/devTools/components/DevToolsUiHost.vue +589 -0
- package/devTools/config.js +55 -0
- package/devTools/core/components/mpDevBubble.vue +174 -0
- package/devTools/core/libs/createH5Bubble.js +156 -0
- package/devTools/core/libs/devCache.js +151 -0
- package/devTools/core/libs/devOptions.js +163 -0
- package/devTools/core/libs/devUi.js +219 -0
- package/devTools/core/libs/drawView.js +140 -0
- package/devTools/core/libs/errorReport.js +64 -0
- package/devTools/core/libs/jsonCompress.js +334 -0
- package/devTools/core/libs/logReport.js +59 -0
- package/devTools/core/libs/pageLinkList.js +125 -0
- package/devTools/core/libs/timeFormat.js +94 -0
- package/devTools/core/proxy/console.js +430 -0
- package/devTools/core/proxy/index.js +36 -0
- package/devTools/core/proxy/request.js +495 -0
- package/devTools/core/proxy/storage.js +113 -0
- package/devTools/core/proxy/uniBus.js +153 -0
- package/devTools/core/proxy/uniListen.js +192 -0
- package/devTools/core/proxy/vueMixin.js +120 -0
- package/devTools/index.js +168 -0
- package/devTools/page/components/bottomTools.vue +1046 -0
- package/devTools/page/components/dialog/addStorage.vue +204 -0
- package/devTools/page/components/dialog/createDir.vue +366 -0
- package/devTools/page/components/dialog/editDialog.vue +192 -0
- package/devTools/page/components/dialog/routeDialog.vue +184 -0
- package/devTools/page/components/dialog/sendRequest.vue +603 -0
- package/devTools/page/components/dialog/textFileEditDialog.vue +391 -0
- package/devTools/page/components/libs/appDelDir.js +86 -0
- package/devTools/page/components/libs/dirReader.js +248 -0
- package/devTools/page/components/libs/fileSize.js +15 -0
- package/devTools/page/components/libs/getRuntimeInfo.js +134 -0
- package/devTools/page/components/listItem/consoleItem.vue +314 -0
- package/devTools/page/components/listItem/errorItem.vue +292 -0
- package/devTools/page/components/listItem/fileSysItem.vue +533 -0
- package/devTools/page/components/listItem/infoList.vue +100 -0
- package/devTools/page/components/listItem/jsRunnerItem.vue +255 -0
- package/devTools/page/components/listItem/logItem.vue +193 -0
- package/devTools/page/components/listItem/networkItem.vue +398 -0
- package/devTools/page/components/listItem/objectAnalysis.vue +651 -0
- package/devTools/page/components/listItem/pages.vue +319 -0
- package/devTools/page/components/listItem/routeItem.vue +153 -0
- package/devTools/page/components/listItem/setting.vue +734 -0
- package/devTools/page/components/listItem/storageList.vue +681 -0
- package/devTools/page/components/listItem/tools.vue +315 -0
- package/devTools/page/components/listItem/vuexList.vue +599 -0
- package/devTools/page/components/main.vue +1867 -0
- package/devTools/page/components/mixins/animationControl.js +91 -0
- package/devTools/page/components/mixins/mp.js +83 -0
- package/devTools/page/components/ui/btnTabs.vue +90 -0
- package/devTools/page/components/ui/codeHisPicker.vue +172 -0
- package/devTools/page/components/ui/h5Cell.vue +13 -0
- package/devTools/page/components/ui/menuBtn.vue +94 -0
- package/devTools/page/components/ui/mobileSwiperScroll.vue +74 -0
- package/devTools/page/components/ui/requestSpeedLimit.vue +52 -0
- package/devTools/page/components/ui/requestTimeoutMock.vue +55 -0
- package/devTools/page/components/ui/subTitleBar.vue +101 -0
- package/devTools/page/static/copy.png +0 -0
- package/devTools/page/static/delete.png +0 -0
- package/devTools/page/static/fileSys/AI.png +0 -0
- package/devTools/page/static/fileSys/DWG.png +0 -0
- package/devTools/page/static/fileSys/EXE.png +0 -0
- package/devTools/page/static/fileSys/GIF.png +0 -0
- package/devTools/page/static/fileSys/HTML.png +0 -0
- package/devTools/page/static/fileSys/PSD.png +0 -0
- package/devTools/page/static/fileSys/RVT.png +0 -0
- package/devTools/page/static/fileSys/SKP.png +0 -0
- package/devTools/page/static/fileSys/SVG.png +0 -0
- package/devTools/page/static/fileSys/excel.png +0 -0
- package/devTools/page/static/fileSys/pdf.png +0 -0
- package/devTools/page/static/fileSys/pptl.png +0 -0
- package/devTools/page/static/fileSys/shipin.png +0 -0
- package/devTools/page/static/fileSys/tupian.png +0 -0
- package/devTools/page/static/fileSys/txt.png +0 -0
- package/devTools/page/static/fileSys/weizhiwenjian.png +0 -0
- package/devTools/page/static/fileSys/wenjianjia.png +0 -0
- package/devTools/page/static/fileSys/word.png +0 -0
- package/devTools/page/static/fileSys/yasuo.png +0 -0
- package/devTools/page/static/fileSys/yinpin.png +0 -0
- package/devTools/page/static/fold.png +0 -0
- package/devTools/page/static/menu.png +0 -0
- package/devTools/page/static/refresh.png +0 -0
- package/devTools/page/static/unfold.png +0 -0
- package/devTools/tools.vue +25 -0
- package/devTools/type/devTools.d.ts +406 -0
- package/global.d.ts +2 -0
- package/index.ts +2 -0
- package/locale/lang/en-US.ts +51 -2
- package/locale/lang/zh-CN.ts +51 -2
- package/oxy-dev-tools/components/DevToolsUiHost.vue +555 -0
- package/oxy-dev-tools/config.js +61 -0
- package/oxy-dev-tools/core/components/mpDevBubble.vue +176 -0
- package/oxy-dev-tools/core/libs/createH5Bubble.js +156 -0
- package/oxy-dev-tools/core/libs/devCache.js +149 -0
- package/oxy-dev-tools/core/libs/devOptions.js +160 -0
- package/oxy-dev-tools/core/libs/devUi.js +219 -0
- package/oxy-dev-tools/core/libs/drawView.js +144 -0
- package/oxy-dev-tools/core/libs/errorReport.js +60 -0
- package/oxy-dev-tools/core/libs/jsonCompress.js +328 -0
- package/oxy-dev-tools/core/libs/logReport.js +55 -0
- package/oxy-dev-tools/core/libs/pageLinkList.js +121 -0
- package/oxy-dev-tools/core/libs/timeFormat.js +93 -0
- package/oxy-dev-tools/core/proxy/console.js +398 -0
- package/oxy-dev-tools/core/proxy/index.js +33 -0
- package/oxy-dev-tools/core/proxy/request.js +473 -0
- package/oxy-dev-tools/core/proxy/storage.js +96 -0
- package/oxy-dev-tools/core/proxy/uniBus.js +148 -0
- package/oxy-dev-tools/core/proxy/uniListen.js +190 -0
- package/oxy-dev-tools/core/proxy/vueMixin.js +115 -0
- package/oxy-dev-tools/index.ts +183 -0
- package/oxy-dev-tools/oxy-dev-tools.vue +62 -0
- package/oxy-dev-tools/page/components/bottomTools.vue +933 -0
- package/oxy-dev-tools/page/components/dialog/addStorage.vue +184 -0
- package/oxy-dev-tools/page/components/dialog/createDir.vue +352 -0
- package/oxy-dev-tools/page/components/dialog/editDialog.vue +178 -0
- package/oxy-dev-tools/page/components/dialog/routeDialog.vue +170 -0
- package/oxy-dev-tools/page/components/dialog/sendRequest.vue +530 -0
- package/oxy-dev-tools/page/components/dialog/textFileEditDialog.vue +379 -0
- package/oxy-dev-tools/page/components/libs/appDelDir.js +77 -0
- package/oxy-dev-tools/page/components/libs/dirReader.js +239 -0
- package/oxy-dev-tools/page/components/libs/fileSize.js +15 -0
- package/oxy-dev-tools/page/components/libs/getRuntimeInfo.js +132 -0
- package/oxy-dev-tools/page/components/listItem/consoleItem.vue +292 -0
- package/oxy-dev-tools/page/components/listItem/errorItem.vue +268 -0
- package/oxy-dev-tools/page/components/listItem/fileSysItem.vue +511 -0
- package/oxy-dev-tools/page/components/listItem/infoList.vue +89 -0
- package/oxy-dev-tools/page/components/listItem/jsRunnerItem.vue +236 -0
- package/oxy-dev-tools/page/components/listItem/logItem.vue +185 -0
- package/oxy-dev-tools/page/components/listItem/networkItem.vue +362 -0
- package/oxy-dev-tools/page/components/listItem/objectAnalysis.vue +642 -0
- package/oxy-dev-tools/page/components/listItem/pages.vue +285 -0
- package/oxy-dev-tools/page/components/listItem/routeItem.vue +140 -0
- package/oxy-dev-tools/page/components/listItem/setting.vue +687 -0
- package/oxy-dev-tools/page/components/listItem/storageList.vue +623 -0
- package/oxy-dev-tools/page/components/listItem/tools.vue +273 -0
- package/oxy-dev-tools/page/components/listItem/vuexList.vue +559 -0
- package/oxy-dev-tools/page/components/main.vue +1824 -0
- package/oxy-dev-tools/page/components/mixins/animationControl.js +80 -0
- package/oxy-dev-tools/page/components/mixins/mp.js +76 -0
- package/oxy-dev-tools/page/components/ui/btnTabs.vue +77 -0
- package/oxy-dev-tools/page/components/ui/codeHisPicker.vue +161 -0
- package/oxy-dev-tools/page/components/ui/h5Cell.vue +13 -0
- package/oxy-dev-tools/page/components/ui/menuBtn.vue +87 -0
- package/oxy-dev-tools/page/components/ui/mobileSwiperScroll.vue +71 -0
- package/oxy-dev-tools/page/components/ui/requestSpeedLimit.vue +47 -0
- package/oxy-dev-tools/page/components/ui/requestTimeoutMock.vue +50 -0
- package/oxy-dev-tools/page/components/ui/subTitleBar.vue +87 -0
- package/oxy-dev-tools/page/static/copy.png +0 -0
- package/oxy-dev-tools/page/static/delete.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/AI.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/DWG.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/EXE.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/GIF.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/HTML.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/PSD.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/RVT.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/SKP.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/SVG.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/excel.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/pdf.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/pptl.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/shipin.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/tupian.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/txt.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/weizhiwenjian.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/wenjianjia.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/word.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/yasuo.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/yinpin.png +0 -0
- package/oxy-dev-tools/page/static/fold.png +0 -0
- package/oxy-dev-tools/page/static/menu.png +0 -0
- package/oxy-dev-tools/page/static/refresh.png +0 -0
- package/oxy-dev-tools/page/static/unfold.png +0 -0
- package/oxy-dev-tools/tools.vue +22 -0
- package/oxy-dev-tools/type/devTools.d.ts +406 -0
- package/package.json +2 -2
- package/styles/all.scss +125 -0
- package/tags.json +1 -1
- package/vite-plugins/vite-plugin-host-class.ts +166 -0
- package/web-types.json +1 -1
|
@@ -27,15 +27,30 @@
|
|
|
27
27
|
@mixin tag-type-style($normalColor, $normalBg) {
|
|
28
28
|
background: $normalBg;
|
|
29
29
|
|
|
30
|
+
@include when(light) {
|
|
31
|
+
color: $normalColor;
|
|
32
|
+
background: transparent;
|
|
33
|
+
position: relative;
|
|
34
|
+
z-index: $-z-index-sticky;
|
|
35
|
+
|
|
36
|
+
&::before {
|
|
37
|
+
content: '';
|
|
38
|
+
position: absolute;
|
|
39
|
+
inset: 0;
|
|
40
|
+
background: $normalBg;
|
|
41
|
+
opacity: $-tag-light-opacity;
|
|
42
|
+
border-radius: inherit;
|
|
43
|
+
z-index: -1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
30
47
|
@include when(plain) {
|
|
31
48
|
background: transparent;
|
|
32
49
|
color: $normalColor;
|
|
33
50
|
border-color: $normalColor;
|
|
34
|
-
padding: 12rpx 20rpx;
|
|
35
51
|
}
|
|
36
52
|
|
|
37
53
|
@include when(round) {
|
|
38
|
-
padding: 12rpx 24rpx;
|
|
39
54
|
background: transparent;
|
|
40
55
|
color: if($normalColor != $-tag-info-color, $normalColor, $-tag-round-color);
|
|
41
56
|
border-color: if($normalColor != $-tag-info-color, $normalColor, $-tag-round-border-color);
|
|
@@ -43,12 +58,7 @@
|
|
|
43
58
|
}
|
|
44
59
|
|
|
45
60
|
@include when(mark) {
|
|
46
|
-
padding: 12rpx 20rpx;
|
|
47
61
|
border-radius: $-tag-mark-radius;
|
|
48
|
-
|
|
49
|
-
@include when(plain) {
|
|
50
|
-
padding: 8rpx 20rpx;
|
|
51
|
-
}
|
|
52
62
|
}
|
|
53
63
|
@include when(active) {
|
|
54
64
|
color: $-tag-primary-color;
|
|
@@ -56,6 +66,146 @@
|
|
|
56
66
|
}
|
|
57
67
|
}
|
|
58
68
|
|
|
69
|
+
@mixin tag-size-style(
|
|
70
|
+
$sizeConfig
|
|
71
|
+
) {
|
|
72
|
+
$fontSize: map-get($sizeConfig, fontSize);
|
|
73
|
+
$paddingY: map-get($sizeConfig, paddingY);
|
|
74
|
+
$paddingX: map-get($sizeConfig, paddingX);
|
|
75
|
+
$roundPaddingX: map-get($sizeConfig, roundPaddingX);
|
|
76
|
+
$plainPaddingY: map-get($sizeConfig, plainPaddingY);
|
|
77
|
+
$markPlainPaddingY: map-get($sizeConfig, markPlainPaddingY);
|
|
78
|
+
$minHeight: map-get($sizeConfig, minHeight);
|
|
79
|
+
$inputHeight: map-get($sizeConfig, inputHeight);
|
|
80
|
+
$iconGap: map-get($sizeConfig, iconGap);
|
|
81
|
+
$closeGap: map-get($sizeConfig, closeGap);
|
|
82
|
+
$dynamicMinWidth: map-get($sizeConfig, dynamicMinWidth);
|
|
83
|
+
$closeSize: map-get($sizeConfig, closeSize);
|
|
84
|
+
$radius: map-get($sizeConfig, radius);
|
|
85
|
+
$roundRadius: map-get($sizeConfig, roundRadius);
|
|
86
|
+
$markRadius: map-get($sizeConfig, markRadius);
|
|
87
|
+
|
|
88
|
+
& {
|
|
89
|
+
font-size: $fontSize;
|
|
90
|
+
padding: $paddingY $paddingX;
|
|
91
|
+
min-height: $minHeight;
|
|
92
|
+
border-radius: $radius;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&.is-round {
|
|
96
|
+
padding: $paddingY $roundPaddingX;
|
|
97
|
+
border-radius: $roundRadius;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&.is-plain {
|
|
101
|
+
padding: $plainPaddingY $paddingX;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&.is-mark {
|
|
105
|
+
padding: $paddingY $paddingX;
|
|
106
|
+
border-radius: $markRadius;
|
|
107
|
+
|
|
108
|
+
&.is-plain {
|
|
109
|
+
padding: $markPlainPaddingY $paddingX;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&.is-dynamic {
|
|
114
|
+
min-width: $dynamicMinWidth;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.oxy-tag__icon {
|
|
118
|
+
margin-right: $iconGap;
|
|
119
|
+
font-size: $fontSize;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.oxy-tag__add-text {
|
|
123
|
+
height: $inputHeight;
|
|
124
|
+
min-height: $inputHeight;
|
|
125
|
+
font-size: $fontSize;
|
|
126
|
+
line-height: $inputHeight;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.oxy-tag__close {
|
|
130
|
+
margin-left: $closeGap;
|
|
131
|
+
font-size: $closeSize;
|
|
132
|
+
width: $closeSize;
|
|
133
|
+
height: $closeSize;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
$-tag-size-default-config: (
|
|
138
|
+
fontSize: $-tag-fs,
|
|
139
|
+
paddingY: 6rpx,
|
|
140
|
+
paddingX: 18rpx,
|
|
141
|
+
roundPaddingX: 22rpx,
|
|
142
|
+
plainPaddingY: 6rpx,
|
|
143
|
+
markPlainPaddingY: 4rpx,
|
|
144
|
+
minHeight: 46rpx,
|
|
145
|
+
inputHeight: 40rpx,
|
|
146
|
+
iconGap: 10rpx,
|
|
147
|
+
closeGap: 12rpx,
|
|
148
|
+
dynamicMinWidth: 148rpx,
|
|
149
|
+
closeSize: $-tag-close-size,
|
|
150
|
+
radius: $-tag-radius,
|
|
151
|
+
roundRadius: $-tag-round-radius,
|
|
152
|
+
markRadius: $-tag-mark-radius
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
$-tag-size-mini-config: (
|
|
156
|
+
fontSize: $-tag-mini-fs,
|
|
157
|
+
paddingY: 2rpx,
|
|
158
|
+
paddingX: 10rpx,
|
|
159
|
+
roundPaddingX: 12rpx,
|
|
160
|
+
plainPaddingY: 2rpx,
|
|
161
|
+
markPlainPaddingY: 2rpx,
|
|
162
|
+
minHeight: 28rpx,
|
|
163
|
+
inputHeight: 26rpx,
|
|
164
|
+
iconGap: 6rpx,
|
|
165
|
+
closeGap: 8rpx,
|
|
166
|
+
dynamicMinWidth: 116rpx,
|
|
167
|
+
closeSize: $-tag-mini-fs,
|
|
168
|
+
radius: $-tag-mini-radius,
|
|
169
|
+
roundRadius: $-tag-round-mini-radius,
|
|
170
|
+
markRadius: $-tag-mark-mini-radius
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
$-tag-size-small-config: (
|
|
174
|
+
fontSize: $-tag-small-fs,
|
|
175
|
+
paddingY: 4rpx,
|
|
176
|
+
paddingX: 14rpx,
|
|
177
|
+
roundPaddingX: 16rpx,
|
|
178
|
+
plainPaddingY: 4rpx,
|
|
179
|
+
markPlainPaddingY: 2rpx,
|
|
180
|
+
minHeight: 34rpx,
|
|
181
|
+
inputHeight: 30rpx,
|
|
182
|
+
iconGap: 8rpx,
|
|
183
|
+
closeGap: 10rpx,
|
|
184
|
+
dynamicMinWidth: 128rpx,
|
|
185
|
+
closeSize: $-tag-small-fs,
|
|
186
|
+
radius: $-tag-small-radius,
|
|
187
|
+
roundRadius: $-tag-round-small-radius,
|
|
188
|
+
markRadius: $-tag-mark-small-radius
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
$-tag-size-large-config: (
|
|
192
|
+
fontSize: $-tag-large-fs,
|
|
193
|
+
paddingY: 8rpx,
|
|
194
|
+
paddingX: 22rpx,
|
|
195
|
+
roundPaddingX: 26rpx,
|
|
196
|
+
plainPaddingY: 8rpx,
|
|
197
|
+
markPlainPaddingY: 6rpx,
|
|
198
|
+
minHeight: 54rpx,
|
|
199
|
+
inputHeight: 48rpx,
|
|
200
|
+
iconGap: 12rpx,
|
|
201
|
+
closeGap: 14rpx,
|
|
202
|
+
dynamicMinWidth: 164rpx,
|
|
203
|
+
closeSize: $-tag-small-fs,
|
|
204
|
+
radius: $-tag-large-radius,
|
|
205
|
+
roundRadius: $-tag-round-large-radius,
|
|
206
|
+
markRadius: $-tag-mark-large-radius
|
|
207
|
+
);
|
|
208
|
+
|
|
59
209
|
@include b(tag) {
|
|
60
210
|
position: relative;
|
|
61
211
|
font-size: $-tag-fs;
|
|
@@ -65,8 +215,8 @@
|
|
|
65
215
|
max-width: 100%;
|
|
66
216
|
box-sizing: border-box;
|
|
67
217
|
color: $-tag-color;
|
|
68
|
-
padding:
|
|
69
|
-
min-height:
|
|
218
|
+
padding: 6rpx 18rpx;
|
|
219
|
+
min-height: 46rpx;
|
|
70
220
|
border: #{$-border-width-base} solid transparent;
|
|
71
221
|
border-radius: $-tag-radius;
|
|
72
222
|
transition: opacity $-transition-duration-base, color $-transition-duration-base, border-color $-transition-duration-base, background-color $-transition-duration-base;
|
|
@@ -89,14 +239,23 @@
|
|
|
89
239
|
@include when(success) {
|
|
90
240
|
@include tag-type-style($-tag-success-color, $-tag-success-bg);
|
|
91
241
|
}
|
|
92
|
-
@include
|
|
93
|
-
|
|
242
|
+
@include tag-size-style($-tag-size-default-config);
|
|
243
|
+
@include when(mini) {
|
|
244
|
+
@include tag-size-style($-tag-size-mini-config);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
@include when(small) {
|
|
248
|
+
@include tag-size-style($-tag-size-small-config);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
@include when(large) {
|
|
252
|
+
@include tag-size-style($-tag-size-large-config);
|
|
94
253
|
}
|
|
95
254
|
|
|
96
255
|
@include when(dynamic) {
|
|
97
256
|
box-sizing: border-box;
|
|
98
257
|
width: auto;
|
|
99
|
-
min-width:
|
|
258
|
+
min-width: 148rpx;
|
|
100
259
|
justify-content: center;
|
|
101
260
|
transition: color .3s, border-color .3s, background-color .3s;
|
|
102
261
|
|
|
@@ -127,7 +286,7 @@
|
|
|
127
286
|
display: inline-flex;
|
|
128
287
|
align-items: center;
|
|
129
288
|
justify-content: center;
|
|
130
|
-
margin-right:
|
|
289
|
+
margin-right: 10rpx;
|
|
131
290
|
font-size: $-tag-fs;
|
|
132
291
|
line-height: 1;
|
|
133
292
|
vertical-align: middle;
|
|
@@ -145,11 +304,11 @@
|
|
|
145
304
|
@include e(add-text) {
|
|
146
305
|
width: 100%;
|
|
147
306
|
min-width: 0;
|
|
148
|
-
height:
|
|
149
|
-
min-height:
|
|
307
|
+
height: 40rpx;
|
|
308
|
+
min-height: 40rpx;
|
|
150
309
|
display: inline-block;
|
|
151
310
|
font-size: $-tag-fs;
|
|
152
|
-
line-height:
|
|
311
|
+
line-height: 40rpx;
|
|
153
312
|
vertical-align: middle;
|
|
154
313
|
color: inherit;
|
|
155
314
|
padding: 0;
|
|
@@ -166,7 +325,7 @@
|
|
|
166
325
|
display: inline-flex;
|
|
167
326
|
align-items: center;
|
|
168
327
|
justify-content: center;
|
|
169
|
-
margin-left: $-spacing-
|
|
328
|
+
margin-left: $-spacing-12;
|
|
170
329
|
margin-right: 0;
|
|
171
330
|
font-size: $-tag-close-size;
|
|
172
331
|
width: $-tag-close-size;
|
|
@@ -35,7 +35,9 @@ export default {
|
|
|
35
35
|
name: 'oxy-tag',
|
|
36
36
|
options: {
|
|
37
37
|
addGlobalClass: true,
|
|
38
|
+
// #ifndef MP-TOUTIAO
|
|
38
39
|
virtualHost: true,
|
|
40
|
+
// #endif
|
|
39
41
|
styleIsolation: 'shared'
|
|
40
42
|
}
|
|
41
43
|
}
|
|
@@ -57,7 +59,16 @@ const dynamicValue = ref<string>('')
|
|
|
57
59
|
const dynamicInput = ref<boolean>(false)
|
|
58
60
|
|
|
59
61
|
watch(
|
|
60
|
-
[
|
|
62
|
+
[
|
|
63
|
+
() => props.useIconSlot,
|
|
64
|
+
() => props.icon,
|
|
65
|
+
() => props.light,
|
|
66
|
+
() => props.plain,
|
|
67
|
+
() => props.dynamic,
|
|
68
|
+
() => props.round,
|
|
69
|
+
() => props.mark,
|
|
70
|
+
() => props.size
|
|
71
|
+
],
|
|
61
72
|
() => {
|
|
62
73
|
computeTagClass()
|
|
63
74
|
},
|
|
@@ -76,6 +87,17 @@ watch(
|
|
|
76
87
|
{ immediate: true }
|
|
77
88
|
)
|
|
78
89
|
|
|
90
|
+
watch(
|
|
91
|
+
() => props.size,
|
|
92
|
+
(newValue) => {
|
|
93
|
+
if (!newValue) return
|
|
94
|
+
const size = ['mini', 'small', 'default', 'large']
|
|
95
|
+
if (size.indexOf(newValue) === -1) console.error(`size must be one of ${size.toString()}`)
|
|
96
|
+
computeTagClass()
|
|
97
|
+
},
|
|
98
|
+
{ immediate: true }
|
|
99
|
+
)
|
|
100
|
+
|
|
79
101
|
watch(
|
|
80
102
|
() => dynamicInput.value,
|
|
81
103
|
() => {
|
|
@@ -107,10 +129,15 @@ const textStyle = computed(() => {
|
|
|
107
129
|
return objToStyle(textStyle)
|
|
108
130
|
})
|
|
109
131
|
|
|
132
|
+
/**
|
|
133
|
+
* 根据 tag 的 type、size、light、plain、round 等属性组合生成样式类名。
|
|
134
|
+
*/
|
|
110
135
|
function computeTagClass() {
|
|
111
|
-
const { type, plain, round, mark, dynamic, icon, useIconSlot } = props
|
|
136
|
+
const { type, size, light, plain, round, mark, dynamic, icon, useIconSlot } = props
|
|
112
137
|
let tagClassList: string[] = []
|
|
113
138
|
type && tagClassList.push(`is-${type}`)
|
|
139
|
+
size && tagClassList.push(`is-${size}`)
|
|
140
|
+
light && tagClassList.push('is-light')
|
|
114
141
|
plain && tagClassList.push('is-plain')
|
|
115
142
|
round && tagClassList.push('is-round')
|
|
116
143
|
mark && tagClassList.push('is-mark')
|
|
@@ -2,6 +2,7 @@ import type { ExtractPropTypes } from 'vue'
|
|
|
2
2
|
import { baseProps, makeBooleanProp, makeStringProp } from '../common/props'
|
|
3
3
|
|
|
4
4
|
export type TagType = 'default' | 'primary' | 'success' | 'warning' | 'danger'
|
|
5
|
+
export type TagSize = 'mini' | 'small' | 'default' | 'large'
|
|
5
6
|
|
|
6
7
|
export const tagProps = {
|
|
7
8
|
...baseProps,
|
|
@@ -21,6 +22,14 @@ export const tagProps = {
|
|
|
21
22
|
*/
|
|
22
23
|
type: makeStringProp<TagType>('default'),
|
|
23
24
|
|
|
25
|
+
/**
|
|
26
|
+
* 标签尺寸
|
|
27
|
+
* 类型:string
|
|
28
|
+
* 可选值:'mini' / 'small' / 'default' / 'large'
|
|
29
|
+
* 默认值:'default'
|
|
30
|
+
*/
|
|
31
|
+
size: makeStringProp<TagSize>('default'),
|
|
32
|
+
|
|
24
33
|
/**
|
|
25
34
|
* 左侧图标
|
|
26
35
|
* 类型:string
|
|
@@ -35,6 +44,13 @@ export const tagProps = {
|
|
|
35
44
|
*/
|
|
36
45
|
closable: makeBooleanProp(false),
|
|
37
46
|
|
|
47
|
+
/**
|
|
48
|
+
* 浅色类型
|
|
49
|
+
* 类型:boolean
|
|
50
|
+
* 默认值:false
|
|
51
|
+
*/
|
|
52
|
+
light: makeBooleanProp(false),
|
|
53
|
+
|
|
38
54
|
/**
|
|
39
55
|
* 幽灵类型
|
|
40
56
|
* 类型:boolean
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
<slot v-if="$slots.prefix || prefix" name="prefix">{{ prefix }}</slot>
|
|
11
11
|
<text>{{ props.toggleExpand && isTextOverflow && !expanded ? realText : formattedText }}</text>
|
|
12
12
|
<slot v-if="$slots.suffix || suffix" name="suffix">{{ suffix }}</slot>
|
|
13
|
-
<text v-if="props.toggleExpand && isTextOverflow" class="oxy-text__btn" @click.stop="handleToggle">
|
|
13
|
+
<text v-if="props.toggleExpand && isTextOverflow" class="oxy-text__btn" @click.stop="handleToggle">
|
|
14
|
+
{{ expanded ? translate('retract') : translate('expand') }}
|
|
15
|
+
</text>
|
|
14
16
|
</text>
|
|
15
17
|
</template>
|
|
16
18
|
|
|
@@ -18,7 +20,9 @@
|
|
|
18
20
|
export default {
|
|
19
21
|
name: 'oxy-text',
|
|
20
22
|
options: {
|
|
23
|
+
// #ifndef MP-TOUTIAO
|
|
21
24
|
virtualHost: true,
|
|
25
|
+
// #endif
|
|
22
26
|
addGlobalClass: true,
|
|
23
27
|
styleIsolation: 'shared'
|
|
24
28
|
}
|
|
@@ -31,10 +35,12 @@ import { isDef, objToStyle, uuid, getRect } from '../common/util'
|
|
|
31
35
|
import { textProps } from './types'
|
|
32
36
|
import dayjs from '../../dayjs'
|
|
33
37
|
import OxyTooltip from '../oxy-tooltip/oxy-tooltip.vue'
|
|
38
|
+
import { useTranslate } from '../composables/useTranslate'
|
|
34
39
|
|
|
35
40
|
// 获取组件的 props 和 emit 函数
|
|
36
41
|
const props = defineProps(textProps)
|
|
37
42
|
const emit = defineEmits(['click'])
|
|
43
|
+
const { translate } = useTranslate('collapse')
|
|
38
44
|
|
|
39
45
|
const { proxy } = getCurrentInstance() as any
|
|
40
46
|
const textId = ref<string>(`oxy-text${uuid()}`)
|
|
@@ -147,6 +153,11 @@ const formattedText = computed(() => {
|
|
|
147
153
|
return formatText(`${text}`, format, mode)
|
|
148
154
|
})
|
|
149
155
|
|
|
156
|
+
/**
|
|
157
|
+
* 文本格式化后检测溢出。
|
|
158
|
+
* toggleExpand/tooltip 模式下:计算实际行数(height/lineHeight),超行则截断文本。
|
|
159
|
+
* 截断时考虑中英文字符宽度差异(中文=1,英文=0.5)。
|
|
160
|
+
*/
|
|
150
161
|
watch(
|
|
151
162
|
formattedText,
|
|
152
163
|
(value) => {
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
|
|
174
174
|
@include e(suffix) {
|
|
175
175
|
position: absolute;
|
|
176
|
-
z-index:
|
|
176
|
+
z-index: $-z-index-sticky;
|
|
177
177
|
right: 0;
|
|
178
178
|
top: 0;
|
|
179
179
|
bottom: 0;
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
position: absolute;
|
|
220
220
|
top: 0;
|
|
221
221
|
left: 0;
|
|
222
|
-
z-index:
|
|
222
|
+
z-index: $-z-index-sticky;
|
|
223
223
|
width: 100%;
|
|
224
224
|
height: 100%;
|
|
225
225
|
}
|
|
@@ -241,6 +241,7 @@
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
@include when(disabled) {
|
|
244
|
+
opacity: $-opacity-disabled;
|
|
244
245
|
|
|
245
246
|
.oxy-textarea__inner {
|
|
246
247
|
color: $-input-disabled-color;
|
|
@@ -67,7 +67,9 @@
|
|
|
67
67
|
export default {
|
|
68
68
|
name: 'oxy-textarea',
|
|
69
69
|
options: {
|
|
70
|
+
// #ifndef MP-TOUTIAO
|
|
70
71
|
virtualHost: true,
|
|
72
|
+
// #endif
|
|
71
73
|
addGlobalClass: true,
|
|
72
74
|
styleIsolation: 'shared'
|
|
73
75
|
}
|
|
@@ -156,8 +158,8 @@ const showWordCount = computed(() => {
|
|
|
156
158
|
|
|
157
159
|
// 表单校验错误信息
|
|
158
160
|
const errorMessage = computed(() => {
|
|
159
|
-
if (form && props.prop && form.errorMessages && form.errorMessages[props.prop]) {
|
|
160
|
-
return form.errorMessages[props.prop]
|
|
161
|
+
if (form.value && props.prop && form.value.errorMessages && form.value.errorMessages[props.prop]) {
|
|
162
|
+
return form.value.errorMessages[props.prop]
|
|
161
163
|
} else {
|
|
162
164
|
return ''
|
|
163
165
|
}
|
|
@@ -166,8 +168,8 @@ const errorMessage = computed(() => {
|
|
|
166
168
|
// 是否展示必填
|
|
167
169
|
const isRequired = computed(() => {
|
|
168
170
|
let formRequired = false
|
|
169
|
-
if (form && form.props.rules) {
|
|
170
|
-
const rules = form.props.rules
|
|
171
|
+
if (form.value && form.value.props.rules) {
|
|
172
|
+
const rules = form.value.props.rules
|
|
171
173
|
for (const key in rules) {
|
|
172
174
|
if (Object.prototype.hasOwnProperty.call(rules, key) && key === props.prop && Array.isArray(rules[key])) {
|
|
173
175
|
formRequired = rules[key].some((rule: FormItemRule) => rule.required)
|
|
@@ -245,6 +247,10 @@ async function handleClear() {
|
|
|
245
247
|
emit('update:modelValue', inputValue.value)
|
|
246
248
|
emit('clear')
|
|
247
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* 失焦处理:延迟 150ms 等待 clear 操作完成
|
|
252
|
+
* 避免清空时重复触发 blur + clear 的连锁反应
|
|
253
|
+
*/
|
|
248
254
|
async function handleBlur({ detail }: any) {
|
|
249
255
|
// 等待150毫秒,clear执行完毕
|
|
250
256
|
await pause(150)
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Toast, ToastOptions } from './types'
|
|
1
|
+
import type { Toast, ToastId, ToastOptions } from './types'
|
|
3
2
|
import { deepMerge } from '../common/util'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* useToast 用到的key
|
|
7
|
-
*/
|
|
8
|
-
const toastDefaultOptionKey = '__TOAST_OPTION__'
|
|
3
|
+
import { createSharedState } from '../composables/useSharedState'
|
|
9
4
|
|
|
10
5
|
// 默认模板
|
|
11
6
|
export const defaultOptions: ToastOptions = {
|
|
@@ -13,16 +8,20 @@ export const defaultOptions: ToastOptions = {
|
|
|
13
8
|
show: false
|
|
14
9
|
}
|
|
15
10
|
|
|
16
|
-
const
|
|
11
|
+
const {
|
|
12
|
+
getState: getToastOptions,
|
|
13
|
+
initState: initToastOptions,
|
|
14
|
+
removeState: removeToastOptions,
|
|
15
|
+
resolveScopeId: resolveToastScopeId,
|
|
16
|
+
resolveStateKey: resolveToastStateKey
|
|
17
|
+
} = createSharedState<ToastOptions>(() => defaultOptions, { namespace: 'toast' })
|
|
18
|
+
|
|
19
|
+
export { getToastOptions, initToastOptions, removeToastOptions, resolveToastScopeId, resolveToastStateKey }
|
|
17
20
|
|
|
18
21
|
export function useToast(selector: string = ''): Toast {
|
|
19
|
-
const toastOptionKey = getToastOptionKey(selector)
|
|
20
|
-
const toastOption = inject(toastOptionKey, ref<ToastOptions | typeof None>(None)) // toast选项
|
|
21
|
-
if (toastOption.value === None) {
|
|
22
|
-
toastOption.value = defaultOptions
|
|
23
|
-
provide(toastOptionKey, toastOption)
|
|
24
|
-
}
|
|
25
22
|
let timer: ReturnType<typeof setTimeout> | null = null
|
|
23
|
+
const scopeId = resolveToastScopeId()
|
|
24
|
+
const id = resolveToastStateKey(selector, scopeId)
|
|
26
25
|
|
|
27
26
|
const createMethod = (toastOptions: ToastOptions) => {
|
|
28
27
|
return (options: ToastOptions | string) => {
|
|
@@ -30,7 +29,8 @@ export function useToast(selector: string = ''): Toast {
|
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
const show = (option: ToastOptions | string) => {
|
|
32
|
+
const show = (option: ToastOptions | string): ToastId => {
|
|
33
|
+
const toastOption = initToastOptions(selector, scopeId)
|
|
34
34
|
const options = deepMerge(defaultOptions, typeof option === 'string' ? { msg: option } : option) as ToastOptions
|
|
35
35
|
toastOption.value = deepMerge(options, {
|
|
36
36
|
show: true
|
|
@@ -43,6 +43,7 @@ export function useToast(selector: string = ''): Toast {
|
|
|
43
43
|
close()
|
|
44
44
|
}, options.duration)
|
|
45
45
|
}
|
|
46
|
+
return resolveToastStateKey(selector, scopeId)
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
const loading = createMethod({
|
|
@@ -59,9 +60,13 @@ export function useToast(selector: string = ''): Toast {
|
|
|
59
60
|
const info = createMethod({ iconName: 'info' })
|
|
60
61
|
|
|
61
62
|
const close = () => {
|
|
62
|
-
toastOption
|
|
63
|
+
const toastOption = initToastOptions(selector, scopeId)
|
|
64
|
+
timer && clearTimeout(timer)
|
|
65
|
+
timer = null
|
|
66
|
+
toastOption.value = { ...defaultOptions, show: false }
|
|
63
67
|
}
|
|
64
68
|
return {
|
|
69
|
+
id,
|
|
65
70
|
show,
|
|
66
71
|
loading,
|
|
67
72
|
success,
|
|
@@ -72,10 +77,6 @@ export function useToast(selector: string = ''): Toast {
|
|
|
72
77
|
}
|
|
73
78
|
}
|
|
74
79
|
|
|
75
|
-
export const getToastOptionKey = (selector: string) => {
|
|
76
|
-
return selector ? `${toastDefaultOptionKey}${selector}` : toastDefaultOptionKey
|
|
77
|
-
}
|
|
78
|
-
|
|
79
80
|
export const toastIcon = {
|
|
80
81
|
success() {
|
|
81
82
|
return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="2 2 44 44" width="48" height="48"><circle cx="24" cy="26" r="22" fill="#000" opacity=".1"/><circle cx="24" cy="24" r="20" fill="#34D19D" opacity=".4"/><circle cx="24" cy="24" r="16" fill="#34D19D"/><path d="M19 24l4 4 8-8" stroke="#FFF" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/></svg>'
|
|
@@ -44,21 +44,24 @@ export default {
|
|
|
44
44
|
name: 'oxy-toast',
|
|
45
45
|
options: {
|
|
46
46
|
addGlobalClass: true,
|
|
47
|
+
// #ifndef MP-TOUTIAO
|
|
47
48
|
virtualHost: true,
|
|
49
|
+
// #endif
|
|
48
50
|
styleIsolation: 'shared'
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
</script>
|
|
52
54
|
|
|
53
55
|
<script lang="ts" setup>
|
|
56
|
+
import { onHide, onUnload } from '@dcloudio/uni-app'
|
|
54
57
|
import OxyIcon from '../oxy-icon/oxy-icon.vue'
|
|
55
58
|
import OxyLoading from '../oxy-loading/oxy-loading.vue'
|
|
56
59
|
import OxyOverlay from '../oxy-overlay/oxy-overlay.vue'
|
|
57
60
|
import OxyTransition from '../oxy-transition/oxy-transition.vue'
|
|
58
61
|
|
|
59
|
-
import { computed,
|
|
62
|
+
import { computed, onBeforeMount, onUnmounted, ref, useSlots, watch, type CSSProperties } from 'vue'
|
|
60
63
|
import base64 from '../common/base64'
|
|
61
|
-
import {
|
|
64
|
+
import { initToastOptions, removeToastOptions, resolveToastScopeId, toastIcon } from '.'
|
|
62
65
|
import { toastProps, type ToastDirection, type ToastLoadingType, type ToastOptions, type ToastProps } from './types'
|
|
63
66
|
import { withDefaultUnit, isDef, isFunction, objToStyle } from '../common/util'
|
|
64
67
|
|
|
@@ -83,8 +86,8 @@ let opened: (() => void) | null = null
|
|
|
83
86
|
|
|
84
87
|
let closed: (() => void) | null = null
|
|
85
88
|
|
|
86
|
-
const
|
|
87
|
-
const toastOption =
|
|
89
|
+
const scopeId = resolveToastScopeId()
|
|
90
|
+
const toastOption = initToastOptions(props.selector, scopeId)
|
|
88
91
|
|
|
89
92
|
// 监听options变化展示
|
|
90
93
|
watch(
|
|
@@ -128,7 +131,7 @@ const transitionStyle = computed(() => {
|
|
|
128
131
|
})
|
|
129
132
|
|
|
130
133
|
const hasCustomContent = computed(() => {
|
|
131
|
-
const slotNodes = slots.default
|
|
134
|
+
const slotNodes = isFunction(slots.default) ? slots.default() : []
|
|
132
135
|
return !!slotNodes?.length
|
|
133
136
|
})
|
|
134
137
|
|
|
@@ -157,6 +160,19 @@ onBeforeMount(() => {
|
|
|
157
160
|
buildSvg()
|
|
158
161
|
})
|
|
159
162
|
|
|
163
|
+
onHide(() => {
|
|
164
|
+
clearToastState()
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
onUnload(() => {
|
|
168
|
+
clearToastState()
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
onUnmounted(() => {
|
|
172
|
+
clearToastState()
|
|
173
|
+
removeToastOptions(props.selector, scopeId)
|
|
174
|
+
})
|
|
175
|
+
|
|
160
176
|
function handleAfterEnter() {
|
|
161
177
|
if (isFunction(opened)) {
|
|
162
178
|
opened()
|
|
@@ -176,6 +192,10 @@ function buildSvg() {
|
|
|
176
192
|
svgStr.value = iconSvgStr
|
|
177
193
|
}
|
|
178
194
|
|
|
195
|
+
function clearToastState() {
|
|
196
|
+
toastOption.value = { ...toastOption.value, show: false }
|
|
197
|
+
}
|
|
198
|
+
|
|
179
199
|
/**
|
|
180
200
|
* 重置toast选项值
|
|
181
201
|
* @param option toast选项值
|
|
@@ -188,6 +208,11 @@ function reset(option: ToastOptions) {
|
|
|
188
208
|
}
|
|
189
209
|
}
|
|
190
210
|
|
|
211
|
+
/**
|
|
212
|
+
* 合并 option 和 props 配置。option 优先级高于 props,用于动态更新 toast 展示状态。
|
|
213
|
+
* @param option - 通过 selector 共享的 toast 运行时选项
|
|
214
|
+
* @param props - 组件的 props 默认值
|
|
215
|
+
*/
|
|
191
216
|
function mergeOptionsWithProps(option: ToastOptions, props: ToastProps) {
|
|
192
217
|
iconName.value = isDef(option.iconName!) ? option.iconName! : props.iconName
|
|
193
218
|
iconClass.value = isDef(option.iconClass!) ? option.iconClass! : props.iconClass
|