2.19 kBJavaScriptView Raw
1var __defProp = Object.defineProperty;
2var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3var __getOwnPropNames = Object.getOwnPropertyNames;
4var __hasOwnProp = Object.prototype.hasOwnProperty;
5var __export = (target, all) => {
6 for (var name2 in all)
7 __defProp(target, name2, { get: all[name2], enumerable: true });
8};
9var __copyProps = (to, from, except, desc) => {
10 if (from && typeof from === "object" || typeof from === "function") {
11 for (let key of __getOwnPropNames(from))
12 if (!__hasOwnProp.call(to, key) && key !== except)
13 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14 }
15 return to;
16};
17var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18var stdin_exports = {};
19__export(stdin_exports, {
20 ACTION_BAR_KEY: () => ACTION_BAR_KEY,
21 actionBarProps: () => actionBarProps,
22 default: () => stdin_default
23});
24module.exports = __toCommonJS(stdin_exports);
25var import_vue = require("vue");
26var import_utils = require("../utils");
27var import_use = require("@vant/use");
28var import_use_placeholder = require("../composables/use-placeholder");
29const [name, bem] = (0, import_utils.createNamespace)("action-bar");
30const ACTION_BAR_KEY = Symbol(name);
31const actionBarProps = {
32 placeholder: Boolean,
33 safeAreaInsetBottom: import_utils.truthProp
34};
35var stdin_default = (0, import_vue.defineComponent)({
36 name,
37 props: actionBarProps,
38 setup(props, {
39 slots
40 }) {
41 const root = (0, import_vue.ref)();
42 const renderPlaceholder = (0, import_use_placeholder.usePlaceholder)(root, bem);
43 const {
44 linkChildren
45 } = (0, import_use.useChildren)(ACTION_BAR_KEY);
46 linkChildren();
47 const renderActionBar = () => {
48 var _a;
49 return (0, import_vue.createVNode)("div", {
50 "ref": root,
51 "class": [bem(), {
52 "van-safe-area-bottom": props.safeAreaInsetBottom
53 }]
54 }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
55 };
56 return () => {
57 if (props.placeholder) {
58 return renderPlaceholder(renderActionBar);
59 }
60 return renderActionBar();
61 };
62 }
63});