@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
@@ -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,43 @@
1
+ import * as React from 'react';
2
+ import { Radio, Divider } from 'antd';
3
+ import { RadioChangeEvent } from 'antd/es/radio/interface';
4
+ import { Grid, GridProps } from '@baic/yolk-web';
5
+
6
+ export default () => {
7
+ const [size, setSize] = React.useState<GridProps['size']>('middle');
8
+ const onChangeHandler = React.useCallback(
9
+ (e: RadioChangeEvent) => setSize(e.target.value),
10
+ [],
11
+ );
12
+ return (
13
+ <>
14
+ <Radio.Group value={size} onChange={onChangeHandler}>
15
+ <Radio.Button value="small">small</Radio.Button>
16
+ <Radio.Button value="middle">middle</Radio.Button>
17
+ <Radio.Button value="large">large</Radio.Button>
18
+ </Radio.Group>
19
+ <Divider />
20
+ <Grid
21
+ size={size}
22
+ data={[
23
+ {
24
+ label: '标题',
25
+ value: '内容',
26
+ },
27
+ {
28
+ label: '标题',
29
+ value: '内容',
30
+ },
31
+ {
32
+ label: '标题',
33
+ value: '内容',
34
+ },
35
+ {
36
+ label: '标题',
37
+ value: '内容',
38
+ },
39
+ ]}
40
+ />
41
+ </>
42
+ );
43
+ };
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ import { Form } from 'antd';
3
+ import { Grid, Input, useForm } from '@baic/yolk-web';
4
+
5
+ export default () => {
6
+ const [form] = useForm();
7
+ const { createFormItem } = form;
8
+ return (
9
+ <Form form={form}>
10
+ <Grid
11
+ data={[
12
+ {
13
+ label: '标题',
14
+ value: createFormItem({
15
+ name: 'content',
16
+ rules: 'required',
17
+ })(<Input />),
18
+ required: true,
19
+ },
20
+ {
21
+ label: '标题',
22
+ value: '内容',
23
+ },
24
+ {
25
+ label: '标题',
26
+ value: '内容',
27
+ },
28
+ {
29
+ label: '标题',
30
+ value: '内容',
31
+ },
32
+ ]}
33
+ />
34
+ </Form>
35
+ );
36
+ };
@@ -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
+ };
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { Button } from 'antd';
3
+ import { ImagePreview } from '@baic/yolk-web';
4
+
5
+ export default () => {
6
+ const [visible, setVisible] = React.useState(false);
7
+ const onClickHandler = React.useCallback(() => setVisible(true), []);
8
+ const onCloseHandler = React.useCallback(() => setVisible(false), []);
9
+ return (
10
+ <>
11
+ <Button onClick={onClickHandler}>预览图片</Button>
12
+ <ImagePreview
13
+ visible={visible}
14
+ onClose={onCloseHandler}
15
+ urls={['https://avatars.githubusercontent.com/u/1750965']}
16
+ current="https://avatars.githubusercontent.com/u/1750965"
17
+ />
18
+ </>
19
+ );
20
+ };
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { Input } from '@baic/yolk-web';
3
+
4
+ export default () => <Input />;
@@ -0,0 +1,80 @@
1
+ import * as React from 'react';
2
+ import { Form, Button, Divider } from 'antd';
3
+ import { useForm } from '@baic/yolk-web';
4
+ import {
5
+ Config,
6
+ Input,
7
+ NumberInput,
8
+ MobileInput,
9
+ BankInput,
10
+ Grid,
11
+ } from '@baic/yolk-web';
12
+
13
+ export default () => {
14
+ const [form] = useForm();
15
+ const { createFormItem, setFieldsValue, resetFields } = form;
16
+ const [edit, setEdit] = React.useState(true);
17
+ const onClickHandler = React.useCallback(() => {
18
+ if (edit) {
19
+ setEdit(false);
20
+ setFieldsValue({
21
+ grid_name: '某某',
22
+ grid_age: 18,
23
+ grid_mobile: '13000000000',
24
+ grid_bankNumber: '0000000000000000',
25
+ });
26
+ } else {
27
+ setEdit(true);
28
+ resetFields();
29
+ }
30
+ }, [edit, setFieldsValue, resetFields]);
31
+ return (
32
+ <>
33
+ <Button onClick={onClickHandler}>{edit ? '详情' : '编辑'}</Button>
34
+ <Divider />
35
+ <Config edit={edit}>
36
+ <Form form={form}>
37
+ <Grid
38
+ data={[
39
+ {
40
+ label: '姓名',
41
+ value: createFormItem({
42
+ name: 'grid_name',
43
+ rules: 'required',
44
+ })(<Input />),
45
+ required: edit,
46
+ },
47
+ {
48
+ label: '年龄',
49
+ value: createFormItem({
50
+ name: 'grid_age',
51
+ rules: 'required',
52
+ })(<NumberInput maxLength={3} />),
53
+ required: edit,
54
+ },
55
+ {
56
+ label: '电话号码',
57
+ value: createFormItem({
58
+ name: 'grid_mobile',
59
+ rules: {
60
+ required: true,
61
+ mobile: true,
62
+ },
63
+ })(<MobileInput />),
64
+ required: edit,
65
+ },
66
+ {
67
+ label: '银行卡号',
68
+ value: createFormItem({
69
+ name: 'grid_bankNumber',
70
+ rules: 'required',
71
+ })(<BankInput />),
72
+ required: edit,
73
+ },
74
+ ]}
75
+ />
76
+ </Form>
77
+ </Config>
78
+ </>
79
+ );
80
+ };
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { LinkButton } from '@baic/yolk-web';
3
+
4
+ export default () => <LinkButton onClick={() => {}}>操作</LinkButton>;
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { LinkButton } from '@baic/yolk-web';
3
+
4
+ export default () => (
5
+ <LinkButton.Merge>
6
+ <LinkButton onClick={() => {}}>修改</LinkButton>
7
+ <LinkButton>删除</LinkButton>
8
+ </LinkButton.Merge>
9
+ );
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { LinkButton } from '@baic/yolk-web';
3
+
4
+ export default () => (
5
+ <LinkButton.Group>
6
+ <LinkButton onClick={() => {}}>编辑</LinkButton>
7
+ <LinkButton.Merge>
8
+ <LinkButton onClick={() => {}}>修改</LinkButton>
9
+ <LinkButton>删除</LinkButton>
10
+ </LinkButton.Merge>
11
+ </LinkButton.Group>
12
+ );
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { Loading } from '@baic/yolk-web';
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 { MobileInput } from '@baic/yolk-web';
3
+
4
+ export default () => <MobileInput />;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { NumberInput } from '@baic/yolk-web';
3
+
4
+ export default () => <NumberInput />;
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ import { PagingTable, Input } from '@baic/yolk-web';
3
+
4
+ export default () => {
5
+ return (
6
+ <PagingTable
7
+ url=""
8
+ columns={[
9
+ {
10
+ dataIndex: 'name',
11
+ title: 'name',
12
+ },
13
+ ]}
14
+ search={({ createFormItem }) => [
15
+ createFormItem({
16
+ name: 'Input',
17
+ })(<Input />),
18
+ ]}
19
+ />
20
+ );
21
+ };
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { QrCode } from '@baic/yolk-web';
3
+
4
+ export default () => <QrCode value="https://www.baidu.com" />;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { RangeNumber } from '@baic/yolk-web';
3
+
4
+ export default () => <RangeNumber />;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { Form } from 'antd';
3
+ import { RangeNumber, 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({
11
+ name: 'RangeNumber',
12
+ })(<RangeNumber />)}
13
+ </Form>
14
+ );
15
+ };
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { Required } from '@baic/yolk-web';
3
+
4
+ export default () => <Required>必填</Required>;
@@ -0,0 +1,46 @@
1
+ import * as React from 'react';
2
+ import { Form } from 'antd';
3
+ import { useForm } from '@baic/yolk-web';
4
+ import {
5
+ SearchLayout,
6
+ Input,
7
+ NumberInput,
8
+ MobileInput,
9
+ BankInput,
10
+ } from '@baic/yolk-web';
11
+
12
+ export default () => {
13
+ const [form] = useForm();
14
+ const { createFormItem } = form;
15
+ return (
16
+ <Form form={form}>
17
+ <SearchLayout
18
+ data={[
19
+ createFormItem({
20
+ name: 'name',
21
+ label: '姓名',
22
+ rules: 'required',
23
+ })(<Input />),
24
+ createFormItem({
25
+ name: 'age',
26
+ label: '年龄',
27
+ rules: 'required',
28
+ })(<NumberInput maxLength={3} />),
29
+ createFormItem({
30
+ name: 'mobile',
31
+ label: '电话号码',
32
+ rules: {
33
+ required: true,
34
+ mobile: true,
35
+ },
36
+ })(<MobileInput />),
37
+ createFormItem({
38
+ name: 'bankNumber',
39
+ label: '银行卡号',
40
+ rules: 'required',
41
+ })(<BankInput />),
42
+ ]}
43
+ />
44
+ </Form>
45
+ );
46
+ };
@@ -0,0 +1,64 @@
1
+ import * as React from 'react';
2
+ import { Table } from '@baic/yolk-web';
3
+
4
+ export default () => (
5
+ <Table
6
+ columns={[
7
+ {
8
+ dataIndex: 'a',
9
+ title: 'a',
10
+ formatter: v => v,
11
+ },
12
+ {
13
+ dataIndex: 'b',
14
+ title: 'b',
15
+ ellipsis: true,
16
+ },
17
+ {
18
+ dataIndex: 'b',
19
+ title: 'b',
20
+ ellipsis: 5,
21
+ },
22
+ {
23
+ dataIndex: 'b',
24
+ title: 'b',
25
+ ellipsis: () => '123',
26
+ },
27
+ {
28
+ dataIndex: 'a',
29
+ title: 'a',
30
+ fontWeight: 'bold',
31
+ },
32
+ {
33
+ dataIndex: 'a',
34
+ title: 'a',
35
+ unit: '元',
36
+ },
37
+ {
38
+ dataIndex: 'a',
39
+ title: 'a',
40
+ tag: true,
41
+ },
42
+ {
43
+ dataIndex: 'a',
44
+ title: 'a',
45
+ tag: {
46
+ color: 'red',
47
+ },
48
+ },
49
+ {
50
+ dataIndex: 'a',
51
+ title: 'a',
52
+ tag: 'red',
53
+ },
54
+ ]}
55
+ dataSource={[
56
+ {
57
+ a: '1',
58
+ b: '124125125151251251515125',
59
+ c: true,
60
+ d: null,
61
+ },
62
+ ]}
63
+ />
64
+ );
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ import { Table } from '@baic/yolk-web';
3
+
4
+ export default () => (
5
+ <Table
6
+ bordered
7
+ dragSort
8
+ columns={[
9
+ {
10
+ dataIndex: 'a',
11
+ title: 'a',
12
+ },
13
+ {
14
+ dataIndex: 'b',
15
+ title: 'b',
16
+ },
17
+ ]}
18
+ dataSource={[
19
+ {
20
+ a: '1',
21
+ b: '1',
22
+ },
23
+ {
24
+ a: '2',
25
+ b: '2',
26
+ },
27
+ ]}
28
+ />
29
+ );
@@ -0,0 +1,39 @@
1
+ import * as React from 'react';
2
+ import { message } from 'antd';
3
+ import { Table } from '@baic/yolk-web';
4
+
5
+ export default () => (
6
+ <Table
7
+ bordered
8
+ dragSort={{
9
+ header: {
10
+ onSortEnd: ({ oldIndex, newIndex }) =>
11
+ message.success(`排序结束, 从${oldIndex}到${newIndex}`),
12
+ },
13
+ body: {
14
+ onSortEnd: ({ oldIndex, newIndex }) =>
15
+ message.success(`排序结束, 从${oldIndex}到${newIndex}`),
16
+ },
17
+ }}
18
+ columns={[
19
+ {
20
+ dataIndex: 'a',
21
+ title: 'a',
22
+ },
23
+ {
24
+ dataIndex: 'b',
25
+ title: 'b',
26
+ },
27
+ ]}
28
+ dataSource={[
29
+ {
30
+ a: '1',
31
+ b: '1',
32
+ },
33
+ {
34
+ a: '2',
35
+ b: '2',
36
+ },
37
+ ]}
38
+ />
39
+ );