@baic/yolk-cli 2.0.1-alpha.0 → 2.0.1-alpha.11
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/{templates/web/base/LICENSE → LICENSE} +1 -1
- package/README.md +6 -6
- package/{bin → lib}/index.d.ts +0 -0
- package/lib/index.js +2 -0
- package/package.json +25 -21
- package/templates/{miniapp/base/.editorconfig.tpl → miniprogram/.editorconfig} +0 -0
- package/templates/miniprogram/.eslintrc +6 -0
- package/templates/{miniapp/base/.prettierignore.tpl → miniprogram/.prettierignore} +0 -0
- package/templates/{miniapp/base/.prettierrc.tpl → miniprogram/.prettierrc} +0 -0
- package/templates/{miniapp/base → miniprogram}/.stylelintrc.json +1 -1
- package/templates/{miniapp/base → miniprogram}/LICENSE +0 -0
- package/templates/{mobile/base → miniprogram}/README.md.tpl +5 -1
- package/templates/miniprogram/babel.config.js +3 -0
- package/templates/miniprogram/config/index.ts.tpl +11 -0
- package/templates/miniprogram/global.d.ts +33 -0
- package/templates/{miniapp/base → miniprogram}/package.json.tpl +2 -3
- package/templates/{miniapp/base → miniprogram}/project.config.json.tpl +18 -3
- package/templates/{miniapp/base → miniprogram}/project.tt.json.tpl +0 -0
- package/templates/{miniapp/base → miniprogram}/src/app.config.ts +1 -3
- package/templates/{miniapp/base → miniprogram}/src/app.scss +0 -0
- package/templates/miniprogram/src/app.tsx +19 -0
- package/templates/{miniapp/base → miniprogram}/src/common/request.ts +1 -1
- package/templates/{web/base → miniprogram}/src/common/util.ts +1 -1
- package/templates/{miniapp/base → miniprogram}/src/components/index.ts +0 -0
- package/templates/miniprogram/src/constants.ts +1 -0
- package/templates/{miniapp/base → miniprogram}/src/hooks/index.ts +0 -0
- package/templates/{miniapp/base → miniprogram}/src/images/empty.gif +0 -0
- package/templates/{miniapp/base → miniprogram}/src/index.html +0 -0
- package/templates/miniprogram/src/pages/demo/examples/Input.tsx +3 -0
- package/templates/miniprogram/src/pages/demo/examples/MobileInput.tsx +3 -0
- package/templates/miniprogram/src/pages/demo/examples/MoneyInput.tsx +3 -0
- package/templates/miniprogram/src/pages/demo/examples/NumberInput.tsx +3 -0
- package/templates/miniprogram/src/pages/demo/examples/Textarea.tsx +3 -0
- package/templates/miniprogram/src/pages/demo/examples/TimerButton.tsx +3 -0
- package/templates/miniprogram/src/pages/demo/examples/usePreload.tsx +10 -0
- package/templates/miniprogram/src/pages/demo/index.config.ts +5 -0
- package/templates/{miniapp/base/src/pages/index → miniprogram/src/pages/demo}/index.module.scss +0 -0
- package/templates/miniprogram/src/pages/demo/index.tsx +44 -0
- package/templates/{miniapp/base → miniprogram}/src/pages/index/index.config.ts +0 -0
- package/templates/miniprogram/src/pages/index/index.module.scss +3 -0
- package/templates/{miniapp/base → miniprogram}/src/pages/index/index.tsx +1 -3
- package/templates/miniprogram/src/theme.scss +4 -0
- package/templates/{miniapp/base → miniprogram}/src/types/user.d.ts +0 -0
- package/templates/{miniapp/base → miniprogram}/tsconfig.json +3 -9
- package/templates/mobile/{base/.editorconfig.tpl → .editorconfig} +0 -0
- package/templates/mobile/{base/.eslintrc.tpl → .eslintrc} +0 -0
- package/templates/mobile/{base/.prettierignore.tpl → .prettierignore} +0 -0
- package/templates/mobile/{base/.prettierrc.tpl → .prettierrc} +0 -0
- package/templates/mobile/{base/.stylelintrc.json → .stylelintrc.json} +1 -1
- package/templates/mobile/{base/.umirc.ts.tpl → .umirc.ts.tpl} +1 -1
- package/templates/mobile/{base/LICENSE → LICENSE} +0 -0
- package/templates/{miniapp/base → mobile}/README.md.tpl +6 -2
- package/templates/{web/base → mobile}/package.json.tpl +2 -3
- package/templates/mobile/{base/public → public}/favicon.ico +0 -0
- package/templates/mobile/src/app.tsx +24 -0
- package/templates/mobile/src/common/request.ts +3 -0
- package/templates/{miniapp/base → mobile}/src/common/util.ts +1 -1
- package/templates/mobile/{base/src → src}/components/index.ts +0 -0
- package/templates/mobile/{base/src → src}/global.less +1 -1
- package/templates/mobile/src/layouts/index.tsx +4 -0
- package/templates/mobile/src/pages/404.tsx +10 -0
- package/templates/mobile/src/pages/demo/examples/BarCode.tsx +4 -0
- package/templates/mobile/src/pages/demo/examples/Iconfont.tsx +18 -0
- package/templates/mobile/src/pages/demo/examples/Loading.tsx +12 -0
- package/templates/mobile/src/pages/demo/examples/QrCode.tsx +4 -0
- package/templates/mobile/src/pages/demo/examples/Required.tsx +4 -0
- package/templates/mobile/src/pages/demo/examples/TimerButton.tsx +4 -0
- package/templates/mobile/src/pages/demo/examples/usePreload.tsx +9 -0
- package/templates/mobile/src/pages/demo/index.tsx +39 -0
- package/templates/mobile/src/pages/index.tsx +3 -0
- package/templates/mobile/{base/src → src}/types/user.d.ts +1 -1
- package/templates/{web/base → mobile}/tsconfig.json +2 -2
- package/templates/mobile/typings.d.ts +16 -0
- package/templates/web/{base/.editorconfig.tpl → .editorconfig} +0 -0
- package/templates/web/{base/.eslintrc.tpl → .eslintrc} +0 -0
- package/templates/web/{base/.prettierignore.tpl → .prettierignore} +0 -0
- package/templates/web/{base/.prettierrc.tpl → .prettierrc} +0 -0
- package/templates/web/{base/.stylelintrc.json → .stylelintrc.json} +1 -1
- package/templates/web/.umirc.ts +6 -0
- package/templates/web/LICENSE +21 -0
- package/templates/web/{base/README.md.tpl → README.md.tpl} +6 -2
- package/templates/{mobile/base → web}/package.json.tpl +2 -3
- package/templates/web/{base/public → public}/favicon.ico +0 -0
- package/templates/web/src/app.tsx +25 -0
- package/templates/web/src/common/request.ts +3 -0
- package/templates/{mobile/base → web}/src/common/util.ts +1 -1
- package/templates/web/{base/src → src}/components/index.ts +0 -0
- package/templates/web/{base/src → src}/global.less +1 -1
- package/templates/web/src/layouts/index.tsx +4 -0
- package/templates/web/{base/src → src}/pages/404.tsx +0 -0
- package/templates/web/src/pages/demo/examples/BankInput.tsx +14 -0
- package/templates/web/src/pages/demo/examples/BarCode.tsx +4 -0
- package/templates/web/src/pages/demo/examples/Collapse.tsx +4 -0
- package/templates/web/src/pages/demo/examples/DatePicker.tsx +4 -0
- package/templates/web/src/pages/demo/examples/Flex.tsx +10 -0
- package/templates/web/src/pages/demo/examples/Grid/1.tsx +25 -0
- package/templates/web/src/pages/demo/examples/Grid/2.tsx +26 -0
- package/templates/web/src/pages/demo/examples/Grid/3.tsx +37 -0
- package/templates/web/src/pages/demo/examples/Grid/4.tsx +44 -0
- package/templates/web/src/pages/demo/examples/Grid/5.tsx +37 -0
- package/templates/web/src/pages/demo/examples/Grid/6.tsx +28 -0
- package/templates/web/src/pages/demo/examples/Iconfont.tsx +18 -0
- package/templates/web/src/pages/demo/examples/ImagePreview.tsx +20 -0
- package/templates/web/src/pages/demo/examples/Input/1.tsx +4 -0
- package/templates/web/src/pages/demo/examples/Input/2.tsx +80 -0
- package/templates/web/src/pages/demo/examples/LinkButton/1.tsx +4 -0
- package/templates/web/src/pages/demo/examples/LinkButton/2.tsx +9 -0
- package/templates/web/src/pages/demo/examples/LinkButton/3.tsx +12 -0
- package/templates/web/src/pages/demo/examples/Loading.tsx +12 -0
- package/templates/web/src/pages/demo/examples/MobileInput.tsx +4 -0
- package/templates/web/src/pages/demo/examples/NumberInput.tsx +4 -0
- package/templates/web/src/pages/demo/examples/QrCode.tsx +4 -0
- package/templates/web/src/pages/demo/examples/RangeNumber/1.tsx +4 -0
- package/templates/web/src/pages/demo/examples/RangeNumber/2.tsx +16 -0
- package/templates/web/src/pages/demo/examples/Required.tsx +4 -0
- package/templates/web/src/pages/demo/examples/SearchLayout.tsx +46 -0
- package/templates/web/src/pages/demo/examples/Table/1.tsx +64 -0
- package/templates/web/src/pages/demo/examples/Table/2.tsx +29 -0
- package/templates/web/src/pages/demo/examples/Table/3.tsx +39 -0
- package/templates/web/src/pages/demo/examples/Table/4.tsx +42 -0
- package/templates/web/src/pages/demo/examples/TimerButton.tsx +4 -0
- package/templates/web/src/pages/demo/examples/Title/1.tsx +4 -0
- package/templates/web/src/pages/demo/examples/Title/2.tsx +5 -0
- package/templates/web/src/pages/demo/examples/WaterMark.tsx +8 -0
- package/templates/web/src/pages/demo/examples/Wrapper.tsx +40 -0
- package/templates/web/src/pages/demo/examples/usePreload.tsx +9 -0
- package/templates/web/src/pages/demo/index.tsx +133 -0
- package/templates/web/src/pages/index.tsx +3 -0
- package/templates/web/{base/src → src}/types/user.d.ts +1 -1
- package/templates/{mobile/base → web}/tsconfig.json +2 -2
- package/templates/web/typings.d.ts +16 -0
- package/bin/index.js +0 -665
- package/templates/miniapp/base/.eslintrc.js.tpl +0 -6
- package/templates/miniapp/base/.gitignore.tpl +0 -38
- package/templates/miniapp/base/babel.config.js +0 -3
- package/templates/miniapp/base/config/index.ts.tpl +0 -8
- package/templates/miniapp/base/global.d.ts +0 -18
- package/templates/miniapp/base/src/app.tsx +0 -26
- package/templates/miniapp/base/src/constants.ts +0 -1
- package/templates/miniapp/base/src/store/index.ts +0 -34
- package/templates/miniapp/base/src/theme.scss +0 -4
- package/templates/mobile/base/.gitignore.tpl +0 -33
- package/templates/mobile/base/__tests__/__snapshots__/pages.test.tsx.snap +0 -88
- package/templates/mobile/base/__tests__/pages.test.tsx +0 -11
- package/templates/mobile/base/src/app.tsx +0 -27
- package/templates/mobile/base/src/common/request.ts +0 -3
- package/templates/mobile/base/src/layouts/index.less +0 -103
- package/templates/mobile/base/src/layouts/index.tsx +0 -48
- package/templates/mobile/base/src/pages/404.tsx +0 -12
- package/templates/mobile/base/src/pages/index.tsx +0 -3
- package/templates/mobile/base/src/store/index.ts +0 -17
- package/templates/mobile/base/typings.d.ts +0 -8
- package/templates/web/base/.gitignore.tpl +0 -33
- package/templates/web/base/.umirc.ts.tpl +0 -6
- package/templates/web/base/__tests__/__snapshots__/pages.test.tsx.snap +0 -112
- package/templates/web/base/__tests__/pages.test.tsx +0 -11
- package/templates/web/base/src/app.tsx +0 -36
- package/templates/web/base/src/common/request.ts +0 -3
- package/templates/web/base/src/layouts/index.less +0 -11
- package/templates/web/base/src/layouts/index.tsx +0 -94
- package/templates/web/base/src/pages/index.tsx +0 -3
- package/templates/web/base/src/store/index.ts +0 -17
- package/templates/web/base/typings.d.ts +0 -8
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
-
|
|
3
|
-
# dependencies
|
|
4
|
-
/node_modules
|
|
5
|
-
/.pnp
|
|
6
|
-
.pnp.js
|
|
7
|
-
.prettierrc.js
|
|
8
|
-
|
|
9
|
-
# testing
|
|
10
|
-
/coverage
|
|
11
|
-
|
|
12
|
-
# production
|
|
13
|
-
/build
|
|
14
|
-
dist/
|
|
15
|
-
|
|
16
|
-
# misc
|
|
17
|
-
.DS_Store
|
|
18
|
-
.env.local
|
|
19
|
-
.env.development.local
|
|
20
|
-
.env.test.local
|
|
21
|
-
.env.production.local
|
|
22
|
-
|
|
23
|
-
# temp
|
|
24
|
-
.temp/
|
|
25
|
-
.rn_temp/
|
|
26
|
-
deploy_versions/
|
|
27
|
-
|
|
28
|
-
npm-debug.log*
|
|
29
|
-
yarn-debug.log*
|
|
30
|
-
yarn-error.log*
|
|
31
|
-
.history/
|
|
32
|
-
package-lock.json
|
|
33
|
-
yarn.lock
|
|
34
|
-
*less.d.ts*
|
|
35
|
-
*scss.d.ts*
|
|
36
|
-
.eslintcache
|
|
37
|
-
.vscode
|
|
38
|
-
project.private.config.json
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare module "*.png";
|
|
2
|
-
declare module "*.gif";
|
|
3
|
-
declare module "*.jpg";
|
|
4
|
-
declare module "*.jpeg";
|
|
5
|
-
declare module "*.svg";
|
|
6
|
-
declare module "*.css";
|
|
7
|
-
declare module "*.less";
|
|
8
|
-
declare module "*.scss";
|
|
9
|
-
declare module "*.sass";
|
|
10
|
-
declare module "*.styl";
|
|
11
|
-
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
declare const process: {
|
|
14
|
-
env: {
|
|
15
|
-
TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt' | 'quickapp' | 'qq' | 'jd';
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Provider as ReduxProvider } from 'react-redux';
|
|
3
|
-
|
|
4
|
-
import { Provider } from '@baic/yolk-miniapp';
|
|
5
|
-
|
|
6
|
-
import { Provider as UIProvider } from '@baic/yolk-miniapp-ui';
|
|
7
|
-
|
|
8
|
-
import request from '@/common/request';
|
|
9
|
-
|
|
10
|
-
import configStore from './store';
|
|
11
|
-
|
|
12
|
-
import './app.scss';
|
|
13
|
-
|
|
14
|
-
const store = configStore();
|
|
15
|
-
|
|
16
|
-
interface Props {
|
|
17
|
-
children: React.ReactNode;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default ({ children }: Props) => (
|
|
21
|
-
<Provider request={request}>
|
|
22
|
-
<UIProvider inputMaxLength={40}>
|
|
23
|
-
<ReduxProvider store={store}>{children}</ReduxProvider>
|
|
24
|
-
</UIProvider>
|
|
25
|
-
</Provider>
|
|
26
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const REQUEST_HOST = '';
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { createStore, combineReducers, applyMiddleware, compose } from 'redux';
|
|
2
|
-
import thunkMiddleware from 'redux-thunk';
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface Window {
|
|
6
|
-
__REDUX_DEVTOOLS_EXTENSION_COMPOSE__: (obj: any) => Function;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const composeEnhancers =
|
|
11
|
-
typeof window === 'object' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
|
12
|
-
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
|
|
13
|
-
// Specify extension’s options like name, actionsBlacklist, actionsCreators, serialize...
|
|
14
|
-
})
|
|
15
|
-
: compose;
|
|
16
|
-
|
|
17
|
-
const middlewares = [thunkMiddleware];
|
|
18
|
-
|
|
19
|
-
if (
|
|
20
|
-
process.env.NODE_ENV === 'development' &&
|
|
21
|
-
process.env.TARO_ENV !== 'quickapp'
|
|
22
|
-
) {
|
|
23
|
-
middlewares.push(require('redux-logger').createLogger());
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const enhancer = composeEnhancers(
|
|
27
|
-
applyMiddleware(...middlewares),
|
|
28
|
-
// other store enhancers if any
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
export default function configStore() {
|
|
32
|
-
const store = createStore(combineReducers({}), enhancer);
|
|
33
|
-
return store;
|
|
34
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
-
|
|
3
|
-
# dependencies
|
|
4
|
-
/node_modules
|
|
5
|
-
/npm-debug.log*
|
|
6
|
-
/yarn-error.log
|
|
7
|
-
/yarn.lock
|
|
8
|
-
/package-lock.json
|
|
9
|
-
|
|
10
|
-
# production
|
|
11
|
-
/dist
|
|
12
|
-
/build
|
|
13
|
-
|
|
14
|
-
# misc
|
|
15
|
-
.DS_Store
|
|
16
|
-
|
|
17
|
-
# umi
|
|
18
|
-
/src/.umi
|
|
19
|
-
/src/.umi-production
|
|
20
|
-
/src/.umi-test
|
|
21
|
-
/.env.local
|
|
22
|
-
coverage
|
|
23
|
-
.eslintcache
|
|
24
|
-
*less.d.ts*
|
|
25
|
-
*scss.d.ts*
|
|
26
|
-
.mfsu*
|
|
27
|
-
|
|
28
|
-
# ide
|
|
29
|
-
.vscode
|
|
30
|
-
|
|
31
|
-
# h5+app
|
|
32
|
-
/h5+app/unpackage/cache
|
|
33
|
-
/h5+app/unpackage/release
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`pages Demo 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"asFragment": [Function],
|
|
6
|
-
"baseElement": <body>
|
|
7
|
-
<div>
|
|
8
|
-
<div
|
|
9
|
-
style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; display: flex; align-items: center; justify-content: center; padding: 10px;"
|
|
10
|
-
>
|
|
11
|
-
<div
|
|
12
|
-
class="am-activity-indicator am-activity-indicator-sm"
|
|
13
|
-
>
|
|
14
|
-
<span
|
|
15
|
-
aria-label="loading"
|
|
16
|
-
class="am-activity-indicator-spinner"
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
</body>,
|
|
22
|
-
"container": <div>
|
|
23
|
-
<div
|
|
24
|
-
style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; display: flex; align-items: center; justify-content: center; padding: 10px;"
|
|
25
|
-
>
|
|
26
|
-
<div
|
|
27
|
-
class="am-activity-indicator am-activity-indicator-sm"
|
|
28
|
-
>
|
|
29
|
-
<span
|
|
30
|
-
aria-label="loading"
|
|
31
|
-
class="am-activity-indicator-spinner"
|
|
32
|
-
/>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</div>,
|
|
36
|
-
"debug": [Function],
|
|
37
|
-
"findAllByAltText": [Function],
|
|
38
|
-
"findAllByDisplayValue": [Function],
|
|
39
|
-
"findAllByLabelText": [Function],
|
|
40
|
-
"findAllByPlaceholderText": [Function],
|
|
41
|
-
"findAllByRole": [Function],
|
|
42
|
-
"findAllByTestId": [Function],
|
|
43
|
-
"findAllByText": [Function],
|
|
44
|
-
"findAllByTitle": [Function],
|
|
45
|
-
"findByAltText": [Function],
|
|
46
|
-
"findByDisplayValue": [Function],
|
|
47
|
-
"findByLabelText": [Function],
|
|
48
|
-
"findByPlaceholderText": [Function],
|
|
49
|
-
"findByRole": [Function],
|
|
50
|
-
"findByTestId": [Function],
|
|
51
|
-
"findByText": [Function],
|
|
52
|
-
"findByTitle": [Function],
|
|
53
|
-
"getAllByAltText": [Function],
|
|
54
|
-
"getAllByDisplayValue": [Function],
|
|
55
|
-
"getAllByLabelText": [Function],
|
|
56
|
-
"getAllByPlaceholderText": [Function],
|
|
57
|
-
"getAllByRole": [Function],
|
|
58
|
-
"getAllByTestId": [Function],
|
|
59
|
-
"getAllByText": [Function],
|
|
60
|
-
"getAllByTitle": [Function],
|
|
61
|
-
"getByAltText": [Function],
|
|
62
|
-
"getByDisplayValue": [Function],
|
|
63
|
-
"getByLabelText": [Function],
|
|
64
|
-
"getByPlaceholderText": [Function],
|
|
65
|
-
"getByRole": [Function],
|
|
66
|
-
"getByTestId": [Function],
|
|
67
|
-
"getByText": [Function],
|
|
68
|
-
"getByTitle": [Function],
|
|
69
|
-
"queryAllByAltText": [Function],
|
|
70
|
-
"queryAllByDisplayValue": [Function],
|
|
71
|
-
"queryAllByLabelText": [Function],
|
|
72
|
-
"queryAllByPlaceholderText": [Function],
|
|
73
|
-
"queryAllByRole": [Function],
|
|
74
|
-
"queryAllByTestId": [Function],
|
|
75
|
-
"queryAllByText": [Function],
|
|
76
|
-
"queryAllByTitle": [Function],
|
|
77
|
-
"queryByAltText": [Function],
|
|
78
|
-
"queryByDisplayValue": [Function],
|
|
79
|
-
"queryByLabelText": [Function],
|
|
80
|
-
"queryByPlaceholderText": [Function],
|
|
81
|
-
"queryByRole": [Function],
|
|
82
|
-
"queryByTestId": [Function],
|
|
83
|
-
"queryByText": [Function],
|
|
84
|
-
"queryByTitle": [Function],
|
|
85
|
-
"rerender": [Function],
|
|
86
|
-
"unmount": [Function],
|
|
87
|
-
}
|
|
88
|
-
`;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
|
|
4
|
-
import Index from '../src/pages/index';
|
|
5
|
-
|
|
6
|
-
describe('pages', () => {
|
|
7
|
-
it('Demo', async () => {
|
|
8
|
-
const wrapper = render(<Index />);
|
|
9
|
-
expect(wrapper).toMatchSnapshot();
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Provider } from '@baic/yolk';
|
|
4
|
-
|
|
5
|
-
import { Provider as MobileProvider } from '@baic/yolk-mobile';
|
|
6
|
-
|
|
7
|
-
import { Provider as MobileUIProvider } from '@baic/yolk-mobile-ui';
|
|
8
|
-
|
|
9
|
-
import { Provider as ReactReduxProvider } from 'react-redux';
|
|
10
|
-
|
|
11
|
-
import request from '@/common/request';
|
|
12
|
-
|
|
13
|
-
import store from './store';
|
|
14
|
-
|
|
15
|
-
import '@baic/yolk-mobile-ui/lib/style/index.less';
|
|
16
|
-
|
|
17
|
-
export function rootContainer(container: React.ReactNode) {
|
|
18
|
-
return (
|
|
19
|
-
<Provider request={request}>
|
|
20
|
-
<ReactReduxProvider store={store}>
|
|
21
|
-
<MobileProvider>
|
|
22
|
-
<MobileUIProvider inputMaxLength={40}>{container}</MobileUIProvider>
|
|
23
|
-
</MobileProvider>
|
|
24
|
-
</ReactReduxProvider>
|
|
25
|
-
</Provider>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
.component-layout {
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 0;
|
|
4
|
-
right: 0;
|
|
5
|
-
bottom: 0;
|
|
6
|
-
left: 0;
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
.component-layout-scroller {
|
|
10
|
-
position: relative;
|
|
11
|
-
flex: 1;
|
|
12
|
-
overflow-y: auto;
|
|
13
|
-
&.has-footer {
|
|
14
|
-
margin-bottom: 20px;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
.component-layout-header {
|
|
18
|
-
z-index: 1000;
|
|
19
|
-
box-shadow: 0 5px 10px #efefef;
|
|
20
|
-
.am-navbar-left {
|
|
21
|
-
color: #000;
|
|
22
|
-
}
|
|
23
|
-
.am-navbar-title {
|
|
24
|
-
overflow: hidden;
|
|
25
|
-
.ellipsis {
|
|
26
|
-
overflow: hidden;
|
|
27
|
-
white-space: nowrap;
|
|
28
|
-
text-overflow: ellipsis;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
.component-layout-footer {
|
|
33
|
-
z-index: 1000;
|
|
34
|
-
display: flex;
|
|
35
|
-
height: 45px;
|
|
36
|
-
background-color: #fff;
|
|
37
|
-
box-shadow: 0 -5px 10px #efefef;
|
|
38
|
-
.component-layout-footer-item {
|
|
39
|
-
position: relative;
|
|
40
|
-
flex: 1;
|
|
41
|
-
color: #000;
|
|
42
|
-
font-size: 14px;
|
|
43
|
-
.btn {
|
|
44
|
-
position: absolute;
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
height: 45px;
|
|
49
|
-
.anticon {
|
|
50
|
-
font-size: 20px;
|
|
51
|
-
}
|
|
52
|
-
.name {
|
|
53
|
-
margin-left: 10px;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
&.selected {
|
|
57
|
-
pointer-events: none;
|
|
58
|
-
.btn {
|
|
59
|
-
flex-direction: column;
|
|
60
|
-
height: 60px;
|
|
61
|
-
padding: 0 24px;
|
|
62
|
-
background-color: #fb8346;
|
|
63
|
-
border-top-left-radius: 10px;
|
|
64
|
-
border-top-right-radius: 10px;
|
|
65
|
-
box-shadow: 0 0 5px #fb8346;
|
|
66
|
-
.anticon {
|
|
67
|
-
color: #fff;
|
|
68
|
-
}
|
|
69
|
-
.name {
|
|
70
|
-
margin-top: 4px;
|
|
71
|
-
margin-left: 0;
|
|
72
|
-
color: #fff;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
&:first-child {
|
|
77
|
-
&::before {
|
|
78
|
-
width: 0;
|
|
79
|
-
}
|
|
80
|
-
.btn {
|
|
81
|
-
right: 50px;
|
|
82
|
-
bottom: 0;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
&:last-child {
|
|
86
|
-
.btn {
|
|
87
|
-
bottom: 0;
|
|
88
|
-
left: 50px;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
&::before {
|
|
92
|
-
position: absolute;
|
|
93
|
-
top: 25%;
|
|
94
|
-
bottom: 25%;
|
|
95
|
-
left: 0;
|
|
96
|
-
width: 2px;
|
|
97
|
-
background-color: #d9d9d9;
|
|
98
|
-
box-shadow: 0 0 10px #efefef;
|
|
99
|
-
content: '';
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { IRouteComponentProps } from 'umi';
|
|
3
|
-
import classnames from 'classnames';
|
|
4
|
-
|
|
5
|
-
import { NavBar, Icon } from 'antd-mobile';
|
|
6
|
-
|
|
7
|
-
import style from './index.less';
|
|
8
|
-
|
|
9
|
-
export default ({
|
|
10
|
-
children,
|
|
11
|
-
location,
|
|
12
|
-
route,
|
|
13
|
-
history,
|
|
14
|
-
match,
|
|
15
|
-
}: IRouteComponentProps) => {
|
|
16
|
-
console.log(
|
|
17
|
-
{
|
|
18
|
-
children,
|
|
19
|
-
location,
|
|
20
|
-
route,
|
|
21
|
-
history,
|
|
22
|
-
match,
|
|
23
|
-
},
|
|
24
|
-
);
|
|
25
|
-
return (
|
|
26
|
-
<div className={style.componentLayout}>
|
|
27
|
-
<NavBar
|
|
28
|
-
className={style.componentLayoutHeader}
|
|
29
|
-
mode="light"
|
|
30
|
-
icon={<Icon type="left" />}
|
|
31
|
-
leftContent="返回"
|
|
32
|
-
/>
|
|
33
|
-
<div className={style.componentLayoutScroller}>{children}</div>
|
|
34
|
-
<div className={style.componentLayoutFooter}>
|
|
35
|
-
<div className={classnames(style.componentLayoutFooterItem, style.selected)}>
|
|
36
|
-
<div className={style.btn}>
|
|
37
|
-
<div className={style.name}>主 页</div>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
<div className={style.componentLayoutFooterItem}>
|
|
41
|
-
<div className={style.btn}>
|
|
42
|
-
<div className={style.name}>我 的</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Result, Icon } from 'antd-mobile';
|
|
3
|
-
|
|
4
|
-
export default () => (
|
|
5
|
-
<Result
|
|
6
|
-
img={
|
|
7
|
-
<Icon type="cross-circle-o" className="spe" style={{ fill: '#F13642' }} />
|
|
8
|
-
}
|
|
9
|
-
title="404"
|
|
10
|
-
message="对不起,您访问的页面不存在。"
|
|
11
|
-
/>
|
|
12
|
-
);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createStore, combineReducers, applyMiddleware } from 'redux';
|
|
2
|
-
|
|
3
|
-
import thunk from 'redux-thunk';
|
|
4
|
-
import { createLogger } from 'redux-logger';
|
|
5
|
-
|
|
6
|
-
const filterLogerAction: string[] = [];
|
|
7
|
-
|
|
8
|
-
const logger = createLogger({
|
|
9
|
-
predicate: (_, action) =>
|
|
10
|
-
action && !filterLogerAction.some((item) => item === action.type),
|
|
11
|
-
});
|
|
12
|
-
const middleware =
|
|
13
|
-
process.env.NODE_ENV !== 'production' ? [thunk, logger] : [thunk];
|
|
14
|
-
|
|
15
|
-
const store = createStore(combineReducers({}), applyMiddleware(...middleware));
|
|
16
|
-
|
|
17
|
-
export default store;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
-
|
|
3
|
-
# dependencies
|
|
4
|
-
/node_modules
|
|
5
|
-
/npm-debug.log*
|
|
6
|
-
/yarn-error.log
|
|
7
|
-
/yarn.lock
|
|
8
|
-
/package-lock.json
|
|
9
|
-
|
|
10
|
-
# production
|
|
11
|
-
/dist
|
|
12
|
-
/build
|
|
13
|
-
|
|
14
|
-
# misc
|
|
15
|
-
.DS_Store
|
|
16
|
-
|
|
17
|
-
# umi
|
|
18
|
-
/src/.umi
|
|
19
|
-
/src/.umi-production
|
|
20
|
-
/src/.umi-test
|
|
21
|
-
/.env.local
|
|
22
|
-
coverage
|
|
23
|
-
.eslintcache
|
|
24
|
-
*less.d.ts*
|
|
25
|
-
*scss.d.ts*
|
|
26
|
-
.mfsu*
|
|
27
|
-
|
|
28
|
-
# ide
|
|
29
|
-
.vscode
|
|
30
|
-
|
|
31
|
-
# h5+app
|
|
32
|
-
/h5+app/unpackage/cache
|
|
33
|
-
/h5+app/unpackage/release
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`pages Demo 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"asFragment": [Function],
|
|
6
|
-
"baseElement": <body>
|
|
7
|
-
<div>
|
|
8
|
-
<div
|
|
9
|
-
style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; display: flex; align-items: center; justify-content: center; padding: 10px;"
|
|
10
|
-
>
|
|
11
|
-
<div
|
|
12
|
-
class="ant-spin ant-spin-spinning"
|
|
13
|
-
>
|
|
14
|
-
<span
|
|
15
|
-
class="ant-spin-dot ant-spin-dot-spin"
|
|
16
|
-
>
|
|
17
|
-
<i
|
|
18
|
-
class="ant-spin-dot-item"
|
|
19
|
-
/>
|
|
20
|
-
<i
|
|
21
|
-
class="ant-spin-dot-item"
|
|
22
|
-
/>
|
|
23
|
-
<i
|
|
24
|
-
class="ant-spin-dot-item"
|
|
25
|
-
/>
|
|
26
|
-
<i
|
|
27
|
-
class="ant-spin-dot-item"
|
|
28
|
-
/>
|
|
29
|
-
</span>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</body>,
|
|
34
|
-
"container": <div>
|
|
35
|
-
<div
|
|
36
|
-
style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; display: flex; align-items: center; justify-content: center; padding: 10px;"
|
|
37
|
-
>
|
|
38
|
-
<div
|
|
39
|
-
class="ant-spin ant-spin-spinning"
|
|
40
|
-
>
|
|
41
|
-
<span
|
|
42
|
-
class="ant-spin-dot ant-spin-dot-spin"
|
|
43
|
-
>
|
|
44
|
-
<i
|
|
45
|
-
class="ant-spin-dot-item"
|
|
46
|
-
/>
|
|
47
|
-
<i
|
|
48
|
-
class="ant-spin-dot-item"
|
|
49
|
-
/>
|
|
50
|
-
<i
|
|
51
|
-
class="ant-spin-dot-item"
|
|
52
|
-
/>
|
|
53
|
-
<i
|
|
54
|
-
class="ant-spin-dot-item"
|
|
55
|
-
/>
|
|
56
|
-
</span>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
</div>,
|
|
60
|
-
"debug": [Function],
|
|
61
|
-
"findAllByAltText": [Function],
|
|
62
|
-
"findAllByDisplayValue": [Function],
|
|
63
|
-
"findAllByLabelText": [Function],
|
|
64
|
-
"findAllByPlaceholderText": [Function],
|
|
65
|
-
"findAllByRole": [Function],
|
|
66
|
-
"findAllByTestId": [Function],
|
|
67
|
-
"findAllByText": [Function],
|
|
68
|
-
"findAllByTitle": [Function],
|
|
69
|
-
"findByAltText": [Function],
|
|
70
|
-
"findByDisplayValue": [Function],
|
|
71
|
-
"findByLabelText": [Function],
|
|
72
|
-
"findByPlaceholderText": [Function],
|
|
73
|
-
"findByRole": [Function],
|
|
74
|
-
"findByTestId": [Function],
|
|
75
|
-
"findByText": [Function],
|
|
76
|
-
"findByTitle": [Function],
|
|
77
|
-
"getAllByAltText": [Function],
|
|
78
|
-
"getAllByDisplayValue": [Function],
|
|
79
|
-
"getAllByLabelText": [Function],
|
|
80
|
-
"getAllByPlaceholderText": [Function],
|
|
81
|
-
"getAllByRole": [Function],
|
|
82
|
-
"getAllByTestId": [Function],
|
|
83
|
-
"getAllByText": [Function],
|
|
84
|
-
"getAllByTitle": [Function],
|
|
85
|
-
"getByAltText": [Function],
|
|
86
|
-
"getByDisplayValue": [Function],
|
|
87
|
-
"getByLabelText": [Function],
|
|
88
|
-
"getByPlaceholderText": [Function],
|
|
89
|
-
"getByRole": [Function],
|
|
90
|
-
"getByTestId": [Function],
|
|
91
|
-
"getByText": [Function],
|
|
92
|
-
"getByTitle": [Function],
|
|
93
|
-
"queryAllByAltText": [Function],
|
|
94
|
-
"queryAllByDisplayValue": [Function],
|
|
95
|
-
"queryAllByLabelText": [Function],
|
|
96
|
-
"queryAllByPlaceholderText": [Function],
|
|
97
|
-
"queryAllByRole": [Function],
|
|
98
|
-
"queryAllByTestId": [Function],
|
|
99
|
-
"queryAllByText": [Function],
|
|
100
|
-
"queryAllByTitle": [Function],
|
|
101
|
-
"queryByAltText": [Function],
|
|
102
|
-
"queryByDisplayValue": [Function],
|
|
103
|
-
"queryByLabelText": [Function],
|
|
104
|
-
"queryByPlaceholderText": [Function],
|
|
105
|
-
"queryByRole": [Function],
|
|
106
|
-
"queryByTestId": [Function],
|
|
107
|
-
"queryByText": [Function],
|
|
108
|
-
"queryByTitle": [Function],
|
|
109
|
-
"rerender": [Function],
|
|
110
|
-
"unmount": [Function],
|
|
111
|
-
}
|
|
112
|
-
`;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
|
|
4
|
-
import Index from '../src/pages/index';
|
|
5
|
-
|
|
6
|
-
describe('pages', () => {
|
|
7
|
-
it('Demo', async () => {
|
|
8
|
-
const wrapper = render(<Index />);
|
|
9
|
-
expect(wrapper).toMatchSnapshot();
|
|
10
|
-
});
|
|
11
|
-
});
|