doui-react 2.0.9 → 2.0.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.
@@ -18,5 +18,5 @@ export declare function includesNonStrictMode(options?: Array<OptionType>, value
18
18
  export declare function mergeProps<T, U>(originProps: T, patchProps: U): {} & T & U;
19
19
  export declare function mergeFunction(...fns: Array<FunctionType | undefined>): (...args: any[]) => void;
20
20
  export declare function transformNullToUndefined<T>(value: T): T;
21
- export declare function wait(fn: Function, timeout?: number): Promise<unknown>;
21
+ export declare function wait(fn: Function, timeout?: number): Promise<boolean>;
22
22
  export {};
@@ -2,8 +2,8 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import dayjs from 'dayjs';
4
4
  import 'dayjs/locale/zh-cn';
5
- import delay from 'delay';
6
5
  import _ from 'lodash';
6
+ import pWaitFor from 'p-wait-for';
7
7
  import { cloneElement, isValidElement } from 'react';
8
8
  import { Fragment as _Fragment, jsx as _jsx } from "@emotion/react/jsx-runtime";
9
9
  dayjs.locale('zh-cn');
@@ -99,49 +99,58 @@ export function transformNullToUndefined(value) {
99
99
  }
100
100
  return value;
101
101
  }
102
- export function wait(fn) {
103
- var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 30 * 1000;
104
- var interval = 100;
105
- return new Promise(function (resolve) {
106
- function run() {
107
- return _run.apply(this, arguments);
108
- }
109
- function _run() {
110
- _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
111
- var times,
112
- _args = arguments;
113
- return _regeneratorRuntime().wrap(function _callee$(_context) {
114
- while (1) switch (_context.prev = _context.next) {
115
- case 0:
116
- times = _args.length > 0 && _args[0] !== undefined ? _args[0] : 0;
117
- if (!(times * interval >= timeout)) {
118
- _context.next = 3;
119
- break;
120
- }
121
- return _context.abrupt("return", resolve(false));
122
- case 3:
123
- _context.next = 5;
124
- return fn();
125
- case 5:
126
- if (!_context.sent) {
127
- _context.next = 7;
128
- break;
129
- }
130
- return _context.abrupt("return", resolve(true));
131
- case 7:
132
- _context.next = 9;
133
- return delay(interval);
134
- case 9:
135
- _context.next = 11;
136
- return run(times + 1);
137
- case 11:
138
- case "end":
139
- return _context.stop();
140
- }
141
- }, _callee);
142
- }));
143
- return _run.apply(this, arguments);
144
- }
145
- run();
146
- });
102
+ function checkCondition(_x) {
103
+ return _checkCondition.apply(this, arguments);
104
+ }
105
+ function _checkCondition() {
106
+ _checkCondition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(fn) {
107
+ var result;
108
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
109
+ while (1) switch (_context.prev = _context.next) {
110
+ case 0:
111
+ _context.next = 2;
112
+ return fn();
113
+ case 2:
114
+ result = _context.sent;
115
+ return _context.abrupt("return", !!result);
116
+ case 4:
117
+ case "end":
118
+ return _context.stop();
119
+ }
120
+ }, _callee);
121
+ }));
122
+ return _checkCondition.apply(this, arguments);
123
+ }
124
+ export function wait(_x2) {
125
+ return _wait.apply(this, arguments);
126
+ }
127
+ function _wait() {
128
+ _wait = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(fn) {
129
+ var timeout,
130
+ _args2 = arguments;
131
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
132
+ while (1) switch (_context2.prev = _context2.next) {
133
+ case 0:
134
+ timeout = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 30 * 1000;
135
+ _context2.prev = 1;
136
+ _context2.next = 4;
137
+ return pWaitFor(function () {
138
+ return checkCondition(fn);
139
+ }, {
140
+ interval: 300,
141
+ timeout: timeout
142
+ });
143
+ case 4:
144
+ return _context2.abrupt("return", true);
145
+ case 7:
146
+ _context2.prev = 7;
147
+ _context2.t0 = _context2["catch"](1);
148
+ return _context2.abrupt("return", false);
149
+ case 10:
150
+ case "end":
151
+ return _context2.stop();
152
+ }
153
+ }, _callee2, null, [[1, 7]]);
154
+ }));
155
+ return _wait.apply(this, arguments);
147
156
  }
@@ -12,8 +12,8 @@ export declare function getFormItemProps(props: any): {
12
12
  color?: string | undefined;
13
13
  title?: import("react").ReactNode | import("antd/es/_util/getRenderPropValue").RenderFunction;
14
14
  overlay?: import("react").ReactNode | import("antd/es/_util/getRenderPropValue").RenderFunction;
15
- styles?: Partial<Record<"root" | "body", import("react").CSSProperties>> | undefined;
16
- classNames: Partial<Record<"root" | "body", string>>;
15
+ styles?: Partial<Record<"body" | "root", import("react").CSSProperties>> | undefined;
16
+ classNames: Partial<Record<"body" | "root", string>>;
17
17
  rootClassName?: string | undefined;
18
18
  placement?: import("antd/es/tooltip").TooltipPlacement | undefined;
19
19
  builtinPlacements?: import("@rc-component/trigger").BuildInPlacements | undefined;
@@ -24,7 +24,7 @@ export declare function getFormItemProps(props: any): {
24
24
  pointAtCenter?: boolean | undefined;
25
25
  };
26
26
  autoAdjustOverflow?: boolean | import("antd/es/tooltip").AdjustOverflow | undefined;
27
- getPopupContainer: (triggerNode: HTMLElement) => HTMLElement;
27
+ getPopupContainer: typeof import("../../api").getPopupContainer;
28
28
  children?: import("react").ReactNode;
29
29
  destroyTooltipOnHide?: boolean | {
30
30
  keepParent?: boolean | undefined;
@@ -38,26 +38,26 @@ export declare function getFormItemProps(props: any): {
38
38
  defaultVisible?: boolean | undefined;
39
39
  onVisibleChange?: ((visible: boolean) => void) | undefined;
40
40
  afterVisibleChange?: ((visible: boolean) => void) | undefined;
41
- prefixCls?: string | undefined;
42
- onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
43
- fresh?: boolean | undefined;
44
- mouseLeaveDelay?: number | undefined;
45
- mouseEnterDelay?: number | undefined;
46
- forceRender?: boolean | undefined;
47
- popupVisible?: boolean | undefined;
48
- trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
49
- transitionName?: string | undefined;
41
+ zIndex?: number | undefined;
50
42
  animation?: string | undefined;
51
43
  motion?: import("rc-motion").CSSMotionProps | undefined;
52
- overlayStyle?: import("react").CSSProperties | undefined;
44
+ transitionName?: string | undefined;
45
+ prefixCls?: string | undefined;
46
+ forceRender?: boolean | undefined;
47
+ id?: string | undefined;
48
+ mouseEnterDelay?: number | undefined;
49
+ mouseLeaveDelay?: number | undefined;
50
+ onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
53
51
  overlayClassName?: string | undefined;
54
- getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
55
52
  align?: import("@rc-component/trigger").AlignType | undefined;
53
+ overlayStyle?: import("react").CSSProperties | undefined;
54
+ trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
55
+ popupVisible?: boolean | undefined;
56
+ fresh?: boolean | undefined;
57
+ getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
56
58
  showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
57
59
  arrowContent?: import("react").ReactNode;
58
- id?: string | undefined;
59
60
  overlayInnerStyle?: import("react").CSSProperties | undefined;
60
- zIndex?: number | undefined;
61
61
  icon: import("@emotion/react/jsx-runtime").JSX.Element;
62
62
  } | undefined;
63
63
  initialValue: any;
@@ -7,7 +7,7 @@ var style = {
7
7
  wrapper: function wrapper(_ref) {
8
8
  var labelWidth = _ref.labelWidth,
9
9
  formItemMarginBottom = _ref.formItemMarginBottom;
10
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-form-item {\n margin-bottom: ", ";\n }\n\n .ant-form-item-label {\n width: ", ";\n }\n\n .ant-form-item-with-help .ant-form-item-explain {\n line-height: 1.1;\n padding: 4px 0;\n\n .ant-form-item-explain-error + .ant-form-item-explain-error {\n margin-top: 2px;\n }\n }\n\n &.ant-form-horizontal {\n .ant-form-item-required::before {\n position: absolute;\n left: -10px;\n }\n }\n\n &.ant-form-vertical {\n .ant-form-item-label {\n padding-bottom: 5px;\n }\n }\n "])), transformValueWithStyleUnit(formItemMarginBottom), transformValueWithStyleUnit(labelWidth));
10
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-form-item {\n margin-bottom: ", ";\n }\n\n .ant-form-item-label {\n width: ", ";\n }\n\n .ant-form-item-with-help .ant-form-item-explain {\n line-height: 1.1;\n padding: 4px 0;\n\n .ant-form-item-explain-error + .ant-form-item-explain-error {\n margin-top: 2px;\n }\n }\n\n &.ant-form-horizontal {\n .ant-form-item-label {\n padding-left: 10px;\n }\n\n .ant-form-item-required::before {\n position: absolute;\n left: -10px;\n }\n }\n\n &.ant-form-vertical {\n .ant-form-item-label {\n padding-bottom: 5px;\n }\n }\n "])), transformValueWithStyleUnit(formItemMarginBottom), transformValueWithStyleUnit(labelWidth));
11
11
  }
12
12
  };
13
13
  export default style;
@@ -11,7 +11,7 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
11
11
  current: number;
12
12
  total: number;
13
13
  onChange: import("react").Dispatch<import("react").SetStateAction<number>>;
14
- position?: ("none" | "bottomLeft" | "bottomRight" | "topLeft" | "topRight" | "topCenter" | "bottomCenter")[] | undefined;
14
+ position?: ("none" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "topCenter" | "bottomCenter")[] | undefined;
15
15
  showQuickJumper?: boolean | {
16
16
  goButton?: import("react").ReactNode;
17
17
  } | undefined;
@@ -23,12 +23,12 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
23
23
  showSizeChanger?: boolean | import("antd").SelectProps<any, import("rc-select/lib/Select").DefaultOptionType> | undefined;
24
24
  selectComponentClass?: any;
25
25
  pageSizeOptions?: (string | number)[] | undefined;
26
- className?: string | undefined;
27
26
  style?: import("react").CSSProperties | undefined;
27
+ className?: string | undefined;
28
28
  prefixCls?: string | undefined;
29
29
  "aria-activedescendant"?: string | undefined;
30
30
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
31
- "aria-autocomplete"?: "inline" | "none" | "list" | "both" | undefined;
31
+ "aria-autocomplete"?: "none" | "list" | "inline" | "both" | undefined;
32
32
  "aria-braillelabel"?: string | undefined;
33
33
  "aria-brailleroledescription"?: string | undefined;
34
34
  "aria-busy"?: (boolean | "true" | "false") | undefined;
@@ -38,17 +38,17 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
38
38
  "aria-colindextext"?: string | undefined;
39
39
  "aria-colspan"?: number | undefined;
40
40
  "aria-controls"?: string | undefined;
41
- "aria-current"?: boolean | "page" | "true" | "false" | "step" | "location" | "date" | "time" | undefined;
41
+ "aria-current"?: boolean | "time" | "page" | "true" | "false" | "step" | "location" | "date" | undefined;
42
42
  "aria-describedby"?: string | undefined;
43
43
  "aria-description"?: string | undefined;
44
44
  "aria-details"?: string | undefined;
45
45
  "aria-disabled"?: (boolean | "true" | "false") | undefined;
46
- "aria-dropeffect"?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
46
+ "aria-dropeffect"?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
47
47
  "aria-errormessage"?: string | undefined;
48
48
  "aria-expanded"?: (boolean | "true" | "false") | undefined;
49
49
  "aria-flowto"?: string | undefined;
50
50
  "aria-grabbed"?: (boolean | "true" | "false") | undefined;
51
- "aria-haspopup"?: boolean | "grid" | "true" | "false" | "dialog" | "listbox" | "menu" | "tree" | undefined;
51
+ "aria-haspopup"?: boolean | "dialog" | "menu" | "grid" | "listbox" | "tree" | "true" | "false" | undefined;
52
52
  "aria-hidden"?: (boolean | "true" | "false") | undefined;
53
53
  "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
54
54
  "aria-keyshortcuts"?: string | undefined;
@@ -65,7 +65,7 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
65
65
  "aria-posinset"?: number | undefined;
66
66
  "aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
67
67
  "aria-readonly"?: (boolean | "true" | "false") | undefined;
68
- "aria-relevant"?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
68
+ "aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
69
69
  "aria-required"?: (boolean | "true" | "false") | undefined;
70
70
  "aria-roledescription"?: string | undefined;
71
71
  "aria-rowcount"?: number | undefined;
@@ -80,10 +80,10 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
80
80
  "aria-valuenow"?: number | undefined;
81
81
  "aria-valuetext"?: string | undefined;
82
82
  disabled?: boolean | undefined;
83
- align?: "start" | "end" | "center" | undefined;
84
83
  locale?: import("rc-pagination").PaginationLocale | undefined;
85
84
  prevIcon?: import("react").ReactNode | import("react").ComponentType<{}>;
86
85
  nextIcon?: import("react").ReactNode | import("react").ComponentType<{}>;
86
+ align?: "center" | "end" | "start" | undefined;
87
87
  selectPrefixCls?: string | undefined;
88
88
  defaultCurrent?: number | undefined;
89
89
  defaultPageSize?: number | undefined;
@@ -98,9 +98,9 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
98
98
  jumpPrevIcon?: import("react").ReactNode | import("react").ComponentType<{}>;
99
99
  jumpNextIcon?: import("react").ReactNode | import("react").ComponentType<{}>;
100
100
  onShowSizeChange?: ((current: number, size: number) => void) | undefined;
101
- itemRender?: ((page: number, type: "page" | "next" | "prev" | "jump-prev" | "jump-next", element: import("react").ReactNode) => import("react").ReactNode) | undefined;
101
+ itemRender?: ((page: number, type: "page" | "prev" | "next" | "jump-prev" | "jump-next", element: import("react").ReactNode) => import("react").ReactNode) | undefined;
102
102
  showTotal?: ((total: number, range: [number, number]) => import("react").ReactNode) | undefined;
103
- justify?: "left" | "right" | "center" | "between" | undefined;
103
+ justify?: "center" | "left" | "right" | "between" | undefined;
104
104
  };
105
105
  export type PaginationProps = TablePaginationConfig & Pick<HStackProps, 'justify'>;
106
106
  export declare function Pagination({ justify, className, style, ...props }: PaginationProps): import("@emotion/react/jsx-runtime").JSX.Element;