first commit
This commit is contained in:
61
node_modules/vant/es/progress/Progress.d.ts
generated
vendored
Normal file
61
node_modules/vant/es/progress/Progress.d.ts
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
import { type ExtractPropTypes } from 'vue';
|
||||
import { type Numeric } from '../utils';
|
||||
export declare const progressProps: {
|
||||
color: StringConstructor;
|
||||
inactive: BooleanConstructor;
|
||||
pivotText: StringConstructor;
|
||||
textColor: StringConstructor;
|
||||
showPivot: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
pivotColor: StringConstructor;
|
||||
trackColor: StringConstructor;
|
||||
strokeWidth: (NumberConstructor | StringConstructor)[];
|
||||
percentage: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
validator: (value: Numeric) => boolean;
|
||||
};
|
||||
};
|
||||
export type ProgressProps = ExtractPropTypes<typeof progressProps>;
|
||||
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
||||
color: StringConstructor;
|
||||
inactive: BooleanConstructor;
|
||||
pivotText: StringConstructor;
|
||||
textColor: StringConstructor;
|
||||
showPivot: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
pivotColor: StringConstructor;
|
||||
trackColor: StringConstructor;
|
||||
strokeWidth: (NumberConstructor | StringConstructor)[];
|
||||
percentage: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
validator: (value: Numeric) => boolean;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
||||
color: StringConstructor;
|
||||
inactive: BooleanConstructor;
|
||||
pivotText: StringConstructor;
|
||||
textColor: StringConstructor;
|
||||
showPivot: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
pivotColor: StringConstructor;
|
||||
trackColor: StringConstructor;
|
||||
strokeWidth: (NumberConstructor | StringConstructor)[];
|
||||
percentage: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
validator: (value: Numeric) => boolean;
|
||||
};
|
||||
}>> & Readonly<{}>, {
|
||||
inactive: boolean;
|
||||
showPivot: boolean;
|
||||
percentage: string | number;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
79
node_modules/vant/es/progress/Progress.mjs
generated
vendored
Normal file
79
node_modules/vant/es/progress/Progress.mjs
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
import { computed, defineComponent, createVNode as _createVNode } from "vue";
|
||||
import { addUnit, truthProp, numericProp, createNamespace } from "../utils/index.mjs";
|
||||
const [name, bem] = createNamespace("progress");
|
||||
const progressProps = {
|
||||
color: String,
|
||||
inactive: Boolean,
|
||||
pivotText: String,
|
||||
textColor: String,
|
||||
showPivot: truthProp,
|
||||
pivotColor: String,
|
||||
trackColor: String,
|
||||
strokeWidth: numericProp,
|
||||
percentage: {
|
||||
type: numericProp,
|
||||
default: 0,
|
||||
validator: (value) => +value >= 0 && +value <= 100
|
||||
}
|
||||
};
|
||||
var stdin_default = defineComponent({
|
||||
name,
|
||||
props: progressProps,
|
||||
setup(props) {
|
||||
const background = computed(() => props.inactive ? void 0 : props.color);
|
||||
const format = (rate) => Math.min(Math.max(+rate, 0), 100);
|
||||
const renderPivot = () => {
|
||||
const {
|
||||
textColor,
|
||||
pivotText,
|
||||
pivotColor,
|
||||
percentage
|
||||
} = props;
|
||||
const safePercentage = format(percentage);
|
||||
const text = pivotText != null ? pivotText : `${percentage}%`;
|
||||
if (props.showPivot && text) {
|
||||
const style = {
|
||||
color: textColor,
|
||||
left: `${safePercentage}%`,
|
||||
transform: `translate(-${safePercentage}%,-50%)`,
|
||||
background: pivotColor || background.value
|
||||
};
|
||||
return _createVNode("span", {
|
||||
"style": style,
|
||||
"class": bem("pivot", {
|
||||
inactive: props.inactive
|
||||
})
|
||||
}, [text]);
|
||||
}
|
||||
};
|
||||
return () => {
|
||||
const {
|
||||
trackColor,
|
||||
percentage,
|
||||
strokeWidth
|
||||
} = props;
|
||||
const safePercentage = format(percentage);
|
||||
const rootStyle = {
|
||||
background: trackColor,
|
||||
height: addUnit(strokeWidth)
|
||||
};
|
||||
const portionStyle = {
|
||||
width: `${safePercentage}%`,
|
||||
background: background.value
|
||||
};
|
||||
return _createVNode("div", {
|
||||
"class": bem(),
|
||||
"style": rootStyle
|
||||
}, [_createVNode("span", {
|
||||
"class": bem("portion", {
|
||||
inactive: props.inactive
|
||||
}),
|
||||
"style": portionStyle
|
||||
}, null), renderPivot()]);
|
||||
};
|
||||
}
|
||||
});
|
||||
export {
|
||||
stdin_default as default,
|
||||
progressProps
|
||||
};
|
||||
1
node_modules/vant/es/progress/index.css
generated
vendored
Normal file
1
node_modules/vant/es/progress/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
:root,:host{--van-progress-height: 4px;--van-progress-color: var(--van-primary-color);--van-progress-inactive-color: var(--van-gray-5);--van-progress-background: var(--van-gray-3);--van-progress-pivot-padding: 0 5px;--van-progress-pivot-text-color: var(--van-white);--van-progress-pivot-font-size: var(--van-font-size-xs);--van-progress-pivot-line-height: 1.6;--van-progress-pivot-background: var(--van-primary-color)}.van-progress{position:relative;height:var(--van-progress-height);background:var(--van-progress-background);border-radius:var(--van-progress-height)}.van-progress__portion{position:absolute;left:0;width:100%;height:100%;background:var(--van-progress-color);border-radius:inherit;transform-origin:0;transition:all var(--van-duration-base) var(--van-ease-out)}.van-progress__portion--inactive{background:var(--van-progress-inactive-color)}.van-progress__pivot{position:absolute;top:50%;box-sizing:border-box;min-width:3.6em;padding:var(--van-progress-pivot-padding);color:var(--van-progress-pivot-text-color);font-size:var(--van-progress-pivot-font-size);line-height:var(--van-progress-pivot-line-height);text-align:center;word-break:keep-all;background:var(--van-progress-pivot-background);border-radius:1em;transition:all var(--van-duration-base) var(--van-ease-out)}.van-progress__pivot--inactive{background:var(--van-progress-inactive-color)}
|
||||
49
node_modules/vant/es/progress/index.d.ts
generated
vendored
Normal file
49
node_modules/vant/es/progress/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
import { ProgressProps } from './Progress';
|
||||
export declare const Progress: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
color: StringConstructor;
|
||||
inactive: BooleanConstructor;
|
||||
pivotText: StringConstructor;
|
||||
textColor: StringConstructor;
|
||||
showPivot: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
pivotColor: StringConstructor;
|
||||
trackColor: StringConstructor;
|
||||
strokeWidth: (NumberConstructor | StringConstructor)[];
|
||||
percentage: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
validator: (value: import("../utils").Numeric) => boolean;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
color: StringConstructor;
|
||||
inactive: BooleanConstructor;
|
||||
pivotText: StringConstructor;
|
||||
textColor: StringConstructor;
|
||||
showPivot: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
pivotColor: StringConstructor;
|
||||
trackColor: StringConstructor;
|
||||
strokeWidth: (NumberConstructor | StringConstructor)[];
|
||||
percentage: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
validator: (value: import("../utils").Numeric) => boolean;
|
||||
};
|
||||
}>> & Readonly<{}>, {
|
||||
inactive: boolean;
|
||||
showPivot: boolean;
|
||||
percentage: string | number;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
export default Progress;
|
||||
export { progressProps } from './Progress';
|
||||
export type { ProgressProps };
|
||||
export type { ProgressInstance, ProgressThemeVars } from './types';
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {
|
||||
VanProgress: typeof Progress;
|
||||
}
|
||||
}
|
||||
10
node_modules/vant/es/progress/index.mjs
generated
vendored
Normal file
10
node_modules/vant/es/progress/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { withInstall } from "../utils/index.mjs";
|
||||
import _Progress from "./Progress.mjs";
|
||||
const Progress = withInstall(_Progress);
|
||||
var stdin_default = Progress;
|
||||
import { progressProps } from "./Progress.mjs";
|
||||
export {
|
||||
Progress,
|
||||
stdin_default as default,
|
||||
progressProps
|
||||
};
|
||||
1
node_modules/vant/es/progress/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/es/progress/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
2
node_modules/vant/es/progress/style/index.mjs
generated
vendored
Normal file
2
node_modules/vant/es/progress/style/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import "../../style/base.css";
|
||||
import "../index.css";
|
||||
14
node_modules/vant/es/progress/types.d.ts
generated
vendored
Normal file
14
node_modules/vant/es/progress/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { ComponentPublicInstance } from 'vue';
|
||||
import type { ProgressProps } from './Progress';
|
||||
export type ProgressInstance = ComponentPublicInstance<ProgressProps>;
|
||||
export type ProgressThemeVars = {
|
||||
progressHeight?: string;
|
||||
progressColor?: string;
|
||||
progressInactiveColor?: string;
|
||||
progressBackground?: string;
|
||||
progressPivotPadding?: string;
|
||||
progressPivotTextColor?: string;
|
||||
progressPivotFontSize?: string;
|
||||
progressPivotLineHeight?: number | string;
|
||||
progressPivotBackground?: string;
|
||||
};
|
||||
0
node_modules/vant/es/progress/types.mjs
generated
vendored
Normal file
0
node_modules/vant/es/progress/types.mjs
generated
vendored
Normal file
Reference in New Issue
Block a user