diff --git a/README.md b/README.md index 6a57dc5ac..229b2efc2 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ As is. Dark theme included. Theme can be changed seamlessly. > When you find that the UI drafts are already in dark mode, you can't start with light theme. But if you start to build a dark mode UI, sooner or later you have to build a light themed UI. As a result, Naive UI has both of them. ### Batteries Included -More than 60 components. Utils for building themed components are provided. +There are more than 60 components. Utils for building themed component are provided. ## License Naive UI is licensed under the [MIT license](https://opensource.org/licenses/MIT). diff --git a/demo/documentation/components/alert/enUS/index.md b/demo/documentation/components/alert/enUS/index.md index ac8957218..b849331e7 100644 --- a/demo/documentation/components/alert/enUS/index.md +++ b/demo/documentation/components/alert/enUS/index.md @@ -10,6 +10,8 @@ no-icon ## Props |Name|Type|Default|Description| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| +|themed-style|`{ [themeName: string]: object }`|`null`|| |title|`string`|`null`|| |show-icon|`string`|`true`|| |type|`'default' \| 'info' \| 'success' \| 'warning' \| 'error'`|`'default'`|| diff --git a/demo/documentation/components/alert/zhCN/index.md b/demo/documentation/components/alert/zhCN/index.md index f68b9f264..0113cfd0b 100644 --- a/demo/documentation/components/alert/zhCN/index.md +++ b/demo/documentation/components/alert/zhCN/index.md @@ -10,6 +10,8 @@ no-icon ## Props |名称|类型|默认值|说明| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| +|themed-style|`{ [themeName: string]: object }`|`null`|| |title|`string`|`null`|| |show-icon|`string`|`true`|| |type|`'default' \| 'info' \| 'success' \| 'warning' \| 'error'`|`'default'`|| diff --git a/demo/documentation/components/autoComplete/enUS/group.md b/demo/documentation/components/autoComplete/enUS/group.md new file mode 100644 index 000000000..4e4815f24 --- /dev/null +++ b/demo/documentation/components/autoComplete/enUS/group.md @@ -0,0 +1,30 @@ +# Group +```html + +``` +```js +export default { + computed: { + options () { + return [ + ['Google', '@gmail.com'], + ['Netease', '@163.com'], + ['Tencent', '@qq.com'] + ].map(emailInfo => { + return { + type: 'group', + name: emailInfo[0], + children: [ + this.value.split('@')[0] + emailInfo[1] + ] + } + }) + } + }, + data () { + return { + value: '' + } + } +} +``` diff --git a/demo/documentation/components/autoComplete/enUS/index.md b/demo/documentation/components/autoComplete/enUS/index.md index 6a31d1bcf..6a0150943 100644 --- a/demo/documentation/components/autoComplete/enUS/index.md +++ b/demo/documentation/components/autoComplete/enUS/index.md @@ -4,6 +4,7 @@ Use as search hint or something similar. ```demo basic size +group custom-input after-select ``` @@ -15,14 +16,14 @@ after-select ## Props |Name|Type|Default|Description| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |size|`'small' \| 'medium' \| 'large'`|`'medium'`|| |value|`string`|`null`|| -|options|`Array`|`[]`|| +|options|`Array`|`[]`|| |placeholder|`string`|`null`|| |blur-after-select|`boolean`|`false`|| |clear-after-select|`boolean`|`false`|| -## API ### AutoCompleteOption Type |Property|Type|Description| |-|-|-| @@ -36,12 +37,12 @@ after-select |-|-|-| |type|`'group'`|| |name|`string`|| -|children|`Array`|| +|children|`Array`|| ## Slots |Name|Parameters|Description| |-|-|-| -|default|`({ handleInput: (value: string) => any, handleFocus: function, handleBlur: function, value: string })`|| +|default|`({ handleInput: (value: string) => any, handleFocus: function, handleBlur: function, value: string, theme: string \| null })`|| ## Events |Name|Parameters|Description| diff --git a/demo/documentation/components/autoComplete/zhCN/group.md b/demo/documentation/components/autoComplete/zhCN/group.md new file mode 100644 index 000000000..d61208368 --- /dev/null +++ b/demo/documentation/components/autoComplete/zhCN/group.md @@ -0,0 +1,30 @@ +# 成组 +```html + +``` +```js +export default { + computed: { + options () { + return [ + ['谷歌', '@gmail.com'], + ['网易', '@163.com'], + ['腾讯', '@qq.com'] + ].map(emailInfo => { + return { + type: 'group', + name: emailInfo[0], + children: [ + this.value.split('@')[0] + emailInfo[1] + ] + } + }) + } + }, + data () { + return { + value: '' + } + } +} +``` diff --git a/demo/documentation/components/autoComplete/zhCN/index.md b/demo/documentation/components/autoComplete/zhCN/index.md index 0540631c3..32550c354 100644 --- a/demo/documentation/components/autoComplete/zhCN/index.md +++ b/demo/documentation/components/autoComplete/zhCN/index.md @@ -4,6 +4,7 @@ ```demo basic size +group custom-input after-select ``` @@ -16,17 +17,33 @@ after-select ## Props |名称|类型|默认值|说明| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |size|`'small' \| 'medium' \| 'large'`|`'medium'`|| |value|`string`|`null`|| -|options|`Array`|`[]`|| +|options|`Array`|`[]`|| |placeholder|`string`|`null`|| |blur-after-select|`boolean`|`false`|| |clear-after-select|`boolean`|`false`|| +### AutoCompleteOption Type +|属性|类型|介绍| +|-|-|-| +|label|`string`|| +|value|`string \| number`|Should be unique in options.| +|disabled|`boolean`|| +|render|`function`|| + +### AutoCompleteOptionGroup Type +|属性|类型|介绍| +|-|-|-| +|type|`'group'`|| +|name|`string`|| +|children|`Array`|| + ## Slots |名称|参数|说明| |-|-|-| -|default|`({ handleInput: (value: string) => any, handleFocus: function, handleBlur: function, value: string })`|| +|default|`({ handleInput: (value: string) => any, handleFocus: function, handleBlur: function, value: string, theme: string \| null })`|| ## Events |名称|参数|说明| diff --git a/demo/documentation/components/badge/enUS/basic.md b/demo/documentation/components/badge/enUS/basic.md index 9be9c9f4e..9738f3a22 100644 --- a/demo/documentation/components/badge/enUS/basic.md +++ b/demo/documentation/components/badge/enUS/basic.md @@ -1,10 +1,10 @@ # Basic ```html -
+ -
+ @@ -37,16 +37,6 @@ export default { ``` ```css .n-badge { - margin: 0 32px 8px 0; -} -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); + margin: 0 32px 12px 0; } ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/enUS/customContent.md b/demo/documentation/components/badge/enUS/customContent.md index 082cd148e..1c8c33aba 100644 --- a/demo/documentation/components/badge/enUS/customContent.md +++ b/demo/documentation/components/badge/enUS/customContent.md @@ -2,24 +2,14 @@ Insert some custom content in it. ```html -
+ -
+ ``` ```css .n-badge { margin: 0 32px 8px 0; } -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/enUS/index.md b/demo/documentation/components/badge/enUS/index.md index 204c7048d..137001e44 100644 --- a/demo/documentation/components/badge/enUS/index.md +++ b/demo/documentation/components/badge/enUS/index.md @@ -14,6 +14,8 @@ raw ## Props |Name|Type|Default|Description| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| +|themed-style|`{ [themeName: string]: object }`|`null`|| |value|`string \| number`|`null`|| |max|`number`|`null`|| |dot|`boolean`|`false`|| diff --git a/demo/documentation/components/badge/enUS/manual.md b/demo/documentation/components/badge/enUS/manual.md index 203fb7bc8..9463e0f18 100644 --- a/demo/documentation/components/badge/enUS/manual.md +++ b/demo/documentation/components/badge/enUS/manual.md @@ -1,11 +1,11 @@ # Controlled Display ```html -
+
-
+ -
+ @@ -43,21 +43,8 @@ export default { .n-badge { margin: 0 32px 0px 0; } -.demo { +.badge-demo { display: flex; align-items: center; } -.n-button-group { - margin: 0 12px 0 0; -} -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/enUS/overflow.md b/demo/documentation/components/badge/enUS/overflow.md index 7f031f9f9..6d096d976 100644 --- a/demo/documentation/components/badge/enUS/overflow.md +++ b/demo/documentation/components/badge/enUS/overflow.md @@ -2,16 +2,16 @@ Set `max` prop to handle overflow situation. ```html -
+ -
+ -
+ -
+ @@ -46,14 +46,4 @@ export default { .n-badge { margin: 0 32px 8px 0; } -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/enUS/processing.md b/demo/documentation/components/badge/enUS/processing.md index 45bb246da..d498298ab 100644 --- a/demo/documentation/components/badge/enUS/processing.md +++ b/demo/documentation/components/badge/enUS/processing.md @@ -2,27 +2,17 @@ Set `processing` prop to indicate it is processing. ```html -
+ -
+ -
+ ``` ```css .n-badge { margin: 0 32px 8px 0; } -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/enUS/raw.md b/demo/documentation/components/badge/enUS/raw.md index 93312809e..86de4d8cf 100644 --- a/demo/documentation/components/badge/enUS/raw.md +++ b/demo/documentation/components/badge/enUS/raw.md @@ -35,14 +35,4 @@ export default { .n-badge { margin: 0 32px 0 0; } -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/enUS/showZero.md b/demo/documentation/components/badge/enUS/showZero.md index 05baf2770..419e6f096 100644 --- a/demo/documentation/components/badge/enUS/showZero.md +++ b/demo/documentation/components/badge/enUS/showZero.md @@ -2,10 +2,10 @@ Set `show-zero` prop to display zero. ```html -
+ -
+ @@ -40,14 +40,4 @@ export default { .n-badge { margin: 0 32px 8px 0; } -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/enUS/type.md b/demo/documentation/components/badge/enUS/type.md index 2ebdb6819..44926daed 100644 --- a/demo/documentation/components/badge/enUS/type.md +++ b/demo/documentation/components/badge/enUS/type.md @@ -2,19 +2,19 @@ Badge has `default`, `error`, `info`, `success`, `warning` types. ```html -
+ -
+ -
+ -
+ -
+ ``` ```js @@ -30,14 +30,4 @@ export default { .n-badge { margin: 0 32px 8px 0; } -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/zhCN/basic.md b/demo/documentation/components/badge/zhCN/basic.md index a98b15e70..e3d2c1c8a 100644 --- a/demo/documentation/components/badge/zhCN/basic.md +++ b/demo/documentation/components/badge/zhCN/basic.md @@ -1,10 +1,10 @@ # 基础用法 ```html -
+ -
+ @@ -39,14 +39,4 @@ export default { .n-badge { margin: 0 32px 8px 0; } -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/zhCN/customContent.md b/demo/documentation/components/badge/zhCN/customContent.md index 034087045..01635e6e9 100644 --- a/demo/documentation/components/badge/zhCN/customContent.md +++ b/demo/documentation/components/badge/zhCN/customContent.md @@ -2,24 +2,14 @@ 在里面插入一些自定义内容。 ```html -
+ -
+ ``` ```css .n-badge { margin: 0 32px 8px 0; } -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/zhCN/index.md b/demo/documentation/components/badge/zhCN/index.md index 766b0ecda..95c8d9fe3 100644 --- a/demo/documentation/components/badge/zhCN/index.md +++ b/demo/documentation/components/badge/zhCN/index.md @@ -14,6 +14,8 @@ raw ## Props |名称|类型|默认值|说明| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| +|themed-style|`{ [themeName: string]: object }`|`null`|| |value|`string \| number`|`null`|| |max|`number`|`null`|| |dot|`boolean`|`false`|| diff --git a/demo/documentation/components/badge/zhCN/manual.md b/demo/documentation/components/badge/zhCN/manual.md index 7ba10ff00..eef667810 100644 --- a/demo/documentation/components/badge/zhCN/manual.md +++ b/demo/documentation/components/badge/zhCN/manual.md @@ -1,11 +1,11 @@ # 受控显示 ```html -
+
-
+ -
+ @@ -43,21 +43,8 @@ export default { .n-badge { margin: 0 32px 0px 0; } -.demo { +.badge-demo { display: flex; align-items: center; } -.n-button-group { - margin: 0 12px 0 0; -} -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/zhCN/overflow.md b/demo/documentation/components/badge/zhCN/overflow.md index ca13ed0e9..c23d72427 100644 --- a/demo/documentation/components/badge/zhCN/overflow.md +++ b/demo/documentation/components/badge/zhCN/overflow.md @@ -2,16 +2,16 @@ 设定 `max` 来处理溢出情况。 ```html -
+ -
+ -
+ -
+ @@ -46,14 +46,4 @@ export default { .n-badge { margin: 0 32px 8px 0; } -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/zhCN/processing.md b/demo/documentation/components/badge/zhCN/processing.md index 5b9dc0d4d..4533993b7 100644 --- a/demo/documentation/components/badge/zhCN/processing.md +++ b/demo/documentation/components/badge/zhCN/processing.md @@ -2,27 +2,17 @@ 设定 `processing` 来表明正在处理。 ```html -
+ -
+ -
+ ``` ```css .n-badge { margin: 0 32px 8px 0; } -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/zhCN/raw.md b/demo/documentation/components/badge/zhCN/raw.md index 986a752de..f36e5bd40 100644 --- a/demo/documentation/components/badge/zhCN/raw.md +++ b/demo/documentation/components/badge/zhCN/raw.md @@ -35,14 +35,4 @@ export default { .n-badge { margin: 0 32px 0 0; } -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/zhCN/showZero.md b/demo/documentation/components/badge/zhCN/showZero.md index 22d7f3cff..93f8b4109 100644 --- a/demo/documentation/components/badge/zhCN/showZero.md +++ b/demo/documentation/components/badge/zhCN/showZero.md @@ -2,10 +2,10 @@ 设定 `show-zero` 来显示 0。 ```html -
+ -
+ @@ -40,14 +40,4 @@ export default { .n-badge { margin: 0 32px 8px 0; } -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/badge/zhCN/type.md b/demo/documentation/components/badge/zhCN/type.md index a54853cc3..d64a57e2a 100644 --- a/demo/documentation/components/badge/zhCN/type.md +++ b/demo/documentation/components/badge/zhCN/type.md @@ -2,19 +2,19 @@ 标记有 `default`、`error`、`info`、`success`、`warning` 类型。 ```html -
+ -
+ -
+ -
+ -
+ ``` ```js @@ -30,14 +30,4 @@ export default { .n-badge { margin: 0 32px 8px 0; } -.block { - width: 32px; - height: 32px; - background-color: #dddddd; - border-radius: 4px; - transition: background-color .3s cubic-bezier(.4, 0, .2, 1); -} -.n-dark-theme .block { - background-color: rgba(255, 255, 255, .15); -} ``` \ No newline at end of file diff --git a/demo/documentation/components/card/zhCN/index.md b/demo/documentation/components/card/zhCN/index.md index 557c1e5ec..d347b3c83 100644 --- a/demo/documentation/components/card/zhCN/index.md +++ b/demo/documentation/components/card/zhCN/index.md @@ -1,5 +1,5 @@ # 卡片 Card -一些经验不足的 UI 设计师喜欢它在上面滥用阴影。 +一些经验不足的 UI 设计师喜欢在它上面滥用阴影。 ## 演示 ```demo basic diff --git a/demo/documentation/components/cascader/enUS/index.md b/demo/documentation/components/cascader/enUS/index.md index a29a980ed..0e6d3bde0 100644 --- a/demo/documentation/components/cascader/enUS/index.md +++ b/demo/documentation/components/cascader/enUS/index.md @@ -26,6 +26,7 @@ filter ## Props |Name|Type|Default|Description| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |options|`Array`|`null`|| |value|`string \| number`|`null`|| |placeholder|`string`|`'Please Select'`|| diff --git a/demo/documentation/components/cascader/zhCN/index.md b/demo/documentation/components/cascader/zhCN/index.md index 99b57038b..8bdbc5006 100644 --- a/demo/documentation/components/cascader/zhCN/index.md +++ b/demo/documentation/components/cascader/zhCN/index.md @@ -27,6 +27,7 @@ filter ## Props |名称|类型|默认值|说明| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |options|`Array`|`null`|| |value|`string \| number`|`null`|| |placeholder|`string`|`'请选择'`|| diff --git a/demo/documentation/components/checkbox/enUS/index.md b/demo/documentation/components/checkbox/enUS/index.md index 307003765..bbb325db2 100644 --- a/demo/documentation/components/checkbox/enUS/index.md +++ b/demo/documentation/components/checkbox/enUS/index.md @@ -24,6 +24,7 @@ event ### Checkbox Props |Name|Type|Default|Description| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |value|`string \| number`|`null`|| |checked|`boolean`|`false`|| |disabled|`boolean`|`false`|| @@ -31,6 +32,7 @@ event ### Checkbox Group Props |Name|Type|Default|Description| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |value|`Array`|`null`|| |disabled|`boolean`|`false`|| diff --git a/demo/documentation/components/checkbox/zhCN/index.md b/demo/documentation/components/checkbox/zhCN/index.md index 6d28d9ff8..2e983748d 100644 --- a/demo/documentation/components/checkbox/zhCN/index.md +++ b/demo/documentation/components/checkbox/zhCN/index.md @@ -24,6 +24,7 @@ event ### Checkbox Props |名称|类型|默认值|说明| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |value|`string \| number`|`null`|| |checked|`boolean`|`false`|| |disabled|`boolean`|`false`|| @@ -31,6 +32,7 @@ event ### Checkbox Group Props |名称|类型|默认值|说明| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |value|`Array`|`null`|| |disabled|`boolean`|`false`|| diff --git a/demo/documentation/components/code/enUS/index.md b/demo/documentation/components/code/enUS/index.md index 6b5a68bc5..6f960efd4 100644 --- a/demo/documentation/components/code/enUS/index.md +++ b/demo/documentation/components/code/enUS/index.md @@ -28,6 +28,7 @@ basic ## Props |Name|Type|Default|Description| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |language|`string`|`null`|| |code|`string`|`null`|| |trim|`boolean`|`true`|| diff --git a/demo/documentation/components/code/zhCN/index.md b/demo/documentation/components/code/zhCN/index.md index 1ebbcf461..b80654bd1 100644 --- a/demo/documentation/components/code/zhCN/index.md +++ b/demo/documentation/components/code/zhCN/index.md @@ -28,6 +28,7 @@ basic ## Props |名称|类型|默认值|说明| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |language|`string`|`null`|| |code|`string`|`null`|| |trim|`boolean`|`true`|| diff --git a/demo/documentation/components/collapse/enUS/index.md b/demo/documentation/components/collapse/enUS/index.md index 838c6b9c1..92f2b9b5a 100644 --- a/demo/documentation/components/collapse/enUS/index.md +++ b/demo/documentation/components/collapse/enUS/index.md @@ -15,6 +15,7 @@ nested ### Collapse |Name|Type|Default|Description| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |expanded-names|`Array`|`null`|| |accordion|`boolean`|`false`|| diff --git a/demo/documentation/components/collapse/zhCN/index.md b/demo/documentation/components/collapse/zhCN/index.md index f539e6681..5bc49b0a0 100644 --- a/demo/documentation/components/collapse/zhCN/index.md +++ b/demo/documentation/components/collapse/zhCN/index.md @@ -15,6 +15,7 @@ nested ### Collapse Props |名称|类型|默认值|说明| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |expanded-names|`Array`|`null`|| |accordion|`boolean`|`false`|| diff --git a/demo/documentation/components/confirm/enUS/async.md b/demo/documentation/components/confirm/enUS/async.md index a8746de3a..f7db53be4 100644 --- a/demo/documentation/components/confirm/enUS/async.md +++ b/demo/documentation/components/confirm/enUS/async.md @@ -21,10 +21,10 @@ export default { content: 'Click and count down 3 second', positiveText: 'Confirm', - onPositiveClick: hide => { + onPositiveClick: () => { confirmInstance.loading = true this.$NMessage.success('Count down 3 second') - window.setTimeout(hide, 3000) + return new Promise(resolve => window.setTimeout(() => resolve(true), 3000)) } }) } diff --git a/demo/documentation/components/confirm/enUS/index.md b/demo/documentation/components/confirm/enUS/index.md index bccee1086..49e450b65 100644 --- a/demo/documentation/components/confirm/enUS/index.md +++ b/demo/documentation/components/confirm/enUS/index.md @@ -29,9 +29,9 @@ use-component |show-icon|`boolean`|`true`|| |loading|`boolean`|`false`|| |bordered|`boolean`|`false`|| -|onPositiveClick|`(hide: function) => any`|`hide => hide()`|| -|onNegativeClick|`(hide: function) => any`|`hide => hide()`| -|onClose|`(hide: function) => any`|`hide => hide()`|| +|onPositiveClick|`() => Promise \| boolean`|`() => true`|The default behavior is closing the confirm. Return `false` or resolve `false` or Promise rejected will prevent the default behavior.| +|onNegativeClick|`() => Promise \| boolean`|`() => true`|The default behavior is closing the confirm. Return `false` or resolve `false` or Promise rejected will prevent the default behavior.| +|onClose|`() => Promise \| boolean`|`() => true`|The default behavior is closing the confirm. Return `false` or resolve `false` or Promise rejected will prevent the default behavior.| ### ConfirmEnvironment API #### ConfirmEnvironment Properties diff --git a/demo/documentation/components/confirm/zhCN/async.md b/demo/documentation/components/confirm/zhCN/async.md index 224d31aad..906314950 100644 --- a/demo/documentation/components/confirm/zhCN/async.md +++ b/demo/documentation/components/confirm/zhCN/async.md @@ -21,10 +21,10 @@ export default { content: '点击,倒计时 3 秒', positiveText: '确认', - onPositiveClick: hide => { + onPositiveClick: () => { confirmInstance.loading = true this.$NMessage.success('倒计时 3 秒') - window.setTimeout(hide, 3000) + return new Promise(resolve => window.setTimeout(() => resolve(true), 3000)) } }) } diff --git a/demo/documentation/components/confirm/zhCN/index.md b/demo/documentation/components/confirm/zhCN/index.md index 5cc8865f8..79e8939c4 100644 --- a/demo/documentation/components/confirm/zhCN/index.md +++ b/demo/documentation/components/confirm/zhCN/index.md @@ -29,9 +29,9 @@ use-component |show-icon|`boolean`|`true`|| |loading|`boolean`|`false`|| |bordered|`boolean`|`false`|| -|onPositiveClick|`(hide: function) => any`|`hide => hide()`|| -|onNegativeClick|`(hide: function) => any`|`hide => hide()`| -|onClose|`(hide: function) => any`|`hide => hide()`|| +|onPositiveClick|`() => Promise \| boolean`|`() => true`|默认行为是关闭确认框。返回 `false` 或者 resolve `false` 或者 Promise 被 reject 会避免默认行为| +|onNegativeClick|`() => Promise \| boolean`|`() => true`|默认行为是关闭确认框。返回 `false` 或者 resolve `false` 或者 Promise 被 reject 会避免默认行为| +|onClose|`() => Promise \| boolean`|`() => true`|默认行为是关闭确认框。返回 `false` 或者 resolve `false` 或者 Promise 被 reject 会避免默认行为| ### ConfirmEnvironment API #### ConfirmEnvironment Properties diff --git a/demo/documentation/components/datePicker/enUS/index.md b/demo/documentation/components/datePicker/enUS/index.md index df5387424..d99894664 100644 --- a/demo/documentation/components/datePicker/enUS/index.md +++ b/demo/documentation/components/datePicker/enUS/index.md @@ -23,6 +23,7 @@ format ### All Types Props |Name|Type|Default|Description| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |value|`number`|`null`|| |actions|`Array<'clear' \| 'now' \| 'confirm'>`|`null`|| |clearable|`boolean`|`false`|| diff --git a/demo/documentation/components/datePicker/zhCN/index.md b/demo/documentation/components/datePicker/zhCN/index.md index 70cff2621..d4bf2eb4e 100644 --- a/demo/documentation/components/datePicker/zhCN/index.md +++ b/demo/documentation/components/datePicker/zhCN/index.md @@ -23,6 +23,7 @@ format ### 通用的 Props |名称|类型|默认值|说明| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| |value|`number`|`null`|| |actions|`Array<'clear' \| 'now' \| 'confirm'>`|`null`|| |clearable|`boolean`|`false`|| diff --git a/demo/documentation/components/drawer/enUS/index.md b/demo/documentation/components/drawer/enUS/index.md index e21f9d1ef..b0a1d4579 100644 --- a/demo/documentation/components/drawer/enUS/index.md +++ b/demo/documentation/components/drawer/enUS/index.md @@ -14,13 +14,19 @@ target ## Props |Name|Parameters|Default|Description| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| +|themed-style|`{ [themeName: string]: object }`|`null`|| |show|`boolean`|`false`|| |placement|`'top' \| 'right' \| 'bottom' \| 'left'`|`'right'`|| |width|`number \| string`|`251`|| |height|`number \| string`|`251`|Works when placement is `top` and `bottom`.| |mask-closable|`boolean`|`true`|Whether to emit `hide` event when click mask.| |drawer-style|`object`|`null`|| +<<<<<<< HEAD |target|`() => HTMLElement`|`null`| +======= +|drawer-class|`string`|`null`|| +>>>>>>> upstream/develop ## Slots |Name|Parameters|Description| diff --git a/demo/documentation/components/drawer/zhCN/index.md b/demo/documentation/components/drawer/zhCN/index.md index 349b42e0b..e830a71d2 100644 --- a/demo/documentation/components/drawer/zhCN/index.md +++ b/demo/documentation/components/drawer/zhCN/index.md @@ -18,13 +18,19 @@ dark-4-debug ## Props |名称|类型|默认值|说明| |-|-|-|-| +|theme|`'light' \| 'dark'`|`null`|| +|themed-style|`{ [themeName: string]: object }`|`null`|| |show|`boolean`|`false`|| |placement|`'top' \| 'right' \| 'bottom' \| 'left'`|`'right'`|| |width|`number \| string`|`251`|| |height|`number \| string`|`251`|在位置是 `top` 和 `bottom` 时生效| |mask-closable|`boolean`|`true`|点击遮罩时是否发出 `hide` 事件| |drawer-style|`object`|`null`|| +<<<<<<< HEAD |target|`() => HTMLElement`|`null`| +======= +|drawer-class|`string`|`null`|| +>>>>>>> upstream/develop ## Slots |名称|参数|说明| diff --git a/demo/documentation/components/dynamicInput/enUS/basic.md b/demo/documentation/components/dynamicInput/enUS/basic.md index 67c01ff10..874b1a97a 100644 --- a/demo/documentation/components/dynamicInput/enUS/basic.md +++ b/demo/documentation/components/dynamicInput/enUS/basic.md @@ -1,28 +1,26 @@ -# Basic +# Use Preset Input +By default, the preset of `n-dynamic-input` is `input`. ```html
-{{  JSON.stringify(test,0,2) }}
+{{  JSON.stringify(value, 0, 2) }}
 
``` ```js export default { data () { return { - test: [ + value: [ + '', + '', '' ] } - }, - methods: { - add (resolve) { - resolve('') - } } } ``` \ No newline at end of file diff --git a/demo/documentation/components/dynamicInput/enUS/custom.md b/demo/documentation/components/dynamicInput/enUS/custom.md index c3df772c8..deb1442c9 100644 --- a/demo/documentation/components/dynamicInput/enUS/custom.md +++ b/demo/documentation/components/dynamicInput/enUS/custom.md @@ -1,52 +1,52 @@ -# Custom +# Custom Input Content ```html -