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
@@ -36,24 +36,24 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
36
36
  defaultVisible?: boolean | undefined;
37
37
  onVisibleChange?: ((visible: boolean) => void) | undefined;
38
38
  afterVisibleChange?: ((visible: boolean) => void) | undefined;
39
- prefixCls?: string | undefined;
39
+ align?: import("@rc-component/trigger").AlignType | undefined;
40
40
  id?: string | undefined;
41
- animation?: string | undefined;
42
- transitionName?: string | undefined;
43
- showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
41
+ prefixCls?: string | undefined;
44
42
  zIndex?: number | undefined;
43
+ animation?: string | undefined;
45
44
  motion?: import("rc-motion").CSSMotionProps | undefined;
45
+ transitionName?: string | undefined;
46
46
  mouseEnterDelay?: number | undefined;
47
47
  mouseLeaveDelay?: number | undefined;
48
48
  onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
49
49
  overlayClassName?: string | undefined;
50
- align?: import("@rc-component/trigger").AlignType | undefined;
51
50
  overlayStyle?: import("react").CSSProperties | undefined;
52
51
  trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
53
52
  popupVisible?: boolean | undefined;
54
53
  forceRender?: boolean | undefined;
55
54
  fresh?: boolean | undefined;
56
55
  getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
56
+ showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
57
57
  arrowContent?: import("react").ReactNode;
58
58
  overlayInnerStyle?: import("react").CSSProperties | undefined;
59
59
  };
@@ -65,40 +65,40 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
65
65
  value?: any;
66
66
  boxTooltip?: import("react").ReactNode | import("antd").TooltipProps;
67
67
  inGroup?: boolean | undefined;
68
- indeterminate?: boolean | undefined;
69
- prefixCls?: string | undefined;
68
+ title?: string | undefined;
70
69
  className?: string | undefined;
71
- rootClassName?: string | undefined;
72
- defaultChecked?: boolean | undefined;
70
+ type?: string | undefined;
73
71
  checked?: boolean | undefined;
74
- style?: import("react").CSSProperties | undefined;
75
72
  disabled?: boolean | undefined;
76
- title?: string | undefined;
73
+ name?: string | undefined;
74
+ required?: boolean | undefined;
75
+ defaultChecked?: boolean | undefined;
76
+ autoFocus?: boolean | undefined;
77
+ id?: string | undefined;
78
+ style?: import("react").CSSProperties | undefined;
79
+ tabIndex?: number | undefined;
80
+ onKeyDown?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
81
+ onKeyPress?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
77
82
  onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
78
83
  onMouseEnter?: import("react").MouseEventHandler<HTMLElement> | undefined;
79
84
  onMouseLeave?: import("react").MouseEventHandler<HTMLElement> | undefined;
80
- onKeyPress?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
81
- onKeyDown?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
82
- tabIndex?: number | undefined;
83
- name?: string | undefined;
84
- id?: string | undefined;
85
- autoFocus?: boolean | undefined;
86
- type?: string | undefined;
85
+ prefixCls?: string | undefined;
86
+ rootClassName?: string | undefined;
87
+ indeterminate?: boolean | undefined;
87
88
  skipGroup?: boolean | undefined;
88
- required?: boolean | undefined;
89
- 'aria-label'?: string | undefined;
90
- direction?: import("antd/es/config-provider").DirectionType;
89
+ hidden?: boolean | undefined;
90
+ onSelect?: import("react").ReactEventHandler<HTMLElement> | undefined;
91
+ rows?: number | false | undefined;
91
92
  defaultValue?: string | number | readonly string[] | undefined;
92
93
  suppressContentEditableWarning?: boolean | undefined;
93
94
  suppressHydrationWarning?: boolean | undefined;
94
95
  accessKey?: string | undefined;
95
- autoCapitalize?: "none" | "off" | "on" | "sentences" | "words" | "characters" | (string & {}) | undefined;
96
- contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
96
+ autoCapitalize?: (string & {}) | "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined;
97
+ contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
97
98
  contextMenu?: string | undefined;
98
99
  dir?: string | undefined;
99
100
  draggable?: (boolean | "true" | "false") | undefined;
100
101
  enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
101
- hidden?: boolean | undefined;
102
102
  lang?: string | undefined;
103
103
  nonce?: string | undefined;
104
104
  slot?: string | undefined;
@@ -128,13 +128,13 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
128
128
  results?: number | undefined;
129
129
  security?: string | undefined;
130
130
  unselectable?: "off" | "on" | undefined;
131
- inputMode?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
131
+ inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
132
132
  is?: string | undefined;
133
133
  exportparts?: string | undefined;
134
134
  part?: string | undefined;
135
135
  "aria-activedescendant"?: string | undefined;
136
136
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
137
- "aria-autocomplete"?: "none" | "list" | "inline" | "both" | undefined;
137
+ "aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
138
138
  "aria-braillelabel"?: string | undefined;
139
139
  "aria-brailleroledescription"?: string | undefined;
140
140
  "aria-busy"?: (boolean | "true" | "false") | undefined;
@@ -144,20 +144,21 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
144
144
  "aria-colindextext"?: string | undefined;
145
145
  "aria-colspan"?: number | undefined;
146
146
  "aria-controls"?: string | undefined;
147
- "aria-current"?: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefined;
147
+ "aria-current"?: boolean | "step" | "date" | "time" | "true" | "false" | "page" | "location" | undefined;
148
148
  "aria-describedby"?: string | undefined;
149
149
  "aria-description"?: string | undefined;
150
150
  "aria-details"?: string | undefined;
151
151
  "aria-disabled"?: (boolean | "true" | "false") | undefined;
152
- "aria-dropeffect"?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
152
+ "aria-dropeffect"?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
153
153
  "aria-errormessage"?: string | undefined;
154
154
  "aria-expanded"?: (boolean | "true" | "false") | undefined;
155
155
  "aria-flowto"?: string | undefined;
156
156
  "aria-grabbed"?: (boolean | "true" | "false") | undefined;
157
- "aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
157
+ "aria-haspopup"?: boolean | "menu" | "tree" | "dialog" | "true" | "false" | "grid" | "listbox" | undefined;
158
158
  "aria-hidden"?: (boolean | "true" | "false") | undefined;
159
159
  "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
160
160
  "aria-keyshortcuts"?: string | undefined;
161
+ 'aria-label'?: string | undefined;
161
162
  "aria-labelledby"?: string | undefined;
162
163
  "aria-level"?: number | undefined;
163
164
  "aria-live"?: "off" | "assertive" | "polite" | undefined;
@@ -297,7 +298,6 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
297
298
  onMouseOverCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
298
299
  onMouseUp?: import("react").MouseEventHandler<HTMLElement> | undefined;
299
300
  onMouseUpCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
300
- onSelect?: import("react").ReactEventHandler<HTMLElement> | undefined;
301
301
  onSelectCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
302
302
  onTouchCancel?: import("react").TouchEventHandler<HTMLElement> | undefined;
303
303
  onTouchCancelCapture?: import("react").TouchEventHandler<HTMLElement> | undefined;
@@ -337,7 +337,7 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
337
337
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLElement> | undefined;
338
338
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLElement> | undefined;
339
339
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLElement> | undefined;
340
- rows?: number | false | undefined;
340
+ direction?: import("antd/es/config-provider").DirectionType;
341
341
  tooltip?: import("react").ReactNode | import("antd").TooltipProps;
342
342
  autoShowTooltip?: boolean | undefined;
343
343
  refs?: import("../../api").Refs | undefined;
@@ -0,0 +1,3 @@
1
+ import { ComponentProps } from './wrapper';
2
+ export declare function Date(props: ComponentProps): import("@emotion/react/jsx-runtime").JSX.Element;
3
+ export declare function DateTime(props: ComponentProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import dayjs from 'dayjs';
3
+ import _ from 'lodash';
4
+ import { Fragment as _Fragment, jsx as _jsx } from "@emotion/react/jsx-runtime";
5
+ function BaseComponent(_ref) {
6
+ var column = _ref.column,
7
+ children = _ref.children;
8
+ var timeFormat = column.timeFormat;
9
+ return _jsx(_Fragment, {
10
+ children: dayjs(children).format(timeFormat)
11
+ });
12
+ }
13
+ function mergerTimeFormat(props, timeFormat) {
14
+ return _.merge({
15
+ column: {
16
+ timeFormat: timeFormat
17
+ }
18
+ }, props);
19
+ }
20
+ export function Date(props) {
21
+ var params = mergerTimeFormat(props, 'YYYY-MM-DD');
22
+ return _jsx(BaseComponent, _objectSpread({}, params));
23
+ }
24
+ export function DateTime(props) {
25
+ var params = mergerTimeFormat(props, 'YYYY-MM-DD hh:mm:ss');
26
+ return _jsx(BaseComponent, _objectSpread({}, params));
27
+ }
@@ -38,7 +38,7 @@ function filter(column, search, record) {
38
38
  var _column$dataIndex = column.dataIndex,
39
39
  dataIndex = _column$dataIndex === void 0 ? '' : _column$dataIndex,
40
40
  filterBy = column.filterBy;
41
- var current = record[dataIndex];
41
+ var current = _.get(record, dataIndex);
42
42
  if (_.isFunction(filterBy)) {
43
43
  return filterBy({
44
44
  record: record,
@@ -11,7 +11,7 @@ export function getSortColumn(_ref) {
11
11
  }
12
12
  return {
13
13
  sorter: function sorter(a, b) {
14
- return _sorter(a[dataIndex], b[dataIndex]);
14
+ return _sorter(_.get(a, dataIndex), _.get(b, dataIndex));
15
15
  }
16
16
  };
17
17
  }
@@ -7,7 +7,7 @@ var _excluded = ["rowKey", "loading", "columns", "dataSource", "editorValueKey"]
7
7
  _excluded2 = ["onlyLoading"],
8
8
  _excluded3 = ["onRowClick", "width", "emptyText"],
9
9
  _excluded4 = ["useFormWrapper", "context", "maxHeight"];
10
- import { executeFunction } from "../../api";
10
+ import { executeFunction, includesNonStrictMode } from "../../api";
11
11
  import { Empty } from "../../empty";
12
12
  import { Form, useFormContext } from "../../form";
13
13
  import { useListOperation } from "../../hooks";
@@ -98,12 +98,21 @@ function useInit(_ref2) {
98
98
  selectedRowKeys: selectedRowKeys,
99
99
  setSelectedRowKeys: function setSelectedRowKeys() {
100
100
  var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
101
- return _setSelectedRowKeys(keys);
101
+ updateSelectedStatus(keys);
102
+ _setSelectedRowKeys(keys);
102
103
  },
103
104
  operation: operation,
104
105
  rowKey: rowKey,
105
106
  editorValueKey: editorValueKey
106
107
  });
108
+ function updateSelectedStatus(keys) {
109
+ var data = _.map(dataSource, function (item) {
110
+ return _objectSpread(_objectSpread({}, item), {}, {
111
+ __selected__: includesNonStrictMode(keys, item[rowKey])
112
+ });
113
+ });
114
+ setDataSource(data);
115
+ }
107
116
  function refresh() {
108
117
  return _refresh.apply(this, arguments);
109
118
  }
@@ -3,15 +3,16 @@ import type { ColumnType } from 'antd/es/table';
3
3
  import type { TableRowSelection } from 'antd/es/table/interface';
4
4
  import { Column, DataSource, GetSearchColumn, TableContext, TableProps } from '../type';
5
5
  import { Actions } from './actions';
6
+ import { Date, DateTime } from './date-time';
6
7
  import { Editor } from './editor';
7
8
  import { Link } from './link';
8
9
  import { Switch } from './switch';
9
- import { Time } from './time';
10
10
  interface GenerateColumnsProps extends TableProps {
11
11
  getSearchColumn: GetSearchColumn;
12
12
  }
13
13
  export declare const componentMap: {
14
- time: typeof Time;
14
+ date: typeof Date;
15
+ dateTime: typeof DateTime;
15
16
  link: typeof Link;
16
17
  switch: typeof Switch;
17
18
  actions: typeof Actions;
@@ -1,21 +1,23 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
- var _excluded = ["type", "disabled", "onClick"];
4
+ var _excluded = ["type", "disabled", "onClick", "fixed", "width"];
5
5
  import { executeFunction } from "../../api";
6
+ import { transformNameToPath } from "../../form/component/utils";
6
7
  import _ from 'lodash';
7
8
  import { Actions } from "./actions";
8
9
  import { formPropsKeysInTable } from "./constant";
10
+ import { Date, DateTime } from "./date-time";
9
11
  import { Editor } from "./editor";
10
12
  import { getFilterColumn } from "./filter";
11
13
  import { Link } from "./link";
12
14
  import { getSortColumn } from "./sort";
13
15
  import { Switch } from "./switch";
14
- import { Time } from "./time";
15
16
  import { Wrapper } from "./wrapper";
16
17
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
17
18
  export var componentMap = {
18
- time: Time,
19
+ date: Date,
20
+ dateTime: DateTime,
19
21
  link: Link,
20
22
  switch: Switch,
21
23
  actions: Actions,
@@ -30,10 +32,13 @@ export function generateColumns(_ref) {
30
32
  getSearchColumn = _ref.getSearchColumn;
31
33
  return _.map(columns, function (column) {
32
34
  var newColumn = _.clone(column);
33
- var search = newColumn.search,
35
+ var dataIndex = newColumn.dataIndex,
36
+ search = newColumn.search,
34
37
  sort = newColumn.sort,
35
38
  filters = newColumn.filters,
36
- originRender = newColumn.render;
39
+ originRender = newColumn.render,
40
+ _newColumn$align = newColumn.align,
41
+ align = _newColumn$align === void 0 ? 'center' : _newColumn$align;
37
42
  _.assign(newColumn, getColumnWidth(newColumn));
38
43
  if (search) {
39
44
  _.assign(newColumn, getSearchColumn(column));
@@ -78,6 +83,8 @@ export function generateColumns(_ref) {
78
83
  return component;
79
84
  };
80
85
  return _objectSpread(_objectSpread({}, newColumn), {}, {
86
+ dataIndex: transformNameToPath(dataIndex),
87
+ align: align,
81
88
  render: render
82
89
  });
83
90
  });
@@ -136,13 +143,17 @@ export function getRowSelection(_ref3) {
136
143
  return;
137
144
  }
138
145
  var selectedRowKeys = context.selectedRowKeys,
139
- setSelectedRowKeys = context.setSelectedRowKeys,
140
- dataSource = context.dataSource;
146
+ setSelectedRowKeys = context.setSelectedRowKeys;
141
147
  var type = column.type,
142
148
  disabled = column.disabled,
143
149
  onClick = column.onClick,
150
+ _column$fixed = column.fixed,
151
+ fixed = _column$fixed === void 0 ? 'left' : _column$fixed,
152
+ width = column.width,
144
153
  rest = _objectWithoutProperties(column, _excluded);
145
154
  return _objectSpread({
155
+ fixed: fixed,
156
+ columnWidth: width,
146
157
  selectedRowKeys: selectedRowKeys,
147
158
  getCheckboxProps: function getCheckboxProps(record) {
148
159
  return {
@@ -160,14 +171,14 @@ export function getRowSelection(_ref3) {
160
171
  var rowKeys = keys || _.map(selectedRows, rowKey);
161
172
  setSelectedRowKeys(rowKeys);
162
173
  },
163
- onSelectAll: function onSelectAll(selected) {
174
+ onSelectAll: function onSelectAll(selected, selectedRows) {
164
175
  if (selected) {
165
- var selectedRows = _.filter(dataSource, function (record) {
176
+ var _selected = _.filter(selectedRows, function (record) {
166
177
  return !executeFunction(disabled, _objectSpread(_objectSpread({}, context), {}, {
167
178
  record: record
168
179
  }));
169
180
  });
170
- setSelectedRowKeys(_.map(selectedRows, rowKey));
181
+ setSelectedRowKeys(_.map(_selected, rowKey));
171
182
  return;
172
183
  }
173
184
  setSelectedRowKeys([]);
@@ -210,7 +221,7 @@ export function getTableFormInitialValues(_ref5) {
210
221
  return;
211
222
  }
212
223
  return _.map(dataSource, function (item) {
213
- return _.pick(item, [rowKey].concat(_toConsumableArray(keys)));
224
+ return _.pick(item, [rowKey, '__selected__'].concat(_toConsumableArray(keys)));
214
225
  });
215
226
  }
216
227
  export function updateDataSourceByFormValues(formValues, dataSource) {
@@ -6,12 +6,12 @@ export declare function getRenderTabBar({ type, items, size, tabBarGutter, tabBa
6
6
  export declare function generateTabItems({ items }: TabsProps): {
7
7
  label: import("@emotion/react/jsx-runtime").JSX.Element;
8
8
  key: string;
9
- prefixCls?: string | undefined;
10
9
  className?: string | undefined;
11
- style?: import("react").CSSProperties | undefined;
12
10
  disabled?: boolean | undefined;
13
- children?: import("react").ReactNode;
14
11
  id?: string | undefined;
12
+ style?: import("react").CSSProperties | undefined;
13
+ children?: import("react").ReactNode;
14
+ prefixCls?: string | undefined;
15
15
  closable?: boolean | undefined;
16
16
  closeIcon?: import("react").ReactNode;
17
17
  active?: boolean | undefined;
@@ -34,17 +34,17 @@ export declare function getTooltipProps(props: TooltipProps): {
34
34
  defaultVisible?: boolean | undefined;
35
35
  onVisibleChange?: ((visible: boolean) => void) | undefined;
36
36
  afterVisibleChange?: ((visible: boolean) => void) | undefined;
37
+ align?: import("@rc-component/trigger").AlignType | undefined;
38
+ id?: string | undefined;
39
+ prefixCls?: string | undefined;
37
40
  zIndex?: number | undefined;
38
41
  animation?: string | undefined;
39
42
  motion?: import("rc-motion").CSSMotionProps | undefined;
40
- id?: string | undefined;
41
- prefixCls?: string | undefined;
42
43
  transitionName?: string | undefined;
43
44
  mouseEnterDelay?: number | undefined;
44
45
  mouseLeaveDelay?: number | undefined;
45
46
  onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
46
47
  overlayClassName?: string | undefined;
47
- align?: import("@rc-component/trigger").AlignType | undefined;
48
48
  overlayStyle?: import("react").CSSProperties | undefined;
49
49
  trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
50
50
  popupVisible?: boolean | undefined;
@@ -1,2 +1,2 @@
1
1
  import { VirtualListProps } from "..";
2
- export declare function VirtualList({ data, emptyText, children, ...props }: VirtualListProps): import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare function VirtualList({ refs, data, emptyText, children, ...props }: VirtualListProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,12 +1,13 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["data", "emptyText", "children"];
3
+ var _excluded = ["refs", "data", "emptyText", "children"];
4
4
  import { Empty } from "../../empty";
5
5
  import _ from 'lodash';
6
6
  import { Virtuoso } from 'react-virtuoso';
7
7
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
8
8
  export function VirtualList(_ref) {
9
- var data = _ref.data,
9
+ var refs = _ref.refs,
10
+ data = _ref.data,
10
11
  emptyText = _ref.emptyText,
11
12
  children = _ref.children,
12
13
  props = _objectWithoutProperties(_ref, _excluded);
@@ -20,6 +21,7 @@ export function VirtualList(_ref) {
20
21
  });
21
22
  }
22
23
  return _jsx(Virtuoso, _objectSpread({
24
+ ref: refs,
23
25
  data: data,
24
26
  itemContent: function itemContent(index, item, context) {
25
27
  return children(item, index, context);
@@ -1,6 +1,7 @@
1
+ import { BaseComponentProps } from "../../api";
1
2
  import { ReactNode } from 'react';
2
3
  import { VirtuosoProps } from 'react-virtuoso';
3
- export interface VirtualListProps extends Omit<VirtuosoProps<any, any>, 'children'> {
4
+ export interface VirtualListProps extends Omit<VirtuosoProps<any, any>, 'children'>, BaseComponentProps {
4
5
  /**
5
6
  * @description 数据
6
7
  */
@@ -8,13 +8,16 @@ exports.mountComponent = mountComponent;
8
8
  exports.unmountComponent = unmountComponent;
9
9
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
- var _ = require("./..");
11
+ var _2 = require("./..");
12
+ var _lodash = _interopRequireDefault(require("lodash"));
12
13
  var _client = require("react-dom/client");
13
14
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
14
- var _excluded = ["hideBodyScroll"];
15
+ var _excluded = ["hideBodyScroll", "getContainer"];
15
16
  function getContainer() {
17
+ var to = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.body;
16
18
  var container = document.createElement('div');
17
- document.body.append(container);
19
+ var root = _lodash.default.isString(to) ? (0, _2.$)(to) : (0, _2.executeFunction)(to);
20
+ root.append(container);
18
21
  return container;
19
22
  }
20
23
  // 处理React17和18版本的兼容性
@@ -37,7 +40,11 @@ function getReactDOM() {
37
40
  var closeFunctionSet = new Set();
38
41
  function mountComponent(Component) {
39
42
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
40
- var container = getContainer();
43
+ var _props$hideBodyScroll = props.hideBodyScroll,
44
+ hide = _props$hideBodyScroll === void 0 ? false : _props$hideBodyScroll,
45
+ outerContainer = props.getContainer,
46
+ restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
47
+ var container = getContainer(outerContainer);
41
48
  var _getReactDOM = getReactDOM(),
42
49
  render = _getReactDOM.render,
43
50
  unmount = _getReactDOM.unmount;
@@ -45,12 +52,9 @@ function mountComponent(Component) {
45
52
  unmount(container);
46
53
  container.remove();
47
54
  closeFunctionSet.delete(close);
48
- !closeFunctionSet.size && (0, _.hideBodyScroll)(false);
55
+ !closeFunctionSet.size && (0, _2.hideBodyScroll)(false);
49
56
  };
50
- var _props$hideBodyScroll = props.hideBodyScroll,
51
- hide = _props$hideBodyScroll === void 0 ? false : _props$hideBodyScroll,
52
- restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
53
- hide && (0, _.hideBodyScroll)();
57
+ hide && (0, _2.hideBodyScroll)();
54
58
  render((0, _jsxRuntime.jsx)(Component, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, restProps), {}, {
55
59
  unmount: close,
56
60
  getContainer: container
@@ -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[];
@@ -7,22 +7,18 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.sortBy = sortBy;
8
8
  exports.sorter = sorter;
9
9
  var _lodash = _interopRequireDefault(require("lodash"));
10
- function sorter(a, b) {
10
+ function sorter() {
11
+ var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
12
+ var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
11
13
  if (_lodash.default.isNumber(a)) {
12
14
  return a - b;
13
15
  }
14
- if (_lodash.default.isNil(a) && _lodash.default.isNil(b)) {
15
- return 0;
16
- }
17
- if (_lodash.default.isNil(a)) {
18
- return -1;
19
- }
20
16
  return a.localeCompare(b);
21
17
  }
22
18
  function sortBy() {
23
19
  var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
24
20
  var key = arguments.length > 1 ? arguments[1] : undefined;
25
21
  return data.sort(function (a, b) {
26
- return sorter(a[key], b[key]);
22
+ return sorter(_lodash.default.get(a, key), _lodash.default.get(b, key));
27
23
  });
28
24
  }
@@ -30,7 +30,7 @@ function showAllToAllConfig() {
30
30
  var baseConfig = {
31
31
  showAll: true,
32
32
  allProps: {
33
- children: 'All'
33
+ children: '全选'
34
34
  }
35
35
  };
36
36
  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
  }