Compare commits

...

69 Commits

Author SHA1 Message Date
nemo-shen
5eb03eea65 docs(changelog): 1.10.0 2021-12-21 10:14:54 +08:00
nemo-shen
7b8ea74bd7 release: 1.10.0 2021-12-21 09:57:29 +08:00
nemo-shen
e5124d5bd4 build: compile 1.10.0 2021-12-21 09:57:24 +08:00
nemo-shen
f226d11b4f fix(build): fix CR 2021-12-21 09:51:43 +08:00
nemo-shen
0d856b0074 build(ci): restore test.yml 2021-12-21 09:51:43 +08:00
nemo-shen
ed36096494 fix(Stepper): use alwaysEmbed 2021-12-21 09:51:43 +08:00
nemo-shen
afb240f737 node 14.16.1 2021-12-21 09:51:43 +08:00
nemo-shen
6217fbec85 debug 2021-12-21 09:51:43 +08:00
nemo-shen
88e99b6ed2 build(ci): debug 2021-12-21 09:51:43 +08:00
nemo-shen
33a32903e0 fix(Calendar): fix timezone 2021-12-21 09:51:43 +08:00
nemo-shen
3b120e3c5b fix(Calendar): fix timezone 2021-12-21 09:51:43 +08:00
nemo-shen
d4f4d75fd9 fix(Calendar): valueOf 2021-12-21 09:51:43 +08:00
nemo-shen
84b8b086a7 fix(Calendar): fix time 2021-12-21 09:51:43 +08:00
nemo-shen
71962ce369 fix(jest): adjust config 2021-12-21 09:51:43 +08:00
nemo-shen
45ccdbb208 fix(compiler): replace icon path when compile 2021-12-21 09:51:43 +08:00
nemo-shen
94d9926ce6 style(example): format 2021-12-21 09:51:43 +08:00
nemo-shen
df7b7a782f fix(demo): update demo snapshot 2021-12-21 09:51:43 +08:00
nemo-shen
565d71eedb test(compiler): auto create example index.wxml 2021-12-21 09:51:43 +08:00
nemo-shen
5778acc088 test(Uploader): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
390eab8d0d test(Transition): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
e90eae2a9f test(SwipeCell): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
99aff7a1ea test(DropdownMenu): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
0df5fa9fca test(CountDown): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
8560eab73c test(DatetimePicker): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
460607c2c4 test(Picker): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
459bd1652f test(Collapse): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
cecccc714b test(Sidebar): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
338f90d5c5 test(Slider): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
4ada479baf test(Field): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
7cc0379043 test(IndexBar): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
0bc139bfb0 test(NavBar): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
fa3b17fdaa test(NoticeBar): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
beaa24f81b test(Notify): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
40349869e5 test(Overlay): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
1739317a5c test(TreeSelect): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
1a9df5599d test(ShareSheet): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
970967a63f test(Progress): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
88529e642f test(Popup): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
bd9ce42f8d test(Panel): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
46a4c7c4f2 test(GoodsAction): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
7e8a0eb4a9 test(Calendar): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
c9dbfc570a test(Toast): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
a3787220c2 test(Tag): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
eda2100dfa test(Tabbar): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
efbc3a9ce6 test(SubmitBar): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
3abd671715 test(Sticky): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
1eabea17a8 test(Steps): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
6e4ebfd886 test(Tab): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
ce8955560e test(Stepper): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
606bf8aa25 test(Skeleton): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
689c5d82ed test(Search): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
293f372da5 test(Rate): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
89d2cdbd2d test(Radio): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
0893406a63 test(Loading): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
24017c1c88 test(Image): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
13df6519a4 test(Icon): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
dfe3d3e9f5 test(Empty): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
75eec05604 test(Divider): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
03ee861ca6 test(Dialog): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
8248ff50d1 test(ConfigProvider): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
b6381a0b31 test(Col): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
0ec0925001 test(Circle): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
fd85dcb64b test(CheckBox): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
f88aaf114c test(Cell): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
e14ca0b257 test(Card): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
ff4299b124 test(Grid): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
2591498204 test(Area): add test demo 2021-12-21 09:51:43 +08:00
nemo-shen
7819c25be0 test(ActionSheet): add demo test 2021-12-21 09:51:43 +08:00
nemo-shen
3edbcdce53 test(Switch): add demo test 2021-12-21 09:51:43 +08:00
536 changed files with 33281 additions and 5128 deletions

View File

@ -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'));
}
)
);

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1,6 +0,0 @@
export interface Day {
date: Date;
type: string;
text: number;
bottomInfo?: string;
}

View File

@ -1 +0,0 @@
export {};

View File

@ -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());

View File

@ -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[];

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -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 {};

View File

@ -1 +0,0 @@
export {};

1
dist/col/index.d.ts vendored
View File

@ -1 +0,0 @@
export {};

View File

@ -1,2 +0,0 @@
/// <reference types="miniprogram-api-typings" />
export declare function setContentAnimate(context: WechatMiniprogram.Component.TrivialInstance, expanded: boolean, mounted: boolean): void;

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -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";

View File

@ -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 };

View File

@ -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 {};

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -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;

View File

@ -1 +0,0 @@
export {};

View File

@ -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 {};

View File

@ -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;

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1,5 +0,0 @@
export interface Option {
text: string;
value: string | number;
icon: string;
}

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -12,3 +12,4 @@ function imageUrl(image) {
module.exports = {
imageUrl: imageUrl,
};

View File

@ -1 +0,0 @@
export {};

View File

@ -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;

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export declare const basic: string;

View File

@ -1 +0,0 @@
export declare const button: string;

View File

@ -1 +0,0 @@
export declare const link: string;

View File

@ -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 {};

View File

@ -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));
}

View File

@ -1 +0,0 @@
export declare const touch: string;

View File

@ -1 +0,0 @@
export declare function transition(showDefaultValue: boolean): string;

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -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;

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -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;
};
};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

1
dist/row/index.d.ts vendored
View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -61,6 +61,7 @@ VantComponent({
value: true,
},
theme: String,
alwaysEmbed: Boolean,
},
data: {
currentValue: '',

View File

@ -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"

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -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>

View File

@ -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
View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

1
dist/tag/index.d.ts vendored
View File

@ -1 +0,0 @@
export {};

View File

@ -1 +0,0 @@
export {};

View File

@ -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
View File

@ -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;

View File

@ -1 +0,0 @@
export {};

Some files were not shown because too many files have changed in this diff Show More