├── packages ├── README.md ├── badge │ ├── README.md │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── badge.vue ├── button │ ├── README.md │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── button.vue ├── cell │ ├── README.md │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── field │ ├── README.md │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── header │ ├── README.md │ ├── index.js │ └── src │ │ └── header.vue ├── navbar │ ├── README.md │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── navbar.vue ├── radio │ ├── README.md │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── radio.vue ├── search │ ├── README.md │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── search.vue ├── swipe │ ├── README.md │ ├── index.js │ ├── package.json │ └── src │ │ └── swipe-item.vue ├── switch │ ├── README.md │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── switch.vue ├── tabbar │ ├── README.md │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── tabbar.vue ├── toast │ ├── README.md │ ├── index.js │ └── src │ │ ├── toast.js │ │ └── toast.vue ├── lazyload │ ├── README.md │ ├── index.js │ └── src │ │ └── lazyload.js ├── tab-item │ ├── README.md │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── tab-item.vue ├── checklist │ ├── README.md │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── checklist.vue ├── index-list │ ├── README.md │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── message-box │ ├── README.md │ └── index.js ├── swipe-item │ ├── README.md │ └── index.js ├── index-section │ ├── README.md │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── index-section.vue ├── tab-container │ ├── README.md │ ├── index.js │ ├── _index.js │ ├── package.json │ └── cooking.conf.js ├── datetime-picker │ ├── README.md │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── infinite-scroll │ ├── README.md │ ├── index.js │ └── src │ │ └── infinite-scroll.js ├── tab-container-item │ ├── README.md │ ├── index.js │ └── src │ │ └── tab-container-item.vue ├── picker │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ ├── src │ │ ├── draggable.js │ │ └── translate.js │ └── README.md ├── popup │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ ├── README.md │ └── src │ │ └── popup.vue ├── range │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ ├── README.md │ └── src │ │ ├── draggable.js │ │ └── index.vue ├── spinner │ ├── index.js │ ├── components.json │ ├── src │ │ ├── spinner │ │ │ ├── common.vue │ │ │ ├── snake.vue │ │ │ ├── double-bounce.vue │ │ │ ├── triple-bounce.vue │ │ │ └── fading-circle.vue │ │ └── spinner.vue │ ├── package.json │ ├── cooking.conf.js │ └── README.md ├── loadmore │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── progress │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ ├── README.md │ └── src │ │ └── progress.vue ├── actionsheet │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ ├── README.md │ └── src │ │ └── actionsheet.vue ├── cell-swipe │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── palette-button │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── README.md └── indicator │ ├── package.json │ ├── cooking.conf.js │ ├── index.js │ ├── README.md │ └── src │ └── indicator.vue ├── src ├── style │ ├── empty.css │ ├── popup.css │ └── var.css ├── assets │ ├── font │ │ ├── iconfont.ttf │ │ └── iconfont.css │ └── loading-spin.svg ├── utils │ ├── merge.js │ └── clickoutside.js ├── mixins │ └── emitter.js └── index.js ├── .eslintignore ├── .eslintrc ├── lerna.json ├── .travis.yml ├── example ├── assets │ └── 100x100.png ├── index.tpl ├── route.js ├── pages │ ├── cell-swipe.vue │ ├── search.vue │ ├── spinner.vue │ ├── cell.vue │ ├── navbar.vue │ ├── switch.vue │ ├── toast.vue │ ├── message-box.vue │ ├── radio.vue │ ├── tab-container.vue │ ├── field.vue │ ├── indicator.vue │ ├── badge.vue │ ├── lazyload.vue │ ├── index-list.vue │ ├── action-sheet.vue │ ├── header.vue │ ├── button.vue │ ├── checklist.vue │ ├── tabbar.vue │ ├── swipe.vue │ ├── infinite-scroll.vue │ ├── progress.vue │ ├── datetime-picker.vue │ ├── palette-button.vue │ ├── pull-down.vue │ ├── pull-up.vue │ ├── range.vue │ └── popup.vue ├── app.vue ├── entry.js ├── demos.vue └── nav.config.json ├── .gitignore ├── .github ├── PULL_REQUEST_TEMPLATE.md ├── ISSUE_TEMPLATE.md ├── CONTRIBUTING_zh-cn.md └── CONTRIBUTING_en-us.md ├── Makefile ├── FAQ.md ├── LICENSE ├── components.json ├── package.json └── README.md /packages/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/style/empty.css: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /packages/badge/README.md: -------------------------------------------------------------------------------- 1 | # mint-badge -------------------------------------------------------------------------------- /packages/button/README.md: -------------------------------------------------------------------------------- 1 | # mint-button -------------------------------------------------------------------------------- /packages/cell/README.md: -------------------------------------------------------------------------------- 1 | # mint-cell -------------------------------------------------------------------------------- /packages/field/README.md: -------------------------------------------------------------------------------- 1 | # mint-field -------------------------------------------------------------------------------- /packages/header/README.md: -------------------------------------------------------------------------------- 1 | # mint-header -------------------------------------------------------------------------------- /packages/navbar/README.md: -------------------------------------------------------------------------------- 1 | # mint-navbar -------------------------------------------------------------------------------- /packages/radio/README.md: -------------------------------------------------------------------------------- 1 | # mint-radio -------------------------------------------------------------------------------- /packages/search/README.md: -------------------------------------------------------------------------------- 1 | # mint-search -------------------------------------------------------------------------------- /packages/swipe/README.md: -------------------------------------------------------------------------------- 1 | # mint-swipe -------------------------------------------------------------------------------- /packages/switch/README.md: -------------------------------------------------------------------------------- 1 | # mint-switch -------------------------------------------------------------------------------- /packages/tabbar/README.md: -------------------------------------------------------------------------------- 1 | # mint-tabbar -------------------------------------------------------------------------------- /packages/toast/README.md: -------------------------------------------------------------------------------- 1 | # mint-toast -------------------------------------------------------------------------------- /packages/lazyload/README.md: -------------------------------------------------------------------------------- 1 | # mint-lazyload -------------------------------------------------------------------------------- /packages/tab-item/README.md: -------------------------------------------------------------------------------- 1 | # mint-tab-item -------------------------------------------------------------------------------- /packages/checklist/README.md: -------------------------------------------------------------------------------- 1 | # mint-checklist -------------------------------------------------------------------------------- /packages/index-list/README.md: -------------------------------------------------------------------------------- 1 | # mint-index-list -------------------------------------------------------------------------------- /packages/message-box/README.md: -------------------------------------------------------------------------------- 1 | # mint-message-box -------------------------------------------------------------------------------- /packages/swipe-item/README.md: -------------------------------------------------------------------------------- 1 | # mint-swipe-item -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | release.sh 2 | node_modules 3 | lib 4 | -------------------------------------------------------------------------------- /packages/index-section/README.md: -------------------------------------------------------------------------------- 1 | # mint-index-section -------------------------------------------------------------------------------- /packages/tab-container/README.md: -------------------------------------------------------------------------------- 1 | # mint-tab-container -------------------------------------------------------------------------------- /packages/datetime-picker/README.md: -------------------------------------------------------------------------------- 1 | # mint-datetime-picker -------------------------------------------------------------------------------- /packages/infinite-scroll/README.md: -------------------------------------------------------------------------------- 1 | # mint-infinite-scroll -------------------------------------------------------------------------------- /packages/tab-container-item/README.md: -------------------------------------------------------------------------------- 1 | # mint-tab-container-item -------------------------------------------------------------------------------- /packages/cell/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/cell.vue'; 2 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["vue"], 3 | "extends": ["elemefe"] 4 | } -------------------------------------------------------------------------------- /packages/badge/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/badge.vue'; 2 | -------------------------------------------------------------------------------- /packages/button/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/button.vue'; 2 | -------------------------------------------------------------------------------- /packages/field/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/field.vue'; 2 | -------------------------------------------------------------------------------- /packages/header/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/header.vue'; 2 | -------------------------------------------------------------------------------- /packages/navbar/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/navbar.vue'; 2 | -------------------------------------------------------------------------------- /packages/picker/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/picker.vue'; 2 | -------------------------------------------------------------------------------- /packages/popup/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/popup.vue'; 2 | -------------------------------------------------------------------------------- /packages/radio/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/radio.vue'; 2 | -------------------------------------------------------------------------------- /packages/range/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/index.vue'; 2 | -------------------------------------------------------------------------------- /packages/search/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/search.vue'; 2 | -------------------------------------------------------------------------------- /packages/spinner/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/spinner'; 2 | -------------------------------------------------------------------------------- /packages/swipe/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/swipe.vue'; 2 | -------------------------------------------------------------------------------- /packages/switch/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/switch.vue'; 2 | -------------------------------------------------------------------------------- /packages/tabbar/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/tabbar.vue'; 2 | -------------------------------------------------------------------------------- /packages/toast/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/toast.js'; 2 | -------------------------------------------------------------------------------- /packages/checklist/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/checklist.vue'; 2 | -------------------------------------------------------------------------------- /packages/loadmore/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/loadmore.vue'; 2 | -------------------------------------------------------------------------------- /packages/progress/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/progress.vue'; 2 | -------------------------------------------------------------------------------- /packages/tab-item/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/tab-item.vue'; 2 | -------------------------------------------------------------------------------- /packages/actionsheet/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/actionsheet.vue'; 2 | -------------------------------------------------------------------------------- /packages/cell-swipe/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/cell-swipe.vue'; 2 | -------------------------------------------------------------------------------- /packages/index-list/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/index-list.vue'; 2 | -------------------------------------------------------------------------------- /packages/message-box/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/message-box.js'; 2 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "lerna": "2.0.0-beta.18", 3 | "version": "independent" 4 | } 5 | -------------------------------------------------------------------------------- /packages/index-section/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/index-section.vue'; 2 | -------------------------------------------------------------------------------- /packages/palette-button/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/palette-button.vue'; 2 | -------------------------------------------------------------------------------- /packages/tab-container/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/tab-container.vue'; 2 | -------------------------------------------------------------------------------- /packages/datetime-picker/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/datetime-picker.vue'; 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - "5" 5 | script: make dist 6 | -------------------------------------------------------------------------------- /packages/tab-container-item/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/tab-container-item.vue'; 2 | -------------------------------------------------------------------------------- /example/assets/100x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/functions/mint-ui/master/example/assets/100x100.png -------------------------------------------------------------------------------- /src/assets/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/functions/mint-ui/master/src/assets/font/iconfont.ttf -------------------------------------------------------------------------------- /packages/lazyload/index.js: -------------------------------------------------------------------------------- 1 | import 'mint-ui/src/style/empty.css'; 2 | export { default } from './src/lazyload.js'; 3 | -------------------------------------------------------------------------------- /packages/infinite-scroll/index.js: -------------------------------------------------------------------------------- 1 | import 'mint-ui/src/style/empty.css'; 2 | export { default } from './src/infinite-scroll.js'; 3 | -------------------------------------------------------------------------------- /packages/swipe-item/index.js: -------------------------------------------------------------------------------- 1 | import 'mint-ui/src/style/empty.css'; 2 | export { default } from '../swipe/src/swipe-item.vue'; 3 | -------------------------------------------------------------------------------- /packages/lazyload/src/lazyload.js: -------------------------------------------------------------------------------- 1 | import Lazyload from 'vue-lazyload'; 2 | import 'mint-ui/src/style/empty.css'; 3 | 4 | export default Lazyload; 5 | -------------------------------------------------------------------------------- /packages/swipe/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "dependencies": { 4 | "wind-dom": "0.0.3" 5 | }, 6 | "name": "mint-swipe" 7 | } 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log* 2 | .cache 3 | .DS_Store 4 | .idea 5 | .vscode/ 6 | packages/**/lib 7 | lib/* 8 | !lib/index.js 9 | !lib/style.css 10 | node_modules 11 | example/dist 12 | -------------------------------------------------------------------------------- /packages/tab-container/_index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | TabContainer: require('./src/tab-container.vue'), 3 | TabContainerItem: require('../tab-container-item/src/tab-container-item.vue') 4 | }; 5 | -------------------------------------------------------------------------------- /packages/spinner/components.json: -------------------------------------------------------------------------------- 1 | { 2 | "index": "./index.js", 3 | "double-bounce": "./src/spinner/double-bounce.vue", 4 | "fading-circle": "./src/spinner/fading-circle.vue", 5 | "snake": "./src/spinner/snake.vue", 6 | "triple-bounce": "./src/spinner/triple-bounce.vue" 7 | } 8 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Please makes sure these boxes are checked before submitting your PR, thank you! 2 | 3 | * [ ] Make sure you follow the contributing guide. 4 | * [ ] Rebase before creating a PR to keep commit history clear. 5 | * [ ] Add some descriptions and refer relative issues for you PR. 6 | -------------------------------------------------------------------------------- /packages/badge/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-badge", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-badge", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/field/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-field", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-field", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/popup/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-popup", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-popup", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/radio/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-radio", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-radio", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/button/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-button", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-button", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/cell-swipe/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-cell-swipe", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-cell-swipe", 10 | "dependencies": {} 11 | } -------------------------------------------------------------------------------- /packages/cell/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-cell", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-cell", 10 | "dependencies": { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/loadmore/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-loadmore", 3 | "description": "", 4 | "version": "0.1.2", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-loadmore", 10 | "dependencies": {} 11 | } 12 | -------------------------------------------------------------------------------- /packages/navbar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-navbar", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-navbar", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/search/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-search", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-search", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/switch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-switch", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-switch", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/tabbar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-tabbar", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-tabbar", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/checklist/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-checklist", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-checklist", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/indicator/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-indicator", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-indicator", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/progress/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-progress", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-progress", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/range/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-range", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "long.zhang@ele.me", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-range", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/tab-item/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-tab-item", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-tab-item", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/index-list/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-index-list", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-index-list", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/index-section/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-index-section", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-index-section", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/tab-container/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-tab-container", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-tab-container", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/datetime-picker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-datetime-picker", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-datetime-picker", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/palette-button/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-palette-button", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "cia.fbi.007@hotmail.com", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/palette-button", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/actionsheet/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-actionsheet", 3 | "description": "An action sheet component for vue.js", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "author": "elemefe", 7 | "homepage": "https://github.com/ElemeFE/mint-ui", 8 | "license": "MIT", 9 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-actionsheet", 10 | "dependencies": { 11 | } 12 | } -------------------------------------------------------------------------------- /packages/spinner/src/spinner/common.vue: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /src/utils/merge.js: -------------------------------------------------------------------------------- 1 | export default function(target) { 2 | for (let i = 1, j = arguments.length; i < j; i++) { 3 | let source = arguments[i] || {}; 4 | for (let prop in source) { 5 | if (source.hasOwnProperty(prop)) { 6 | let value = source[prop]; 7 | if (value !== undefined) { 8 | target[prop] = value; 9 | } 10 | } 11 | } 12 | } 13 | 14 | return target; 15 | }; 16 | -------------------------------------------------------------------------------- /packages/swipe/src/swipe-item.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 20 | -------------------------------------------------------------------------------- /src/assets/loading-spin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /packages/infinite-scroll/src/infinite-scroll.js: -------------------------------------------------------------------------------- 1 | import InfiniteScroll from './directive'; 2 | import 'mint-ui/src/style/empty.css'; 3 | import Vue from 'vue'; 4 | 5 | const install = function(Vue) { 6 | Vue.directive('InfiniteScroll', InfiniteScroll); 7 | }; 8 | 9 | if (!Vue.prototype.$isServer && window.Vue) { 10 | window.infiniteScroll = InfiniteScroll; 11 | Vue.use(install); // eslint-disable-line 12 | } 13 | 14 | InfiniteScroll.install = install; 15 | export default InfiniteScroll; 16 | -------------------------------------------------------------------------------- /packages/picker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-picker", 3 | "description": "", 4 | "version": "0.1.0", 5 | "main": "lib/index.js", 6 | "homepage": "https://github.com/ElemeFE/mint-ui", 7 | "license": "MIT", 8 | "repository": "https://github.com/ElemeFE/mint-ui/tree/master/components/mint-picker", 9 | "keywords": [ 10 | "picker", 11 | "multi slots", 12 | "vue" 13 | ], 14 | "author": "long.zhang@ele.me", 15 | "dependencies": { 16 | "raf.js": "0.0.4", 17 | "wind-dom": "0.0.3" 18 | } 19 | } -------------------------------------------------------------------------------- /packages/cell/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintCell', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/badge/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintBadge', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/button/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintButton', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/field/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintField', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/navbar/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintNavbar', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/picker/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintPicker', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/popup/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintPopup', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/radio/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintRadio', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/range/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintRange', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/search/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintSearch', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/switch/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintSwitch', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/tabbar/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintTabBar', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /src/style/popup.css: -------------------------------------------------------------------------------- 1 | .v-modal-enter { 2 | animation: v-modal-in .2s ease; 3 | } 4 | 5 | .v-modal-leave { 6 | animation: v-modal-out .2s ease forwards; 7 | } 8 | 9 | @keyframes v-modal-in { 10 | 0% { 11 | opacity: 0; 12 | } 13 | 100% { 14 | } 15 | } 16 | 17 | @keyframes v-modal-out { 18 | 0% { 19 | } 20 | 100% { 21 | opacity: 0; 22 | } 23 | } 24 | 25 | .v-modal { 26 | position: fixed; 27 | left: 0; 28 | top: 0; 29 | width: 100%; 30 | height: 100%; 31 | opacity: 0.5; 32 | background: #000; 33 | } 34 | -------------------------------------------------------------------------------- /packages/checklist/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintChecklist', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/indicator/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintIndicator', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/loadmore/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintLoadmore', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/progress/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintProgress', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/tab-item/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintTabItem', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/actionsheet/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintActionsheet', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/cell-swipe/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintCellSwipe', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/index-list/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintIndexlist', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/index-section/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintIndexSection', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/tab-container/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintTabContainer', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/datetime-picker/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'MintDatetimePicker', 13 | extractCSS: 'style.css', 14 | extends: config.extends, 15 | alias: config.alias, 16 | externals: config.externals 17 | }); 18 | 19 | module.exports = cooking.resolve(); 20 | -------------------------------------------------------------------------------- /packages/spinner/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-spinner", 3 | "version": "2.0.0", 4 | "description": "A spinner component for vue.js", 5 | "main": "lib/index.js", 6 | "files": [ 7 | "lib" 8 | ], 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/mint-ui/mint-spinner.git" 12 | }, 13 | "homepage": "https://github.com/mint-ui/mint-spinner#readme", 14 | "bugs": { 15 | "url": "https://github.com/mint-ui/mint-spinner/issues" 16 | }, 17 | "author": "qingwei-li", 18 | "license": "MIT", 19 | "devDependencies": { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/range/README.md: -------------------------------------------------------------------------------- 1 | # mint-range 2 | > A mint component 3 | 4 | ## Installation 5 | ```shell 6 | npm i mint-range -D 7 | ``` 8 | 9 | ## Usage 10 | ```javascript 11 | import Vue from 'vue' 12 | import MintRange from 'mint-range' 13 | 14 | Vue.use(MintRange) 15 | ``` 16 | 17 | or 18 | 19 | ```javascript 20 | import Vue from 'vue' 21 | import { MintRange } from 'mint-range' 22 | 23 | Vue.component('mint-range', MintRange) 24 | ``` 25 | 26 | ## Development 27 | 28 | ```shell 29 | make dev 30 | ``` 31 | 32 | ## Production 33 | ``` 34 | make dist 35 | ``` 36 | 37 | ## Deploy 38 | ```shell 39 | make deploy 40 | ``` 41 | 42 | ## License 43 | MIT 44 | -------------------------------------------------------------------------------- /packages/progress/README.md: -------------------------------------------------------------------------------- 1 | # mint-progress 2 | > A mint component 3 | 4 | ## Installation 5 | ```shell 6 | npm i mint-progress -D 7 | ``` 8 | 9 | ## Usage 10 | ```javascript 11 | import Vue from 'vue' 12 | import MintProgress from 'mint-progress' 13 | 14 | Vue.use(MintProgress) 15 | ``` 16 | 17 | or 18 | 19 | ```javascript 20 | import Vue from 'vue' 21 | import { MintProgress } from 'mint-progress' 22 | 23 | Vue.component('mint-progress', MintProgress) 24 | ``` 25 | 26 | ## Development 27 | 28 | ```shell 29 | make dev 30 | ``` 31 | 32 | ## Production 33 | ``` 34 | make dist 35 | ``` 36 | 37 | ## Deploy 38 | ```shell 39 | make deploy 40 | ``` 41 | 42 | ## License 43 | MIT 44 | -------------------------------------------------------------------------------- /example/index.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Mint UI 7 | 8 | 9 | 10 |
<% if (process.env.NODE_ENV === 'production') { %> 11 | 12 | 13 | <% } %> 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/assets/font/iconfont.css: -------------------------------------------------------------------------------- 1 | 2 | @font-face {font-family: "mintui"; 3 | src: url('iconfont.ttf?t=1464927413') 4 | } 5 | 6 | .mintui { 7 | font-family:"mintui" !important; 8 | font-size:16px; 9 | font-style:normal; 10 | -webkit-font-smoothing: antialiased; 11 | -webkit-text-stroke-width: 0.2px; 12 | -moz-osx-font-smoothing: grayscale; 13 | } 14 | .mintui-search:before { content: "\e604"; } 15 | .mintui-more:before { content: "\e601"; } 16 | .mintui-back:before { content: "\e600"; } 17 | .mintui-field-error:before { content: "\e605"; } 18 | .mintui-field-warning:before { content: "\e608"; } 19 | .mintui-success:before { content: "\e602"; } 20 | .mintui-field-success:before { content: "\e609"; } 21 | -------------------------------------------------------------------------------- /example/route.js: -------------------------------------------------------------------------------- 1 | import NavConfig from './nav.config.json'; 2 | 3 | const registerRoute = (config) => { 4 | let route = []; 5 | config.map(nav => 6 | nav.list.map(page => 7 | route.push({ 8 | name: page.name, 9 | path: page.path, 10 | component: require(`./pages${page.path}`), 11 | meta: { 12 | title: page.title || page.name, 13 | description: page.description 14 | } 15 | }) 16 | ) 17 | ); 18 | 19 | return { route, navs: config }; 20 | }; 21 | 22 | const route = registerRoute(NavConfig); 23 | 24 | route.route.push({ 25 | path: '/', 26 | component: require('./demos.vue') 27 | }); 28 | 29 | export const navs = route.navs; 30 | export default route.route; 31 | -------------------------------------------------------------------------------- /packages/palette-button/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | 4 | cooking.set({ 5 | entry: { 6 | index: path.join(__dirname, 'index.js') 7 | }, 8 | dist: path.join(__dirname, 'lib'), 9 | template: false, 10 | format: 'umd', 11 | moduleName: 'MintPaletteButton', 12 | extractCSS: 'style.css', 13 | 14 | extends: ['vue', 'saladcss'] 15 | }); 16 | 17 | cooking.add('resolve.alias', { 18 | 'main': path.join(__dirname, '../../src'), 19 | 'mint-ui': path.join(__dirname, '..') 20 | }); 21 | 22 | cooking.add('externals', { 23 | vue: { 24 | root: 'Vue', 25 | commonjs: 'vue', 26 | commonjs2: 'vue', 27 | amd: 'vue' 28 | } 29 | }); 30 | 31 | module.exports = cooking.resolve(); 32 | -------------------------------------------------------------------------------- /packages/indicator/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | 3 | const Indicator = Vue.extend(require('./src/indicator.vue')); 4 | let instance; 5 | 6 | export default { 7 | open(options = {}) { 8 | if (!instance) { 9 | instance = new Indicator({ 10 | el: document.createElement('div') 11 | }); 12 | } 13 | if (instance.visible) return; 14 | instance.text = typeof options === 'string' ? options : options.text || ''; 15 | instance.spinnerType = options.spinnerType || 'snake'; 16 | document.body.appendChild(instance.$el); 17 | 18 | Vue.nextTick(() => { 19 | instance.visible = true; 20 | }); 21 | }, 22 | 23 | close() { 24 | if (instance) { 25 | instance.visible = false; 26 | } 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /packages/palette-button/README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | palette-button is a set of buttons that can expand and collapse 3 | 4 | # Usage 5 | 6 | see example 7 | 8 | # Option 9 | - content: the text content of the main button 10 | - offset: the offset arc of the fan-shaped area 11 | - direction: the direction of the fan-shaped area, belongs to one of the ['lt', 't', 'rt', 'r', 'rb', 'b', 'lb', 'l'] 12 | - radius: the radius of the fan-shaped area 13 | - mainButtonStyle: set the style of the main button 14 | 15 | # Method 16 | - toggle: toggle between expand and collapse 17 | - expand: expand all sub buttons 18 | - collapse: collapse all sub buttons 19 | 20 | # Event 21 | - expand: begin expand sub buttons 22 | - expanded: all sub buttons has been expanded 23 | - collapse: begin collapse sub buttons -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: dist 2 | default: help 3 | 4 | dev: 5 | npm run dev 6 | 7 | dist: 8 | npm run dist 9 | 10 | dist-all: 11 | node build/bin/build-all.js 12 | 13 | deploy: 14 | npm run deploy 15 | 16 | pub: 17 | npm run pub 18 | 19 | pub-all: 20 | npm run pub:all 21 | 22 | help: 23 | @echo " \033[35mmake\033[0m \033[1m命令使用说明\033[0m" 24 | @echo " \033[35mmake install\033[0m\t\033[0m\t--- 安装依赖" 25 | @echo " \033[35mmake dev\033[0m\t\033[0m\t--- 开发模式" 26 | @echo " \033[35mmake dist\033[0m\t\033[0m\t--- 编译项目,生成目标文件" 27 | @echo " \033[35mmake dist-all\033[0m\t--- 分别编译每个组件项目" 28 | @echo " \033[35mmake deploy\033[0m\t\033[0m\t--- 部署 demo" 29 | @echo " \033[35mmake pub\033[0m\t\033[0m\t--- 发布到 npm 上" 30 | @echo " \033[35mmake pub-all\033[0m\t\033[0m\t--- 发布各组件到 npm 上" 31 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING_zh-cn.md: -------------------------------------------------------------------------------- 1 | # Mint UI Contributing Guide 2 | 3 | Hi! 首先感谢你使用 Mint UI。 4 | 5 | Mint UI 是一套基于 Vue.js 的移动端组件库,它包含丰富的 CSS 和 JS 组件,能够满足日常的移动端开发需要。通过它,可以快速构建出风格统一的页面,提升开发效率。 6 | 7 | Mint UI 的成长离不开大家的支持,如果你愿意为 Mint UI 贡献代码或提供建议,请阅读以下内容。 8 | 9 | ## Issue 规范 10 | - issue 仅用于提交 Bug 或 Feature,其它内容可能会被直接关闭。 11 | 12 | - 在提交 issue 之前,请搜索相关内容是否已被提出。 13 | 14 | - 请说明 Mint UI 的版本号,并提供操作系统和浏览器信息。推荐使用 [JSFiddle](https://jsfiddle.net/) 生成在线 demo,这能够更直观地重现问题。 15 | 16 | ## Pull Request 规范 17 | - 请先 fork 一份到自己的项目下,不要直接在仓库下建分支。 18 | 19 | - **不要提交** `lib` 里面打包的文件。 20 | 21 | - 提交 PR 前请 rebase,确保 commit 记录的整洁。 22 | 23 | - 如果是修复 bug,请在 PR 中给出描述信息。 24 | 25 | - 合并代码需要两名维护人员参与:一人进行 review 后 approve,另一人再次 review,通过后即可合并。 26 | 27 | ## 代码规范 28 | 遵循饿了么前端的 [ESLint](https://github.com/ElemeFE/eslint-config-elemefe) 即可 29 | -------------------------------------------------------------------------------- /example/pages/cell-swipe.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 35 | -------------------------------------------------------------------------------- /FAQ.md: -------------------------------------------------------------------------------- 1 | ## FAQ 2 | 3 | ### 给组件绑定的事件为什么无法触发? 4 | 5 | 在 Vue 2.0 中,为自定义组件绑定原生事件必须使用 `.native` 修饰符: 6 | ```html 7 | Click Me 8 | ``` 9 | 10 | ### 在项目中引入 Mint UI,但是 CSS 报错/字体文件报错/组件没有样式是什么原因? 11 | 12 | 请参考 webpack 文档,在 webpack 的 loaders 中正确配置 file-loader、css-loader 和 style-loader。 13 | 14 | ### 在项目中引入 Mint UI,报 `Uncaught Error: Module build failed: SyntaxError: 'with' in strict mode` 是什么原因? 15 | 16 | 请避免你使用的编译器处理 Mint UI。比如,若是使用 webpack,请在 loaders 中配置: 17 | ```javascript 18 | { 19 | test: /\.js$/, 20 | loader: 'babel', 21 | exclude: /node_modules/ 22 | } 23 | ``` 24 | 25 | ### 将 Mint UI 克隆至本地,运行时为何会报错/跑不起来? 26 | 27 | 首先,确保克隆的是 master 分支的最新代码,并且文件完整。其次,确保本地的 node 版本在 4.0 以上,npm 版本在 3.0 以上。最后,请按照 README 的方法启动开发环境: 28 | 29 | ```bash 30 | npm run dev 31 | ``` 32 | 33 | 或是直接打包: 34 | 35 | ```bash 36 | npm run dist 37 | ``` 38 | -------------------------------------------------------------------------------- /packages/spinner/src/spinner/snake.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 21 | 22 | 38 | -------------------------------------------------------------------------------- /example/pages/search.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 42 | 43 | 48 | -------------------------------------------------------------------------------- /packages/spinner/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var Components = require('./components.json'); 3 | var path = require('path'); 4 | var config = require('../../build/config'); 5 | var WebpackShellPlugin = require('webpack-shell-plugin'); 6 | 7 | var entrys = {}; 8 | Object.keys(Components).forEach(function(key) { 9 | entrys[key] = [path.join(__dirname, Components[key])]; 10 | }); 11 | 12 | cooking.set({ 13 | entry: entrys, 14 | dist: path.join(__dirname, 'lib'), 15 | template: false, 16 | format: 'umd', 17 | moduleName: 'MintSpinner', 18 | extractCSS: '[name]/style.css', 19 | extends: config.extends, 20 | alias: config.alias, 21 | externals: config.externals 22 | }); 23 | 24 | cooking.add('output.filename', '[name]/index.js'); 25 | cooking.add('plugin.WebpackShell', new WebpackShellPlugin({ 26 | onBuildExit: [`mv ${__dirname}/lib/index/* ${__dirname}/lib/ && rm -rf ${__dirname}/lib/index`] 27 | })); 28 | module.exports = cooking.resolve(); 29 | -------------------------------------------------------------------------------- /packages/tab-container-item/src/tab-container-item.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 30 | 31 | 39 | -------------------------------------------------------------------------------- /example/app.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 35 | 36 | 47 | -------------------------------------------------------------------------------- /example/pages/spinner.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 34 | 35 | -------------------------------------------------------------------------------- /example/pages/cell.vue: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /src/mixins/emitter.js: -------------------------------------------------------------------------------- 1 | function broadcast(componentName, eventName, params) { 2 | this.$children.forEach(child => { 3 | var name = child.$options.componentName; 4 | 5 | if (name === componentName) { 6 | child.$emit.apply(child, [eventName].concat(params)); 7 | } else { 8 | broadcast.apply(child, [componentName, eventName].concat(params)); 9 | } 10 | }); 11 | } 12 | export default { 13 | methods: { 14 | dispatch(componentName, eventName, params) { 15 | var parent = this.$parent; 16 | var name = parent.$options.componentName; 17 | 18 | while (parent && (!name || name !== componentName)) { 19 | parent = parent.$parent; 20 | 21 | if (parent) { 22 | name = parent.$options.componentName; 23 | } 24 | } 25 | if (parent) { 26 | parent.$emit.apply(parent, [eventName].concat(params)); 27 | } 28 | }, 29 | broadcast(componentName, eventName, params) { 30 | broadcast.call(this, componentName, eventName, params); 31 | } 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /example/entry.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import App from './app'; 3 | import routes from './route'; 4 | import { install as Mint } from 'src/index'; 5 | import VueRouter from 'vue-router'; 6 | 7 | document.addEventListener('DOMContentLoaded', function() { 8 | if (window.FastClick) window.FastClick.attach(document.body); 9 | }, false); 10 | 11 | Vue.use(Mint); 12 | Vue.use(VueRouter); 13 | 14 | const router = new VueRouter({ 15 | base: __dirname, 16 | routes 17 | }); 18 | 19 | new Vue({ // eslint-disable-line 20 | el: '#app', 21 | render: h => h(App), 22 | router 23 | }); 24 | 25 | let indexScrollTop = 0; 26 | router.beforeEach((route, redirect, next) => { 27 | if (route.path !== '/') { 28 | indexScrollTop = document.body.scrollTop; 29 | } 30 | document.title = route.meta.title || document.title; 31 | next(); 32 | }); 33 | 34 | router.afterEach(route => { 35 | if (route.path !== '/') { 36 | document.body.scrollTop = 0; 37 | } else { 38 | Vue.nextTick(() => { 39 | document.body.scrollTop = indexScrollTop; 40 | }); 41 | } 42 | }); 43 | -------------------------------------------------------------------------------- /example/pages/navbar.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 39 | -------------------------------------------------------------------------------- /packages/index-section/src/index-section.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 28 | 29 | 52 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 mint-ui 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/utils/clickoutside.js: -------------------------------------------------------------------------------- 1 | /** 2 | * v-clickoutside 3 | * @desc 点击元素外面才会触发的事件 4 | * @example 5 | * ```vue 6 | *
7 | * ``` 8 | */ 9 | const clickoutsideContext = '@@clickoutsideContext'; 10 | 11 | export default { 12 | bind(el, binding, vnode) { 13 | const documentHandler = function(e) { 14 | if (vnode.context && !el.contains(e.target)) { 15 | vnode.context[el[clickoutsideContext].methodName](); 16 | } 17 | }; 18 | el[clickoutsideContext] = { 19 | documentHandler, 20 | methodName: binding.expression, 21 | arg: binding.arg || 'click' 22 | }; 23 | document.addEventListener(el[clickoutsideContext].arg, documentHandler); 24 | }, 25 | 26 | update(el, binding) { 27 | el[clickoutsideContext].methodName = binding.expression; 28 | }, 29 | 30 | unbind(el) { 31 | document.removeEventListener( 32 | el[clickoutsideContext].arg, 33 | el[clickoutsideContext].documentHandler); 34 | }, 35 | 36 | install(Vue) { 37 | Vue.directive('clickoutside', { 38 | bind: this.bind, 39 | unbind: this.unbind 40 | }); 41 | } 42 | }; 43 | -------------------------------------------------------------------------------- /src/style/var.css: -------------------------------------------------------------------------------- 1 | $color-blue: #26a2ff; 2 | $color-white: #fff; 3 | $color-grey: #d9d9d9; 4 | $border-color: #c8c8cd; 5 | $success-color: #4caf50; 6 | $error-color: #f44336; 7 | $warning-color: #ffc107; 8 | 9 | /* Cell Component */ 10 | $cell-value-color: #888; 11 | 12 | /* Header Component */ 13 | $header-height: 40px; 14 | 15 | /* Button Component */ 16 | $button-default-color: #656b79; 17 | $button-default-background-color: #f6f8fa; 18 | $button-default-plain-color: #5a5a5a; 19 | $button-default-box-shadow: 0 0 1px #b8bbbf; 20 | $button-primary-color: #fff; 21 | $button-primary-background-color: #26a2ff; 22 | $button-danger-color: #fff; 23 | $button-danger-background-color: #ef4f4f; 24 | 25 | /* Tab Item Component */ 26 | $tab-item-font-size: 12px; 27 | 28 | /* Tabbar Component */ 29 | $tabbar-background-color: #fafafa; 30 | $tabbar-tab-item-selected-background-color: #eaeaea; 31 | $tabbar-tab-item-selected-color: $color-blue; 32 | 33 | /* Navbar Component */ 34 | $navbar-background-color: #fafafa; 35 | $tabbar-tab-item-selected-background-color: #eaeaea; 36 | 37 | /* Checklist Component */ 38 | $checklist-title-color: #888; 39 | 40 | /* Radio Component */ 41 | $radio-title-color: #888; 42 | 43 | /* z-index */ 44 | $z-index-normal: 1; 45 | -------------------------------------------------------------------------------- /packages/indicator/README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | vue-indicator is a mobile loading indicator plugin for vue.js. 3 | 4 | # Installation 5 | First, install `vue-indicator` from npm: 6 | ```bash 7 | $ npm install vue-indicator 8 | ``` 9 | 10 | Then use it: 11 | ```Javascript 12 | // ES6 mudule 13 | import Indicator from 'vue-indicator'; 14 | 15 | // CommonJS 16 | const Indicator = require('vue-indicator').default; 17 | ``` 18 | 19 | # Usage 20 | Open an indicator: 21 | ```Javascript 22 | Indicator.open(); 23 | ``` 24 | 25 | Open an indicator with a string: 26 | ```Javascript 27 | Indicator.open('Loading...'); 28 | ``` 29 | 30 | Open an indicator with an object: 31 | ```Javascript 32 | Indicator.open({ text:'Loading...', spinnerType: 'fading-circle' }); 33 | ``` 34 | 35 | Then close it: 36 | ```Javascript 37 | Indicator.close(); 38 | ``` 39 | 40 | # API 41 | | Option | Description | Value | Default | 42 | |-------------|----------------|-------------------------------------------------------------|---------| 43 | | text | indicator text | String | | 44 | | spinnerType | spinner type | 'snake', 'fading-circle', 'double-bounce', 'triple-bounce' | 'snake' | 45 | 46 | # License 47 | MIT 48 | -------------------------------------------------------------------------------- /example/pages/switch.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 45 | 46 | 55 | -------------------------------------------------------------------------------- /packages/spinner/src/spinner/double-bounce.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 20 | 21 | 54 | -------------------------------------------------------------------------------- /example/pages/toast.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 27 | 28 | 53 | -------------------------------------------------------------------------------- /example/pages/message-box.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 27 | 28 | 51 | -------------------------------------------------------------------------------- /example/demos.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 52 | 53 | 68 | -------------------------------------------------------------------------------- /example/pages/radio.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 65 | 66 | 71 | 72 | -------------------------------------------------------------------------------- /packages/tab-item/src/tab-item.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 31 | 32 | 64 | -------------------------------------------------------------------------------- /example/pages/tab-container.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 34 | 35 | 50 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING_en-us.md: -------------------------------------------------------------------------------- 1 | # Mint UI Contributing Guide 2 | 3 | Hi! Thank you for choosing Mint UI. 4 | 5 | Mint UI is a mobile component library for Vue.js. It provides abundant CSS and JS components for building mobile applications. With it, you can create web pages in cohesive style ever faster. 6 | 7 | We are excited that you are interested in contributing to Mint UI. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines. 8 | 9 | ## Issue Guidelines 10 | - Issues are exclusively for bug reports and feature requests. Other questions may be closed directly. 11 | 12 | - Before submitting an issue, please check if similar problems have already been issued. 13 | 14 | - Please specify which version of Mint UI you are using, and provide OS and browser information. [JSFiddle](https://jsfiddle.net/) is recommended to build a live demo so that your issue can be reproduced clearly. 15 | 16 | ## Pull Request Guidelines 17 | - Fork this repository to your own account. Do not create branches here. 18 | 19 | - **DO NOT** include files inside `lib` directory. 20 | 21 | - Rebase before creating a PR to keep commit history clear. 22 | 23 | - If you are fixing a bug, please include detailed description of the bug in the PR. 24 | 25 | - Merging a PR takes two maintainers: one approves the changes after reviewing, and then the other reviews and merges. 26 | 27 | ## Code Style 28 | Just comply with the [ESLint](https://github.com/ElemeFE/eslint-config-elemefe) configuration of [ElemeFE](https://github.com/elemefe). 29 | -------------------------------------------------------------------------------- /example/pages/field.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 39 | -------------------------------------------------------------------------------- /example/pages/indicator.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 27 | 28 | 54 | -------------------------------------------------------------------------------- /packages/spinner/src/spinner/triple-bounce.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 32 | 33 | 60 | -------------------------------------------------------------------------------- /example/pages/badge.vue: -------------------------------------------------------------------------------- 1 | 40 | 41 | 46 | 47 | 52 | -------------------------------------------------------------------------------- /example/pages/lazyload.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 39 | 40 | -------------------------------------------------------------------------------- /packages/navbar/src/navbar.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 39 | 40 | 71 | -------------------------------------------------------------------------------- /packages/range/src/draggable.js: -------------------------------------------------------------------------------- 1 | let isDragging = false; 2 | import Vue from 'vue'; 3 | const supportTouch = !Vue.prototype.$isServer && 'ontouchstart' in window; 4 | 5 | export default function(element, options) { 6 | const moveFn = function(event) { 7 | if (options.drag) { 8 | options.drag(supportTouch ? event.changedTouches[0] || event.touches[0] : event); 9 | } 10 | }; 11 | 12 | const endFn = function(event) { 13 | if (!supportTouch) { 14 | document.removeEventListener('mousemove', moveFn); 15 | document.removeEventListener('mouseup', endFn); 16 | } 17 | document.onselectstart = null; 18 | document.ondragstart = null; 19 | 20 | isDragging = false; 21 | 22 | if (options.end) { 23 | options.end(supportTouch ? event.changedTouches[0] || event.touches[0] : event); 24 | } 25 | }; 26 | 27 | element.addEventListener(supportTouch ? 'touchstart' : 'mousedown', function(event) { 28 | if (isDragging) return; 29 | event.preventDefault(); 30 | document.onselectstart = function() { return false; }; 31 | document.ondragstart = function() { return false; }; 32 | 33 | if (!supportTouch) { 34 | document.addEventListener('mousemove', moveFn); 35 | document.addEventListener('mouseup', endFn); 36 | } 37 | isDragging = true; 38 | 39 | if (options.start) { 40 | options.start(supportTouch ? event.changedTouches[0] || event.touches[0] : event); 41 | } 42 | }); 43 | 44 | if (supportTouch) { 45 | element.addEventListener('touchmove', moveFn); 46 | element.addEventListener('touchend', endFn); 47 | element.addEventListener('touchcancel', endFn); 48 | } 49 | }; 50 | -------------------------------------------------------------------------------- /packages/picker/src/draggable.js: -------------------------------------------------------------------------------- 1 | let isDragging = false; 2 | import Vue from 'vue'; 3 | 4 | const supportTouch = !Vue.prototype.$isServer && 'ontouchstart' in window; 5 | 6 | export default function(element, options) { 7 | const moveFn = function(event) { 8 | if (options.drag) { 9 | options.drag(supportTouch ? event.changedTouches[0] || event.touches[0] : event); 10 | } 11 | }; 12 | 13 | const endFn = function(event) { 14 | if (!supportTouch) { 15 | document.removeEventListener('mousemove', moveFn); 16 | document.removeEventListener('mouseup', endFn); 17 | } 18 | document.onselectstart = null; 19 | document.ondragstart = null; 20 | 21 | isDragging = false; 22 | 23 | if (options.end) { 24 | options.end(supportTouch ? event.changedTouches[0] || event.touches[0] : event); 25 | } 26 | }; 27 | 28 | element.addEventListener(supportTouch ? 'touchstart' : 'mousedown', function(event) { 29 | if (isDragging) return; 30 | document.onselectstart = function() { return false; }; 31 | document.ondragstart = function() { return false; }; 32 | 33 | if (!supportTouch) { 34 | document.addEventListener('mousemove', moveFn); 35 | document.addEventListener('mouseup', endFn); 36 | } 37 | isDragging = true; 38 | 39 | if (options.start) { 40 | event.preventDefault(); 41 | options.start(supportTouch ? event.changedTouches[0] || event.touches[0] : event); 42 | } 43 | }); 44 | 45 | if (supportTouch) { 46 | element.addEventListener('touchmove', moveFn); 47 | element.addEventListener('touchend', endFn); 48 | element.addEventListener('touchcancel', endFn); 49 | } 50 | }; 51 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "font": "./src/assets/font/iconfont.css", 3 | "header": "./packages/header/index.js", 4 | "button": "./packages/button/index.js", 5 | "cell": "./packages/cell/index.js", 6 | "cell-swipe": "./packages/cell-swipe/index.js", 7 | "field": "./packages/field/index.js", 8 | "badge": "./packages/badge/index.js", 9 | "switch": "./packages/switch/index.js", 10 | "spinner": "./packages/spinner/index.js", 11 | "tab-item": "./packages/tab-item/index.js", 12 | "tab-container-item": "./packages/tab-container-item/index.js", 13 | "tab-container": "./packages/tab-container/index.js", 14 | "navbar": "./packages/navbar/index.js", 15 | "tabbar": "./packages/tabbar/index.js", 16 | "search": "./packages/search/index.js", 17 | "checklist": "./packages/checklist/index.js", 18 | "radio": "./packages/radio/index.js", 19 | "loadmore": "./packages/loadmore/index.js", 20 | "actionsheet": "./packages/actionsheet/index.js", 21 | "popup": "./packages/popup/index.js", 22 | "swipe": "./packages/swipe/index.js", 23 | "swipe-item": "./packages/swipe-item/index.js", 24 | "range": "./packages/range/index.js", 25 | "picker": "./packages/picker/index.js", 26 | "progress": "./packages/progress/index.js", 27 | "toast": "./packages/toast/index.js", 28 | "indicator": "./packages/indicator/index.js", 29 | "message-box": "./packages/message-box/index.js", 30 | "infinite-scroll": "./packages/infinite-scroll/index.js", 31 | "lazyload": "./packages/lazyload/index.js", 32 | "datetime-picker": "./packages/datetime-picker/index.js", 33 | "index-list": "./packages/index-list/index.js", 34 | "index-section": "./packages/index-section/index.js", 35 | "palette-button": "./packages/palette-button/index.js" 36 | } -------------------------------------------------------------------------------- /packages/actionsheet/README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | mint-actionsheet is an action sheet component for vue.js 3 | 4 | # Installation 5 | First, install `mint-actionsheet` from npm: 6 | ```bash 7 | $ npm install mint-actionsheet 8 | ``` 9 | 10 | Import it: 11 | ```Javascript 12 | require ('mint-actionsheet/lib/index.css'); 13 | 14 | // ES6 mudule 15 | import Actionsheet from 'mint-actionsheet'; 16 | 17 | // CommonJS 18 | const Actionsheet = require('mint-actionsheet').default; 19 | ``` 20 | 21 | Register component: 22 | ```Javascript 23 | Vue.component('actionsheet', Actionsheet); 24 | ``` 25 | 26 | Then use it: 27 | ```html 28 | 29 | ``` 30 | 31 | # Usage 32 | `actions` is an array of objects. Each object has two keys: `name` and `method`. `name` is the text showing on the sheet, and `method` (optional) is the callback when clicked. 33 | 34 | Sync `visible` with one of your vue instance variables. Toggle it to switch on/off the action sheet. 35 | 36 | # API 37 | | Option | Description | Value | Default | 38 | |--------------------|-------------------------------------------------------------------|---------|----------| 39 | | actions | array of actions | Array | | 40 | | visible | visibility of the action sheet | Boolean | 'false' | 41 | | cancelText | text of the cancel button | String | '取消' | 42 | | closeOnClickModal | determines if the action sheet turn off when the modal is clicked | Boolean | 'true' | 43 | 44 | # License 45 | MIT -------------------------------------------------------------------------------- /packages/toast/src/toast.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | 3 | const ToastConstructor = Vue.extend(require('./toast.vue')); 4 | let toastPool = []; 5 | 6 | let getAnInstance = () => { 7 | if (toastPool.length > 0) { 8 | let instance = toastPool[0]; 9 | toastPool.splice(0, 1); 10 | return instance; 11 | } 12 | return new ToastConstructor({ 13 | el: document.createElement('div') 14 | }); 15 | }; 16 | 17 | let returnAnInstance = instance => { 18 | if (instance) { 19 | toastPool.push(instance); 20 | } 21 | }; 22 | 23 | let removeDom = event => { 24 | if (event.target.parentNode) { 25 | event.target.parentNode.removeChild(event.target); 26 | } 27 | }; 28 | 29 | ToastConstructor.prototype.close = function() { 30 | this.visible = false; 31 | this.$el.addEventListener('transitionend', removeDom); 32 | this.closed = true; 33 | returnAnInstance(this); 34 | }; 35 | 36 | let Toast = (options = {}) => { 37 | let duration = options.duration || 3000; 38 | 39 | let instance = getAnInstance(); 40 | instance.closed = false; 41 | clearTimeout(instance.timer); 42 | instance.message = typeof options === 'string' ? options : options.message; 43 | instance.position = options.position || 'middle'; 44 | instance.className = options.className || ''; 45 | instance.iconClass = options.iconClass || ''; 46 | 47 | document.body.appendChild(instance.$el); 48 | Vue.nextTick(function() { 49 | instance.visible = true; 50 | instance.$el.removeEventListener('transitionend', removeDom); 51 | ~duration && (instance.timer = setTimeout(function() { 52 | if (instance.closed) return; 53 | instance.close(); 54 | }, duration)); 55 | }); 56 | return instance; 57 | }; 58 | 59 | export default Toast; 60 | -------------------------------------------------------------------------------- /example/pages/index-list.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 31 | 32 | 53 | -------------------------------------------------------------------------------- /packages/progress/src/progress.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 59 | 60 | 73 | -------------------------------------------------------------------------------- /example/pages/action-sheet.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 29 | 30 | 72 | -------------------------------------------------------------------------------- /packages/tabbar/src/tabbar.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 41 | 42 | 69 | -------------------------------------------------------------------------------- /packages/badge/src/badge.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 39 | 84 | -------------------------------------------------------------------------------- /packages/spinner/README.md: -------------------------------------------------------------------------------- 1 | # mint-spinner 2 | > spinner. 3 | 4 | ## Install 5 | ```shell 6 | npm i mint-spinner -S 7 | ``` 8 | 9 | ## Required 10 | ```shell 11 | npm i babel-plugin-component -D 12 | ``` 13 | 14 | ## Usage 15 | import all spinner 16 | ```javascript 17 | import Vue from 'vue'; 18 | import Spinner from 'mint-spinner'; 19 | 20 | Vue.use(Spinner); 21 | ``` 22 | 23 | ```html 24 | 25 | ``` 26 | 27 | import one spinner 28 | 29 | ```javascript 30 | import Vue from 'vue'; 31 | import { DoubleBounce } from 'mint-spinner'; 32 | 33 | Vue.component(DoubleBounce.name, DoubleBounce); 34 | ``` 35 | 36 | ```html 37 | 38 | ``` 39 | 40 | .babelrc 41 | ```json 42 | { 43 | "plugins": [ 44 | "xxx", 45 | ["component", [ 46 | { 47 | "libraryName": "mint-spinner", 48 | "style": true 49 | } 50 | ] 51 | ] 52 | ] 53 | } 54 | ``` 55 | 56 | **`import Spinner from 'mint-spinner'` and `import { DoubleBounce } from 'mint-spinner'` can not be used together.**. 57 | 58 | ## Spinner 59 | - snake 60 | - double-bounce 61 | - triple-bounce 62 | - fading-circle 63 | 64 | ## API 65 | 66 | ### color 67 | - type: String 68 | 69 | ### size 70 | - type: Number 71 | 72 | ### type 73 | - type: String|Number 74 | 75 | ```html 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | ``` 88 | 89 | ## Development 90 | 91 | ```shell 92 | make dev 93 | ``` 94 | 95 | ## Production 96 | ``` 97 | make dist 98 | ``` 99 | 100 | ## License 101 | MIT 102 | -------------------------------------------------------------------------------- /example/pages/header.vue: -------------------------------------------------------------------------------- 1 | 43 | 44 | 61 | 62 | 76 | -------------------------------------------------------------------------------- /packages/spinner/src/spinner.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 76 | -------------------------------------------------------------------------------- /example/pages/button.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 48 | 49 | 64 | -------------------------------------------------------------------------------- /example/pages/checklist.vue: -------------------------------------------------------------------------------- 1 | 48 | 49 | 89 | 90 | 95 | -------------------------------------------------------------------------------- /example/pages/tabbar.vue: -------------------------------------------------------------------------------- 1 | 50 | 51 | 61 | 62 | 74 | -------------------------------------------------------------------------------- /packages/popup/README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | mint-popup is a popup component for vue.js 3 | 4 | # Installation 5 | First, install `mint-popup` from npm: 6 | ```bash 7 | $ npm install mint-popup 8 | ``` 9 | 10 | Import it: 11 | ```Javascript 12 | require ('mint-popup/lib/index.css'); 13 | 14 | // ES6 mudule 15 | import Popup from 'mint-popup'; 16 | 17 | // CommonJS 18 | const Popup = require('mint-popup').default; 19 | ``` 20 | 21 | Register component: 22 | ```Javascript 23 | Vue.component('popup', Popup); 24 | ``` 25 | 26 | Then use it: 27 | ```html 28 | 29 | ``` 30 | 31 | # Usage 32 | `position` defines the location of the popup. If it's `bottom`, when you switch on the popup, it'll slide into the screen from the bottom and become fixed at the bottom. 33 | 34 | If the `position` attribute is omitted, the popup will be located at the center of the viewport (and of course you can relocate it using CSS). In this case, you may want to set its `popup-transition` attribute to `popup-fade` so that it'll have a fading effect when switched on/off. 35 | 36 | Sync `visible` with one of your vue instance variables. Toggle it to switch on/off the popup. 37 | 38 | # API 39 | | Option | Description | Value | Default | 40 | |-------------------|-------------------------------------------------------------|-------------------------------|---------------| 41 | | visible | visibility of the popup | Boolean | 'false' | 42 | | position | location of the popup | 'top' 'right' 'bottom' 'left' | | 43 | | pop-transition | CSS transition of the popup | 'popup-fade' 'popup-slide' | 'popup-slide' | 44 | | modal | determines if a modal pops with the popup | Boolean | true | 45 | | closeOnClickModal | determines if the popup turns off when the modal is clicked | Boolean | true | 46 | 47 | # License 48 | MIT 49 | -------------------------------------------------------------------------------- /packages/spinner/src/spinner/fading-circle.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 37 | 38 | 74 | -------------------------------------------------------------------------------- /example/pages/swipe.vue: -------------------------------------------------------------------------------- 1 | 38 | 39 | 76 | -------------------------------------------------------------------------------- /packages/indicator/src/indicator.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 55 | 56 | 97 | -------------------------------------------------------------------------------- /example/pages/infinite-scroll.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 56 | 57 | 89 | -------------------------------------------------------------------------------- /packages/header/src/header.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 40 | 41 | 103 | -------------------------------------------------------------------------------- /example/pages/progress.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 63 | 64 | -------------------------------------------------------------------------------- /example/pages/datetime-picker.vue: -------------------------------------------------------------------------------- 1 | 45 | 46 | 62 | 63 | 96 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mint-ui", 3 | "version": "2.2.3", 4 | "description": "Mobile UI elements for vue.js", 5 | "keywords": [ 6 | "component", 7 | "vue", 8 | "mobile", 9 | "eleme" 10 | ], 11 | "main": "lib/mint-ui.common.js", 12 | "style": "lib/style.css", 13 | "files": [ 14 | "lib", 15 | "src", 16 | "packages" 17 | ], 18 | "scripts": { 19 | "dev": "npm run bootstrap && npm run build:entry && cooking watch -c build/cooking.demo.js -p", 20 | "bootstrap": "yarn || npm i", 21 | "dist": "npm run clean && npm run build:entry && npm run lint && cooking build -c build/cooking.conf.js,build/cooking.common.js,build/cooking.component.js -p", 22 | "deploy": "npm run build:entry && cooking build -c build/cooking.demo.js -p && gh-pages -d example/dist --remote eleme", 23 | "build:entry": "node build/bin/build-entry", 24 | "pub": "sh build/release.sh", 25 | "pub:all": "node build/bin/build-all.js && lerna publish", 26 | "clean": "rimraf lib && rimraf packages/*/lib", 27 | "lint": "eslint src/**/*.js packages/**/*.{js,vue} build/**/*.js --quiet" 28 | }, 29 | "repository": { 30 | "type": "git", 31 | "url": "git+https://github.com/ElemeFE/mint-ui.git" 32 | }, 33 | "homepage": "https://github.com/ElemeFE/mint-ui#readme", 34 | "bugs": { 35 | "url": "https://github.com/ElemeFE/mint-ui/issues" 36 | }, 37 | "author": "elemefe", 38 | "license": "MIT", 39 | "dependencies": { 40 | "array-find-index": "^1.0.2", 41 | "raf.js": "0.0.4", 42 | "vue-lazyload": "^1.0.1" 43 | }, 44 | "peerDependencies": { 45 | "vue": "^2.1.8" 46 | }, 47 | "devDependencies": { 48 | "cooking": "^1.2.4", 49 | "cooking-buble": "^0.1.2", 50 | "cooking-lint": "^0.1.2", 51 | "cooking-saladcss": "^0.4.0", 52 | "cooking-vue2": "^0.2.2", 53 | "css-loader": "^0.25.0", 54 | "eslint": "^3.12.2", 55 | "extract-text-webpack-plugin": "beta", 56 | "fastclick": "^1.0.6", 57 | "file-loader": "^0.9.0", 58 | "gh-pages": "^0.11.0", 59 | "html-loader": "^0.4.3", 60 | "html-webpack-plugin": "^2.22.0", 61 | "json-loader": "^0.5.4", 62 | "json-templater": "^1.0.4", 63 | "lerna": "2.0.0-beta.18", 64 | "my-local-ip": "^1.0.0", 65 | "postcss": "^5.2.0", 66 | "postcss-loader": "^0.13.0", 67 | "rimraf": "^2.5.4", 68 | "style-loader": "^0.13.1", 69 | "uppercamelcase": "^1.1.0", 70 | "url-loader": "^0.5.7", 71 | "vue": "^2.1.8", 72 | "vue-loader": "10", 73 | "vue-router": "^2.0.0", 74 | "vue-template-compiler": "^2.1.8", 75 | "vue-template-es2015-compiler": "^1.4.2", 76 | "webpack": "beta", 77 | "webpack-dev-server": "beta", 78 | "webpack-shell-plugin": "^0.4.3" 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /packages/switch/src/switch.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 38 | 39 | 110 | -------------------------------------------------------------------------------- /packages/toast/src/toast.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 59 | 60 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mint UI 2 | 3 | [![Build Status](https://travis-ci.org/ElemeFE/mint-ui.svg?branch=master)](https://travis-ci.org/ElemeFE/mint-ui) 4 | [![npm](https://img.shields.io/npm/v/mint-ui.svg?maxAge=3600)](https://www.npmjs.com/package/mint-ui) 5 | [![NPM downloads](http://img.shields.io/npm/dm/mint-ui.svg)](https://npmjs.org/package/mint-ui) 6 | ![JS gzip size](http://img.badgesize.io/elemefe/mint-ui/master/lib/index.js.svg?compression=gzip&label=gzip%20size:%20JS) 7 | ![CSS gzip size](http://img.badgesize.io/elemefe/mint-ui/master/lib/style.css.svg?compression=gzip&label=gzip%20size:%20CSS) 8 | [![Join the chat at https://gitter.im/ElemeFE/mint-ui](https://badges.gitter.im/ElemeFE/mint-ui.svg)](https://gitter.im/ElemeFE/mint-ui?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 9 | 10 | > Mobile UI elements for **Vue 2.0** 11 | 12 | - [Homepage](http://mint-ui.github.io) 13 | - [Documentation](http://mint-ui.github.io/docs) 14 | 15 | ## Installation 16 | ```shell 17 | npm i mint-ui -S 18 | 19 | # for Vue 1.x 20 | npm i mint-ui@1 -S 21 | ``` 22 | 23 | ## Usage 24 | 25 | Import all components. 26 | 27 | ```javascript 28 | import Vue from 'vue' 29 | import Mint from 'mint-ui'; 30 | 31 | Vue.use(Mint); 32 | ``` 33 | 34 | Or import specified component. (Use [babel-plugin-component](https://www.npmjs.com/package/babel-plugin-component)) 35 | 36 | ```javascript 37 | import { Cell, Checklist } from 'mint-ui'; 38 | 39 | Vue.component(Cell.name, Cell); 40 | Vue.component(Checklist.name, Checklist); 41 | ``` 42 | 43 | 44 | Equals to 45 | 46 | ```javascript 47 | import Vue from 'vue'; 48 | import Mint from 'mint-ui'; 49 | import 'mint-ui/lib/style.css'; 50 | 51 | Vue.use(Mint); 52 | 53 | // import specified component 54 | 55 | import MtRadio from 'mint-ui/lib/radio'; 56 | import 'mint-ui/lib/radio/style.css'; 57 | 58 | Vue.component(MtRadio.name, MtRadio); 59 | ``` 60 | 61 | ## babel-plugin-component 62 | - Auto import css file 63 | - Modular import component 64 | 65 | Installation 66 | ```shell 67 | npm i babel-plugin-component -D 68 | ``` 69 | 70 | Usage 71 | 72 | .babelrc 73 | ```json 74 | { 75 | "plugins": ["other-plugin", ["component", [ 76 | { "libraryName": "mint-ui", "style": true } 77 | ]]] 78 | } 79 | ``` 80 | 81 | ## CDN 82 | RawGit 83 | 84 | - https://cdn.rawgit.com/ElemeFE/mint-ui/master/lib/index.js 85 | - https://cdn.rawgit.com/ElemeFE/mint-ui/master/lib/style.css 86 | 87 | NPMCDN 88 | 89 | - https://unpkg.com/mint-ui/lib/index.js 90 | - https://unpkg.com/mint-ui/lib/style.css 91 | 92 | ## Development 93 | 94 | ```shell 95 | npm run dev 96 | ``` 97 | 98 | ## Contribution 99 | Please make sure to read the [Contributing Guide](https://github.com/ElemeFE/mint-ui/blob/master/.github/CONTRIBUTING_en-us.md) before making a pull request. 100 | 101 | ## License 102 | MIT 103 | -------------------------------------------------------------------------------- /packages/picker/README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | vue-picker is a multi-slot picker based on vue.js. 3 | 4 | # Install 5 | 6 | ```Bash 7 | npm install vue-picker --save 8 | ``` 9 | 10 | ```JavaScript 11 | require ('mint-picker/lib/index.css'); 12 | 13 | // ES6 mudule 14 | import Picker from 'mint-picker'; 15 | 16 | // CommonJS 17 | const Picker = require('mint-picker').default; 18 | ``` 19 | Register component: 20 | ```Javascript 21 | Vue.component('picker', Picker); 22 | ``` 23 | 24 | # Usage 25 | 26 | ```HTML 27 | 28 | 29 | 30 | 31 | 32 | ``` 33 | 34 | ```JavaScript 35 | export default { 36 | methods: { 37 | onValuesChange(picker, values) { 38 | if (values[0] > values[1]) { 39 | picker.setSlotValue(1, values[0]); 40 | } 41 | } 42 | }, 43 | 44 | data() { 45 | return { 46 | slots: [ 47 | { 48 | flex: 1, 49 | values: ['2015-01', '2015-02', '2015-03', '2015-04', '2015-05', '2015-06'], 50 | className: 'slot1', 51 | textAlign: 'right' 52 | }, { 53 | divider: true, 54 | content: '-', 55 | className: 'slot2' 56 | }, { 57 | flex: 1, 58 | values: ['2015-01', '2015-02', '2015-03', '2015-04', '2015-05', '2015-06'], 59 | className: 'slot3', 60 | textAlign: 'left' 61 | } 62 | ] 63 | }; 64 | } 65 | }; 66 | ``` 67 | 68 | # Options 69 | 70 | Picker Options: 71 | 72 | | Option | Description | 73 | | ----- | ----- | 74 | | slots | Array(default: []) the slot config of picker. | 75 | | showToolbar | Boolean(default: false) show a toolbar on top of picker when showToolbar is true. | 76 | | visibleItemCount | Number(default: 5) visible item count of each slot. | 77 | | rotateEffect | Boolean(default: false) use rotate effect on picker item when rotateEffect is true. | 78 | | itemHeight | Number(default: 36) height of each slot. | 79 | 80 | Picker Methods: 81 | 82 | - getSlotValue(index): get the value of specific slot. 83 | - setSlotValue(index, value): set the value of specific slot. 84 | - getSlotValues(index): get the values of specific slot. 85 | - setSlotValues(index, values): set the values of specific slot. 86 | - getValues(): values of all slots except divider slots. 87 | - setValues(values): set values(Array) of all slots except divider slots. 88 | 89 | Picker Slot Options: 90 | 91 | | Option | Description | 92 | | ----- | ----- | 93 | | divider | Boolean(default: false) - just a divider slot when divider is true. | 94 | | content | String - text content in divider slot. | 95 | | values | values of this slot. | 96 | | textAlign | text align of this slot's item. | 97 | | flex | the style.flex value of this slot. | 98 | | className | className of this slot. | 99 | 100 | # License 101 | MIT -------------------------------------------------------------------------------- /example/pages/palette-button.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 45 | 46 | 69 | -------------------------------------------------------------------------------- /example/pages/pull-down.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 68 | 69 | 106 | -------------------------------------------------------------------------------- /packages/actionsheet/src/actionsheet.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 55 | 56 | 127 | -------------------------------------------------------------------------------- /example/pages/pull-up.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 67 | 68 | 110 | -------------------------------------------------------------------------------- /example/pages/range.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 55 | 56 | -------------------------------------------------------------------------------- /packages/picker/src/translate.js: -------------------------------------------------------------------------------- 1 | var exportObj = {}; 2 | import Vue from 'vue'; 3 | if (!Vue.prototype.$isServer) { 4 | var docStyle = document.documentElement.style; 5 | var engine; 6 | var translate3d = false; 7 | 8 | if (window.opera && Object.prototype.toString.call(opera) === '[object Opera]') { 9 | engine = 'presto'; 10 | } else if ('MozAppearance' in docStyle) { 11 | engine = 'gecko'; 12 | } else if ('WebkitAppearance' in docStyle) { 13 | engine = 'webkit'; 14 | } else if (typeof navigator.cpuClass === 'string') { 15 | engine = 'trident'; 16 | } 17 | 18 | var cssPrefix = {trident: '-ms-', gecko: '-moz-', webkit: '-webkit-', presto: '-o-'}[engine]; 19 | 20 | var vendorPrefix = {trident: 'ms', gecko: 'Moz', webkit: 'Webkit', presto: 'O'}[engine]; 21 | 22 | var helperElem = document.createElement('div'); 23 | var perspectiveProperty = vendorPrefix + 'Perspective'; 24 | var transformProperty = vendorPrefix + 'Transform'; 25 | var transformStyleName = cssPrefix + 'transform'; 26 | var transitionProperty = vendorPrefix + 'Transition'; 27 | var transitionStyleName = cssPrefix + 'transition'; 28 | var transitionEndProperty = vendorPrefix.toLowerCase() + 'TransitionEnd'; 29 | 30 | if (helperElem.style[perspectiveProperty] !== undefined) { 31 | translate3d = true; 32 | } 33 | 34 | var getTranslate = function(element) { 35 | var result = {left: 0, top: 0}; 36 | if (element === null || element.style === null) return result; 37 | 38 | var transform = element.style[transformProperty]; 39 | var matches = /translate\(\s*(-?\d+(\.?\d+?)?)px,\s*(-?\d+(\.\d+)?)px\)\s*translateZ\(0px\)/ig.exec(transform); 40 | if (matches) { 41 | result.left = +matches[1]; 42 | result.top = +matches[3]; 43 | } 44 | 45 | return result; 46 | }; 47 | 48 | var translateElement = function(element, x, y) { 49 | if (x === null && y === null) return; 50 | 51 | if (element === null || element === undefined || element.style === null) return; 52 | 53 | if (!element.style[transformProperty] && x === 0 && y === 0) return; 54 | 55 | if (x === null || y === null) { 56 | var translate = getTranslate(element); 57 | if (x === null) { 58 | x = translate.left; 59 | } 60 | if (y === null) { 61 | y = translate.top; 62 | } 63 | } 64 | 65 | cancelTranslateElement(element); 66 | 67 | if (translate3d) { 68 | element.style[transformProperty] += ' translate(' + (x ? (x + 'px') : '0px') + ',' + (y ? (y + 'px') : '0px') + ') translateZ(0px)'; 69 | } else { 70 | element.style[transformProperty] += ' translate(' + (x ? (x + 'px') : '0px') + ',' + (y ? (y + 'px') : '0px') + ')'; 71 | } 72 | }; 73 | 74 | var cancelTranslateElement = function(element) { 75 | if (element === null || element.style === null) return; 76 | var transformValue = element.style[transformProperty]; 77 | if (transformValue) { 78 | transformValue = transformValue.replace(/translate\(\s*(-?\d+(\.?\d+?)?)px,\s*(-?\d+(\.\d+)?)px\)\s*translateZ\(0px\)/g, ''); 79 | element.style[transformProperty] = transformValue; 80 | } 81 | }; 82 | exportObj = { 83 | transformProperty: transformProperty, 84 | transformStyleName: transformStyleName, 85 | transitionProperty: transitionProperty, 86 | transitionStyleName: transitionStyleName, 87 | transitionEndProperty: transitionEndProperty, 88 | getElementTranslate: getTranslate, 89 | translateElement: translateElement, 90 | cancelTranslateElement: cancelTranslateElement 91 | }; 92 | }; 93 | 94 | export default exportObj ; 95 | -------------------------------------------------------------------------------- /packages/popup/src/popup.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 79 | 80 | -------------------------------------------------------------------------------- /packages/search/src/search.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 95 | 96 | 153 | -------------------------------------------------------------------------------- /packages/radio/src/radio.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 75 | 76 | 152 | -------------------------------------------------------------------------------- /example/nav.config.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "title": "JS Components", 4 | "list": [ 5 | { 6 | "path": "/toast", 7 | "name": "Toast", 8 | "icon": "toast" 9 | }, 10 | { 11 | "path": "/indicator", 12 | "name": "Indicator", 13 | "icon": "indicator" 14 | }, 15 | { 16 | "path": "/pull-down", 17 | "name": "Pull down", 18 | "icon": "pull-down" 19 | }, 20 | { 21 | "path": "/pull-up", 22 | "name": "Pull up", 23 | "icon": "pull-up" 24 | }, 25 | { 26 | "path": "/infinite-scroll", 27 | "name": "Infinite scroll", 28 | "icon": "infinite-scroll" 29 | }, 30 | { 31 | "path": "/message-box", 32 | "name": "Message box", 33 | "icon": "message-box" 34 | }, 35 | { 36 | "path": "/action-sheet", 37 | "name": "Action sheet", 38 | "icon": "action-sheet" 39 | }, 40 | { 41 | "path": "/popup", 42 | "name": "Popup", 43 | "icon": "popup" 44 | }, 45 | { 46 | "path": "/swipe", 47 | "name": "Swipe", 48 | "icon": "swipe" 49 | }, 50 | { 51 | "path": "/lazyload", 52 | "name": "Lazy load", 53 | "icon": "lazyload" 54 | }, 55 | { 56 | "path": "/range", 57 | "name": "Range", 58 | "icon": "range" 59 | }, 60 | { 61 | "path": "/progress", 62 | "name": "Progress", 63 | "icon": "progress" 64 | }, 65 | { 66 | "path": "/picker", 67 | "name": "Picker", 68 | "icon": "picker" 69 | }, 70 | { 71 | "path": "/datetime-picker", 72 | "name": "Datetime Picker", 73 | "icon": "time" 74 | }, 75 | { 76 | "path": "/index-list", 77 | "name": "Index List", 78 | "icon": "alphabet" 79 | }, 80 | { 81 | "path": "/palette-button", 82 | "name": "Palette Button", 83 | "icon": "alphabet" 84 | } 85 | ] 86 | }, 87 | { 88 | "title": "CSS Components", 89 | "list": [ 90 | { 91 | "path": "/header", 92 | "name": "Header", 93 | "icon": "header" 94 | }, 95 | { 96 | "path": "/tabbar", 97 | "name": "Tabbar", 98 | "icon": "tabbar" 99 | }, 100 | { 101 | "path": "/navbar", 102 | "name": "Navbar", 103 | "icon": "navbar" 104 | }, 105 | { 106 | "path": "/button", 107 | "name": "Button", 108 | "icon": "button" 109 | }, 110 | { 111 | "path": "/cell", 112 | "name": "Cell", 113 | "icon": "cell" 114 | }, 115 | { 116 | "path": "/cell-swipe", 117 | "name": "Cell Swipe", 118 | "icon": "cell" 119 | }, 120 | { 121 | "path": "/spinner", 122 | "name": "Spinner", 123 | "icon": "spinner" 124 | }, 125 | { 126 | "path": "/tab-container", 127 | "name": "TabContainer", 128 | "icon": "panel" 129 | }, 130 | { 131 | "path": "/search", 132 | "name": "Search", 133 | "icon": "searchbar" 134 | } 135 | ] 136 | }, 137 | { 138 | "title": "Form Components", 139 | "list": [ 140 | { 141 | "path": "/switch", 142 | "name": "Switch", 143 | "icon": "switch" 144 | }, 145 | { 146 | "path": "/checklist", 147 | "name": "Checklist", 148 | "icon": "checklist" 149 | }, 150 | { 151 | "path": "/radio", 152 | "name": "Radio", 153 | "icon": "radio" 154 | }, 155 | { 156 | "path": "/field", 157 | "name": "Field", 158 | "icon": "field" 159 | }, 160 | { 161 | "path": "/badge", 162 | "name": "Badge", 163 | "icon": "badge" 164 | } 165 | ] 166 | } 167 | ] -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import Header from '../packages/header'; 2 | import Button from '../packages/button'; 3 | import Cell from '../packages/cell'; 4 | import CellSwipe from '../packages/cell-swipe'; 5 | import Field from '../packages/field'; 6 | import Badge from '../packages/badge'; 7 | import Switch from '../packages/switch'; 8 | import Spinner from '../packages/spinner'; 9 | import TabItem from '../packages/tab-item'; 10 | import TabContainerItem from '../packages/tab-container-item'; 11 | import TabContainer from '../packages/tab-container'; 12 | import Navbar from '../packages/navbar'; 13 | import Tabbar from '../packages/tabbar'; 14 | import Search from '../packages/search'; 15 | import Checklist from '../packages/checklist'; 16 | import Radio from '../packages/radio'; 17 | import Loadmore from '../packages/loadmore'; 18 | import Actionsheet from '../packages/actionsheet'; 19 | import Popup from '../packages/popup'; 20 | import Swipe from '../packages/swipe'; 21 | import SwipeItem from '../packages/swipe-item'; 22 | import Range from '../packages/range'; 23 | import Picker from '../packages/picker'; 24 | import Progress from '../packages/progress'; 25 | import Toast from '../packages/toast'; 26 | import Indicator from '../packages/indicator'; 27 | import MessageBox from '../packages/message-box'; 28 | import InfiniteScroll from '../packages/infinite-scroll'; 29 | import Lazyload from '../packages/lazyload'; 30 | import DatetimePicker from '../packages/datetime-picker'; 31 | import IndexList from '../packages/index-list'; 32 | import IndexSection from '../packages/index-section'; 33 | import PaletteButton from '../packages/palette-button'; 34 | import '../src/assets/font/iconfont.css'; 35 | 36 | const version = '2.2.3'; 37 | const install = function(Vue) { 38 | if (install.installed) return; 39 | 40 | Vue.component(Header.name, Header); 41 | Vue.component(Button.name, Button); 42 | Vue.component(Cell.name, Cell); 43 | Vue.component(CellSwipe.name, CellSwipe); 44 | Vue.component(Field.name, Field); 45 | Vue.component(Badge.name, Badge); 46 | Vue.component(Switch.name, Switch); 47 | Vue.component(Spinner.name, Spinner); 48 | Vue.component(TabItem.name, TabItem); 49 | Vue.component(TabContainerItem.name, TabContainerItem); 50 | Vue.component(TabContainer.name, TabContainer); 51 | Vue.component(Navbar.name, Navbar); 52 | Vue.component(Tabbar.name, Tabbar); 53 | Vue.component(Search.name, Search); 54 | Vue.component(Checklist.name, Checklist); 55 | Vue.component(Radio.name, Radio); 56 | Vue.component(Loadmore.name, Loadmore); 57 | Vue.component(Actionsheet.name, Actionsheet); 58 | Vue.component(Popup.name, Popup); 59 | Vue.component(Swipe.name, Swipe); 60 | Vue.component(SwipeItem.name, SwipeItem); 61 | Vue.component(Range.name, Range); 62 | Vue.component(Picker.name, Picker); 63 | Vue.component(Progress.name, Progress); 64 | Vue.component(DatetimePicker.name, DatetimePicker); 65 | Vue.component(IndexList.name, IndexList); 66 | Vue.component(IndexSection.name, IndexSection); 67 | Vue.component(PaletteButton.name, PaletteButton); 68 | Vue.use(InfiniteScroll); 69 | Vue.use(Lazyload, { 70 | loading: require('./assets/loading-spin.svg'), 71 | try: 3 72 | }); 73 | 74 | Vue.$messagebox = Vue.prototype.$messagebox = MessageBox; 75 | Vue.$toast = Vue.prototype.$toast = Toast; 76 | Vue.$indicator = Vue.prototype.$indicator = Indicator; 77 | }; 78 | 79 | // auto install 80 | if (typeof window !== 'undefined' && window.Vue) { 81 | install(window.Vue); 82 | }; 83 | 84 | module.exports = { 85 | install, 86 | version, 87 | Header, 88 | Button, 89 | Cell, 90 | CellSwipe, 91 | Field, 92 | Badge, 93 | Switch, 94 | Spinner, 95 | TabItem, 96 | TabContainerItem, 97 | TabContainer, 98 | Navbar, 99 | Tabbar, 100 | Search, 101 | Checklist, 102 | Radio, 103 | Loadmore, 104 | Actionsheet, 105 | Popup, 106 | Swipe, 107 | SwipeItem, 108 | Range, 109 | Picker, 110 | Progress, 111 | Toast, 112 | Indicator, 113 | MessageBox, 114 | InfiniteScroll, 115 | Lazyload, 116 | DatetimePicker, 117 | IndexList, 118 | IndexSection, 119 | PaletteButton 120 | }; 121 | -------------------------------------------------------------------------------- /packages/checklist/src/checklist.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 84 | 85 | 169 | -------------------------------------------------------------------------------- /packages/button/src/button.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 80 | 81 | 173 | -------------------------------------------------------------------------------- /example/pages/popup.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 101 | 102 | 156 | -------------------------------------------------------------------------------- /packages/range/src/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 77 | 78 | 168 | --------------------------------------------------------------------------------