├── .editorconfig ├── .eslintignore ├── .github ├── ISSUE_TEMPLATE │ ├── BUG.md │ └── FEATURE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── check.yml │ └── publish.yml ├── .gitignore ├── .husky ├── commit-msg └── pre-commit ├── .prettierignore ├── .prettierrc ├── .stylelintignore ├── .vscode └── settings.json ├── .yarnrc ├── CHANGELOG.md ├── LICENSE ├── README.md ├── antm.config.ts ├── eslint.config.js ├── lerna.json ├── lint-staged.config.js ├── package.json ├── packages ├── vantui-cli │ ├── .editorconfig │ ├── .npmignore │ ├── README.md │ ├── bin.js │ ├── cjs │ │ ├── babel.config.cjs │ │ ├── cli-release-plugin.cjs │ │ ├── postcss.config.cjs │ │ └── shared.cjs │ ├── package.json │ ├── preset.cjs │ ├── src │ │ ├── cli.ts │ │ ├── commands │ │ │ ├── build.ts │ │ │ ├── changelog.ts │ │ │ ├── clean.ts │ │ │ ├── release.ts │ │ │ └── watch.ts │ │ ├── common │ │ │ ├── constant.ts │ │ │ ├── css.ts │ │ │ ├── index.ts │ │ │ ├── logger.ts │ │ │ └── manager.ts │ │ ├── compiler │ │ │ ├── compile-css.ts │ │ │ ├── compile-less.ts │ │ │ ├── compile-sass.ts │ │ │ ├── compile-script.ts │ │ │ ├── compile-style.ts │ │ │ ├── gen-component-style.ts │ │ │ ├── gen-package-entry.ts │ │ │ ├── gen-package-style.ts │ │ │ ├── gen-style-deps-map.ts │ │ │ └── get-deps.ts │ │ ├── index.ts │ │ └── module.d.ts │ ├── template │ │ ├── changelog-commit.hbs │ │ ├── changelog-header.hbs │ │ └── changelog-main.hbs │ └── tsconfig.cjs.json ├── vantui-demo │ ├── .editorconfig │ ├── README.md │ ├── babel.config.js │ ├── config │ │ ├── development.js │ │ ├── index.js │ │ ├── production.js │ │ └── webpack │ │ │ ├── commonChain.js │ │ │ ├── configPlugin.js │ │ │ ├── h5Chain.js │ │ │ └── miniChain.js │ ├── package.json │ ├── project.alipay.json │ ├── project.config.json │ ├── project.ks.json │ ├── project.swan.json │ ├── project.tt.json │ ├── src │ │ ├── app.config.js │ │ ├── app.less │ │ ├── app.tsx │ │ ├── common │ │ │ └── page.js │ │ ├── components │ │ │ ├── demo-block │ │ │ │ ├── index.js │ │ │ │ └── index.less │ │ │ ├── demo-home-nav │ │ │ │ ├── index.js │ │ │ │ └── index.less │ │ │ ├── demo-home │ │ │ │ ├── index.js │ │ │ │ └── index.less │ │ │ └── demo-page │ │ │ │ ├── index.js │ │ │ │ └── index.less │ │ ├── config.json │ │ ├── index.html │ │ ├── pages │ │ │ ├── action-sheet │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── area │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── badge │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── button │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── calendar │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── card │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── cascader │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── cell │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── check-list │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── checkbox │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── circle │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── col │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── collapse │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── common │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── config-provider │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── count-down │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── count-up │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── dashboard │ │ │ │ ├── index.config.js │ │ │ │ └── index.js │ │ │ ├── datetime-picker │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── default-props │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── dialog │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── divider │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── dropdown-menu │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── ellipsis │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── empty │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── field │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── form-render │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── form │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── goods-action │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── grid │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── icon │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── image-cropper │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── image-viewer │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── image │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── index-bar │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── infinite-scroll │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── loading │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── nav-bar │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── notice-bar │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── notify │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── number-keyboard │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── overlay │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── pagination │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── picker │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── popup │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── progress │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── pull-to-refresh │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── radio │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── rate │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── result │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── search │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── share-sheet │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── sidebar │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── signature │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── skeleton │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── sku │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── slider │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── space │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── stepper │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── steps │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── sticky │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── submit-bar │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── swipe-cell │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── swiper │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── switch │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── tab │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── tabbar │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── table │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── tag │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── toast │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── transition │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── tree-select │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── uploader │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── virtual-list │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ ├── water-mark │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ │ └── waterfall-flow │ │ │ │ ├── index.config.js │ │ │ │ └── index.tsx │ │ └── styles │ │ │ └── index.less │ └── types │ │ └── global.d.ts └── vantui │ ├── .editorconfig │ ├── .npmignore │ ├── README.md │ ├── antm.config.ts │ ├── build.sh │ ├── docs │ ├── comments.md │ ├── contributing.md │ ├── custom-style.md │ ├── home.md │ ├── premium.md │ ├── quickstart.md │ ├── theme.less │ ├── theme.md │ ├── use-in-react.md │ └── v2-to-v3.md │ ├── global.d.ts │ ├── package.json │ ├── scripts │ ├── md.js │ ├── style-to-md.js │ ├── ts-to-md.js │ └── utils │ │ ├── cross-platform-path.js.js │ │ ├── md-format.js │ │ └── ts-parser.js │ ├── src │ ├── action-sheet │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── area │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── badge │ │ ├── README.md │ │ ├── demo │ │ │ ├── config.ts │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── index.less │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── button │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo10.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ ├── demo8.tsx │ │ │ ├── demo9.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── calendar │ │ ├── README.md │ │ ├── components │ │ │ ├── header │ │ │ │ └── index.tsx │ │ │ ├── longSpan │ │ │ │ └── index.tsx │ │ │ └── month │ │ │ │ ├── index.tsx │ │ │ │ └── wxs.ts │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo10.tsx │ │ │ ├── demo11.tsx │ │ │ ├── demo12.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ ├── demo8.tsx │ │ │ ├── demo9.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ ├── utils.ts │ │ └── wxs.ts │ ├── card │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── cascader │ │ ├── README.md │ │ ├── cascader.tsx │ │ ├── cascaderItem.tsx │ │ ├── demo │ │ │ ├── demo-costom-opt.ts │ │ │ ├── demo-opt.ts │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ └── index.tsx │ │ ├── helper.ts │ │ ├── index.less │ │ ├── index.ts │ │ ├── scrollViewTimeout.tsx │ │ └── tree.ts │ ├── cell-group │ │ ├── index.less │ │ └── index.tsx │ ├── cell │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ ├── demo8.tsx │ │ │ ├── demo9.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── check-list │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── index.tsx │ │ │ └── options.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── checkbox-group │ │ ├── context.ts │ │ ├── index.less │ │ └── index.tsx │ ├── checkbox │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── circle │ │ ├── README.md │ │ ├── canvas.ts │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── col │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── collapse-item │ │ ├── index.less │ │ └── index.tsx │ ├── collapse │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── common │ │ ├── README.md │ │ ├── color.ts │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ └── index.tsx │ │ ├── jumpLink.ts │ │ ├── relation.ts │ │ ├── utils.ts │ │ ├── validator.ts │ │ └── version.ts │ ├── config-provider │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── count-down │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── util.ts │ ├── count-up │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── datetime-picker │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── default-props │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── index.tsx │ │ │ └── set.tsx │ │ └── index.ts │ ├── dialog │ │ ├── README.md │ │ ├── create-only-dialog.tsx │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ └── index.tsx │ │ ├── dialog.ts │ │ ├── events.ts │ │ ├── index.less │ │ └── index.tsx │ ├── divider │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── dropdown-item │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── dropdown-menu │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── ellipsis │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── empty │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── field │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── form-item │ │ ├── index.less │ │ ├── index.tsx │ │ ├── label.tsx │ │ └── message.tsx │ ├── form-render │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── form-render-new.tsx │ │ │ └── index.tsx │ │ ├── index.tsx │ │ ├── register.tsx │ │ └── utils.ts │ ├── form │ │ ├── README.md │ │ ├── core │ │ │ ├── formContext.ts │ │ │ ├── formstore.ts │ │ │ └── useForm.ts │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ └── index.tsx │ ├── goods-action-button │ │ ├── index.less │ │ └── index.tsx │ ├── goods-action-icon │ │ ├── index.less │ │ └── index.tsx │ ├── goods-action │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── grid-item │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── grid │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ ├── demo8.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── icon │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── image-cropper │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ └── index.tsx │ │ ├── h5.ts │ │ ├── index.less │ │ ├── index.tsx │ │ └── utils.ts │ ├── image-viewer │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ └── index.tsx │ │ ├── image-viewer.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ ├── node.tsx │ │ └── trigger.tsx │ ├── image │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── index-anchor │ │ ├── index.less │ │ └── index.tsx │ ├── index-bar │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── infinite-scroll │ │ ├── README.md │ │ ├── demo │ │ │ ├── common.ts │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── infinite-scroll.tsx │ ├── info │ │ ├── index.less │ │ └── index.tsx │ ├── init │ │ ├── index.less │ │ └── index.tsx │ ├── loading │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── mini-login-button │ │ ├── index.less │ │ └── index.tsx │ ├── mini-nav-bar │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── mini-phone-button │ │ ├── index.less │ │ └── index.tsx │ ├── mini-user-button │ │ ├── index.less │ │ └── index.tsx │ ├── mixins │ │ ├── page-scroll.ts │ │ └── transition.ts │ ├── nav-bar │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── notice-bar │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── notify │ │ ├── README.md │ │ ├── create-only-notify.tsx │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ ├── node.tsx │ │ ├── notify.tsx │ │ └── wxs.ts │ ├── number-keyboard │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── overlay │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── pagination │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── picker-column │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── picker │ │ ├── README.md │ │ ├── demo │ │ │ ├── data.ts │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── index.tsx │ │ │ └── options.ts │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── popup │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── progress │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── pull-to-refresh │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── pull-to-refresh.tsx │ ├── px-transform │ │ ├── index.less │ │ └── index.ts │ ├── radio-group │ │ ├── context.ts │ │ ├── index.less │ │ └── index.tsx │ ├── radio │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ ├── demo8.tsx │ │ │ ├── demo9.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── rate │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── result │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ └── index.tsx │ │ ├── iconfont │ │ │ └── iconfont.less │ │ ├── index.less │ │ └── index.tsx │ ├── root-portal │ │ └── index.tsx │ ├── row │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── search │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── share-sheet │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ ├── options.tsx │ │ ├── share-sheet-options.less │ │ └── wxs.ts │ ├── sidebar-item │ │ ├── index.less │ │ └── index.tsx │ ├── sidebar │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── signature │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── skeleton │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── sku │ │ ├── README.md │ │ ├── demo │ │ │ ├── common.ts │ │ │ ├── demo1.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── utils.ts │ ├── slider │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ ├── demo8.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── space │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── stepper │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ ├── demo8.tsx │ │ │ ├── demo9.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── steps │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── sticky │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── style │ │ ├── base.less │ │ ├── clearfix.less │ │ ├── ellipsis.less │ │ ├── hairline.less │ │ ├── mixins │ │ │ ├── clearfix.less │ │ │ ├── ellipsis.less │ │ │ └── hairline.less │ │ └── var.less │ ├── submit-bar │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── swipe-cell │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── swiper-item │ │ └── index.tsx │ ├── swiper │ │ ├── README.md │ │ ├── context.ts │ │ ├── demo │ │ │ ├── common.ts │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ ├── swiper.tsx │ │ └── utils.ts │ ├── switch │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── tab │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ ├── demo8.tsx │ │ │ ├── demo9.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── tabbar-item │ │ ├── index.less │ │ └── index.tsx │ ├── tabbar │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── table │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── tabs │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── tag │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ ├── demo6.tsx │ │ │ ├── demo7.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── toast │ │ ├── README.md │ │ ├── create-only-toast.tsx │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ └── index.tsx │ │ ├── events.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── toast.tsx │ ├── transition │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── tree-select │ │ ├── README.md │ │ ├── demo │ │ │ ├── common.ts │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── wxs.ts │ ├── uploader │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ ├── demo4.tsx │ │ │ ├── demo5.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ ├── shared.ts │ │ ├── utils.ts │ │ └── wxs.ts │ ├── utils │ │ ├── index.ts │ │ └── type.ts │ ├── virtual-list │ │ ├── README.md │ │ ├── demo │ │ │ ├── common.ts │ │ │ ├── demo1.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ ├── utils.tsx │ │ └── virtual-half-list.tsx │ ├── water-mark │ │ ├── README.md │ │ ├── demo │ │ │ ├── demo1.tsx │ │ │ └── index.tsx │ │ ├── index.less │ │ ├── index.tsx │ │ └── utils.ts │ ├── waterfall-flow │ │ ├── README.md │ │ ├── WaterfallFlowItem │ │ │ ├── index.tsx │ │ │ └── useForceResize.ts │ │ ├── demo │ │ │ ├── common.ts │ │ │ ├── demo1.tsx │ │ │ ├── demo2.tsx │ │ │ ├── demo3.tsx │ │ │ └── index.tsx │ │ ├── hooks │ │ │ ├── index.ts │ │ │ ├── useForceUpdate │ │ │ │ └── index.ts │ │ │ ├── useNextTick │ │ │ │ └── index.ts │ │ │ ├── usePersistFn │ │ │ │ └── index.ts │ │ │ ├── useSubscribeElementSize │ │ │ │ └── index.ts │ │ │ └── useTimeout │ │ │ │ ├── index.ts │ │ │ │ ├── useDepsTimeout.ts │ │ │ │ └── useTimeout.ts │ │ ├── index.less │ │ ├── index.tsx │ │ ├── types │ │ │ └── index.ts │ │ ├── useWaterfallAttributes.ts │ │ └── utils │ │ │ └── element │ │ │ ├── index.ts │ │ │ └── size │ │ │ ├── index.ts │ │ │ ├── queryElementSize.ts │ │ │ └── types.ts │ └── wxs │ │ ├── add-unit.ts │ │ ├── array.ts │ │ ├── bem.ts │ │ ├── extra-node.ts │ │ ├── memoize.ts │ │ ├── object.ts │ │ ├── style.ts │ │ └── utils.ts │ ├── stylelint.config.js │ ├── tsconfig.json │ ├── types │ ├── action-sheet.d.ts │ ├── area.d.ts │ ├── badge.d.ts │ ├── button.d.ts │ ├── calendar.d.ts │ ├── card.d.ts │ ├── cascader.d.ts │ ├── cell.d.ts │ ├── check-list.d.ts │ ├── checkbox.d.ts │ ├── circle.d.ts │ ├── col.d.ts │ ├── collapse.d.ts │ ├── config-provider.d.ts │ ├── count-down.d.ts │ ├── count-up.d.ts │ ├── datetime-picker.d.ts │ ├── default-props.d.ts │ ├── dialog.d.ts │ ├── divider.d.ts │ ├── dropdown-menu.d.ts │ ├── ellipsis.d.ts │ ├── empty.d.ts │ ├── field.d.ts │ ├── form-render.d.ts │ ├── form.d.ts │ ├── goods-action-button.d.ts │ ├── goods-action-icon.d.ts │ ├── goods-action.d.ts │ ├── grid.d.ts │ ├── icon.d.ts │ ├── image-cropper.d.ts │ ├── image-viewer.d.ts │ ├── image.d.ts │ ├── index-anchor.d.ts │ ├── index-bar.d.ts │ ├── index.d.ts │ ├── infinite-scroll.d.ts │ ├── info.d.ts │ ├── loading.d.ts │ ├── mini-login-button.d.ts │ ├── mini-nav-bar.d.ts │ ├── mini-phone-button.d.ts │ ├── mini-user-button.d.ts │ ├── mixins │ │ └── transition.d.ts │ ├── nav-bar.d.ts │ ├── normal.d.ts │ ├── notice-bar.d.ts │ ├── notify.d.ts │ ├── number-keyboard.d.ts │ ├── overlay.d.ts │ ├── pagination.d.ts │ ├── picker-column.d.ts │ ├── picker.d.ts │ ├── popup.d.ts │ ├── progress.d.ts │ ├── pull-to-refresh.d.ts │ ├── radio.d.ts │ ├── rate.d.ts │ ├── result.d.ts │ ├── search.d.ts │ ├── share-sheet.d.ts │ ├── sidebar.d.ts │ ├── signature.d.ts │ ├── skeleton.d.ts │ ├── sku.d.ts │ ├── slider.d.ts │ ├── space.d.ts │ ├── stepper.d.ts │ ├── steps.d.ts │ ├── sticky.d.ts │ ├── submit-bar.d.ts │ ├── swipe-cell.d.ts │ ├── swiper.d.ts │ ├── switch.d.ts │ ├── tab.d.ts │ ├── tabbar.d.ts │ ├── table.d.ts │ ├── tag.d.ts │ ├── toast.d.ts │ ├── transition.d.ts │ ├── tree-select.d.ts │ ├── uploader.d.ts │ ├── virtual-list.d.ts │ ├── water-mark.d.ts │ └── waterfall-flow.d.ts │ └── vant.config.js ├── pullRequest.js ├── resource ├── abcd.png └── log.jpeg ├── stylelint.config.js ├── tsconfig.base.json ├── tsconfig.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/BUG.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug反馈 3 | about: 为了更快速的定位您的问题,请提供详细的BUG描述。 4 | --- 5 | 6 | 7 | 8 | **这个 Issue 涉及以下平台:** 9 | 10 | - [ ] 微信小程序 11 | - [ ] 支付宝小程序 12 | - [ ] 百度小程序 13 | - [ ] 头条小程序 14 | - [ ] 快手小程序 15 | - [ ] QQ 轻应用 16 | - [ ] Web 平台(H5) 17 | 18 | **BUG 描述** 19 | 20 | **复现步骤** 21 | 22 | **期望结果** 23 | 24 | **实际结果** 25 | 26 | **截图** 27 | 28 | **环境** 29 | 30 | **附加信息** 31 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 产品功能需求及建议 3 | about: 提供新功能的建议 4 | --- 5 | 6 | 7 | 8 | **这个 Issue 涉及以下平台:** 9 | 10 | - [ ] 微信小程序 11 | - [ ] 支付宝小程序 12 | - [ ] 百度小程序 13 | - [ ] 头条小程序 14 | - [ ] 快手小程序 15 | - [ ] QQ 轻应用 16 | - [ ] Web 平台(H5) 17 | 18 | **您提出的功能是否和您遇到的问题有关,请描述该问题** 19 | 20 | **您是否有建议的实现方案** 21 | 22 | **其它帮助我们理解您需求的描述、截图** 23 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no-install commitlint --edit $1 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn lint-staged 5 | # npx antm-warning webhooks 6 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all", 4 | "semi": false 5 | } -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/lerna/schemas/lerna-schema.json", 3 | "useNx": true, 4 | "useWorkspaces": true, 5 | "npmClient": "yarn", 6 | "command": { 7 | "publish": { 8 | "message": "chore(release): publish %s" 9 | } 10 | }, 11 | "packages": [ 12 | "packages/*" 13 | ], 14 | "ignoreChanges": [ 15 | "packages/vantui-demo/**", 16 | "**/*.md", 17 | "**/__test__/**" 18 | ], 19 | "version": "3.6.4" 20 | } -------------------------------------------------------------------------------- /lint-staged.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | '**/*.{js,jsx,ts,tsx}': ['npx eslint -c eslint.config.js --fix'], 3 | '**/*.ts?(x)': () => 'npx tsc -p tsconfig.json --skipLibCheck', 4 | '**/*.{css,less}': ['npx stylelint --aei --config stylelint.config.js --fix'], 5 | '**/*.{js,jsx,ts,tsx,md,html,css,less}': 'npx prettier --write', 6 | } 7 | -------------------------------------------------------------------------------- /packages/vantui-cli/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /packages/vantui-cli/.npmignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.swp 3 | 4 | .github 5 | .cache 6 | .temp 7 | .idea 8 | .rn_temp 9 | .DS_Store 10 | 11 | CHANGELOG.md 12 | 13 | node_modules 14 | coverage 15 | src 16 | -------------------------------------------------------------------------------- /packages/vantui-cli/bin.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /* eslint-disable import/no-unresolved */ 3 | import './dest/cli.js' 4 | -------------------------------------------------------------------------------- /packages/vantui-cli/cjs/babel.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function (api, options) { 2 | if (api) { 3 | api.cache.never() 4 | } 5 | 6 | const { BABEL_MODULE, NODE_ENV } = process.env 7 | const isTest = NODE_ENV === 'test' 8 | const useESModules = BABEL_MODULE !== 'commonjs' && !isTest 9 | 10 | return { 11 | presets: [ 12 | [ 13 | require.resolve('@babel/preset-env'), 14 | { 15 | modules: useESModules ? false : 'commonjs', 16 | loose: options.loose, 17 | }, 18 | ], 19 | require.resolve('@babel/preset-typescript'), 20 | ], 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/vantui-cli/cjs/cli-release-plugin.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const { execSync } = require('child_process') 3 | const releaseIt = require('release-it') 4 | 5 | class VantCliReleasePlugin extends releaseIt.Plugin { 6 | async beforeRelease() { 7 | // log an empty line 8 | console.log('') 9 | 10 | execSync('antm-lib-cli build', { stdio: 'inherit' }) 11 | execSync('antm-lib-cli changelog', { stdio: 'inherit' }) 12 | } 13 | } 14 | 15 | module.exports = VantCliReleasePlugin 16 | -------------------------------------------------------------------------------- /packages/vantui-cli/cjs/shared.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const { join, dirname } = require('path') 3 | const { existsSync } = require('fs') 4 | 5 | function findRootDir(dir) { 6 | if (existsSync(join(dir, 'vant.config.js'))) { 7 | return dir 8 | } 9 | 10 | const parentDir = dirname(dir) 11 | if (dir === parentDir) { 12 | return dir 13 | } 14 | 15 | return findRootDir(parentDir) 16 | } 17 | 18 | const CWD = process.cwd() 19 | const ROOT = findRootDir(CWD) 20 | 21 | module.exports = { 22 | CWD, 23 | ROOT, 24 | } 25 | -------------------------------------------------------------------------------- /packages/vantui-cli/preset.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const babelConfig = require('./cjs/babel.config.cjs') 3 | 4 | module.exports = (api, options) => babelConfig(api, options) 5 | -------------------------------------------------------------------------------- /packages/vantui-cli/src/commands/clean.ts: -------------------------------------------------------------------------------- 1 | import { remove } from 'fs-extra' 2 | import { ES_DIR, LIB_DIR, DIST_DIR } from '../common/constant.js' 3 | 4 | export async function clean() { 5 | await Promise.all([remove(ES_DIR), remove(LIB_DIR), remove(DIST_DIR)]) 6 | } 7 | -------------------------------------------------------------------------------- /packages/vantui-cli/src/common/logger.ts: -------------------------------------------------------------------------------- 1 | import ora from 'ora' 2 | import chalk from 'chalk' 3 | import consola from 'consola' 4 | import { ROOT } from '../common/constant.js' 5 | 6 | export function slimPath(path: string) { 7 | return chalk.yellow(path.replace(ROOT, '')) 8 | } 9 | 10 | export { ora, consola } 11 | -------------------------------------------------------------------------------- /packages/vantui-cli/src/compiler/compile-css.ts: -------------------------------------------------------------------------------- 1 | import postcss from 'postcss' 2 | import postcssrc from 'postcss-load-config' 3 | import CleanCss from 'clean-css' 4 | import { POSTCSS_CONFIG_FILE } from '../common/constant.js' 5 | 6 | const cleanCss = new CleanCss() 7 | 8 | export async function compileCss(source: string | Buffer) { 9 | const config = await postcssrc({}, POSTCSS_CONFIG_FILE) 10 | const { css } = await postcss(config.plugins as any).process(source, { 11 | from: undefined, 12 | }) 13 | 14 | return cleanCss.minify(css).styles 15 | } 16 | -------------------------------------------------------------------------------- /packages/vantui-cli/src/compiler/compile-less.ts: -------------------------------------------------------------------------------- 1 | import { join } from 'path' 2 | import { readFileSync } from 'fs' 3 | import less from 'less' 4 | import { CWD } from '../common/constant.js' 5 | 6 | export async function compileLess(filePath: string) { 7 | const source = readFileSync(filePath, 'utf-8') 8 | const { css } = await less.render(source, { 9 | filename: filePath, 10 | paths: [join(CWD, 'node_modules')], 11 | }) 12 | 13 | return css 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui-cli/src/module.d.ts: -------------------------------------------------------------------------------- 1 | // some modules with missing type definitions 2 | declare module 'execa' 3 | declare module 'hash-sum' 4 | declare module 'clean-css' 5 | declare module 'release-it' 6 | declare module 'conventional-changelog' 7 | declare module 'babel-loader' 8 | declare module 'markdown-to-ast' 9 | declare module 'prettier' 10 | declare namespace NodeJS { 11 | interface ProcessEnv { 12 | NODE_ENV: 'development' | 'production' 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui-cli/template/changelog-commit.hbs: -------------------------------------------------------------------------------- 1 | -{{#if scope}} 2 | {{scope}}: 3 | {{~/if}} 4 | {{#if subject}} 5 | {{~subject}} 6 | {{~else}} 7 | {{~header}} 8 | {{~/if}} 9 | {{#if references~}} 10 | {{~#each references}} 11 | [{{~this.repository}}#{{this.issue}}]({{~@root.repoUrl}}/{{~@root.issue}}/{{this.issue}}){{/each}} 12 | {{~else}} 13 | [{{shortHash}}]({{~@root.repoUrl}}/{{~@root.commit}}/{{hash}}) 14 | {{~/if}} -------------------------------------------------------------------------------- /packages/vantui-cli/template/changelog-header.hbs: -------------------------------------------------------------------------------- 1 | ### [v{{version}}]({{~@root.repoUrl}}/compare/{{previousTag}}...{{currentTag}}) 2 | `{{date}}` -------------------------------------------------------------------------------- /packages/vantui-cli/template/changelog-main.hbs: -------------------------------------------------------------------------------- 1 | {{> header}} 2 | {{#each commitGroups}} 3 | 4 | {{#if title}} 5 | **{{title}}** 6 | 7 | {{/if}} 8 | {{#each commits}} 9 | {{> commit root=@root}} 10 | {{/each}} 11 | {{/each}} 12 | {{> footer}} 13 | -------------------------------------------------------------------------------- /packages/vantui-cli/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "target": "ES2017", 5 | "module": "ES2022", 6 | "baseUrl": "./", 7 | "outDir": "dest" 8 | }, 9 | "include": ["src"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/vantui-demo/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /packages/vantui-demo/babel.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-commonjs */ 2 | // babel-preset-taro 更多选项和默认值: 3 | // https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md 4 | module.exports = { 5 | presets: [ 6 | [ 7 | 'taro', 8 | { 9 | framework: 'react', 10 | ts: true, 11 | hot: false, 12 | useBuiltIns: false, 13 | }, 14 | ], 15 | ], 16 | plugins: [ 17 | ['lodash'], 18 | [ 19 | 'import', 20 | { 21 | libraryName: '@antmjs/vantui', 22 | libraryDirectory: 'es', 23 | }, 24 | '@antmjs/vantui', 25 | ], 26 | ], 27 | } 28 | -------------------------------------------------------------------------------- /packages/vantui-demo/config/development.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | NODE_ENV: '"development"', 4 | }, 5 | defineConstants: {}, 6 | mini: {}, 7 | h5: {}, 8 | } 9 | -------------------------------------------------------------------------------- /packages/vantui-demo/config/webpack/h5Chain.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const H5FixPlugin = require('@antmjs/plugin-h5-fix') 3 | const commonChain = require('./commonChain') 4 | 5 | module.exports = function (chain) { 6 | chain.plugin('H5FixPlugin').use(new H5FixPlugin()) 7 | commonChain(chain) 8 | } 9 | -------------------------------------------------------------------------------- /packages/vantui-demo/project.alipay.json: -------------------------------------------------------------------------------- 1 | { 2 | "component2": true, 3 | "enableAppxNg": true, 4 | "enableParallelLoader": false, 5 | "enableHMR": false 6 | } 7 | -------------------------------------------------------------------------------- /packages/vantui-demo/project.ks.json: -------------------------------------------------------------------------------- 1 | { 2 | "miniprogramRoot": "./", 3 | "projectname": "mini-project", 4 | "description": "", 5 | "setting": { 6 | "urlCheck": true, 7 | "es6": false, 8 | "postcss": false, 9 | "minified": false, 10 | "enhance": false 11 | }, 12 | "compileType": "miniprogram" 13 | } 14 | -------------------------------------------------------------------------------- /packages/vantui-demo/project.swan.json: -------------------------------------------------------------------------------- 1 | { 2 | "projectname": "pure-project-vantui", 3 | "miniprogramRoot": "./", 4 | "compilation-args": { 5 | "common": { 6 | "ignorePrefixCss": true, 7 | "ignoreTransJs": true, 8 | "ignoreUglify": true 9 | } 10 | }, 11 | "setting": { 12 | "urlCheck": true, 13 | "es6": false, 14 | "minified": false, 15 | "postcss": false 16 | } 17 | } -------------------------------------------------------------------------------- /packages/vantui-demo/project.tt.json: -------------------------------------------------------------------------------- 1 | { 2 | "miniprogramRoot": "./", 3 | "projectname": "mini-project", 4 | "setting": { 5 | "urlCheck": true, 6 | "es6": false, 7 | "minified": false, 8 | "postcss": false, 9 | "enhance": false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/common/page.js: -------------------------------------------------------------------------------- 1 | export default function (options = {}) { 2 | return Page({ 3 | onShareAppMessage() { 4 | return { 5 | title: '@antmjs/vantui 组件库演示', 6 | } 7 | }, 8 | ...options, 9 | }) 10 | } 11 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/components/demo-block/index.less: -------------------------------------------------------------------------------- 1 | .demo-block__title { 2 | margin: 0; 3 | padding: 40px 30px 30px; 4 | color: rgba(69, 90, 100, 0.6); 5 | font-weight: normal; 6 | font-size: 28px; 7 | } 8 | 9 | .demo-block__card { 10 | overflow: hidden; 11 | border-radius: 16px; 12 | } 13 | 14 | .demo-block--padding { 15 | padding: 0 30px; 16 | } 17 | 18 | .demo-block--padding .demo-block__title { 19 | padding-left: 0; 20 | } 21 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/action-sheet/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'ActionSheet 动作面板', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/action-sheet/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/action-sheet/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/area/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Area 省市区选择', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/area/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/area/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/badge/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Badge 徽标', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/badge/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/badge/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/button/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Button 按钮', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/button/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/button/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/calendar/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Calendar 日历', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/calendar/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/calendar/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/card/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Card 商品卡片', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/card/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/card/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/cascader/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Cascader 级联选择', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/cascader/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/cascader/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/cell/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Cell 单元格', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/cell/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/cell/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/check-list/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'CheckList 勾选列表', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/check-list/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/check-list/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/checkbox/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Checkbox 复选框', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/checkbox/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/checkbox/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/circle/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Circle 环形进度条', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/circle/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/circle/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/col/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Layout 布局', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/col/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/col/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/collapse/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Collapse 折叠面板', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/collapse/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/collapse/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/common/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Style 内置样式', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/common/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/common/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/config-provider/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'ConfigProvider 全局配置', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/config-provider/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/config-provider/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/count-down/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'CountDown 倒计时', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/count-down/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/count-down/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/count-up/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'CountUp 数字滚动', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/count-up/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/count-up/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/dashboard/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'antmjs-vantui', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/dashboard/index.js: -------------------------------------------------------------------------------- 1 | import { Component } from 'react' 2 | import list from '../../config.json' 3 | import DemoHome from '../../components/demo-home/index' 4 | 5 | export default class Index extends Component { 6 | constructor() { 7 | super() 8 | } 9 | 10 | state = { 11 | list, 12 | } 13 | 14 | render() { 15 | const { list } = this.state 16 | 17 | return 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/datetime-picker/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'DatetimePicker 时间选择', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/datetime-picker/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/datetime-picker/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/default-props/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'default-props 默认参数配置', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/default-props/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/default-props/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/dialog/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Dialog 弹出框', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/dialog/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/dialog/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/divider/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Divider 分割线', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/divider/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/divider/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/dropdown-menu/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'DropdownMenu 下拉菜单', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/dropdown-menu/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/dropdown-menu/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/ellipsis/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Ellipsis 文本省略', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/ellipsis/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/ellipsis/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/empty/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Empty 空状态', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/empty/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/empty/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/field/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Field 输入框', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/field/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/field/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/form-render/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'FormRender 表单渲染器', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/form-render/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/form-render/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/form/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Form 表单', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/form/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/form/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/goods-action/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'GoodsAction 商品导航', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/goods-action/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/goods-action/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/grid/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Grid 宫格', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/grid/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/grid/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/icon/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Icon 图标', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/icon/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/icon/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/image-cropper/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Image-cropper 图片裁剪', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/image-cropper/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/image-cropper/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/image-viewer/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Image Viewer 图片查看', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/image-viewer/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/image-viewer/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/image/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Image 图片', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/image/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/image/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/index-bar/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'IndexBar 索引栏', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/index-bar/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/index-bar/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/infinite-scroll/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'InfiniteScroll 无限滚动', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/infinite-scroll/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/infinite-scroll/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/loading/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Loading 加载', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/loading/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/loading/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/nav-bar/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'NavBar 导航栏', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/nav-bar/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/nav-bar/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/notice-bar/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'NoticeBar 通知栏', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/notice-bar/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/notice-bar/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/notify/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Notify 消息通知', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/notify/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/notify/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/number-keyboard/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'NumberKeyboard 数字键盘', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/number-keyboard/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/number-keyboard/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/overlay/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Overlay 遮罩层', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/overlay/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/overlay/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/pagination/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Pagination 分页', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/pagination/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/pagination/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/picker/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Picker 选择器', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/picker/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/picker/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/popup/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Popup 弹出层', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/popup/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/popup/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/progress/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Progress 进度条', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/progress/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/progress/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/pull-to-refresh/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'PullToRefresh 下拉刷新', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/pull-to-refresh/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/pull-to-refresh/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/radio/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Radio 单选框', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/radio/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/radio/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/rate/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Rate 评分', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/rate/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/rate/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/result/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Rsult 操作结果', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/result/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/result/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/search/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Search 搜索', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/search/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/search/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/share-sheet/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'ShareSheet 分享面板', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/share-sheet/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/share-sheet/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/sidebar/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Sidebar 侧边导航', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/sidebar/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/sidebar/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/signature/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Signature 签名', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/signature/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/signature/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/skeleton/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Skeleton 骨架屏', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/skeleton/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/skeleton/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/sku/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Sku 商品规格选择', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/sku/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/sku/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/slider/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Slider 滑块', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/slider/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/slider/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/space/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Space 间距', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/space/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/space/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/stepper/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Stepper 步进器', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/stepper/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/stepper/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/steps/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Steps 步骤条', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/steps/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/steps/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/sticky/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Sticky 粘性布局', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/sticky/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/sticky/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/submit-bar/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'SubmitBar 提交订单栏', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/submit-bar/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/submit-bar/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/swipe-cell/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'SwipeCell 滑动单元格', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/swipe-cell/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/swipe-cell/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/swiper/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Swiper 轮播', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/swiper/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/swiper/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/switch/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Switch 开关', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/switch/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/switch/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/tab/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Tab 标签页', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/tab/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/tab/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/tabbar/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Tabbar 标签栏', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/tabbar/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/tabbar/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/table/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Table 表格', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/table/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/table/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/tag/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Tag 标签', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/tag/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/tag/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/toast/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Toast 轻提示', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/toast/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/toast/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/transition/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'transition 动画', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/transition/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/transition/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/tree-select/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'TreeSelect 分类选择', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/tree-select/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/tree-select/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/uploader/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'Uploader 文件上传', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/uploader/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/uploader/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/virtual-list/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'VirtualList 虚拟列表', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/virtual-list/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/virtual-list/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/water-mark/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'WaterMark 水印', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/water-mark/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/water-mark/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/waterfall-flow/index.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'WaterfallFlow 瀑布流', 3 | enableShareAppMessage: true, 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/pages/waterfall-flow/index.tsx: -------------------------------------------------------------------------------- 1 | import Demo from '../../../../vantui/src/waterfall-flow/demo/index' 2 | 3 | export default function Index() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui-demo/src/styles/index.less: -------------------------------------------------------------------------------- 1 | @import '@antmjs/vantui/es/style/var.less'; 2 | 3 | // 这里可以重写主题 4 | @green: #07c160; 5 | -------------------------------------------------------------------------------- /packages/vantui/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /packages/vantui/.npmignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.swp 3 | 4 | .github 5 | .cache 6 | .temp 7 | .idea 8 | .rn_temp 9 | .DS_Store 10 | 11 | CHANGELOG.md 12 | 13 | src 14 | node_modules 15 | coverage 16 | docs 17 | scripts 18 | build.sh 19 | .antm.config.* 20 | -------------------------------------------------------------------------------- /packages/vantui/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -rf ./doc_build 4 | 5 | npx antm-doc-build 6 | 7 | npx prettier --write '**/*.{js,jsx,ts,tsx,md,html,css,less}' 8 | 9 | cd ./../vantui-demo 10 | 11 | pwd 12 | yarn real:h5Doc 13 | 14 | cd ./../vantui 15 | 16 | mv ./../vantui-demo/build/js ./doc_build/js 17 | mv ./../vantui-demo/build/assets ./doc_build/assets 18 | 19 | mv ./../vantui-demo/build/index.html ./doc_build/mobile.html 20 | -------------------------------------------------------------------------------- /packages/vantui/docs/custom-style.md: -------------------------------------------------------------------------------- 1 | # 样式覆盖 2 | 3 | ### 样式类覆盖 4 | 5 | 得益于 Taro3 的实现,我们无需再关注小程序的样式隔离问题,所以我们可以常规使用样式覆盖 6 | 7 | ```jsx 8 | 9 | ``` 10 | 11 | ```css 12 | /* page.less */ 13 | .van-button--primary { 14 | font-size: 20px; 15 | background-color: pink; 16 | } 17 | ``` 18 | 19 | ### 使用 CSS 变量 20 | 21 | @antmjs/vantui 为部分 CSS 属性开放了基于 CSS 属性的定制方案。 22 | 23 | 相较于 样式类覆盖,这种方案支持在页面或应用级别对多个组件的样式做批量修改以进行主题样式的定制。 24 | 25 | 当然,用它来修改单个组件的部分样式也是绰绰有余的。具体的使用方法请查阅[定制主题](#/theme) 26 | -------------------------------------------------------------------------------- /packages/vantui/docs/theme.less: -------------------------------------------------------------------------------- 1 | :root { 2 | --header-back-color: #06021e; 3 | --code-box-max-height: max-content; 4 | --code-box-background: #fafafa; 5 | --code-tabs-background: #f1f1f1; 6 | } 7 | 8 | .antm-docs-header-nav .nav-text, 9 | .antm-docs-header-nav .nav-select { 10 | background-color: #ffffff; 11 | } 12 | 13 | .demo-code-tabs .code-tab-name { 14 | color: #453f3f; 15 | font-weight: 500; 16 | } 17 | 18 | .demo-code-tabs .code-tab-name-active { 19 | color: #453f3f; 20 | border-color: #453f3f; 21 | border-width: 2px; 22 | } 23 | 24 | .antm-docs-markdown pre code { 25 | color: #474141ee; 26 | } 27 | -------------------------------------------------------------------------------- /packages/vantui/global.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace NodeJS { 2 | interface ProcessEnv { 3 | NODE_ENV: 'development' | 'production' 4 | TARO_ENV: 5 | | 'weapp' 6 | | 'swan' 7 | | 'alipay' 8 | | 'h5' 9 | | 'tt' 10 | | 'qq' 11 | | 'dd' 12 | | 'qywx' 13 | | 'jd' 14 | | 'iot' 15 | | 'kwai' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/vantui/scripts/md.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const stylToMd = require('./style-to-md') 3 | const typescriptToMd = require('./ts-to-md') 4 | 5 | async function main() { 6 | await typescriptToMd() 7 | stylToMd() 8 | } 9 | 10 | main() 11 | -------------------------------------------------------------------------------- /packages/vantui/scripts/utils/cross-platform-path.js.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path') 3 | const { sep } = path 4 | 5 | module.exports = function (path) { 6 | if (typeof path !== 'string') { 7 | return path 8 | } 9 | if (sep === '\\') { 10 | // 如果当前操作系统为Windows,则将双反斜杠转换为单反斜杠 11 | return path.replace(/\\/g, '/') 12 | } 13 | return path 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui/scripts/utils/md-format.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const Prettier = require('prettier') 3 | 4 | module.exports = function formatMd(md) { 5 | return Prettier.format(md, { 6 | singleQuote: true, 7 | trailingComma: 'all', 8 | semi: false, 9 | parser: 'markdown', 10 | }) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/action-sheet/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { View } from '@tarojs/components' 4 | import { ActionSheet, Button } from '@antmjs/vantui' 5 | 6 | export default function Demo() { 7 | const [show, setShow] = react.useState(false) 8 | 9 | return ( 10 | <> 11 | setShow(false)}> 12 | 内容 13 | 14 | 17 | 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /packages/vantui/src/area/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Area } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | const areaList = { 5 | province_list: { 6 | 110000: '北京市', 7 | 120000: '天津市', 8 | }, 9 | city_list: { 10 | 110100: '北京市', 11 | 120100: '天津市', 12 | }, 13 | county_list: { 14 | 110101: '东城区', 15 | 110102: '西城区', 16 | }, 17 | } 18 | return ( 19 | 24 | ) 25 | } 26 | -------------------------------------------------------------------------------- /packages/vantui/src/area/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import react from 'react' 2 | import { areaList } from '@vant/area-data' 3 | import { Area } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState('') 7 | react.useEffect(() => { 8 | setTimeout(() => { 9 | setValue('210793') 10 | }, 1000) 11 | }, []) 12 | 13 | return ( 14 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/area/index.less: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /packages/vantui/src/area/wxs.ts: -------------------------------------------------------------------------------- 1 | function displayColumns(columns: any, columnsNum: string | number) { 2 | return columns.slice(0, +columnsNum) 3 | } 4 | 5 | export { displayColumns } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/badge/demo/config.ts: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export const style: React.CSSProperties = { 4 | width: 50, 5 | height: 50, 6 | background: '#eee', 7 | borderRadius: 8, 8 | } 9 | -------------------------------------------------------------------------------- /packages/vantui/src/badge/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { Badge } from '@antmjs/vantui' 3 | import { View } from '@tarojs/components' 4 | 5 | export default function Demo() { 6 | return ( 7 | <> 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /packages/vantui/src/badge/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { Badge } from '@antmjs/vantui' 3 | import { View } from '@tarojs/components' 4 | 5 | export default function Demo() { 6 | return ( 7 | <> 8 | 9 | 10 | 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /packages/vantui/src/badge/demo/index.less: -------------------------------------------------------------------------------- 1 | .avart { 2 | width: 80px; 3 | height: 80px; 4 | background: #aba3a3; 5 | border-radius: 20px; 6 | } 7 | -------------------------------------------------------------------------------- /packages/vantui/src/button/demo/demo10.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Button } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 9 | 12 | 15 | 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /packages/vantui/src/button/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Button } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 11 | 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/button/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Button } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 11 | 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/button/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Button } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 11 | 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/button/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Button } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 11 | 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/button/demo/demo7.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Button } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 12 | 18 | 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /packages/vantui/src/button/demo/demo8.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Button } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 11 | 14 | 17 | 20 | 21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /packages/vantui/src/button/demo/demo9.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Button } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /packages/vantui/src/calendar/demo/demo12.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { Calendar } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/card/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { Card } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/card/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Card, Button } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 16 | 17 | 18 | 19 | } 20 | /> 21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /packages/vantui/src/cascader/index.ts: -------------------------------------------------------------------------------- 1 | import { Cascader } from './cascader' 2 | 3 | export default Cascader 4 | 5 | export { Cascader } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/cell-group/index.less: -------------------------------------------------------------------------------- 1 | @import '../style/var.less'; 2 | 3 | .van-cell-group { 4 | &--inset { 5 | .theme(margin, '@cell-group-inset-padding'); 6 | .theme(border-radius, '@cell-group-inset-border-radius'); 7 | 8 | overflow: hidden; 9 | } 10 | 11 | &__title { 12 | .theme(padding, '@cell-group-title-padding'); 13 | .theme(font-size, '@cell-group-title-font-size'); 14 | .theme(line-height, '@cell-group-title-line-height'); 15 | .theme(color, '@cell-group-title-color'); 16 | 17 | &--inset { 18 | .theme(padding, '@cell-group-inset-title-padding'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/cell/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { CellGroup, Cell } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 9 | 10 | 11 | 12 | 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/cell/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { CellGroup, Cell } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 9 | 10 | 11 | 12 | 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/cell/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Cell } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 9 | 10 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/cell/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Cell } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/cell/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Cell } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 9 | 10 | 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /packages/vantui/src/cell/demo/demo6.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Cell } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/cell/demo/demo7.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { CellGroup, Cell } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/cell/demo/demo9.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Cell } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/cell/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/style' 2 | import { addUnit } from '../wxs/add-unit' 3 | 4 | function titleStyle(data: any) { 5 | return style([ 6 | { 7 | 'max-width': addUnit(data.titleWidth), 8 | 'min-width': addUnit(data.titleWidth), 9 | }, 10 | data.titleStyle, 11 | ]) 12 | } 13 | 14 | export { titleStyle } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/checkbox-group/context.ts: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react' 2 | import { CheckboxGroupProps } from '../../types/checkbox' 3 | 4 | const CheckboxGroupContext = createContext({}) 5 | 6 | export default CheckboxGroupContext 7 | -------------------------------------------------------------------------------- /packages/vantui/src/checkbox-group/index.less: -------------------------------------------------------------------------------- 1 | .van-checkbox-group { 2 | &--horizontal { 3 | display: flex; 4 | flex-wrap: wrap; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/vantui/src/checkbox/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Checkbox } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState(true) 7 | return ( 8 | setValue(e.detail)}> 9 | 复选框 10 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/checkbox/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { View } from '@tarojs/components' 4 | import { Checkbox } from '@antmjs/vantui' 5 | 6 | export default function Demo() { 7 | const [value, setValue] = react.useState(true) 8 | return ( 9 | 10 | 11 | 禁用1 12 | 13 | setValue(e.detail)} 17 | > 18 | 禁用2 19 | 20 | 21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /packages/vantui/src/checkbox/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { CheckboxGroup, Checkbox } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [values, setValues] = react.useState(['a', 'b']) 7 | return ( 8 | { 11 | console.info(e) 12 | setValues([...e.detail]) 13 | }} 14 | > 15 | 复选框 a 16 | 复选框 b 17 | 复选框 c 18 | 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /packages/vantui/src/checkbox/demo/demo6.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { CheckboxGroup, Checkbox } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [values, setValues] = react.useState(['a']) 7 | return ( 8 | { 13 | setValues([...e.detail]) 14 | }} 15 | > 16 | 复选框 a 17 | 复选框 b 18 | 复选框 c 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/checkbox/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/style' 2 | import { addUnit } from '../wxs/add-unit' 3 | 4 | function iconStyle(data: any) { 5 | const styles: any = { 6 | 'font-size': addUnit(data.iconSize), 7 | } 8 | 9 | if ( 10 | data.checkedColor && 11 | data.value && 12 | !data.disabled && 13 | !data.parentDisabled 14 | ) { 15 | styles['border-color'] = data.checkedColor 16 | styles['background-color'] = data.checkedColor 17 | } 18 | 19 | return style(styles) 20 | } 21 | 22 | export { iconStyle } 23 | -------------------------------------------------------------------------------- /packages/vantui/src/circle/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { Circle } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return 6 | } 7 | -------------------------------------------------------------------------------- /packages/vantui/src/circle/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Circle, Button } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState(50) 7 | 8 | return ( 9 | <> 10 | 11 | 12 | 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/circle/index.less: -------------------------------------------------------------------------------- 1 | @import '../style/var.less'; 2 | 3 | .van-circle { 4 | position: relative; 5 | display: inline-block; 6 | text-align: center; 7 | 8 | .theme(font-size, '@circle-font-color'); 9 | 10 | &__text { 11 | position: absolute; 12 | top: 50%; 13 | left: 0; 14 | width: 100%; 15 | transform: translateY(-50%); 16 | 17 | .theme(color, '@circle-text-color'); 18 | 19 | background-color: inherit; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/col/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Row, Col } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 9 | 10 | span: 8 11 | 12 | 13 | span: 8 14 | 15 | 16 | span: 8 17 | 18 | 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/col/index.less: -------------------------------------------------------------------------------- 1 | .van-col { 2 | float: left; 3 | box-sizing: border-box; 4 | } 5 | 6 | .generate(24); 7 | .generate(@n, @i: 1) when (@i =< @n) { 8 | .van-col--@{i} { 9 | width: @i * (100% / 24); 10 | } 11 | .van-col--offset-@{i} { 12 | margin-left: @i * (100% / 24); 13 | } 14 | .generate(@n, (@i + 1)); 15 | } 16 | -------------------------------------------------------------------------------- /packages/vantui/src/collapse/index.less: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /packages/vantui/src/common/color.ts: -------------------------------------------------------------------------------- 1 | export const BLUE = '#1989fa' 2 | export const GREEN = '#07c160' 3 | export const GRAY_DARK = '#969799' 4 | -------------------------------------------------------------------------------- /packages/vantui/src/common/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | 4 | export default function Demo() { 5 | return ( 6 | <> 7 | {/** 上边框,可选各个方向 **/} 8 | 12 | 13 | {/** 全边框 **/} 14 | 18 | 全边框 19 | 20 | 21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /packages/vantui/src/config-provider/index.less: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /packages/vantui/src/count-down/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { CountDown } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value] = react.useState(30 * 60 * 60 * 1000) 7 | 8 | return 9 | } 10 | -------------------------------------------------------------------------------- /packages/vantui/src/count-down/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { CountDown } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value] = react.useState(30 * 60 * 60 * 1000) 7 | 8 | return 9 | } 10 | -------------------------------------------------------------------------------- /packages/vantui/src/count-down/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { CountDown } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value] = react.useState(30 * 60 * 60 * 1000) 7 | 8 | return 9 | } 10 | -------------------------------------------------------------------------------- /packages/vantui/src/count-down/index.less: -------------------------------------------------------------------------------- 1 | @import '../style/var.less'; 2 | 3 | .van-count-down { 4 | .theme(color, '@count-down-text-color'); 5 | .theme(font-size, '@count-down-font-size'); 6 | .theme(line-height, '@count-down-line-height'); 7 | } 8 | -------------------------------------------------------------------------------- /packages/vantui/src/count-up/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { CountUp } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return 6 | } 7 | -------------------------------------------------------------------------------- /packages/vantui/src/count-up/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { CountUp } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | ) 8 | } 9 | -------------------------------------------------------------------------------- /packages/vantui/src/count-up/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { CountUp } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return 6 | } 7 | -------------------------------------------------------------------------------- /packages/vantui/src/count-up/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { CountUp } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return 6 | } 7 | -------------------------------------------------------------------------------- /packages/vantui/src/count-up/index.less: -------------------------------------------------------------------------------- 1 | @import '../style/var.less'; 2 | 3 | .vant-count-up { 4 | display: inline-flex; 5 | text-align: center; 6 | .theme(color, '@count-up-text-color'); 7 | .theme(font-size, '@count-up-font-size'); 8 | .theme(line-height, '@count-up-line-height'); 9 | 10 | &__prefix, 11 | &__suffix, 12 | &__content { 13 | display: inline-block; 14 | vertical-align: middle; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/datetime-picker/index.less: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /packages/vantui/src/default-props/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { useDidHide } from '@tarojs/taro' 2 | import { DefaultProps, Empty } from '@antmjs/vantui' 3 | 4 | const originProps = DefaultProps.set({ 5 | Empty: { 6 | description: '空空如也~~', 7 | }, 8 | }) 9 | 10 | export default function Demo() { 11 | useDidHide(() => { 12 | DefaultProps.set(originProps) 13 | }) 14 | 15 | return 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/default-props/demo/set.tsx: -------------------------------------------------------------------------------- 1 | import { DefaultProps, Icon } from '@antmjs/vantui' 2 | 3 | DefaultProps.set({ 4 | Image: { 5 | renderError: , 6 | }, 7 | }) 8 | -------------------------------------------------------------------------------- /packages/vantui/src/default-props/index.ts: -------------------------------------------------------------------------------- 1 | import { IDefaultProps } from '../../types/index' 2 | 3 | let defaultProps: IDefaultProps = {} 4 | 5 | function set(props: IDefaultProps) { 6 | const backupProps = defaultProps 7 | defaultProps = { 8 | ...defaultProps, 9 | ...props, 10 | } 11 | 12 | return backupProps 13 | } 14 | 15 | function get() { 16 | return defaultProps 17 | } 18 | 19 | export { set, get } 20 | 21 | export default { set, get } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/divider/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Divider } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/divider/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Divider } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/divider/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Divider } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/divider/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Divider } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 文本 9 | 文本 10 | 文本 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /packages/vantui/src/divider/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Divider } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 9 | 文本颜色 10 | 11 | 12 | border 颜色 13 | 14 | 15 | 字体大小 16 | 17 | 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /packages/vantui/src/divider/demo/demo6.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { View } from '@tarojs/components' 3 | import { Divider } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | 12 | 文本 13 | 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/divider/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/style' 2 | import { addUnit } from '../wxs/add-unit' 3 | 4 | function rootStyle(data: any) { 5 | return style([ 6 | { 7 | 'border-color': data.borderColor, 8 | color: data.textColor, 9 | 'font-size': addUnit(data.fontSize), 10 | }, 11 | ]) 12 | } 13 | 14 | export { rootStyle } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/dropdown-menu/wxs.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | function displayTitle(item: any) { 3 | const match = (item.options || []).filter(function (option: any) { 4 | return option.value === item.value 5 | }) 6 | let displayTitle = match.length ? match[0].text : '' 7 | if ( 8 | displayTitle === null || 9 | displayTitle === undefined || 10 | displayTitle === '' 11 | ) { 12 | return item.title || '' 13 | } 14 | return displayTitle 15 | } 16 | 17 | export { displayTitle } 18 | -------------------------------------------------------------------------------- /packages/vantui/src/ellipsis/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { Ellipsis } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | 整个组件库是依赖开源项目 Vant Weapp 8 | 的代码经过全量编译而来,所有样式文件及代码结构都与其保持高度一致,只是生命周期经过改造使其支持 9 | React,很大程度避免了重新造轮子带来的各种问题,同时保留了 Vant Weapp 10 | 多年积累的经验 收到了一些反馈,这里说明一下吧。关于 demo 11 | 的质量和文档现在确实是有一些不足的地方的,因为做这件事的人并不多暂时,我们把更多的精力放在了组件本身,确保大家在实际的应用中能够更少的被中断。目前除了 12 | 50 多个组件要维护,还有 Taro Demo 和 React Demo 13 | 和文档,同时公司也有业务要跟进,所以希望大家能够体谅,当然非常欢迎有兴趣的人一起来完善它! 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/ellipsis/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Ellipsis } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 整个组件库是依赖开源项目 Vant Weapp 7 | 的代码经过全量编译而来,所有样式文件及代码结构都与其保持高度一致,只是生命周期经过改造使其支持 8 | React,很大程度避免了重新造轮子带来的各种问题,同时保留了 Vant Weapp 9 | 多年积累的经验 收到了一些反馈,这里说明一下吧。关于 demo 10 | 的质量和文档现在确实是有一些不足的地方的,因为做这件事的人并不多暂时,我们把更多的精力放在了组件本身,确保大家在实际的应用中能够更少的被中断。目前除了 11 | 50 多个组件要维护,还有 Taro Demo 和 React Demo 12 | 和文档,同时公司也有业务要跟进,所以希望大家能够体谅,当然非常欢迎有兴趣的人一起来完善它! 13 | 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /packages/vantui/src/empty/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Empty } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | 8 | 9 | ) 10 | } 11 | -------------------------------------------------------------------------------- /packages/vantui/src/empty/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Empty } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | {/* 通用错误 */} 8 | 9 | {/* 网络错误 */} 10 | 11 | {/* 搜索提示 */} 12 | 13 | 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /packages/vantui/src/empty/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Empty } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | 12 | 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/empty/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Empty, Button } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | 8 | 11 | 12 | 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/empty/wxs.ts: -------------------------------------------------------------------------------- 1 | const PRESETS = ['error', 'search', 'default', 'network'] 2 | 3 | function imageUrl(image: string) { 4 | if (PRESETS.indexOf(image) !== -1) { 5 | return 'https://img.yzcdn.cn/vant/empty-image-' + image + '.png' 6 | } 7 | 8 | return image 9 | } 10 | 11 | export { imageUrl } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/field/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { CellGroup, Field } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState() 7 | 8 | return ( 9 | 10 | setValue(e.detail)} 15 | /> 16 | 17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /packages/vantui/src/field/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { CellGroup, Toast, Field } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 14 | 21 | 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /packages/vantui/src/field/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { CellGroup, Field } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 13 | 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /packages/vantui/src/field/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import react from 'react' 2 | import { CellGroup, Field } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | const [state] = react.useState({ 6 | username: '', 7 | phone: '', 8 | }) 9 | return ( 10 | 11 | 17 | 24 | 25 | ) 26 | } 27 | -------------------------------------------------------------------------------- /packages/vantui/src/field/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | import { CellGroup, Field } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | ) 9 | } 10 | -------------------------------------------------------------------------------- /packages/vantui/src/field/demo/demo6.tsx: -------------------------------------------------------------------------------- 1 | import { CellGroup, Field } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 13 | 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /packages/vantui/src/field/demo/demo7.tsx: -------------------------------------------------------------------------------- 1 | import { CellGroup, Field, Button } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 14 | 发送验证码 15 | 16 | } 17 | /> 18 | 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /packages/vantui/src/field/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/style' 2 | import { addUnit } from '../wxs/add-unit' 3 | 4 | function inputStyle(autosize: any) { 5 | if (autosize && autosize.constructor.name === 'Object') { 6 | return style({ 7 | 'min-height': addUnit(autosize.minHeight), 8 | 'max-height': addUnit(autosize.maxHeight), 9 | }) 10 | } 11 | 12 | return '' 13 | } 14 | 15 | export { inputStyle } 16 | -------------------------------------------------------------------------------- /packages/vantui/src/form/core/formContext.ts: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react' 2 | import { IFormInstanceAPI } from '../../../types/form' 3 | 4 | const FormContext = createContext({} as IFormInstanceAPI) 5 | 6 | export default FormContext 7 | -------------------------------------------------------------------------------- /packages/vantui/src/goods-action/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { GoodsAction, GoodsActionIcon, GoodsActionButton } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /packages/vantui/src/goods-action/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { GoodsAction, GoodsActionIcon, GoodsActionButton } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/goods-action/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { GoodsAction, GoodsActionIcon, GoodsActionButton } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /packages/vantui/src/grid/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Grid, GridItem } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | {false && } 7 | 8 | 9 | 10 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/grid/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Grid, GridItem } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | ) 9 | } 10 | -------------------------------------------------------------------------------- /packages/vantui/src/grid/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { Grid, GridItem, Image } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | {[1, 2, 3].map((index) => ( 7 | 8 | 12 | 13 | ))} 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/grid/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { Grid, GridItem } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/grid/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | import { Grid, GridItem } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/grid/demo/demo6.tsx: -------------------------------------------------------------------------------- 1 | import { Grid, GridItem } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/grid/demo/demo7.tsx: -------------------------------------------------------------------------------- 1 | import { Grid, GridItem } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 12 | 18 | 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /packages/vantui/src/grid/demo/demo8.tsx: -------------------------------------------------------------------------------- 1 | import { Grid, GridItem } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | 9 | ) 10 | } 11 | -------------------------------------------------------------------------------- /packages/vantui/src/grid/index.less: -------------------------------------------------------------------------------- 1 | .van-grid { 2 | position: relative; 3 | box-sizing: border-box; 4 | overflow: hidden; 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/grid/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/style' 2 | import { addUnit } from '../wxs/add-unit' 3 | 4 | function rootStyle(data: any) { 5 | return style({ 6 | 'padding-left': addUnit(data.gutter), 7 | }) 8 | } 9 | 10 | export { rootStyle } 11 | -------------------------------------------------------------------------------- /packages/vantui/src/icon/index.less: -------------------------------------------------------------------------------- 1 | @import '../style/var.less'; 2 | @import '@vant/icons/src/index.less'; 3 | 4 | .van-icon { 5 | /* stylelint-disable-next-line */ 6 | font: normal normal normal 28px 'vant-icon'; 7 | display: inline-flex; 8 | justify-content: center; 9 | align-items: center; 10 | 11 | &--image { 12 | width: 1em; 13 | height: 1em; 14 | } 15 | 16 | &__image { 17 | width: 100%; 18 | height: 100%; 19 | } 20 | 21 | &__info { 22 | z-index: 1; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/vantui/src/image-viewer/index.tsx: -------------------------------------------------------------------------------- 1 | import { close, show } from './trigger' 2 | 3 | export const ImageViewer = { close, show } 4 | 5 | export default ImageViewer 6 | -------------------------------------------------------------------------------- /packages/vantui/src/image-viewer/node.tsx: -------------------------------------------------------------------------------- 1 | import { createExtraNode, ExtraNode } from '../wxs/extra-node' 2 | 3 | let extraNode: ExtraNode = {} 4 | 5 | if (!Object.keys(extraNode).length) { 6 | extraNode = createExtraNode() 7 | } 8 | 9 | export default extraNode 10 | -------------------------------------------------------------------------------- /packages/vantui/src/image-viewer/trigger.tsx: -------------------------------------------------------------------------------- 1 | import { ImageViewerProps } from '../../types/index' 2 | import extraNode from './node' 3 | import { ImageViewer } from './image-viewer' 4 | 5 | const { removeNode, renderNode } = extraNode 6 | 7 | export function show(props: ImageViewerProps) { 8 | renderNode?.() 9 | } 10 | 11 | export function close() { 12 | removeNode?.() 13 | } 14 | -------------------------------------------------------------------------------- /packages/vantui/src/image/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Image } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/image/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { Image } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/image/demo/demo6.tsx: -------------------------------------------------------------------------------- 1 | import { View, Text } from '@tarojs/components' 2 | import { Image } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | 加载失败} 12 | /> 13 | 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /packages/vantui/src/index-anchor/index.less: -------------------------------------------------------------------------------- 1 | @import '../style/var.less'; 2 | 3 | .van-index-anchor { 4 | .theme(padding, '@index-anchor-padding'); 5 | .theme(color, '@index-anchor-text-color'); 6 | .theme(font-weight, '@index-anchor-font-weight'); 7 | .theme(font-size, '@index-anchor-font-size'); 8 | .theme(line-height, '@index-anchor-line-height'); 9 | .theme(background-color, '@index-anchor-background-color'); 10 | 11 | &--active { 12 | right: 0; 13 | left: 0; 14 | .theme(color, '@index-anchor-active-text-color'); 15 | .theme(background-color, '@index-anchor-active-background-color'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/vantui/src/infinite-scroll/index.less: -------------------------------------------------------------------------------- 1 | @import '../style/var.less'; 2 | 3 | .van-infinite-scroll { 4 | display: flex; 5 | align-items: center; 6 | justify-content: center; 7 | 8 | &-loading, 9 | &-complete, 10 | &-error { 11 | .theme(color, '@infinite-scroll-color'); 12 | 13 | .theme(font-size, '@infinite-scroll-font-size'); 14 | 15 | line-height: 40px; 16 | padding: 24px 0; 17 | } 18 | 19 | &-error { 20 | .reload-btn { 21 | padding-left: 8px; 22 | 23 | .theme(color, '@infinite-scroll-primary-color'); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/vantui/src/infinite-scroll/index.tsx: -------------------------------------------------------------------------------- 1 | import { InfiniteScroll } from './infinite-scroll' 2 | 3 | export { InfiniteScroll } 4 | 5 | export default InfiniteScroll 6 | -------------------------------------------------------------------------------- /packages/vantui/src/init/index.less: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /packages/vantui/src/loading/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Loading } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | <> 6 | 7 | 8 | 9 | ) 10 | } 11 | -------------------------------------------------------------------------------- /packages/vantui/src/loading/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Loading } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | <> 6 | 7 | 8 | 9 | ) 10 | } 11 | -------------------------------------------------------------------------------- /packages/vantui/src/loading/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { Loading } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 加载中... 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/loading/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { Loading } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 加载中... 7 | 8 | ) 9 | } 10 | -------------------------------------------------------------------------------- /packages/vantui/src/loading/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/utils' 2 | import { addUnit } from '../wxs/add-unit' 3 | 4 | function spinnerStyle(data: any) { 5 | return style({ 6 | color: data.color, 7 | width: addUnit(data.size), 8 | height: addUnit(data.size), 9 | }) 10 | } 11 | 12 | function textStyle(data: any) { 13 | return style({ 14 | 'font-size': addUnit(data.textSize), 15 | }) 16 | } 17 | 18 | export { spinnerStyle, textStyle } 19 | -------------------------------------------------------------------------------- /packages/vantui/src/mini-login-button/index.less: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /packages/vantui/src/mini-nav-bar/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/style' 2 | 3 | function barStyle(data: any) { 4 | const newData: any = { 5 | 'padding-top': data.safeAreaInsetTop ? data.statusBarHeight + 'px' : 0, 6 | height: data.height + 'px', 7 | } 8 | if (data.zIndex) { 9 | newData['z-index'] = data.zIndex 10 | } 11 | return style(newData) 12 | } 13 | 14 | export { barStyle } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/mini-phone-button/index.less: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /packages/vantui/src/mini-user-button/index.less: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /packages/vantui/src/nav-bar/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { NavBar, Toast, Notify, Dialog } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | Toast.show({ message: '点击按钮 返回' })} 13 | onClickRight={() => Toast.show({ message: '点击按钮 right' })} 14 | /> 15 | 16 | 17 | 18 | 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /packages/vantui/src/nav-bar/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { NavBar, Icon } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | } 13 | /> 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/nav-bar/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/style' 2 | 3 | function barStyle(data: any) { 4 | const newData: any = { 5 | 'padding-top': data.safeAreaInsetTop ? data.statusBarHeight + 'px' : 0, 6 | height: data.height + 'px', 7 | } 8 | if (data.zIndex) { 9 | newData['z-index'] = data.zIndex 10 | } 11 | return style(newData) 12 | } 13 | 14 | export { barStyle } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/notice-bar/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { NoticeBar } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 9 | ) 10 | } 11 | -------------------------------------------------------------------------------- /packages/vantui/src/notice-bar/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { NoticeBar } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | {/* 文字较短时,通过设置 scrollable 属性开启滚动播放 */} 8 | 9 | {/* 文字较长时,通过禁用 scrollable 属性关闭滚动播放 */} 10 | 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/notice-bar/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { NoticeBar } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/notice-bar/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { NoticeBar } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | {/* closeable 模式,在右侧显示关闭按钮 */} 8 | 9 | {/* link 模式,在右侧显示链接箭头 */} 10 | 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /packages/vantui/src/notice-bar/demo/demo6.tsx: -------------------------------------------------------------------------------- 1 | import { NoticeBar } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/notice-bar/demo/demo7.tsx: -------------------------------------------------------------------------------- 1 | import { NoticeBar } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 9 | ) 10 | } 11 | -------------------------------------------------------------------------------- /packages/vantui/src/notice-bar/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/style' 2 | 3 | function rootStyle(data: any) { 4 | return style({ 5 | color: data.color, 6 | 'background-color': data.backgroundColor, 7 | background: data.background, 8 | }) 9 | } 10 | 11 | export { rootStyle } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/notify/create-only-notify.tsx: -------------------------------------------------------------------------------- 1 | export function createOnlyNotify(Notify) { 2 | return Notify 3 | } 4 | -------------------------------------------------------------------------------- /packages/vantui/src/notify/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Button, Notify } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | const show = () => { 6 | Notify.show({ 7 | message: '自定义颜色', 8 | color: '#ad0000', 9 | background: '#ffe1e1', 10 | duration: 10000, 11 | }) 12 | } 13 | 14 | return ( 15 | 16 | 19 | 20 | 21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /packages/vantui/src/notify/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Button, Notify } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | const show = () => { 6 | Notify.show({ 7 | message: '自定义节点选择器', 8 | duration: 1000, 9 | selector: '#customSelector', 10 | }) 11 | } 12 | 13 | return ( 14 | 15 | 18 | 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/notify/index.tsx: -------------------------------------------------------------------------------- 1 | import { NotifyProps } from '../../types/notify' 2 | import { createOnlyNotify } from './create-only-notify' 3 | import { show, hide } from './node' 4 | 5 | // @ts-ignore 6 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 7 | function Notify(props: NotifyProps) { 8 | return <> 9 | } 10 | 11 | Notify.show = show 12 | Notify.clear = hide 13 | Notify.createOnlyNotify = () => createOnlyNotify(Notify) 14 | 15 | export { Notify } 16 | 17 | export default Notify 18 | -------------------------------------------------------------------------------- /packages/vantui/src/notify/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/utils' 2 | import { addUnit } from '../wxs/add-unit' 3 | 4 | function rootStyle(data: any) { 5 | return style({ 6 | 'z-index': data.zIndex, 7 | top: addUnit(data.top), 8 | }) 9 | } 10 | 11 | function notifyStyle(data: any) { 12 | return style({ 13 | background: data.background, 14 | color: data.color, 15 | }) 16 | } 17 | 18 | export { rootStyle, notifyStyle } 19 | -------------------------------------------------------------------------------- /packages/vantui/src/overlay/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { View } from '@tarojs/components' 4 | import { Button, Overlay } from '@antmjs/vantui' 5 | 6 | export default function Demo() { 7 | const [show, setShow] = react.useState(false) 8 | return ( 9 | 10 | 13 | setShow(false)} /> 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/overlay/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { View } from '@tarojs/components' 4 | import { Button, Overlay } from '@antmjs/vantui' 5 | 6 | export default function Demo() { 7 | const [show, setShow] = react.useState(false) 8 | return ( 9 | 10 | 13 | setShow(false)}> 14 | 15 | 16 | 17 | 18 | 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /packages/vantui/src/overlay/index.less: -------------------------------------------------------------------------------- 1 | @import '../style/var.less'; 2 | 3 | .van-overlay { 4 | position: fixed; 5 | top: 0; 6 | left: 0; 7 | width: 100%; 8 | height: 100%; 9 | display: flex; 10 | align-items: center; 11 | justify-content: center; 12 | 13 | .theme(z-index, '@overlay-z-index'); 14 | 15 | .theme(background-color, '@overlay-background-color'); 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/pagination/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Pagination } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [currentPage1, setCurrentPage1] = react.useState(1) 7 | const pageChange1 = (v) => { 8 | const c = v 9 | setCurrentPage1(c) 10 | } 11 | return ( 12 | 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /packages/vantui/src/pagination/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Pagination } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [currentPage2, setCurrentPage2] = react.useState(1) 7 | const pageChange2 = (v) => { 8 | const c = v 9 | setCurrentPage2(c) 10 | } 11 | 12 | return ( 13 | 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /packages/vantui/src/pagination/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Pagination } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [currentPage3, setCurrentPage3] = react.useState(1) 7 | const pageChange3 = (v) => { 8 | const c = v 9 | setCurrentPage3(c) 10 | } 11 | 12 | return ( 13 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/picker-column/index.less: -------------------------------------------------------------------------------- 1 | @import '../style/var.less'; 2 | 3 | .van-picker-column { 4 | overflow: hidden; 5 | text-align: center; 6 | position: relative; 7 | .theme(color, '@picker-option-text-color'); 8 | .theme(font-size, '@picker-option-font-size'); 9 | 10 | &__item { 11 | padding: 0 10px; 12 | 13 | &--selected { 14 | .theme(font-weight, '@font-weight-bold'); 15 | .theme(color, '@picker-option-selected-text-color'); 16 | } 17 | 18 | &--disabled { 19 | .theme(opacity, '@picker-option-disabled-opacity'); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/vantui/src/picker/demo/data.ts: -------------------------------------------------------------------------------- 1 | export const data = [ 2 | { 3 | id: 11, 4 | text: '开始', 5 | }, 6 | { 7 | id: 22, 8 | text: '进行中', 9 | }, 10 | { 11 | id: 33, 12 | text: '结束', 13 | }, 14 | ] 15 | -------------------------------------------------------------------------------- /packages/vantui/src/picker/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Picker, PickerProps } from '@antmjs/vantui' 2 | import { useState } from 'react' 3 | 4 | const columns = ['杭州', '宁波', '温州', '嘉兴', '湖州'] 5 | export default function Demo() { 6 | const [value, setValue] = useState('杭州') 7 | return ( 8 | { 11 | setValue(e.detail) 12 | }} 13 | mode="content" 14 | columns={columns} 15 | /> 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /packages/vantui/src/picker/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Picker, PickerProps } from '@antmjs/vantui' 2 | import { useState } from 'react' 3 | import { data } from './data' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = useState(22) 7 | return ( 8 | { 11 | console.info(e.detail, '~~~~~~~~~') 12 | setValue(e.detail) 13 | }} 14 | mode="content" 15 | idKey="id" 16 | valueKey="text" 17 | columns={data} 18 | /> 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /packages/vantui/src/picker/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { Picker } from '@antmjs/vantui' 2 | 3 | const columns = ['杭州', '宁波', '温州', '嘉兴', '湖州'] 4 | export default function Demo() { 5 | return ( 6 | 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/popup/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { View } from '@tarojs/components' 4 | import { Cell, Popup } from '@antmjs/vantui' 5 | 6 | export default function Demo() { 7 | const [show, setShow] = react.useState(false) 8 | return ( 9 | 10 | setShow(true)} /> 11 | setShow(false)}> 12 | 内容 13 | 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/popup/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { View } from '@tarojs/components' 4 | import { Cell, Popup } from '@antmjs/vantui' 5 | 6 | export default function Demo() { 7 | const [show, setShow] = react.useState(false) 8 | return ( 9 | 10 | setShow(true)} /> 11 | setShow(false)} 16 | closeIconPosition="top-right" 17 | > 18 | 内容 19 | 20 | 21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /packages/vantui/src/popup/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { View } from '@tarojs/components' 4 | import { Cell, Popup } from '@antmjs/vantui' 5 | 6 | export default function Demo() { 7 | const [show, setShow] = react.useState(false) 8 | return ( 9 | 10 | setShow(true)} /> 11 | setShow(false)}> 12 | 内容 13 | 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/popup/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { View } from '@tarojs/components' 4 | import { Cell, Popup } from '@antmjs/vantui' 5 | 6 | export default function Demo() { 7 | const [show, setShow] = react.useState(false) 8 | 9 | return ( 10 | 11 | setShow(true)} /> 12 | setShow(false)}> 13 | 14 | 内容 15 | 16 | 17 | 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /packages/vantui/src/popup/wxs.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import * as utils from '../wxs/utils' 3 | 4 | function popupStyle(data: any) { 5 | return utils.style([ 6 | { 7 | 'z-index': data.zIndex, 8 | '-webkit-transition-duration': data.currentDuration + 'ms', 9 | 'transition-duration': data.currentDuration + 'ms', 10 | }, 11 | data.display ? null : 'display: none', 12 | ]) 13 | } 14 | export { popupStyle } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/progress/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Progress } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/progress/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Progress } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/progress/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { Progress } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/progress/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Progress } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | 8 | 9 | 15 | 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /packages/vantui/src/pull-to-refresh/index.less: -------------------------------------------------------------------------------- 1 | @import '../style/var.less'; 2 | 3 | .van-pull-to-refresh { 4 | &-status { 5 | color: #969799; 6 | 7 | .theme(font-size, '@pull-to-refresh-font-size'); 8 | 9 | overflow: hidden; 10 | transition: all @pull-to-refresh-animation-duration; 11 | display: flex; 12 | align-items: center; 13 | justify-content: center; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/vantui/src/pull-to-refresh/index.tsx: -------------------------------------------------------------------------------- 1 | import PullToRefresh from './pull-to-refresh' 2 | 3 | export default PullToRefresh 4 | 5 | export { PullToRefresh } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/px-transform/index.less: -------------------------------------------------------------------------------- 1 | // empty 2 | -------------------------------------------------------------------------------- /packages/vantui/src/px-transform/index.ts: -------------------------------------------------------------------------------- 1 | import { pxTransform as TaroPxTransform } from '@tarojs/taro' 2 | 3 | export function pxTransform(size: number, designWidth?: number | undefined) { 4 | return TaroPxTransform(size, designWidth) 5 | } 6 | export default TaroPxTransform 7 | -------------------------------------------------------------------------------- /packages/vantui/src/radio-group/context.ts: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react' 2 | import { RadioGroupProps } from '../../types/radio' 3 | 4 | const RadioGroupContext = createContext({}) 5 | 6 | export default RadioGroupContext 7 | -------------------------------------------------------------------------------- /packages/vantui/src/radio-group/index.less: -------------------------------------------------------------------------------- 1 | .van-radio-group { 2 | &--horizontal { 3 | display: flex; 4 | flex-wrap: wrap; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/vantui/src/radio/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { RadioGroup, Radio } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState('1') 7 | return ( 8 | setValue(e.detail)}> 9 | 单选框 1 10 | 单选框 2 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /packages/vantui/src/radio/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { RadioGroup, Radio } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState('1') 7 | return ( 8 | setValue(e.detail)} 12 | > 13 | 单选框 1 14 | 单选框 2 15 | 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /packages/vantui/src/radio/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { RadioGroup, Radio } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState('1') 7 | return ( 8 | setValue(e.detail)}> 9 | 单选框 1 10 | 单选框 2 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /packages/vantui/src/radio/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { RadioGroup, Radio } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState('1') 7 | return ( 8 | setValue(e.detail)}> 9 | 10 | 单选框 1 11 | 12 | 13 | 单选框 2 14 | 15 | 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /packages/vantui/src/radio/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { RadioGroup, Radio } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState('1') 7 | return ( 8 | setValue(e.detail)}> 9 | 10 | 单选框 1 11 | 12 | 13 | 单选框 2 14 | 15 | 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /packages/vantui/src/radio/demo/demo6.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { RadioGroup, Radio } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState('1') 7 | return ( 8 | setValue(e.detail)}> 9 | 10 | 单选框 1 11 | 12 | 13 | 单选框 2 14 | 15 | 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /packages/vantui/src/radio/demo/demo8.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { RadioGroup, Radio } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState('1') 7 | return ( 8 | setValue(e.detail)} 12 | > 13 | 14 | 单选框 1 15 | 16 | 17 | 单选框 2 18 | 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/radio/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/style' 2 | import { addUnit } from '../wxs/add-unit' 3 | 4 | function iconStyle(data: any) { 5 | const styles: any = { 6 | 'font-size': addUnit(data.iconSize), 7 | } 8 | 9 | if ( 10 | data.checkedColor && 11 | !(data.disabled || data.parentDisabled) && 12 | data.value === data.name 13 | ) { 14 | styles['border-color'] = data.checkedColor 15 | styles['background-color'] = data.checkedColor 16 | } 17 | 18 | return style(styles) 19 | } 20 | 21 | export { iconStyle } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/rate/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Rate } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState(3.5) 7 | 8 | return setValue(e.detail)} allowHalf /> 9 | } 10 | -------------------------------------------------------------------------------- /packages/vantui/src/rate/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Rate } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState(4) 7 | 8 | return ( 9 | setValue(e.detail)} 14 | /> 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/rate/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Rate } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState(4) 7 | 8 | return ( 9 | setValue(e.detail)} 16 | /> 17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /packages/vantui/src/rate/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Rate } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState(4.5) 7 | 8 | return ( 9 | setValue(e.detail)} 15 | /> 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /packages/vantui/src/rate/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Rate } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState(3) 7 | 8 | return setValue(e.detail)} /> 9 | } 10 | -------------------------------------------------------------------------------- /packages/vantui/src/rate/demo/demo6.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Rate } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState(3) 7 | 8 | return setValue(e.detail)} /> 9 | } 10 | -------------------------------------------------------------------------------- /packages/vantui/src/rate/demo/demo7.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Rate } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value] = react.useState(3) 7 | 8 | return 9 | } 10 | -------------------------------------------------------------------------------- /packages/vantui/src/result/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { Result } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/result/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { Result } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/result/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { Result } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/result/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { Result } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/result/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { Result } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/root-portal/index.tsx: -------------------------------------------------------------------------------- 1 | import { useRouter } from '@tarojs/taro' 2 | import { createPortal } from '@tarojs/react' 3 | import { useLayoutEffect, useState } from 'react' 4 | 5 | const RootPortal = ({ children, enable = false }) => { 6 | const router = useRouter() 7 | const [dom, setDom] = useState() 8 | 9 | useLayoutEffect(() => { 10 | // @ts-ignore 11 | const _dom = document.getElementById(router.$taroPath) 12 | _dom && setDom(_dom) 13 | // @ts-ignore 14 | }, [router.$taroPath]) 15 | 16 | return enable && dom ? createPortal(children, dom) : children 17 | } 18 | 19 | export default RootPortal 20 | -------------------------------------------------------------------------------- /packages/vantui/src/row/index.less: -------------------------------------------------------------------------------- 1 | .van-row { 2 | &::after { 3 | display: table; 4 | clear: both; 5 | content: ''; 6 | } 7 | } 8 | 9 | .van-row-wrapper { 10 | overflow: hidden; 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/search/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Search } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/search/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Search, Toast } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | const onSearch = (e) => { 5 | Toast.show(`search: ${e.detail}`) 6 | } 7 | const onCancel = () => { 8 | Toast.show(`onCancel`) 9 | } 10 | return ( 11 | <> 12 | 18 | 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/search/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { Search } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/search/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { Search } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/search/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | import { Search } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | ) 7 | } 8 | -------------------------------------------------------------------------------- /packages/vantui/src/sidebar/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Sidebar, SidebarItem } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/sidebar/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Sidebar, SidebarItem } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/sidebar/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { Sidebar, SidebarItem } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/sidebar/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { Sidebar, SidebarItem, Notify } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | <> 6 | 9 | Notify.show({ 10 | type: 'primary', 11 | message: e.detail, 12 | }) 13 | } 14 | > 15 | 16 | 17 | 18 | 19 | 20 | 21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /packages/vantui/src/sidebar/index.less: -------------------------------------------------------------------------------- 1 | @import '../style/var.less'; 2 | 3 | .van-sidebar { 4 | .theme(width, '@sidebar-width'); 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/skeleton/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Skeleton } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/skeleton/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Skeleton } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/skeleton/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { View } from '@tarojs/components' 4 | import { Skeleton } from '@antmjs/vantui' 5 | 6 | export default function Demo() { 7 | const [loading, setLoading] = react.useState(true) 8 | react.useEffect(() => { 9 | setTimeout(() => { 10 | setLoading(false) 11 | }, 2000) 12 | }, []) 13 | 14 | return ( 15 | 16 | 实际内容 17 | 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /packages/vantui/src/sku/utils.ts: -------------------------------------------------------------------------------- 1 | export function everyItemEqual(a: number[], b: number[]) { 2 | let equalLength = 0 3 | for (let i = 0; i < a.length; i++) { 4 | const itema = a[i] 5 | if (itema && b.includes(itema)) equalLength++ 6 | } 7 | 8 | return equalLength === b.length 9 | } 10 | -------------------------------------------------------------------------------- /packages/vantui/src/slider/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Slider } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/slider/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Slider } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/slider/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { Slider } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/slider/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { Slider } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/slider/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | import { Slider } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/slider/demo/demo6.tsx: -------------------------------------------------------------------------------- 1 | import { Slider } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/slider/demo/demo7.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { View } from '@tarojs/components' 4 | import { Slider } from '@antmjs/vantui' 5 | 6 | export default function Demo() { 7 | const [value, setValue] = react.useState(50) 8 | return ( 9 | { 12 | setValue(e.detail.value) 13 | }} 14 | onChange={(e) => { 15 | setValue(e.detail) 16 | }} 17 | renderButton={{value}/100} 18 | /> 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /packages/vantui/src/slider/demo/demo8.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Slider } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | 8 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/space/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Button, Space } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/space/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Button, Space } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/space/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { Button, Space } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/space/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { Button, Space } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 10 | 13 | 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /packages/vantui/src/space/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | import { Button, Space } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 7 | 10 | 13 | 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /packages/vantui/src/stepper/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Stepper } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/stepper/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Stepper } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/stepper/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { Stepper } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/stepper/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { Stepper } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/stepper/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | import { Stepper } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/stepper/demo/demo6.tsx: -------------------------------------------------------------------------------- 1 | import { Stepper } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/stepper/demo/demo7.tsx: -------------------------------------------------------------------------------- 1 | import { Stepper } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/stepper/demo/demo8.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Stepper, Toast } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState() 7 | function onChange(value) { 8 | Toast.loading({ 9 | forbidClick: true, 10 | }) 11 | setTimeout(() => { 12 | Toast.clear() 13 | setValue(value.detail) 14 | }, 1000) 15 | } 16 | 17 | return ( 18 | <> 19 | 20 | 21 | 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /packages/vantui/src/stepper/demo/demo9.tsx: -------------------------------------------------------------------------------- 1 | import { Stepper } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/stepper/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/style' 2 | import { addUnit } from '../wxs/add-unit' 3 | 4 | function buttonStyle(data: any) { 5 | return style({ 6 | width: addUnit(data.buttonSize), 7 | height: addUnit(data.buttonSize), 8 | }) 9 | } 10 | 11 | function inputStyle(data: any) { 12 | return style({ 13 | width: addUnit(data.inputWidth), 14 | height: addUnit(data.buttonSize), 15 | }) 16 | } 17 | 18 | export { inputStyle, buttonStyle } 19 | -------------------------------------------------------------------------------- /packages/vantui/src/steps/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Steps } from '@antmjs/vantui' 2 | 3 | const steps = [ 4 | { 5 | text: '步骤一', 6 | desc: '描述信息', 7 | }, 8 | { 9 | text: '步骤二', 10 | desc: '描述信息', 11 | }, 12 | { 13 | text: '步骤三', 14 | desc: '描述信息', 15 | }, 16 | { 17 | text: '步骤四', 18 | desc: '描述信息', 19 | }, 20 | ] 21 | export default function Demo() { 22 | return 23 | } 24 | -------------------------------------------------------------------------------- /packages/vantui/src/steps/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Steps } from '@antmjs/vantui' 2 | 3 | const steps = [ 4 | { 5 | text: '步骤一', 6 | desc: '描述信息', 7 | }, 8 | { 9 | text: '步骤二', 10 | desc: '描述信息', 11 | }, 12 | { 13 | text: '步骤三', 14 | desc: '描述信息', 15 | }, 16 | { 17 | text: '步骤四', 18 | desc: '描述信息', 19 | }, 20 | ] 21 | export default function Demo() { 22 | return ( 23 | 24 | ) 25 | } 26 | -------------------------------------------------------------------------------- /packages/vantui/src/steps/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { Steps } from '@antmjs/vantui' 2 | 3 | const steps = [ 4 | { 5 | text: '步骤一', 6 | desc: '描述信息', 7 | inactiveIcon: 'location-o', 8 | activeIcon: 'success', 9 | }, 10 | { 11 | text: '步骤二', 12 | desc: '描述信息', 13 | inactiveIcon: 'like-o', 14 | activeIcon: 'plus', 15 | }, 16 | { 17 | text: '步骤三', 18 | desc: '描述信息', 19 | inactiveIcon: 'star-o', 20 | activeIcon: 'cross', 21 | }, 22 | ] 23 | export default function Demo() { 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /packages/vantui/src/steps/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { Steps } from '@antmjs/vantui' 2 | 3 | const steps = [ 4 | { 5 | text: '步骤一', 6 | desc: '描述信息', 7 | }, 8 | { 9 | text: '步骤二', 10 | desc: '描述信息', 11 | }, 12 | { 13 | text: '步骤三', 14 | desc: '描述信息', 15 | }, 16 | ] 17 | export default function Demo() { 18 | return ( 19 | 25 | ) 26 | } 27 | -------------------------------------------------------------------------------- /packages/vantui/src/sticky/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { Sticky, Button } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/sticky/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Sticky, Button } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/sticky/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { createSelectorQuery } from '@tarojs/taro' 3 | import { Sticky, Button } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | return ( 7 | 8 | createSelectorQuery().select(`#stick-in-view`)}> 9 | 12 | 13 | 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /packages/vantui/src/sticky/index.less: -------------------------------------------------------------------------------- 1 | /* stylelint-disable no-descending-specificity */ 2 | @import '../style/var.less'; 3 | 4 | .van-sticky { 5 | position: relative; 6 | 7 | &-wrap { 8 | &--fixed { 9 | position: fixed; 10 | right: 0; 11 | left: 0; 12 | 13 | .theme(z-index, '@sticky-z-index'); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/sticky/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/style' 2 | // import { addUnit } from '../wxs/add-unit' 3 | 4 | function wrapStyle(data: any) { 5 | return style({ 6 | transform: data.transform 7 | ? 'translate3d(0, ' + data.transform + 'px, 0)' 8 | : '', 9 | top: data.fixed ? data.offsetTop + 'px' : '', 10 | 'z-index': data.zIndex, 11 | }) 12 | } 13 | 14 | function containerStyle(data: any) { 15 | return style({ 16 | height: data.fixed ? data.height + 'px' : '', 17 | 'z-index': data.zIndex, 18 | }) 19 | } 20 | 21 | export { wrapStyle, containerStyle } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/style/base.less: -------------------------------------------------------------------------------- 1 | /* stylelint-disable selector-type-no-unknown, selector-max-type */ 2 | 3 | /** 4 | * Entry of basic styles 5 | */ 6 | 7 | @import './var.less'; 8 | @import './ellipsis.less'; 9 | @import './clearfix.less'; 10 | @import './hairline.less'; 11 | 12 | html, 13 | body, 14 | page { 15 | font-size: 28px; 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/style/clearfix.less: -------------------------------------------------------------------------------- 1 | @import './mixins/clearfix.less'; 2 | 3 | .van-clearfix { 4 | .clearfix(); 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/style/ellipsis.less: -------------------------------------------------------------------------------- 1 | @import './mixins/ellipsis.less'; 2 | 3 | .van-ellipsis { 4 | .ellipsis(); 5 | } 6 | 7 | .van-multi-ellipsis--l2 { 8 | .multi-ellipsis(2); 9 | } 10 | 11 | .van-multi-ellipsis--l3 { 12 | .multi-ellipsis(3); 13 | } 14 | -------------------------------------------------------------------------------- /packages/vantui/src/style/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | .clearfix() { 2 | &::after { 3 | display: table; 4 | clear: both; 5 | content: ''; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/vantui/src/style/mixins/ellipsis.less: -------------------------------------------------------------------------------- 1 | .multi-ellipsis(@lines) { 2 | /* stylelint-disable-next-line value-no-vendor-prefix */ 3 | display: -webkit-box; 4 | overflow: hidden; 5 | text-overflow: ellipsis; 6 | -webkit-line-clamp: @lines; 7 | 8 | /* autoprefixer: ignore next */ 9 | -webkit-box-orient: vertical; 10 | } 11 | 12 | .ellipsis() { 13 | overflow: hidden; 14 | white-space: nowrap; 15 | text-overflow: ellipsis; 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/submit-bar/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { SubmitBar } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | console.info('提交')} 9 | /> 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/submit-bar/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { SubmitBar } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | console.info('提交')} 12 | /> 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/submit-bar/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { SubmitBar } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | console.info('提交')} 10 | /> 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/submit-bar/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { View, Text } from '@tarojs/components' 2 | import { SubmitBar, Tag } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 12 | 您的收货地址不支持同城送, 13 | 修改地址 14 | 15 | } 16 | > 17 | 标签 18 | 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /packages/vantui/src/swipe-cell/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { SwipeCell, Button, CellGroup, Cell } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 选择} 9 | renderRight={} 10 | > 11 | 12 | 13 | 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/swipe-cell/index.less: -------------------------------------------------------------------------------- 1 | .van-swipe-cell { 2 | position: relative; 3 | overflow: hidden; 4 | 5 | &__left, 6 | &__right { 7 | position: absolute; 8 | top: 0; 9 | height: 100%; 10 | } 11 | 12 | &__left { 13 | left: 0; 14 | transform: translate3d(-100%, 0, 0); 15 | } 16 | 17 | &__right { 18 | right: 0; 19 | transform: translate3d(100%, 0, 0); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/swiper-item/index.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { useState } from 'react' 3 | import { SwiperItemProps } from '../../types/swiper' 4 | import { get } from '../default-props' 5 | 6 | export const SwiperItem = (props: SwiperItemProps) => { 7 | const [d] = useState(get().InfiniteScroll) 8 | const { children, className, ...others } = { 9 | ...d, 10 | ...props, 11 | } 12 | 13 | return ( 14 | 15 | {children} 16 | 17 | ) 18 | } 19 | 20 | export default SwiperItem 21 | -------------------------------------------------------------------------------- /packages/vantui/src/swiper/context.ts: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react' 2 | 3 | export const DataContext = createContext({}) 4 | -------------------------------------------------------------------------------- /packages/vantui/src/swiper/demo/common.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export const images = [ 3 | 'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg', 4 | 'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg', 5 | 'https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg', 6 | 'https://fastly.jsdelivr.net/npm/@vant/assets/apple-4.jpeg', 7 | ] 8 | -------------------------------------------------------------------------------- /packages/vantui/src/swiper/index.tsx: -------------------------------------------------------------------------------- 1 | import Swiper from './swiper' 2 | 3 | export { Swiper } 4 | 5 | export default Swiper 6 | -------------------------------------------------------------------------------- /packages/vantui/src/swiper/utils.ts: -------------------------------------------------------------------------------- 1 | const DISTANCE = 5 2 | export const getDirection = (x: number, y: number) => { 3 | if (x > y && x > DISTANCE) return 'horizontal' 4 | if (y > x && y > DISTANCE) return 'vertical' 5 | return '' 6 | } 7 | -------------------------------------------------------------------------------- /packages/vantui/src/switch/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Switch } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState(false) 7 | return setValue(e.detail)} /> 8 | } 9 | -------------------------------------------------------------------------------- /packages/vantui/src/switch/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Switch } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/switch/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { Switch } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/switch/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Switch } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState(false) 7 | return ( 8 | setValue(e.detail)} /> 9 | ) 10 | } 11 | -------------------------------------------------------------------------------- /packages/vantui/src/switch/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import react from 'react' 3 | import { Switch } from '@antmjs/vantui' 4 | 5 | export default function Demo() { 6 | const [value, setValue] = react.useState(false) 7 | return ( 8 | setValue(e.detail)} 13 | /> 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /packages/vantui/src/tab/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { Tabs, Tab, Toast } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 8 | Toast.show({ 9 | message: e.detail.name, 10 | selector: '#tabs-demo1', 11 | }) 12 | } 13 | > 14 | 内容 1 15 | 内容 2 16 | 内容 3 17 | 内容 4 18 | 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/tab/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { Tabs, Tab, Toast } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 8 | Toast.show({ 9 | message: e.detail.name, 10 | selector: '#tabs-demo2', 11 | }) 12 | } 13 | > 14 | 15 | 内容 a 16 | 17 | 18 | 内容 b 19 | 20 | 21 | 内容 c 22 | 23 | 24 | 25 | ) 26 | } 27 | -------------------------------------------------------------------------------- /packages/vantui/src/tab/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { Tabs, Tab } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 内容 1 7 | 内容 2 8 | 内容 3 9 | 内容 4 10 | 内容 5 11 | 内容 6 12 | 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/tab/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | import { Tabs, Tab, Toast } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 7 | Toast.show({ 8 | message: e.detail.title + '已被禁', 9 | selector: '#tabs-demo4', 10 | }) 11 | } 12 | > 13 | 内容 1 14 | 15 | 内容 2 16 | 17 | 内容 3 18 | 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/tab/demo/demo6.tsx: -------------------------------------------------------------------------------- 1 | import { Tabs, Tab } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 内容 1 7 | 内容 2 8 | 内容 3 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/tab/demo/demo7.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Tabs, Tab, Toast } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | const onClick = (e) => { 6 | Toast.show({ 7 | message: e.detail.title, 8 | selector: '#tab-demo6', 9 | }) 10 | } 11 | 12 | return ( 13 | 14 | 15 | 内容 1 16 | 内容 2 17 | 18 | 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/tab/demo/demo8.tsx: -------------------------------------------------------------------------------- 1 | import { Tabs, Tab } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 内容 1 7 | 内容 2 8 | 内容 3 9 | 内容 4 10 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/tab/demo/demo9.tsx: -------------------------------------------------------------------------------- 1 | import { Tabs, Tab } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | 内容 1 7 | 内容 2 8 | 内容 3 9 | 内容 4 10 | 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/tab/index.less: -------------------------------------------------------------------------------- 1 | .van-tab__pane { 2 | box-sizing: border-box; 3 | overflow-y: auto; 4 | -webkit-overflow-scrolling: touch; 5 | flex-shrink: 0; 6 | width: 100%; 7 | 8 | &--active { 9 | height: auto; 10 | } 11 | 12 | &--inactive { 13 | height: 0; 14 | overflow: visible; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/tabbar/index.less: -------------------------------------------------------------------------------- 1 | @import '../style/var.less'; 2 | 3 | .van-tabbar { 4 | display: flex; 5 | box-sizing: content-box; 6 | width: 100%; 7 | 8 | .theme(z-index, '@tabbar-z-index'); 9 | 10 | .theme(height, '@tabbar-height'); 11 | .theme(background-color, '@tabbar-background-color'); 12 | 13 | &--fixed { 14 | position: fixed !important; 15 | bottom: 0; 16 | left: 0; 17 | } 18 | 19 | &--safe { 20 | padding-bottom: constant(safe-area-inset-bottom); 21 | /* stylelint-disable-next-line */ 22 | padding-bottom: env(safe-area-inset-bottom); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/vantui/src/tag/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Tag } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | 标签 8 | 标签 9 | 标签 10 | 标签 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /packages/vantui/src/tag/demo/demo2.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Tag } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | 8 | 标签 9 | 10 | 11 | 标签 12 | 13 | 14 | 标签 15 | 16 | 17 | 标签 18 | 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/tag/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Tag } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | 8 | 标签 9 | 10 | 11 | 标签 12 | 13 | 14 | 标签 15 | 16 | 17 | 标签 18 | 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/tag/demo/demo4.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Tag } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | 8 | 标签 9 | 10 | 11 | 标签 12 | 13 | 14 | 标签 15 | 16 | 17 | 标签 18 | 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/vantui/src/tag/demo/demo5.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Tag } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | 标签 8 | 标签 9 | 10 | 标签 11 | 12 | 13 | 标签 14 | 15 | 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /packages/vantui/src/tag/demo/demo6.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Tag } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | return ( 6 | 7 | 标签 8 | 9 | 标签 10 | 11 | 12 | 标签 13 | 14 | 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/tag/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/style' 2 | function rootStyle(data: any) { 3 | return style({ 4 | 'background-color': data.plain ? '' : data.color, 5 | color: data.textColor || data.plain ? data.textColor || data.color : '', 6 | }) 7 | } 8 | 9 | export { rootStyle } 10 | -------------------------------------------------------------------------------- /packages/vantui/src/toast/create-only-toast.tsx: -------------------------------------------------------------------------------- 1 | import { ToastProps, toastProps } from '../../types/toast' 2 | 3 | export function createOnlyToast(Toast) { 4 | return Toast as React.FunctionComponent & toastProps 5 | } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/toast/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { View } from '@tarojs/components' 2 | import { Button, Toast } from '@antmjs/vantui' 3 | 4 | export default function Demo() { 5 | const show = () => { 6 | Toast.show('我是提示文案') 7 | } 8 | 9 | const showLong = () => { 10 | Toast.show('我是提示文案, 超过了十五就会换行额~~~') 11 | } 12 | 13 | return ( 14 | 15 | 18 | 21 | 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /packages/vantui/src/transition/wxs.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import * as utils from '../wxs/utils' 3 | function rootStyle(data: any) { 4 | return utils.style([ 5 | { 6 | '-webkit-transition-duration': data.currentDuration + 'ms', 7 | 'transition-duration': data.currentDuration + 'ms', 8 | }, 9 | data.display ? null : 'display: none', 10 | data.style, 11 | ]) 12 | } 13 | 14 | export { rootStyle } 15 | -------------------------------------------------------------------------------- /packages/vantui/src/tree-select/demo/demo3.tsx: -------------------------------------------------------------------------------- 1 | import { TreeSelect, Image } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | } 10 | /> 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/tree-select/wxs.ts: -------------------------------------------------------------------------------- 1 | function isActive(activeList: any, itemId: number | string) { 2 | if (Array.isArray(activeList)) { 3 | return activeList.indexOf(itemId) > -1 4 | } 5 | 6 | return activeList === itemId 7 | } 8 | 9 | export { isActive } 10 | -------------------------------------------------------------------------------- /packages/vantui/src/uploader/wxs.ts: -------------------------------------------------------------------------------- 1 | import { style } from '../wxs/style' 2 | import { addUnit } from '../wxs/add-unit' 3 | 4 | function sizeStyle(data: any) { 5 | return 'Array' === data.previewSize.constructor 6 | ? style({ 7 | width: addUnit(data.previewSize[0]), 8 | height: addUnit(data.previewSize[1]), 9 | }) 10 | : style({ 11 | width: addUnit(data.previewSize), 12 | height: addUnit(data.previewSize), 13 | }) 14 | } 15 | 16 | export { sizeStyle } 17 | -------------------------------------------------------------------------------- /packages/vantui/src/virtual-list/index.tsx: -------------------------------------------------------------------------------- 1 | import { VirtualList } from './virtual-half-list' 2 | 3 | export default VirtualList 4 | 5 | export { VirtualList } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/water-mark/demo/demo1.tsx: -------------------------------------------------------------------------------- 1 | import { WaterMark } from '@antmjs/vantui' 2 | 3 | export default function Demo() { 4 | return ( 5 | 6 | ) 7 | } 8 | -------------------------------------------------------------------------------- /packages/vantui/src/water-mark/index.less: -------------------------------------------------------------------------------- 1 | @import '../style/var.less'; 2 | 3 | .van-water-mark { 4 | position: absolute; 5 | 6 | .theme(z-index, '@water-mark-z-index'); 7 | 8 | left: 0; 9 | right: 0; 10 | top: 0; 11 | bottom: 0; 12 | pointer-events: none; 13 | background-repeat: repeat; 14 | 15 | &-full-page { 16 | position: fixed; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/vantui/src/waterfall-flow/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export * from './useForceUpdate' 2 | export * from './useNextTick' 3 | export * from './usePersistFn' 4 | export * from './useSubscribeElementSize' 5 | export * from './useTimeout' 6 | -------------------------------------------------------------------------------- /packages/vantui/src/waterfall-flow/hooks/useForceUpdate/index.ts: -------------------------------------------------------------------------------- 1 | import { useState } from 'react' 2 | import { usePersistFn } from '../usePersistFn' 3 | 4 | export const useForceUpdate = () => { 5 | const [, forceUpdate] = useState(new Date().valueOf()) 6 | const update = usePersistFn(() => { 7 | forceUpdate(new Date().valueOf()) 8 | }) 9 | return update 10 | } 11 | 12 | export default useForceUpdate 13 | -------------------------------------------------------------------------------- /packages/vantui/src/waterfall-flow/hooks/useNextTick/index.ts: -------------------------------------------------------------------------------- 1 | import Taro from '@tarojs/taro' 2 | 3 | export const useNextTick = (fn: () => void) => { 4 | if (['h5', 'weapp'].includes(process.env.TARO_ENV)) { 5 | return Taro.nextTick(fn) 6 | } 7 | setTimeout(fn, 0) 8 | } 9 | -------------------------------------------------------------------------------- /packages/vantui/src/waterfall-flow/hooks/useTimeout/index.ts: -------------------------------------------------------------------------------- 1 | export * from './useDepsTimeout' 2 | export * from './useTimeout' 3 | -------------------------------------------------------------------------------- /packages/vantui/src/waterfall-flow/hooks/useTimeout/useTimeout.ts: -------------------------------------------------------------------------------- 1 | import { useDepsTimeout } from './useDepsTimeout' 2 | 3 | export const useTimeout = (fn: () => void, delay?: number) => { 4 | const clear = useDepsTimeout(fn, [], delay) 5 | 6 | return clear 7 | } 8 | -------------------------------------------------------------------------------- /packages/vantui/src/waterfall-flow/index.less: -------------------------------------------------------------------------------- 1 | .van-waterfall-flow { 2 | position: relative; 3 | } 4 | 5 | .van-waterfall-flow-item { 6 | position: absolute; 7 | top: -999px; 8 | left: 0; 9 | overflow: hidden; 10 | } 11 | 12 | .van-compare-area { 13 | position: absolute; 14 | bottom: 0; 15 | left: 0; 16 | width: 100%; 17 | height: 1px; 18 | overflow: visible; 19 | } 20 | 21 | .van-waterfall-flow-item-content { 22 | position: absolute; 23 | left: 0; 24 | width: 100%; 25 | } 26 | -------------------------------------------------------------------------------- /packages/vantui/src/waterfall-flow/types/index.ts: -------------------------------------------------------------------------------- 1 | export interface WaterfallFlowItemSize { 2 | width: number 3 | height: number 4 | } 5 | 6 | export interface WaterfallFlowItemAttributes { 7 | key: string 8 | left: number 9 | top: number 10 | width: number 11 | height: number 12 | columnIndex: number // 所在列索引 13 | } 14 | 15 | export interface WaterfallFlowColumn { 16 | height: number 17 | items: string[] 18 | } 19 | 20 | export type Gutter = number | [number, number] 21 | -------------------------------------------------------------------------------- /packages/vantui/src/waterfall-flow/utils/element/index.ts: -------------------------------------------------------------------------------- 1 | export * from './size' 2 | -------------------------------------------------------------------------------- /packages/vantui/src/waterfall-flow/utils/element/size/index.ts: -------------------------------------------------------------------------------- 1 | export * from './queryElementSize' 2 | export * from './types' 3 | -------------------------------------------------------------------------------- /packages/vantui/src/waterfall-flow/utils/element/size/types.ts: -------------------------------------------------------------------------------- 1 | export interface Size { 2 | width: number 3 | height: number 4 | } 5 | -------------------------------------------------------------------------------- /packages/vantui/src/wxs/add-unit.ts: -------------------------------------------------------------------------------- 1 | import { pxTransform } from '@tarojs/taro' 2 | 3 | function addUnit(value: any) { 4 | if (value == null) { 5 | return undefined 6 | } 7 | 8 | return /^-?\d+(\.\d+)?$/.test('' + value) ? pxTransform(value) : value 9 | } 10 | 11 | export { addUnit } 12 | -------------------------------------------------------------------------------- /packages/vantui/src/wxs/array.ts: -------------------------------------------------------------------------------- 1 | function isArray(array: any) { 2 | return array && toString.call(array) === '[object Array]' 3 | } 4 | 5 | export { isArray } 6 | -------------------------------------------------------------------------------- /packages/vantui/src/wxs/object.ts: -------------------------------------------------------------------------------- 1 | const REGEXP = new RegExp('{|}|"', 'g') 2 | 3 | function keys(obj: any) { 4 | return JSON.stringify(obj) 5 | .replace(REGEXP, '') 6 | .split(',') 7 | .map(function (item) { 8 | return item.split(':')[0] 9 | }) 10 | } 11 | 12 | export { keys } 13 | -------------------------------------------------------------------------------- /packages/vantui/src/wxs/utils.ts: -------------------------------------------------------------------------------- 1 | import { _bem } from './bem' 2 | import { memoize } from './memoize' 3 | import { addUnit } from './add-unit' 4 | import { style, cssStyle } from './style' 5 | import { isArray } from './array' 6 | import { keys } from './object' 7 | 8 | const bem: (name: any, conf?: any) => string = memoize(_bem) 9 | 10 | export { memoize, addUnit, bem, style, isArray, keys, cssStyle } 11 | -------------------------------------------------------------------------------- /packages/vantui/stylelint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@antmjs/stylelint'], 3 | rules: { 4 | 'import-notation': 'string', 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /packages/vantui/types/circle.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent, ReactNode } from 'react' 2 | import { ViewProps } from '@tarojs/components' 3 | 4 | export interface CircleProps extends ViewProps { 5 | text?: ReactNode 6 | lineCap?: string 7 | value?: number 8 | speed?: number 9 | size?: number 10 | fill?: string 11 | layerColor?: string 12 | color?: string | Record 13 | strokeWidth?: number 14 | clockwise?: boolean 15 | beginAngle?: number 16 | children?: ReactNode 17 | } 18 | 19 | declare const Circle: FunctionComponent 20 | 21 | export { Circle } 22 | -------------------------------------------------------------------------------- /packages/vantui/types/divider.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent, ReactNode } from 'react' 2 | import { ViewProps } from '@tarojs/components' 3 | 4 | export interface DividerProps extends ViewProps { 5 | dashed?: boolean 6 | hairline?: boolean 7 | contentPosition?: 'left' | 'center' | 'right' 8 | fontSize?: string 9 | borderColor?: string 10 | textColor?: string 11 | children?: ReactNode 12 | } 13 | 14 | declare const Divider: FunctionComponent 15 | 16 | export { Divider } 17 | -------------------------------------------------------------------------------- /packages/vantui/types/empty.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent, ReactNode } from 'react' 2 | import { ViewProps } from '@tarojs/components' 3 | 4 | export interface EmptyProps extends ViewProps { 5 | description?: string 6 | image?: 'error' | 'search' | 'default' | 'network' | string 7 | children?: ReactNode 8 | renderImage?: ReactNode 9 | renderDescription?: ReactNode 10 | } 11 | 12 | declare const Empty: FunctionComponent 13 | 14 | export { Empty } 15 | -------------------------------------------------------------------------------- /packages/vantui/types/goods-action-button.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent, ReactNode } from 'react' 2 | import { ButtonProps } from './button' 3 | 4 | export interface GoodsActionButtonProps extends Omit { 5 | url?: string 6 | linkType?: 'navigateTo' | 'reLaunch' | 'redirectTo' 7 | text?: string 8 | children?: ReactNode 9 | } 10 | 11 | declare const GoodsActionButton: FunctionComponent 12 | 13 | export { GoodsActionButton } 14 | -------------------------------------------------------------------------------- /packages/vantui/types/goods-action-icon.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent, ReactNode } from 'react' 2 | import { ButtonProps } from './button' 3 | 4 | export interface GoodsActionIconProps 5 | extends Omit { 6 | url?: string 7 | linkType?: 'navigateTo' | 'reLaunch' | 'redirectTo' 8 | text?: string 9 | dot?: boolean 10 | info?: string 11 | icon?: string 12 | renderIcon?: ReactNode 13 | children?: ReactNode 14 | } 15 | 16 | declare const GoodsActionIcon: FunctionComponent 17 | 18 | export { GoodsActionIcon } 19 | -------------------------------------------------------------------------------- /packages/vantui/types/goods-action.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent, ReactNode } from 'react' 2 | import { ViewProps } from '@tarojs/components' 3 | 4 | export interface GoodsActionProps extends ViewProps { 5 | safeAreaInsetBottom?: boolean 6 | children: ReactNode 7 | } 8 | 9 | declare const GoodsAction: FunctionComponent 10 | 11 | export { GoodsAction } 12 | -------------------------------------------------------------------------------- /packages/vantui/types/image-viewer.d.ts: -------------------------------------------------------------------------------- 1 | import { ViewProps } from '@tarojs/components' 2 | 3 | export interface ImageViewerProps extends ViewProps { 4 | /** 5 | * @description 展示的图片列表 6 | */ 7 | list?: string[] 8 | /** 9 | * @description 初始化展示第几张图片 10 | * @default 0 11 | */ 12 | currentIndex?: number 13 | } 14 | 15 | declare const ImageViewer: { 16 | show: (props: ImageViewerProps) => void 17 | close: () => void 18 | } 19 | 20 | export { ImageViewer } 21 | -------------------------------------------------------------------------------- /packages/vantui/types/index-anchor.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent, ReactNode } from 'react' 2 | import { ViewProps } from '@tarojs/components' 3 | export interface IndexAnchorProps extends ViewProps { 4 | index: string | number 5 | children?: ReactNode 6 | } 7 | declare const IndexAnchor: FunctionComponent 8 | export { IndexAnchor } 9 | -------------------------------------------------------------------------------- /packages/vantui/types/info.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent, ReactNode } from 'react' 2 | import { ViewProps } from '@tarojs/components' 3 | 4 | export interface InfoProps extends ViewProps { 5 | dot?: boolean 6 | info?: ReactNode | number 7 | style?: string 8 | } 9 | 10 | declare const Info: FunctionComponent 11 | 12 | export { Info } 13 | -------------------------------------------------------------------------------- /packages/vantui/types/mini-login-button.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from 'react' 2 | import { ButtonProps } from './button.d' 3 | export interface MiniLoginButtonProps extends ButtonProps { 4 | onFail: (error: TaroGeneral.CallbackResult) => void 5 | onGetLoginCode: (loginInfo: Taro.login.SuccessCallbackResult) => void 6 | } 7 | 8 | declare const MiniLoginButton: FunctionComponent 9 | 10 | export { MiniLoginButton } 11 | -------------------------------------------------------------------------------- /packages/vantui/types/mini-nav-bar.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent, ReactNode } from 'react' 2 | import { ViewProps } from '@tarojs/components' 3 | 4 | export interface MiniNavBarProps extends ViewProps { 5 | homeUrl: string 6 | buttonColor?: 'white' | 'black' 7 | title?: string 8 | fixed?: boolean 9 | placeholder?: boolean 10 | style?: string 11 | border?: boolean 12 | zIndex?: number 13 | renderTitle?: ReactNode 14 | } 15 | 16 | declare const MiniNavBar: FunctionComponent 17 | 18 | export { MiniNavBar } 19 | -------------------------------------------------------------------------------- /packages/vantui/types/mixins/transition.d.ts: -------------------------------------------------------------------------------- 1 | export interface TransitionProps { 2 | show?: boolean 3 | duration?: 4 | | string 5 | | number 6 | | { enter: string | number; leave: string | number } 7 | name?: string 8 | onBeforeEnter?: () => void 9 | onBeforeLeave?: () => void 10 | onAfterEnter?: () => void 11 | onAfterLeave?: () => void 12 | onEnter?: () => void 13 | onLeave?: () => void 14 | enterClass?: string 15 | enterActiveClass?: string 16 | enterToClass?: string 17 | leaveClass?: string 18 | leaveActiveClass?: string 19 | leaveToClass?: string 20 | } 21 | -------------------------------------------------------------------------------- /packages/vantui/types/normal.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace VANTUI { 2 | type IAnyObject = Record 3 | } 4 | 5 | export default VANTUI 6 | -------------------------------------------------------------------------------- /packages/vantui/types/overlay.d.ts: -------------------------------------------------------------------------------- 1 | import { ViewProps } from '@tarojs/components' 2 | import { FunctionComponent, ReactNode } from 'react' 3 | export interface OverlayProps extends ViewProps { 4 | show?: boolean 5 | lockScroll?: boolean 6 | zIndex?: number 7 | /** 8 | * @description 是否挂载到页面根节点,用于解决各种 fixed 失效问题 9 | * @default false 10 | */ 11 | rootPortal?: boolean 12 | duration?: 13 | | string 14 | | number 15 | | { enter: string | number; leave: string | number } 16 | children?: ReactNode 17 | } 18 | declare const Overlay: FunctionComponent 19 | 20 | export { Overlay } 21 | -------------------------------------------------------------------------------- /packages/vantui/types/picker-column.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from 'react' 2 | import { ViewProps } from '@tarojs/components' 3 | 4 | export interface PickerColumnProps extends ViewProps { 5 | valueKey?: string 6 | className?: string 7 | itemHeight?: number | string 8 | visibleItemCount?: number 9 | initialOptions?: Array 10 | defaultIndex?: number 11 | onChange?: (a: any) => void 12 | activeClass?: string 13 | refBase?: any 14 | idKey?: string 15 | } 16 | 17 | declare const PickerColumn: FunctionComponent 18 | 19 | export { PickerColumn } 20 | -------------------------------------------------------------------------------- /packages/vantui/types/switch.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from 'react' 2 | import { ITouchEvent, ViewProps } from '@tarojs/components' 3 | 4 | export interface SwitchProps extends ViewProps { 5 | checked?: boolean 6 | loading?: boolean 7 | disabled?: boolean 8 | activeColor?: string 9 | inactiveColor?: string 10 | size?: string 11 | activeValue?: any 12 | inactiveValue?: any 13 | onChange?: (event: ITouchEvent) => any 14 | } 15 | 16 | declare const Switch: FunctionComponent 17 | 18 | export { Switch } 19 | -------------------------------------------------------------------------------- /packages/vantui/types/transition.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent, ReactNode } from 'react' 2 | import { ViewProps } from '@tarojs/components' 3 | import { TransitionProps } from './mixins/transition' 4 | 5 | export interface TransitionPropsCom extends TransitionProps, ViewProps { 6 | children?: ReactNode 7 | } 8 | 9 | declare const Transition: FunctionComponent 10 | 11 | export { Transition } 12 | -------------------------------------------------------------------------------- /packages/vantui/vant.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'antmjs.vantui', 3 | compiler: 'babel', 4 | build: { 5 | srcDir: 'src', 6 | namedExport: true, 7 | skipInstall: ['lazyload'], 8 | packageManager: 'yarn', 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /resource/abcd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntmJS/vantui/17955e2fb0b2e18ab5a1370c2c0bc612f677abae/resource/abcd.png -------------------------------------------------------------------------------- /resource/log.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntmJS/vantui/17955e2fb0b2e18ab5a1370c2c0bc612f677abae/resource/log.jpeg -------------------------------------------------------------------------------- /stylelint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@antmjs/stylelint'], 3 | rules: { 4 | 'import-notation': 'string', 5 | }, 6 | } 7 | --------------------------------------------------------------------------------