| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
- import { defineComponent } from "vue";
- import { extend, makeArrayProp, createNamespace } from "../utils/index.mjs";
- import { useChildren } from "@vant/use";
- import { Tab } from "../tab/index.mjs";
- import { Tabs } from "../tabs/index.mjs";
- import Toolbar, { pickerToolbarProps } from "../picker/PickerToolbar.mjs";
- const [name, bem] = createNamespace("picker-group");
- const PICKER_GROUP_KEY = Symbol(name);
- const pickerGroupProps = extend({
- tabs: makeArrayProp()
- }, pickerToolbarProps);
- var stdin_default = defineComponent({
- name,
- props: pickerGroupProps,
- emits: ["confirm", "cancel"],
- setup(props, {
- emit,
- slots
- }) {
- const {
- children,
- linkChildren
- } = useChildren(PICKER_GROUP_KEY);
- linkChildren();
- const onConfirm = () => {
- emit("confirm", children.map((item) => item.confirm()));
- };
- const onCancel = () => emit("cancel");
- return () => {
- var _a;
- const childNodes = (_a = slots.default) == null ? void 0 : _a.call(slots);
- return _createVNode("div", {
- "class": bem()
- }, [_createVNode(Toolbar, _mergeProps(props, {
- "onConfirm": onConfirm,
- "onCancel": onCancel
- }), null), _createVNode(Tabs, {
- "shrink": true,
- "class": bem("tabs"),
- "animated": true
- }, {
- default: () => [props.tabs.map((title, index) => _createVNode(Tab, {
- "title": title,
- "titleClass": bem("tab-title")
- }, {
- default: () => [childNodes == null ? void 0 : childNodes[index]]
- }))]
- })]);
- };
- }
- });
- export {
- PICKER_GROUP_KEY,
- stdin_default as default,
- pickerGroupProps
- };
|