@baic/yolk-cli 2.0.0-beta.1 → 2.0.1-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/{templates/web/base/LICENSE → LICENSE} +1 -1
  2. package/README.md +13 -5
  3. package/lib/index.js +1 -1
  4. package/package.json +21 -52
  5. package/templates/{miniapp/base/.editorconfig.tpl → miniprogram/.editorconfig} +0 -0
  6. package/templates/miniprogram/.eslintrc +6 -0
  7. package/templates/{miniapp/base/.prettierignore.tpl → miniprogram/.prettierignore} +0 -0
  8. package/templates/{miniapp/base/.prettierrc.tpl → miniprogram/.prettierrc} +0 -0
  9. package/templates/{miniapp/base → miniprogram}/.stylelintrc.json +1 -1
  10. package/templates/{miniapp/base → miniprogram}/LICENSE +0 -0
  11. package/templates/{mobile/base → miniprogram}/README.md.tpl +5 -1
  12. package/templates/miniprogram/babel.config.js +3 -0
  13. package/templates/miniprogram/config/index.ts.tpl +11 -0
  14. package/templates/miniprogram/global.d.ts +33 -0
  15. package/templates/{miniapp/base → miniprogram}/package.json.tpl +2 -3
  16. package/templates/{miniapp/base → miniprogram}/project.config.json.tpl +18 -3
  17. package/templates/{miniapp/base → miniprogram}/project.tt.json.tpl +0 -0
  18. package/templates/{miniapp/base → miniprogram}/src/app.config.ts +1 -3
  19. package/templates/{miniapp/base → miniprogram}/src/app.scss +0 -0
  20. package/templates/miniprogram/src/app.tsx +19 -0
  21. package/templates/{miniapp/base → miniprogram}/src/common/request.ts +1 -1
  22. package/templates/{web/base → miniprogram}/src/common/util.ts +1 -1
  23. package/templates/{miniapp/base → miniprogram}/src/components/index.ts +0 -0
  24. package/templates/miniprogram/src/constants.ts +1 -0
  25. package/templates/{miniapp/base → miniprogram}/src/hooks/index.ts +0 -0
  26. package/templates/{miniapp/base → miniprogram}/src/images/empty.gif +0 -0
  27. package/templates/{miniapp/base → miniprogram}/src/index.html +0 -0
  28. package/templates/miniprogram/src/pages/demo/examples/Input.tsx +3 -0
  29. package/templates/miniprogram/src/pages/demo/examples/MobileInput.tsx +3 -0
  30. package/templates/miniprogram/src/pages/demo/examples/MoneyInput.tsx +3 -0
  31. package/templates/miniprogram/src/pages/demo/examples/NumberInput.tsx +3 -0
  32. package/templates/miniprogram/src/pages/demo/examples/Textarea.tsx +3 -0
  33. package/templates/miniprogram/src/pages/demo/examples/TimerButton.tsx +3 -0
  34. package/templates/miniprogram/src/pages/demo/examples/usePreload.tsx +10 -0
  35. package/templates/miniprogram/src/pages/demo/index.config.ts +5 -0
  36. package/templates/{miniapp/base/src/pages/index → miniprogram/src/pages/demo}/index.module.scss +0 -0
  37. package/templates/miniprogram/src/pages/demo/index.tsx +44 -0
  38. package/templates/{miniapp/base → miniprogram}/src/pages/index/index.config.ts +0 -0
  39. package/templates/miniprogram/src/pages/index/index.module.scss +3 -0
  40. package/templates/{miniapp/base → miniprogram}/src/pages/index/index.tsx +1 -3
  41. package/templates/miniprogram/src/theme.scss +4 -0
  42. package/templates/{miniapp/base → miniprogram}/src/types/user.d.ts +0 -0
  43. package/templates/{miniapp/base → miniprogram}/tsconfig.json +3 -9
  44. package/templates/mobile/{base/.editorconfig.tpl → .editorconfig} +0 -0
  45. package/templates/mobile/{base/.eslintrc.tpl → .eslintrc} +0 -0
  46. package/templates/mobile/{base/.prettierignore.tpl → .prettierignore} +0 -0
  47. package/templates/mobile/{base/.prettierrc.tpl → .prettierrc} +0 -0
  48. package/templates/mobile/{base/.stylelintrc.json → .stylelintrc.json} +1 -1
  49. package/templates/mobile/{base/.umirc.ts.tpl → .umirc.ts.tpl} +1 -1
  50. package/templates/mobile/{base/LICENSE → LICENSE} +0 -0
  51. package/templates/{miniapp/base → mobile}/README.md.tpl +6 -2
  52. package/templates/{web/base → mobile}/package.json.tpl +2 -3
  53. package/templates/mobile/{base/public → public}/favicon.ico +0 -0
  54. package/templates/mobile/src/app.tsx +24 -0
  55. package/templates/mobile/src/common/request.ts +3 -0
  56. package/templates/{miniapp/base → mobile}/src/common/util.ts +1 -1
  57. package/templates/mobile/{base/src → src}/components/index.ts +0 -0
  58. package/templates/mobile/{base/src → src}/global.less +1 -1
  59. package/templates/mobile/src/layouts/index.tsx +4 -0
  60. package/templates/mobile/src/pages/404.tsx +10 -0
  61. package/templates/mobile/src/pages/demo/examples/BarCode.tsx +4 -0
  62. package/templates/mobile/src/pages/demo/examples/Iconfont.tsx +18 -0
  63. package/templates/mobile/src/pages/demo/examples/Loading.tsx +12 -0
  64. package/templates/mobile/src/pages/demo/examples/QrCode.tsx +4 -0
  65. package/templates/mobile/src/pages/demo/examples/Required.tsx +4 -0
  66. package/templates/mobile/src/pages/demo/examples/TimerButton.tsx +4 -0
  67. package/templates/mobile/src/pages/demo/examples/usePreload.tsx +9 -0
  68. package/templates/mobile/src/pages/demo/index.tsx +39 -0
  69. package/templates/mobile/src/pages/index.tsx +3 -0
  70. package/templates/mobile/{base/src → src}/types/user.d.ts +1 -1
  71. package/templates/{web/base → mobile}/tsconfig.json +2 -2
  72. package/templates/mobile/typings.d.ts +16 -0
  73. package/templates/web/{base/.editorconfig.tpl → .editorconfig} +0 -0
  74. package/templates/web/{base/.eslintrc.tpl → .eslintrc} +0 -0
  75. package/templates/web/{base/.prettierignore.tpl → .prettierignore} +0 -0
  76. package/templates/web/{base/.prettierrc.tpl → .prettierrc} +0 -0
  77. package/templates/web/{base/.stylelintrc.json → .stylelintrc.json} +1 -1
  78. package/templates/web/.umirc.ts +6 -0
  79. package/templates/web/LICENSE +21 -0
  80. package/templates/web/{base/README.md.tpl → README.md.tpl} +6 -2
  81. package/templates/{mobile/base → web}/package.json.tpl +2 -3
  82. package/templates/web/{base/public → public}/favicon.ico +0 -0
  83. package/templates/web/src/app.tsx +25 -0
  84. package/templates/web/src/common/request.ts +3 -0
  85. package/templates/{mobile/base → web}/src/common/util.ts +1 -1
  86. package/templates/web/{base/src → src}/components/index.ts +0 -0
  87. package/templates/web/{base/src → src}/global.less +1 -1
  88. package/templates/web/src/layouts/index.tsx +4 -0
  89. package/templates/web/{base/src → src}/pages/404.tsx +0 -0
  90. package/templates/web/src/pages/demo/examples/BankInput.tsx +14 -0
  91. package/templates/web/src/pages/demo/examples/BarCode.tsx +4 -0
  92. package/templates/web/src/pages/demo/examples/Collapse.tsx +4 -0
  93. package/templates/web/src/pages/demo/examples/DatePicker.tsx +4 -0
  94. package/templates/web/src/pages/demo/examples/Flex.tsx +10 -0
  95. package/templates/web/src/pages/demo/examples/Grid/1.tsx +25 -0
  96. package/templates/web/src/pages/demo/examples/Grid/2.tsx +26 -0
  97. package/templates/web/src/pages/demo/examples/Grid/3.tsx +37 -0
  98. package/templates/web/src/pages/demo/examples/Grid/4.tsx +44 -0
  99. package/templates/web/src/pages/demo/examples/Grid/5.tsx +37 -0
  100. package/templates/web/src/pages/demo/examples/Grid/6.tsx +28 -0
  101. package/templates/web/src/pages/demo/examples/Iconfont.tsx +18 -0
  102. package/templates/web/src/pages/demo/examples/ImagePreview.tsx +20 -0
  103. package/templates/web/src/pages/demo/examples/Input/1.tsx +4 -0
  104. package/templates/web/src/pages/demo/examples/Input/2.tsx +80 -0
  105. package/templates/web/src/pages/demo/examples/LinkButton/1.tsx +4 -0
  106. package/templates/web/src/pages/demo/examples/LinkButton/2.tsx +9 -0
  107. package/templates/web/src/pages/demo/examples/LinkButton/3.tsx +12 -0
  108. package/templates/web/src/pages/demo/examples/Loading.tsx +12 -0
  109. package/templates/web/src/pages/demo/examples/MobileInput.tsx +4 -0
  110. package/templates/web/src/pages/demo/examples/NumberInput.tsx +4 -0
  111. package/templates/web/src/pages/demo/examples/QrCode.tsx +4 -0
  112. package/templates/web/src/pages/demo/examples/RangeNumber/1.tsx +4 -0
  113. package/templates/web/src/pages/demo/examples/RangeNumber/2.tsx +16 -0
  114. package/templates/web/src/pages/demo/examples/Required.tsx +4 -0
  115. package/templates/web/src/pages/demo/examples/SearchLayout.tsx +46 -0
  116. package/templates/web/src/pages/demo/examples/Table/1.tsx +64 -0
  117. package/templates/web/src/pages/demo/examples/Table/2.tsx +29 -0
  118. package/templates/web/src/pages/demo/examples/Table/3.tsx +39 -0
  119. package/templates/web/src/pages/demo/examples/Table/4.tsx +42 -0
  120. package/templates/web/src/pages/demo/examples/TimerButton.tsx +4 -0
  121. package/templates/web/src/pages/demo/examples/Title/1.tsx +4 -0
  122. package/templates/web/src/pages/demo/examples/Title/2.tsx +5 -0
  123. package/templates/web/src/pages/demo/examples/WaterMark.tsx +8 -0
  124. package/templates/web/src/pages/demo/examples/Wrapper.tsx +40 -0
  125. package/templates/web/src/pages/demo/examples/usePreload.tsx +9 -0
  126. package/templates/web/src/pages/demo/index.tsx +133 -0
  127. package/templates/web/src/pages/index.tsx +3 -0
  128. package/templates/web/{base/src → src}/types/user.d.ts +1 -1
  129. package/templates/{mobile/base → web}/tsconfig.json +2 -2
  130. package/templates/web/typings.d.ts +16 -0
  131. package/es/index.d.ts +0 -2
  132. package/es/index.js +0 -2
  133. package/templates/miniapp/base/.eslintrc.js.tpl +0 -6
  134. package/templates/miniapp/base/.gitignore.tpl +0 -38
  135. package/templates/miniapp/base/babel.config.js +0 -3
  136. package/templates/miniapp/base/config/index.ts.tpl +0 -8
  137. package/templates/miniapp/base/global.d.ts +0 -18
  138. package/templates/miniapp/base/src/app.tsx +0 -26
  139. package/templates/miniapp/base/src/constants.ts +0 -1
  140. package/templates/miniapp/base/src/store/index.ts +0 -34
  141. package/templates/miniapp/base/src/theme.scss +0 -4
  142. package/templates/mobile/base/.gitignore.tpl +0 -33
  143. package/templates/mobile/base/__tests__/__snapshots__/pages.test.tsx.snap +0 -88
  144. package/templates/mobile/base/__tests__/pages.test.tsx +0 -11
  145. package/templates/mobile/base/src/app.tsx +0 -27
  146. package/templates/mobile/base/src/common/request.ts +0 -3
  147. package/templates/mobile/base/src/layouts/index.less +0 -103
  148. package/templates/mobile/base/src/layouts/index.tsx +0 -48
  149. package/templates/mobile/base/src/pages/404.tsx +0 -12
  150. package/templates/mobile/base/src/pages/index.tsx +0 -3
  151. package/templates/mobile/base/src/store/index.ts +0 -17
  152. package/templates/mobile/base/typings.d.ts +0 -8
  153. package/templates/web/base/.gitignore.tpl +0 -33
  154. package/templates/web/base/.umirc.ts.tpl +0 -6
  155. package/templates/web/base/__tests__/__snapshots__/pages.test.tsx.snap +0 -112
  156. package/templates/web/base/__tests__/pages.test.tsx +0 -11
  157. package/templates/web/base/src/app.tsx +0 -36
  158. package/templates/web/base/src/common/request.ts +0 -3
  159. package/templates/web/base/src/layouts/index.less +0 -11
  160. package/templates/web/base/src/layouts/index.tsx +0 -94
  161. package/templates/web/base/src/pages/index.tsx +0 -3
  162. package/templates/web/base/src/store/index.ts +0 -17
  163. package/templates/web/base/typings.d.ts +0 -8
@@ -3,10 +3,9 @@
3
3
  "name": "{{ projectName }}",
4
4
  "scripts": {
5
5
  "start": "yolk start",
6
- "build": "yolk build",
7
- "test": "yolk test"
6
+ "build": "yolk build"
8
7
  },
9
8
  "dependencies": {
10
- "@baic/preset-yolk-web": "1.x"
9
+ "@baic/preset-yolk-mobile": "~2.0.1-alpha.10"
11
10
  }
12
11
  }
@@ -0,0 +1,24 @@
1
+ import * as React from 'react';
2
+
3
+ import { Provider } from '@baic/yolk-browser-base';
4
+
5
+ import { Provider as WebProvider } from '@baic/yolk-mobile';
6
+
7
+ import request from '@/common/request';
8
+
9
+ import '@baic/yolk-mobile/lib/style/index.less';
10
+
11
+ export function rootContainer(container: React.ReactNode) {
12
+ return (
13
+ <Provider request={request}>
14
+ <WebProvider
15
+ iconfontScriptUrl={[
16
+ '//at.alicdn.com/t/font_1788044_0dwu4guekcwr.js',
17
+ '//at.alicdn.com/t/font_1788592_a5xf2bdic3u.js',
18
+ ]}
19
+ >
20
+ {container}
21
+ </WebProvider>
22
+ </Provider>
23
+ );
24
+ }
@@ -0,0 +1,3 @@
1
+ import { Request } from '@baic/yolk-browser-base';
2
+
3
+ export default new Request();
@@ -1,4 +1,4 @@
1
- import { Util } from '@baic/yolk-miniapp';
1
+ import { Util } from '@baic/yolk-mobile';
2
2
 
3
3
  const util = {
4
4
  ...Util,
@@ -1,3 +1,3 @@
1
1
  #yolk-app {
2
2
  height: 100%;
3
- }
3
+ }
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { IRouteComponentProps } from 'umi';
3
+
4
+ export default ({ children }: IRouteComponentProps) => <>{children}</>;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { Result } from 'antd-mobile';
3
+
4
+ export default () => (
5
+ <Result
6
+ title="404"
7
+ description="对不起,您访问的页面不存在。"
8
+ status="warning"
9
+ />
10
+ );
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { BarCode } from '@baic/yolk-mobile';
3
+
4
+ export default () => <BarCode value="https://www.baidu.com" />;
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import { Provider, Iconfont } from '@baic/yolk-mobile';
3
+
4
+ export default () => {
5
+ return (
6
+ <Provider
7
+ iconfontScriptUrl={[
8
+ '//at.alicdn.com/t/font_1788044_0dwu4guekcwr.js',
9
+ '//at.alicdn.com/t/font_1788592_a5xf2bdic3u.js',
10
+ ]}
11
+ >
12
+ <Iconfont type="icon-javascript" />
13
+ <Iconfont type="icon-java" />
14
+ <Iconfont type="icon-shoppingcart" />
15
+ <Iconfont type="icon-python" />
16
+ </Provider>
17
+ );
18
+ };
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { Loading } from '@baic/yolk-mobile';
3
+
4
+ export default () => (
5
+ <div
6
+ style={{
7
+ position: 'relative',
8
+ }}
9
+ >
10
+ <Loading />
11
+ </div>
12
+ );
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { QrCode } from '@baic/yolk-mobile';
3
+
4
+ export default () => <QrCode value="https://www.baidu.com" />;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { Required } from '@baic/yolk-mobile';
3
+
4
+ export default () => <Required>必填</Required>;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { TimerButton } from '@baic/yolk-mobile';
3
+
4
+ export default () => <TimerButton>验证码</TimerButton>;
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { Util } from '@baic/yolk';
3
+ import { usePreload } from '@baic/yolk-mobile';
4
+ export default () => {
5
+ const [wrap] = usePreload(async () => {
6
+ await Util.delay(1000);
7
+ });
8
+ return wrap(<div>页面加载完成显示出来了</div>);
9
+ };
@@ -0,0 +1,39 @@
1
+ import * as React from 'react';
2
+
3
+ import { Tabs } from 'antd-mobile';
4
+
5
+ import BarCode from './examples/BarCode';
6
+ import Iconfont from './examples/Iconfont';
7
+ import Loading from './examples/Loading';
8
+ import QrCode from './examples/QrCode';
9
+ import Required from './examples/Required';
10
+ import TimerButton from './examples/TimerButton';
11
+ import usePreload from './examples/usePreload';
12
+
13
+ const { Tab } = Tabs;
14
+
15
+ const tabs: Record<string, React.FunctionComponent> = {
16
+ BarCode,
17
+ Iconfont,
18
+ Loading,
19
+ QrCode,
20
+ Required,
21
+ TimerButton,
22
+ usePreload,
23
+ };
24
+
25
+ export default () => {
26
+ const keys = Object.keys(tabs);
27
+ return (
28
+ <Tabs defaultActiveKey={keys[0]}>
29
+ {keys.map(key => {
30
+ const tab = tabs[key];
31
+ return (
32
+ <Tab key={key} title={key}>
33
+ {React.createElement(tab)}
34
+ </Tab>
35
+ );
36
+ })}
37
+ </Tabs>
38
+ );
39
+ };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+
3
+ export default () => <div>Hello world</div>;
@@ -1,3 +1,3 @@
1
1
  export interface User {
2
2
  id?: string;
3
- }
3
+ }
@@ -4,14 +4,14 @@
4
4
  "module": "esnext",
5
5
  "moduleResolution": "node",
6
6
  "importHelpers": true,
7
- "jsx": "react",
7
+ "jsx": "react-jsx",
8
8
  "esModuleInterop": true,
9
9
  "sourceMap": true,
10
10
  "baseUrl": "./",
11
11
  "strict": true,
12
12
  "paths": {
13
13
  "@/*": ["src/*"],
14
- "@@/*": ["src/.umi/*"],
14
+ "@@/*": ["src/.umi/*"]
15
15
  },
16
16
  "allowSyntheticDefaultImports": true
17
17
  },
@@ -0,0 +1,16 @@
1
+ declare module '*.png';
2
+ declare module '*.gif';
3
+ declare module '*.jpg';
4
+ declare module '*.jpeg';
5
+ declare module '*.svg' {
6
+ export function ReactComponent(
7
+ props: React.SVGProps<SVGSVGElement>,
8
+ ): React.ReactElement;
9
+ const url: string;
10
+ export default url;
11
+ }
12
+ declare module '*.css';
13
+ declare module '*.less';
14
+ declare module '*.scss';
15
+ declare module '*.sass';
16
+ declare module '*.styl';
File without changes
@@ -1,3 +1,3 @@
1
1
  {
2
2
  "extends": "@baic/stylelint-config-yolk"
3
- }
3
+ }
@@ -0,0 +1,6 @@
1
+ import defineConfig from '@baic/yolk-umi-web/lib/define-config';
2
+
3
+ export default defineConfig({
4
+ title: 'web',
5
+ publicPath: '/',
6
+ });
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Baic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,18 +1,22 @@
1
- # {{ projectName }}
1
+ # web
2
2
 
3
3
  ## Getting Started
4
4
 
5
5
  Install dependencies,
6
6
 
7
7
  {{ #dependenciesInstallType }}
8
+
8
9
  ```bash
9
10
  $ {{ dependenciesInstallType }} install
10
11
  ```
12
+
11
13
  {{ /dependenciesInstallType }}
12
14
  {{ ^dependenciesInstallType }}
15
+
13
16
  ```bash
14
17
  $ yarn install
15
18
  ```
19
+
16
20
  {{ /dependenciesInstallType }}
17
21
 
18
22
  Start the dev server,
@@ -27,4 +31,4 @@ Build,
27
31
  $ npm run build
28
32
  ```
29
33
 
30
- [查阅文档](https://303394539.github.io/yolk-docs/)
34
+ [查阅文档](https://303394539.github.io/yolk-docs/)
@@ -3,10 +3,9 @@
3
3
  "name": "{{ projectName }}",
4
4
  "scripts": {
5
5
  "start": "yolk start",
6
- "build": "yolk build",
7
- "test": "yolk test"
6
+ "build": "yolk build"
8
7
  },
9
8
  "dependencies": {
10
- "@baic/preset-yolk-mobile": "1.x"
9
+ "@baic/preset-yolk-web": "~2.0.1-alpha.10"
11
10
  }
12
11
  }
@@ -0,0 +1,25 @@
1
+ import * as React from 'react';
2
+
3
+ import { Provider } from '@baic/yolk-browser-base';
4
+
5
+ import { Provider as WebProvider } from '@baic/yolk-web';
6
+
7
+ import request from '@/common/request';
8
+
9
+ import '@baic/yolk-web/lib/style/index.less';
10
+
11
+ export function rootContainer(container: React.ReactNode) {
12
+ return (
13
+ <Provider request={request}>
14
+ <WebProvider
15
+ inputMaxLength={40}
16
+ iconfontScriptUrl={[
17
+ '//at.alicdn.com/t/font_1788044_0dwu4guekcwr.js',
18
+ '//at.alicdn.com/t/font_1788592_a5xf2bdic3u.js',
19
+ ]}
20
+ >
21
+ {container}
22
+ </WebProvider>
23
+ </Provider>
24
+ );
25
+ }
@@ -0,0 +1,3 @@
1
+ import { Request } from '@baic/yolk-browser-base';
2
+
3
+ export default new Request();
@@ -1,4 +1,4 @@
1
- import { Util } from '@baic/yolk-mobile-ui';
1
+ import { Util } from '@baic/yolk-web';
2
2
 
3
3
  const util = {
4
4
  ...Util,
@@ -1,3 +1,3 @@
1
1
  #yolk-app {
2
2
  height: 100%;
3
- }
3
+ }
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { IRouteComponentProps } from 'umi';
3
+
4
+ export default ({ children }: IRouteComponentProps) => <>{children}</>;
File without changes
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { Form } from 'antd';
3
+ import { useForm } from '@baic/yolk-web-form';
4
+ import { BankInput } from '@baic/yolk-web';
5
+
6
+ export default () => {
7
+ const [form] = useForm();
8
+ const { createFormItem } = form;
9
+ return (
10
+ <Form form={form}>
11
+ {createFormItem({ name: 'BankInput' })(<BankInput />)}
12
+ </Form>
13
+ );
14
+ };
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { BarCode } from '@baic/yolk-web';
3
+
4
+ export default () => <BarCode value="https://www.baidu.com" />;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { Collapse } from '@baic/yolk-web';
3
+
4
+ export default () => <Collapse title="折叠组件">这里是隐藏内容</Collapse>;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { DatePicker } from '@baic/yolk-web';
3
+
4
+ export default () => <DatePicker autoFixDate />;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { Flex } from '@baic/yolk-web';
3
+
4
+ export default () => (
5
+ <Flex>
6
+ <Flex>1</Flex>
7
+ <Flex>2</Flex>
8
+ <Flex>3</Flex>
9
+ </Flex>
10
+ );
@@ -0,0 +1,25 @@
1
+ import * as React from 'react';
2
+ import { Grid } from '@baic/yolk-web';
3
+
4
+ export default () => (
5
+ <Grid
6
+ data={[
7
+ {
8
+ label: '标题',
9
+ value: '内容',
10
+ },
11
+ {
12
+ label: '标题',
13
+ value: '内容',
14
+ },
15
+ {
16
+ label: '标题',
17
+ value: '内容',
18
+ },
19
+ {
20
+ label: '标题',
21
+ value: '内容',
22
+ },
23
+ ]}
24
+ />
25
+ );
@@ -0,0 +1,26 @@
1
+ import * as React from 'react';
2
+ import { Grid } from '@baic/yolk-web';
3
+
4
+ export default () => (
5
+ <Grid
6
+ span={2}
7
+ data={[
8
+ {
9
+ label: '标题',
10
+ value: '内容',
11
+ },
12
+ {
13
+ label: '标题',
14
+ value: '内容',
15
+ },
16
+ {
17
+ label: '标题',
18
+ value: '内容',
19
+ },
20
+ {
21
+ label: '标题',
22
+ value: '内容',
23
+ },
24
+ ]}
25
+ />
26
+ );
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+ import { Button, Divider } from 'antd';
3
+ import { Grid } from '@baic/yolk-web';
4
+
5
+ export default () => {
6
+ const [bordered, setBordered] = React.useState(true);
7
+ const onClickHandler = React.useCallback(() => setBordered(!bordered), [
8
+ bordered,
9
+ ]);
10
+ return (
11
+ <>
12
+ <Button onClick={onClickHandler}>{bordered ? '关闭' : '开启'}边框</Button>
13
+ <Divider />
14
+ <Grid
15
+ bordered={bordered}
16
+ data={[
17
+ {
18
+ label: '标题',
19
+ value: '内容',
20
+ },
21
+ {
22
+ label: '标题',
23
+ value: '内容',
24
+ },
25
+ {
26
+ label: '标题',
27
+ value: '内容',
28
+ },
29
+ {
30
+ label: '标题',
31
+ value: '内容',
32
+ },
33
+ ]}
34
+ />
35
+ </>
36
+ );
37
+ };
@@ -0,0 +1,44 @@
1
+ import * as React from 'react';
2
+ import { Radio, Divider } from 'antd';
3
+ import { RadioChangeEvent } from 'antd/lib/radio/interface';
4
+ import { Grid } from '@baic/yolk-web';
5
+ import { GridProps } from '@baic/yolk-web/lib/grid';
6
+
7
+ export default () => {
8
+ const [size, setSize] = React.useState<GridProps['size']>('middle');
9
+ const onChangeHandler = React.useCallback(
10
+ (e: RadioChangeEvent) => setSize(e.target.value),
11
+ [],
12
+ );
13
+ return (
14
+ <>
15
+ <Radio.Group value={size} onChange={onChangeHandler}>
16
+ <Radio.Button value="small">small</Radio.Button>
17
+ <Radio.Button value="middle">middle</Radio.Button>
18
+ <Radio.Button value="large">large</Radio.Button>
19
+ </Radio.Group>
20
+ <Divider />
21
+ <Grid
22
+ size={size}
23
+ data={[
24
+ {
25
+ label: '标题',
26
+ value: '内容',
27
+ },
28
+ {
29
+ label: '标题',
30
+ value: '内容',
31
+ },
32
+ {
33
+ label: '标题',
34
+ value: '内容',
35
+ },
36
+ {
37
+ label: '标题',
38
+ value: '内容',
39
+ },
40
+ ]}
41
+ />
42
+ </>
43
+ );
44
+ };
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+ import { Form } from 'antd';
3
+ import { useForm } from '@baic/yolk-web-form';
4
+ import { Grid, Input } from '@baic/yolk-web';
5
+
6
+ export default () => {
7
+ const [form] = useForm();
8
+ const { createFormItem } = form;
9
+ return (
10
+ <Form form={form}>
11
+ <Grid
12
+ data={[
13
+ {
14
+ label: '标题',
15
+ value: createFormItem({
16
+ name: 'content',
17
+ rules: 'required',
18
+ })(<Input />),
19
+ required: true,
20
+ },
21
+ {
22
+ label: '标题',
23
+ value: '内容',
24
+ },
25
+ {
26
+ label: '标题',
27
+ value: '内容',
28
+ },
29
+ {
30
+ label: '标题',
31
+ value: '内容',
32
+ },
33
+ ]}
34
+ />
35
+ </Form>
36
+ );
37
+ };
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ import { Grid } from '@baic/yolk-web';
3
+
4
+ export default () => (
5
+ <Grid
6
+ bordered={false}
7
+ itemDirection="vertical"
8
+ data={[
9
+ {
10
+ label: '标题',
11
+ value: '内容',
12
+ required: true,
13
+ },
14
+ {
15
+ label: '标题',
16
+ value: '内容',
17
+ },
18
+ {
19
+ label: '标题',
20
+ value: '内容',
21
+ },
22
+ {
23
+ label: '标题',
24
+ value: '内容',
25
+ },
26
+ ]}
27
+ />
28
+ );
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import { Provider, Iconfont } from '@baic/yolk-web';
3
+
4
+ export default () => {
5
+ return (
6
+ <Provider
7
+ iconfontScriptUrl={[
8
+ '//at.alicdn.com/t/font_1788044_0dwu4guekcwr.js',
9
+ '//at.alicdn.com/t/font_1788592_a5xf2bdic3u.js',
10
+ ]}
11
+ >
12
+ <Iconfont type="icon-javascript" />
13
+ <Iconfont type="icon-java" />
14
+ <Iconfont type="icon-shoppingcart" />
15
+ <Iconfont type="icon-python" />
16
+ </Provider>
17
+ );
18
+ };