From 71d4605326a5221a8f65c936a96bf6ac349acb71 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Tue, 21 Jan 2025 13:25:36 +0800 Subject: [PATCH] chore: build --- packages/uni-h5/dist-x/uni-h5.cjs.js | 2 +- packages/uni-h5/dist-x/uni-h5.es.js | 53 +++++++++++++++---- .../uni_modules/uni-actionSheet/changelog.md | 0 .../pages/actionSheet/actionSheet.vue | 17 +++--- .../uni_modules/uni-actionSheet/readme.md | 6 --- 5 files changed, 50 insertions(+), 28 deletions(-) delete mode 100644 uni-ext-api/uni_modules/uni-actionSheet/changelog.md delete mode 100644 uni-ext-api/uni_modules/uni-actionSheet/readme.md diff --git a/packages/uni-h5/dist-x/uni-h5.cjs.js b/packages/uni-h5/dist-x/uni-h5.cjs.js index 26599306fc9..29446b5514e 100644 --- a/packages/uni-h5/dist-x/uni-h5.cjs.js +++ b/packages/uni-h5/dist-x/uni-h5.cjs.js @@ -113,7 +113,7 @@ function isInstanceOf(value, type) { return value && value[Symbol.iterator]; } const isNativeInstanceofType = value instanceof type; - if (isNativeInstanceofType || typeof value !== "object") { + if (isNativeInstanceofType || typeof value !== "object" || value === null) { return isNativeInstanceofType; } const proto = Object.getPrototypeOf(value).constructor; diff --git a/packages/uni-h5/dist-x/uni-h5.es.js b/packages/uni-h5/dist-x/uni-h5.es.js index 964f7719c28..4aa52234ee3 100644 --- a/packages/uni-h5/dist-x/uni-h5.es.js +++ b/packages/uni-h5/dist-x/uni-h5.es.js @@ -118,7 +118,7 @@ function isInstanceOf(value, type) { return value && value[Symbol.iterator]; } const isNativeInstanceofType = value instanceof type; - if (isNativeInstanceofType || typeof value !== "object") { + if (isNativeInstanceofType || typeof value !== "object" || value === null) { return isNativeInstanceofType; } const proto = Object.getPrototypeOf(value).constructor; @@ -8179,8 +8179,8 @@ const getSystemSafeAreaInsets = function() { let escBackPageNum = 0; const homeDialogPages = []; const homeSystemDialogPages = []; -function getPageWrapperInfo() { - const pageWrapper = document.querySelector("uni-page-wrapper"); +function getPageWrapperInfo(container) { + const pageWrapper = container.querySelector("uni-page-wrapper"); const pageWrapperRect = pageWrapper.getBoundingClientRect(); const bodyRect = document.body.getBoundingClientRect(); return { @@ -8192,6 +8192,9 @@ function getPageWrapperInfo() { height: pageWrapperRect.height }; } +function isDialogPageImpl(page) { + return page instanceof UniDialogPageImpl; +} class UniPageImpl { constructor({ route, @@ -8205,18 +8208,42 @@ class UniPageImpl { this.$vm = vm; } get pageBody() { + var _a; const currentPage = getCurrentPage(); - if (currentPage !== this) { + let container = document; + if (isDialogPageImpl(this)) { + const dialogPages = currentPage.getDialogPages(); + if (dialogPages.indexOf(this) === -1) { + throw new Error("Can't get pageBody of other dialog page"); + } + container = document.querySelector(`uni-page[data-page="${(_a = this.vm) == null ? void 0 : _a.route}"]`); + } else if (this !== currentPage) { throw new Error("Can't get pageBody of other page"); } - return getPageWrapperInfo(); + const pageWrapperInfo = getPageWrapperInfo(container); + return { + top: pageWrapperInfo.top, + left: pageWrapperInfo.left, + right: pageWrapperInfo.left + pageWrapperInfo.width, + bottom: pageWrapperInfo.top + pageWrapperInfo.height, + width: pageWrapperInfo.width, + height: pageWrapperInfo.height + }; } get safeAreaInsets() { + var _a; const currentPage = getCurrentPage(); - if (currentPage !== this) { + let container = document; + if (isDialogPageImpl(this)) { + const dialogPages = currentPage.getDialogPages(); + if (dialogPages.indexOf(this) === -1) { + throw new Error("Can't get safeAreaInsets of other dialog page"); + } + container = document.querySelector(`uni-page[data-page="${(_a = this.vm) == null ? void 0 : _a.route}"]`); + } else if (this !== currentPage) { throw new Error("Can't get safeAreaInsets of other page"); } - const pageWrapperEdge = getPageWrapperInfo(); + const pageWrapperEdge = getPageWrapperInfo(container); const systemSafeAreaInsets = getSystemSafeAreaInsets(); const computeEdge = (bodyEdge, nativeEdge) => { return Math.max(0, nativeEdge - bodyEdge); @@ -27696,7 +27723,8 @@ const _sfc_main$1 = { isLandscape: false, windowWidth: 0, windowHeight: 0, - popover: {} + popover: {}, + bottomNavigationHeight: 0 }; }, onLoad(options) { @@ -27838,10 +27866,13 @@ const _sfc_main$1 = { return this.i18nCancelText["zh-Hant"]; } return "取消"; + }, + computedBackgroundColor() { + return this.backgroundColor !== null ? this.backgroundColor : this.theme == "dark" ? "#2C2C2B" : "#ffffff"; } }, onReady() { - this.bottomNavigationHeight = uni.getWindowInfo().safeAreaInsets.bottom; + this.bottomNavigationHeight = this.$page.safeAreaInsets.bottom; setTimeout(() => { this.show = true; }, 10); @@ -27885,7 +27916,7 @@ const _sfc_main$1 = { } } }; -const _style_0$1 = "\n.uni-action-sheet_dialog__mask {\n position: fixed;\n z-index: 999;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n opacity: 0;\n background-color: rgba(0, 0, 0, 0.6);\n transition: opacity 0.1s;\n}\n.uni-action-sheet_dialog__mask__show {\n opacity: 1;\n}\n.uni-action-sheet_dialog__container {\n position: fixed;\n width: 100%;\n left: 0;\n bottom: 0;\n z-index: 999;\n transform: translate(0, 100%);\n opacity: 0;\n\n\n\n\n transition: transform 0.3s, opacity 0.3s;\n\n background-color: #f7f7f7;\n border-top-left-radius: 12px;\n border-top-right-radius: 12px;\n}\n.uni-action-sheet_dialog__menu {\n border-top-left-radius: 12px;\n border-top-right-radius: 12px;\n overflow: hidden;\n}\n.uni-action-sheet_dialog__container.uni-action-sheet_dialog__show {\n opacity: 1;\n transform: translate(0, 0);\n}\n.uni-action-sheet_dialog__title,\n .uni-action-sheet_dialog__cell,\n .uni-action-sheet_dialog__action {\n padding: 16px;\n}\n.uni-action-sheet_dialog__title__text,\n .uni-action-sheet_dialog__cell__text,\n .uni-action-sheet_dialog__action__text {\n line-height: 1.4;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.uni-action-sheet_dialog__action {\n margin-top: 8px;\n}\n.uni-action-sheet_dialog__title__text {\n color: #666666;\n}\n.uni-action-sheet_dialog__cell__text,\n .uni-action-sheet_dialog__action__text {\n color: #000000;\n}\n.uni-action-sheet_dialog__menu,\n .uni-action-sheet_dialog__action {\n background-color: #ffffff;\n}\n.uni-action-sheet_dialog__title {\n border-bottom: 1px solid #e5e5e5;\n}\n.uni-action-sheet_dialog__cell__container {\n max-height: 330px;\n\n display: block;\n overflow-y: auto;\n scrollbar-width: none;\n}\n.uni-action-sheet_dialog__cell {\n border-top: 1px solid #e5e5e5;\n}\n\n /* dark mode */\n.uni-action-sheet_dialog__container.uni-action-sheet_dark__mode {\n background-color: #1D1E1E;\n}\n.uni-action-sheet_dialog__menu.uni-action-sheet_dark__mode,\n .uni-action-sheet_dialog__action.uni-action-sheet_dark__mode {\n background-color: #2C2C2B;\n}\n.uni-action-sheet_dialog__title.uni-action-sheet_dark__mode {\n border-bottom: 1px solid #2F3131;\n}\n.uni-action-sheet_dialog__cell.uni-action-sheet_dark__mode {\n border-top: 1px solid #2F3131;\n}\n.uni-action-sheet_dialog__title__text.uni-action-sheet_dark__mode {\n color: #999999;\n}\n.uni-action-sheet_dialog__cell__text.uni-action-sheet_dark__mode,\n .uni-action-sheet_dialog__action__text.uni-action-sheet_dark__mode {\n color: #ffffff;\n}\n\n /* landscape mode */\n.uni-action-sheet_dialog__container.uni-action-sheet_landscape__mode {\n width: 300px;\n position: fixed;\n left: 50%;\n right: auto;\n top: 50%;\n bottom: auto;\n z-index: 999;\n transform: translate(-50%, -50%);\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n transition: opacity 0.3s;\n}\n.uni-action-sheet_dialog__menu.uni-action-sheet_landscape__mode {\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n box-shadow: 0 0 20px 5px rgba(0, 0, 0, 0.3);\n}\n.uni-action-sheet_dialog__action.uni-action-sheet_landscape__mode {\n display: none;\n}\n.uni-action-sheet_dialog__cell__container.uni-action-sheet_landscape__mode {\n max-height: 260px;\n}\n.uni-action-sheet_dialog__title.uni-action-sheet_landscape__mode,\n .uni-action-sheet_dialog__cell.uni-action-sheet_landscape__mode,\n .uni-action-sheet_dialog__action.uni-action-sheet_landscape__mode {\n padding: 10px 6px;\n}\n.uni-action-sheet_dialog__menu {\n display: block;\n}\n.uni-action-sheet_dialog__title,\n .uni-action-sheet_dialog__cell,\n .uni-action-sheet_dialog__action {\n display: block;\n text-align: center;\n line-height: 1.4;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.uni-action-sheet_dialog__cell,\n .uni-action-sheet_dialog__action {\n cursor: pointer;\n}\n.uni-action-sheet_dialog__triangle {\n position: absolute;\n width: 0;\n height: 0;\n margin-left: -6px;\n border-style: solid;\n}\n /* web wide screen */\n@media screen and (min-width: 500px) and (min-height: 500px) {\n.uni-action-sheet_dialog__mask {\n background: none;\n}\n.uni-action-sheet_dialog__container {\n width: 300px;\n position: fixed;\n left: 50%;\n right: auto;\n top: 50%;\n bottom: auto;\n z-index: 999;\n border-radius: 5px;\n opacity: 0;\n transform: translate(-50%, -50%);\n transition: opacity 0.3s;\n}\n.uni-action-sheet_dialog__show {\n opacity: 1;\n transform: translate(-50%, -50%) !important;\n}\n.uni-action-sheet_dialog__menu {\n border-radius: 5px;\n box-shadow: 0 0 20px 5px rgba(0, 0, 0, 0.3);\n}\n.uni-action-sheet_dialog__cell__container {\n max-height: 260px;\n}\n.uni-action-sheet_dialog__action {\n display: none;\n}\n.uni-action-sheet_dialog__title {\n font-size: 15px;\n}\n.uni-action-sheet_dialog__title,\n .uni-action-sheet_dialog__cell,\n .uni-action-sheet_dialog__action {\n padding: 10px 6px;\n}\n}\n\n"; +const _style_0$1 = "\n.uni-action-sheet_dialog__mask {\n position: fixed;\n z-index: 999;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n opacity: 0;\n background-color: rgba(0, 0, 0, 0.6);\n transition: opacity 0.1s;\n}\n.uni-action-sheet_dialog__mask__show {\n opacity: 1;\n}\n.uni-action-sheet_dialog__container {\n position: fixed;\n width: 100%;\n left: 0;\n bottom: 0;\n z-index: 999;\n transform: translate(0, 100%);\n opacity: 0;\n transition-property: transform, opacity;\n transition-duration: 0.3s;\n background-color: #f7f7f7;\n border-top-left-radius: 12px;\n border-top-right-radius: 12px;\n}\n.uni-action-sheet_dialog__menu {\n border-top-left-radius: 12px;\n border-top-right-radius: 12px;\n overflow: hidden;\n}\n.uni-action-sheet_dialog__container.uni-action-sheet_dialog__show {\n opacity: 1;\n transform: translate(0, 0);\n}\n.uni-action-sheet_dialog__title,\n .uni-action-sheet_dialog__cell,\n .uni-action-sheet_dialog__action {\n padding: 16px;\n}\n.uni-action-sheet_dialog__title__text,\n .uni-action-sheet_dialog__cell__text,\n .uni-action-sheet_dialog__action__text {\n line-height: 1.4;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.uni-action-sheet_dialog__action {\n margin-top: 8px;\n}\n.uni-action-sheet_dialog__title__text {\n color: #666666;\n}\n.uni-action-sheet_dialog__cell__text,\n .uni-action-sheet_dialog__action__text {\n color: #000000;\n}\n.uni-action-sheet_dialog__menu,\n .uni-action-sheet_dialog__action {\n background-color: #ffffff;\n}\n.uni-action-sheet_dialog__title {\n border-bottom: 1px solid #e5e5e5;\n}\n.uni-action-sheet_dialog__cell__container {\n max-height: 330px;\n\n display: block;\n overflow-y: auto;\n scrollbar-width: none;\n}\n.uni-action-sheet_dialog__cell {\n border-top: 1px solid #e5e5e5;\n}\n\n /* dark mode */\n.uni-action-sheet_dialog__container.uni-action-sheet_dark__mode {\n background-color: #1D1E1E;\n}\n.uni-action-sheet_dialog__menu.uni-action-sheet_dark__mode,\n .uni-action-sheet_dialog__action.uni-action-sheet_dark__mode {\n background-color: #2C2C2B;\n}\n.uni-action-sheet_dialog__title.uni-action-sheet_dark__mode {\n border-bottom: 1px solid #2F3131;\n}\n.uni-action-sheet_dialog__cell.uni-action-sheet_dark__mode {\n border-top: 1px solid #2F3131;\n}\n.uni-action-sheet_dialog__title__text.uni-action-sheet_dark__mode {\n color: #999999;\n}\n.uni-action-sheet_dialog__cell__text.uni-action-sheet_dark__mode,\n .uni-action-sheet_dialog__action__text.uni-action-sheet_dark__mode {\n color: #ffffff;\n}\n\n /* landscape mode */\n.uni-action-sheet_dialog__container.uni-action-sheet_landscape__mode {\n width: 300px;\n position: fixed;\n left: 50%;\n right: auto;\n top: 50%;\n bottom: auto;\n z-index: 999;\n transform: translate(-50%, -50%);\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n transition: opacity 0.3s;\n}\n.uni-action-sheet_dialog__menu.uni-action-sheet_landscape__mode {\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n box-shadow: 0 0 20px 5px rgba(0, 0, 0, 0.3);\n}\n.uni-action-sheet_dialog__action.uni-action-sheet_landscape__mode {\n display: none;\n}\n.uni-action-sheet_dialog__cell__container.uni-action-sheet_landscape__mode {\n max-height: 260px;\n}\n.uni-action-sheet_dialog__title.uni-action-sheet_landscape__mode,\n .uni-action-sheet_dialog__cell.uni-action-sheet_landscape__mode,\n .uni-action-sheet_dialog__action.uni-action-sheet_landscape__mode {\n padding: 10px 6px;\n}\n.uni-action-sheet_dialog__menu {\n display: block;\n}\n.uni-action-sheet_dialog__title,\n .uni-action-sheet_dialog__cell,\n .uni-action-sheet_dialog__action {\n display: block;\n text-align: center;\n line-height: 1.4;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.uni-action-sheet_dialog__cell,\n .uni-action-sheet_dialog__action {\n cursor: pointer;\n}\n.uni-action-sheet_dialog__triangle {\n position: absolute;\n width: 0;\n height: 0;\n margin-left: -6px;\n border-style: solid;\n}\n /* web wide screen */\n@media screen and (min-width: 500px) and (min-height: 500px) {\n.uni-action-sheet_dialog__mask {\n background: none;\n}\n.uni-action-sheet_dialog__container {\n width: 300px;\n position: fixed;\n left: 50%;\n right: auto;\n top: 50%;\n bottom: auto;\n z-index: 999;\n border-radius: 5px;\n opacity: 0;\n transform: translate(-50%, -50%);\n transition: opacity 0.3s;\n}\n.uni-action-sheet_dialog__show {\n opacity: 1;\n transform: translate(-50%, -50%) !important;\n}\n.uni-action-sheet_dialog__menu {\n border-radius: 5px;\n box-shadow: 0 0 20px 5px rgba(0, 0, 0, 0.3);\n}\n.uni-action-sheet_dialog__cell__container {\n max-height: 260px;\n}\n.uni-action-sheet_dialog__action {\n display: none;\n}\n.uni-action-sheet_dialog__title {\n font-size: 15px;\n}\n.uni-action-sheet_dialog__title,\n .uni-action-sheet_dialog__cell,\n .uni-action-sheet_dialog__action {\n padding: 10px 6px;\n}\n}\n\n"; function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { const _component_view = __syscom_2; const _component_text = __syscom_1; @@ -27976,7 +28007,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { _: 1 }, 8, ["style", "class", "onClick"]), createVNode(_component_view, { - style: normalizeStyle({ height: `${_ctx.bottomNavigationHeight}px`, backgroundColor: `${$data.theme == "dark" ? "#2C2C2B" : "#ffffff"}` }) + style: normalizeStyle({ height: `${$data.bottomNavigationHeight}px`, backgroundColor: $options.computedBackgroundColor }) }, null, 8, ["style"]), $options.isWidescreen && Object.keys($data.popover).length > 0 ? (openBlock(), createBlock(_component_view, { key: 0, diff --git a/uni-ext-api/uni_modules/uni-actionSheet/changelog.md b/uni-ext-api/uni_modules/uni-actionSheet/changelog.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/uni-ext-api/uni_modules/uni-actionSheet/pages/actionSheet/actionSheet.vue b/uni-ext-api/uni_modules/uni-actionSheet/pages/actionSheet/actionSheet.vue index 7a656ab7fff..da723ed5c99 100644 --- a/uni-ext-api/uni_modules/uni-actionSheet/pages/actionSheet/actionSheet.vue +++ b/uni-ext-api/uni_modules/uni-actionSheet/pages/actionSheet/actionSheet.vue @@ -48,7 +48,7 @@ {{ cancelText }} - + @@ -87,9 +87,7 @@ windowHeight: 0, popover: {}, // #endif - // #ifdef APP-ANDROID bottomNavigationHeight: 0 - // #endif } }, onLoad(options) { @@ -253,9 +251,12 @@ } return '取消' }, + computedBackgroundColor(): string { + return this.backgroundColor !== null ? this.backgroundColor! : (this.theme == 'dark' ? '#2C2C2B' : '#ffffff') + } }, onReady() { - this.bottomNavigationHeight = uni.getWindowInfo().safeAreaInsets.bottom + this.bottomNavigationHeight = this.$page.safeAreaInsets.bottom setTimeout(() => { this.show = true }, 10) @@ -337,12 +338,8 @@ z-index: 999; transform: translate(0, 100%); opacity: 0; - /* #ifdef APP */ - transition: transform 0.3s; - /* #endif */ - /* #ifdef WEB */ - transition: transform 0.3s, opacity 0.3s; - /* #endif */ + transition-property: transform, opacity; + transition-duration: 0.3s; background-color: #f7f7f7; border-top-left-radius: 12px; border-top-right-radius: 12px; diff --git a/uni-ext-api/uni_modules/uni-actionSheet/readme.md b/uni-ext-api/uni_modules/uni-actionSheet/readme.md deleted file mode 100644 index 7c7ed829753..00000000000 --- a/uni-ext-api/uni_modules/uni-actionSheet/readme.md +++ /dev/null @@ -1,6 +0,0 @@ -# uni-actionSheet -### 开发文档 -[UTS 语法](https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html) -[UTS API插件](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html) -[UTS 组件插件](https://uniapp.dcloud.net.cn/plugin/uts-component.html) -[Hello UTS](https://gitcode.net/dcloud/hello-uts) \ No newline at end of file