Skip to content

Commit

Permalink
chore: build
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenyuWang committed Jan 21, 2025
1 parent 0344e18 commit 71d4605
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 28 deletions.
2 changes: 1 addition & 1 deletion packages/uni-h5/dist-x/uni-h5.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
53 changes: 42 additions & 11 deletions packages/uni-h5/dist-x/uni-h5.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand All @@ -8192,6 +8192,9 @@ function getPageWrapperInfo() {
height: pageWrapperRect.height
};
}
function isDialogPageImpl(page) {
return page instanceof UniDialogPageImpl;
}
class UniPageImpl {
constructor({
route,
Expand All @@ -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);
Expand Down Expand Up @@ -27696,7 +27723,8 @@ const _sfc_main$1 = {
isLandscape: false,
windowWidth: 0,
windowHeight: 0,
popover: {}
popover: {},
bottomNavigationHeight: 0
};
},
onLoad(options) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
{{ cancelText }}
</text>
</view>
<view :style="{height: `${bottomNavigationHeight}px`, backgroundColor: `${theme == 'dark' ? '#2C2C2B' : '#ffffff'}`}"></view>
<view :style="{height: `${bottomNavigationHeight}px`, backgroundColor: computedBackgroundColor}"></view>
<!-- #ifdef WEB -->
<view v-if='isWidescreen && Object.keys(popover).length > 0' :style='triangleStyle' class="uni-action-sheet_dialog__triangle" />
<!-- #endif -->
Expand Down Expand Up @@ -87,9 +87,7 @@
windowHeight: 0,
popover: {},
// #endif
// #ifdef APP-ANDROID
bottomNavigationHeight: 0
// #endif
}
},
onLoad(options) {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 0 additions & 6 deletions uni-ext-api/uni_modules/uni-actionSheet/readme.md

This file was deleted.

0 comments on commit 71d4605

Please sign in to comment.