mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2026-07-15 02:21:05 +08:00
Compare commits
69 Commits
1a01c0eae8
...
5eb03eea65
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5eb03eea65 | ||
|
|
7b8ea74bd7 | ||
|
|
e5124d5bd4 | ||
|
|
f226d11b4f | ||
|
|
0d856b0074 | ||
|
|
ed36096494 | ||
|
|
afb240f737 | ||
|
|
6217fbec85 | ||
|
|
88e99b6ed2 | ||
|
|
33a32903e0 | ||
|
|
3b120e3c5b | ||
|
|
d4f4d75fd9 | ||
|
|
84b8b086a7 | ||
|
|
71962ce369 | ||
|
|
45ccdbb208 | ||
|
|
94d9926ce6 | ||
|
|
df7b7a782f | ||
|
|
565d71eedb | ||
|
|
5778acc088 | ||
|
|
390eab8d0d | ||
|
|
e90eae2a9f | ||
|
|
99aff7a1ea | ||
|
|
0df5fa9fca | ||
|
|
8560eab73c | ||
|
|
460607c2c4 | ||
|
|
459bd1652f | ||
|
|
cecccc714b | ||
|
|
338f90d5c5 | ||
|
|
4ada479baf | ||
|
|
7cc0379043 | ||
|
|
0bc139bfb0 | ||
|
|
fa3b17fdaa | ||
|
|
beaa24f81b | ||
|
|
40349869e5 | ||
|
|
1739317a5c | ||
|
|
1a9df5599d | ||
|
|
970967a63f | ||
|
|
88529e642f | ||
|
|
bd9ce42f8d | ||
|
|
46a4c7c4f2 | ||
|
|
7e8a0eb4a9 | ||
|
|
c9dbfc570a | ||
|
|
a3787220c2 | ||
|
|
eda2100dfa | ||
|
|
efbc3a9ce6 | ||
|
|
3abd671715 | ||
|
|
1eabea17a8 | ||
|
|
6e4ebfd886 | ||
|
|
ce8955560e | ||
|
|
606bf8aa25 | ||
|
|
689c5d82ed | ||
|
|
293f372da5 | ||
|
|
89d2cdbd2d | ||
|
|
0893406a63 | ||
|
|
24017c1c88 | ||
|
|
13df6519a4 | ||
|
|
dfe3d3e9f5 | ||
|
|
75eec05604 | ||
|
|
03ee861ca6 | ||
|
|
8248ff50d1 | ||
|
|
b6381a0b31 | ||
|
|
0ec0925001 | ||
|
|
fd85dcb64b | ||
|
|
f88aaf114c | ||
|
|
e14ca0b257 | ||
|
|
ff4299b124 | ||
|
|
2591498204 | ||
|
|
7819c25be0 | ||
|
|
3edbcdce53 |
@ -1,9 +1,11 @@
|
||||
const fs = require('fs');
|
||||
const gulp = require('gulp');
|
||||
const path = require('path');
|
||||
const less = require('gulp-less');
|
||||
const insert = require('gulp-insert');
|
||||
const rename = require('gulp-rename');
|
||||
const postcss = require('gulp-postcss');
|
||||
const ts = require('gulp-typescript');
|
||||
const util = require('util');
|
||||
const exec = util.promisify(require('child_process').exec);
|
||||
|
||||
@ -16,8 +18,10 @@ const exampleConfig = path.resolve(__dirname, '../tsconfig.example.json');
|
||||
|
||||
const libDir = path.resolve(__dirname, '../lib');
|
||||
const esDir = path.resolve(__dirname, '../dist');
|
||||
const exampleDir = path.resolve(__dirname, '../example/dist');
|
||||
const exampleDistDir = path.resolve(__dirname, '../example/dist');
|
||||
const examplePagesDir = path.resolve(__dirname, '../example/pages');
|
||||
|
||||
const exampleAppJsonPath = path.resolve(__dirname, '../example/app.json');
|
||||
const baseCssPath = path.resolve(__dirname, '../packages/common/index.wxss');
|
||||
|
||||
const lessCompiler = (dist) =>
|
||||
@ -49,9 +53,27 @@ const lessCompiler = (dist) =>
|
||||
};
|
||||
|
||||
const tsCompiler = (dist, config) =>
|
||||
async function compileTs() {
|
||||
await exec(`npx tsc -p ${config}`);
|
||||
await exec(`npx tscpaths -p ${config} -s ../packages -o ${dist}`);
|
||||
function compileTs() {
|
||||
const tsProject = ts.createProject(config);
|
||||
return tsProject
|
||||
.src()
|
||||
.pipe(tsProject())
|
||||
.js.pipe(
|
||||
insert.transform((contents, file) => {
|
||||
if (dist === exampleDistDir && file.path.includes('/demo/')) {
|
||||
const iconConfig = '@vant/icons/src/config';
|
||||
contents = contents.replace(
|
||||
iconConfig,
|
||||
path.relative(
|
||||
path.dirname(file.path),
|
||||
`${exampleDistDir}/${iconConfig}`
|
||||
)
|
||||
);
|
||||
}
|
||||
return contents;
|
||||
})
|
||||
)
|
||||
.pipe(gulp.dest(dist));
|
||||
};
|
||||
|
||||
const copier = (dist, ext) =>
|
||||
@ -101,18 +123,47 @@ const tasks = [
|
||||
}, {});
|
||||
|
||||
tasks.buildExample = gulp.series(
|
||||
cleaner(exampleDir),
|
||||
cleaner(exampleDistDir),
|
||||
gulp.parallel(
|
||||
tsCompiler(exampleDir, exampleConfig),
|
||||
lessCompiler(exampleDir),
|
||||
staticCopier(exampleDir),
|
||||
tsCompiler(exampleDistDir, exampleConfig),
|
||||
lessCompiler(exampleDistDir),
|
||||
staticCopier(exampleDistDir),
|
||||
() =>
|
||||
gulp.src(`${icons}/**/*`).pipe(gulp.dest(`${exampleDir}/@vant/icons`)),
|
||||
gulp
|
||||
.src(`${icons}/**/*`)
|
||||
.pipe(gulp.dest(`${exampleDistDir}/@vant/icons`)),
|
||||
() => {
|
||||
gulp.watch(`${src}/**/*.less`, lessCompiler(exampleDir));
|
||||
gulp.watch(`${src}/**/*.wxml`, copier(exampleDir, 'wxml'));
|
||||
gulp.watch(`${src}/**/*.wxs`, copier(exampleDir, 'wxs'));
|
||||
gulp.watch(`${src}/**/*.json`, copier(exampleDir, 'json'));
|
||||
const appJson = JSON.parse(fs.readFileSync(exampleAppJsonPath));
|
||||
appJson.pages.forEach((path) => {
|
||||
const component = path.replace(/(pages\/|\/index)/g, '');
|
||||
const writeFiles = [
|
||||
{
|
||||
path: `${examplePagesDir}/${component}/index.js`,
|
||||
contents: "import Page from '../../common/page';\n\nPage();",
|
||||
},
|
||||
{
|
||||
path: `${examplePagesDir}/${component}/index.wxml`,
|
||||
contents: `<van-${component}-demo />`,
|
||||
},
|
||||
];
|
||||
writeFiles.forEach((writeFile) => {
|
||||
fs.access(writeFile.path, fs.constants.F_OK, (fileNotExists) => {
|
||||
if (fileNotExists) {
|
||||
fs.writeFile(writeFile.path, writeFile.contents, (err) => {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
() => {
|
||||
gulp.watch(`${src}/**/*.less`, lessCompiler(exampleDistDir));
|
||||
gulp.watch(`${src}/**/*.wxml`, copier(exampleDistDir, 'wxml'));
|
||||
gulp.watch(`${src}/**/*.wxs`, copier(exampleDistDir, 'wxs'));
|
||||
gulp.watch(`${src}/**/*.json`, copier(exampleDistDir, 'json'));
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
1
dist/action-sheet/index.d.ts
vendored
1
dist/action-sheet/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/area/index.d.ts
vendored
1
dist/area/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/button/index.d.ts
vendored
1
dist/button/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/calendar/components/header/index.d.ts
vendored
1
dist/calendar/components/header/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
6
dist/calendar/components/month/index.d.ts
vendored
6
dist/calendar/components/month/index.d.ts
vendored
@ -1,6 +0,0 @@
|
||||
export interface Day {
|
||||
date: Date;
|
||||
type: string;
|
||||
text: number;
|
||||
bottomInfo?: string;
|
||||
}
|
||||
1
dist/calendar/index.d.ts
vendored
1
dist/calendar/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/calendar/index.wxs
vendored
1
dist/calendar/index.wxs
vendored
@ -6,6 +6,7 @@ function getMonths(minDate, maxDate) {
|
||||
var cursor = getDate(minDate);
|
||||
|
||||
cursor.setDate(1);
|
||||
cursor.setMinutes(cursor.getMinutes() - cursor.getTimezoneOffset());
|
||||
|
||||
do {
|
||||
months.push(cursor.getTime());
|
||||
|
||||
12
dist/calendar/utils.d.ts
vendored
12
dist/calendar/utils.d.ts
vendored
@ -1,12 +0,0 @@
|
||||
export declare const ROW_HEIGHT = 64;
|
||||
export declare function formatMonthTitle(date: Date): string;
|
||||
export declare function compareMonth(date1: Date | number, date2: Date | number): 1 | -1 | 0;
|
||||
export declare function compareDay(day1: Date | number, day2: Date | number): 1 | -1 | 0;
|
||||
export declare function getDayByOffset(date: Date, offset: number): Date;
|
||||
export declare function getPrevDay(date: Date): Date;
|
||||
export declare function getNextDay(date: Date): Date;
|
||||
export declare function getToday(): Date;
|
||||
export declare function calcDateNum(date: [Date, Date]): number;
|
||||
export declare function copyDates(dates: Date | Date[]): Date | Date[];
|
||||
export declare function getMonthEndDay(year: number, month: number): number;
|
||||
export declare function getMonths(minDate: number, maxDate: number): number[];
|
||||
1
dist/card/index.d.ts
vendored
1
dist/card/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/cell-group/index.d.ts
vendored
1
dist/cell-group/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/cell/index.d.ts
vendored
1
dist/cell/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/checkbox-group/index.d.ts
vendored
1
dist/checkbox-group/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/checkbox/index.d.ts
vendored
1
dist/checkbox/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
4
dist/circle/canvas.d.ts
vendored
4
dist/circle/canvas.d.ts
vendored
@ -1,4 +0,0 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
declare type CanvasContext = WechatMiniprogram.CanvasContext;
|
||||
export declare function adaptor(ctx: CanvasContext & Record<string, unknown>): CanvasContext;
|
||||
export {};
|
||||
1
dist/circle/index.d.ts
vendored
1
dist/circle/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/col/index.d.ts
vendored
1
dist/col/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
2
dist/collapse-item/animate.d.ts
vendored
2
dist/collapse-item/animate.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
export declare function setContentAnimate(context: WechatMiniprogram.Component.TrivialInstance, expanded: boolean, mounted: boolean): void;
|
||||
1
dist/collapse-item/index.d.ts
vendored
1
dist/collapse-item/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/collapse/index.d.ts
vendored
1
dist/collapse/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
7
dist/common/color.d.ts
vendored
7
dist/common/color.d.ts
vendored
@ -1,7 +0,0 @@
|
||||
export declare const RED = "#ee0a24";
|
||||
export declare const BLUE = "#1989fa";
|
||||
export declare const WHITE = "#fff";
|
||||
export declare const GREEN = "#07c160";
|
||||
export declare const ORANGE = "#ff976a";
|
||||
export declare const GRAY = "#323233";
|
||||
export declare const GRAY_DARK = "#969799";
|
||||
4
dist/common/component.d.ts
vendored
4
dist/common/component.d.ts
vendored
@ -1,4 +0,0 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
import { VantComponentOptions } from '../definitions/index';
|
||||
declare function VantComponent<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption>(vantOptions: VantComponentOptions<Data, Props, Methods>): void;
|
||||
export { VantComponent };
|
||||
15
dist/common/relation.d.ts
vendored
15
dist/common/relation.d.ts
vendored
@ -1,15 +0,0 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
declare type TrivialInstance = WechatMiniprogram.Component.TrivialInstance;
|
||||
export declare function useParent(name: string, onEffect?: (this: TrivialInstance) => void): {
|
||||
relations: {
|
||||
[x: string]: WechatMiniprogram.Component.RelationOption;
|
||||
};
|
||||
mixin: string;
|
||||
};
|
||||
export declare function useChildren(name: string, onEffect?: (this: TrivialInstance, target: TrivialInstance) => void): {
|
||||
relations: {
|
||||
[x: string]: WechatMiniprogram.Component.RelationOption;
|
||||
};
|
||||
mixin: string;
|
||||
};
|
||||
export {};
|
||||
13
dist/common/utils.d.ts
vendored
13
dist/common/utils.d.ts
vendored
@ -1,13 +0,0 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
export { isDef } from './validator';
|
||||
export declare function range(num: number, min: number, max: number): number;
|
||||
export declare function nextTick(cb: (...args: any[]) => void): void;
|
||||
export declare function getSystemInfoSync(): WechatMiniprogram.SystemInfo;
|
||||
export declare function addUnit(value?: string | number): string | undefined;
|
||||
export declare function requestAnimationFrame(cb: () => void): number | WechatMiniprogram.NodesRef;
|
||||
export declare function pickExclude(obj: unknown, keys: string[]): {};
|
||||
export declare function getRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult>;
|
||||
export declare function getAllRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult[]>;
|
||||
export declare function groupSetData(context: WechatMiniprogram.Component.TrivialInstance, cb: () => void): void;
|
||||
export declare function toPromise(promiseLike: Promise<unknown> | unknown): Promise<unknown>;
|
||||
export declare function getCurrentPage<T>(): T & WechatMiniprogram.OptionalInterface<WechatMiniprogram.Page.ILifetime> & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods<WechatMiniprogram.IAnyObject> & WechatMiniprogram.Page.Data<WechatMiniprogram.IAnyObject> & WechatMiniprogram.IAnyObject;
|
||||
9
dist/common/validator.d.ts
vendored
9
dist/common/validator.d.ts
vendored
@ -1,9 +0,0 @@
|
||||
export declare function isFunction(val: unknown): val is Function;
|
||||
export declare function isPlainObject(val: unknown): val is Record<string, unknown>;
|
||||
export declare function isPromise<T = unknown>(val: unknown): val is Promise<T>;
|
||||
export declare function isDef(value: unknown): boolean;
|
||||
export declare function isObj(x: unknown): x is Record<string, unknown>;
|
||||
export declare function isNumber(value: string): boolean;
|
||||
export declare function isBoolean(value: unknown): value is boolean;
|
||||
export declare function isImageUrl(url: string): boolean;
|
||||
export declare function isVideoUrl(url: string): boolean;
|
||||
7
dist/common/version.d.ts
vendored
7
dist/common/version.d.ts
vendored
@ -1,7 +0,0 @@
|
||||
export declare function canIUseModel(): boolean;
|
||||
export declare function canIUseFormFieldButton(): boolean;
|
||||
export declare function canIUseAnimate(): boolean;
|
||||
export declare function canIUseGroupSetData(): boolean;
|
||||
export declare function canIUseNextTick(): boolean;
|
||||
export declare function canIUseCanvas2d(): boolean;
|
||||
export declare function canIUseGetUserProfile(): boolean;
|
||||
1
dist/config-provider/index.d.ts
vendored
1
dist/config-provider/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/count-down/index.d.ts
vendored
1
dist/count-down/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
10
dist/count-down/utils.d.ts
vendored
10
dist/count-down/utils.d.ts
vendored
@ -1,10 +0,0 @@
|
||||
export declare type TimeData = {
|
||||
days: number;
|
||||
hours: number;
|
||||
minutes: number;
|
||||
seconds: number;
|
||||
milliseconds: number;
|
||||
};
|
||||
export declare function parseTimeData(time: number): TimeData;
|
||||
export declare function parseFormat(format: string, timeData: TimeData): string;
|
||||
export declare function isSameSecond(time1: number, time2: number): boolean;
|
||||
1
dist/datetime-picker/index.d.ts
vendored
1
dist/datetime-picker/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
27
dist/definitions/index.d.ts
vendored
27
dist/definitions/index.d.ts
vendored
@ -1,27 +0,0 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
interface VantComponentInstance {
|
||||
parent: WechatMiniprogram.Component.TrivialInstance;
|
||||
children: WechatMiniprogram.Component.TrivialInstance[];
|
||||
index: number;
|
||||
$emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void;
|
||||
}
|
||||
export declare type VantComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption> = {
|
||||
data?: Data;
|
||||
field?: boolean;
|
||||
classes?: string[];
|
||||
mixins?: string[];
|
||||
props?: Props;
|
||||
relation?: {
|
||||
relations: Record<string, WechatMiniprogram.Component.RelationOption>;
|
||||
mixin: string;
|
||||
};
|
||||
methods?: Methods;
|
||||
beforeCreate?: () => void;
|
||||
created?: () => void;
|
||||
mounted?: () => void;
|
||||
destroyed?: () => void;
|
||||
} & ThisType<VantComponentInstance & WechatMiniprogram.Component.Instance<Data & {
|
||||
name: string;
|
||||
value: any;
|
||||
} & Record<string, any>, Props, Methods> & Record<string, any>>;
|
||||
export {};
|
||||
50
dist/dialog/dialog.d.ts
vendored
50
dist/dialog/dialog.d.ts
vendored
@ -1,50 +0,0 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
export declare type Action = 'confirm' | 'cancel' | 'overlay';
|
||||
interface DialogOptions {
|
||||
lang?: string;
|
||||
show?: boolean;
|
||||
title?: string;
|
||||
width?: string | number | null;
|
||||
zIndex?: number;
|
||||
theme?: string;
|
||||
context?: WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
|
||||
message?: string;
|
||||
overlay?: boolean;
|
||||
selector?: string;
|
||||
ariaLabel?: string;
|
||||
className?: string;
|
||||
customStyle?: string;
|
||||
transition?: string;
|
||||
/**
|
||||
* @deprecated use beforeClose instead
|
||||
*/
|
||||
asyncClose?: boolean;
|
||||
beforeClose?: null | ((action: Action) => Promise<void> | void);
|
||||
businessId?: number;
|
||||
sessionFrom?: string;
|
||||
overlayStyle?: string;
|
||||
appParameter?: string;
|
||||
messageAlign?: string;
|
||||
sendMessageImg?: string;
|
||||
showMessageCard?: boolean;
|
||||
sendMessagePath?: string;
|
||||
sendMessageTitle?: string;
|
||||
confirmButtonText?: string;
|
||||
cancelButtonText?: string;
|
||||
showConfirmButton?: boolean;
|
||||
showCancelButton?: boolean;
|
||||
closeOnClickOverlay?: boolean;
|
||||
confirmButtonOpenType?: string;
|
||||
}
|
||||
declare const Dialog: {
|
||||
(options: DialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
|
||||
alert(options: DialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
|
||||
confirm(options: DialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
|
||||
close(): void;
|
||||
stopLoading(): void;
|
||||
currentOptions: DialogOptions;
|
||||
defaultOptions: DialogOptions;
|
||||
setDefaultOptions(options: DialogOptions): void;
|
||||
resetDefaultOptions(): void;
|
||||
};
|
||||
export default Dialog;
|
||||
1
dist/dialog/index.d.ts
vendored
1
dist/dialog/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/divider/index.d.ts
vendored
1
dist/divider/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/dropdown-item/index.d.ts
vendored
1
dist/dropdown-item/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
5
dist/dropdown-item/shared.d.ts
vendored
5
dist/dropdown-item/shared.d.ts
vendored
@ -1,5 +0,0 @@
|
||||
export interface Option {
|
||||
text: string;
|
||||
value: string | number;
|
||||
icon: string;
|
||||
}
|
||||
1
dist/dropdown-menu/index.d.ts
vendored
1
dist/dropdown-menu/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/empty/index.d.ts
vendored
1
dist/empty/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/empty/index.wxs
vendored
1
dist/empty/index.wxs
vendored
@ -12,3 +12,4 @@ function imageUrl(image) {
|
||||
module.exports = {
|
||||
imageUrl: imageUrl,
|
||||
};
|
||||
|
||||
|
||||
1
dist/field/index.d.ts
vendored
1
dist/field/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
4
dist/field/props.d.ts
vendored
4
dist/field/props.d.ts
vendored
@ -1,4 +0,0 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
export declare const commonProps: WechatMiniprogram.Component.PropertyOption;
|
||||
export declare const inputProps: WechatMiniprogram.Component.PropertyOption;
|
||||
export declare const textareaProps: WechatMiniprogram.Component.PropertyOption;
|
||||
1
dist/goods-action-button/index.d.ts
vendored
1
dist/goods-action-button/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/goods-action-icon/index.d.ts
vendored
1
dist/goods-action-icon/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/goods-action/index.d.ts
vendored
1
dist/goods-action/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/grid-item/index.d.ts
vendored
1
dist/grid-item/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/grid/index.d.ts
vendored
1
dist/grid/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/icon/index.d.ts
vendored
1
dist/icon/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/image/index.d.ts
vendored
1
dist/image/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/index-anchor/index.d.ts
vendored
1
dist/index-anchor/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/index-bar/index.d.ts
vendored
1
dist/index-bar/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/info/index.d.ts
vendored
1
dist/info/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/loading/index.d.ts
vendored
1
dist/loading/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/mixins/basic.d.ts
vendored
1
dist/mixins/basic.d.ts
vendored
@ -1 +0,0 @@
|
||||
export declare const basic: string;
|
||||
1
dist/mixins/button.d.ts
vendored
1
dist/mixins/button.d.ts
vendored
@ -1 +0,0 @@
|
||||
export declare const button: string;
|
||||
1
dist/mixins/link.d.ts
vendored
1
dist/mixins/link.d.ts
vendored
@ -1 +0,0 @@
|
||||
export declare const link: string;
|
||||
5
dist/mixins/page-scroll.d.ts
vendored
5
dist/mixins/page-scroll.d.ts
vendored
@ -1,5 +0,0 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
declare type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption;
|
||||
declare type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void;
|
||||
export declare const pageScrollMixin: (scroller: Scroller) => string;
|
||||
export {};
|
||||
3
dist/mixins/page-scroll.js
vendored
3
dist/mixins/page-scroll.js
vendored
@ -11,6 +11,9 @@ function onPageScroll(event) {
|
||||
export const pageScrollMixin = (scroller) => Behavior({
|
||||
attached() {
|
||||
const page = getCurrentPage();
|
||||
if (!isDef(page)) {
|
||||
return;
|
||||
}
|
||||
if (Array.isArray(page.vanPageScroller)) {
|
||||
page.vanPageScroller.push(scroller.bind(this));
|
||||
}
|
||||
|
||||
1
dist/mixins/touch.d.ts
vendored
1
dist/mixins/touch.d.ts
vendored
@ -1 +0,0 @@
|
||||
export declare const touch: string;
|
||||
1
dist/mixins/transition.d.ts
vendored
1
dist/mixins/transition.d.ts
vendored
@ -1 +0,0 @@
|
||||
export declare function transition(showDefaultValue: boolean): string;
|
||||
1
dist/nav-bar/index.d.ts
vendored
1
dist/nav-bar/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/notice-bar/index.d.ts
vendored
1
dist/notice-bar/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/notify/index.d.ts
vendored
1
dist/notify/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
20
dist/notify/notify.d.ts
vendored
20
dist/notify/notify.d.ts
vendored
@ -1,20 +0,0 @@
|
||||
interface NotifyOptions {
|
||||
type?: 'primary' | 'success' | 'danger' | 'warning';
|
||||
color?: string;
|
||||
zIndex?: number;
|
||||
top?: number;
|
||||
message: string;
|
||||
context?: any;
|
||||
duration?: number;
|
||||
selector?: string;
|
||||
background?: string;
|
||||
safeAreaInsetTop?: boolean;
|
||||
onClick?: () => void;
|
||||
onOpened?: () => void;
|
||||
onClose?: () => void;
|
||||
}
|
||||
declare function Notify(options: NotifyOptions | string): any;
|
||||
declare namespace Notify {
|
||||
var clear: (options?: NotifyOptions | undefined) => void;
|
||||
}
|
||||
export default Notify;
|
||||
1
dist/overlay/index.d.ts
vendored
1
dist/overlay/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/panel/index.d.ts
vendored
1
dist/panel/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/picker-column/index.d.ts
vendored
1
dist/picker-column/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/picker/index.d.ts
vendored
1
dist/picker/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
21
dist/picker/shared.d.ts
vendored
21
dist/picker/shared.d.ts
vendored
@ -1,21 +0,0 @@
|
||||
export declare const pickerProps: {
|
||||
title: StringConstructor;
|
||||
loading: BooleanConstructor;
|
||||
showToolbar: BooleanConstructor;
|
||||
cancelButtonText: {
|
||||
type: StringConstructor;
|
||||
value: string;
|
||||
};
|
||||
confirmButtonText: {
|
||||
type: StringConstructor;
|
||||
value: string;
|
||||
};
|
||||
visibleItemCount: {
|
||||
type: NumberConstructor;
|
||||
value: number;
|
||||
};
|
||||
itemHeight: {
|
||||
type: NumberConstructor;
|
||||
value: number;
|
||||
};
|
||||
};
|
||||
1
dist/popup/index.d.ts
vendored
1
dist/popup/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/progress/index.d.ts
vendored
1
dist/progress/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/radio-group/index.d.ts
vendored
1
dist/radio-group/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/radio/index.d.ts
vendored
1
dist/radio/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/rate/index.d.ts
vendored
1
dist/rate/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/row/index.d.ts
vendored
1
dist/row/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/search/index.d.ts
vendored
1
dist/search/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/share-sheet/index.d.ts
vendored
1
dist/share-sheet/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/share-sheet/options.d.ts
vendored
1
dist/share-sheet/options.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/sidebar-item/index.d.ts
vendored
1
dist/sidebar-item/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/sidebar/index.d.ts
vendored
1
dist/sidebar/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/skeleton/index.d.ts
vendored
1
dist/skeleton/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/slider/index.d.ts
vendored
1
dist/slider/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/stepper/index.d.ts
vendored
1
dist/stepper/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/stepper/index.js
vendored
1
dist/stepper/index.js
vendored
@ -61,6 +61,7 @@ VantComponent({
|
||||
value: true,
|
||||
},
|
||||
theme: String,
|
||||
alwaysEmbed: Boolean,
|
||||
},
|
||||
data: {
|
||||
currentValue: '',
|
||||
|
||||
2
dist/stepper/index.wxml
vendored
2
dist/stepper/index.wxml
vendored
@ -16,12 +16,14 @@
|
||||
<slot name="minus" />
|
||||
</view>
|
||||
<input
|
||||
always-embed="{{ false }}"
|
||||
type="{{ integer ? 'number' : 'digit' }}"
|
||||
class="input-class {{ utils.bem('stepper__input', { disabled: disabled || disableInput }) }}"
|
||||
style="{{ computed.inputStyle({ buttonSize, inputWidth }) }}"
|
||||
value="{{ currentValue }}"
|
||||
focus="{{ focus }}"
|
||||
disabled="{{ disabled || disableInput }}"
|
||||
always-embed="{{ alwaysEmbed }}"
|
||||
bindinput="onInput"
|
||||
bind:focus="onFocus"
|
||||
bind:blur="onBlur"
|
||||
|
||||
1
dist/steps/index.d.ts
vendored
1
dist/steps/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/sticky/index.d.ts
vendored
1
dist/sticky/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/submit-bar/index.d.ts
vendored
1
dist/submit-bar/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/swipe-cell/index.d.ts
vendored
1
dist/swipe-cell/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/switch/index.d.ts
vendored
1
dist/switch/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
4
dist/switch/index.wxml
vendored
4
dist/switch/index.wxml
vendored
@ -3,13 +3,13 @@
|
||||
|
||||
<view
|
||||
class="{{ utils.bem('switch', { on: checked === activeValue, disabled }) }} custom-class"
|
||||
style="{{ computed.rootStyle({ size, checked, activeColor, inactiveColor }) }}"
|
||||
style="{{ computed.rootStyle({ size, checked, activeColor, inactiveColor, activeValue }) }}"
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<view class="van-switch__node node-class">
|
||||
<van-loading
|
||||
wx:if="{{ loading }}"
|
||||
color="{{ computed.loadingColor({ checked, activeColor, inactiveColor }) }}"
|
||||
color="{{ computed.loadingColor({ checked, activeColor, inactiveColor, activeValue }) }}"
|
||||
custom-class="van-switch__loading"
|
||||
/>
|
||||
</view>
|
||||
|
||||
4
dist/switch/index.wxs
vendored
4
dist/switch/index.wxs
vendored
@ -3,7 +3,7 @@ var style = require('../wxs/style.wxs');
|
||||
var addUnit = require('../wxs/add-unit.wxs');
|
||||
|
||||
function rootStyle(data) {
|
||||
var currentColor = data.checked ? data.activeColor : data.inactiveColor;
|
||||
var currentColor = data.checked === data.activeValue ? data.activeColor : data.inactiveColor;
|
||||
|
||||
return style({
|
||||
'font-size': addUnit(data.size),
|
||||
@ -15,7 +15,7 @@ var BLUE = '#1989fa';
|
||||
var GRAY_DARK = '#969799';
|
||||
|
||||
function loadingColor(data) {
|
||||
return data.checked
|
||||
return data.checked === data.activeValue
|
||||
? data.activeColor || BLUE
|
||||
: data.inactiveColor || GRAY_DARK;
|
||||
}
|
||||
|
||||
1
dist/tab/index.d.ts
vendored
1
dist/tab/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/tabbar-item/index.d.ts
vendored
1
dist/tabbar-item/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/tabbar/index.d.ts
vendored
1
dist/tabbar/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/tabs/index.d.ts
vendored
1
dist/tabs/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/tag/index.d.ts
vendored
1
dist/tag/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
1
dist/toast/index.d.ts
vendored
1
dist/toast/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
2
dist/toast/index.wxml
vendored
2
dist/toast/index.wxml
vendored
@ -10,7 +10,7 @@
|
||||
custom-class="van-toast__container"
|
||||
>
|
||||
<view
|
||||
class="van-toast van-toast--{{ type === 'icon' ? 'icon' : 'text' }} van-toast--{{ position }}"
|
||||
class="van-toast van-toast--{{ (type === 'text' || type === 'html') ? 'text' : 'icon' }} van-toast--{{ position }}"
|
||||
catch:touchmove="noop"
|
||||
>
|
||||
<!-- text only -->
|
||||
|
||||
26
dist/toast/toast.d.ts
vendored
26
dist/toast/toast.d.ts
vendored
@ -1,26 +0,0 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
declare type ToastMessage = string | number;
|
||||
interface ToastOptions {
|
||||
show?: boolean;
|
||||
type?: string;
|
||||
mask?: boolean;
|
||||
zIndex?: number;
|
||||
context?: WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance;
|
||||
position?: string;
|
||||
duration?: number;
|
||||
selector?: string;
|
||||
forbidClick?: boolean;
|
||||
loadingType?: string;
|
||||
message?: ToastMessage;
|
||||
onClose?: () => void;
|
||||
}
|
||||
declare function Toast(toastOptions: ToastOptions | ToastMessage): WechatMiniprogram.Component.TrivialInstance | undefined;
|
||||
declare namespace Toast {
|
||||
var loading: (options: ToastMessage | ToastOptions) => WechatMiniprogram.Component.TrivialInstance | undefined;
|
||||
var success: (options: ToastMessage | ToastOptions) => WechatMiniprogram.Component.TrivialInstance | undefined;
|
||||
var fail: (options: ToastMessage | ToastOptions) => WechatMiniprogram.Component.TrivialInstance | undefined;
|
||||
var clear: () => void;
|
||||
var setDefaultOptions: (options: ToastOptions) => void;
|
||||
var resetDefaultOptions: () => void;
|
||||
}
|
||||
export default Toast;
|
||||
1
dist/transition/index.d.ts
vendored
1
dist/transition/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user