├── packages
├── translation
│ ├── index.js
│ ├── locales
│ │ ├── de-DE.json
│ │ ├── en-US.json
│ │ ├── es-ES.json
│ │ ├── fa-IR.json
│ │ ├── fr-FR.json
│ │ ├── it-IT.json
│ │ ├── ja-JP.json
│ │ ├── ko-KR.json
│ │ ├── pt-BR.json
│ │ ├── ru-RU.json
│ │ ├── tr-TR.json
│ │ ├── zh-TW.json
│ │ ├── de-DE.js
│ │ ├── en-US.js
│ │ ├── es-ES.js
│ │ ├── fa-IR.js
│ │ ├── fr-FR.js
│ │ ├── it-IT.js
│ │ ├── ja-JP.js
│ │ ├── ko-KR.js
│ │ ├── pt-BR.js
│ │ ├── ru-RU.js
│ │ ├── tr-TR.js
│ │ ├── zh-TW.js
│ │ └── index-build.js
│ ├── package.json
│ └── README.md
├── components
│ ├── uikits
│ │ ├── src
│ │ │ ├── box
│ │ │ │ ├── src
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── Box.js
│ │ │ │ └── package.json
│ │ │ ├── style
│ │ │ │ ├── src
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── antd
│ │ │ │ │ │ ├── layer.less
│ │ │ │ │ │ ├── navbarmenus.less
│ │ │ │ │ │ ├── box.less
│ │ │ │ │ │ ├── images
│ │ │ │ │ │ │ ├── icon-info.png
│ │ │ │ │ │ │ ├── icon-error.png
│ │ │ │ │ │ │ ├── icon-success.png
│ │ │ │ │ │ │ └── icon-warning.png
│ │ │ │ │ │ ├── card.less
│ │ │ │ │ │ ├── icon.less
│ │ │ │ │ │ ├── menus.less
│ │ │ │ │ │ ├── spin.less
│ │ │ │ │ │ ├── drawer.less
│ │ │ │ │ │ ├── form.less
│ │ │ │ │ │ ├── checkbox.less
│ │ │ │ │ │ ├── input.less
│ │ │ │ │ │ ├── index.less
│ │ │ │ │ │ ├── layer-select-dropdown.less
│ │ │ │ │ │ ├── layer-popover.less
│ │ │ │ │ │ ├── tag.less
│ │ │ │ │ │ ├── tabs.less
│ │ │ │ │ │ ├── notify.less
│ │ │ │ │ │ ├── select.less
│ │ │ │ │ │ ├── slider.less
│ │ │ │ │ │ ├── modal.less
│ │ │ │ │ │ └── button.less
│ │ │ │ │ ├── reset
│ │ │ │ │ │ ├── reset.less
│ │ │ │ │ │ └── index.less
│ │ │ │ │ ├── box
│ │ │ │ │ │ ├── box-type.less
│ │ │ │ │ │ ├── _variables.less
│ │ │ │ │ │ ├── layer-shadow.less
│ │ │ │ │ │ ├── cursor.less
│ │ │ │ │ │ ├── position-zindex.less
│ │ │ │ │ │ ├── index.less
│ │ │ │ │ │ ├── hoverable.less
│ │ │ │ │ │ ├── border-type.less
│ │ │ │ │ │ ├── background.less
│ │ │ │ │ │ ├── spacing.less
│ │ │ │ │ │ ├── line-height.less
│ │ │ │ │ │ └── scrollbar.less
│ │ │ │ │ ├── typo
│ │ │ │ │ │ ├── text-decoration.less
│ │ │ │ │ │ ├── fonts
│ │ │ │ │ │ │ ├── DINPro.41757346.otf
│ │ │ │ │ │ │ └── TTNormsPro-Normal.ttf
│ │ │ │ │ │ ├── text-justify.less
│ │ │ │ │ │ ├── placeholder.less
│ │ │ │ │ │ ├── typo-types.less
│ │ │ │ │ │ ├── font-weight.less
│ │ │ │ │ │ ├── title.less
│ │ │ │ │ │ ├── _variables.less
│ │ │ │ │ │ ├── index.less
│ │ │ │ │ │ ├── paragraph.less
│ │ │ │ │ │ ├── text-wrap.less
│ │ │ │ │ │ ├── font-color.less
│ │ │ │ │ │ └── font-family.less
│ │ │ │ │ ├── other
│ │ │ │ │ │ ├── table.css
│ │ │ │ │ │ └── animation.less
│ │ │ │ │ ├── flex
│ │ │ │ │ │ ├── index.less
│ │ │ │ │ │ └── flex.less
│ │ │ │ │ ├── brand
│ │ │ │ │ │ ├── index.less
│ │ │ │ │ │ ├── assets
│ │ │ │ │ │ │ ├── dropdown
│ │ │ │ │ │ │ │ ├── dark
│ │ │ │ │ │ │ │ │ ├── icon-earn.png
│ │ │ │ │ │ │ │ │ ├── icon-spot.png
│ │ │ │ │ │ │ │ │ ├── icon-arrow.png
│ │ │ │ │ │ │ │ │ ├── icon-forex.png
│ │ │ │ │ │ │ │ │ ├── icon-address.png
│ │ │ │ │ │ │ │ │ ├── icon-deposits.png
│ │ │ │ │ │ │ │ │ ├── icon-history.png
│ │ │ │ │ │ │ │ │ ├── icon-overview.png
│ │ │ │ │ │ │ │ │ ├── icon-transfer.png
│ │ │ │ │ │ │ │ │ ├── icon-withdraws.png
│ │ │ │ │ │ │ │ │ └── icon-derivatives.png
│ │ │ │ │ │ │ │ └── light
│ │ │ │ │ │ │ │ │ ├── icon-arrow.png
│ │ │ │ │ │ │ │ │ ├── icon-earn.png
│ │ │ │ │ │ │ │ │ ├── icon-forex.png
│ │ │ │ │ │ │ │ │ ├── icon-spot.png
│ │ │ │ │ │ │ │ │ ├── icon-address.png
│ │ │ │ │ │ │ │ │ ├── icon-deposits.png
│ │ │ │ │ │ │ │ │ ├── icon-history.png
│ │ │ │ │ │ │ │ │ ├── icon-overview.png
│ │ │ │ │ │ │ │ │ ├── icon-transfer.png
│ │ │ │ │ │ │ │ │ ├── icon-withdraws.png
│ │ │ │ │ │ │ │ │ └── icon-derivatives.png
│ │ │ │ │ │ │ └── footer
│ │ │ │ │ │ │ │ └── follow
│ │ │ │ │ │ │ │ ├── hover
│ │ │ │ │ │ │ │ ├── kakao.png
│ │ │ │ │ │ │ │ ├── discord.png
│ │ │ │ │ │ │ │ ├── facebook.png
│ │ │ │ │ │ │ │ ├── linkedin.png
│ │ │ │ │ │ │ │ ├── medium.png
│ │ │ │ │ │ │ │ ├── reddit.png
│ │ │ │ │ │ │ │ ├── telegram.png
│ │ │ │ │ │ │ │ ├── twitter.png
│ │ │ │ │ │ │ │ ├── youtube.png
│ │ │ │ │ │ │ │ └── instagram.png
│ │ │ │ │ │ │ │ ├── default
│ │ │ │ │ │ │ │ ├── kakao.png
│ │ │ │ │ │ │ │ ├── medium.png
│ │ │ │ │ │ │ │ ├── reddit.png
│ │ │ │ │ │ │ │ ├── discord.png
│ │ │ │ │ │ │ │ ├── facebook.png
│ │ │ │ │ │ │ │ ├── linkedin.png
│ │ │ │ │ │ │ │ ├── telegram.png
│ │ │ │ │ │ │ │ ├── twitter.png
│ │ │ │ │ │ │ │ ├── youtube.png
│ │ │ │ │ │ │ │ └── instagram.png
│ │ │ │ │ │ │ │ ├── follow-arrow-up.png
│ │ │ │ │ │ │ │ └── follow-arrow-down.png
│ │ │ │ │ │ ├── downloadLayer.less
│ │ │ │ │ │ └── footer.less
│ │ │ │ │ ├── index.less
│ │ │ │ │ └── theme
│ │ │ │ │ │ └── brand.less
│ │ │ │ └── package.json
│ │ │ ├── flex
│ │ │ │ ├── src
│ │ │ │ │ ├── Flex.less
│ │ │ │ │ ├── Grid.js
│ │ │ │ │ ├── Scrollbar.js
│ │ │ │ │ └── Position.js
│ │ │ │ └── package.json
│ │ │ ├── list
│ │ │ │ ├── src
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── empty.png
│ │ │ │ │ ├── Empty.js
│ │ │ │ │ ├── AntPagination.js
│ │ │ │ │ ├── MobileList.js
│ │ │ │ │ ├── TimeRange.js
│ │ │ │ │ └── SimplePagination.js
│ │ │ │ └── package.json
│ │ │ ├── mobile
│ │ │ │ ├── index.js
│ │ │ │ └── src
│ │ │ │ │ └── Navbar.js
│ │ │ ├── typo
│ │ │ │ ├── src
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── List.js
│ │ │ │ └── package.json
│ │ │ ├── responsive
│ │ │ │ ├── index.js
│ │ │ │ └── src
│ │ │ │ │ └── index.less
│ │ │ ├── table
│ │ │ │ ├── src
│ │ │ │ │ ├── empty.png
│ │ │ │ │ ├── empty-grey.png
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── Empty.js
│ │ │ │ │ ├── AntPagination.js
│ │ │ │ │ ├── TimeRange.js
│ │ │ │ │ └── SimplePagination.js
│ │ │ │ └── package.json
│ │ │ ├── antd
│ │ │ │ ├── src
│ │ │ │ │ ├── Icon.js
│ │ │ │ │ ├── Field.js
│ │ │ │ │ ├── Spin.js
│ │ │ │ │ ├── Tooltip.js
│ │ │ │ │ ├── Form.js
│ │ │ │ │ ├── Button.js
│ │ │ │ │ ├── Input.js
│ │ │ │ │ ├── Select.js
│ │ │ │ │ ├── Tag.js
│ │ │ │ │ ├── Notify.js
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── Tabs.js
│ │ │ │ │ └── NumberInput.js
│ │ │ │ └── package.json
│ │ │ └── index.js
│ │ └── package.json
│ ├── iui
│ │ ├── src
│ │ │ ├── Empty
│ │ │ │ ├── index.less
│ │ │ │ └── index.js
│ │ │ ├── MobileTable
│ │ │ │ ├── ListView.less
│ │ │ │ └── Empty.js
│ │ │ ├── Table
│ │ │ │ ├── empty.png
│ │ │ │ ├── index.js
│ │ │ │ └── ListView.less
│ │ │ ├── common
│ │ │ │ └── iconfont
│ │ │ │ │ ├── iconfont.ttf
│ │ │ │ │ ├── iconfont.woff
│ │ │ │ │ └── iconfont.woff2
│ │ │ ├── Select
│ │ │ │ ├── images
│ │ │ │ │ ├── select-empty-dark.png
│ │ │ │ │ └── select-empty-light.png
│ │ │ │ └── index.js
│ │ │ ├── Navbar
│ │ │ │ └── child
│ │ │ │ │ ├── UserDropdown
│ │ │ │ │ └── images
│ │ │ │ │ │ └── avatar.png
│ │ │ │ │ ├── OrdersDropdown
│ │ │ │ │ ├── index.less
│ │ │ │ │ └── index.js
│ │ │ │ │ ├── MoreDrawer
│ │ │ │ │ ├── index.less
│ │ │ │ │ └── index.js
│ │ │ │ │ ├── CommonItem
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── index.less
│ │ │ │ │ ├── CommonDropdown
│ │ │ │ │ └── index.less
│ │ │ │ │ ├── DownloadDropdown
│ │ │ │ │ └── index.less
│ │ │ │ │ ├── MessageDropdown
│ │ │ │ │ └── index.less
│ │ │ │ │ └── CommonMenu
│ │ │ │ │ └── index.less
│ │ │ ├── Radio
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── Checkbox
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── Dropdown
│ │ │ │ ├── index.less
│ │ │ │ └── index.js
│ │ │ ├── Input
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── Switch
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── Button
│ │ │ │ └── index.js
│ │ │ ├── Tooltip
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── SimplePagination
│ │ │ │ ├── index.less
│ │ │ │ └── index.js
│ │ │ ├── Footer
│ │ │ │ ├── index.less
│ │ │ │ └── index.js
│ │ │ ├── index.less
│ │ │ ├── EditNickNameLayer
│ │ │ │ └── index.less
│ │ │ ├── index.js
│ │ │ ├── Modal
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── Drawer
│ │ │ │ └── index.js
│ │ │ └── Scrollbar
│ │ │ │ └── index.less
│ │ └── package.json
│ ├── ui
│ │ ├── src
│ │ │ ├── NotFound
│ │ │ │ ├── images
│ │ │ │ │ └── empty.png
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── toast
│ │ │ │ ├── images
│ │ │ │ │ ├── icon-info.png
│ │ │ │ │ ├── icon-error.png
│ │ │ │ │ ├── icon-success.png
│ │ │ │ │ └── icon-warning.png
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── Empty
│ │ │ │ ├── images
│ │ │ │ │ ├── empty-dark.png
│ │ │ │ │ └── empty-light.png
│ │ │ │ ├── index.less
│ │ │ │ └── index.js
│ │ │ ├── Select
│ │ │ │ ├── images
│ │ │ │ │ ├── icon-empty.png
│ │ │ │ │ └── icon-arrow-down.png
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── Tips
│ │ │ │ ├── images
│ │ │ │ │ ├── icon-remind.png
│ │ │ │ │ └── icon-warning.png
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── Input
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── Button
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── Checkbox
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── Tooltip
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ ├── Table
│ │ │ │ ├── index.less
│ │ │ │ └── index.js
│ │ │ ├── index.js
│ │ │ ├── SimplePagination
│ │ │ │ ├── index.less
│ │ │ │ └── index.js
│ │ │ └── Slider
│ │ │ │ └── index.js
│ │ └── package.json
│ └── tradingview
│ │ ├── package.json
│ │ └── README.md
├── bridge
│ ├── lib
│ │ ├── utils.js
│ │ └── error.js
│ ├── package.json
│ └── README.md
├── abtest
│ ├── package.json
│ ├── index.js
│ └── README.md
└── translang
│ ├── package.json
│ └── README.md
├── src
├── src
│ └── index.js
├── modules
│ ├── utils
│ │ ├── src
│ │ │ ├── ev.js
│ │ │ ├── iframe.js
│ │ │ ├── RegExp.js
│ │ │ ├── types.js
│ │ │ ├── index.js
│ │ │ ├── image.js
│ │ │ ├── validator.js
│ │ │ ├── umi.js
│ │ │ ├── gio.js
│ │ │ ├── useragent.js
│ │ │ ├── offline.js
│ │ │ ├── storage.js
│ │ │ ├── script.js
│ │ │ ├── transformers.js
│ │ │ ├── url.js
│ │ │ ├── dva.js
│ │ │ ├── array.js
│ │ │ ├── mock.js
│ │ │ ├── perf.js
│ │ │ ├── file.js
│ │ │ └── routeActions.js
│ │ ├── package.json
│ │ └── README.md
│ ├── auth
│ │ ├── src
│ │ │ ├── index.js
│ │ │ ├── containers.js
│ │ │ └── apis.js
│ │ └── package.json
│ ├── langs
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.js
│ │ │ ├── apis.js
│ │ │ └── pageInit.js
│ │ └── README.md
│ ├── config
│ │ ├── index.js
│ │ └── README.md
│ └── storages
│ │ └── README.md
└── package.json
├── .gitignore
├── lernaBak.json
├── lerna.json
└── package.json
/packages/translation/index.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/box/src/index.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/box/src/Box.js:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/index.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/src/index.js:
--------------------------------------------------------------------------------
1 | // placeholder for package main
2 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/flex/src/Flex.less:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/layer.less:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/navbarmenus.less:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/reset/reset.less:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/translation/locales/de-DE.json:
--------------------------------------------------------------------------------
1 | {
2 | "Test": "Test"
3 | }
--------------------------------------------------------------------------------
/packages/translation/locales/en-US.json:
--------------------------------------------------------------------------------
1 | {
2 | "Test": "Test"
3 | }
--------------------------------------------------------------------------------
/packages/translation/locales/es-ES.json:
--------------------------------------------------------------------------------
1 | {
2 | "Test": "Test"
3 | }
--------------------------------------------------------------------------------
/packages/translation/locales/fa-IR.json:
--------------------------------------------------------------------------------
1 | {
2 | "Test": "Test"
3 | }
--------------------------------------------------------------------------------
/packages/translation/locales/fr-FR.json:
--------------------------------------------------------------------------------
1 | {
2 | "Test": "Test"
3 | }
--------------------------------------------------------------------------------
/packages/translation/locales/it-IT.json:
--------------------------------------------------------------------------------
1 | {
2 | "Test": "Test"
3 | }
--------------------------------------------------------------------------------
/packages/translation/locales/ja-JP.json:
--------------------------------------------------------------------------------
1 | {
2 | "Test": "Test"
3 | }
--------------------------------------------------------------------------------
/packages/translation/locales/ko-KR.json:
--------------------------------------------------------------------------------
1 | {
2 | "Test": "Test"
3 | }
--------------------------------------------------------------------------------
/packages/translation/locales/pt-BR.json:
--------------------------------------------------------------------------------
1 | {
2 | "Test": "Test"
3 | }
--------------------------------------------------------------------------------
/packages/translation/locales/ru-RU.json:
--------------------------------------------------------------------------------
1 | {
2 | "Test": "Test"
3 | }
--------------------------------------------------------------------------------
/packages/translation/locales/tr-TR.json:
--------------------------------------------------------------------------------
1 | {
2 | "Test": "Test"
3 | }
--------------------------------------------------------------------------------
/packages/translation/locales/zh-TW.json:
--------------------------------------------------------------------------------
1 | {
2 | "Test": "Test"
3 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/reset/index.less:
--------------------------------------------------------------------------------
1 | @import './reset.less';
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/box/box-type.less:
--------------------------------------------------------------------------------
1 | .create-custom-box-types() {}
2 |
--------------------------------------------------------------------------------
/packages/translation/locales/de-DE.js:
--------------------------------------------------------------------------------
1 | import locales from './de-DE.json'
2 | export default locales
3 |
--------------------------------------------------------------------------------
/packages/translation/locales/en-US.js:
--------------------------------------------------------------------------------
1 | import locales from './en-US.json'
2 | export default locales
3 |
--------------------------------------------------------------------------------
/packages/translation/locales/es-ES.js:
--------------------------------------------------------------------------------
1 | import locales from './es-ES.json'
2 | export default locales
3 |
--------------------------------------------------------------------------------
/packages/translation/locales/fa-IR.js:
--------------------------------------------------------------------------------
1 | import locales from './fa-IR.json'
2 | export default locales
3 |
--------------------------------------------------------------------------------
/packages/translation/locales/fr-FR.js:
--------------------------------------------------------------------------------
1 | import locales from './fr-FR.json'
2 | export default locales
3 |
--------------------------------------------------------------------------------
/packages/translation/locales/it-IT.js:
--------------------------------------------------------------------------------
1 | import locales from './it-IT.json'
2 | export default locales
3 |
--------------------------------------------------------------------------------
/packages/translation/locales/ja-JP.js:
--------------------------------------------------------------------------------
1 | import locales from './ja-JP.json'
2 | export default locales
3 |
--------------------------------------------------------------------------------
/packages/translation/locales/ko-KR.js:
--------------------------------------------------------------------------------
1 | import locales from './ko-KR.json'
2 | export default locales
3 |
--------------------------------------------------------------------------------
/packages/translation/locales/pt-BR.js:
--------------------------------------------------------------------------------
1 | import locales from './pt-BR.json'
2 | export default locales
3 |
--------------------------------------------------------------------------------
/packages/translation/locales/ru-RU.js:
--------------------------------------------------------------------------------
1 | import locales from './ru-RU.json'
2 | export default locales
3 |
--------------------------------------------------------------------------------
/packages/translation/locales/tr-TR.js:
--------------------------------------------------------------------------------
1 | import locales from './tr-TR.json'
2 | export default locales
3 |
--------------------------------------------------------------------------------
/packages/translation/locales/zh-TW.js:
--------------------------------------------------------------------------------
1 | import locales from './zh-TW.json'
2 | export default locales
3 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/list/src/index.js:
--------------------------------------------------------------------------------
1 | import List from './MobileList'
2 | export default List
3 |
--------------------------------------------------------------------------------
/src/modules/utils/src/ev.js:
--------------------------------------------------------------------------------
1 | import { EventEmitter } from 'events'
2 | export default new EventEmitter()
3 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Empty/index.less:
--------------------------------------------------------------------------------
1 | .empty {
2 | margin: 64px auto;
3 | text-align: center;
4 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/mobile/index.js:
--------------------------------------------------------------------------------
1 | import Navbar from './src/Navbar';
2 | export {
3 | Navbar
4 | }
5 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/box/_variables.less:
--------------------------------------------------------------------------------
1 | @br-1: 2px;
2 | @br-2: 4px;
3 | @modal-width-1: 460px;
4 |
--------------------------------------------------------------------------------
/packages/components/iui/src/MobileTable/ListView.less:
--------------------------------------------------------------------------------
1 | .am-list-body::before, .am-list-body::after {
2 | height: 0 !important;
3 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/text-decoration.less:
--------------------------------------------------------------------------------
1 | .text-decoration{
2 | text-decoration:underline !important;
3 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/typo/src/index.js:
--------------------------------------------------------------------------------
1 | import { Title, Text } from './Typo'
2 | export {
3 | Title,
4 | Text,
5 | }
6 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/flex/src/Grid.js:
--------------------------------------------------------------------------------
1 | import { Row, Col } from 'antd'
2 |
3 | export default {
4 | Row,
5 | Col
6 | }
7 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/responsive/index.js:
--------------------------------------------------------------------------------
1 | import { useDevice } from './src/index'
2 |
3 | export {
4 | useDevice
5 | }
6 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/box/layer-shadow.less:
--------------------------------------------------------------------------------
1 | .navbar-shadow {
2 | box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.08);
3 | }
--------------------------------------------------------------------------------
/packages/components/iui/src/Table/empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/iui/src/Table/empty.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/other/table.css:
--------------------------------------------------------------------------------
1 | .table-responsive {
2 | display: block;
3 | width: 100%;
4 | overflow-x: auto;
5 | }
6 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/list/src/empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/list/src/empty.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/box.less:
--------------------------------------------------------------------------------
1 | .ant-popover.rs {
2 | .ant-popover-inner-content {
3 | padding: 0px !important;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/table/src/empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/table/src/empty.png
--------------------------------------------------------------------------------
/packages/components/ui/src/NotFound/images/empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/ui/src/NotFound/images/empty.png
--------------------------------------------------------------------------------
/packages/components/ui/src/toast/images/icon-info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/ui/src/toast/images/icon-info.png
--------------------------------------------------------------------------------
/packages/components/iui/src/common/iconfont/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/iui/src/common/iconfont/iconfont.ttf
--------------------------------------------------------------------------------
/packages/components/ui/src/Empty/images/empty-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/ui/src/Empty/images/empty-dark.png
--------------------------------------------------------------------------------
/packages/components/ui/src/Empty/images/empty-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/ui/src/Empty/images/empty-light.png
--------------------------------------------------------------------------------
/packages/components/ui/src/Select/images/icon-empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/ui/src/Select/images/icon-empty.png
--------------------------------------------------------------------------------
/packages/components/ui/src/Tips/images/icon-remind.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/ui/src/Tips/images/icon-remind.png
--------------------------------------------------------------------------------
/packages/components/ui/src/Tips/images/icon-warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/ui/src/Tips/images/icon-warning.png
--------------------------------------------------------------------------------
/packages/components/ui/src/toast/images/icon-error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/ui/src/toast/images/icon-error.png
--------------------------------------------------------------------------------
/packages/components/ui/src/toast/images/icon-success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/ui/src/toast/images/icon-success.png
--------------------------------------------------------------------------------
/packages/components/ui/src/toast/images/icon-warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/ui/src/toast/images/icon-warning.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/src/Icon.js:
--------------------------------------------------------------------------------
1 | import { Icon } from 'antd'
2 |
3 | export default function NewIcon(props) {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/table/src/empty-grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/table/src/empty-grey.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
3 | package-lock.json
4 | **/**/lerna-debug.log
5 | yarn.lock
6 | .tgz
7 | .doc/
8 | .docz/
9 | doc
10 | .idea
11 | .DS_Store
12 |
--------------------------------------------------------------------------------
/packages/components/iui/src/common/iconfont/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/iui/src/common/iconfont/iconfont.woff
--------------------------------------------------------------------------------
/packages/components/iui/src/common/iconfont/iconfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/iui/src/common/iconfont/iconfont.woff2
--------------------------------------------------------------------------------
/packages/components/ui/src/Select/images/icon-arrow-down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/ui/src/Select/images/icon-arrow-down.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/flex/index.less:
--------------------------------------------------------------------------------
1 | @import './bs-utils.less';
2 | @import './bs-grid.less';
3 | @import './flex.less';
4 | @import './flex-type.less';
5 |
--------------------------------------------------------------------------------
/lernaBak.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "independent",
3 | "packages": [
4 | "third-party-libs/*",
5 | "states/*",
6 | "modules/*",
7 | "ui/*"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Select/images/select-empty-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/iui/src/Select/images/select-empty-dark.png
--------------------------------------------------------------------------------
/packages/components/iui/src/Select/images/select-empty-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/iui/src/Select/images/select-empty-light.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/images/icon-info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/antd/images/icon-info.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/images/icon-error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/antd/images/icon-error.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/index.less:
--------------------------------------------------------------------------------
1 | @import './navbar.less';
2 | @import './footer.less';
3 | @import "./billanceFooter.less";
4 | @import "./navbarDropdown.less";
5 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/table/src/index.js:
--------------------------------------------------------------------------------
1 | import TableList from './TableList'
2 | import TimeRange from './TimeRange'
3 | export {
4 | TimeRange
5 | }
6 | export default TableList
7 |
--------------------------------------------------------------------------------
/src/modules/auth/src/index.js:
--------------------------------------------------------------------------------
1 | import * as utils from './utils'
2 | import { Loged, UnLoged } from './containers'
3 |
4 | export default utils
5 | export {
6 | Loged,
7 | UnLoged
8 | }
9 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Navbar/child/UserDropdown/images/avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/iui/src/Navbar/child/UserDropdown/images/avatar.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/images/icon-success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/antd/images/icon-success.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/images/icon-warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/antd/images/icon-warning.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/fonts/DINPro.41757346.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/typo/fonts/DINPro.41757346.otf
--------------------------------------------------------------------------------
/lerna.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "independent",
3 | "packages": [
4 | "packages/widgets/*",
5 | "packages/components/*",
6 | "packages/translation",
7 | "src"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/card.less:
--------------------------------------------------------------------------------
1 | .ant-card.rs {
2 | .ant-card-head {
3 | padding: 0px;
4 | }
5 |
6 | .ant-card-body {
7 | padding: 0px;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/fonts/TTNormsPro-Normal.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/typo/fonts/TTNormsPro-Normal.ttf
--------------------------------------------------------------------------------
/packages/components/iui/src/Table/index.js:
--------------------------------------------------------------------------------
1 | import TableList from './TableList'
2 | import ListView from './ListView'
3 |
4 | export {
5 | ListView,
6 | }
7 | export default TableList
8 |
9 |
10 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/icon.less:
--------------------------------------------------------------------------------
1 | .create-antd-icon() {
2 | .anticon {
3 |
4 | // color: @fc-icon;
5 | &.anticon-close {
6 | color: @fc-icon;
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-earn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-earn.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-spot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-spot.png
--------------------------------------------------------------------------------
/packages/bridge/lib/utils.js:
--------------------------------------------------------------------------------
1 | const utils = {
2 |
3 | isIOS: () => {
4 | return navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false
5 | }
6 |
7 | }
8 |
9 | export default utils;
10 |
11 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-arrow.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-forex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-forex.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-arrow.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-earn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-earn.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-forex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-forex.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-spot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-spot.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/kakao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/kakao.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-address.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-address.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-deposits.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-deposits.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-history.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-history.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-overview.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-transfer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-transfer.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-withdraws.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-withdraws.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-address.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-address.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-deposits.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-deposits.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-history.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-history.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-overview.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-transfer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-transfer.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/kakao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/kakao.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/medium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/medium.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/reddit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/reddit.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/discord.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/discord.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/facebook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/facebook.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/linkedin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/linkedin.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/medium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/medium.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/reddit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/reddit.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/telegram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/telegram.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/twitter.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/youtube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/youtube.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-derivatives.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/dark/icon-derivatives.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-withdraws.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-withdraws.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/discord.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/discord.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/facebook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/facebook.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/linkedin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/linkedin.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/telegram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/telegram.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/twitter.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/youtube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/youtube.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/follow-arrow-up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/follow-arrow-up.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/instagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/hover/instagram.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-derivatives.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/dropdown/light/icon-derivatives.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/instagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/default/instagram.png
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/assets/footer/follow/follow-arrow-down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nemo-crypto/monorepo/HEAD/packages/components/uikits/src/style/src/brand/assets/footer/follow/follow-arrow-down.png
--------------------------------------------------------------------------------
/packages/components/iui/src/Radio/index.js:
--------------------------------------------------------------------------------
1 | import { Radio } from 'antd'
2 |
3 | export default function (props) {
4 | const { children, className = '', ...rest } = props
5 | return {children}
6 | }
7 |
--------------------------------------------------------------------------------
/packages/components/ui/src/Input/index.js:
--------------------------------------------------------------------------------
1 | import { Input } from 'antd'
2 | import './index.less'
3 |
4 | export default function (props) {
5 | const { className = '', ...rest } = props
6 | return
7 | }
8 |
--------------------------------------------------------------------------------
/src/modules/auth/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/auth",
3 | "version": "1.0.0",
4 | "description": "",
5 | "author": "https://github.com/nemo-crypto",
6 | "main": "src/index.js",
7 | "license": "ISC",
8 | "files": [
9 | "src"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/modules/langs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/langs",
3 | "version": "1.0.2",
4 | "description": "",
5 | "author": "https://github.com/nemo-crypto",
6 | "main": "src/index.js",
7 | "license": "ISC",
8 | "files": [
9 | "src"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Checkbox/index.js:
--------------------------------------------------------------------------------
1 | import { Checkbox } from 'antd'
2 |
3 | export default function (props) {
4 | const { children, className = '', ...rest } = props
5 | return {children}
6 | }
7 |
--------------------------------------------------------------------------------
/packages/components/iui/src/MobileTable/Empty.js:
--------------------------------------------------------------------------------
1 | import $t from '@xatom/intl'
2 |
3 | export default function Widget (props) {
4 | return (
5 |
6 |
{$t('No Record')}
7 |
8 | )
9 | }
--------------------------------------------------------------------------------
/packages/components/ui/src/toast/index.js:
--------------------------------------------------------------------------------
1 | import { message } from 'antd'
2 | import './index.less'
3 |
4 | message.config({
5 | duration: 3,
6 | maxCount: 2,
7 | });
8 |
9 | export default function ({ type = 'success', title = "" }) {
10 | message[type](title)
11 | }
12 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/antd",
3 | "version": "1.0.0",
4 | "description": "",
5 | "author": "https://github.com/nemo-crypto",
6 | "license": "ISC",
7 | "main": "src/index.js",
8 | "files": [
9 | "src"
10 | ]
11 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/typo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/typo",
3 | "version": "1.0.1",
4 | "description": "typo",
5 | "author": "https://github.com/nemo-crypto",
6 | "license": "ISC",
7 | "main": "src/index.js",
8 | "files": [
9 | "src"
10 | ]
11 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/box/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/box",
3 | "version": "1.0.1",
4 | "description": "box",
5 | "author": "https://github.com/nemo-crypto",
6 | "license": "ISC",
7 | "main": "src/index.js",
8 | "files": [
9 | "src"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/list/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/table",
3 | "version": "0.0.2",
4 | "description": "",
5 | "author": "https://github.com/nemo-crypto",
6 | "license": "ISC",
7 | "main": "src/index.js",
8 | "files": [
9 | "src"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/table/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/table",
3 | "version": "0.0.2",
4 | "description": "",
5 | "author": "https://github.com/nemo-crypto",
6 | "license": "ISC",
7 | "main": "src/index.js",
8 | "files": [
9 | "src"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/flex/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/flex",
3 | "version": "1.0.1",
4 | "description": "flex",
5 | "author": "https://github.com/nemo-crypto",
6 | "license": "ISC",
7 | "main": "src/index.js",
8 | "files": [
9 | "src"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/style",
3 | "version": "1.0.2",
4 | "description": "style",
5 | "author": "https://github.com/nemo-crypto",
6 | "license": "ISC",
7 | "main": "src/index.js",
8 | "files": [
9 | "src"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/packages/components/ui/src/Button/index.js:
--------------------------------------------------------------------------------
1 | import { Button } from 'antd'
2 | import './index.less'
3 |
4 | export default function (props) {
5 | const { children, className = '', ...rest } = props
6 | return
7 | }
8 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Dropdown/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-dropdown(
2 | @Bg4: '';
3 | @L2: '';
4 | ) {
5 | .iui-dropdown-overlay {
6 | background: @Bg4;
7 | border-radius: 6px;
8 | border: 1px solid @L2;
9 | box-shadow: 0px 2px 30px 0px rgba(0, 0, 0, 0.15);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/packages/components/ui/src/Checkbox/index.js:
--------------------------------------------------------------------------------
1 | import { Checkbox } from 'antd'
2 | import './index.less'
3 |
4 | export default function (props) {
5 | const { children, className = '', ...rest } = props
6 | return {children}
7 | }
8 |
--------------------------------------------------------------------------------
/src/modules/utils/src/iframe.js:
--------------------------------------------------------------------------------
1 | // 防止iframe非法嵌入
2 | export function disallowIframe() {
3 | try {
4 | if (top.location.hostname != window.location.hostname) {
5 | top.location.href = window.location.href
6 | }
7 | }
8 | catch(e) {
9 | window.location.href = "about:blank"
10 | }
11 | }
--------------------------------------------------------------------------------
/packages/components/iui/src/Dropdown/index.js:
--------------------------------------------------------------------------------
1 | import { Dropdown } from 'antd'
2 |
3 | export default function (props) {
4 | const { children, overlayClassName = '', ...rest } = props
5 | return {children}
6 | }
7 |
--------------------------------------------------------------------------------
/packages/abtest/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/abtest",
3 | "version": "0.0.2-beta.1",
4 | "description": "To test the data of the current system.",
5 | "license": "ISC",
6 | "main": "index.js",
7 | "publishConfig": {
8 | "registry": "https://github.com/nemo-crypto/monorepo"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/src/Field.js:
--------------------------------------------------------------------------------
1 | import { Form } from 'antd'
2 | const FormItem = Form.Item
3 | export default props => {
4 | const { children, visible = true, colon = false, onChange, ...rest } = props
5 | return visible ? {children} : null
6 | }
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/components/ui/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/ui",
3 | "version": "1.0.14",
4 | "description": "",
5 | "license": "ISC",
6 | "main": "src/index.js",
7 | "files": [
8 | "src"
9 | ],
10 | "publishConfig": {
11 | "registry": "https://github.com/nemo-crypto/monorepo"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/src/Spin.js:
--------------------------------------------------------------------------------
1 | import { Spin } from 'antd'
2 | export default (props) => {
3 | let { loading, className, style = {}, ...rest } = props
4 | className += ` center-vh ${className}`
5 | style = { flex: 1 }
6 | return
7 | }
8 |
--------------------------------------------------------------------------------
/src/modules/utils/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/utils",
3 | "version": "1.0.1",
4 | "description": "",
5 | "author": "https://github.com/nemo-crypto",
6 | "main": "src/index.js",
7 | "license": "ISC",
8 | "files": [
9 | "src"
10 | ],
11 | "dependencies": {
12 | "uuid": "8.3.2"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/modules/utils/src/RegExp.js:
--------------------------------------------------------------------------------
1 |
2 | export function isEmail(str){
3 | // const pattern = /w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*/
4 | if (str && str.indexOf('@') > -1) {
5 | return true
6 | } else {
7 | return false
8 | }
9 | }
10 |
11 |
12 | export function isMobilePhone(str){
13 |
14 | }
15 |
16 |
17 |
--------------------------------------------------------------------------------
/packages/components/ui/src/Empty/index.less:
--------------------------------------------------------------------------------
1 | .ui-empty {
2 | display: flex;
3 | flex-direction: column;
4 | align-items: center;
5 | justify-content: center;
6 |
7 | &-icon {
8 | display: block;
9 | margin-bottom: 20px;
10 | }
11 | &-text {
12 | color: #c1c1c1;
13 | font-size: 14px;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/components/ui/src/Tooltip/index.js:
--------------------------------------------------------------------------------
1 | import { Tooltip } from 'antd'
2 | import './index.less'
3 |
4 | export default function (props) {
5 | const { children, overlayClassName = '', ...rest } = props
6 | return {children}
7 | }
8 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/box/cursor.less:
--------------------------------------------------------------------------------
1 | .cursor-pointer {
2 | cursor: pointer !important;
3 | }
4 |
5 | .cursor-not-allowed {
6 | cursor: not-allowed !important;
7 | }
8 |
9 | .pointer {
10 | cursor: pointer !important;
11 | }
12 |
13 | .cursor-not-selected {
14 | user-select: none !important;
15 | }
16 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/src/Tooltip.js:
--------------------------------------------------------------------------------
1 | import { Tooltip } from 'antd'
2 | export default (props) => {
3 | let { type = 'primary', overlayClassName = '', ...rest } = props
4 | overlayClassName = `tooltip-${type} ${overlayClassName}`
5 | return {props.children}
6 | }
7 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/index.less:
--------------------------------------------------------------------------------
1 | @times: 0.625;
2 |
3 | // modules
4 | @import './box/index.less';
5 | @import './flex/index.less';
6 | @import './typo/index.less';
7 | @import './antd/index.less';
8 | @import './brand/index.less';
9 |
10 | // theme
11 | @import './theme/index.less';
12 | @import './brand/downloadLayer.less';
13 |
--------------------------------------------------------------------------------
/packages/translang/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/translang",
3 | "version": "0.0.8",
4 | "description": "转换指定格式的xlsx文件为项目里的语言json文件",
5 | "bin": {
6 | "translang": "/bin/index.js"
7 | },
8 | "author": "https://github.com/nemo-crypto",
9 | "license": "ISC",
10 | "dependencies": {
11 | "xlsx": "0.18.5"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/box/position-zindex.less:
--------------------------------------------------------------------------------
1 | .zindex-0 {
2 | z-index: 0;
3 | }
4 |
5 | .zindex-1 {
6 | z-index: 1;
7 | }
8 |
9 | .zindex-2 {
10 | z-index: 10;
11 | }
12 |
13 | .zindex-3 {
14 | z-index: 100;
15 | }
16 |
17 | .zindex-4 {
18 | z-index: 1000;
19 | }
20 |
21 | .zindex-5 {
22 | z-index: 10000;
23 | }
24 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/menus.less:
--------------------------------------------------------------------------------
1 | .ant-menu-root {
2 | background: transparent !important;
3 | }
4 |
5 | .ant-menu-item,
6 | .ant-menu-submenu-title {
7 | position: inherit !important;
8 | }
9 |
10 | .ant-menu-horizontal>.ant-menu-item,
11 | .ant-menu-horizontal>.ant-menu-submenu {
12 | position: inherit !important;
13 | }
14 |
--------------------------------------------------------------------------------
/packages/bridge/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/bridge",
3 | "version": "2.0.11-beta.1",
4 | "description": "",
5 | "author": "https://github.com/nemo-crypto",
6 | "license": "ISC",
7 | "main": "lib/bridge.js",
8 | "files": [
9 | "lib"
10 | ],
11 | "publishConfig": {
12 | "registry": "https://github.com/nemo-crypto/monorepo"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Table/ListView.less:
--------------------------------------------------------------------------------
1 | .create-iui-listView (
2 |
3 | ) {
4 | .iui-list-h5 {
5 | .am-list {
6 | .am-list-body {
7 | padding: 0 16px 16px 16px;
8 | background: transparent !important;
9 | border: 0;
10 | }
11 | .am-list-footer {
12 | padding: 0;
13 | }
14 | }
15 | }
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/src/Form.js:
--------------------------------------------------------------------------------
1 | import { Form } from 'antd'
2 | export default props => {
3 | const { form = {}, children, ...rest } = props
4 | const childProps = { form }
5 | return
6 | }
7 | // { React.Children.map(children, child => React.cloneElement(child, { ...childProps })) }
8 | // export default Form.create()(FormWrapper)
9 |
--------------------------------------------------------------------------------
/src/modules/config/index.js:
--------------------------------------------------------------------------------
1 | import { getValueByPath } from '../utils/src/object'
2 |
3 | export function getAppConfig(path, defaultValue) {
4 | if (path) {
5 | return getValueByPath(window.appConfig, path, defaultValue)
6 | } else {
7 | return window.appConfig
8 | }
9 | }
10 |
11 | export function setAppConfig(config) {
12 | window.appConfig = config
13 | }
14 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Input/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * size:max/large/default/small
3 | */
4 | import { Input } from 'antd'
5 |
6 | export default function (props) {
7 | const { className = '', size = '', ...rest } = props
8 | const sizeClassName = size ? `iui-input-size-${size}` : ''
9 | return
10 | }
11 |
--------------------------------------------------------------------------------
/packages/translation/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/locales",
3 | "version": "0.1.131",
4 | "description": "",
5 | "author": "https://github.com/nemo-crypto",
6 | "license": "ISC",
7 | "main": "index.js",
8 | "files": [
9 | "locales",
10 | "index.js"
11 | ],
12 | "publishConfig": {
13 | "registry": "https://github.com/nemo-crypto/monorepo"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/spin.less:
--------------------------------------------------------------------------------
1 | .create-antd-spin(@brand-primary: ''; ) {
2 | .ant-spin-spinning {
3 | background: transparent;
4 | }
5 |
6 | .ant-spin-container::after {
7 | background: transparent;
8 | }
9 |
10 | .ant-spin {
11 | background: transparent;
12 | }
13 |
14 | .ant-spin-dot-item {
15 | background-color: @brand-primary;
16 | }
17 | }
--------------------------------------------------------------------------------
/packages/components/iui/src/Switch/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * size:default/small
3 | * type:default/primary
4 | */
5 |
6 | import { Switch } from 'antd'
7 |
8 | export default function (props) {
9 | const { className = '', type = '', ...rest } = props
10 | const typeClassName = type ? `iui-switch-${type}` : ''
11 | return
12 | }
13 |
--------------------------------------------------------------------------------
/src/modules/utils/src/types.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | export function isArray(value) {
4 | return Object.prototype.toString.call(value) === '[object Array]'
5 | }
6 | export function isFunction(value) {
7 | return Object.prototype.toString.call(value) === '[object Function]'
8 | }
9 | export function isString(value) {
10 | return Object.prototype.toString.call(value) === '[object String]'
11 | }
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/text-justify.less:
--------------------------------------------------------------------------------
1 | // frozenui
2 | // http://frozenui.github.io/components/function
3 | // 不能搭配 typo-nowrap typo-ellipse
4 | .ui-txt-justify-one {
5 | text-align: justify;
6 | overflow: hidden;
7 | height: 24px
8 | }
9 |
10 | .ui-txt-justify-one:after {
11 | display: inline-block;
12 | content: '';
13 | overflow: hidden;
14 | width: 100%;
15 | height: 0
16 | }
17 |
--------------------------------------------------------------------------------
/packages/components/ui/src/Checkbox/index.less:
--------------------------------------------------------------------------------
1 | .ui-checkbox {
2 | color: #000 !important;
3 | font-size: 14px;
4 | .ant-checkbox-inner {
5 | border-color: rgba(0, 0, 0, 0.1);
6 | border-radius: 4px;
7 | }
8 | .ant-checkbox.ant-checkbox-checked .ant-checkbox-inner {
9 | border-color: #000;
10 | background-color: #000;
11 | }
12 | .ant-checkbox-checked::after {
13 | display: none;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/drawer.less:
--------------------------------------------------------------------------------
1 | // 强制要求 Modal的样式单独实现,不依赖系统的设置
2 | .ant-drawer {
3 | background: transparent !important;
4 |
5 | .ant-drawer-content {
6 | background: transparent !important;
7 | }
8 |
9 | .ant-drawer-body {
10 | padding: 0px !important;
11 | background: transparent !important;
12 | height: 100%;
13 |
14 | &>* {
15 | height: 100%;
16 | }
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/packages/components/ui/src/Tooltip/index.less:
--------------------------------------------------------------------------------
1 | .ui-tooltip-overlay {
2 | .ant-tooltip-inner {
3 | background: #2D2D2F !important;
4 | color: #fff !important;
5 | border-radius: 6px;
6 | padding: 12px !important;
7 | }
8 |
9 | .ant-tooltip-arrow {
10 | border-right-color: #2D2D2F !important;
11 | border-bottom-color: #2D2D2F !important;
12 |
13 | &::before {
14 | background: #2D2D2F !important;
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "version": "0.0.0",
4 | "author": "https://github.com/nemo-crypto",
5 | "devDependencies": {
6 | "lerna": "3.15.0"
7 | },
8 | "scripts": {
9 | "versions": "lerna ls --long",
10 | "diff": "git log --pretty=oneline --no-merges",
11 | "i18n": "node --experimental-modules --loader ./build/custom-loader.mjs build/build-i18n.js"
12 | },
13 | "dependencies": {
14 | "glob": "7.2.0"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/packages/components/iui/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/iui",
3 | "version": "1.0.25-beta.1",
4 | "description": "",
5 | "license": "ISC",
6 | "main": "src/index.js",
7 | "files": [
8 | "src"
9 | ],
10 | "publishConfig": {
11 | "registry": "https://github.com/nemo-crypto/monorepo"
12 | },
13 | "dependencies": {
14 | "react-responsive": "8.2.0",
15 | "qrcode.react": "3.1.0",
16 | "copy-to-clipboard": "3.3.3"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/list/src/Empty.js:
--------------------------------------------------------------------------------
1 | import { Text } from '@xatom/typo';
2 | import $t from '@xatom/intl';
3 |
4 | export default function Empty({ height = '66px' }) {
5 | return (
6 |
7 |
})
8 |
{$t('No Record')}
9 |
10 | )
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Button/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * size:max/large/default/small
3 | * type:primary/up/down/default/line/text
4 | */
5 | import { Button } from 'antd'
6 |
7 | export default function (props) {
8 | const { children, className = '', size = '', ...rest } = props
9 | const sizeClassName = size ? `iui-button-size-${size}` : ''
10 | return
11 | }
12 |
--------------------------------------------------------------------------------
/packages/components/ui/src/Tips/index.js:
--------------------------------------------------------------------------------
1 | import './index.less'
2 |
3 | export default function (props) {
4 | const { children, align = '', type = 'remind', shape = '', className = '', ...rest } = props
5 | return
6 |
7 | {children}
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/placeholder.less:
--------------------------------------------------------------------------------
1 | .create-placeholder-types() {
2 | .fake-input-placeholder {
3 | font-size: @fs-text1 !important;
4 | color: @fc-grey-lighter !important;
5 | // .center-v;
6 | line-height: 16px !important;
7 | }
8 |
9 | input::-webkit-input-placeholder {
10 | font-size: @fs-text1 !important;
11 | color: @fc-grey-lighter !important;
12 | // .center-v;
13 | line-height: normal !important;
14 | }
15 | }
--------------------------------------------------------------------------------
/packages/components/ui/src/Empty/index.js:
--------------------------------------------------------------------------------
1 | import $t from '@xatom/intl'
2 | import './index.less'
3 |
4 | export default function (props) {
5 | const { className = '', size = '100px', theme = 'light', text = $t('No Record'), ...rest } = props
6 | return
7 |
})
8 |
{text}
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/index.js:
--------------------------------------------------------------------------------
1 | import { Title, Text } from '@xatom/typo'
2 | import { Cols, Stacks, Cell, Fluid, Scroll, Auto } from '@xatom/flex'
3 | import { Button, Icon, Form, Field, Select, Input, NumberInput, toast, notify, Spin, Tag, Tabs, Tooltip } from '@xatom/antd'
4 | export {
5 | Title, Text,
6 | Cols, Stacks, Cell, Fluid, Scroll, Auto,
7 | Button, Icon, Spin,
8 | Form, Field, Select, Input, NumberInput,
9 | toast, notify,
10 | Tag,
11 | Tabs,
12 | Tooltip,
13 | }
14 |
--------------------------------------------------------------------------------
/src/modules/utils/src/index.js:
--------------------------------------------------------------------------------
1 | // 数字千分位展示
2 | export const toSeprator = num => {
3 | if(isNaN(num)) return 0
4 | const arr = ("" + num).split('.')
5 | const str1 = arr[0]
6 | const str2 = arr[1] ? '.' + arr[1] : ''
7 | return str1.replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g, "$1,") + str2
8 | }
9 |
10 | // 获取传入数值有几位小数
11 | export const getNumPrecisionLength = num => {
12 | if (!num) return 0
13 | const arr = num.toString().split('.')
14 | if (arr[1]) return arr[1].length
15 | return 0
16 | }
17 |
--------------------------------------------------------------------------------
/packages/components/uikits/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/uikits",
3 | "version": "0.1.145",
4 | "description": "",
5 | "author": "https://github.com/nemo-crypto",
6 | "license": "ISC",
7 | "main": "src/index.js",
8 | "files": [
9 | "src"
10 | ],
11 | "publishConfig": {
12 | "registry": "https://github.com/nemo-crypto/monorepo"
13 | },
14 | "dependencies": {
15 | "react-custom-scrollbars": "4.2.1",
16 | "moment": "2.30.1",
17 | "react-responsive": "8.2.0"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/src/Button.js:
--------------------------------------------------------------------------------
1 | import { Button } from 'antd'
2 |
3 | export default function NewButton(props) {
4 | let { children, type, className, outline, ...rest } = props
5 | className = `typo-button-${type} ${className}`
6 | if (props.disabled) className += ' typo-button-disabled'
7 | if (props.outline) className += ' typo-button-outline'
8 | const newProps = { className, type, ...rest }
9 | return
10 | }
11 | NewButton.Group = Button.Group
12 |
--------------------------------------------------------------------------------
/src/modules/utils/src/image.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 图片压缩处理
3 | * url 图片地址
4 | * w 需要的图片宽度
5 | * h 需要的图片高度
6 | * dpi 几倍图
7 | * q 图片质量
8 | */
9 | export function getOssImage(url, { w, h, dpi = 2, q = 80 }) {
10 | if (url) {
11 | const split = url.includes('?') ? '&' : '?'
12 | let suffix = `${url}${split}x-oss-process=image/resize`
13 | if (w) suffix += `,w_${w * dpi}`
14 | if (h) suffix += `,h_${h * dpi}`
15 | if (q) suffix += `/quality,q_${q}`
16 | return suffix
17 | }
18 | return ''
19 | }
20 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/src/Input.js:
--------------------------------------------------------------------------------
1 | import { Input } from 'antd'
2 | NewInput.Password = Input.Password
3 | NewInput.Search = Input.Search
4 | NewInput.TextArea = Input.TextArea
5 | NewInput.Group = Input.Group
6 | export default function NewInput(props) {
7 | let { onChange, children, ...rest } = props
8 |
9 | function handelChange(e) {
10 | onChange && onChange(e.target.value)
11 | }
12 | return (
13 |
14 | {children}
15 |
16 | )
17 | }
18 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/typo-types.less:
--------------------------------------------------------------------------------
1 | .typo-tab {
2 | height: 100%;
3 | .center-vh;
4 | border-bottom-width: 3px;
5 | border-bottom-style: solid;
6 | border-bottom-color: transparent;
7 | border-bottom: 3px solid transparent;
8 |
9 | &.active {
10 | border-color: @brand-primary;
11 | }
12 |
13 | &.bb-3 {
14 | border-bottom-width: 3px;
15 | }
16 |
17 | &.bb-2 {
18 | border-bottom-width: 2px;
19 | }
20 |
21 | &.bb-1 {
22 | border-bottom-width: 2px;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/font-weight.less:
--------------------------------------------------------------------------------
1 | .fw-type(@type: ''; @weight: ''; ) {
2 | .fw-@{type} {
3 | font-weight: @weight !important;
4 | }
5 |
6 | .hover-fw-@{type}:hover {
7 | font-weight: @weight !important;
8 | }
9 |
10 | .active-fw-@{type}.active {
11 | font-weight: @weight !important;
12 | }
13 | }
14 |
15 | .fw-type(@type: ~"light"; @weight: 300; );
16 | .fw-type(@type: ~"normal"; @weight: 400; );
17 | .fw-type(@type: ~"bold"; @weight: 500; );
18 | .fw-type(@type: ~"bolder"; @weight: 600; );
19 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/typo/src/List.js:
--------------------------------------------------------------------------------
1 |
2 | export function Inlines(props) {
3 | let { children, className = '', style = {}, dataSource = [], ...rest } = props
4 | className = `title ${className}`
5 | style = { ...style }
6 | const newProps = { className, style, ...rest }
7 | return (
8 |
9 | {
10 | dataSource.map(item => (
11 | {item.children}
12 | ))
13 | }
14 |
15 | )
16 | }
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/responsive/src/index.less:
--------------------------------------------------------------------------------
1 | .grid-items {
2 | display: flex;
3 | flex-wrap: wrap;
4 |
5 | .grid-item {
6 | flex: 0 0 auto;
7 | }
8 |
9 | .grid-item-col-1 {
10 | width: 100%;
11 | }
12 |
13 | .grid-item-col-2 {
14 | width: 50%;
15 | }
16 |
17 | .grid-item-col-3 {
18 | width: 33.333%;
19 | }
20 |
21 | .grid-item-col-4 {
22 | width: 25%;
23 | }
24 |
25 | .grid-item-col-5 {
26 | width: 20%;
27 | }
28 |
29 | .grid-item-col-6 {
30 | width: 16.6666%;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/packages/components/tradingview/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@xatom/tradingview",
3 | "version": "1.0.21",
4 | "description": "tradingview",
5 | "keywords": [
6 | "tradingview"
7 | ],
8 | "author": "https://github.com/nemo-crypto",
9 | "homepage": "",
10 | "license": "ISC",
11 | "main": "src/index.js",
12 | "files": [
13 | "src"
14 | ],
15 | "publishConfig": {
16 | "registry": "https://github.com/nemo-crypto/monorepo"
17 | },
18 | "dependencies": {
19 | "lodash": "4.17.21",
20 | "moment-timezone": "0.5.43"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/table/src/Empty.js:
--------------------------------------------------------------------------------
1 | import $t from '@xatom/intl';
2 | import { getHooksMode } from '@xatom/utils/src/themes';
3 |
4 | export default function Empty(props) {
5 | const mode = getHooksMode()
6 | const { height = '72px', emptyText = $t('No Record') } = props
7 | return (
8 |
9 |

10 |
{emptyText}
11 |
12 | )
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/form.less:
--------------------------------------------------------------------------------
1 | .create-antd-form() {}
2 |
3 | .ant-form-item-label {
4 | line-height: 1 !important;
5 | margin-bottom: 5px;
6 | }
7 |
8 | .ant-form-inline {
9 | .d-flex;
10 |
11 | .ant-form-item {
12 | .d-flex;
13 |
14 | &>.ant-form-item-label {
15 | margin-bottom: 0px;
16 | .center-v;
17 | }
18 | }
19 | }
20 |
21 |
22 |
23 |
24 |
25 | .ant-form {
26 | .ant-form-item {
27 | margin-bottom: 0;
28 | }
29 | }
30 |
31 | .ant-calendar-range-picker-separator {
32 | padding-top: 7px;
33 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/title.less:
--------------------------------------------------------------------------------
1 | .title-type(@type: 1; @size: 14px; @color: #000; @bold: normal;@hover:@color;) {
2 | .typo-title-@{type} {
3 | line-height: 1.2;
4 | font-size: @size ;
5 | color: @color;
6 | &.cursor-pointer:hover{
7 | color:@hover;
8 | }
9 | // font-weight: @bold;
10 | &.fc-inherit {
11 | color: inherit;
12 | }
13 |
14 | &.typo-disabled {
15 | color: fade(@color, 65%) !important;
16 | cursor: not-allowed;
17 | }
18 | }
19 | }
20 |
21 | .create-title-types() {}
22 |
--------------------------------------------------------------------------------
/src/modules/langs/src/index.js:
--------------------------------------------------------------------------------
1 | import { getLang, setLang, getLangs, getServerLang, formatLang, getTradingViewLang, getUmiLocale, getValidLangs, getZendeskLang, getZELang, isFaLang } from './utils'
2 | import init, { handleSimulatorLang } from './pageInit'
3 | import * as apis from './apis'
4 | export {
5 | formatLang,
6 | getLang,
7 | getLangs,
8 | getServerLang,
9 | setLang,
10 | getTradingViewLang,
11 | getUmiLocale,
12 | getValidLangs,
13 | getZendeskLang,
14 | apis,
15 | init,
16 | getZELang,
17 | handleSimulatorLang,
18 | isFaLang
19 | }
20 |
--------------------------------------------------------------------------------
/packages/bridge/lib/error.js:
--------------------------------------------------------------------------------
1 | const error = {
2 | 'BRIDGE_TIMEOUT': {
3 | 'code': 1,
4 | 'message': 'bridge time out.'
5 | },
6 | 'BRIDGE_NOTFOUND': {
7 | 'code': 2,
8 | 'message': 'bridge not found !'
9 | },
10 | 'PARAMETER_ERROR': {
11 | 'code': 3,
12 | 'message': 'parameter error !'
13 | },
14 | 'JSON_PARSE_ERROR': {
15 | 'code': 4,
16 | 'message': 'json parse error !'
17 | },
18 | 'BRIDGE_FUNCTION_NOTFOUND': {
19 | 'code': 5,
20 | 'message': 'bridge function not found !'
21 | }
22 | };
23 |
24 | export default error;
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/src/Select.js:
--------------------------------------------------------------------------------
1 | import { Select } from 'antd'
2 | export default function NewSelect(props) {
3 | let { options = [], labelRender, block, className, children, label, ...rest } = props
4 | if (block) {
5 | className += ' d-block'
6 | }
7 | return (
8 |
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/src/Tag.js:
--------------------------------------------------------------------------------
1 | import { Icon } from 'antd'
2 | export default (props) => {
3 | let { type = 'primary', size = "middle", outline, className = '', style = {}, icon, ...rest } = props
4 | className += ` ${className} tag-basic tag-${type} tag-${size}`
5 | if (props.onClick) className = className + ' cursor-pointer'
6 | if (outline) className += ` tag-outline`
7 | if (icon) icon =
8 | style = { ...style }
9 | return {icon}{props.children}
10 | }
11 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/box/index.less:
--------------------------------------------------------------------------------
1 | @import './_variables.less';
2 | // colors
3 | @import './background.less';
4 | @import './border-type.less';
5 | @import './border.less';
6 | // size
7 | @import './size.less';
8 | // spacing
9 | @import './margin.less';
10 | @import './spacing.less';
11 | // position
12 | @import './position.less';
13 | @import './position-zindex.less';
14 | // other
15 | @import './cursor.less';
16 | @import './line-height.less';
17 | @import './scrollbar.less';
18 | @import './box-type.less';
19 | @import './hoverable.less';
20 | @import './layer-shadow.less';
21 |
--------------------------------------------------------------------------------
/src/modules/utils/src/validator.js:
--------------------------------------------------------------------------------
1 | import Schema from 'async-validator';
2 | import { isFunction } from './types';
3 |
4 | export const validate = (value = '', schema = {}, callback, options = {}, ) => {
5 | let validator = new Schema(schema);
6 | if (isFunction(callback)) {
7 | validator.validate(value, options, callback);
8 | } else {
9 | validator.validate(value, options, defaultCallback);
10 | }
11 | }
12 |
13 | const defaultCallback = (errors, fields) => {
14 | let msgs = errors.map(err => err.message).join()
15 | throw new Error(`data type invalid: ${msgs} \n`);
16 | };
17 |
18 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/_variables.less:
--------------------------------------------------------------------------------
1 | // ========================================
2 | // Font Size
3 | // ========================================
4 |
5 | // text
6 | @fs-text1: 12px;
7 | @fs-text2: 14px;
8 | // title
9 | @fs-title1: 16px;
10 | @fs-title2: 20px;
11 | @fs-title3: 26px;
12 | // paragraph
13 | @fs-paragraph1: 12px;
14 | @fs-paragraph2: 13px;
15 | @fs-paragraph3: 14px;
16 |
17 |
18 | // ========================================
19 | // Line Height
20 | // ========================================
21 |
22 | @lh-paragraph1: 1.5;
23 | @lh-paragraph2: 1.5;
24 | @lh-paragraph3: 1.5;
25 |
--------------------------------------------------------------------------------
/src/modules/utils/src/umi.js:
--------------------------------------------------------------------------------
1 | import { isFunction } from './types'
2 |
3 | // get dispatch by this way only in some specail condition
4 | export function getDispatch() {
5 | const dispatch = window.g_app && window.g_app._store && window.g_app._store.dispatch
6 | if (!isFunction(dispatch)) { console.log('cant not get dispatch') }
7 | return isFunction(dispatch) ? dispatch : null
8 | }
9 | export function getStore() {
10 | return window.g_app._store
11 | }
12 |
13 | export function getState() {
14 | const store = window.g_app._store
15 | return store ? store.getState() : {}
16 | }
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Tooltip/index.js:
--------------------------------------------------------------------------------
1 | import { Tooltip } from 'antd'
2 |
3 | export default function (props) {
4 | /**
5 | * underline 可选,触发节点是否添加下划线
6 | * maxWidth 可选,提示浮层宽度
7 | */
8 | let { children, underline = false, maxWidth = '', overlayStyle = {}, overlayClassName = '', ...rest } = props
9 | maxWidth = maxWidth || 'calc(100vw - 48px)'
10 | return
11 | {underline ? {children} : children}
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/packages/components/ui/src/Table/index.less:
--------------------------------------------------------------------------------
1 | .ui-table {
2 |
3 | .ant-table-thead>tr>th,
4 | .ant-table-tbody>tr>td {
5 | border-bottom: 1px solid rgba(0, 0, 0, 0.06);
6 |
7 | &:not(:first-child) {
8 | padding-left: 10px;
9 | }
10 | }
11 |
12 | .ant-table-thead>tr>th {
13 | padding: 14px 0;
14 | color: rgba(137, 137, 137, 1);
15 | font-size: 12px;
16 | }
17 |
18 | .ant-table-tbody>tr>td {
19 | height: auto;
20 | padding: 15px 0;
21 | color: rgba(0, 0, 0, 1);
22 | font-size: 14px;
23 | line-height: 30px;
24 | word-wrap: break-word;
25 | word-break: break-all;
26 | }
27 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/box/hoverable.less:
--------------------------------------------------------------------------------
1 | .hoverable {
2 | .hover-visible {
3 | display: none !important;
4 | }
5 | .hover-visible-inline {
6 | display: none !important;
7 | }
8 | .hover-hidden {
9 | display: block !important;
10 | }
11 | .hover-hidden-inline {
12 | display: inline-block !important;
13 | }
14 |
15 |
16 | &:hover {
17 | .hover-visible {
18 | display: block !important;
19 | }
20 |
21 | .hover-visible-inline {
22 | display: inline-block !important;
23 | }
24 | .hover-hidden {
25 | display: none !important;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/modules/auth/src/containers.js:
--------------------------------------------------------------------------------
1 | import { isLoged, getUser } from './utils'
2 | import { isFunction } from '@xatom/utils/src/types'
3 |
4 | export function Loged(props) {
5 | const loged = isLoged()
6 | const user = getUser()
7 | if (loged) {
8 | if (isFunction(props.children)) {
9 | return props.children({ user })
10 | } else {
11 | return props.children
12 | }
13 | } else {
14 | return props.unLoged || null
15 | }
16 | }
17 |
18 | export function UnLoged(props) {
19 | const loged = isLoged()
20 | if (!loged) {
21 | return props.children
22 | } else {
23 | return null
24 | }
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/src/modules/langs/src/apis.js:
--------------------------------------------------------------------------------
1 | import request from '@xatom/utils/src/http'
2 |
3 | export const changeLanguage = (payload = {}) => {
4 | const url = '/user/changeLanguage'
5 | const { query = {} } = payload
6 | const options = {
7 | method: 'post',
8 | requestType: 'jsonstring',
9 | responseType: 'jsonstring',
10 | body: {
11 | lang: query.lang,
12 | }
13 | }
14 | return request(url, options, 'config')
15 | }
16 |
17 | export const getLangList = () => {
18 | const url = '/content/public/getLangList'
19 | const options = {
20 | method: 'get',
21 | }
22 | return request(url, options, 'config')
23 | }
24 |
--------------------------------------------------------------------------------
/src/modules/utils/src/gio.js:
--------------------------------------------------------------------------------
1 | // 自定义埋点
2 | export const trackEvent = (event, params = {}) => {
3 | try {
4 | window.gio && window.gio('track', event, params);
5 | } catch (e) { }
6 | };
7 |
8 | // 设置登录用户ID
9 | export const setUserIdGio = (userId) => {
10 | const randomNum = Math.floor(Math.random() * 90 + 10);
11 | const newUserId = `${randomNum}${userId}`;
12 | try {
13 | window.gio && window.gio('setUserId', newUserId);
14 | } catch (e) { }
15 | };
16 |
17 | // gio清除登录用户ID
18 | export const clearUserIdGio = () => {
19 | try {
20 | window.gio && window.gio('clearUserId');
21 | } catch (e) { }
22 | };
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Navbar/child/OrdersDropdown/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-navbar-orders(
2 | @T1: '';
3 | ) {
4 | .iui-navbar-orders {
5 | display: flex;
6 | height: 100%;
7 | align-items: center;
8 | cursor: pointer;
9 | padding: 0 12px;
10 |
11 | &-label {
12 | color: @T1;
13 | font-size: 14px;
14 | font-weight: 500;
15 | }
16 |
17 | &-arrow {
18 | margin-left: 4px;
19 | color: @T1;
20 | font-size: 12px !important;
21 | transition: all 300ms;
22 | }
23 |
24 | &.ant-dropdown-open .iui-navbar-orders-arrow {
25 | transform: rotate(180deg);
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/src/Notify.js:
--------------------------------------------------------------------------------
1 | import { notification, message } from 'antd'
2 |
3 | message.config({
4 | // top: 100,
5 | duration: 3,
6 | maxCount: 2,
7 | });
8 | // const TOAST_DEFAULF_DURATION = 3 * 1
9 | export const toast = function ({ type = 'success', title = "" }) {
10 | message[type](title)
11 | }
12 |
13 | export const notify = function ({
14 | ui = 'notification',
15 | type = 'success', // success/error/warning/info
16 | title = 'this is title',
17 | des = null,
18 | icon = null,
19 | }) {
20 | notification[type] && notification[type]({
21 | message: title,
22 | description: des,
23 | })
24 | }
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/box/border-type.less:
--------------------------------------------------------------------------------
1 | .border-color-type(@type: ''; @color: '') {
2 | .bc-@{type} {
3 | border-color: @color;
4 | }
5 | .bc-@{type}-im {
6 | border-color: @color !important;
7 | }
8 | .hover-bc-@{type} {
9 | border-color: @color !important;
10 | }
11 | }
12 |
13 | .border-type(@type: ''; @color: ''; ) {
14 | .bt-@{type} {
15 | border-bottom: 1px solid @color;
16 | }
17 | .bt-@{type}-im {
18 | border-bottom: 1px solid @color !important;
19 | }
20 | .hover-bt-@{type} {
21 | border-bottom: 1px solid @color !important;
22 | }
23 | }
24 |
25 | .create-border-color-types() {}
26 | .create-border-types() {}
27 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/index.less:
--------------------------------------------------------------------------------
1 | @import './_variables.less';
2 | // baisc
3 | @import './font-color.less';
4 | @import './font-family.less';
5 | @import './font-size.less';
6 | @import './font-weight.less';
7 | @import './placeholder.less';
8 | // advanced
9 | @import './text-wrap.less';
10 | @import './text.less';
11 | @import './title.less';
12 | @import './paragraph.less';
13 | @import './typo-types.less';
14 | @import './text-decoration.less';
15 | // other
16 | @import './placeholder.less';
17 |
18 | .create-typo-types() {
19 | // .create-font-color-types();
20 | // .create-text-types();
21 | // .create-title-types();
22 | // .create-placeholder-types();
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Navbar/child/MoreDrawer/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-navbar-more(
2 | @T1: '';
3 | ) {
4 | .iui-navbar-more {
5 | color: @T1;
6 | display: flex;
7 | align-items: center;
8 | height: 100%;
9 | padding-left: 12px;
10 |
11 | &-icon {
12 | font-size: 24px !important;
13 | cursor: pointer;
14 | }
15 | }
16 |
17 | .iui-navbar-more-drawer {
18 | .iui-drawer-wrap {
19 | padding: 64px 0 48px;
20 | }
21 |
22 | &-unloged {
23 | padding: 0 24px;
24 |
25 | &-register {
26 | margin-bottom: 8px;
27 | }
28 |
29 | &-login {
30 | margin-bottom: 24px;
31 | }
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/packages/components/ui/src/index.js:
--------------------------------------------------------------------------------
1 | import Select from './Select'
2 | import Table from './Table'
3 | import Button from './Button'
4 | import Input from './Input'
5 | import SimplePagination from './SimplePagination'
6 | import Empty from './Empty'
7 | import Checkbox from './Checkbox'
8 | import Tips from './Tips'
9 | import Tooltip from './Tooltip'
10 | import Slider, { TwoStageSlider } from './Slider'
11 | import toast from './toast'
12 | import NotFound from './NotFound'
13 |
14 | export {
15 | toast,
16 | Select,
17 | Table,
18 | Button,
19 | SimplePagination,
20 | Empty,
21 | Input,
22 | Checkbox,
23 | Tips,
24 | Tooltip,
25 | TwoStageSlider,
26 | Slider,
27 | NotFound,
28 | }
29 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/flex/src/Scrollbar.js:
--------------------------------------------------------------------------------
1 | import { Scrollbars } from 'react-custom-scrollbars';
2 | export default function Scrollbar(props) {
3 | let { className, ...rest } = props
4 | const renderThumbHorizontal = ({ style, ...props }) =>
5 | const renderThumbVertical = ({ style, ...props }) =>
6 | const scrollProps = {
7 | renderThumbHorizontal,
8 | renderThumbVertical,
9 | autoHide: false,
10 | }
11 | className += ' pc-scrollbar'
12 | return {props.children}
13 | }
14 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Empty/index.js:
--------------------------------------------------------------------------------
1 | import { Button, Cols, Icon, Text, Stacks, Title, Cell} from '@xatom/uikits'
2 | import React, { useState, useEffect, useReducer, useContext } from 'react'
3 | import $t from '@xatom/intl'
4 | import { getMode } from '@xatom/utils/src/themes'
5 | import './index.less'
6 |
7 | export default function Widget (props) {
8 | const mode = getMode()
9 | let { ptH, emptyText = $t('No Record') } = props
10 | return (
11 |
12 |

13 |
{emptyText}
14 |
15 | )
16 | }
--------------------------------------------------------------------------------
/src/modules/utils/src/useragent.js:
--------------------------------------------------------------------------------
1 | export function isMobile() {
2 | return window.navigator.userAgent.toLowerCase().indexOf('mobi') > -1
3 | }
4 | export function isWechat() {
5 | // 微信的ios 和 Android 里的浏览器的名字 名字叫 MicroMessenger (微信)
6 | return window.navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
7 | }
8 | export function isAndroid() {
9 | return window.navigator.userAgent.toLowerCase().indexOf('android') !== -1
10 | }
11 | export function isIOS() {
12 | return /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)
13 | }
14 |
15 | /**
16 | * 判断是否在咱们的app内
17 | * 判断标识 ida
18 | */
19 | export function isInApp() {
20 | return /ida/i.test(navigator.userAgent)
21 | }
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/src/index.js:
--------------------------------------------------------------------------------
1 | import Button from './Button';
2 | import Icon from './Icon';
3 | import Tag from './Tag';
4 | import Tabs from './Tabs';
5 | // form
6 | import Select from './Select';
7 | import Input from './Input';
8 | import Form from './Form';
9 | import Field from './Field';
10 | import NumberInput from './NumberInput';
11 | // notification
12 | import { toast, notify } from './Notify';
13 | // loading
14 | import Spin from './Spin';
15 | // layer
16 | import Tooltip from './Tooltip';
17 |
18 | export {
19 | Button,
20 | Icon,
21 | Select,
22 | Input,
23 | NumberInput,
24 | Form,
25 | Field,
26 | toast,
27 | notify,
28 | Spin,
29 | Tag,
30 | Tabs,
31 | Tooltip,
32 | }
33 |
--------------------------------------------------------------------------------
/packages/translation/locales/index-build.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | import en_US from './en-US.json'
3 | import ko_KR from './ko-KR.json'
4 | import tr_TR from './tr-TR.json'
5 | import ja_JP from './ja-JP.json'
6 | import pt_BR from './pt-BR.json'
7 | import de_DE from './de-DE.json'
8 | import zh_TW from './zh-TW.json'
9 | import ru_RU from './ru-RU.json'
10 | import es_ES from './es-ES.json'
11 | import fr_FR from './fr-FR.json'
12 | import fa_IR from './fa-IR.json'
13 | import it_IT from './it-IT.json'
14 |
15 | var messages = {
16 | en_US,
17 | ko_KR,
18 | tr_TR,
19 | ja_JP,
20 | pt_BR,
21 | de_DE,
22 | zh_TW,
23 | ru_RU,
24 | es_ES,
25 | fr_FR,
26 | fa_IR,
27 | it_IT
28 | }
29 | export default messages
30 |
--------------------------------------------------------------------------------
/packages/components/ui/src/SimplePagination/index.less:
--------------------------------------------------------------------------------
1 | .ui-simple-pagination {
2 | margin-top: 30px;
3 |
4 | &-item {
5 | width: 28px;
6 | height: 28px;
7 | line-height: 26px;
8 | text-align: center;
9 | border-radius: 50%;
10 | border: 1px solid rgba(0, 0, 0, 0.08);
11 | color: #898989;
12 | font-size: 14px;
13 | cursor: pointer;
14 | &:not(:last-child) {
15 | margin-right: 12px;
16 | }
17 | &.disabled {
18 | color: #c1c1c1;
19 | cursor: not-allowed;
20 | }
21 | &:hover {
22 | color: #3169ff;
23 | border-color: #3169ff;
24 | }
25 | &.disabled:hover {
26 | color: #c1c1c1;
27 | border-color: rgba(0, 0, 0, 0.08);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/downloadLayer.less:
--------------------------------------------------------------------------------
1 | .download-navbar-light, .download-navbar-dark {
2 | font-size: 12px;
3 | }
4 |
5 | .download-navbar-light {
6 | .mobile-tips {
7 | color: #25282b !important;
8 | }
9 |
10 | .download-btn {
11 | &:hover {
12 | background-color: #3169ff!important;
13 | }
14 | }
15 | }
16 |
17 | .theme-blue-dark {
18 | .download-navbar-dark {
19 | .download-btn {
20 | border: none!important;
21 | .abs-cover {
22 | &:hover {
23 | background: #3169ff!important;
24 | border-radius: 6px!important;
25 | }
26 | }
27 | }
28 | .mobile-tips {
29 | color: #ffffff !important;
30 | }
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "monorepo",
3 | "version": "0.1.229-beta.2",
4 | "author": "https://github.com/nemo-crypto",
5 | "main": "src/index.js",
6 | "files": [
7 | "src",
8 | "modules",
9 | "states",
10 | "libs",
11 | "widgets",
12 | "ui"
13 | ],
14 | "publishConfig": {
15 | "registry": "https://github.com/nemo-crypto/monorepo"
16 | },
17 | "dependencies": {
18 | "qs": "6.5.1",
19 | "minimatch": "3.0.4",
20 | "moment": "2.30.1",
21 | "decimal.js": "10.1.1",
22 | "react-responsive": "8.2.0",
23 | "js-md5": "0.8.3",
24 | "crypto-js": "4.0.0",
25 | "moment-timezone": "0.5.43",
26 | "uuid": "8.3.2",
27 | "mockjs": "1.1.0",
28 | "async-validator": "4.1.1"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/packages/components/ui/src/NotFound/index.js:
--------------------------------------------------------------------------------
1 | import $t from '@xatom/intl'
2 | import './index.less'
3 |
4 | export default function (props) {
5 | const {
6 | className = '',
7 | text = $t('Oops, page not found!'),
8 | desc = $t("We are very sorry for the inconvenience. It looks like you`re trying to access a page that has been deleted or never even existed."),
9 | btnText = $t('Back to homepage'),
10 | } = props
11 | return
12 |
})
13 |
{text}
14 |
{desc}
15 |
{btnText}
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/box/background.less:
--------------------------------------------------------------------------------
1 | .bg-type(@type: 'primary'; @color: ''; ) {
2 | .bg-@{type} {
3 | background: @color !important;
4 | }
5 |
6 | &.bg-@{type} {
7 | background: @color !important;
8 | }
9 |
10 |
11 | .active-bg-@{type}.active,
12 | .hover-bg-@{type}:hover {
13 | background: @color !important;
14 | }
15 | }
16 |
17 | .bg-type(@type: ~"darken-1"; @color: rgba(0, 0, 0, 0.15); );
18 | .bg-type(@type: ~"darken-2"; @color: rgba(0, 0, 0, 0.35); );
19 | .bg-type(@type: ~"lighten-1"; @color: rgba(255, 255, 255, 0.05); );
20 | .bg-type(@type: ~"lighten-2"; @color: rgba(255, 255, 255, 0.15); );
21 | .bg-type(@type: ~"page-light"; @color: rgba(49, 105, 255, 0.11); );
22 | .bg-type(@type: ~"page-dark"; @color: #1c2330; );
23 |
--------------------------------------------------------------------------------
/packages/components/ui/src/Input/index.less:
--------------------------------------------------------------------------------
1 | .ui-input,
2 | .ui-input .ant-input {
3 | border-color: rgba(0, 0, 0, 0.08) !important;
4 | border-radius: 6px !important;
5 | color: #000 !important;
6 |
7 | &.error {
8 | border-color: #FC3C56 !important;
9 | }
10 |
11 | &.ant-input-sm {
12 | height: 40px;
13 | }
14 |
15 | &.ant-input-lg {
16 | height: 48px;
17 | }
18 | }
19 |
20 |
21 | .ui-input,
22 | .ui-input .ant-input {
23 | &::placeholder {
24 | color: #C1C1C1 !important;
25 | font-size: 14px !important;
26 | }
27 |
28 | &.ant-input-sm {
29 | &::placeholder {
30 | font-size: 12px !important;
31 | }
32 | }
33 |
34 | &.ant-input-lg {
35 | &::placeholder {
36 | font-size: 16px !important;
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/list/src/AntPagination.js:
--------------------------------------------------------------------------------
1 | import { Pagination } from 'antd'
2 | import { listActions } from '@xatom/lists'
3 | import { Cols } from '@xatom/flex'
4 |
5 | export default function AntPagination(props) {
6 | const { page = {}, id, type, ...rest } = props
7 | let { total, size, current } = page
8 | const handleChange = (page, pageSize) => {
9 | listActions.pageChange({
10 | id, page: {
11 | current: page,
12 | size: pageSize
13 | }
14 | })
15 | }
16 | if (type === 'nototal') {
17 | total = null
18 | }
19 | return (
20 |
21 |
22 |
23 | )
24 | }
25 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/table/src/AntPagination.js:
--------------------------------------------------------------------------------
1 | import { Pagination } from 'antd'
2 | import { listActions } from '@xatom/lists'
3 | import { Cols } from '@xatom/flex'
4 |
5 | export default function AntPagination(props) {
6 | const { page = {}, id, type, ...rest } = props
7 | let { total, size, current } = page
8 | const handleChange = (page, pageSize) => {
9 | listActions.pageChange({
10 | id, page: {
11 | current: page,
12 | size: pageSize
13 | }
14 | })
15 | }
16 | if (type === 'nototal') {
17 | total = null
18 | }
19 | return (
20 |
21 |
22 |
23 | )
24 | }
25 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Navbar/child/CommonItem/index.js:
--------------------------------------------------------------------------------
1 | export function Item(props) {
2 | const { title = '', link = {}, iconfont = '', afterNode = null, downNode = null, ...rest } = props
3 | return
4 |
5 |
6 |
7 |
{title}
8 | {afterNode}
9 |
10 | {downNode}
11 |
12 |
13 | }
14 |
15 | export function ItemGroup(props) {
16 | return
17 | {props.children}
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/packages/components/iui/src/SimplePagination/index.less:
--------------------------------------------------------------------------------
1 |
2 | .create-iui-simple-pagination(
3 | @T1: '';
4 | @T2: '';
5 | @B1: '';
6 | @F1: '';
7 | @Bg1: '';
8 | ) {
9 | .iui-simple-pagination {
10 | margin: 0 16px 24px;
11 | .pagination-item {
12 | min-width: 22px;
13 | height: 22px;
14 | line-height: 20px;
15 | text-align: center;
16 | color: @T1;
17 | border-radius: 4px;
18 | margin-left: 10px;
19 | cursor: pointer;
20 |
21 | &:hover {
22 | border-color: @F1;
23 | }
24 |
25 | &.disabled {
26 | color: @T2;
27 | cursor: not-allowed;
28 |
29 | &:hover {
30 | border-color: @Bg1;
31 | }
32 | }
33 |
34 | &.active {
35 | background: @B1;
36 | .typo {
37 | line-height: 1.8;
38 | }
39 | }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Footer/index.less:
--------------------------------------------------------------------------------
1 | @import './child/LayoutH5/index.less';
2 | @import './child/LayoutWeb/index.less';
3 | @import './child/LayoutPad/index.less';
4 |
5 | .create-iui-footer(
6 | @Bg1: '';
7 | @Bg2: '';
8 | @T2: '';
9 | @T1: '';
10 | @C3: '';
11 | @F1: '';
12 | @L2: '';
13 | ) {
14 | .create-iui-footer-h5(
15 | @Bg1: @Bg1;
16 | @Bg2: @Bg2;
17 | @T2: @T2;
18 | @T1: @T1;
19 | @C3: @C3;
20 | @F1: @F1;
21 | @L2: @L2;
22 | );
23 | .create-iui-footer-web(
24 | @Bg1: @Bg1;
25 | @Bg2: @Bg2;
26 | @T2: @T2;
27 | @T1: @T1;
28 | @C3: @C3;
29 | @F1: @F1;
30 | @L2: @L2;
31 | );
32 | .create-iui-footer-pad(
33 | @Bg1: @Bg1;
34 | @Bg2: @Bg2;
35 | @T2: @T2;
36 | @T1: @T1;
37 | @C3: @C3;
38 | @F1: @F1;
39 | @L2: @L2;
40 | );
41 | }
--------------------------------------------------------------------------------
/packages/components/ui/src/Button/index.less:
--------------------------------------------------------------------------------
1 | .ui-button {
2 | text-shadow: none;
3 | box-shadow: none;
4 |
5 | &.ant-btn-lg {
6 | padding: 0 30px;
7 | font-size: 14px;
8 | }
9 |
10 | &.ant-btn-sm {
11 | height: 40px;
12 | padding: 0 20px;
13 | }
14 |
15 | &.ant-btn-primary {
16 | &:hover {
17 | background-color: #2958d6;
18 | border-color: #2958d6;
19 | }
20 |
21 | &[disabled] {
22 | color: #fff;
23 | background-color: rgba(49, 105, 255, 0.3);
24 | border-color: rgba(49, 105, 255, 0.3);
25 | }
26 | }
27 |
28 | &.ant-btn-minor {
29 | background: #f6f6f6;
30 | color: #000;
31 | border: none;
32 |
33 | &:hover {
34 | background: #eaecef;
35 | }
36 | }
37 |
38 | &.ant-btn-link {
39 | height: auto;
40 | padding: 0;
41 | }
42 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/paragraph.less:
--------------------------------------------------------------------------------
1 | .paragraph-type(@type: ''; @size: 14px; @color: ''; @bold: normal; @lh: 1.5) {
2 | .typo-paragraph-@{type} {
3 | line-height: @lh;
4 | font-size: @size ;
5 | color: @color;
6 | font-weight: @bold;
7 | }
8 |
9 | &:not(body) {
10 | .typo-paragraph-@{type} {
11 | color: @color !important;
12 | }
13 | }
14 | }
15 |
16 | .create-paragraph-types() {
17 | .paragraph-type(@type: ~"1"; @size: @fs-text1; @color: @fc-grey; @lh: @lh-paragraph1);
18 | .paragraph-type(@type: ~"1-light"; @size: @fs-text1; @color: @fc-grey-light; @lh: @lh-paragraph1);
19 | .paragraph-type(@type: ~"1-lighter"; @size: @fs-text1; @color: @fc-grey-lighter; @lh: @lh-paragraph1);
20 | .paragraph-type(@type: ~"2"; @size: @fs-text2; @color: @fc-grey; @lh: @lh-paragraph2);
21 | }
22 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Tooltip/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-tooltip(
2 | @Bg3: '';
3 | @T1: '';
4 | @T2: '';
5 | ) {
6 | .iui-tooltip-overlay {
7 | .ant-tooltip-inner {
8 | background: @Bg3 !important;
9 | color: @T1 !important;
10 | border-radius: 4px;
11 | padding: 12px !important;
12 | box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);
13 | }
14 |
15 | .ant-tooltip-arrow {
16 | border-right-color: @Bg3 !important;
17 | border-bottom-color: @Bg3 !important;
18 |
19 | &::before {
20 | background: @Bg3 !important;
21 | width: 9px;
22 | height: 9px;
23 | }
24 | }
25 |
26 | &-underline {
27 | display: inline-block;
28 | vertical-align: top;
29 | padding-bottom: 1px;
30 | border-bottom: 1px dashed @T2;
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/list/src/MobileList.js:
--------------------------------------------------------------------------------
1 | import { List } from 'antd'
2 | import SimplePagination from './SimplePagination';
3 | import { ConfigProvider } from 'antd';
4 | import Empty from './Empty';
5 | import $t from '@xatom/intl'
6 | export default function MobileList(props) {
7 | const { list, renderItem = () => null, className = '' } = props
8 | let { items = [], page = {}, loading, id } = list
9 | const listProps = {
10 | className: `${className}`,
11 | dataSource: items,
12 | loading,
13 | loadMore: null,
14 | pagination: false,
15 | renderItem,
16 | }
17 | return (
18 | }>
19 |
20 |
21 |
22 | )
23 | }
24 |
--------------------------------------------------------------------------------
/packages/components/iui/src/index.less:
--------------------------------------------------------------------------------
1 | @import './common/iconfont/iconfont.css';
2 | @import './Button/index.less';
3 | @import './Drawer/index.less';
4 | @import './Dropdown/index.less';
5 | @import './Footer/index.less';
6 | @import './Input/index.less';
7 | @import './Navbar/index.less';
8 | @import './Select/index.less';
9 | @import './Slider/index.less';
10 | @import './Switch/index.less';
11 | @import './Tooltip/index.less';
12 | @import './Table/index.less';
13 | @import './SimplePagination/index.less';
14 | @import './Empty/index.less';
15 | @import './Table/ListView.less';
16 | @import './Modal/index.less';
17 | @import './Scrollbar/index.less';
18 | @import './Checkbox/index.less';
19 | @import './Radio/index.less';
20 | @import './EditNickNameLayer/index.less';
21 | @import './Colour/index.less';
22 |
23 | // 放在最后
24 | @import './common/theme/index.less';
25 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/theme/brand.less:
--------------------------------------------------------------------------------
1 | // ========================================
2 | // Brand Varibales
3 | // ========================================
4 |
5 | // brand
6 | @brand-primary: #3169ff;
7 | @brand-secondary: blue; // TODO
8 | @brand-up: #3cbc98;
9 | @brand-down: #e3595d;
10 | @brand-success: #4db16e;
11 | @brand-error: #ff5656;
12 | @brand-warn: #f99c03;
13 | @brand-info: blue; // TODO
14 |
15 | // brand-light
16 | @brand-primary-light: fade(@brand-primary, 10%);
17 | @brand-secondary-light: fade(@brand-secondary, 10%);
18 | @brand-up-light: fade(@brand-up, 10%);
19 | @brand-down-light: fade(@brand-down, 10%);
20 | @brand-success-light: fade(@brand-success, 10%);
21 | @brand-error-light: fade(@brand-error, 10%);
22 | @brand-warn-light: fade(@brand-warn, 10%);
23 | @brand-info-light: fade(@brand-info, 10%);
24 |
25 | // border-radius
26 | @br-main: 4px;
27 |
28 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Navbar/child/CommonItem/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-navbar-common-item-row(
2 | @T1: '';
3 | @L1: '';
4 | @C2: '';
5 | ) {
6 | .iui-navbar-common-item-row {
7 | display: flex;
8 | align-items: center;
9 | padding: 14px 16px;
10 |
11 | &-icon {
12 | font-size: 24px !important;
13 | color: @T1;
14 | }
15 |
16 | &-info {
17 | flex: 1;
18 | margin-left: 16px;
19 | line-height: 16px;
20 |
21 | &-title {
22 | display: flex;
23 |
24 | &-label {
25 | font-weight: 500;
26 | color: @T1;
27 | font-size: 14px;
28 | }
29 | }
30 | }
31 |
32 | &:hover {
33 | background: @C2;
34 | cursor: pointer;
35 | }
36 | }
37 |
38 | .iui-navbar-common-item {
39 | &:not(:last-child) {
40 | border-bottom: 1px solid @L1;
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/brand/footer.less:
--------------------------------------------------------------------------------
1 | // .container-footer{
2 | // width: 1280px;
3 | // .fc-primary-footer{
4 | // .tag-hover-icon{
5 | // display: none;
6 | // }
7 | // &.typo-text-1-light{
8 | // color: rgba(255, 255, 255, 0.8) !important;
9 | // }
10 | // &:hover{
11 | // color: #67c6f2 !important;
12 | // .tag-hover-icon{
13 | // display: inline-block;
14 | // }
15 | // }
16 | // }
17 | // .hoverable {
18 | // .hover-visible {
19 | // display: none;
20 | // }
21 |
22 | // .hover-hidden {
23 | // display: inline;
24 | // }
25 |
26 | // &:hover {
27 | // .hover-visible {
28 | // display: inline;
29 | // }
30 |
31 | // .hover-hidden {
32 | // display: none;
33 | // }
34 | // }
35 | // }
36 | // }
37 |
38 | .container-footer {
39 | width: 100%;
40 | }
41 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Navbar/child/CommonDropdown/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-navbar-common-dropdown(
2 | @T1: '';
3 | @F4: '';
4 | ) {
5 | .iui-navbar-common-dropdown {
6 | display: flex;
7 | height: 100%;
8 | align-items: center;
9 | cursor: pointer;
10 | padding: 0 12px;
11 |
12 | &-label {
13 | color: @T1;
14 | font-size: 14px;
15 | font-weight: 500;
16 | }
17 |
18 | &-arrow {
19 | margin-left: 4px;
20 | color: @T1;
21 | font-size: 12px !important;
22 | transition: all 300ms;
23 | }
24 |
25 | &-hot {
26 | margin-left: 4px;
27 | color: @F4;
28 | }
29 |
30 | &.ant-dropdown-open .iui-navbar-common-dropdown-arrow {
31 | transform: rotate(180deg);
32 | }
33 | }
34 |
35 | .iui-navbar-common-dropdown-overlay {
36 | &-menu-hot {
37 | margin-left: 4px;
38 | color: @F4;
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/src/modules/utils/src/offline.js:
--------------------------------------------------------------------------------
1 | /**
2 | * H5离线环境相关
3 | */
4 |
5 | // 是否H5离线包环境
6 | export const isOffline = window.location.origin.includes('file://')
7 |
8 | // 是否离线包测试环境
9 | export const isOfflineTest = navigator.userAgent.toLowerCase().indexOf('online/0') !== -1
10 |
11 | // 是否离线包线上环境
12 | export const isOfflineProd = navigator.userAgent.toLowerCase().indexOf('online/1') !== -1
13 |
14 | // 是否离线包预发布环境
15 | export const isOfflineStaging = navigator.userAgent.toLowerCase().indexOf('online/2') !== -1
16 |
17 | // 离线包环境host
18 | export function getOfflineHost() {
19 | // file路径:file:///xxx/m.test.net/cur/xxx
20 | const r = /[^/]+(?=\/cur)/.exec(window.location.href) // 在file路径中找出域名Host
21 | return r[0]
22 | }
23 |
24 | // 离线包环境host域名后缀
25 | export function getOfflineHostSuffix() {
26 | const r = /[^/]+(?=\/cur)/.exec(window.location.href)
27 | const host = r[0].split('.').slice(-2).join('.')
28 | return host
29 | }
30 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/text-wrap.less:
--------------------------------------------------------------------------------
1 | .text-nowrap {
2 | max-width: 100%;
3 | overflow: hidden;
4 | white-space: nowrap;
5 | }
6 |
7 | .text-truncate {
8 | overflow: hidden !important;
9 | text-overflow: ellipsis !important;
10 | white-space: nowrap !important;
11 | }
12 |
13 | .text-nowrap-flex {
14 | display: -webkit-box;
15 | overflow: hidden;
16 | text-overflow: ellipsis;
17 | -webkit-box-orient: vertical;
18 | -webkit-line-clamp: 1;
19 | -webkit-box-flex: 1;
20 | height: inherit
21 | }
22 |
23 | .text-nowrap-multi {
24 | display: -webkit-box;
25 | overflow: hidden;
26 | text-overflow: ellipsis;
27 | -webkit-box-orient: vertical;
28 | -webkit-line-clamp: 2
29 | }
30 |
31 | .typo-nowrap {
32 | &:extend(.text-nowrap);
33 | }
34 |
35 | .typo-nowrap-visible {
36 | &:extend(.text-nowrap);
37 | overflow: visible;
38 | }
39 |
40 | .typo-ellipsis {
41 | &:extend(.text-truncate);
42 | }
43 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/flex/src/Position.js:
--------------------------------------------------------------------------------
1 | export const Absolute = props => {
2 | let { children, className = '', style = {}, ...rest } = props
3 | className = `${className}`
4 | style = { height: '100%', ...style }
5 | const newProps = { className, style, ...rest }
6 | return {children}
7 | }
8 |
9 | export const Relative = props => {
10 | let { children, className = '', style = {}, ...rest } = props
11 | className = `${className}`
12 | style = { height: '100%', ...style }
13 | const newProps = { className, style, ...rest }
14 | return {children}
15 | }
16 |
17 | export const Fixed = props => {
18 | let { children, className = '', style = {}, ...rest } = props
19 | className = `${className}`
20 | style = { height: '100%', ...style }
21 | const newProps = { className, style, ...rest }
22 | return {children}
23 | }
24 |
25 |
26 |
--------------------------------------------------------------------------------
/packages/components/iui/src/EditNickNameLayer/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-nickName(
2 | @T1: '';
3 | @T2: '';
4 | @L1: '';
5 | ) {
6 | .nick-name-title {
7 | color: @T1;
8 | }
9 | .editNickNameLayer {
10 | .nick-name-label {
11 | color: @T1;
12 | }
13 | .nick-name-input {
14 | .ant-input {
15 | height: 40px;
16 | line-height: 40px;
17 | padding: 0 12px;
18 | }
19 | .ant-input-suffix {
20 | right: 12px;
21 | }
22 | }
23 | .nick-name-icon-clear {
24 | color: @T2;
25 | }
26 | .nick-name-length {
27 | color: @T1;
28 | }
29 | .nick-name-split-line {
30 | height: 16px;
31 | border-left: 1px solid @L1;
32 | margin: 0 12px;
33 | }
34 | .nick-name-tip {
35 | color: @T2;
36 | }
37 | }
38 | }
39 |
40 | html[dir="rtl"] {
41 | .editNickNameLayer .nick-name-input .ant-input-suffix {
42 | right: 77% !important;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/packages/components/ui/src/Select/index.js:
--------------------------------------------------------------------------------
1 | import { Select } from 'antd'
2 | import $t from '@xatom/intl'
3 | import './index.less'
4 |
5 | export default function (props) {
6 | const { options = [], labelRender, className = '', ...rest } = props
7 |
8 | return (
9 | }
12 | notFoundContent={
13 |
14 |
15 |
{$t('No Record')}
16 |
17 | }
18 | dropdownClassName="ui-select-dropdown" {...rest}>
19 | {options.map((item, index) =>
20 |
21 | {labelRender ? labelRender(item) : item.label}
22 |
23 | )}
24 |
25 | )
26 | }
27 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/checkbox.less:
--------------------------------------------------------------------------------
1 | .create-antd-checkbox(@brand-primary: ''; ) {
2 | .ant-checkbox-wrapper {
3 | color: @fc-grey;
4 | }
5 |
6 | .ant-checkbox-wrapper:hover .ant-checkbox-inner,
7 | .ant-checkbox:hover .ant-checkbox-inner,
8 | .ant-checkbox-input:focus+.ant-checkbox-inner {
9 | border-color: @brand-primary;
10 | }
11 |
12 | .ant-checkbox {
13 | .ant-checkbox-inner {
14 | background: @bg-input;
15 | border: 1px solid @bc-input;
16 |
17 | &:hover {
18 | border-color: @brand-primary;
19 | }
20 | }
21 |
22 | &.ant-checkbox-checked {
23 | .ant-checkbox-inner {
24 | background: @brand-primary;
25 | border-color: @brand-primary;
26 | }
27 | }
28 | }
29 | }
30 |
31 | .ant-checkbox-wrapper+span,
32 | .ant-checkbox+span {
33 | padding-right: 0px;
34 | }
--------------------------------------------------------------------------------
/packages/abtest/index.js:
--------------------------------------------------------------------------------
1 | import { sessionStore } from '@xatom/utils/src/storage'
2 | import request from '@xatom/utils/src/http'
3 | import { getHost } from '@xatom/utils/src/env'
4 | import { isLoged } from '@xatom/auth/utils'
5 |
6 | /**
7 | * 初始化abtest
8 | * 获取abtest策略
9 | * 存储到storage中
10 | */
11 | export async function initAbtest() {
12 | const path = isLoged() ? '/content/user/abtest/check-strategy' : '/content/public/abtest/check-strategy'
13 | const res = await request(getHost('config') + path, { method: 'get' })
14 | if (res && res.code === 200) {
15 | const { data = {} } = res || {}
16 | sessionStore.setItem('G_ABTEST_STRATEGY', data)
17 | }
18 | }
19 |
20 | /**
21 | * 获取abtest策略
22 | * @param {string} key 策略key
23 | * @param {boolean} defaultValue 默认值
24 | * @returns {boolean} 策略值
25 | */
26 | export function getAbtest(key, defaultValue = false) {
27 | const data = sessionStore.getItem('G_ABTEST_STRATEGY') || {}
28 | return data[key] || defaultValue
29 | }
30 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/input.less:
--------------------------------------------------------------------------------
1 | // https: //github.com/ant-design/ant-design/blob/master/components/style/themes/default.less
2 | // theme-config
3 | // @input-height-base: 44px;
4 |
5 |
6 | .create-antd-input(@bg: ''; @bc: ''; @brand-primary: ''; @br: ''; ) {
7 | .ant-input {
8 | border: 1px solid @bc ;
9 | border-radius: @br ;
10 | color: @fc-grey ;
11 | background: @bg;
12 |
13 | &:focus,
14 | &:hover {
15 | border-color: @brand-primary !important;
16 | box-shadow: none;
17 | outline: none;
18 | }
19 | }
20 |
21 | .ant-input-group-addon {
22 | background: @bg !important;
23 | border-color: @bc !important;
24 | }
25 |
26 | .input-reset {
27 | .ant-input {
28 | border-color: transparent !important;
29 | background: transparent !important;
30 | }
31 | }
32 |
33 | .ant-input-group-addon {
34 | border-radius: @br;
35 | border-color: @bc !important;
36 | padding: 7.5px;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/box/spacing.less:
--------------------------------------------------------------------------------
1 | .sv-type(@type: 1) {
2 | .sv-@{type} {
3 | &>* {
4 | margin-bottom: 5px * @type !important;
5 | }
6 |
7 | &>:last-child,
8 | .s-no {
9 | margin-bottom: 0px !important;
10 | }
11 | }
12 | }
13 |
14 | .sh-type(@type: 1) {
15 | .sh-@{type} {
16 | &>* {
17 | margin-right: 5px * @type !important;
18 | }
19 |
20 | &>:last-child,
21 | .s-no {
22 | margin-right: 0px !important;
23 | }
24 | }
25 | }
26 |
27 | .sv-type(@type: 1);
28 | .sv-type(@type: 2);
29 | .sv-type(@type: 3);
30 | .sv-type(@type: 4);
31 | .sv-type(@type: 5);
32 | .sv-type(@type: 6);
33 | .sv-type(@type: 7);
34 | .sv-type(@type: 8);
35 | .sv-type(@type: 9);
36 | .sv-type(@type: 10);
37 |
38 | .sh-type(@type: 1);
39 | .sh-type(@type: 2);
40 | .sh-type(@type: 3);
41 | .sh-type(@type: 4);
42 | .sh-type(@type: 5);
43 | .sh-type(@type: 6);
44 | .sh-type(@type: 7);
45 | .sh-type(@type: 8);
46 | .sh-type(@type: 9);
47 | .sh-type(@type: 10);
48 |
--------------------------------------------------------------------------------
/src/modules/utils/src/storage.js:
--------------------------------------------------------------------------------
1 | // 本地存储
2 | export const localStore = {
3 | setItem: function (id, data) {
4 | try {
5 | localStorage.setItem(id, JSON.stringify(data))
6 | } catch (err) {}
7 | },
8 | getItem: function (id) {
9 | try {
10 | return JSON.parse(localStorage.getItem(id))
11 | } catch (error) {
12 | return null
13 | }
14 | },
15 | removeItem: id => {
16 | try {
17 | localStorage.removeItem(id)
18 | } catch (err) {}
19 | }
20 | }
21 |
22 | // 会话存储
23 | export const sessionStore = {
24 | setItem: function (id, data) {
25 | try {
26 | sessionStorage.setItem(id, JSON.stringify(data))
27 | } catch (err) { }
28 | },
29 | getItem: function (id) {
30 | try {
31 | return JSON.parse(sessionStorage.getItem(id))
32 | } catch (error) {
33 | return null
34 | }
35 | },
36 | removeItem: id => {
37 | try {
38 | sessionStorage.removeItem(id)
39 | } catch (err) { }
40 | }
41 | }
42 |
43 | export default localStore
44 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/mobile/src/Navbar.js:
--------------------------------------------------------------------------------
1 | import { Title, Cols } from '@xatom/uikits'
2 | // 专注于layout
3 | export default function NavBar(props) {
4 | let { left, right, center, title, className = '' } = props
5 | className = `${className} bt-grey-light bg-card-header`
6 | return (
7 |
8 |
9 | {/* { }} className="fc-grey hover-fc-primary fs20" type="arrow-left" style={{ width: '50px' }} /> */}
10 | {left}
11 |
12 |
13 | {center}
14 | {!center && title &&
{title}}
15 |
16 |
17 | {/* { }} className="fc-grey hover-fc-primary fs20" type="filter" style={{ width: '50px' }}> */}
18 | {right}
19 |
20 |
21 | )
22 | }
23 |
--------------------------------------------------------------------------------
/packages/components/ui/src/Tips/index.less:
--------------------------------------------------------------------------------
1 | .ui-tips {
2 | display: flex;
3 | padding: 10px;
4 | line-height: 20px;
5 | font-size: 14px;
6 |
7 | &-icon {
8 | width: 20px;
9 | height: 20px;
10 | min-width: 20px;
11 | }
12 |
13 | &-text {
14 | margin-left: 6px;
15 | }
16 |
17 | &--shape-round {
18 | border-radius: 6px;
19 | }
20 |
21 | &--type-remind {
22 | background: rgba(255, 153, 0, 0.06);
23 | }
24 |
25 | &--type-remind &-icon {
26 | background: url(./images/icon-remind.png) 0 0 no-repeat;
27 | background-size: cover;
28 | }
29 |
30 | &--type-remind &-text {
31 | color: rgba(255, 153, 0, 1);
32 | }
33 |
34 | &--type-warning {
35 | background: rgba(252, 60, 86, 0.06);
36 | }
37 |
38 | &--type-warning &-icon {
39 | background: url(./images/icon-warning.png) 0 0 no-repeat;
40 | background-size: cover;
41 | }
42 |
43 | &--type-warning &-text {
44 | color: rgba(252, 60, 86, 1)
45 | }
46 |
47 | &--align-center {
48 | justify-content: center;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/packages/components/iui/src/index.js:
--------------------------------------------------------------------------------
1 | import Button from './Button'
2 | import Input from './Input'
3 | import Select from './Select'
4 | import Switch from './Switch'
5 | import Tooltip from './Tooltip'
6 | import Slider, { TwoStageSlider } from './Slider'
7 | import MobileTable from './MobileTable'
8 | import TableList from './Table'
9 | import SimplePagination from './SimplePagination'
10 | import Empty from './Empty'
11 | import ListView from './Table/ListView'
12 | import Footer from './Footer'
13 | import Navbar from './Navbar'
14 | import Dropdown from './Dropdown'
15 | import Drawer from './Drawer'
16 | import Modal from './Modal'
17 | import Checkbox from './Checkbox'
18 | import Radio from './Radio'
19 | import './index.less'
20 |
21 | export {
22 | Button,
23 | Input,
24 | Select,
25 | Switch,
26 | Tooltip,
27 | Slider,
28 | TwoStageSlider,
29 | MobileTable,
30 | TableList,
31 | SimplePagination,
32 | Empty,
33 | ListView,
34 | Footer,
35 | Navbar,
36 | Dropdown,
37 | Drawer,
38 | Modal,
39 | Checkbox,
40 | Radio,
41 | }
42 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Navbar/child/OrdersDropdown/index.js:
--------------------------------------------------------------------------------
1 | import { Dropdown } from '@xatom/iui';
2 | import { Item } from '../CommonItem';
3 |
4 | export default function (props) {
5 | const { title, children = [] } = props
6 | return } placement="bottomRight">
7 |
11 |
12 | }
13 |
14 | const DropdownOverlay = (props) => {
15 | const { children = [] } = props
16 | return
17 | {
18 | children.map((group, groupIndex) => {
19 | return
20 | {
21 | group.map((item, index) => {
22 | return
23 | })
24 | }
25 |
26 | })
27 | }
28 |
29 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/font-color.less:
--------------------------------------------------------------------------------
1 | .fc-type(@type: ''; @color: ''; @hover:inherit) {
2 | .fc-@{type} {
3 | color: @color;
4 | &.cursor-pointer:hover{
5 | color:@hover;
6 | }
7 | }
8 |
9 | .hover-fc-@{type}:hover {
10 | color: @color !important;
11 | }
12 |
13 | .active-fc-@{type}.active {
14 | color: @color !important;
15 | }
16 |
17 | // &:not(body) {
18 | // .fc-@{type} {
19 | // color: @color ;
20 | // }
21 |
22 | // .hover-fc-@{type}:hover {
23 | // color: @color ;
24 | // }
25 |
26 | // .active-fc-@{type}.active {
27 | // color: @color ;
28 | // }
29 | // }
30 | }
31 |
32 | .fc-inherit {
33 | color: inherit !important;
34 | }
35 |
36 | .fc-white {
37 | color: #fff !important;
38 | }
39 |
40 | .hover-fc-white:hover {
41 | color: #fff !important;
42 | }
43 | .hover-fc-black:hover {
44 | color: #000 !important;
45 | }
46 |
47 | .fc-black {
48 | color: #000 !important;
49 | }
50 |
51 | .fc-navbar-grey {
52 | color: #25282b !important;
53 | }
54 |
--------------------------------------------------------------------------------
/packages/abtest/README.md:
--------------------------------------------------------------------------------
1 | # @abtest 模块使用说明
2 |
3 | ## 简介
4 |
5 | `@abtest` 模块用于前端项目中的 A/B 测试策略获取与管理,支持从后端拉取策略并本地存储,便于在业务代码中灵活读取和应用不同实验分组。
6 |
7 | ---
8 |
9 | ## 主要功能
10 |
11 | - 拉取并存储当前用户/全局的 A/B 测试策略
12 | - 通过 key 获取指定的 A/B 测试策略值
13 | - 支持登录/未登录用户的策略区分
14 |
15 | ---
16 |
17 | ## API 说明
18 |
19 | ### `initAbtest()`
20 | - 异步方法,拉取最新的 A/B 测试策略并存储到本地(storage)。
21 | - 登录用户请求 `/content/user/abtest/check-strategy`,未登录用户请求 `/content/public/abtest/check-strategy`。
22 |
23 | ### `getAbtest(key, defaultValue)`
24 | - 获取本地存储的指定 key 的 A/B 测试策略值。
25 | - `key`:策略名称。
26 | - `defaultValue`:可选,未命中时的默认值,默认为 `false`。
27 | - 返回:策略值(通常为布尔值)。
28 |
29 | ---
30 |
31 | ## 使用示例
32 |
33 | ### 1. 初始化并拉取策略
34 | ```js
35 | import { initAbtest } from '@xatom/abtest'
36 | initAbtest()
37 | ```
38 |
39 | ### 2. 获取某个实验策略
40 | ```js
41 | import { getAbtest } from '@xatom/abtest'
42 | const isNewFeatureEnabled = getAbtest('new_feature')
43 | if (isNewFeatureEnabled) {
44 | // 展示新功能
45 | }
46 | ```
47 |
48 | ---
49 |
50 | ## 依赖
51 | - @xatom/utils
52 | - @xatom/auth
53 |
54 | ---
55 |
56 | 如需更多帮助,请查阅源码或联系维护者。
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/index.less:
--------------------------------------------------------------------------------
1 | @import './button.less';
2 | @import './menus.less';
3 | @import './input.less';
4 | @import './icon.less';
5 | @import './modal.less';
6 | @import './navbarmenus.less';
7 | @import './notify.less';
8 | @import './table.less';
9 | @import './form.less';
10 | @import './spin.less';
11 | @import './select.less';
12 | @import './layer-tooltip.less';
13 | @import './layer-popover.less';
14 | @import './layer-select-dropdown.less';
15 | @import './slider.less';
16 | @import './pagination.less';
17 | @import './tag.less';
18 | @import './tabs.less';
19 | @import './card.less';
20 | @import './drawer.less';
21 | @import './checkbox.less';
22 |
23 | .create-antd() {
24 | // .create-antd-input();
25 | // .create-antd-slider();
26 | // .create-antd-button();
27 | // .create-antd-navbar();
28 | // .create-antd-icon();
29 | // .create-antd-table();
30 | // .create-antd-form();
31 | // .create-antd-select();
32 | // .create-antd-spin();
33 | // .create-antd-layer();
34 | // .create-antd-pagination();
35 | // .create-antd-modal();
36 | }
--------------------------------------------------------------------------------
/src/modules/utils/src/script.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * loadScript
4 | * @param options.src // required
5 | * @param options.onload
6 | * @param options.onerror
7 | */
8 |
9 | export function loadScript(options = {}) {
10 | if (options.src && window.scriptsLoaded && window.scriptsLoaded[options.src]) {
11 | options.onload && options.onload()
12 | } else {
13 | let script = document.createElement('script')
14 | script.type = 'text/javascript'
15 | script.async = true
16 | script.charset = "utf-8"
17 | script.src = options.src
18 | script.onerror = options.onerror || function (err) { console.error('load script error', err) }
19 | script.onload = function () {
20 | window.scriptsLoaded = {
21 | [options.src]: true
22 | }
23 | options.onload && options.onload()
24 | }
25 | document.body.appendChild(script) // body 最后
26 | // document.head.appendChild(script) // head 最后
27 | // var firstScript = document.getElementsByTagName('script')[0] // 第一个 script 之前
28 | // firstScript.parentNode.insertBefore(script, firstScript)
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/box/line-height.less:
--------------------------------------------------------------------------------
1 | .lh-p100 {
2 | line-height: 100% !important;
3 | }
4 |
5 | .lh-10 {
6 | line-height: 1.0rem * @times !important
7 | }
8 |
9 | .lh-14 {
10 | line-height: 1.4rem * @times !important
11 | }
12 |
13 | .lh-15 {
14 | line-height: 1.5rem * @times !important
15 | }
16 |
17 | .lh-16 {
18 | line-height: 1.6rem * @times !important
19 | }
20 |
21 | .lh-18 {
22 | line-height: 1.8rem * @times !important
23 | }
24 |
25 | .lh-20 {
26 | line-height: 2.0rem * @times !important
27 | }
28 |
29 | .lh-25 {
30 | line-height: 2.5rem * @times !important
31 | }
32 |
33 | .lh-24 {
34 | line-height: 2.4rem * @times !important
35 | }
36 |
37 | .lh-28 {
38 | line-height: 2.8rem * @times !important
39 | }
40 |
41 | .lh-30 {
42 | line-height: 3.0rem * @times !important
43 | }
44 |
45 | .lh-35 {
46 | line-height: 3.5rem * @times !important
47 | }
48 |
49 | .lh-40 {
50 | line-height: 4.0rem * @times !important
51 | }
52 |
53 | .lh-45 {
54 | line-height: 4.5rem * @times !important
55 | }
56 |
57 | .lh-1 {
58 | line-height: 1 !important
59 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/list/src/TimeRange.js:
--------------------------------------------------------------------------------
1 | import $t from '@xatom/intl'
2 | import { DatePicker } from 'antd'
3 | import { getTs, parseTs } from '@xatom/utils/src/time'
4 | import moment from 'moment'
5 | const { RangePicker } = DatePicker
6 | export default function TimeRange(props) {
7 | const { value = [], onChange, ...rest } = props
8 | const dateValue = value[0] && value[1] && [
9 | parseTs({ value: value[0], format: 'moment' }),
10 | parseTs({ value: value[1], format: 'moment' }),
11 | ]
12 | function handleChange(value) {
13 | const beginTime = getTs({ value: value[0], format: "moment" })
14 | const endTime = getTs({ value: value[1], format: "moment" })
15 | onChange && onChange([beginTime, endTime])
16 | }
17 |
18 | return
19 | }
20 |
21 | function getDisableDate(date) {
22 | // 小于3个月之前 和 大于今天的时间,都不可选
23 | return date < moment().subtract(3, 'months').startOf('day') || date > moment().endOf('day')
24 | }
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/packages/translation/README.md:
--------------------------------------------------------------------------------
1 | # @xatom/locales
2 |
3 | 用于集中管理和导出多语言(i18n)资源,适用于 React/Vue/小程序等多端国际化项目。
4 |
5 | ## 目录结构
6 |
7 | ```
8 | locales/
9 | en-US.json # 英文语言包
10 | zh-TW.json # 繁体中文语言包
11 | ... # 其他语言包
12 | en-US.js # 对应 json 的导出
13 | ...
14 | index.js # (可选)入口文件
15 | ```
16 |
17 | ## 使用方法
18 |
19 | ### 1. 按需引入单个语言包
20 | ```js
21 | import enUS from '@xatom/locales/locales/en-US.json'
22 | // 或
23 | import zhTW from '@xatom/locales/locales/zh-TW.json'
24 | ```
25 |
26 | ### 2. 通过 js 文件默认导出
27 | ```js
28 | import enUS from '@xatom/locales/locales/en-US.js'
29 | import zhTW from '@xatom/locales/locales/zh-TW.js'
30 | ```
31 |
32 | ### 3. 批量引入所有语言(推荐用于国际化框架)
33 | ```js
34 | import messages from '@xatom/locales/locales/index-build.js'
35 | // messages = { en_US, zh_TW, ... }
36 | ```
37 |
38 | ### 4. 语言包 JSON 示例
39 | ```json
40 | {
41 | "Hello": "你好",
42 | "Welcome": "欢迎",
43 | "Logout": "退出登录"
44 | }
45 | ```
46 |
47 | ## 注意事项
48 | - 语言包文件名需与实际语言代码一致(如 en-US、zh-TW 等)
49 | - 推荐通过 `index-build.js` 聚合导出,便于国际化框架(如 vue-i18n、react-intl)直接使用
50 | - 支持直接引入 json 或 js 文件
51 | - 如需扩展新语言,添加对应的 json 和 js 文件即可
52 |
53 | ## License
54 |
55 | ISC
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/layer-select-dropdown.less:
--------------------------------------------------------------------------------
1 | // 不自动生成theme,
2 | // 默认:使用 antd的默认风格
3 | // 定制:如有需要,在自己的theme中,生成个性化的 dropdown
4 | .create-antd-select-drodown(@type: ''; @bg: ''; @fc: ''; ) {
5 |
6 | // new type: ant-select-dropdown-xx
7 | .ant-select-dropdown.ant-select-dropdown-@{type} {
8 | background: @bg;
9 |
10 | .ant-select-dropdown-menu-item-selected:hover,
11 | .ant-select-dropdown-menu-item-selected {
12 | background: lighten(@bg, 5%);
13 | color: @brand-primary !important;
14 | font-weight: bold;
15 | }
16 |
17 | .ant-select-dropdown-menu-item-active,
18 | .ant-select-dropdown-menu-item-active:hover {
19 | background: lighten(@bg, 2%);
20 | color: @fc;
21 | }
22 |
23 | .ant-select-dropdown-menu-item {
24 | color: @fc;
25 |
26 | &:hover {
27 | background: lighten(@bg, 2%);
28 | }
29 | }
30 | }
31 | }
32 |
33 |
34 | .ant-select-dropdown-menu {
35 | margin-top: 0px;
36 | }
37 |
38 | .ant-select-dropdown-menu-item {
39 | line-height: 28px;
40 | }
--------------------------------------------------------------------------------
/packages/components/iui/src/Checkbox/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-checkbox(@T2: '';
2 | @T3: '';
3 | @Bg4: '';
4 | @F1: '';
5 |
6 | ) {
7 | .iui-checkbox {
8 | font-size: 12px;
9 |
10 | .ant-checkbox {
11 | font-size: 12px;
12 |
13 | &-input,
14 | &-inner {
15 | width: 12px !important;
16 | height: 12px !important;
17 | }
18 |
19 | &-inner {
20 | background: @Bg4 !important;
21 | border: 1px solid @T3;
22 |
23 | &::after {
24 | width: 5px;
25 | height: 7px;
26 | border-width: 1.5px;
27 | }
28 | }
29 |
30 | &+span {
31 | padding: 0 0 0 8px !important;
32 | }
33 |
34 | &:hover .ant-checkbox-inner {
35 | border-color: @F1;
36 | }
37 |
38 | &-checked .ant-checkbox-inner {
39 | border-color: @F1 !important;
40 | background-color: @F1 !important;
41 | }
42 |
43 | &-disabled .ant-checkbox-inner {
44 | border-color: @T2 !important;
45 | background-color: @Bg4 !important;
46 | &::after {
47 | border-color: @T2 !important;
48 | }
49 | }
50 | }
51 | }
52 | }
--------------------------------------------------------------------------------
/src/modules/config/README.md:
--------------------------------------------------------------------------------
1 | # @config 模块使用说明
2 |
3 | ## 简介
4 |
5 | `@config` 模块用于全局应用配置的获取与设置,支持通过路径获取嵌套配置项,常用于前端项目中全局配置的管理。
6 |
7 | ---
8 |
9 | ## 主要功能
10 |
11 | - 获取全局配置(支持路径获取嵌套属性)
12 | - 设置全局配置
13 |
14 | ---
15 |
16 | ## API 说明
17 |
18 | ### `getAppConfig(path, defaultValue)`
19 | - **参数:**
20 | - `path`:可选,字符串或数组,配置项路径(如 'user.info.name')。
21 | - `defaultValue`:可选,未找到时返回的默认值。
22 | - **返回值:**
23 | - 指定路径下的配置值,或整个配置对象。
24 | - **说明:**
25 | - 若不传 path,则返回整个 `window.appConfig`。
26 |
27 | ### `setAppConfig(config)`
28 | - **参数:**
29 | - `config`:对象,新的全局配置。
30 | - **说明:**
31 | - 会直接覆盖 `window.appConfig`。
32 |
33 | ---
34 |
35 | ## 使用示例
36 |
37 | ### 1. 获取全局配置
38 | ```js
39 | import { getAppConfig } from '@config'
40 | const allConfig = getAppConfig()
41 | const apiBase = getAppConfig('api.baseUrl')
42 | const userName = getAppConfig(['user', 'name'], '默认用户名')
43 | ```
44 |
45 | ### 2. 设置全局配置
46 | ```js
47 | import { setAppConfig } from '@config'
48 | setAppConfig({ api: { baseUrl: 'https://api.example.com' }, user: { name: '张三' } })
49 | ```
50 |
51 | ---
52 |
53 | ## 依赖
54 | - `getValueByPath`(位于 `src/modules/utils/src/object.js`)
55 |
56 | ---
57 |
58 | 如需更多帮助,请查阅源码或联系维护者。
--------------------------------------------------------------------------------
/src/modules/langs/src/pageInit.js:
--------------------------------------------------------------------------------
1 | import routeActions from '@xatom/utils/src/routeActions'
2 | import { getLang, setLang, getUmiLocale, setValidLangs } from './utils'
3 | import { setLocale } from 'umi/locale'
4 | import { getAppConfig } from '@xatom/modules/config'
5 | function setUmiLocale(langMap) {
6 | const lang1 = getLang() // 获取 storage 里面 的 lang
7 | const lang2 = routeActions.getQuery('lang') // url 里面的lang
8 | let lang = lang2 || lang1 // url 里的 lang 优先级更高
9 | lang = handleSimulatorLang(lang,langMap)
10 | const locale = getUmiLocale(lang)
11 | localStorage.setItem('umi_locale',locale)
12 | setLang(lang) // 将 url 里的 lang 更新到本地
13 | setLocale(locale) // 将 主站的 locale 同步给umi (如果不同,umi 会自己刷新)
14 | }
15 | window.setLocale = setLocale
16 | export default function init() {
17 | const langMap = getAppConfig('langs.supportLangs') || ['zh_CN', 'en_US', 'ko_KR', 'ja_JP']
18 | // 读取url的 lang 参数,确保 lang 正确
19 | setUmiLocale(langMap)
20 | // 存储当前app的ValidLangs
21 | setValidLangs(langMap)
22 | }
23 | // 不同项目的多语言筛选
24 | export function handleSimulatorLang(lang,langMap) {
25 | if(langMap.indexOf(lang) > -1){
26 | return lang
27 | }else{
28 | return 'en_US'
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/src/Tabs.js:
--------------------------------------------------------------------------------
1 | import { Tabs } from 'antd'
2 | export default function CustomTabs(props) {
3 | let { className = '', style = {}, tabs = [], fluid = true, tabBarProps = {}, renderTabBar, ...rest } = props
4 | if (fluid) className += ' h-p100 tabs-hfull '
5 | const newProps = { className, style, ...rest }
6 | const defaultActiveKey = (tabs.find(item => item.isDefault) || {}).key || 'USDT'
7 | const defaultRenderTabBar = (props, DefaultTabBar) => {
8 | // const { activeKey } = props
9 | return
10 | }
11 | return (
12 |
13 | {
14 | tabs.map(tab => {
15 | const { title, key, ...tabRest } = tab
16 | return (
17 |
18 | {tab.content}
19 |
20 | )
21 | })
22 | }
23 |
24 | )
25 | }
26 |
--------------------------------------------------------------------------------
/src/modules/utils/src/transformers.js:
--------------------------------------------------------------------------------
1 | // default transformer of item
2 | export const item = (res) => {
3 | if (res && res.code === 200) {
4 | return {
5 | code: res.code,
6 | // fix1: 接受res.data 是一个字符串
7 | // fix2: 有些接口没有data key,所以要做 undefined 处理
8 | item: res.data === undefined ? {} : res.data
9 | }
10 | } else {
11 | return {
12 | code: res && res.code,
13 | item: {}
14 | }
15 | }
16 | }
17 |
18 | // default transformer of list
19 | export const list = (res) => {
20 | if (res && res.code === 200 && res.data) {
21 | return {
22 | code: res.code,
23 | items: res.data.list || [],
24 | page: {
25 | ...(res.data.pageNum ? { current: res.data.pageNum } : {}),
26 | ...(res.data.pageSize ? { size: res.data.pageSize } : {}),
27 | total: res.data.total,
28 | },
29 | }
30 | } else {
31 | return {
32 | code: res && res.code,
33 | items: [],
34 | }
35 | }
36 | }
37 |
38 | // default transformer of page
39 | export const page = (payload) => {
40 | const { page = {} } = payload
41 | return {
42 | pageNum: page.current,
43 | pageSize: page.size,
44 | }
45 | }
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Switch/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-switch(
2 | @C1: '';
3 | @F1: '';
4 | @F2: '';
5 | ) {
6 | .iui-switch {
7 | height: 20px;
8 | line-height: 20px;
9 | border: none;
10 | background: @C1;
11 | min-width: 36px;
12 |
13 | // default
14 | &::after {
15 | width: 12px;
16 | height: 12px;
17 | top: 4px;
18 | left: 4px;
19 | border-radius: 12px;
20 | }
21 |
22 | &.ant-switch-checked {
23 | background: @F2;
24 |
25 | &::after {
26 | left: 100%;
27 | margin-left: -4px;
28 | }
29 | }
30 |
31 | &.ant-switch-disabled {
32 | opacity: 0.3;
33 | }
34 |
35 | // type - primary
36 | &-primary {
37 | &.ant-switch-checked {
38 | background: @F1;
39 | }
40 | }
41 |
42 | // size - small
43 | &.ant-switch-small {
44 | min-width: 32px;
45 | height: 16px;
46 | line-height: 16px;
47 |
48 | &::after {
49 | top: 2px;
50 | left: 2px;
51 | }
52 |
53 | &.ant-switch-checked {
54 | &::after {
55 | left: 100%;
56 | margin-left: -2px;
57 | }
58 | }
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/src/modules/utils/src/url.js:
--------------------------------------------------------------------------------
1 | import { parse } from 'qs';
2 |
3 | /* eslint no-useless-escape:0 */
4 | const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
5 | export function isUrl(path) {
6 | return reg.test(path);
7 | }
8 | export function getQuery(paramKey, url) {
9 | url = url ? url : window.location.href
10 | const querystring = url.split('?')[1]
11 | const query = parse(querystring)
12 | return paramKey ? query[paramKey] : query
13 | }
14 |
15 | export function toQuery(obj = {}) {
16 |
17 | }
18 |
19 | export function getPathname(uri) {
20 | // 移除协议部分 (http://, https://, ws://, wss://)
21 | const withoutProtocol = uri.replace(/^(?:[\w+.-]+:)?\/\//, '');
22 | // 移除认证信息 (user:pass@)
23 | const withoutAuth = withoutProtocol.replace(/^[^@]*@/, '');
24 | // 移除域名和端口,获取路径部分
25 | const pathAndQuery = withoutAuth.replace(/^[^/]*/, '');
26 | // 移除查询参数和hash
27 | const pathname = pathAndQuery.split(/[?#]/)[0];
28 | // 如果结果为空,返回 '/'
29 | return pathname || '/';
30 | }
31 |
32 | export default {
33 | isUrl,
34 | getQuery,
35 | toQuery,
36 | getPathname,
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Radio/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-radio(@T2: '';
2 | @Bg4: '';
3 | @Bg5: '';
4 | @F1: '';
5 |
6 | ) {
7 | .iui-radio {
8 | font-size: 12px;
9 |
10 | .ant-radio {
11 | font-size: 12px;
12 |
13 | &-input,
14 | &-inner {
15 | width: 12px;
16 | height: 12px;
17 | }
18 |
19 | &-inner {
20 | background-color: @Bg4;
21 | border: 1px solid @T2;
22 |
23 | &::after {
24 | width: 6px;
25 | height: 6px;
26 | top: 2px;
27 | left: 2px;
28 | background-color: @F1;
29 | opacity: 0;
30 | }
31 | }
32 |
33 | &+span {
34 | padding: 0 0 0 8px !important;
35 | }
36 |
37 | &:hover .ant-radio-inner {
38 | border-color: @F1;
39 | }
40 |
41 | &-checked .ant-radio-inner {
42 | border-color: @F1 !important;
43 |
44 | &::after {
45 | opacity: 1;
46 | }
47 | }
48 |
49 | &-disabled .ant-radio-inner {
50 | border-color: @T2 !important;
51 | background-color: @Bg5 !important;
52 |
53 | &::after {
54 | opacity: 0;
55 | }
56 | }
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/layer-popover.less:
--------------------------------------------------------------------------------
1 | // 不自动生成theme,
2 | // 默认:使用 antd的默认风格
3 | // 定制:如有需要,在自己的theme中,生成个性化的 dropdown
4 | .create-antd-popover(@type: ''; @bg: ''; @fc: ''; ) {
5 |
6 | // new type: ant-popover-xx
7 | .ant-popover.ant-popover-@{type} {
8 | background: @bg;
9 |
10 | .ant-popover-inner {
11 | background-color: @bg;
12 | }
13 |
14 | &.ant-popover-placement-top>.ant-popover-content>.ant-popover-arrow,
15 | &.ant-popover-placement-topLeft>.ant-popover-content>.ant-popover-arrow,
16 | &.ant-popover-placement-topRight>.ant-popover-content>.ant-popover-arrow {
17 | border-right-color: @bg;
18 | border-bottom-color: @bg;
19 | }
20 |
21 | &.ant-popover-placement-left>.ant-popover-content>.ant-popover-arrow,
22 | &.ant-popover-placement-leftTop>.ant-popover-content>.ant-popover-arrow,
23 | &.ant-popover-placement-leftBottom>.ant-popover-content>.ant-popover-arrow {
24 | border-top-color: @bg;
25 | border-right-color: @bg;
26 | }
27 | }
28 | }
29 |
30 | .ant-popover.rs {
31 | .ant-popover-inner-content {
32 | padding: 0px !important;
33 | }
34 | }
--------------------------------------------------------------------------------
/src/modules/utils/src/dva.js:
--------------------------------------------------------------------------------
1 | import { bindActionCreators } from 'redux'
2 | import { getDispatch } from './umi'
3 |
4 | export function getActionCreators({ namespace = '', keys = [], id }) {
5 | let actionCreators = {}
6 | keys.forEach(key => {
7 | const actionCreator = (payload, resHandler) => {
8 | let type = namespace ? namespace + "/" + key : key
9 | let newPayload = id ? { ...payload, id } : payload
10 | return { type, payload: newPayload, resHandler };
11 | }
12 | actionCreators[key] = actionCreator
13 | })
14 | return actionCreators
15 | }
16 |
17 | export function getActions(model = {}, dispatch) {
18 | const namespace = model.namespace
19 | const reducersKeys = Object.keys(model.reducers || {})
20 | const effectsKeys = Object.keys(model.effects || {})
21 | const keys = [...reducersKeys, ...effectsKeys]
22 | const actionCreators = getActionCreators({ namespace, keys })
23 | if (!dispatch) dispatch = getDispatch()
24 | // console.log('getActions: model ',model)
25 | // console.log('getActions: dispatch ',dispatch)
26 | const actions = dispatch ? bindActionCreators(actionCreators, dispatch) : []
27 | // console.log('getActions: actions ',actions)
28 | return actions
29 | }
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/modules/utils/src/array.js:
--------------------------------------------------------------------------------
1 |
2 | export function orderByDesc() {
3 | // TODO
4 | }
5 |
6 | export function orderByAsc() {
7 | // TODO
8 | }
9 |
10 | export function unique() {
11 | // TODO
12 | }
13 |
14 | // 升序
15 | // obj arr 或者 二维数组
16 | export function ascSorter(key, type) {
17 | if (type === 'string') {
18 | return (a, b) => {
19 | return a[key] >= b[key] ? 1 : -1 // 字符串比大小,不能与加减号
20 | }
21 | } else {
22 | return (a, b) => {
23 | const aValue = isNaN(a[key]) ? 0 : Number(a[key]) // fixbug: 修复 Number(value) 为 NaN时候排序不正确的bug
24 | const bValue = isNaN(b[key]) ? 0 : Number(b[key]) // fixbug: 修复 Number(value) 为 NaN时候排序不正确的bug
25 | return aValue - bValue
26 | }
27 | }
28 |
29 | }
30 |
31 | // 降序
32 | // obj arr 或者 二维数组
33 | export function descSorter(key, type) {
34 | if (type === 'string') {
35 | return (a, b) => {
36 | return b[key] >= a[key] ? 1 : -1 // 字符串比大小,不能与加减号
37 | }
38 | } else {
39 | return (a, b) => {
40 | const aValue = isNaN(a[key]) ? 0 : Number(a[key]) // fixbug: 修复 Number(value) 为 NaN时候排序不正确的bug
41 | const bValue = isNaN(b[key]) ? 0 : Number(b[key]) // fixbug: 修复 Number(value) 为 NaN时候排序不正确的bug
42 | return bValue - aValue
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/packages/components/ui/src/Table/index.js:
--------------------------------------------------------------------------------
1 | import { Table, ConfigProvider } from 'antd'
2 | import $t from '@xatom/intl'
3 | import SimplePagination from '../SimplePagination'
4 | import Empty from '../Empty'
5 | import './index.less'
6 |
7 | export default function (props) {
8 | const { list, columns, className = '', emptyText = $t('No Record'), simplePagination = true, scroll, theme } = props
9 | let { items = [], page = {}, loading, id } = list
10 | const tableProps = {
11 | className: `ui-table ${className}`,
12 | dataSource: items,
13 | columns: formatColumns(columns),
14 | pagination: false,
15 | loading,
16 | scroll
17 | }
18 | return (
19 | }>
20 |
21 | {simplePagination && }
22 |
23 | )
24 | }
25 | function formatColumns(columns) {
26 | return columns.map(column => {
27 | let newColumn = {}
28 | if (!column.key) {
29 | newColumn.key = column.dataIndex
30 | }
31 | return {
32 | ...column,
33 | ...newColumn,
34 | }
35 | })
36 | }
37 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/typo/font-family.less:
--------------------------------------------------------------------------------
1 | body, button, input, optgroup, select, textarea {
2 | font-family: 'IBMPlexSans' sans-serif !important;
3 | }
4 |
5 | @font-face {
6 | font-family: 'IBMPlexSans';
7 | src: url('https://cdn.test.mobi/fonts/IBMPlexSans-Regular.ttf') format('truetype'), url('https://cdn.test.mobi/fonts/IBMPlexSans-Regular.ttf') format('svg');
8 | font-weight: 100 400;
9 | font-display: swap;
10 | }
11 |
12 | @font-face {
13 | font-family: 'IBMPlexSans';
14 | src: url('https://cdn.test.mobi/fonts/IBMPlexSans-Medium.ttf') format('truetype'), url('https://cdn.test.mobi/fonts/IBMPlexSans-Medium.ttf') format('svg');
15 | font-weight: 500;
16 | font-display: swap;
17 | }
18 |
19 | @font-face {
20 | font-family: 'IBMPlexSans';
21 | src: url('https://cdn.test.mobi/fonts/IBMPlexSans-SemiBold.ttf') format('truetype'), url('https://cdn.test.mobi/fonts/IBMPlexSans-SemiBold.ttf') format('svg');
22 | font-weight: 600;
23 | font-display: swap;
24 | }
25 |
26 | @font-face {
27 | font-family: 'IBMPlexSans';
28 | src: url('https://cdn.test.mobi/fonts/IBMPlexSans-Bold.ttf') format('truetype'), url('https://cdn.test.mobi/fonts/IBMPlexSans-Bold.ttf') format('svg');
29 | font-weight: 700 900;
30 | font-display: swap;
31 | }
32 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Modal/index.js:
--------------------------------------------------------------------------------
1 | import { Modal } from 'antd'
2 | import { useMediaQuery } from 'react-responsive'
3 |
4 | export default function (props) {
5 | /**
6 | * scrollbar:auto/scroll
7 | * - auto 滚动条样式auto
8 | * - scroll 滚动条贴边
9 | * title: 可固定的页头
10 | * footer: 可固定的页脚
11 | */
12 | const { children, wrapClassName = '', scrollbar = 'auto', title = null, footer = null, ...rest } = props
13 | const isH5 = useMediaQuery({ maxWidth: 767 })
14 | const isH5MaxWidth = useMediaQuery({ maxWidth: 367 })
15 | const width = isH5 ? (isH5MaxWidth ? 'calc(100vw - 48px)' : '320px' ) : '420px'
16 | const modalProps = {
17 | wrapClassName: ['iui-modal', wrapClassName].join(' '),
18 | destroyOnClose: true,
19 | maskClosable: false,
20 | centered: true,
21 | title: null,
22 | footer: null,
23 | width,
24 | zIndex: 1002,
25 | closeIcon: ,
26 | ...rest
27 | }
28 | return
29 | {title && {title}
}
30 | {children}
31 | {footer && {footer}
}
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Navbar/child/MoreDrawer/index.js:
--------------------------------------------------------------------------------
1 | import { Drawer, Button } from '@xatom/iui';
2 | import auth, { UnLoged } from '@xatom/auth'
3 | import { useState } from 'react'
4 | import $t from '@xatom/intl'
5 | import LanguageDropdown from '../LanguageDropdown'
6 | import CommonMenu from '../CommonMenu'
7 |
8 | export default function (props) {
9 | const { leftMenus = [] } = props
10 | const [drawerVisible, setDrawerVisible] = useState(false)
11 |
12 | return <>
13 | setDrawerVisible(true)}>
14 |
15 |
16 |
17 | setDrawerVisible(false)}>
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | >
29 | }
30 |
--------------------------------------------------------------------------------
/src/modules/utils/src/mock.js:
--------------------------------------------------------------------------------
1 | import mockjs from 'mockjs';
2 | import moment from 'moment';
3 |
4 | const { Random } = mockjs
5 | // 参考文档:http://mockjs.com/examples.html
6 |
7 | // 生成随机数据
8 | export const random = {
9 | enum: (arr) => arr[Math.floor(Math.random() * arr.length)],
10 | timestamp: () => moment(Random.datetime()).format('x'),
11 | ...Random
12 | }
13 |
14 | // 模拟网络请求时间
15 | // referene https://github.com/nikogu/roadhog-api-doc/blob/master/lib/utils.js
16 | export const delay = function (proxy, timer = 1500 * 1) {
17 | let mockApi = {};
18 | Object.keys(proxy).forEach(function (key) {
19 | let result = proxy[key].$body || proxy[key];
20 | if (Object.prototype.toString.call(result) === '[object String]' && /^http/.test(result)) {
21 | mockApi[key] = proxy[key];
22 | } else {
23 | mockApi[key] = function (req, res) {
24 | let foo;
25 | if (Object.prototype.toString.call(result) === '[object Function]') {
26 | foo = result;
27 | } else {
28 | foo = function (req, res) {
29 | res.json(result);
30 | };
31 | }
32 | setTimeout(function () {
33 | foo(req, res);
34 | }, timer);
35 | };
36 | }
37 | });
38 | mockApi.__mockData = proxy;
39 | return mockApi;
40 | };
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/modules/utils/src/perf.js:
--------------------------------------------------------------------------------
1 | /**
2 | * debouncing, executes the function if there was no new event in $wait milliseconds
3 | * @param func
4 | * @param wait
5 | * @param scope
6 | * @returns {Function}
7 | */
8 | export function debounce(func, wait, scope) {
9 | var timer;
10 | return function () {
11 | var context = scope || this, args = arguments;
12 | var later = function () {
13 | timer = null;
14 | func.apply(context, args);
15 | };
16 | clearTimeout(timer);
17 | timer = setTimeout(later, wait);
18 | };
19 | }
20 |
21 | /**
22 | * in case of a "storm of events", this executes once every $threshold
23 | * @param fn
24 | * @param threshhold
25 | * @param scope
26 | * @returns {Function}
27 | */
28 |
29 | export function throttle(fn, threshhold, scope) {
30 | threshhold || (threshhold = 250);
31 | var last,
32 | deferTimer;
33 | return function () {
34 | var context = scope || this;
35 |
36 | var now = +new Date(),
37 | args = arguments;
38 | if (last && now < last + threshhold) {
39 | // hold on to it
40 | clearTimeout(deferTimer);
41 | deferTimer = setTimeout(function () {
42 | last = now;
43 | fn.apply(context, args);
44 | }, threshhold);
45 | } else {
46 | last = now;
47 | fn.apply(context, args);
48 | }
49 | };
50 | }
51 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/other/animation.less:
--------------------------------------------------------------------------------
1 | @keyframes slideShine {
2 | 0% {
3 | background-position: -20% 0
4 | }
5 |
6 | to {
7 | background-position: 120% 100%
8 | }
9 | }
10 |
11 | @bg: #ee781c;
12 | @bg-light: lighten(#ee781c, 8%);
13 |
14 | .blink-bg {
15 | background: @bg linear-gradient(-45deg, @bg 42%, @bg-light 48%, @bg-light 52%, @bg 58%) no-repeat 0 0 !important;
16 | background-size: 200% 100% !important;
17 | // -webkit-background-clip: text;
18 | // -webkit-text-fill-color: transparent;
19 | animation-duration: 1.5s;
20 | animation-timing-function: linear;
21 | animation-delay: 0s;
22 | animation-iteration-count: infinite;
23 | animation-direction: normal;
24 | animation-fill-mode: none;
25 | animation-play-state: running;
26 | animation-name: slideShine;
27 | }
28 |
29 | .blink-text {
30 | background: @bg linear-gradient(-45deg, @bg 42%, @bg-light 48%, @bg-light 52%, @bg 58%) no-repeat 0 0 !important;
31 | background-size: 20% 100% !important;
32 | background-clip: text !important;
33 | // text-fill-color: transparent !important;
34 | animation-duration: 1.5s;
35 | animation-timing-function: linear;
36 | animation-delay: 0s;
37 | animation-iteration-count: infinite;
38 | animation-direction: normal;
39 | animation-fill-mode: none;
40 | animation-play-state: running;
41 | animation-name: slideShine;
42 | }
43 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Select/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * size:max/large/default/small
3 | */
4 | import { Select } from 'antd'
5 | import $t from '@xatom/intl'
6 | import { getMode } from '@xatom/utils/src/themes'
7 |
8 | export default function (props) {
9 | const { options = [], labelRender, className = '', dropdownClassName = '', size = '', ...rest } = props
10 | const sizeClassName = size ? `iui-select-size-${size}` : ''
11 | const dropdownSizeClassName = size ? `iui-select-dropdown-size-${size}` : ''
12 | const mode = getMode()
13 |
14 | return (
15 | }
18 | notFoundContent={
19 |
20 |
21 |
{$t('No Record')}
22 |
23 | }
24 | dropdownClassName={['iui-select-dropdown', dropdownClassName, dropdownSizeClassName].join(' ')} {...rest}>
25 | {options.map((item, index) =>
26 |
27 | {labelRender ? labelRender(item) : item.label}
28 |
29 | )}
30 |
31 | )
32 | }
33 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Navbar/child/DownloadDropdown/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-navbar-download(@T1: '';
2 | @C1: '';
3 | @F1: '';
4 |
5 | ) {
6 | .iui-navbar-download {
7 | color: @T1;
8 | display: flex;
9 | align-items: center;
10 | height: 100%;
11 | padding-left: 12px;
12 |
13 | &-icon {
14 | font-size: 24px !important;
15 | cursor: pointer;
16 | }
17 | }
18 |
19 | .iui-navbar-download-overlay {
20 | padding: 20px;
21 |
22 | &-qrcode {
23 | width: 136px;
24 | margin-bottom: 16px;
25 | }
26 |
27 | &-title {
28 | font-size: 14px;
29 | line-height: 16px;
30 | color: @T1;
31 | text-align: center;
32 | margin-bottom: 16px;
33 | }
34 |
35 | &-platform {
36 | display: flex;
37 | justify-content: space-between;
38 |
39 | &-item {
40 | display: flex;
41 | justify-content: center;
42 | align-items: center;
43 | width: 40px;
44 | height: 40px;
45 | border-radius: 50%;
46 | background: @C1;
47 | color: @T1;
48 | cursor: pointer;
49 |
50 | &-icon {
51 | font-size: 20px !important;
52 | }
53 |
54 | &:hover {
55 | background: #FFFFFF;
56 | box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);
57 | color: @F1;
58 | }
59 | }
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/tag.less:
--------------------------------------------------------------------------------
1 | .tag-basic {
2 | // TODO
3 | }
4 |
5 | .tag-small {
6 | height: 15px;
7 | line-height: 15px - 2px;
8 | padding: 0 5px;
9 | display: inline-block;
10 | box-sizing: border-box;
11 | }
12 |
13 | .tag-middle {
14 | display: inline-block;
15 | height: 20px;
16 | line-height: 20px - 2px;
17 | padding: 0 7.5px;
18 | box-sizing: border-box;
19 | }
20 |
21 | .tag-large {
22 | height: 25px;
23 | line-height: 25px - 2px;
24 | padding: 0 10px;
25 | display: inline-block;
26 | box-sizing: border-box;
27 | }
28 |
29 | .tag-type(@type: ''; @bg: ''; @br: ''; ) {
30 | .tag-@{type} {
31 | border: 1px solid @bg;
32 | background: @bg;
33 | color: #fff;
34 | border-radius: @br;
35 | font-size: 12px;
36 |
37 | &.tag-outline {
38 | background: transparent;
39 | color: @bg;
40 | border: 1px solid @bg;
41 | }
42 | }
43 |
44 | }
45 |
46 | .tag-light-type(@type: ''; @bg: ''; @bc: ''; @br: ''; ) {
47 | .tag-@{type} {
48 | border: 1px solid transparent;
49 | color: @bc;
50 | background: @bg;
51 | border-radius: @br;
52 | font-size: 12px;
53 |
54 | &.tag-outline {
55 | background: transparent;
56 | border: 1px solid @bc;
57 | color: @bc;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/packages/components/iui/src/Navbar/child/MessageDropdown/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-navbar-message(
2 | @T1: '';
3 | @T2: '';
4 | @F1: '';
5 | @F3: '';
6 | ) {
7 | .iui-navbar-message {
8 | display: flex;
9 | align-items: center;
10 | height: 100%;
11 | padding: 0 12px;
12 |
13 | &-trigger {
14 | position: relative;
15 | cursor: pointer;
16 |
17 | &-icon {
18 | font-size: 24px !important;
19 | color: @T1;
20 | }
21 |
22 | &-badge {
23 | width: 8px;
24 | height: 8px;
25 | position: absolute;
26 | top: -2px;
27 | right: -2px;
28 | background: @F3;
29 | border-radius: 50%;
30 | overflow: hidden;
31 | }
32 | }
33 | }
34 |
35 | .iui-navbar-message-overlay {
36 | padding: 12px;
37 |
38 | .iui-navbar-common-item-row {
39 | &:hover {
40 | border-radius: 4px;
41 | }
42 |
43 | &:not(:last-child) {
44 | margin-bottom: 4px;
45 | }
46 | }
47 |
48 | &-text {
49 | &-item {
50 | margin-top: 4px;
51 | color: @T2;
52 |
53 | &-detail {
54 | margin-left: 16px;
55 | color: @F1;
56 | font-size: 12px;
57 | }
58 | }
59 | }
60 |
61 | &-badge {
62 | display: block;
63 | width: 8px;
64 | height: 8px;
65 | background: @F3;
66 | border-radius: 50%;
67 | overflow: hidden;
68 | margin-left: 4px;
69 | }
70 | }
71 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/tabs.less:
--------------------------------------------------------------------------------
1 | .ant-tabs.ant-tabs-top,
2 | .ant-tabs.ant-tabs-bottom {
3 |
4 | &.tabs-hfull,
5 | &.tabs-full {
6 | display: flex;
7 | flex-direction: column;
8 |
9 | .ant-tabs-content {
10 | .box-fluid;
11 | height: 0;
12 |
13 | &>.ant-tabs-tabpane {
14 | height: 100%;
15 |
16 | &.ant-tabs-tabpane-inactive {
17 | height: 0%;
18 | }
19 | }
20 | }
21 | }
22 |
23 | .tabs-header {
24 | height: 100%;
25 | }
26 |
27 | .ant-tabs-bar {
28 | // ant-tabs-top-bar
29 | height: 100%;
30 | border-bottom: none;
31 |
32 | .ant-tabs-nav-container {
33 | height: 100%;
34 |
35 | .ant-tabs-nav-wrap {
36 | height: 100%;
37 |
38 | .ant-tabs-nav-scroll {
39 | height: 100%;
40 |
41 | .ant-tabs-nav {
42 | height: 100%;
43 |
44 | div:first-child {
45 | display: flex;
46 | height: 100%;
47 |
48 | .ant-tabs-tab {
49 | height: 100%;
50 | .center-vh;
51 | }
52 | }
53 | }
54 | }
55 | }
56 | }
57 | }
58 | }
59 |
60 | .ant-tabs.rs-flex {
61 | .ant-tabs-nav {
62 | display: block;
63 |
64 | div:first-child {
65 | display: flex !important;
66 |
67 | .ant-tabs-tab {
68 | margin: 0px !important;
69 | flex: 1 !important;
70 | // padding:12px 0px !important;
71 | }
72 | }
73 | }
74 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/box/scrollbar.less:
--------------------------------------------------------------------------------
1 | .no-scrollbar() {
2 | ::-webkit-scrollbar {
3 | width: 6px !important;
4 | /*高宽分别对应横竖滚动条的尺寸*/
5 | height: 6px !important;
6 | }
7 |
8 | ::-webkit-scrollbar-thumb {
9 | background: transparent !important;
10 | // display: none !important;
11 | // background: red !important;
12 |
13 | }
14 | }
15 |
16 | .create-scrollbar-types() {
17 | .pc-scrollbar-thumb {
18 | background: @bg-scrollbar;
19 | border-radius: 6px;
20 | width: 6px;
21 | }
22 |
23 | // .ant-table-body {
24 | // .no-scrollbar();
25 | // }
26 |
27 | // .ant-table-header.ant-table-hide-scrollbar {
28 | // .no-scrollbar();
29 | // }
30 | ::-webkit-scrollbar {
31 | /*滚动条整体样式*/
32 | width: 6px;
33 | /*高宽分别对应横竖滚动条的尺寸*/
34 | height: 6px;
35 | // position: relative;
36 | }
37 |
38 | ::-webkit-scrollbar-thumb {
39 | /*滚动条里面小方块*/
40 | border-radius: 6px;
41 | background: @bg-scrollbar;
42 |
43 | // background: blue;
44 | &:hover {
45 | cursor: move;
46 | }
47 | }
48 |
49 | ::-webkit-scrollbar-track {
50 | /*滚动条里面轨道*/
51 | background: transparent !important;
52 | display: none !important;
53 | // background: blue;
54 |
55 | }
56 |
57 | ::-webkit-scrollbar-corner {
58 | background: transparent !important;
59 | display: none !important;
60 | }
61 |
62 | }
63 |
64 | .ant-select-dropdown {
65 | ::-webkit-scrollbar-thumb {
66 | background: rgba(0, 0, 0, 0.1) !important;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/modules/utils/src/file.js:
--------------------------------------------------------------------------------
1 |
2 | // URL API: https://developer.mozilla.org/en-US/docs/Web/API/URL
3 | export function createFileAndDownload(fileName, content) {
4 | var aTag = document.createElement('a')
5 | var blob = new Blob([content])
6 | aTag.download = fileName
7 | aTag.href = URL.createObjectURL(blob)
8 | aTag.click()
9 | URL.revokeObjectURL(blob)
10 | }
11 |
12 | // http://caibaojian.com/js-download.html
13 | export function downloadFile(aLink, fileName, content) {
14 | aLink.download = fileName;
15 | aLink.href = "data:text/plain," + content;
16 | }
17 |
18 | export function downloadURL(url, fileName = 'img.png') {
19 | const elem = document.createElement('a');
20 |
21 | elem.setAttribute('href', url);
22 | elem.setAttribute('download', fileName);
23 | document.body.appendChild(elem);
24 | elem.click();
25 |
26 | elem.remove();
27 | }
28 |
29 | /**
30 | *
31 | * @param {String|HTMLCanvasElement} target canvas selector 或 canvas
32 | * @param {String} fileName
33 | */
34 | export function downloadCanvas(target, fileName) {
35 | let canvas
36 |
37 | if (typeof target === 'string') {
38 | canvas = document.querySelector(target)
39 | } else {
40 | canvas = target
41 | }
42 |
43 | if (canvas) {
44 | try {
45 | const image = canvas.toDataURL('image/png').replace('image/png', 'image/octet-stream')
46 |
47 | downloadURL(image, fileName)
48 |
49 | return true
50 | } catch (error) {
51 | return false
52 | }
53 | } else {
54 | return false
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/packages/bridge/README.md:
--------------------------------------------------------------------------------
1 | # @xatom/bridge
2 |
3 | 一个用于 WebView Javascript Bridge 的工具库,支持在 iOS 和 Android WebView 中与原生代码进行通信。
4 |
5 | ## 安装
6 |
7 | ```bash
8 | npm install @xatom/bridge
9 | ```
10 |
11 | ## 使用说明
12 |
13 | ### 1. bridgeReady(schema?)
14 | 等待 Bridge 初始化完成,返回一个 Promise,resolve 后可安全调用原生方法。
15 |
16 | **参数:**
17 | - `schema`(可选):iOS 下用于触发 bridge 初始化的 schema,默认值为 `ida`。
18 |
19 | **示例:**
20 | ```js
21 | import { bridgeReady } from '@xatom/bridge'
22 |
23 | bridgeReady().then((bridgeInstance) => {
24 | // 可以安全调用原生方法
25 | })
26 | ```
27 |
28 | ### 2. callApi(action, opt)
29 | 调用原生方法。
30 |
31 | **参数:**
32 | - `action`:字符串,格式为 `apiType.actionName`,如 `app.getUserInfo`
33 | - `opt`:对象,传递给原生的参数
34 |
35 | **返回:**
36 | - Promise,resolve 为原生返回数据,reject 为错误信息
37 |
38 | **示例:**
39 | ```js
40 | import { callApi } from '@xatom/bridge'
41 |
42 | callApi('app.getUserInfo', { foo: 'bar' })
43 | .then(data => {
44 | // 处理原生返回的数据
45 | })
46 | .catch(err => {
47 | // 处理错误
48 | })
49 | ```
50 |
51 | ### 3. registerApi(action, callback)
52 | 注册 JS 方法给原生调用。
53 |
54 | **参数:**
55 | - `action`:字符串,方法名
56 | - `callback`:函数,接收原生传递的数据
57 |
58 | **示例:**
59 | ```js
60 | import { registerApi } from '@xatom/bridge'
61 |
62 | registerApi('onCustomEvent', (err, data) => {
63 | if (!err) {
64 | // 处理原生传递的数据
65 | }
66 | })
67 | ```
68 |
69 | ## 错误码
70 | - `BRIDGE_TIMEOUT`:bridge 初始化超时
71 | - `BRIDGE_NOTFOUND`:未找到 bridge
72 | - `PARAMETER_ERROR`:参数错误
73 | - `JSON_PARSE_ERROR`:JSON 解析失败
74 | - `BRIDGE_FUNCTION_NOTFOUND`:未找到指定的原生方法
75 |
76 | ## License
77 | ISC
--------------------------------------------------------------------------------
/packages/components/ui/src/SimplePagination/index.js:
--------------------------------------------------------------------------------
1 | import { Cols } from '@xatom/flex'
2 | import { Icon } from '@xatom/antd'
3 | import { listActions } from '@xatom/lists'
4 | import './index.less'
5 |
6 | export default function (props) {
7 | const { page = {}, disabled, total = 0, id } = props
8 | const current = Number(page.current || 1)
9 | const next = () => listActions.pageChange({ id, page: { current: current + 1 } })
10 | const prev = () => listActions.pageChange({ id, page: { current: current - 1 } })
11 | const back = () => listActions.pageChange({ id, page: { current: 1 } })
12 |
13 | return ((total === Number(page.size) || current > 1) &&
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | {current}
22 |
23 |
24 |
25 |
26 | )
27 | }
28 |
29 | function PageItem(props) {
30 | let { children, className = '', disabled, onClick, ...rest } = props
31 | className = `ui-simple-pagination-item ${className}`
32 | if (disabled) {
33 | className += ` disabled`
34 | onClick = null
35 | }
36 | return {children}
37 | }
--------------------------------------------------------------------------------
/packages/components/iui/src/Drawer/index.js:
--------------------------------------------------------------------------------
1 | import { Drawer } from 'antd'
2 | import { useMediaQuery } from 'react-responsive'
3 |
4 | export default function (props) {
5 | /**
6 | * scrollbar:auto/scroll
7 | * - auto 滚动条样式auto
8 | * - scroll 滚动条贴边
9 | * shape: round
10 | * - round 抽屉上部分支持圆角
11 | * closable: 是否展示自定义的关闭按钮
12 | * title: 可固定的页头
13 | * footer: 可固定的页脚
14 | */
15 | const { children, scrollbar = 'auto', shape = '', closable = true, title = null, footer = null, className = '', onClose = () => { }, ...rest } = props
16 | const isH5 = useMediaQuery({ maxWidth: 767 })
17 | const width = isH5 ? '100vw' : '320px'
18 | const platformClassName = isH5 ? 'iui-drawer-h5' : 'iui-drawer-web'
19 | const shapeClassName = shape ? `iui-drawer-shape-${shape}` : ''
20 | const drawerProps = {
21 | width,
22 | zIndex: 1002,
23 | placement: 'right',
24 | closable: false,
25 | destroyOnClose: true,
26 | maskClosable: false,
27 | className: ['iui-drawer', platformClassName, shapeClassName, className].join(' '),
28 | ...rest
29 | }
30 |
31 | return
32 | {closable && }
33 |
34 | {title &&
{title}
}
35 |
{children}
36 | {footer &&
{footer}
}
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/packages/components/ui/src/toast/index.less:
--------------------------------------------------------------------------------
1 | .ant-message {
2 | &-notice {
3 | &-content {
4 | box-shadow: none;
5 | border-radius: 6px;
6 | padding: 0;
7 | overflow: hidden;
8 | }
9 | }
10 |
11 | &-custom-content {
12 | padding: 12px 20px;
13 | line-height: 20px;
14 | display: flex;
15 | align-items: center;
16 |
17 | svg {
18 | display: none;
19 | }
20 |
21 | .anticon {
22 | top: 0;
23 | width: 20px;
24 | height: 20px;
25 | margin-right: 6px;
26 | }
27 | }
28 |
29 | &-info {
30 | background-color: rgba(0, 0, 0, 0.04);
31 | color: rgba(137, 137, 137, 1);
32 |
33 | .anticon {
34 | background: url(./images/icon-info.png) 0 0 no-repeat;
35 | background-size: cover;
36 | }
37 | }
38 |
39 | &-success {
40 | background-color: rgba(0, 191, 117, 0.06);
41 | color: rgba(0, 191, 117, 1);
42 |
43 | .anticon {
44 | background: url(./images/icon-success.png) 0 0 no-repeat;
45 | background-size: cover;
46 | }
47 | }
48 |
49 | &-error {
50 | background-color: rgba(252, 60, 86, 0.06);
51 | color: rgba(252, 60, 86, 1);
52 |
53 | .anticon {
54 | background: url(./images/icon-error.png) 0 0 no-repeat;
55 | background-size: cover;
56 | }
57 | }
58 |
59 | &-warning {
60 | background-color: rgba(255, 153, 0, 0.06);
61 | color: rgba(255, 153, 0, 1);
62 |
63 | .anticon {
64 | background: url(./images/icon-warning.png) 0 0 no-repeat;
65 | background-size: cover;
66 | }
67 | }
68 | }
--------------------------------------------------------------------------------
/packages/translang/README.md:
--------------------------------------------------------------------------------
1 | # @xatom/translang
2 |
3 | 用于将指定格式的 xlsx 文件自动转换为项目中的多语言 json 文件,适用于多语言项目的批量翻译管理。
4 |
5 | ## 功能简介
6 | - 支持从 Excel(.xlsx)文件批量生成/更新多语言 json 文件
7 | - 自动合并历史翻译,保留未覆盖的旧数据
8 | - 支持多 sheet、任意语言列
9 |
10 | ## xlsx 文件格式要求
11 | | Key | en-US | zh-CN |
12 | |------|-------|-------|
13 | | name | name | 姓名 |
14 |
15 | - 第一行为表头,第一列为 Key,后续每列为不同语言(如 en-US、zh-CN 等)
16 | - 每行为一个翻译项
17 |
18 | ## 安装
19 |
20 | ```bash
21 | npm install -g @xatom/translang
22 | ```
23 |
24 | ## 使用方法
25 |
26 | ```bash
27 | translang --xlsx="/绝对路径/language.xlsx" --sheets="Sheet1" --locales="/绝对路径/your_project/locales"
28 | ```
29 |
30 | ### 参数说明
31 | - `--xlsx` xlsx 文件的绝对路径(必填)
32 | - `--sheets` 需要处理的 sheet 名称(必填)
33 | - `--locales` 语言 json 文件所在目录的绝对路径(必填)
34 |
35 | ### 示例
36 | 假设有如下 xlsx 文件:
37 |
38 | | Key | en-US | zh-CN |
39 | |------|-------|-------|
40 | | name | name | 姓名 |
41 | | age | age | 年龄 |
42 |
43 | 执行命令:
44 |
45 | ```bash
46 | translang --xlsx="/Users/xxx/language.xlsx" --sheets="Sheet1" --locales="/Users/xxx/project/locales"
47 | ```
48 |
49 | 会自动生成/更新:
50 | - `/Users/xxx/project/locales/en-US.json`
51 | - `/Users/xxx/project/locales/zh-CN.json`
52 |
53 | ## 注意事项
54 | - 仅支持 xlsx 格式,且需保证表头格式正确
55 | - 运行前请备份原有语言文件,避免数据丢失
56 | - 仅会覆盖/新增 xlsx 中存在的 key,未覆盖的 key 保留原值
57 | - 依赖 [xlsx](https://www.npmjs.com/package/xlsx) 包
58 |
59 | ## 常见问题
60 | - **Q:** 支持多 sheet 吗?
61 | **A:** 支持,通过 `--sheets` 指定 sheet 名称
62 | - **Q:** 语言文件不存在会怎样?
63 | **A:** 会自动创建新的 json 文件
64 | - **Q:** 只更新部分 key 会怎样?
65 | **A:** 只会覆盖 xlsx 中有的 key,其他 key 保留原值
66 |
67 | ## License
68 |
69 | ISC
70 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/notify.less:
--------------------------------------------------------------------------------
1 | .ant-message {
2 | &-notice {
3 | &-content {
4 | box-shadow: none;
5 | border-radius: 6px;
6 | padding: 0;
7 | overflow: hidden;
8 | }
9 | }
10 |
11 | &-custom-content {
12 | padding: 12px 20px;
13 | line-height: 20px;
14 | display: flex;
15 | align-items: center;
16 |
17 | svg {
18 | display: none;
19 | }
20 |
21 | .anticon {
22 | top: 0;
23 | width: 20px;
24 | height: 20px;
25 | margin-right: 6px;
26 | }
27 | }
28 |
29 | &-info {
30 | background-color: rgba(0, 0, 0, 0.04);
31 | color: rgba(137, 137, 137, 1);
32 |
33 | .anticon {
34 | background: url(./images/icon-info.png) 0 0 no-repeat;
35 | background-size: cover;
36 | }
37 | }
38 |
39 | &-success {
40 | background-color: rgba(0, 191, 117, 0.06);
41 | color: rgba(0, 191, 117, 1);
42 |
43 | .anticon {
44 | background: url(./images/icon-success.png) 0 0 no-repeat;
45 | background-size: cover;
46 | }
47 | }
48 |
49 | &-error {
50 | background-color: rgba(252, 60, 86, 0.06);
51 | color: rgba(252, 60, 86, 1);
52 |
53 | .anticon {
54 | background: url(./images/icon-error.png) 0 0 no-repeat;
55 | background-size: cover;
56 | }
57 | }
58 |
59 | &-warning {
60 | background-color: rgba(255, 153, 0, 0.06);
61 | color: rgba(255, 153, 0, 1);
62 |
63 | .anticon {
64 | background: url(./images/icon-warning.png) 0 0 no-repeat;
65 | background-size: cover;
66 | }
67 | }
68 | }
--------------------------------------------------------------------------------
/src/modules/utils/src/routeActions.js:
--------------------------------------------------------------------------------
1 | import router from 'umi/router';
2 | import { getQuery } from './url';
3 | import { matchPath } from "react-router";
4 |
5 | export default {
6 | refresh: (bool = true) => {
7 | window.location.reload(bool)
8 | },
9 | goBack: (defaultUrl) => {
10 | const length = window.history.length
11 | if (length >= 1) {
12 | router.goBack()
13 | } else {
14 | if (defaultUrl) {
15 | // 如果没有上一页的话,有指定页的话,就会自动跳转到指定的页面
16 | window.location.href = defaultUrl
17 | } else {
18 | router.goBack()
19 | }
20 | }
21 | },
22 | goForward: () => {
23 | router.goForward()
24 | },
25 | gotoRoute: (route) => {
26 | router.push(route);
27 | },
28 | gotoPath: (path, state) => {
29 | router.push({
30 | pathname: path,
31 | ...state,
32 | });
33 | },
34 | gotoHref: (href, ifNewPage = false) => {
35 | if (ifNewPage) {
36 | window.open(href);
37 | } else {
38 | window.location.href = href
39 | }
40 | },
41 | getQuery,
42 | getParams,
43 | // TODO
44 | isActive: () => { },
45 | isMatch: () => { },
46 | }
47 |
48 | function getParams({
49 | key,
50 | pathname, // 当前页面无需传递
51 | route, // 例如 /margin/exchange/:symbol
52 | }) {
53 | pathname = pathname ? pathname : window.location.pathname
54 | const match = matchPath(pathname, {
55 | path: route,
56 | exact: false,
57 | strict: false
58 | });
59 | if (key) {
60 | return match && match.params && match.params[key]
61 | } else {
62 | return match && match.params
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/select.less:
--------------------------------------------------------------------------------
1 | // https: //github.com/ant-design/ant-design/blob/master/components/style/themes/default.less
2 | // theme-config
3 | // @input-height-base: 44px;
4 | .ant-select-dropdown-menu-item {
5 | padding: 0px 12px;
6 | line-height: 1;
7 | min-height: 40px;
8 | .center-v();
9 | }
10 |
11 | .create-antd-select(@brand-primary: ""; @brand-primary-light: ""; ) {
12 | .ant-select-selection {
13 | border: 1px solid @bc-input ;
14 | color: @fc-grey ;
15 | background: @bg-input;
16 |
17 | &:focus,
18 | &:hover {
19 | border-color: @brand-primary !important;
20 | box-shadow: none;
21 | outline: none;
22 | }
23 |
24 | .ant-select-selection__placeholder {
25 | color: @fc-grey-lighter ;
26 | font-size: 12px;
27 | }
28 | }
29 |
30 | .ant-select-dropdown-menu-item-active,
31 | .ant-select-dropdown-menu-item-active:hover {
32 | background: @brand-primary-light !important;
33 |
34 | }
35 |
36 | &:not(body) {
37 | .ant-select-selection {
38 | border: 1px solid @bc-input ;
39 | color: @fc-grey ;
40 | background: @bg-input;
41 |
42 | .status {
43 | display: none;
44 | }
45 |
46 | &:focus,
47 | &:hover {
48 | border-color: @brand-primary !important;
49 | box-shadow: none;
50 | outline: none;
51 | }
52 | }
53 |
54 | .ant-select-selection__placeholder {
55 | color: @fc-grey-lighter !important;
56 | }
57 |
58 | .ant-select-enabled .status {
59 | display: none;
60 | }
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Input/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-input (@Bg1: '';
2 | @Bg5: '';
3 | @T1: '';
4 | @T3: '';
5 | @L1: '';
6 | @F1: '';
7 |
8 | ) {
9 | .iui-input {
10 |
11 | &.ant-input,
12 | .ant-input {
13 | height: 32px;
14 | border: 1px solid @L1;
15 | color: @T1;
16 | background: transparent;
17 | padding: 4px 7px;
18 | font-size: 14px;
19 |
20 | &:hover,
21 | &:focus {
22 | border-color: @F1;
23 | }
24 |
25 | &::placeholder {
26 | color: @T3;
27 | font-size: 14px !important;
28 | }
29 |
30 | &.ant-input-disabled {
31 | background: @Bg5;
32 | color: @T3;
33 | }
34 |
35 | &.ant-input-disabled:hover,
36 | &.ant-input-disabled:focus {
37 | border-color: @L1 !important;
38 | }
39 | }
40 |
41 | .ant-input-group-addon {
42 | border-color: @L1;
43 | background: transparent;
44 | }
45 |
46 | // size - max
47 | &-size-max,
48 | &-size-max .ant-input {
49 | height: 50px;
50 | font-size: 16px;
51 | padding: 4px 12px;
52 |
53 | &::placeholder {
54 | font-size: 16px !important;
55 | }
56 | }
57 |
58 | // size - large
59 | &-size-large,
60 | &-size-large .ant-input {
61 | height: 40px;
62 | padding: 4px 12px;
63 | }
64 |
65 | // size - small
66 | &-size-small,
67 | &-size-small .ant-input {
68 | height: 30px;
69 | font-size: 12px;
70 |
71 | &::placeholder {
72 | font-size: 12px !important;
73 | }
74 | }
75 | }
76 | }
--------------------------------------------------------------------------------
/packages/components/tradingview/README.md:
--------------------------------------------------------------------------------
1 | # @xatom/tradingview
2 |
3 | 基于 TradingView 封装的专业级 K 线图表组件,支持多市场、多主题、持仓/订单线等扩展,适用于 React 项目。
4 |
5 | ## 目录结构
6 |
7 | ```
8 | src/
9 | index.js # 主入口,导出 TradingViewWidget 组件
10 | index.less # 样式文件
11 | ... # 其他辅助模块
12 | ```
13 |
14 | ## 安装
15 |
16 | ```bash
17 | yarn add @xatom/tradingview
18 | # 或
19 | npm install @xatom/tradingview
20 | ```
21 |
22 | ## 使用方法
23 |
24 | ### 1. 引入主组件
25 |
26 | ```js
27 | import TradingViewWidget from '@xatom/tradingview';
28 |
29 |
30 | ```
31 |
32 | ### 2. 主要 props 说明
33 |
34 | - `kline`:K 线相关数据对象,必填
35 | - `url`:K 线数据接口地址,默认 `/market/tradepair/tradeview/kline`
36 | - `theme`:主题配置,支持自定义颜色、线条等
37 | - `maList`:均线列表,如 `[5, 10, 20]`
38 | - `mp`:是否显示 MP 线
39 | - `positions`:持仓数据,支持在图表上绘制持仓线
40 | - `menus`:自定义菜单项
41 | - `storage`:自定义存储对象
42 | - `deps`:依赖的 TradingView 脚本路径
43 | - `tvConfig`:TradingView 原生配置扩展
44 |
45 | ### 3. 示例
46 |
47 | ```js
48 |
56 | ```
57 |
58 | ### 4. 样式覆盖
59 |
60 | 如需自定义样式,可覆盖 `index.less`。
61 |
62 | ## 注意事项
63 |
64 | - 需确保页面已引入 TradingView 相关依赖脚本(如 charting_library.standalone.js、datafeed.js)。
65 | - 组件 props 支持高度自定义,建议结合实际业务需求传递。
66 | - 需在全局引入 antd 相关样式。
67 | - 组件依赖 `@xatom/intl`、`@xatom/flex`、`@xatom/typo`、`@xatom/utils` 等基础包。
68 |
69 | ## License
70 |
71 | ISC
--------------------------------------------------------------------------------
/packages/components/iui/src/Modal/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-modal(@Bg4: '';
2 | @L1: '';
3 | @T1: '';
4 | @T2: '';
5 |
6 | ) {
7 | .iui-modal {
8 | .ant-modal {
9 | padding-bottom: 0;
10 | border-radius: 12px;
11 | background: @Bg4 !important;
12 | border: 1px solid @L1;
13 | box-shadow: none;
14 | box-sizing: content-box;
15 |
16 | &-content {
17 | border-radius: 0;
18 | background: transparent !important;
19 | border: none;
20 | padding: 24px;
21 | max-height: calc(100vh - 48px);
22 | box-shadow: none;
23 | }
24 |
25 | &-body {
26 | display: flex;
27 | flex-direction: column;
28 | padding: 0 !important;
29 | background: transparent !important;
30 | max-height: calc(100vh - 96px);
31 | }
32 |
33 | &-close {
34 | top: 24px;
35 | right: 24px;
36 |
37 | &-x {
38 | width: 24px;
39 | height: 24px;
40 | line-height: 24px;
41 | }
42 | }
43 | }
44 |
45 | &-close {
46 | font-size: 24px !important;
47 | color: @T2;
48 |
49 | &:hover {
50 | color: @T1;
51 | }
52 | }
53 |
54 | &-body {
55 | flex: 1;
56 | min-height: 24px;
57 | // margin: 0 -24px;
58 | // padding: 0 16px 0 24px;
59 | }
60 |
61 | &-scrollbar-auto {
62 | overflow: auto;
63 | }
64 |
65 | &-scrollbar-scroll {
66 | overflow-x: hidden;
67 | overflow-y: scroll;
68 | margin: 0 -24px;
69 | padding: 0 16px 0 24px;
70 | }
71 | }
72 | }
--------------------------------------------------------------------------------
/src/modules/utils/README.md:
--------------------------------------------------------------------------------
1 | # @utils 模块使用说明
2 |
3 | ## 简介
4 |
5 | `@utils` 模块为前端项目提供丰富的通用工具函数,涵盖对象、数组、字符串、数字、时间、环境、存储、网络、加密、类型判断、浏览器等常用场景,极大提升开发效率。
6 |
7 | ---
8 |
9 | ## 主要功能
10 |
11 | - 对象、数组、字符串等数据结构处理
12 | - 数字、时间、千分位、精度等格式化
13 | - 本地存储、cookie、环境变量、路由等操作
14 | - 网络请求、加密解密、类型判断、校验等
15 | - 浏览器、用户代理、iframe、图片等工具
16 | - 兼容 Umi、Dva 等主流前端框架
17 |
18 | ---
19 |
20 | ## API 说明
21 |
22 | ### 1. 常用工具
23 | - `toSeprator(num)`:数字千分位格式化。
24 | - `getNumPrecisionLength(num)`:获取小数位数。
25 | - `getValueByPath(obj, path, defaultValue)`:按路径安全获取对象属性。
26 | - `setValue(obj, path, value)`:按路径安全设置对象属性。
27 | - `removeEmptyValues(obj)`:移除对象中的空值属性。
28 |
29 | ### 2. 目录结构与分类
30 | - `object.js`:对象相关工具
31 | - `array.js`:数组相关工具
32 | - `number.js`:数字相关工具
33 | - `time.js`:时间相关工具
34 | - `env.js`:环境变量与判断
35 | - `http.js`:网络请求封装
36 | - `crypto.js`:加密解密工具
37 | - `storage.js`:本地存储
38 | - `cookie.js`:Cookie 操作
39 | - `routeActions.js`:路由操作
40 | - `useragent.js`:用户代理判断
41 | - `browser.js`:浏览器相关
42 | - `types.js`:类型判断
43 | - `validator.js`:常用校验
44 | - `file.js`:文件处理
45 | - `image.js`:图片处理
46 | - `mock.js`:Mock 工具
47 | - `perf.js`:性能工具
48 | - `umi.js`、`dva.js`:框架兼容
49 |
50 | ---
51 |
52 | ## 使用示例
53 |
54 | ### 1. 千分位格式化
55 | ```js
56 | import { toSeprator } from '@utils'
57 | toSeprator(1234567.89) // "1,234,567.89"
58 | ```
59 |
60 | ### 2. 按路径获取对象属性
61 | ```js
62 | import { getValueByPath } from '@utils/object'
63 | const value = getValueByPath(obj, 'a.b.c', '默认值')
64 | ```
65 |
66 | ### 3. 网络请求
67 | ```js
68 | import request from '@utils/http'
69 | request('/api/user', { method: 'get' })
70 | ```
71 |
72 | ---
73 |
74 | ## 依赖
75 | - uuid
76 |
77 | ---
78 |
79 | 如需更多帮助,请查阅源码或联系维护者。
--------------------------------------------------------------------------------
/packages/components/iui/src/Scrollbar/index.less:
--------------------------------------------------------------------------------
1 | /**
2 | * 默认大小 .iui-scrollbar-default
3 | * 最大尺寸 .iui-scrollbar-large
4 | */
5 | .create-iui-scrollbar(
6 | @T1: '';
7 | ) {
8 | .iui-scrollbar {
9 | &::-webkit-scrollbar-corner {
10 | background-color: transparent !important;
11 | }
12 |
13 | &-default {
14 | &::-webkit-scrollbar {
15 | background-color: transparent;
16 | width: 8px;
17 | height: 8px;
18 | }
19 |
20 | &::-webkit-scrollbar-thumb {
21 | background-clip: padding-box;
22 | background-color: fade(@T1, 10%) !important;
23 | border: 2px solid transparent;
24 | border-radius: 8px;
25 |
26 | &:active,
27 | &:hover {
28 | background-color: fade(@T1, 40%) !important;
29 | cursor: default !important;
30 | }
31 | }
32 | }
33 |
34 | &-large {
35 | &::-webkit-scrollbar {
36 | background-color: transparent;
37 | width: 16px;
38 | height: 16px;
39 | }
40 |
41 | &::-webkit-scrollbar-thumb {
42 | background-clip: padding-box;
43 | background-color: fade(@T1, 10%) !important;
44 | border: 4px solid transparent;
45 | border-radius: 16px;
46 |
47 | &:active,
48 | &:hover {
49 | background-color: fade(@T1, 40%) !important;
50 | cursor: default !important;
51 | }
52 | }
53 |
54 | &::-webkit-scrollbar-corner {
55 | background-color: transparent !important;
56 | }
57 | }
58 |
59 | &-none {
60 | &::-webkit-scrollbar {
61 | display: none;
62 | }
63 | }
64 | }
65 | }
--------------------------------------------------------------------------------
/src/modules/storages/README.md:
--------------------------------------------------------------------------------
1 | # @storages 模块使用说明
2 |
3 | ## 简介
4 |
5 | `@storages` 模块用于统一管理本地存储(localStorage)数据,支持全局存储、作用域存储、模块化注册、版本校验等,适合多业务线、复杂前端项目的数据持久化需求。
6 |
7 | ---
8 |
9 | ## 主要功能
10 |
11 | - 全局存储与作用域存储的统一管理
12 | - 支持多模块注册与命名空间隔离
13 | - 存储数据的版本校验与自动升级
14 | - 支持通过路径(path)读写嵌套数据
15 | - 提供模块化扩展能力
16 |
17 | ---
18 |
19 | ## API 说明
20 |
21 | ### 1. 类与实例
22 | - `CacheModule`:基础存储模块抽象类。
23 | - `StorageModule`:本地存储基础实现。
24 | - `GlobalStorageModule`:全局存储实现,支持 path 读写。
25 | - `ScopedStorageModule`:作用域存储实现,支持命名空间隔离、版本校验。
26 | - `CacheData`:多模块统一管理器,支持注册、获取、设置、版本校验等。
27 | - `cacheData`:默认导出实例,直接使用。
28 |
29 | ### 2. 主要方法
30 | - `cacheData.init(options, config)`:初始化模块与配置。
31 | - `cacheData.get(path, defaultValue)`:通过路径获取数据。
32 | - `cacheData.set(path, value)`:通过路径设置数据。
33 | - `cacheData.register({ name, Module, isDefault, scoped })`:注册自定义存储模块。
34 |
35 | ### 3. 工具方法
36 | - `createStorageRequirement(project)`:生成 storages 初始化依赖(适用于全局初始化流程)。
37 |
38 | ---
39 |
40 | ## 使用示例
41 |
42 | ### 1. 获取和设置全局存储
43 | ```js
44 | import storages from '@storages'
45 | storages.set('user.token', 'xxx')
46 | const token = storages.get('user.token')
47 | ```
48 |
49 | ### 2. 注册自定义模块
50 | ```js
51 | import storages, { ScopedStorageModule } from '@storages'
52 | storages.register({ name: 'custom', Module: ScopedStorageModule, scoped: true })
53 | storages.set('custom.someKey', 'value')
54 | ```
55 |
56 | ### 3. 版本校验与自动升级
57 | ```js
58 | import storages from '@storages'
59 | // 初始化时传入 storages 配置,自动校验版本
60 | storages.init({}, { preferences: { version: '1.0.1', data: { ... } } })
61 | ```
62 |
63 | ---
64 |
65 | ## 依赖
66 | - localStorage
67 | - @xatom/utils
68 |
69 | ---
70 |
71 | 如需更多帮助,请查阅源码或联系维护者。
--------------------------------------------------------------------------------
/packages/components/ui/src/NotFound/index.less:
--------------------------------------------------------------------------------
1 | .ui-router-404 {
2 | margin: auto;
3 | text-align: center;
4 | background: #fff;
5 | height: calc(100vh - 64px);
6 | &-icon {
7 | width: 240px;
8 | height: 232px;
9 | margin-bottom: 20px;
10 | margin-top: 100px;
11 | }
12 |
13 | &-text {
14 | font-size: 36px;
15 | font-weight: 700;
16 | line-height: 30px;
17 | text-align: center;
18 | color: rgba(0, 0, 0, 1);
19 |
20 | }
21 |
22 | &-desc {
23 | font-size: 16px;
24 | font-weight: 400;
25 | line-height: 26px;
26 | color: rgba(112, 122, 138, 1);
27 | max-width: 486px;
28 | padding-top: 26px;
29 | padding-bottom: 56px;
30 | margin: auto;
31 | }
32 |
33 | &-btn {
34 | box-shadow: 0px 16px 18px 0px rgba(0, 0, 0, 0.08);
35 | background: rgba(49, 105, 255, 1);
36 | border-radius: 8px;
37 | font-size: 16px;
38 | font-weight: 400;
39 | text-align: center;
40 | color: rgba(255, 255, 255, 1);
41 | margin: auto;
42 | cursor: pointer;
43 | padding: 20px 50px;
44 | }
45 |
46 | &-btn:hover {
47 | color: rgba(255, 255, 255, 1);
48 | }
49 | }
50 |
51 | @media screen and (max-width: 1200px) {
52 | .ui-router-404 {
53 | width: 100%;
54 | text-align: center;
55 | }
56 | }
57 |
58 | @media screen and (max-width: 768px) {
59 | .ui-router-404 {
60 | width: 100%;
61 | text-align: center;
62 | padding: 0 20px;
63 |
64 | &-icon {
65 | margin-bottom: 0;
66 | margin-top: 80px;
67 | }
68 |
69 | &-text {
70 | font-size: 25px;
71 | }
72 |
73 | &-desc {
74 | font-size: 14px;
75 | padding-top: 12px;
76 | padding-bottom: 45px;
77 | }
78 |
79 | }
80 | }
--------------------------------------------------------------------------------
/packages/components/ui/src/Select/index.less:
--------------------------------------------------------------------------------
1 | .ui-select {
2 | width: 180px;
3 |
4 | &.ant-select-sm {
5 | height: 40px;
6 | .ant-select-selection__rendered {
7 | line-height: 40px;
8 | }
9 | }
10 |
11 | &.ant-select-lg {
12 | height: 48px;
13 | .ant-select-selection__rendered {
14 | line-height: 48px;
15 | }
16 | }
17 |
18 |
19 |
20 | .ant-select-selection {
21 | height: 100%;
22 | color: #000;
23 | border-color: rgba(0, 0, 0, 0.08);
24 | border-radius: 6px;
25 | box-shadow: none;
26 | }
27 |
28 | .ant-select-arrow {
29 | right: 12px;
30 | margin-top: -10px;
31 | transition: all 300ms;
32 | }
33 |
34 | .ant-select-dropdown-menu {
35 | padding: 0;
36 | }
37 |
38 | &.ant-select-open .ant-select-arrow {
39 | transform: rotate(180deg);
40 | }
41 | }
42 |
43 | .ui-select-dropdown {
44 | overflow: hidden;
45 | border-radius: 6px;
46 |
47 | .ant-select-dropdown-menu {
48 | padding: 0;
49 | }
50 |
51 | .ant-select-dropdown-menu-item {
52 | color: #000;
53 | }
54 |
55 | .ant-select-dropdown-menu-item-selected,
56 | .ant-select-dropdown-menu-item-active,
57 | .ant-select-dropdown-menu-item-active:hover {
58 | font-weight: 400 !important;
59 | background: rgba(246, 246, 246, 1) !important;
60 | }
61 | }
62 |
63 | .ui-select-empty {
64 | padding: 10px 0;
65 | width: 100%;
66 | text-align: center;
67 |
68 | &-icon {
69 | width: 68px;
70 | height: 68px;
71 | margin: 0 auto 10px;
72 | background: url(./images/icon-empty.png) 0 0 no-repeat;
73 | background-size: cover;
74 | }
75 |
76 | &-text {
77 | color: #c1c1c1;
78 | font-size: 14px;
79 | line-height: 17px;
80 | }
81 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/slider.less:
--------------------------------------------------------------------------------
1 | .ant-slider {
2 | .ant-slider-rail {
3 | height: 2px !important;
4 | }
5 |
6 | .ant-slider-track {
7 | height: 2px !important;
8 | }
9 |
10 | .ant-slider-step {
11 | top: 3px !important;
12 | }
13 |
14 | .ant-slider-mark {
15 | top: 18px !important;
16 | }
17 | }
18 |
19 | .slider-type(@type: ~''; @color: ''; ) {
20 | .ant-slider.ant-slider-@{type} {
21 | .ant-slider-track {
22 | background: @color !important;
23 | }
24 |
25 | .ant-slider-dot-active {
26 | border-color: @color !important;
27 | // background: @color !important;
28 | }
29 |
30 | .ant-slider-handle {
31 | border-color: @color !important;
32 | // background: @color !important;
33 |
34 | &:focus {
35 | box-shadow: 0 0 0 5px fade(@color, 20);
36 | }
37 | }
38 | }
39 | }
40 |
41 | .create-antd-slider(@brand-primary: ''; ) {
42 | @dot-border: @bc-input;
43 | @dot-bg: @bg-card;
44 | .slider-type(@type: ~'up'; @color: @brand-up; );
45 | .slider-type(@type: ~'down'; @color: @brand-down; );
46 | .slider-type(@type: ~'primary'; @color: @brand-primary; );
47 |
48 | .ant-slider {
49 | .ant-slider-rail {
50 | background: @dot-border ;
51 | }
52 |
53 | &:hover {
54 | .ant-slider-rail {
55 | background: @dot-border ;
56 | }
57 | }
58 |
59 | .ant-slider-handle {
60 | background: @dot-bg !important;
61 | }
62 |
63 | .ant-slider-dot {
64 | border-color: @dot-border !important;
65 | background: @dot-bg !important;
66 | }
67 |
68 | .ant-slider-mark-text {
69 | color: @fc-grey;
70 | font-size: 12px !important;
71 | }
72 | }
73 | }
--------------------------------------------------------------------------------
/src/modules/langs/README.md:
--------------------------------------------------------------------------------
1 | # @langs 模块使用说明
2 |
3 | ## 简介
4 |
5 | `@langs` 模块用于多语言(国际化)管理,支持语言格式化、切换、获取支持语言列表、与 umi/locale 及后端语言映射等,适用于多语言前端项目。
6 |
7 | ---
8 |
9 | ## 主要功能
10 |
11 | - 获取/设置当前语言
12 | - 语言格式化与映射(前端、后端、三方组件等)
13 | - 获取支持的语言列表
14 | - 初始化页面多语言环境
15 | - 语言切换与校验
16 | - 提供多语言相关 API(如 changeLanguage、getLangList)
17 |
18 | ---
19 |
20 | ## API 说明
21 |
22 | ### 工具函数(`utils.js`)
23 | - `getLang()`:获取当前语言(如 'en_US')。
24 | - `setLang(lang)`:设置当前语言。
25 | - `formatLang(lang)`:格式化语言标识。
26 | - `getLangs()`:获取支持的语言列表。
27 | - `getServerLang()`:获取后端所需语言标识。
28 | - `getTradingViewLang()`:获取 TradingView 组件所需语言。
29 | - `getUmiLocale(lang)`:获取 umi/locale 所需语言。
30 | - `getZendeskLang(lang)`:获取 Zendesk 文档语言。
31 | - `getZELang()`:获取 Zendesk 客服语言。
32 | - `getValidLangs()`:获取当前有效语言列表。
33 | - `setValidLangs(langMap)`:设置有效语言列表。
34 | - `isFaLang()`:判断是否为波斯语。
35 |
36 | ### 页面初始化(`pageInit.js`)
37 | - `init()`:初始化页面多语言环境(自动识别 URL、storage、配置等)。
38 | - `handleSimulatorLang(lang, langMap)`:多项目下的语言筛选。
39 |
40 | ### API 方法(`apis.js`)
41 | - `changeLanguage({ query: { lang } })`:调用后端接口切换语言。
42 | - `getLangList()`:获取后端支持的语言列表。
43 |
44 | ---
45 |
46 | ## 使用示例
47 |
48 | ### 1. 获取和设置当前语言
49 | ```js
50 | import { getLang, setLang } from '@langs'
51 | const lang = getLang()
52 | setLang('ja_JP')
53 | ```
54 |
55 | ### 2. 页面多语言初始化
56 | ```js
57 | import init from '@langs'
58 | init()
59 | ```
60 |
61 | ### 3. 获取支持的语言列表
62 | ```js
63 | import { getLangs } from '@langs'
64 | const langs = getLangs()
65 | ```
66 |
67 | ### 4. 调用后端切换语言
68 | ```js
69 | import { apis } from '@langs'
70 | apis.changeLanguage({ query: { lang: 'en_US' } })
71 | ```
72 |
73 | ---
74 |
75 | ## 依赖
76 | - @xatom/utils
77 | - @xatom/modules/config
78 | - umi/locale
79 |
80 | ---
81 |
82 | 如需更多帮助,请查阅源码或联系维护者。
--------------------------------------------------------------------------------
/packages/components/ui/src/Slider/index.js:
--------------------------------------------------------------------------------
1 | import { Slider } from 'antd'
2 | import './index.less'
3 |
4 | // 两段滑动条,例如:0~N, N~Max
5 | export function TwoStageSlider(props) {
6 | const { theme = 'drak', className = '', stagePercent = 20, maxPercent = 500, value = 0, onChange = () => { }, ...rest } = props
7 | const maxValue = (maxPercent - stagePercent) / ((100 - stagePercent) / 100)
8 | const stageValue = stagePercent / 100 * maxValue
9 | const stageBeforeValue = value / 100 * maxValue
10 | const stageAfterValue = stageValue + (value - stagePercent)
11 | const currentValue = value > stagePercent ? stageAfterValue : stageBeforeValue
12 | const marks = {
13 | 0: '0%',
14 | [stageValue]: `${stagePercent}%`,
15 | [maxValue]: `${maxPercent}%`
16 | }
17 |
18 | const getSliderPercent = val => {
19 | const spilt = maxValue * stagePercent / 100
20 | if (val >= spilt) {
21 | return (val - spilt) + stagePercent
22 | }
23 | return Number(val / (spilt / stagePercent)).toFixed()
24 | }
25 |
26 | return
27 | onChange(getSliderPercent(val))}
30 | marks={marks}
31 | value={currentValue}
32 | max={maxValue}
33 | tooltipPlacement="top"
34 | tipFormatter={val => getSliderPercent(val) + '%'}
35 | {...rest}
36 | >
37 |
38 |
39 | }
40 |
41 | // 默认滑动条,仅修改样式
42 | export default function (props) {
43 | const { theme = 'drak', className = '', ...rest } = props
44 | return
45 | `${val}%`} {...rest}>
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/packages/components/iui/src/Navbar/child/CommonMenu/index.less:
--------------------------------------------------------------------------------
1 | .create-iui-navbar-common-menu(
2 | @T1: '';
3 | @L1: '';
4 | @C2: '';
5 | ) {
6 | .iui-nabvar-common-menu {
7 | position: relative;
8 |
9 | &:not(:last-child)::after {
10 | content: '';
11 | position: absolute;
12 | left: 24px;
13 | right: 24px;
14 | bottom: 0;
15 | height: 1px;
16 | background: @L1;
17 | }
18 |
19 | &-item {
20 | &-title {
21 | display: block;
22 | display: flex;
23 | padding: 16px 24px;
24 | justify-content: space-between;
25 | align-items: center;
26 | cursor: pointer;
27 |
28 | &:hover {
29 | background: @C2;
30 | color: @T1;
31 | }
32 |
33 | &-label,
34 | &-label:hover,
35 | &-expand {
36 | color: @T1;
37 | }
38 |
39 | &-label {
40 | flex: 1;
41 | font-size: 14px;
42 | font-weight: 500;
43 | line-height: 24px;
44 | }
45 |
46 | &-expand {
47 | font-size: 24px !important;
48 | transition: all 300ms;
49 | }
50 | }
51 |
52 | &-submenu {
53 | display: none;
54 |
55 | &-item {
56 | display: flex;
57 | align-items: center;
58 | line-height: 20px;
59 | padding: 13px 40px;
60 | color: @T1;
61 |
62 | &:hover {
63 | background: @C2;
64 | color: @T1;
65 | }
66 | }
67 | }
68 |
69 | &.is-active .iui-nabvar-common-menu-item-title-expand {
70 | transform: rotate(180deg);
71 | }
72 |
73 | &.is-active .iui-nabvar-common-menu-item-submenu {
74 | display: block;
75 | }
76 | }
77 | }
78 | }
--------------------------------------------------------------------------------
/src/modules/auth/src/apis.js:
--------------------------------------------------------------------------------
1 | import { getHost, isLocal } from '@xatom/utils/src/env'
2 | import request from '@xatom/utils/src/http'
3 | import * as auth from './utils'
4 |
5 | export const refreshToken = (payload={}) => {
6 | // 如果pending,就不是首次,拦截不发生refresh
7 | if (window.refresh_status === 'pending') {
8 | return null
9 | } else {
10 | // 首次请求发送refresh,并设置pending,以拦截后续的refresh
11 | window.refresh_status = 'pending'
12 | }
13 | const url = getHost('config') + '/user/refresh_token'
14 | const options = {
15 | method: 'post',
16 | requestType: 'jsonstring',
17 | responseType: 'jsonstring'
18 | }
19 | return request(url, options).then(res => {
20 | if (res && res.code === 200) {
21 | auth.setUser(res.data)
22 | // 如果请求成功,就标记成功
23 | payload && payload.onSuccess && payload.onSuccess()
24 | window.refresh_status = 'success'
25 | } else if (res && res.code === 10001) {
26 | if (!isLocal()) { }// 本地 local 开发环境的时候,不跳转去登录,
27 | auth.tokenInvalidHandle()
28 | payload && payload.onError && payload.onError()
29 | } else {
30 | window.refresh_status = 'success'
31 | }
32 | })
33 | }
34 | export function refreshUser() {
35 | const url = getHost('config') + '/user/userInfo'
36 | const options = {
37 | method: 'get',
38 | }
39 | return request(url, options).then(res => {
40 | if (res && res.code === 200) {
41 | auth.setUser(res.data)
42 | }
43 | })
44 | }
45 |
46 | export function getkyc(userKyc) {
47 | const url = getHost('config') + '/kyc/getkyc'
48 | const options = {
49 | method: 'get',
50 | }
51 | request(url, options).then(res => {
52 | if (res && res.code === 200) {
53 | auth.setUser({kycStatus: res.data.status || -1})
54 | }
55 | })
56 | }
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/table/src/TimeRange.js:
--------------------------------------------------------------------------------
1 | import $t from '@xatom/intl'
2 | import { DatePicker, ConfigProvider } from 'antd'
3 | import { getTs, parseTs } from '@xatom/utils/src/time'
4 | import moment from 'moment'
5 | import locale from 'antd/lib/date-picker/locale/en_US'
6 | import { isFaLang } from '@xatom/langs'
7 |
8 | const { RangePicker } = DatePicker
9 | export default function TimeRange(props) {
10 | const { value = [], onChange, ...rest } = props
11 | const dateValue = value[0] && value[1] && [
12 | parseTs({ value: value[0], format: 'moment' }),
13 | parseTs({ value: value[1], format: 'moment' }),
14 | ]
15 | function handleChange(value) {
16 | const beginTime = getTs({ value: value[0], format: "moment" })
17 | const endTime = getTs({ value: value[1], format: "moment" })
18 | onChange && onChange([beginTime, endTime])
19 | }
20 | //波斯语下 时间区间组件默认英文(fix:波斯语语言下时间选择为NaN)
21 | if (isFaLang()) {
22 | return
23 | } else {
24 | return
25 | }
26 | }
27 |
28 | function getDisableDate(date) {
29 | // 小于3个月之前 和 大于今天的时间,都不可选
30 | return date < moment().subtract(3, 'months').startOf('day') || date > moment().endOf('day')
31 | }
32 | // 注意
33 | // 获得今天的0分0秒(返回moment对象): moment().startOf('day')
34 | // 获得今天的0分0秒(返回unix字符串,毫秒): moment().startOf('day').format('x')
35 | // 获得今天的0分0秒(返回unix字符串,秒): moment().startOf('day').format('X')
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/antd/src/NumberInput.js:
--------------------------------------------------------------------------------
1 | import Input from './Input'
2 |
3 | export default function NumberInput(props) {
4 | const { value, onChange = () => { }, isInt = false, min, max, decimal, precision, className, ...rest } = props
5 | const handleChange = (value) => {
6 | // 替换非数字有效字符
7 | value = String(value).replace(/[^\d.]+/g, '')
8 | const sValue = value.split('.')
9 | const integerValue = sValue[0]
10 | const floatValue = sValue[1] || ''
11 | let isValid = true
12 | if(value === '.'){ //不允许只输入 "." //不允许只输入 空格
13 | value = ''
14 | }
15 | // 过滤掉前面无效的0
16 | if (value && /^(0+[1-9])|^(0{2,})/.test(value)) {
17 | value = value.replace(/\b(0+)/gi, '') || '0'
18 | if (value.startsWith('.')) {
19 | value = `0${value}`
20 | }
21 | }
22 | if (isNaN(value)) {
23 | isValid = false
24 | }
25 | if (isInt) {
26 | value = (value === null || value === '' || value === '-') ? value : parseInt(value) // 允许为null 和空字符串 (允许清空整个input)
27 | }
28 | if (min && !isNaN(min) && Number(value) < Number(min)) {
29 | isValid = false
30 | }
31 | if (max && !isNaN(max) && Number(value) > Number(max)) {
32 | isValid = false
33 | }
34 | if ((decimal || Number(decimal) === 0) && value) {
35 | if (floatValue.length > decimal) {
36 | isValid = false
37 | }
38 | }
39 | // 当以复制方式粘贴超过最大精度要求时
40 | if (precision >= 0 && floatValue.length > precision) {
41 | // 直接舍去多余小数位
42 | value = `${integerValue}.${floatValue.slice(0, precision)}`
43 | }
44 | isValid && onChange(value)
45 | }
46 | return (
47 | handleChange(value)}
50 | {...rest}
51 | />
52 | )
53 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/list/src/SimplePagination.js:
--------------------------------------------------------------------------------
1 | import { Text } from '@xatom/typo'
2 | import { Cols } from '@xatom/flex'
3 | import { Icon } from '@xatom/antd'
4 | import { listActions } from '@xatom/lists'
5 |
6 | export default function SimplePagination(props) {
7 | const { page = {}, disabled, total = 0, id } = props
8 | const current = Number(page.current || 1)
9 | const next = () => listActions.pageChange({ id, page: { current: current + 1 } })
10 | const prev = () => listActions.pageChange({ id, page: { current: current - 1 } })
11 | const back = () => listActions.pageChange({ id, page: { current: 1 } })
12 | const jump = (page) => listActions.pageChange({ id, page: { current: page } })
13 | return ((total === Number(page.size) || current > 1) &&
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | {current}
23 |
24 |
25 |
26 |
27 |
28 | )
29 | }
30 |
31 | function PageItem(props) {
32 | let { children, className = '', disabled, style, active, onClick, ...rest } = props
33 | className = `pagination-item ${className}`
34 | if (disabled) {
35 | className += ` disabled`
36 | onClick = null
37 | }
38 | if (active) className += ` active`
39 | return {children}
40 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/flex/flex.less:
--------------------------------------------------------------------------------
1 | .center-hv,
2 | .center-vh {
3 | &:extend(.d-flex, .align-items-center, .justify-content-center);
4 | }
5 |
6 | .center-v {
7 | &:extend(.d-flex, .align-items-center);
8 | }
9 |
10 | .center-h {
11 | &:extend(.d-flex, .justify-content-center);
12 | }
13 |
14 | .box-flex {
15 | display: flex !important;
16 | position: relative;
17 | }
18 |
19 | .box-fluid {
20 | -ms-flex-preferred-size: 0;
21 | flex-basis: 0;
22 | -webkit-box-flex: 1;
23 | -ms-flex-positive: 1;
24 | flex-grow: 1;
25 | max-width: 100%;
26 | max-height: 100%;
27 | // overflow: auto;
28 | }
29 |
30 | .box-auto {
31 | -webkit-box-flex: 0;
32 | -ms-flex: 0 0 auto;
33 | flex: 0 0 auto;
34 | width: auto;
35 | max-width: none;
36 | max-height: none;
37 | }
38 |
39 | // fuild with & height
40 | .d-flex {
41 | position: relative;
42 |
43 | & > .box-fluid {
44 | width: 0; // fix 高度溢出的问题
45 | }
46 |
47 | &.flex-column {
48 | & > .box-fluid {
49 | width: auto;
50 | height: 0;
51 | }
52 | }
53 | }
54 |
55 | // fuild with & height
56 | .cols-fluid {
57 | .box-fluid;
58 | width: 0;
59 | }
60 |
61 | .stacks-fluid {
62 | .box-fluid;
63 | height: 0;
64 | }
65 |
66 | // fuild with & height
67 | .equal-cols {
68 | & > * {
69 | .box-fluid;
70 | // width: 0;
71 | }
72 | }
73 |
74 | .box-flex-h {
75 | &:extend(.box-flex);
76 | -webkit-box-orient: horizontal !important;
77 | -webkit-box-direction: normal !important;
78 | -ms-flex-direction: row !important;
79 | flex-direction: row !important;
80 | }
81 |
82 | .box-flex-v {
83 | &:extend(.box-flex);
84 | -webkit-box-orient: vertical !important;
85 | -webkit-box-direction: normal !important;
86 | -ms-flex-direction: column !important;
87 | flex-direction: column !important;
88 | }
89 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/table/src/SimplePagination.js:
--------------------------------------------------------------------------------
1 | import { Text } from '@xatom/typo'
2 | import { Cols } from '@xatom/flex'
3 | import { Icon } from '@xatom/antd'
4 | import { listActions } from '@xatom/lists'
5 |
6 | export default function SimplePagination(props) {
7 | const { page = {}, disabled, total = 0, id } = props
8 | const current = Number(page.current || 1)
9 | const next = () => listActions.pageChange({ id, page: { current: current + 1 } })
10 | const prev = () => listActions.pageChange({ id, page: { current: current - 1 } })
11 | const back = () => listActions.pageChange({ id, page: { current: 1 } })
12 | const jump = (page) => listActions.pageChange({ id, page: { current: page } })
13 | return ((total === Number(page.size) || current > 1) &&
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | {current}
23 |
24 |
25 |
26 |
27 |
28 | )
29 | }
30 |
31 | function PageItem(props) {
32 | let { children, className = '', disabled, style, active, onClick, ...rest } = props
33 | className = `pagination-item ${className}`
34 | if (disabled) {
35 | className += ` disabled`
36 | onClick = null
37 | }
38 | if (active) className += ` active`
39 | return {children}
40 | }
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/modal.less:
--------------------------------------------------------------------------------
1 | .ant-modal {
2 | max-width: 100% !important;
3 | width: 460px; // @modal-width: 460px;
4 | }
5 |
6 | .box-modal {
7 | padding: 30px;
8 | width: 100%;
9 | }
10 |
11 | .create-antd-modal() {
12 | .box-modal {
13 | background-color: @bg-modal;
14 | }
15 |
16 | &:not(body) {
17 |
18 | &.box-modal,
19 | .box-modal {
20 | background: @bg-modal !important;
21 | }
22 | }
23 | }
24 |
25 | // 强制要求 Modal的样式单独实现,不依赖系统的设置
26 | .ant-modal {
27 | background: transparent !important;
28 |
29 | .ant-modal-content {
30 | background: transparent !important;
31 | border-radius: 16px;
32 | }
33 |
34 | .ant-modal-body {
35 | padding: 0px !important;
36 | background: transparent !important;
37 | }
38 | }
39 |
40 | //========================================
41 | // Model Confirm
42 | //========================================
43 |
44 | .ant-modal-confirm {
45 | .ant-modal-content {
46 | background: #fff !important;
47 | }
48 |
49 | .ant-modal-close {
50 | display: block;
51 |
52 | svg {
53 | color: #c0c5d2;
54 | }
55 | }
56 |
57 | .ant-modal-body {
58 | padding: 30px !important;
59 |
60 | .anticon {
61 | display: none !important;
62 | }
63 | }
64 |
65 | .ant-modal-confirm-body-wrapper {
66 | text-align: center !important;
67 | }
68 |
69 | .ant-modal-confirm-title {
70 | font-size: 20px !important;
71 | }
72 |
73 | .ant-modal-confirm-content {
74 | margin-left: 0 !important;
75 | }
76 |
77 | .ant-modal-confirm-btns {
78 | display: flex;
79 | float: none !important;
80 | margin-top: 30px !important;
81 |
82 | .ant-btn {
83 | flex: 1;
84 | }
85 |
86 | button+button {
87 | margin-left: 20px !important;
88 | }
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/packages/components/uikits/src/style/src/antd/button.less:
--------------------------------------------------------------------------------
1 | .typo-button-transparent {
2 | background: transparent !important;
3 | border-color: transparent !important;
4 | box-shadow: none !important;
5 | text-shadow: none !important;
6 | }
7 |
8 |
9 | .ant-btn-group {
10 | &:extend(.d-flex);
11 |
12 | .ant-btn {
13 | &:extend(.box-fluid);
14 | }
15 | }
16 |
17 | .button-type(@type: 1; @bg-color: ''; @fc-color: ~'#fff'; @border-color: transparent; @br: ''; ) {
18 | .typo-button-@{type} {
19 | background: @bg-color !important;
20 | border: 1px solid @border-color !important;
21 | box-shadow: none !important;
22 | text-shadow: none !important;
23 | color: @fc-color !important;
24 | border-radius: @br;
25 |
26 | &:hover {
27 | background: lighten(@bg-color, 5%) !important;
28 | }
29 |
30 | &:active {
31 | box-shadow: inset -2px -2px 1px rgba(0, 0, 0, 0.15) !important;
32 | background: darken(@bg-color, 5%) !important;
33 | }
34 |
35 | &.typo-button-disabled {
36 | // border: fade(@border-color, 65%) !important;
37 | // background: fade(@bg-color, 65%) !important;
38 | // color: fade(@fc-color, 40%) !important;
39 | opacity: 0.5;
40 | }
41 |
42 | &.ant-btn-background-ghost {
43 | background: transparent !important;
44 | border-color: @bg-color !important;
45 | color: @bg-color !important;
46 |
47 | &.typo-button-disabled {
48 | color: @bg-color !important;
49 | opacity: 0.5;
50 | }
51 | }
52 |
53 | &.typo-button-outline {
54 | background: transparent !important;
55 | border-color: @bg-color !important;
56 | color: @bg-color !important;
57 |
58 | &.typo-button-disabled {
59 | color: @bg-color !important;
60 | opacity: 0.5;
61 | }
62 | }
63 | }
64 | }
--------------------------------------------------------------------------------
/packages/components/iui/src/SimplePagination/index.js:
--------------------------------------------------------------------------------
1 | import { Text } from '@xatom/typo'
2 | import { Cols } from '@xatom/flex'
3 | import { Icon } from '@xatom/antd'
4 | import { listActions } from '@xatom/lists'
5 | import './index.less'
6 |
7 | export default function SimplePagination(props) {
8 | const { page = {}, disabled, total = 0, id } = props
9 | const current = Number(page.current || 1)
10 | const next = () => listActions.pageChange({ id, page: { current: current + 1 } })
11 | const prev = () => listActions.pageChange({ id, page: { current: current - 1 } })
12 | const back = () => listActions.pageChange({ id, page: { current: 1 } })
13 | const jump = (page) => listActions.pageChange({ id, page: { current: page } })
14 | return ((total === Number(page.size) || current > 1) &&
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | {current}
24 |
25 |
26 |
27 |
28 |
29 | )
30 | }
31 |
32 | function PageItem(props) {
33 | let { children, className = '', disabled, style, active, onClick, ...rest } = props
34 | className = `pagination-item ${className}`
35 | if (disabled) {
36 | className += ` disabled`
37 | onClick = null
38 | }
39 | if (active) className += ` active`
40 | return {children}
41 | }
--------------------------------------------------------------------------------
/packages/components/iui/src/Footer/index.js:
--------------------------------------------------------------------------------
1 | import { getAppConfig } from '@xatom/modules/config'
2 | import { getLang, getZendeskLang } from '@xatom/langs'
3 | import { useMediaQuery } from 'react-responsive'
4 | import { isInApp } from '@xatom/utils/src/useragent'
5 | import LayoutH5 from './child/LayoutH5'
6 | import LayoutWeb from './child/LayoutWeb'
7 | import LayoutPad from './child/LayoutPad'
8 |
9 | export default function () {
10 | const lang = getLang()
11 | const footer = getAppConfig('footer') || {}
12 | let { links = [], followLinks = [], thirdparty = [] } = footer
13 | const isApp = isInApp()
14 | const isH5 = useMediaQuery({ maxWidth: 767 })
15 | const isPad = useMediaQuery({ maxWidth: 1023 })
16 |
17 | // Zendesk language check.
18 | const target = getZendeskLang(lang) || 'en-us'
19 | for (let i = 0; i < links.length; i++) {
20 | let data = links[i].data
21 | if (data) {
22 | for (let j = 0; j < data.length; j++) {
23 | if (data[j].isintl) {
24 | data[j].href = data[j].href.replace('/en-us', '/' + target)
25 | }
26 | }
27 | }
28 | }
29 |
30 | // 根据showInLang和notShowInlang过滤Follow Us链接链接
31 | followLinks = followLinks.filter(link => {
32 | if ((link.showInLang && link.showInLang !== lang) || (link.notShowInlang && link.notShowInlang === lang)) {
33 | return false
34 | }
35 | return true
36 | })
37 |
38 | // 根据语言获取Follow Us链接
39 | const getLocalLink = item => {
40 | if (item.locales) return item.locales[lang] || item.href
41 | return item.href
42 | }
43 |
44 | const payload = {
45 | links,
46 | followLinks,
47 | thirdparty,
48 | getLocalLink
49 | }
50 |
51 | if (isApp) {
52 | return null
53 | } else if (isH5) {
54 | return
55 | } else if (isPad) {
56 | return
57 | } else {
58 | return
59 | }
60 | }
61 |
--------------------------------------------------------------------------------