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

View File

@@ -0,0 +1,71 @@
import { type PropType, type InjectionKey, type ExtractPropTypes } from 'vue';
import { type Numeric } from '../utils';
export type ConfigProviderTheme = 'light' | 'dark';
export type ConfigProviderThemeVarsScope = 'local' | 'global';
export type ConfigProviderProvide = {
iconPrefix?: string;
};
export declare const CONFIG_PROVIDER_KEY: InjectionKey<ConfigProviderProvide>;
export type ThemeVars = PropType<Record<string, Numeric>>;
export declare const configProviderProps: {
tag: {
type: PropType<keyof HTMLElementTagNameMap>;
default: keyof HTMLElementTagNameMap;
};
theme: {
type: PropType<ConfigProviderTheme>;
default: ConfigProviderTheme;
};
zIndex: NumberConstructor;
themeVars: ThemeVars;
themeVarsDark: ThemeVars;
themeVarsLight: ThemeVars;
themeVarsScope: {
type: PropType<ConfigProviderThemeVarsScope>;
default: ConfigProviderThemeVarsScope;
};
iconPrefix: StringConstructor;
};
export type ConfigProviderProps = ExtractPropTypes<typeof configProviderProps>;
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
tag: {
type: PropType<keyof HTMLElementTagNameMap>;
default: keyof HTMLElementTagNameMap;
};
theme: {
type: PropType<ConfigProviderTheme>;
default: ConfigProviderTheme;
};
zIndex: NumberConstructor;
themeVars: ThemeVars;
themeVarsDark: ThemeVars;
themeVarsLight: ThemeVars;
themeVarsScope: {
type: PropType<ConfigProviderThemeVarsScope>;
default: ConfigProviderThemeVarsScope;
};
iconPrefix: StringConstructor;
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
tag: {
type: PropType<keyof HTMLElementTagNameMap>;
default: keyof HTMLElementTagNameMap;
};
theme: {
type: PropType<ConfigProviderTheme>;
default: ConfigProviderTheme;
};
zIndex: NumberConstructor;
themeVars: ThemeVars;
themeVarsDark: ThemeVars;
themeVarsLight: ThemeVars;
themeVarsScope: {
type: PropType<ConfigProviderThemeVarsScope>;
default: ConfigProviderThemeVarsScope;
};
iconPrefix: StringConstructor;
}>> & Readonly<{}>, {
tag: keyof HTMLElementTagNameMap;
theme: ConfigProviderTheme;
themeVarsScope: ConfigProviderThemeVarsScope;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

121
node_modules/vant/lib/config-provider/ConfigProvider.js generated vendored Normal file
View File

@@ -0,0 +1,121 @@
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, {
CONFIG_PROVIDER_KEY: () => CONFIG_PROVIDER_KEY,
configProviderProps: () => configProviderProps,
default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_vue = require("vue");
var import_utils = require("../utils");
var import_use_global_z_index = require("../composables/use-global-z-index");
const [name, bem] = (0, import_utils.createNamespace)("config-provider");
const CONFIG_PROVIDER_KEY = Symbol(name);
const configProviderProps = {
tag: (0, import_utils.makeStringProp)("div"),
theme: (0, import_utils.makeStringProp)("light"),
zIndex: Number,
themeVars: Object,
themeVarsDark: Object,
themeVarsLight: Object,
themeVarsScope: (0, import_utils.makeStringProp)("local"),
iconPrefix: String
};
function insertDash(str) {
return str.replace(/([a-zA-Z])(\d)/g, "$1-$2");
}
function mapThemeVarsToCSSVars(themeVars) {
const cssVars = {};
Object.keys(themeVars).forEach((key) => {
const formattedKey = insertDash((0, import_utils.kebabCase)(key));
cssVars[`--van-${formattedKey}`] = themeVars[key];
});
return cssVars;
}
function syncThemeVarsOnRoot(newStyle = {}, oldStyle = {}) {
Object.keys(newStyle).forEach((key) => {
if (newStyle[key] !== oldStyle[key]) {
document.documentElement.style.setProperty(key, newStyle[key]);
}
});
Object.keys(oldStyle).forEach((key) => {
if (!newStyle[key]) {
document.documentElement.style.removeProperty(key);
}
});
}
var stdin_default = (0, import_vue.defineComponent)({
name,
props: configProviderProps,
setup(props, {
slots
}) {
const style = (0, import_vue.computed)(() => mapThemeVarsToCSSVars((0, import_utils.extend)({}, props.themeVars, props.theme === "dark" ? props.themeVarsDark : props.themeVarsLight)));
if (import_utils.inBrowser) {
const addTheme = () => {
document.documentElement.classList.add(`van-theme-${props.theme}`);
};
const removeTheme = (theme = props.theme) => {
document.documentElement.classList.remove(`van-theme-${theme}`);
};
(0, import_vue.watch)(() => props.theme, (newVal, oldVal) => {
if (oldVal) {
removeTheme(oldVal);
}
addTheme();
}, {
immediate: true
});
(0, import_vue.onActivated)(addTheme);
(0, import_vue.onDeactivated)(removeTheme);
(0, import_vue.onBeforeUnmount)(removeTheme);
(0, import_vue.watch)(style, (newStyle, oldStyle) => {
if (props.themeVarsScope === "global") {
syncThemeVarsOnRoot(newStyle, oldStyle);
}
});
(0, import_vue.watch)(() => props.themeVarsScope, (newScope, oldScope) => {
if (oldScope === "global") {
syncThemeVarsOnRoot({}, style.value);
}
if (newScope === "global") {
syncThemeVarsOnRoot(style.value, {});
}
});
if (props.themeVarsScope === "global") {
syncThemeVarsOnRoot(style.value, {});
}
}
(0, import_vue.provide)(CONFIG_PROVIDER_KEY, props);
(0, import_vue.watchEffect)(() => {
if (props.zIndex !== void 0) {
(0, import_use_global_z_index.setGlobalZIndex)(props.zIndex);
}
});
return () => (0, import_vue.createVNode)(props.tag, {
"class": bem(),
"style": props.themeVarsScope === "local" ? style.value : void 0
}, {
default: () => {
var _a;
return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
}
});
}
});

50
node_modules/vant/lib/config-provider/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,50 @@
export declare const ConfigProvider: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
tag: {
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
default: keyof HTMLElementTagNameMap;
};
theme: {
type: import("vue").PropType<import("./ConfigProvider").ConfigProviderTheme>;
default: import("./ConfigProvider").ConfigProviderTheme;
};
zIndex: NumberConstructor;
themeVars: import("./ConfigProvider").ThemeVars;
themeVarsDark: import("./ConfigProvider").ThemeVars;
themeVarsLight: import("./ConfigProvider").ThemeVars;
themeVarsScope: {
type: import("vue").PropType<import("./ConfigProvider").ConfigProviderThemeVarsScope>;
default: import("./ConfigProvider").ConfigProviderThemeVarsScope;
};
iconPrefix: StringConstructor;
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
tag: {
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
default: keyof HTMLElementTagNameMap;
};
theme: {
type: import("vue").PropType<import("./ConfigProvider").ConfigProviderTheme>;
default: import("./ConfigProvider").ConfigProviderTheme;
};
zIndex: NumberConstructor;
themeVars: import("./ConfigProvider").ThemeVars;
themeVarsDark: import("./ConfigProvider").ThemeVars;
themeVarsLight: import("./ConfigProvider").ThemeVars;
themeVarsScope: {
type: import("vue").PropType<import("./ConfigProvider").ConfigProviderThemeVarsScope>;
default: import("./ConfigProvider").ConfigProviderThemeVarsScope;
};
iconPrefix: StringConstructor;
}>> & Readonly<{}>, {
tag: keyof HTMLElementTagNameMap;
theme: import("./ConfigProvider").ConfigProviderTheme;
themeVarsScope: import("./ConfigProvider").ConfigProviderThemeVarsScope;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
export default ConfigProvider;
export { configProviderProps } from './ConfigProvider';
export type { ConfigProviderProps, ConfigProviderTheme, ConfigProviderThemeVarsScope, } from './ConfigProvider';
export type { ConfigProviderThemeVars } from './types';
declare module 'vue' {
interface GlobalComponents {
VanConfigProvider: typeof ConfigProvider;
}
}

39
node_modules/vant/lib/config-provider/index.js generated vendored Normal file
View File

@@ -0,0 +1,39 @@
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
ConfigProvider: () => ConfigProvider,
configProviderProps: () => import_ConfigProvider2.configProviderProps,
default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_utils = require("../utils");
var import_ConfigProvider = __toESM(require("./ConfigProvider"));
var import_ConfigProvider2 = require("./ConfigProvider");
const ConfigProvider = (0, import_utils.withInstall)(import_ConfigProvider.default);
var stdin_default = ConfigProvider;

View File

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

1
node_modules/vant/lib/config-provider/style/index.js generated vendored Normal file
View File

@@ -0,0 +1 @@
require("../../style/base.css");

61
node_modules/vant/lib/config-provider/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,61 @@
type BaseThemeVars = {
black?: string;
white?: string;
gray1?: string;
gray2?: string;
gray3?: string;
gray4?: string;
gray5?: string;
gray6?: string;
gray7?: string;
gray8?: string;
red?: string;
blue?: string;
orange?: string;
orangeDark?: string;
orangeLight?: string;
green?: string;
gradientRed?: string;
gradientOrange?: string;
primaryColor?: string;
successColor?: string;
dangerColor?: string;
warningColor?: string;
textColor?: string;
textColor2?: string;
textColor3?: string;
activeColor?: string;
activeOpacity?: number;
disabledOpacity?: number;
background?: string;
background2?: string;
paddingBase?: string;
paddingXs?: string;
paddingSm?: string;
paddingMd?: string;
paddingLg?: string;
paddingXl?: string;
fontSizeXs?: string;
fontSizeSm?: string;
fontSizeMd?: string;
fontSizeLg?: string;
fontBold?: number;
lineHeightXs?: string;
lineHeightSm?: string;
lineHeightMd?: string;
lineHeightLg?: string;
baseFont?: string;
priceFont?: string;
durationBase?: string;
durationFast?: string;
easeOut?: string;
easeIn?: string;
borderColor?: string;
borderWidth?: string;
radiusSm?: string;
radiusMd?: string;
radiusLg?: string;
radiusMax?: string;
};
export type ConfigProviderThemeVars = BaseThemeVars & import('../action-bar').ActionBarThemeVars & import('../action-bar-button').ActionBarButtonThemeVars & import('../action-bar-icon').ActionBarIconThemeVars & import('../action-sheet').ActionSheetThemeVars & import('../address-edit').AddressEditThemeVars & import('../address-list').AddressListThemeVars & import('../back-top').BackTopThemeVars & import('../badge').BadgeThemeVars & import('../barrage').BarrageThemeVars & import('../button').ButtonThemeVars & import('../calendar').CalendarThemeVars & import('../card').CardThemeVars & import('../cascader').CascaderThemeVars & import('../cell').CellThemeVars & import('../cell-group').CellGroupThemeVars & import('../checkbox').CheckboxThemeVars & import('../circle').CircleThemeVars & import('../collapse-item').CollapseItemThemeVars & import('../contact-card').ContactCardThemeVars & import('../contact-edit').ContactEditThemeVars & import('../contact-list').ContactListThemeVars & import('../count-down').CountDownThemeVars & import('../coupon').CouponThemeVars & import('../coupon-cell').CouponCellThemeVars & import('../coupon-list').CouponListThemeVars & import('../dialog').DialogThemeVars & import('../divider').DividerThemeVars & import('../dropdown-item').DropdownItemThemeVars & import('../dropdown-menu').DropdownMenuThemeVars & import('../empty').EmptyThemeVars & import('../highlight').HighlightThemeVars & import('../field').FieldThemeVars & import('../floating-bubble').FloatingBubbleThemeVars & import('../floating-panel').FloatingPanelThemeVars & import('../grid-item').GridItemThemeVars & import('../image').ImageThemeVars & import('../image-preview').ImagePreviewThemeVars & import('../index-anchor').IndexAnchorThemeVars & import('../index-bar').IndexBarThemeVars & import('../list').ListThemeVars & import('../loading').LoadingThemeVars & import('../nav-bar').NavBarThemeVars & import('../notice-bar').NoticeBarThemeVars & import('../notify').NotifyThemeVars & import('../number-keyboard').NumberKeyboardThemeVars & import('../overlay').OverlayThemeVars & import('../pagination').PaginationThemeVars & import('../password-input').PasswordInputThemeVars & import('../picker').PickerThemeVars & import('../picker-group').PickerGroupThemeVars & import('../popover').PopoverThemeVars & import('../popup').PopupThemeVars & import('../progress').ProgressThemeVars & import('../pull-refresh').PullRefreshThemeVars & import('../radio').RadioThemeVars & import('../rate').RateThemeVars & import('../rolling-text').RollingTextThemeVars & import('../search').SearchThemeVars & import('../share-sheet').ShareSheetThemeVars & import('../sidebar').SidebarThemeVars & import('../sidebar-item').SidebarItemThemeVars & import('../signature').SignatureThemeVars & import('../skeleton').SkeletonThemeVars & import('../slider').SliderThemeVars & import('../step').StepThemeVars & import('../stepper').StepperThemeVars & import('../steps').StepsThemeVars & import('../sticky').StickyThemeVars & import('../submit-bar').SubmitBarThemeVars & import('../swipe').SwipeThemeVars & import('../switch').SwitchThemeVars & import('../tabbar').TabbarThemeVars & import('../tabbar-item').TabbarItemThemeVars & import('../tabs').TabsThemeVars & import('../tag').TagThemeVars & import('../toast').ToastThemeVars & import('../tree-select').TreeSelectThemeVars & import('../uploader').UploaderThemeVars & import('../watermark').WatermarkThemeVars;
export {};

15
node_modules/vant/lib/config-provider/types.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 = {};
module.exports = __toCommonJS(stdin_exports);