xmirror-components 1.0.39 → 1.0.40-alpha.2

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 (67) hide show
  1. package/build/dist/index.cjs +31 -109
  2. package/build/dist/index.mjs +3940 -10397
  3. package/build/es/components/AntdApp/index.d.ts +1 -2
  4. package/build/es/components/AntdApp/index.js +2 -5
  5. package/build/es/components/CheckboxValue/index.d.ts +1 -1
  6. package/build/es/components/CheckboxValue/index.js +2 -2
  7. package/build/es/components/ConfigProvider/index.d.ts +1 -1
  8. package/build/es/components/ConfigProvider/index.js +3 -3
  9. package/build/es/components/GlobalLoading/index.d.ts +1 -2
  10. package/build/es/components/GlobalLoading/index.js +8 -19
  11. package/build/es/components/IconButton/index.js +5 -6
  12. package/build/es/components/IconFont/index.js +5 -5
  13. package/build/es/components/IntlProvider/index.d.ts +1 -1
  14. package/build/es/components/IntlProvider/index.js +3 -2
  15. package/build/es/components/SearchArea/Item/index.d.ts +2 -2
  16. package/build/es/components/SearchArea/Item/index.js +4 -2
  17. package/build/es/components/SearchArea/ToggleButton/index.d.ts +1 -2
  18. package/build/es/components/SearchArea/ToggleButton/index.js +3 -4
  19. package/build/es/components/SearchArea/index.js +13 -24
  20. package/build/es/components/SwitchValue/index.d.ts +1 -1
  21. package/build/es/components/SwitchValue/index.js +2 -2
  22. package/build/es/components/Table/Footer/index.d.ts +1 -2
  23. package/build/es/components/Table/Footer/index.js +10 -20
  24. package/build/es/components/Table/PopoverSetColumns/index.d.ts +1 -2
  25. package/build/es/components/Table/PopoverSetColumns/index.js +9 -12
  26. package/build/es/components/Table/PopoverSetColumns/styles.d.ts +0 -4
  27. package/build/es/components/Table/PopoverSetColumns/styles.js +2 -3
  28. package/build/es/components/Table/ResizableColumns/index.js +4 -5
  29. package/build/es/components/Table/index.js +8 -11
  30. package/build/es/components/TagGroup/index.d.ts +40 -0
  31. package/build/es/components/TagGroup/index.js +33 -0
  32. package/build/es/hooks/useSearchParams/index.js +38 -17
  33. package/build/es/hooks/useTable/index.js +30 -14
  34. package/build/lib/components/AntdApp/index.js +2 -5
  35. package/build/lib/components/CheckboxValue/index.js +2 -5
  36. package/build/lib/components/ConfigProvider/index.js +3 -3
  37. package/build/lib/components/GlobalLoading/index.js +8 -52
  38. package/build/lib/components/IconButton/index.js +5 -6
  39. package/build/lib/components/IconFont/index.js +5 -38
  40. package/build/lib/components/IntlProvider/index.js +3 -2
  41. package/build/lib/components/SearchArea/Item/index.js +4 -2
  42. package/build/lib/components/SearchArea/ToggleButton/index.js +3 -37
  43. package/build/lib/components/SearchArea/index.js +13 -57
  44. package/build/lib/components/SwitchValue/index.js +2 -5
  45. package/build/lib/components/Table/Footer/index.js +10 -53
  46. package/build/lib/components/Table/PopoverSetColumns/index.js +9 -45
  47. package/build/lib/components/Table/PopoverSetColumns/styles.js +3 -4
  48. package/build/lib/components/Table/ResizableColumns/index.js +4 -38
  49. package/build/lib/components/Table/index.js +8 -44
  50. package/build/lib/components/TagGroup/index.js +35 -0
  51. package/build/lib/hooks/useSearchParams/index.js +36 -18
  52. package/build/lib/hooks/useTable/index.js +30 -14
  53. package/build/lib/index.d.ts +9 -7
  54. package/build/package.json +13 -12
  55. package/build/types/components/AntdApp/index.d.ts +1 -2
  56. package/build/types/components/CheckboxValue/index.d.ts +1 -1
  57. package/build/types/components/ConfigProvider/index.d.ts +1 -1
  58. package/build/types/components/GlobalLoading/index.d.ts +1 -2
  59. package/build/types/components/IntlProvider/index.d.ts +1 -1
  60. package/build/types/components/SearchArea/Item/index.d.ts +2 -2
  61. package/build/types/components/SearchArea/ToggleButton/index.d.ts +1 -2
  62. package/build/types/components/SwitchValue/index.d.ts +1 -1
  63. package/build/types/components/Table/Footer/index.d.ts +1 -2
  64. package/build/types/components/Table/PopoverSetColumns/index.d.ts +1 -2
  65. package/build/types/components/Table/PopoverSetColumns/styles.d.ts +0 -4
  66. package/build/types/components/TagGroup/index.d.ts +40 -0
  67. package/package.json +13 -12
@@ -9,7 +9,8 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import React, { useEffect, useMemo, useRef, useState, forwardRef } from 'react';
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useEffect, useMemo, useRef, useState, forwardRef } from 'react';
13
14
  import { Table, Tooltip } from 'antd';
14
15
  import { useLocalStorageState } from 'ahooks';
15
16
  import { DownOutlined } from '@ant-design/icons';
@@ -92,9 +93,7 @@ function Index(props, ref) {
92
93
  var initSettingButton = function (column) {
93
94
  var newColumn = __assign({}, column);
94
95
  var columnTitleRender = function (children) {
95
- return (React.createElement("span", null,
96
- children,
97
- React.createElement(PopoverSetColumns, { onChangeOrder: changeOrder, onChangeVisible: changeVisibleItems, order: order, columnsSort: columnsSort, visibleItems: visibleItems, columns: columns, columnsVisible: columnsVisible })));
96
+ return (_jsxs("span", { children: [children, _jsx(PopoverSetColumns, { onChangeOrder: changeOrder, onChangeVisible: changeVisibleItems, order: order, columnsSort: columnsSort, visibleItems: visibleItems, columns: columns, columnsVisible: columnsVisible })] }));
98
97
  };
99
98
  if (typeof column.title === 'function') {
100
99
  newColumn.title = function (props) {
@@ -108,8 +107,7 @@ function Index(props, ref) {
108
107
  };
109
108
  var renderDefaultColumn = function (value) {
110
109
  return value !== null && value !== undefined && value !== ''
111
- ? (React.createElement(Tooltip, { title: value, placement: "topLeft" },
112
- React.createElement("span", { className: 'column-ellipsis' }, value)))
110
+ ? (_jsx(Tooltip, { title: value, placement: "topLeft", children: _jsx("span", { className: 'column-ellipsis', children: value }) }))
113
111
  : '-';
114
112
  };
115
113
  /**
@@ -154,7 +152,7 @@ function Index(props, ref) {
154
152
  }
155
153
  return returnColumns.map(function (item) {
156
154
  if (item.filters && !item.filterIcon) {
157
- item.filterIcon = (React.createElement(DownOutlined, { type: "icon-xiajiantou", style: { fontWeight: 500 } }));
155
+ item.filterIcon = (_jsx(DownOutlined, { type: "icon-xiajiantou", style: { fontWeight: 500 } }));
158
156
  }
159
157
  if (item.ellipsis === false) {
160
158
  item.ellipsis = false;
@@ -172,7 +170,7 @@ function Index(props, ref) {
172
170
  var paginationProps = useMemo(function () {
173
171
  if (props.pagination) {
174
172
  return __assign(__assign({}, (pagination || {})), { showTotal: function () {
175
- return dataSource && dataSource.length > 0 && (React.createElement(Footer, __assign({}, props)));
173
+ return dataSource && dataSource.length > 0 && (_jsx(Footer, __assign({}, props)));
176
174
  } });
177
175
  }
178
176
  else {
@@ -182,9 +180,8 @@ function Index(props, ref) {
182
180
  useEffect(function () {
183
181
  initColumnsSort();
184
182
  }, []);
185
- return (React.createElement(TableWrapper, { ref: ref },
186
- React.createElement(Table, __assign({ ref: tableRef, scroll: {
183
+ return (_jsx(TableWrapper, { ref: ref, children: _jsx(Table, __assign({ ref: tableRef, scroll: {
187
184
  x: 900
188
- }, components: { header: { cell: columnsResizable ? ResizableTitle : undefined } } }, props, { pagination: paginationProps, columns: columnsResizable ? resizableColumns(renderColumns, tableId) : renderColumns }))));
185
+ }, components: { header: { cell: columnsResizable ? ResizableTitle : undefined } } }, props, { pagination: paginationProps, columns: columnsResizable ? resizableColumns(renderColumns, tableId) : renderColumns })) }));
189
186
  }
190
187
  export default forwardRef(Index);
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { Checkbox } from 'antd';
3
+ import { type CheckboxChangeEvent } from 'antd/es/checkbox';
4
+ /**
5
+ * checkbox 可自定义 value 和 label
6
+ * 使用场景:
7
+ * 1. 需要自定义 value 和 label
8
+ */
9
+ interface CheckboxValueProps<T = any, F = any> extends Omit<React.ComponentProps<typeof Checkbox>, 'checked' | 'onChange'> {
10
+ /**
11
+ * 选中值
12
+ */
13
+ trueValue?: T;
14
+ /**
15
+ * 未选中值
16
+ */
17
+ falseValue?: F;
18
+ /**
19
+ * 选中值
20
+ */
21
+ checked?: T | F;
22
+ /**
23
+ * 选中事件
24
+ */
25
+ onChange?: (value: T | F, event: CheckboxChangeEvent) => void;
26
+ /**
27
+ * 选中标签
28
+ */
29
+ trueLabel?: string;
30
+ /**
31
+ * 未选中标签
32
+ */
33
+ falseLabel?: string;
34
+ /**
35
+ * 子元素
36
+ */
37
+ children?: React.ReactNode;
38
+ }
39
+ declare const CheckboxValue: <T = any, F = any>({ checked, onChange, trueValue, falseValue, trueLabel, falseLabel, children, ...props }: CheckboxValueProps<T, F>) => import("react/jsx-runtime").JSX.Element;
40
+ export default CheckboxValue;
@@ -0,0 +1,33 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { Checkbox } from 'antd';
25
+ var CheckboxValue = function (_a) {
26
+ var checked = _a.checked, onChange = _a.onChange, _b = _a.trueValue, trueValue = _b === void 0 ? true : _b, _c = _a.falseValue, falseValue = _c === void 0 ? false : _c, _d = _a.trueLabel, trueLabel = _d === void 0 ? '' : _d, _e = _a.falseLabel, falseLabel = _e === void 0 ? '' : _e, children = _a.children, props = __rest(_a, ["checked", "onChange", "trueValue", "falseValue", "trueLabel", "falseLabel", "children"]);
27
+ var _checked = checked === trueValue;
28
+ var change = function (e) {
29
+ onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked ? trueValue : falseValue, e);
30
+ };
31
+ return (_jsx(Checkbox, __assign({ checked: _checked, onChange: change }, props, { children: children || (_checked ? trueLabel : falseLabel) })));
32
+ };
33
+ export default CheckboxValue;
@@ -45,9 +45,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
45
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
46
  }
47
47
  };
48
- import { useRef, useEffect, useContext } from 'react';
49
- import { useBlocker, useNavigate, useLocation } from 'react-router-dom';
50
- import useUrlState from '@ahooksjs/use-url-state';
48
+ import { useRef, useEffect, useContext, useMemo, useCallback } from 'react';
49
+ import { useBlocker, useNavigate, useLocation, useSearchParams as useRouterSearchParams } from 'react-router-dom';
51
50
  import { useUpdate } from 'ahooks';
52
51
  import { noop } from 'lodash-es';
53
52
  import { encodeParams, decodeParams } from './util';
@@ -64,9 +63,29 @@ var useSearchParams = function (initialValue, options) {
64
63
  var update = useUpdate();
65
64
  var navigator = useNavigate();
66
65
  var location = useLocation();
67
- var _e = useUrlState(encodeParams(__assign(__assign({}, initialSearchParams), initialValue)), {
68
- navigateMode: 'replace'
69
- }), urlParams = _e[0], setUrlParams = _e[1];
66
+ var _e = useRouterSearchParams(), routerSearchParams = _e[0], setRouterSearchParams = _e[1];
67
+ var urlParams = useMemo(function () {
68
+ var params = {};
69
+ routerSearchParams.forEach(function (value, key) {
70
+ params[key] = value;
71
+ });
72
+ return params;
73
+ }, [routerSearchParams]);
74
+ var setUrlParams = useCallback(function (params) {
75
+ var nextParams = new URLSearchParams(routerSearchParams);
76
+ Object.entries(params).forEach(function (_a) {
77
+ var key = _a[0], value = _a[1];
78
+ if (value === undefined || value === null || value === '') {
79
+ nextParams.delete(key);
80
+ }
81
+ else {
82
+ nextParams.set(key, String(value));
83
+ }
84
+ });
85
+ setRouterSearchParams(nextParams, {
86
+ replace: true
87
+ });
88
+ }, [routerSearchParams, setRouterSearchParams]);
70
89
  var initialDecodedParams = storage === 'url'
71
90
  ? decodeParams(urlParams)
72
91
  : (((_a = location.state) === null || _a === void 0 ? void 0 : _a[stateKey]) || {});
@@ -87,21 +106,23 @@ var useSearchParams = function (initialValue, options) {
87
106
  * 根据配置更新存储
88
107
  */
89
108
  var persistParams = function (params) { return __awaiter(void 0, void 0, void 0, function () {
90
- var payload, params_1, search, key, value;
91
- var _a, _b;
92
- return __generator(this, function (_c) {
109
+ var payload, params_1, urlSearchParams, _i, _a, _b, key, value, search;
110
+ var _c, _d;
111
+ return __generator(this, function (_e) {
93
112
  payload = __assign(__assign({}, params), { y: window.scrollY });
94
113
  if (storage === 'url') {
95
114
  params_1 = encodeParams(payload);
96
115
  setUrlParams(params_1);
97
- search = '';
98
- for (key in params_1) {
99
- value = params_1[key];
100
- search += "".concat(key, "=").concat(value, "&");
116
+ urlSearchParams = new URLSearchParams();
117
+ for (_i = 0, _a = Object.entries(params_1); _i < _a.length; _i++) {
118
+ _b = _a[_i], key = _b[0], value = _b[1];
119
+ if (value !== undefined && value !== null && value !== '') {
120
+ urlSearchParams.set(key, String(value));
121
+ }
101
122
  }
102
- search = search.slice(0, -1);
123
+ search = urlSearchParams.toString();
103
124
  window.routerHistory.set(location.pathname, {
104
- path: "".concat(location.pathname, "?").concat(search),
125
+ path: search ? "".concat(location.pathname, "?").concat(search) : location.pathname,
105
126
  replace: true,
106
127
  });
107
128
  return [2 /*return*/];
@@ -109,11 +130,11 @@ var useSearchParams = function (initialValue, options) {
109
130
  window.routerHistory.set(location.pathname, {
110
131
  path: location.pathname,
111
132
  replace: true,
112
- state: __assign(__assign({}, (location.state || {})), (_a = {}, _a[stateKey] = payload, _a)),
133
+ state: __assign(__assign({}, (location.state || {})), (_c = {}, _c[stateKey] = payload, _c)),
113
134
  });
114
135
  navigator(location.pathname, {
115
136
  replace: true,
116
- state: __assign(__assign({}, location.state), (_b = {}, _b[stateKey] = payload, _b))
137
+ state: __assign(__assign({}, location.state), (_d = {}, _d[stateKey] = payload, _d))
117
138
  });
118
139
  return [2 /*return*/];
119
140
  });
@@ -85,6 +85,7 @@ function useTable(request, options) {
85
85
  var intl = useIntl();
86
86
  var _a = __assign(__assign({}, defaultOptions), options), rowKey = _a.rowKey, interval = _a.interval, immediate = _a.immediate, defaultPagination = _a.defaultPagination, showRowSelection = _a.showRowSelection, multiPageSelection = _a.multiPageSelection, onBeforeRequest = _a.onBeforeRequest, onAfterRequest = _a.onAfterRequest;
87
87
  var tableTimerRef = useRef(null);
88
+ var latestRequestIdRef = useRef(0);
88
89
  var _b = useState(false), loading = _b[0], setLoading = _b[1];
89
90
  var _c = useState([]), tableData = _c[0], setTableData = _c[1];
90
91
  var _d = useState(__assign({ current: 1, pageSize: 10, total: 0 }, defaultPagination)), pagination = _d[0], setPagination = _d[1];
@@ -110,7 +111,7 @@ function useTable(request, options) {
110
111
  args_1[_i] = arguments[_i];
111
112
  }
112
113
  return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (page, pageSize, auto) {
113
- var requestParams, params, finalParams, response, _a, records, total, current, size, data, list, maxPage, error_1, errorMessage;
114
+ var requestId, requestParams, params, finalParams, response, _a, records, total_1, current_1, size_1, data, list, maxPage, error_1, errorMessage;
114
115
  if (page === void 0) { page = 1; }
115
116
  if (pageSize === void 0) { pageSize = 10; }
116
117
  return __generator(this, function (_b) {
@@ -124,6 +125,7 @@ function useTable(request, options) {
124
125
  resetTableTimer(page, pageSize);
125
126
  return [2 /*return*/];
126
127
  }
128
+ requestId = ++latestRequestIdRef.current;
127
129
  _b.label = 1;
128
130
  case 1:
129
131
  _b.trys.push([1, 5, 6, 7]);
@@ -135,35 +137,48 @@ function useTable(request, options) {
135
137
  return [4 /*yield*/, request(finalParams)];
136
138
  case 3:
137
139
  response = _b.sent();
138
- _a = response.data, records = _a.records, total = _a.total, current = _a.current, size = _a.size;
140
+ _a = response.data, records = _a.records, total_1 = _a.total, current_1 = _a.current, size_1 = _a.size;
139
141
  return [4 /*yield*/, (onAfterRequest === null || onAfterRequest === void 0 ? void 0 : onAfterRequest(response))];
140
142
  case 4:
141
143
  data = _b.sent();
142
144
  list = Array.isArray(data) ? data : records;
143
- setTableData(list);
144
- if (current !== pagination.current ||
145
- pageSize !== pagination.pageSize ||
146
- total !== pagination.total) {
147
- setPagination({
148
- current: current,
149
- pageSize: size,
150
- total: total
151
- });
145
+ // 仅处理最新请求,避免并发请求导致旧数据覆盖新状态
146
+ if (requestId !== latestRequestIdRef.current) {
147
+ return [2 /*return*/];
152
148
  }
153
- if (list.length === 0 && current && current > 1 && total && total > 0) {
154
- maxPage = Math.ceil(total / size);
149
+ setTableData(list);
150
+ setPagination(function (prev) {
151
+ if (current_1 === prev.current &&
152
+ size_1 === prev.pageSize &&
153
+ total_1 === prev.total) {
154
+ return prev;
155
+ }
156
+ return {
157
+ current: current_1,
158
+ pageSize: size_1,
159
+ total: total_1
160
+ };
161
+ });
162
+ if (list.length === 0 && current_1 && current_1 > 1 && total_1 && total_1 > 0) {
163
+ maxPage = Math.ceil(total_1 / size_1);
155
164
  initList(maxPage, pageSize, auto);
156
165
  }
157
166
  else {
158
- resetTableTimer(current, size);
167
+ resetTableTimer(current_1, size_1);
159
168
  }
160
169
  return [3 /*break*/, 7];
161
170
  case 5:
162
171
  error_1 = _b.sent();
172
+ if (requestId !== latestRequestIdRef.current) {
173
+ return [2 /*return*/];
174
+ }
163
175
  errorMessage = error_1 instanceof Error ? error_1.message : '请求失败';
164
176
  message.error(errorMessage);
165
177
  return [3 /*break*/, 7];
166
178
  case 6:
179
+ if (requestId !== latestRequestIdRef.current) {
180
+ return [2 /*return*/];
181
+ }
167
182
  if (!multiPageSelection) {
168
183
  setSelectedRows([]);
169
184
  }
@@ -293,6 +308,7 @@ function useTable(request, options) {
293
308
  // 使用当前分页值作为默认值,处理可能为 undefined 的情况
294
309
  var currentPage = (_b = pagination.current) !== null && _b !== void 0 ? _b : paginationRef.current.current;
295
310
  var currentPageSize = (_c = pagination.pageSize) !== null && _c !== void 0 ? _c : paginationRef.current.pageSize;
311
+ setPagination(function (prev) { return (__assign(__assign({}, prev), { current: currentPage, pageSize: currentPageSize })); });
296
312
  initList(currentPage, currentPageSize);
297
313
  }, [initList, searchParams]);
298
314
  var reset = function () {
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
28
  exports.modal = exports.notification = exports.message = void 0;
29
- var react_1 = __importDefault(require("react"));
29
+ var jsx_runtime_1 = require("react/jsx-runtime");
30
30
  var antd_1 = require("antd");
31
31
  var GlobalLoading_1 = __importDefault(require("./../GlobalLoading"));
32
32
  var ConfigProvider_1 = __importDefault(require("./../ConfigProvider"));
@@ -46,9 +46,6 @@ function InitApp(_a) {
46
46
  }
47
47
  function Index(_a) {
48
48
  var children = _a.children, config = _a.config, props = __rest(_a, ["children", "config"]);
49
- return (react_1.default.createElement(ConfigProvider_1.default, { config: config || {} },
50
- react_1.default.createElement(antd_1.App, __assign({}, props),
51
- react_1.default.createElement(GlobalLoading_1.default, null),
52
- react_1.default.createElement(InitApp, null, children))));
49
+ return ((0, jsx_runtime_1.jsx)(ConfigProvider_1.default, { config: config || {}, children: (0, jsx_runtime_1.jsxs)(antd_1.App, __assign({}, props, { children: [(0, jsx_runtime_1.jsx)(GlobalLoading_1.default, {}), (0, jsx_runtime_1.jsx)(InitApp, { children: children })] })) }));
53
50
  }
54
51
  exports.default = Index;
@@ -21,11 +21,8 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  }
22
22
  return t;
23
23
  };
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
24
  Object.defineProperty(exports, "__esModule", { value: true });
28
- var react_1 = __importDefault(require("react"));
25
+ var jsx_runtime_1 = require("react/jsx-runtime");
29
26
  var antd_1 = require("antd");
30
27
  var CheckboxValue = function (_a) {
31
28
  var checked = _a.checked, onChange = _a.onChange, _b = _a.trueValue, trueValue = _b === void 0 ? true : _b, _c = _a.falseValue, falseValue = _c === void 0 ? false : _c, _d = _a.trueLabel, trueLabel = _d === void 0 ? '' : _d, _e = _a.falseLabel, falseLabel = _e === void 0 ? '' : _e, children = _a.children, props = __rest(_a, ["checked", "onChange", "trueValue", "falseValue", "trueLabel", "falseLabel", "children"]);
@@ -33,6 +30,6 @@ var CheckboxValue = function (_a) {
33
30
  var change = function (e) {
34
31
  onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked ? trueValue : falseValue, e);
35
32
  };
36
- return (react_1.default.createElement(antd_1.Checkbox, __assign({ checked: _checked, onChange: change }, props), children || (_checked ? trueLabel : falseLabel)));
33
+ return ((0, jsx_runtime_1.jsx)(antd_1.Checkbox, __assign({ checked: _checked, onChange: change }, props, { children: children || (_checked ? trueLabel : falseLabel) })));
37
34
  };
38
35
  exports.default = CheckboxValue;
@@ -16,6 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.ConfigContext = void 0;
18
18
  exports.default = ConfigProvider;
19
+ var jsx_runtime_1 = require("react/jsx-runtime");
19
20
  var react_1 = __importDefault(require("react"));
20
21
  var IntlProvider_1 = __importDefault(require("../IntlProvider"));
21
22
  var locale_1 = require("../../locale");
@@ -53,9 +54,8 @@ exports.ConfigContext = react_1.default.createContext(baseConfig);
53
54
  function ConfigProvider(_a) {
54
55
  var children = _a.children, config = _a.config;
55
56
  var mergeConfig = deepMerge(baseConfig, config);
56
- return (react_1.default.createElement(exports.ConfigContext.Provider, { value: mergeConfig },
57
- react_1.default.createElement(IntlProvider_1.default, { config: {
57
+ return ((0, jsx_runtime_1.jsx)(exports.ConfigContext.Provider, { value: mergeConfig, children: (0, jsx_runtime_1.jsx)(IntlProvider_1.default, { config: {
58
58
  locale: config.locale,
59
59
  messages: locale_1.messages
60
- } }, children)));
60
+ }, children: children }) }));
61
61
  }
@@ -3,45 +3,13 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
4
  return cooked;
5
5
  };
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
- Object.defineProperty(o, "default", { enumerable: true, value: v });
19
- }) : function(o, v) {
20
- o["default"] = v;
21
- });
22
- var __importStar = (this && this.__importStar) || (function () {
23
- var ownKeys = function(o) {
24
- ownKeys = Object.getOwnPropertyNames || function (o) {
25
- var ar = [];
26
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
- return ar;
28
- };
29
- return ownKeys(o);
30
- };
31
- return function (mod) {
32
- if (mod && mod.__esModule) return mod;
33
- var result = {};
34
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
- __setModuleDefault(result, mod);
36
- return result;
37
- };
38
- })();
39
6
  var __importDefault = (this && this.__importDefault) || function (mod) {
40
7
  return (mod && mod.__esModule) ? mod : { "default": mod };
41
8
  };
42
9
  Object.defineProperty(exports, "__esModule", { value: true });
43
10
  exports.setGlobalLoading = void 0;
44
- var react_1 = __importStar(require("react"));
11
+ var jsx_runtime_1 = require("react/jsx-runtime");
12
+ var react_1 = require("react");
45
13
  var react_transition_group_1 = require("react-transition-group");
46
14
  var styled_1 = __importDefault(require("@emotion/styled"));
47
15
  var react_2 = require("@emotion/react");
@@ -75,24 +43,12 @@ function GlobalLoading() {
75
43
  setLoading(value);
76
44
  };
77
45
  }, []);
78
- return (react_1.default.createElement(react_transition_group_1.CSSTransition, { in: loading, nodeRef: ref, timeout: 500, classNames: "global-loading-transition", unmountOnExit: true }, function () {
79
- return (react_1.default.createElement(GlobalLoadingWrapper, { ref: ref, className: "global-loading" },
80
- react_1.default.createElement(LoadingContainer, { className: "global-loading-container" },
81
- react_1.default.createElement(Dot, { className: "dot dot-1", size: 15, delay: "0.0s" }),
82
- react_1.default.createElement(Dot, { className: "dot dot-2", size: 13, delay: "0.2s" }),
83
- react_1.default.createElement(Dot, { className: "dot dot-3", size: 11, delay: "0.4s" }),
84
- react_1.default.createElement(Dot, { className: "dot dot-4", size: 9, delay: "0.6s" }),
85
- react_1.default.createElement(Dot, { className: "dot dot-5", size: 7, delay: "0.8s" })),
86
- react_1.default.createElement("svg", { style: {
87
- visibility: 'hidden',
88
- position: 'absolute'
89
- } },
90
- react_1.default.createElement("defs", null,
91
- react_1.default.createElement("filter", { id: "goo" },
92
- react_1.default.createElement("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "3", result: "blur" }),
93
- react_1.default.createElement("feColorMatrix", { in: "blur", type: "matrix", values: "\n 1 0 0 0 0\n 0 1 0 0 0\n 0 0 1 0 0\n 0 0 0 18 -6" }),
94
- react_1.default.createElement("feComposite", { in: "SourceGraphic", in2: "goo", operator: "atop" }))))));
95
- }));
46
+ return ((0, jsx_runtime_1.jsx)(react_transition_group_1.CSSTransition, { in: loading, nodeRef: ref, timeout: 500, classNames: "global-loading-transition", unmountOnExit: true, children: function () {
47
+ return ((0, jsx_runtime_1.jsxs)(GlobalLoadingWrapper, { ref: ref, className: "global-loading", children: [(0, jsx_runtime_1.jsxs)(LoadingContainer, { className: "global-loading-container", children: [(0, jsx_runtime_1.jsx)(Dot, { className: "dot dot-1", size: 15, delay: "0.0s" }), (0, jsx_runtime_1.jsx)(Dot, { className: "dot dot-2", size: 13, delay: "0.2s" }), (0, jsx_runtime_1.jsx)(Dot, { className: "dot dot-3", size: 11, delay: "0.4s" }), (0, jsx_runtime_1.jsx)(Dot, { className: "dot dot-4", size: 9, delay: "0.6s" }), (0, jsx_runtime_1.jsx)(Dot, { className: "dot dot-5", size: 7, delay: "0.8s" })] }), (0, jsx_runtime_1.jsx)("svg", { style: {
48
+ visibility: 'hidden',
49
+ position: 'absolute'
50
+ }, children: (0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("filter", { id: "goo", children: [(0, jsx_runtime_1.jsx)("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "3", result: "blur" }), (0, jsx_runtime_1.jsx)("feColorMatrix", { in: "blur", type: "matrix", values: "\n 1 0 0 0 0\n 0 1 0 0 0\n 0 0 1 0 0\n 0 0 0 18 -6" }), (0, jsx_runtime_1.jsx)("feComposite", { in: "SourceGraphic", in2: "goo", operator: "atop" })] }) }) })] }));
51
+ } }));
96
52
  }
97
53
  exports.default = GlobalLoading;
98
54
  var templateObject_1, templateObject_2, templateObject_3;
@@ -62,6 +62,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
62
62
  return (mod && mod.__esModule) ? mod : { "default": mod };
63
63
  };
64
64
  Object.defineProperty(exports, "__esModule", { value: true });
65
+ var jsx_runtime_1 = require("react/jsx-runtime");
65
66
  var react_1 = __importStar(require("react"));
66
67
  var antd_1 = require("antd");
67
68
  var lodash_es_1 = require("lodash-es");
@@ -70,7 +71,7 @@ var IconFont_1 = __importDefault(require("../IconFont"));
70
71
  var ConfigProvider_1 = require("../ConfigProvider");
71
72
  var styled_1 = __importDefault(require("@emotion/styled"));
72
73
  // 1. 先用 forwardRef 包裹 antd Button,确保 ref 类型
73
- var BaseButton = react_1.default.forwardRef(function (props, ref) { return (react_1.default.createElement(antd_1.Button, __assign({ ref: ref }, props))); });
74
+ var BaseButton = react_1.default.forwardRef(function (props, ref) { return ((0, jsx_runtime_1.jsx)(antd_1.Button, __assign({ ref: ref }, props))); });
74
75
  // 2. 用 styled/emotion 包裹 BaseButton
75
76
  var StyledButton = (0, styled_1.default)(BaseButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &&.icon-button {\n font-size: 18px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: var(--color-primary-bg);\n }\n }\n"], ["\n &&.icon-button {\n font-size: 18px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: var(--color-primary-bg);\n }\n }\n"])));
76
77
  var ButtonTooltip = function (_a) {
@@ -79,7 +80,7 @@ var ButtonTooltip = function (_a) {
79
80
  return children;
80
81
  }
81
82
  else {
82
- return (react_1.default.createElement(antd_1.Tooltip, __assign({ title: disabled ? disabledReason || title : title }, attrs), children));
83
+ return ((0, jsx_runtime_1.jsx)(antd_1.Tooltip, __assign({ title: disabled ? disabledReason || title : title }, attrs, { children: children })));
83
84
  }
84
85
  };
85
86
  var IconButton = (0, react_1.forwardRef)(function (props, ref) {
@@ -87,7 +88,7 @@ var IconButton = (0, react_1.forwardRef)(function (props, ref) {
87
88
  var Icon = props.icon, _a = props.tooltipDisabled, tooltipDisabled = _a === void 0 ? false : _a, title = props.title, _b = props.hide, hide = _b === void 0 ? false : _b, disabledReason = props.disabledReason, _c = props.onClick, onClick = _c === void 0 ? lodash_es_1.noop : _c, disabled = props.disabled, _d = props.size, size = _d === void 0 ? iconButton.size || 'small' : _d, _e = props.style, style = _e === void 0 ? {} : _e, className = props.className, _f = props.loading, loading = _f === void 0 ? false : _f, attrs = __rest(props, ["icon", "tooltipDisabled", "title", "hide", "disabledReason", "onClick", "disabled", "size", "style", "className", "loading"]);
88
89
  var createIcon = function () {
89
90
  if ((0, lodash_es_1.isString)(Icon)) {
90
- return react_1.default.createElement(IconFont_1.default, { type: Icon });
91
+ return (0, jsx_runtime_1.jsx)(IconFont_1.default, { type: Icon });
91
92
  }
92
93
  else {
93
94
  return Icon;
@@ -97,9 +98,7 @@ var IconButton = (0, react_1.forwardRef)(function (props, ref) {
97
98
  if (!Icon) {
98
99
  console.warn('Icon props not found');
99
100
  }
100
- return (react_1.default.createElement(IconButtonRender, __assign({}, props),
101
- react_1.default.createElement(ButtonTooltip, __assign({ tooltipDisabled: tooltipDisabled, hide: hide, disabled: disabled, disabledReason: disabledReason, title: title }, attrs),
102
- react_1.default.createElement(StyledButton, { ref: ref, icon: createIcon(), size: size, className: (0, classnames_1.default)(['icon-button', iconButton.className, className]), disabled: disabled, style: __assign(__assign({}, iconButton.style), style), loading: loading, onClick: onClick }))));
101
+ return ((0, jsx_runtime_1.jsx)(IconButtonRender, __assign({}, props, { children: (0, jsx_runtime_1.jsx)(ButtonTooltip, __assign({ tooltipDisabled: tooltipDisabled, hide: hide, disabled: disabled, disabledReason: disabledReason, title: title }, attrs, { children: (0, jsx_runtime_1.jsx)(StyledButton, { ref: ref, icon: createIcon(), size: size, className: (0, classnames_1.default)(['icon-button', iconButton.className, className]), disabled: disabled, style: __assign(__assign({}, iconButton.style), style), loading: loading, onClick: onClick }) })) })));
103
102
  });
104
103
  exports.default = IconButton;
105
104
  var templateObject_1;
@@ -10,39 +10,6 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || (function () {
30
- var ownKeys = function(o) {
31
- ownKeys = Object.getOwnPropertyNames || function (o) {
32
- var ar = [];
33
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
- return ar;
35
- };
36
- return ownKeys(o);
37
- };
38
- return function (mod) {
39
- if (mod && mod.__esModule) return mod;
40
- var result = {};
41
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
- __setModuleDefault(result, mod);
43
- return result;
44
- };
45
- })();
46
13
  var __rest = (this && this.__rest) || function (s, e) {
47
14
  var t = {};
48
15
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -58,22 +25,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
58
25
  return (mod && mod.__esModule) ? mod : { "default": mod };
59
26
  };
60
27
  Object.defineProperty(exports, "__esModule", { value: true });
61
- var react_1 = __importStar(require("react"));
28
+ var jsx_runtime_1 = require("react/jsx-runtime");
29
+ var react_1 = require("react");
62
30
  var classnames_1 = __importDefault(require("classnames"));
63
31
  var ConfigProvider_1 = require("../ConfigProvider");
64
32
  var IconFont = (0, react_1.forwardRef)(function (_a, ref) {
65
33
  var _b = _a.type, type = _b === void 0 ? '' : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.symbol, symbol = _d === void 0 ? false : _d, style = _a.style, attrs = __rest(_a, ["type", "className", "symbol", "style"]);
66
34
  var iconFont = (0, react_1.useContext)(ConfigProvider_1.ConfigContext).iconFont;
67
35
  if (symbol) {
68
- return (react_1.default.createElement("svg", __assign({ className: (0, classnames_1.default)([
36
+ return ((0, jsx_runtime_1.jsx)("svg", __assign({ className: (0, classnames_1.default)([
69
37
  'iconfont-symbol',
70
38
  iconFont.className || '',
71
39
  type,
72
40
  className,
73
- ]), "aria-hidden": "true", ref: ref, style: __assign(__assign({}, iconFont.style), (style || {})) }, attrs),
74
- react_1.default.createElement("use", { xlinkHref: "#".concat(type) })));
41
+ ]), "aria-hidden": "true", ref: ref, style: __assign(__assign({}, iconFont.style), (style || {})) }, attrs, { children: (0, jsx_runtime_1.jsx)("use", { xlinkHref: "#".concat(type) }) })));
75
42
  }
76
- return (react_1.default.createElement("i", __assign({ className: (0, classnames_1.default)([
43
+ return ((0, jsx_runtime_1.jsx)("i", __assign({ className: (0, classnames_1.default)([
77
44
  'iconfont',
78
45
  iconFont.className || '',
79
46
  type,
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.useIntl = exports.FormattedMessage = exports.IntlContext = void 0;
7
7
  exports.default = IntlProvider;
8
+ var jsx_runtime_1 = require("react/jsx-runtime");
8
9
  var react_1 = __importDefault(require("react"));
9
10
  var locale_1 = require("../../locale");
10
11
  var FormattedMessage_1 = __importDefault(require("./FormattedMessage"));
@@ -18,8 +19,8 @@ var baseConfig = {
18
19
  exports.IntlContext = react_1.default.createContext(baseConfig);
19
20
  function IntlProvider(_a) {
20
21
  var children = _a.children, config = _a.config;
21
- return (react_1.default.createElement(exports.IntlContext.Provider, { value: {
22
+ return ((0, jsx_runtime_1.jsx)(exports.IntlContext.Provider, { value: {
22
23
  locale: config.locale,
23
24
  messages: locale_1.messages
24
- } }, children));
25
+ }, children: children }));
25
26
  }
@@ -29,13 +29,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
29
29
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
- var react_1 = __importDefault(require("react"));
32
+ var jsx_runtime_1 = require("react/jsx-runtime");
33
33
  var antd_1 = require("antd");
34
34
  var styled_1 = __importDefault(require("@emotion/styled"));
35
35
  var StyledFormItem = (0, styled_1.default)(antd_1.Form.Item)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .search-item__label {\n position: relative;\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n height: 32px;\n font-size: 14px;\n color: rgba(0, 0, 0, 85%);\n\n &::after {\n position: relative;\n top: -0.5px;\n margin: 0 8px 0 2px;\n content: ':';\n }\n }\n\n .search-item__content {\n flex: 1;\n }\n"], ["\n .search-item__label {\n position: relative;\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n height: 32px;\n font-size: 14px;\n color: rgba(0, 0, 0, 85%);\n\n &::after {\n position: relative;\n top: -0.5px;\n margin: 0 8px 0 2px;\n content: ':';\n }\n }\n\n .search-item__content {\n flex: 1;\n }\n"
36
36
  /**
37
37
  * 筛选项
38
38
  * @param props
39
+ * @param children
39
40
  * @return {JSX.Element}
40
41
  * @constructor
41
42
  */
@@ -43,12 +44,13 @@ var StyledFormItem = (0, styled_1.default)(antd_1.Form.Item)(templateObject_1 ||
43
44
  /**
44
45
  * 筛选项
45
46
  * @param props
47
+ * @param children
46
48
  * @return {JSX.Element}
47
49
  * @constructor
48
50
  */
49
51
  function Index(_a) {
50
52
  var children = _a.children, props = __rest(_a, ["children"]);
51
- return (react_1.default.createElement(StyledFormItem, __assign({}, props), children));
53
+ return ((0, jsx_runtime_1.jsx)(StyledFormItem, __assign({}, props, { children: children })));
52
54
  }
53
55
  exports.default = Index;
54
56
  var templateObject_1;