MCPcopy Index your code
hub / github.com/UCloud-FE/react-components

github.com/UCloud-FE/react-components @v1.18.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.18.4 ↗ · + Follow
2,739 symbols 6,135 edges 1,124 files 14 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

React Components

npm version TravisCI CircleCI codecov Commitizen friendly Conventional Commits

前排注意事项

  • 一些没有写在文档中的 props 以及方法等强烈不建议使用,因为这类 API 可能会随时变动。版本更新后可能会发生不可预知的问题。

浏览器兼容

| IE / Edge

IE / Edge | Firefox

Firefox | Chrome

Chrome | Safari

Safari | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | IE11, Edge 18 | 29 | 30 | 7 |

如何使用

  • 组件依赖于 react(^16)、react-dom(^16),请注意引入对应依赖,从 0.7.0 开始,不再兼容 react 15。

  • 使用 npm 或 yarn 进行安装


yarn add @ucloud-fe/react-components

npm install @ucloud-fe/react-components

yarn add @ucloud-fe/react-components@0.3.1
  • 需要注意对应修改 webpack 的 loader 配置,根据项目具体配置

js static { rules: [ { test: /\.css$/, use: ['style-loader', 'css-loader'] }, { test: /.(svg|eot|ttf|woff)$/, use: [ { loader: 'file-loader', options: { name: 'assets/[name].[ext]' } } ] } ]; }

  • 实现模块化加载

    • 通过babel-plugin-import实现模块化加载

    添加 import 插件

    bash npm install babel-plugin-import --dev

    在 babel 的 plugins 中添加配置

    json { "plugins": [ [ "import", { "libraryName": "@ucloud-fe/react-components", "camel2DashComponentName": false, "libraryDirectory": "lib/components" } ] ] }

    • 或者直接手动引用对应文件来实现模块化加载

    js static import Button from '@ucloud-fe/react-components/lib/components/Button';

如何在 Create-React-App 中使用

添加到依赖

  1. 通过 Create-React-App 创建好项目
  2. 按照上述文档将 react-components 添加到依赖,然后按照需要去引用

模块化支持

  1. 修改项目的自定义配置,不支持的需要先执行 npm run eject
  2. 按照上述文档在 babel 的 plugin 中添加配置

zIndex 说明

  • Modal、Drawer 默认的 zIndex 为 1010
  • Popover 默认的 zIndex 为 1030
  • Tooltip、Select、DatePicker、TimePicker、ActionList、PopConfirm 等 zIndex 同为 1030,弹出层容器、层级、滚动定位可通过 ConfigProvider 统一配置
  • Message 默认的 zIndex 为 1060
  • Loading 默认的 zIndex 为 10
  • 其余内部使用的 zIndex 为 10 以下

Extension points exported contracts — how you extend this code

ThemeProviderProps (Interface)
(no doc)
index.d.ts
DisplayToFormatAndTimeMode (Interface)
(no doc)
src/components/DatePicker/usePicker.tsx
Theme (Interface)
(no doc)
src/utils/styledWrap.tsx
Theme (Interface)
(no doc)
src/style/interface.ts
ExpandIconProps (Interface)
(no doc)
src/libs/rc-table/ExpandIcon.tsx
GroupContext (Interface)
(no doc)
src/hooks/group.tsx
InputWrapProps (Interface)
(no doc)
src/sharedComponents/InputWrap.tsx
BoxProps (Interface)
(no doc)
index.d.ts

Core symbols most depended-on inside this repo

css
called by 326
src/libs/dom-align/utils.js
push
called by 152
src/components/Table/Table.jsx
demoTest
called by 98
tests/shared/demoTest.js
withProps
called by 69
src/utils/withProps.jsx
sWrap
called by 69
src/style/sWrap.tsx
alert
called by 23
src/components/Modal/method.jsx
focus
called by 22
src/components/NumberInput/NumberInput.jsx
useUncontrolled
called by 21
src/hooks/useUncontrolled.tsx

Shape

Function 984
Class 859
Method 731
Interface 165

Languages

TypeScript100%

Modules by API surface

index.d.ts161 symbols
static/script/polyfill.min.js93 symbols
src/libs/dom-align/utils.js30 symbols
src/components/NumberInput/NumberInput.jsx29 symbols
src/components/EditableTable/__demo__/demo.jsx24 symbols
src/components/EditableList/__demo__/demo.jsx24 symbols
src/components/Modal/method.jsx22 symbols
src/components/Tabs/TabBar.tsx20 symbols
src/components/Table/Table.jsx19 symbols
src/libs/rc-table/TableRow.js18 symbols
src/libs/rc-trigger/src/index.js14 symbols
src/libs/rc-table/Table.js14 symbols

For agents

$ claude mcp add react-components \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact