Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: react-component/menu
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v9.0.8
Choose a base ref
...
head repository: react-component/menu
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on May 28, 2021

  1. fix: keyPath is inverse (#402)

    * fix:keyPath is inverse
    
    * test: Update snapshot
    zombieJ authored May 28, 2021
    Copy the full SHA
    cbe4d95 View commit details
  2. 9.0.9

    zombieJ committed May 28, 2021
    Copy the full SHA
    5c3fe05 View commit details
  3. Copy the full SHA
    d5ba051 View commit details
  4. 9.0.10

    zombieJ committed May 28, 2021
    Copy the full SHA
    d41b3c3 View commit details

Commits on Jun 7, 2021

  1. Copy the full SHA
    23740fe View commit details
  2. 9.0.11

    zombieJ committed Jun 7, 2021
    Copy the full SHA
    86ee28f View commit details

Commits on Jun 18, 2021

  1. Copy the full SHA
    571c52f View commit details
  2. 9.0.12

    zombieJ committed Jun 18, 2021
    Copy the full SHA
    f468451 View commit details

Commits on Oct 8, 2021

  1. fix: Menu popup miss rtl cls (#423)

    * fix: Menu popup miss rtl cls
    
    * test: reorder
    zombieJ authored Oct 8, 2021
    Copy the full SHA
    9d85b24 View commit details
  2. 9.0.13

    zombieJ committed Oct 8, 2021
    Copy the full SHA
    a8fe026 View commit details

Commits on Oct 13, 2021

  1. Copy the full SHA
    6ce8652 View commit details
  2. 9.0.14

    afc163 committed Oct 13, 2021
    Copy the full SHA
    fbc51ff View commit details

Commits on Dec 23, 2021

  1. chore: support internal props (#428)

    * chore: support internal props
    
    * chore: more props
    zombieJ authored Dec 23, 2021
    Copy the full SHA
    3c74ad1 View commit details
  2. 9.1.0

    zombieJ committed Dec 23, 2021
    Copy the full SHA
    102534e View commit details
  3. Copy the full SHA
    03e3ff3 View commit details
  4. 9.1.1

    zombieJ committed Dec 23, 2021
    Copy the full SHA
    826a73f View commit details

Commits on Jan 6, 2022

  1. Copy the full SHA
    be2e5ab View commit details
  2. v9.2.0

    MadCcc committed Jan 6, 2022
    Copy the full SHA
    c4f8bad View commit details
  3. v9.2.1

    MadCcc committed Jan 6, 2022
    Copy the full SHA
    d6b1eb0 View commit details

Commits on Jan 17, 2022

  1. feat: _internalRenderSubMenuItem and _internalRenderMenuItem support …

    …selected (#432)
    
    * _internalRenderSubMenuItem and _internalRenderMenuItem support selected
    
    * use stateProps
    
    Co-authored-by: 期贤 <qixian.cs@antgroup.com>
    chenshuai2144 and chenshuai2144 authored Jan 17, 2022
    Copy the full SHA
    0256d8b View commit details
  2. v9.3.0

    chenshuai2144 committed Jan 17, 2022
    Copy the full SHA
    00583dc View commit details

Commits on Jan 19, 2022

  1. fix: add more state props (#433)

    Co-authored-by: 期贤 <qixian.cs@antgroup.com>
    chenshuai2144 and chenshuai2144 authored Jan 19, 2022
    Copy the full SHA
    2488422 View commit details
  2. v9.3.1

    chenshuai2144 committed Jan 19, 2022
    Copy the full SHA
    7b56f09 View commit details

Commits on Jan 29, 2022

  1. feat: support ref (#435)

    * feat: support ref
    
    * test: fix test case
    MadCcc authored Jan 29, 2022
    Copy the full SHA
    e52f1fa View commit details
  2. v9.3.2

    MadCcc committed Jan 29, 2022
    Copy the full SHA
    5aeca9e View commit details

Commits on Mar 17, 2022

  1. feat: support items (#438)

    * chore: popout interface
    
    * chore: popup convert
    
    * docs: demo update
    
    * chore: fix compile
    
    * test: add test case
    
    * test: coverage
    
    * test: covearege
    
    * refactor: to items
    zombieJ authored Mar 17, 2022
    Copy the full SHA
    adbfd23 View commit details
  2. 9.4.0

    zombieJ committed Mar 17, 2022
    Copy the full SHA
    907f621 View commit details
  3. refactor: rename item.title to item.label to avoid conflict with antd (

    …#439)
    
    * chore: move title to label
    
    * docs: update doc
    
    * chore: reorder
    zombieJ authored Mar 17, 2022
    Copy the full SHA
    0cee119 View commit details
  4. 9.5.0

    zombieJ committed Mar 17, 2022
    Copy the full SHA
    05f738d View commit details

Commits on Mar 18, 2022

  1. chore: update ts def

    zombieJ committed Mar 18, 2022
    Copy the full SHA
    f9f9363 View commit details
  2. 9.5.1

    zombieJ committed Mar 18, 2022
    Copy the full SHA
    f1e25c9 View commit details
  3. chore: update ts def

    zombieJ committed Mar 18, 2022
    Copy the full SHA
    bd99d30 View commit details

Commits on Mar 27, 2022

  1. Copy the full SHA
    4242acd View commit details
  2. v9.5.2

    MadCcc committed Mar 27, 2022
    Copy the full SHA
    a4613ab View commit details
  3. Copy the full SHA
    f92d764 View commit details
  4. v9.5.3

    MadCcc committed Mar 27, 2022
    Copy the full SHA
    1b5cbab View commit details

Commits on Apr 8, 2022

  1. add rootClassName (#445)

    heiyu4585 authored Apr 8, 2022
    Copy the full SHA
    6cd311c View commit details
  2. v9.5.4

    MadCcc committed Apr 8, 2022
    Copy the full SHA
    700ce5c View commit details

Commits on Apr 18, 2022

  1. Copy the full SHA
    5e607ff View commit details
  2. 9.5.5

    zombieJ committed Apr 18, 2022
    Copy the full SHA
    e7a4cc8 View commit details
  3. Upgrade to GitHub-native Dependabot (#384)

    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Apr 18, 2022
    Copy the full SHA
    51ad071 View commit details

Commits on May 6, 2022

  1. feat: focus item when focusing menu (#464)

    * feat: focus item when focusing menu
    
    * chore: update snapshot
    
    * feat: focus active child
    
    * fix: index > -1
    
    * fix: use querySelecor instead
    MadCcc authored May 6, 2022
    Copy the full SHA
    4d4a6ad View commit details
  2. v9.6.0

    MadCcc committed May 6, 2022
    Copy the full SHA
    77bd8e4 View commit details

Commits on May 9, 2022

  1. fix: type warning

    afc163 committed May 9, 2022
    Copy the full SHA
    7a4a215 View commit details

Commits on Jun 26, 2022

  1. chore: Move test case to react 18 (#489)

    * chore: init
    
    * test: more
    
    * test: more and more test
    
    * test: keyboard test case
    
    * test: menu
    
    * test: update snapshot
    
    * test: MenuItem test
    
    * test: Options test
    
    * test: Res test
    
    * test: sub test
    
    * test: all
    
    * chore: cleanup
    
    * test: back of res
    
    * test: more
    zombieJ authored Jun 26, 2022
    Copy the full SHA
    96e3210 View commit details

Commits on Aug 1, 2022

  1. feat: Ignore top level indent (#498)

    * feat: Ignore top level indent
    
    * feat: Ignore top level indent
    nuintun authored Aug 1, 2022
    Copy the full SHA
    fa7e350 View commit details

Commits on Aug 4, 2022

  1. v9.6.1

    MadCcc committed Aug 4, 2022
    Copy the full SHA
    fba538d View commit details
  2. Revert "feat: Ignore top level indent (#498)"

    This reverts commit fa7e350.
    MadCcc committed Aug 4, 2022
    Copy the full SHA
    2c4e96a View commit details
  3. v9.6.2

    MadCcc committed Aug 4, 2022
    Copy the full SHA
    8a8b888 View commit details
  4. chore: add tnpm sync script

    MadCcc committed Aug 4, 2022
    Copy the full SHA
    5100a57 View commit details
Showing with 5,461 additions and 3,346 deletions.
  1. +24 −0 .dumirc.ts
  2. +8 −4 .eslintrc.js
  3. +5 −9 .fatherrc.js
  4. +15 −0 .github/FUNDING.yml
  5. +28 −0 .github/dependabot.yml
  6. +41 −0 .github/workflows/codeql.yml
  7. +5 −113 .github/workflows/main.yml
  8. +7 −4 .gitignore
  9. +1 −0 .husky/pre-commit
  10. +2 −0 .prettierrc
  11. +0 −19 .umirc.ts
  12. +36 −2 README.md
  13. +14 −2 assets/index.less
  14. +2 −0 bunfig.toml
  15. +1 −1 docs/demo/antd-switch.md
  16. +1 −1 docs/demo/antd.md
  17. +1 −1 docs/demo/custom-icon.md
  18. +3 −0 docs/demo/customPopupRender.md
  19. +1 −1 docs/demo/debug.md
  20. +1 −1 docs/demo/fragment.md
  21. +1 −1 docs/demo/inlineCollapsed.md
  22. +3 −0 docs/demo/items-ref.md
  23. +3 −0 docs/demo/items.md
  24. +1 −1 docs/demo/keyPath.md
  25. +1 −1 docs/demo/menuItemGroup.md
  26. +1 −1 docs/demo/multiple.md
  27. +1 −1 docs/demo/openKeys.md
  28. +1 −1 docs/demo/rtl-antd.md
  29. +1 −1 docs/demo/scrollable.md
  30. +1 −1 docs/demo/selectedKeys.md
  31. +1 −1 docs/demo/single.md
  32. +12 −38 docs/examples/antd.tsx
  33. +76 −0 docs/examples/customPopupRender.less
  34. +164 −0 docs/examples/customPopupRender.tsx
  35. +10 −5 docs/examples/debug.tsx
  36. +1 −1 docs/examples/fragment.tsx
  37. +24 −10 docs/examples/inlineCollapsed.tsx
  38. +100 −0 docs/examples/items-ref.tsx
  39. +69 −0 docs/examples/items.tsx
  40. +1 −1 docs/examples/keyPath.tsx
  41. +6 −2 docs/examples/menuItemGroup.tsx
  42. +1 −1 docs/examples/multiple.tsx
  43. +1 −1 docs/examples/openKeys.tsx
  44. +18 −36 docs/examples/rtl-antd.tsx
  45. +1 −1 docs/examples/scrollable.tsx
  46. +9 −3 docs/examples/selectedKeys.tsx
  47. +50 −63 docs/examples/single.tsx
  48. +2 −2 jest.config.js
  49. +57 −49 package.json
  50. +4 −9 src/Divider.tsx
  51. +5 −1 src/Icon.tsx
  52. +267 −146 src/Menu.tsx
  53. +50 −44 src/MenuItem.tsx
  54. +43 −28 src/MenuItemGroup.tsx
  55. +5 −19 src/SubMenu/InlineSubMenuList.tsx
  56. +22 −9 src/SubMenu/PopupTrigger.tsx
  57. +10 −6 src/SubMenu/SubMenuList.tsx
  58. +146 −112 src/SubMenu/index.tsx
  59. +0 −3 src/context/IdContext.ts
  60. +14 −14 src/context/MenuContext.tsx
  61. +11 −0 src/context/PrivateContext.ts
  62. +60 −103 src/hooks/useAccessibility.ts
  63. +7 −7 src/hooks/useKeyRecords.ts
  64. +0 −23 src/hooks/useUUID.ts
  65. +16 −9 src/index.ts
  66. +97 −3 src/interface.ts
  67. +32 −8 src/placements.ts
  68. +3 −6 src/utils/{nodeUtil.ts → commonUtil.ts}
  69. +1 −1 src/utils/motionUtil.ts
  70. +88 −0 src/utils/nodeUtil.tsx
  71. +2 −5 src/utils/warnUtil.ts
  72. +0 −273 tests/Collapsed.spec.js
  73. +342 −0 tests/Collapsed.spec.tsx
  74. +190 −0 tests/Focus.spec.tsx
  75. +98 −104 tests/Keyboard.spec.tsx
  76. +0 −610 tests/Menu.spec.js
  77. +863 −0 tests/Menu.spec.tsx
  78. +85 −31 tests/{MenuItem.spec.js → MenuItem.spec.tsx}
  79. +45 −0 tests/Options.spec.tsx
  80. +40 −0 tests/Private.spec.tsx
  81. +59 −0 tests/React18.spec.tsx
  82. +121 −40 tests/Responsive.spec.tsx
  83. +0 −411 tests/SubMenu.spec.js
  84. +487 −0 tests/SubMenu.spec.tsx
  85. +3 −0 tests/__mocks__/@rc-component/trigger.js
  86. +0 −3 tests/__mocks__/rc-trigger.js
  87. +45 −34 tests/__snapshots__/Keyboard.spec.tsx.snap
  88. +0 −725 tests/__snapshots__/Menu.spec.js.snap
  89. +815 −0 tests/__snapshots__/Menu.spec.tsx.snap
  90. +0 −134 tests/__snapshots__/MenuItem.spec.js.snap
  91. +193 −0 tests/__snapshots__/MenuItem.spec.tsx.snap
  92. +84 −0 tests/__snapshots__/Options.spec.tsx.snap
  93. +15 −6 tests/__snapshots__/Responsive.spec.tsx.snap
  94. +130 −0 tests/__snapshots__/SubMenu.spec.tsx.snap
  95. +57 −0 tests/popupRender.test.tsx
  96. +78 −0 tests/semantic.spec.tsx
  97. +0 −23 tests/setup.js
  98. +1 −0 tests/setupFilesAfterEnv.ts
  99. +11 −13 tests/util.ts
  100. +3 −3 tsconfig.json
24 changes: 24 additions & 0 deletions .dumirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// more config: https://d.umijs.org/config
import { defineConfig } from 'dumi';

export default defineConfig({
themeConfig: {
name: 'rc-menu',
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
nav: [
{ title: 'Demo', link: '/demo/antd'}
],
},
favicons:
['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
outputPath: '.doc',
exportStatic: {},
mfsu: {},
styles: [
`
.markdown table {
width: auto !important;
}
`,
]
});
12 changes: 8 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
const base = require('@umijs/fabric/dist/eslint');

module.exports = {
...base,
extends: [require.resolve('@umijs/fabric/dist/eslint')],
rules: {
...base.rules,
'import/no-extraneous-dependencies': 0,
'import/no-named-as-default': 0,
'no-template-curly-in-string': 0,
@@ -15,5 +12,12 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 0,
'jsx-a11y/label-has-associated-control': 0,
'jsx-a11y/label-has-for': 0,
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/consistent-indexed-object-style': 0,
'@typescript-eslint/switch-exhaustiveness-check': 0,
'@typescript-eslint/no-parameter-properties': 0,
'@typescript-eslint/no-throw-literal': 0,
'@typescript-eslint/type-annotation-spacing': 0,
'@typescript-eslint/ban-types': 0,
},
};
14 changes: 5 additions & 9 deletions .fatherrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
export default {
cjs: 'babel',
esm: { type: 'babel', importLibToEs: true },
preCommit: {
eslint: true,
prettier: true,
},
runtimeHelpers: true,
};
import { defineConfig } from 'father';

export default defineConfig({
plugins: ['@rc-component/father-plugin'],
});
15 changes: 15 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# These are supported funding model platforms

github: ant-design # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: ant-design # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
thanks_dev: # Replace with a single thanks.dev username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "21:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: "@types/react-dom"
versions:
- 17.0.0
- 17.0.1
- 17.0.2
- dependency-name: "@types/react"
versions:
- 17.0.0
- 17.0.1
- 17.0.2
- 17.0.3
- dependency-name: np
versions:
- 7.2.0
- 7.3.0
- 7.4.0
- dependency-name: less
versions:
- 4.1.0
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "12 22 * * 6"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ javascript ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
118 changes: 5 additions & 113 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,114 +1,6 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

name: ✅ test
on: [push, pull_request]
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- uses: actions/setup-node@v1
with:
node-version: '12'

- name: cache package-lock.json
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}

- name: create package-lock.json
run: npm i --package-lock-only

- name: hack for singe file
run: |
if [ ! -d "package-temp-dir" ]; then
mkdir package-temp-dir
fi
cp package-lock.json package-temp-dir
- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}

- name: install
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm ci

lint:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- name: restore cache from package-lock.json
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}

- name: restore cache from node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}

- name: lint
run: npm run lint

needs: setup

compile:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- name: restore cache from package-lock.json
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}

- name: restore cache from node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}

- name: compile
run: npm run compile

needs: setup

coverage:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- name: restore cache from package-lock.json
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}

- name: restore cache from node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}

- name: coverage
run: npm run coverage && bash <(curl -s https://codecov.io/bash)

needs: setup
test:
uses: react-component/rc-test/.github/workflows/test.yml@main
secrets: inherit
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -29,10 +29,13 @@ es
coverage
yarn.lock
package-lock.json
pnpm-lock.yaml
.vscode

# umi
.umi
.umi-production
.umi-test
.env.local
.dumi/tmp
.dumi/tmp-test
.dumi/tmp-production
.env.local

bun.lockb
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lint-staged
2 changes: 2 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"printWidth": 100,
"proseWrap": "never",
"trailingComma": "all",
"arrowParens": "avoid"
}
19 changes: 0 additions & 19 deletions .umirc.ts

This file was deleted.

Loading