Skip to content

Commit

Permalink
fix: navigation number itemkey can't expand , close #2316
Browse files Browse the repository at this point in the history
* fix: fixed expansion of itemKey of type number
* chore: update Nav ItemKey type define
* docs: remove uesless version text
* fix: use include to judge isOpen, handle numebr & string in same logic
---------

Co-authored-by: pointhalo <[email protected]>
  • Loading branch information
changlin2569 and pointhalo authored Aug 8, 2024
1 parent 8fa9cc4 commit ef8a3a5
Show file tree
Hide file tree
Showing 12 changed files with 201 additions and 126 deletions.
1 change: 1 addition & 0 deletions .storybook/base/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ module.exports = {
config.resolve.alias = {
'@douyinfe/semi-foundation': resolve('packages/semi-foundation'),
'@douyinfe/semi-icons': resolve('packages/semi-icons/src'),
'@douyinfe/semi-icons-lab': resolve('packages/semi-icons-lab/src'),
'@douyinfe/semi-ui': resolve('packages/semi-ui'),
'@douyinfe/semi-theme-default': resolve('packages/semi-theme-default'),
'@douyinfe/semi-illustrations': resolve('packages/semi-illustrations/src'),
Expand Down
28 changes: 14 additions & 14 deletions content/navigation/navigation/index-en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -760,16 +760,16 @@ function NavApp (props = {}) {

### Nav.Item

| Properties | Description | Type | Default | Version |
| Properties | Description | Type | Default |
| ------------ | ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -------- | ------- |
| disabled | Disabled state | boolean | false | 1.17.0 |
| icon | Navigation project icon name or component | ReactNode | | |
| indent | If the icon is empty, keep its space or not. Only effective for first level navigation | boolean | false | |
| itemKey | Navigation project only key | string | "" | |
| level | The nesting level of the current item. When limitIndent is true, it is used to customize the indentation position | number | | 1.27.0 |
| link | Navigation item href link, when imported, the navigation item will be wrapped with an a tag | string | - | 1.0.0 |
| linkOptions | Parameters transparently passed to the a tag | object | - | 1.0.0 |
| text | Navigation project copy or element | string \| ReactNode | "" | |
| disabled | Disabled state | boolean | false |
| icon | Navigation project icon name or component | ReactNode | |
| indent | If the icon is empty, keep its space or not. Only effective for first level navigation | boolean | false |
| itemKey | Unique item identifier, no duplication allowed | string | "" |
| level | The nesting level of the current item. When limitIndent is true, it is used to customize the indentation position | number | |
| link | Navigation item href link, when imported, the navigation item will be wrapped with an a tag | string | - |
| linkOptions | Parameters transparently passed to the a tag | object | - |
| text | Navigation project copy or element | string \| ReactNode | "" |
| onClick | Callback of click | function({ itemKey: string, domEvent: MouseEvent, isOpen: boolean }) | () => {} |
| onMouseEnter | Callback of mouse enter event | function(e) => {} | () => {} |
| onMouseLeave | Callback of mouse leave event | function(e) => {} | () => {} |
Expand All @@ -778,14 +778,14 @@ function NavApp (props = {}) {

| Properties | Description | Type | Default |
| ------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------- | -------- |
| disabled | Disabled state | boolean | false | 1.17.0 |
| dropdownStyle | Style of dropdown layer | CSSProperties | | |
| disabled | Disabled state | boolean | false |
| dropdownStyle | Style of dropdown layer | CSSProperties | |
| icon | Navigation project icon name or component | ReactNode | |
| indent | If the icon is empty, keep its space or not. Only effective for first level navigation | boolean | false |
| isCollapsed | Whether it is a controlled attribute in the collapsed state, only `mode = "vertical"` | boolean | false |
| isOpen | Control open state | boolean | false |
| itemKey | Navigation project only key | string | "" |
| level | The nesting level of the current item. When limitIndent is true, it is used to customize the indentation position | number | 1.27.0 |
| level | The nesting level of the current item. When limitIndent is true, it is used to customize the indentation position | number | |
| maxHeight | max height | number | 999 |
| text | Navigation project copy or component | string \| ReactNode | "" |
| onMouseEnter | Callback of mouse enter event | function(e) => {} | () => {} |
Expand All @@ -797,8 +797,8 @@ function NavApp (props = {}) {
| ----------- | ------------------------------------------------------------------------------------------- | ------------------- | ------- | ------- |
| children | Sub element | ReactNode | | |
| className | Outermost style name | string | | |
| link | Navigation item href link, when imported, the navigation item will be wrapped with an a tag | string | - | 1.0.0 |
| linkOptions | Parameters transparently passed to the a tag | object | - | 1.0.0 |
| link | Navigation item href link, when imported, the navigation item will be wrapped with an a tag | string | - | |
| linkOptions | Parameters transparently passed to the a tag | object | - | |
| logo | Logo, can be a string or component | string \| ReactNode | | |
| style | Outermost style | object | | |
| text | Logo copy, which can be a string or component | string \| ReactNode | | |
Expand Down
Loading

0 comments on commit ef8a3a5

Please sign in to comment.