var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name2 in all) __defProp(target, name2, { get: all[name2], 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 stdin_exports = {}; __export(stdin_exports, { TABBAR_KEY: () => TABBAR_KEY, default: () => stdin_default, tabbarProps: () => tabbarProps }); module.exports = __toCommonJS(stdin_exports); var import_vue = require("vue"); var import_utils = require("../utils"); var import_use = require("@vant/use"); var import_use_placeholder = require("../composables/use-placeholder"); const [name, bem] = (0, import_utils.createNamespace)("tabbar"); const tabbarProps = { route: Boolean, fixed: import_utils.truthProp, border: import_utils.truthProp, zIndex: import_utils.numericProp, placeholder: Boolean, activeColor: String, beforeChange: Function, inactiveColor: String, modelValue: (0, import_utils.makeNumericProp)(0), safeAreaInsetBottom: { type: Boolean, default: null } }; const TABBAR_KEY = Symbol(name); var stdin_default = (0, import_vue.defineComponent)({ name, props: tabbarProps, emits: ["change", "update:modelValue"], setup(props, { emit, slots }) { const root = (0, import_vue.ref)(); const { linkChildren } = (0, import_use.useChildren)(TABBAR_KEY); const renderPlaceholder = (0, import_use_placeholder.usePlaceholder)(root, bem); const enableSafeArea = () => { var _a; return (_a = props.safeAreaInsetBottom) != null ? _a : props.fixed; }; const renderTabbar = () => { var _a; const { fixed, zIndex, border } = props; return (0, import_vue.createVNode)("div", { "ref": root, "role": "tablist", "style": (0, import_utils.getZIndexStyle)(zIndex), "class": [bem({ fixed }), { [import_utils.BORDER_TOP_BOTTOM]: border, "van-safe-area-bottom": enableSafeArea() }] }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]); }; const setActive = (active, afterChange) => { (0, import_utils.callInterceptor)(props.beforeChange, { args: [active], done() { emit("update:modelValue", active); emit("change", active); afterChange(); } }); }; linkChildren({ props, setActive }); return () => { if (props.fixed && props.placeholder) { return renderPlaceholder(renderTabbar); } return renderTabbar(); }; } });