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

170
node_modules/vant/lib/coupon-list/CouponList.d.ts generated vendored Normal file
View File

@@ -0,0 +1,170 @@
import { type PropType, type ExtractPropTypes } from 'vue';
import { CouponInfo } from '../coupon';
export declare const couponListProps: {
code: {
type: PropType<string>;
default: string;
};
coupons: {
type: PropType<CouponInfo[]>;
default: () => never[];
};
currency: {
type: PropType<string>;
default: string;
};
showCount: {
type: BooleanConstructor;
default: true;
};
emptyImage: StringConstructor;
enabledTitle: StringConstructor;
disabledTitle: StringConstructor;
disabledCoupons: {
type: PropType<CouponInfo[]>;
default: () => never[];
};
showExchangeBar: {
type: BooleanConstructor;
default: true;
};
showCloseButton: {
type: BooleanConstructor;
default: true;
};
closeButtonText: StringConstructor;
inputPlaceholder: StringConstructor;
exchangeMinLength: {
type: NumberConstructor;
default: number;
};
exchangeButtonText: StringConstructor;
displayedCouponIndex: {
type: NumberConstructor;
default: number;
};
exchangeButtonLoading: BooleanConstructor;
exchangeButtonDisabled: BooleanConstructor;
chosenCoupon: {
type: PropType<number | number[]>;
default: number;
};
};
export type CouponListProps = ExtractPropTypes<typeof couponListProps>;
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
code: {
type: PropType<string>;
default: string;
};
coupons: {
type: PropType<CouponInfo[]>;
default: () => never[];
};
currency: {
type: PropType<string>;
default: string;
};
showCount: {
type: BooleanConstructor;
default: true;
};
emptyImage: StringConstructor;
enabledTitle: StringConstructor;
disabledTitle: StringConstructor;
disabledCoupons: {
type: PropType<CouponInfo[]>;
default: () => never[];
};
showExchangeBar: {
type: BooleanConstructor;
default: true;
};
showCloseButton: {
type: BooleanConstructor;
default: true;
};
closeButtonText: StringConstructor;
inputPlaceholder: StringConstructor;
exchangeMinLength: {
type: NumberConstructor;
default: number;
};
exchangeButtonText: StringConstructor;
displayedCouponIndex: {
type: NumberConstructor;
default: number;
};
exchangeButtonLoading: BooleanConstructor;
exchangeButtonDisabled: BooleanConstructor;
chosenCoupon: {
type: PropType<number | number[]>;
default: number;
};
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "exchange" | "update:code")[], "change" | "exchange" | "update:code", import("vue").PublicProps, Readonly<ExtractPropTypes<{
code: {
type: PropType<string>;
default: string;
};
coupons: {
type: PropType<CouponInfo[]>;
default: () => never[];
};
currency: {
type: PropType<string>;
default: string;
};
showCount: {
type: BooleanConstructor;
default: true;
};
emptyImage: StringConstructor;
enabledTitle: StringConstructor;
disabledTitle: StringConstructor;
disabledCoupons: {
type: PropType<CouponInfo[]>;
default: () => never[];
};
showExchangeBar: {
type: BooleanConstructor;
default: true;
};
showCloseButton: {
type: BooleanConstructor;
default: true;
};
closeButtonText: StringConstructor;
inputPlaceholder: StringConstructor;
exchangeMinLength: {
type: NumberConstructor;
default: number;
};
exchangeButtonText: StringConstructor;
displayedCouponIndex: {
type: NumberConstructor;
default: number;
};
exchangeButtonLoading: BooleanConstructor;
exchangeButtonDisabled: BooleanConstructor;
chosenCoupon: {
type: PropType<number | number[]>;
default: number;
};
}>> & Readonly<{
onChange?: ((...args: any[]) => any) | undefined;
onExchange?: ((...args: any[]) => any) | undefined;
"onUpdate:code"?: ((...args: any[]) => any) | undefined;
}>, {
code: string;
currency: string;
coupons: CouponInfo[];
chosenCoupon: number | number[];
showCount: boolean;
disabledCoupons: CouponInfo[];
showExchangeBar: boolean;
showCloseButton: boolean;
exchangeMinLength: number;
displayedCouponIndex: number;
exchangeButtonLoading: boolean;
exchangeButtonDisabled: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

215
node_modules/vant/lib/coupon-list/CouponList.js generated vendored Normal file
View File

@@ -0,0 +1,215 @@
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, {
couponListProps: () => couponListProps,
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_empty = require("../empty");
var import_field = require("../field");
var import_button = require("../button");
var import_coupon = require("../coupon");
var import_use = require("@vant/use");
const [name, bem, t] = (0, import_utils.createNamespace)("coupon-list");
const couponListProps = {
code: (0, import_utils.makeStringProp)(""),
coupons: (0, import_utils.makeArrayProp)(),
currency: (0, import_utils.makeStringProp)("\xA5"),
showCount: import_utils.truthProp,
emptyImage: String,
enabledTitle: String,
disabledTitle: String,
disabledCoupons: (0, import_utils.makeArrayProp)(),
showExchangeBar: import_utils.truthProp,
showCloseButton: import_utils.truthProp,
closeButtonText: String,
inputPlaceholder: String,
exchangeMinLength: (0, import_utils.makeNumberProp)(1),
exchangeButtonText: String,
displayedCouponIndex: (0, import_utils.makeNumberProp)(-1),
exchangeButtonLoading: Boolean,
exchangeButtonDisabled: Boolean,
chosenCoupon: {
type: [Number, Array],
default: -1
}
};
var stdin_default = (0, import_vue.defineComponent)({
name,
props: couponListProps,
emits: ["change", "exchange", "update:code"],
setup(props, {
emit,
slots
}) {
const [couponRefs, setCouponRefs] = (0, import_use_refs.useRefs)();
const root = (0, import_vue.ref)();
const barRef = (0, import_vue.ref)();
const activeTab = (0, import_vue.ref)(0);
const listHeight = (0, import_vue.ref)(0);
const currentCode = (0, import_vue.ref)(props.code);
const buttonDisabled = (0, import_vue.computed)(() => !props.exchangeButtonLoading && (props.exchangeButtonDisabled || !currentCode.value || currentCode.value.length < props.exchangeMinLength));
const updateListHeight = () => {
const TABS_HEIGHT = 44;
const rootHeight = (0, import_use.useRect)(root).height;
const headerHeight = (0, import_use.useRect)(barRef).height + TABS_HEIGHT;
listHeight.value = (rootHeight > headerHeight ? rootHeight : import_utils.windowHeight.value) - headerHeight;
};
const onExchange = () => {
emit("exchange", currentCode.value);
if (!props.code) {
currentCode.value = "";
}
};
const scrollToCoupon = (index) => {
(0, import_vue.nextTick)(() => {
var _a;
return (_a = couponRefs.value[index]) == null ? void 0 : _a.scrollIntoView();
});
};
const renderEmpty = () => (0, import_vue.createVNode)(import_empty.Empty, {
"image": props.emptyImage
}, {
default: () => [(0, import_vue.createVNode)("p", {
"class": bem("empty-tip")
}, [t("noCoupon")])]
});
const renderExchangeBar = () => {
if (props.showExchangeBar) {
return (0, import_vue.createVNode)("div", {
"ref": barRef,
"class": bem("exchange-bar")
}, [(0, import_vue.createVNode)(import_field.Field, {
"modelValue": currentCode.value,
"onUpdate:modelValue": ($event) => currentCode.value = $event,
"clearable": true,
"border": false,
"class": bem("field"),
"placeholder": props.inputPlaceholder || t("placeholder"),
"maxlength": "20"
}, null), (0, import_vue.createVNode)(import_button.Button, {
"plain": true,
"type": "primary",
"class": bem("exchange"),
"text": props.exchangeButtonText || t("exchange"),
"loading": props.exchangeButtonLoading,
"disabled": buttonDisabled.value,
"onClick": onExchange
}, null)]);
}
};
const renderCouponTab = () => {
const {
coupons,
chosenCoupon
} = props;
const count = props.showCount ? ` (${coupons.length})` : "";
const title = (props.enabledTitle || t("enable")) + count;
const updateChosenCoupon = (currentValues = [], value = 0) => {
if (currentValues.includes(value)) {
return currentValues.filter((item) => item !== value);
}
return [...currentValues, value];
};
return (0, import_vue.createVNode)(import_tab.Tab, {
"title": title
}, {
default: () => {
var _a;
return [(0, import_vue.createVNode)("div", {
"class": bem("list", {
"with-bottom": props.showCloseButton
}),
"style": {
height: `${listHeight.value}px`
}
}, [coupons.map((coupon, index) => (0, import_vue.createVNode)(import_coupon.Coupon, {
"key": coupon.id,
"ref": setCouponRefs(index),
"coupon": coupon,
"chosen": Array.isArray(chosenCoupon) ? chosenCoupon.includes(index) : index === chosenCoupon,
"currency": props.currency,
"onClick": () => emit("change", Array.isArray(chosenCoupon) ? updateChosenCoupon(chosenCoupon, index) : index)
}, null)), !coupons.length && renderEmpty(), (_a = slots["list-footer"]) == null ? void 0 : _a.call(slots)])];
}
});
};
const renderDisabledTab = () => {
const {
disabledCoupons
} = props;
const count = props.showCount ? ` (${disabledCoupons.length})` : "";
const title = (props.disabledTitle || t("disabled")) + count;
return (0, import_vue.createVNode)(import_tab.Tab, {
"title": title
}, {
default: () => {
var _a;
return [(0, import_vue.createVNode)("div", {
"class": bem("list", {
"with-bottom": props.showCloseButton
}),
"style": {
height: `${listHeight.value}px`
}
}, [disabledCoupons.map((coupon) => (0, import_vue.createVNode)(import_coupon.Coupon, {
"disabled": true,
"key": coupon.id,
"coupon": coupon,
"currency": props.currency
}, null)), !disabledCoupons.length && renderEmpty(), (_a = slots["disabled-list-footer"]) == null ? void 0 : _a.call(slots)])];
}
});
};
(0, import_vue.watch)(() => props.code, (value) => {
currentCode.value = value;
});
(0, import_vue.watch)(import_utils.windowHeight, updateListHeight);
(0, import_vue.watch)(currentCode, (value) => emit("update:code", value));
(0, import_vue.watch)(() => props.displayedCouponIndex, scrollToCoupon);
(0, import_vue.onMounted)(() => {
updateListHeight();
scrollToCoupon(props.displayedCouponIndex);
});
return () => (0, import_vue.createVNode)("div", {
"ref": root,
"class": bem()
}, [renderExchangeBar(), (0, import_vue.createVNode)(import_tabs.Tabs, {
"active": activeTab.value,
"onUpdate:active": ($event) => activeTab.value = $event,
"class": bem("tab")
}, {
default: () => [renderCouponTab(), renderDisabledTab()]
}), (0, import_vue.createVNode)("div", {
"class": bem("bottom")
}, [slots["list-button"] ? slots["list-button"]() : (0, import_vue.withDirectives)((0, import_vue.createVNode)(import_button.Button, {
"round": true,
"block": true,
"type": "primary",
"class": bem("close"),
"text": props.closeButtonText || t("close"),
"onClick": () => emit("change", Array.isArray(props.chosenCoupon) ? [] : -1)
}, null), [[import_vue.vShow, props.showCloseButton]])])]);
}
});

1
node_modules/vant/lib/coupon-list/index.css generated vendored Normal file
View File

@@ -0,0 +1 @@
:root,:host{--van-coupon-list-background: var(--van-background);--van-coupon-list-field-padding: 5px 0 5px var(--van-padding-md);--van-coupon-list-exchange-button-height: 32px;--van-coupon-list-close-button-height: 40px;--van-coupon-list-empty-tip-color: var(--van-text-color-2);--van-coupon-list-empty-tip-font-size: var(--van-font-size-md);--van-coupon-list-empty-tip-line-height: var(--van-line-height-md)}.van-coupon-list{position:relative;height:100%;background:var(--van-coupon-list-background)}.van-coupon-list__field{padding:var(--van-coupon-list-field-padding)}.van-coupon-list__field .van-field__body{height:34px;padding-left:var(--van-padding-sm);line-height:34px;background:var(--van-background);border-radius:var(--van-radius-max)}.van-coupon-list__field .van-field__body::-webkit-input-placeholder{color:var(--van-text-color-3)}.van-coupon-list__field .van-field__body::placeholder{color:var(--van-text-color-3)}.van-coupon-list__field .van-field__clear{margin-right:0}.van-coupon-list__exchange-bar{display:flex;align-items:center;background-color:var(--van-background-2)}.van-coupon-list__exchange{flex:none;height:var(--van-coupon-list-exchange-button-height);font-size:var(--van-font-size-lg);line-height:calc(var(--van-coupon-list-exchange-button-height) - 2px);border:0}.van-coupon-list .van-tabs__wrap{box-shadow:0 6px 12px -12px var(--van-gray-6)}.van-coupon-list__list{box-sizing:border-box;padding:var(--van-padding-md) 0 var(--van-padding-lg);overflow-y:auto;-webkit-overflow-scrolling:touch}.van-coupon-list__list--with-bottom{padding-bottom:50px}.van-coupon-list__bottom{position:absolute;bottom:0;left:0;z-index:999;box-sizing:border-box;width:100%;padding:5px var(--van-padding-md);font-weight:var(--van-font-bold);background-color:var(--van-background-2)}.van-coupon-list__close{height:var(--van-coupon-list-close-button-height)}.van-coupon-list__empty-tip{color:var(--van-coupon-list-empty-tip-color);font-size:var(--van-coupon-list-empty-tip-font-size);line-height:var(--van-coupon-list-empty-tip-line-height)}

125
node_modules/vant/lib/coupon-list/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,125 @@
export declare const CouponList: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
code: {
type: import("vue").PropType<string>;
default: string;
};
coupons: {
type: import("vue").PropType<import("..").CouponInfo[]>;
default: () => never[];
};
currency: {
type: import("vue").PropType<string>;
default: string;
};
showCount: {
type: BooleanConstructor;
default: true;
};
emptyImage: StringConstructor;
enabledTitle: StringConstructor;
disabledTitle: StringConstructor;
disabledCoupons: {
type: import("vue").PropType<import("..").CouponInfo[]>;
default: () => never[];
};
showExchangeBar: {
type: BooleanConstructor;
default: true;
};
showCloseButton: {
type: BooleanConstructor;
default: true;
};
closeButtonText: StringConstructor;
inputPlaceholder: StringConstructor;
exchangeMinLength: {
type: NumberConstructor;
default: number;
};
exchangeButtonText: StringConstructor;
displayedCouponIndex: {
type: NumberConstructor;
default: number;
};
exchangeButtonLoading: BooleanConstructor;
exchangeButtonDisabled: BooleanConstructor;
chosenCoupon: {
type: import("vue").PropType<number | number[]>;
default: number;
};
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "exchange" | "update:code")[], "change" | "exchange" | "update:code", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
code: {
type: import("vue").PropType<string>;
default: string;
};
coupons: {
type: import("vue").PropType<import("..").CouponInfo[]>;
default: () => never[];
};
currency: {
type: import("vue").PropType<string>;
default: string;
};
showCount: {
type: BooleanConstructor;
default: true;
};
emptyImage: StringConstructor;
enabledTitle: StringConstructor;
disabledTitle: StringConstructor;
disabledCoupons: {
type: import("vue").PropType<import("..").CouponInfo[]>;
default: () => never[];
};
showExchangeBar: {
type: BooleanConstructor;
default: true;
};
showCloseButton: {
type: BooleanConstructor;
default: true;
};
closeButtonText: StringConstructor;
inputPlaceholder: StringConstructor;
exchangeMinLength: {
type: NumberConstructor;
default: number;
};
exchangeButtonText: StringConstructor;
displayedCouponIndex: {
type: NumberConstructor;
default: number;
};
exchangeButtonLoading: BooleanConstructor;
exchangeButtonDisabled: BooleanConstructor;
chosenCoupon: {
type: import("vue").PropType<number | number[]>;
default: number;
};
}>> & Readonly<{
onChange?: ((...args: any[]) => any) | undefined;
onExchange?: ((...args: any[]) => any) | undefined;
"onUpdate:code"?: ((...args: any[]) => any) | undefined;
}>, {
code: string;
currency: string;
coupons: import("..").CouponInfo[];
chosenCoupon: number | number[];
showCount: boolean;
disabledCoupons: import("..").CouponInfo[];
showExchangeBar: boolean;
showCloseButton: boolean;
exchangeMinLength: number;
displayedCouponIndex: number;
exchangeButtonLoading: boolean;
exchangeButtonDisabled: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
export default CouponList;
export { couponListProps } from './CouponList';
export type { CouponListProps } from './CouponList';
export type { CouponListThemeVars } from './types';
declare module 'vue' {
interface GlobalComponents {
VanCouponList: typeof CouponList;
}
}

39
node_modules/vant/lib/coupon-list/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, {
CouponList: () => CouponList,
couponListProps: () => import_CouponList2.couponListProps,
default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_utils = require("../utils");
var import_CouponList = __toESM(require("./CouponList"));
var import_CouponList2 = require("./CouponList");
const CouponList = (0, import_utils.withInstall)(import_CouponList.default);
var stdin_default = CouponList;

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

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

17
node_modules/vant/lib/coupon-list/style/index.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
require("../../style/base.css");
require("../../badge/index.css");
require("../../icon/index.css");
require("../../cell/index.css");
require("../../field/index.css");
require("../../loading/index.css");
require("../../button/index.css");
require("../../sticky/index.css");
require("../../swipe/index.css");
require("../../swipe-item/index.css");
require("../../tabs/index.css");
require("../../tab/index.css");
require("../../checkbox-group/index.css");
require("../../checkbox/index.css");
require("../../coupon/index.css");
require("../../empty/index.css");
require("../index.css");

9
node_modules/vant/lib/coupon-list/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
export type CouponListThemeVars = {
couponListBackground?: string;
couponListFieldPadding?: string;
couponListExchangeButtonHeight?: string;
couponListCloseButtonHeight?: string;
couponListEmptyTipColor?: string;
couponListEmptyTipFontSize?: string;
couponListEmptyTipLineHeight?: number | string;
};

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