@baic/yolk-cli 2.0.1-alpha.36 → 2.0.1-alpha.39

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 (196) hide show
  1. package/lib/index.js +1 -1
  2. package/package.json +2 -2
  3. package/templates/{mobile → ice-mobile}/.editorconfig +0 -0
  4. package/templates/{mobile → ice-mobile}/.eslintrc +0 -0
  5. package/templates/ice-mobile/.gitignore.tpl +26 -0
  6. package/templates/ice-mobile/.ice.ts +3 -0
  7. package/templates/ice-mobile/.prettierignore +9 -0
  8. package/templates/{mobile → ice-mobile}/.prettierrc +0 -0
  9. package/templates/{mobile → ice-mobile}/.stylelintrc +0 -0
  10. package/templates/{web → ice-mobile}/README.md.tpl +0 -0
  11. package/templates/ice-mobile/package.json.tpl +11 -0
  12. package/templates/{mobile → ice-mobile}/public/favicon.ico +0 -0
  13. package/templates/ice-mobile/public/index.html +13 -0
  14. package/templates/ice-mobile/src/app.tsx +12 -0
  15. package/templates/{mobile → ice-mobile}/src/common/request.ts +0 -0
  16. package/templates/{mobile → ice-mobile}/src/common/util.ts +0 -0
  17. package/templates/{mobile → ice-mobile}/src/components/index.ts +0 -0
  18. package/templates/{mobile → ice-mobile}/src/global.less +0 -0
  19. package/templates/ice-mobile/src/layouts/index.tsx +5 -0
  20. package/templates/{mobile → ice-mobile}/src/pages/404.tsx +0 -0
  21. package/templates/{mobile → ice-mobile}/src/pages/demo/examples/BarCode.tsx +0 -0
  22. package/templates/{mobile → ice-mobile}/src/pages/demo/examples/Iconfont.tsx +0 -0
  23. package/templates/{mobile → ice-mobile}/src/pages/demo/examples/Input.tsx +0 -0
  24. package/templates/{mobile → ice-mobile}/src/pages/demo/examples/Loading.tsx +0 -0
  25. package/templates/{mobile → ice-mobile}/src/pages/demo/examples/NumberInput/1.tsx +0 -0
  26. package/templates/{mobile → ice-mobile}/src/pages/demo/examples/NumberInput/2.tsx +0 -0
  27. package/templates/{mobile → ice-mobile}/src/pages/demo/examples/NumberInput/3.tsx +0 -0
  28. package/templates/{mobile → ice-mobile}/src/pages/demo/examples/NumberInput/4.tsx +0 -0
  29. package/templates/{mobile → ice-mobile}/src/pages/demo/examples/QrCode.tsx +0 -0
  30. package/templates/{mobile → ice-mobile}/src/pages/demo/examples/Required.tsx +0 -0
  31. package/templates/{mobile → ice-mobile}/src/pages/demo/examples/TimerButton.tsx +0 -0
  32. package/templates/{mobile → ice-mobile}/src/pages/demo/examples/usePreload.tsx +0 -0
  33. package/templates/{mobile → ice-mobile}/src/pages/demo/index.tsx +0 -0
  34. package/templates/{mobile → ice-mobile}/src/pages/index.tsx +0 -0
  35. package/templates/ice-mobile/src/routes.ts +28 -0
  36. package/templates/{mobile → ice-mobile}/src/types/user.d.ts +0 -0
  37. package/templates/ice-mobile/tsconfig.json +26 -0
  38. package/templates/{mobile → ice-mobile}/typings.d.ts +0 -0
  39. package/templates/{web → ice-web}/.editorconfig +0 -0
  40. package/templates/ice-web/.eslintcache +1 -0
  41. package/templates/{web → ice-web}/.eslintrc +0 -0
  42. package/templates/ice-web/.gitignore.tpl +26 -0
  43. package/templates/ice-web/.ice.ts +3 -0
  44. package/templates/ice-web/.prettierignore +9 -0
  45. package/templates/{web → ice-web}/.prettierrc +0 -0
  46. package/templates/{web → ice-web}/.stylelintrc +0 -0
  47. package/templates/ice-web/README.md.tpl +34 -0
  48. package/templates/{web → ice-web}/package.json.tpl +1 -1
  49. package/templates/{web → ice-web}/public/favicon.ico +0 -0
  50. package/templates/ice-web/public/index.html +13 -0
  51. package/templates/ice-web/src/app.tsx +12 -0
  52. package/templates/{web → ice-web}/src/common/request.ts +0 -0
  53. package/templates/{web → ice-web}/src/common/util.ts +0 -0
  54. package/templates/{web → ice-web}/src/components/index.ts +0 -0
  55. package/templates/ice-web/src/global.less +5 -0
  56. package/templates/ice-web/src/layouts/index.tsx +5 -0
  57. package/templates/ice-web/src/pages/404.tsx +17 -0
  58. package/templates/{web → ice-web}/src/pages/demo/examples/BankInput.tsx +0 -0
  59. package/templates/{web → ice-web}/src/pages/demo/examples/BarCode.tsx +0 -0
  60. package/templates/{web → ice-web}/src/pages/demo/examples/Collapse.tsx +0 -0
  61. package/templates/{web → ice-web}/src/pages/demo/examples/DatePicker.tsx +0 -0
  62. package/templates/{web → ice-web}/src/pages/demo/examples/Flex.tsx +0 -0
  63. package/templates/{web → ice-web}/src/pages/demo/examples/Grid/1.tsx +0 -0
  64. package/templates/{web → ice-web}/src/pages/demo/examples/Grid/2.tsx +0 -0
  65. package/templates/{web → ice-web}/src/pages/demo/examples/Grid/3.tsx +0 -0
  66. package/templates/{web → ice-web}/src/pages/demo/examples/Grid/4.tsx +0 -0
  67. package/templates/{web → ice-web}/src/pages/demo/examples/Grid/5.tsx +0 -0
  68. package/templates/{web → ice-web}/src/pages/demo/examples/Grid/6.tsx +0 -0
  69. package/templates/{web → ice-web}/src/pages/demo/examples/Iconfont.tsx +0 -0
  70. package/templates/{web → ice-web}/src/pages/demo/examples/ImagePreview.tsx +0 -0
  71. package/templates/{web → ice-web}/src/pages/demo/examples/Input/1.tsx +0 -0
  72. package/templates/{web → ice-web}/src/pages/demo/examples/Input/2.tsx +0 -0
  73. package/templates/{web → ice-web}/src/pages/demo/examples/LinkButton/1.tsx +0 -0
  74. package/templates/{web → ice-web}/src/pages/demo/examples/LinkButton/2.tsx +0 -0
  75. package/templates/{web → ice-web}/src/pages/demo/examples/LinkButton/3.tsx +0 -0
  76. package/templates/{web → ice-web}/src/pages/demo/examples/Loading.tsx +0 -0
  77. package/templates/{web → ice-web}/src/pages/demo/examples/MobileInput.tsx +0 -0
  78. package/templates/{web → ice-web}/src/pages/demo/examples/NumberInput.tsx +0 -0
  79. package/templates/{web → ice-web}/src/pages/demo/examples/PagingTable.tsx +0 -0
  80. package/templates/{web → ice-web}/src/pages/demo/examples/QrCode.tsx +0 -0
  81. package/templates/{web → ice-web}/src/pages/demo/examples/RangeNumber/1.tsx +0 -0
  82. package/templates/{web → ice-web}/src/pages/demo/examples/RangeNumber/2.tsx +0 -0
  83. package/templates/{web → ice-web}/src/pages/demo/examples/Required.tsx +0 -0
  84. package/templates/{web → ice-web}/src/pages/demo/examples/SearchLayout.tsx +0 -0
  85. package/templates/{web → ice-web}/src/pages/demo/examples/Table/1.tsx +0 -0
  86. package/templates/{web → ice-web}/src/pages/demo/examples/Table/2.tsx +0 -0
  87. package/templates/{web → ice-web}/src/pages/demo/examples/Table/3.tsx +0 -0
  88. package/templates/{web → ice-web}/src/pages/demo/examples/Table/4.tsx +0 -0
  89. package/templates/{web → ice-web}/src/pages/demo/examples/TimerButton.tsx +0 -0
  90. package/templates/{web → ice-web}/src/pages/demo/examples/Title/1.tsx +0 -0
  91. package/templates/{web → ice-web}/src/pages/demo/examples/Title/2.tsx +0 -0
  92. package/templates/{web → ice-web}/src/pages/demo/examples/WaterMark.tsx +0 -0
  93. package/templates/{web → ice-web}/src/pages/demo/examples/Wrapper.tsx +0 -0
  94. package/templates/{web → ice-web}/src/pages/demo/examples/usePreload.tsx +0 -0
  95. package/templates/{web → ice-web}/src/pages/demo/index.tsx +0 -0
  96. package/templates/{web → ice-web}/src/pages/index.tsx +0 -0
  97. package/templates/ice-web/src/routes.ts +28 -0
  98. package/templates/{web → ice-web}/src/types/user.d.ts +0 -0
  99. package/templates/ice-web/tsconfig.json +26 -0
  100. package/templates/{web → ice-web}/typings.d.ts +0 -0
  101. package/templates/miniprogram/package.json.tpl +1 -1
  102. package/templates/umi-mobile/.editorconfig +16 -0
  103. package/templates/umi-mobile/.eslintrc +6 -0
  104. package/templates/{mobile → umi-mobile}/.gitignore.tpl +0 -0
  105. package/templates/{mobile → umi-mobile}/.prettierignore +0 -0
  106. package/templates/umi-mobile/.prettierrc +11 -0
  107. package/templates/umi-mobile/.stylelintrc +3 -0
  108. package/templates/{mobile → umi-mobile}/.umirc.ts.tpl +0 -0
  109. package/templates/{mobile → umi-mobile}/LICENSE +0 -0
  110. package/templates/{mobile → umi-mobile}/README.md.tpl +0 -0
  111. package/templates/umi-mobile/package.json.tpl +11 -0
  112. package/templates/umi-mobile/public/favicon.ico +0 -0
  113. package/templates/{mobile → umi-mobile}/src/app.tsx +0 -0
  114. package/templates/umi-mobile/src/common/request.ts +3 -0
  115. package/templates/umi-mobile/src/common/util.ts +7 -0
  116. package/templates/umi-mobile/src/components/index.ts +0 -0
  117. package/templates/{web → umi-mobile}/src/global.less +0 -0
  118. package/templates/{mobile → umi-mobile}/src/layouts/index.tsx +0 -0
  119. package/templates/umi-mobile/src/pages/404.tsx +10 -0
  120. package/templates/umi-mobile/src/pages/demo/examples/BarCode.tsx +4 -0
  121. package/templates/umi-mobile/src/pages/demo/examples/Iconfont.tsx +18 -0
  122. package/templates/umi-mobile/src/pages/demo/examples/Input.tsx +17 -0
  123. package/templates/umi-mobile/src/pages/demo/examples/Loading.tsx +12 -0
  124. package/templates/umi-mobile/src/pages/demo/examples/NumberInput/1.tsx +17 -0
  125. package/templates/umi-mobile/src/pages/demo/examples/NumberInput/2.tsx +17 -0
  126. package/templates/umi-mobile/src/pages/demo/examples/NumberInput/3.tsx +17 -0
  127. package/templates/umi-mobile/src/pages/demo/examples/NumberInput/4.tsx +17 -0
  128. package/templates/umi-mobile/src/pages/demo/examples/QrCode.tsx +4 -0
  129. package/templates/umi-mobile/src/pages/demo/examples/Required.tsx +4 -0
  130. package/templates/umi-mobile/src/pages/demo/examples/TimerButton.tsx +4 -0
  131. package/templates/umi-mobile/src/pages/demo/examples/usePreload.tsx +9 -0
  132. package/templates/umi-mobile/src/pages/demo/index.tsx +76 -0
  133. package/templates/umi-mobile/src/pages/index.tsx +3 -0
  134. package/templates/umi-mobile/src/types/user.d.ts +3 -0
  135. package/templates/{mobile → umi-mobile}/tsconfig.json +0 -0
  136. package/templates/umi-mobile/typings.d.ts +16 -0
  137. package/templates/umi-web/.editorconfig +16 -0
  138. package/templates/umi-web/.eslintrc +6 -0
  139. package/templates/{web → umi-web}/.gitignore.tpl +0 -0
  140. package/templates/{web → umi-web}/.prettierignore +0 -0
  141. package/templates/umi-web/.prettierrc +11 -0
  142. package/templates/umi-web/.stylelintrc +3 -0
  143. package/templates/{web → umi-web}/.umirc.ts.tpl +0 -0
  144. package/templates/{web → umi-web}/LICENSE +0 -0
  145. package/templates/umi-web/README.md.tpl +34 -0
  146. package/templates/{mobile → umi-web}/package.json.tpl +1 -1
  147. package/templates/umi-web/public/favicon.ico +0 -0
  148. package/templates/{web → umi-web}/src/app.tsx +0 -0
  149. package/templates/umi-web/src/common/request.ts +3 -0
  150. package/templates/umi-web/src/common/util.ts +7 -0
  151. package/templates/umi-web/src/components/index.ts +0 -0
  152. package/templates/umi-web/src/global.less +3 -0
  153. package/templates/{web → umi-web}/src/layouts/index.tsx +0 -0
  154. package/templates/{web → umi-web}/src/pages/404.tsx +0 -0
  155. package/templates/umi-web/src/pages/demo/examples/BankInput.tsx +13 -0
  156. package/templates/umi-web/src/pages/demo/examples/BarCode.tsx +4 -0
  157. package/templates/umi-web/src/pages/demo/examples/Collapse.tsx +4 -0
  158. package/templates/umi-web/src/pages/demo/examples/DatePicker.tsx +4 -0
  159. package/templates/umi-web/src/pages/demo/examples/Flex.tsx +10 -0
  160. package/templates/umi-web/src/pages/demo/examples/Grid/1.tsx +25 -0
  161. package/templates/umi-web/src/pages/demo/examples/Grid/2.tsx +26 -0
  162. package/templates/umi-web/src/pages/demo/examples/Grid/3.tsx +37 -0
  163. package/templates/umi-web/src/pages/demo/examples/Grid/4.tsx +43 -0
  164. package/templates/umi-web/src/pages/demo/examples/Grid/5.tsx +36 -0
  165. package/templates/umi-web/src/pages/demo/examples/Grid/6.tsx +28 -0
  166. package/templates/umi-web/src/pages/demo/examples/Iconfont.tsx +18 -0
  167. package/templates/umi-web/src/pages/demo/examples/ImagePreview.tsx +20 -0
  168. package/templates/umi-web/src/pages/demo/examples/Input/1.tsx +4 -0
  169. package/templates/umi-web/src/pages/demo/examples/Input/2.tsx +80 -0
  170. package/templates/umi-web/src/pages/demo/examples/LinkButton/1.tsx +4 -0
  171. package/templates/umi-web/src/pages/demo/examples/LinkButton/2.tsx +9 -0
  172. package/templates/umi-web/src/pages/demo/examples/LinkButton/3.tsx +12 -0
  173. package/templates/umi-web/src/pages/demo/examples/Loading.tsx +12 -0
  174. package/templates/umi-web/src/pages/demo/examples/MobileInput.tsx +4 -0
  175. package/templates/umi-web/src/pages/demo/examples/NumberInput.tsx +4 -0
  176. package/templates/umi-web/src/pages/demo/examples/PagingTable.tsx +21 -0
  177. package/templates/umi-web/src/pages/demo/examples/QrCode.tsx +4 -0
  178. package/templates/umi-web/src/pages/demo/examples/RangeNumber/1.tsx +4 -0
  179. package/templates/umi-web/src/pages/demo/examples/RangeNumber/2.tsx +15 -0
  180. package/templates/umi-web/src/pages/demo/examples/Required.tsx +4 -0
  181. package/templates/umi-web/src/pages/demo/examples/SearchLayout.tsx +46 -0
  182. package/templates/umi-web/src/pages/demo/examples/Table/1.tsx +64 -0
  183. package/templates/umi-web/src/pages/demo/examples/Table/2.tsx +29 -0
  184. package/templates/umi-web/src/pages/demo/examples/Table/3.tsx +39 -0
  185. package/templates/umi-web/src/pages/demo/examples/Table/4.tsx +42 -0
  186. package/templates/umi-web/src/pages/demo/examples/TimerButton.tsx +4 -0
  187. package/templates/umi-web/src/pages/demo/examples/Title/1.tsx +4 -0
  188. package/templates/umi-web/src/pages/demo/examples/Title/2.tsx +5 -0
  189. package/templates/umi-web/src/pages/demo/examples/WaterMark.tsx +8 -0
  190. package/templates/umi-web/src/pages/demo/examples/Wrapper.tsx +40 -0
  191. package/templates/umi-web/src/pages/demo/examples/usePreload.tsx +9 -0
  192. package/templates/umi-web/src/pages/demo/index.tsx +135 -0
  193. package/templates/umi-web/src/pages/index.tsx +3 -0
  194. package/templates/umi-web/src/types/user.d.ts +3 -0
  195. package/templates/{web → umi-web}/tsconfig.json +0 -0
  196. package/templates/umi-web/typings.d.ts +16 -0
File without changes
@@ -0,0 +1,28 @@
1
+ import { IRouterConfig, lazy } from 'ice';
2
+ import Layouts from '@/layouts';
3
+
4
+ const Index = lazy(() => import('@/pages/index'));
5
+ const Demo = lazy(() => import('@/pages/demo'));
6
+
7
+ const routerConfig: IRouterConfig[] = [
8
+ {
9
+ path: '/',
10
+ component: Layouts,
11
+ children: [
12
+ {
13
+ path: '/demo',
14
+ component: Demo,
15
+ },
16
+ {
17
+ path: '/',
18
+ exact: true,
19
+ component: Index,
20
+ },
21
+ {
22
+ component: lazy(() => import('@/pages/404')),
23
+ },
24
+ ],
25
+ },
26
+ ];
27
+
28
+ export default routerConfig;
File without changes
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "module": "esnext",
5
+ "moduleResolution": "node",
6
+ "importHelpers": true,
7
+ "jsx": "react-jsx",
8
+ "esModuleInterop": true,
9
+ "sourceMap": true,
10
+ "baseUrl": "./",
11
+ "strict": true,
12
+ "paths": {
13
+ "@/*": ["./src/*"],
14
+ "ice": [".ice/"]
15
+ },
16
+ "allowSyntheticDefaultImports": true
17
+ },
18
+ "include": [
19
+ "mock/**/*",
20
+ "src/**/*",
21
+ "tests/**/*",
22
+ "config/**/*",
23
+ ".ice.ts",
24
+ "typings.d.ts"
25
+ ]
26
+ }
File without changes
@@ -16,7 +16,7 @@
16
16
  "ios >= 8"
17
17
  ],
18
18
  "dependencies": {
19
- "@baic/preset-yolk-miniapp": "~{{ yolkVersion }}",
19
+ "@baic/preset-yolk-taro-miniprogram": "~{{ yolkVersion }}",
20
20
  "babel-preset-taro": "3.x"
21
21
  }
22
22
  }
@@ -0,0 +1,16 @@
1
+ # http://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [*.md]
13
+ trim_trailing_whitespace = false
14
+
15
+ [Makefile]
16
+ indent_style = tab
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "@baic/eslint-config-yolk-mobile",
3
+ "parserOptions": {
4
+ "project": "./tsconfig.json"
5
+ }
6
+ }
File without changes
File without changes
@@ -0,0 +1,11 @@
1
+ {
2
+ "singleQuote": true,
3
+ "trailingComma": "all",
4
+ "printWidth": 80,
5
+ "overrides": [
6
+ {
7
+ "files": ".prettierrc",
8
+ "options": { "parser": "json" }
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "@baic/stylelint-config-yolk"
3
+ }
File without changes
File without changes
File without changes
@@ -0,0 +1,11 @@
1
+ {
2
+ "private": true,
3
+ "name": "{{ projectName }}",
4
+ "scripts": {
5
+ "start": "yolk start",
6
+ "build": "yolk build"
7
+ },
8
+ "dependencies": {
9
+ "@baic/preset-yolk-umi-mobile": "~{{ yolkVersion }}"
10
+ }
11
+ }
File without changes
@@ -0,0 +1,3 @@
1
+ import { Request } from '@baic/yolk-mobile';
2
+
3
+ export default new Request();
@@ -0,0 +1,7 @@
1
+ import { Util } from '@baic/yolk-mobile';
2
+
3
+ const util = {
4
+ ...Util,
5
+ };
6
+
7
+ export default util;
File without changes
File without changes
@@ -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,17 @@
1
+ import * as React from 'react';
2
+ import { Form } from 'antd-mobile';
3
+ import { Input, useForm } from '@baic/yolk-mobile';
4
+
5
+ export default () => {
6
+ const [form] = useForm();
7
+ const { createFormItem } = form;
8
+ return (
9
+ <Form form={form}>
10
+ {createFormItem({
11
+ label: 'Input',
12
+ name: 'Input',
13
+ rules: 'required',
14
+ })(<Input maxLength={5} />)}
15
+ </Form>
16
+ );
17
+ };
@@ -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,17 @@
1
+ import * as React from 'react';
2
+ import { Form } from 'antd-mobile';
3
+ import { NumberInput, useForm } from '@baic/yolk-mobile';
4
+
5
+ export default () => {
6
+ const [form] = useForm();
7
+ const { createFormItem } = form;
8
+ return (
9
+ <Form form={form}>
10
+ {createFormItem({
11
+ label: 'default',
12
+ name: 'NumberInput',
13
+ rules: 'required',
14
+ })(<NumberInput />)}
15
+ </Form>
16
+ );
17
+ };
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { Form } from 'antd-mobile';
3
+ import { NumberInput, useForm } from '@baic/yolk-mobile';
4
+
5
+ export default () => {
6
+ const [form] = useForm();
7
+ const { createFormItem } = form;
8
+ return (
9
+ <Form form={form}>
10
+ {createFormItem({
11
+ label: 'decimal',
12
+ name: 'NumberInput',
13
+ rules: 'required',
14
+ })(<NumberInput decimal={3} />)}
15
+ </Form>
16
+ );
17
+ };
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { Form } from 'antd-mobile';
3
+ import { NumberInput, useForm } from '@baic/yolk-mobile';
4
+
5
+ export default () => {
6
+ const [form] = useForm();
7
+ const { createFormItem } = form;
8
+ return (
9
+ <Form form={form}>
10
+ {createFormItem({
11
+ label: 'zeroStart',
12
+ name: 'NumberInput',
13
+ rules: 'required',
14
+ })(<NumberInput zeroStart />)}
15
+ </Form>
16
+ );
17
+ };
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { Form } from 'antd-mobile';
3
+ import { NumberInput, useForm } from '@baic/yolk-mobile';
4
+
5
+ export default () => {
6
+ const [form] = useForm();
7
+ const { createFormItem } = form;
8
+ return (
9
+ <Form form={form}>
10
+ {createFormItem({
11
+ label: 'negative',
12
+ name: 'NumberInput',
13
+ rules: 'required',
14
+ })(<NumberInput negative />)}
15
+ </Form>
16
+ );
17
+ };
@@ -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,76 @@
1
+ import * as React from 'react';
2
+
3
+ import _ from 'lodash';
4
+
5
+ import { Tabs, Collapse } from 'antd-mobile';
6
+
7
+ import BarCode from './examples/BarCode';
8
+ import Iconfont from './examples/Iconfont';
9
+ import Input from './examples/Input';
10
+ import Loading from './examples/Loading';
11
+ import NumberInput_1 from './examples/NumberInput/1';
12
+ import NumberInput_2 from './examples/NumberInput/2';
13
+ import NumberInput_3 from './examples/NumberInput/3';
14
+ import NumberInput_4 from './examples/NumberInput/4';
15
+ import QrCode from './examples/QrCode';
16
+ import Required from './examples/Required';
17
+ import TimerButton from './examples/TimerButton';
18
+ import usePreload from './examples/usePreload';
19
+
20
+ const { Tab } = Tabs;
21
+ const { Panel } = Collapse;
22
+
23
+ const tabs: Record<
24
+ string,
25
+ React.FunctionComponent | Record<string, React.FunctionComponent>
26
+ > = {
27
+ BarCode,
28
+ Iconfont,
29
+ Input,
30
+ Loading,
31
+ NumberInput: {
32
+ NumberInput_1,
33
+ NumberInput_2,
34
+ NumberInput_3,
35
+ NumberInput_4,
36
+ },
37
+ QrCode,
38
+ Required,
39
+ TimerButton,
40
+ usePreload,
41
+ };
42
+
43
+ export default () => {
44
+ const keys = Object.keys(tabs);
45
+ return (
46
+ <Tabs defaultActiveKey={keys[4]}>
47
+ {keys.map((key) => {
48
+ const tab = tabs[key];
49
+ if (_.isFunction(tab)) {
50
+ return (
51
+ <Tab key={key} title={key}>
52
+ {React.createElement(tab)}
53
+ </Tab>
54
+ );
55
+ }
56
+ if (_.isObject(tab)) {
57
+ const keys2 = Object.keys(tab);
58
+ return (
59
+ <Tab key={key} title={key}>
60
+ <Collapse accordion defaultActiveKey={keys2[0]}>
61
+ {keys2.map((key2) => {
62
+ const tab2 = tab[key2];
63
+ return (
64
+ <Panel key={key2} title={key2}>
65
+ {React.createElement(tab2)}
66
+ </Panel>
67
+ );
68
+ })}
69
+ </Collapse>
70
+ </Tab>
71
+ );
72
+ }
73
+ })}
74
+ </Tabs>
75
+ );
76
+ };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+
3
+ export default () => <div>Hello world</div>;
@@ -0,0 +1,3 @@
1
+ export interface User {
2
+ id?: string;
3
+ }
File without changes
@@ -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';
@@ -0,0 +1,16 @@
1
+ # http://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [*.md]
13
+ trim_trailing_whitespace = false
14
+
15
+ [Makefile]
16
+ indent_style = tab
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "@baic/eslint-config-yolk-web",
3
+ "parserOptions": {
4
+ "project": "./tsconfig.json"
5
+ }
6
+ }
File without changes
File without changes
@@ -0,0 +1,11 @@
1
+ {
2
+ "singleQuote": true,
3
+ "trailingComma": "all",
4
+ "printWidth": 80,
5
+ "overrides": [
6
+ {
7
+ "files": ".prettierrc",
8
+ "options": { "parser": "json" }
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "@baic/stylelint-config-yolk"
3
+ }
File without changes
File without changes
@@ -0,0 +1,34 @@
1
+ # web
2
+
3
+ ## Getting Started
4
+
5
+ Install dependencies,
6
+
7
+ {{ #dependenciesInstallType }}
8
+
9
+ ```bash
10
+ $ {{ dependenciesInstallType }} install
11
+ ```
12
+
13
+ {{ /dependenciesInstallType }}
14
+ {{ ^dependenciesInstallType }}
15
+
16
+ ```bash
17
+ $ yarn install
18
+ ```
19
+
20
+ {{ /dependenciesInstallType }}
21
+
22
+ Start the dev server,
23
+
24
+ ```bash
25
+ $ npm start
26
+ ```
27
+
28
+ Build,
29
+
30
+ ```bash
31
+ $ npm run build
32
+ ```
33
+
34
+ [查阅文档](https://303394539.github.io/yolk-docs/)
@@ -6,6 +6,6 @@
6
6
  "build": "yolk build"
7
7
  },
8
8
  "dependencies": {
9
- "@baic/preset-yolk-mobile": "~{{ yolkVersion }}"
9
+ "@baic/preset-yolk-umi-web": "~{{ yolkVersion }}"
10
10
  }
11
11
  }
File without changes
@@ -0,0 +1,3 @@
1
+ import { Request } from '@baic/yolk-web';
2
+
3
+ export default new Request();
@@ -0,0 +1,7 @@
1
+ import { Util } from '@baic/yolk-web';
2
+
3
+ const util = {
4
+ ...Util,
5
+ };
6
+
7
+ export default util;
File without changes
@@ -0,0 +1,3 @@
1
+ #yolk-app {
2
+ height: 100%;
3
+ }
File without changes
File without changes
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { Form } from 'antd';
3
+ import { BankInput, useForm } from '@baic/yolk-web';
4
+
5
+ export default () => {
6
+ const [form] = useForm();
7
+ const { createFormItem } = form;
8
+ return (
9
+ <Form form={form}>
10
+ {createFormItem({ name: 'BankInput' })(<BankInput />)}
11
+ </Form>
12
+ );
13
+ };