diff --git a/.npmrc b/.npmrc index 9bf9395dd3..bf2e7648b0 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1 @@ -shamefully-hoist = true +shamefully-hoist=true diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js deleted file mode 100644 index bcc952fdbf..0000000000 --- a/docs/.vitepress/config.js +++ /dev/null @@ -1,4 +0,0 @@ -require('sucrase/register/ts') - -const { config } = require('./config/index') -module.exports = config diff --git a/docs/.vitepress/config/index.ts b/docs/.vitepress/config.ts similarity index 81% rename from docs/.vitepress/config/index.ts rename to docs/.vitepress/config.ts index 0af5bfc4fa..ee48eda0c9 100644 --- a/docs/.vitepress/config/index.ts +++ b/docs/.vitepress/config.ts @@ -1,9 +1,9 @@ -import { languages } from '../utils/lang' -import { head } from './head' -import { sidebars } from './sidebars' -import { nav } from './nav' -import { mdPlugin } from './plugins' -import { features } from './features' +import { languages } from './utils/lang' +import { head } from './config/head' +import { sidebars } from './config/sidebars' +import { nav } from './config/nav' +import { mdPlugin } from './config/plugins' +import { features } from './config/features' import type { UserConfig } from 'vitepress' const buildTransformers = () => { @@ -32,6 +32,7 @@ const buildTransformers = () => { return transformers } +// eslint-disable-next-line no-console console.log(`DOC_ENV: ${process.env.DOC_ENV}`) const locales = {} @@ -80,3 +81,5 @@ export const config: UserConfig = { }, }, } + +export default config diff --git a/docs/.vitepress/theme/index.js b/docs/.vitepress/theme/index.js index 4670f714c2..a3386a5a25 100644 --- a/docs/.vitepress/theme/index.js +++ b/docs/.vitepress/theme/index.js @@ -1,7 +1,16 @@ import ElementPlus from 'element-plus' +// windicss layers +import 'virtual:windi-base.css' +import 'virtual:windi-components.css' + import VPApp, { globals, NotFound } from '../vitepress' +// windicss utilities should be the last style import +import 'virtual:windi-utilities.css' +// windicss devtools support (dev only) +import 'virtual:windi-devtools' + export default { NotFound, Layout: VPApp, diff --git a/docs/.vitepress/vitepress/styles/code.scss b/docs/.vitepress/vitepress/styles/code.scss index c771c1cdd7..c89e222acf 100644 --- a/docs/.vitepress/vitepress/styles/code.scss +++ b/docs/.vitepress/vitepress/styles/code.scss @@ -3,7 +3,7 @@ code { border-radius: 3px; padding: 0.25rem 0.5rem; font-family: var(--code-font-family); - font-size: 0.85em; + font-size: var(--code-font-size); color: var(--code-text-color); background-color: var(--code-bg-color); } diff --git a/docs/.vitepress/vitepress/styles/vars.scss b/docs/.vitepress/vitepress/styles/vars.scss index 27fedcd482..f54402d446 100644 --- a/docs/.vitepress/vitepress/styles/vars.scss +++ b/docs/.vitepress/vitepress/styles/vars.scss @@ -39,7 +39,6 @@ // --dropdown-z-index: 22; // code block vars - --code-font-size: var(--el-font-size-base); --code-bg-color: var(--el-bg-color); --code-text-color: var(--text-color); diff --git a/docs/en-US/component/avatar.md b/docs/en-US/component/avatar.md index 269c2dfc21..93dd9591b0 100644 --- a/docs/en-US/component/avatar.md +++ b/docs/en-US/component/avatar.md @@ -52,7 +52,7 @@ avatar/fit | Attribute | Description | Type | Accepted Values | Default | | --------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------ | ------------------------------------------ | ------- | | icon | set representation type to Icon, more info on Icon Component | string / Component | | | -| size | set avatar size | number / string | number / large / medium / small | large | +| size | set avatar size | number / string | number / large / default /small | default | | shape | set avatar shape | string | circle / square | circle | | src | the address of the image for an image avatar | string | | | | srcSet | A list of one or more strings separated by commas indicating a set of possible image sources for the user agent to use | string | | | diff --git a/docs/en-US/component/button.md b/docs/en-US/component/button.md index ff6424b1f9..8123c0e4ee 100644 --- a/docs/en-US/component/button.md +++ b/docs/en-US/component/button.md @@ -69,7 +69,7 @@ button/loading Besides default size, Button component provides three additional sizes for you to choose among different scenarios. -:::demo Use attribute `size` to set additional sizes with `medium`, `small` or `mini`. +:::demo Use attribute `size` to set additional sizes with `large`, `small`. button/size @@ -91,7 +91,7 @@ button/custom | Attribute | Description | Type | Accepted Values | Default | | ----------------- | ----------------------------------------------------------- | ------------------ | -------------------------------------------------- | ------- | -| size | button size | string | medium / small / mini | — | +| size | button size | string | large / default /small | — | | type | button type | string | primary / success / warning / danger / info / text | — | | plain | determine whether it's a plain button | boolean | — | false | | round | determine whether it's a round button | boolean | — | false | @@ -113,7 +113,7 @@ button/custom | Attribute | Description | Type | Accepted Values | Default | | --------- | ------------------------------------------------ | ------ | --------------------------- | ------- | -| size | control the size of buttons in this button-group | string | medium / small / mini | — | +| size | control the size of buttons in this button-group | string | large / small | — | | type | control the type of buttons in this button-group | string | primary / success / warning | — | ## Button-Group Slots diff --git a/docs/en-US/component/cascader.md b/docs/en-US/component/cascader.md index ebe365b066..437513cfc4 100644 --- a/docs/en-US/component/cascader.md +++ b/docs/en-US/component/cascader.md @@ -138,24 +138,24 @@ cascader/panel ## Cascader Attributes -| Attribute | Description | Type | Accepted Values | Default | -| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | --------------------- | ------- | -| model-value / v-model | binding value | - | — | — | -| options | data of the options,the key of `value` and `label` can be customize by `Props`. | array | — | — | -| props | configuration options, see the following table. | object | — | — | -| size | size of input | string | medium / small / mini | — | -| placeholder | placeholder of input | string | — | Select | -| disabled | whether Cascader is disabled | boolean | — | false | -| clearable | whether selected value can be cleared | boolean | — | false | -| show-all-levels | whether to display all levels of the selected value in the input | boolean | — | true | -| collapse-tags | whether to collapse tags in multiple selection mode | boolean | - | false | -| separator | option label separator | string | — | ' / ' | -| filterable | whether the options can be searched | boolean | — | — | -| filter-method | customize search logic, the first parameter is `node`, the second is `keyword`, and need return a boolean value indicating whether it hits. | function(node, keyword) | - | - | -| debounce | debounce delay when typing filter keyword, in milliseconds | number | — | 300 | -| before-filter | hook function before filtering with the value to be filtered as its parameter. If `false` is returned or a `Promise` is returned and then is rejected, filtering will be aborted | function(value) | — | — | -| popper-class | custom class name for Cascader's dropdown | string | — | — | -| popper-append-to-body | whether to append the popper menu to body. If the positioning of the popper is wrong, you can try to set this prop to false | boolean | - | true | +| Attribute | Description | Type | Accepted Values | Default | +| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ---------------------- | ------- | +| model-value / v-model | binding value | - | — | — | +| options | data of the options,the key of `value` and `label` can be customize by `Props`. | array | — | — | +| props | configuration options, see the following table. | object | — | — | +| size | size of input | string | large / default /small | — | +| placeholder | placeholder of input | string | — | Select | +| disabled | whether Cascader is disabled | boolean | — | false | +| clearable | whether selected value can be cleared | boolean | — | false | +| show-all-levels | whether to display all levels of the selected value in the input | boolean | — | true | +| collapse-tags | whether to collapse tags in multiple selection mode | boolean | - | false | +| separator | option label separator | string | — | ' / ' | +| filterable | whether the options can be searched | boolean | — | — | +| filter-method | customize search logic, the first parameter is `node`, the second is `keyword`, and need return a boolean value indicating whether it hits. | function(node, keyword) | - | - | +| debounce | debounce delay when typing filter keyword, in milliseconds | number | — | 300 | +| before-filter | hook function before filtering with the value to be filtered as its parameter. If `false` is returned or a `Promise` is returned and then is rejected, filtering will be aborted | function(value) | — | — | +| popper-class | custom class name for Cascader's dropdown | string | — | — | +| popper-append-to-body | whether to append the popper menu to body. If the positioning of the popper is wrong, you can try to set this prop to false | boolean | - | true | ## Cascader Events diff --git a/docs/en-US/component/checkbox.md b/docs/en-US/component/checkbox.md index c034892e9c..d41fef5836 100644 --- a/docs/en-US/component/checkbox.md +++ b/docs/en-US/component/checkbox.md @@ -77,18 +77,18 @@ checkbox/with-border ## Checkbox Attributes -| Attribute | Description | Type | Accepted Values | Default | -| --------------------- | --------------------------------------------------------- | ---------------------------------- | --------------------- | ------- | -| model-value / v-model | binding value | string / number / boolean | — | — | -| label | value of the Checkbox when used inside a `checkbox-group` | string / number / boolean / object | — | — | -| true-label | value of the Checkbox if it's checked | string / number | — | — | -| false-label | value of the Checkbox if it's not checked | string / number | — | — | -| disabled | whether the Checkbox is disabled | boolean | — | false | -| border | whether to add a border around Checkbox | boolean | — | false | -| size | size of the Checkbox | string | medium / small / mini | — | -| name | native 'name' attribute | string | — | — | -| checked | if the Checkbox is checked | boolean | — | false | -| indeterminate | same as `indeterminate` in native checkbox | boolean | — | false | +| Attribute | Description | Type | Accepted Values | Default | +| --------------------- | --------------------------------------------------------- | ---------------------------------- | ---------------------- | ------- | +| model-value / v-model | binding value | string / number / boolean | — | — | +| label | value of the Checkbox when used inside a `checkbox-group` | string / number / boolean / object | — | — | +| true-label | value of the Checkbox if it's checked | string / number | — | — | +| false-label | value of the Checkbox if it's not checked | string / number | — | — | +| disabled | whether the Checkbox is disabled | boolean | — | false | +| border | whether to add a border around Checkbox | boolean | — | false | +| size | size of the Checkbox | string | large / default /small | — | +| name | native 'name' attribute | string | — | — | +| checked | if the Checkbox is checked | boolean | — | false | +| indeterminate | same as `indeterminate` in native checkbox | boolean | — | false | ## Checkbox Events @@ -104,15 +104,15 @@ checkbox/with-border ## Checkbox-group Attributes -| Attribute | Description | Type | Accepted Values | Default | -| --------------------- | ------------------------------------------------- | ------- | --------------------- | ------- | -| model-value / v-model | binding value | array | — | — | -| size | size of checkbox | string | medium / small / mini | — | -| disabled | whether the nesting checkboxes are disabled | boolean | — | false | -| min | minimum number of checkbox checked | number | — | — | -| max | maximum number of checkbox checked | number | — | — | -| text-color | font color when button is active | string | — | #ffffff | -| fill | border and background color when button is active | string | — | #409EFF | +| Attribute | Description | Type | Accepted Values | Default | +| --------------------- | ------------------------------------------------- | ------- | ---------------------- | ------- | +| model-value / v-model | binding value | array | — | — | +| size | size of checkbox | string | large / default /small | — | +| disabled | whether the nesting checkboxes are disabled | boolean | — | false | +| min | minimum number of checkbox checked | number | — | — | +| max | maximum number of checkbox checked | number | — | — | +| text-color | font color when button is active | string | — | #ffffff | +| fill | border and background color when button is active | string | — | #409EFF | ## Checkbox-group Events diff --git a/docs/en-US/component/color-picker.md b/docs/en-US/component/color-picker.md index 6b41b7b6aa..e4feac0a09 100644 --- a/docs/en-US/component/color-picker.md +++ b/docs/en-US/component/color-picker.md @@ -41,15 +41,15 @@ color-picker/sizes ## Attributes -| Attribute | Description | Type | Accepted Values | Default | -| --------------------- | ------------------------------------------------- | ------------------ | --------------------- | ------------------------------------------------------------- | -| model-value / v-model | binding value | string | — | — | -| disabled | whether to disable the ColorPicker | boolean | — | false | -| size | size of ColorPicker | string | medium / small / mini | — | -| show-alpha | whether to display the alpha slider | boolean | — | false | -| color-format | color format of v-model | string | hsl / hsv / hex / rgb | hex (when show-alpha is false)/ rgb (when show-alpha is true) | -| popper-class | custom icon compontent for ColorPicker's dropdown | string / Component | — | — | -| predefine | predefined color options | array | — | — | +| Attribute | Description | Type | Accepted Values | Default | +| --------------------- | ------------------------------------------------- | ------------------ | ---------------------- | ------------------------------------------------------------- | +| model-value / v-model | binding value | string | — | — | +| disabled | whether to disable the ColorPicker | boolean | — | false | +| size | size of ColorPicker | string | large / default /small | — | +| show-alpha | whether to display the alpha slider | boolean | — | false | +| color-format | color format of v-model | string | hsl / hsv / hex / rgb | hex (when show-alpha is false)/ rgb (when show-alpha is true) | +| popper-class | custom icon compontent for ColorPicker's dropdown | string / Component | — | — | +| predefine | predefined color options | array | — | — | ## Events diff --git a/docs/en-US/component/date-picker.md b/docs/en-US/component/date-picker.md index e8a674bac5..5ca1bf8d80 100644 --- a/docs/en-US/component/date-picker.md +++ b/docs/en-US/component/date-picker.md @@ -10,8 +10,9 @@ Use Date Picker for date input. ## Date and time @@ -73,7 +67,7 @@ datetime-picker/default-time | disabled | whether DatePicker is disabled | boolean | — | false | | editable | whether the input is editable | boolean | — | true | | clearable | whether to show clear button | boolean | — | true | -| size | size of Input | string | large/medium/small/mini | large | +| size | size of Input | string | large/default/small | default | | placeholder | placeholder in non-range mode | string | — | — | | start-placeholder | placeholder for the start date in range mode | string | — | — | | end-placeholder | placeholder for the end date in range mode | string | — | — | diff --git a/docs/en-US/component/descriptions.md b/docs/en-US/component/descriptions.md index ec97e29a79..b2cc5193fe 100644 --- a/docs/en-US/component/descriptions.md +++ b/docs/en-US/component/descriptions.md @@ -57,14 +57,14 @@ descriptions/customized-style ## Descriptions Attributes -| Attribute | Description | Type | Accepted Values | Default | -| --------- | ------------------------------------------ | ------- | --------------------- | ---------- | -| border | with or without border | boolean | — | false | -| column | numbers of `Descriptions Item` in one line | number | — | 3 | -| direction | direction of list | string | vertical / horizontal | horizontal | -| size | size of list | string | medium / small / mini | — | -| title | title text, display on the top left | string | — | — | -| extra | extra text, display on the top right | string | — | — | +| Attribute | Description | Type | Accepted Values | Default | +| --------- | ------------------------------------------ | ------- | ----------------------- | ---------- | +| border | with or without border | boolean | — | false | +| column | numbers of `Descriptions Item` in one line | number | — | 3 | +| direction | direction of list | string | vertical / horizontal | horizontal | +| size | size of list | string | large / default / small | default | +| title | title text, display on the top left | string | — | — | +| extra | extra text, display on the top right | string | — | — | ## Descriptions Slots diff --git a/docs/en-US/component/dropdown.md b/docs/en-US/component/dropdown.md index 5501a07168..dbcb394a3d 100644 --- a/docs/en-US/component/dropdown.md +++ b/docs/en-US/component/dropdown.md @@ -101,7 +101,7 @@ dropdown/command-event Besides default size, Dropdown component provides three additional sizes for you to choose among different scenarios. -:::demo Use attribute `size` to set additional sizes with `medium`, `small` or `mini`. +:::demo Use attribute `size` to set additional sizes with `large`, `default` or `small`. dropdown/sizes @@ -112,7 +112,7 @@ dropdown/sizes | Attribute | Description | Type | Accepted Values | Default | | ------------- | ---------------------------------------------------------------------------------------------------- | --------------- | ---------------------------------------------------- | ------- | | type | menu button type, refer to `Button` Component, only works when `split-button` is true | string | — | — | -| size | menu size, also works on the split button | string | medium / small / mini | — | +| size | menu size, also works on the split button | string | large / default / small | default | | max-height | the max height of menu | string / number | — | — | | split-button | whether a button group is displayed | boolean | — | false | | disabled | Whether to disable | boolean | — | false | diff --git a/docs/en-US/component/form.md b/docs/en-US/component/form.md index 9924d0103f..ffc5346b58 100644 --- a/docs/en-US/component/form.md +++ b/docs/en-US/component/form.md @@ -189,21 +189,21 @@ form/size-control ## Form Attributes -| Attribute | Description | Type | Accepted Values | Default | -| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------- | --------------------- | ------- | -| model | data of form component | object | — | — | -| rules | validation rules of form | object | — | — | -| inline | whether the form is inline | boolean | — | false | -| label-position | position of label. If set to 'left' or 'right', `label-width` prop is also required | string | left / right / top | right | -| label-width | width of label, e.g. '50px'. All its direct child form items will inherit this value. Width `auto` is supported. | string / number | — | — | -| label-suffix | suffix of the label | string | — | — | -| hide-required-asterisk | whether required fields should have a red asterisk (star) beside their labels | boolean | — | false | -| show-message | whether to show the error message | boolean | — | true | -| inline-message | whether to display the error message inline with the form item | boolean | — | false | -| status-icon | whether to display an icon indicating the validation result | boolean | — | false | -| validate-on-rule-change | whether to trigger validation when the `rules` prop is changed | boolean | — | true | -| size | control the size of components in this form | string | medium / small / mini | — | -| disabled | whether to disabled all components in this form. If set to true, it cannot be overridden by its inner components' `disabled` prop | boolean | — | false | +| Attribute | Description | Type | Accepted Values | Default | +| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------- | ----------------------- | ------- | +| model | data of form component | object | — | — | +| rules | validation rules of form | object | — | — | +| inline | whether the form is inline | boolean | — | false | +| label-position | position of label. If set to 'left' or 'right', `label-width` prop is also required | string | left / right / top | right | +| label-width | width of label, e.g. '50px'. All its direct child form items will inherit this value. Width `auto` is supported. | string / number | — | — | +| label-suffix | suffix of the label | string | — | — | +| hide-required-asterisk | whether required fields should have a red asterisk (star) beside their labels | boolean | — | false | +| show-message | whether to show the error message | boolean | — | true | +| inline-message | whether to display the error message inline with the form item | boolean | — | false | +| status-icon | whether to display an icon indicating the validation result | boolean | — | false | +| validate-on-rule-change | whether to trigger validation when the `rules` prop is changed | boolean | — | true | +| size | control the size of components in this form | string | large / default / small | — | +| disabled | whether to disabled all components in this form. If set to true, it cannot be overridden by its inner components' `disabled` prop | boolean | — | false | ## Form Methods @@ -239,7 +239,7 @@ form/size-control | error | field error message, set its value and the field will validate error and show this message immediately | string | — | — | | show-message | whether to show the error message | boolean | — | true | | inline-message | inline style validate message | boolean | — | false | -| size | control the size of components in this form-item | string | medium / small / mini | — | +| size | control the size of components in this form-item | string | large / default / small | default | ## Rules diff --git a/docs/en-US/component/input-number.md b/docs/en-US/component/input-number.md index 157f7b08d8..03dd72ae76 100644 --- a/docs/en-US/component/input-number.md +++ b/docs/en-US/component/input-number.md @@ -63,7 +63,7 @@ The value of `precision` must be a non negative integer and should not be less t ## Size -Use attribute `size` to set additional sizes with `medium`, `small` or `mini`. +Use attribute `size` to set additional sizes with `large` or `small`. :::demo @@ -81,21 +81,21 @@ input-number/controlled ## Attributes -| Attribute | Description | Type | Accepted Values | Default | -| --------------------- | ------------------------------------------------ | ------------------ | ----------------------- | ----------- | -| model-value / v-model | binding value | number / undefined | — | — | -| min | the minimum allowed value | number | — | `-Infinity` | -| max | the maximum allowed value | number | — | `Infinity` | -| step | incremental step | number | — | 1 | -| step-strictly | whether input value can only be multiple of step | boolean | — | false | -| precision | precision of input value | number | — | — | -| size | size of the component | string | large/medium/small/mini | large | -| disabled | whether the component is disabled | boolean | — | false | -| controls | whether to enable the control buttons | boolean | — | true | -| controls-position | position of the control buttons | string | right | - | -| name | same as `name` in native input | string | — | — | -| label | label text | string | — | — | -| placeholder | placeholder in input | string | - | - | +| Attribute | Description | Type | Accepted Values | Default | +| --------------------- | ------------------------------------------------ | ------------------ | --------------- | ----------- | +| model-value / v-model | binding value | number / undefined | — | — | +| min | the minimum allowed value | number | — | `-Infinity` | +| max | the maximum allowed value | number | — | `Infinity` | +| step | incremental step | number | — | 1 | +| step-strictly | whether input value can only be multiple of step | boolean | — | false | +| precision | precision of input value | number | — | — | +| size | size of the component | string | large/small | default | +| disabled | whether the component is disabled | boolean | — | false | +| controls | whether to enable the control buttons | boolean | — | true | +| controls-position | position of the control buttons | string | right | - | +| name | same as `name` in native input | string | — | — | +| label | label text | string | — | — | +| placeholder | placeholder in input | string | - | - | ## Events diff --git a/docs/en-US/component/input.md b/docs/en-US/component/input.md index ddc269c585..4cdb541509 100644 --- a/docs/en-US/component/input.md +++ b/docs/en-US/component/input.md @@ -137,35 +137,35 @@ input/length-limiting ## Input Attributes -| Attribute | Description | Type | Accepted Values | Default | -| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | ------- | -| type | type of input | string | text, textarea and other [native input types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types) | text | -| modelValue / v-model | binding value | string / number | — | — | -| maxlength | the max length | string / number | — | — | -| minlength | same as `minlength` in native input | number | — | — | -| show-word-limit | whether show word count,only works when `type` is 'text' or 'textarea' | boolean | — | false | -| placeholder | placeholder of Input | string | — | — | -| clearable | whether to show clear button | boolean | — | false | -| show-password | whether to show toggleable password input | boolean | — | false | -| disabled | whether Input is disabled | boolean | — | false | -| size | size of Input, works when `type` is not 'textarea' | string | medium / small / mini | — | -| prefix-icon | prefix icon component | string / Component | — | — | -| suffix-icon | suffix icon component | string / Component | — | — | -| rows | number of rows of textarea, only works when `type` is 'textarea' | number | — | 2 | -| autosize | whether textarea has an adaptive height, only works when `type` is 'textarea'. Can accept an object, e.g. { minRows: 2, maxRows: 6 } | boolean / object | — | false | -| autocomplete | same as `autocomplete` in native input | string | — | off | -| name | same as `name` in native input | string | — | — | -| readonly | same as `readonly` in native input | boolean | — | false | -| max | same as `max` in native input | — | — | — | -| min | same as `min` in native input | — | — | — | -| step | same as `step` in native input | — | — | — | -| resize | control the resizability | string | none / both / horizontal / vertical | — | -| autofocus | same as `autofocus` in native input | boolean | — | false | -| form | same as `form` in native input | string | — | — | -| label | label text | string | — | — | -| tabindex | input tabindex | string / number | - | - | -| validate-event | whether to trigger form validation | boolean | - | true | -| input-style | the style of the input element or textarea element | object | - | {} | +| Attribute | Description | Type | Accepted Values | Default | +| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| type | type of input | string | text, textarea and other [native input types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types) | text | +| modelValue / v-model | binding value | string / number | — | — | +| maxlength | the max length | string / number | — | — | +| minlength | same as `minlength` in native input | number | — | — | +| show-word-limit | whether show word count,only works when `type` is 'text' or 'textarea' | boolean | — | false | +| placeholder | placeholder of Input | string | — | — | +| clearable | whether to show clear button | boolean | — | false | +| show-password | whether to show toggleable password input | boolean | — | false | +| disabled | whether Input is disabled | boolean | — | false | +| size | size of Input, works when `type` is not 'textarea' | string | large / small | — | +| prefix-icon | prefix icon component | string / Component | — | — | +| suffix-icon | suffix icon component | string / Component | — | — | +| rows | number of rows of textarea, only works when `type` is 'textarea' | number | — | 2 | +| autosize | whether textarea has an adaptive height, only works when `type` is 'textarea'. Can accept an object, e.g. `{ minRows: 2, maxRows: 6 }` | boolean / object | — | false | +| autocomplete | same as `autocomplete` in native input | string | — | off | +| name | same as `name` in native input | string | — | — | +| readonly | same as `readonly` in native input | boolean | — | false | +| max | same as `max` in native input | — | — | — | +| min | same as `min` in native input | — | — | — | +| step | same as `step` in native input | — | — | — | +| resize | control the resizability | string | none / both / horizontal / vertical | — | +| autofocus | same as `autofocus` in native input | boolean | — | false | +| form | same as `form` in native input | string | — | — | +| label | label text | string | — | — | +| tabindex | input tabindex | string / number | - | - | +| validate-event | whether to trigger form validation | boolean | - | true | +| input-style | the style of the input element or textarea element | object | - | {} | ## Input slots diff --git a/docs/en-US/component/message-box.md b/docs/en-US/component/message-box.md index 47ca7e51f2..62951a4d52 100644 --- a/docs/en-US/component/message-box.md +++ b/docs/en-US/component/message-box.md @@ -148,4 +148,4 @@ The corresponding methods are: `ElMessageBox`, `ElMessageBox.alert`, `ElMessageB | input-error-message | error message when validation fails | string | — | Illegal input | | center | whether to align the content in center | boolean | — | false | | round-button | whether to use round button | boolean | — | false | -| button-size | custom size of confirm and cancel buttons | string | mini / small / medium / large | small | +| button-size | custom size of confirm and cancel buttons | string | small / default / large | default | diff --git a/docs/en-US/component/radio.md b/docs/en-US/component/radio.md index 63cce7ca6d..46766fef49 100644 --- a/docs/en-US/component/radio.md +++ b/docs/en-US/component/radio.md @@ -57,14 +57,14 @@ radio/with-borders ## Radio Attributes -| Attribute | Description | Type | Accepted Values | Default | -| --------------------- | ------------------------------------ | ------------------------- | --------------------- | ------- | -| model-value / v-model | binding value | string / number / boolean | — | — | -| label | the value of Radio | string / number / boolean | — | — | -| disabled | whether Radio is disabled | boolean | — | false | -| border | whether to add a border around Radio | boolean | — | false | -| size | size of the Radio | string | medium / small / mini | — | -| name | native 'name' attribute | string | — | — | +| Attribute | Description | Type | Accepted Values | Default | +| --------------------- | ------------------------------------ | ------------------------- | ---------------------- | ------- | +| model-value / v-model | binding value | string / number / boolean | — | — | +| label | the value of Radio | string / number / boolean | — | — | +| disabled | whether Radio is disabled | boolean | — | false | +| border | whether to add a border around Radio | boolean | — | false | +| size | size of the Radio | string | large / default /small | — | +| name | native 'name' attribute | string | — | — | ## Radio Events @@ -83,7 +83,7 @@ radio/with-borders | Attribute | Description | Type | Accepted Values | Default | | --------------------- | ------------------------------------------------- | ------------------------- | --------------------- | ------- | | model-value / v-model | binding value | string / number / boolean | — | — | -| size | the size of radio | string | medium / small / mini | — | +| size | the size of radio | string | large / small / small | default | | disabled | whether the nesting radios are disabled | boolean | — | false | | text-color | font color when button is active | string | — | #ffffff | | fill | border and background color when button is active | string | — | #409EFF | diff --git a/docs/en-US/component/select-v2.md b/docs/en-US/component/select-v2.md index 13aea453db..b0c27dff2a 100644 --- a/docs/en-US/component/select-v2.md +++ b/docs/en-US/component/select-v2.md @@ -116,29 +116,29 @@ select-v2/remote-search ## SelectV2 Attributes -| Param | Description | Type | Accepted Values | Default | -| --------------------- | --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | ----------------- | ------------- | -| model-value / v-model | biding value | string / number / boolean / object | — | — | -| multiple | is multiple | boolean | — | false | -| disabled | is disabled | boolean | — | false | -| value-key | unique identity key name for value, required when value is an object | string | — | value | -| size | input box size | string | medium/small/mini | — | -| clearable | whether select can be cleared | boolean | — | false | -| collapse-tags | whether to collapse tags to a text when multiple selecting | boolean | — | false | -| multiple-limit | maximum number of options user can select when multiple is true. No limit when set to 0 | number | — | 0 | -| name | the name attribute of select input | string | — | — | -| autocomplete | select input 的 autocomplete 属性 | string | — | off | -| placeholder | the autocomplete attribute of select input | string | — | Please select | -| filterable | is filterable | boolean | — | false | -| allow-create | whether creating new items is allowed. To use this, `filterable` must be true | boolean | — | false | -| no-data-text | displayed text when there is no options, you can also use slot empty | string | — | No Data | -| popper-class | custom class name for Select's dropdown | string | — | — | -| popper-append-to-body | whether to append the popper menu to body. If the positioning of the popper is wrong, you can try to set this prop to false | boolean | - | false | -| popper-options | Customized popper option see more at [popper.js](https://popper.js.org/documentation.html) | object | - | - | -| automatic-dropdown | for non-filterable Select, this prop decides if the option menu pops up when the input is focused | boolean | - | false | -| clear-icon | Customized clear icon component | string / Component | — | CircleClose | -| height | The height of the dropdown panel, 34px for each item | number | - | 170 | -| scrollbar-always-on | Controls whether the scrollbar is always displayed | boolean | - | false | +| Param | Description | Type | Accepted Values | Default | +| --------------------- | --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | ------------------- | ------------- | +| model-value / v-model | biding value | string / number / boolean / object | — | — | +| multiple | is multiple | boolean | — | false | +| disabled | is disabled | boolean | — | false | +| value-key | unique identity key name for value, required when value is an object | string | — | value | +| size | input box size | string | large/default/small | default | +| clearable | whether select can be cleared | boolean | — | false | +| collapse-tags | whether to collapse tags to a text when multiple selecting | boolean | — | false | +| multiple-limit | maximum number of options user can select when multiple is true. No limit when set to 0 | number | — | 0 | +| name | the name attribute of select input | string | — | — | +| autocomplete | select input 的 autocomplete 属性 | string | — | off | +| placeholder | the autocomplete attribute of select input | string | — | Please select | +| filterable | is filterable | boolean | — | false | +| allow-create | whether creating new items is allowed. To use this, `filterable` must be true | boolean | — | false | +| no-data-text | displayed text when there is no options, you can also use slot empty | string | — | No Data | +| popper-class | custom class name for Select's dropdown | string | — | — | +| popper-append-to-body | whether to append the popper menu to body. If the positioning of the popper is wrong, you can try to set this prop to false | boolean | - | false | +| popper-options | Customized popper option see more at [popper.js](https://popper.js.org/documentation.html) | object | - | - | +| automatic-dropdown | for non-filterable Select, this prop decides if the option menu pops up when the input is focused | boolean | - | false | +| clear-icon | Customized clear icon component | string / Component | — | CircleClose | +| height | The height of the dropdown panel, 34px for each item | number | - | 170 | +| scrollbar-always-on | Controls whether the scrollbar is always displayed | boolean | - | false | @@ -166,7 +166,7 @@ select-v2/remote-search ## SelectV2 Slots -| name | 说明 | +| name | 说明 | | ------- | ------------------ | | default | Option renderer | | empty | 无 Option 时的列表 | diff --git a/docs/en-US/component/select.md b/docs/en-US/component/select.md index 8e0447a9fc..dd8408f937 100644 --- a/docs/en-US/component/select.md +++ b/docs/en-US/component/select.md @@ -123,7 +123,7 @@ If the binding value of Select is an object, make sure to assign `value-key` as | multiple | whether multiple-select is activated | boolean | — | false | | disabled | whether Select is disabled | boolean | — | false | | value-key | unique identity key name for value, required when value is an object | string | — | value | -| size | size of Input | string | large/medium/small/mini | large | +| size | size of Input | string | large/default/small | default | | clearable | whether select can be cleared | boolean | — | false | | collapse-tags | whether to collapse tags to a text when multiple selecting | boolean | — | false | | multiple-limit | maximum number of options user can select when `multiple` is `true`. No limit when set to 0 | number | — | 0 | diff --git a/docs/en-US/component/slider.md b/docs/en-US/component/slider.md index b2698bec6a..ae46a83c36 100644 --- a/docs/en-US/component/slider.md +++ b/docs/en-US/component/slider.md @@ -88,26 +88,26 @@ slider/show-marks ## Attributes -| Attribute | Description | Type | Accepted Values | Default | -| --------------------- | --------------------------------------------------------------------------------------------------------- | --------------- | ----------------------------- | ------- | -| model-value / v-model | binding value | number | — | 0 | -| min | minimum value | number | — | 0 | -| max | maximum value | number | — | 100 | -| disabled | whether Slider is disabled | boolean | — | false | -| step | step size | number | — | 1 | -| show-input | whether to display an input box, works when `range` is false | boolean | — | false | -| show-input-controls | whether to display control buttons when `show-input` is true | boolean | — | true | -| input-size | size of the input box | string | large / medium / small / mini | small | -| show-stops | whether to display breakpoints | boolean | — | false | -| show-tooltip | whether to display tooltip value | boolean | — | true | -| format-tooltip | format to display tooltip value | function(value) | — | — | -| range | whether to select a range | boolean | — | false | -| vertical | vertical mode | boolean | — | false | -| height | Slider height, required in vertical mode | string | — | — | -| label | label for screen reader | string | — | — | -| debounce | debounce delay when typing, in milliseconds, works when `show-input` is true | number | — | 300 | -| tooltip-class | custom class name for the tooltip | string | — | — | -| marks | marks, type of key must be `number` and must in closed interval `[min, max]`, each mark can custom style | object | — | — | +| Attribute | Description | Type | Accepted Values | Default | +| --------------------- | --------------------------------------------------------------------------------------------------------- | --------------- | ---------------------- | ------- | +| model-value / v-model | binding value | number | — | 0 | +| min | minimum value | number | — | 0 | +| max | maximum value | number | — | 100 | +| disabled | whether Slider is disabled | boolean | — | false | +| step | step size | number | — | 1 | +| show-input | whether to display an input box, works when `range` is false | boolean | — | false | +| show-input-controls | whether to display control buttons when `show-input` is true | boolean | — | true | +| input-size | size of the input box | string | large / default /small | default | +| show-stops | whether to display breakpoints | boolean | — | false | +| show-tooltip | whether to display tooltip value | boolean | — | true | +| format-tooltip | format to display tooltip value | function(value) | — | — | +| range | whether to select a range | boolean | — | false | +| vertical | vertical mode | boolean | — | false | +| height | Slider height, required in vertical mode | string | — | — | +| label | label for screen reader | string | — | — | +| debounce | debounce delay when typing, in milliseconds, works when `show-input` is true | number | — | 300 | +| tooltip-class | custom class name for the tooltip | string | — | — | +| marks | marks, type of key must be `number` and must in closed interval `[min, max]`, each mark can custom style | object | — | — | ## Events diff --git a/docs/en-US/component/space.md b/docs/en-US/component/space.md index edcf8e66b2..c24ad95e4a 100644 --- a/docs/en-US/component/space.md +++ b/docs/en-US/component/space.md @@ -31,7 +31,7 @@ space/vertical-layout Control the space size via `size` API. -You can set the size with built-in sizes `mini`, `small`, `medium`, `large`, these size coresponds to `4px`, `8px`, `12px`, `16px`. The default size is `small`, A.K.A. `8px` +You can set the size with built-in sizes `small`, `default`, `large`, these size coresponds to `4px`, `8px`, `12px`, `16px`. The default size is `small`, A.K.A. `8px` You can also using customized size to override it. Refer to the next part. diff --git a/docs/en-US/component/tag.md b/docs/en-US/component/tag.md index 62d0715884..e15f0d8622 100644 --- a/docs/en-US/component/tag.md +++ b/docs/en-US/component/tag.md @@ -37,7 +37,7 @@ tag/editable Besides default size, Tag component provides three additional sizes for you to choose among different scenarios. -:::demo Use attribute `size` to set additional sizes with `medium`, `small` or `mini`. +:::demo Use attribute `size` to set additional sizes with `large`, `default` or `small`. tag/sizes @@ -72,7 +72,7 @@ tag/checkable | disable-transitions | whether to disable animations | boolean | — | false | | hit | whether Tag has a highlighted border | boolean | — | false | | color | background color of the Tag | string | — | — | -| size | tag size | string | medium / small / mini | — | +| size | tag size | string | large / default /small | default | | effect | component theme | string | dark / light / plain | light | ## Events diff --git a/docs/en-US/component/time-picker.md b/docs/en-US/component/time-picker.md index 75fe3ebdbf..0579fd48bb 100644 --- a/docs/en-US/component/time-picker.md +++ b/docs/en-US/component/time-picker.md @@ -36,7 +36,7 @@ time-picker/range | disabled | whether TimePicker is disabled | boolean | — | false | | editable | whether the input is editable | boolean | — | true | | clearable | whether to show clear button | boolean | — | true | -| size | size of Input | string | medium / small / mini | — | +| size | size of Input | string | large / default / small | — | | placeholder | placeholder in non-range mode | string | — | — | | start-placeholder | placeholder for the start time in range mode | string | — | — | | end-placeholder | placeholder for the end time in range mode | string | — | — | diff --git a/docs/en-US/component/time-select.md b/docs/en-US/component/time-select.md index e953916bf0..deb637fc52 100644 --- a/docs/en-US/component/time-select.md +++ b/docs/en-US/component/time-select.md @@ -29,22 +29,22 @@ time-select/time-range ## Attributes -| Attribute | Description | Type | Accepted Values | Default | -| --------------------- | -------------------------------------------------------- | ------------------ | --------------------- | ----------- | -| model-value / v-model | binding value | string | — | — | -| disabled | whether TimeSelect is disabled | boolean | — | false | -| editable | whether the input is editable | boolean | — | true | -| clearable | whether to show clear button | boolean | — | true | -| size | size of Input | string | medium / small / mini | — | -| placeholder | placeholder in non-range mode | string | — | — | -| name | same as `name` in native input | string | — | — | -| prefix-icon | Custom prefix icon component | string / Component | — | Clock | -| clear-icon | Custom clear icon component | string / Component | — | CircleClose | -| start | start time | string | — | 09:00 | -| end | end time | string | — | 18:00 | -| step | time step | string | — | 00:30 | -| min-time | minimum time, any time before this time will be disabled | string | — | 00:00 | -| max-time | maximum time, any time after this time will be disabled | string | — | — | +| Attribute | Description | Type | Accepted Values | Default | +| --------------------- | -------------------------------------------------------- | ------------------ | ----------------------- | ----------- | +| model-value / v-model | binding value | string | — | — | +| disabled | whether TimeSelect is disabled | boolean | — | false | +| editable | whether the input is editable | boolean | — | true | +| clearable | whether to show clear button | boolean | — | true | +| size | size of Input | string | large / default / small | default | +| placeholder | placeholder in non-range mode | string | — | — | +| name | same as `name` in native input | string | — | — | +| prefix-icon | Custom prefix icon component | string / Component | — | Clock | +| clear-icon | Custom clear icon component | string / Component | — | CircleClose | +| start | start time | string | — | 09:00 | +| end | end time | string | — | 18:00 | +| step | time step | string | — | 00:30 | +| min-time | minimum time, any time before this time will be disabled | string | — | 00:00 | +| max-time | maximum time, any time after this time will be disabled | string | — | — | ## Events diff --git a/docs/examples/avatar/basic.vue b/docs/examples/avatar/basic.vue index f5a848d885..d828234032 100644 --- a/docs/examples/avatar/basic.vue +++ b/docs/examples/avatar/basic.vue @@ -34,7 +34,7 @@ export default defineComponent({ 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png', squareUrl: 'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png', - sizeList: ['large', 'medium', 'small'], + sizeList: ['large', 'default', 'small'], }) return { diff --git a/docs/examples/button/basic.vue b/docs/examples/button/basic.vue index 6125b1dbaf..cc2f676db9 100644 --- a/docs/examples/button/basic.vue +++ b/docs/examples/button/basic.vue @@ -36,6 +36,7 @@ + + + diff --git a/docs/examples/checkbox/basic.vue b/docs/examples/checkbox/basic.vue index f85e328eed..55ecb82f18 100644 --- a/docs/examples/checkbox/basic.vue +++ b/docs/examples/checkbox/basic.vue @@ -1,28 +1,16 @@ - - + + - - + + - - - - diff --git a/docs/examples/input-number/size.vue b/docs/examples/input-number/size.vue index f8f97d7f5f..c1c5f282bc 100644 --- a/docs/examples/input-number/size.vue +++ b/docs/examples/input-number/size.vue @@ -1,25 +1,13 @@ - - + + - - diff --git a/docs/examples/input/autocomplete.vue b/docs/examples/input/autocomplete.vue index db69a694c8..9609df49a5 100644 --- a/docs/examples/input/autocomplete.vue +++ b/docs/examples/input/autocomplete.vue @@ -1,7 +1,9 @@ - + - list suggestions when activated + + list suggestions when activated + - list suggestions on input + + list suggestions on input + - - - - + + + + + + + + - - - diff --git a/docs/examples/input/with-icon.vue b/docs/examples/input/with-icon.vue index 74b9054cba..f8e1519498 100644 --- a/docs/examples/input/with-icon.vue +++ b/docs/examples/input/with-icon.vue @@ -1,33 +1,34 @@ - Using attributes + Using attributes - - - Using slots - + Using slots + - - - - + @@ -44,14 +45,3 @@ const input2 = ref('') const input3 = ref('') const input4 = ref('') - - diff --git a/docs/examples/popover/nested-operation.vue b/docs/examples/popover/nested-operation.vue index c758842c3c..04cd8258e0 100644 --- a/docs/examples/popover/nested-operation.vue +++ b/docs/examples/popover/nested-operation.vue @@ -2,10 +2,10 @@ Are you sure to delete this? - cancel - confirm diff --git a/docs/examples/radio/basic-usage.vue b/docs/examples/radio/basic-usage.vue index a3a65deef5..6f3469698c 100644 --- a/docs/examples/radio/basic-usage.vue +++ b/docs/examples/radio/basic-usage.vue @@ -1,20 +1,16 @@ - Option 1 - Option 2 + Option 1 + Option 2 - Option 1 - Option 2 + Option 1 + Option 2 Option 1 Option 2 - - Option 1 - Option 2 - + + diff --git a/docs/examples/select-v2/remote-search.vue b/docs/examples/select-v2/remote-search.vue index 2247433804..dad8008b51 100644 --- a/docs/examples/select-v2/remote-search.vue +++ b/docs/examples/select-v2/remote-search.vue @@ -3,7 +3,6 @@ v-model="value" style="width: 240px" multiple - size="medium" filterable remote :remote-method="remoteMethod" diff --git a/docs/examples/select/basic-usage.vue b/docs/examples/select/basic-usage.vue index 959b7653d2..765579310a 100644 --- a/docs/examples/select/basic-usage.vue +++ b/docs/examples/select/basic-usage.vue @@ -1,5 +1,23 @@ - + + + + + + + + + + + + + + + diff --git a/docs/examples/space/control-size.vue b/docs/examples/space/control-size.vue index 06b4dbc0c7..355ea8748c 100644 --- a/docs/examples/space/control-size.vue +++ b/docs/examples/space/control-size.vue @@ -1,9 +1,8 @@ - mini small - medium + default large @@ -27,7 +26,7 @@ export default { data() { return { - size: 'mini', + size: 'small', } }, } diff --git a/docs/examples/table/custom-column.vue b/docs/examples/table/custom-column.vue index 72e6f9421d..18c6dbb311 100644 --- a/docs/examples/table/custom-column.vue +++ b/docs/examples/table/custom-column.vue @@ -15,7 +15,7 @@ - {{ scope.row.name }} + {{ scope.row.name }} @@ -23,11 +23,11 @@ - Edit Delete - + - Edit Delete Tag 1 - Tag 2 - Tag 3 - Tag 4 - Tag 5 + Tag 2 + Tag 3 + Tag 4 + Tag 5 diff --git a/docs/examples/tag/editable.vue b/docs/examples/tag/editable.vue index bf6add7b66..36200317bd 100644 --- a/docs/examples/tag/editable.vue +++ b/docs/examples/tag/editable.vue @@ -2,6 +2,7 @@ - + New Tag + + + New Tag + - - - diff --git a/docs/examples/tag/removable.vue b/docs/examples/tag/removable.vue index 7c9ba5f087..f63267d909 100644 --- a/docs/examples/tag/removable.vue +++ b/docs/examples/tag/removable.vue @@ -1,5 +1,11 @@ - + {{ tag.name }} diff --git a/docs/examples/tag/sizes.vue b/docs/examples/tag/sizes.vue index 0d6675c05d..f2f643d660 100644 --- a/docs/examples/tag/sizes.vue +++ b/docs/examples/tag/sizes.vue @@ -1,6 +1,5 @@ - Default - Medium - Small - Mini + Large + Default + Small diff --git a/docs/examples/tag/theme.vue b/docs/examples/tag/theme.vue index 743df0a2c0..25e301eb0d 100644 --- a/docs/examples/tag/theme.vue +++ b/docs/examples/tag/theme.vue @@ -1,20 +1,22 @@ - - Dark + + Dark {{ item.label }} - - Plain + + Plain @@ -38,13 +40,3 @@ export default { }, } - - diff --git a/docs/examples/typography/convention.vue b/docs/examples/typography/convention.vue index 72a5b01c17..63f563fb44 100644 --- a/docs/examples/typography/convention.vue +++ b/docs/examples/typography/convention.vue @@ -12,59 +12,53 @@ :style="`font-size: var(--el-font-size-${fontSize.type})`" > {{ fontSize.level }} - {{ fontSize.size + ' ' + formatType(fontSize.type) }} + + {{ + useCssVar(`--el-font-size-${fontSize.type}`).value + + ' ' + + formatType(fontSize.type) + }} + Build with Element - diff --git a/docs/package.json b/docs/package.json index c210aae927..15e82bdc34 100644 --- a/docs/package.json +++ b/docs/package.json @@ -9,7 +9,7 @@ "crowdin-credentials": "sucrase-node .vitepress/build/crowdin-credentials.ts" }, "dependencies": { - "@vueuse/core": "7.2.2", + "@vueuse/core": "7.3.0", "axios": "0.24.0", "clipboard-copy": "4.0.1", "element-plus": "npm:element-plus@latest", @@ -20,9 +20,11 @@ "@crowdin/cli": "3.7.2", "@types/markdown-it": "12.2.3", "cross-env": "7.0.3", + "escape-html": "^1.0.3", "markdown-it": "12.3.0", "markdown-it-container": "3.0.0", "vite-plugin-inspect": "0.3.11", - "vitepress": "0.18.1" + "vite-plugin-windicss": "^1.5.1", + "vitepress": "0.20.5" } } diff --git a/docs/vite.config.ts b/docs/vite.config.ts index 516e63e1a8..f193687e74 100644 --- a/docs/vite.config.ts +++ b/docs/vite.config.ts @@ -1,6 +1,7 @@ import path from 'path' import Inspect from 'vite-plugin-inspect' import { defineConfig } from 'vite' +import WindiCSS from 'vite-plugin-windicss' import { projRoot } from './.vitepress/utils/paths' import type { Alias } from 'vite' @@ -29,7 +30,16 @@ export default defineConfig({ resolve: { alias, }, - plugins: [Inspect()], + build: { + rollupOptions: { + output: { + manualChunks: { + windicss: ['windicss'], + }, + }, + }, + }, + plugins: [WindiCSS(), Inspect()], optimizeDeps: { include: [ 'vue', diff --git a/docs/windi.config.ts b/docs/windi.config.ts new file mode 100644 index 0000000000..adcac5b31b --- /dev/null +++ b/docs/windi.config.ts @@ -0,0 +1,28 @@ +import { defineConfig } from 'windicss/helpers' + +import colors from 'windicss/colors' + +export default defineConfig({ + // https://windicss.org/guide/extractions.html + extract: { + include: [ + '**/*.md', + '.vitepress/vitepress/**/*.{md,vue}', + 'examples/**/*.{md,vue}', + ], + }, + darkMode: 'class', + // https://windicss.org/posts/v30.html#attributify-mode + attributify: true, + + theme: { + extend: { + colors: { + primary: { + DEFAULT: colors.blue[600], + deep: colors.blue[700], + }, + }, + }, + }, +}) diff --git a/package.json b/package.json index 05c9b69f55..0427b31e6f 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@element-plus/tokens": "workspace:*", "@element-plus/utils": "workspace:*", "@popperjs/core": "^2.10.2", - "@vueuse/core": "^7.0.0", + "@vueuse/core": "^7.3.0", "async-validator": "^4.0.7", "dayjs": "^1.10.7", "lodash": "^4.17.21", @@ -83,7 +83,7 @@ "@types/sass": "1.43.1", "@typescript-eslint/eslint-plugin": "5.6.0", "@typescript-eslint/parser": "5.6.0", - "@vue/compiler-sfc": "3.2.24", + "@vue/compiler-sfc": "3.2.26", "@vue/test-utils": "2.0.0-rc.16", "chalk": "4.1.2", "components-helper": "1.0.5", diff --git a/packages/components/avatar/__tests__/avatar.spec.ts b/packages/components/avatar/__tests__/avatar.spec.ts index a99bdcfa05..5a55de76c0 100644 --- a/packages/components/avatar/__tests__/avatar.spec.ts +++ b/packages/components/avatar/__tests__/avatar.spec.ts @@ -21,7 +21,7 @@ describe('Avatar.vue', () => { const wrapper = mount(Avatar, { props: { size: 50 }, }) - expect(wrapper.attributes('style')).toContain('height: 50px') + expect(wrapper.attributes('style')).toContain('--el-avatar-size: 50px;') }) test('size is string', () => { diff --git a/packages/components/avatar/src/avatar.ts b/packages/components/avatar/src/avatar.ts index 306860ec66..c3d224cb2f 100644 --- a/packages/components/avatar/src/avatar.ts +++ b/packages/components/avatar/src/avatar.ts @@ -5,7 +5,7 @@ import type { ObjectFitProperty } from 'csstype' export const avatarProps = buildProps({ size: { type: [Number, String], - values: ['large', 'medium', 'small'], + values: ['large', 'default', 'small'], default: 'large', validator: (val: unknown): val is number => typeof val === 'number', }, diff --git a/packages/components/avatar/src/avatar.vue b/packages/components/avatar/src/avatar.vue index a8e7af5617..072b78a666 100644 --- a/packages/components/avatar/src/avatar.vue +++ b/packages/components/avatar/src/avatar.vue @@ -8,7 +8,9 @@ :style="fitStyle" @error="handleError" /> - + + + @@ -44,9 +46,7 @@ export default defineComponent({ const { size } = props return typeof size === 'number' ? { - height: `${size}px`, - width: `${size}px`, - lineHeight: `${size}px`, + '--el-avatar-size': `${size}px`, } : {} }) diff --git a/packages/components/button/__tests__/button.spec.ts b/packages/components/button/__tests__/button.spec.ts index aa100a4d1e..0f058f8daf 100644 --- a/packages/components/button/__tests__/button.spec.ts +++ b/packages/components/button/__tests__/button.spec.ts @@ -35,9 +35,9 @@ describe('Button.vue', () => { }) it('size', () => { const wrapper = mount(Button, { - props: { size: 'medium' }, + props: { size: 'default' }, }) - expect(wrapper.classes()).toContain('el-button--medium') + expect(wrapper.classes()).toContain('el-button--default') }) it('plain', () => { const wrapper = mount(Button, { @@ -132,7 +132,6 @@ describe('Button Group', () => { h(ButtonGroup, { size: size.value }, () => [ h(Button, { type: 'primary' }, () => 'Prev'), h(Button, { type: 'primary' }, () => 'Next'), - h(Button, { type: 'primary', size: 'mini' }, () => 'Mini'), ]) }, }) @@ -140,19 +139,13 @@ describe('Button Group', () => { expect( wrapper.findAll('.el-button-group button.el-button--small').length ).toBe(2) - expect( - wrapper.findAll('.el-button-group button.el-button--mini').length - ).toBe(1) - size.value = 'medium' + size.value = 'default' await nextTick() expect( - wrapper.findAll('.el-button-group button.el-button--medium').length + wrapper.findAll('.el-button-group button.el-button--default').length ).toBe(2) - expect( - wrapper.findAll('.el-button-group button.el-button--mini').length - ).toBe(1) }) it('button group type', async () => { diff --git a/packages/components/button/src/button.ts b/packages/components/button/src/button.ts index 1db79ebd42..acb69a9a77 100644 --- a/packages/components/button/src/button.ts +++ b/packages/components/button/src/button.ts @@ -13,7 +13,7 @@ export const buttonType = [ 'text', '', ] as const -export const buttonSize = ['', 'large', 'medium', 'small', 'mini'] as const +export const buttonSize = ['', 'large', 'default', 'small'] as const export const buttonNativeType = ['button', 'submit', 'reset'] as const export const buttonProps = buildProps({ diff --git a/packages/components/cascader/src/index.vue b/packages/components/cascader/src/index.vue index 7a9788a551..e0f21d3e0e 100644 --- a/packages/components/cascader/src/index.vue +++ b/packages/components/cascader/src/index.vue @@ -200,9 +200,9 @@ type suggestionPanelType = InstanceType const DEFAULT_INPUT_HEIGHT = 40 const INPUT_HEIGHT_MAP = { - medium: 36, - small: 32, - mini: 28, + large: 36, + default: 32, + small: 28, } const popperOptions: Partial = { @@ -324,7 +324,7 @@ export default defineComponent({ ) const realSize = useSize() const tagSize = computed(() => - ['small', 'mini'].includes(realSize.value) ? 'mini' : 'small' + ['small'].includes(realSize.value) ? 'small' : '' ) const multiple = computed(() => !!props.props.multiple) const readonly = computed(() => !props.filterable || multiple.value) diff --git a/packages/components/checkbox/__tests__/checkbox.spec.ts b/packages/components/checkbox/__tests__/checkbox.spec.ts index f30d5393cd..4d54b1934b 100644 --- a/packages/components/checkbox/__tests__/checkbox.spec.ts +++ b/packages/components/checkbox/__tests__/checkbox.spec.ts @@ -87,6 +87,7 @@ describe('Checkbox', () => { expect(vm.checkList.length).toBe(0) await wrapper.findComponent({ ref: 'a' }).trigger('click') expect(vm.checkList.length).toBe(1) + expect(vm.checkList).toContain('a') await wrapper.findComponent({ ref: 'b' }).trigger('click') expect(vm.checkList.length).toBe(2) diff --git a/packages/components/color-picker/src/index.vue b/packages/components/color-picker/src/index.vue index ef7c72c051..6434ded9b5 100644 --- a/packages/components/color-picker/src/index.vue +++ b/packages/components/color-picker/src/index.vue @@ -31,13 +31,13 @@ @@ -74,20 +74,21 @@ :style="{ backgroundColor: displayedColor, }" - > - - - + + + + + + + - - - diff --git a/packages/components/date-picker/src/date-picker-com/panel-date-pick.vue b/packages/components/date-picker/src/date-picker-com/panel-date-pick.vue index 6f117a27cf..c3ba8f58cb 100644 --- a/packages/components/date-picker/src/date-picker-com/panel-date-pick.vue +++ b/packages/components/date-picker/src/date-picker-com/panel-date-pick.vue @@ -142,7 +142,7 @@ > diff --git a/packages/components/date-picker/src/date-picker-com/panel-date-range.vue b/packages/components/date-picker/src/date-picker-com/panel-date-range.vue index 46002c8ab5..0b4ac089f0 100644 --- a/packages/components/date-picker/src/date-picker-com/panel-date-range.vue +++ b/packages/components/date-picker/src/date-picker-com/panel-date-range.vue @@ -212,7 +212,7 @@
Are you sure to delete this?