@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.
- package/lib/index.js +1 -1
- package/package.json +2 -2
- package/templates/{mobile → ice-mobile}/.editorconfig +0 -0
- package/templates/{mobile → ice-mobile}/.eslintrc +0 -0
- package/templates/ice-mobile/.gitignore.tpl +26 -0
- package/templates/ice-mobile/.ice.ts +3 -0
- package/templates/ice-mobile/.prettierignore +9 -0
- package/templates/{mobile → ice-mobile}/.prettierrc +0 -0
- package/templates/{mobile → ice-mobile}/.stylelintrc +0 -0
- package/templates/{web → ice-mobile}/README.md.tpl +0 -0
- package/templates/ice-mobile/package.json.tpl +11 -0
- package/templates/{mobile → ice-mobile}/public/favicon.ico +0 -0
- package/templates/ice-mobile/public/index.html +13 -0
- package/templates/ice-mobile/src/app.tsx +12 -0
- package/templates/{mobile → ice-mobile}/src/common/request.ts +0 -0
- package/templates/{mobile → ice-mobile}/src/common/util.ts +0 -0
- package/templates/{mobile → ice-mobile}/src/components/index.ts +0 -0
- package/templates/{mobile → ice-mobile}/src/global.less +0 -0
- package/templates/ice-mobile/src/layouts/index.tsx +5 -0
- package/templates/{mobile → ice-mobile}/src/pages/404.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/demo/examples/BarCode.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/demo/examples/Iconfont.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/demo/examples/Input.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/demo/examples/Loading.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/demo/examples/NumberInput/1.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/demo/examples/NumberInput/2.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/demo/examples/NumberInput/3.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/demo/examples/NumberInput/4.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/demo/examples/QrCode.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/demo/examples/Required.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/demo/examples/TimerButton.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/demo/examples/usePreload.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/demo/index.tsx +0 -0
- package/templates/{mobile → ice-mobile}/src/pages/index.tsx +0 -0
- package/templates/ice-mobile/src/routes.ts +28 -0
- package/templates/{mobile → ice-mobile}/src/types/user.d.ts +0 -0
- package/templates/ice-mobile/tsconfig.json +26 -0
- package/templates/{mobile → ice-mobile}/typings.d.ts +0 -0
- package/templates/{web → ice-web}/.editorconfig +0 -0
- package/templates/ice-web/.eslintcache +1 -0
- package/templates/{web → ice-web}/.eslintrc +0 -0
- package/templates/ice-web/.gitignore.tpl +26 -0
- package/templates/ice-web/.ice.ts +3 -0
- package/templates/ice-web/.prettierignore +9 -0
- package/templates/{web → ice-web}/.prettierrc +0 -0
- package/templates/{web → ice-web}/.stylelintrc +0 -0
- package/templates/ice-web/README.md.tpl +34 -0
- package/templates/{web → ice-web}/package.json.tpl +1 -1
- package/templates/{web → ice-web}/public/favicon.ico +0 -0
- package/templates/ice-web/public/index.html +13 -0
- package/templates/ice-web/src/app.tsx +12 -0
- package/templates/{web → ice-web}/src/common/request.ts +0 -0
- package/templates/{web → ice-web}/src/common/util.ts +0 -0
- package/templates/{web → ice-web}/src/components/index.ts +0 -0
- package/templates/ice-web/src/global.less +5 -0
- package/templates/ice-web/src/layouts/index.tsx +5 -0
- package/templates/ice-web/src/pages/404.tsx +17 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/BankInput.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/BarCode.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Collapse.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/DatePicker.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Flex.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Grid/1.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Grid/2.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Grid/3.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Grid/4.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Grid/5.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Grid/6.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Iconfont.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/ImagePreview.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Input/1.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Input/2.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/LinkButton/1.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/LinkButton/2.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/LinkButton/3.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Loading.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/MobileInput.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/NumberInput.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/PagingTable.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/QrCode.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/RangeNumber/1.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/RangeNumber/2.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Required.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/SearchLayout.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Table/1.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Table/2.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Table/3.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Table/4.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/TimerButton.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Title/1.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Title/2.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/WaterMark.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/Wrapper.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/examples/usePreload.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/demo/index.tsx +0 -0
- package/templates/{web → ice-web}/src/pages/index.tsx +0 -0
- package/templates/ice-web/src/routes.ts +28 -0
- package/templates/{web → ice-web}/src/types/user.d.ts +0 -0
- package/templates/ice-web/tsconfig.json +26 -0
- package/templates/{web → ice-web}/typings.d.ts +0 -0
- package/templates/miniprogram/package.json.tpl +1 -1
- package/templates/umi-mobile/.editorconfig +16 -0
- package/templates/umi-mobile/.eslintrc +6 -0
- package/templates/{mobile → umi-mobile}/.gitignore.tpl +0 -0
- package/templates/{mobile → umi-mobile}/.prettierignore +0 -0
- package/templates/umi-mobile/.prettierrc +11 -0
- package/templates/umi-mobile/.stylelintrc +3 -0
- package/templates/{mobile → umi-mobile}/.umirc.ts.tpl +0 -0
- package/templates/{mobile → umi-mobile}/LICENSE +0 -0
- package/templates/{mobile → umi-mobile}/README.md.tpl +0 -0
- package/templates/umi-mobile/package.json.tpl +11 -0
- package/templates/umi-mobile/public/favicon.ico +0 -0
- package/templates/{mobile → umi-mobile}/src/app.tsx +0 -0
- package/templates/umi-mobile/src/common/request.ts +3 -0
- package/templates/umi-mobile/src/common/util.ts +7 -0
- package/templates/umi-mobile/src/components/index.ts +0 -0
- package/templates/{web → umi-mobile}/src/global.less +0 -0
- package/templates/{mobile → umi-mobile}/src/layouts/index.tsx +0 -0
- package/templates/umi-mobile/src/pages/404.tsx +10 -0
- package/templates/umi-mobile/src/pages/demo/examples/BarCode.tsx +4 -0
- package/templates/umi-mobile/src/pages/demo/examples/Iconfont.tsx +18 -0
- package/templates/umi-mobile/src/pages/demo/examples/Input.tsx +17 -0
- package/templates/umi-mobile/src/pages/demo/examples/Loading.tsx +12 -0
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/1.tsx +17 -0
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/2.tsx +17 -0
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/3.tsx +17 -0
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/4.tsx +17 -0
- package/templates/umi-mobile/src/pages/demo/examples/QrCode.tsx +4 -0
- package/templates/umi-mobile/src/pages/demo/examples/Required.tsx +4 -0
- package/templates/umi-mobile/src/pages/demo/examples/TimerButton.tsx +4 -0
- package/templates/umi-mobile/src/pages/demo/examples/usePreload.tsx +9 -0
- package/templates/umi-mobile/src/pages/demo/index.tsx +76 -0
- package/templates/umi-mobile/src/pages/index.tsx +3 -0
- package/templates/umi-mobile/src/types/user.d.ts +3 -0
- package/templates/{mobile → umi-mobile}/tsconfig.json +0 -0
- package/templates/umi-mobile/typings.d.ts +16 -0
- package/templates/umi-web/.editorconfig +16 -0
- package/templates/umi-web/.eslintrc +6 -0
- package/templates/{web → umi-web}/.gitignore.tpl +0 -0
- package/templates/{web → umi-web}/.prettierignore +0 -0
- package/templates/umi-web/.prettierrc +11 -0
- package/templates/umi-web/.stylelintrc +3 -0
- package/templates/{web → umi-web}/.umirc.ts.tpl +0 -0
- package/templates/{web → umi-web}/LICENSE +0 -0
- package/templates/umi-web/README.md.tpl +34 -0
- package/templates/{mobile → umi-web}/package.json.tpl +1 -1
- package/templates/umi-web/public/favicon.ico +0 -0
- package/templates/{web → umi-web}/src/app.tsx +0 -0
- package/templates/umi-web/src/common/request.ts +3 -0
- package/templates/umi-web/src/common/util.ts +7 -0
- package/templates/umi-web/src/components/index.ts +0 -0
- package/templates/umi-web/src/global.less +3 -0
- package/templates/{web → umi-web}/src/layouts/index.tsx +0 -0
- package/templates/{web → umi-web}/src/pages/404.tsx +0 -0
- package/templates/umi-web/src/pages/demo/examples/BankInput.tsx +13 -0
- package/templates/umi-web/src/pages/demo/examples/BarCode.tsx +4 -0
- package/templates/umi-web/src/pages/demo/examples/Collapse.tsx +4 -0
- package/templates/umi-web/src/pages/demo/examples/DatePicker.tsx +4 -0
- package/templates/umi-web/src/pages/demo/examples/Flex.tsx +10 -0
- package/templates/umi-web/src/pages/demo/examples/Grid/1.tsx +25 -0
- package/templates/umi-web/src/pages/demo/examples/Grid/2.tsx +26 -0
- package/templates/umi-web/src/pages/demo/examples/Grid/3.tsx +37 -0
- package/templates/umi-web/src/pages/demo/examples/Grid/4.tsx +43 -0
- package/templates/umi-web/src/pages/demo/examples/Grid/5.tsx +36 -0
- package/templates/umi-web/src/pages/demo/examples/Grid/6.tsx +28 -0
- package/templates/umi-web/src/pages/demo/examples/Iconfont.tsx +18 -0
- package/templates/umi-web/src/pages/demo/examples/ImagePreview.tsx +20 -0
- package/templates/umi-web/src/pages/demo/examples/Input/1.tsx +4 -0
- package/templates/umi-web/src/pages/demo/examples/Input/2.tsx +80 -0
- package/templates/umi-web/src/pages/demo/examples/LinkButton/1.tsx +4 -0
- package/templates/umi-web/src/pages/demo/examples/LinkButton/2.tsx +9 -0
- package/templates/umi-web/src/pages/demo/examples/LinkButton/3.tsx +12 -0
- package/templates/umi-web/src/pages/demo/examples/Loading.tsx +12 -0
- package/templates/umi-web/src/pages/demo/examples/MobileInput.tsx +4 -0
- package/templates/umi-web/src/pages/demo/examples/NumberInput.tsx +4 -0
- package/templates/umi-web/src/pages/demo/examples/PagingTable.tsx +21 -0
- package/templates/umi-web/src/pages/demo/examples/QrCode.tsx +4 -0
- package/templates/umi-web/src/pages/demo/examples/RangeNumber/1.tsx +4 -0
- package/templates/umi-web/src/pages/demo/examples/RangeNumber/2.tsx +15 -0
- package/templates/umi-web/src/pages/demo/examples/Required.tsx +4 -0
- package/templates/umi-web/src/pages/demo/examples/SearchLayout.tsx +46 -0
- package/templates/umi-web/src/pages/demo/examples/Table/1.tsx +64 -0
- package/templates/umi-web/src/pages/demo/examples/Table/2.tsx +29 -0
- package/templates/umi-web/src/pages/demo/examples/Table/3.tsx +39 -0
- package/templates/umi-web/src/pages/demo/examples/Table/4.tsx +42 -0
- package/templates/umi-web/src/pages/demo/examples/TimerButton.tsx +4 -0
- package/templates/umi-web/src/pages/demo/examples/Title/1.tsx +4 -0
- package/templates/umi-web/src/pages/demo/examples/Title/2.tsx +5 -0
- package/templates/umi-web/src/pages/demo/examples/WaterMark.tsx +8 -0
- package/templates/umi-web/src/pages/demo/examples/Wrapper.tsx +40 -0
- package/templates/umi-web/src/pages/demo/examples/usePreload.tsx +9 -0
- package/templates/umi-web/src/pages/demo/index.tsx +135 -0
- package/templates/umi-web/src/pages/index.tsx +3 -0
- package/templates/umi-web/src/types/user.d.ts +3 -0
- package/templates/{web → umi-web}/tsconfig.json +0 -0
- package/templates/umi-web/typings.d.ts +16 -0
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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,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,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
|
+
};
|
|
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
|
|
File without changes
|
|
File without changes
|
|
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/)
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
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
|
+
};
|