├── examples ├── assets │ ├── styles │ │ ├── common.css │ │ └── fonts │ │ │ ├── icomoon.eot │ │ │ ├── icomoon.ttf │ │ │ ├── icomoon.woff │ │ │ └── style.css │ └── images │ │ ├── guide.png │ │ ├── qrcode.png │ │ ├── stars.png │ │ ├── feedback.png │ │ ├── navbar_0.png │ │ ├── navbar_1.png │ │ ├── navbar_2.png │ │ ├── navbar_3.png │ │ ├── resource.png │ │ ├── component.png │ │ ├── consistency.png │ │ ├── efficiency.png │ │ ├── hamburger.png │ │ ├── element-demo.jpeg │ │ └── controllability.png ├── favicon.ico ├── i18n │ ├── route.json │ ├── title.json │ └── component.json ├── docs │ ├── zh-CN │ │ ├── home.md │ │ ├── breadcrumb.md │ │ ├── i18n.md │ │ └── installation.md │ └── en-US │ │ ├── home.md │ │ ├── icon.md │ │ ├── breadcrumb.md │ │ ├── i18n.md │ │ └── installation.md ├── play.js ├── play │ ├── component.vue │ └── index.vue ├── icon.json ├── dom │ └── class.js ├── index.tpl ├── entry.js └── pages │ └── template │ ├── component.tpl │ └── guide.tpl ├── packages ├── theme-default │ ├── src │ │ ├── submenu.css │ │ ├── button-group.css │ │ ├── form-item.css │ │ ├── menu-item.css │ │ ├── radio-button.css │ │ ├── radio-group.css │ │ ├── tab-pane.css │ │ ├── breadcrumb-item.css │ │ ├── checkbox-group.css │ │ ├── dropdown-item.css │ │ ├── dropdown-menu.css │ │ ├── menu-item-group.css │ │ ├── base.css │ │ ├── fonts │ │ │ ├── element-icons.eot │ │ │ ├── element-icons.ttf │ │ │ └── element-icons.woff │ │ ├── time-picker.css │ │ ├── steps.css │ │ ├── date-picker.css │ │ ├── option-group.css │ │ ├── card.css │ │ ├── core │ │ │ ├── tag.css │ │ │ ├── dropdown.css │ │ │ ├── input.css │ │ │ └── option.css │ │ ├── date-picker │ │ │ ├── time-range-picker.css │ │ │ ├── month-table.css │ │ │ ├── year-table.css │ │ │ ├── time-spinner.css │ │ │ ├── date-table.css │ │ │ └── time-picker.css │ │ ├── row.css │ │ ├── time-select.css │ │ ├── spinner.css │ │ ├── breadcrumb.css │ │ ├── badge.css │ │ ├── rate.css │ │ ├── cascader.css │ │ ├── option.css │ │ ├── index.css │ │ ├── select-dropdown.css │ │ ├── mixins │ │ │ └── _button.css │ │ ├── dropdown.css │ │ ├── loading.css │ │ ├── message.css │ │ ├── table-column.css │ │ └── form.css │ ├── .gitignore │ ├── salad.config.json │ ├── gulpfile.js │ ├── README.md │ └── package.json ├── pagination │ ├── README.md │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── message │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ ├── src │ │ └── main.js │ └── assets │ │ └── success.svg ├── message-box │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── notification │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── loading │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── loading.vue ├── popover │ ├── src │ │ └── directive.js │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── card │ ├── index.js │ ├── package.json │ ├── src │ │ └── main.vue │ └── cooking.conf.js ├── rate │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── tag │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── tag.vue ├── tree │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── alert │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── badge │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── main.vue ├── form │ ├── index.js │ ├── _index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── form.vue ├── menu │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ ├── _index.js │ └── src │ │ ├── menu-mixin.js │ │ ├── menu-item-group.vue │ │ └── menu-item.vue ├── radio │ ├── index.js │ ├── _index.js │ ├── package.json │ ├── cooking.conf.js │ ├── src │ │ ├── radio-group.vue │ │ ├── radio-button.vue │ │ └── radio.vue │ └── README.md ├── row │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── row.vue ├── step │ └── index.js ├── steps │ ├── index.js │ ├── _index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── steps.vue ├── tabs │ ├── index.js │ ├── _index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── tab-pane.vue ├── upload │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── upload-list.vue ├── icon │ ├── index.js │ └── src │ │ └── icon.vue ├── select │ ├── index.js │ ├── _index.js │ ├── cooking.conf.js │ ├── package.json │ └── src │ │ ├── option-group.vue │ │ └── select-dropdown.vue ├── slider │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── col │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── col.js ├── input │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── README.md ├── table │ ├── index.js │ ├── _index.js │ ├── package.json │ ├── cooking.conf.js │ ├── src │ │ └── dropdown.js │ └── README.md ├── tooltip │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── main.vue ├── button │ ├── index.js │ ├── _index.js │ ├── src │ │ ├── button-group.vue │ │ └── button.vue │ ├── package.json │ └── cooking.conf.js ├── spinner │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ └── spinner.vue ├── dialog │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── README.md ├── option │ └── index.js ├── switch │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── README.md ├── tab-pane │ └── index.js ├── dropdown │ ├── index.js │ ├── package.json │ ├── cooking.conf.js │ └── src │ │ ├── dropdown-item.vue │ │ └── dropdown-menu.vue ├── progress │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── submenu │ └── index.js ├── form-item │ └── index.js ├── menu-item │ └── index.js ├── breadcrumb │ ├── index.js │ ├── src │ │ ├── breadcrumb.vue │ │ └── breadcrumb-item.vue │ ├── package.json │ └── cooking.conf.js ├── checkbox │ ├── index.js │ ├── _index.js │ ├── package.json │ ├── cooking.conf.js │ ├── src │ │ └── checkbox-group.vue │ └── README.md ├── radio-group │ └── index.js ├── date-picker │ ├── index.js │ ├── src │ │ └── picker │ │ │ ├── time-select.js │ │ │ ├── time-picker.js │ │ │ └── date-picker.js │ ├── _index.js │ ├── package.json │ ├── cooking.conf.js │ └── README.md ├── input-number │ ├── index.js │ ├── cooking.conf.js │ ├── package.json │ └── README.md ├── radio-button │ └── index.js ├── time-picker │ └── index.js ├── time-select │ └── index.js ├── autocomplete │ ├── index.js │ ├── package.json │ └── cooking.conf.js ├── button-group │ └── index.js ├── option-group │ └── index.js ├── table-column │ └── index.js ├── dropdown-item │ └── index.js ├── dropdown-menu │ └── index.js ├── menu-item-group │ └── index.js ├── checkbox-group │ └── index.js └── breadcrumb-item │ └── index.js ├── .gitattributes ├── .eslintignore ├── lerna.json ├── src ├── mixins │ ├── locale.js │ ├── emitter.js │ └── migrating.js ├── utils │ ├── merge.js │ ├── clickoutside.js │ └── sync.js └── locale │ ├── index.js │ ├── format.js │ └── lang │ ├── zh-CN.js │ ├── zh-TW.js │ └── ko.js ├── .gitignore ├── .eslintrc ├── .babelrc ├── .github ├── PULL_REQUEST_TEMPLATE.md ├── ISSUE_TEMPLATE.md └── CONTRIBUTING.md ├── test └── unit │ ├── index.js │ ├── specs │ ├── breadcrumb.spec.js │ ├── card.spec.js │ ├── badge.spec.js │ ├── row.spec.js │ └── message.spec.js │ └── karma.conf.js ├── LICENSE ├── .travis.yml ├── CHANGELOG.en-US.md └── Makefile /examples/assets/styles/common.css: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /packages/theme-default/src/submenu.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/theme-default/src/button-group.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/theme-default/src/form-item.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/theme-default/src/menu-item.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/theme-default/src/radio-button.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/theme-default/src/radio-group.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/theme-default/src/tab-pane.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/theme-default/src/breadcrumb-item.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/theme-default/src/checkbox-group.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/theme-default/src/dropdown-item.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/theme-default/src/dropdown-menu.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/theme-default/src/menu-item-group.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | test/**/*.js linguist-language=Vue 2 | -------------------------------------------------------------------------------- /packages/pagination/README.md: -------------------------------------------------------------------------------- 1 | ## el-pagination 2 | -------------------------------------------------------------------------------- /packages/theme-default/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | npm-debug* 4 | -------------------------------------------------------------------------------- /examples/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/favicon.ico -------------------------------------------------------------------------------- /packages/message/index.js: -------------------------------------------------------------------------------- 1 | import Message from './src/main.js'; 2 | export default Message; 3 | -------------------------------------------------------------------------------- /packages/theme-default/src/base.css: -------------------------------------------------------------------------------- 1 | @import "./common/transition.css"; 2 | @import "./icon.css"; 3 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | src/utils/popper.js 2 | src/utils/date.js 3 | *.sh 4 | node_modules 5 | lib 6 | coverage 7 | -------------------------------------------------------------------------------- /packages/message-box/index.js: -------------------------------------------------------------------------------- 1 | import MessageBox from './src/main.js'; 2 | export default MessageBox; 3 | -------------------------------------------------------------------------------- /examples/assets/images/guide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/guide.png -------------------------------------------------------------------------------- /examples/assets/images/qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/qrcode.png -------------------------------------------------------------------------------- /examples/assets/images/stars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/stars.png -------------------------------------------------------------------------------- /packages/notification/index.js: -------------------------------------------------------------------------------- 1 | import Notification from './src/main.js'; 2 | export default Notification; 3 | -------------------------------------------------------------------------------- /examples/assets/images/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/feedback.png -------------------------------------------------------------------------------- /examples/assets/images/navbar_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/navbar_0.png -------------------------------------------------------------------------------- /examples/assets/images/navbar_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/navbar_1.png -------------------------------------------------------------------------------- /examples/assets/images/navbar_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/navbar_2.png -------------------------------------------------------------------------------- /examples/assets/images/navbar_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/navbar_3.png -------------------------------------------------------------------------------- /examples/assets/images/resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/resource.png -------------------------------------------------------------------------------- /examples/i18n/route.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "lang": "zh-CN" 4 | }, 5 | { 6 | "lang": "en-US" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /examples/assets/images/component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/component.png -------------------------------------------------------------------------------- /examples/assets/images/consistency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/consistency.png -------------------------------------------------------------------------------- /examples/assets/images/efficiency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/efficiency.png -------------------------------------------------------------------------------- /examples/assets/images/hamburger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/hamburger.png -------------------------------------------------------------------------------- /examples/assets/images/element-demo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/element-demo.jpeg -------------------------------------------------------------------------------- /examples/assets/styles/fonts/icomoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/styles/fonts/icomoon.eot -------------------------------------------------------------------------------- /examples/assets/styles/fonts/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/styles/fonts/icomoon.ttf -------------------------------------------------------------------------------- /examples/assets/images/controllability.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/images/controllability.png -------------------------------------------------------------------------------- /examples/assets/styles/fonts/icomoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/examples/assets/styles/fonts/icomoon.woff -------------------------------------------------------------------------------- /packages/theme-default/src/fonts/element-icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/packages/theme-default/src/fonts/element-icons.eot -------------------------------------------------------------------------------- /packages/theme-default/src/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/packages/theme-default/src/fonts/element-icons.ttf -------------------------------------------------------------------------------- /packages/theme-default/src/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/element/dev/packages/theme-default/src/fonts/element-icons.woff -------------------------------------------------------------------------------- /packages/loading/index.js: -------------------------------------------------------------------------------- 1 | import directive from './src/directive'; 2 | import service from './src/index'; 3 | export default { 4 | directive, 5 | service 6 | }; 7 | -------------------------------------------------------------------------------- /packages/popover/src/directive.js: -------------------------------------------------------------------------------- 1 | export default { 2 | bind(el, binding, vnode) { 3 | vnode.context.$refs[binding.arg].$refs.reference = el; 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /packages/theme-default/src/time-picker.css: -------------------------------------------------------------------------------- 1 | @import "./date-picker/picker.css"; 2 | @import "./date-picker/time-spinner.css"; 3 | @import "./date-picker/time-picker.css"; 4 | -------------------------------------------------------------------------------- /packages/card/index.js: -------------------------------------------------------------------------------- 1 | import Card from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Card.install = function(Vue) { 5 | Vue.component(Card.name, Card); 6 | }; 7 | 8 | export default Card; 9 | -------------------------------------------------------------------------------- /packages/rate/index.js: -------------------------------------------------------------------------------- 1 | import Rate from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Rate.install = function(Vue) { 5 | Vue.component(Rate.name, Rate); 6 | }; 7 | 8 | export default Rate; 9 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "lerna": "2.0.0-beta.18", 3 | "version": "independent", 4 | "publishConfig": { 5 | "ignore": [ 6 | "node_modules", 7 | "log.*" 8 | ] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/tag/index.js: -------------------------------------------------------------------------------- 1 | import ElTag from './src/tag'; 2 | 3 | /* istanbul ignore next */ 4 | ElTag.install = function(Vue) { 5 | Vue.component(ElTag.name, ElTag); 6 | }; 7 | 8 | export default ElTag; 9 | -------------------------------------------------------------------------------- /packages/tree/index.js: -------------------------------------------------------------------------------- 1 | import Tree from './src/tree.vue'; 2 | 3 | /* istanbul ignore next */ 4 | Tree.install = function(Vue) { 5 | Vue.component(Tree.name, Tree); 6 | }; 7 | 8 | export default Tree; 9 | -------------------------------------------------------------------------------- /src/mixins/locale.js: -------------------------------------------------------------------------------- 1 | import { t } from 'element-ui/src/locale'; 2 | 3 | export default { 4 | methods: { 5 | t(...args) { 6 | return t.apply(this, args); 7 | } 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /packages/alert/index.js: -------------------------------------------------------------------------------- 1 | import Alert from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Alert.install = function(Vue) { 5 | Vue.component(Alert.name, Alert); 6 | }; 7 | 8 | export default Alert; 9 | -------------------------------------------------------------------------------- /packages/badge/index.js: -------------------------------------------------------------------------------- 1 | import Badge from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Badge.install = function(Vue) { 5 | Vue.component(Badge.name, Badge); 6 | }; 7 | 8 | export default Badge; 9 | -------------------------------------------------------------------------------- /packages/form/index.js: -------------------------------------------------------------------------------- 1 | import ElForm from './src/form'; 2 | 3 | /* istanbul ignore next */ 4 | ElForm.install = function(Vue) { 5 | Vue.component(ElForm.name, ElForm); 6 | }; 7 | 8 | export default ElForm; 9 | -------------------------------------------------------------------------------- /packages/menu/index.js: -------------------------------------------------------------------------------- 1 | import ElMenu from './src/menu'; 2 | 3 | /* istanbul ignore next */ 4 | ElMenu.install = function(Vue) { 5 | Vue.component(ElMenu.name, ElMenu); 6 | }; 7 | 8 | export default ElMenu; 9 | -------------------------------------------------------------------------------- /packages/radio/index.js: -------------------------------------------------------------------------------- 1 | import Radio from './src/radio'; 2 | 3 | /* istanbul ignore next */ 4 | Radio.install = function(Vue) { 5 | Vue.component('el-radio', Radio); 6 | }; 7 | 8 | export default Radio; 9 | -------------------------------------------------------------------------------- /packages/row/index.js: -------------------------------------------------------------------------------- 1 | import Row from './src/row'; 2 | 3 | /* istanbul ignore next */ 4 | Row.install = function(Vue) { 5 | Vue.component(Row.name, Row); 6 | }; 7 | 8 | export default Row; 9 | 10 | -------------------------------------------------------------------------------- /packages/step/index.js: -------------------------------------------------------------------------------- 1 | import Step from '../steps/src/step'; 2 | 3 | /* istanbul ignore next */ 4 | Step.install = function(Vue) { 5 | Vue.component(Step.name, Step); 6 | }; 7 | 8 | export default Step; 9 | -------------------------------------------------------------------------------- /packages/steps/index.js: -------------------------------------------------------------------------------- 1 | import Steps from './src/steps'; 2 | 3 | /* istanbul ignore next */ 4 | Steps.install = function(Vue) { 5 | Vue.component(Steps.name, Steps); 6 | }; 7 | 8 | export default Steps; 9 | -------------------------------------------------------------------------------- /packages/tabs/index.js: -------------------------------------------------------------------------------- 1 | import ElTabs from './src/tabs'; 2 | 3 | /* istanbul ignore next */ 4 | ElTabs.install = function(Vue) { 5 | Vue.component(ElTabs.name, ElTabs); 6 | }; 7 | 8 | export default ElTabs; 9 | -------------------------------------------------------------------------------- /packages/upload/index.js: -------------------------------------------------------------------------------- 1 | import Upload from './src'; 2 | 3 | /* istanbul ignore next */ 4 | Upload.install = function(Vue) { 5 | Vue.component(Upload.name, Upload); 6 | }; 7 | 8 | export default Upload; 9 | -------------------------------------------------------------------------------- /packages/icon/index.js: -------------------------------------------------------------------------------- 1 | import ElIcon from './src/icon.vue'; 2 | 3 | /* istanbul ignore next */ 4 | ElIcon.install = function(Vue) { 5 | Vue.component(ElIcon.name, ElIcon); 6 | }; 7 | 8 | export default ElIcon; 9 | -------------------------------------------------------------------------------- /packages/select/index.js: -------------------------------------------------------------------------------- 1 | import Select from './src/select'; 2 | 3 | /* istanbul ignore next */ 4 | Select.install = function(Vue) { 5 | Vue.component(Select.name, Select); 6 | }; 7 | 8 | export default Select; 9 | -------------------------------------------------------------------------------- /packages/slider/index.js: -------------------------------------------------------------------------------- 1 | import Slider from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Slider.install = function(Vue) { 5 | Vue.component(Slider.name, Slider); 6 | }; 7 | 8 | export default Slider; 9 | -------------------------------------------------------------------------------- /packages/col/index.js: -------------------------------------------------------------------------------- 1 | import ElCol from './src/col'; 2 | 3 | /* istanbul ignore next */ 4 | ElCol.install = function(Vue) { 5 | Vue.component(ElCol.name, ElCol); 6 | }; 7 | 8 | export default ElCol; 9 | 10 | -------------------------------------------------------------------------------- /packages/input/index.js: -------------------------------------------------------------------------------- 1 | import ElInput from './src/input'; 2 | 3 | /* istanbul ignore next */ 4 | ElInput.install = function(Vue) { 5 | Vue.component(ElInput.name, ElInput); 6 | }; 7 | 8 | export default ElInput; 9 | -------------------------------------------------------------------------------- /packages/table/index.js: -------------------------------------------------------------------------------- 1 | import ElTable from './src/table'; 2 | 3 | /* istanbul ignore next */ 4 | ElTable.install = function(Vue) { 5 | Vue.component(ElTable.name, ElTable); 6 | }; 7 | 8 | export default ElTable; 9 | -------------------------------------------------------------------------------- /packages/tooltip/index.js: -------------------------------------------------------------------------------- 1 | import Tooltip from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Tooltip.install = function(Vue) { 5 | Vue.component(Tooltip.name, Tooltip); 6 | }; 7 | 8 | export default Tooltip; 9 | -------------------------------------------------------------------------------- /packages/button/index.js: -------------------------------------------------------------------------------- 1 | import ElButton from './src/button'; 2 | 3 | /* istanbul ignore next */ 4 | ElButton.install = function(Vue) { 5 | Vue.component(ElButton.name, ElButton); 6 | }; 7 | 8 | export default ElButton; 9 | -------------------------------------------------------------------------------- /packages/spinner/index.js: -------------------------------------------------------------------------------- 1 | import Spinner from './src/spinner'; 2 | 3 | /* istanbul ignore next */ 4 | Spinner.install = function(Vue) { 5 | Vue.component(Spinner.name, Spinner); 6 | }; 7 | 8 | export default Spinner; 9 | -------------------------------------------------------------------------------- /packages/dialog/index.js: -------------------------------------------------------------------------------- 1 | import ElDialog from './src/component'; 2 | 3 | /* istanbul ignore next */ 4 | ElDialog.install = function(Vue) { 5 | Vue.component(ElDialog.name, ElDialog); 6 | }; 7 | 8 | export default ElDialog; 9 | -------------------------------------------------------------------------------- /packages/option/index.js: -------------------------------------------------------------------------------- 1 | import ElOption from '../select/src/option'; 2 | 3 | /* istanbul ignore next */ 4 | ElOption.install = function(Vue) { 5 | Vue.component(ElOption.name, ElOption); 6 | }; 7 | 8 | export default ElOption; 9 | -------------------------------------------------------------------------------- /packages/switch/index.js: -------------------------------------------------------------------------------- 1 | import Switch from './src/component'; 2 | 3 | /* istanbul ignore next */ 4 | Switch.install = function(Vue) { 5 | Vue.component(Switch.name, Switch); 6 | }; 7 | 8 | export default Switch; 9 | 10 | -------------------------------------------------------------------------------- /packages/tab-pane/index.js: -------------------------------------------------------------------------------- 1 | import TabPane from '../tabs/src/tab-pane.vue'; 2 | 3 | /* istanbul ignore next */ 4 | TabPane.install = function(Vue) { 5 | Vue.component(TabPane.name, TabPane); 6 | }; 7 | 8 | export default TabPane; 9 | -------------------------------------------------------------------------------- /packages/dropdown/index.js: -------------------------------------------------------------------------------- 1 | import ElDropdown from './src/dropdown'; 2 | 3 | /* istanbul ignore next */ 4 | ElDropdown.install = function(Vue) { 5 | Vue.component(ElDropdown.name, ElDropdown); 6 | }; 7 | 8 | export default ElDropdown; 9 | -------------------------------------------------------------------------------- /packages/progress/index.js: -------------------------------------------------------------------------------- 1 | import ElProgress from './src/progress'; 2 | 3 | /* istanbul ignore next */ 4 | ElProgress.install = function(Vue) { 5 | Vue.component(ElProgress.name, ElProgress); 6 | }; 7 | 8 | export default ElProgress; 9 | -------------------------------------------------------------------------------- /packages/submenu/index.js: -------------------------------------------------------------------------------- 1 | import ElSubmenu from '../menu/src/submenu'; 2 | 3 | /* istanbul ignore next */ 4 | ElSubmenu.install = function(Vue) { 5 | Vue.component(ElSubmenu.name, ElSubmenu); 6 | }; 7 | 8 | export default ElSubmenu; 9 | -------------------------------------------------------------------------------- /packages/pagination/index.js: -------------------------------------------------------------------------------- 1 | import Pagination from './src/pagination'; 2 | 3 | /* istanbul ignore next */ 4 | Pagination.install = function(Vue) { 5 | Vue.component(Pagination.name, Pagination); 6 | }; 7 | 8 | export default Pagination; 9 | -------------------------------------------------------------------------------- /examples/docs/zh-CN/home.md: -------------------------------------------------------------------------------- 1 | # 组件说明文档 2 | 3 | -------------------------------------------------------------------------------- /packages/form-item/index.js: -------------------------------------------------------------------------------- 1 | import ElFormItem from '../form/src/form-item'; 2 | 3 | /* istanbul ignore next */ 4 | ElFormItem.install = function(Vue) { 5 | Vue.component(ElFormItem.name, ElFormItem); 6 | }; 7 | 8 | export default ElFormItem; 9 | -------------------------------------------------------------------------------- /packages/menu-item/index.js: -------------------------------------------------------------------------------- 1 | import ElMenuItem from '../menu/src/menu-item'; 2 | 3 | /* istanbul ignore next */ 4 | ElMenuItem.install = function(Vue) { 5 | Vue.component(ElMenuItem.name, ElMenuItem); 6 | }; 7 | 8 | export default ElMenuItem; 9 | -------------------------------------------------------------------------------- /packages/breadcrumb/index.js: -------------------------------------------------------------------------------- 1 | import ElBreadcrumb from './src/breadcrumb'; 2 | 3 | /* istanbul ignore next */ 4 | ElBreadcrumb.install = function(Vue) { 5 | Vue.component(ElBreadcrumb.name, ElBreadcrumb); 6 | }; 7 | 8 | export default ElBreadcrumb; 9 | -------------------------------------------------------------------------------- /packages/checkbox/index.js: -------------------------------------------------------------------------------- 1 | import ElCheckbox from './src/checkbox'; 2 | 3 | /* istanbul ignore next */ 4 | ElCheckbox.install = function(Vue) { 5 | Vue.component(ElCheckbox.name, ElCheckbox); 6 | }; 7 | 8 | export default ElCheckbox; 9 | 10 | -------------------------------------------------------------------------------- /packages/icon/src/icon.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 14 | -------------------------------------------------------------------------------- /packages/radio-group/index.js: -------------------------------------------------------------------------------- 1 | import RadioGroup from '../radio/src/radio-group.vue'; 2 | 3 | /* istanbul ignore next */ 4 | RadioGroup.install = function(Vue) { 5 | Vue.component(RadioGroup.name, RadioGroup); 6 | }; 7 | 8 | export default RadioGroup; 9 | -------------------------------------------------------------------------------- /examples/docs/en-US/home.md: -------------------------------------------------------------------------------- 1 | # Components Document 2 | 3 | -------------------------------------------------------------------------------- /packages/date-picker/index.js: -------------------------------------------------------------------------------- 1 | import DatePicker from './src/picker/date-picker'; 2 | 3 | /* istanbul ignore next */ 4 | DatePicker.install = function install(Vue) { 5 | Vue.component(DatePicker.name, DatePicker); 6 | }; 7 | 8 | export default DatePicker; 9 | -------------------------------------------------------------------------------- /packages/input-number/index.js: -------------------------------------------------------------------------------- 1 | import ElInputNumber from './src/input-number'; 2 | 3 | /* istanbul ignore next */ 4 | ElInputNumber.install = function(Vue) { 5 | Vue.component(ElInputNumber.name, ElInputNumber); 6 | }; 7 | 8 | export default ElInputNumber; 9 | -------------------------------------------------------------------------------- /packages/radio-button/index.js: -------------------------------------------------------------------------------- 1 | import RadioButton from '../radio/src/radio-button.vue'; 2 | 3 | /* istanbul ignore next */ 4 | RadioButton.install = function(Vue) { 5 | Vue.component(RadioButton.name, RadioButton); 6 | }; 7 | 8 | export default RadioButton; 9 | -------------------------------------------------------------------------------- /packages/time-picker/index.js: -------------------------------------------------------------------------------- 1 | import TimePicker from '../date-picker/src/picker/time-picker'; 2 | 3 | /* istanbul ignore next */ 4 | TimePicker.install = function(Vue) { 5 | Vue.component(TimePicker.name, TimePicker); 6 | }; 7 | 8 | export default TimePicker; 9 | -------------------------------------------------------------------------------- /packages/time-select/index.js: -------------------------------------------------------------------------------- 1 | import TimeSelect from '../date-picker/src/picker/time-select'; 2 | 3 | /* istanbul ignore next */ 4 | TimeSelect.install = function(Vue) { 5 | Vue.component(TimeSelect.name, TimeSelect); 6 | }; 7 | 8 | export default TimeSelect; 9 | -------------------------------------------------------------------------------- /packages/autocomplete/index.js: -------------------------------------------------------------------------------- 1 | import ElAutocomplete from './src/autocomplete'; 2 | 3 | /* istanbul ignore next */ 4 | ElAutocomplete.install = function(Vue) { 5 | Vue.component(ElAutocomplete.name, ElAutocomplete); 6 | }; 7 | 8 | export default ElAutocomplete; 9 | -------------------------------------------------------------------------------- /packages/button-group/index.js: -------------------------------------------------------------------------------- 1 | import ElButtonGroup from '../button/src/button-group'; 2 | 3 | /* istanbul ignore next */ 4 | ElButtonGroup.install = function(Vue) { 5 | Vue.component(ElButtonGroup.name, ElButtonGroup); 6 | }; 7 | 8 | export default ElButtonGroup; 9 | -------------------------------------------------------------------------------- /packages/option-group/index.js: -------------------------------------------------------------------------------- 1 | import ElOptionGroup from '../select/src/option-group'; 2 | 3 | /* istanbul ignore next */ 4 | ElOptionGroup.install = function(Vue) { 5 | Vue.component(ElOptionGroup.name, ElOptionGroup); 6 | }; 7 | 8 | export default ElOptionGroup; 9 | -------------------------------------------------------------------------------- /packages/table-column/index.js: -------------------------------------------------------------------------------- 1 | import ElTableColumn from '../table/src/table-column'; 2 | 3 | /* istanbul ignore next */ 4 | ElTableColumn.install = function(Vue) { 5 | Vue.component(ElTableColumn.name, ElTableColumn); 6 | }; 7 | 8 | export default ElTableColumn; 9 | -------------------------------------------------------------------------------- /packages/dropdown-item/index.js: -------------------------------------------------------------------------------- 1 | import ElDropdownItem from '../dropdown/src/dropdown-item'; 2 | 3 | /* istanbul ignore next */ 4 | ElDropdownItem.install = function(Vue) { 5 | Vue.component(ElDropdownItem.name, ElDropdownItem); 6 | }; 7 | 8 | export default ElDropdownItem; 9 | -------------------------------------------------------------------------------- /packages/dropdown-menu/index.js: -------------------------------------------------------------------------------- 1 | import ElDropdownMenu from '../dropdown/src/dropdown-menu'; 2 | 3 | /* istanbul ignore next */ 4 | ElDropdownMenu.install = function(Vue) { 5 | Vue.component(ElDropdownMenu.name, ElDropdownMenu); 6 | }; 7 | 8 | export default ElDropdownMenu; 9 | -------------------------------------------------------------------------------- /packages/menu-item-group/index.js: -------------------------------------------------------------------------------- 1 | import ElMenuItemGroup from '../menu/src/menu-item-group'; 2 | 3 | /* istanbul ignore next */ 4 | ElMenuItemGroup.install = function(Vue) { 5 | Vue.component(ElMenuItemGroup.name, ElMenuItemGroup); 6 | }; 7 | 8 | export default ElMenuItemGroup; 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | npm-debug.log 4 | lerna-debug.log 5 | npm-debug.log.* 6 | lerna-debug.log.* 7 | lib 8 | .idea 9 | examples/element-ui 10 | examples/pages/en-US 11 | examples/pages/zh-CN 12 | fe.element/element-ui 13 | .npmrc 14 | coverage 15 | yarn.lock 16 | -------------------------------------------------------------------------------- /packages/checkbox-group/index.js: -------------------------------------------------------------------------------- 1 | import ElCheckboxGroup from '../checkbox/src/checkbox-group.vue'; 2 | 3 | /* istanbul ignore next */ 4 | ElCheckboxGroup.install = function(Vue) { 5 | Vue.component(ElCheckboxGroup.name, ElCheckboxGroup); 6 | }; 7 | 8 | export default ElCheckboxGroup; 9 | -------------------------------------------------------------------------------- /packages/breadcrumb-item/index.js: -------------------------------------------------------------------------------- 1 | import ElBreadcrumbItem from '../breadcrumb/src/breadcrumb-item'; 2 | 3 | /* istanbul ignore next */ 4 | ElBreadcrumbItem.install = function(Vue) { 5 | Vue.component(ElBreadcrumbItem.name, ElBreadcrumbItem); 6 | }; 7 | 8 | export default ElBreadcrumbItem; 9 | -------------------------------------------------------------------------------- /packages/steps/_index.js: -------------------------------------------------------------------------------- 1 | import Steps from './src/steps'; 2 | import Step from './src/step'; 3 | 4 | /* istanbul ignore next */ 5 | export default function(Vue) { 6 | Vue.component(Steps.name, Steps); 7 | Vue.component(Step.name, Step); 8 | }; 9 | 10 | export { Step, Steps }; 11 | -------------------------------------------------------------------------------- /examples/play.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Element from 'main/index.js'; 3 | import App from './play/index.vue'; 4 | import 'packages/theme-default/src/index.css'; 5 | 6 | Vue.use(Element); 7 | 8 | new Vue({ // eslint-disable-line 9 | render: h => h(App) 10 | }).$mount('#app'); 11 | -------------------------------------------------------------------------------- /packages/tabs/_index.js: -------------------------------------------------------------------------------- 1 | import ElTabs from './src/tabs'; 2 | import ElTabPane from './src/tab-pane'; 3 | 4 | /* istanbul ignore next */ 5 | export default function(Vue) { 6 | Vue.component(ElTabs.name, ElTabs); 7 | Vue.component(ElTabPane.name, ElTabPane); 8 | }; 9 | 10 | export { ElTabs, ElTabPane }; 11 | -------------------------------------------------------------------------------- /packages/date-picker/src/picker/time-select.js: -------------------------------------------------------------------------------- 1 | import Picker from '../picker'; 2 | import Panel from '../panel/time-select'; 3 | 4 | export default { 5 | mixins: [Picker], 6 | 7 | name: 'ElTimeSelect', 8 | 9 | created() { 10 | this.type = 'time-select'; 11 | this.panel = Panel; 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /packages/form/_index.js: -------------------------------------------------------------------------------- 1 | import ElFormItem from './src/form-item'; 2 | import ElForm from './src/form'; 3 | 4 | /* istanbul ignore next */ 5 | export default function(Vue) { 6 | Vue.component(ElForm.name, ElForm); 7 | Vue.component(ElFormItem.name, ElFormItem); 8 | }; 9 | 10 | export { ElForm, ElFormItem }; 11 | -------------------------------------------------------------------------------- /examples/play/component.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 9 | 10 | 20 | -------------------------------------------------------------------------------- /packages/table/_index.js: -------------------------------------------------------------------------------- 1 | import ElTableColumn from './src/table-column'; 2 | import ElTable from './src/table'; 3 | 4 | /* istanbul ignore next */ 5 | export default function(Vue) { 6 | Vue.component(ElTable.name, ElTable); 7 | Vue.component(ElTableColumn.name, ElTableColumn); 8 | }; 9 | 10 | export { ElTable, ElTableColumn }; 11 | -------------------------------------------------------------------------------- /packages/theme-default/src/steps.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | 4 | @component-namespace el { 5 | @b steps { 6 | font-size: 0; 7 | 8 | > :last-child .el-step__line { 9 | display: none; 10 | } 11 | 12 | @when horizontal { 13 | white-space: nowrap; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "mocha": true 4 | }, 5 | "globals": { 6 | "expect": true, 7 | "sinon": true 8 | }, 9 | "plugins": ['vue'], 10 | "extends": 'elemefe', 11 | "parserOptions": { 12 | "ecmaFeatures": { 13 | "experimentalObjectRestSpread": true, 14 | "jsx": true 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/breadcrumb/src/breadcrumb.vue: -------------------------------------------------------------------------------- 1 | 6 | 18 | -------------------------------------------------------------------------------- /packages/button/_index.js: -------------------------------------------------------------------------------- 1 | import ElButton from './src/button'; 2 | import ElButtonGroup from './src/button-group'; 3 | 4 | /* istanbul ignore next */ 5 | export default function(Vue) { 6 | Vue.component(ElButton.name, ElButton); 7 | Vue.component(ElButtonGroup.name, ElButtonGroup); 8 | }; 9 | 10 | export { 11 | ElButton, 12 | ElButtonGroup 13 | }; 14 | -------------------------------------------------------------------------------- /packages/button/src/button-group.vue: -------------------------------------------------------------------------------- 1 | 6 | 17 | -------------------------------------------------------------------------------- /examples/play/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 15 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["es2015", { "loose": true }]], 3 | "plugins": ["transform-vue-jsx"], 4 | "env": { 5 | "utils": { 6 | "plugins": [ 7 | ["module-resolver", { 8 | "root": ["element-ui"], 9 | "alias": { 10 | "element-ui/src": "element-ui/lib" 11 | } 12 | }] 13 | ] 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/theme-default/salad.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "browsers": ["ie > 8", "last 2 versions"], 3 | "features": { 4 | "bem": { 5 | "shortcuts": { 6 | "component": "b", 7 | "modifier": "m", 8 | "descendent": "e" 9 | }, 10 | "separators": { 11 | "descendent": "__", 12 | "modifier": "--" 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/checkbox/_index.js: -------------------------------------------------------------------------------- 1 | import ElCheckbox from './src/checkbox'; 2 | import ElCheckboxGroup from './src/checkbox-group.vue'; 3 | 4 | /* istanbul ignore next */ 5 | export default function install(Vue) { 6 | Vue.component(ElCheckboxGroup.name, ElCheckboxGroup); 7 | Vue.component(ElCheckbox.name, ElCheckbox); 8 | }; 9 | 10 | export { 11 | ElCheckbox, 12 | ElCheckboxGroup 13 | }; 14 | -------------------------------------------------------------------------------- /packages/theme-default/src/date-picker.css: -------------------------------------------------------------------------------- 1 | @import "./date-picker/date-table.css"; 2 | @import "./date-picker/month-table.css"; 3 | @import "./date-picker/year-table.css"; 4 | @import "./date-picker/time-spinner.css"; 5 | @import "./date-picker/picker.css"; 6 | @import "./date-picker/date-picker.css"; 7 | @import "./date-picker/date-range-picker.css"; 8 | @import "./date-picker/time-range-picker.css"; 9 | -------------------------------------------------------------------------------- /examples/i18n/title.json: -------------------------------------------------------------------------------- 1 | { 2 | "zh-CN": { 3 | "home": "Element - 网站快速成型工具", 4 | "guide": "指南 | Element", 5 | "component": "组件 | Element", 6 | "resource": "资源 | Element" 7 | }, 8 | "en-US": { 9 | "home": "Element - A Desktop UI Toolkit for Web", 10 | "guide": "Guide | Element", 11 | "component": "Component | Element", 12 | "resource": "Resource | Element" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/card/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-card", 3 | "version": "0.0.0", 4 | "description": "A card component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/card", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /packages/popover/index.js: -------------------------------------------------------------------------------- 1 | import Popover from './src/main'; 2 | import directive from './src/directive'; 3 | import Vue from 'vue'; 4 | 5 | Vue.directive('popover', directive); 6 | 7 | /* istanbul ignore next */ 8 | Popover.install = function(Vue) { 9 | Vue.directive('popover', directive); 10 | Vue.component(Popover.name, Popover); 11 | }; 12 | Popover.directive = directive; 13 | 14 | export default Popover; 15 | -------------------------------------------------------------------------------- /packages/select/_index.js: -------------------------------------------------------------------------------- 1 | import Select from './src/select'; 2 | import Option from './src/option'; 3 | import OptionGroup from './src/option-group'; 4 | 5 | /* istanbul ignore next */ 6 | export default function(Vue) { 7 | Vue.component(Select.name, Select); 8 | Vue.component(Option.name, Option); 9 | Vue.component(OptionGroup.name, OptionGroup); 10 | }; 11 | 12 | export { Select, Option, OptionGroup }; 13 | -------------------------------------------------------------------------------- /packages/tree/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-tree", 3 | "version": "0.0.0", 4 | "description": "A tree component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/tree", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /examples/icon.json: -------------------------------------------------------------------------------- 1 | ["arrow-down","arrow-left","arrow-right","arrow-up","caret-bottom","caret-left","caret-right","caret-top","check","circle-check","circle-close","circle-cross","close","upload","d-arrow-left","d-arrow-right","d-caret","date","delete","document","edit","information","loading","menu","message","minus","more","picture","plus","search","setting","share","star-off","star-on","time","warning","delete2","upload2","view"] -------------------------------------------------------------------------------- /packages/alert/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-alert", 3 | "version": "0.0.0", 4 | "description": "A alert component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/alert", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /packages/badge/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-badge", 3 | "version": "0.0.0", 4 | "description": "A badge component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/badge", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /packages/col/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-col", 3 | "version": "1.0.0", 4 | "description": "A row component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/col", 12 | "author": "haiping.zeng@ele.me", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /packages/steps/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-steps", 3 | "version": "0.0.0", 4 | "description": "A steps component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/steps", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /packages/switch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-switch", 3 | "version": "1.0.0", 4 | "description": "A switch component for vue.js", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/switch", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /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/message/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-message", 3 | "version": "0.0.0", 4 | "description": "A message component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/message", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /packages/row/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-row", 3 | "version": "1.0.2", 4 | "description": "A row component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/row", 12 | "author": "qingwei-li", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /packages/dialog/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-dialog", 3 | "version": "1.0.0", 4 | "description": "A dialog component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/dialog", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "devDependencies": { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/radio/_index.js: -------------------------------------------------------------------------------- 1 | import Radio from './src/radio'; 2 | import RadioButton from './src/radio-button.vue'; 3 | import RadioGroup from './src/radio-group.vue'; 4 | 5 | /* istanbul ignore next */ 6 | export default function(Vue) { 7 | Vue.component(Radio.name, Radio); 8 | Vue.component(RadioButton.name, RadioButton); 9 | Vue.component(RadioGroup.name, RadioGroup); 10 | }; 11 | 12 | export { Radio, RadioButton, RadioGroup }; 13 | -------------------------------------------------------------------------------- /packages/checkbox/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-checkbox", 3 | "version": "1.0.2", 4 | "description": "A checkbox component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/checkbox", 12 | "author": "haiping.zeng@ele.me", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /.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 Element's [Contributing Guide](https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.md). 4 | * [ ] Make sure you are merging your commits to `dev` branch. 5 | * [ ] Rebase before creating a PR to keep commit history clear. 6 | * [ ] Add some descriptions and refer relative issues for you PR. 7 | -------------------------------------------------------------------------------- /packages/radio/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-radio", 3 | "version": "1.0.0", 4 | "description": "A radio component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/radio", 12 | "author": "qingwei-li", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /packages/notification/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-notification", 3 | "version": "0.0.0", 4 | "description": "A notification component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/notification", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /packages/tabs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-tabs", 3 | "version": "1.0.0", 4 | "description": "A tabs component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/tabs", 12 | "author": "haiping.zeng", 13 | "license": "MIT", 14 | "dependencies": { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/button/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-button", 3 | "version": "1.0.0", 4 | "description": "A button component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/button", 12 | "author": "haiping.zeng", 13 | "license": "MIT", 14 | "dependencies": { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-menu", 3 | "version": "0.0.0", 4 | "description": "A menu component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/menu", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": { 15 | "wind-dom": "0.0.3" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/rate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-rate", 3 | "version": "0.0.0", 4 | "description": "A rate component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/rate", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": { 15 | "wind-dom": "0.0.3" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/upload/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-upload", 3 | "version": "0.0.0", 4 | "description": "A upload component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/upload", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {}, 15 | "devDependencies": {} 16 | } 17 | -------------------------------------------------------------------------------- /packages/card/src/main.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 19 | -------------------------------------------------------------------------------- /packages/slider/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-slider", 3 | "version": "0.0.0", 4 | "description": "A slider component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/slider", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": { 15 | "wind-dom": "0.0.3" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/tooltip/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-tooltip", 3 | "version": "0.0.0", 4 | "description": "A tooltip component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/tooltip", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {}, 15 | "devDependencies": {} 16 | } 17 | -------------------------------------------------------------------------------- /packages/dropdown/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-dropdown", 3 | "version": "1.0.0", 4 | "description": "A dropdown component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/dropdown", 12 | "author": "haiping.zeng", 13 | "license": "MIT", 14 | "dependencies": { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/loading/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-loading", 3 | "version": "0.0.0", 4 | "description": "A loading component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/loading", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": { 15 | "wind-dom": "0.0.3" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/pagination/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-pagination", 3 | "version": "0.0.0", 4 | "description": "A pagination component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/pagination", 12 | "author": "qingwei-li", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /packages/spinner/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-spinner", 3 | "version": "1.0.0", 4 | "description": "A input component for Vue.", 5 | "main": "lib/index.js", 6 | "keywords": [ 7 | "element", 8 | "vue", 9 | "component", 10 | "input" 11 | ], 12 | "author": "haiping.zeng@ele.me", 13 | "license": "MIT", 14 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/spinner", 15 | "devDependencies": { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/table/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-table", 3 | "version": "1.0.0", 4 | "description": "A table component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/dialog", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": { 15 | "throttle-debounce": "^1.0.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/tag/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-tag", 3 | "version": "1.0.1", 4 | "description": "A input component for Vue.", 5 | "main": "lib/index.js", 6 | "keywords": [ 7 | "element", 8 | "vue", 9 | "component", 10 | "input" 11 | ], 12 | "author": "haipingZeng ", 13 | "license": "MIT", 14 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/tag", 15 | "devDependencies": { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/breadcrumb/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-breadcrumb", 3 | "version": "1.0.0", 4 | "description": "A breadcrumb component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/breadcrumb", 12 | "author": "haiping.zeng", 13 | "license": "MIT", 14 | "dependencies": { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/input/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-input", 3 | "version": "1.0.1", 4 | "description": "A input component for Vue.", 5 | "main": "lib/index.js", 6 | "keywords": [ 7 | "element", 8 | "vue", 9 | "component", 10 | "input" 11 | ], 12 | "author": "haiping.zeng ", 13 | "license": "MIT", 14 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/input", 15 | "devDependencies": { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/popover/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-popover", 3 | "version": "0.0.0", 4 | "description": "A popover component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/popover", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "devDependencies": { 15 | "wind-dom": "0.0.3" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/autocomplete/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-autocomplete", 3 | "version": "1.0.0", 4 | "description": "A autocomplete component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/autocomplete", 12 | "author": "haiping.zeng", 13 | "license": "MIT", 14 | "dependencies": { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/date-picker/src/picker/time-picker.js: -------------------------------------------------------------------------------- 1 | import Picker from '../picker'; 2 | import TimePanel from '../panel/time'; 3 | import TimeRangePanel from '../panel/time-range'; 4 | 5 | export default { 6 | mixins: [Picker], 7 | 8 | name: 'ElTimePicker', 9 | 10 | props: { 11 | isRange: Boolean 12 | }, 13 | 14 | created() { 15 | this.type = this.isRange ? 'timerange' : 'time'; 16 | this.panel = this.isRange ? TimeRangePanel : TimePanel; 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /packages/message-box/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-message-box", 3 | "version": "0.0.0", 4 | "description": "A message-box component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/message-box", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": { 15 | "wind-dom": "0.0.3" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/date-picker/_index.js: -------------------------------------------------------------------------------- 1 | import DatePicker from './src/picker/date-picker'; 2 | import TimePicker from './src/picker/time-picker'; 3 | import TimeSelect from './src/picker/time-select'; 4 | 5 | /* istanbul ignore next */ 6 | export default function install(Vue) { 7 | Vue.component(DatePicker.name, DatePicker); 8 | Vue.component(TimePicker.name, TimePicker); 9 | Vue.component(TimeSelect.name, TimeSelect); 10 | }; 11 | 12 | export { DatePicker, TimePicker, TimeSelect }; 13 | -------------------------------------------------------------------------------- /packages/date-picker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-datepicker", 3 | "version": "1.0.0", 4 | "description": "A datepicker component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/datepicker", 12 | "author": "long.zhang@ele.me", 13 | "license": "MIT", 14 | "dependencies": { 15 | "wind-dom": "0.0.3" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/form/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-form", 3 | "version": "1.0.0", 4 | "description": "A form component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/form", 12 | "author": "haiping.zeng", 13 | "license": "MIT", 14 | "dependencies": { 15 | "async-validator": "^1.6.6" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/progress/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-progress", 3 | "version": "1.0.1", 4 | "description": "A progress component for Vue.", 5 | "main": "lib/index.js", 6 | "keywords": [ 7 | "element", 8 | "vue", 9 | "component", 10 | "progress" 11 | ], 12 | "author": "haiping.zeng ", 13 | "license": "MIT", 14 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/progress", 15 | "devDependencies": { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/alert/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: 'ElAlert', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /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: 'ElBadge', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/card/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: 'ElCard', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/col/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: 'ElCol', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/form/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: 'ElForm', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/input/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: 'ElInput', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/menu/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: 'ElMenu', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/rate/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: 'ElRate', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/row/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: 'ElRow', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/tabs/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: 'ElTabs', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/tag/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: 'ElTag', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/tree/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: 'ElTree', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /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: 'ElButton', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/dialog/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: 'ElDialog', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/loading/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: 'ElLoading', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/message/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: 'ElMessage', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/popover/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: 'ElPopover', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /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: 'ElRadio', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/select/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: 'ElSelect', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/slider/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: 'ElSlider', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/spinner/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: 'ElSpinner', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/steps/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: 'ElSteps', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /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: 'ElSwitch', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/table/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: 'ElTable', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/tooltip/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: 'ElTooltip', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/upload/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: 'ElUpload', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/breadcrumb/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: 'ElBreadcrumb', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/checkbox/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: 'ElCheckbox', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/dropdown/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: 'ElDropdown', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/pagination/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: 'ElPagination', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /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: 'ElProgress', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/autocomplete/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: 'ElAutocomplete', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/date-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: 'ElDatePicker', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/input-number/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: 'ElInputNumber', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/message-box/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: 'ElMessageBox', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/notification/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: 'ElNotification', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /packages/input-number/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-input-number", 3 | "version": "1.0.1", 4 | "description": "A input component for Vue.", 5 | "main": "lib/index.js", 6 | "keywords": [ 7 | "element", 8 | "vue", 9 | "component", 10 | "input" 11 | ], 12 | "author": "haipingZeng ", 13 | "license": "MIT", 14 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/input-number", 15 | "dependencies": { 16 | "wind-dom": "0.0.3" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/select/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "el-select", 3 | "version": "1.0.1", 4 | "description": "A el-select component for Vue.", 5 | "main": "lib/index.js", 6 | "keywords": [ 7 | "element", 8 | "vue", 9 | "component" 10 | ], 11 | "author": "qingwei.li", 12 | "license": "MIT", 13 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/select", 14 | "devDependencies": { 15 | "throttle-debounce": "^1.0.1", 16 | "wind-dom": "0.0.3" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/menu/_index.js: -------------------------------------------------------------------------------- 1 | import ElMenu from './src/menu'; 2 | import ElMenuItem from './src/menu-item'; 3 | import ElMenuItemGroup from './src/menu-item-group'; 4 | import ElSubmenu from './src/submenu'; 5 | 6 | /* istanbul ignore next */ 7 | export default function(Vue) { 8 | Vue.component(ElMenuItem.name, ElMenuItem); 9 | Vue.component(ElMenuItemGroup.name, ElMenuItemGroup); 10 | Vue.component(ElMenu.name, ElMenu); 11 | Vue.component(ElSubmenu.name, ElSubmenu); 12 | }; 13 | 14 | export { 15 | ElMenuItemGroup, 16 | ElMenuItem, 17 | ElMenu, 18 | ElSubmenu 19 | }; 20 | -------------------------------------------------------------------------------- /packages/checkbox/src/checkbox-group.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | -------------------------------------------------------------------------------- /packages/menu/src/menu-mixin.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | computed: { 3 | indexPath() { 4 | var path = [this.index]; 5 | var parent = this.$parent; 6 | while (parent.$options.componentName !== 'ElMenu') { 7 | if (parent.index) { 8 | path.unshift(parent.index); 9 | } 10 | parent = parent.$parent; 11 | } 12 | return path; 13 | }, 14 | rootMenu() { 15 | var parent = this.$parent; 16 | while (parent.$options.componentName !== 'ElMenu') { 17 | parent = parent.$parent; 18 | } 19 | return parent; 20 | } 21 | } 22 | }; 23 | -------------------------------------------------------------------------------- /packages/date-picker/src/picker/date-picker.js: -------------------------------------------------------------------------------- 1 | import Picker from '../picker'; 2 | import DatePanel from '../panel/date'; 3 | import DateRangePanel from '../panel/date-range'; 4 | 5 | const getPanel = function(type) { 6 | if (type === 'daterange' || type === 'datetimerange') { 7 | return DateRangePanel; 8 | } 9 | return DatePanel; 10 | }; 11 | 12 | export default { 13 | mixins: [Picker], 14 | 15 | name: 'ElDatePicker', 16 | 17 | props: { 18 | type: { 19 | type: String, 20 | default: 'date' 21 | } 22 | }, 23 | 24 | created() { 25 | this.panel = getPanel(this.type); 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /packages/loading/src/loading.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | -------------------------------------------------------------------------------- /packages/theme-default/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var postcss = require('gulp-postcss'); 5 | var cssmin = require('gulp-cssmin'); 6 | var salad = require('postcss-salad')(require('./salad.config.json')); 7 | 8 | gulp.task('compile', function() { 9 | return gulp.src('./src/*.css') 10 | .pipe(postcss([salad])) 11 | .pipe(cssmin()) 12 | .pipe(gulp.dest('./lib')); 13 | }); 14 | 15 | gulp.task('copyfont', function() { 16 | return gulp.src('./src/fonts/**') 17 | .pipe(cssmin()) 18 | .pipe(gulp.dest('./lib/fonts')); 19 | }); 20 | 21 | gulp.task('build', ['compile', 'copyfont']); 22 | -------------------------------------------------------------------------------- /packages/radio/src/radio-group.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | -------------------------------------------------------------------------------- /packages/theme-default/src/option-group.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | 4 | @component-namespace el { 5 | 6 | @b select-group { 7 | margin: 0; 8 | padding: 0; 9 | 10 | @e wrap { 11 | list-style: none; 12 | margin: 0; 13 | padding: 0; 14 | } 15 | 16 | @e title { 17 | padding-left: 10px; 18 | font-size: var(--select-group-font-size); 19 | color: var(--select-group-color); 20 | height: var(--select-group-height); 21 | line-height: var(--select-group-height); 22 | } 23 | 24 | & .el-select-dropdown__item { 25 | padding-left: 20px; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /examples/dom/class.js: -------------------------------------------------------------------------------- 1 | export const hasClass = function(obj, cls) { 2 | return obj.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')); 3 | }; 4 | 5 | export const addClass = function(obj, cls) { 6 | if (!hasClass(obj, cls)) obj.className += ' ' + cls; 7 | }; 8 | 9 | export const removeClass = function(obj, cls) { 10 | if (hasClass(obj, cls)) { 11 | const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)'); 12 | obj.className = obj.className.replace(reg, ' '); 13 | } 14 | }; 15 | 16 | export const toggleClass = function(obj, cls) { 17 | if (hasClass(obj, cls)) { 18 | removeClass(obj, cls); 19 | } else { 20 | addClass(obj, cls); 21 | } 22 | }; 23 | -------------------------------------------------------------------------------- /test/unit/index.js: -------------------------------------------------------------------------------- 1 | // Polyfill fn.bind() for PhantomJS 2 | /* eslint-disable no-extend-native */ 3 | Function.prototype.bind = require('function-bind'); 4 | require('packages/theme-default/src/index.css'); 5 | 6 | // require all test files (files that ends with .spec.js) 7 | const testsContext = require.context('./specs', true, /\.spec$/); 8 | testsContext.keys().forEach(testsContext); 9 | 10 | // require all src files except main.js for coverage. 11 | // you can also change this to match only the subset of files that 12 | // you want coverage for. 13 | const srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/); 14 | srcContext.keys().forEach(srcContext); 15 | -------------------------------------------------------------------------------- /packages/theme-default/README.md: -------------------------------------------------------------------------------- 1 | # element-theme-default 2 | > element component defualt theme. 3 | 4 | 5 | ## Installation 6 | ```shell 7 | npm i element-theme-default -S 8 | ``` 9 | 10 | ## Usage 11 | 12 | Use Sass Or postcss-import 13 | ```css 14 | @import 'element-theme-default'; 15 | ``` 16 | 17 | Or Use webpack 18 | ```javascript 19 | import 'element-theme-default'; 20 | ``` 21 | 22 | Or 23 | ```html 24 | 25 | ``` 26 | 27 | ## Import your need 28 | ```javascript 29 | import 'element-theme-default/lib/input.css'; 30 | import 'element-theme-default/lib/select.css'; 31 | 32 | // ... 33 | ``` 34 | -------------------------------------------------------------------------------- /packages/theme-default/src/card.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | 4 | @component-namespace el { 5 | @b card { 6 | border: 1px solid var(--card-border-color); 7 | border-radius: var(--card-border-radius); 8 | background-color: #fff; 9 | overflow: hidden; 10 | box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, .12), 11 | 0px 0px 6px 0px rgba(0, 0, 0, .04); 12 | 13 | @e header { 14 | padding: calc(var(--card-padding) - 2) var(--card-padding); 15 | border-bottom: 1px solid var(--card-border-color); 16 | box-sizing: border-box; 17 | } 18 | 19 | @e body { 20 | padding: var(--card-padding); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/theme-default/src/core/tag.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "../common/var.css"; 3 | 4 | @component-namespace element-core { 5 | 6 | @b tag { 7 | background-color: var(--tag-fill); 8 | border: 0; 9 | border-radius: var(--tag-border-radius); 10 | color: var(--tag-color); 11 | height: 22px; 12 | margin: 1px; 13 | outline: 0; 14 | padding: 3px 16px 3px 3px; 15 | position: relative; 16 | 17 | @e button { 18 | color: var(--tag-close-color); 19 | cursor: pointer; 20 | line-height: 1; 21 | 22 | /* 增大可点击面积 */ 23 | padding: 5px; 24 | position: absolute; 25 | right: 0; 26 | top: 0; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/table/src/dropdown.js: -------------------------------------------------------------------------------- 1 | var dropdowns = []; 2 | 3 | document.addEventListener('click', function(event) { 4 | dropdowns.forEach(function(dropdown) { 5 | var target = event.target; 6 | if (!dropdown || !dropdown.$el) return; 7 | if (target === dropdown.$el || dropdown.$el.contains(target)) { 8 | return; 9 | } 10 | dropdown.handleOutsideClick && dropdown.handleOutsideClick(event); 11 | }); 12 | }); 13 | 14 | export default { 15 | open(instance) { 16 | if (instance) { 17 | dropdowns.push(instance); 18 | } 19 | }, 20 | 21 | close(instance) { 22 | var index = dropdowns.indexOf(instance); 23 | if (index !== -1) { 24 | dropdowns.splice(instance, 1); 25 | } 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /test/unit/specs/breadcrumb.spec.js: -------------------------------------------------------------------------------- 1 | import { createVue, destroyVM } from '../util'; 2 | 3 | describe('Breadcrumb', () => { 4 | let vm; 5 | afterEach(() => { 6 | destroyVM(vm); 7 | }); 8 | 9 | it('create', done => { 10 | vm = createVue(` 11 | 12 | 首页 13 | 活动管理 14 | 活动列表 15 | 活动详情 16 | 17 | `); 18 | vm.$nextTick(_ => { 19 | expect(vm.$el.querySelector('.el-breadcrumb__separator').innerText).to.equal('>'); 20 | done(); 21 | }); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /packages/tag/src/tag.vue: -------------------------------------------------------------------------------- 1 | 13 | 30 | -------------------------------------------------------------------------------- /packages/dropdown/src/dropdown-item.vue: -------------------------------------------------------------------------------- 1 | 13 | 34 | -------------------------------------------------------------------------------- /packages/spinner/src/spinner.vue: -------------------------------------------------------------------------------- 1 | 8 | 28 | -------------------------------------------------------------------------------- /packages/theme-default/src/date-picker/time-range-picker.css: -------------------------------------------------------------------------------- 1 | @import "../common/var.css"; 2 | 3 | @component-namespace el { 4 | @b time-range-picker { 5 | min-width: 354px; 6 | overflow: visible; 7 | 8 | @e content { 9 | position: relative; 10 | text-align: center; 11 | padding: 10px; 12 | display: flex; 13 | } 14 | 15 | @e cell { 16 | box-sizing: border-box; 17 | margin: 0; 18 | padding: 4px 7px 7px; 19 | flex: 1; 20 | } 21 | 22 | @e header { 23 | margin-bottom: 5px; 24 | text-align: center; 25 | font-size: 14px; 26 | } 27 | 28 | @e body { 29 | display: flex; 30 | border-radius:2px; 31 | border: 1px solid var(--datepicker-border-color); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/badge/src/main.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 38 | -------------------------------------------------------------------------------- /packages/date-picker/README.md: -------------------------------------------------------------------------------- 1 | # el-date-picker 2 | 3 | 4 | ## Installation 5 | ```shell 6 | npm i el-date-picker -S 7 | ``` 8 | 9 | ## Usage 10 | 11 | A: 12 | ```javascript 13 | import Vue from 'vue' 14 | import ElDatePicker from 'el-date-picker' 15 | 16 | Vue.use(ElDatePicker) 17 | ``` 18 | 19 | B: 20 | ```javascript 21 | import Vue from 'vue' 22 | import { DatePicker, TimePicker, TimeSelect } from 'el-date-picker' 23 | 24 | Vue.component(DatePicker.name, DatePicker); 25 | Vue.component(TimePicker.name, TimePicker); 26 | Vue.component(TimeSelect.name, TimeSelect); 27 | ``` 28 | 29 | C: 30 | ```html 31 | 32 | 33 | 36 | ``` 37 | 38 | ## License 39 | MIT 40 | -------------------------------------------------------------------------------- /examples/docs/en-US/icon.md: -------------------------------------------------------------------------------- 1 | 12 | 13 | ## Icon 14 | 15 | Element provides a set of common icons. 16 | 17 | ### Basic usage 18 | 19 | Just assign the class name to `el-icon-iconName`. 20 | 21 | :::demo 22 | 23 | ```html 24 | 25 | 26 | 27 | Search 28 | 29 | ``` 30 | ::: 31 | 32 | ### Icons 33 | 34 |
    35 |
  • 36 | 37 | 38 | {{'el-icon-' + name}} 39 | 40 |
  • 41 |
-------------------------------------------------------------------------------- /packages/dropdown/src/dropdown-menu.vue: -------------------------------------------------------------------------------- 1 | 8 | 36 | -------------------------------------------------------------------------------- /packages/switch/README.md: -------------------------------------------------------------------------------- 1 | # el-switch 2 | > A el-switch component for Vue.js. 3 | 4 | ## Installation 5 | ```shell 6 | npm i el-switch -D 7 | ``` 8 | 9 | ## Usage 10 | ```javascript 11 | import Vue from 'vue' 12 | import ElSwitch from 'el-switch' 13 | import 'element-theme-default' 14 | 15 | Vue.use(ElSwitch) 16 | ``` 17 | 18 | or 19 | 20 | ```javascript 21 | import Vue from 'vue' 22 | import { ElSwitch } from 'el-switch' 23 | 24 | Vue.component('el-switch', ElSwitch) 25 | ``` 26 | 27 | 28 | ## Options 29 | 30 | | name | description | type | default | 31 | |-------------|-------------|-------------|-------------| 32 | | | | | | 33 | 34 | ## Development 35 | ```shell 36 | make dev 37 | 38 | ## test 39 | make test 40 | 41 | ## build 42 | make build 43 | ``` 44 | 45 | # License 46 | [MIT](https://opensource.org/licenses/MIT) 47 | -------------------------------------------------------------------------------- /packages/theme-default/src/row.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | 4 | @component-namespace el { 5 | @b row { 6 | position: relative; 7 | box-sizing: border-box; 8 | @utils-clearfix; 9 | 10 | @m flex { 11 | display: flex; 12 | &:before, 13 | &:after { 14 | display: none; 15 | } 16 | 17 | @when justify-center { 18 | justify-content: center; 19 | } 20 | @when justify-end { 21 | justify-content: flex-end; 22 | } 23 | @when justify-space-between { 24 | justify-content: space-between; 25 | } 26 | @when justify-space-around { 27 | justify-content: space-around; 28 | } 29 | 30 | @when align-middle { 31 | align-items: center; 32 | } 33 | @when align-bottom { 34 | align-items: flex-end; 35 | } 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /packages/breadcrumb/src/breadcrumb-item.vue: -------------------------------------------------------------------------------- 1 | 6 | 32 | -------------------------------------------------------------------------------- /packages/steps/src/steps.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 46 | -------------------------------------------------------------------------------- /packages/select/src/option-group.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | -------------------------------------------------------------------------------- /packages/theme-default/src/date-picker/month-table.css: -------------------------------------------------------------------------------- 1 | @import "../common/var.css"; 2 | 3 | @component-namespace el { 4 | @b month-table { 5 | font-size: 12px; 6 | margin: -1px; 7 | border-collapse: collapse; 8 | 9 | td { 10 | text-align: center; 11 | padding: 20px 3px; 12 | cursor: pointer; 13 | 14 | &.disabled .cell { 15 | background-color: #f4f4f4; 16 | cursor: not-allowed; 17 | color: #ccc; 18 | } 19 | 20 | .cell { 21 | width: 48px; 22 | height: 32px; 23 | display: block; 24 | line-height: 32px; 25 | color: var(--datepicker-color); 26 | 27 | &:hover { 28 | background-color: var(--datepicker-cell-hover-color); 29 | } 30 | } 31 | 32 | &.current .cell { 33 | background-color: var(--datepicker-active-color) !important; 34 | color: #fff; 35 | } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /packages/theme-default/src/time-select.css: -------------------------------------------------------------------------------- 1 | @import "./date-picker/picker.css"; 2 | @import "./date-picker/date-picker.css"; 3 | @import "./common/var.css"; 4 | 5 | .time-select { 6 | margin: 5px 0; 7 | min-width: 0; 8 | } 9 | 10 | .time-select .el-picker-panel__content { 11 | max-height: 200px; 12 | overflow: hidden; 13 | margin: 0; 14 | 15 | &:hover { 16 | overflow-y: auto; 17 | } 18 | } 19 | 20 | .time-select-item { 21 | padding: 8px 10px; 22 | font-size: 14px; 23 | } 24 | 25 | .time-select-item.selected:not(.disabled) { 26 | background-color: var(--datepicker-active-color); 27 | color: #fff; 28 | 29 | &:hover { 30 | background-color: #1d8ce0; 31 | } 32 | } 33 | 34 | .time-select-item.disabled { 35 | color: var(--datepicker-border-color); 36 | cursor: not-allowed; 37 | } 38 | 39 | .time-select-item:hover { 40 | background-color: var(--datepicker-cell-hover-color); 41 | cursor: pointer; 42 | } 43 | -------------------------------------------------------------------------------- /packages/table/README.md: -------------------------------------------------------------------------------- 1 | # el-table 2 | > A el-table component for Vue.js. 3 | 4 | ## Demo 5 | http://element-component.github.io/el-table 6 | 7 | ## Installation 8 | ```shell 9 | npm i el-table -D 10 | ``` 11 | 12 | ## Usage 13 | ```javascript 14 | import Vue from 'vue' 15 | import ElTable from 'el-table' 16 | import 'element-theme-default' 17 | 18 | Vue.use(ElTable) 19 | ``` 20 | 21 | or 22 | 23 | ```javascript 24 | import Vue from 'vue' 25 | import { ElTable } from 'el-table' 26 | 27 | Vue.component('el-table', ElTable) 28 | ``` 29 | 30 | 31 | ## Options 32 | 33 | | name | description | type | default | 34 | |-------------|-------------|-------------|-------------| 35 | | | | | | 36 | 37 | ## Development 38 | ```shell 39 | make dev 40 | 41 | ## test 42 | make test 43 | 44 | ## build 45 | make build 46 | ``` 47 | 48 | # License 49 | [MIT](https://opensource.org/licenses/MIT) 50 | -------------------------------------------------------------------------------- /packages/dialog/README.md: -------------------------------------------------------------------------------- 1 | # el-dialog 2 | > A el-dialog component for Vue.js. 3 | 4 | ## Demo 5 | http://element-component.github.io/el-dialog 6 | 7 | ## Installation 8 | ```shell 9 | npm i el-dialog -D 10 | ``` 11 | 12 | ## Usage 13 | ```javascript 14 | import Vue from 'vue' 15 | import ElDialog from 'el-dialog' 16 | import 'element-theme-default' 17 | 18 | Vue.use(ElDialog) 19 | ``` 20 | 21 | or 22 | 23 | ```javascript 24 | import Vue from 'vue' 25 | import { ElDialog } from 'el-dialog' 26 | 27 | Vue.component('el-dialog', ElDialog) 28 | ``` 29 | 30 | 31 | ## Options 32 | 33 | | name | description | type | default | 34 | |-------------|-------------|-------------|-------------| 35 | | | | | | 36 | 37 | ## Development 38 | ```shell 39 | make dev 40 | 41 | ## test 42 | make test 43 | 44 | ## build 45 | make build 46 | ``` 47 | 48 | # License 49 | [MIT](https://opensource.org/licenses/MIT) 50 | -------------------------------------------------------------------------------- /packages/theme-default/src/spinner.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | 4 | @component-namespace el { 5 | @b time-spinner { 6 | display: flex; 7 | width: 100%; 8 | } 9 | 10 | @b spinner { 11 | display: inline-block; 12 | vertical-align: middle; 13 | } 14 | @b spinner-inner { 15 | animation: rotate 2s linear infinite; 16 | width: 50px; 17 | height: 50px; 18 | 19 | & .path { 20 | stroke: #ececec; 21 | stroke-linecap: round; 22 | animation: dash 1.5s ease-in-out infinite; 23 | } 24 | 25 | } 26 | } 27 | @keyframes rotate { 28 | 100% { 29 | transform: rotate(360deg); 30 | } 31 | } 32 | 33 | @keyframes dash { 34 | 0% { 35 | stroke-dasharray: 1, 150; 36 | stroke-dashoffset: 0; 37 | } 38 | 50% { 39 | stroke-dasharray: 90, 150; 40 | stroke-dashoffset: -35; 41 | } 42 | 100% { 43 | stroke-dasharray: 90, 150; 44 | stroke-dashoffset: -124; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /test/unit/karma.conf.js: -------------------------------------------------------------------------------- 1 | var webpackConfig = require('../../build/cooking.test'); 2 | 3 | // no need for app entry during tests 4 | delete webpackConfig.entry; 5 | 6 | module.exports = function(config) { 7 | config.set({ 8 | // to run in additional browsers: 9 | // 1. install corresponding karma launcher 10 | // http://karma-runner.github.io/0.13/config/browsers.html 11 | // 2. add it to the `browsers` array below. 12 | browsers: ['PhantomJS'], 13 | frameworks: ['mocha', 'sinon-chai'], 14 | reporters: ['spec', 'coverage'], 15 | files: ['./index.js'], 16 | preprocessors: { 17 | './index.js': ['webpack', 'sourcemap'] 18 | }, 19 | webpack: webpackConfig, 20 | webpackMiddleware: { 21 | noInfo: true 22 | }, 23 | coverageReporter: { 24 | dir: './coverage', 25 | reporters: [ 26 | { type: 'lcov', subdir: '.' }, 27 | { type: 'text-summary' } 28 | ] 29 | } 30 | }); 31 | }; 32 | -------------------------------------------------------------------------------- /test/unit/specs/card.spec.js: -------------------------------------------------------------------------------- 1 | import { createVue, createTest, destroyVM } from '../util'; 2 | import Card from 'packages/card'; 3 | 4 | describe('Card', () => { 5 | let vm; 6 | afterEach(() => { 7 | destroyVM(vm); 8 | }); 9 | 10 | it('slot:header', () => { 11 | vm = createVue(` 12 | 13 |
二师兄叫我埋梗 啦啦啦
14 |
15 | `); 16 | 17 | expect(vm.$el.querySelector('.el-card__header')).to.property('textContent').to.include('二师兄叫我埋梗 啦啦啦'); 18 | }); 19 | 20 | it('header', () => { 21 | vm = createTest(Card, { 22 | header: '好烦' 23 | }); 24 | 25 | expect(vm.$el.querySelector('.el-card__header')).to.property('textContent').to.include('好烦'); 26 | }); 27 | 28 | it('bodyStyle', () => { 29 | vm = createTest(Card, { 30 | bodyStyle: { padding: '10px' } 31 | }); 32 | 33 | expect(vm.$el.querySelector('.el-card__body').style.padding).to.equal('10px'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /examples/i18n/component.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "lang": "zh-CN", 4 | "demo-block": { 5 | "hide-text": "隐藏代码", 6 | "show-text": "显示代码", 7 | "button-text": "在线运行", 8 | "tooltip-text": "前往 jsfiddle.net 运行此示例" 9 | }, 10 | "footer": { 11 | "feedback": "反馈建议", 12 | "contribution": "贡献指南", 13 | "eleme": "饿了么" 14 | }, 15 | "header": { 16 | "guide": "指南", 17 | "components": "组件", 18 | "resource": "资源" 19 | } 20 | }, 21 | { 22 | "lang": "en-US", 23 | "demo-block": { 24 | "hide-text": "Hide", 25 | "show-text": "Expand", 26 | "button-text": "Try it!", 27 | "tooltip-text": "Run this demo on jsfiddle.net" 28 | }, 29 | "footer": { 30 | "feedback": "Feedback", 31 | "contribution": "Contribution", 32 | "eleme": "Eleme" 33 | }, 34 | "header": { 35 | "guide": "Guide", 36 | "components": "Component", 37 | "resource": "Resource" 38 | } 39 | } 40 | ] 41 | -------------------------------------------------------------------------------- /packages/row/src/row.vue: -------------------------------------------------------------------------------- 1 | 16 | 47 | -------------------------------------------------------------------------------- /packages/theme-default/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "element-theme-default", 3 | "version": "1.0.1", 4 | "description": "Element component default theme.", 5 | "main": "lib/index.css", 6 | "style": "lib/index.css", 7 | "files": [ 8 | "lib", 9 | "src" 10 | ], 11 | "scripts": { 12 | "build": "gulp build" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/ElementUI/theme-default.git" 17 | }, 18 | "keywords": [ 19 | "element", 20 | "theme" 21 | ], 22 | "author": "haiping.zeng ", 23 | "license": "MIT", 24 | "bugs": { 25 | "url": "https://github.com/ElementUI/theme-default/issues" 26 | }, 27 | "homepage": "https://github.com/ElementUI/theme-default#readme", 28 | "devDependencies": { 29 | "gulp": "^3.9.1", 30 | "gulp-cssmin": "^0.1.7", 31 | "gulp-postcss": "^6.1.1", 32 | "postcss-salad": "^1.0.5" 33 | }, 34 | "dependencies": { 35 | "vue-popup": "^0.2.9" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/theme-default/src/breadcrumb.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | 4 | @component-namespace el { 5 | 6 | @b breadcrumb { 7 | font-size:13px; 8 | line-height: 1; 9 | @utils-clearfix; 10 | 11 | @e separator { 12 | margin: 0 8px; 13 | color: #c0ccda; 14 | } 15 | @e item { 16 | float: left; 17 | 18 | @e inner { 19 | &, & a { 20 | transition: color .15s linear; 21 | color:#475669; 22 | 23 | &:hover { 24 | color: var(--color-primary); 25 | cursor: pointer; 26 | } 27 | } 28 | } 29 | 30 | &:last-child { 31 | .el-breadcrumb__item__inner, 32 | .el-breadcrumb__item__inner a { 33 | &, &:hover { 34 | color: #99a9bf; 35 | cursor: text; 36 | } 37 | } 38 | 39 | .el-breadcrumb__separator { 40 | display: none; 41 | } 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /packages/theme-default/src/date-picker/year-table.css: -------------------------------------------------------------------------------- 1 | @import "../common/var.css"; 2 | 3 | @component-namespace el { 4 | @b year-table { 5 | font-size: 12px; 6 | margin: -1px; 7 | border-collapse: collapse; 8 | 9 | .el-icon { 10 | color: var(--datepicker-icon-color); 11 | } 12 | 13 | td { 14 | text-align: center; 15 | padding: 20px 3px; 16 | cursor: pointer; 17 | 18 | &.disabled .cell { 19 | background-color: #f4f4f4; 20 | cursor: not-allowed; 21 | color: #ccc; 22 | } 23 | 24 | .cell { 25 | width: 48px; 26 | height: 32px; 27 | display: block; 28 | line-height: 32px; 29 | color: var(--datepicker-color); 30 | 31 | &:hover { 32 | background-color: var(--datepicker-cell-hover-color); 33 | } 34 | } 35 | 36 | &.current .cell { 37 | background-color: var(--datepicker-active-color) !important; 38 | color: #fff; 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 9 | 12 | 13 | 16 | 17 | ### ElementUI version 18 | 19 | 20 | ### OS/Browers version 21 | 22 | 23 | ### Vue version 24 | 25 | 26 | ### Reproduction Link 27 | 28 | 29 | 30 | 31 | ### Steps to reproduce 32 | 33 | ### What is Expected? 34 | 35 | ### What is actually happening? 36 | -------------------------------------------------------------------------------- /examples/index.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Element 7 | 8 | 9 |
<% if (process.env.NODE_ENV === 'production') { %> 10 | 11 | <% } %> 12 | 13 | <% if (process.env.NODE_ENV === 'production') { %><% } %> 22 | 23 | -------------------------------------------------------------------------------- /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 || this.$root; 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 | -------------------------------------------------------------------------------- /packages/theme-default/src/badge.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | 4 | @component-namespace el { 5 | @b badge { 6 | position: relative; 7 | vertical-align: middle; 8 | display: inline-block; 9 | 10 | @e content { 11 | background-color: var(--badge-fill); 12 | border-radius: var(--badge-radius); 13 | color: #fff; 14 | display: inline-block; 15 | font-size: var(--badge-font-size); 16 | height: var(--badge-size); 17 | line-height: var(--badge-size); 18 | padding: 0 var(--badge-padding); 19 | text-align: center; 20 | white-space: nowrap; 21 | border: 1px solid #fff; 22 | 23 | @when fixed { 24 | position: absolute 0 calc(var(--badge-size) / 2 + 1) * *; 25 | transform: translateY(-50%) translateX(100%); 26 | 27 | @when dot { 28 | right: 5px; 29 | } 30 | } 31 | 32 | @when dot { 33 | size: 8px 8px; 34 | padding: 0; 35 | right: 0; 36 | border-radius: 50%; 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/theme-default/src/rate.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | 4 | @component-namespace el { 5 | 6 | @b rate { 7 | height: var(--rate-height); 8 | line-height: 1; 9 | 10 | @e item { 11 | display: inline-block; 12 | position: relative; 13 | font-size: 0; 14 | vertical-align: middle; 15 | } 16 | 17 | @e icon { 18 | position: relative; 19 | display: inline-block; 20 | font-size: var(--rate-icon-size); 21 | margin-right: var(--rate-icon-margin); 22 | color: var(--rate-icon-color); 23 | transition: .3s; 24 | &.hover { 25 | transform: scale(1.15); 26 | } 27 | 28 | .path2 { 29 | position: absolute; 30 | left: 0; 31 | top: 0; 32 | } 33 | } 34 | 35 | @e decimal { 36 | position: absolute; 37 | top: 0; 38 | left: 0; 39 | display: inline-block; 40 | overflow: hidden; 41 | } 42 | 43 | @e text { 44 | font-size: var(--rate-font-size); 45 | vertical-align: middle; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /test/unit/specs/badge.spec.js: -------------------------------------------------------------------------------- 1 | import { createTest, createVue, destroyVM } from '../util'; 2 | import Badge from 'packages/badge'; 3 | 4 | describe('Badge', () => { 5 | let vm; 6 | afterEach(() => { 7 | destroyVM(vm); 8 | }); 9 | 10 | it('value', () => { 11 | vm = createTest(Badge, { value: 80 }); 12 | expect(vm.content).to.equal(80); 13 | }); 14 | 15 | it('is fixed', () => { 16 | vm = createVue(` 17 | 18 | 19 | 20 | `); 21 | 22 | expect(vm.$el.querySelector('.el-badge__content.is-fixed')).to.exist; 23 | }); 24 | 25 | it('is dot', () => { 26 | vm = createVue(` 27 | 28 | 29 | 30 | `); 31 | 32 | expect(vm.$el.querySelector('.el-badge__content.is-dot')).to.exist; 33 | }); 34 | 35 | it('max', () => { 36 | vm = createTest(Badge, { max: 100, value: 200 }); 37 | expect(vm.content).to.equal('100+'); 38 | vm = createTest(Badge, { max: 100, value: 80 }); 39 | expect(vm.content).to.equal(80); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /src/locale/index.js: -------------------------------------------------------------------------------- 1 | import defaultLang from 'element-ui/src/locale/lang/zh-CN'; 2 | import Vue from 'vue'; 3 | import deepmerge from 'deepmerge'; 4 | import Format from './format'; 5 | 6 | const format = Format(Vue); 7 | let lang = defaultLang; 8 | let merged = false; 9 | 10 | export const t = function(path, options) { 11 | const vuei18n = Object.getPrototypeOf(this || Vue).$t; 12 | if (typeof vuei18n === 'function') { 13 | if (!merged) { 14 | merged = true; 15 | Vue.locale( 16 | Vue.config.lang, 17 | deepmerge(lang, Vue.locale(Vue.config.lang) || {}, { clone: true }) 18 | ); 19 | } 20 | return vuei18n.apply(this, [path, options]); 21 | } 22 | const array = path.split('.'); 23 | let current = lang; 24 | 25 | for (var i = 0, j = array.length; i < j; i++) { 26 | var property = array[i]; 27 | var value = current[property]; 28 | if (i === j - 1) return format(value, options); 29 | if (!value) return ''; 30 | current = value; 31 | } 32 | return ''; 33 | }; 34 | 35 | export const use = function(l) { 36 | lang = l || lang; 37 | }; 38 | export default { use, t }; 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 ElemeFE 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. -------------------------------------------------------------------------------- /examples/entry.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import entry from './app'; 3 | import VueRouter from 'vue-router'; 4 | import routes from './route.config'; 5 | import Element from 'main/index.js'; 6 | import 'packages/theme-default/src/index.css'; 7 | import demoBlock from './components/demo-block.vue'; 8 | import MainFooter from './components/footer.vue'; 9 | import MainHeader from './components/header.vue'; 10 | import SideNav from './components/side-nav'; 11 | import FooterNav from './components/footer-nav'; 12 | import title from './i18n/title.json'; 13 | 14 | Vue.use(Element); 15 | Vue.use(VueRouter); 16 | Vue.component('demo-block', demoBlock); 17 | Vue.component('main-footer', MainFooter); 18 | Vue.component('main-header', MainHeader); 19 | Vue.component('side-nav', SideNav); 20 | Vue.component('footer-nav', FooterNav); 21 | 22 | const router = new VueRouter({ 23 | mode: 'hash', 24 | base: __dirname, 25 | routes 26 | }); 27 | 28 | router.afterEach(route => { 29 | document.title = title[route.meta.lang][route.name] || 'Element'; 30 | }); 31 | 32 | new Vue({ // eslint-disable-line 33 | render: h => h(entry), 34 | router 35 | }).$mount('#app'); 36 | -------------------------------------------------------------------------------- /src/locale/format.js: -------------------------------------------------------------------------------- 1 | /** 2 | * String format template 3 | * - Inspired: 4 | * https://github.com/Matt-Esch/string-template/index.js 5 | */ 6 | 7 | const RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g; 8 | 9 | export default function(Vue) { 10 | const { hasOwn } = Vue.util; 11 | 12 | /** 13 | * template 14 | * 15 | * @param {String} string 16 | * @param {Array} ...args 17 | * @return {String} 18 | */ 19 | 20 | function template(string, ...args) { 21 | if (args.length === 1 && typeof args[0] === 'object') { 22 | args = args[0]; 23 | } 24 | 25 | if (!args || !args.hasOwnProperty) { 26 | args = {}; 27 | } 28 | 29 | return string.replace(RE_NARGS, (match, prefix, i, index) => { 30 | let result; 31 | 32 | if (string[index - 1] === '{' && 33 | string[index + match.length] === '}') { 34 | return i; 35 | } else { 36 | result = hasOwn(args, i) ? args[i] : null; 37 | if (result === null || result === undefined) { 38 | return ''; 39 | } 40 | 41 | return result; 42 | } 43 | }); 44 | } 45 | 46 | return template; 47 | } 48 | -------------------------------------------------------------------------------- /packages/input/README.md: -------------------------------------------------------------------------------- 1 | # el-input 2 | > A el-input component for Vue.js. 3 | 4 | # Demo 5 | http://element-component.github.io/el-input 6 | 7 | # Installation 8 | ```shell 9 | npm i el-input -D 10 | ``` 11 | 12 | # Usage 13 | ```javascript 14 | import Vue from 'vue' 15 | import ElInput from 'el-input' 16 | import 'element-theme-default/dist/input.css' 17 | 18 | Vue.use(ElInput) 19 | ``` 20 | 21 | or 22 | 23 | ```javascript 24 | import Vue from 'vue' 25 | import { ElInput } from 'el-input' 26 | 27 | Vue.component('el-input', ElInput) 28 | ``` 29 | 30 | # Options 31 | 32 | | name | description | type | default | 33 | |-------------|-------------|-------------|-------------| 34 | | model | 绑定值,需双向绑定 | string|number || 35 | | placeholder | 输入框占位文本 | string || 36 | | suggestion | 输入建议 | string[] || 37 | | disabled | 是否禁用 | boolean | false | 38 | | cache | 是否需要缓存 | boolean | false | 39 | | effect | 输入框效果,允许 text, number, special | string | text | 40 | 41 | # Development 42 | ```shell 43 | make dev 44 | 45 | # test 46 | make test 47 | 48 | # build 49 | make build 50 | ``` 51 | 52 | # License 53 | [MIT](https://opensource.org/licenses/MIT) 54 | -------------------------------------------------------------------------------- /packages/radio/README.md: -------------------------------------------------------------------------------- 1 | # el-radio 2 | > A el-radio component for Vue.js. 3 | 4 | ## Demo 5 | http://element-component.github.io/el-radio 6 | 7 | ## Installation 8 | ```shell 9 | npm i el-radio -D 10 | ``` 11 | 12 | ## Usage 13 | ```javascript 14 | import Vue from 'vue' 15 | import ElRadio from 'el-radio' 16 | import 'element-theme-default/dist/radio.css' 17 | 18 | Vue.use(ElRadio) 19 | ``` 20 | 21 | or 22 | 23 | ```javascript 24 | import Vue from 'vue' 25 | import { ElRadio } from 'el-radio' 26 | 27 | Vue.component('el-radio', ElRadio) 28 | ``` 29 | 30 | 31 | ## Options 32 | | 参数 | 说明 | 类型 | 可选值 | 默认值 | 33 | |---------- |-------- |---------- |------------- |-------- | 34 | | model | 绑定值 | string | | | 35 | | value | 真实值 | string | | | 36 | | label | 显示值,默认显示 value | string | | | 37 | | disabled | 禁用 | boolean | true, false | false | 38 | 39 | ## Development 40 | ```shell 41 | make dev 42 | 43 | ## test 44 | make test 45 | 46 | ## build 47 | make build 48 | ``` 49 | 50 | # License 51 | [MIT](https://opensource.org/licenses/MIT) 52 | -------------------------------------------------------------------------------- /packages/theme-default/src/core/dropdown.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "../common/var.css"; 3 | @import "./option.css"; 4 | 5 | @component-namespace element { 6 | 7 | @b dropdown { 8 | background-color: var(--dropdown-fill); 9 | border: var(--dropdown-border); 10 | border-radius: var(--dropdown-radius); 11 | box-shadow: var(--dropdown-shadow); 12 | left: 0; 13 | list-style-type: none; 14 | margin: -var(--dropdown-border-width); 15 | margin-top: 5px; 16 | min-width: calc(var(--input-width) + 4); 17 | padding: 0; 18 | position: absolute; 19 | white-space: nowrap; 20 | z-index: var(--index-normal); 21 | 22 | @e empty { 23 | color: var(--dropdown-option-empty-color); 24 | font-size: var(--input-font-size); 25 | padding: 7px; 26 | text-align: center; 27 | } 28 | 29 | @e list { 30 | margin: 0; 31 | max-height: var(--cascader-height); 32 | overflow: auto; 33 | padding: 0; 34 | } 35 | 36 | @e option { 37 | max-height: 250px; 38 | overflow: auto; 39 | } 40 | 41 | &:empty { 42 | display: none; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /packages/input-number/README.md: -------------------------------------------------------------------------------- 1 | # el-input 2 | > A el-input component for Vue.js. 3 | 4 | # Demo 5 | http://element-component.github.io/el-input 6 | 7 | # Installation 8 | ```shell 9 | npm i el-input -D 10 | ``` 11 | 12 | # Usage 13 | ```javascript 14 | import Vue from 'vue' 15 | import ElInput from 'el-input' 16 | import 'element-theme-default/dist/input.css' 17 | 18 | Vue.use(ElInput) 19 | ``` 20 | 21 | or 22 | 23 | ```javascript 24 | import Vue from 'vue' 25 | import { ElInput } from 'el-input' 26 | 27 | Vue.component('el-input', ElInput) 28 | ``` 29 | 30 | # Options 31 | 32 | | name | description | type | default | 33 | |-------------|-------------|-------------|-------------| 34 | | model | 绑定值,需双向绑定 | string|number || 35 | | placeholder | 输入框占位文本 | string || 36 | | suggestion | 输入建议 | string[] || 37 | | disabled | 是否禁用 | boolean | false | 38 | | cache | 是否需要缓存 | boolean | false | 39 | | effect | 输入框效果,允许 text, number, special | string | text | 40 | 41 | # Development 42 | ```shell 43 | make dev 44 | 45 | # test 46 | make test 47 | 48 | # build 49 | make build 50 | ``` 51 | 52 | # License 53 | [MIT](https://opensource.org/licenses/MIT) 54 | -------------------------------------------------------------------------------- /packages/menu/src/menu-item-group.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 48 | -------------------------------------------------------------------------------- /packages/theme-default/src/date-picker/time-spinner.css: -------------------------------------------------------------------------------- 1 | @import "../common/var.css"; 2 | 3 | @component-namespace el { 4 | @b time-spinner { 5 | @e wrapper { 6 | height: 190px; 7 | overflow: hidden; 8 | flex: 1; 9 | vertical-align: top; 10 | position: relative; 11 | -ms-overflow-style: none; 12 | 13 | &:hover { 14 | overflow-y: auto; 15 | } 16 | } 17 | 18 | @e list { 19 | padding: 0; 20 | margin: 0; 21 | list-style: none; 22 | text-align: center; 23 | 24 | &::after, 25 | &::before { 26 | content: ''; 27 | display: block; 28 | width: 100%; 29 | height: 80px; 30 | } 31 | } 32 | 33 | @e item { 34 | height: 32px; 35 | line-height: 32px; 36 | font-size: 12px; 37 | 38 | &:hover:not(.disabled):not(.active) { 39 | background: #E5E9F2; 40 | cursor: pointer; 41 | } 42 | 43 | &.active:not(.disabled) { 44 | color: #fff; 45 | } 46 | 47 | &.disabled { 48 | color: var(--datepicker-border-color); 49 | cursor: not-allowed; 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /examples/docs/zh-CN/breadcrumb.md: -------------------------------------------------------------------------------- 1 | ## Breadcrumb 面包屑 2 | 显示当前页面的路径,快速返回之前的任意页面。 3 | 4 | ### 基础用法 5 | 6 | 适用广泛的基础用法。 7 | 8 | :::demo 在`el-breadcrumb`中使用`el-breadcrumb-item`标签表示从首页开始的每一级。Element 提供了一个`separator`属性,在`el-breadcrumb`标签中设置它来决定分隔符,它只能是字符串,默认为斜杠`/`。 9 | 10 | ```html 11 | 12 | 首页 13 | 活动管理 14 | 活动列表 15 | 活动详情 16 | 17 | ``` 18 | ::: 19 | 20 | ### Breadcrumb Attributes 21 | | 参数 | 说明 | 类型 | 可选值 | 默认值 | 22 | |---------- |-------------- |---------- |-------------------------------- |-------- | 23 | | separator | 分隔符 | string | — | 斜杠'/' | 24 | 25 | ### Breadcrumb Item Attributes 26 | | 参数 | 说明 | 类型 | 可选值 | 默认值 | 27 | |---------- |-------------- |---------- |-------------------------------- |-------- | 28 | | to | 路由跳转对象,同 `vue-router` 的 `to` | string/object | — | — | 29 | | replace | 在使用 to 进行路由跳转时,启用 replace 将不会向 history 添加新记录 | boolean | — | false | 30 | -------------------------------------------------------------------------------- /packages/theme-default/src/cascader.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./input.css"; 3 | @import "./common/var.css"; 4 | /*@import "./core/dropdown.css";*/ 5 | 6 | @component-namespace element { 7 | 8 | @b cascader { 9 | display: inline-block; 10 | position: relative; 11 | 12 | @e dropdown { 13 | background-color: var(--cascader-menu-fill); 14 | border: var(--cascader-menu-border); 15 | border-radius: var(--cascader-menu-radius); 16 | box-shadow: var(--cascader-menu-submenu-shadow); 17 | margin-top: 5px; 18 | max-height: var(--cascader-height); 19 | position: absolute; 20 | white-space: nowrap; 21 | z-index: 10; 22 | } 23 | 24 | @e wrap { 25 | overflow: hidden; 26 | } 27 | 28 | @e menu { 29 | border: 0; 30 | box-shadow: none; 31 | display: inline-block; 32 | margin: 0; 33 | position: relative; 34 | vertical-align: top; 35 | 36 | &::before { 37 | border-left: var(--cascader-menu-border); 38 | content: " "; 39 | height: var(--cascader-height); 40 | left: 0; 41 | position: absolute; 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /packages/checkbox/README.md: -------------------------------------------------------------------------------- 1 | # el-checkbox 2 | > A el-checkbox component for Vue.js. 3 | 4 | ## Demo 5 | http://element-component.github.io/el-checkbox 6 | 7 | ## Installation 8 | ```shell 9 | npm i el-checkbox -D 10 | ``` 11 | 12 | ## Usage 13 | ```javascript 14 | import Vue from 'vue' 15 | import ElCheckbox from 'el-checkbox' 16 | import 'element-theme-default/dist/checkbox.css' 17 | 18 | Vue.use(ElCheckbox) 19 | ``` 20 | 21 | or 22 | 23 | ```javascript 24 | import Vue from 'vue' 25 | import { ElCheckbox } from 'el-checkbox' 26 | 27 | Vue.component('el-checkbox', ElCheckbox) 28 | ``` 29 | 30 | 31 | ## Options 32 | | 参数 | 说明 | 类型 | 可选值 | 默认值 | 33 | |---------- |-------- |---------- |------------- |-------- | 34 | | model | 绑定值 | string[] | | | 35 | | value | 真实值 | string | | | 36 | | label | 显示值,不填则显示 value | string | | | 37 | | disabled | 禁用 | boolean | true, false | false | 38 | 39 | ## Development 40 | ```shell 41 | make dev 42 | 43 | ## test 44 | make test 45 | 46 | ## build 47 | make build 48 | ``` 49 | 50 | # License 51 | [MIT](https://opensource.org/licenses/MIT) 52 | -------------------------------------------------------------------------------- /packages/menu/src/menu-item.vue: -------------------------------------------------------------------------------- 1 | 44 | 45 | 55 | -------------------------------------------------------------------------------- /packages/radio/src/radio-button.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 52 | -------------------------------------------------------------------------------- /examples/assets/styles/fonts/style.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'icomoon'; 3 | src: url('assets/styles/fonts/icomoon.eot?h6xgdm'); 4 | src: url('assets/styles/fonts/icomoon.eot?h6xgdm#iefix') format('embedded-opentype'), 5 | url('assets/styles/fonts/icomoon.ttf?h6xgdm') format('truetype'), 6 | url('assets/styles/fonts/icomoon.woff?h6xgdm') format('woff'), 7 | url('assets/styles/fonts/icomoon.svg?h6xgdm#icomoon') format('svg'); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | 12 | [class^="icon-"], [class*=" icon-"] { 13 | /* use !important to prevent issues with browser extensions that change fonts */ 14 | font-family: 'icomoon' !important; 15 | speak: none; 16 | font-style: normal; 17 | font-weight: normal; 18 | font-variant: normal; 19 | text-transform: none; 20 | line-height: 1; 21 | 22 | /* Better Font Rendering =========== */ 23 | -webkit-font-smoothing: antialiased; 24 | -moz-osx-font-smoothing: grayscale; 25 | } 26 | 27 | .icon-rate-face-off:before { 28 | content: "\e900"; 29 | } 30 | .icon-rate-face-1:before { 31 | content: "\e901"; 32 | } 33 | .icon-rate-face-2:before { 34 | content: "\e902"; 35 | } 36 | .icon-rate-face-3:before { 37 | content: "\e903"; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /packages/theme-default/src/option.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | 4 | @component-namespace el { 5 | 6 | @b select-dropdown { 7 | @e item { 8 | font-size: var(--select-font-size); 9 | padding: 8px 10px; 10 | position: relative; 11 | white-space: nowrap; 12 | overflow: hidden; 13 | text-overflow: ellipsis; 14 | color: var(--select-option-color); 15 | height: var(--select-option-height); 16 | line-height: 1.5; 17 | box-sizing: border-box; 18 | cursor: pointer; 19 | 20 | @when disabled { 21 | color: var(--select-option-disabled-color); 22 | cursor: not-allowed; 23 | 24 | &:hover { 25 | background-color: var(--color-white); 26 | } 27 | } 28 | 29 | &.hover { 30 | background-color: var(--select-option-hover-background); 31 | } 32 | 33 | &.selected { 34 | color: var(--color-white); 35 | background-color: var(--select-option-selected); 36 | 37 | &.hover { 38 | background-color: var(--select-option-selected-hover); 39 | } 40 | } 41 | 42 | & span { 43 | line-height: 1.5 !important; 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 5 3 | cache: 4 | bundler: true 5 | directories: 6 | - node_modules 7 | - travis_phantomjs 8 | before_install: 9 | - export TRAVIS_COMMIT_MSG="[deploy] $(git log --format='%h - %B' --no-merges -n 1)" 10 | - export TRAVIS_COMMIT_USER="$(git log --no-merges -n 1 --format=%an)" 11 | - export TRAVIS_COMMIT_EMAIL="$(git log --no-merges -n 1 --format=%ae)" 12 | - export PHANTOMJS_VERSION=2.1.1 13 | - export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH 14 | - if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs; 15 | mkdir -p $PWD/travis_phantomjs; fi 16 | - if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 17 | -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi 18 | - if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 19 | -C $PWD/travis_phantomjs; fi 20 | - phantomjs --version 21 | after_success: 22 | - sh build/deploy-ci.sh 23 | - cat ./test/unit/coverage/lcov.info | ./node_modules/.bin/coveralls 24 | -------------------------------------------------------------------------------- /packages/theme-default/src/index.css: -------------------------------------------------------------------------------- 1 | @import "./base.css"; 2 | @import "./button.css"; 3 | @import "./input.css"; 4 | @import "./select.css"; 5 | @import "./alert.css"; 6 | @import "./notification.css"; 7 | @import "./slider.css"; 8 | @import "./checkbox.css"; 9 | @import "./radio.css"; 10 | @import "./switch.css"; 11 | @import "./dropdown.css"; 12 | @import "./dropdown-menu.css"; 13 | @import "./loading.css"; 14 | @import "./dialog.css"; 15 | @import "./table.css"; 16 | @import "./table-column.css"; 17 | @import "./pagination.css"; 18 | @import "./popover.css"; 19 | @import "./tooltip.css"; 20 | @import "./autocomplete.css"; 21 | @import "./message.css"; 22 | @import "./message-box.css"; 23 | @import "./date-picker.css"; 24 | @import "./time-picker.css"; 25 | @import "./time-select.css"; 26 | @import "./input-number.css"; 27 | @import "./tag.css"; 28 | @import "./breadcrumb.css"; 29 | @import "./form.css"; 30 | @import "./tabs.css"; 31 | @import "./progress.css"; 32 | @import "./tree.css"; 33 | @import "./menu.css"; 34 | @import "./upload.css"; 35 | @import "./row.css"; 36 | @import "./col.css"; 37 | @import "./spinner.css"; 38 | @import "./badge.css"; 39 | @import "./card.css"; 40 | @import "./rate.css"; 41 | @import "./steps.css"; 42 | @import "./step.css"; 43 | -------------------------------------------------------------------------------- /packages/button/src/button.vue: -------------------------------------------------------------------------------- 1 | 21 | 52 | -------------------------------------------------------------------------------- /test/unit/specs/row.spec.js: -------------------------------------------------------------------------------- 1 | import { createTest, destroyVM } from '../util'; 2 | import Row from 'packages/row'; 3 | 4 | describe('Row', () => { 5 | let vm; 6 | afterEach(() => { 7 | destroyVM(vm); 8 | }); 9 | 10 | it('create', () => { 11 | vm = createTest(Row, true); 12 | let rowElm = vm.$el; 13 | expect(rowElm.classList.contains('el-row')).to.be.true; 14 | }); 15 | it('gutter', () => { 16 | vm = createTest(Row, { 17 | gutter: 20 18 | }, true); 19 | let rowElm = vm.$el; 20 | expect(rowElm.style.marginLeft).to.be.equal('-10px'); 21 | expect(rowElm.style.marginRight).to.be.equal('-10px'); 22 | }); 23 | it('type', () => { 24 | vm = createTest(Row, { 25 | type: 'flex' 26 | }, true); 27 | let rowElm = vm.$el; 28 | expect(rowElm.classList.contains('el-row--flex')).to.be.true; 29 | }); 30 | it('justify', () => { 31 | vm = createTest(Row, { 32 | justify: 'end' 33 | }, true); 34 | let rowElm = vm.$el; 35 | expect(rowElm.classList.contains('is-justify-end')).to.be.true; 36 | }); 37 | it('align', () => { 38 | vm = createTest(Row, { 39 | align: 'bottom' 40 | }, true); 41 | let rowElm = vm.$el; 42 | expect(rowElm.classList.contains('is-align-bottom')).to.be.true; 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /examples/docs/zh-CN/i18n.md: -------------------------------------------------------------------------------- 1 | 11 | ## 国际化 12 | 13 | Element 组件内部默认使用中文,若希望使用其他语言,则需要进行多语言设置。以英文为例,在 main.js 中: 14 | 15 | ```javascript 16 | // 完整引入 Element 17 | import Vue from 'vue' 18 | import ElementUI from 'element-ui' 19 | import locale from 'element-ui/lib/locale/lang/en' 20 | 21 | Vue.use(ElementUI, { locale }) 22 | ``` 23 | 24 | 或 25 | 26 | ```javascript 27 | // 按需引入 Element 28 | import Vue from 'vue' 29 | import { Button, Select } from 'element-ui' 30 | import lang from 'element-ui/lib/locale/lang/en' 31 | import locale from 'element-ui/lib/locale' 32 | 33 | // 设置语言 34 | locale.use(lang) 35 | 36 | // 引入组件 37 | Vue.component(Button.name, Button) 38 | Vue.component(Select.name, Select) 39 | ``` 40 | 41 | 如果使用其它语言,默认情况下中文语言包依旧是被引入的,可以使用 webpack 的 IgnorePlugin 忽略掉它以减少打包后的文件体积。 42 | 43 | **webpack.config.js** 44 | ```javascript 45 | { 46 | plugins: [ 47 | new webpack.IgnorePlugin(/element-ui\/lib\/locale\/lang\/zh-CN/) 48 | ] 49 | } 50 | ``` 51 | 52 | 目前 Element 内置了以下语言: 53 |
    54 |
  • 汉语(zh-CN)
  • 55 |
  • 英语(en)
  • 56 |
  • 德语(de)
  • 57 |
  • 葡萄牙语(pt)
  • 58 |
59 | 60 | 如果你需要使用其他的语言,欢迎贡献 PR:只需在 [这里](https://github.com/ElemeFE/element/tree/master/src/locale/lang) 添加一个语言配置文件即可。 61 | -------------------------------------------------------------------------------- /packages/select/src/select-dropdown.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 59 | -------------------------------------------------------------------------------- /packages/theme-default/src/core/input.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "../common/var.css"; 3 | 4 | @component-namespace element-core { 5 | 6 | @b input { 7 | background-color: var(--input-fill); 8 | border: var(--input-border); 9 | border-radius: var(--input-border-radius); 10 | box-sizing: border-box; 11 | color: var(--input-color); 12 | cursor: text; 13 | display: inline-block; 14 | font-size: var(--input-font-size); 15 | min-height: var(--input-height); 16 | min-width: var(--input-width); 17 | padding: 2px; 18 | position: relative; 19 | vertical-align: middle; 20 | 21 | @when disabled { 22 | background-color: var(--input-fill-disabled); 23 | border-color: inherit; 24 | box-shadow: none; 25 | color: var(--input-color-disabled); 26 | cursor: not-allowed; 27 | } 28 | 29 | @when readonly { 30 | cursor: pointer; 31 | } 32 | 33 | @when multiple { 34 | cursor: text; 35 | } 36 | 37 | &:hover, 38 | &.is-active { 39 | border-color: var(--input-focus-border); 40 | box-shadow: var(--input-shadow-hover); 41 | } 42 | 43 | @e original { 44 | background-color: inherit; 45 | border: none; 46 | box-sizing: border-box; 47 | cursor: inherit; 48 | height: 100%; 49 | line-height: 1.2; 50 | outline: none; 51 | padding: 5px 7px; 52 | width: auto; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /examples/docs/en-US/breadcrumb.md: -------------------------------------------------------------------------------- 1 | ## Breadcrumb 2 | 3 | Displays the location of the current page, making it easier to browser back. 4 | 5 | ### Basic usage 6 | 7 | 8 | :::demo In `el-breadcrumb`, each `el-breadcrumb-item` is a tag that stands for every level starting from homepage. This component has a `String` attribute `separator`, and it determines the separator. Its default value is '/'. 9 | 10 | ```html 11 | 12 | homepage 13 | promotion management 14 | promotion list 15 | promotion detail 16 | 17 | ``` 18 | ::: 19 | 20 | ### Breadcrumb Attributes 21 | | Attribute | Description | Type | Accepted Values | Default| 22 | |---------- |-------------- |---------- |-------------------------------- |-------- | 23 | | separator | separator character | string | — | / | 24 | 25 | ### Breadcrumb Item Attributes 26 | | Attribute | Description | Type | Accepted Values | Default| 27 | |---------- |-------------- |---------- |-------------------------------- |-------- | 28 | | to | target route of the link, same as `to` of `vue-router` | string/object | — | — | 29 | | replace | if `true`, the navigation will not leave a history record | boolean | — | false | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /CHANGELOG.en-US.md: -------------------------------------------------------------------------------- 1 | ## Changelog 2 | 3 | ### 1.0.1 4 | 5 | *2016-11-16* 6 | 7 | - Fixed Pagination improperly triggering multiple `current-change` events 8 | - Fixed Switch style when nested in a Form, #967 9 | - Fixed Loading locks scroll of `body` in specific scenarios, #968 10 | - `span` of Col is no longer a required attribute, and its default value is `24` if omitted 11 | - Added `disabled` and `editable` attribute for DatePicker, #976 12 | - Fixed DatePicker readonly with native behavior, #976 13 | - Added `close` method for Message and Notification to manually close an instance 14 | - Added clear value feature for DatePicker, #759 15 | - Fixed Form reports an error when resetting a Date typed field, #937 16 | - Fixed Table render error using vue-loader 9.9.0 17 | - Added `align-center` attribute for Step, #994 18 | - Fixed Upload missing Progress component, #1013 19 | - Layout now supports responsive layout 20 | - Added `show-close` for Dialog 21 | - Fixed an error when `vue-i18n` is imported but not configured, #973 22 | - Fixed DatePicker not refresh view with an initial value, #1050 23 | - Fixed DiatePicker not refresh year when switched in month picker, #1070 24 | - Added $loading service 25 | - Added `manual` trigger in Popover 26 | - Added props: `nodeKey` `emptyText` `checkStrictly` `defaultExpandAll` `autoExpandParent` `defaultCheckedKeys` `defaultExpandedKeys` and method: `setCheckedNodes` for Tree 27 | 28 | ### 1.0.0 29 | 30 | *2016-11-9* 31 | 32 | Element 1.0.0 released. 33 | -------------------------------------------------------------------------------- /packages/upload/src/upload-list.vue: -------------------------------------------------------------------------------- 1 | 25 | 49 | -------------------------------------------------------------------------------- /examples/docs/zh-CN/installation.md: -------------------------------------------------------------------------------- 1 | ## 安装 2 | 3 | ### npm 安装 4 | 推荐使用 npm 的方式安装,它能更好地和 [webpack](https://webpack.js.org/) 打包工具配合使用。 5 | 6 | ```shell 7 | npm i element-ui -D 8 | ``` 9 | 10 | ### CDN 11 | 目前可以通过 [unpkg.com/element-ui](https://unpkg.com/element-ui/) 获取到最新版本的资源,在页面上引入 js 和 css 文件即可开始使用。 12 | 13 | ```html 14 | 15 | 16 | 17 | 18 | ``` 19 | 20 | ### Hello world 21 | 通过 CDN 的方式我们可以很容易地使用 Element 写出一个 Hello world 页面。[在线演示](http://codepen.io/QingWei-Li/pen/vXwJrY) 22 | 23 | ```html 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 | 按钮 34 | 35 |

欢迎使用 Element

36 |
37 |
38 | 39 | 40 | 41 | 42 | 43 | 51 | 52 | ``` 53 | 如果是通过 npm 安装,并希望配合 webpack 使用,请阅读下一节:快速上手。 -------------------------------------------------------------------------------- /src/utils/clickoutside.js: -------------------------------------------------------------------------------- 1 | import { on } from 'wind-dom/src/event'; 2 | 3 | const nodeList = []; 4 | const ctx = '@@clickoutsideContext'; 5 | 6 | on(document, 'click', e => { 7 | nodeList.forEach(node => node[ctx].documentHandler(e)); 8 | }); 9 | /** 10 | * v-clickoutside 11 | * @desc 点击元素外面才会触发的事件 12 | * @example 13 | * ```vue 14 | *
15 | * ``` 16 | */ 17 | export default { 18 | bind(el, binding, vnode) { 19 | const id = nodeList.push(el) - 1; 20 | const documentHandler = function(e) { 21 | if (!vnode.context || 22 | el.contains(e.target) || 23 | (vnode.context.popperElm && 24 | vnode.context.popperElm.contains(e.target))) return; 25 | 26 | if (binding.expression) { 27 | el[ctx].methodName && 28 | vnode.context[el[ctx].methodName] && 29 | vnode.context[el[ctx].methodName](); 30 | } else { 31 | el[ctx].bindingFn && el[ctx].bindingFn(); 32 | } 33 | }; 34 | el[ctx] = { 35 | id, 36 | documentHandler, 37 | methodName: binding.expression, 38 | bindingFn: binding.value 39 | }; 40 | }, 41 | 42 | update(el, binding) { 43 | el[ctx].methodName = binding.expression; 44 | el[ctx].bindingFn = binding.value; 45 | }, 46 | 47 | unbind(el) { 48 | let len = nodeList.length; 49 | 50 | for (let i = 0; i < len; i++) { 51 | if (nodeList[i][ctx].id === el[ctx].id) { 52 | nodeList.splice(i, 1); 53 | break; 54 | } 55 | } 56 | } 57 | }; 58 | -------------------------------------------------------------------------------- /packages/tabs/src/tab-pane.vue: -------------------------------------------------------------------------------- 1 | 60 | 65 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: dist test 2 | default: help 3 | 4 | # build all theme 5 | build-theme: 6 | npm run build:theme 7 | 8 | install: 9 | npm install 10 | 11 | install-cn: 12 | npm install --registry=http://registry.npm.taobao.org 13 | 14 | dev: 15 | npm run dev 16 | 17 | play: 18 | npm run dev:play 19 | 20 | new: 21 | node build/bin/new.js $(filter-out $@,$(MAKECMDGOALS)) 22 | 23 | new-lang: 24 | node build/bin/new-lang.js $(filter-out $@,$(MAKECMDGOALS)) 25 | 26 | dist: install 27 | npm run dist 28 | 29 | dist-all: 30 | npm run dist:all 31 | 32 | deploy: 33 | @npm run deploy 34 | 35 | pub: 36 | npm run pub 37 | 38 | pub-all: 39 | npm run pub:all 40 | 41 | test: 42 | npm run test:watch 43 | 44 | help: 45 | @echo " \033[35mmake\033[0m \033[1m命令使用说明\033[0m" 46 | @echo " \033[35mmake install\033[0m\t\033[0m\t\033[0m\t\033[0m\t--- 安装依赖" 47 | @echo " \033[35mmake new [中文名]\033[0m\t--- 创建新组件 package. 例如 'make new button 按钮'" 48 | @echo " \033[35mmake dev\033[0m\t\033[0m\t\033[0m\t\033[0m\t--- 开发模式" 49 | @echo " \033[35mmake dist\033[0m\t\033[0m\t\033[0m\t\033[0m\t--- 编译项目,生成目标文件" 50 | @echo " \033[35mmake dist-all\033[0m\t\033[0m\t\033[0m\t--- 分别编译每个组件项目" 51 | @echo " \033[35mmake deploy\033[0m\t\033[0m\t\033[0m\t\033[0m\t--- 部署 demo" 52 | @echo " \033[35mmake pub\033[0m\t\033[0m\t\033[0m\t\033[0m\t--- 发布到 npm 上" 53 | @echo " \033[35mmake pub-all\033[0m\t\033[0m\t\033[0m\t\033[0m\t--- 发布各组件到 npm 上" 54 | @echo " \033[35mmake new-lang \033[0m\t\033[0m\t\033[0m\t--- 为网站添加新语言. 例如 'make new-lang fr'" 55 | -------------------------------------------------------------------------------- /packages/radio/src/radio.vue: -------------------------------------------------------------------------------- 1 | 26 | 60 | -------------------------------------------------------------------------------- /src/mixins/migrating.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Show migrating guide in browser console. 3 | * 4 | * Usage: 5 | * import Migrating from 'element-ui/src/mixins/migrating'; 6 | * 7 | * mixins: [Migrating] 8 | * 9 | * add getMigratingConfig method for your component. 10 | * getMigratingConfig() { 11 | * return { 12 | * props: { 13 | * 'allow-no-selection': 'allow-no-selection is removed.', 14 | * 'selection-mode': 'selection-mode is removed.' 15 | * }, 16 | * events: { 17 | * selectionchange: 'selectionchange is renamed to selection-change.' 18 | * } 19 | * }; 20 | * }, 21 | */ 22 | export default { 23 | mounted() { 24 | if (process.env.NODE_ENV === 'production') return; 25 | if (!this.$vnode) return; 26 | const { props, events } = this.getMigratingConfig(); 27 | const { data, componentOptions } = this.$vnode; 28 | const definedProps = data.attrs || {}; 29 | const definedEvents = componentOptions.listeners || {}; 30 | 31 | for (let propName in definedProps) { 32 | if (definedProps.hasOwnProperty(propName) && props[propName]) { 33 | console.warn(`[Element Migrating][Attribute]: ${props[propName]}`); 34 | } 35 | } 36 | 37 | for (let eventName in definedEvents) { 38 | if (definedEvents.hasOwnProperty(eventName) && events[eventName]) { 39 | console.warn(`[Element Migrating][Event]: ${events[eventName]}`); 40 | } 41 | } 42 | }, 43 | methods: { 44 | getMigratingConfig() { 45 | return { 46 | props: {}, 47 | events: {} 48 | }; 49 | } 50 | } 51 | }; 52 | -------------------------------------------------------------------------------- /src/utils/sync.js: -------------------------------------------------------------------------------- 1 | const SYNC_HOOK_PROP = '$v-sync'; 2 | 3 | /** 4 | * v-sync directive 5 | * 6 | * Usage: 7 | * v-sync:component-prop="context prop name" 8 | * 9 | * If your want to sync component's prop "visible" to context prop "myVisible", use like this: 10 | * v-sync:visible="myVisible" 11 | */ 12 | export default { 13 | bind(el, binding, vnode) { 14 | const context = vnode.context; 15 | const component = vnode.child; 16 | const expression = binding.expression; 17 | const prop = binding.arg; 18 | 19 | if (!expression || !prop) { 20 | console.warn('v-sync should specify arg & expression, for example: v-sync:visible="myVisible"'); 21 | return; 22 | } 23 | 24 | if (!component || !component.$watch) { 25 | console.warn('v-sync is only available on Vue Component'); 26 | return; 27 | } 28 | 29 | const unwatchContext = context.$watch(expression, (val) => { 30 | component[prop] = val; 31 | }); 32 | 33 | const unwatchComponent = component.$watch(prop, (val) => { 34 | context[expression] = val; 35 | }); 36 | 37 | Object.defineProperty(component, SYNC_HOOK_PROP, { 38 | value: { 39 | unwatchContext, 40 | unwatchComponent 41 | }, 42 | enumerable: false 43 | }); 44 | }, 45 | 46 | unbind(el, binding, vnode) { 47 | const component = vnode.child; 48 | if (component && component[SYNC_HOOK_PROP]) { 49 | const { unwatchContext, unwatchComponent } = component[SYNC_HOOK_PROP]; 50 | unwatchContext && unwatchContext(); 51 | unwatchComponent && unwatchComponent(); 52 | } 53 | } 54 | }; 55 | -------------------------------------------------------------------------------- /examples/docs/en-US/i18n.md: -------------------------------------------------------------------------------- 1 | ## Internationalization 2 | 3 | The default language of Element is Chinese. If you wish to use another language, you'll need to do some i18n configuration. In your entry file, if you are importing Element entirely: 4 | 5 | ```javascript 6 | import Vue from 'vue' 7 | import ElementUI from 'element-ui' 8 | import locale from 'element-ui/lib/locale/lang/en' 9 | 10 | Vue.use(ElementUI, { locale }) 11 | ``` 12 | 13 | Or if you are importing Element on demand: 14 | 15 | ```javascript 16 | import Vue from 'vue' 17 | import { Button, Select } from 'element-ui' 18 | import lang from 'element-ui/lib/locale/lang/en' 19 | import locale from 'element-ui/lib/locale' 20 | 21 | // configure language 22 | locale.use(lang) 23 | 24 | // import components 25 | Vue.component(Button.name, Button) 26 | Vue.component(Select.name, Select) 27 | ``` 28 | 29 | The Chinese language pack is imported by default, even if you're using another language. But with `IgnorePlugin` provided by webpack you can ignore it when building: 30 | 31 | webpack.config.js 32 | ```javascript 33 | { 34 | plugins: [ 35 | new webpack.IgnorePlugin(/element-ui\/lib\/locale\/lang\/zh-CN/) 36 | ] 37 | } 38 | ``` 39 | 40 | Currently Element ships with the following languages: 41 |
    42 |
  • Chinese (zh-CN)
  • 43 |
  • English (en)
  • 44 |
  • German (de)
  • 45 |
  • Portuguese (pt)
  • 46 |
47 | 48 | If your target language is not included, you are more than welcome to contribute: just add another language config [here](https://github.com/ElemeFE/element/tree/master/src/locale/lang) and create a pull request. 49 | -------------------------------------------------------------------------------- /packages/message/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import { PopupManager } from 'vue-popup'; 3 | let MessageConstructor = Vue.extend(require('./main.vue')); 4 | 5 | let instance; 6 | let instances = []; 7 | let seed = 1; 8 | 9 | var Message = function(options) { 10 | options = options || {}; 11 | if (typeof options === 'string') { 12 | options = { 13 | message: options 14 | }; 15 | } 16 | let userOnClose = options.onClose; 17 | let id = 'message_' + seed++; 18 | 19 | options.onClose = function() { 20 | Message.close(id, userOnClose); 21 | }; 22 | 23 | instance = new MessageConstructor({ 24 | data: options 25 | }); 26 | instance.id = id; 27 | instance.vm = instance.$mount(); 28 | document.body.appendChild(instance.vm.$el); 29 | instance.vm.visible = true; 30 | instance.dom = instance.vm.$el; 31 | instance.dom.style.zIndex = PopupManager.nextZIndex(); 32 | instances.push(instance); 33 | return instance.vm; 34 | }; 35 | 36 | ['success', 'warning', 'info', 'error'].forEach(type => { 37 | Message[type] = options => { 38 | if (typeof options === 'string') { 39 | options = { 40 | message: options 41 | }; 42 | } 43 | options.type = type; 44 | return Message(options); 45 | }; 46 | }); 47 | 48 | Message.close = function(id, userOnClose) { 49 | for (let i = 0, len = instances.length; i < len; i++) { 50 | if (id === instances[i].id) { 51 | if (typeof userOnClose === 'function') { 52 | userOnClose(instances[i]); 53 | } 54 | instances.splice(i, 1); 55 | break; 56 | } 57 | } 58 | }; 59 | 60 | export default Message; 61 | -------------------------------------------------------------------------------- /packages/theme-default/src/select-dropdown.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | 4 | @component-namespace el { 5 | 6 | @b select-dropdown { 7 | position: absolute; 8 | z-index: 1001; 9 | border: var(--select-dropdown-border); 10 | border-radius: var(--border-radius-small); 11 | background-color: var(--select-dropdown-background); 12 | box-shadow: var(--select-dropdown-shadow); 13 | box-sizing: border-box; 14 | margin: 5px 0; 15 | 16 | @when multiple { 17 | & .el-select-dropdown__item.selected { 18 | color: var(--select-option-selected); 19 | background-color: var(--select-dropdown-background); 20 | 21 | &.hover { 22 | background-color: var(--select-option-hover-background); 23 | } 24 | 25 | &::after { 26 | position: absolute; 27 | right: 10px; 28 | font-family: 'element-icons'; 29 | content: "\E608"; 30 | font-size: 11px; 31 | -webkit-font-smoothing: antialiased; 32 | -moz-osx-font-smoothing: grayscale; 33 | } 34 | } 35 | } 36 | } 37 | 38 | @b select-dropdown__empty { 39 | padding: var(--select-dropdown-empty-padding); 40 | margin: 0; 41 | text-align: center; 42 | color: var(--select-dropdown-empty-color); 43 | font-size: var(--select-font-size); 44 | } 45 | 46 | @b select-dropdown__list { 47 | list-style: none; 48 | padding: var(--select-dropdown-padding); 49 | margin: 0; 50 | width: 100%; 51 | max-height: var(--select-dropdown-max-height); 52 | box-sizing: border-box; 53 | overflow-y: auto; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /examples/pages/template/component.tpl: -------------------------------------------------------------------------------- 1 | 41 | 54 | 65 | -------------------------------------------------------------------------------- /packages/theme-default/src/mixins/_button.css: -------------------------------------------------------------------------------- 1 | @define-mixin button-variant $color, $background-color, $border-color { 2 | color: $color; 3 | background-color: $background-color; 4 | border-color: $border-color; 5 | 6 | &:hover, 7 | &:focus { 8 | background: tint($background-color, var(--button-hover-tint-percent)); 9 | border-color: tint($border-color, var(--button-hover-tint-percent)); 10 | color: $color; 11 | } 12 | 13 | &:active { 14 | background: shade($background-color, var(--button-active-shade-percent)); 15 | border-color: shade($border-color, var(--button-active-shade-percent)); 16 | color: $color; 17 | outline: none; 18 | } 19 | 20 | &.is-active { 21 | background: shade($background-color, var(--button-active-shade-percent)); 22 | border-color: shade($border-color, var(--button-active-shade-percent)); 23 | color: $color; 24 | } 25 | 26 | &.is-plain { 27 | background: var(--button-default-fill); 28 | border: var(--border-base); 29 | color: var(--button-default-color); 30 | 31 | &:hover, 32 | &:focus { 33 | background: #fff; 34 | border-color: $border-color; 35 | color: $background-color; 36 | } 37 | 38 | &:active { 39 | background: #fff; 40 | border-color: shade($border-color, var(--button-active-shade-percent)); 41 | color: shade($background-color, var(--button-active-shade-percent)); 42 | outline: none; 43 | } 44 | } 45 | } 46 | 47 | @define-mixin button-size $padding-vertical, $padding-horizontal, $font-size, $border-radius { 48 | padding: $padding-vertical $padding-horizontal; 49 | font-size: $font-size; 50 | border-radius: $border-radius; 51 | } 52 | -------------------------------------------------------------------------------- /examples/docs/en-US/installation.md: -------------------------------------------------------------------------------- 1 | ## Installation 2 | 3 | ### npm 4 | Installing with npm is recommended, for it works seamlessly with [webpack](https://webpack.js.org/). 5 | 6 | ```shell 7 | npm i element-ui -D 8 | ``` 9 | 10 | ### CDN 11 | Get the latest version from [unpkg.com/element-ui](https://unpkg.com/element-ui/) , and import JavaScript and CSS file in your page. 12 | 13 | ```html 14 | 15 | 16 | 17 | 18 | ``` 19 | 20 | ### Hello world 21 | If you are using CDN, a hello-world page is easy with Element. [Online Demo](http://codepen.io/QingWei-Li/pen/vXwJrY) 22 | 23 | ```html 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 | Button 34 | 35 |

Try Element

36 |
37 |
38 | 39 | 40 | 41 | 42 | 43 | 51 | 52 | ``` 53 | If you are using npm and wish to apply webpack, please continue to the next page: Quick Start. -------------------------------------------------------------------------------- /packages/theme-default/src/dropdown.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | @import "./button.css"; 4 | 5 | @component-namespace el { 6 | @b dropdown { 7 | display: inline-block; 8 | position: relative; 9 | color: #475669; 10 | font-size: var(--font-size-base); 11 | 12 | .el-button-group { 13 | display: block; 14 | } 15 | 16 | & .el-dropdown__caret-button { 17 | padding: * 5px; 18 | 19 | & .el-dropdown__icon { 20 | padding-left: 0; 21 | } 22 | } 23 | @e icon { 24 | font-size: 12px; 25 | margin: 0 3px; 26 | } 27 | } 28 | @b dropdown-menu { 29 | margin: 5px 0; 30 | background-color: #fff; 31 | border: 1px solid #D3DCE6; 32 | box-shadow: var(--dropdown-menu-box-shadow); 33 | padding: 6px 0; 34 | z-index: 10; 35 | position: absolute; 36 | top: 0; 37 | left: 0; 38 | min-width: 100px; 39 | 40 | @e item { 41 | list-style: none; 42 | line-height: 36px; 43 | padding: 0 10px; 44 | margin: 0; 45 | cursor: pointer; 46 | 47 | &:not(.is-disabled):hover { 48 | background-color: var(--dropdown-menuItem-hover-fill); 49 | color: var(--dropdown-menuItem-hover-color); 50 | } 51 | @m divided { 52 | position: relative; 53 | margin-top: 6px; 54 | border-top: 1px solid #D3DCE6; 55 | 56 | &:before { 57 | content: ''; 58 | height: 6px; 59 | display: block; 60 | margin: 0 -10px; 61 | background-color: #fff; 62 | } 63 | } 64 | @when disabled { 65 | cursor: default; 66 | color: #c0ccda; 67 | pointer-events: none; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /packages/col/src/col.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'ElCol', 3 | 4 | props: { 5 | span: { 6 | type: Number, 7 | default: 24 8 | }, 9 | offset: Number, 10 | pull: Number, 11 | push: Number, 12 | xs: [Number, Object], 13 | sm: [Number, Object], 14 | md: [Number, Object], 15 | lg: [Number, Object] 16 | }, 17 | 18 | computed: { 19 | gutter() { 20 | return this.$parent.gutter; 21 | }, 22 | 23 | style() { 24 | var ret = {}; 25 | 26 | if (this.gutter) { 27 | ret.paddingLeft = this.gutter / 2 + 'px'; 28 | ret.paddingRight = ret.paddingLeft; 29 | } 30 | 31 | return ret; 32 | } 33 | }, 34 | render(h) { 35 | let { style } = this; 36 | let classList = []; 37 | 38 | ['span', 'offset', 'pull', 'push'].forEach(prop => { 39 | if (this[prop]) { 40 | classList.push( 41 | prop !== 'span' 42 | ? `el-col-${prop}-${this[prop]}` 43 | : `el-col-${this[prop]}` 44 | ); 45 | } 46 | }); 47 | 48 | ['xs', 'sm', 'md', 'lg'].forEach(size => { 49 | if (typeof this[size] === 'number') { 50 | classList.push(`el-col-${size}-${this[size]}`); 51 | } else if (typeof this[size] === 'object') { 52 | let props = this[size]; 53 | Object.keys(props).forEach(prop => { 54 | classList.push( 55 | prop !== 'span' 56 | ? `el-col-${size}-${prop}-${props[prop]}` 57 | : `el-col-${size}-${props[prop]}` 58 | ); 59 | }); 60 | } 61 | }); 62 | 63 | return ( 64 |
67 | {this.$slots.default} 68 |
69 | ); 70 | } 71 | }; 72 | -------------------------------------------------------------------------------- /packages/theme-default/src/loading.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | 4 | @component-namespace el { 5 | @b loading-mask { 6 | position: absolute; 7 | z-index: 10000; 8 | background-color: rgba(255, 255, 255, .9); 9 | margin: 0; 10 | top: 0; 11 | right: 0; 12 | bottom: 0; 13 | left: 0; 14 | 15 | @when fullscreen { 16 | position: fixed; 17 | 18 | .el-loading-spinner { 19 | margin-top: calc(- var(--loading-fullscreen-spinner-size) / 2); 20 | 21 | .circular { 22 | width: var(--loading-fullscreen-spinner-size); 23 | } 24 | } 25 | } 26 | } 27 | 28 | @b loading-spinner { 29 | top: 50%; 30 | margin-top: calc(- var(--loading-spinner-size) / 2); 31 | width: 100%; 32 | text-align: center; 33 | position: absolute; 34 | 35 | .el-loading-text { 36 | color: var(--color-primary); 37 | margin: 3px 0; 38 | font-size: 14px; 39 | } 40 | 41 | .circular { 42 | width: var(--loading-spinner-size); 43 | animation: rotate 2s linear infinite; 44 | } 45 | 46 | .path { 47 | animation: dash 1.5s ease-in-out infinite; 48 | stroke-dasharray: 1, 100; 49 | stroke-dashoffset: 0; 50 | stroke-width: 2; 51 | stroke: var(--color-primary); 52 | stroke-linecap: round; 53 | } 54 | } 55 | } 56 | 57 | @keyframes rotate { 58 | 100% { 59 | transform: rotate(360deg); 60 | } 61 | } 62 | 63 | @keyframes dash { 64 | 0% { 65 | stroke-dasharray: 1, 100; 66 | stroke-dashoffset: 0; 67 | } 68 | 50% { 69 | stroke-dasharray: 45, 100; 70 | stroke-dashoffset: -35px; 71 | } 72 | 100% { 73 | stroke-dasharray: 45, 100; 74 | stroke-dashoffset: -124px; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /packages/tooltip/src/main.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 75 | -------------------------------------------------------------------------------- /packages/message/assets/success.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | icon_success 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /packages/theme-default/src/date-picker/date-table.css: -------------------------------------------------------------------------------- 1 | @import "../common/var.css"; 2 | 3 | @component-namespace el { 4 | @b date-table { 5 | font-size: 12px; 6 | min-width: 224px; 7 | user-select: none; 8 | 9 | @when week-mode { 10 | .el-date-table__row { 11 | &:hover { 12 | background-color: var(--datepicker-cell-hover-color); 13 | } 14 | 15 | &.current { 16 | background-color: var(--datepicker-inrange-color); 17 | } 18 | } 19 | } 20 | 21 | td { 22 | width: 32px; 23 | height: 32px; 24 | box-sizing: border-box; 25 | text-align: center; 26 | cursor: pointer; 27 | 28 | &.next-month, 29 | &.prev-month { 30 | color: var(--datepicker-off-color); 31 | } 32 | 33 | &.today { 34 | color: var(--datepicker-text-hover-color); 35 | } 36 | 37 | &.available:hover { 38 | background-color: var(--datepicker-cell-hover-color); 39 | } 40 | 41 | &.in-range { 42 | background-color: var(--datepicker-inrange-color); 43 | &:hover { 44 | background-color: var(--datepicker-inrange-hover-color); 45 | } 46 | } 47 | 48 | &.current, 49 | &.start-date, 50 | &.end-date { 51 | background-color: var(--datepicker-active-color) !important; 52 | color: #fff; 53 | } 54 | 55 | &.disabled { 56 | background-color: #f4f4f4; 57 | opacity: 1; 58 | cursor: not-allowed; 59 | color: #ccc; 60 | } 61 | 62 | &.week { 63 | font-size: 80%; 64 | color: var(--datepicker-header-color); 65 | } 66 | } 67 | 68 | th { 69 | padding: 5px; 70 | color: var(--datepicker-header-color); 71 | font-weight: 400; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /packages/theme-default/src/core/option.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "../common/var.css"; 3 | 4 | @component-namespace element { 5 | 6 | @b option { 7 | box-sizing: border-box; 8 | color: var(--dropdown-color); 9 | cursor: pointer; 10 | display: block; 11 | font-size: var(--dropdown-font-size); 12 | padding: 9px; 13 | 14 | @e remark { 15 | color: var(--dropdown-option-pinyin-color); 16 | float: right; 17 | } 18 | 19 | @m arrow { 20 | 21 | &:not(.is-last)::after { 22 | border-left: 1px solid var(--dropdown-border-color); 23 | border-top: 1px solid var(--dropdown-border-color); 24 | content: " "; 25 | height: 4px; 26 | margin-top: 6px; 27 | position: absolute; 28 | right: 12px; 29 | transform: rotate(135deg); 30 | width: 4px; 31 | } 32 | } 33 | 34 | @when disabled { 35 | background-color: transparent; 36 | color: var(--dropdown-option-color-disabled); 37 | cursor: not-allowed; 38 | } 39 | 40 | &:hover, 41 | &.is-hover { 42 | background-color: var(--dropdown-option-fill-hover); 43 | color: var(--dropdown-option-color-hover); 44 | } 45 | 46 | @when selected { 47 | background-color: var(--dropdown-option-fill-active); 48 | color: var(--dropdown-option-color-active); 49 | } 50 | } 51 | 52 | @b optiongroup { 53 | list-style: none; 54 | padding-left: 0; 55 | 56 | & .element-option { 57 | padding-left: 21px; 58 | } 59 | 60 | @e title { 61 | box-sizing: border-box; 62 | color: var(--dropdown-group-color); 63 | display: inline-block; 64 | font-size: var(--dropdown-font-size); 65 | padding: 8px; 66 | 67 | &:hover { 68 | background-color: inherit; 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Element UI Contributing Guide 2 | 3 | Hi! 首先感谢你使用 Element UI。 4 | 5 | Element UI 是一套为开发者、设计师和产品经理准备的开源组件库,旨在快速搭建页面。它基于 Vue 2.0 开发,并提供了配套的设计资源,充分满足可定制化的需求。 6 | 7 | Element UI 的成长离不开大家的支持,如果你愿意为 Element UI 贡献代码或提供建议,请阅读以下内容。 8 | 9 | ## Issue 规范 10 | - issue 仅用于提交 Bug 或 Feature 以及设计相关的内容,其它内容可能会被直接关闭。如果你在使用时产生了疑问,请到 Slack 或 [Gitter](https://gitter.im/ElemeFE/element) 里咨询。 11 | 12 | - 在提交 issue 之前,请搜索相关内容是否已被提出。 13 | 14 | - 请说明 Element UI 和 Vue 的版本号,并提供操作系统和浏览器信息。推荐使用 [JSFiddle](https://jsfiddle.net/) 生成在线 demo,这能够更直观地重现问题。 15 | 16 | ## Pull Request 规范 17 | - 请先 fork 一份到自己的项目下,不要直接在仓库下建分支。 18 | 19 | - commit 信息要以`[组件名]: 描述信息` 的形式填写,例如 `Button: fix xxx bug`。 20 | 21 | - **不要提交** `lib` 里面打包的文件。 22 | 23 | - 执行 `npm run dist` 后可以正确打包文件。 24 | 25 | - 为了兼容性以及最终打包的文件体积考虑,我们的 babel 只引入了 `preset-2015`,所以不建议使用 ES2015 的 API,例如 `Array.prototype.find`、`Object.assign`等。如果有需要,请引入第三方的 polyfill。 26 | 27 | - 提交 PR 前请 rebase,确保 commit 记录的整洁。 28 | 29 | - 确保 PR 是提交到 `dev` 分支,而不是 `master` 分支。 30 | 31 | - 如果是修复 bug,请在 PR 中给出描述信息。 32 | 33 | - 合并代码需要两名维护人员参与:一人进行 review 后 approve,另一人再次 review,通过后即可合并。 34 | 35 | ## 开发环境搭建 36 | 首先你需要 Node.js 4+ 和 NPM 3+ 37 | ```shell 38 | git clone git@github.com:ElemeFE/element.git 39 | npm run dev 40 | 41 | # open http://localhost:8085 42 | ``` 43 | 44 | 如果国内用户觉得安装慢可以使用 [yarn](https://github.com/yarnpkg/yarn) 搭配 taobao registry 45 | ```shell 46 | npm i yarn -g 47 | yarn config set registry https://registry.npm.taobao.org 48 | yarn 49 | npm run dev 50 | 51 | # open http://localhost:8085 52 | ``` 53 | 54 | To build: 55 | 56 | ```shell 57 | npm run dist 58 | ``` 59 | 60 | ## 组件开发规范 61 | - 通过 `npm run new` 创建组件目录结构,包含测试代码、入口文件、cooking 配置、package.json、文档 62 | - 如果包含父子组件,需要更改目录结构,参考 `Button` 63 | - 组件内如果依赖了其他组件,需要在当前组件内引入,参考 `Select` 64 | 65 | ## 代码规范 66 | 遵循饿了么前端的 [ESLint](https://github.com/ElemeFE/eslint-config-elemefe) 即可 67 | -------------------------------------------------------------------------------- /packages/theme-default/src/message.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | 4 | @component-namespace el { 5 | 6 | @b message { 7 | box-shadow: var(--message-shadow); 8 | min-width: var(--message-min-width); 9 | padding: var(--message-padding); 10 | box-sizing: border-box; 11 | border-radius: var(--border-radius-small); 12 | position: fixed; 13 | left: 50%; 14 | top: 20px; 15 | transform: translateX(-50%); 16 | background-color: #fff; 17 | transition: opacity 0.3s, transform .4s; 18 | overflow: hidden; 19 | 20 | @e group { 21 | margin-left: 38px; 22 | position: relative; 23 | 24 | & p { 25 | font-size: var(--font-size-base); 26 | line-height: 20px; 27 | margin: 0 34px 0 0; 28 | white-space: nowrap; 29 | color: var(--message-content-color); 30 | text-align: justify; 31 | } 32 | } 33 | 34 | @e icon { 35 | size: 40px; 36 | position: absolute; 37 | left: 0; 38 | top: 0; 39 | } 40 | 41 | @e closeBtn { 42 | position: absolute 3px 0 * *; 43 | cursor: pointer; 44 | color: var(--message-close-color); 45 | font-size: var(--font-size-base); 46 | 47 | &:hover { 48 | color: var(--message-close-hover-color); 49 | } 50 | } 51 | 52 | & .el-icon-circle-check { 53 | color: var(--message-success-color); 54 | } 55 | 56 | & .el-icon-circle-cross { 57 | color: var(--message-danger-color); 58 | } 59 | 60 | & .el-icon-information { 61 | color: var(--message-info-color); 62 | } 63 | 64 | & .el-icon-warning { 65 | color: var(--message-warning-color); 66 | } 67 | } 68 | 69 | .el-message-fade-enter, 70 | .el-message-fade-leave-active { 71 | opacity: 0; 72 | transform: translate(-50%, -100%); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /examples/pages/template/guide.tpl: -------------------------------------------------------------------------------- 1 | 52 | 64 | 83 | -------------------------------------------------------------------------------- /packages/theme-default/src/date-picker/time-picker.css: -------------------------------------------------------------------------------- 1 | @import "../common/var.css"; 2 | 3 | @component-namespace el { 4 | @b time-panel { 5 | margin: 5px 0; 6 | border: solid 1px #d3dce6; 7 | background-color: #fff; 8 | box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px 0 rgba(0, 0, 0, .04); 9 | border-radius: 2px; 10 | position: absolute; 11 | width: 180px; 12 | left: 0; 13 | z-index: 1000; 14 | user-select: none; 15 | 16 | @e content { 17 | font-size: 0; 18 | display: flex; 19 | position: relative; 20 | overflow: hidden; 21 | 22 | &::after, &::before { 23 | content: ":"; 24 | top: 50%; 25 | color: #fff; 26 | position: absolute; 27 | font-size: 14px; 28 | margin-top: -15px; 29 | line-height: 16px; 30 | background-color: #20a0ff; 31 | height: 32px; 32 | z-index: -1; 33 | left: 0; 34 | right: 0; 35 | box-sizing: border-box; 36 | padding-top: 6px; 37 | text-align: left; 38 | } 39 | 40 | &::after { 41 | left: calc(100%/3*2); 42 | margin-left: -2px; 43 | } 44 | 45 | &::before { 46 | padding-left: calc(100%/3); 47 | margin-right: -2px; 48 | } 49 | } 50 | 51 | @e footer { 52 | border-top: 1px solid var(--datepicker-inner-border-color); 53 | padding: 4px; 54 | height: 36px; 55 | line-height: 25px; 56 | text-align: right; 57 | box-sizing: border-box; 58 | } 59 | 60 | @e btn { 61 | border: none; 62 | line-height: 28px; 63 | padding: 0 5px; 64 | margin: 0 5px; 65 | cursor: pointer; 66 | background-color: transparent; 67 | outline: none; 68 | font-size: 12px; 69 | color: #8492a6; 70 | 71 | &.confirm { 72 | font-weight: 800; 73 | color: #20a0ff; 74 | } 75 | } 76 | 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /test/unit/specs/message.spec.js: -------------------------------------------------------------------------------- 1 | import { triggerEvent } from '../util'; 2 | import Message from 'packages/message'; 3 | 4 | describe('Message', () => { 5 | afterEach(() => { 6 | const el = document.querySelector('.el-message'); 7 | if (!el) return; 8 | if (el.parentNode) { 9 | el.parentNode.removeChild(el); 10 | } 11 | if (el.__vue__) { 12 | el.__vue__.$destroy(); 13 | } 14 | }); 15 | 16 | it('automatically close', done => { 17 | Message({ 18 | message: '灰风', 19 | duration: 500 20 | }); 21 | const message = document.querySelector('.el-message__group').childNodes[0]; 22 | expect(document.querySelector('.el-message')).to.exist; 23 | expect(message.textContent).to.equal('灰风'); 24 | setTimeout(() => { 25 | expect(document.querySelector('.el-message')).to.not.exist; 26 | done(); 27 | }, 1000); 28 | }); 29 | 30 | it('manually close', done => { 31 | Message({ 32 | message: '夏天', 33 | showClose: true 34 | }); 35 | setTimeout(() => { 36 | document.querySelector('.el-message__closeBtn').click(); 37 | setTimeout(() => { 38 | expect(document.querySelector('.el-message')).to.not.exist; 39 | done(); 40 | }, 500); 41 | }, 500); 42 | }); 43 | 44 | it('create', () => { 45 | Message('娜梅莉亚'); 46 | expect(document.querySelector('.el-message')).to.exist; 47 | }); 48 | 49 | it('invoke with type', () => { 50 | Message.success('毛毛狗'); 51 | expect(document.querySelector('.el-message').__vue__.type).to.equal('success'); 52 | }); 53 | 54 | it('reset timer', done => { 55 | Message({ 56 | message: '白灵', 57 | duration: 1000 58 | }); 59 | setTimeout(() => { 60 | triggerEvent(document.querySelector('.el-message'), 'mouseenter'); 61 | setTimeout(() => { 62 | expect(document.querySelector('.el-message')).to.exist; 63 | done(); 64 | }, 700); 65 | }, 500); 66 | }); 67 | }); 68 | -------------------------------------------------------------------------------- /packages/theme-default/src/table-column.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./checkbox.css"; 3 | @import "./tag.css"; 4 | @import "./common/var.css"; 5 | 6 | @component-namespace el { 7 | @b table-filter { 8 | border: solid 1px #d3dce6; 9 | border-radius: 2px; 10 | background-color: #fff; 11 | box-shadow: var(--dropdown-menu-box-shadow); 12 | box-sizing: border-box; 13 | margin: 2px 0; 14 | 15 | /** used for dropdown mode */ 16 | @e list { 17 | padding: 5px 0; 18 | margin: 0; 19 | list-style: none; 20 | min-width: 100px; 21 | } 22 | 23 | @e list-item { 24 | line-height: 36px; 25 | padding: 0 10px; 26 | cursor: pointer; 27 | font-size: var(--font-size-base); 28 | 29 | &:hover { 30 | background-color: var(--dropdown-menuItem-hover-fill); 31 | color: var(--dropdown-menuItem-hover-color); 32 | } 33 | 34 | @when active { 35 | background-color: #20a0ff; 36 | color: #fff; 37 | } 38 | } 39 | 40 | @e content { 41 | min-width: 100px; 42 | } 43 | 44 | @e bottom { 45 | border-top: 1px solid #d3dce6; 46 | padding: 8px; 47 | 48 | button { 49 | background: transparent; 50 | border: none; 51 | color: #8492a6; 52 | cursor: pointer; 53 | font-size: var(--font-size-base); 54 | padding: 0 3px; 55 | 56 | &:hover { 57 | color: #20a0ff; 58 | } 59 | 60 | &:focus { 61 | outline: none; 62 | } 63 | 64 | &.is-disabled { 65 | color: #c0ccda; 66 | cursor: not-allowed; 67 | } 68 | } 69 | } 70 | 71 | @e checkbox-group { 72 | padding: 10px; 73 | 74 | .el-checkbox { 75 | display: block; 76 | margin-bottom: 8px; 77 | margin-left: 5px; 78 | } 79 | 80 | .el-checkbox:last-child { 81 | margin-bottom: 0; 82 | } 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /src/locale/lang/zh-CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | el: { 3 | datepicker: { 4 | now: '此刻', 5 | today: '今天', 6 | cancel: '取消', 7 | clear: '清空', 8 | confirm: '确定', 9 | selectDate: '选择日期', 10 | selectTime: '选择时间', 11 | startDate: '开始日期', 12 | startTime: '开始时间', 13 | endDate: '结束日期', 14 | endTime: '结束时间', 15 | year: '年', 16 | month1: '1 月', 17 | month2: '2 月', 18 | month3: '3 月', 19 | month4: '4 月', 20 | month5: '5 月', 21 | month6: '6 月', 22 | month7: '7 月', 23 | month8: '8 月', 24 | month9: '9 月', 25 | month10: '10 月', 26 | month11: '11 月', 27 | month12: '12 月', 28 | // week: '周次', 29 | weeks: { 30 | sun: '日', 31 | mon: '一', 32 | tue: '二', 33 | wed: '三', 34 | thu: '四', 35 | fri: '五', 36 | sat: '六' 37 | }, 38 | months: { 39 | jan: '一月', 40 | feb: '二月', 41 | mar: '三月', 42 | apr: '四月', 43 | may: '五月', 44 | jun: '六月', 45 | jul: '七月', 46 | aug: '八月', 47 | sep: '九月', 48 | oct: '十月', 49 | nov: '十一月', 50 | dec: '十二月' 51 | } 52 | }, 53 | select: { 54 | loading: '加载中', 55 | noMatch: '无匹配数据', 56 | noData: '无数据', 57 | placeholder: '请选择' 58 | }, 59 | pagination: { 60 | goto: '前往', 61 | pagesize: '条/页', 62 | total: '共 {total} 条', 63 | pageClassifier: '页' 64 | }, 65 | messagebox: { 66 | title: '提示', 67 | confirm: '确定', 68 | cancel: '取消', 69 | error: '输入的数据不合法!' 70 | }, 71 | upload: { 72 | delete: '删除', 73 | preview: '查看图片', 74 | continue: '继续上传' 75 | }, 76 | table: { 77 | emptyText: '暂无数据', 78 | confirmFilter: '筛选', 79 | resetFilter: '重置', 80 | clearFilter: '全部' 81 | }, 82 | tree: { 83 | emptyText: '暂无数据' 84 | } 85 | } 86 | }; 87 | -------------------------------------------------------------------------------- /src/locale/lang/zh-TW.js: -------------------------------------------------------------------------------- 1 | export default { 2 | el: { 3 | datepicker: { 4 | now: '現在', 5 | today: '今天', 6 | cancel: '取消', 7 | clear: '清空', 8 | confirm: '確認', 9 | selectDate: '選擇日期', 10 | selectTime: '選擇時間', 11 | startDate: '開始日期', 12 | startTime: '開始時間', 13 | endDate: '結束日期', 14 | endTime: '結束時間', 15 | year: '年', 16 | month1: '1 月', 17 | month2: '2 月', 18 | month3: '3 月', 19 | month4: '4 月', 20 | month5: '5 月', 21 | month6: '6 月', 22 | month7: '7 月', 23 | month8: '8 月', 24 | month9: '9 月', 25 | month10: '10 月', 26 | month11: '11 月', 27 | month12: '12 月', 28 | // week: '周次', 29 | weeks: { 30 | sun: '日', 31 | mon: '一', 32 | tue: '二', 33 | wed: '三', 34 | thu: '四', 35 | fri: '五', 36 | sat: '六' 37 | }, 38 | months: { 39 | jan: '一月', 40 | feb: '二月', 41 | mar: '三月', 42 | apr: '四月', 43 | may: '五月', 44 | jun: '六月', 45 | jul: '七月', 46 | aug: '八月', 47 | sep: '九月', 48 | oct: '十月', 49 | nov: '十一月', 50 | dec: '十二月' 51 | } 52 | }, 53 | select: { 54 | loading: '加載中', 55 | noMatch: '無匹配資料', 56 | noData: '無資料', 57 | placeholder: '請選擇' 58 | }, 59 | pagination: { 60 | goto: '前往', 61 | pagesize: '項/頁', 62 | total: '共 {total} 項', 63 | pageClassifier: '頁' 64 | }, 65 | messagebox: { 66 | title: '提示', 67 | confirm: '確定', 68 | cancel: '取消', 69 | error: '輸入的資料不符規定!' 70 | }, 71 | upload: { 72 | delete: '刪除', 73 | preview: '查看圖片', 74 | continue: '繼續上傳' 75 | }, 76 | table: { 77 | emptyText: '暫無資料', 78 | confirmFilter: '篩選', 79 | resetFilter: '重置', 80 | clearFilter: '全部' 81 | }, 82 | tree: { 83 | emptyText: '暫無資料' 84 | } 85 | } 86 | }; 87 | -------------------------------------------------------------------------------- /packages/theme-default/src/form.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "./common/var.css"; 3 | 4 | @component-namespace el { 5 | @b form { 6 | @m label-left { 7 | & .el-form-item__label { 8 | text-align: left; 9 | } 10 | } 11 | @m label-top { 12 | & .el-form-item__label { 13 | float: none; 14 | display: inline-block; 15 | padding: 0 0 10px 0; 16 | } 17 | } 18 | @m inline { 19 | & .el-form-item { 20 | display: inline-block; 21 | margin-right: 10px; 22 | vertical-align: top; 23 | } 24 | } 25 | } 26 | @b form-item { 27 | margin-bottom: 22px; 28 | @utils-clearfix; 29 | 30 | & .el-form-item { 31 | margin-bottom: 0; 32 | 33 | & .el-form-item__content { 34 | margin-left: 0 !important; 35 | } 36 | } 37 | 38 | @e label { 39 | text-align: right; 40 | vertical-align: middle; 41 | float: left; 42 | font-size: 14px; 43 | color: #5e6d82; 44 | line-height: 1; 45 | padding: 11px 12px 11px 0; 46 | box-sizing: border-box; 47 | } 48 | @e content { 49 | line-height: 36px; 50 | position: relative; 51 | font-size: 14px; 52 | @utils-clearfix; 53 | } 54 | @e error { 55 | color: #ff4949; 56 | font-size: 12px; 57 | line-height: 1; 58 | padding-top: 4px; 59 | position: absolute; 60 | top: 100%; 61 | left: 0; 62 | } 63 | & .el-button + .el-button, 64 | & .el-checkbox + .el-checkbox, 65 | & .el-radio + .el-radio { 66 | margin-left: 10px; 67 | } 68 | 69 | @when required { 70 | .el-form-item__label:before { 71 | content: '*'; 72 | color: var(--color-danger); 73 | margin-right: 4px; 74 | } 75 | } 76 | 77 | @when error { 78 | & .el-input__inner, 79 | & .el-textarea__inner { 80 | border-color: var(--color-danger); 81 | } 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /packages/form/src/form.vue: -------------------------------------------------------------------------------- 1 | 9 | 76 | -------------------------------------------------------------------------------- /src/locale/lang/ko.js: -------------------------------------------------------------------------------- 1 | export default { 2 | el: { 3 | datepicker: { 4 | now: '지금', 5 | today: '오늘', 6 | cancel: '취소', 7 | clear: '초기화', 8 | confirm: '확인', 9 | selectDate: '날짜 선택', 10 | selectTime: '시간 선택', 11 | startDate: '시작 날짜', 12 | startTime: '시작 시간', 13 | endDate: '종료 날짜', 14 | endTime: '종료 시간', 15 | year: '년', 16 | month1: '1월', 17 | month2: '2월', 18 | month3: '3월', 19 | month4: '4월', 20 | month5: '5월', 21 | month6: '6월', 22 | month7: '7월', 23 | month8: '8월', 24 | month9: '9월', 25 | month10: '10월', 26 | month11: '11월', 27 | month12: '12월', 28 | // week: 'week', 29 | weeks: { 30 | sun: '일', 31 | mon: '월', 32 | tue: '화', 33 | wed: '수', 34 | thu: '목', 35 | fri: '금', 36 | sat: '토' 37 | }, 38 | months: { 39 | jan: '1월', 40 | feb: '2월', 41 | mar: '3월', 42 | apr: '4월', 43 | may: '5월', 44 | jun: '6월', 45 | jul: '7월', 46 | aug: '8월', 47 | sep: '9월', 48 | oct: '10월', 49 | nov: '11월', 50 | dec: '12월' 51 | } 52 | }, 53 | select: { 54 | loading: '불러오는 중', 55 | noMatch: '맞는 데이터가 없습니다', 56 | noData: '데이터 없음', 57 | placeholder: '선택' 58 | }, 59 | pagination: { 60 | goto: '이동', 61 | pagesize: '/page', 62 | total: '총 {total}', 63 | pageClassifier: '' 64 | }, 65 | messagebox: { 66 | title: '메시지', 67 | confirm: '확인', 68 | cancel: '취소', 69 | error: '올바르지 않은 입력' 70 | }, 71 | upload: { 72 | delete: '삭제', 73 | preview: '미리보기', 74 | continue: '계속하기' 75 | }, 76 | table: { 77 | emptyText: '데이터 없음', 78 | confirmFilter: '확인', 79 | resetFilter: '초기화', 80 | clearFilter: '전체' 81 | }, 82 | tree: { 83 | emptyText: '데이터 없음' 84 | } 85 | } 86 | }; 87 | --------------------------------------------------------------------------------