first commit

This commit is contained in:
2025-12-29 14:59:44 +08:00
commit 10c3fbb0d7
5315 changed files with 795443 additions and 0 deletions

58
node_modules/vant/es/tab/Tab.d.ts generated vendored Normal file
View File

@@ -0,0 +1,58 @@
import { type PropType, type CSSProperties, type ExtractPropTypes } from 'vue';
export declare const tabProps: {
to: PropType<import("vue-router").RouteLocationRaw>;
url: StringConstructor;
replace: BooleanConstructor;
} & {
dot: BooleanConstructor;
name: (NumberConstructor | StringConstructor)[];
badge: (NumberConstructor | StringConstructor)[];
title: StringConstructor;
disabled: BooleanConstructor;
titleClass: PropType<unknown>;
titleStyle: PropType<string | CSSProperties>;
showZeroBadge: {
type: BooleanConstructor;
default: true;
};
};
export type TabProps = ExtractPropTypes<typeof tabProps>;
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
to: PropType<import("vue-router").RouteLocationRaw>;
url: StringConstructor;
replace: BooleanConstructor;
} & {
dot: BooleanConstructor;
name: (NumberConstructor | StringConstructor)[];
badge: (NumberConstructor | StringConstructor)[];
title: StringConstructor;
disabled: BooleanConstructor;
titleClass: PropType<unknown>;
titleStyle: PropType<string | CSSProperties>;
showZeroBadge: {
type: BooleanConstructor;
default: true;
};
}>, (() => import("vue/jsx-runtime").JSX.Element | undefined) | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
to: PropType<import("vue-router").RouteLocationRaw>;
url: StringConstructor;
replace: BooleanConstructor;
} & {
dot: BooleanConstructor;
name: (NumberConstructor | StringConstructor)[];
badge: (NumberConstructor | StringConstructor)[];
title: StringConstructor;
disabled: BooleanConstructor;
titleClass: PropType<unknown>;
titleStyle: PropType<string | CSSProperties>;
showZeroBadge: {
type: BooleanConstructor;
default: true;
};
}>> & Readonly<{}>, {
replace: boolean;
dot: boolean;
disabled: boolean;
showZeroBadge: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

154
node_modules/vant/es/tab/Tab.mjs generated vendored Normal file
View File

@@ -0,0 +1,154 @@
import { ref, watch, computed, nextTick, watchEffect, defineComponent, getCurrentInstance, mergeProps as _mergeProps, createVNode as _createVNode, vShow as _vShow, withDirectives as _withDirectives } from "vue";
import { normalizeClass, normalizeStyle, stringifyStyle } from "@vue/shared";
import { pick, extend, truthProp, unknownProp, numericProp, createNamespace } from "../utils/index.mjs";
import { TABS_KEY } from "../tabs/Tabs.mjs";
import { doubleRaf, useParent } from "@vant/use";
import { useId } from "../composables/use-id.mjs";
import { useExpose } from "../composables/use-expose.mjs";
import { routeProps } from "../composables/use-route.mjs";
import { useProvideTabStatus } from "../composables/use-tab-status.mjs";
import { TabTitle } from "./TabTitle.mjs";
import { SwipeItem } from "../swipe-item/index.mjs";
const [name, bem] = createNamespace("tab");
const tabProps = extend({}, routeProps, {
dot: Boolean,
name: numericProp,
badge: numericProp,
title: String,
disabled: Boolean,
titleClass: unknownProp,
titleStyle: [String, Object],
showZeroBadge: truthProp
});
var stdin_default = defineComponent({
name,
props: tabProps,
setup(props, {
slots
}) {
const id = useId();
const inited = ref(false);
const instance = getCurrentInstance();
const {
parent,
index
} = useParent(TABS_KEY);
if (!parent) {
if (process.env.NODE_ENV !== "production") {
console.error("[Vant] <Tab> must be a child component of <Tabs>.");
}
return;
}
const getName = () => {
var _a;
return (_a = props.name) != null ? _a : index.value;
};
const init = () => {
inited.value = true;
if (parent.props.lazyRender) {
nextTick(() => {
parent.onRendered(getName(), props.title);
});
}
};
const active = computed(() => {
const isActive = getName() === parent.currentName.value;
if (isActive && !inited.value) {
init();
}
return isActive;
});
const parsedClass = ref("");
const parsedStyle = ref("");
watchEffect(() => {
const {
titleClass,
titleStyle
} = props;
parsedClass.value = titleClass ? normalizeClass(titleClass) : "";
parsedStyle.value = titleStyle && typeof titleStyle !== "string" ? stringifyStyle(normalizeStyle(titleStyle)) : titleStyle;
});
const renderTitle = (onClickTab) => _createVNode(TabTitle, _mergeProps({
"key": id,
"id": `${parent.id}-${index.value}`,
"ref": parent.setTitleRefs(index.value),
"style": parsedStyle.value,
"class": parsedClass.value,
"isActive": active.value,
"controls": id,
"scrollable": parent.scrollable.value,
"activeColor": parent.props.titleActiveColor,
"inactiveColor": parent.props.titleInactiveColor,
"onClick": (event) => onClickTab(instance.proxy, index.value, event)
}, pick(parent.props, ["type", "color", "shrink"]), pick(props, ["dot", "badge", "title", "disabled", "showZeroBadge"])), {
title: slots.title
});
const hasInactiveClass = ref(!active.value);
watch(active, (val) => {
if (val) {
hasInactiveClass.value = false;
} else {
doubleRaf(() => {
hasInactiveClass.value = true;
});
}
});
watch(() => props.title, () => {
parent.setLine();
parent.scrollIntoView();
});
useProvideTabStatus(active);
useExpose({
id,
renderTitle
});
return () => {
var _a;
const label = `${parent.id}-${index.value}`;
const {
animated,
swipeable,
scrollspy,
lazyRender
} = parent.props;
if (!slots.default && !animated) {
return;
}
const show = scrollspy || active.value;
if (animated || swipeable) {
return _createVNode(SwipeItem, {
"id": id,
"role": "tabpanel",
"class": bem("panel-wrapper", {
inactive: hasInactiveClass.value
}),
"tabindex": active.value ? 0 : -1,
"aria-hidden": !active.value,
"aria-labelledby": label,
"data-allow-mismatch": "attribute"
}, {
default: () => {
var _a2;
return [_createVNode("div", {
"class": bem("panel")
}, [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)])];
}
});
}
const shouldRender = inited.value || scrollspy || !lazyRender;
const Content = shouldRender ? (_a = slots.default) == null ? void 0 : _a.call(slots) : null;
return _withDirectives(_createVNode("div", {
"id": id,
"role": "tabpanel",
"class": bem("panel"),
"tabindex": show ? 0 : -1,
"aria-labelledby": label,
"data-allow-mismatch": "attribute"
}, [Content]), [[_vShow, show]]);
};
}
});
export {
stdin_default as default,
tabProps
};

44
node_modules/vant/es/tab/TabTitle.d.ts generated vendored Normal file
View File

@@ -0,0 +1,44 @@
export declare const TabTitle: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
id: StringConstructor;
dot: BooleanConstructor;
type: StringConstructor;
color: StringConstructor;
title: StringConstructor;
badge: (NumberConstructor | StringConstructor)[];
shrink: BooleanConstructor;
isActive: BooleanConstructor;
disabled: BooleanConstructor;
controls: StringConstructor;
scrollable: BooleanConstructor;
activeColor: StringConstructor;
inactiveColor: StringConstructor;
showZeroBadge: {
type: BooleanConstructor;
default: true;
};
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
id: StringConstructor;
dot: BooleanConstructor;
type: StringConstructor;
color: StringConstructor;
title: StringConstructor;
badge: (NumberConstructor | StringConstructor)[];
shrink: BooleanConstructor;
isActive: BooleanConstructor;
disabled: BooleanConstructor;
controls: StringConstructor;
scrollable: BooleanConstructor;
activeColor: StringConstructor;
inactiveColor: StringConstructor;
showZeroBadge: {
type: BooleanConstructor;
default: true;
};
}>> & Readonly<{}>, {
dot: boolean;
disabled: boolean;
shrink: boolean;
scrollable: boolean;
isActive: boolean;
showZeroBadge: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

90
node_modules/vant/es/tab/TabTitle.mjs generated vendored Normal file
View File

@@ -0,0 +1,90 @@
import { computed, defineComponent, createVNode as _createVNode } from "vue";
import { isDef, truthProp, numericProp, createNamespace } from "../utils/index.mjs";
import { Badge } from "../badge/index.mjs";
const [name, bem] = createNamespace("tab");
const TabTitle = defineComponent({
name,
props: {
id: String,
dot: Boolean,
type: String,
color: String,
title: String,
badge: numericProp,
shrink: Boolean,
isActive: Boolean,
disabled: Boolean,
controls: String,
scrollable: Boolean,
activeColor: String,
inactiveColor: String,
showZeroBadge: truthProp
},
setup(props, {
slots
}) {
const style = computed(() => {
const style2 = {};
const {
type,
color,
disabled,
isActive,
activeColor,
inactiveColor
} = props;
const isCard = type === "card";
if (color && isCard) {
style2.borderColor = color;
if (!disabled) {
if (isActive) {
style2.backgroundColor = color;
} else {
style2.color = color;
}
}
}
const titleColor = isActive ? activeColor : inactiveColor;
if (titleColor) {
style2.color = titleColor;
}
return style2;
});
const renderText = () => {
const Text = _createVNode("span", {
"class": bem("text", {
ellipsis: !props.scrollable
})
}, [slots.title ? slots.title() : props.title]);
if (props.dot || isDef(props.badge) && props.badge !== "") {
return _createVNode(Badge, {
"dot": props.dot,
"content": props.badge,
"showZero": props.showZeroBadge
}, {
default: () => [Text]
});
}
return Text;
};
return () => _createVNode("div", {
"id": props.id,
"role": "tab",
"class": [bem([props.type, {
grow: props.scrollable && !props.shrink,
shrink: props.shrink,
active: props.isActive,
disabled: props.disabled
}])],
"style": style.value,
"tabindex": props.disabled ? void 0 : props.isActive ? 0 : -1,
"aria-selected": props.isActive,
"aria-disabled": props.disabled || void 0,
"aria-controls": props.controls,
"data-allow-mismatch": "attribute"
}, [renderText()]);
}
});
export {
TabTitle
};

1
node_modules/vant/es/tab/index.css generated vendored Normal file
View File

@@ -0,0 +1 @@
.van-tab__panel,.van-tab__panel-wrapper{flex-shrink:0;box-sizing:border-box;width:100%}.van-tab__panel-wrapper--inactive{height:0;overflow:visible}

47
node_modules/vant/es/tab/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,47 @@
export declare const Tab: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
to: import("vue").PropType<import("vue-router").RouteLocationRaw>;
url: StringConstructor;
replace: BooleanConstructor;
} & {
dot: BooleanConstructor;
name: (NumberConstructor | StringConstructor)[];
badge: (NumberConstructor | StringConstructor)[];
title: StringConstructor;
disabled: BooleanConstructor;
titleClass: import("vue").PropType<unknown>;
titleStyle: import("vue").PropType<string | import("vue").CSSProperties>;
showZeroBadge: {
type: BooleanConstructor;
default: true;
};
}>, (() => import("vue/jsx-runtime").JSX.Element | undefined) | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
to: import("vue").PropType<import("vue-router").RouteLocationRaw>;
url: StringConstructor;
replace: BooleanConstructor;
} & {
dot: BooleanConstructor;
name: (NumberConstructor | StringConstructor)[];
badge: (NumberConstructor | StringConstructor)[];
title: StringConstructor;
disabled: BooleanConstructor;
titleClass: import("vue").PropType<unknown>;
titleStyle: import("vue").PropType<string | import("vue").CSSProperties>;
showZeroBadge: {
type: BooleanConstructor;
default: true;
};
}>> & Readonly<{}>, {
replace: boolean;
dot: boolean;
disabled: boolean;
showZeroBadge: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
export default Tab;
export { tabProps } from './Tab';
export { useTabStatus, useAllTabStatus } from '../composables/use-tab-status';
export type { TabProps } from './Tab';
declare module 'vue' {
interface GlobalComponents {
VanTab: typeof Tab;
}
}

13
node_modules/vant/es/tab/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,13 @@
import { withInstall } from "../utils/index.mjs";
import _Tab from "./Tab.mjs";
const Tab = withInstall(_Tab);
var stdin_default = Tab;
import { tabProps } from "./Tab.mjs";
import { useTabStatus, useAllTabStatus } from "../composables/use-tab-status.mjs";
export {
Tab,
stdin_default as default,
tabProps,
useAllTabStatus,
useTabStatus
};

1
node_modules/vant/es/tab/style/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export {};

7
node_modules/vant/es/tab/style/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import "../../style/base.css";
import "../../badge/index.css";
import "../../sticky/index.css";
import "../../swipe/index.css";
import "../../swipe-item/index.css";
import "../../tabs/index.css";
import "../index.css";