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

96
node_modules/vant/lib/cascader/Cascader.d.ts generated vendored Normal file
View File

@@ -0,0 +1,96 @@
import { type PropType, type ExtractPropTypes } from 'vue';
import type { CascaderOption, CascaderFieldNames } from './types';
export declare const cascaderProps: {
title: StringConstructor;
options: {
type: PropType<CascaderOption[]>;
default: () => never[];
};
closeable: {
type: BooleanConstructor;
default: true;
};
swipeable: {
type: BooleanConstructor;
default: true;
};
closeIcon: {
type: PropType<string>;
default: string;
};
showHeader: {
type: BooleanConstructor;
default: true;
};
modelValue: (NumberConstructor | StringConstructor)[];
fieldNames: PropType<CascaderFieldNames>;
placeholder: StringConstructor;
activeColor: StringConstructor;
};
export type CascaderProps = ExtractPropTypes<typeof cascaderProps>;
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
title: StringConstructor;
options: {
type: PropType<CascaderOption[]>;
default: () => never[];
};
closeable: {
type: BooleanConstructor;
default: true;
};
swipeable: {
type: BooleanConstructor;
default: true;
};
closeIcon: {
type: PropType<string>;
default: string;
};
showHeader: {
type: BooleanConstructor;
default: true;
};
modelValue: (NumberConstructor | StringConstructor)[];
fieldNames: PropType<CascaderFieldNames>;
placeholder: StringConstructor;
activeColor: StringConstructor;
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "close" | "clickTab" | "finish")[], "update:modelValue" | "change" | "close" | "clickTab" | "finish", import("vue").PublicProps, Readonly<ExtractPropTypes<{
title: StringConstructor;
options: {
type: PropType<CascaderOption[]>;
default: () => never[];
};
closeable: {
type: BooleanConstructor;
default: true;
};
swipeable: {
type: BooleanConstructor;
default: true;
};
closeIcon: {
type: PropType<string>;
default: string;
};
showHeader: {
type: BooleanConstructor;
default: true;
};
modelValue: (NumberConstructor | StringConstructor)[];
fieldNames: PropType<CascaderFieldNames>;
placeholder: StringConstructor;
activeColor: StringConstructor;
}>> & Readonly<{
onChange?: ((...args: any[]) => any) | undefined;
onClose?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
onClickTab?: ((...args: any[]) => any) | undefined;
onFinish?: ((...args: any[]) => any) | undefined;
}>, {
closeIcon: string;
closeable: boolean;
options: CascaderOption[];
swipeable: boolean;
showHeader: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

259
node_modules/vant/lib/cascader/Cascader.js generated vendored Normal file
View File

@@ -0,0 +1,259 @@
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, {
cascaderProps: () => cascaderProps,
default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_vue = require("vue");
var import_utils = require("../utils");
var import_use_refs = require("../composables/use-refs");
var import_tab = require("../tab");
var import_tabs = require("../tabs");
var import_icon = require("../icon");
const [name, bem, t] = (0, import_utils.createNamespace)("cascader");
const cascaderProps = {
title: String,
options: (0, import_utils.makeArrayProp)(),
closeable: import_utils.truthProp,
swipeable: import_utils.truthProp,
closeIcon: (0, import_utils.makeStringProp)("cross"),
showHeader: import_utils.truthProp,
modelValue: import_utils.numericProp,
fieldNames: Object,
placeholder: String,
activeColor: String
};
var stdin_default = (0, import_vue.defineComponent)({
name,
props: cascaderProps,
emits: ["close", "change", "finish", "clickTab", "update:modelValue"],
setup(props, {
slots,
emit
}) {
const tabs = (0, import_vue.ref)([]);
const activeTab = (0, import_vue.ref)(0);
const [selectedElementRefs, setSelectedElementRefs] = (0, import_use_refs.useRefs)();
const {
text: textKey,
value: valueKey,
children: childrenKey
} = (0, import_utils.extend)({
text: "text",
value: "value",
children: "children"
}, props.fieldNames);
const getSelectedOptionsByValue = (options, value) => {
for (const option of options) {
if (option[valueKey] === value) {
return [option];
}
if (option[childrenKey]) {
const selectedOptions = getSelectedOptionsByValue(option[childrenKey], value);
if (selectedOptions) {
return [option, ...selectedOptions];
}
}
}
};
const updateTabs = () => {
const {
options,
modelValue
} = props;
if (modelValue !== void 0) {
const selectedOptions = getSelectedOptionsByValue(options, modelValue);
if (selectedOptions) {
let optionsCursor = options;
tabs.value = selectedOptions.map((option) => {
const tab = {
options: optionsCursor,
selected: option
};
const next = optionsCursor.find((item) => item[valueKey] === option[valueKey]);
if (next) {
optionsCursor = next[childrenKey];
}
return tab;
});
if (optionsCursor) {
tabs.value.push({
options: optionsCursor,
selected: null
});
}
(0, import_vue.nextTick)(() => {
activeTab.value = tabs.value.length - 1;
});
return;
}
}
tabs.value = [{
options,
selected: null
}];
};
const onSelect = (option, tabIndex) => {
if (option.disabled) {
return;
}
tabs.value[tabIndex].selected = option;
if (tabs.value.length > tabIndex + 1) {
tabs.value = tabs.value.slice(0, tabIndex + 1);
}
if (option[childrenKey]) {
const nextTab = {
options: option[childrenKey],
selected: null
};
if (tabs.value[tabIndex + 1]) {
tabs.value[tabIndex + 1] = nextTab;
} else {
tabs.value.push(nextTab);
}
(0, import_vue.nextTick)(() => {
activeTab.value++;
});
}
const selectedOptions = tabs.value.map((tab) => tab.selected).filter(Boolean);
emit("update:modelValue", option[valueKey]);
const params = {
value: option[valueKey],
tabIndex,
selectedOptions
};
emit("change", params);
if (!option[childrenKey]) {
emit("finish", params);
}
};
const onClose = () => emit("close");
const onClickTab = ({
name: name2,
title
}) => emit("clickTab", name2, title);
const renderHeader = () => props.showHeader ? (0, import_vue.createVNode)("div", {
"class": bem("header")
}, [(0, import_vue.createVNode)("h2", {
"class": bem("title")
}, [slots.title ? slots.title() : props.title]), props.closeable ? (0, import_vue.createVNode)(import_icon.Icon, {
"name": props.closeIcon,
"class": [bem("close-icon"), import_utils.HAPTICS_FEEDBACK],
"onClick": onClose
}, null) : null]) : null;
const renderOption = (option, selectedOption, tabIndex) => {
const {
disabled
} = option;
const selected = !!(selectedOption && option[valueKey] === selectedOption[valueKey]);
const color = option.color || (selected ? props.activeColor : void 0);
const Text = slots.option ? slots.option({
option,
selected
}) : (0, import_vue.createVNode)("span", null, [option[textKey]]);
return (0, import_vue.createVNode)("li", {
"ref": selected ? setSelectedElementRefs(tabIndex) : void 0,
"role": "menuitemradio",
"class": [bem("option", {
selected,
disabled
}), option.className],
"style": {
color
},
"tabindex": disabled ? void 0 : selected ? 0 : -1,
"aria-checked": selected,
"aria-disabled": disabled || void 0,
"onClick": () => onSelect(option, tabIndex)
}, [Text, selected ? (0, import_vue.createVNode)(import_icon.Icon, {
"name": "success",
"class": bem("selected-icon")
}, null) : null]);
};
const renderOptions = (options, selectedOption, tabIndex) => (0, import_vue.createVNode)("ul", {
"role": "menu",
"class": bem("options")
}, [options.map((option) => renderOption(option, selectedOption, tabIndex))]);
const renderTab = (tab, tabIndex) => {
const {
options,
selected
} = tab;
const placeholder = props.placeholder || t("select");
const title = selected ? selected[textKey] : placeholder;
return (0, import_vue.createVNode)(import_tab.Tab, {
"title": title,
"titleClass": bem("tab", {
unselected: !selected
})
}, {
default: () => {
var _a, _b;
return [(_a = slots["options-top"]) == null ? void 0 : _a.call(slots, {
tabIndex
}), renderOptions(options, selected, tabIndex), (_b = slots["options-bottom"]) == null ? void 0 : _b.call(slots, {
tabIndex
})];
}
});
};
const renderTabs = () => (0, import_vue.createVNode)(import_tabs.Tabs, {
"active": activeTab.value,
"onUpdate:active": ($event) => activeTab.value = $event,
"shrink": true,
"animated": true,
"class": bem("tabs"),
"color": props.activeColor,
"swipeable": props.swipeable,
"onClickTab": onClickTab
}, {
default: () => [tabs.value.map(renderTab)]
});
const scrollIntoView = (el) => {
const scrollParent = el.parentElement;
if (scrollParent) {
scrollParent.scrollTop = el.offsetTop - (scrollParent.offsetHeight - el.offsetHeight) / 2;
}
};
updateTabs();
(0, import_vue.watch)(activeTab, (value) => {
const el = selectedElementRefs.value[value];
if (el) scrollIntoView(el);
});
(0, import_vue.watch)(() => props.options, updateTabs, {
deep: true
});
(0, import_vue.watch)(() => props.modelValue, (value) => {
if (value !== void 0) {
const values = tabs.value.map((tab) => {
var _a;
return (_a = tab.selected) == null ? void 0 : _a[valueKey];
});
if (values.includes(value)) {
return;
}
}
updateTabs();
});
return () => (0, import_vue.createVNode)("div", {
"class": bem()
}, [renderHeader(), renderTabs()]);
}
});

1
node_modules/vant/lib/cascader/index.css generated vendored Normal file
View File

@@ -0,0 +1 @@
:root,:host{--van-cascader-header-height: 48px;--van-cascader-header-padding: 0 var(--van-padding-md);--van-cascader-title-font-size: var(--van-font-size-lg);--van-cascader-title-line-height: 20px;--van-cascader-close-icon-size: 22px;--van-cascader-close-icon-color: var(--van-gray-5);--van-cascader-selected-icon-size: 18px;--van-cascader-tabs-height: 48px;--van-cascader-active-color: var(--van-primary-color);--van-cascader-options-height: 384px;--van-cascader-option-disabled-color: var(--van-text-color-3);--van-cascader-tab-color: var(--van-text-color);--van-cascader-unselected-tab-color: var(--van-text-color-2)}.van-cascader__header{display:flex;align-items:center;justify-content:space-between;height:var(--van-cascader-header-height);padding:var(--van-cascader-header-padding)}.van-cascader__title{font-weight:var(--van-font-bold);font-size:var(--van-cascader-title-font-size);line-height:var(--van-cascader-title-line-height)}.van-cascader__close-icon{color:var(--van-cascader-close-icon-color);font-size:var(--van-cascader-close-icon-size)}.van-cascader__tabs.van-tabs--line .van-tabs__wrap{height:var(--van-cascader-tabs-height)}.van-cascader__tab{color:var(--van-cascader-tab-color);font-weight:var(--van-font-bold)}.van-cascader__tab--unselected{color:var(--van-cascader-unselected-tab-color);font-weight:400}.van-cascader__option{display:flex;align-items:center;justify-content:space-between;padding:10px var(--van-padding-md);font-size:var(--van-font-size-md);line-height:var(--van-line-height-md);cursor:pointer}.van-cascader__option:active{background-color:var(--van-active-color)}.van-cascader__option--selected{color:var(--van-cascader-active-color);font-weight:var(--van-font-bold)}.van-cascader__option--disabled{color:var(--van-cascader-option-disabled-color);cursor:not-allowed}.van-cascader__option--disabled:active{background-color:transparent}.van-cascader__selected-icon{font-size:var(--van-cascader-selected-icon-size)}.van-cascader__options{box-sizing:border-box;height:var(--van-cascader-options-height);padding-top:6px;overflow-y:auto;-webkit-overflow-scrolling:touch}

74
node_modules/vant/lib/cascader/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,74 @@
export declare const Cascader: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
title: StringConstructor;
options: {
type: import("vue").PropType<import("./types").CascaderOption[]>;
default: () => never[];
};
closeable: {
type: BooleanConstructor;
default: true;
};
swipeable: {
type: BooleanConstructor;
default: true;
};
closeIcon: {
type: import("vue").PropType<string>;
default: string;
};
showHeader: {
type: BooleanConstructor;
default: true;
};
modelValue: (NumberConstructor | StringConstructor)[];
fieldNames: import("vue").PropType<import("./types").CascaderFieldNames>;
placeholder: StringConstructor;
activeColor: StringConstructor;
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "close" | "clickTab" | "finish")[], "update:modelValue" | "change" | "close" | "clickTab" | "finish", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
title: StringConstructor;
options: {
type: import("vue").PropType<import("./types").CascaderOption[]>;
default: () => never[];
};
closeable: {
type: BooleanConstructor;
default: true;
};
swipeable: {
type: BooleanConstructor;
default: true;
};
closeIcon: {
type: import("vue").PropType<string>;
default: string;
};
showHeader: {
type: BooleanConstructor;
default: true;
};
modelValue: (NumberConstructor | StringConstructor)[];
fieldNames: import("vue").PropType<import("./types").CascaderFieldNames>;
placeholder: StringConstructor;
activeColor: StringConstructor;
}>> & Readonly<{
onChange?: ((...args: any[]) => any) | undefined;
onClose?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
onClickTab?: ((...args: any[]) => any) | undefined;
onFinish?: ((...args: any[]) => any) | undefined;
}>, {
closeIcon: string;
closeable: boolean;
options: import("./types").CascaderOption[];
swipeable: boolean;
showHeader: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
export default Cascader;
export { cascaderProps } from './Cascader';
export type { CascaderProps } from './Cascader';
export type { CascaderOption, CascaderThemeVars, CascaderFieldNames, } from './types';
declare module 'vue' {
interface GlobalComponents {
VanCascader: typeof Cascader;
}
}

39
node_modules/vant/lib/cascader/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, {
Cascader: () => Cascader,
cascaderProps: () => import_Cascader2.cascaderProps,
default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_utils = require("../utils");
var import_Cascader = __toESM(require("./Cascader"));
var import_Cascader2 = require("./Cascader");
const Cascader = (0, import_utils.withInstall)(import_Cascader.default);
var stdin_default = Cascader;

1
node_modules/vant/lib/cascader/style/index.d.ts generated vendored Normal file
View File

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

9
node_modules/vant/lib/cascader/style/index.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
require("../../style/base.css");
require("../../badge/index.css");
require("../../icon/index.css");
require("../../sticky/index.css");
require("../../swipe/index.css");
require("../../swipe-item/index.css");
require("../../tabs/index.css");
require("../../tab/index.css");
require("../index.css");

34
node_modules/vant/lib/cascader/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,34 @@
import type { Numeric } from '../utils';
export type CascaderOption = {
text?: string;
value?: Numeric;
color?: string;
disabled?: boolean;
children?: CascaderOption[];
className?: unknown;
[key: PropertyKey]: any;
};
export type CascaderTab = {
options: CascaderOption[];
selected: CascaderOption | null;
};
export type CascaderFieldNames = {
text?: string;
value?: string;
children?: string;
};
export type CascaderThemeVars = {
cascaderHeaderHeight?: string;
cascaderHeaderPadding?: string;
cascaderTitleFontSize?: string;
cascaderTitleLineHeight?: number | string;
cascaderCloseIconSize?: string;
cascaderCloseIconColor?: string;
cascaderSelectedIconSize?: string;
cascaderTabsHeight?: string;
cascaderActiveColor?: string;
cascaderOptionsHeight?: string;
cascaderOptionDisabledColor?: string;
cascaderTabColor?: string;
cascaderUnselectedTabColor?: string;
};

15
node_modules/vant/lib/cascader/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);