Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/gh-pages-5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jia-nan authored Nov 25, 2023
2 parents 1fc0aaa + 85d4f62 commit c1777f8
Show file tree
Hide file tree
Showing 51 changed files with 649 additions and 384 deletions.
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;
}
`,
]
});
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 }}"
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

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

jobs:
setup:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
- name: install
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm ci

lint:
runs-on: ubuntu-latest
steps:
Expand All @@ -66,7 +66,7 @@ jobs:
run: npm run lint

needs: setup

compile:
runs-on: ubuntu-latest
steps:
Expand All @@ -89,7 +89,7 @@ jobs:
run: npm run compile

needs: setup

coverage:
runs-on: ubuntu-latest
steps:
Expand All @@ -111,4 +111,4 @@ jobs:
- name: coverage
run: npm run coverage && bash <(curl -s https://codecov.io/bash)

needs: setup
needs: setup
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ package-lock.json
.vscode

# umi
.umi
.umi-production
.umi-test
.env.local
.dumi/tmp
.dumi/tmp-test
.dumi/tmp-production
.env.local
19 changes: 0 additions & 19 deletions .umirc.ts

This file was deleted.

17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@

React Menu Component. port from https://github.com/kissyteam/menu

[![NPM version][npm-image]][npm-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Test coverage][coveralls-image]][coveralls-url] [![Dependencies][david-image]][david-url] [![DevDependencies][david-dev-image]][david-dev-url] [![npm download][download-image]][download-url] [![bundle size][bundlephobia-image]][bundlephobia-url]
[![NPM version][npm-image]][npm-url]
[![npm download][download-image]][download-url]
[![build status][github-actions-image]][github-actions-url]
[![Codecov][codecov-image]][codecov-url]
[![bundle size][bundlephobia-image]][bundlephobia-url]
[![dumi][dumi-image]][dumi-url]

[npm-image]: http://img.shields.io/npm/v/rc-menu.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-menu
[github-actions-image]: https://github.com/react-component/menu/workflows/CI/badge.svg
[github-actions-url]: https://github.com/react-component/menu/actions
[circleci-image]: https://img.shields.io/circleci/react-component/menu/master?style=flat-square
[circleci-url]: https://circleci.com/gh/react-component/menu
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/footer/master.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/react-component/footer/branch/master
[coveralls-image]: https://img.shields.io/coveralls/react-component/menu.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/react-component/menu?branch=master
[david-url]: https://david-dm.org/react-component/menu
Expand All @@ -22,6 +29,8 @@ React Menu Component. port from https://github.com/kissyteam/menu
[download-url]: https://npmjs.org/package/rc-menu
[bundlephobia-url]: https://bundlephobia.com/result?p=rc-menu
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-menu
[dumi-url]: https://github.com/umijs/dumi
[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square

## Install

Expand Down Expand Up @@ -291,6 +300,12 @@ ReactDOM.render(
<td></td>
<td>additional css class of root dom node</td>
</tr>
<tr>
<td>popupStyle</td>
<td>CSSProperties</td>
<td></td>
<td>additional css style of root dom node</td>
</tr>
<tr>
<td>title</td>
<td>String/ReactElement</td>
Expand Down
2 changes: 1 addition & 1 deletion docs/demo/antd-switch.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## antd-switch

<code src="../examples/antd-switch.tsx">
<code src="../examples/antd-switch.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/antd.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## antd

<code src="../examples/antd.tsx">
<code src="../examples/antd.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/custom-icon.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## custom-icon

<code src="../examples/custom-icon.tsx">
<code src="../examples/custom-icon.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/debug.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## debug

<code src="../examples/debug.tsx">
<code src="../examples/debug.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/fragment.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## fragment

<code src="../examples/fragment.tsx">
<code src="../examples/fragment.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/inlineCollapsed.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## inlineCollapsed

<code src="../examples/inlineCollapsed.tsx">
<code src="../examples/inlineCollapsed.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/items.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## items

<code src="../examples/items.tsx">
<code src="../examples/items.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/keyPath.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## keyPath

<code src="../examples/keyPath.tsx">
<code src="../examples/keyPath.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/menuItemGroup.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## menuItemGroup

<code src="../examples/menuItemGroup.tsx">
<code src="../examples/menuItemGroup.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/multiple.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## multiple

<code src="../examples/multiple.tsx">
<code src="../examples/multiple.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/openKeys.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## openKeys

<code src="../examples/openKeys.tsx">
<code src="../examples/openKeys.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/rtl-antd.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## rtl-antd

<code src="../examples/rtl-antd.tsx">
<code src="../examples/rtl-antd.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/scrollable.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## scrollable

<code src="../examples/scrollable.tsx">
<code src="../examples/scrollable.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/selectedKeys.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## selectedKeys

<code src="../examples/selectedKeys.tsx">
<code src="../examples/selectedKeys.tsx"></code>
2 changes: 1 addition & 1 deletion docs/demo/single.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## single

<code src="../examples/single.tsx">
<code src="../examples/single.tsx"></code>
28 changes: 20 additions & 8 deletions docs/examples/inlineCollapsed.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import Menu, { SubMenu, Item } from 'rc-menu';
import Menu from 'rc-menu';
import './inlineCollapsed.less';

const App = () => {
Expand All @@ -15,13 +15,25 @@ const App = () => {
inlineCollapsed={collapsed}
style={{ width: 600 }}
className={collapsed ? 'collapsed' : ''}
>
<Item key="1">item 1</Item>
<SubMenu key="2" title={`inlineCollapsed: ${collapsed.toString()}`}>
<Item key="3">item 2</Item>
<Item key="4">item 3</Item>
</SubMenu>
</Menu>
items={[
{ key: '1', label: 'item 1' },
{
key: '2',
label: `inlineCollapsed: ${collapsed.toString()}`,
children: [
{ key: '3', label: 'item 2' },
{ key: '4', label: 'item 3' },
{
key: '5', label: 'SubMenu', children: [
{ key: '6', label: 'item 4' },
{ key: '7', label: 'item 5' },
{ key: '8', label: 'item 6' },
]
}
],
},
]}
/>
</>
);
}
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
setupFiles: ['<rootDir>/tests/setup.js'],
setupFilesAfterEnv: ['<rootDir>/tests/setupFilesAfterEnv.ts']
};
};
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rc-menu",
"version": "9.8.2",
"version": "9.12.2",
"description": "menu ui component for react",
"keywords": [
"react",
Expand Down Expand Up @@ -44,32 +44,32 @@
},
"dependencies": {
"@babel/runtime": "^7.10.1",
"@rc-component/trigger": "^1.17.0",
"classnames": "2.x",
"rc-motion": "^2.4.3",
"rc-overflow": "^1.2.8",
"rc-trigger": "^5.1.2",
"rc-overflow": "^1.3.1",
"rc-util": "^5.27.0"
},
"devDependencies": {
"@rc-component/father-plugin": "^1.0.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.0.0",
"@testing-library/react": "^14.0.0",
"@types/jest": "^26.0.23",
"@types/react": "^16.8.19",
"@types/react-dom": "^16.8.4",
"@types/react-dom": "^18.2.6",
"@types/react": "^18.2.14",
"@types/warning": "^3.0.0",
"cross-env": "^7.0.0",
"dumi": "^1.1.0",
"dumi": "^2.1.17",
"eslint": "^7.0.0",
"father": "^4.0.0",
"gh-pages": "^5.0.0",
"less": "^3.10.3",
"less": "^4.1.3",
"np": "^6.0.0",
"rc-test": "^7.0.14",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"regenerator-runtime": "^0.13.7",
"typescript": "^4.0.5"
"typescript": "^5.1.6"
},
"peerDependencies": {
"react": ">=16.9.0",
Expand Down
1 change: 1 addition & 0 deletions src/Divider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function Divider({ className, style }: DividerProps) {

return (
<li
role="separator"
className={classNames(`${prefixCls}-item-divider`, className)}
style={style}
/>
Expand Down
Loading

0 comments on commit c1777f8

Please sign in to comment.