MCPcopy Index your code
hub / github.com/cqkqinfo/ui

github.com/cqkqinfo/ui @v1.16.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.16.1 ↗ · + Follow
547 symbols 1,726 edges 529 files 2 documented · 0% updated 3y agov1.8.72 · 2022-01-06★ 7416 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

凯桥 UI

NPM version Test coverage npm download

使用

$ yarn add @kqinfo/ui

按需加载

安装babel-plugin-import插件

$ yarn add babel-plugin-import -D

修改babel.config.js文件

// babel.config.js
module.exports = {
  plugins: [
+    [
+      'import',
+      {
+        libraryDirectory: 'es',
+        libraryName: '@kqinfo/ui'
+      },
+      '@kqinfo/ui'
+    ]
  ]
};

定制主题

修改remax.config.js文件

module.exports = {
  ...
-  plugins: [less()],
+  plugins: [
+   less({
+     lessOptions: {
+       modifyVars: { '@brand-primary': '#2780d9', '@brand-attract': '#ff9d46' },
+       javascriptEnabled: true
+     }
+   })
+ ]
  ...
};

修改app.tsx文件

+import { ConfigProvider } from '@kqinfo/ui';

const App = (props) => {
-  return props.children;
+  return <ConfigProvider brandAttract={'#ff9d46'} brandPrimary={'#2780d9'}>{props.children}</ConfigProvider>;
};

使用源安装

在项目根目录添加.npmrc文件

canvas_binary_host_mirror=https://npm.taobao.org/mirrors/canvas/
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
electron_mirror=https://npm.taobao.org/mirrors/electron/
chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver/
sentrycli_cdnurl=https://cdn.npm.taobao.org/dist/sentry-cli
cypress_download_mirror=https://npm.taobao.org/mirrors/cypress/

yarn安装的话添加.yarnrc文件

canvas_binary_host_mirror: https://npm.taobao.org/mirrors/canvas
registry: https://registry.npm.taobao.org
ENTRYCLI_CDNURL: https://cdn.npm.taobao.org/dist/sentry-cli
sentrycli_cdnurl: https://cdn.npm.taobao.org/dist/sentry-cli

开发

安装依赖

$ yarn

启动服务

$ yarn start

本地调试

启动调试

$ yarn dev

本地连接

$ yarn link

本地项目调试

$ yarn link @kqinfo/ui

编写测试

开发注意项

  • fork到自己名下,再提merge request
  • 样式不要嵌套
  • 样式用less-modules
  • 表单组件暴露valueonChange
  • 不要用图片当icon
  • 尽量暴露节点的class,缩写用cls,比如暴露子项类名就用itemCls
  • 例子尽量写多点

Extension points exported contracts — how you extend this code

DropDownMenuProps (Interface)
(no doc)
src/drop-down-menu/index.tsx
Props (Interface)
(no doc)
src/need-wrap/index.tsx
FormItemChildrenNative (Interface)
(no doc)
src/form-item/index.tsx
Props (Interface)
(no doc)
src/image/common.tsx
CheckBoxProps (Interface)
(no doc)
src/check-box/index.tsx
GetUserInfoData (Interface)
(no doc)
src/open-type-button/index.tsx
Props (Interface)
(no doc)
src/fixed/index.tsx
Props (Interface)
(no doc)
src/user-authorization/index.tsx

Core symbols most depended-on inside this repo

getIconColor
called by 88
src/icon/rn/helper.ts
getIconColor
called by 88
src/icon/web/helper.ts
Component
called by 16
src/preview-image/index.web.tsx
getCurrentPage
called by 12
src/sentry/init.ali.tsx
onTap
called by 10
src/native/native/index.js
useProps
called by 7
src/image/common.tsx
handleChange
called by 6
src/tab/index.tsx
getCls
called by 6
src/native/demo/menu.tsx

Shape

Function 293
Interface 237
Method 8
Enum 5
Class 4

Languages

TypeScript100%

Modules by API surface

src/use-web-socket/index.wechat.tsx10 symbols
src/use-web-socket/useWebSocket.tsx9 symbols
src/license-key-board/index.tsx9 symbols
src/skeleton/index.tsx7 symbols
src/re-textarea/native-ali/index.js6 symbols
src/re-input/native-ali/index.js6 symbols
src/check-box/index.tsx6 symbols
src/re-textarea/native/index.js5 symbols
src/re-input/native/index.js5 symbols
src/radio/index.tsx5 symbols
src/open-weapp/index.tsx5 symbols
src/form/index.tsx5 symbols

For agents

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

⬇ download graph artifact