doui-react 2.0.1 → 2.0.6

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 (49) hide show
  1. package/es/api/component/react-dom.js +11 -7
  2. package/es/api/component/sort.d.ts +1 -1
  3. package/es/api/component/sort.js +4 -8
  4. package/es/checkbox/component/utils.js +1 -1
  5. package/es/form/component/utils.d.ts +7 -7
  6. package/es/grid/component/pagination.d.ts +12 -12
  7. package/es/icon/hook/index.d.ts +254 -254
  8. package/es/open-modal/component/modal.js +2 -0
  9. package/es/open-modal/style/index.js +2 -1
  10. package/es/radio/component/abstract-box.d.ts +31 -31
  11. package/es/table/component/date-time.d.ts +3 -0
  12. package/es/table/component/date-time.js +27 -0
  13. package/es/table/component/filter.js +1 -1
  14. package/es/table/component/sort.js +1 -1
  15. package/es/table/component/table.js +11 -2
  16. package/es/table/component/utils.d.ts +3 -2
  17. package/es/table/component/utils.js +22 -11
  18. package/es/tabs/component/utils.d.ts +3 -3
  19. package/es/tooltip/component/index.d.ts +3 -3
  20. package/es/virtual-list/component/index.d.ts +1 -1
  21. package/es/virtual-list/component/index.js +4 -2
  22. package/es/virtual-list/type/index.d.ts +2 -1
  23. package/lib/api/component/react-dom.js +13 -9
  24. package/lib/api/component/sort.d.ts +1 -1
  25. package/lib/api/component/sort.js +4 -8
  26. package/lib/checkbox/component/utils.js +1 -1
  27. package/lib/form/component/utils.d.ts +7 -7
  28. package/lib/grid/component/pagination.d.ts +12 -12
  29. package/lib/icon/hook/index.d.ts +254 -254
  30. package/lib/open-modal/component/modal.js +2 -0
  31. package/lib/open-modal/style/index.js +2 -1
  32. package/lib/radio/component/abstract-box.d.ts +39 -39
  33. package/lib/table/component/date-time.d.ts +3 -0
  34. package/lib/table/component/date-time.js +35 -0
  35. package/lib/table/component/filter.js +1 -1
  36. package/lib/table/component/sort.js +1 -1
  37. package/lib/table/component/table.js +10 -1
  38. package/lib/table/component/utils.d.ts +3 -2
  39. package/lib/table/component/utils.js +22 -11
  40. package/lib/tabs/component/utils.d.ts +3 -3
  41. package/lib/tooltip/component/index.d.ts +3 -3
  42. package/lib/virtual-list/component/index.d.ts +1 -1
  43. package/lib/virtual-list/component/index.js +4 -2
  44. package/lib/virtual-list/type/index.d.ts +2 -1
  45. package/package.json +2 -1
  46. package/es/table/component/time.d.ts +0 -2
  47. package/es/table/component/time.js +0 -12
  48. package/lib/table/component/time.d.ts +0 -2
  49. package/lib/table/component/time.js +0 -19
@@ -1,12 +1,15 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["hideBodyScroll"];
4
- import { hideBodyScroll } from "./..";
3
+ var _excluded = ["hideBodyScroll", "getContainer"];
4
+ import { $, executeFunction, hideBodyScroll } from "./..";
5
+ import _ from 'lodash';
5
6
  import { createRoot } from 'react-dom/client';
6
7
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
7
8
  function getContainer() {
9
+ var to = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.body;
8
10
  var container = document.createElement('div');
9
- document.body.append(container);
11
+ var root = _.isString(to) ? $(to) : executeFunction(to);
12
+ root.append(container);
10
13
  return container;
11
14
  }
12
15
  // 处理React17和18版本的兼容性
@@ -29,7 +32,11 @@ function getReactDOM() {
29
32
  var closeFunctionSet = new Set();
30
33
  export function mountComponent(Component) {
31
34
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
32
- var container = getContainer();
35
+ var _props$hideBodyScroll = props.hideBodyScroll,
36
+ hide = _props$hideBodyScroll === void 0 ? false : _props$hideBodyScroll,
37
+ outerContainer = props.getContainer,
38
+ restProps = _objectWithoutProperties(props, _excluded);
39
+ var container = getContainer(outerContainer);
33
40
  var _getReactDOM = getReactDOM(),
34
41
  render = _getReactDOM.render,
35
42
  unmount = _getReactDOM.unmount;
@@ -39,9 +46,6 @@ export function mountComponent(Component) {
39
46
  closeFunctionSet.delete(close);
40
47
  !closeFunctionSet.size && hideBodyScroll(false);
41
48
  };
42
- var _props$hideBodyScroll = props.hideBodyScroll,
43
- hide = _props$hideBodyScroll === void 0 ? false : _props$hideBodyScroll,
44
- restProps = _objectWithoutProperties(props, _excluded);
45
49
  hide && hideBodyScroll();
46
50
  render(_jsx(Component, _objectSpread(_objectSpread({}, restProps), {}, {
47
51
  unmount: close,
@@ -1,2 +1,2 @@
1
- export declare function sorter(a: any, b: any): any;
1
+ export declare function sorter(a?: any, b?: any): any;
2
2
  export declare function sortBy(data: any[] | undefined, key: string): any[];
@@ -1,20 +1,16 @@
1
1
  import _ from 'lodash';
2
- export function sorter(a, b) {
2
+ export function sorter() {
3
+ var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
4
+ var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3
5
  if (_.isNumber(a)) {
4
6
  return a - b;
5
7
  }
6
- if (_.isNil(a) && _.isNil(b)) {
7
- return 0;
8
- }
9
- if (_.isNil(a)) {
10
- return -1;
11
- }
12
8
  return a.localeCompare(b);
13
9
  }
14
10
  export function sortBy() {
15
11
  var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
16
12
  var key = arguments.length > 1 ? arguments[1] : undefined;
17
13
  return data.sort(function (a, b) {
18
- return sorter(a[key], b[key]);
14
+ return sorter(_.get(a, key), _.get(b, key));
19
15
  });
20
16
  }
@@ -23,7 +23,7 @@ function showAllToAllConfig() {
23
23
  var baseConfig = {
24
24
  showAll: true,
25
25
  allProps: {
26
- children: 'All'
26
+ children: '全选'
27
27
  }
28
28
  };
29
29
  if (showAll === true) {
@@ -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,24 +38,24 @@ 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;
41
+ align?: import("@rc-component/trigger").AlignType | undefined;
42
42
  id?: string | undefined;
43
- animation?: string | undefined;
44
- transitionName?: string | undefined;
45
- showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
43
+ prefixCls?: string | undefined;
46
44
  zIndex?: number | undefined;
45
+ animation?: string | undefined;
47
46
  motion?: import("rc-motion").CSSMotionProps | undefined;
47
+ transitionName?: string | undefined;
48
48
  mouseEnterDelay?: number | undefined;
49
49
  mouseLeaveDelay?: number | undefined;
50
50
  onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
51
51
  overlayClassName?: string | undefined;
52
- align?: import("@rc-component/trigger").AlignType | undefined;
53
52
  overlayStyle?: import("react").CSSProperties | undefined;
54
53
  trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
55
54
  popupVisible?: boolean | undefined;
56
55
  forceRender?: boolean | undefined;
57
56
  fresh?: boolean | undefined;
58
57
  getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
58
+ showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
59
59
  arrowContent?: import("react").ReactNode;
60
60
  overlayInnerStyle?: import("react").CSSProperties | undefined;
61
61
  icon: import("@emotion/react/jsx-runtime").JSX.Element;
@@ -85,7 +85,7 @@ export declare function transformPathToName(path?: NamePath): string | undefined
85
85
  export declare function transformKeyToPath(params?: Record<string, any>): Record<string, any>;
86
86
  export declare function parseFormFailedError(error: ValidateErrorEntity): Record<string, string>;
87
87
  export declare function noStyle(item: FormItemProps): boolean;
88
- export declare function transformOptions(item: FormItemProps, values: FormValues, params: CommonParams): import("../../api").FunctionReturn<SelectOptions> | ((values: FormValues, params: import("..").OptionsParams) => import("../../api").FunctionReturn<SelectOptions>) | ((search?: string) => import("../../api").FunctionReturn<SelectOptions>) | undefined;
88
+ export declare function transformOptions(item: FormItemProps, values: FormValues, params: CommonParams): ((values: FormValues, params: import("..").OptionsParams) => import("../../api").FunctionReturn<SelectOptions>) | import("../../api").FunctionReturn<SelectOptions> | ((search?: string) => import("../../api").FunctionReturn<SelectOptions>) | undefined;
89
89
  interface FocusFirstInputParams extends CommonParams {
90
90
  focusFirstOnMount: FormProps['focusFirstOnMount'];
91
91
  }
@@ -15,7 +15,7 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
15
15
  showQuickJumper?: boolean | {
16
16
  goButton?: import("react").ReactNode;
17
17
  } | undefined;
18
- size?: "small" | "default" | undefined;
18
+ size?: "default" | "small" | undefined;
19
19
  responsive?: boolean | undefined;
20
20
  role?: string | undefined;
21
21
  totalBoundaryShowSizeChanger?: number | undefined;
@@ -23,11 +23,13 @@ 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
- style?: import("react").CSSProperties | undefined;
27
26
  className?: string | undefined;
27
+ align?: "start" | "end" | "center" | undefined;
28
+ disabled?: boolean | undefined;
29
+ style?: import("react").CSSProperties | undefined;
28
30
  "aria-activedescendant"?: string | undefined;
29
31
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
30
- "aria-autocomplete"?: "none" | "list" | "inline" | "both" | undefined;
32
+ "aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
31
33
  "aria-braillelabel"?: string | undefined;
32
34
  "aria-brailleroledescription"?: string | undefined;
33
35
  "aria-busy"?: (boolean | "true" | "false") | undefined;
@@ -37,7 +39,7 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
37
39
  "aria-colindextext"?: string | undefined;
38
40
  "aria-colspan"?: number | undefined;
39
41
  "aria-controls"?: string | undefined;
40
- "aria-current"?: boolean | "time" | "page" | "true" | "false" | "step" | "location" | "date" | undefined;
42
+ "aria-current"?: boolean | "step" | "date" | "time" | "true" | "false" | "page" | "location" | undefined;
41
43
  "aria-describedby"?: string | undefined;
42
44
  "aria-description"?: string | undefined;
43
45
  "aria-details"?: string | undefined;
@@ -47,7 +49,7 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
47
49
  "aria-expanded"?: (boolean | "true" | "false") | undefined;
48
50
  "aria-flowto"?: string | undefined;
49
51
  "aria-grabbed"?: (boolean | "true" | "false") | undefined;
50
- "aria-haspopup"?: boolean | "dialog" | "menu" | "grid" | "listbox" | "tree" | "true" | "false" | undefined;
52
+ "aria-haspopup"?: boolean | "menu" | "tree" | "dialog" | "true" | "false" | "grid" | "listbox" | undefined;
51
53
  "aria-hidden"?: (boolean | "true" | "false") | undefined;
52
54
  "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
53
55
  "aria-keyshortcuts"?: string | undefined;
@@ -58,13 +60,13 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
58
60
  "aria-modal"?: (boolean | "true" | "false") | undefined;
59
61
  "aria-multiline"?: (boolean | "true" | "false") | undefined;
60
62
  "aria-multiselectable"?: (boolean | "true" | "false") | undefined;
61
- "aria-orientation"?: "vertical" | "horizontal" | undefined;
63
+ "aria-orientation"?: "horizontal" | "vertical" | undefined;
62
64
  "aria-owns"?: string | undefined;
63
65
  "aria-placeholder"?: string | undefined;
64
66
  "aria-posinset"?: number | undefined;
65
67
  "aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
66
68
  "aria-readonly"?: (boolean | "true" | "false") | undefined;
67
- "aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
69
+ "aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
68
70
  "aria-required"?: (boolean | "true" | "false") | undefined;
69
71
  "aria-roledescription"?: string | undefined;
70
72
  "aria-rowcount"?: number | undefined;
@@ -78,12 +80,10 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
78
80
  "aria-valuemin"?: number | undefined;
79
81
  "aria-valuenow"?: number | undefined;
80
82
  "aria-valuetext"?: string | undefined;
81
- disabled?: boolean | undefined;
83
+ prefixCls?: string | undefined;
82
84
  locale?: import("rc-pagination").PaginationLocale | undefined;
83
85
  prevIcon?: import("react").ReactNode | import("react").ComponentType<{}>;
84
86
  nextIcon?: import("react").ReactNode | import("react").ComponentType<{}>;
85
- prefixCls?: string | undefined;
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" | "prev" | "next" | "jump-prev" | "jump-next", element: import("react").ReactNode) => import("react").ReactNode) | undefined;
101
+ itemRender?: ((page: number, type: "next" | "page" | "prev" | "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?: "center" | "left" | "right" | "between" | undefined;
103
+ justify?: "left" | "right" | "center" | "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;