clxx 2.0.7 → 2.0.8
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/README.md +0 -1
- package/build/Dialog/style.d.ts +2 -2
- package/build/Flex/index.d.ts +1 -1
- package/build/Flex/index.js +2 -2
- package/build/utils/Countdown.d.ts +3 -3
- package/build/utils/ago.d.ts +1 -1
- package/build/utils/createApp.d.ts +3 -3
- package/build/utils/createApp.js +3 -3
- package/build/utils/request.d.ts +4 -4
- package/package.json +6 -8
package/README.md
CHANGED
package/build/Dialog/style.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Keyframes } from "@emotion/serialize";
|
|
2
2
|
export declare const maskHide: Keyframes;
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type DialogType = "center" | "pullUp" | "pullDown" | "pullLeft" | "pullRight";
|
|
4
|
+
export type AnimationStatus = "show" | "hide";
|
|
5
5
|
export declare function getAnimation(type: DialogType, status: AnimationStatus): {
|
|
6
6
|
keyframes: Keyframes;
|
|
7
7
|
animation: import("@emotion/utils").SerializedStyles;
|
package/build/Flex/index.d.ts
CHANGED
package/build/Flex/index.js
CHANGED
|
@@ -11,9 +11,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
13
13
|
export function Flex(props) {
|
|
14
|
-
const { children, alignItems =
|
|
14
|
+
const { children, alignItems = 'center', alignContent, justifyContent, flexFlow, flexWrap, flexDirection } = props, extra = __rest(props, ["children", "alignItems", "alignContent", "justifyContent", "flexFlow", "flexWrap", "flexDirection"]);
|
|
15
15
|
return (_jsx("div", Object.assign({ css: {
|
|
16
|
-
display:
|
|
16
|
+
display: 'flex',
|
|
17
17
|
alignItems,
|
|
18
18
|
alignContent,
|
|
19
19
|
justifyContent,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type CountdownValueIndex = "d" | "h" | "i" | "s";
|
|
2
|
+
export type CountdownValue = {
|
|
3
3
|
[key in CountdownValueIndex]?: number;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type UpdateCallback = (value: CountdownValue) => void;
|
|
6
6
|
export interface CountdownOption {
|
|
7
7
|
remain?: number | string;
|
|
8
8
|
onUpdate?: UpdateCallback;
|
package/build/utils/ago.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import { History } from 'history';
|
|
3
3
|
import { ContainerProps } from '../Container';
|
|
4
4
|
import { ContextValue } from '../context';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type RouteMethod = 'browser' | 'hash' | 'memory';
|
|
6
|
+
export type AwaitValue<T> = T | Promise<T>;
|
|
7
7
|
export interface CreateAppOption extends Omit<ContainerProps, 'children'>, ContextValue {
|
|
8
8
|
onBeforeRenderPage?: (pathname?: string) => AwaitValue<void>;
|
|
9
9
|
onAfterRenderPage?: (pathname?: string) => AwaitValue<void>;
|
|
10
|
-
|
|
10
|
+
onLoadingPage?: (pathname?: string) => AwaitValue<React.ReactNode>;
|
|
11
11
|
renderPage?: (pathname?: string) => AwaitValue<React.ReactNode>;
|
|
12
12
|
routeMethod?: RouteMethod;
|
|
13
13
|
defaultRoute?: string;
|
package/build/utils/createApp.js
CHANGED
|
@@ -51,7 +51,7 @@ export function createApp(option) {
|
|
|
51
51
|
'designWidth',
|
|
52
52
|
'globalStyle',
|
|
53
53
|
]);
|
|
54
|
-
const { onBeforeRenderPage, onAfterRenderPage,
|
|
54
|
+
const { onBeforeRenderPage, onAfterRenderPage, onLoadingPage, renderPage } = option;
|
|
55
55
|
// 设置上下文属性
|
|
56
56
|
setContextValue(context);
|
|
57
57
|
/**
|
|
@@ -70,8 +70,8 @@ export function createApp(option) {
|
|
|
70
70
|
pathname = option.defaultRoute.replace(pathReg, '');
|
|
71
71
|
}
|
|
72
72
|
// 如果有loading,要先显示loading
|
|
73
|
-
if (typeof
|
|
74
|
-
setPage(yield (
|
|
73
|
+
if (typeof onLoadingPage === 'function') {
|
|
74
|
+
setPage(yield (onLoadingPage === null || onLoadingPage === void 0 ? void 0 : onLoadingPage(pathname)));
|
|
75
75
|
}
|
|
76
76
|
// 加载页面之前可能会存在的逻辑
|
|
77
77
|
yield (onBeforeRenderPage === null || onBeforeRenderPage === void 0 ? void 0 : onBeforeRenderPage(pathname));
|
package/build/utils/request.d.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* params: 请求体为URLSearchParams,data为JSON对象或URLSearchParams
|
|
8
8
|
* buffer: 请求体data只能为ArrayBuffer、TypeArray、DataView
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
11
|
-
export
|
|
10
|
+
export type SendType = "normal" | "text" | "form" | "json" | "blob" | "params" | "buffer";
|
|
11
|
+
export type SendDataType = BodyInit | Record<string, any>;
|
|
12
12
|
/**
|
|
13
13
|
* 请求对象参数
|
|
14
14
|
*/
|
|
@@ -20,8 +20,8 @@ export interface RequestOption extends RequestInit {
|
|
|
20
20
|
transmitPageParam?: boolean;
|
|
21
21
|
timeout?: number;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
24
|
-
export
|
|
23
|
+
export type BuildUrlOption = Pick<RequestOption, "url" | "data" | "disableUrlCache" | "transmitPageParam" | "sendType">;
|
|
24
|
+
export type StandardAjaxResult = {
|
|
25
25
|
code: number;
|
|
26
26
|
message?: string;
|
|
27
27
|
data?: any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clxx",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "Basic JS library for mobile devices",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"module": "./build/index.js",
|
|
@@ -33,20 +33,18 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@emotion/react": "^11.10.
|
|
36
|
+
"@emotion/react": "^11.10.6",
|
|
37
37
|
"dayjs": "^1.11.5",
|
|
38
38
|
"history": "^5.3.0",
|
|
39
39
|
"lodash": "^4.17.21",
|
|
40
40
|
"react": "^18.2.0",
|
|
41
|
-
"react-dom": "^18.2.0"
|
|
42
|
-
"swiper": "^8.3.2"
|
|
41
|
+
"react-dom": "^18.2.0"
|
|
43
42
|
},
|
|
44
43
|
"devDependencies": {
|
|
45
44
|
"@types/lodash": "^4.14.182",
|
|
46
|
-
"@types/react": "^18.0.
|
|
47
|
-
"@types/react-dom": "^18.0.
|
|
48
|
-
"@types/swiper": "^6.0.0",
|
|
45
|
+
"@types/react": "^18.0.37",
|
|
46
|
+
"@types/react-dom": "^18.0.11",
|
|
49
47
|
"csstype": "^3.1.0",
|
|
50
|
-
"typescript": "^4.
|
|
48
|
+
"typescript": "^4.9.5"
|
|
51
49
|
}
|
|
52
50
|
}
|