first commit
This commit is contained in:
78
node_modules/vant/lib/coupon-cell/CouponCell.d.ts
generated
vendored
Normal file
78
node_modules/vant/lib/coupon-cell/CouponCell.d.ts
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
import { type PropType, type ExtractPropTypes } from 'vue';
|
||||
import type { CouponInfo } from '../coupon';
|
||||
export declare const couponCellProps: {
|
||||
title: StringConstructor;
|
||||
border: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
editable: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
coupons: {
|
||||
type: PropType<CouponInfo[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
currency: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
chosenCoupon: {
|
||||
type: PropType<number | number[]>;
|
||||
default: number;
|
||||
};
|
||||
};
|
||||
export type CouponCellProps = ExtractPropTypes<typeof couponCellProps>;
|
||||
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
||||
title: StringConstructor;
|
||||
border: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
editable: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
coupons: {
|
||||
type: PropType<CouponInfo[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
currency: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
chosenCoupon: {
|
||||
type: PropType<number | number[]>;
|
||||
default: number;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
||||
title: StringConstructor;
|
||||
border: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
editable: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
coupons: {
|
||||
type: PropType<CouponInfo[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
currency: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
chosenCoupon: {
|
||||
type: PropType<number | number[]>;
|
||||
default: number;
|
||||
};
|
||||
}>> & Readonly<{}>, {
|
||||
border: boolean;
|
||||
currency: string;
|
||||
editable: boolean;
|
||||
coupons: CouponInfo[];
|
||||
chosenCoupon: number | number[];
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
89
node_modules/vant/lib/coupon-cell/CouponCell.js
generated
vendored
Normal file
89
node_modules/vant/lib/coupon-cell/CouponCell.js
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
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, {
|
||||
couponCellProps: () => couponCellProps,
|
||||
default: () => stdin_default
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_vue = require("vue");
|
||||
var import_utils = require("../utils");
|
||||
var import_cell = require("../cell");
|
||||
const [name, bem, t] = (0, import_utils.createNamespace)("coupon-cell");
|
||||
const couponCellProps = {
|
||||
title: String,
|
||||
border: import_utils.truthProp,
|
||||
editable: import_utils.truthProp,
|
||||
coupons: (0, import_utils.makeArrayProp)(),
|
||||
currency: (0, import_utils.makeStringProp)("\xA5"),
|
||||
chosenCoupon: {
|
||||
type: [Number, Array],
|
||||
default: -1
|
||||
}
|
||||
};
|
||||
const getValue = (coupon) => {
|
||||
const {
|
||||
value,
|
||||
denominations
|
||||
} = coupon;
|
||||
if ((0, import_utils.isDef)(value)) {
|
||||
return value;
|
||||
}
|
||||
if ((0, import_utils.isDef)(denominations)) {
|
||||
return denominations;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
function formatValue({
|
||||
coupons,
|
||||
chosenCoupon,
|
||||
currency
|
||||
}) {
|
||||
let value = 0;
|
||||
let isExist = false;
|
||||
(Array.isArray(chosenCoupon) ? chosenCoupon : [chosenCoupon]).forEach((i) => {
|
||||
const coupon = coupons[+i];
|
||||
if (coupon) {
|
||||
isExist = true;
|
||||
value += getValue(coupon);
|
||||
}
|
||||
});
|
||||
if (isExist) {
|
||||
return `-${currency} ${(value / 100).toFixed(2)}`;
|
||||
}
|
||||
return coupons.length === 0 ? t("noCoupon") : t("count", coupons.length);
|
||||
}
|
||||
var stdin_default = (0, import_vue.defineComponent)({
|
||||
name,
|
||||
props: couponCellProps,
|
||||
setup(props) {
|
||||
return () => {
|
||||
const selected = Array.isArray(props.chosenCoupon) ? props.chosenCoupon.length : props.coupons[+props.chosenCoupon];
|
||||
return (0, import_vue.createVNode)(import_cell.Cell, {
|
||||
"class": bem(),
|
||||
"value": formatValue(props),
|
||||
"title": props.title || t("title"),
|
||||
"border": props.border,
|
||||
"isLink": props.editable,
|
||||
"valueClass": bem("value", {
|
||||
selected
|
||||
})
|
||||
}, null);
|
||||
};
|
||||
}
|
||||
});
|
||||
1
node_modules/vant/lib/coupon-cell/index.css
generated
vendored
Normal file
1
node_modules/vant/lib/coupon-cell/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
:root,:host{--van-coupon-cell-selected-text-color: var(--van-text-color)}.van-coupon-cell__value--selected{color:var(--van-coupon-cell-selected-text-color)}
|
||||
60
node_modules/vant/lib/coupon-cell/index.d.ts
generated
vendored
Normal file
60
node_modules/vant/lib/coupon-cell/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
export declare const CouponCell: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
title: StringConstructor;
|
||||
border: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
editable: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
coupons: {
|
||||
type: import("vue").PropType<import("..").CouponInfo[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
currency: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
chosenCoupon: {
|
||||
type: import("vue").PropType<number | number[]>;
|
||||
default: number;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
title: StringConstructor;
|
||||
border: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
editable: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
coupons: {
|
||||
type: import("vue").PropType<import("..").CouponInfo[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
currency: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
chosenCoupon: {
|
||||
type: import("vue").PropType<number | number[]>;
|
||||
default: number;
|
||||
};
|
||||
}>> & Readonly<{}>, {
|
||||
border: boolean;
|
||||
currency: string;
|
||||
editable: boolean;
|
||||
coupons: import("..").CouponInfo[];
|
||||
chosenCoupon: number | number[];
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
export default CouponCell;
|
||||
export { couponCellProps } from './CouponCell';
|
||||
export type { CouponCellProps } from './CouponCell';
|
||||
export type { CouponCellThemeVars } from './types';
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {
|
||||
VanCouponCell: typeof CouponCell;
|
||||
}
|
||||
}
|
||||
39
node_modules/vant/lib/coupon-cell/index.js
generated
vendored
Normal file
39
node_modules/vant/lib/coupon-cell/index.js
generated
vendored
Normal 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, {
|
||||
CouponCell: () => CouponCell,
|
||||
couponCellProps: () => import_CouponCell2.couponCellProps,
|
||||
default: () => stdin_default
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_utils = require("../utils");
|
||||
var import_CouponCell = __toESM(require("./CouponCell"));
|
||||
var import_CouponCell2 = require("./CouponCell");
|
||||
const CouponCell = (0, import_utils.withInstall)(import_CouponCell.default);
|
||||
var stdin_default = CouponCell;
|
||||
1
node_modules/vant/lib/coupon-cell/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/lib/coupon-cell/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
5
node_modules/vant/lib/coupon-cell/style/index.js
generated
vendored
Normal file
5
node_modules/vant/lib/coupon-cell/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
require("../../style/base.css");
|
||||
require("../../badge/index.css");
|
||||
require("../../icon/index.css");
|
||||
require("../../cell/index.css");
|
||||
require("../index.css");
|
||||
3
node_modules/vant/lib/coupon-cell/types.d.ts
generated
vendored
Normal file
3
node_modules/vant/lib/coupon-cell/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export type CouponCellThemeVars = {
|
||||
couponCellSelectedTextColor?: string;
|
||||
};
|
||||
15
node_modules/vant/lib/coupon-cell/types.js
generated
vendored
Normal file
15
node_modules/vant/lib/coupon-cell/types.js
generated
vendored
Normal 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);
|
||||
Reference in New Issue
Block a user