diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index 56600be..f860ff1 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -1,113 +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 test -- --coverage && bash <(curl -s https://codecov.io/bash) - - needs: setup \ No newline at end of file + test: + uses: react-component/rc-test/.github/workflows/test.yml@main + secrets: inherit diff --git a/package.json b/package.json index efd2ff3..bc98564 100644 --- a/package.json +++ b/package.json @@ -80,5 +80,8 @@ "react-dom": "^18.0.0", "typescript": "^4.6.3", "umi-test": "^1.9.7" + }, + "overrides": { + "cheerio": "1.0.0-rc.12" } -} \ No newline at end of file +} diff --git a/src/form/Form.tsx b/src/form/Form.tsx index bb018f7..3a92149 100755 --- a/src/form/Form.tsx +++ b/src/form/Form.tsx @@ -142,7 +142,7 @@ export interface ValidateFieldsOptions { // function create export interface WrappedFormUtils { /** 获取一组输入控件的值,如不传入参数,则获取全部组件的值 */ - getFieldsValue(fieldNames?: string[]): { [field: string]: any }; + getFieldsValue(fieldNames?: string[]): Record; /** 获取一个输入控件的值 */ getFieldValue(fieldName: string): any; /** 设置一组输入控件的值 */ diff --git a/src/form/interface.ts b/src/form/interface.ts index 9b67f7d..8f8e28b 100644 --- a/src/form/interface.ts +++ b/src/form/interface.ts @@ -50,9 +50,7 @@ interface FORWARD_REF_STATICS { type NonReactStatics< S extends React.ComponentType, - C extends { - [key: string]: true; - } = {} + C extends Record = {} > = { [key in Exclude< keyof S, diff --git a/src/icon/index.tsx b/src/icon/index.tsx index 873e2d5..f0b934c 100644 --- a/src/icon/index.tsx +++ b/src/icon/index.tsx @@ -62,9 +62,7 @@ export interface IconComponent

extends React.FC

{ setTwoToneColor: typeof setTwoToneColor; } -const iconsMap: { - [key: string]: any; -} = allIcons; +const iconsMap: Record = allIcons; const LegacyTypeIcon: React.FC = props => { const { type, theme } = props; diff --git a/src/theme/dark.ts b/src/theme/dark.ts index 063f029..cdcd9f4 100644 --- a/src/theme/dark.ts +++ b/src/theme/dark.ts @@ -62,6 +62,10 @@ const generateNeutralColorPalettes: GenerateNeutralColorMap = ( colorBorder: getSolidColor(colorBgBase, 26), colorBorderSecondary: getSolidColor(colorBgBase, 19), colorSplit: getAlphaColor(colorTextBase, 0.12), + + colorBgSolid: getAlphaColor(colorTextBase, 0.95), + colorBgSolidHover: getAlphaColor(colorTextBase, 1), + colorBgSolidActive: getAlphaColor(colorTextBase, 0.9), }; }; diff --git a/src/theme/default.ts b/src/theme/default.ts index c754390..0027d46 100644 --- a/src/theme/default.ts +++ b/src/theme/default.ts @@ -62,6 +62,10 @@ const generateNeutralColorPalettes: GenerateNeutralColorMap = ( colorBorder: getSolidColor(colorBgBase, 15), colorBorderSecondary: getSolidColor(colorBgBase, 6), colorSplit: getAlphaColor(colorTextBase, 0.06), + + colorBgSolid: getAlphaColor(colorTextBase, 1), + colorBgSolidHover: getAlphaColor(colorTextBase, 0.75), + colorBgSolidActive: getAlphaColor(colorTextBase, 0.95), }; }; diff --git a/src/theme/genColorMapToken.ts b/src/theme/genColorMapToken.ts index cd439ab..51ff1d4 100644 --- a/src/theme/genColorMapToken.ts +++ b/src/theme/genColorMapToken.ts @@ -59,6 +59,9 @@ export default function genColorMapToken( colorErrorBg: errorColors[1], colorErrorBgHover: errorColors[2], + colorErrorBgFilledHover: new TinyColor(errorColors[1]) + .mix(new TinyColor(errorColors[3]), 50) + .toHexString(), colorErrorBorder: errorColors[3], colorErrorBgActive: errorColors[3], colorErrorBorderHover: errorColors[4],