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 CHANGED
@@ -1,3 +1,2 @@
1
1
  # v2.0.0
2
2
 
3
- Completely reconstructed,Documentation coming soon...
@@ -1,7 +1,7 @@
1
1
  import { Keyframes } from "@emotion/serialize";
2
2
  export declare const maskHide: Keyframes;
3
- export declare type DialogType = "center" | "pullUp" | "pullDown" | "pullLeft" | "pullRight";
4
- export declare type AnimationStatus = "show" | "hide";
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;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import * as CSS from "csstype";
2
+ import * as CSS from 'csstype';
3
3
  export interface FlexProps extends React.HTMLProps<HTMLDivElement> {
4
4
  children?: React.ReactNode;
5
5
  alignItems?: CSS.Property.AlignItems;
@@ -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 = "center", alignContent, justifyContent, flexFlow, flexWrap, flexDirection } = props, extra = __rest(props, ["children", "alignItems", "alignContent", "justifyContent", "flexFlow", "flexWrap", "flexDirection"]);
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: "flex",
16
+ display: 'flex',
17
17
  alignItems,
18
18
  alignContent,
19
19
  justifyContent,
@@ -1,8 +1,8 @@
1
- export declare type CountdownValueIndex = "d" | "h" | "i" | "s";
2
- export declare type CountdownValue = {
1
+ export type CountdownValueIndex = "d" | "h" | "i" | "s";
2
+ export type CountdownValue = {
3
3
  [key in CountdownValueIndex]?: number;
4
4
  };
5
- export declare type UpdateCallback = (value: CountdownValue) => void;
5
+ export type UpdateCallback = (value: CountdownValue) => void;
6
6
  export interface CountdownOption {
7
7
  remain?: number | string;
8
8
  onUpdate?: UpdateCallback;
@@ -1,5 +1,5 @@
1
1
  import dayjs from 'dayjs';
2
- export declare type AgoValue = {
2
+ export type AgoValue = {
3
3
  num: number;
4
4
  unit: 'y' | 'm' | 'd' | 'h' | 'i' | 's';
5
5
  format: string;
@@ -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 declare type RouteMethod = 'browser' | 'hash' | 'memory';
6
- export declare type AwaitValue<T> = T | Promise<T>;
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
- renderLoading?: (pathname?: string) => AwaitValue<React.ReactNode>;
10
+ onLoadingPage?: (pathname?: string) => AwaitValue<React.ReactNode>;
11
11
  renderPage?: (pathname?: string) => AwaitValue<React.ReactNode>;
12
12
  routeMethod?: RouteMethod;
13
13
  defaultRoute?: string;
@@ -51,7 +51,7 @@ export function createApp(option) {
51
51
  'designWidth',
52
52
  'globalStyle',
53
53
  ]);
54
- const { onBeforeRenderPage, onAfterRenderPage, renderLoading, renderPage } = option;
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 renderLoading === 'function') {
74
- setPage(yield (renderLoading === null || renderLoading === void 0 ? void 0 : renderLoading(pathname)));
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));
@@ -7,8 +7,8 @@
7
7
  * params: 请求体为URLSearchParams,data为JSON对象或URLSearchParams
8
8
  * buffer: 请求体data只能为ArrayBuffer、TypeArray、DataView
9
9
  */
10
- export declare type SendType = "normal" | "text" | "form" | "json" | "blob" | "params" | "buffer";
11
- export declare type SendDataType = BodyInit | Record<string, any>;
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 declare type BuildUrlOption = Pick<RequestOption, "url" | "data" | "disableUrlCache" | "transmitPageParam" | "sendType">;
24
- export declare type StandardAjaxResult = {
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.7",
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.0",
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.17",
47
- "@types/react-dom": "^18.0.6",
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.7.4"
48
+ "typescript": "^4.9.5"
51
49
  }
52
50
  }