generated from react-component/footer
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
975 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import { defineConfig } from 'dumi'; | ||
|
||
const basePath = process.env.GH_PAGES ? '/input/' : '/'; | ||
const publicPath = process.env.GH_PAGES ? '/input/' : '/'; | ||
|
||
export default defineConfig({ | ||
mfsu: false, | ||
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'], | ||
themeConfig: { | ||
name: 'Input', | ||
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', | ||
}, | ||
outputPath: '.doc', | ||
base: basePath, | ||
publicPath, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 test -- --coverage && bash <(curl -s https://codecov.io/bash) | ||
|
||
needs: setup | ||
test: | ||
uses: react-component/rc-test/.github/workflows/test.yml@main | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,5 @@ dist/ | |
# dumi | ||
.dumi/tmp | ||
.dumi/tmp-production | ||
.node | ||
bun.lockb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
.rc-input { | ||
&-out-of-range { | ||
color: red; | ||
} | ||
|
||
&-affix-wrapper { | ||
padding: 2px 8px; | ||
overflow: hidden; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[install] | ||
peer = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,68 @@ | ||
import Input from 'rc-input'; | ||
import type { FC } from 'react'; | ||
import React from 'react'; | ||
import '../../assets/index.less'; | ||
import Input from 'rc-input'; | ||
|
||
const sharedHeadStyle: React.CSSProperties = { | ||
margin: 0, | ||
padding: 0, | ||
}; | ||
|
||
const Demo: FC = () => { | ||
return <Input prefixCls="rc-input" showCount />; | ||
return ( | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: 16, | ||
alignItems: 'start', | ||
}} | ||
> | ||
<h3 style={sharedHeadStyle}>Native</h3> | ||
<Input prefixCls="rc-input" showCount defaultValue="👨👩👧👦" /> | ||
<Input prefixCls="rc-input" showCount defaultValue="👨👩👧👦" maxLength={20} /> | ||
<h3 style={sharedHeadStyle}>Count</h3> | ||
<h4 style={sharedHeadStyle}>Only Max</h4> | ||
<Input | ||
placeholder="count.max" | ||
prefixCls="rc-input" | ||
defaultValue="🔥" | ||
count={{ | ||
show: true, | ||
max: 5, | ||
}} | ||
/> | ||
<h4 style={sharedHeadStyle}>Customize strategy</h4> | ||
<Input | ||
placeholder="Emoji count 1" | ||
prefixCls="rc-input" | ||
defaultValue="🔥" | ||
count={{ | ||
show: true, | ||
max: 5, | ||
strategy: (val) => [...new Intl.Segmenter().segment(val)].length, | ||
}} | ||
/> | ||
<h4 style={sharedHeadStyle}>Customize exceedFormatter</h4> | ||
<Input | ||
placeholder="Emoji count 1" | ||
prefixCls="rc-input" | ||
defaultValue="🔥" | ||
count={{ | ||
show: true, | ||
max: 5, | ||
exceedFormatter: (val, { max }) => { | ||
const segments = [...new Intl.Segmenter().segment(val)]; | ||
|
||
return segments | ||
.filter((seg) => seg.index + seg.segment.length <= max) | ||
.map((seg) => seg.segment) | ||
.join(''); | ||
}, | ||
}} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Demo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.