@crossed/sheet
Version:
A Cross Platform(Android & iOS) ActionSheet with a robust and flexible api, native performance and zero dependency code for react native. Create anything you want inside ActionSheet.
66 lines (65 loc) • 2.14 kB
JavaScript
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var utils_exports = {};
__export(utils_exports, {
SUPPORTED_ORIENTATIONS: () => SUPPORTED_ORIENTATIONS,
getDeviceHeight: () => getDeviceHeight,
getElevation: () => getElevation,
waitAsync: () => waitAsync
});
module.exports = __toCommonJS(utils_exports);
var import_react_native = require("react-native");
function getDeviceHeight(statusBarTranslucent, heightProps) {
if (import_react_native.Platform.OS === "ios")
return heightProps;
const currentStatusbarHeight = import_react_native.StatusBar.currentHeight || 0;
const height = heightProps + currentStatusbarHeight - 3;
if (!statusBarTranslucent) {
return height - currentStatusbarHeight;
}
return height;
}
const getElevation = (elevation) => {
return {
elevation,
shadowColor: "black",
shadowOffset: { width: 0.3 * elevation, height: 0.5 * elevation },
shadowOpacity: 0.2,
shadowRadius: 0.7 * elevation
};
};
const SUPPORTED_ORIENTATIONS = [
"portrait",
"portrait-upside-down",
"landscape",
"landscape-left",
"landscape-right"
];
const waitAsync = (ms) => new Promise((resolve) => {
setTimeout(() => {
resolve(null);
}, ms);
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SUPPORTED_ORIENTATIONS,
getDeviceHeight,
getElevation,
waitAsync
});
//# sourceMappingURL=utils.js.map