first commit
This commit is contained in:
55
node_modules/vant/lib/count-down/CountDown.d.ts
generated
vendored
Normal file
55
node_modules/vant/lib/count-down/CountDown.d.ts
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
import { type ExtractPropTypes } from 'vue';
|
||||
export declare const countDownProps: {
|
||||
time: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
format: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
autoStart: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
millisecond: BooleanConstructor;
|
||||
};
|
||||
export type CountDownProps = ExtractPropTypes<typeof countDownProps>;
|
||||
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
||||
time: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
format: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
autoStart: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
millisecond: BooleanConstructor;
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "finish")[], "change" | "finish", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
||||
time: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
format: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
autoStart: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
millisecond: BooleanConstructor;
|
||||
}>> & Readonly<{
|
||||
onChange?: ((...args: any[]) => any) | undefined;
|
||||
onFinish?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
time: string | number;
|
||||
format: string;
|
||||
autoStart: boolean;
|
||||
millisecond: boolean;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
75
node_modules/vant/lib/count-down/CountDown.js
generated
vendored
Normal file
75
node_modules/vant/lib/count-down/CountDown.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
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, {
|
||||
countDownProps: () => countDownProps,
|
||||
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 = require("@vant/use");
|
||||
var import_use_expose = require("../composables/use-expose");
|
||||
const [name, bem] = (0, import_utils.createNamespace)("count-down");
|
||||
const countDownProps = {
|
||||
time: (0, import_utils.makeNumericProp)(0),
|
||||
format: (0, import_utils.makeStringProp)("HH:mm:ss"),
|
||||
autoStart: import_utils.truthProp,
|
||||
millisecond: Boolean
|
||||
};
|
||||
var stdin_default = (0, import_vue.defineComponent)({
|
||||
name,
|
||||
props: countDownProps,
|
||||
emits: ["change", "finish"],
|
||||
setup(props, {
|
||||
emit,
|
||||
slots
|
||||
}) {
|
||||
const {
|
||||
start,
|
||||
pause,
|
||||
reset,
|
||||
current
|
||||
} = (0, import_use.useCountDown)({
|
||||
time: +props.time,
|
||||
millisecond: props.millisecond,
|
||||
onChange: (current2) => emit("change", current2),
|
||||
onFinish: () => emit("finish")
|
||||
});
|
||||
const timeText = (0, import_vue.computed)(() => (0, import_utils2.parseFormat)(props.format, current.value));
|
||||
const resetTime = () => {
|
||||
reset(+props.time);
|
||||
if (props.autoStart) {
|
||||
start();
|
||||
}
|
||||
};
|
||||
(0, import_vue.watch)(() => props.time, resetTime, {
|
||||
immediate: true
|
||||
});
|
||||
(0, import_use_expose.useExpose)({
|
||||
start,
|
||||
pause,
|
||||
reset: resetTime
|
||||
});
|
||||
return () => (0, import_vue.createVNode)("div", {
|
||||
"role": "timer",
|
||||
"class": bem()
|
||||
}, [slots.default ? slots.default(current.value) : timeText.value]);
|
||||
}
|
||||
});
|
||||
1
node_modules/vant/lib/count-down/index.css
generated
vendored
Normal file
1
node_modules/vant/lib/count-down/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
:root,:host{--van-count-down-text-color: var(--van-text-color);--van-count-down-font-size: var(--van-font-size-md);--van-count-down-line-height: var(--van-line-height-md)}.van-count-down{color:var(--van-count-down-text-color);font-size:var(--van-count-down-font-size);line-height:var(--van-count-down-line-height)}
|
||||
46
node_modules/vant/lib/count-down/index.d.ts
generated
vendored
Normal file
46
node_modules/vant/lib/count-down/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
export declare const CountDown: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
time: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
format: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
autoStart: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
millisecond: BooleanConstructor;
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "finish")[], "change" | "finish", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
time: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
format: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
autoStart: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
millisecond: BooleanConstructor;
|
||||
}>> & Readonly<{
|
||||
onChange?: ((...args: any[]) => any) | undefined;
|
||||
onFinish?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
time: string | number;
|
||||
format: string;
|
||||
autoStart: boolean;
|
||||
millisecond: boolean;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
export default CountDown;
|
||||
export { countDownProps } from './CountDown';
|
||||
export type { CountDownProps } from './CountDown';
|
||||
export type { CountDownInstance, CountDownThemeVars, CountDownCurrentTime, } from './types';
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {
|
||||
VanCountDown: typeof CountDown;
|
||||
}
|
||||
}
|
||||
39
node_modules/vant/lib/count-down/index.js
generated
vendored
Normal file
39
node_modules/vant/lib/count-down/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, {
|
||||
CountDown: () => CountDown,
|
||||
countDownProps: () => import_CountDown2.countDownProps,
|
||||
default: () => stdin_default
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_utils = require("../utils");
|
||||
var import_CountDown = __toESM(require("./CountDown"));
|
||||
var import_CountDown2 = require("./CountDown");
|
||||
const CountDown = (0, import_utils.withInstall)(import_CountDown.default);
|
||||
var stdin_default = CountDown;
|
||||
1
node_modules/vant/lib/count-down/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/lib/count-down/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
2
node_modules/vant/lib/count-down/style/index.js
generated
vendored
Normal file
2
node_modules/vant/lib/count-down/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
require("../../style/base.css");
|
||||
require("../index.css");
|
||||
16
node_modules/vant/lib/count-down/types.d.ts
generated
vendored
Normal file
16
node_modules/vant/lib/count-down/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { ComponentPublicInstance } from 'vue';
|
||||
import type { CurrentTime } from '@vant/use';
|
||||
import type { CountDownProps } from './CountDown';
|
||||
type CountDownExpose = {
|
||||
start: () => void;
|
||||
pause: () => void;
|
||||
reset: () => void;
|
||||
};
|
||||
export type CountDownInstance = ComponentPublicInstance<CountDownProps, CountDownExpose>;
|
||||
export type CountDownCurrentTime = CurrentTime;
|
||||
export type CountDownThemeVars = {
|
||||
countDownTextColor?: string;
|
||||
countDownFontSize?: string;
|
||||
countDownLineHeight?: number | string;
|
||||
};
|
||||
export {};
|
||||
15
node_modules/vant/lib/count-down/types.js
generated
vendored
Normal file
15
node_modules/vant/lib/count-down/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);
|
||||
2
node_modules/vant/lib/count-down/utils.d.ts
generated
vendored
Normal file
2
node_modules/vant/lib/count-down/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { CurrentTime } from '@vant/use';
|
||||
export declare function parseFormat(format: string, currentTime: CurrentTime): string;
|
||||
58
node_modules/vant/lib/count-down/utils.js
generated
vendored
Normal file
58
node_modules/vant/lib/count-down/utils.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
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, {
|
||||
parseFormat: () => parseFormat
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_utils = require("../utils");
|
||||
function parseFormat(format, currentTime) {
|
||||
const { days } = currentTime;
|
||||
let { hours, minutes, seconds, milliseconds } = currentTime;
|
||||
if (format.includes("DD")) {
|
||||
format = format.replace("DD", (0, import_utils.padZero)(days));
|
||||
} else {
|
||||
hours += days * 24;
|
||||
}
|
||||
if (format.includes("HH")) {
|
||||
format = format.replace("HH", (0, import_utils.padZero)(hours));
|
||||
} else {
|
||||
minutes += hours * 60;
|
||||
}
|
||||
if (format.includes("mm")) {
|
||||
format = format.replace("mm", (0, import_utils.padZero)(minutes));
|
||||
} else {
|
||||
seconds += minutes * 60;
|
||||
}
|
||||
if (format.includes("ss")) {
|
||||
format = format.replace("ss", (0, import_utils.padZero)(seconds));
|
||||
} else {
|
||||
milliseconds += seconds * 1e3;
|
||||
}
|
||||
if (format.includes("S")) {
|
||||
const ms = (0, import_utils.padZero)(milliseconds, 3);
|
||||
if (format.includes("SSS")) {
|
||||
format = format.replace("SSS", ms);
|
||||
} else if (format.includes("SS")) {
|
||||
format = format.replace("SS", ms.slice(0, 2));
|
||||
} else {
|
||||
format = format.replace("S", ms.charAt(0));
|
||||
}
|
||||
}
|
||||
return format;
|
||||
}
|
||||
Reference in New Issue
Block a user