clxx 2.0.5 → 2.0.7

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 (66) hide show
  1. package/build/Ago/index.d.ts +3 -5
  2. package/build/Ago/index.js +6 -7
  3. package/build/Alert/Wrapper.d.ts +3 -4
  4. package/build/Alert/Wrapper.js +10 -17
  5. package/build/Alert/index.d.ts +2 -2
  6. package/build/Alert/index.js +9 -10
  7. package/build/AutoGrid/index.d.ts +4 -5
  8. package/build/AutoGrid/index.js +19 -21
  9. package/build/CarouselNotice/index.d.ts +4 -5
  10. package/build/CarouselNotice/index.js +20 -21
  11. package/build/Clickable/index.d.ts +2 -2
  12. package/build/Clickable/index.js +16 -10
  13. package/build/Container/index.d.ts +3 -4
  14. package/build/Container/index.js +37 -39
  15. package/build/Countdowner/index.d.ts +4 -5
  16. package/build/Countdowner/index.js +13 -14
  17. package/build/Dialog/Wrapper.d.ts +2 -2
  18. package/build/Dialog/Wrapper.js +6 -9
  19. package/build/Dialog/index.d.ts +3 -3
  20. package/build/Dialog/index.js +17 -12
  21. package/build/Flex/Col.d.ts +7 -9
  22. package/build/Flex/Col.js +14 -15
  23. package/build/Flex/Row.d.ts +7 -9
  24. package/build/Flex/Row.js +14 -15
  25. package/build/Flex/index.d.ts +2 -4
  26. package/build/Flex/index.js +5 -6
  27. package/build/Indicator/index.d.ts +4 -5
  28. package/build/Indicator/index.js +14 -15
  29. package/build/Loading/Wrapper.d.ts +6 -7
  30. package/build/Loading/Wrapper.js +14 -18
  31. package/build/Loading/index.d.ts +1 -1
  32. package/build/Loading/index.js +10 -11
  33. package/build/Overlay/index.d.ts +2 -4
  34. package/build/Overlay/index.js +15 -17
  35. package/build/SafeArea/index.d.ts +2 -4
  36. package/build/SafeArea/index.js +15 -10
  37. package/build/ScrollView/index.d.ts +2 -2
  38. package/build/ScrollView/index.js +3 -8
  39. package/build/Toast/Toast.d.ts +2 -2
  40. package/build/Toast/Toast.js +4 -5
  41. package/build/Toast/index.d.ts +2 -2
  42. package/build/Toast/index.js +13 -11
  43. package/build/Toast/style.d.ts +1 -1
  44. package/build/index.d.ts +1 -3
  45. package/build/index.js +1 -3
  46. package/build/utils/createApp.d.ts +7 -7
  47. package/build/utils/createApp.js +28 -22
  48. package/build/utils/dom.d.ts +5 -5
  49. package/build/utils/dom.js +14 -27
  50. package/package.json +16 -16
  51. package/build/Cascader/Column.d.ts +0 -13
  52. package/build/Cascader/Column.js +0 -65
  53. package/build/Cascader/Wrapper.d.ts +0 -21
  54. package/build/Cascader/Wrapper.js +0 -105
  55. package/build/Cascader/index.d.ts +0 -21
  56. package/build/Cascader/index.js +0 -63
  57. package/build/Cascader/style.d.ts +0 -4
  58. package/build/Cascader/style.js +0 -111
  59. package/build/Picker/Wrapper.d.ts +0 -20
  60. package/build/Picker/Wrapper.js +0 -92
  61. package/build/Picker/index.d.ts +0 -21
  62. package/build/Picker/index.js +0 -64
  63. package/build/Picker/style.d.ts +0 -3
  64. package/build/Picker/style.js +0 -122
  65. package/build/Picker/swiperStyle.d.ts +0 -1
  66. package/build/Picker/swiperStyle.js +0 -66
@@ -1,5 +1,4 @@
1
- /** @jsx jsx */
2
- import { jsx } from "@emotion/react";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
3
2
  import { Overlay } from "../Overlay";
4
3
  import { style, getAnimation } from "./style";
5
4
  export function Wrapper(props) {
@@ -27,11 +26,9 @@ export function Wrapper(props) {
27
26
  onBlankClick === null || onBlankClick === void 0 ? void 0 : onBlankClick(event);
28
27
  }
29
28
  };
30
- return (jsx(Overlay, { css: { overflow: "hidden" }, centerContent: type === "center", maskColor: "transparent", fullScreen: true, onClick: showMask ? undefined : blankClick },
31
- showMask && jsx("div", { css: maskCss, onClick: blankClick }),
32
- jsx("div", { css: [boxCss, boxStyle, animation], onAnimationEnd: (event) => {
33
- if (status === "hide" && event.animationName === keyframes.name) {
34
- onHide === null || onHide === void 0 ? void 0 : onHide();
35
- }
36
- } }, children)));
29
+ return (_jsxs(Overlay, Object.assign({ css: { overflow: "hidden" }, centerContent: type === "center", maskColor: "transparent", fullScreen: true, onClick: showMask ? undefined : blankClick }, { children: [showMask && _jsx("div", { css: maskCss, onClick: blankClick }), _jsx("div", Object.assign({ css: [boxCss, boxStyle, animation], onAnimationEnd: (event) => {
30
+ if (status === "hide" && event.animationName === keyframes.name) {
31
+ onHide === null || onHide === void 0 ? void 0 : onHide();
32
+ }
33
+ } }, { children: children }))] })));
37
34
  }
@@ -1,6 +1,6 @@
1
- import React from "react";
2
- import { DialogType } from "./style";
3
- import { WrapperProps } from "./Wrapper";
1
+ import React from 'react';
2
+ import { DialogType } from './style';
3
+ import { WrapperProps } from './Wrapper';
4
4
  export interface ShowDialogOption extends WrapperProps {
5
5
  blankClosable?: boolean;
6
6
  content?: React.ReactNode;
@@ -7,20 +7,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import React from "react";
11
- import { createPortalDOM } from "../utils/dom";
12
- import { Wrapper } from "./Wrapper";
13
- import isPlainObject from "lodash/isPlainObject";
14
- import omit from "lodash/omit";
10
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
11
+ import React from 'react';
12
+ import { createPortalDOM } from '../utils/dom';
13
+ import { Wrapper } from './Wrapper';
14
+ import isPlainObject from 'lodash/isPlainObject';
15
+ import omit from 'lodash/omit';
15
16
  /**
16
17
  * 显示一个对话框,出现和隐藏都带有动画效果
17
18
  * @param option
18
19
  * @returns
19
20
  */
20
21
  export function showDialog(option) {
21
- const { mount, destroy } = createPortalDOM();
22
+ const { mount, unmount } = createPortalDOM();
22
23
  // 生成全部配置
23
- let config = { status: "show", blankClosable: false };
24
+ let config = { status: 'show', blankClosable: false };
24
25
  if (React.isValidElement(option) || !isPlainObject(option)) {
25
26
  config.content = option;
26
27
  }
@@ -32,15 +33,19 @@ export function showDialog(option) {
32
33
  const children = config.content;
33
34
  const onBlankClick = config.onBlankClick;
34
35
  const onHide = config.onHide;
35
- const props = omit(config, ["blankClosable", "content", "onHide"]);
36
+ const props = omit(config, [
37
+ 'blankClosable',
38
+ 'content',
39
+ 'onHide',
40
+ ]);
36
41
  // 关闭弹窗
37
42
  const closeDialog = () => __awaiter(this, void 0, void 0, function* () {
38
- props.status = "hide";
43
+ props.status = 'hide';
39
44
  props.onHide = () => {
40
- destroy();
45
+ unmount();
41
46
  onHide === null || onHide === void 0 ? void 0 : onHide();
42
47
  };
43
- yield mount(React.createElement(Wrapper, Object.assign({}, props), children));
48
+ yield mount(_jsx(Wrapper, Object.assign({}, props, { children: children })));
44
49
  });
45
50
  // 空白处可点击关闭
46
51
  if (blankClosable) {
@@ -50,7 +55,7 @@ export function showDialog(option) {
50
55
  });
51
56
  }
52
57
  // 挂载容器对象
53
- const amountShow = mount(React.createElement(Wrapper, Object.assign({}, props), children));
58
+ const amountShow = mount(_jsx(Wrapper, Object.assign({}, props, { children: children })));
54
59
  return () => __awaiter(this, void 0, void 0, function* () {
55
60
  // 关闭前确保容器已经被挂载
56
61
  yield amountShow;
@@ -1,10 +1,8 @@
1
- /** @jsx jsx */
2
- import { jsx } from "@emotion/react";
3
- import { FlexProps } from ".";
4
- export declare function ColStart(props: FlexProps): jsx.JSX.Element;
5
- export declare function ColEnd(props: FlexProps): jsx.JSX.Element;
6
- export declare function ColCenter(props: FlexProps): jsx.JSX.Element;
7
- export declare function ColBetween(props: FlexProps): jsx.JSX.Element;
8
- export declare function ColAround(props: FlexProps): jsx.JSX.Element;
9
- export declare function ColEvenly(props: FlexProps): jsx.JSX.Element;
1
+ import { FlexProps } from '.';
2
+ export declare function ColStart(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
3
+ export declare function ColEnd(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
4
+ export declare function ColCenter(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
5
+ export declare function ColBetween(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
6
+ export declare function ColAround(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
7
+ export declare function ColEvenly(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
10
8
  export { ColStart as Col };
package/build/Flex/Col.js CHANGED
@@ -9,31 +9,30 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- /** @jsx jsx */
13
- import { jsx } from "@emotion/react";
14
- import { Flex } from ".";
12
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
13
+ import { Flex } from '.';
15
14
  export function ColStart(props) {
16
- const { flexDirection = "column", justifyContent = "flex-start" } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
17
- return (jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
15
+ const { flexDirection = 'column', justifyContent = 'flex-start' } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
16
+ return (_jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
18
17
  }
19
18
  export function ColEnd(props) {
20
- const { flexDirection = "column", justifyContent = "flex-end" } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
21
- return (jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
19
+ const { flexDirection = 'column', justifyContent = 'flex-end' } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
20
+ return (_jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
22
21
  }
23
22
  export function ColCenter(props) {
24
- const { flexDirection = "column", justifyContent = "center" } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
25
- return (jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
23
+ const { flexDirection = 'column', justifyContent = 'center' } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
24
+ return (_jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
26
25
  }
27
26
  export function ColBetween(props) {
28
- const { flexDirection = "column", justifyContent = "space-between" } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
29
- return (jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
27
+ const { flexDirection = 'column', justifyContent = 'space-between' } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
28
+ return (_jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
30
29
  }
31
30
  export function ColAround(props) {
32
- const { flexDirection = "column", justifyContent = "space-around" } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
33
- return (jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
31
+ const { flexDirection = 'column', justifyContent = 'space-around' } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
32
+ return (_jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
34
33
  }
35
34
  export function ColEvenly(props) {
36
- const { flexDirection = "column", justifyContent = "space-evenly" } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
37
- return (jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
35
+ const { flexDirection = 'column', justifyContent = 'space-evenly' } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
36
+ return (_jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
38
37
  }
39
38
  export { ColStart as Col };
@@ -1,10 +1,8 @@
1
- /** @jsx jsx */
2
- import { jsx } from "@emotion/react";
3
- import { FlexProps } from ".";
4
- export declare function RowStart(props: FlexProps): jsx.JSX.Element;
5
- export declare function RowEnd(props: FlexProps): jsx.JSX.Element;
6
- export declare function RowCenter(props: FlexProps): jsx.JSX.Element;
7
- export declare function RowBetween(props: FlexProps): jsx.JSX.Element;
8
- export declare function RowAround(props: FlexProps): jsx.JSX.Element;
9
- export declare function RowEvenly(props: FlexProps): jsx.JSX.Element;
1
+ import { FlexProps } from '.';
2
+ export declare function RowStart(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
3
+ export declare function RowEnd(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
4
+ export declare function RowCenter(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
5
+ export declare function RowBetween(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
6
+ export declare function RowAround(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
7
+ export declare function RowEvenly(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
10
8
  export { RowStart as Row };
package/build/Flex/Row.js CHANGED
@@ -9,31 +9,30 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- /** @jsx jsx */
13
- import { jsx } from "@emotion/react";
14
- import { Flex } from ".";
12
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
13
+ import { Flex } from '.';
15
14
  export function RowStart(props) {
16
- const { flexDirection = "row", justifyContent = "flex-start" } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
17
- return (jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
15
+ const { flexDirection = 'row', justifyContent = 'flex-start' } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
16
+ return (_jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
18
17
  }
19
18
  export function RowEnd(props) {
20
- const { flexDirection = "row", justifyContent = "flex-end" } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
21
- return (jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
19
+ const { flexDirection = 'row', justifyContent = 'flex-end' } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
20
+ return (_jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
22
21
  }
23
22
  export function RowCenter(props) {
24
- const { flexDirection = "row", justifyContent = "center" } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
25
- return (jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
23
+ const { flexDirection = 'row', justifyContent = 'center' } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
24
+ return (_jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
26
25
  }
27
26
  export function RowBetween(props) {
28
- const { flexDirection = "row", justifyContent = "space-between" } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
29
- return (jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
27
+ const { flexDirection = 'row', justifyContent = 'space-between' } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
28
+ return (_jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
30
29
  }
31
30
  export function RowAround(props) {
32
- const { flexDirection = "row", justifyContent = "space-around" } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
33
- return (jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
31
+ const { flexDirection = 'row', justifyContent = 'space-around' } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
32
+ return (_jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
34
33
  }
35
34
  export function RowEvenly(props) {
36
- const { flexDirection = "row", justifyContent = "space-evenly" } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
37
- return (jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
35
+ const { flexDirection = 'row', justifyContent = 'space-evenly' } = props, extra = __rest(props, ["flexDirection", "justifyContent"]);
36
+ return (_jsx(Flex, Object.assign({ flexDirection: flexDirection, justifyContent: justifyContent }, extra)));
38
37
  }
39
38
  export { RowStart as Row };
@@ -1,6 +1,4 @@
1
1
  /// <reference types="react" />
2
- /** @jsx jsx */
3
- import { jsx } from "@emotion/react";
4
2
  import * as CSS from "csstype";
5
3
  export interface FlexProps extends React.HTMLProps<HTMLDivElement> {
6
4
  children?: React.ReactNode;
@@ -20,5 +18,5 @@ export interface FlexItemProps extends React.HTMLProps<HTMLDivElement> {
20
18
  flexShrink?: CSS.Property.FlexShrink;
21
19
  flexBasis?: CSS.Property.FlexBasis;
22
20
  }
23
- export declare function Flex(props: FlexProps): jsx.JSX.Element;
24
- export declare function FlexItem(props: FlexItemProps): jsx.JSX.Element;
21
+ export declare function Flex(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
22
+ export declare function FlexItem(props: FlexItemProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -9,11 +9,10 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- /** @jsx jsx */
13
- import { jsx } from "@emotion/react";
12
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
14
13
  export function Flex(props) {
15
14
  const { children, alignItems = "center", alignContent, justifyContent, flexFlow, flexWrap, flexDirection } = props, extra = __rest(props, ["children", "alignItems", "alignContent", "justifyContent", "flexFlow", "flexWrap", "flexDirection"]);
16
- return (jsx("div", Object.assign({ css: {
15
+ return (_jsx("div", Object.assign({ css: {
17
16
  display: "flex",
18
17
  alignItems,
19
18
  alignContent,
@@ -21,16 +20,16 @@ export function Flex(props) {
21
20
  flexFlow,
22
21
  flexWrap,
23
22
  flexDirection,
24
- } }, extra), children));
23
+ } }, extra, { children: children })));
25
24
  }
26
25
  export function FlexItem(props) {
27
26
  const { children, alignSelf, order, flex, flexGrow, flexShrink, flexBasis } = props, extra = __rest(props, ["children", "alignSelf", "order", "flex", "flexGrow", "flexShrink", "flexBasis"]);
28
- return (jsx("div", Object.assign({ css: {
27
+ return (_jsx("div", Object.assign({ css: {
29
28
  alignSelf,
30
29
  order,
31
30
  flex,
32
31
  flexGrow,
33
32
  flexShrink,
34
33
  flexBasis,
35
- } }, extra), children));
34
+ } }, extra, { children: children })));
36
35
  }
@@ -1,7 +1,6 @@
1
- /** @jsx jsx */
2
- import { jsx, Interpolation, Theme } from "@emotion/react";
3
- import React from "react";
4
- import * as CSS from "csstype";
1
+ import { Interpolation, Theme } from '@emotion/react';
2
+ import React from 'react';
3
+ import * as CSS from 'csstype';
5
4
  export interface IndicatorProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
6
5
  size?: CSS.Property.Width | number;
7
6
  rounded?: boolean;
@@ -16,4 +15,4 @@ export interface IndicatorProps extends React.DetailedHTMLProps<React.HTMLAttrib
16
15
  * SVG转圈指示器,一般用作loading效果
17
16
  * @param props
18
17
  */
19
- export declare function Indicator(props: IndicatorProps): jsx.JSX.Element;
18
+ export declare function Indicator(props: IndicatorProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -9,29 +9,29 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- /** @jsx jsx */
13
- import { jsx, css } from "@emotion/react";
14
- import { adaptive, normalizeUnit } from "../utils/cssUtil";
15
- import { getBarChangeKeyFrames } from "./style";
12
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
13
+ import { css } from '@emotion/react';
14
+ import { adaptive, normalizeUnit } from '../utils/cssUtil';
15
+ import { getBarChangeKeyFrames } from './style';
16
16
  /**
17
17
  * SVG转圈指示器,一般用作loading效果
18
18
  * @param props
19
19
  */
20
20
  export function Indicator(props) {
21
- const { size, rounded = true, barWidth = 7, barHeight = 28, barColor = "#fff", barCount = 12, duration = 600, containerStyle } = props, attributes = __rest(props, ["size", "rounded", "barWidth", "barHeight", "barColor", "barCount", "duration", "containerStyle"]);
21
+ const { size, rounded = true, barWidth = 7, barHeight = 28, barColor = '#fff', barCount = 12, duration = 600, containerStyle } = props, attributes = __rest(props, ["size", "rounded", "barWidth", "barHeight", "barColor", "barCount", "duration", "containerStyle"]);
22
22
  const radius = rounded ? barWidth / 2 : 0;
23
23
  const barList = [];
24
24
  for (let i = 0; i < barCount; i++) {
25
- barList.push(jsx("rect", { key: i, x: (100 - barWidth) / 2, y: "0", rx: radius, ry: radius, width: barWidth, height: barHeight, transform: `rotate(${(360 / barCount) * i}, 50, 50)`, css: {
25
+ barList.push(_jsx("rect", { x: (100 - barWidth) / 2, y: "0", rx: radius, ry: radius, width: barWidth, height: barHeight, transform: `rotate(${(360 / barCount) * i}, 50, 50)`, css: {
26
26
  animationDelay: `${-(duration * (barCount - i)) / barCount}ms`,
27
- } }));
27
+ } }, i));
28
28
  }
29
29
  const style = [
30
30
  {
31
31
  fontSize: 0,
32
32
  },
33
33
  ];
34
- if (typeof size !== "undefined") {
34
+ if (typeof size !== 'undefined') {
35
35
  const unitSize = normalizeUnit(size);
36
36
  style.push({
37
37
  width: unitSize,
@@ -46,16 +46,15 @@ export function Indicator(props) {
46
46
  }));
47
47
  }
48
48
  const svgStyle = css({
49
- width: "100%",
50
- height: "100%",
49
+ width: '100%',
50
+ height: '100%',
51
51
  rect: {
52
- fill: "transparent",
52
+ fill: 'transparent',
53
53
  animationName: getBarChangeKeyFrames(barColor),
54
54
  animationDuration: `${duration}ms`,
55
- animationTimingFunction: "linear",
56
- animationIterationCount: "infinite",
55
+ animationTimingFunction: 'linear',
56
+ animationIterationCount: 'infinite',
57
57
  },
58
58
  });
59
- return (jsx("div", Object.assign({ css: [style, containerStyle] }, attributes),
60
- jsx("svg", { viewBox: "0 0 100 100", css: svgStyle }, barList)));
59
+ return (_jsx("div", Object.assign({ css: [style, containerStyle] }, attributes, { children: _jsx("svg", Object.assign({ viewBox: "0 0 100 100", css: svgStyle }, { children: barList })) })));
61
60
  }
@@ -1,14 +1,13 @@
1
- /** @jsx jsx */
2
- import { jsx, Interpolation, Theme } from "@emotion/react";
3
- import React from "react";
4
- import { IndicatorProps } from "../Indicator";
5
- import { OverlayProps } from "../Overlay";
1
+ import { Interpolation, Theme } from '@emotion/react';
2
+ import React from 'react';
3
+ import { IndicatorProps } from '../Indicator';
4
+ import { OverlayProps } from '../Overlay';
6
5
  export interface LoadingWrapperProps {
7
- status?: "show" | "hide";
6
+ status?: 'show' | 'hide';
8
7
  hint?: React.ReactNode;
9
8
  overlay?: OverlayProps;
10
9
  indicator?: IndicatorProps;
11
10
  onHide?: () => void;
12
11
  containerStyle?: Interpolation<Theme>;
13
12
  }
14
- export declare function Wrapper(props: LoadingWrapperProps): jsx.JSX.Element;
13
+ export declare function Wrapper(props: LoadingWrapperProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,18 +1,17 @@
1
- /** @jsx jsx */
2
- import { jsx } from "@emotion/react";
3
- import { style, LoadingHide } from "./style";
4
- import { Indicator } from "../Indicator";
5
- import { RowCenter } from "../Flex/Row";
6
- import { Overlay } from "../Overlay";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { style, LoadingHide } from './style';
3
+ import { Indicator } from '../Indicator';
4
+ import { RowCenter } from '../Flex/Row';
5
+ import { Overlay } from '../Overlay';
7
6
  export function Wrapper(props) {
8
- const { status = "show", hint, overlay, indicator, onHide, containerStyle, } = props;
7
+ const { status = 'show', hint, overlay, indicator, onHide, containerStyle, } = props;
9
8
  // 覆盖层样式
10
9
  let overlayProps = {
11
10
  centerContent: true,
12
11
  fullScreen: true,
13
- maskColor: "transparent",
12
+ maskColor: 'transparent',
14
13
  };
15
- if (typeof overlay === "object") {
14
+ if (typeof overlay === 'object') {
16
15
  overlayProps = Object.assign(Object.assign({}, overlayProps), overlay);
17
16
  }
18
17
  // 指示器样式
@@ -21,11 +20,11 @@ export function Wrapper(props) {
21
20
  barHeight: 25,
22
21
  barCount: 14,
23
22
  };
24
- if (typeof indicator === "object") {
23
+ if (typeof indicator === 'object') {
25
24
  indicatorProps = Object.assign(Object.assign({}, indicatorProps), indicator);
26
25
  }
27
26
  // 根据状态设置动画
28
- const animation = status === "show" ? style.boxShow : style.boxHide;
27
+ const animation = status === 'show' ? style.boxShow : style.boxHide;
29
28
  // 动画结束时触发的函数逻辑
30
29
  const animationEnd = (event) => {
31
30
  if (event.animationName === LoadingHide.name) {
@@ -33,14 +32,11 @@ export function Wrapper(props) {
33
32
  }
34
33
  };
35
34
  let box;
36
- if (hint && typeof hint === "string") {
37
- box = (jsx(RowCenter, { css: [style.boxCommon, style.boxWithExtra, animation, containerStyle], onAnimationEnd: animationEnd },
38
- jsx(Indicator, Object.assign({}, indicatorProps)),
39
- jsx("div", { css: style.hint }, hint)));
35
+ if (hint && typeof hint === 'string') {
36
+ box = (_jsxs(RowCenter, Object.assign({ css: [style.boxCommon, style.boxWithExtra, animation, containerStyle], onAnimationEnd: animationEnd }, { children: [_jsx(Indicator, Object.assign({}, indicatorProps)), _jsx("div", Object.assign({ css: style.hint }, { children: hint }))] })));
40
37
  }
41
38
  else {
42
- box = (jsx(RowCenter, { css: [style.boxCommon, style.box, animation, containerStyle], onAnimationEnd: animationEnd },
43
- jsx(Indicator, Object.assign({}, indicatorProps))));
39
+ box = (_jsx(RowCenter, Object.assign({ css: [style.boxCommon, style.box, animation, containerStyle], onAnimationEnd: animationEnd }, { children: _jsx(Indicator, Object.assign({}, indicatorProps)) })));
44
40
  }
45
- return jsx(Overlay, Object.assign({}, overlayProps), box);
41
+ return _jsx(Overlay, Object.assign({}, overlayProps, { children: box }));
46
42
  }
@@ -1,4 +1,4 @@
1
- import { LoadingWrapperProps } from "./Wrapper";
1
+ import { LoadingWrapperProps } from './Wrapper';
2
2
  /**
3
3
  * 显示loading
4
4
  * @param hint 提示文字
@@ -7,11 +7,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- /** @jsx jsx */
11
- import { jsx } from "@emotion/react";
12
- import { Wrapper } from "./Wrapper";
13
- import { createPortalDOM } from "../utils/dom";
14
- import isPlainObject from "lodash/isPlainObject";
10
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
11
+ import { Wrapper } from './Wrapper';
12
+ import { createPortalDOM } from '../utils/dom';
13
+ import isPlainObject from 'lodash/isPlainObject';
15
14
  /**
16
15
  * 显示loading
17
16
  * @param hint 提示文字
@@ -19,20 +18,20 @@ import isPlainObject from "lodash/isPlainObject";
19
18
  * @returns
20
19
  */
21
20
  export function showLoading(hint, option) {
22
- const { mount, destroy } = createPortalDOM();
23
- let props = { hint, status: "show" };
21
+ const { mount, unmount } = createPortalDOM();
22
+ let props = { hint, status: 'show' };
24
23
  if (isPlainObject(option)) {
25
24
  delete option.status;
26
25
  props = Object.assign(Object.assign({}, props), option);
27
26
  }
28
27
  // 关闭loading
29
28
  const closeLoading = () => __awaiter(this, void 0, void 0, function* () {
30
- props.status = "hide";
31
- props.onHide = destroy;
32
- yield mount(jsx(Wrapper, Object.assign({}, props)));
29
+ props.status = 'hide';
30
+ props.onHide = unmount;
31
+ yield mount(_jsx(Wrapper, Object.assign({}, props)));
33
32
  });
34
33
  // 显示loading
35
- const mountShow = mount(jsx(Wrapper, Object.assign({}, props)));
34
+ const mountShow = mount(_jsx(Wrapper, Object.assign({}, props)));
36
35
  // 关闭loading
37
36
  return () => __awaiter(this, void 0, void 0, function* () {
38
37
  yield mountShow;
@@ -1,6 +1,4 @@
1
- /**@jsx jsx */
2
- import { jsx } from "@emotion/react";
3
- import React from "react";
1
+ import React from 'react';
4
2
  export interface OverlayProps extends React.HTMLProps<HTMLDivElement> {
5
3
  children?: React.ReactNode;
6
4
  outside?: boolean;
@@ -13,4 +11,4 @@ export interface OverlayProps extends React.HTMLProps<HTMLDivElement> {
13
11
  * @param props
14
12
  * @returns
15
13
  */
16
- export declare function Overlay(props: OverlayProps): jsx.JSX.Element | null;
14
+ export declare function Overlay(props: OverlayProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
@@ -9,19 +9,18 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- /**@jsx jsx */
13
- import { jsx } from "@emotion/react";
14
- import { useEffect, useLayoutEffect, useRef, useState } from "react";
15
- import ReactDOM from "react-dom";
16
- import { getContextValue } from "../context";
17
- import { useWindowResize } from "../Effect/useWindowResize";
12
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
13
+ import { useEffect, useLayoutEffect, useRef, useState } from 'react';
14
+ import { createPortal } from 'react-dom';
15
+ import { getContextValue } from '../context';
16
+ import { useWindowResize } from '../Effect/useWindowResize';
18
17
  /**
19
18
  * 覆盖层,可以作为通用遮罩
20
19
  * @param props
21
20
  * @returns
22
21
  */
23
22
  export function Overlay(props) {
24
- const { children, outside = false, centerContent = true, fullScreen = true, maskColor = "rgba(0, 0, 0, .6)" } = props, extra = __rest(props, ["children", "outside", "centerContent", "fullScreen", "maskColor"]);
23
+ const { children, outside = false, centerContent = true, fullScreen = true, maskColor = 'rgba(0, 0, 0, .6)' } = props, extra = __rest(props, ["children", "outside", "centerContent", "fullScreen", "maskColor"]);
25
24
  const [mount, setMount] = useState(null);
26
25
  const [innerWidth, setInnerWidth] = useState(window.innerWidth);
27
26
  // 这里是为了修复一个非挂载状态触发resize事件的bug
@@ -33,11 +32,10 @@ export function Overlay(props) {
33
32
  }, []);
34
33
  useLayoutEffect(() => {
35
34
  if (outside) {
36
- const div = document.createElement("div");
35
+ const div = document.createElement('div');
37
36
  document.body.appendChild(div);
38
37
  setMount(div);
39
38
  return () => {
40
- // ReactDOM.unmountComponentAtNode(div);
41
39
  div.remove();
42
40
  };
43
41
  }
@@ -62,12 +60,12 @@ export function Overlay(props) {
62
60
  }
63
61
  style.push({
64
62
  zIndex: 9999,
65
- position: "fixed",
63
+ position: 'fixed',
66
64
  top: 0,
67
- left: "50%",
65
+ left: '50%',
68
66
  marginLeft: `-${width / 2}px`,
69
67
  width: `${width}px`,
70
- height: "100%",
68
+ height: '100%',
71
69
  maxWidth: `${ctx.maxDocWidth}px`,
72
70
  minWidth: `${ctx.minDocWidth}px`,
73
71
  backgroundColor: maskColor,
@@ -76,12 +74,12 @@ export function Overlay(props) {
76
74
  // 如果内容居中,设置内容居中有样式
77
75
  if (centerContent) {
78
76
  style.push({
79
- display: "flex",
80
- alignItems: "center",
81
- justifyContent: "center",
77
+ display: 'flex',
78
+ alignItems: 'center',
79
+ justifyContent: 'center',
82
80
  });
83
81
  }
84
- const content = (jsx("div", Object.assign({ css: style }, extra), children));
82
+ const content = (_jsx("div", Object.assign({ css: style }, extra, { children: children })));
85
83
  /**
86
84
  * 如果是挂载到当前位置,直接返回
87
85
  */
@@ -97,5 +95,5 @@ export function Overlay(props) {
97
95
  /**
98
96
  * 挂载到外部,且挂载点已经准备好
99
97
  */
100
- return ReactDOM.createPortal(content, mount);
98
+ return createPortal(content, mount);
101
99
  }
@@ -1,8 +1,6 @@
1
1
  /// <reference types="react" />
2
- /** @jsx jsx */
3
- import { jsx } from "@emotion/react";
4
2
  export interface SafeAreaProps extends React.HTMLProps<HTMLDivElement> {
5
3
  children?: React.ReactNode;
6
- type: "top" | "bottom";
4
+ type: 'top' | 'bottom';
7
5
  }
8
- export declare function SafeArea(props: SafeAreaProps): jsx.JSX.Element;
6
+ export declare function SafeArea(props: SafeAreaProps): import("@emotion/react/jsx-runtime").JSX.Element;