├── .npmrc ├── docs ├── base.md ├── display.md ├── layout.md ├── other.md └── interactive.md ├── .prettierignore ├── .recodo ├── .gitignore ├── @types │ └── index.d.ts ├── data │ ├── Spin.info.json │ ├── Spin.doc.json │ ├── Skeleton.doc.json │ ├── Compact.doc.json │ ├── Textarea.doc.json │ ├── Transfer.doc.json │ ├── TransferMenu.doc.json │ ├── Notice.doc.json │ ├── TransferTable.doc.json │ ├── ThemeProvider.doc.json │ ├── Progress.doc.json │ ├── Loading.doc.json │ ├── Link.doc.json │ ├── PopConfirm.doc.json │ ├── Layout.doc.json │ ├── SvgIcon.doc.json │ ├── ZForm.info.json │ ├── ConfigProvider.doc.json │ ├── Tooltip.doc.json │ ├── Steps.doc.json │ ├── Calendar.doc.json │ ├── Textarea.info.json │ ├── EditableList.doc.json │ ├── EditableTable.doc.json │ └── Card.doc.json ├── interface.ts ├── package.json └── componentDemos │ ├── Skeleton.tsx │ ├── PopConfirm.tsx │ └── Notice.tsx ├── .stylelintignore ├── tests ├── __mocks__ │ └── styleMock.js ├── imageSetup.js └── lib.manual.test.js ├── src ├── interfaces │ ├── Size.js │ └── Color.js ├── components │ ├── Box │ │ ├── index.jsx │ │ └── __tests__ │ │ │ └── demo.test.js │ ├── Icon │ │ ├── index.tsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ └── __demo__ │ │ │ ├── customStyle.jsx │ │ │ └── type.jsx │ ├── Menu │ │ ├── locale │ │ │ ├── zh_CN.js │ │ │ └── en_US.js │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── Item.md │ │ ├── SubMenu.md │ │ ├── index.tsx │ │ └── MenuContext.tsx │ ├── Nav │ │ ├── index.tsx │ │ ├── __tests__ │ │ │ └── demo.test.js │ │ └── util.ts │ ├── Spin │ │ ├── index.jsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── style │ │ │ └── index.js │ │ ├── Spin.md │ │ ├── Spin.jsx │ │ └── __demo__ │ │ │ └── base.jsx │ ├── Button │ │ ├── index.tsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── shared.ts │ │ └── __demo__ │ │ │ ├── block.jsx │ │ │ ├── disabled.jsx │ │ │ ├── size.jsx │ │ │ ├── styleType.jsx │ │ │ └── loading.jsx │ ├── DatePicker │ │ ├── Month.md │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── __demo__ │ │ │ ├── range-type.jsx │ │ │ ├── datepicker-disabled.jsx │ │ │ ├── datepicker-nullable.jsx │ │ │ ├── range-disabled.jsx │ │ │ ├── range-size.jsx │ │ │ ├── datepicker-size.jsx │ │ │ ├── datepicker-status.jsx │ │ │ ├── datepicker-uncontrolled.jsx │ │ │ ├── month-size.jsx │ │ │ ├── range-status.jsx │ │ │ ├── month-disabled.jsx │ │ │ └── month-nullable.jsx │ │ ├── index.tsx │ │ └── locale │ │ │ └── zh_CN.js │ ├── Drawer │ │ └── index.jsx │ ├── EditableList │ │ ├── locale │ │ │ ├── zh_CN.js │ │ │ └── en_US.js │ │ ├── index.jsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ └── EditableList.md │ ├── Slider │ │ ├── index.jsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ └── locale │ │ │ ├── zh_CN.js │ │ │ └── en_US.js │ ├── Steps │ │ ├── index.jsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── Steps.md │ │ └── Link.jsx │ ├── TimePicker │ │ ├── locale │ │ │ ├── zh_CN.js │ │ │ └── en_US.js │ │ ├── index.tsx │ │ ├── __tests__ │ │ │ └── demo.test.js │ │ └── __demo__ │ │ │ ├── disabled.jsx │ │ │ ├── nullable.jsx │ │ │ └── size.jsx │ ├── Compact │ │ ├── index.jsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── style │ │ │ └── index.js │ │ └── Compact.md │ ├── Loading │ │ ├── index.jsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ └── Loading.md │ ├── SvgIcon │ │ ├── index.jsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── icons │ │ │ ├── Circle.jsx │ │ │ ├── Horz.jsx │ │ │ ├── RingLoading.jsx │ │ │ ├── Tick.jsx │ │ │ ├── CrossBold.jsx │ │ │ ├── Cross.jsx │ │ │ ├── CircleMarkFill.jsx │ │ │ ├── Minus.jsx │ │ │ ├── LineArrowDown.jsx │ │ │ ├── LineArrowUp.jsx │ │ │ ├── ArrowUp.jsx │ │ │ ├── ArrowDown.jsx │ │ │ ├── ArrowRight.jsx │ │ │ ├── DottedLineArrowRight.jsx │ │ │ ├── Plus.jsx │ │ │ ├── Filter.jsx │ │ │ ├── ArrowLeft.jsx │ │ │ ├── TriangleDown.jsx │ │ │ ├── TriangleRight.jsx │ │ │ ├── TriangleUp.jsx │ │ │ ├── CircleYesMdFill.jsx │ │ │ ├── Search.jsx │ │ │ ├── TriangleLeft.jsx │ │ │ ├── Ellipsis.jsx │ │ │ ├── CircleCrossFill.jsx │ │ │ ├── TickSmall.jsx │ │ │ └── Sort.jsx │ │ ├── __demo__ │ │ │ ├── svgIcon-type.jsx │ │ │ ├── svgIcon-spin.jsx │ │ │ ├── svgIcon-size.jsx │ │ │ └── svgIcon-color.jsx │ │ └── SvgIcon.md │ ├── Cascader │ │ ├── index.tsx │ │ ├── __tests__ │ │ │ └── demo.test.js │ │ ├── locale │ │ │ ├── zh_CN.js │ │ │ └── en_US.js │ │ ├── CascadeContext.tsx │ │ └── interface.ts │ ├── Progress │ │ ├── index.jsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ └── Progress.md │ ├── Skeleton │ │ ├── index.tsx │ │ ├── __tests__ │ │ │ └── demo.test.js │ │ └── Skeleton.md │ ├── Textarea │ │ ├── index.jsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── Textarea.md │ │ ├── __demo__ │ │ │ └── disabled.jsx │ │ └── Textarea.jsx │ ├── Transfer │ │ ├── index.jsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── locale │ │ │ ├── zh_CN.js │ │ │ └── en_US.js │ │ └── Transfer.md │ ├── Modal │ │ ├── locale │ │ │ ├── zh_CN.js │ │ │ └── en_US.js │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── Content.md │ │ └── index.jsx │ ├── ThemeProvider │ │ ├── green.js │ │ ├── ocean.js │ │ ├── material.js │ │ ├── dark.js │ │ ├── index.jsx │ │ ├── private.js │ │ ├── ThemeProvider.md │ │ ├── runtime.js │ │ └── useDesignTokens.tsx │ ├── Card │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── Action.jsx │ │ ├── Footer.jsx │ │ ├── Content.jsx │ │ ├── index.jsx │ │ ├── SubArea.jsx │ │ ├── Card.md │ │ └── Header.jsx │ ├── Form │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── ItemContext.jsx │ │ ├── Group.md │ │ ├── SubArea.md │ │ ├── ControllerContext.tsx │ │ ├── index.jsx │ │ ├── Form.md │ │ └── __demo__ │ │ │ ├── item-required.jsx │ │ │ └── item-help.jsx │ ├── Grid │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── README.md │ │ ├── index.jsx │ │ ├── Row.md │ │ └── Col.md │ ├── Link │ │ ├── __tests__ │ │ │ └── demo.test.js │ │ ├── Link.md │ │ ├── Button.md │ │ ├── index.tsx │ │ ├── __demo__ │ │ │ └── base.jsx │ │ └── Link.tsx │ ├── NumberInput │ │ ├── index.jsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ └── __demo__ │ │ │ ├── computeValidNumber.jsx │ │ │ ├── disabled.jsx │ │ │ ├── readOnly.jsx │ │ │ ├── hideHandler.jsx │ │ │ └── step.jsx │ ├── Pagination │ │ ├── index.jsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ ├── image.test.js │ │ │ └── __snapshots__ │ │ │ │ └── index.test.js.snap │ │ ├── locale │ │ │ ├── zh_CN.js │ │ │ └── en_US.js │ │ └── __demo__ │ │ │ ├── total.jsx │ │ │ ├── simple.jsx │ │ │ ├── showLessItems.jsx │ │ │ └── showTitle.jsx │ ├── PopConfirm │ │ ├── index.tsx │ │ ├── locale │ │ │ ├── zh_CN.js │ │ │ └── en_US.js │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── PopConfirm.md │ │ └── __demo__ │ │ │ ├── onCancel.jsx │ │ │ ├── onConfirm.jsx │ │ │ └── popConfirm.jsx │ ├── Tag │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── index.tsx │ │ ├── Icon.md │ │ ├── Group.md │ │ └── Tag.md │ ├── Tree │ │ ├── __tests__ │ │ │ └── demo.test.js │ │ ├── index.tsx │ │ └── TreeContext.tsx │ ├── AutoComplete │ │ ├── index.tsx │ │ ├── __tests__ │ │ │ └── demo.test.js │ │ └── __demo__ │ │ │ └── disabled.jsx │ ├── Badge │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ ├── image.test.js │ │ │ └── index.test.js │ │ ├── Bubble.md │ │ └── index.tsx │ ├── Calendar │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── locale │ │ │ ├── zh_CN.js │ │ │ └── en_US.js │ │ ├── __demo__ │ │ │ ├── twoside.jsx │ │ │ ├── base.jsx │ │ │ ├── month.jsx │ │ │ └── range.jsx │ │ ├── index.tsx │ │ └── Calendar.md │ ├── Checkbox │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── interface.ts │ │ ├── index.tsx │ │ ├── __demo__ │ │ │ ├── performance.jsx │ │ │ ├── checkbox-size.jsx │ │ │ ├── checkbox-checked.jsx │ │ │ └── checkbox-disabled.jsx │ │ ├── CheckboxContext.tsx │ │ └── Checkbox.md │ ├── Collapse │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── CollapseContext.tsx │ │ ├── index.tsx │ │ ├── Collapse.md │ │ ├── style │ │ │ └── index.ts │ │ └── Panel.md │ ├── Combine │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── index.tsx │ │ └── __demo__ │ │ │ └── null.jsx │ ├── Layout │ │ ├── __tests__ │ │ │ └── demo.test.js │ │ ├── Sider.md │ │ ├── Layout.md │ │ ├── index.tsx │ │ ├── Content.tsx │ │ ├── Footer.tsx │ │ └── Header.tsx │ ├── Notice │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── Notice.md │ │ └── index.tsx │ ├── Popover │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ └── ContainerContext.tsx │ ├── Radio │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── index.jsx │ │ ├── Tag.jsx │ │ ├── Button.jsx │ │ ├── __demo__ │ │ │ ├── radio-disabled.jsx │ │ │ ├── radio-size.jsx │ │ │ ├── radio-checked.jsx │ │ │ ├── group-size.jsx │ │ │ ├── group-disabled.jsx │ │ │ └── group-uncontrolled.jsx │ │ └── RadioIcon.tsx │ ├── Select │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── locale │ │ │ ├── zh_CN.js │ │ │ └── en_US.js │ │ ├── index.tsx │ │ └── SelectContext.tsx │ ├── Switch │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── index.tsx │ │ └── __demo__ │ │ │ ├── disabled.jsx │ │ │ ├── size.jsx │ │ │ ├── checked.jsx │ │ │ ├── uncontrolled.jsx │ │ │ └── onTextAndOffText.jsx │ ├── Table │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── ActionList.jsx │ │ ├── ActionList.md │ │ ├── HoverDisplayArea.md │ │ ├── SearchInput.md │ │ ├── ExpandedRowContent.jsx │ │ ├── ColumnConfigButton.md │ │ ├── locale │ │ │ ├── zh_CN.js │ │ │ └── en_US.js │ │ └── SearchInput.jsx │ ├── Tooltip │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── index.tsx │ │ ├── Tooltip.md │ │ └── __demo__ │ │ │ └── theme.jsx │ ├── TransferMenu │ │ ├── index.jsx │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── TransferMenu.md │ │ └── style │ │ │ └── index.js │ ├── Upload │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── index.jsx │ │ ├── __demo__ │ │ │ ├── base.jsx │ │ │ ├── multiple.jsx │ │ │ ├── disabled.jsx │ │ │ ├── listType.jsx │ │ │ ├── maxCount.jsx │ │ │ ├── accept.jsx │ │ │ ├── maxSize.jsx │ │ │ └── single.jsx │ │ ├── locale │ │ │ └── zh_CN.js │ │ └── icons │ │ │ └── Docs.jsx │ ├── ZForm │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ └── index.jsx │ ├── ActionList │ │ ├── __tests__ │ │ │ └── demo.test.js │ │ ├── style │ │ │ └── index.ts │ │ └── index.tsx │ ├── Breadcrumb │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── BackButton.md │ │ ├── interface.ts │ │ ├── Breadcrumb.md │ │ ├── BackButton.tsx │ │ ├── index.tsx │ │ └── Item.md │ ├── ConfigProvider │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── index.tsx │ │ ├── __demo__ │ │ │ ├── icon.jsx │ │ │ └── locale.jsx │ │ ├── ConfigProvider.md │ │ └── ConfigContext.tsx │ ├── EditableTable │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── index.jsx │ │ └── EditableTable.md │ ├── Input │ │ ├── __tests__ │ │ │ ├── image.test.js │ │ │ └── demo.test.js │ │ ├── Search.md │ │ └── __demo__ │ │ │ ├── input-clearable.jsx │ │ │ ├── input-size.jsx │ │ │ ├── input-status.jsx │ │ │ ├── search-disabled.jsx │ │ │ ├── search-size.jsx │ │ │ └── input-icon.jsx │ ├── LocaleProvider │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── index.jsx │ │ ├── LocaleContext.tsx │ │ ├── runtime.ts │ │ ├── __demo__ │ │ │ ├── localeprovider.jsx │ │ │ └── localefile.jsx │ │ └── LocaleProvider.tsx │ ├── Tabs │ │ ├── __tests__ │ │ │ ├── image.test.js │ │ │ └── demo.test.js │ │ ├── Pane.md │ │ ├── RefContext.tsx │ │ └── shared.ts │ ├── TransferTable │ │ ├── __tests__ │ │ │ ├── demo.test.js │ │ │ └── image.test.js │ │ ├── index.jsx │ │ └── TransferTable.md │ ├── Col │ │ └── index.jsx │ ├── Row │ │ └── index.jsx │ └── Message │ │ ├── index.jsx │ │ └── __demo__ │ │ └── message.jsx ├── utils │ ├── isIE.ts │ ├── isFirefox.ts │ ├── isNumber.ts │ ├── isArray.ts │ ├── wait.ts │ ├── noop.ts │ ├── typeMemo.ts │ ├── isObject.ts │ ├── isFunction.ts │ ├── isSafari.ts │ ├── each.ts │ ├── hoistStatics.js │ ├── string.ts │ ├── generateError.js │ ├── warning.ts │ ├── pick.ts │ ├── deprecatedLog.ts │ ├── KeyCode.ts │ ├── isEmpty.ts │ ├── memo.js │ └── once.ts ├── libs │ ├── rc-drawer │ │ ├── README.md │ │ └── index.js │ ├── rc-table │ │ ├── README.md │ │ └── index.ts │ ├── rc-trigger │ │ ├── index.js │ │ └── src │ │ │ └── mock.js │ └── dom-align │ │ ├── index.js │ │ └── getElFuturePos.js ├── sharedComponents │ └── Search │ │ ├── locale │ │ ├── zh_CN.js │ │ └── en_US.js │ │ ├── Highlight.tsx │ │ └── index.tsx ├── hooks │ ├── useInitial.tsx │ ├── useConfig.tsx │ ├── useConstructor.tsx │ ├── useIsInitial.tsx │ └── useDidMount.tsx ├── config.js ├── style │ └── interface.ts └── decorators │ └── __tests__ │ └── index.test.js ├── .styleguide ├── favicon.ico └── components │ ├── IsolateButton.jsx │ └── Preview.tsx ├── static └── fonts │ ├── ucicon.eot │ ├── ucicon.ttf │ └── ucicon.woff ├── .eslintignore ├── .prettierrc ├── shared ├── formLayout.js ├── sleep.js ├── demoUtil.jsx ├── DemoWrap.jsx └── DemoBlock.jsx ├── webpack.dist.config.js ├── start-pm2.json ├── .stylelintrc ├── .editorconfig ├── .lintstagedrc ├── commitlint.config.js ├── index.js ├── .github └── PULL_REQUEST_TEMPLATE.md └── .gitignore /.npmrc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/base.md: -------------------------------------------------------------------------------- 1 | ## 基础组件 2 | -------------------------------------------------------------------------------- /docs/display.md: -------------------------------------------------------------------------------- 1 | ## 展示类组件 2 | -------------------------------------------------------------------------------- /docs/layout.md: -------------------------------------------------------------------------------- 1 | ## 布局组件 2 | -------------------------------------------------------------------------------- /docs/other.md: -------------------------------------------------------------------------------- 1 | ## 其它组件 2 | -------------------------------------------------------------------------------- /docs/interactive.md: -------------------------------------------------------------------------------- 1 | ## 交互组件 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | yarn.lock 3 | -------------------------------------------------------------------------------- /.recodo/.gitignore: -------------------------------------------------------------------------------- 1 | /dist 2 | node_modules 3 | -------------------------------------------------------------------------------- /.stylelintignore: -------------------------------------------------------------------------------- 1 | /src/components/Tabs/utils.ts 2 | -------------------------------------------------------------------------------- /tests/__mocks__/styleMock.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /src/interfaces/Size.js: -------------------------------------------------------------------------------- 1 | export default ['sm', 'md', 'lg']; 2 | -------------------------------------------------------------------------------- /src/components/Box/index.jsx: -------------------------------------------------------------------------------- 1 | import Box from './Box'; 2 | 3 | export default Box; 4 | -------------------------------------------------------------------------------- /src/components/Icon/index.tsx: -------------------------------------------------------------------------------- 1 | import Icon from './Icon'; 2 | export default Icon; 3 | -------------------------------------------------------------------------------- /src/components/Menu/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | selectAll: '全选' 3 | }; 4 | -------------------------------------------------------------------------------- /src/components/Nav/index.tsx: -------------------------------------------------------------------------------- 1 | import Nav from './Nav'; 2 | 3 | export default Nav; 4 | -------------------------------------------------------------------------------- /src/components/Spin/index.jsx: -------------------------------------------------------------------------------- 1 | import Spin from './Spin'; 2 | export default Spin; 3 | -------------------------------------------------------------------------------- /src/utils/isIE.ts: -------------------------------------------------------------------------------- 1 | export default navigator?.userAgent?.indexOf?.('Trident/') > -1; 2 | -------------------------------------------------------------------------------- /src/components/Button/index.tsx: -------------------------------------------------------------------------------- 1 | import Button from './Button'; 2 | export default Button; 3 | -------------------------------------------------------------------------------- /src/components/DatePicker/Month.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 请使用 `` 替换 4 | -------------------------------------------------------------------------------- /src/components/Drawer/index.jsx: -------------------------------------------------------------------------------- 1 | import Drawer from './Drawer'; 2 | export default Drawer; 3 | -------------------------------------------------------------------------------- /src/components/EditableList/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | add: '添加数据' 3 | }; 4 | -------------------------------------------------------------------------------- /src/components/Slider/index.jsx: -------------------------------------------------------------------------------- 1 | import Slider from './Slider'; 2 | export default Slider; 3 | -------------------------------------------------------------------------------- /src/components/Steps/index.jsx: -------------------------------------------------------------------------------- 1 | import Steps from './Steps'; 2 | export default Steps; 3 | -------------------------------------------------------------------------------- /src/components/TimePicker/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | confirm: '确定' 3 | }; 4 | -------------------------------------------------------------------------------- /src/libs/rc-drawer/README.md: -------------------------------------------------------------------------------- 1 | # rc-drawer 2 | 3 | copy from rc-drawer and fix some bug 4 | -------------------------------------------------------------------------------- /src/libs/rc-table/README.md: -------------------------------------------------------------------------------- 1 | # rc-table 2 | 3 | copy from rc-table and add some feature 4 | -------------------------------------------------------------------------------- /src/libs/rc-table/index.ts: -------------------------------------------------------------------------------- 1 | import Table from './Table'; 2 | 3 | export default Table; 4 | -------------------------------------------------------------------------------- /src/utils/isFirefox.ts: -------------------------------------------------------------------------------- 1 | export default navigator?.userAgent?.indexOf?.('Firefox') > -1; 2 | -------------------------------------------------------------------------------- /src/utils/isNumber.ts: -------------------------------------------------------------------------------- 1 | export default (v: unknown): v is number => typeof v === 'number'; 2 | -------------------------------------------------------------------------------- /src/components/Compact/index.jsx: -------------------------------------------------------------------------------- 1 | import Compact from './Compact'; 2 | export default Compact; 3 | -------------------------------------------------------------------------------- /src/components/EditableList/locale/en_US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | add: 'Add item' 3 | }; 4 | -------------------------------------------------------------------------------- /src/components/Loading/index.jsx: -------------------------------------------------------------------------------- 1 | import Loading from './Loading'; 2 | export default Loading; 3 | -------------------------------------------------------------------------------- /src/components/Menu/locale/en_US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | selectAll: 'Select all' 3 | }; 4 | -------------------------------------------------------------------------------- /src/components/SvgIcon/index.jsx: -------------------------------------------------------------------------------- 1 | import SvgIcon from './SvgIcon'; 2 | export default SvgIcon; 3 | -------------------------------------------------------------------------------- /src/components/TimePicker/locale/en_US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | confirm: 'Confirm' 3 | }; 4 | -------------------------------------------------------------------------------- /src/components/Cascader/index.tsx: -------------------------------------------------------------------------------- 1 | import Cascader from './Cascader'; 2 | export default Cascader; 3 | -------------------------------------------------------------------------------- /src/components/Progress/index.jsx: -------------------------------------------------------------------------------- 1 | import Progress from './Progress'; 2 | export default Progress; 3 | -------------------------------------------------------------------------------- /src/components/Skeleton/index.tsx: -------------------------------------------------------------------------------- 1 | import Skeleton from './Skeleton'; 2 | export default Skeleton; 3 | -------------------------------------------------------------------------------- /src/components/Textarea/index.jsx: -------------------------------------------------------------------------------- 1 | import Textarea from './Textarea'; 2 | export default Textarea; 3 | -------------------------------------------------------------------------------- /src/components/Transfer/index.jsx: -------------------------------------------------------------------------------- 1 | import Transfer from './Transfer'; 2 | export default Transfer; 3 | -------------------------------------------------------------------------------- /.styleguide/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UCloud-FE/react-components/HEAD/.styleguide/favicon.ico -------------------------------------------------------------------------------- /src/components/Modal/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | confirm: '确定', 3 | cancel: '取消' 4 | }; 5 | -------------------------------------------------------------------------------- /src/components/ThemeProvider/green.js: -------------------------------------------------------------------------------- 1 | console.warn('This theme is unused'); 2 | 3 | export default {}; 4 | -------------------------------------------------------------------------------- /src/components/ThemeProvider/ocean.js: -------------------------------------------------------------------------------- 1 | console.warn('This theme is unused'); 2 | 3 | export default {}; 4 | -------------------------------------------------------------------------------- /static/fonts/ucicon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UCloud-FE/react-components/HEAD/static/fonts/ucicon.eot -------------------------------------------------------------------------------- /static/fonts/ucicon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UCloud-FE/react-components/HEAD/static/fonts/ucicon.ttf -------------------------------------------------------------------------------- /src/components/Box/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Card/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Form/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Grid/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Icon/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Link/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Menu/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Nav/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/NumberInput/index.jsx: -------------------------------------------------------------------------------- 1 | import NumberInput from './NumberInput'; 2 | export default NumberInput; 3 | -------------------------------------------------------------------------------- /src/components/Pagination/index.jsx: -------------------------------------------------------------------------------- 1 | import Pagination from './Pagination'; 2 | export default Pagination; 3 | -------------------------------------------------------------------------------- /src/components/PopConfirm/index.tsx: -------------------------------------------------------------------------------- 1 | import PopConfirm from './PopConfirm'; 2 | export default PopConfirm; 3 | -------------------------------------------------------------------------------- /src/components/PopConfirm/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | confirm: '确定', 3 | cancel: '取消' 4 | }; 5 | -------------------------------------------------------------------------------- /src/components/Spin/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Tag/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/TimePicker/index.tsx: -------------------------------------------------------------------------------- 1 | import TimePicker from './TimePicker'; 2 | export default TimePicker; 3 | -------------------------------------------------------------------------------- /src/components/Tree/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/sharedComponents/Search/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | empty: '无结果', 3 | unit: '条' 4 | }; 5 | -------------------------------------------------------------------------------- /static/fonts/ucicon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UCloud-FE/react-components/HEAD/static/fonts/ucicon.woff -------------------------------------------------------------------------------- /src/components/AutoComplete/index.tsx: -------------------------------------------------------------------------------- 1 | import AutoComplete from './AutoComplete'; 2 | export default AutoComplete; 3 | -------------------------------------------------------------------------------- /src/components/Badge/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Button/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Calendar/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Cascader/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Checkbox/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Collapse/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Combine/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Compact/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/EditableList/index.jsx: -------------------------------------------------------------------------------- 1 | import EditableList from './EditableList'; 2 | export default EditableList; 3 | -------------------------------------------------------------------------------- /src/components/Layout/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Loading/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Modal/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Modal/locale/en_US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | confirm: 'Confirm', 3 | cancel: 'Cancel' 4 | }; 5 | -------------------------------------------------------------------------------- /src/components/Notice/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Popover/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Progress/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Radio/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Select/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Skeleton/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Slider/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Steps/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/SvgIcon/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Switch/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Table/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Tag/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Textarea/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Tooltip/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Transfer/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/TransferMenu/index.jsx: -------------------------------------------------------------------------------- 1 | import TransferMenu from './TransferMenu'; 2 | export default TransferMenu; 3 | -------------------------------------------------------------------------------- /src/components/Upload/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/ZForm/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/ActionList/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/AutoComplete/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Badge/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Breadcrumb/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Button/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Calendar/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Card/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Cascader/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | emptyTip: '暂无数据', 3 | placeholder: '请选择' 4 | }; 5 | -------------------------------------------------------------------------------- /src/components/Checkbox/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Collapse/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Combine/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Compact/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/ConfigProvider/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/DatePicker/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/EditableList/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/EditableTable/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/EditableTable/index.jsx: -------------------------------------------------------------------------------- 1 | import EditableTable from './EditableTable'; 2 | export default EditableTable; 3 | -------------------------------------------------------------------------------- /src/components/Form/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Grid/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Icon/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Input/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Loading/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/LocaleProvider/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Menu/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Modal/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Notice/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/NumberInput/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Pagination/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/PopConfirm/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/PopConfirm/locale/en_US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | confirm: 'Confirm', 3 | cancel: 'Cancel' 4 | }; 5 | -------------------------------------------------------------------------------- /src/components/Popover/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Progress/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Radio/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Select/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Slider/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Spin/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Steps/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/SvgIcon/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Switch/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Table/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Tabs/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Textarea/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/TimePicker/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Tooltip/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Transfer/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/TransferMenu/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/TransferTable/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/TransferTable/index.jsx: -------------------------------------------------------------------------------- 1 | import TransferTable from './TransferTable'; 2 | export default TransferTable; 3 | -------------------------------------------------------------------------------- /src/components/Upload/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/ZForm/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/libs/rc-trigger/index.js: -------------------------------------------------------------------------------- 1 | // export this package's api 2 | import Trigger from './src/'; 3 | export default Trigger; 4 | -------------------------------------------------------------------------------- /src/utils/isArray.ts: -------------------------------------------------------------------------------- 1 | export default (v?: T[]): v is T[] => Object.prototype.toString.apply(v) === '[object Array]'; 2 | -------------------------------------------------------------------------------- /src/components/Breadcrumb/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/DatePicker/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/EditableList/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/EditableTable/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/NumberInput/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Pagination/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/PopConfirm/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/TransferMenu/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/TransferTable/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/libs/rc-drawer/index.js: -------------------------------------------------------------------------------- 1 | // export this package's api 2 | import Drawer from './Drawer'; 3 | 4 | export default Drawer; 5 | -------------------------------------------------------------------------------- /src/utils/wait.ts: -------------------------------------------------------------------------------- 1 | const wait = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms)); 2 | 3 | export default wait; 4 | -------------------------------------------------------------------------------- /src/components/Cascader/locale/en_US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | emptyTip: 'No data', 3 | placeholder: 'Please select' 4 | }; 5 | -------------------------------------------------------------------------------- /src/components/Col/index.jsx: -------------------------------------------------------------------------------- 1 | import Grid from 'src/components/Grid'; 2 | 3 | const { Col } = Grid; 4 | 5 | export default Col; 6 | -------------------------------------------------------------------------------- /src/components/ConfigProvider/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Input/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(['manual-test']); 4 | -------------------------------------------------------------------------------- /src/components/LocaleProvider/__tests__/image.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoImageTest'; 2 | 3 | demoTest(); 4 | -------------------------------------------------------------------------------- /src/components/Row/index.jsx: -------------------------------------------------------------------------------- 1 | import Grid from 'src/components/Grid'; 2 | 3 | const { Row } = Grid; 4 | 5 | export default Row; 6 | -------------------------------------------------------------------------------- /src/components/Tabs/__tests__/demo.test.js: -------------------------------------------------------------------------------- 1 | import demoTest from 'tests/shared/demoTest'; 2 | 3 | demoTest(['tabs-boundary']); 4 | -------------------------------------------------------------------------------- /src/sharedComponents/Search/locale/en_US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | empty: 'No search result', 3 | unit: ' items' 4 | }; 5 | -------------------------------------------------------------------------------- /src/interfaces/Color.js: -------------------------------------------------------------------------------- 1 | const Color = ['red', 'blue', 'white', 'green', 'yellow', 'gray', 'pink', 'orange']; 2 | export default Color; 3 | -------------------------------------------------------------------------------- /src/components/Grid/README.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - Grid 布局 包含 Row 和 Col 两个组件,使用的是 12 栅格,如果需要更细致的珊格,可使用小数 4 | - Row 用来建立组,其中放置 Col 来进行布局 5 | -------------------------------------------------------------------------------- /src/utils/noop.ts: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line @typescript-eslint/no-empty-function 2 | const noop = () => {}; 3 | 4 | export default noop; 5 | -------------------------------------------------------------------------------- /src/utils/typeMemo.ts: -------------------------------------------------------------------------------- 1 | import { memo } from 'react'; 2 | 3 | const typedMemo: (c: T) => T = memo; 4 | 5 | export default typedMemo; 6 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/Circle.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ); 4 | -------------------------------------------------------------------------------- /src/components/Table/ActionList.jsx: -------------------------------------------------------------------------------- 1 | import ActionList from 'src/components/ActionList'; 2 | 3 | /** @deprecated */ 4 | export default ActionList; 5 | -------------------------------------------------------------------------------- /src/components/Combine/index.tsx: -------------------------------------------------------------------------------- 1 | import Combine, { CombineProps } from './Combine'; 2 | 3 | export default Combine; 4 | export type { CombineProps }; 5 | -------------------------------------------------------------------------------- /src/components/Form/ItemContext.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const ItemContext = React.createContext({}); 4 | 5 | export default ItemContext; 6 | -------------------------------------------------------------------------------- /src/components/Grid/index.jsx: -------------------------------------------------------------------------------- 1 | import Row from './Row'; 2 | import Col from './Col'; 3 | 4 | export default { Row, Col }; 5 | 6 | export { Row, Col }; 7 | -------------------------------------------------------------------------------- /.recodo/@types/index.d.ts: -------------------------------------------------------------------------------- 1 | import * as components from '../../index'; 2 | 3 | declare module '@ucloud-fe/react-components' { 4 | export = components; 5 | } 6 | -------------------------------------------------------------------------------- /src/components/Form/Group.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 表单组控件,用于包裹表单项成为表单组 4 | 5 | ### 演示 6 | 7 | #### 布局 8 | 9 | ```js {"codepath": "group.jsx"} 10 | ``` 11 | -------------------------------------------------------------------------------- /src/utils/isObject.ts: -------------------------------------------------------------------------------- 1 | export default >(v: any): v is T => { 2 | return {}.toString.call(v) === '[object Object]'; 3 | }; 4 | -------------------------------------------------------------------------------- /src/components/Form/SubArea.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 表单组控件,用于包裹表单项成为一个小的组 4 | 5 | ### 演示 6 | 7 | #### 布局 8 | 9 | ```js {"codepath": "subArea.jsx"} 10 | ``` 11 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/Horz.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ); 4 | -------------------------------------------------------------------------------- /src/sharedComponents/Search/Highlight.tsx: -------------------------------------------------------------------------------- 1 | import { memo } from 'react'; 2 | 3 | import { SHighlight } from './style'; 4 | 5 | export default memo(SHighlight); 6 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /build 3 | /dist 4 | /lib 5 | /.vscode 6 | /docs 7 | /scripts 8 | /static 9 | /styleguide-build 10 | /coverage 11 | /index.d.ts 12 | -------------------------------------------------------------------------------- /src/components/Badge/Bubble.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是 Bubble 组件,特殊的角标样式提示 4 | 5 | ### 演示 6 | 7 | #### 演示 8 | 9 | ```js {"codepath": "bubble.jsx"} 10 | ``` 11 | -------------------------------------------------------------------------------- /src/components/Link/Link.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是 Link 组件,主要是针对 a 标签进行样式封装 4 | 5 | ### 演示 6 | 7 | - 普通使用 8 | 9 | ```js {"codepath": "base.jsx"} 10 | ``` 11 | -------------------------------------------------------------------------------- /src/components/Upload/index.jsx: -------------------------------------------------------------------------------- 1 | import Upload from './Upload'; 2 | export default Upload; 3 | 4 | import { readFile } from './utils'; 5 | Upload.readFile = readFile; 6 | -------------------------------------------------------------------------------- /src/components/Breadcrumb/BackButton.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 面包屑后退按钮组件,配合面包屑使用 4 | 5 | ### 演示 6 | 7 | #### 演示 8 | 9 | ```js {"codepath": "backbutton.jsx"} 10 | ``` 11 | -------------------------------------------------------------------------------- /src/components/Message/index.jsx: -------------------------------------------------------------------------------- 1 | import Message from './Message'; 2 | export default Message; 3 | 4 | import * as method from './method'; 5 | Object.assign(Message, method); 6 | -------------------------------------------------------------------------------- /src/components/Pagination/__tests__/__snapshots__/index.test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Pagination hideOnSinglePage 1`] = `null`; 4 | -------------------------------------------------------------------------------- /src/utils/isFunction.ts: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 2 | export default (v: any): v is (...args: any[]) => any => typeof v === 'function'; 3 | -------------------------------------------------------------------------------- /src/components/Layout/Sider.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 侧边导航 4 | 5 | ### 演示 6 | 7 | - 普通使用 8 | 9 | #### 侧边通栏 10 | 11 | ```js {"codepath": "full-sider.jsx"} 12 | ``` 13 | -------------------------------------------------------------------------------- /src/components/Modal/Content.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 弹窗内容容器组件,为了方便组合,没有将间距、滚动等内置,而是拆分为自组件 4 | 5 | ### 演示 6 | 7 | #### 演示 8 | 9 | ```js {"codepath": "content.jsx"} 10 | ``` 11 | -------------------------------------------------------------------------------- /src/components/Tooltip/index.tsx: -------------------------------------------------------------------------------- 1 | import type { TooltipProps } from './Tooltip'; 2 | import Tooltip from './Tooltip'; 3 | export default Tooltip; 4 | export type { TooltipProps }; 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "singleQuote": true, 4 | "useTabs": false, 5 | "semi": true, 6 | "trailingComma": "none", 7 | "arrowParens": "avoid" 8 | } 9 | -------------------------------------------------------------------------------- /src/components/Select/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | placeholder: '请选择', 3 | selected: '已选择 ', 4 | items: ' 项', 5 | emptyTip: '暂无数据', 6 | selectAll: '全选' 7 | }; 8 | -------------------------------------------------------------------------------- /src/components/Spin/style/index.js: -------------------------------------------------------------------------------- 1 | import styled from '@emotion/styled'; 2 | 3 | import { spinMixin } from 'src/style'; 4 | 5 | export const SpinWrap = styled('div')` 6 | ${spinMixin}; 7 | `; 8 | -------------------------------------------------------------------------------- /src/components/Tree/index.tsx: -------------------------------------------------------------------------------- 1 | import Tree from './Tree'; 2 | 3 | type TExportTree = typeof Tree; 4 | 5 | const ExportTree: TExportTree = Tree as TExportTree; 6 | 7 | export default ExportTree; 8 | -------------------------------------------------------------------------------- /shared/formLayout.js: -------------------------------------------------------------------------------- 1 | const formLayout = { 2 | labelCol: { 3 | span: 3 4 | }, 5 | controllerCol: { 6 | span: 9 7 | } 8 | }; 9 | 10 | export default formLayout; 11 | -------------------------------------------------------------------------------- /src/components/Breadcrumb/interface.ts: -------------------------------------------------------------------------------- 1 | import { tuple } from 'src/type'; 2 | 3 | export const StyleTypes = tuple('block-hover', 'hover', 'active'); 4 | export type StyleType = typeof StyleTypes[number]; 5 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/RingLoading.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ); 4 | -------------------------------------------------------------------------------- /src/components/ZForm/index.jsx: -------------------------------------------------------------------------------- 1 | import ZForm from './ZForm'; 2 | export default ZForm; 3 | 4 | import controllerDecorator from './controllerDecorator'; 5 | ZForm.controllerDecorator = controllerDecorator; 6 | -------------------------------------------------------------------------------- /webpack.dist.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const config = require('./webpack.config'); 4 | 5 | config.output.path = path.resolve(__dirname, 'dist'); 6 | 7 | module.exports = config; 8 | -------------------------------------------------------------------------------- /src/components/Table/ActionList.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - ActionList 已经抽离为外层组件,请使用 ActionList 替换 Table.ActionList 4 | 5 | ### 演示 6 | 7 | #### 演示 8 | 9 | ```js {"codepath": "actionList.jsx"} 10 | ``` 11 | -------------------------------------------------------------------------------- /src/components/ThemeProvider/material.js: -------------------------------------------------------------------------------- 1 | export default originTheme => { 2 | console.warn('Material theme is default theme now, please remove this generate function'); 3 | return originTheme; 4 | }; 5 | -------------------------------------------------------------------------------- /src/libs/dom-align/index.js: -------------------------------------------------------------------------------- 1 | import alignElement from './align/alignElement'; 2 | import alignPoint from './align/alignPoint'; 3 | 4 | export { alignElement, alignPoint }; 5 | 6 | export default alignElement; 7 | -------------------------------------------------------------------------------- /shared/sleep.js: -------------------------------------------------------------------------------- 1 | const sleep = duration => { 2 | return new Promise(resolve => { 3 | setTimeout(() => { 4 | resolve(); 5 | }, duration); 6 | }); 7 | }; 8 | export default sleep; 9 | -------------------------------------------------------------------------------- /src/components/Link/Button.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是 Link.Button 子组件,提供 Button 样式的 Link 组件,除了支持 Link 的属性外,还支持 Button 的样式属性 4 | 5 | ### 演示 6 | 7 | - 普通使用 8 | 9 | ```js {"codepath": "button.jsx"} 10 | ``` 11 | -------------------------------------------------------------------------------- /src/utils/isSafari.ts: -------------------------------------------------------------------------------- 1 | const isChrome = navigator.userAgent.toLowerCase().indexOf('chrome/') > -1; 2 | const isSafari = !isChrome && navigator.userAgent.toLowerCase().indexOf('safari/') > -1; 3 | export default isSafari; 4 | -------------------------------------------------------------------------------- /start-pm2.json: -------------------------------------------------------------------------------- 1 | { 2 | "apps": [ 3 | { 4 | "name": "react-components-styleguide", 5 | "script": "npm", 6 | "args": "run styleguide" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/components/Select/locale/en_US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | placeholder: 'Please select', 3 | selected: 'Selected ', 4 | items: ' items', 5 | emptyTip: 'Data is empty', 6 | selectAll: 'Select All' 7 | }; 8 | -------------------------------------------------------------------------------- /src/components/ThemeProvider/dark.js: -------------------------------------------------------------------------------- 1 | import designTokensDark from './designTokensDark'; 2 | 3 | // 主题唯一标识 4 | designTokensDark['T_THEME'] = 'dark'; 5 | 6 | export default { 7 | designTokens: designTokensDark 8 | }; 9 | -------------------------------------------------------------------------------- /src/utils/each.ts: -------------------------------------------------------------------------------- 1 | export default function (arr: T[], func: (item: T) => void) { 2 | const l = arr.length; 3 | for (let i = 0; i < l; i++) { 4 | const item = arr[i]; 5 | func(item); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Spin/Spin.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | * 只是一个 div 包裹容器,div 本身有自转的样式。 4 | * 传入其它原生的 props 会自动附加到最外层的 div 上,如 style、className 等 5 | 6 | ### 演示 7 | 8 | * 普通使用 9 | 10 | ```js {"codepath": "base.jsx"} 11 | ``` 12 | -------------------------------------------------------------------------------- /src/components/Skeleton/Skeleton.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 用作组件的简单占位符。 4 | 5 | ### 演示 6 | 7 | - 普通使用 8 | 9 | ```js {"codepath": "skeleton.jsx"} 10 | ``` 11 | 12 | - 使用案例 13 | 14 | ```js {"codepath": "usage.jsx"} 15 | ``` 16 | -------------------------------------------------------------------------------- /src/components/ThemeProvider/index.jsx: -------------------------------------------------------------------------------- 1 | import ThemeProvider from './ThemeProvider'; 2 | import useDesignTokens from './useDesignTokens'; 3 | 4 | ThemeProvider.useDesignTokens = useDesignTokens; 5 | 6 | export default ThemeProvider; 7 | -------------------------------------------------------------------------------- /src/hooks/useInitial.tsx: -------------------------------------------------------------------------------- 1 | import useIsInitial from './useIsInitial'; 2 | 3 | const useInitial = (cb: () => void) => { 4 | const isInitial = useIsInitial(); 5 | if (isInitial) cb(); 6 | }; 7 | 8 | export default useInitial; 9 | -------------------------------------------------------------------------------- /src/sharedComponents/Search/index.tsx: -------------------------------------------------------------------------------- 1 | import Search from './Search'; 2 | import Highlight from './Highlight'; 3 | import SearchInput from './SearchInput'; 4 | 5 | export default Search; 6 | 7 | export { Highlight, SearchInput }; 8 | -------------------------------------------------------------------------------- /src/components/Card/Action.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { ActionWrap } from './style'; 4 | 5 | const Action = ({ ...rest }) => { 6 | return ; 7 | }; 8 | 9 | export default Action; 10 | -------------------------------------------------------------------------------- /src/components/ThemeProvider/private.js: -------------------------------------------------------------------------------- 1 | import designTokensPrivate from './designTokensPrivate'; 2 | 3 | // 主题唯一标识 4 | designTokensPrivate['T_THEME'] = 'private'; 5 | 6 | export default { 7 | designTokens: designTokensPrivate 8 | }; 9 | -------------------------------------------------------------------------------- /.recodo/data/Spin.info.json: -------------------------------------------------------------------------------- 1 | { 2 | "Spin": { 3 | "path": "Spin/Spin.jsx", 4 | "name": "Spin", 5 | "info": { "description": { "description": "自转控件", "tags": [] }, "displayName": "Spin", "methods": [] } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Compact/style/index.js: -------------------------------------------------------------------------------- 1 | import config from 'src/config'; 2 | 3 | const { prefixCls: _prefixCls } = config; 4 | export const prefixCls = _prefixCls + '-compact'; 5 | 6 | export const controllerPrefix = prefixCls + '-controller'; 7 | -------------------------------------------------------------------------------- /src/components/Form/ControllerContext.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const ControllerContext = React.createContext<{ status?: 'default' | 'success' | 'warning' | 'error' | 'loading' }>({}); 4 | 5 | export default ControllerContext; 6 | -------------------------------------------------------------------------------- /src/components/Table/HoverDisplayArea.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 用于表单列中 hover 时才展示的元素,为了防止 hover 时宽度变化导致抖动,使用 visibility 来控制隐藏。 4 | 5 | ### 演示 6 | 7 | #### HoverDisplayArea 8 | 9 | ```js {"codepath": "hoverDisplayArea.jsx"} 10 | ``` 11 | -------------------------------------------------------------------------------- /src/components/TransferMenu/TransferMenu.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 这是 TransferMenu 组件,使用 Menu 来渲染 Transfer 的列表,支持 Transfer 的所有 props,可参考 Transfer 组件 4 | 5 | ### 演示 6 | 7 | #### 普通使用 8 | 9 | ```js {"codepath": "transferMenu.jsx"} 10 | ``` 11 | -------------------------------------------------------------------------------- /.styleguide/components/IsolateButton.jsx: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | export default class IsolateButton extends Component { 5 | render() { 6 | return null; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/components/Button/shared.ts: -------------------------------------------------------------------------------- 1 | import { tuple } from 'src/style'; 2 | 3 | export const StyleTypes = tuple('primary', 'border', 'border-gray'); 4 | export const Sizes = tuple('sm', 'md', 'lg'); 5 | export const Shapes = tuple('circle', 'square'); 6 | -------------------------------------------------------------------------------- /src/components/Card/Footer.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { FooterWrap } from './style'; 4 | 5 | const Footer = ({ ...rest }) => { 6 | return ; 7 | }; 8 | 9 | export default React.memo(Footer); 10 | -------------------------------------------------------------------------------- /src/components/Layout/Layout.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是 Layout 布局组件 4 | 5 | ### 演示 6 | 7 | #### 顶部通栏+侧边导航 8 | 9 | ```js {"codepath": "full-header.jsx"} 10 | ``` 11 | 12 | #### 顶部通栏 13 | 14 | ```js {"codepath": "no-sider.jsx"} 15 | ``` 16 | -------------------------------------------------------------------------------- /.stylelintrc: -------------------------------------------------------------------------------- 1 | { 2 | "processors": ["stylelint-processor-styled-components"], 3 | "extends": ["stylelint-config-recommended", "stylelint-config-styled-components"], 4 | "rules": { 5 | "no-descending-specificity": null 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Card/Content.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { ContentWrap } from './style'; 4 | 5 | const Content = ({ ...rest }) => { 6 | return ; 7 | }; 8 | 9 | export default React.memo(Content); 10 | -------------------------------------------------------------------------------- /src/components/Compact/Compact.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 用于控件间的连接式布局 4 | 5 | ### 演示 6 | 7 | #### 演示 8 | 9 | ```js {"codepath": "compact.jsx"} 10 | ``` 11 | 12 | #### sharedProps - 属性共享 13 | 14 | ```js {"codepath": "sharedProps.jsx"} 15 | ``` 16 | -------------------------------------------------------------------------------- /src/components/Menu/Item.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 这是菜单项组件 4 | 5 | ### 演示 6 | 7 | #### disabled - 是否禁用 8 | 9 | ```js {"codepath": "item-disabled.jsx"} 10 | ``` 11 | 12 | #### tooltip - 提示 13 | 14 | ```js {"codepath": "item-tooltip.jsx"} 15 | ``` 16 | -------------------------------------------------------------------------------- /src/components/Modal/index.jsx: -------------------------------------------------------------------------------- 1 | import Modal from './Modal'; 2 | export default Modal; 3 | 4 | import Content from './Content'; 5 | Modal.Content = Content; 6 | 7 | import * as method from './method'; 8 | 9 | Object.assign(Modal, method); 10 | -------------------------------------------------------------------------------- /src/components/Spin/Spin.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { SpinWrap } from './style'; 4 | 5 | /** 自转控件 */ 6 | const Spin = ({ ...rest }) => ; 7 | 8 | Spin.propTypes = {}; 9 | 10 | export default Spin; 11 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/Tick.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /src/components/Transfer/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | emptyTargetTip: '请从左侧列表选择', 3 | emptySourceTip: '暂无资源', 4 | emptySearchTip: '当前搜索或筛选结果为空', 5 | resetSearch: '重置列表', 6 | sourceTitle: '可选', 7 | targetTitle: '已选' 8 | }; 9 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 4 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = false 9 | insert_final_newline = true 10 | 11 | [{package.json,**/*.yml}] 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /src/components/Collapse/CollapseContext.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { defaultContext, GroupContext } from 'src/hooks/group'; 4 | 5 | const CollapseContext = React.createContext(defaultContext); 6 | export default CollapseContext; 7 | -------------------------------------------------------------------------------- /src/components/Menu/SubMenu.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 这是子菜单组组件 4 | 5 | ### 演示 6 | 7 | #### title - 标题 8 | 9 | ```js {"codepath": "submenu-title.jsx"} 10 | ``` 11 | 12 | #### styleType - 样式类型 13 | 14 | ```js {"codepath": "submenu-styleType.jsx"} 15 | ``` 16 | -------------------------------------------------------------------------------- /src/components/Textarea/Textarea.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 对原生 textarea 的简单封装,包含了一些样式 4 | 5 | ### 演示 6 | 7 | #### 演示 8 | 9 | ```js {"codepath": "textarea.jsx"} 10 | ``` 11 | 12 | #### disabled - 禁用 13 | 14 | ```js {"codepath": "disabled.jsx"} 15 | ``` 16 | -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.{js,jsx}": [ 3 | "prettier --write", 4 | "git add", 5 | "eslint", 6 | "jest --bail --findRelatedTests --collectCoverage" 7 | ], 8 | "*.{json,css,md}": ["prettier --write", "git add"] 9 | } 10 | -------------------------------------------------------------------------------- /src/components/Link/index.tsx: -------------------------------------------------------------------------------- 1 | import Link from './Link'; 2 | import Button from './Button'; 3 | 4 | import { ExportComponent } from 'src/type'; 5 | 6 | const ExportLink = ExportComponent(Link, { 7 | Button 8 | }); 9 | 10 | export default ExportLink; 11 | -------------------------------------------------------------------------------- /src/components/Transfer/Transfer.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 这是 Transfer 穿梭框组件,用于数据间的选择 4 | 5 | ### 演示 6 | 7 | #### 普通使用 8 | 9 | ```js {"codepath": "transfer.jsx"} 10 | ``` 11 | 12 | #### search - 自定义搜索 13 | 14 | ```js {"codepath": "transfer-search.jsx"} 15 | ``` 16 | -------------------------------------------------------------------------------- /src/utils/hoistStatics.js: -------------------------------------------------------------------------------- 1 | export default function hoistStatics(targetComponent, sourceComponent) { 2 | if ('defaultProps' in sourceComponent) { 3 | targetComponent.defaultProps = sourceComponent.defaultProps; 4 | } 5 | return targetComponent; 6 | } 7 | -------------------------------------------------------------------------------- /src/utils/string.ts: -------------------------------------------------------------------------------- 1 | import memo from './memo'; 2 | 3 | export const camel2Kebab = memo((s = ''): string => { 4 | return s.replace(/([A-Z])/g, (v, n, i) => { 5 | const r = v.toLowerCase() || ''; 6 | return i === 0 ? r : '-' + r; 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /src/hooks/useConfig.tsx: -------------------------------------------------------------------------------- 1 | import { useContext } from 'react'; 2 | 3 | import ConfigContext from 'src/components/ConfigProvider/ConfigContext'; 4 | 5 | const useConfig = () => { 6 | return useContext(ConfigContext); 7 | }; 8 | 9 | export default useConfig; 10 | -------------------------------------------------------------------------------- /src/utils/generateError.js: -------------------------------------------------------------------------------- 1 | /** 构建error */ 2 | const generateError = (message, name) => { 3 | const error = new Error(message); 4 | if (name) { 5 | error.name = name; 6 | } 7 | return error; 8 | }; 9 | 10 | export default generateError; 11 | -------------------------------------------------------------------------------- /src/components/Tree/TreeContext.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { Group, SelectedMap } from './interface'; 4 | 5 | const TreeContext = React.createContext<{ selectedMap: SelectedMap; group: Group }>({ selectedMap: {}, group: {} }); 6 | export default TreeContext; 7 | -------------------------------------------------------------------------------- /src/config.js: -------------------------------------------------------------------------------- 1 | const config = { 2 | prefixCls: 'uc-fe', 3 | actionListAutoAdjustment: false 4 | }; 5 | 6 | export default config; 7 | 8 | /** 只能在组件初始化时使用,否则会导致意外的问题 */ 9 | export const setConfig = _config => { 10 | Object.assign(config, _config); 11 | }; 12 | -------------------------------------------------------------------------------- /src/components/Form/index.jsx: -------------------------------------------------------------------------------- 1 | import Form from './Form'; 2 | export default Form; 3 | 4 | import Item from './Item'; 5 | Form.Item = Item; 6 | 7 | import Group from './Group'; 8 | Form.Group = Group; 9 | 10 | import SubArea from './SubArea'; 11 | Form.SubArea = SubArea; 12 | -------------------------------------------------------------------------------- /src/components/Radio/index.jsx: -------------------------------------------------------------------------------- 1 | import Radio from './Radio'; 2 | export default Radio; 3 | 4 | import Group from './Group'; 5 | Radio.Group = Group; 6 | 7 | import Button from './Button'; 8 | Radio.Button = Button; 9 | 10 | import Tag from './Tag'; 11 | Radio.Tag = Tag; 12 | -------------------------------------------------------------------------------- /src/components/TransferTable/TransferTable.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是 TransferTable 组件,使用 Table 来渲染 Transfer 的列表,支持 Transfer 的所有 props,可参考 Transfer 组件 4 | - 性能考虑,数量超过 400 条时会出现分页器 5 | 6 | ### 演示 7 | 8 | #### 普通使用 9 | 10 | ```js {"codepath": "transferTable.jsx"} 11 | ``` 12 | -------------------------------------------------------------------------------- /src/utils/warning.ts: -------------------------------------------------------------------------------- 1 | import once from './once'; 2 | 3 | const warning = (msg: string) => { 4 | console.error(`URC Warning: ${msg}`); 5 | }; 6 | export default warning; 7 | 8 | const onceWarning = (msg: string) => once(() => warning(msg)); 9 | export { onceWarning }; 10 | -------------------------------------------------------------------------------- /src/utils/pick.ts: -------------------------------------------------------------------------------- 1 | export default (obj: T, keys: (keyof T)[]) => { 2 | const result: any = {}; 3 | keys.forEach(key => { 4 | if (key in obj) { 5 | result[key] = obj[key]; 6 | } 7 | }); 8 | return result as Pick; 9 | }; 10 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'scope-empty': [2, 'never'], 4 | 'scope-case': [2, 'always', ['lower-case', 'camel-case', 'pascal-case']], 5 | 'footer-leading-blank': [0] 6 | }, 7 | extends: ['@commitlint/config-conventional'] 8 | }; 9 | -------------------------------------------------------------------------------- /shared/demoUtil.jsx: -------------------------------------------------------------------------------- 1 | import DemoBlock from './DemoBlock'; 2 | import DemoWrap from './DemoWrap'; 3 | import formLayout from './formLayout'; 4 | 5 | const Sizes = ['sm', 'md', 'lg']; 6 | const defaultSize = 'md'; 7 | 8 | export default { DemoBlock, DemoWrap, formLayout, Sizes, defaultSize }; 9 | -------------------------------------------------------------------------------- /.recodo/interface.ts: -------------------------------------------------------------------------------- 1 | export interface ConfigInfo { 2 | type: string; 3 | desc?: string; 4 | options?: []; 5 | defaultValue?: any; 6 | optionToProps?: (option: any) => any; 7 | } 8 | 9 | export interface Config { 10 | [key: string]: string | [] | ConfigInfo; 11 | } 12 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/CrossBold.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /tests/imageSetup.js: -------------------------------------------------------------------------------- 1 | 2 | // add some helpful assertions 3 | import '@testing-library/jest-dom/extend-expect'; 4 | 5 | // This was here before as we added it earlier. We still need it. 6 | import { toMatchImageSnapshot } from 'jest-image-snapshot'; 7 | 8 | expect.extend({ toMatchImageSnapshot }); 9 | -------------------------------------------------------------------------------- /src/components/Transfer/locale/en_US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | emptyTargetTip: 'Please select from left', 3 | emptySourceTip: 'No data', 4 | emptySearchTip: 'No search data', 5 | resetSearch: 'Reset search', 6 | sourceTitle: 'Selectable Items', 7 | targetTitle: 'Selected Items' 8 | }; 9 | -------------------------------------------------------------------------------- /src/utils/deprecatedLog.ts: -------------------------------------------------------------------------------- 1 | import once from './once'; 2 | 3 | const deprecatedLog = (name: string, insteadName: string) => 4 | once(() => { 5 | console.error(`URC Deprecated: ${name} will be deprecated, please use ${insteadName} to replace`); 6 | }); 7 | 8 | export default deprecatedLog; 9 | -------------------------------------------------------------------------------- /.recodo/data/Spin.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "Spin": { 3 | "path": "Spin/Spin.md", 4 | "name": "Spin", 5 | "info": "### 说明\n\n* 只是一个 div 包裹容器,div 本身有自转的样式。\n* 传入其它原生的 props 会自动附加到最外层的 div 上,如 style、className 等\n\n### 演示\n\n* 普通使用\n\n```js {\"codepath\": \"base.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Collapse/index.tsx: -------------------------------------------------------------------------------- 1 | import { ExportComponent } from 'src/type'; 2 | 3 | import Collapse from './Collapse'; 4 | import Panel from './Panel'; 5 | 6 | const ExportCollapse = ExportComponent(Collapse, { 7 | Panel 8 | }); 9 | 10 | export default ExportCollapse; 11 | export { Panel }; 12 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/Cross.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /.recodo/data/Skeleton.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "Skeleton": { 3 | "path": "Skeleton/Skeleton.md", 4 | "name": "Skeleton", 5 | "info": "### 说明\n\n用作组件的简单占位符。\n\n### 演示\n\n- 普通使用\n\n```js {\"codepath\": \"skeleton.jsx\"}\n```\n\n- 使用案例\n\n```js {\"codepath\": \"usage.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Notice/Notice.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 这是 Notice 提示框组件 4 | 5 | ### 演示 6 | 7 | #### 演示 8 | 9 | ```js {"codepath": "notice.jsx"} 10 | ``` 11 | 12 | #### 普通使用 13 | 14 | ```js {"codepath": "base.jsx"} 15 | ``` 16 | 17 | #### 自定义是否可关闭、自定义图标、自定义操作 18 | 19 | ```js {"codepath": "custom.jsx"} 20 | ``` 21 | -------------------------------------------------------------------------------- /src/components/Tag/index.tsx: -------------------------------------------------------------------------------- 1 | import { ExportComponent } from 'src/type'; 2 | 3 | import Tag from './Tag'; 4 | import Group from './Group'; 5 | import IconTag from './Icon'; 6 | 7 | const ExportTag = ExportComponent(Tag, { 8 | Group, 9 | Icon: IconTag 10 | }); 11 | 12 | export default ExportTag; 13 | -------------------------------------------------------------------------------- /src/components/Badge/index.tsx: -------------------------------------------------------------------------------- 1 | import { ExportComponent } from 'src/type'; 2 | 3 | import Badge, { BadgeProps } from './Badge'; 4 | import Bubble from './Bubble'; 5 | 6 | const ExportBadge = ExportComponent(Badge, { 7 | Bubble 8 | }); 9 | 10 | export default ExportBadge; 11 | export type { BadgeProps }; 12 | -------------------------------------------------------------------------------- /src/components/Table/SearchInput.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是 SearchInput 表格搜索框 4 | - 使用 context 和 table 通信,所以需要嵌入到 table 中才起作用(title,footer) 5 | - 自定义搜索配合 Table.handleSearch 使用 6 | - 支持所有 Input 的 props 7 | 8 | ### 演示 9 | 10 | #### searchInput - 演示 11 | 12 | ```js {"codepath": "searchInput.jsx"} 13 | ``` 14 | -------------------------------------------------------------------------------- /.recodo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@ucloud-fe/react-components-docs", 3 | "version": "0.0.1", 4 | "description": "", 5 | "main": "index.tsx", 6 | "scripts": { 7 | }, 8 | "author": "ZxBing0066@gmail.com", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@ucloud-fe/mod": "^1" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/Link/__demo__/base.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Link from 'src/components/Link'; 4 | 5 | // demo start 6 | const Demo = () => ( 7 | 8 | Link to Google 9 | 10 | ); 11 | // demo end 12 | 13 | export default Demo; 14 | -------------------------------------------------------------------------------- /src/components/Slider/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | currentValueIs: '当前生效值为', 3 | inputValueIs: '输入值为', 4 | period: '。', 5 | semicolon: ';', 6 | colon: ':', 7 | comma: ',', 8 | input: '输入', 9 | isValid: '合法', 10 | isInvalid: '不合法', 11 | tip: '请回车或者点击它处自动计算最相近合法值' 12 | }; 13 | -------------------------------------------------------------------------------- /src/components/Spin/__demo__/base.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Spin from 'src/components/Spin'; 4 | 5 | // demo start 6 | const Demo = () => ( 7 | 8 |

这是一行会旋转的文字

9 |
10 | ); 11 | // demo end 12 | 13 | export default Demo; 14 | -------------------------------------------------------------------------------- /src/hooks/useConstructor.tsx: -------------------------------------------------------------------------------- 1 | import { useRef } from 'react'; 2 | 3 | const useConstructor = (callBack: () => void) => { 4 | const hasBeenCalled = useRef(false); 5 | if (hasBeenCalled.current) return; 6 | callBack?.(); 7 | hasBeenCalled.current = true; 8 | }; 9 | 10 | export default useConstructor; 11 | -------------------------------------------------------------------------------- /tests/lib.manual.test.js: -------------------------------------------------------------------------------- 1 | const components = require('../dist/main.min.js'); 2 | const libComponents = require('../lib/index.js'); 3 | 4 | describe('Lib Test', () => { 5 | test('output libs is equal to components', () => { 6 | expect(Object.keys(components)).toEqual(Object.keys(libComponents)); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /.recodo/data/Compact.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "Compact": { 3 | "path": "Compact/Compact.md", 4 | "name": "Compact", 5 | "info": "### 说明\n\n- 用于控件间的连接式布局\n\n### 演示\n\n#### 演示\n\n```js {\"codepath\": \"compact.jsx\"}\n```\n\n#### sharedProps - 属性共享\n\n```js {\"codepath\": \"sharedProps.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/ConfigProvider/index.tsx: -------------------------------------------------------------------------------- 1 | import { setConfig } from 'src/config'; 2 | import { ExportComponent } from 'src/type'; 3 | 4 | import ConfigProvider from './ConfigProvider'; 5 | 6 | const ExportConfigProvider = ExportComponent(ConfigProvider, { 7 | setConfig 8 | }); 9 | 10 | export default ExportConfigProvider; 11 | -------------------------------------------------------------------------------- /src/components/LocaleProvider/index.jsx: -------------------------------------------------------------------------------- 1 | import { ExportComponent } from 'src/type'; 2 | 3 | import LocaleProvider from './LocaleProvider'; 4 | import useLocale from './useLocale'; 5 | 6 | const ExportLocaleProvider = ExportComponent(LocaleProvider, { 7 | useLocale 8 | }); 9 | 10 | export default ExportLocaleProvider; 11 | -------------------------------------------------------------------------------- /src/hooks/useIsInitial.tsx: -------------------------------------------------------------------------------- 1 | import { useEffect, useRef } from 'react'; 2 | 3 | const useIsInitial = () => { 4 | const isFirst = useRef(true); 5 | useEffect(() => { 6 | setTimeout(() => (isFirst.current = false), 0); 7 | }, []); 8 | return isFirst.current; 9 | }; 10 | 11 | export default useIsInitial; 12 | -------------------------------------------------------------------------------- /src/utils/KeyCode.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | ZERO: 48, 3 | NINE: 57, 4 | 5 | NUMPAD_ZERO: 96, 6 | NUMPAD_NINE: 105, 7 | 8 | BACKSPACE: 8, 9 | TAB: 9, 10 | ENTER: 13, 11 | DELETE: 46, 12 | 13 | ARROW_UP: 38, 14 | ARROW_DOWN: 40, 15 | ARROW_LEFT: 37, 16 | ARROW_RIGHT: 39 17 | }; 18 | -------------------------------------------------------------------------------- /src/components/Calendar/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | const months = '1_2_3_4_5_6_7_8_9_10_11_12'.split('_').map(v => `${v}月`); 2 | const weekdays = '日_一_二_三_四_五_六'.split('_'); 3 | 4 | export default { 5 | month: '月', 6 | year: '年', 7 | monthBeforeYear: false, 8 | months, 9 | weekdays, 10 | disabledTip: '当前日期不可选' 11 | }; 12 | -------------------------------------------------------------------------------- /.recodo/data/Textarea.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "Textarea": { 3 | "path": "Textarea/Textarea.md", 4 | "name": "Textarea", 5 | "info": "### 说明\n\n- 对原生 textarea 的简单封装,包含了一些样式\n\n### 演示\n\n#### 演示\n\n```js {\"codepath\": \"textarea.jsx\"}\n```\n\n#### disabled - 禁用\n\n```js {\"codepath\": \"disabled.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Menu/index.tsx: -------------------------------------------------------------------------------- 1 | import { ExportComponent } from 'src/type'; 2 | 3 | import Menu from './Menu'; 4 | import Item from './Item'; 5 | import SubMenu from './SubMenu'; 6 | 7 | const ExportMenu = ExportComponent(Menu, { 8 | Item, 9 | SubMenu 10 | }); 11 | 12 | export default ExportMenu; 13 | export { Item, SubMenu }; 14 | -------------------------------------------------------------------------------- /src/components/Notice/index.tsx: -------------------------------------------------------------------------------- 1 | import { ExportComponent } from 'src/type'; 2 | 3 | import Notice, { StyleTypes, NoticeProps } from './Notice'; 4 | 5 | const ExportNotice = ExportComponent(Notice, { 6 | /** @deprecated */ 7 | StyleType: StyleTypes 8 | }); 9 | 10 | export default ExportNotice; 11 | export type { NoticeProps }; 12 | -------------------------------------------------------------------------------- /src/components/Table/ExpandedRowContent.jsx: -------------------------------------------------------------------------------- 1 | import React, { PureComponent } from 'react'; 2 | 3 | import { ExpandedRowContent } from './style'; 4 | 5 | export class ExpandedRow extends PureComponent { 6 | render() { 7 | return ; 8 | } 9 | } 10 | 11 | export default ExpandedRow; 12 | -------------------------------------------------------------------------------- /.recodo/data/Transfer.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "Transfer": { 3 | "path": "Transfer/Transfer.md", 4 | "name": "Transfer", 5 | "info": "### 说明\n\n这是 Transfer 穿梭框组件,用于数据间的选择\n\n### 演示\n\n#### 普通使用\n\n```js {\"codepath\": \"transfer.jsx\"}\n```\n\n#### search - 自定义搜索\n\n```js {\"codepath\": \"transfer-search.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.styleguide/components/Preview.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Preview from 'react-styleguidist/lib/client/rsg-components/Preview/Preview'; 3 | import { DarkThemeContext } from './StyleGuideRenderer'; 4 | 5 | export default props => { 6 | const darkTheme = React.useContext(DarkThemeContext); 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /src/components/Switch/index.tsx: -------------------------------------------------------------------------------- 1 | import Switch, { SwitchProps } from './Switch'; 2 | 3 | type TExportSwitch = typeof Switch & { 4 | Sizes: ('sm' | 'md' | 'lg')[]; 5 | }; 6 | 7 | const ExportSwitch = Switch as TExportSwitch; 8 | ExportSwitch.Sizes = ['sm', 'md', 'lg']; 9 | 10 | export default Switch; 11 | export type { SwitchProps }; 12 | -------------------------------------------------------------------------------- /src/components/Tabs/Pane.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | tabs 的面板,必须传入唯一的 key 才可正常工作 4 | 5 | ### 演示 6 | 7 | #### 演示 8 | 9 | ```js {"codepath": "pane.jsx"} 10 | ``` 11 | 12 | #### disabled - 禁用 13 | 14 | ```js {"codepath": "pane-disabled.jsx"} 15 | ``` 16 | 17 | #### forceRender - 强制直接渲染 18 | 19 | ```js {"codepath": "pane-forceRender.jsx"} 20 | ``` 21 | -------------------------------------------------------------------------------- /src/components/ThemeProvider/ThemeProvider.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 这是主题化组件,正常用于包裹整个程序来替换颜色主题等 4 | 5 | ### 演示 6 | 7 | #### 主题展示 8 | 9 | ```js {"codepath": "themeprovider.jsx"} 10 | ``` 11 | 12 | #### useDesignTokens 13 | 14 | 不提供 useTheme 是因为 theme 中除了 DT 还有一些其它内部属性,不适合暴露,故只暴露 DT。 15 | 16 | ```js {"codepath": "useDesignTokens.jsx"} 17 | ``` 18 | -------------------------------------------------------------------------------- /src/hooks/useDidMount.tsx: -------------------------------------------------------------------------------- 1 | import { useEffect } from 'react'; 2 | 3 | const useDidMount = (callBack: () => void) => { 4 | useEffect(() => { 5 | callBack?.(); 6 | // only run when first mounted 7 | // eslint-disable-next-line react-hooks/exhaustive-deps 8 | }, []); 9 | }; 10 | 11 | export default useDidMount; 12 | -------------------------------------------------------------------------------- /src/utils/isEmpty.ts: -------------------------------------------------------------------------------- 1 | import isFunction from './isFunction'; 2 | 3 | export default (v: any): v is T => { 4 | if (!v) return true; 5 | if (isFunction(v)) return true; 6 | if ('length' in v) return !v.length; 7 | if ('size' in v) return !v.size; 8 | if (Object.keys(v).length) return false; 9 | return true; 10 | }; 11 | -------------------------------------------------------------------------------- /.recodo/data/TransferMenu.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "TransferMenu": { 3 | "path": "TransferMenu/TransferMenu.md", 4 | "name": "TransferMenu", 5 | "info": "### 说明\n\n这是 TransferMenu 组件,使用 Menu 来渲染 Transfer 的列表,支持 Transfer 的所有 props,可参考 Transfer 组件\n\n### 演示\n\n#### 普通使用\n\n```js {\"codepath\": \"transferMenu.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Collapse/Collapse.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 对内容进行分组并控制显示隐藏 4 | 5 | ### 演示 6 | 7 | #### 演示 8 | 9 | ```js {"codepath": "collapse.jsx"} 10 | ``` 11 | 12 | #### multiple - 同时展开多个 13 | 14 | ```js {"codepath": "collapse-multiple.jsx"} 15 | ``` 16 | 17 | #### uncontrolled 18 | 19 | ```js {"codepath": "collapse-uncontrolled.jsx"} 20 | ``` 21 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/CircleMarkFill.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/Minus.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 8 | )); 9 | -------------------------------------------------------------------------------- /src/components/LocaleProvider/LocaleContext.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export interface LocaleMap { 4 | [localeName: string]: string; 5 | } 6 | export interface AllLocaleMap { 7 | [componentName: string]: LocaleMap; 8 | } 9 | 10 | const LocaleContext = React.createContext({}); 11 | 12 | export default LocaleContext; 13 | -------------------------------------------------------------------------------- /src/components/Nav/util.ts: -------------------------------------------------------------------------------- 1 | import { ItemType } from './type'; 2 | 3 | export const getTreeAllKeys = (keys: React.Key[] = [], treeData: ItemType[]) => { 4 | treeData.forEach(v => { 5 | v?.key && !keys.includes(v.key) && keys.push(v.key); 6 | v?.children && getTreeAllKeys(keys, v.children); 7 | }); 8 | return keys; 9 | }; 10 | -------------------------------------------------------------------------------- /src/components/Radio/Tag.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Radio from './Radio'; 4 | 5 | /** @deprecated */ 6 | const Button = props => { 7 | console.warn('This will be deprecated, please use to instead!'); 8 | return ; 9 | }; 10 | 11 | export default Button; 12 | -------------------------------------------------------------------------------- /src/components/Radio/Button.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Radio from './Radio'; 4 | 5 | /** @deprecated */ 6 | const Button = props => { 7 | console.warn('This will be deprecated, please use to instead!'); 8 | return ; 9 | }; 10 | 11 | export default Button; 12 | -------------------------------------------------------------------------------- /src/components/ThemeProvider/runtime.js: -------------------------------------------------------------------------------- 1 | import defaultTheme from './theme'; 2 | 3 | let runtimeTheme = defaultTheme; 4 | 5 | const setRuntimeTheme = _runtimeTheme => { 6 | runtimeTheme = _runtimeTheme; 7 | }; 8 | const getRuntimeTheme = () => { 9 | return runtimeTheme || defaultTheme; 10 | }; 11 | 12 | export { setRuntimeTheme, getRuntimeTheme }; 13 | -------------------------------------------------------------------------------- /src/style/interface.ts: -------------------------------------------------------------------------------- 1 | import { defaultDesignTokens, defaultTheme } from 'src/components/ThemeProvider/theme'; 2 | 3 | export type DesignTokens = typeof defaultDesignTokens; 4 | export type DesignToken = keyof DesignTokens; 5 | export interface Theme { 6 | designTokens: DesignTokens; 7 | [key: string]: unknown; 8 | } 9 | export { defaultTheme }; 10 | -------------------------------------------------------------------------------- /.recodo/componentDemos/Skeleton.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Skeleton, Box } from '@ucloud-fe/react-components'; 3 | 4 | const Demo = () => { 5 | return ( 6 | 7 | 8 | 9 | 10 | ); 11 | }; 12 | 13 | export default React.memo(Demo); 14 | -------------------------------------------------------------------------------- /src/components/Breadcrumb/Breadcrumb.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 面包屑组件,配合子组件 Item 使用 4 | 5 | ### 演示 6 | 7 | #### 演示 8 | 9 | ```js {"codepath": "breadcrumb.jsx"} 10 | ``` 11 | 12 | #### separator - 分隔符 13 | 14 | ```js {"codepath": "breadcrumb-separator.jsx"} 15 | ``` 16 | 17 | #### styleType - 样式风格 18 | 19 | ```js {"codepath": "breadcrumb-styleType.jsx"} 20 | ``` 21 | -------------------------------------------------------------------------------- /.recodo/data/Notice.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "Notice": { 3 | "path": "Notice/Notice.md", 4 | "name": "Notice", 5 | "info": "### 说明\n\n这是 Notice 提示框组件\n\n### 演示\n\n#### 演示\n\n```js {\"codepath\": \"notice.jsx\"}\n```\n\n#### 普通使用\n\n```js {\"codepath\": \"base.jsx\"}\n```\n\n#### 自定义是否可关闭、自定义图标、自定义操作\n\n```js {\"codepath\": \"custom.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Checkbox/interface.ts: -------------------------------------------------------------------------------- 1 | import type { Size } from 'src/type'; 2 | import { Sizes, tuple } from 'src/style'; 3 | 4 | export const StyleTypes = tuple('default', 'card'); 5 | export type StyleType = typeof StyleTypes[number]; 6 | export type { Size }; 7 | export type Value = string | number; 8 | export type ValueMap = Map; 9 | export { Sizes }; 10 | -------------------------------------------------------------------------------- /src/components/Badge/__tests__/index.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { mount } from 'enzyme'; 3 | 4 | import Badge from 'src/components/Badge'; 5 | 6 | describe('Badge', () => { 7 | test('max value useful', () => { 8 | const wrapper = mount(); 9 | expect(wrapper.html().indexOf('99+') >= 0).toBe(true); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /src/components/Menu/MenuContext.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { defaultContext, GroupContext } from 'src/hooks/group'; 4 | import LOCALE from './locale/zh_CN'; 5 | 6 | const MenuContext = React.createContext({ 7 | ...defaultContext, 8 | locale: LOCALE 9 | }); 10 | export default MenuContext; 11 | -------------------------------------------------------------------------------- /.recodo/data/TransferTable.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "TransferTable": { 3 | "path": "TransferTable/TransferTable.md", 4 | "name": "TransferTable", 5 | "info": "### 说明\n\n- 这是 TransferTable 组件,使用 Table 来渲染 Transfer 的列表,支持 Transfer 的所有 props,可参考 Transfer 组件\n- 性能考虑,数量超过 400 条时会出现分页器\n\n### 演示\n\n#### 普通使用\n\n```js {\"codepath\": \"transferTable.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Breadcrumb/BackButton.tsx: -------------------------------------------------------------------------------- 1 | import React, { HTMLAttributes } from 'react'; 2 | 3 | import { ButtonProps } from 'src/components/Button/Button'; 4 | 5 | import { BackButtonWrap } from './style'; 6 | 7 | const BackButton = (props: ButtonProps & HTMLAttributes) => { 8 | return ; 9 | }; 10 | 11 | export default BackButton; 12 | -------------------------------------------------------------------------------- /src/components/Input/Search.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是 Search 组件,用于搜索,支持除了 suffix 以外的所有 Input 的 props 4 | - 在点击搜索按钮或者回车时会触发搜索事件 5 | 6 | ### 演示 7 | 8 | #### 演示 9 | 10 | ```js {"codepath": "search.jsx"} 11 | ``` 12 | 13 | #### size - 尺寸 14 | 15 | ```js {"codepath": "search-size.jsx"} 16 | ``` 17 | 18 | #### disabled - 禁用 19 | 20 | ```js {"codepath": "search-disabled.jsx"} 21 | ``` 22 | -------------------------------------------------------------------------------- /src/components/LocaleProvider/runtime.ts: -------------------------------------------------------------------------------- 1 | import { AllLocaleMap } from './LocaleContext'; 2 | 3 | let runtimeLocale: AllLocaleMap = {}; 4 | 5 | const setRuntimeLocale = (_runtimeLocale: AllLocaleMap) => { 6 | runtimeLocale = _runtimeLocale; 7 | }; 8 | const getRuntimeLocale = () => { 9 | return runtimeLocale; 10 | }; 11 | 12 | export { setRuntimeLocale, getRuntimeLocale }; 13 | -------------------------------------------------------------------------------- /src/components/Card/index.jsx: -------------------------------------------------------------------------------- 1 | import Card from './Card'; 2 | export default Card; 3 | 4 | import Header from './Header'; 5 | import Action from './Action'; 6 | import Content from './Content'; 7 | import Footer from './Footer'; 8 | import SubArea from './SubArea'; 9 | 10 | Object.assign(Card, { 11 | Header, 12 | Action, 13 | Content, 14 | Footer, 15 | SubArea 16 | }); 17 | -------------------------------------------------------------------------------- /src/components/Table/ColumnConfigButton.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是 ColumnConfigButton 表头配置弹窗按钮 4 | - 使用 context 和 table 通信,所以需要嵌入到 table 中才起作用(title,footer) 5 | 6 | ### 演示 7 | 8 | #### columnConfigButton 9 | 10 | ```js {"codepath": "columnConfigButton.jsx"} 11 | ``` 12 | 13 | #### modalProps - 弹窗自定义 props 设置 14 | 15 | ```js {"codepath": "columnConfigButton-modalProps.jsx"} 16 | ``` 17 | -------------------------------------------------------------------------------- /src/components/ThemeProvider/useDesignTokens.tsx: -------------------------------------------------------------------------------- 1 | import { useTheme } from 'emotion-theming'; 2 | 3 | import { defaultTheme, Theme } from 'src/style'; 4 | 5 | const useDesignTokens = () => { 6 | const theme = useTheme(); 7 | if (!Object.keys(theme).length) return defaultTheme.designTokens; 8 | return theme.designTokens; 9 | }; 10 | 11 | export default useDesignTokens; 12 | -------------------------------------------------------------------------------- /src/utils/memo.js: -------------------------------------------------------------------------------- 1 | export default handle => { 2 | const memoMap = {}; 3 | return (key, ...args) => { 4 | // eslint-disable-next-line no-prototype-builtins 5 | if (memoMap.hasOwnProperty(key)) { 6 | return memoMap[key]; 7 | } 8 | const returnValue = handle(key, ...args); 9 | return (memoMap[key] = returnValue); 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /src/utils/once.ts: -------------------------------------------------------------------------------- 1 | const once = (func: (...args: A) => R): ((...args: A) => R) => { 2 | let result: R; 3 | let done = false; 4 | return function (...args: A) { 5 | if (!done) { 6 | done = true; 7 | result = func(...args); 8 | } 9 | return result; 10 | }; 11 | }; 12 | 13 | export default once; 14 | -------------------------------------------------------------------------------- /src/components/Select/index.tsx: -------------------------------------------------------------------------------- 1 | import { ExportComponent, Sizes } from 'src/type'; 2 | 3 | import Select from './Select'; 4 | import Option from './Option'; 5 | import Group from './Group'; 6 | import Extra from './Extra'; 7 | 8 | const ExportSelect = ExportComponent(Select, { 9 | Option, 10 | Group, 11 | Extra, 12 | Size: Sizes 13 | }); 14 | 15 | export default ExportSelect; 16 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/LineArrowDown.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /src/components/Progress/Progress.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 这是 Progress 组件 4 | 5 | ### 演示 6 | 7 | #### 普通使用 8 | 9 | ```js {"codepath": "base.jsx"} 10 | ``` 11 | 12 | #### format - 展示文字的格式化 13 | 14 | ```js {"codepath": "format.jsx"} 15 | ``` 16 | 17 | #### color - 进度条颜色 18 | 19 | ```js {"codepath": "color.jsx"} 20 | ``` 21 | 22 | #### custom - 自定义 23 | 24 | ```js {"codepath": "custom.jsx"} 25 | ``` 26 | -------------------------------------------------------------------------------- /src/components/Slider/locale/en_US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | currentValueIs: 'Current value is ', 3 | inputValueIs: 'Input value is ', 4 | period: '.', 5 | semicolon: ';', 6 | colon: ':', 7 | comma: ', ', 8 | input: 'Input', 9 | isValid: ' is valid', 10 | isInvalid: ' is invalid', 11 | tip: 'Please press enter or click other place to accept valid value' 12 | }; 13 | -------------------------------------------------------------------------------- /src/components/Link/Link.tsx: -------------------------------------------------------------------------------- 1 | import React, { HTMLAttributes } from 'react'; 2 | 3 | import { SLink } from './style'; 4 | 5 | type LinkProps = { 6 | /** a 标签的链接 */ 7 | href?: string; 8 | /** 打开方式 */ 9 | target?: string; 10 | } & HTMLAttributes; 11 | 12 | const Link = (props: LinkProps) => { 13 | return ; 14 | }; 15 | 16 | export default Link; 17 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/LineArrowUp.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /src/components/TransferMenu/style/index.js: -------------------------------------------------------------------------------- 1 | import styled from '@emotion/styled'; 2 | 3 | import config from 'src/config'; 4 | 5 | const { prefixCls: _prefixCls } = config; 6 | export const prefixCls = _prefixCls + '-transfer-menu'; 7 | export const menuCls = prefixCls + '-transfer-menu'; 8 | 9 | export const MenuWrap = styled('div')` 10 | .${menuCls} { 11 | max-height: 300px; 12 | } 13 | `; 14 | -------------------------------------------------------------------------------- /src/components/Pagination/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // Options.jsx 3 | itemsPerPage: '条/页', 4 | jumpTo: '跳至', 5 | jumpToConfirm: '确定', 6 | page: '页', 7 | 8 | // Pagination.jsx 9 | prevPage: '上一页', 10 | nextPage: '下一页', 11 | prev5: '向前 5 页', 12 | next5: '向后 5 页', 13 | prev3: '向前 3 页', 14 | next3: '向后 3 页', 15 | total: '总计', 16 | items: '条' 17 | }; 18 | -------------------------------------------------------------------------------- /src/components/Loading/Loading.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 这是 Loading 组件 4 | 5 | ### 演示 6 | 7 | #### 演示 8 | 9 | ```js {"codepath": "loading.jsx"} 10 | ``` 11 | 12 | #### loading - 是否加载 13 | 14 | ```js {"codepath": "showLoading.jsx"} 15 | ``` 16 | 17 | #### indicator - 自定义指示符 18 | 19 | ```js {"codepath": "indicator.jsx"} 20 | ``` 21 | 22 | #### 包裹 inline-block 元素 23 | 24 | ```js {"codepath": "inlineBlock.jsx"} 25 | ``` 26 | -------------------------------------------------------------------------------- /src/components/SvgIcon/__demo__/svgIcon-type.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import SvgIcon from 'src/components/SvgIcon'; 4 | 5 | // demo start 6 | const layout = { 7 | style: { 8 | marginRight: 10 9 | } 10 | }; 11 | const { Type } = SvgIcon; 12 | const Demo = () =>
{Type.map(type => )}
; 13 | // demo end 14 | 15 | export default Demo; 16 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/ArrowUp.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 8 | )); 9 | -------------------------------------------------------------------------------- /src/components/Upload/__demo__/base.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Upload from 'src/components/Upload'; 3 | 4 | // demo start 5 | const Demo = () => ( 6 | console.log(fileList)} 8 | onError={({ message, name }) => alert(`there is an error of ${name}: ${message}`)} 9 | multiple 10 | /> 11 | ); 12 | // demo end 13 | 14 | export default Demo; 15 | -------------------------------------------------------------------------------- /src/components/Upload/__demo__/multiple.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Upload from 'src/components/Upload'; 3 | 4 | // demo start 5 | const Demo = () => ( 6 | console.log(fileList)} 8 | onError={({ message, name }) => alert(`there is an error of ${name}: ${message}`)} 9 | multiple 10 | /> 11 | ); 12 | // demo end 13 | 14 | export default Demo; 15 | -------------------------------------------------------------------------------- /src/components/Cascader/CascadeContext.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import noop from 'src/utils/noop'; 4 | 5 | import { Key } from './interface'; 6 | 7 | const CascadeContext = React.createContext<{ 8 | expandItem: (expandedKey: Key[]) => void; 9 | selectItem: (selectedKey: Key[]) => void; 10 | }>({ 11 | expandItem: noop, 12 | selectItem: noop 13 | }); 14 | 15 | export default CascadeContext; 16 | -------------------------------------------------------------------------------- /src/components/Layout/index.tsx: -------------------------------------------------------------------------------- 1 | import { ExportComponent } from 'src/type'; 2 | 3 | import Layout from './Layout'; 4 | import Header from './Header'; 5 | import Sider from './Sider'; 6 | import Content from './Content'; 7 | import Footer from './Footer'; 8 | 9 | const ExportLayout = ExportComponent(Layout, { 10 | Header, 11 | Sider, 12 | Content, 13 | Footer 14 | }); 15 | 16 | export default ExportLayout; 17 | -------------------------------------------------------------------------------- /src/components/SvgIcon/__demo__/svgIcon-spin.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import SvgIcon from 'src/components/SvgIcon'; 4 | 5 | // demo start 6 | const layout = { 7 | style: { 8 | marginRight: 10 9 | } 10 | }; 11 | const { Type } = SvgIcon; 12 | const Demo = () =>
{Type.map(type => )}
; 13 | // demo end 14 | 15 | export default Demo; 16 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/ArrowDown.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 8 | )); 9 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/ArrowRight.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 8 | )); 9 | -------------------------------------------------------------------------------- /src/components/Tabs/RefContext.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export type GetRef = (name: string) => HTMLElement | null; 4 | export type SaveRef = (name: string) => (node: HTMLElement | null) => void; 5 | 6 | const RefContext = React.createContext<{ 7 | getRef: GetRef; 8 | saveRef: SaveRef; 9 | }>({ 10 | getRef: () => null, 11 | saveRef: () => () => null 12 | }); 13 | 14 | export default RefContext; 15 | -------------------------------------------------------------------------------- /.recodo/componentDemos/PopConfirm.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { PopConfirm, Box, Button } from '@ucloud-fe/react-components'; 3 | 4 | const Demo = () => { 5 | return ( 6 | 7 | 8 | 9 | 10 | 11 | ); 12 | }; 13 | 14 | export default React.memo(Demo); 15 | -------------------------------------------------------------------------------- /.recodo/data/ThemeProvider.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "ThemeProvider": { 3 | "path": "ThemeProvider/ThemeProvider.md", 4 | "name": "ThemeProvider", 5 | "info": "### 说明\n\n这是主题化组件,正常用于包裹整个程序来替换颜色主题等\n\n### 演示\n\n#### 主题展示\n\n```js {\"codepath\": \"themeprovider.jsx\"}\n```\n\n#### useDesignTokens\n\n不提供 useTheme 是因为 theme 中除了 DT 还有一些其它内部属性,不适合暴露,故只暴露 DT。\n\n```js {\"codepath\": \"useDesignTokens.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Collapse/style/index.ts: -------------------------------------------------------------------------------- 1 | import styled from '@emotion/styled'; 2 | import { css } from '@emotion/core'; 3 | 4 | import { sWrap } from 'src/style'; 5 | 6 | export const PanelWrap = sWrap<{ open?: boolean }>({})( 7 | styled('div')(props => { 8 | return css` 9 | ${!props.open && 10 | css` 11 | display: none; 12 | `}; 13 | `; 14 | }) 15 | ); 16 | -------------------------------------------------------------------------------- /src/components/Grid/Row.md: -------------------------------------------------------------------------------- 1 | ### 演示 2 | 3 | #### 演示 4 | 5 | ```js {"codepath": "row.jsx"} 6 | ``` 7 | 8 | #### 基本使用 9 | 10 | ```js {"codepath": "row-base.jsx"} 11 | ``` 12 | 13 | #### align - 垂直定位 14 | 15 | ```js {"codepath": "row-align.jsx"} 16 | ``` 17 | 18 | #### justify - 水平定位 19 | 20 | ```js {"codepath": "row-justify.jsx"} 21 | ``` 22 | 23 | #### gutter - 栅格间距 24 | 25 | ```js {"codepath": "row-gutter.jsx"} 26 | ``` 27 | -------------------------------------------------------------------------------- /src/components/Grid/Col.md: -------------------------------------------------------------------------------- 1 | ### 演示 2 | 3 | #### 演示 4 | 5 | ```js {"codepath": "col.jsx"} 6 | ``` 7 | 8 | #### span - 占位 9 | 10 | ```js {"codepath": "col-span.jsx"} 11 | ``` 12 | 13 | #### offset - 偏移 14 | 15 | ```js {"codepath": "col-offset.jsx"} 16 | ``` 17 | 18 | #### pull & push - 偏移 19 | 20 | ```js {"codepath": "col-pullAndPush.jsx"} 21 | ``` 22 | 23 | #### order - 排序 24 | 25 | ```js {"codepath": "col-order.jsx"} 26 | ``` 27 | -------------------------------------------------------------------------------- /src/components/Button/__demo__/block.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Button from 'src/components/Button'; 4 | 5 | // demo start 6 | const Demo = () => ( 7 |
8 | 9 | 12 |
13 | ); 14 | // demo end 15 | 16 | export default Demo; 17 | -------------------------------------------------------------------------------- /src/components/Tag/Icon.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是只有 Icon 的 Tag 组件,用作纯 Icon 标识 4 | 5 | ### 演示 6 | 7 | #### 功能演示 8 | 9 | ```js {"codepath": "icon.jsx"} 10 | ``` 11 | 12 | #### 样式风格 - styleType 13 | 14 | ```js {"codepath": "icon-styleType.jsx"} 15 | ``` 16 | 17 | #### 自定义 icon - icon 18 | 19 | ```js {"codepath": "icon-icon.jsx"} 20 | ``` 21 | 22 | #### 自定义样式 - customStyle 23 | 24 | ```js {"codepath": "icon-customStyle.jsx"} 25 | ``` 26 | -------------------------------------------------------------------------------- /src/components/Button/__demo__/disabled.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Button from 'src/components/Button'; 4 | 5 | // demo start 6 | const Demo = () => ( 7 |
8 | 9 | 12 |
13 | ); 14 | // demo end 15 | 16 | export default Demo; 17 | -------------------------------------------------------------------------------- /src/components/ConfigProvider/__demo__/icon.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import ConfigProvider from 'src/components/ConfigProvider'; 4 | import Icon from 'src/components/Icon'; 5 | 6 | // demo start 7 | const Demo = () => ( 8 |
9 | 10 | 11 | 12 |
13 | ); 14 | // demo end 15 | 16 | export default Demo; 17 | -------------------------------------------------------------------------------- /src/components/Upload/__demo__/disabled.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Upload from 'src/components/Upload'; 3 | 4 | // demo start 5 | const Demo = () => ( 6 | console.log(fileList)} 8 | onError={({ message, name }) => alert(`there is an error of ${name}: ${message}`)} 9 | disabled 10 | multiple 11 | /> 12 | ); 13 | // demo end 14 | 15 | export default Demo; 16 | -------------------------------------------------------------------------------- /.recodo/data/Progress.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "Progress": { 3 | "path": "Progress/Progress.md", 4 | "name": "Progress", 5 | "info": "### 说明\n\n这是 Progress 组件\n\n### 演示\n\n#### 普通使用\n\n```js {\"codepath\": \"base.jsx\"}\n```\n\n#### format - 展示文字的格式化\n\n```js {\"codepath\": \"format.jsx\"}\n```\n\n#### color - 进度条颜色\n\n```js {\"codepath\": \"color.jsx\"}\n```\n\n#### custom - 自定义\n\n```js {\"codepath\": \"custom.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/ActionList/style/index.ts: -------------------------------------------------------------------------------- 1 | import { css } from '@emotion/core'; 2 | import styled from '@emotion/styled'; 3 | 4 | import Combine from 'src/components/Combine'; 5 | import config from 'src/config'; 6 | 7 | const { prefixCls: _prefixCls } = config; 8 | export const prefixCls = _prefixCls + '-actionlist'; 9 | 10 | export const SWrap = styled(Combine)(() => { 11 | return css` 12 | white-space: nowrap; 13 | `; 14 | }); 15 | -------------------------------------------------------------------------------- /src/components/Form/Form.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 表单 UI 组件,只负责布局和展示,不提供任何逻辑功能,表单校验、数据收集请看 `ZForm` 组件。 4 | 5 | #### API 设计说明 6 | 7 | 完整的表单不止包含视觉规范、布局等,还包含了大量的逻辑处理,为了让开发者可以自由选择表单逻辑处理的方式,将表单拆分为 UI 布局组件 - `Form` 和表单逻辑组件 - `ZForm`,开发者如果对表单用法不喜,可自行选择合适的表单逻辑进行封装而不用担心样式。 8 | 9 | ### 演示 10 | 11 | #### 普通使用 12 | 13 | ```js {"codepath": "form.jsx"} 14 | ``` 15 | 16 | #### itemProps - 统一设置 item 的 props 17 | 18 | ```js {"codepath": "form-itemProps.jsx"} 19 | ``` 20 | -------------------------------------------------------------------------------- /src/components/Layout/Content.tsx: -------------------------------------------------------------------------------- 1 | import React, { HTMLAttributes } from 'react'; 2 | import classnames from 'classnames'; 3 | 4 | import { ContentWrap, prefixCls } from './style'; 5 | 6 | const Content = ({ className, ...rest }: HTMLAttributes) => { 7 | return ; 8 | }; 9 | 10 | const MemoContent = React.memo(Content); 11 | 12 | export default MemoContent; 13 | -------------------------------------------------------------------------------- /src/components/Table/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | emptyTip: '数据为空', 3 | search: '搜索', 4 | filter: '筛选', 5 | searchResult: '搜索结果', 6 | items: '条', 7 | reset: '返回列表', 8 | period: '。', 9 | semicolon: ';', 10 | colon: ':', 11 | selected: '已选择', 12 | cancelSelect: '取消选择', 13 | columnConfigHeader: '自定义列表', 14 | columnConfigTip: '清除缓存或更换浏览器,自定义列表失效。', 15 | columnConfigSelected: '选中' 16 | }; 17 | -------------------------------------------------------------------------------- /src/components/Tag/Group.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是 Tag 的 Group 组件,用于包裹 Tag,并提供紧凑型布局 4 | 5 | ### 演示 6 | 7 | - 功能演示 8 | 9 | ```js {"codepath": "group.jsx"} 10 | ``` 11 | 12 | - 紧凑布局 - compact 13 | 14 | ```js {"codepath": "group-compact.jsx"} 15 | ``` 16 | 17 | - 暴露的 Tag 数量 - exposeCount 18 | 19 | ```js {"codepath": "group-expose.jsx"} 20 | ``` 21 | 22 | - 自适应 - autoAdjustment 23 | 24 | ```js {"codepath": "group-resizable.jsx"} 25 | ``` 26 | -------------------------------------------------------------------------------- /src/components/Upload/__demo__/listType.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Upload from 'src/components/Upload'; 3 | 4 | // demo start 5 | const Demo = () => ( 6 | console.log(fileList)} 8 | onError={({ message, name }) => alert(`there is an error of ${name}: ${message}`)} 9 | listType="none" 10 | multiple 11 | /> 12 | ); 13 | // demo end 14 | 15 | export default Demo; 16 | -------------------------------------------------------------------------------- /src/components/Upload/__demo__/maxCount.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Upload from 'src/components/Upload'; 3 | 4 | // demo start 5 | const Demo = () => ( 6 | console.log(fileList)} 8 | onError={({ message, name }) => alert(`there is an error of ${name}: ${message}`)} 9 | multiple 10 | maxCount={3} 11 | /> 12 | ); 13 | // demo end 14 | 15 | export default Demo; 16 | -------------------------------------------------------------------------------- /src/components/Breadcrumb/index.tsx: -------------------------------------------------------------------------------- 1 | import { ExportComponent } from 'src/type'; 2 | 3 | import Breadcrumb from './Breadcrumb'; 4 | import Item from './Item'; 5 | import BackButton from './BackButton'; 6 | import { StyleTypes } from './interface'; 7 | 8 | const ExportBreadcrumb = ExportComponent(Breadcrumb, { 9 | Item, 10 | BackButton, 11 | StyleType: StyleTypes, 12 | defaultProps: {} 13 | }); 14 | 15 | export default ExportBreadcrumb; 16 | -------------------------------------------------------------------------------- /src/components/Layout/Footer.tsx: -------------------------------------------------------------------------------- 1 | import React, { HTMLAttributes } from 'react'; 2 | import classnames from 'classnames'; 3 | 4 | import { FooterWrap, prefixClsFooter } from './style'; 5 | 6 | const Footer = ({ className, ...rest }: HTMLAttributes) => { 7 | return ; 8 | }; 9 | 10 | const MemoFooter = React.memo(Footer); 11 | 12 | export default MemoFooter; 13 | -------------------------------------------------------------------------------- /src/components/Layout/Header.tsx: -------------------------------------------------------------------------------- 1 | import React, { HTMLAttributes } from 'react'; 2 | import classnames from 'classnames'; 3 | 4 | import { HeaderWrap, prefixClsHeader } from './style'; 5 | 6 | const Header = ({ className, ...rest }: HTMLAttributes) => { 7 | return ; 8 | }; 9 | 10 | const MemoHeader = React.memo(Header); 11 | 12 | export default MemoHeader; 13 | -------------------------------------------------------------------------------- /src/components/Upload/__demo__/accept.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Upload from 'src/components/Upload'; 3 | 4 | // demo start 5 | const Demo = () => ( 6 | console.log(fileList)} 8 | onError={({ message, name }) => alert(`there is an error of ${name}: ${message}`)} 9 | accept="image/* , .pdf" 10 | multiple 11 | /> 12 | ); 13 | // demo end 14 | 15 | export default Demo; 16 | -------------------------------------------------------------------------------- /src/components/Upload/__demo__/maxSize.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Upload from 'src/components/Upload'; 3 | 4 | // demo start 5 | const Demo = () => ( 6 | console.log(fileList)} 8 | onError={({ message, name }) => alert(`there is an error of ${name}: ${message}`)} 9 | maxSize={1024 * 1024} 10 | multiple 11 | /> 12 | ); 13 | // demo end 14 | 15 | export default Demo; 16 | -------------------------------------------------------------------------------- /src/components/Radio/__demo__/radio-disabled.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Radio from 'src/components/Radio'; 3 | 4 | // demo start 5 | const Demo = () => ( 6 |
7 |
8 | common 9 |
10 |
11 | disabled 12 |
13 |
14 | ); 15 | // demo end 16 | 17 | export default Demo; 18 | -------------------------------------------------------------------------------- /src/components/Radio/__demo__/radio-size.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Radio from 'src/components/Radio'; 3 | 4 | // demo start 5 | const { Size } = Radio; 6 | const Demo = () => ( 7 |
8 | {Size.map(size => ( 9 |
10 | {size} 11 |
12 | ))} 13 |
14 | ); 15 | // demo end 16 | 17 | export default Demo; 18 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/DottedLineArrowRight.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/Plus.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const components = {}; 2 | 3 | function importAll(r) { 4 | r.keys().forEach(key => { 5 | const name = key.replace(/(^\.\/)|(\/index\.(j|t)sx$)/g, ''); 6 | const all = r(key); 7 | const component = all.default; 8 | components[name] = Object.assign(component, all); 9 | }); 10 | } 11 | 12 | importAll(require.context('./src/components/', true, /^\.\/[A-Za-z]+\/index\.(j|t)sx$/)); 13 | 14 | module.exports = components; 15 | -------------------------------------------------------------------------------- /.recodo/data/Loading.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "Loading": { 3 | "path": "Loading/Loading.md", 4 | "name": "Loading", 5 | "info": "### 说明\n\n这是 Loading 组件\n\n### 演示\n\n#### 演示\n\n```js {\"codepath\": \"loading.jsx\"}\n```\n\n#### loading - 是否加载\n\n```js {\"codepath\": \"showLoading.jsx\"}\n```\n\n#### indicator - 自定义指示符\n\n```js {\"codepath\": \"indicator.jsx\"}\n```\n\n#### 包裹 inline-block 元素\n\n```js {\"codepath\": \"inlineBlock.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/ActionList/index.tsx: -------------------------------------------------------------------------------- 1 | import { ExportComponent } from 'src/type'; 2 | import Button from 'src/components/Button'; 3 | 4 | import ActionList, { ActionListProps } from './ActionList'; 5 | 6 | const Sizes = Button.Sizes; 7 | const ButtonStyleTypes = Button.StyleTypes; 8 | 9 | const ExportActionList = ExportComponent(ActionList, { 10 | Sizes, 11 | ButtonStyleTypes 12 | }); 13 | 14 | export default ExportActionList; 15 | export type { ActionListProps }; 16 | -------------------------------------------------------------------------------- /src/components/Pagination/locale/en_US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // Options.jsx 3 | itemsPerPage: 'items/page', 4 | jumpTo: 'Jump to', 5 | jumpToConfirm: 'Confirm', 6 | page: 'Page', 7 | 8 | // Pagination.jsx 9 | prevPage: 'Prev page', 10 | nextPage: 'Next page', 11 | prev5: 'Prev 5 page', 12 | next5: 'Next 5 page', 13 | prev3: 'Prev 3 page', 14 | next3: 'Next 3 page', 15 | total: 'Total', 16 | items: 'Items' 17 | }; 18 | -------------------------------------------------------------------------------- /src/components/Radio/__demo__/radio-checked.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Radio from 'src/components/Radio'; 3 | 4 | // demo start 5 | const Demo = () => ( 6 |
7 |
8 | common 9 |
10 |
11 | checked 12 |
13 |
14 | ); 15 | // demo end 16 | 17 | export default Demo; 18 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/Filter.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /src/components/NumberInput/__demo__/computeValidNumber.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import NumberInput from 'src/components/NumberInput'; 3 | 4 | // demo start 5 | class Demo extends React.Component { 6 | render() { 7 | return ( 8 |
9 | ((v / 2) | 0) * 2} /> 10 |
11 | ); 12 | } 13 | } 14 | // demo end 15 | 16 | export default Demo; 17 | -------------------------------------------------------------------------------- /src/components/PopConfirm/PopConfirm.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是 PopConfirm 组件,用作一些按钮操作的二次确认 4 | - PopConfirm 由 Tooltip 封装,支持所有 Tooltip 的 props 5 | 6 | ### 演示 7 | 8 | #### 普通使用 9 | 10 | ```js {"codepath": "popConfirm.jsx"} 11 | ``` 12 | 13 | #### onConfirm - 确认按钮回调 14 | 15 | ```js {"codepath": "onConfirm.jsx"} 16 | ``` 17 | 18 | #### onCancel - 取消按钮回调 19 | 20 | ```js {"codepath": "onCancel.jsx"} 21 | ``` 22 | 23 | #### 演示 24 | 25 | ```js {"codepath": "demo.jsx"} 26 | ``` 27 | -------------------------------------------------------------------------------- /src/components/Radio/RadioIcon.tsx: -------------------------------------------------------------------------------- 1 | import React, { memo } from 'react'; 2 | 3 | import SvgIcon from 'src/components/SvgIcon'; 4 | 5 | import { iconCls, SIconWrap } from './style'; 6 | 7 | const RadioIcon = (props: { checked?: boolean; disabled?: boolean }) => { 8 | return ( 9 | 10 | 11 | 12 | ); 13 | }; 14 | 15 | export default memo(RadioIcon); 16 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/ArrowLeft.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 9 | )); 10 | -------------------------------------------------------------------------------- /src/components/Calendar/__demo__/twoside.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Calendar from 'src/components/Calendar'; 4 | 5 | // demo start 6 | const Demo = () => ( 7 |
8 | console.log('change', v)} 10 | rules={{ range: [Date.now() - 3 * 30 * 24 * 60 * 60 * 1000, Date.now() + 3 * 30 * 24 * 60 * 60 * 1000] }} 11 | /> 12 |
13 | ); 14 | // demo end 15 | 16 | export default Demo; 17 | -------------------------------------------------------------------------------- /src/components/Calendar/index.tsx: -------------------------------------------------------------------------------- 1 | import Calendar from './Calendar'; 2 | import Month from './Month'; 3 | import TwoSide from './TwoSide'; 4 | 5 | type TExportCalendar = typeof Calendar & { 6 | Month: typeof Month; 7 | TwoSide: typeof TwoSide; 8 | }; 9 | 10 | const ExportCalendar: TExportCalendar = Calendar as TExportCalendar; 11 | ExportCalendar.Month = Month; 12 | ExportCalendar.TwoSide = TwoSide; 13 | 14 | export default ExportCalendar; 15 | 16 | export { TwoSide }; 17 | -------------------------------------------------------------------------------- /src/components/Calendar/locale/en_US.js: -------------------------------------------------------------------------------- 1 | const months = 'January_February_March_April_May_June_July_August_September_October_November_December' 2 | .split('_') 3 | .map(v => v.substr(0, 3)); 4 | const weekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_').map(v => v.substr(0, 2)); 5 | 6 | export default { 7 | month: '', 8 | year: '', 9 | monthBeforeYear: true, 10 | months, 11 | weekdays, 12 | disabledTip: 'Invalid date' 13 | }; 14 | -------------------------------------------------------------------------------- /src/components/PopConfirm/__demo__/onCancel.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import PopConfirm from 'src/components/PopConfirm'; 4 | import Button from 'src/components/Button'; 5 | 6 | // demo start 7 | const Demo = () => ( 8 | console.log('onConfirm')} onCancel={() => console.log('onCancel')}> 9 | 10 | 11 | ); 12 | // demo end 13 | 14 | export default Demo; 15 | -------------------------------------------------------------------------------- /src/components/PopConfirm/__demo__/onConfirm.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import PopConfirm from 'src/components/PopConfirm'; 4 | import Button from 'src/components/Button'; 5 | 6 | // demo start 7 | const Demo = () => ( 8 | console.log('onConfirm')} onCancel={() => console.log('onCancel')}> 9 | 10 | 11 | ); 12 | // demo end 13 | 14 | export default Demo; 15 | -------------------------------------------------------------------------------- /src/components/Breadcrumb/Item.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 面包屑项组件 4 | - 传入 href 时为 a 标签,其它情况下为 span 标签,可使用 href 或 onClick 执行跳转,或用于包裹其它元素(Link 等) 5 | 6 | ### 演示 7 | 8 | #### 演示 9 | 10 | ```js {"codepath": "item.jsx"} 11 | ``` 12 | 13 | #### current - 当前项 14 | 15 | ```js {"codepath": "item-current.jsx"} 16 | ``` 17 | 18 | #### noAction - 无操作 19 | 20 | ```js {"codepath": "item-noAction.jsx"} 21 | ``` 22 | 23 | #### disabled - 禁用 24 | 25 | ```js {"codepath": "item-disabled.jsx"} 26 | ``` 27 | -------------------------------------------------------------------------------- /src/components/DatePicker/__demo__/range-type.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import DatePicker from 'src/components/DatePicker'; 3 | 4 | // demo start 5 | const Demo = () => ( 6 |
7 | {['date', 'month'].map(type => ( 8 |
9 | console.log(v)} /> 10 |
11 | ))} 12 |
13 | ); 14 | // demo end 15 | 16 | export default Demo; 17 | -------------------------------------------------------------------------------- /src/components/Icon/__demo__/customStyle.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Icon from 'src/components/Icon'; 3 | 4 | // demo start 5 | const layout = { 6 | style: { 7 | marginRight: 10 8 | } 9 | }; 10 | const Demo = () => ( 11 |
12 | 13 | 14 |
15 | ); 16 | // demo end 17 | 18 | export default Demo; 19 | -------------------------------------------------------------------------------- /src/components/PopConfirm/__demo__/popConfirm.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import PopConfirm from 'src/components/PopConfirm'; 4 | import Button from 'src/components/Button'; 5 | 6 | // demo start 7 | const Demo = () => ( 8 | console.log('onConfirm')} onCancel={() => console.log('onCancel')}> 9 | 10 | 11 | ); 12 | // demo end 13 | 14 | export default Demo; 15 | -------------------------------------------------------------------------------- /src/components/Checkbox/index.tsx: -------------------------------------------------------------------------------- 1 | import { ExportComponent } from 'src/type'; 2 | 3 | import Checkbox, { CheckboxProps } from './Checkbox'; 4 | import Group from './Group'; 5 | import { StyleTypes, Sizes } from './interface'; 6 | 7 | const ExportCheckbox = ExportComponent(Checkbox, { 8 | Group, 9 | /** @deprecated */ 10 | StyleType: StyleTypes, 11 | /** @deprecated */ 12 | Size: Sizes 13 | }); 14 | 15 | export default ExportCheckbox; 16 | export type { CheckboxProps }; 17 | -------------------------------------------------------------------------------- /src/components/Select/SelectContext.tsx: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react'; 2 | 3 | import { Key } from 'src/hooks/group'; 4 | import noop from 'src/utils/noop'; 5 | 6 | const SelectContext = createContext<{ 7 | hidePopup: () => void; 8 | handleSearch: (value: Key, props: any) => boolean | [string, string, string]; 9 | searchValue: string; 10 | }>({ 11 | hidePopup: noop, 12 | handleSearch: () => true, 13 | searchValue: '' 14 | }); 15 | export default SelectContext; 16 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/TriangleDown.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/TriangleRight.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/TriangleUp.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /src/components/AutoComplete/__demo__/disabled.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import AutoComplete from 'src/components/AutoComplete'; 4 | 5 | // demo start 6 | const options = new Array(100).fill(null).map((v, i) => ({ value: `Item ${i}` })); 7 | const Demo = () => { 8 | return ( 9 | <> 10 | 11 | 12 | ); 13 | }; 14 | // demo end 15 | 16 | export default Demo; 17 | -------------------------------------------------------------------------------- /src/components/Checkbox/__demo__/performance.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Checkbox from 'src/components/Checkbox'; 4 | 5 | // demo start 6 | const options = new Array(1000).fill(null).map((v, i) => ({ value: i, label: `option-${i}` })); 7 | const Demo = () => { 8 | return ( 9 |
10 | 11 |
12 | ); 13 | }; 14 | // demo end 15 | 16 | export default Demo; 17 | -------------------------------------------------------------------------------- /src/components/Upload/__demo__/single.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Upload from 'src/components/Upload'; 4 | 5 | // demo start 6 | const Demo = () => ( 7 | console.log(fileList)} 9 | onError={({ message, name }) => alert(`there is an error of ${name}: ${message}`)} 10 | onRemove={console.log} 11 | onAdd={console.log} 12 | multiple={false} 13 | /> 14 | ); 15 | // demo end 16 | 17 | export default Demo; 18 | -------------------------------------------------------------------------------- /src/components/SvgIcon/__demo__/svgIcon-size.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import SvgIcon from 'src/components/SvgIcon'; 4 | 5 | // demo start 6 | const layout = { 7 | style: { 8 | marginRight: 10 9 | } 10 | }; 11 | const Demo = () => ( 12 |
13 | {['12px', '16px', '30px', '2em', '3rem'].map(size => ( 14 | 15 | ))} 16 |
17 | ); 18 | // demo end 19 | 20 | export default Demo; 21 | -------------------------------------------------------------------------------- /src/components/SvgIcon/SvgIcon.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是 SvgIcon 组件,主要是组件内部使用的一些图标,目前直接不建议使用 4 | 5 | ### 演示 6 | 7 | #### 演示 8 | 9 | ```js {"codepath": "svgIcon.jsx"} 10 | ``` 11 | 12 | #### type - 图标类型 13 | 14 | ```js {"codepath": "svgIcon-type.jsx"} 15 | ``` 16 | 17 | #### color - 颜色 18 | 19 | ```js {"codepath": "svgIcon-color.jsx"} 20 | ``` 21 | 22 | #### spin - 是否旋转 23 | 24 | ```js {"codepath": "svgIcon-spin.jsx"} 25 | ``` 26 | 27 | #### size - 尺寸 28 | 29 | ```js {"codepath": "svgIcon-size.jsx"} 30 | ``` 31 | -------------------------------------------------------------------------------- /src/components/Calendar/__demo__/base.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Calendar from 'src/components/Calendar'; 4 | 5 | // demo start 6 | const Demo = () => ( 7 |
8 | console.log('select', v)} 10 | onChange={v => console.log('change', v)} 11 | rules={{ range: [Date.now() - 7 * 24 * 60 * 60 * 1000, Date.now() + 7 * 24 * 60 * 60 * 1000] }} 12 | /> 13 |
14 | ); 15 | // demo end 16 | 17 | export default Demo; 18 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/CircleYesMdFill.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/Search.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /.recodo/data/Link.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "Button": { 3 | "path": "Link/Button.md", 4 | "name": "Button", 5 | "info": "### 说明\n\n- 这是 Link.Button 子组件,提供 Button 样式的 Link 组件,除了支持 Link 的属性外,还支持 Button 的样式属性\n\n### 演示\n\n- 普通使用\n\n```js {\"codepath\": \"button.jsx\"}\n```\n" 6 | }, 7 | "Link": { 8 | "path": "Link/Link.md", 9 | "name": "Link", 10 | "info": "### 说明\n\n- 这是 Link 组件,主要是针对 a 标签进行样式封装\n\n### 演示\n\n- 普通使用\n\n```js {\"codepath\": \"base.jsx\"}\n```\n" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.recodo/data/PopConfirm.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "PopConfirm": { 3 | "path": "PopConfirm/PopConfirm.md", 4 | "name": "PopConfirm", 5 | "info": "### 说明\n\n- 这是 PopConfirm 组件,用作一些按钮操作的二次确认\n- PopConfirm 由 Tooltip 封装,支持所有 Tooltip 的 props\n\n### 演示\n\n#### 普通使用\n\n```js {\"codepath\": \"popConfirm.jsx\"}\n```\n\n#### onConfirm - 确认按钮回调\n\n```js {\"codepath\": \"onConfirm.jsx\"}\n```\n\n#### onCancel - 取消按钮回调\n\n```js {\"codepath\": \"onCancel.jsx\"}\n```\n\n#### 演示\n\n```js {\"codepath\": \"demo.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Button/__demo__/size.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Button from 'src/components/Button'; 4 | 5 | // demo start 6 | const { Sizes } = Button; 7 | 8 | const Demo = () => { 9 | return ( 10 |
11 | {Sizes.map(size => ( 12 | 15 | ))} 16 |
17 | ); 18 | }; 19 | // demo end 20 | 21 | export default Demo; 22 | -------------------------------------------------------------------------------- /src/components/ConfigProvider/ConfigProvider.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 这是 ConfigProvider 组件,用于统一配置应用的配置 4 | 5 | ### 演示 6 | 7 | #### 普通使用 8 | 9 | ```js {"codepath": "demo.jsx"} 10 | ``` 11 | 12 | #### theme - 用作定义主题 13 | 14 | ```js {"codepath": "theme.jsx"} 15 | ``` 16 | 17 | #### locale - 用作定义语言 18 | 19 | ```js {"codepath": "locale.jsx"} 20 | ``` 21 | 22 | #### iconDefaultPrefix - icon 默认前缀 23 | 24 | ```js {"codepath": "icon.jsx"} 25 | ``` 26 | 27 | #### actionListAutoAdjustment 28 | 29 | ```js {"codepath": "actionList.jsx"} 30 | ``` 31 | -------------------------------------------------------------------------------- /src/components/SvgIcon/__demo__/svgIcon-color.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import SvgIcon from 'src/components/SvgIcon'; 4 | 5 | // demo start 6 | const layout = { 7 | style: { 8 | marginRight: 10 9 | } 10 | }; 11 | const Demo = () => ( 12 |
13 | {['black', 'white', 'red', 'green', 'blue', 'purple', '#18E1c9'].map(color => ( 14 | 15 | ))} 16 |
17 | ); 18 | // demo end 19 | 20 | export default Demo; 21 | -------------------------------------------------------------------------------- /src/components/Upload/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | selectFile: '请选择文件', 3 | selectFileTip: '请选择符合规则的文件', 4 | emptyTip: '你还未上传任何内容', 5 | retry: '重试', 6 | uploading: '上传中...', 7 | defaultUploadErrorTip: '上传失败,请重试', 8 | defaultErrorTipTitle: '无法添加文件', 9 | defaultErrorTip: '请检查添加的文件是否符合规则', 10 | maxCountErrorTip: '最大文件数量为 {maxCount}', 11 | typeErrorTip: '支持的文件类型为 {accept}', 12 | maxSizeErrorTip: '文件最大尺寸为 {size}', 13 | dropzoneMainTip: '拖拽文件到此处上传', 14 | dropzoneSubTip: '请上传符合要求的文件' 15 | }; 16 | -------------------------------------------------------------------------------- /src/components/Radio/__demo__/group-size.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Radio from 'src/components/Radio'; 3 | 4 | // demo start 5 | const { Size } = Radio; 6 | const options = [1, 2, 3]; 7 | const Demo = () => ( 8 |
9 | {Size.map(size => ( 10 |
11 | ({ value: v, styleType: 'button' }))} /> 12 |
13 | ))} 14 |
15 | ); 16 | // demo end 17 | 18 | export default Demo; 19 | -------------------------------------------------------------------------------- /.recodo/data/Layout.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "Layout": { 3 | "path": "Layout/Layout.md", 4 | "name": "Layout", 5 | "info": "### 说明\n\n- 这是 Layout 布局组件\n\n### 演示\n\n#### 顶部通栏+侧边导航\n\n```js {\"codepath\": \"full-header.jsx\"}\n```\n\n#### 顶部通栏\n\n```js {\"codepath\": \"no-sider.jsx\"}\n```\n" 6 | }, 7 | "Sider": { 8 | "path": "Layout/Sider.md", 9 | "name": "Sider", 10 | "info": "### 说明\n\n- 侧边导航\n\n### 演示\n\n- 普通使用\n\n#### 侧边通栏\n\n```js {\"codepath\": \"full-sider.jsx\"}\n```\n" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.recodo/data/SvgIcon.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "SvgIcon": { 3 | "path": "SvgIcon/SvgIcon.md", 4 | "name": "SvgIcon", 5 | "info": "### 说明\n\n- 这是 SvgIcon 组件,主要是组件内部使用的一些图标,目前直接不建议使用\n\n### 演示\n\n#### 演示\n\n```js {\"codepath\": \"svgIcon.jsx\"}\n```\n\n#### type - 图标类型\n\n```js {\"codepath\": \"svgIcon-type.jsx\"}\n```\n\n#### color - 颜色\n\n```js {\"codepath\": \"svgIcon-color.jsx\"}\n```\n\n#### spin - 是否旋转\n\n```js {\"codepath\": \"svgIcon-spin.jsx\"}\n```\n\n#### size - 尺寸\n\n```js {\"codepath\": \"svgIcon-size.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Checkbox/CheckboxContext.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { SelectableContext } from 'src/hooks/selectable'; 4 | import noop from 'src/utils/noop'; 5 | 6 | import { Size, StyleType } from './interface'; 7 | 8 | const CheckboxContext = React.createContext< 9 | { 10 | disabled?: boolean; 11 | styleType?: StyleType; 12 | size?: Size; 13 | } & SelectableContext 14 | >({ 15 | toggleSelect: noop, 16 | addItem: noop, 17 | removeItem: noop 18 | }); 19 | export default CheckboxContext; 20 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/TriangleLeft.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 8 | )); 9 | -------------------------------------------------------------------------------- /src/components/Table/SearchInput.jsx: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | import Input from 'src/components/Input'; 4 | 5 | import { TableContext } from './Table'; 6 | 7 | export default class SearchInput extends Component { 8 | render() { 9 | const { ...rest } = this.props; 10 | return ( 11 | 12 | {({ handleSearch }) => } 13 | 14 | ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/components/ConfigProvider/ConfigContext.tsx: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react'; 2 | 3 | import { ConfigProviderProps } from './ConfigProvider'; 4 | 5 | export const defaultConfig = { 6 | forwardPopupContainer: true, 7 | preventFormDefaultAction: true 8 | }; 9 | 10 | export type ConfigContextType = Pick< 11 | ConfigProviderProps, 12 | 'forwardPopupContainer' | 'popover' | 'preventFormDefaultAction' | 'iconDefaultPrefix' | 'actionListAutoAdjustment' 13 | >; 14 | 15 | export default createContext(defaultConfig); 16 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/Ellipsis.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /src/components/Calendar/__demo__/month.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Calendar from 'src/components/Calendar'; 4 | 5 | // demo start 6 | const Demo = () => ( 7 |
8 | console.log('select', v)} 11 | onChange={v => console.log('change', v)} 12 | rules={{ range: [Date.now() - 3 * 30 * 24 * 60 * 60 * 1000, Date.now() + 3 * 30 * 24 * 60 * 60 * 1000] }} 13 | /> 14 |
15 | ); 16 | // demo end 17 | 18 | export default Demo; 19 | -------------------------------------------------------------------------------- /src/components/Cascader/interface.ts: -------------------------------------------------------------------------------- 1 | import { ReactNode } from 'react'; 2 | 3 | export type Key = string; 4 | 5 | export interface LoadData { 6 | (expandedKeys: Key[]): Promise; 7 | } 8 | 9 | export interface CascadeData { 10 | // 唯一键,所有值的字符串不得重复,会用作 key 和选中判定,如果为其它值会转为 string 再应用 11 | key: Key; 12 | // 选项标题内容 13 | title: ReactNode; 14 | // 子数据,存在即为父节点,不存在即为叶子结点,与程序树有差异,原因详见说明 15 | children?: CascadeData[]; 16 | // 是否禁用,父节点禁用会禁用所有子孙节点 17 | disabled?: boolean; 18 | // 是否强制为父节点 19 | isParent?: boolean; 20 | } 21 | -------------------------------------------------------------------------------- /src/components/Radio/__demo__/group-disabled.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Radio from 'src/components/Radio'; 3 | 4 | // demo start 5 | const options = [1, 2, 3]; 6 | const Demo = () => ( 7 |
8 |
9 | ({ value: v }))} /> 10 |
11 |
12 | ({ value: v }))} /> 13 |
14 |
15 | ); 16 | // demo end 17 | 18 | export default Demo; 19 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)** 2 | 3 | **What is the current behavior? (You can also link to an open issue here)** 4 | 5 | **What is the new behavior (if this is a feature change)?** 6 | 7 | **Does this PR introduce a breaking change?** 8 | 9 | **Please check if the PR fulfills these requirements** 10 | 11 | * [ ] Follow our contributing docs 12 | * [ ] Docs have been added/updated 13 | * [ ] Tests have been added; existing tests pass 14 | 15 | **Other information**: 16 | -------------------------------------------------------------------------------- /src/components/Tooltip/Tooltip.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - Tooltip 基于 Popover,增加了箭头样式,支持所有 Popover 的 props,其它 props 的定义和注意事项参考 Popover 文档 4 | - 主要用于包裹一些展示性的提示 5 | 6 | ### 演示 7 | 8 | #### 演示 9 | 10 | ```js {"codepath": "tooltip.jsx"} 11 | ``` 12 | 13 | #### theme - 主题 14 | 15 | ```js {"codepath": "theme.jsx"} 16 | ``` 17 | 18 | #### arrow - 箭头 19 | 20 | ```js {"codepath": "arrow.jsx"} 21 | ``` 22 | 23 | #### placement - 位置 24 | 25 | ```js {"codepath": "placement.jsx"} 26 | ``` 27 | 28 | #### style - 修改提示文案宽度 29 | 30 | ```js {"codepath": "style.jsx"} 31 | ``` 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # dependencies 2 | /node_modules 3 | package-lock.json 4 | 5 | # testing 6 | /coverage 7 | 8 | # production 9 | /build 10 | /dist 11 | /styleguide-build 12 | /styleguide 13 | /lib 14 | 15 | # misc 16 | .DS_Store 17 | .env.local 18 | .env.development.local 19 | .env.test.local 20 | .env.production.local 21 | 22 | npm-debug.log* 23 | yarn-debug.log* 24 | yarn-error.log* 25 | 26 | # local 27 | /.vscode 28 | /jsconfig.json 29 | /.idea 30 | 31 | /static/fonts/demoTemplate.html 32 | 33 | # cache 34 | .eslintcache 35 | .gh-pages-cache 36 | __image_snapshots__ 37 | -------------------------------------------------------------------------------- /src/components/Calendar/__demo__/range.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Calendar from 'src/components/Calendar'; 4 | 5 | // demo start 6 | const Demo = () => ( 7 |
8 | console.log('change', v)} 11 | rangeValue={[ 12 | new Date(Date.now() - 30 * 24 * 60 * 60 * 1000), 13 | new Date(Date.now() + 30 * 24 * 60 * 60 * 1000) 14 | ]} 15 | /> 16 |
17 | ); 18 | // demo end 19 | 20 | export default Demo; 21 | -------------------------------------------------------------------------------- /src/components/ConfigProvider/__demo__/locale.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import ConfigProvider from 'src/components/ConfigProvider'; 4 | import Pagination from 'src/components/Pagination'; 5 | 6 | // demo start 7 | const Demo = () => ( 8 |
9 | 10 | 11 | 12 |
13 | ); 14 | // demo end 15 | 16 | export default Demo; 17 | -------------------------------------------------------------------------------- /src/components/DatePicker/index.tsx: -------------------------------------------------------------------------------- 1 | import { Sizes } from 'src/type'; 2 | 3 | import DatePicker from './DatePicker'; 4 | import Month from './Month'; 5 | import Range from './Range'; 6 | 7 | type TExportDatePicker = typeof DatePicker & { 8 | Month: typeof Month; 9 | Range: typeof Range; 10 | Sizes: typeof Sizes; 11 | }; 12 | 13 | const ExportDatePicker: TExportDatePicker = DatePicker as TExportDatePicker; 14 | ExportDatePicker.Month = Month; 15 | ExportDatePicker.Range = Range; 16 | ExportDatePicker.Sizes = Sizes; 17 | 18 | export default ExportDatePicker; 19 | -------------------------------------------------------------------------------- /src/components/EditableTable/EditableTable.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是 EditableTable 组件,主要用于列表项的编辑删除 4 | - 与表格的区别 5 | 1. pagination 固定为 null 6 | 2. emptyContent 固定为 null 7 | 3. columns 中添加了删除列 8 | - 其余属性与 Table 保持一致 9 | 10 | ### 演示 11 | 12 | #### 普通使用 13 | 14 | ```js {"codepath": "editableTable.jsx"} 15 | ``` 16 | 17 | #### addition - 添加 18 | 19 | ```js {"codepath": "addition.jsx"} 20 | ``` 21 | 22 | #### rowDeletion - 删除 23 | 24 | ```js {"codepath": "rowDeletion.jsx"} 25 | ``` 26 | 27 | #### 样例演示 28 | 29 | ```js {"codepath": "demo.jsx"} 30 | ``` 31 | -------------------------------------------------------------------------------- /src/components/Table/locale/en_US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | emptyTip: 'Data is empty', 3 | search: 'Search', 4 | filter: 'Filter', 5 | searchResult: 'Search result', 6 | items: 'Items', 7 | reset: 'Reset search and filter', 8 | period: '.', 9 | semicolon: ';', 10 | colon: ': ', 11 | selected: 'Selected', 12 | cancelSelect: 'Cancel select', 13 | columnConfigHeader: 'Custom columns', 14 | columnConfigTip: 'When you clean cache or change browser, the saving record will lost.', 15 | columnConfigSelected: 'Selected' 16 | }; 17 | -------------------------------------------------------------------------------- /shared/DemoWrap.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import classnames from 'classnames'; 3 | import PropTypes from 'prop-types'; 4 | 5 | const DemoWrap = ({ children, className, title }) => { 6 | return ( 7 | <> 8 | {title &&

{title}

} 9 |
{children}
10 | 11 | ); 12 | }; 13 | DemoWrap.propTypes = { 14 | children: PropTypes.node, 15 | className: PropTypes.string, 16 | title: PropTypes.node 17 | }; 18 | export default DemoWrap; 19 | -------------------------------------------------------------------------------- /src/components/Button/__demo__/styleType.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Button from 'src/components/Button'; 4 | 5 | // demo start 6 | const { StyleTypes } = Button; 7 | 8 | const Demo = () => { 9 | return ( 10 |
11 | {StyleTypes.map(styleType => ( 12 | 15 | ))} 16 |
17 | ); 18 | }; 19 | // demo end 20 | 21 | export default Demo; 22 | -------------------------------------------------------------------------------- /src/components/LocaleProvider/__demo__/localeprovider.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import LocaleProvider from 'src/components/LocaleProvider'; 3 | import Pagination from 'src/components/Pagination'; 4 | 5 | // demo start 6 | const Demo = () => ( 7 |
8 | 9 | 10 | 11 |
12 | ); 13 | // demo end 14 | 15 | export default Demo; 16 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/CircleCrossFill.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /src/components/SvgIcon/icons/TickSmall.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default React.memo(() => ( 4 | 5 | )); 6 | -------------------------------------------------------------------------------- /src/components/TimePicker/__demo__/disabled.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import demoUtil from 'shared/demoUtil'; 4 | import TimePicker from 'src/components/TimePicker'; 5 | 6 | // demo start 7 | const { DemoWrap } = demoUtil; 8 | const Demo = () => { 9 | return ( 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | ); 19 | }; 20 | // demo end 21 | 22 | export default Demo; 23 | -------------------------------------------------------------------------------- /src/components/TimePicker/__demo__/nullable.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import demoUtil from 'shared/demoUtil'; 4 | import TimePicker from 'src/components/TimePicker'; 5 | 6 | // demo start 7 | const { DemoWrap } = demoUtil; 8 | const Demo = () => { 9 | return ( 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | ); 19 | }; 20 | // demo end 21 | 22 | export default Demo; 23 | -------------------------------------------------------------------------------- /src/components/TimePicker/__demo__/size.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import demoUtil from 'shared/demoUtil'; 4 | import TimePicker from 'src/components/TimePicker'; 5 | 6 | // demo start 7 | const { DemoWrap } = demoUtil; 8 | const Demo = () => { 9 | return ( 10 |
11 | {['sm', 'md', 'lg'].map(size => ( 12 | 13 | 14 | 15 | ))} 16 |
17 | ); 18 | }; 19 | // demo end 20 | 21 | export default Demo; 22 | -------------------------------------------------------------------------------- /src/libs/rc-trigger/src/mock.js: -------------------------------------------------------------------------------- 1 | import Portal from 'rc-util/lib/Portal'; 2 | import Trigger from './index'; 3 | 4 | Portal.prototype.render = function () { 5 | // eslint-disable-line 6 | return this.props.children; 7 | }; 8 | 9 | const render = Trigger.prototype.render; 10 | 11 | Trigger.prototype.render = function () { 12 | // eslint-disable-line 13 | const tree = render.call(this); 14 | 15 | if (this.state.popupVisible || this._component) { 16 | return tree; 17 | } 18 | 19 | return tree[0]; 20 | }; 21 | 22 | export default Trigger; 23 | -------------------------------------------------------------------------------- /src/components/EditableList/EditableList.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 这是 EditableList 可编辑列表组件 4 | 5 | ### 演示 6 | 7 | #### 普通使用 8 | 9 | ```js {"codepath": "editableList.jsx"} 10 | ``` 11 | 12 | #### addition - 添加 13 | 14 | ```js {"codepath": "addition.jsx"} 15 | ``` 16 | 17 | #### itemDeletion - 项删除 18 | 19 | ```js {"codepath": "itemDeletion.jsx"} 20 | ``` 21 | 22 | #### grid - 布局 23 | 24 | ```js {"codepath": "grid.jsx"} 25 | ``` 26 | 27 | #### size - 空间尺寸 28 | 29 | ```js {"codepath": "size.jsx"} 30 | ``` 31 | 32 | #### demo - 案例演示 33 | 34 | ```js {"codepath": "demo.jsx"} 35 | ``` 36 | -------------------------------------------------------------------------------- /src/components/LocaleProvider/__demo__/localefile.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import LocaleProvider from 'src/components/LocaleProvider'; 4 | import Pagination from 'src/components/Pagination'; 5 | import ENLocale from 'src/components/LocaleProvider/locale/en_US'; 6 | 7 | // demo start 8 | const Demo = () => ( 9 |
10 | 11 | 12 | 13 |
14 | ); 15 | // demo end 16 | 17 | export default Demo; 18 | -------------------------------------------------------------------------------- /src/components/Message/__demo__/message.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Message from 'src/components/Message'; 4 | 5 | // demo start 6 | const { StyleType } = Message; 7 | const Demo = () => { 8 | return ( 9 |
10 | {StyleType.map(styleType => ( 11 |
12 | this is a message
} /> 13 |
14 | ))} 15 | 16 | ); 17 | }; 18 | // demo end 19 | 20 | export default Demo; 21 | -------------------------------------------------------------------------------- /src/components/Switch/__demo__/disabled.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Switch from 'src/components/Switch'; 3 | 4 | // demo start 5 | class Demo extends React.Component { 6 | render() { 7 | return ( 8 |
9 |
10 | 11 |
12 |
13 | 14 |
15 |
16 | ); 17 | } 18 | } 19 | // demo end 20 | 21 | export default Demo; 22 | -------------------------------------------------------------------------------- /.recodo/data/ZForm.info.json: -------------------------------------------------------------------------------- 1 | { 2 | "ZForm": { 3 | "path": "ZForm/ZForm.jsx", 4 | "name": "ZForm", 5 | "info": { 6 | "description": "", 7 | "displayName": "ZForm", 8 | "methods": [], 9 | "props": { 10 | "form": { 11 | "type": { "name": "custom", "raw": "formShape" }, 12 | "required": false, 13 | "description": { "description": "formDecorator生成的form实例", "tags": [] } 14 | } 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /shared/DemoBlock.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import classnames from 'classnames'; 3 | import PropTypes from 'prop-types'; 4 | 5 | const DemoBlock = ({ children, className, lg, row }) => { 6 | return ( 7 |
8 | {children} 9 |
10 | ); 11 | }; 12 | DemoBlock.propTypes = { 13 | children: PropTypes.node, 14 | className: PropTypes.string, 15 | lg: PropTypes.bool, 16 | row: PropTypes.bool 17 | }; 18 | export default DemoBlock; 19 | -------------------------------------------------------------------------------- /src/components/Input/__demo__/input-clearable.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Input from 'src/components/Input'; 4 | 5 | // demo start 6 | class Demo extends React.Component { 7 | render() { 8 | return ( 9 |
10 |
11 | 12 |
13 |
14 | 15 |
16 |
17 | ); 18 | } 19 | } 20 | // demo end 21 | 22 | export default Demo; 23 | -------------------------------------------------------------------------------- /src/components/Steps/Steps.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | 这是步骤条组件 4 | 5 | ### 演示 6 | 7 | #### 演示 8 | 9 | ```js {"codepath": "steps.jsx"} 10 | ``` 11 | 12 | #### steps - 步骤 13 | 14 | ```js {"codepath": "steps-steps.jsx"} 15 | ``` 16 | 17 | #### status - 状态 18 | 19 | ```js {"codepath": "steps-status.jsx"} 20 | ``` 21 | 22 | #### current - 当前 step 23 | 24 | ```js {"codepath": "steps-current.jsx"} 25 | ``` 26 | 27 | #### vertical - 纵向 step 28 | 29 | ```js {"codepath": "steps-vertical.jsx"} 30 | ``` 31 | 32 | #### onChange - 可点击 step 33 | 34 | ```js {"codepath": "steps-change.jsx"} 35 | ``` 36 | -------------------------------------------------------------------------------- /src/components/Switch/__demo__/size.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Switch from 'src/components/Switch'; 3 | 4 | // demo start 5 | const { Sizes } = Switch; 6 | class Demo extends React.Component { 7 | render() { 8 | return ( 9 |
10 | {Sizes.map(size => ( 11 |
12 | 13 |
14 | ))} 15 |
16 | ); 17 | } 18 | } 19 | // demo end 20 | 21 | export default Demo; 22 | -------------------------------------------------------------------------------- /.recodo/data/ConfigProvider.doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConfigProvider": { 3 | "path": "ConfigProvider/ConfigProvider.md", 4 | "name": "ConfigProvider", 5 | "info": "### 说明\n\n这是 ConfigProvider 组件,用于统一配置应用的配置\n\n### 演示\n\n#### 普通使用\n\n```js {\"codepath\": \"demo.jsx\"}\n```\n\n#### theme - 用作定义主题\n\n```js {\"codepath\": \"theme.jsx\"}\n```\n\n#### locale - 用作定义语言\n\n```js {\"codepath\": \"locale.jsx\"}\n```\n\n#### iconDefaultPrefix - icon 默认前缀\n\n```js {\"codepath\": \"icon.jsx\"}\n```\n\n#### actionListAutoAdjustment\n\n```js {\"codepath\": \"actionList.jsx\"}\n```\n" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Calendar/Calendar.md: -------------------------------------------------------------------------------- 1 | ### 说明 2 | 3 | - 这是 日历 组件 4 | - 需要自行导入 moment 语言包、设置时区 5 | 6 | ### 演示 7 | 8 | #### 普通使用 9 | 10 | ```js {"codepath": "base.jsx"} 11 | ``` 12 | 13 | #### 范围 14 | 15 | ```js {"codepath": "range.jsx"} 16 | ``` 17 | 18 | #### value / defaultValue - 选中的时间 (受控 / 非受控) 19 | 20 | ```js {"codepath": "controlled.jsx"} 21 | ``` 22 | 23 | #### rules - 自定义规则 24 | 25 | ```js {"codepath": "rules.jsx"} 26 | ``` 27 | 28 | #### month - 月历 29 | 30 | ```js {"codepath": "month.jsx"} 31 | ``` 32 | 33 | #### 组合 34 | 35 | ```js {"codepath": "twoside.jsx"} 36 | ``` 37 | -------------------------------------------------------------------------------- /src/components/Input/__demo__/input-size.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Input from 'src/components/Input'; 4 | 5 | // demo start 6 | const { Sizes } = Input; 7 | class Demo extends React.Component { 8 | render() { 9 | return ( 10 |
11 | {Sizes.map(size => ( 12 |
13 | 14 |
15 | ))} 16 |
17 | ); 18 | } 19 | } 20 | // demo end 21 | 22 | export default Demo; 23 | -------------------------------------------------------------------------------- /src/components/Input/__demo__/input-status.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Input from 'src/components/Input'; 4 | 5 | // demo start 6 | class Demo extends React.Component { 7 | render() { 8 | return ( 9 |
10 |
11 | 12 |
13 |
14 | 15 |
16 |
17 | ); 18 | } 19 | } 20 | // demo end 21 | 22 | export default Demo; 23 | -------------------------------------------------------------------------------- /src/components/LocaleProvider/LocaleProvider.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactNode, useEffect } from 'react'; 2 | 3 | import { setRuntimeLocale } from './runtime'; 4 | import LocaleContext, { AllLocaleMap } from './LocaleContext'; 5 | 6 | const LocaleProvider = ({ locale = {}, children }: { locale: AllLocaleMap; children: ReactNode }) => { 7 | useEffect(() => { 8 | setRuntimeLocale(locale); 9 | }, [locale]); 10 | return {React.Children.only(children)}; 11 | }; 12 | 13 | export default React.memo(LocaleProvider); 14 | -------------------------------------------------------------------------------- /src/components/Switch/__demo__/checked.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Switch from 'src/components/Switch'; 3 | 4 | // demo start 5 | class Demo extends React.Component { 6 | render() { 7 | return ( 8 |
9 |
10 | 11 |
12 |
13 | 14 |
15 |
16 | ); 17 | } 18 | } 19 | // demo end 20 | 21 | export default Demo; 22 | -------------------------------------------------------------------------------- /src/components/Tabs/shared.ts: -------------------------------------------------------------------------------- 1 | import { ReactElement } from 'react'; 2 | 3 | import { tuple } from 'src/style'; 4 | 5 | import { TabPaneProps } from './Pane'; 6 | 7 | export const TabBarPositions = tuple('top', 'bottom', 'left', 'right'); 8 | export const StyleTypes = tuple('default', 'ink', 'pure'); 9 | export const Sizes = tuple('sm', 'md', 'lg'); 10 | export type TabBarPosition = typeof TabBarPositions[number]; 11 | export type StyleType = typeof StyleTypes[number]; 12 | export type Size = typeof Sizes[number]; 13 | export type Panes = { pane: ReactElement; key: string }[]; 14 | -------------------------------------------------------------------------------- /src/components/Textarea/__demo__/disabled.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Textarea from 'src/components/Textarea'; 3 | 4 | // demo start 5 | class Demo extends React.Component { 6 | render() { 7 | return ( 8 |
9 |
10 |