first commit
This commit is contained in:
78
node_modules/vant/es/coupon-cell/CouponCell.d.ts
generated
vendored
Normal file
78
node_modules/vant/es/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;
|
||||
70
node_modules/vant/es/coupon-cell/CouponCell.mjs
generated
vendored
Normal file
70
node_modules/vant/es/coupon-cell/CouponCell.mjs
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
import { defineComponent, createVNode as _createVNode } from "vue";
|
||||
import { isDef, truthProp, makeArrayProp, makeStringProp, createNamespace } from "../utils/index.mjs";
|
||||
import { Cell } from "../cell/index.mjs";
|
||||
const [name, bem, t] = createNamespace("coupon-cell");
|
||||
const couponCellProps = {
|
||||
title: String,
|
||||
border: truthProp,
|
||||
editable: truthProp,
|
||||
coupons: makeArrayProp(),
|
||||
currency: makeStringProp("\xA5"),
|
||||
chosenCoupon: {
|
||||
type: [Number, Array],
|
||||
default: -1
|
||||
}
|
||||
};
|
||||
const getValue = (coupon) => {
|
||||
const {
|
||||
value,
|
||||
denominations
|
||||
} = coupon;
|
||||
if (isDef(value)) {
|
||||
return value;
|
||||
}
|
||||
if (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 = defineComponent({
|
||||
name,
|
||||
props: couponCellProps,
|
||||
setup(props) {
|
||||
return () => {
|
||||
const selected = Array.isArray(props.chosenCoupon) ? props.chosenCoupon.length : props.coupons[+props.chosenCoupon];
|
||||
return _createVNode(Cell, {
|
||||
"class": bem(),
|
||||
"value": formatValue(props),
|
||||
"title": props.title || t("title"),
|
||||
"border": props.border,
|
||||
"isLink": props.editable,
|
||||
"valueClass": bem("value", {
|
||||
selected
|
||||
})
|
||||
}, null);
|
||||
};
|
||||
}
|
||||
});
|
||||
export {
|
||||
couponCellProps,
|
||||
stdin_default as default
|
||||
};
|
||||
1
node_modules/vant/es/coupon-cell/index.css
generated
vendored
Normal file
1
node_modules/vant/es/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/es/coupon-cell/index.d.ts
generated
vendored
Normal file
60
node_modules/vant/es/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;
|
||||
}
|
||||
}
|
||||
10
node_modules/vant/es/coupon-cell/index.mjs
generated
vendored
Normal file
10
node_modules/vant/es/coupon-cell/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { withInstall } from "../utils/index.mjs";
|
||||
import _CouponCell from "./CouponCell.mjs";
|
||||
const CouponCell = withInstall(_CouponCell);
|
||||
var stdin_default = CouponCell;
|
||||
import { couponCellProps } from "./CouponCell.mjs";
|
||||
export {
|
||||
CouponCell,
|
||||
couponCellProps,
|
||||
stdin_default as default
|
||||
};
|
||||
1
node_modules/vant/es/coupon-cell/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/es/coupon-cell/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
5
node_modules/vant/es/coupon-cell/style/index.mjs
generated
vendored
Normal file
5
node_modules/vant/es/coupon-cell/style/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import "../../style/base.css";
|
||||
import "../../badge/index.css";
|
||||
import "../../icon/index.css";
|
||||
import "../../cell/index.css";
|
||||
import "../index.css";
|
||||
3
node_modules/vant/es/coupon-cell/types.d.ts
generated
vendored
Normal file
3
node_modules/vant/es/coupon-cell/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export type CouponCellThemeVars = {
|
||||
couponCellSelectedTextColor?: string;
|
||||
};
|
||||
0
node_modules/vant/es/coupon-cell/types.mjs
generated
vendored
Normal file
0
node_modules/vant/es/coupon-cell/types.mjs
generated
vendored
Normal file
Reference in New Issue
Block a user