From 465dcf2a1983641875be3a998457d4501920dfe5 Mon Sep 17 00:00:00 2001 From: hetech Date: Tue, 5 Jun 2018 19:27:13 +0800 Subject: [PATCH] Chore: retire lerna and remove redundant files (#11493) * Chore: retire lerna and delete redundant files * Chore: update Makefile --- .github/CONTRIBUTING.en-US.md | 2 +- .github/CONTRIBUTING.es.md | 2 +- .github/CONTRIBUTING.zh-CN.md | 2 +- Makefile | 8 -- build/bin/build-all.js | 26 ------- build/bin/new.js | 28 ------- lerna.json | 11 --- package.json | 5 +- packages/carousel/_index.js | 10 --- packages/carousel/cooking.conf.js | 6 -- packages/carousel/package.json | 17 ----- packages/cascader/cooking.conf.js | 18 ----- packages/cascader/package.json | 15 ---- packages/color-picker/cooking.conf.js | 6 -- packages/color-picker/package.json | 15 ---- packages/date-picker/README.md | 64 ---------------- packages/date-picker/_index.js | 12 --- packages/date-picker/cooking.conf.js | 6 -- packages/date-picker/package.json | 15 ---- packages/loading/README.md | 66 ---------------- packages/loading/cooking.conf.js | 6 -- packages/loading/package.json | 15 ---- packages/pagination/README.md | 59 -------------- packages/pagination/cooking.conf.js | 6 -- packages/pagination/package.json | 15 ---- packages/table/README.md | 106 -------------------------- packages/table/_index.js | 10 --- packages/table/cooking.conf.js | 6 -- packages/table/package.json | 17 ----- packages/upload/README.md | 67 ---------------- packages/upload/cooking.conf.js | 6 -- packages/upload/package.json | 16 ---- 32 files changed, 4 insertions(+), 659 deletions(-) delete mode 100644 build/bin/build-all.js delete mode 100644 lerna.json delete mode 100644 packages/carousel/_index.js delete mode 100644 packages/carousel/cooking.conf.js delete mode 100644 packages/carousel/package.json delete mode 100644 packages/cascader/cooking.conf.js delete mode 100644 packages/cascader/package.json delete mode 100644 packages/color-picker/cooking.conf.js delete mode 100644 packages/color-picker/package.json delete mode 100644 packages/date-picker/README.md delete mode 100644 packages/date-picker/_index.js delete mode 100644 packages/date-picker/cooking.conf.js delete mode 100644 packages/date-picker/package.json delete mode 100644 packages/loading/README.md delete mode 100644 packages/loading/cooking.conf.js delete mode 100644 packages/loading/package.json delete mode 100644 packages/pagination/README.md delete mode 100644 packages/pagination/cooking.conf.js delete mode 100644 packages/pagination/package.json delete mode 100644 packages/table/README.md delete mode 100644 packages/table/_index.js delete mode 100644 packages/table/cooking.conf.js delete mode 100644 packages/table/package.json delete mode 100644 packages/upload/README.md delete mode 100644 packages/upload/cooking.conf.js delete mode 100644 packages/upload/package.json diff --git a/.github/CONTRIBUTING.en-US.md b/.github/CONTRIBUTING.en-US.md index c0107b416..0a8c357e6 100644 --- a/.github/CONTRIBUTING.en-US.md +++ b/.github/CONTRIBUTING.en-US.md @@ -50,7 +50,7 @@ npm run dist ``` ## Component Developing Guidelines -- Run `make new ` to create project directory for a new component. Test codes, entry file, cooking config, documentation and `package.json` are included. +- Run `make new ` to create project directory for a new component. Test codes, entry file and documentation are included. - Refer to `Button` for nested components. - Refer to `Select` for components that depend on other components. diff --git a/.github/CONTRIBUTING.es.md b/.github/CONTRIBUTING.es.md index 9d415f48b..177e0ca09 100644 --- a/.github/CONTRIBUTING.es.md +++ b/.github/CONTRIBUTING.es.md @@ -55,7 +55,7 @@ npm run dist ``` ## Guía Para Desarrollo de Componentes -- Corra el comando `make new ` para crear el directorio de su proyecto para un componente nuevo. Verifique su código fuente test, configuración para armar, documentación y `package.json` están incluidos. +- Corra el comando `make new ` para crear el directorio de su proyecto para un componente nuevo. Verifique su código fuente test, archivo de entrada y documentación están incluidos. - Refiérase al `Button` para componentes anidados. - Refiérase al `Select` para componentes que dependen de otros componentes. diff --git a/.github/CONTRIBUTING.zh-CN.md b/.github/CONTRIBUTING.zh-CN.md index 8900cc37f..ce07fd8ea 100644 --- a/.github/CONTRIBUTING.zh-CN.md +++ b/.github/CONTRIBUTING.zh-CN.md @@ -48,7 +48,7 @@ npm run dist ``` ## 组件开发规范 -- 通过 `make new` 创建组件目录结构,包含测试代码、入口文件、cooking 配置、package.json、文档 +- 通过 `make new` 创建组件目录结构,包含测试代码、入口文件、文档 - 如果包含父子组件,需要更改目录结构,参考 `Button` - 组件内如果依赖了其他组件,需要在当前组件内引入,参考 `Select` diff --git a/Makefile b/Makefile index 96c7b3113..ccedd526a 100644 --- a/Makefile +++ b/Makefile @@ -26,18 +26,12 @@ new-lang: dist: install npm run dist -dist-all: - npm run dist:all - deploy: @npm run deploy pub: npm run pub -pub-all: - npm run pub:all - test: npm run test:watch @@ -47,8 +41,6 @@ help: @echo " \033[35mmake new [中文名]\033[0m\t--- 创建新组件 package. 例如 'make new button 按钮'" @echo " \033[35mmake dev\033[0m\t\033[0m\t\033[0m\t\033[0m\t--- 开发模式" @echo " \033[35mmake dist\033[0m\t\033[0m\t\033[0m\t\033[0m\t--- 编译项目,生成目标文件" - @echo " \033[35mmake dist-all\033[0m\t\033[0m\t\033[0m\t--- 分别编译每个组件项目" @echo " \033[35mmake deploy\033[0m\t\033[0m\t\033[0m\t\033[0m\t--- 部署 demo" @echo " \033[35mmake pub\033[0m\t\033[0m\t\033[0m\t\033[0m\t--- 发布到 npm 上" - @echo " \033[35mmake pub-all\033[0m\t\033[0m\t\033[0m\t\033[0m\t--- 发布各组件到 npm 上" @echo " \033[35mmake new-lang \033[0m\t\033[0m\t\033[0m\t--- 为网站添加新语言. 例如 'make new-lang fr'" diff --git a/build/bin/build-all.js b/build/bin/build-all.js deleted file mode 100644 index 65acafb9c..000000000 --- a/build/bin/build-all.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -const components = require('../../components.json'); -const execSync = require('child_process').execSync; -const existsSync = require('fs').existsSync; -const path = require('path'); - -let componentPaths = []; - -delete components.index; -delete components.font; - -Object.keys(components).forEach(key => { - const filePath = path.join(__dirname, `../../packages/${key}/cooking.conf.js`); - - if (existsSync(filePath)) { - componentPaths.push(`packages/${key}/cooking.conf.js`); - } -}); - -const paths = componentPaths.join(','); -const cli = path.join('node_modules', '.bin', 'cooking') + ` build -c ${paths} -p`; - -execSync(cli, { - stdio: 'inherit' -}); diff --git a/build/bin/new.js b/build/bin/new.js index 13584828a..7a5aefb44 100644 --- a/build/bin/new.js +++ b/build/bin/new.js @@ -28,34 +28,6 @@ ${ComponentName}.install = function(Vue) { }; export default ${ComponentName};` - }, - { - filename: 'cooking.conf.js', - content: `var cooking = require('cooking'); -var gen = require('../../build/gen-single-config'); - -cooking.set(gen(__dirname, 'El${ComponentName}')); - -module.exports = cooking.resolve(); -` - }, - { - filename: 'package.json', - content: `{ - "name": "element-${componentname}", - "version": "0.0.0", - "description": "A ${componentname} component for Vue.js.", - "keywords": [ - "element", - "vue", - "component" - ], - "main": "./lib/index.js", - "repository": "https://github.com/ElemeFE/element/tree/master/packages/${componentname}", - "author": "elemefe", - "license": "MIT", - "dependencies": {} -}` }, { filename: 'src/main.vue', diff --git a/lerna.json b/lerna.json deleted file mode 100644 index 6b3c592bb..000000000 --- a/lerna.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "lerna": "2.0.0-beta.32", - "version": "independent", - "publishConfig": { - "ignore": [ - "node_modules", - "log.*" - ] - }, - "packages": ["packages/carousel", "packages/table", "packages/upload", "packages/date-picker", "packages/loading", "packages/pagination"] -} diff --git a/package.json b/package.json index ff77c9f28..7dfe92616 100644 --- a/package.json +++ b/package.json @@ -16,17 +16,15 @@ "build:theme": "node build/bin/gen-cssfile && gulp build --gulpfile packages/theme-chalk/gulpfile.js && cp-cli packages/theme-chalk/lib lib/theme-chalk", "build:utils": "cross-env BABEL_ENV=utils babel src --out-dir lib --ignore src/index.js", "build:umd": "node build/bin/build-locale.js", - "clean": "rimraf lib && rimraf packages/*/lib && rimraf test/**/coverage && lerna clean --yes", + "clean": "rimraf lib && rimraf packages/*/lib && rimraf test/**/coverage", "deploy": "npm run deploy:build && gh-pages -d examples/element-ui --remote eleme && del examples/element-ui", "deploy:build": "npm run build:file && cross-env NODE_ENV=production webpack --config build/webpack.demo.js && echo element.eleme.io>>examples/element-ui/CNAME", "dev": "npm run bootstrap && npm run build:file && cross-env NODE_ENV=development webpack-dev-server --config build/webpack.demo.js & node build/bin/template.js", "dev:play": "npm run build:file && cross-env NODE_ENV=development PLAY_ENV=true webpack-dev-server --config build/webpack.demo.js", "dist": "npm run clean && npm run build:file && npm run lint && webpack --config build/webpack.conf.js && webpack --config build/webpack.common.js && webpack --config build/webpack.component.js && npm run build:utils && npm run build:umd && npm run build:theme", - "dist:all": "node build/bin/build-all.js && npm run build:theme", "i18n": "node build/bin/i18n.js", "lint": "eslint src/**/* test/**/* packages/**/* build/**/* --quiet", "pub": "npm run bootstrap && sh build/git-release.sh && sh build/release.sh && node build/bin/gen-indices.js && sh build/deploy-faas.sh", - "pub:all": "npm run dist:all && lerna publish --skip-git && git commit -am 'publish independent packages' && git push eleme dev", "test": "npm run lint && npm run build:theme && cross-env CI_ENV=/dev/ karma start test/unit/karma.conf.js --single-run", "test:watch": "npm run build:theme && karma start test/unit/karma.conf.js" }, @@ -109,7 +107,6 @@ "karma-sourcemap-loader": "^0.3.7", "karma-spec-reporter": "0.0.26", "karma-webpack": "^3.0.0", - "lerna": "^2.0.0-beta.32", "lolex": "^1.5.1", "markdown-it": "^6.1.1", "markdown-it-anchor": "^2.5.0", diff --git a/packages/carousel/_index.js b/packages/carousel/_index.js deleted file mode 100644 index b92c3ff68..000000000 --- a/packages/carousel/_index.js +++ /dev/null @@ -1,10 +0,0 @@ -import ElCarousel from './src/main'; -import ElCarouselItem from './src/item'; - -/* istanbul ignore next */ -export default function(Vue) { - Vue.component(ElCarousel.name, ElCarousel); - Vue.component(ElCarouselItem.name, ElCarouselItem); -}; - -export { ElCarousel, ElCarouselItem }; diff --git a/packages/carousel/cooking.conf.js b/packages/carousel/cooking.conf.js deleted file mode 100644 index e2201c661..000000000 --- a/packages/carousel/cooking.conf.js +++ /dev/null @@ -1,6 +0,0 @@ -var cooking = require('cooking'); -var gen = require('../../build/gen-single-config'); - -cooking.set(gen(__dirname, 'ElCarousel', '_index.js')); - -module.exports = cooking.resolve(); diff --git a/packages/carousel/package.json b/packages/carousel/package.json deleted file mode 100644 index fd9ccb5cb..000000000 --- a/packages/carousel/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "element-carousel", - "version": "2.0.0", - "description": "A carousel component for Vue.js.", - "main": "lib/index.js", - "keywords": [ - "element", - "vue", - "component" - ], - "repository": "https://github.com/ElemeFE/element/tree/master/packages/carousel", - "author": "elemefe", - "license": "MIT", - "dependencies": { - "throttle-debounce": "^1.0.1" - } -} diff --git a/packages/cascader/cooking.conf.js b/packages/cascader/cooking.conf.js deleted file mode 100644 index 3bbec53de..000000000 --- a/packages/cascader/cooking.conf.js +++ /dev/null @@ -1,18 +0,0 @@ -var cooking = require('cooking'); -var path = require('path'); -var config = require('../../build/config'); - -cooking.set({ - entry: { - index: path.join(__dirname, 'index.js') - }, - dist: path.join(__dirname, 'lib'), - template: false, - format: 'umd', - moduleName: 'ElCascader', - extends: ['vue2'], - alias: config.alias, - externals: { vue: config.vue } -}); - -module.exports = cooking.resolve(); diff --git a/packages/cascader/package.json b/packages/cascader/package.json deleted file mode 100644 index 65e1961f9..000000000 --- a/packages/cascader/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "element-cascader", - "version": "0.0.0", - "description": "A cascader component for Vue.js.", - "keywords": [ - "element", - "vue", - "component" - ], - "main": "./lib/index.js", - "repository": "https://github.com/ElemeFE/element/tree/master/packages/cascader", - "author": "elemefe", - "license": "MIT", - "dependencies": {} -} diff --git a/packages/color-picker/cooking.conf.js b/packages/color-picker/cooking.conf.js deleted file mode 100644 index e19746a23..000000000 --- a/packages/color-picker/cooking.conf.js +++ /dev/null @@ -1,6 +0,0 @@ -var cooking = require('cooking'); -var gen = require('../../build/gen-single-config'); - -cooking.set(gen(__dirname, 'ElColorPicker')); - -module.exports = cooking.resolve(); diff --git a/packages/color-picker/package.json b/packages/color-picker/package.json deleted file mode 100644 index 1da298ec2..000000000 --- a/packages/color-picker/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "element-color-picker", - "version": "0.0.0", - "description": "A color-picker component for Vue.js.", - "keywords": [ - "element", - "vue", - "component" - ], - "main": "./lib/index.js", - "repository": "https://github.com/ElemeFE/element/tree/master/packages/color-picker", - "author": "elemefe", - "license": "MIT", - "dependencies": {} -} diff --git a/packages/date-picker/README.md b/packages/date-picker/README.md deleted file mode 100644 index 2a4e9bd2a..000000000 --- a/packages/date-picker/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# element-datepicker - - -## Installation -```shell -npm i element-datepicker -S -``` - -## Usage - -A: -```javascript -import Vue from 'vue' -import ElDatePicker from 'element-datepicker' - -Vue.use(ElDatePicker) -``` - -B: -```javascript -import Vue from 'vue' -import { DatePicker, TimePicker, TimeSelect } from 'element-datepicker' - -Vue.component(DatePicker.name, DatePicker); -Vue.component(TimePicker.name, TimePicker); -Vue.component(TimeSelect.name, TimeSelect); -``` - -C: -```html - - - -``` - -### Attributes -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -|---------- |-------------- |---------- |-------------------------------- |-------- | -| readonly | 完全只读 | boolean | — | false | -| disabled | 禁用 | boolean | - | false | -| editable | 文本框可输入 | boolean | - | true | -| size | 输入框尺寸 | string | large, small, mini | — | -| placeholder | 占位内容 | string | — | — | -| type | 显示类型 | string | year/month/date/week/ datetime/datetimerange/daterange | date | -| format | 时间日期格式化 | string | 年 `yyyy`,月 `MM`,日 `dd`,小时 `HH`,分 `mm`,秒 `ss`,AM/PM `A` | yyyy-MM-dd | -| align | 对齐方式 | string | left, center, right | left | -|picker-options | 当前时间日期选择器特有的选项参考下表 | object | — | {} | - -### Picker Options -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -|---------- |-------------- |---------- |-------------------------------- |-------- | -| shortcuts | 设置快捷选项,需要传入 { text, onClick } 对象用法参考 demo 或下表 | Object[] | - | - | -| disabledDate | 设置禁用状态,参数为当前日期,要求返回 Boolean | Function | - | - | - -### Shortcuts -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -|---------- |-------------- |---------- |-------------------------------- |-------- | -| text | 标题文本 | string | — | — | -| onClick | 选中后的回调函数,参数是 vm,可通过触发 'pick' 事件设置选择器的值。例如 vm.$emit('pick', new Date()) | function | — | — | - -## License -MIT diff --git a/packages/date-picker/_index.js b/packages/date-picker/_index.js deleted file mode 100644 index 4443bd898..000000000 --- a/packages/date-picker/_index.js +++ /dev/null @@ -1,12 +0,0 @@ -import DatePicker from './src/picker/date-picker'; -import TimePicker from './src/picker/time-picker'; -import TimeSelect from './src/picker/time-select'; - -/* istanbul ignore next */ -export default function install(Vue) { - Vue.component(DatePicker.name, DatePicker); - Vue.component(TimePicker.name, TimePicker); - Vue.component(TimeSelect.name, TimeSelect); -}; - -export { DatePicker, TimePicker, TimeSelect }; diff --git a/packages/date-picker/cooking.conf.js b/packages/date-picker/cooking.conf.js deleted file mode 100644 index 8cda5464a..000000000 --- a/packages/date-picker/cooking.conf.js +++ /dev/null @@ -1,6 +0,0 @@ -var cooking = require('cooking'); -var gen = require('../../build/gen-single-config'); - -cooking.set(gen(__dirname, 'ElDatePicker', '_index.js')); - -module.exports = cooking.resolve(); diff --git a/packages/date-picker/package.json b/packages/date-picker/package.json deleted file mode 100644 index 79b9d6f0f..000000000 --- a/packages/date-picker/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "element-datepicker", - "version": "2.0.0", - "description": "A datepicker component for Vue.", - "keywords": [ - "element", - "vue", - "component" - ], - "main": "./lib/index.js", - "repository": "https://github.com/ElemeFE/element/tree/master/packages/date-picker", - "author": "long.zhang@ele.me", - "license": "MIT", - "dependencies": {} -} diff --git a/packages/loading/README.md b/packages/loading/README.md deleted file mode 100644 index 2c2d734c8..000000000 --- a/packages/loading/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# element-loading -> A element-loading component for Vue.js. - -## Demo -http://element-component.github.io/element-loading - -## Installation -```shell -npm i element-loading -D -``` - -## Usage -```javascript -import Vue from 'vue' -import ElLoading from 'element-loading' -import 'element-theme-chalk/dist/loading.css' - -Vue.use(ElLoading) -``` - -### 服务 -Loading 还可以以服务的方式调用。引入 Loading 服务: - -在需要调用时: -```javascript -Loading.service(options); -``` -其中 `options` 参数为 Loading 的配置项,具体见下表。`LoadingService` 会返回一个 Loading 实例,可通过调用该实例的 `close` 方法来关闭它: -```javascript -let loadingInstance = Loading.service(options); -loadingInstance.close(); -``` -需要注意的是,以服务的方式调用的全屏 Loading 是单例的:若在前一个全屏 Loading 关闭前再次调用全屏 Loading,并不会创建一个新的 Loading 实例,而是返回现有全屏 Loading 的实例: -```javascript -let loadingInstance1 = Loading.service({ fullscreen: true }); -let loadingInstance2 = Loading.service({ fullscreen: true }); -console.log(loadingInstance1 === loadingInstance2); // true -``` -此时调用它们中任意一个的 `close` 方法都能关闭这个全屏 Loading。 - -如果完整引入了 Element,那么 Vue.prototype 上会有一个全局方法 `$loading`,它的调用方式为:`this.$loading(options)`,同样会返回一个 Loading 实例。 - -### Options -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -|---------- |-------------- |---------- |-------------------------------- |-------- | -| target | Loading 需要覆盖的 DOM 节点。可传入一个 DOM 对象或字符串;若传入字符串,则会将其作为参数传入 `document.querySelector`以获取到对应 DOM 节点 | object/string | — | document.body | -| body | 同 `v-loading` 指令中的 `body` 修饰符 | boolean | — | false | -| fullscreen | 同 `v-loading` 指令中的 `fullscreen` 修饰符 | boolean | — | true | -| lock | 同 `v-loading` 指令中的 `lock` 修饰符 | boolean | — | false | -| text | 显示在加载图标下方的加载文案 | string | — | — | -| customClass | Loading 的自定义类名 | string | — | — | - - -## Development -```shell -make dev - -## test -make test - -## build -make build -``` - -# License -[MIT](https://opensource.org/licenses/MIT) diff --git a/packages/loading/cooking.conf.js b/packages/loading/cooking.conf.js deleted file mode 100644 index 34c82fcb9..000000000 --- a/packages/loading/cooking.conf.js +++ /dev/null @@ -1,6 +0,0 @@ -var cooking = require('cooking'); -var gen = require('../../build/gen-single-config'); - -cooking.set(gen(__dirname, 'ElLoading')); - -module.exports = cooking.resolve(); diff --git a/packages/loading/package.json b/packages/loading/package.json deleted file mode 100644 index 4f99c3a9a..000000000 --- a/packages/loading/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "element-loading", - "version": "2.0.0", - "description": "A loading component for Vue.js.", - "keywords": [ - "element", - "vue", - "component" - ], - "main": "./lib/index.js", - "repository": "https://github.com/ElemeFE/element/tree/master/packages/loading", - "author": "elemefe", - "license": "MIT", - "dependencies": {} -} diff --git a/packages/pagination/README.md b/packages/pagination/README.md deleted file mode 100644 index 8eb69f52f..000000000 --- a/packages/pagination/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# element-pagination -> A element-pagination component for Vue.js. - -## Demo -http://element-component.github.io/element-pagination - -## Installation -```shell -npm i element-pagination -D -``` - -## Usage -```javascript -import Vue from 'vue' -import ElPagination from 'element-pagination' -import 'element-theme-chalk/dist/pagination.css' - -Vue.use(ElPagination) -``` - -or - -```javascript -import Vue from 'vue' -import ElPagination from 'element-pagination' - -Vue.component('el-pagination', ElPagination) -``` - -### Attributes -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -|--------------------|----------------------------------------------------------|-------------------|-------------|--------| -| small | 是否使用小型分页样式 | Boolean | — | false | -| page-size | 每页显示条目个数 | Number | — | 10 | -| total | 总条目数 | Number | — | - | -| page-count | 总页数,total 和 page-count 设置任意一个就可以达到显示页码的功能;如果要支持 page-sizes 的更改,则需要使用 total 属性 | Number | — | - | -| current-page | 当前页数 | Number | — | 1 | -| layout | 组件布局,子组件名用逗号分隔| String | `sizes`, `prev`, `pager`, `next`, `jumper`, `->`, `total` | 'prev, pager, next, jumper, ->, total' | -| page-sizes | 每页显示个数选择器的选项设置 | Number[] | — | [10, 20, 30, 40, 50, 100] | - -### Events -| 事件名称 | 说明 | 回调参数 | -|---------|--------|---------| -| size-change | pageSize 改变时会触发 | 每页条数`size` | -| current-change | currentPage 改变时会触发 | 当前页`currentPage` | - -## Development -```shell -make dev - -## test -make test - -## build -make build -``` - -# License -[MIT](https://opensource.org/licenses/MIT) diff --git a/packages/pagination/cooking.conf.js b/packages/pagination/cooking.conf.js deleted file mode 100644 index a525ddc8c..000000000 --- a/packages/pagination/cooking.conf.js +++ /dev/null @@ -1,6 +0,0 @@ -var cooking = require('cooking'); -var gen = require('../../build/gen-single-config'); - -cooking.set(gen(__dirname, 'ElPagination')); - -module.exports = cooking.resolve(); diff --git a/packages/pagination/package.json b/packages/pagination/package.json deleted file mode 100644 index bdeaf5a68..000000000 --- a/packages/pagination/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "element-pagination", - "version": "2.0.0", - "description": "A pagination component for Vue.js.", - "keywords": [ - "element", - "vue", - "component" - ], - "main": "./lib/index.js", - "repository": "https://github.com/ElemeFE/element/tree/master/packages/pagination", - "author": "qingwei-li", - "license": "MIT", - "dependencies": {} -} diff --git a/packages/table/README.md b/packages/table/README.md deleted file mode 100644 index e253ef6b4..000000000 --- a/packages/table/README.md +++ /dev/null @@ -1,106 +0,0 @@ -# element-table -> A element-table component for Vue.js. - -## Demo -http://element-component.github.io/element-table - -## Installation -```shell -npm i element-table -D -``` - -## Usage -```javascript -import Vue from 'vue' -import ElTable from 'element-table' -import 'element-theme-chalk' - -Vue.use(ElTable) -``` - -or - -```javascript -import Vue from 'vue' -import { ElTable } from 'element-table' -import { ElTableColumn } from 'element-table' - -Vue.component('el-table', ElTable) -Vue.component('el-table-column', ElTableColumn) -``` - - -### Table Attributes -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -|---------- |-------------- |---------- |-------------------------------- |-------- | -| data | 显示的数据 | array | — | — | -| height | Table 的高度,默认为自动高度。如果 height 为 number 类型,单位 px;如果 height 为 string 类型,则 Table 的高度受控于外部样式。 | string/number | — | — | -| stripe | 是否为斑马纹 table | boolean | — | false | -| border | 是否带有纵向边框 | boolean | — | false | -| fit | 列的宽度是否自撑开 | boolean | — | true | -| show-header | 是否显示表头 | boolean | - | true | -| highlight-current-row | 是否要高亮当前行 | boolean | — | false | -| row-class-name | 行的 className 的回调方法,也可以使用字符串为所有行设置一个固定的 className。 | Function(row, index)/String | — | — | -| row-style | 行的 style 的回调方法,也可以使用一个固定的 Object 为所有行设置一样的 Style。 | Function(row, index)/Object | — | — | -| row-key | 行数据的 Key,用来优化 Table 的渲染;在使用 reserve-selection 功能的情况下,该属性是必填的 | Function(row)/String | — | — | - -### Table Events -| 事件名 | 说明 | 参数 | -| ---- | ---- | ---- | -| select | 当用户手动勾选数据行的 Checkbox 时触发的事件 | selection, row | -| select-all | 当用户手动勾选全选 Checkbox 时触发的事件 | selection | -| selection-change | 当选择项发生变化时会触发该事件 | selection | -| cell-mouse-enter | 当单元格 hover 进入时会触发该事件 | row, column, cell, event | -| cell-mouse-leave | 当单元格 hover 退出时会触发该事件 | row, column, cell, event | -| cell-click | 当某个单元格被点击时会触发该事件 | row, column, cell, event | -| row-click | 当某一行被点击时会触发该事件 | row, event | -| row-dblclick | 当某一行被双击时会触发该事件 | row, event | -| header-click | 当某一列的表头被点击时会触发该事件 | column, event | -| sort-change | 当表格的排序条件发生变化的时候会触发该事件 | { column, prop, order } | -| current-change | 当表格的当前行发生变化的时候会触发该事件,如果要高亮当前行,请打开表格的 highlight-current-row 属性 | currentRow, oldCurrentRow | - -### Table Methods -| 方法名 | 说明 | 参数 | -| ---- | ---- | ---- | -| clearSelection | 清空用户的选择,当使用 reserve-selection 功能的时候,可能会需要使用此方法 | selection | -| toggleRowSelection | 切换某一行的选中状态,如果使用了第二个参数,则是设置这一行选中与否(selected 为 true 则选中) | row, selected | - -### Table-column Attributes -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -|---------- |-------------- |---------- |-------------------------------- |-------- | -| type | 对应列的类型。如果设置了 `selection` 则显示多选框,如果设置了 `index` 则显示该行的索引(从 1 开始计算) | string | selection/index | — | -| label | 显示的标题 | string | — | — | -| prop | 对应列内容的字段名,也可以使用 property 属性 | string | — | — | -| width | 对应列的宽度 | string | — | — | -| min-width | 对应列的最小宽度,与 width 的区别是 width 是固定的,min-width 会把剩余宽度按比例分配给设置了 min-width 的列 | string | — | — | -| fixed | 列是否固定在左侧或者右侧,true 表示固定在左侧 | string, boolean | true, left, right | — | -| render-header | 列标题 Label 区域渲染使用的 Function | Function(h, { column, $index }) | — | — | -| sortable | 对应列是否可以排序,如果设置为 'custom',则代表用户希望远程排序,需要监听 Table 的 sort-change 事件 | boolean, string | true, false, 'custom' | false | -| sort-method | 对数据进行排序的时候使用的方法,仅当 sortable 设置为 true 的时候有效 | Function(a, b) | — | — | -| sort-by | 对数据进行排序的时候按照 sort-by 排序,仅当 sortable 设置为 true 且没有设置 sort-method 的时候有效。如果 sort-by 为数组,则先按照第 0 个排序,如果第 0 个相等,再按照第 1 个排序,以此类推。 | Function(row, index)/String/Array | — | — | -| resizable | 对应列是否可以通过拖动改变宽度(需要在 el-table 上设置 border 属性为真) | boolean | — | true | -| formatter | 用来格式化内容 | Function(row, column) | — | — | -| show-overflow-tooltip | 当内容过长被隐藏时显示 tooltip | Boolean | — | false | -| inline-template | 指定该属性后可以自定义 column 模板,参考多选的时间列,通过 row 获取行信息。总共可以获取到 `{ row(当前行), column(当前列), $index(行数), store(table store) }` 以及 Table 所处的上下文环境。 | — | — | -| align | 对齐方式 | String | left, center, right | left | -| class-name | 列的 className | string | — | — | -| selectable | 仅对 type=selection 的列有效,类型为 Function,Function 的返回值用来决定这一行的 CheckBox 是否可以勾选 | Function(row, index) | — | — | -| reserve-selection | 仅对 type=selection 的列有效,类型为 Boolean,为 true 则代表会保留之前数据的选项,需要配合 Table 的 clearSelection 方法使用。 | Boolean | — | false | -| filters | 数据过滤的选项,数组格式,数组中的元素需要有 text 和 value 属性。 | Array[{ text, value }] | — | — | -| filter-multiple | 数据过滤的选项是否多选 | Boolean | — | true | -| filter-method | 数据过滤使用的方法,如果是多选的筛选项,对每一条数据会执行多次,任意一次返回 true 就会显示。 | Function(value, row) | — | — | -| filtered-value | 选中的数据过滤项,如果需要自定义表头过滤的渲染方式,可能会需要此属性。 | Array | — | — | - -## Development -```shell -make dev - -## test -make test - -## build -make build -``` - -# License -[MIT](https://opensource.org/licenses/MIT) diff --git a/packages/table/_index.js b/packages/table/_index.js deleted file mode 100644 index 289659c6d..000000000 --- a/packages/table/_index.js +++ /dev/null @@ -1,10 +0,0 @@ -import ElTableColumn from './src/table-column'; -import ElTable from './src/table'; - -/* istanbul ignore next */ -export default function(Vue) { - Vue.component(ElTable.name, ElTable); - Vue.component(ElTableColumn.name, ElTableColumn); -}; - -export { ElTable, ElTableColumn }; diff --git a/packages/table/cooking.conf.js b/packages/table/cooking.conf.js deleted file mode 100644 index fed10f8a0..000000000 --- a/packages/table/cooking.conf.js +++ /dev/null @@ -1,6 +0,0 @@ -var cooking = require('cooking'); -var gen = require('../../build/gen-single-config'); - -cooking.set(gen(__dirname, 'ElTable', '_index.js')); - -module.exports = cooking.resolve(); diff --git a/packages/table/package.json b/packages/table/package.json deleted file mode 100644 index 3e52680e2..000000000 --- a/packages/table/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "element-table", - "version": "2.2.2", - "description": "A table component for Vue.", - "keywords": [ - "element", - "vue", - "component" - ], - "main": "./lib/index.js", - "repository": "https://github.com/ElemeFE/element/tree/master/packages/table", - "author": "elemefe", - "license": "MIT", - "dependencies": { - "throttle-debounce": "^1.0.1" - } -} diff --git a/packages/upload/README.md b/packages/upload/README.md deleted file mode 100644 index 9dbe1bc14..000000000 --- a/packages/upload/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# element-upload -> A element-upload component for Vue.js. - -## Demo -http://element-component.github.io/element-upload - -## Installation -```shell -npm i element-upload -D -``` - -## Usage -```javascript -import Vue from 'vue' -import ElUpload from 'element-upload' -import 'element-theme-chalk/dist/upload.css' - -Vue.use(ElUpload) -``` - -or - -```javascript -import Vue from 'vue' -import ElUpload from 'element-upload' - -Vue.component('el-upload', ElUpload) -``` - -### Attribute -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -|---------- |-------------- |---------- |-------------------------------- |-------- | -| action | 必选参数, 上传的地址 | string | — | — | -| headers | 可选参数, 设置上传的请求头部 | object | — | — | -| multiple | 可选参数, 是否支持多选文件 | boolean | — | — | -| data | 可选参数, 上传时附带的额外参数 | object | — | — | -| name | 可选参数, 上传的文件字段名 | string | — | file | -| with-credentials | 支持发送 cookie 凭证信息 | boolean | — | false | -| show-file-list | 是否显示已上传文件列表 | boolean | — | true | -| type | 上传控件类型 | string | select,drag | select | -| accept | 可选参数, 接受上传的[文件类型](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept)(thumbnail-mode 模式下此参数无效)| string | — | — | -| on-preview | 可选参数, 点击已上传的文件链接时的钩子, 可以通过 file.response 拿到服务端返回数据 | function(file) | — | — | -| on-remove | 可选参数, 文件列表移除文件时的钩子 | function(file, fileList) | — | — | -| on-success | 可选参数, 文件上传成功时的钩子 | function(response, file, fileList) | — | — | -| on-error | 可选参数, 文件上传失败时的钩子 | function(err, response, file) | — | — | -| before-upload | 可选参数, 上传文件之前的钩子,参数为上传的文件,若返回 false 或者 Promise 则停止上传。 | function(file) | — | — | -| thumbnail-mode | 是否设置为图片模式,该模式下会显示图片缩略图 | boolean | — | false | -| default-file-list | 默认已上传的文件列表, 例如: [{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}] | array | — | [] | - -### Methods -| 方法名 | 说明 | 参数 | -|---------- |-------------- | - | -| clearFiles | 清空已上传的文件列表 | — | - -## Development -```shell -make dev - -## test -make test - -## build -make build -``` - -# License -[MIT](https://opensource.org/licenses/MIT) diff --git a/packages/upload/cooking.conf.js b/packages/upload/cooking.conf.js deleted file mode 100644 index d20431e13..000000000 --- a/packages/upload/cooking.conf.js +++ /dev/null @@ -1,6 +0,0 @@ -var cooking = require('cooking'); -var gen = require('../../build/gen-single-config'); - -cooking.set(gen(__dirname, 'ElUpload')); - -module.exports = cooking.resolve(); diff --git a/packages/upload/package.json b/packages/upload/package.json deleted file mode 100644 index d2686a68b..000000000 --- a/packages/upload/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "element-upload", - "version": "2.0.0", - "description": "A upload component for Vue.js.", - "keywords": [ - "element", - "vue", - "component" - ], - "main": "./lib/index.js", - "repository": "https://github.com/ElemeFE/element/tree/master/packages/upload", - "author": "elemefe", - "license": "MIT", - "dependencies": {}, - "devDependencies": {} -}