diff --git a/.eslintrc b/.eslintrc
index ba8a1b188..efb7c4f79 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -6,7 +6,7 @@
"expect": true,
"sinon": true
},
- "plugins": ['vue'],
+ "plugins": ['vue','json'],
"extends": 'elemefe',
"parserOptions": {
"ecmaFeatures": {
diff --git a/.github/CONTRIBUTING.en-US.md b/.github/CONTRIBUTING.en-US.md
index e527744db..080f03954 100644
--- a/.github/CONTRIBUTING.en-US.md
+++ b/.github/CONTRIBUTING.en-US.md
@@ -8,7 +8,7 @@ We are excited that you are interested in contributing to Element. Before submit
## Issue Guidelines
-- Issues are exclusively for bug reports, feature requests and design-related topics. Other questions may be closed directly. If any questions come up when you are using Element, please hit [Gitter](https://gitter.im/ElemeFE/element) for help.
+- Issues are exclusively for bug reports, feature requests and design-related topics. Other questions may be closed directly. If any questions come up when you are using Element, please hit [Gitter](https://gitter.im/element-en/Lobby) for help.
- Before submitting an issue, please check if similar problems have already been issued.
diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md
index df777aff6..497b52d20 100644
--- a/CHANGELOG.en-US.md
+++ b/CHANGELOG.en-US.md
@@ -1,5 +1,15 @@
## Changelog
+### 2.0.4
+
+*2017-11-10*
+
+- Improved accessibility for Cascader, Dropdown, Message, Notification, Popover, Tooltip and Tree
+- Fixed Container resize when the width of viewport decreases, #8042
+- Fixed Tree's `updateKeyChildren` incorrectly deleting child nodes, #8100
+- Fixed bordered CheckboxButton's height when nested in a Form, #8100
+- Fixed Menu's parsing error for custom colors, #8153 (by @zhouyixiang)
+
### 2.0.3
*2017-11-03*
diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md
index d713059db..1e21c98a4 100644
--- a/CHANGELOG.zh-CN.md
+++ b/CHANGELOG.zh-CN.md
@@ -1,5 +1,15 @@
## 更新日志
+### 2.0.4
+
+*2017-11-10*
+
+- 提升 Cascader、Dropdown、Message、Notification、Popover、Tooltip、Tree 的可访问性
+- 修复当视口变窄时 Container 无法同步更新其宽度的问题,#8042
+- 修复 Tree 的 `updateKeyChildren` 在删除子节点时的行为错误,#8100
+- 修复带有边框的 CheckboxButton 在 Form 中高度错误的问题,#8100
+- 修复 Menu 在解析自定义颜色时的错误,#8153(by @zhouyixiang)
+
### 2.0.3
*2017-11-03*
diff --git a/FAQ.md b/FAQ.md
index 3f1bbfb8c..ab54450a8 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -36,27 +36,6 @@
请阅读 Vue 文档 [Render Function](http://vuejs.org/v2/guide/render-function.html) 的相关内容。注意,使用 JSX 来写 Render Function 的话,需要安装 `babel-plugin-transform-vue-jsx`,并参照其[文档](https://github.com/vuejs/babel-plugin-transform-vue-jsx)进行配置。
-
-如何使用第三方图标库?
-
-只要修改第三方图标库的前缀(具体方法参阅第三方库的文档),并编写相应的 CSS,即可在 Element 中像使用内置图标一样使用第三方图标。例如,将第三方库的前缀改为 `el-icon-my`,然后在其 CSS 文件中添加:
-```css
-[class^="el-icon-my"], [class*=" el-icon-my"] {
- font-family:"your-font-family" !important;
-
- /* 以下内容参照第三方图标库本身的规则 */
- font-size: inherit;
- font-style:normal;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-```
-具体使用时,和 Element 内置的图标用法一样。比如在 `el-input` 中:
-```html
-
-```
-
-
所有组件的任意属性都支持 `.sync` 修饰符吗?
@@ -129,27 +108,6 @@ The parameter `row` is the data object of corresponding row.
Please refer to [Render Function](http://vuejs.org/v2/guide/render-function.html) in Vue's documentation. In addition, if you are writing render functions with JSX, `babel-plugin-transform-vue-jsx` is required. See [here](https://github.com/vuejs/babel-plugin-transform-vue-jsx) for its configurations.
-
-How do I use third-party icon font library with Element?
-
-You just need to modify the class name prefix of the third-party library (see their docs for how to do it), and write some CSS, then you can use them just like you use Element built-in icons. For example, change the prefix to `el-icon-my`, and then add the following to its CSS:
-```css
-[class^="el-icon-my"], [class*=" el-icon-my"] {
- font-family:"your-font-family" !important;
-
- /* The following is based on original CSS rules of third-party library */
- font-size: inherit;
- font-style:normal;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-```
-Now you can use them as you do with built-in icons. For example, in `el-input`:
-```html
-
-```
-
-
Can I use `.sync` modifier on every attribute?
diff --git a/examples/app.vue b/examples/app.vue
index 784c0b888..035034755 100644
--- a/examples/app.vue
+++ b/examples/app.vue
@@ -191,7 +191,6 @@
const lang = location.hash.replace('#', '').split('/')[1] || 'zh-CN';
const localize = lang => {
- console.log(lang);
switch (lang) {
case 'zh-CN':
use(zhLocale);
@@ -232,6 +231,7 @@
const preferGithub = localStorage.getItem('PREFER_GITHUB');
if (href.indexOf('element-cn') > -1 || preferGithub) return;
setTimeout(() => {
+ if (this.lang !== 'zh-CN') return;
this.$confirm('建议大陆用户访问部署在国内的站点,是否跳转?', '提示')
.then(() => {
location.href = location.href.replace('element.', 'element-cn.');
@@ -249,12 +249,12 @@
this.suggestJump();
}
setTimeout(() => {
- const notified = localStorage.getItem('RELEASE_NOTIFIED');
- if (!notified) {
+ const notified = localStorage.getItem('ES_NOTIFIED');
+ if (!notified && this.lang !== 'zh-CN') {
const h = this.$createElement;
const title = this.lang === 'zh-CN'
- ? '2.0 正式发布'
- : '2.0 available now';
+ ? '帮助我们完成西班牙语文档'
+ : 'Help us with Spanish docs';
const messages = this.lang === 'zh-CN'
? ['点击', '这里', '查看详情']
: ['Click ', 'here', ' to learn more'];
@@ -266,13 +266,13 @@
h('a', {
attrs: {
target: '_blank',
- href: `https://github.com/ElemeFE/element/issues/${ this.lang === 'zh-CN' ? '7755' : '7756' }`
+ href: 'https://github.com/ElemeFE/element/issues/8074'
}
}, messages[1]),
messages[2]
]),
onClose() {
- localStorage.setItem('RELEASE_NOTIFIED', 1);
+ localStorage.setItem('ES_NOTIFIED', 1);
}
});
}
diff --git a/examples/docs/en-US/select.md b/examples/docs/en-US/select.md
index 79e85c45b..abff1c601 100644
--- a/examples/docs/en-US/select.md
+++ b/examples/docs/en-US/select.md
@@ -101,6 +101,7 @@
value8: '',
value9: [],
value10: [],
+ value11: [],
loading: false,
states: ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"]
};
@@ -320,7 +321,7 @@ You can clear Select using a clear icon.
Multiple select uses tags to display selected options.
-:::demo Set `multiple` attribute for `el-select` to enable multiple mode. In this case, the value of `v-model` will be an array of selected options.
+:::demo Set `multiple` attribute for `el-select` to enable multiple mode. In this case, the value of `v-model` will be an array of selected options. By default the selected options will be displayed as Tags. You can collapse them to a text by using `collapse-tags` attribute.
```html
@@ -331,6 +332,20 @@ Multiple select uses tags to display selected options.
:value="item.value">
+
+
+
+
+
-## Container
-Container components for scaffolding basic structure of the page:
+## Contenedor
+Componentes contenedores para iniciar una estructura básica de un sitio:
-``: wrapper container. When nested with a `` or ``, all its child elements will be vertically arranged. Otherwise horizontally.
+``: Contenedor. Cuando este elemento se anida con un `` o ``, todos los elementos secundarios se organizan verticalmente.
+De lo contrario, de forma horizontal.
-``: container for headers.
+``: Contenedor para cabeceras.
-``: container for side sections (usually a side nav).
+``: Contenedor para secciones laterales (generalmente, una barra lateral).
-``: container for main sections.
+``: Contenedor para sección principal.
-``: container for footers.
+``: Contenedor para pie de página.
:::tip
-These components use flex for layout, so please make sure your browser supports it. Besides, ``'s direct child elements have to be one or more of the latter four components. And father element of the latter four components must be a ``.
+Estos componentes utilizan flex para el diseño, así que asegúrate que el navegador lo soporte. Además, los elementos directos de `` tienen que
+ser uno o más de los últimos cuatro componentes. Y el elemento padre de los últimos cuatro componentes debe ser un ``.
:::
-### Common layouts
+### Diseños comunes
::: demo
```html
- Header
- Main
+ Cabecera
+ Principal
- Header
- Main
- Footer
+ Cabecera
+ Principal
+ Pie de página
- Aside
- Main
+ Barra lateral
+ Principal
- Header
+ Cabecera
- Aside
- Main
+ Barra lateral
+ Principal
- Header
+ Cabecera
- Aside
+ Barra lateral
- Main
- Footer
+ Principal
+ Pie de página
- Aside
+ Barra lateral
- Header
- Main
+ Cabecera
+ Principal
- Aside
+ Barra lateral
- Header
- Main
- Footer
+ Cabecera
+ Principal
+ Pie de página
@@ -168,7 +170,7 @@ These components use flex for layout, so please make sure your browser supports
```
:::
-### Example
+### Ejemplo
::: demo
```html
@@ -278,22 +280,22 @@ These components use flex for layout, so please make sure your browser supports
```
:::
-### Container Attributes
-| Attribute | Description | Type | Accepted Values | Default |
+### Atributos de contenedor
+| Atributo | Descripción | Tipo | Valores aceptados | Por defecto |
|---------- |-------------- |---------- |-------------------------------- |-------- |
-| direction | layout direction for child elements | string | horizontal / vertical | vertical when nested with `el-header` or `el-footer`; horizontal otherwise |
+| direction | dirección de diseño para elementos secundarios | string | horizontal / vertical | vertical cuando el elemento está anidado con `el-header`, de lo contrario, horizontal |
-### Header Attributes
-| Attribute | Description | Type | Accepted Values | Default |
+### Atributos de cabecera
+| Atributo | Descripción | Tipo | Valores aceptados | Por defecto |
|---------- |-------------- |---------- |-------------------------------- |-------- |
-| height | height of the header | string | — | 60px |
+| height | altura de la cabecera | string | — | 60px |
-### Aside Attributes
-| Attribute | Description | Type | Accepted Values | Default |
+### Atributos de barra lateral
+| Atributo | Descripción | Tipo | Valores aceptados | Por defecto |
|---------- |-------------- |---------- |-------------------------------- |-------- |
-| width | width of the side section | string | — | 300px |
+| width | ancho de la barra lateral | string | — | 300px |
-### Footer Attributes
-| Attribute | Description | Type | Accepted Values | Default |
+### Atributos de pie de página
+| Atributo | Descripción | Tipo | Valores aceptados | Por defecto |
|---------- |-------------- |---------- |-------------------------------- |-------- |
-| height | height of the footer | string | — | 60px |
\ No newline at end of file
+| height | altura del pie de página | string | — | 60px |
\ No newline at end of file
diff --git a/examples/docs/es/custom-theme.md b/examples/docs/es/custom-theme.md
index 5fb6bdd59..07b918480 100644
--- a/examples/docs/es/custom-theme.md
+++ b/examples/docs/es/custom-theme.md
@@ -1,25 +1,25 @@
-## Custom theme
-Element uses BEM-styled CSS so that you can override styles easily. But if you need to replace styles at a large scale, e.g. change the theme color from blue to orange or green, maybe overriding them one by one is not a good idea. We provide three ways to change the style variables.
+## Tema personalizado
+Element utiliza la metodología BEM en CSS con la finalidad de que puedas sobrescribir los estilos fácilmente. Pero, si necesitas remplazar estilos a gran escala, por ejemplo, cambiar el color del tema de azul a naranja o verde, quizás reemplazarlos uno a uno no sea lo más adecuado, por ello, te proporcionamos 3 maneras de modificar los estilos.
-### Changing theme color
-If you just want to change the theme color of Element, the [theme preview website](https://elementui.github.io/theme-chalk-preview/#/en-US) is recommended. The theme color of Element is bright and friendly blue. By changing it, you can make Element more visually connected to specific projects.
+### Cambiando el color del tema
+Si lo que buscas es cambiar el color del tema de Element, se recomienda utilizar el [sitio de visualización de temas](https://elementui.github.io/theme-chalk-preview/#/en-US). Element utiliza un color azul brillante y amigable como tema principal. Al cambiarlo, puede hacer que Element este más conectado visualmente a proyectos específicos.
-The above website enables you to preview theme of a new theme color in real-time, and it can generate a complete style package based on the new theme color for you to download directly (to import new style files in your project, please refer to the 'Import custom theme' or 'Import component theme on demand' part of this section).
+Este sitio, te permitirá obtener una vista previa del tema con un nuevo color en tiempo real, y, además, obtener un paquete de estilos completo basado en el nuevo color para su descarga (para importar estos nuevos estilos, consulta la sección ‘Importar un tema personalizado’ o ‘Importar un tema de componente bajo demanda' que se encuentran dentro de esta sección).
-### Update SCSS variables in your project
-`theme-chalk` is written in SCSS. If your project also uses SCSS, you can directly change Element style variables. Create a new style file, e.g. `element-variables.scss`:
+### Actualizando variables SCSS en tu proyecto
+`theme-chalk` esta escrito en SCSS. Si tu proyecto también utiliza SCSS, puedes cambiar las variables de estilos de Element. Para ello, solo necesitas crear un nuevo archivo de estilos, por ejemplo, `element-variables.scss`:
```html
-/* theme color */
+/* Color del tema */
$--color-primary: teal;
-/* icon font path, required */
+/* Ubicación de la fuente, obligatoria */
$--font-path: '../node_modules/element-ui/lib/theme-chalk/fonts';
@import "../node_modules/element-ui/packages/theme-chalk/src/index";
```
-Then in the entry file of your project, import this style file instead of Element's built CSS:
+Entonces, en el archivo principal del proyecto, importa este archivo de estilos en lugar de los estilos de Element:
```JS
import Vue from 'vue'
import Element from 'element-ui'
@@ -29,29 +29,29 @@ Vue.use(Element)
```
:::tip
-Note that it is required to override icon font path to the relative path of Element's font files.
+Nota es necesario sobreescribir la ruta de la fuente por una ruta relativa de las fuentes de Element.
:::
-### CLI theme tool
-If you project doesn't use SCSS, you can customize themes with our CLI theme tool:
+### CLI para generar temas
+Si tu proyecto no utiliza SCSS, puedes personalizar el tema a través de esta herramienta:
-#### Install
-First install the theme generator globally or locally. Local install is recommended because in this way, when others clone your project, npm will automatically install it for them.
+#### Instalación
+Primero, debes instalar el generador de temas ya sea de forma global o local. Se recomienda instalarlo de forma local, ya que de esta manera, cuando otros clonen tu proyecto, npm automáticamente los instalará para ellos.
```shell
npm i element-theme -g
```
-Then install the chalk theme from npm or GitHub.
+Ahora, instala el tema `chalk` desde npm o Github.
```shell
-# from npm
+# desde npm
npm i element-theme-chalk -D
-# from GitHub
+# desde GitHub
npm i https://github.com/ElementUI/theme-chalk -D
```
-#### Initialize variable file
-After successfully installing the above packages, a command named `et` is available in CLI (if the packages are installed locally, use `node_modules/.bin/et` instead). Run `-i` to initialize the variable file which outputs to `element-variables.scss` by default. And you can specify its output directory as you will.
+#### Inicializar archivo de variables
+Después de haber instalado correctamente los paquetes, el comando `et` estará disponible en tu CLI (si instalaste el paquete de manera local, utilizá `node_modules/.bin/et` en su lugar). Ejecuta `-i` para inicializar un archivo de variables, puedes especificar un nombre distinto, pero por defecto, el archivo se llama `element-variables.scss`. También puedes especificar un directorio distinto.
```shell
et -i [custom output file]
@@ -59,7 +59,7 @@ et -i [custom output file]
> ✔ Generator variables file
```
-In `element-variables.scss` you can find all the variables we used to style Element and they are defined in SCSS format. Here's a snippet:
+En el archivo `element-variables.scss` podrás encontrar todas las variables que utiliza Element para definir los estilos y estos están definidos en SCSS. Aquí un ejemplo:
```css
$--color-primary: #409EFF !default;
$--color-primary-light-1: mix($--color-white, $--color-primary, 10%) !default; /* 53a8ff */
@@ -80,14 +80,14 @@ $--color-info: #878d99 !default;
...
```
-#### Modify variables
-Just edit `element-variables.scss`, e.g. changing the theme color to red:
+#### Modificando variables
+Solo debes modificar el archivo `element-variables.scss`, por ejemplo, para cambiar el color del tema a rojo:
```CSS
$--color-primary: red;
```
-#### Build theme
-After saving the variable file, use `et` to build your theme. You can activate `watch` mode by adding a parameter `-w`. And if you customized the variable file's output, you need to add a parameter `-c` and variable file's name:
+#### Construyendo el tema
+Después de haber modificado el archivo de variables, utilizaremos el comando `et` para construir nuestro tema. Puedes activar el modo `watch` agregando el parámetro `-w`. Y, si deseas personalizar el nombre del archivo, debes agregar el parámetro `-c` seguido del nombre.
```shell
et
@@ -95,8 +95,8 @@ et
> ✔ build element theme
```
-#### Import custom theme
-By default the build theme file is placed inside `./theme`. You can specify its output directory with parameter `-o`. Importing your own theme is just like importing the default theme, only this time you import the file you just built:
+#### Importar un tema personalizado
+Por defecto, el archivo de tema construido es colocado dentro de `./theme`. Tu puedes especificar un directorio distinto utilizando el parámetro `-o`. Importar tu propio tema es igual a como si importarás el tema por defecto, únicamente tienes que importar el archivo que se construyó:
```javascript
import '../theme/index.css'
@@ -106,8 +106,8 @@ import Vue from 'vue'
Vue.use(ElementUI)
```
-#### Import component theme on demand
-If you are using `babel-plugin-component` for on-demand import, just modify `.babelrc` and specify `styleLibraryName` to the path where your custom theme is located relative to `.babelrc`. Note that `~` is required:
+#### Importar un tema de componente bajo demanda
+Si estas utilizando `babel-plugin-component` para importar bajo demanda, solo debes modificar el archivo `.babelrc` y especificar en la propiedad `styleLibraryName` la ruta en donde se encuentra localizado tu tema personalizado relativo a `.babelrc`. Nota el carácter `~` es obligatorio:
```json
{
"plugins": [["component", [
@@ -119,4 +119,4 @@ If you are using `babel-plugin-component` for on-demand import, just modify `.ba
}
```
-If you are unfamiliar with `babel-plugin-component`, please refer to Quick Start. For more details, check out the [project repository](https://github.com/ElementUI/element-theme) of `element-theme`.
\ No newline at end of file
+Si no estas familiarizado con `babel-plugin-component`, por favor dirígete a la documentación sobre Como Iniciar. Para más detalles, consulta el [repositorio del proyecto](https://github.com/ElementUI/element-theme) de `element-theme`.
\ No newline at end of file
diff --git a/examples/docs/es/installation.md b/examples/docs/es/installation.md
index a381d3972..bc96d89c9 100644
--- a/examples/docs/es/installation.md
+++ b/examples/docs/es/installation.md
@@ -1,14 +1,14 @@
-## Installation
+## Instalación
### npm
-Installing with npm is recommended and it works seamlessly with [webpack](https://webpack.js.org/).
+Instalar mediante npm es la forma recomendada ya que se integra facilmente con [webpack](https://webpack.js.org/).
```shell
npm i element-ui -S
```
-### CDN
-Get the latest version from [unpkg.com/element-ui](https://unpkg.com/element-ui/) , and import JavaScript and CSS file in your page.
+### CDN
+Obten la última versión desde [unpkg.com/element-ui](https://unpkg.com/element-ui/) , e importa el JavaScript y los archivos CSS en tu página.
```html
@@ -17,12 +17,12 @@ Get the latest version from [unpkg.com/element-ui](https://unpkg.com/element-ui/
```
-:::tip
-We recommend our users to lock Element's version when using CDN. Please refer to [unpkg.com](https://unpkg.com) for more information.
-:::
+##Tip
+Recomendamos a nuestros usuarios congelar la versión de Elemet cuando usas un CDN. Por favor, refiérase a [unpkg.com](https://unpkg.com) para más información.
+
### Hello world
-If you are using CDN, a hello-world page is easy with Element. [Online Demo](https://jsfiddle.net/hzfpyvg6/14/)
+Si estás usando un CDN, una página con Hello-World es fácil con Element. [Online Demo](https://jsfiddle.net/hzfpyvg6/14/)
```html
@@ -54,4 +54,5 @@ If you are using CDN, a hello-world page is easy with Element. [Online Demo](htt