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

176
node_modules/vant/lib/date-picker/DatePicker.d.ts generated vendored Normal file
View File

@@ -0,0 +1,176 @@
import { type ComponentPublicInstance, type PropType, type ExtractPropTypes } from 'vue';
export type DatePickerColumnType = 'year' | 'month' | 'day';
export declare const datePickerProps: {
loading: BooleanConstructor;
readonly: BooleanConstructor;
allowHtml: BooleanConstructor;
optionHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
showToolbar: {
type: BooleanConstructor;
default: true;
};
swipeDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
visibleOptionNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
} & {
title: StringConstructor;
cancelButtonText: StringConstructor;
confirmButtonText: StringConstructor;
} & {
modelValue: {
type: PropType<string[]>;
default: () => never[];
};
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values: string[]) => import("../picker").PickerOption[]>;
formatter: {
type: PropType<(type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption>;
default: (type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption;
};
} & {
columnsType: {
type: PropType<DatePickerColumnType[]>;
default: () => string[];
};
minDate: {
type: DateConstructor;
default: () => Date;
validator: (val: unknown) => val is Date;
};
maxDate: {
type: DateConstructor;
default: () => Date;
validator: (val: unknown) => val is Date;
};
};
export type DatePickerExpose = {
confirm: () => void;
getSelectedDate: () => string[];
};
export type DatePickerProps = ExtractPropTypes<typeof datePickerProps>;
export type DatePickerInstance = ComponentPublicInstance<DatePickerProps, DatePickerExpose>;
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
loading: BooleanConstructor;
readonly: BooleanConstructor;
allowHtml: BooleanConstructor;
optionHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
showToolbar: {
type: BooleanConstructor;
default: true;
};
swipeDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
visibleOptionNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
} & {
title: StringConstructor;
cancelButtonText: StringConstructor;
confirmButtonText: StringConstructor;
} & {
modelValue: {
type: PropType<string[]>;
default: () => never[];
};
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values: string[]) => import("../picker").PickerOption[]>;
formatter: {
type: PropType<(type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption>;
default: (type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption;
};
} & {
columnsType: {
type: PropType<DatePickerColumnType[]>;
default: () => string[];
};
minDate: {
type: DateConstructor;
default: () => Date;
validator: (val: unknown) => val is Date;
};
maxDate: {
type: DateConstructor;
default: () => Date;
validator: (val: unknown) => val is Date;
};
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").PublicProps, Readonly<ExtractPropTypes<{
loading: BooleanConstructor;
readonly: BooleanConstructor;
allowHtml: BooleanConstructor;
optionHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
showToolbar: {
type: BooleanConstructor;
default: true;
};
swipeDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
visibleOptionNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
} & {
title: StringConstructor;
cancelButtonText: StringConstructor;
confirmButtonText: StringConstructor;
} & {
modelValue: {
type: PropType<string[]>;
default: () => never[];
};
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values: string[]) => import("../picker").PickerOption[]>;
formatter: {
type: PropType<(type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption>;
default: (type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption;
};
} & {
columnsType: {
type: PropType<DatePickerColumnType[]>;
default: () => string[];
};
minDate: {
type: DateConstructor;
default: () => Date;
validator: (val: unknown) => val is Date;
};
maxDate: {
type: DateConstructor;
default: () => Date;
validator: (val: unknown) => val is Date;
};
}>> & Readonly<{
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
onCancel?: ((...args: any[]) => any) | undefined;
onConfirm?: ((...args: any[]) => any) | undefined;
}>, {
formatter: (type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption;
modelValue: string[];
readonly: boolean;
loading: boolean;
allowHtml: boolean;
optionHeight: string | number;
showToolbar: boolean;
swipeDuration: string | number;
visibleOptionNum: string | number;
minDate: Date;
maxDate: Date;
columnsType: DatePickerColumnType[];
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

152
node_modules/vant/lib/date-picker/DatePicker.js generated vendored Normal file
View File

@@ -0,0 +1,152 @@
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, {
datePickerProps: () => datePickerProps,
default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_vue = require("vue");
var import_utils = require("../utils");
var import_utils2 = require("./utils");
var import_use_expose = require("../composables/use-expose");
var import_picker = require("../picker");
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
const [name] = (0, import_utils.createNamespace)("date-picker");
const datePickerProps = (0, import_utils.extend)({}, import_utils2.sharedProps, {
columnsType: {
type: Array,
default: () => ["year", "month", "day"]
},
minDate: {
type: Date,
default: () => new Date(currentYear - 10, 0, 1),
validator: import_utils.isDate
},
maxDate: {
type: Date,
default: () => new Date(currentYear + 10, 11, 31),
validator: import_utils.isDate
}
});
var stdin_default = (0, import_vue.defineComponent)({
name,
props: datePickerProps,
emits: ["confirm", "cancel", "change", "update:modelValue"],
setup(props, {
emit,
slots
}) {
const currentValues = (0, import_vue.ref)(props.modelValue);
const updatedByExternalSources = (0, import_vue.ref)(false);
const pickerRef = (0, import_vue.ref)();
const computedValues = (0, import_vue.computed)(() => updatedByExternalSources.value ? props.modelValue : currentValues.value);
const isMinYear = (year) => year === props.minDate.getFullYear();
const isMaxYear = (year) => year === props.maxDate.getFullYear();
const isMinMonth = (month) => month === props.minDate.getMonth() + 1;
const isMaxMonth = (month) => month === props.maxDate.getMonth() + 1;
const getValue = (type) => {
const {
minDate,
columnsType
} = props;
const index = columnsType.indexOf(type);
const value = computedValues.value[index];
if (value) {
return +value;
}
switch (type) {
case "year":
return minDate.getFullYear();
case "month":
return minDate.getMonth() + 1;
case "day":
return minDate.getDate();
}
};
const genYearOptions = () => {
const minYear = props.minDate.getFullYear();
const maxYear = props.maxDate.getFullYear();
return (0, import_utils2.genOptions)(minYear, maxYear, "year", props.formatter, props.filter, computedValues.value);
};
const genMonthOptions = () => {
const year = getValue("year");
const minMonth = isMinYear(year) ? props.minDate.getMonth() + 1 : 1;
const maxMonth = isMaxYear(year) ? props.maxDate.getMonth() + 1 : 12;
return (0, import_utils2.genOptions)(minMonth, maxMonth, "month", props.formatter, props.filter, computedValues.value);
};
const genDayOptions = () => {
const year = getValue("year");
const month = getValue("month");
const minDate = isMinYear(year) && isMinMonth(month) ? props.minDate.getDate() : 1;
const maxDate = isMaxYear(year) && isMaxMonth(month) ? props.maxDate.getDate() : (0, import_utils2.getMonthEndDay)(year, month);
return (0, import_utils2.genOptions)(minDate, maxDate, "day", props.formatter, props.filter, computedValues.value);
};
const confirm = () => {
var _a;
return (_a = pickerRef.value) == null ? void 0 : _a.confirm();
};
const getSelectedDate = () => currentValues.value;
const columns = (0, import_vue.computed)(() => props.columnsType.map((type) => {
switch (type) {
case "year":
return genYearOptions();
case "month":
return genMonthOptions();
case "day":
return genDayOptions();
default:
if (process.env.NODE_ENV !== "production") {
throw new Error(`[Vant] DatePicker: unsupported columns type: ${type}`);
}
return [];
}
}));
(0, import_vue.watch)(currentValues, (newValues) => {
if (!(0, import_utils.isSameValue)(newValues, props.modelValue)) {
emit("update:modelValue", newValues);
}
});
(0, import_vue.watch)(() => props.modelValue, (newValues, oldValues) => {
updatedByExternalSources.value = (0, import_utils.isSameValue)(oldValues, currentValues.value);
newValues = (0, import_utils2.formatValueRange)(newValues, columns.value);
if (!(0, import_utils.isSameValue)(newValues, currentValues.value)) {
currentValues.value = newValues;
}
updatedByExternalSources.value = false;
}, {
immediate: true
});
const onChange = (...args) => emit("change", ...args);
const onCancel = (...args) => emit("cancel", ...args);
const onConfirm = (...args) => emit("confirm", ...args);
(0, import_use_expose.useExpose)({
confirm,
getSelectedDate
});
return () => (0, import_vue.createVNode)(import_picker.Picker, (0, import_vue.mergeProps)({
"ref": pickerRef,
"modelValue": currentValues.value,
"onUpdate:modelValue": ($event) => currentValues.value = $event,
"columns": columns.value,
"onChange": onChange,
"onCancel": onCancel,
"onConfirm": onConfirm
}, (0, import_utils.pick)(props, import_utils2.pickerInheritKeys)), slots);
}
});

127
node_modules/vant/lib/date-picker/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,127 @@
import { DatePickerProps } from './DatePicker';
export declare const DatePicker: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
loading: BooleanConstructor;
readonly: BooleanConstructor;
allowHtml: BooleanConstructor;
optionHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
showToolbar: {
type: BooleanConstructor;
default: true;
};
swipeDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
visibleOptionNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
} & {
title: StringConstructor;
cancelButtonText: StringConstructor;
confirmButtonText: StringConstructor;
} & {
modelValue: {
type: import("vue").PropType<string[]>;
default: () => never[];
};
filter: import("vue").PropType<(columnType: string, options: import("..").PickerOption[], values: string[]) => import("..").PickerOption[]>;
formatter: {
type: import("vue").PropType<(type: string, option: import("..").PickerOption) => import("..").PickerOption>;
default: (type: string, option: import("..").PickerOption) => import("..").PickerOption;
};
} & {
columnsType: {
type: import("vue").PropType<import("./DatePicker").DatePickerColumnType[]>;
default: () => string[];
};
minDate: {
type: DateConstructor;
default: () => Date;
validator: (val: unknown) => val is Date;
};
maxDate: {
type: DateConstructor;
default: () => Date;
validator: (val: unknown) => val is Date;
};
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
loading: BooleanConstructor;
readonly: BooleanConstructor;
allowHtml: BooleanConstructor;
optionHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
showToolbar: {
type: BooleanConstructor;
default: true;
};
swipeDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
visibleOptionNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
} & {
title: StringConstructor;
cancelButtonText: StringConstructor;
confirmButtonText: StringConstructor;
} & {
modelValue: {
type: import("vue").PropType<string[]>;
default: () => never[];
};
filter: import("vue").PropType<(columnType: string, options: import("..").PickerOption[], values: string[]) => import("..").PickerOption[]>;
formatter: {
type: import("vue").PropType<(type: string, option: import("..").PickerOption) => import("..").PickerOption>;
default: (type: string, option: import("..").PickerOption) => import("..").PickerOption;
};
} & {
columnsType: {
type: import("vue").PropType<import("./DatePicker").DatePickerColumnType[]>;
default: () => string[];
};
minDate: {
type: DateConstructor;
default: () => Date;
validator: (val: unknown) => val is Date;
};
maxDate: {
type: DateConstructor;
default: () => Date;
validator: (val: unknown) => val is Date;
};
}>> & Readonly<{
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
onCancel?: ((...args: any[]) => any) | undefined;
onConfirm?: ((...args: any[]) => any) | undefined;
}>, {
formatter: (type: string, option: import("..").PickerOption) => import("..").PickerOption;
modelValue: string[];
readonly: boolean;
loading: boolean;
allowHtml: boolean;
optionHeight: string | number;
showToolbar: boolean;
swipeDuration: string | number;
visibleOptionNum: string | number;
minDate: Date;
maxDate: Date;
columnsType: import("./DatePicker").DatePickerColumnType[];
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
export default DatePicker;
export { datePickerProps } from './DatePicker';
export type { DatePickerProps };
export type { DatePickerColumnType, DatePickerInstance } from './DatePicker';
declare module 'vue' {
interface GlobalComponents {
VanDatePicker: typeof DatePicker;
}
}

39
node_modules/vant/lib/date-picker/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, {
DatePicker: () => DatePicker,
datePickerProps: () => import_DatePicker2.datePickerProps,
default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_utils = require("../utils");
var import_DatePicker = __toESM(require("./DatePicker"));
var import_DatePicker2 = require("./DatePicker");
const DatePicker = (0, import_utils.withInstall)(import_DatePicker.default);
var stdin_default = DatePicker;

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

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

10
node_modules/vant/lib/date-picker/style/index.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
require("../../style/base.css");
require("../../badge/index.css");
require("../../loading/index.css");
require("../../sticky/index.css");
require("../../swipe/index.css");
require("../../swipe-item/index.css");
require("../../tabs/index.css");
require("../../tab/index.css");
require("../../picker/index.css");
require("../../picker-group/index.css");

46
node_modules/vant/lib/date-picker/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,46 @@
import { pickerSharedProps } from '../picker/Picker';
import type { PropType } from 'vue';
import type { PickerOption } from '../picker';
type Filter = (columnType: string, options: PickerOption[], values: string[]) => PickerOption[];
type Formatter = (type: string, option: PickerOption) => PickerOption;
export declare const sharedProps: {
loading: BooleanConstructor;
readonly: BooleanConstructor;
allowHtml: BooleanConstructor;
optionHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
showToolbar: {
type: BooleanConstructor;
default: true;
};
swipeDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
visibleOptionNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
} & {
title: StringConstructor;
cancelButtonText: StringConstructor;
confirmButtonText: StringConstructor;
} & {
modelValue: {
type: PropType<string[]>;
default: () => never[];
};
filter: PropType<Filter>;
formatter: {
type: PropType<Formatter>;
default: (type: string, option: PickerOption) => PickerOption;
};
};
export declare const pickerInheritKeys: Array<keyof typeof pickerSharedProps>;
export declare function times<T>(n: number, iteratee: (index: number) => T): T[];
export declare const getMonthEndDay: (year: number, month: number) => number;
export declare const genOptions: <T extends string>(min: number, max: number, type: T, formatter: Formatter, filter: Filter | undefined, values: string[]) => PickerOption[];
export declare const formatValueRange: (values: string[], columns: PickerOption[][]) => string[];
export {};

69
node_modules/vant/lib/date-picker/utils.js generated vendored Normal file
View File

@@ -0,0 +1,69 @@
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
formatValueRange: () => formatValueRange,
genOptions: () => genOptions,
getMonthEndDay: () => getMonthEndDay,
pickerInheritKeys: () => pickerInheritKeys,
sharedProps: () => sharedProps,
times: () => times
});
module.exports = __toCommonJS(stdin_exports);
var import_utils = require("../utils");
var import_Picker = require("../picker/Picker");
const sharedProps = (0, import_utils.extend)({}, import_Picker.pickerSharedProps, {
modelValue: (0, import_utils.makeArrayProp)(),
filter: Function,
formatter: {
type: Function,
default: (type, option) => option
}
});
const pickerInheritKeys = Object.keys(import_Picker.pickerSharedProps);
function times(n, iteratee) {
if (n < 0) {
return [];
}
const result = Array(n);
let index = -1;
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
const getMonthEndDay = (year, month) => 32 - new Date(year, month - 1, 32).getDate();
const genOptions = (min, max, type, formatter, filter, values) => {
const options = times(max - min + 1, (index) => {
const value = (0, import_utils.padZero)(min + index);
return formatter(type, {
text: value,
value
});
});
return filter ? filter(type, options, values) : options;
};
const formatValueRange = (values, columns) => values.map((value, index) => {
const column = columns[index];
if (column.length) {
const minValue = +column[0].value;
const maxValue = +column[column.length - 1].value;
return (0, import_utils.padZero)((0, import_utils.clamp)(+value, minValue, maxValue));
}
return value;
});