one
Version:
One is a React framework for web, iOS, and Android apps.
111 lines (108 loc) • 4.01 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 StackToolbar_exports = {};
__export(StackToolbar_exports, {
StackToolbarBadge: () => StackToolbarBadge,
StackToolbarButton: () => StackToolbarButton,
StackToolbarComponent: () => StackToolbarComponent,
StackToolbarIcon: () => StackToolbarIcon,
StackToolbarLabel: () => StackToolbarLabel,
StackToolbarMenu: () => StackToolbarMenu,
StackToolbarMenuAction: () => StackToolbarMenuAction,
StackToolbarSearchBarSlot: () => StackToolbarSearchBarSlot,
StackToolbarSpacer: () => StackToolbarSpacer,
appendStackToolbarPropsToOptions: () => import_stackToolbarDescriptors2.appendStackToolbarPropsToOptions,
isToolbarKind: () => import_stackToolbarDescriptors.isToolbarKind
});
module.exports = __toCommonJS(StackToolbar_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var import_react = require("react");
var import_native = require("@react-navigation/native");
var import_children = require("../../headless/children.native.js");
var import_platform = require("../../utils/platform.native.js");
var import_stackToolbarDescriptors = require("./stackToolbarDescriptors.native.js");
var import_StackToolbarBottomHost = require("./StackToolbarBottomHost.native.js");
var import_stackToolbarDescriptors2 = require("./stackToolbarDescriptors.native.js");
function mark(component, kind) {
return Object.assign(component, {
[import_children.NAVIGATOR_CONFIG]: true,
[import_stackToolbarDescriptors.TOOLBAR_KIND]: kind
});
}
function StackToolbarComponent(props) {
var _props_placement;
var placement = (_props_placement = props.placement) !== null && _props_placement !== void 0 ? _props_placement : "bottom";
if (placement === "bottom") {
if (import_platform.PLATFORM !== "ios") return null;
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_StackToolbarBottomHost.BottomToolbarHost, { children: props.children });
}
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StackToolbarHeaderOptions, { props });
}
mark(StackToolbarComponent, "toolbar");
function StackToolbarHeaderOptions(param) {
var { props } = param;
var navigation = (0, import_native.useNavigation)();
var options = (0, import_react.useMemo)(function() {
return (0, import_stackToolbarDescriptors.appendStackToolbarPropsToOptions)({}, props);
}, [
props.children,
props.placement,
props.asChild
]);
(0, import_react.useEffect)(function() {
navigation.setOptions(options);
}, [navigation, options]);
return null;
}
function StackToolbarButton(_props) {
return null;
}
mark(StackToolbarButton, "button");
function StackToolbarMenu(_props) {
return null;
}
mark(StackToolbarMenu, "menu");
function StackToolbarMenuAction(_props) {
return null;
}
mark(StackToolbarMenuAction, "menuAction");
function StackToolbarSpacer(_props) {
return null;
}
mark(StackToolbarSpacer, "spacer");
function StackToolbarSearchBarSlot(_props) {
return null;
}
mark(StackToolbarSearchBarSlot, "searchBarSlot");
function StackToolbarLabel(_props) {
return null;
}
mark(StackToolbarLabel, "label");
function StackToolbarIcon(_props) {
return null;
}
mark(StackToolbarIcon, "icon");
function StackToolbarBadge(_props) {
return null;
}
mark(StackToolbarBadge, "badge");
//# sourceMappingURL=StackToolbar.native.js.map