@ccs-ui/rc-pro 2.3.6-beta-40 → 2.4.0-beta.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 (209) hide show
  1. package/docs-dist/1449.2b56219b.async.js +15 -0
  2. package/docs-dist/1449.e8c51481.chunk.css +5 -0
  3. package/docs-dist/1474.20b8cea1.async.js +578 -0
  4. package/docs-dist/2085.27b7a56c.async.js +5 -0
  5. package/docs-dist/27.cf0e6aaf.async.js +11 -0
  6. package/docs-dist/404.html +15 -0
  7. package/docs-dist/4859.645461e8.async.js +18 -0
  8. package/docs-dist/9510.92d7c9e5.async.js +137 -0
  9. package/docs-dist/auth__demos.3be7cd2a.async.js +1 -0
  10. package/docs-dist/button__demos.a0dc2689.async.js +1 -0
  11. package/docs-dist/cascader__demos.d47af25c.async.js +1 -0
  12. package/docs-dist/date-picker__demos.259c9ecb.async.js +1 -0
  13. package/docs-dist/demos.a585b64a.async.js +1 -0
  14. package/docs-dist/dialog__demos.03d15fe7.async.js +1 -0
  15. package/docs-dist/docs__guide.md.33be0665.chunk.css +1 -0
  16. package/docs-dist/docs__guide.md.e5041fb4.async.js +1 -0
  17. package/docs-dist/docs__index.md.33be0665.chunk.css +1 -0
  18. package/docs-dist/docs__index.md.75a9a568.async.js +1 -0
  19. package/docs-dist/dumi__tmp-production__dumi__theme__ContextWrapper.ef64dc7c.async.js +1 -0
  20. package/docs-dist/editor__demos.88663d1e.async.js +6 -0
  21. package/docs-dist/favicon.png +0 -0
  22. package/docs-dist/group-form-item__demos.4b5b499b.async.js +1 -0
  23. package/docs-dist/guide/index.html +15 -0
  24. package/docs-dist/index.html +15 -0
  25. package/docs-dist/interval-button__demos.d647fbab.async.js +1 -0
  26. package/docs-dist/loading__demos.fe7b1e59.async.js +1 -0
  27. package/docs-dist/logo.svg +48 -0
  28. package/docs-dist/meta__docs.56a19a6a.async.js +1 -0
  29. package/docs-dist/meta__packages.6c636f9a.async.js +13817 -0
  30. package/docs-dist/meta__packages.9ed2b563.chunk.css +1 -0
  31. package/docs-dist/nm__dumi__dist__client__pages__404.3097fa22.async.js +1 -0
  32. package/docs-dist/nm__dumi__dist__client__pages__404.8b85f2d9.chunk.css +1 -0
  33. package/docs-dist/nm__dumi__dist__client__pages__Demo__index.578aa5c0.chunk.css +1 -0
  34. package/docs-dist/nm__dumi__dist__client__pages__Demo__index.83a2c730.async.js +1 -0
  35. package/docs-dist/nm__dumi__theme-default__layouts__DocLayout__index.e556091c.async.js +1 -0
  36. package/docs-dist/packages__plugin-eui__src__free.md.33be0665.chunk.css +1 -0
  37. package/docs-dist/packages__plugin-eui__src__free.md.9706dcd8.async.js +1 -0
  38. package/docs-dist/packages__plugin-eui__src__table-tree.md.33be0665.chunk.css +1 -0
  39. package/docs-dist/packages__plugin-eui__src__table-tree.md.63bc8653.async.js +1 -0
  40. package/docs-dist/packages__plugin-eui__src__table.md.33be0665.chunk.css +1 -0
  41. package/docs-dist/packages__plugin-eui__src__table.md.58c0aeec.async.js +1 -0
  42. package/docs-dist/packages__plugin-eui__src__tabs.md.33be0665.chunk.css +1 -0
  43. package/docs-dist/packages__plugin-eui__src__tabs.md.5cd12eb6.async.js +1 -0
  44. package/docs-dist/packages__plugin-openapi__src__index.md.33be0665.chunk.css +1 -0
  45. package/docs-dist/packages__plugin-openapi__src__index.md.ac4ed387.async.js +54 -0
  46. package/docs-dist/packages__rc-pro__src__auth__index.md.09d47ed9.async.js +1 -0
  47. package/docs-dist/packages__rc-pro__src__auth__index.md.33be0665.chunk.css +1 -0
  48. package/docs-dist/packages__rc-pro__src__button__index.md.33be0665.chunk.css +1 -0
  49. package/docs-dist/packages__rc-pro__src__button__index.md.e4392f5d.async.js +1 -0
  50. package/docs-dist/packages__rc-pro__src__cascader__index.md.33be0665.chunk.css +1 -0
  51. package/docs-dist/packages__rc-pro__src__cascader__index.md.83dd07db.async.js +1 -0
  52. package/docs-dist/packages__rc-pro__src__date-picker__index.md.1954391f.async.js +1 -0
  53. package/docs-dist/packages__rc-pro__src__date-picker__index.md.33be0665.chunk.css +1 -0
  54. package/docs-dist/packages__rc-pro__src__dialog__index.md.0ab8f5d9.async.js +1 -0
  55. package/docs-dist/packages__rc-pro__src__dialog__index.md.33be0665.chunk.css +1 -0
  56. package/docs-dist/packages__rc-pro__src__editor__index.md.33be0665.chunk.css +1 -0
  57. package/docs-dist/packages__rc-pro__src__editor__index.md.571e2c64.async.js +1 -0
  58. package/docs-dist/packages__rc-pro__src__group-form-item__index.md.33be0665.chunk.css +1 -0
  59. package/docs-dist/packages__rc-pro__src__group-form-item__index.md.ae7880a8.async.js +1 -0
  60. package/docs-dist/packages__rc-pro__src__index.md.2043702c.async.js +1 -0
  61. package/docs-dist/packages__rc-pro__src__index.md.33be0665.chunk.css +1 -0
  62. package/docs-dist/packages__rc-pro__src__interval-button__index.md.33be0665.chunk.css +1 -0
  63. package/docs-dist/packages__rc-pro__src__interval-button__index.md.4ee5873c.async.js +1 -0
  64. package/docs-dist/packages__rc-pro__src__layout-keep-alive__index.md.33be0665.chunk.css +1 -0
  65. package/docs-dist/packages__rc-pro__src__layout-keep-alive__index.md.9bbd4cba.async.js +1 -0
  66. package/docs-dist/packages__rc-pro__src__loading__index.md.33be0665.chunk.css +1 -0
  67. package/docs-dist/packages__rc-pro__src__loading__index.md.ffd4e9c3.async.js +1 -0
  68. package/docs-dist/packages__rc-pro__src__pro-table__index.md.33be0665.chunk.css +1 -0
  69. package/docs-dist/packages__rc-pro__src__pro-table__index.md.e8542cec.async.js +1 -0
  70. package/docs-dist/packages__rc-pro__src__pro-tabs__index.md.33be0665.chunk.css +1 -0
  71. package/docs-dist/packages__rc-pro__src__pro-tabs__index.md.5c2c6378.async.js +1 -0
  72. package/docs-dist/packages__rc-pro__src__result__index.md.33be0665.chunk.css +1 -0
  73. package/docs-dist/packages__rc-pro__src__result__index.md.bf4bb31c.async.js +2 -0
  74. package/docs-dist/packages__rc-pro__src__select__index.md.33be0665.chunk.css +1 -0
  75. package/docs-dist/packages__rc-pro__src__select__index.md.f739fe71.async.js +2 -0
  76. package/docs-dist/packages__rc-pro__src__time-picker__index.md.33be0665.chunk.css +1 -0
  77. package/docs-dist/packages__rc-pro__src__time-picker__index.md.cdc2078f.async.js +1 -0
  78. package/docs-dist/packages__rc-pro__src__water-mark__index.md.33be0665.chunk.css +1 -0
  79. package/docs-dist/packages__rc-pro__src__water-mark__index.md.7d0bee7d.async.js +1 -0
  80. package/docs-dist/packages__utils__src__utils__index.md.2e9b549d.async.js +1 -0
  81. package/docs-dist/packages__utils__src__utils__index.md.33be0665.chunk.css +1 -0
  82. package/docs-dist/plugin-euis/free/index.html +15 -0
  83. package/docs-dist/plugin-euis/table/index.html +15 -0
  84. package/docs-dist/plugin-euis/table-tree/index.html +15 -0
  85. package/docs-dist/plugin-euis/tabs/index.html +15 -0
  86. package/docs-dist/plugin-openapis/index.html +15 -0
  87. package/docs-dist/preload_helper.b6bb2ecb.js +1 -0
  88. package/docs-dist/pro-table__demos.ca265923.async.js +1 -0
  89. package/docs-dist/pro-tabs__demos.1edccbc5.async.js +1 -0
  90. package/docs-dist/rc-pros/auth/index.html +15 -0
  91. package/docs-dist/rc-pros/button/index.html +15 -0
  92. package/docs-dist/rc-pros/cascader/index.html +15 -0
  93. package/docs-dist/rc-pros/date-picker/index.html +15 -0
  94. package/docs-dist/rc-pros/dialog/index.html +15 -0
  95. package/docs-dist/rc-pros/editor/index.html +15 -0
  96. package/docs-dist/rc-pros/group-form-item/index.html +15 -0
  97. package/docs-dist/rc-pros/index.html +15 -0
  98. package/docs-dist/rc-pros/interval-button/index.html +15 -0
  99. package/docs-dist/rc-pros/layout-keep-alive/index.html +15 -0
  100. package/docs-dist/rc-pros/loading/index.html +15 -0
  101. package/docs-dist/rc-pros/pro-table/index.html +15 -0
  102. package/docs-dist/rc-pros/pro-tabs/index.html +15 -0
  103. package/docs-dist/rc-pros/result/index.html +15 -0
  104. package/docs-dist/rc-pros/select/index.html +15 -0
  105. package/docs-dist/rc-pros/time-picker/index.html +15 -0
  106. package/docs-dist/rc-pros/water-mark/index.html +15 -0
  107. package/docs-dist/result__demos.7ad0defe.async.js +1 -0
  108. package/docs-dist/select__demos.c6a6d803.async.js +1 -0
  109. package/docs-dist/time-picker__demos.8beda018.async.js +1 -0
  110. package/docs-dist/umi.4859fef9.js +108 -0
  111. package/docs-dist/umi.4e0bcd92.css +1 -0
  112. package/docs-dist/utils/utils/index.html +15 -0
  113. package/docs-dist/utils__demos.4d502190.async.js +1 -0
  114. package/docs-dist/water-mark__demos.26d16c3b.async.js +1 -0
  115. package/docs-dist/~demos/:id/index.html +15 -0
  116. package/docs-dist/~demos/auth-demo-basic/index.html +15 -0
  117. package/docs-dist/~demos/button-demo-button/index.html +15 -0
  118. package/docs-dist/~demos/button-demo-group/index.html +15 -0
  119. package/docs-dist/~demos/cascader-demo-basic/index.html +15 -0
  120. package/docs-dist/~demos/cascader-demo-cache/index.html +15 -0
  121. package/docs-dist/~demos/date-picker-demo-basic/index.html +15 -0
  122. package/docs-dist/~demos/date-picker-demo-range/index.html +15 -0
  123. package/docs-dist/~demos/dialog-demo-demos/index.html +15 -0
  124. package/docs-dist/~demos/editor-demo-demos/index.html +15 -0
  125. package/docs-dist/~demos/group-form-item-demo-basic/index.html +15 -0
  126. package/docs-dist/~demos/interval-button-demo-basic/index.html +15 -0
  127. package/docs-dist/~demos/loading-demo-basic/index.html +15 -0
  128. package/docs-dist/~demos/packages-plugin-eui-src-free-demo-free/index.html +15 -0
  129. package/docs-dist/~demos/packages-plugin-eui-src-table-demo-table/index.html +15 -0
  130. package/docs-dist/~demos/packages-plugin-eui-src-table-tree-demo-table-tree/index.html +15 -0
  131. package/docs-dist/~demos/packages-plugin-eui-src-tabs-demo-tabs/index.html +15 -0
  132. package/docs-dist/~demos/pro-table-demo-basic/index.html +15 -0
  133. package/docs-dist/~demos/pro-table-demo-fixed/index.html +15 -0
  134. package/docs-dist/~demos/pro-table-demo-selection/index.html +15 -0
  135. package/docs-dist/~demos/pro-tabs-demo-basic/index.html +15 -0
  136. package/docs-dist/~demos/pro-tabs-demo-tab/index.html +15 -0
  137. package/docs-dist/~demos/result-demo-basic/index.html +15 -0
  138. package/docs-dist/~demos/select-demo-api/index.html +15 -0
  139. package/docs-dist/~demos/select-demo-basic/index.html +15 -0
  140. package/docs-dist/~demos/select-demo-customize/index.html +15 -0
  141. package/docs-dist/~demos/select-demo-customize-label/index.html +15 -0
  142. package/docs-dist/~demos/time-picker-demo-basic/index.html +15 -0
  143. package/docs-dist/~demos/utils-demo-demos/index.html +15 -0
  144. package/docs-dist/~demos/water-mark-demo-basic/index.html +15 -0
  145. package/es/Foo/d +0 -0
  146. package/es/aj-captcha/index.less +9 -23
  147. package/es/auth/index.d.ts +7 -0
  148. package/es/auth/index.js +14 -0
  149. package/es/cascader/index.js +4 -4
  150. package/es/ccs.d.ts +7 -13
  151. package/es/config.js +33 -11
  152. package/es/context/index.d.ts +2 -2
  153. package/es/date-picker/index.js +20 -0
  154. package/es/dialog/button.d.ts +1 -1
  155. package/es/dialog/button.js +3 -3
  156. package/es/dialog/index.d.ts +0 -1
  157. package/es/dialog/index.js +0 -1
  158. package/es/ellipsis/index.js +4 -2
  159. package/es/ellipsis/useResizeEffect.js +10 -24
  160. package/es/group-form-item/index.d.ts +11 -0
  161. package/es/group-form-item/index.js +124 -0
  162. package/es/hooks/use-selection.d.ts +12 -23
  163. package/es/hooks/use-selection.js +51 -25
  164. package/es/index.d.ts +1 -3
  165. package/es/index.js +1 -3
  166. package/es/interval-button/index.js +4 -4
  167. package/es/layout-keep-alive/index.d.ts +1 -1
  168. package/es/layout-keep-alive/index.js +26 -20
  169. package/es/layout-keep-alive/index.less +19 -23
  170. package/es/layout-keep-alive/page.d.ts +3 -2
  171. package/es/layout-keep-alive/page.js +4 -3
  172. package/es/layout-single-page/index.d.ts +4 -2
  173. package/es/layout-single-page/index.js +12 -5
  174. package/es/layout-single-page/index.less +2 -8
  175. package/es/layout-single-page/page.d.ts +3 -1
  176. package/es/layout-single-page/page.js +2 -1
  177. package/es/pro-table/_utils.d.ts +1 -1
  178. package/es/pro-table/_utils.js +7 -7
  179. package/es/pro-table/form-item.d.ts +5 -3
  180. package/es/pro-table/form-item.js +28 -11
  181. package/es/pro-table/head.js +88 -63
  182. package/es/pro-table/index.less +20 -175
  183. package/es/pro-table/selection-alert.d.ts +4 -2
  184. package/es/pro-table/selection-alert.js +16 -4
  185. package/es/pro-table/table.d.ts +13 -24
  186. package/es/pro-table/table.js +128 -250
  187. package/es/pro-table/tree.d.ts +3 -3
  188. package/es/pro-table/tree.js +28 -17
  189. package/es/select/ modal.d.ts +3 -9
  190. package/es/select/ modal.js +63 -22
  191. package/es/select/customize.d.ts +7 -15
  192. package/es/select/customize.js +58 -48
  193. package/es/select/index.d.ts +2 -1
  194. package/es/select/index.js +9 -9
  195. package/es/table/index.js +12 -14
  196. package/es/table/index.less +0 -129
  197. package/package.json +11 -29
  198. package/LICENSE +0 -21
  199. package/README.md +0 -37
  200. package/es/breadcrumb.d.ts +0 -8
  201. package/es/breadcrumb.js +0 -40
  202. package/es/dialog/index.less +0 -16
  203. package/es/pro-grid/index.d.ts +0 -15
  204. package/es/pro-grid/index.js +0 -58
  205. package/es/trigger/index.d.ts +0 -43
  206. package/es/trigger/index.js +0 -298
  207. package/es/trigger/index.less +0 -42
  208. package/es/virtual-list/index.d.ts +0 -51
  209. package/es/virtual-list/index.js +0 -132
@@ -1,298 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["size", "style", "value", "width", "height", "disabled", "children", "className", "forceRender", "placeholder", "popupContainer", "onChange"];
3
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
9
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
12
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
13
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
15
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
- import { CloseCircleFilled, DownOutlined } from '@ant-design/icons';
17
- import { useDebounceFn, useEventListener, useUpdate } from 'ahooks';
18
- import { ConfigProvider, Input, Spin } from 'antd';
19
- import zhCN from 'antd/locale/zh_CN';
20
- import _isNil from 'lodash.isnil';
21
- import Trigger from 'rc-trigger';
22
- import { cloneElement, useEffect, useMemo, useRef, useState } from 'react';
23
- import "./index.less";
24
- import { jsx as _jsx } from "react/jsx-runtime";
25
- import { Fragment as _Fragment } from "react/jsx-runtime";
26
- import { jsxs as _jsxs } from "react/jsx-runtime";
27
- var zIndex = 2000;
28
- var classPrefix = 'ccs-trigger';
29
-
30
- /**
31
- * 适用于Form.Item中的 trigger组件,其内容自行定义,遵循ant form 自定义组件规范
32
- * @deprecated
33
- * @param CcsTriggerPropsType
34
- * @returns
35
- */
36
- var TriggerComponent = function TriggerComponent(props) {
37
- var _ref$current2;
38
- var size = props.size,
39
- style = props.style,
40
- value = props.value,
41
- width = props.width,
42
- height = props.height,
43
- disabled = props.disabled,
44
- children = props.children,
45
- className = props.className,
46
- forceRender = props.forceRender,
47
- placeholder = props.placeholder,
48
- popupContainer = props.popupContainer,
49
- onChange = props.onChange,
50
- restProps = _objectWithoutProperties(props, _excluded);
51
- var inputRef = useRef(null);
52
- var ref = useRef(null);
53
- var containerRef = useRef(null);
54
- var closeRef = useRef(null);
55
- var downRef = useRef(null);
56
- var alignRef = useRef({
57
- points: ['tl', 'bl'],
58
- offset: [0, 3],
59
- size: {
60
- width: width,
61
- height: height
62
- },
63
- maxSize: {
64
- width: width,
65
- height: height
66
- }
67
- });
68
- var _useState = useState(null),
69
- _useState2 = _slicedToArray(_useState, 2),
70
- visible = _useState2[0],
71
- setVisible = _useState2[1];
72
- var update = useUpdate();
73
- var _useState3 = useState(false),
74
- _useState4 = _slicedToArray(_useState3, 2),
75
- loading = _useState4[0],
76
- setLoading = _useState4[1];
77
-
78
- // 显示下拉图标
79
- var onMouseLeave = function onMouseLeave() {
80
- var _closeRef$current, _downRef$current;
81
- (_closeRef$current = closeRef.current) === null || _closeRef$current === void 0 || _closeRef$current.classList.replace('ccs-trigger-show', 'ccs-trigger-hidden');
82
- (_downRef$current = downRef.current) === null || _downRef$current === void 0 || _downRef$current.classList.replace('ccs-trigger-hidden', 'ccs-trigger-show');
83
- };
84
-
85
- // 显示清除数据图标
86
- var onMouseEnter = function onMouseEnter() {
87
- if (!_isNil(value)) {
88
- var _downRef$current2, _closeRef$current2;
89
- (_downRef$current2 = downRef.current) === null || _downRef$current2 === void 0 || _downRef$current2.classList.replace('ccs-trigger-show', 'ccs-trigger-hidden');
90
- (_closeRef$current2 = closeRef.current) === null || _closeRef$current2 === void 0 || _closeRef$current2.classList.replace('ccs-trigger-hidden', 'ccs-trigger-show');
91
- }
92
- };
93
-
94
- // 获取对齐方式、默认右下侧展开
95
- var getAlignMode = function getAlignMode() {
96
- var _ref$current;
97
- var rect = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect();
98
- if (!rect) return;
99
- var top = rect.top,
100
- left = rect.left,
101
- right = rect.right,
102
- bottom = rect.bottom;
103
- var _document$body = document.body,
104
- offsetWidth = _document$body.offsetWidth,
105
- offsetHeight = _document$body.offsetHeight;
106
- var rightWidth = offsetWidth - left; // 右侧宽度
107
- var bottomHeight = offsetHeight - bottom; // 下侧高度
108
-
109
- // 元素 上右下左弹出框空间 top rightWidth bottomHeight right
110
- var x = 'right';
111
- var y = 'bottom';
112
- if (width) {
113
- if (rightWidth >= width) {
114
- // 右侧宽度足够
115
- } else if (right >= width) {
116
- // 左侧宽度足够
117
- x = 'left';
118
- } else {
119
- // 两侧宽度都不够,取最大
120
- x = rightWidth > right ? 'right' : 'left';
121
- // 弹出框最大宽度
122
- alignRef.current.size.width = Math.max(right, rightWidth) - 10;
123
- }
124
- } else {
125
- // 没有传入宽度、取最大值
126
- x = rightWidth > right ? 'right' : 'left';
127
- alignRef.current.maxSize.width = Math.max(right, rightWidth) - 10;
128
- }
129
- if (height) {
130
- if (bottomHeight >= height) {
131
- // 底部高度足够
132
- } else if (top >= height) {
133
- // 顶部高度足够
134
- y = 'top';
135
- } else {
136
- // 上下高度都不够取最大
137
- y = bottomHeight > top ? 'bottom' : 'top';
138
- // 弹出框最大高度
139
- alignRef.current.size.height = Math.max(top, bottomHeight) - 10;
140
- }
141
- } else {
142
- // 没有传入高度、取最大值
143
- y = bottomHeight > top ? 'bottom' : 'top';
144
- alignRef.current.maxSize.height = Math.max(top, bottomHeight) - 10;
145
- }
146
- var point0 = 'tl'; // 弹出框对齐点
147
- var point1 = 'bl'; // 目标对齐点
148
- var offsetX = 0; // x偏移量
149
- var offsetY = 3; // y偏移量
150
-
151
- // 弹出框四个方位展开
152
- if (x === 'right' && y === 'bottom') {
153
- // 右下空间足够、默认右下展开
154
- } else if (x === 'left' && y === 'bottom') {
155
- // 右边宽度不够、高度足够、左下侧展开
156
- point1 = 'br';
157
- point0 = 'tr';
158
- } else if (x === 'right' && y === 'top') {
159
- // 右边宽度足够、高度不够、右上侧展开
160
- point1 = 'tl';
161
- point0 = 'bl';
162
- offsetY = -3;
163
- } else {
164
- // 右边宽度不够、高度不够、左上侧展开
165
- point1 = 'tr';
166
- point0 = 'br';
167
- offsetY = -3;
168
- }
169
- alignRef.current = _objectSpread(_objectSpread({}, alignRef.current), {}, {
170
- points: [point0, point1],
171
- offset: [offsetX, offsetY]
172
- });
173
- };
174
-
175
- // resize 防抖
176
- var _useDebounceFn = useDebounceFn(function (e) {
177
- if (!alignRef.current.timeStamp && visible) {
178
- // 防抖开始、关闭已打开的弹出框
179
- alignRef.current.timeStamp = e.timeStamp;
180
- setVisible(false);
181
- } else {
182
- // 防抖结束
183
- getAlignMode();
184
- update();
185
- alignRef.current.timeStamp = undefined;
186
- }
187
- }, {
188
- wait: 500,
189
- leading: true
190
- }),
191
- run = _useDebounceFn.run;
192
- var onChangeLabel = function onChangeLabel(text) {
193
- inputRef.current = text;
194
- update();
195
- };
196
-
197
- // 监听窗口变化
198
- useEventListener('resize', run, {
199
- target: window
200
- });
201
- var _useState5 = useState(zIndex),
202
- _useState6 = _slicedToArray(_useState5, 1),
203
- triggerIndex = _useState6[0];
204
- useEffect(function () {
205
- setTimeout(function () {
206
- getAlignMode();
207
- }, 10);
208
- zIndex += 1;
209
- }, []);
210
- var _alignRef$current$siz = alignRef.current.size,
211
- ppWidth = _alignRef$current$siz.width,
212
- ppHeight = _alignRef$current$siz.height;
213
- var _alignRef$current$max = alignRef.current.maxSize,
214
- maxWidth = _alignRef$current$max.width,
215
- maxHeight = _alignRef$current$max.height;
216
-
217
- // 如果有初始值则渲染子组件
218
- var isForceRender = useMemo(function () {
219
- if (forceRender) return true;
220
- return !!value;
221
- }, []);
222
- return /*#__PURE__*/_jsx(ConfigProvider, {
223
- locale: zhCN,
224
- children: /*#__PURE__*/_jsx(Trigger, {
225
- mask: true,
226
- action: ['click'],
227
- forceRender: isForceRender,
228
- prefixCls: classPrefix,
229
- popup: /*#__PURE__*/_jsx("div", {
230
- className: "".concat(classPrefix, "-container"),
231
- ref: containerRef,
232
- style: {
233
- width: ppWidth || 'auto',
234
- minWidth: (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.clientWidth,
235
- maxHeight: ppHeight || maxHeight,
236
- maxWidth: maxWidth
237
- },
238
- children: children && /*#__PURE__*/cloneElement(children, _objectSpread({
239
- value: value,
240
- onChange: onChange,
241
- onChangeLabel: onChangeLabel,
242
- onVisible: setVisible,
243
- onLoading: setLoading,
244
- width: ppWidth,
245
- height: ppHeight
246
- }, restProps))
247
- }),
248
- popupVisible: visible,
249
- onPopupVisibleChange: function onPopupVisibleChange(e) {
250
- if (!disabled) setVisible(e);
251
- },
252
- showAction: ['click'],
253
- hideAction: ['click'],
254
- popupAlign: alignRef.current,
255
- popupStyle: {
256
- position: 'absolute'
257
- },
258
- getPopupContainer: popupContainer ? function () {
259
- return ref.current;
260
- } : undefined,
261
- zIndex: triggerIndex,
262
- children: /*#__PURE__*/_jsx("div", {
263
- ref: ref,
264
- className: className,
265
- style: style,
266
- onMouseEnter: onMouseEnter,
267
- onMouseLeave: onMouseLeave,
268
- children: /*#__PURE__*/_jsx(Spin, {
269
- spinning: loading,
270
- children: /*#__PURE__*/_jsx(Input, {
271
- readOnly: true,
272
- disabled: disabled,
273
- value: inputRef.current,
274
- placeholder: placeholder || '请选择',
275
- size: size || 'middle',
276
- suffix: !disabled ? /*#__PURE__*/_jsxs(_Fragment, {
277
- children: [/*#__PURE__*/_jsx(CloseCircleFilled, {
278
- ref: closeRef,
279
- onClick: function onClick() {
280
- if (onChange) {
281
- onChange(undefined);
282
- onChangeLabel(undefined);
283
- onMouseLeave();
284
- }
285
- },
286
- className: "".concat(classPrefix, "-icon ").concat(classPrefix, "-hidden")
287
- }), /*#__PURE__*/_jsx(DownOutlined, {
288
- className: "".concat(classPrefix, "-icon ").concat(classPrefix, "-show"),
289
- ref: downRef
290
- })]
291
- }) : null
292
- })
293
- })
294
- })
295
- })
296
- });
297
- };
298
- export default TriggerComponent;
@@ -1,42 +0,0 @@
1
- // ccs trigger
2
- .ccs-trigger {
3
- &-hidden {
4
- display: none !important;
5
- }
6
-
7
- &-show {
8
- display: block !important;
9
- }
10
-
11
- &-icon {
12
- color: rgb(0 0 0 / 25%) !important;
13
- font-size: 12px;
14
- }
15
-
16
- &-container {
17
- overflow: auto;
18
- background: #fff;
19
- border-radius: 2px;
20
- box-shadow: 0 3px 6px -4px rgb(0 0 0 / 12%), 0 6px 16px 0 rgb(0 0 0 / 8%),
21
- 0 9px 28px 8px rgb(0 0 0 / 5%);
22
- transition: margin 0.3s;
23
- }
24
-
25
- &-mask {
26
- position: fixed;
27
- top: 0;
28
- right: 0;
29
- bottom: 0;
30
- left: 0;
31
- height: 100%;
32
- opacity: 1;
33
-
34
- &-hidden {
35
- display: none;
36
- }
37
- }
38
- }
39
-
40
- .rc-trigger-popup-hidden {
41
- display: none;
42
- }
@@ -1,51 +0,0 @@
1
- import { ReactNode, RefObject } from 'react';
2
- import { PropsWithCss } from '../ccs';
3
- type Position = {
4
- left: number;
5
- top: number;
6
- };
7
- export type RowRendererProps = {
8
- rowHeight: number;
9
- index: number;
10
- };
11
- export type VirtualInstance = {
12
- scrollTop: (top: number) => void;
13
- };
14
- export type VirtualListProps = PropsWithCss & {
15
- /** 容器高度 */
16
- height?: number;
17
- /** 记录条数 */
18
- rowCount: number;
19
- /** 行高 */
20
- rowHeight: number;
21
- /**
22
- * 自动隐藏滚动条
23
- * @default true
24
- */
25
- autoHideScroll?: boolean;
26
- /** 显示条数 */
27
- overscanRowCount: number;
28
- /** 条数改变定位顶部 */
29
- rowCountChangeScrollTop?: boolean;
30
- /** instance */
31
- virtualRef?: RefObject<VirtualInstance>;
32
- /** 渲染row */
33
- rowRenderer: ({ rowHeight, index }: RowRendererProps) => ReactNode;
34
- /** scroll event */
35
- onScroll?: (position: Position) => void;
36
- };
37
- export type VirtualListItemProps = Pick<VirtualListProps, 'rowHeight' | 'rowRenderer'> & {
38
- index: number;
39
- };
40
- export type ListItemProps = {
41
- prefix: ReactNode;
42
- title: ReactNode;
43
- extra?: ReactNode;
44
- extraIcon?: ReactNode;
45
- height: number;
46
- className?: string;
47
- description?: ReactNode;
48
- onClick?: () => void;
49
- };
50
- declare const VirtualList: ({ height, rowCount, rowHeight, className, style, virtualRef, onScroll, rowRenderer, autoHideScroll, overscanRowCount, rowCountChangeScrollTop, }: VirtualListProps) => import("react/jsx-runtime").JSX.Element;
51
- export default VirtualList;
@@ -1,132 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { useScroll } from 'ahooks';
14
- import { useEffect, useImperativeHandle, useRef, useState } from 'react';
15
- import { Scrollbars } from 'react-custom-scrollbars';
16
- import { jsx as _jsx } from "react/jsx-runtime";
17
- import { Fragment as _Fragment } from "react/jsx-runtime";
18
- function getArrayIdsNew(start, end) {
19
- var ids = [];
20
- for (var i = start; i <= end; i += 1) {
21
- ids.push(i);
22
- }
23
- return ids;
24
- }
25
- var VirtualListItem = function VirtualListItem(_ref) {
26
- var rowHeight = _ref.rowHeight,
27
- rowRenderer = _ref.rowRenderer,
28
- index = _ref.index;
29
- return /*#__PURE__*/_jsx("div", {
30
- style: {
31
- height: rowHeight,
32
- position: 'absolute',
33
- top: index * rowHeight,
34
- width: '100%'
35
- },
36
- children: rowRenderer({
37
- rowHeight: rowHeight,
38
- index: index
39
- })
40
- });
41
- };
42
- var VirtualList = function VirtualList(_ref2) {
43
- var height = _ref2.height,
44
- rowCount = _ref2.rowCount,
45
- rowHeight = _ref2.rowHeight,
46
- className = _ref2.className,
47
- _ref2$style = _ref2.style,
48
- style = _ref2$style === void 0 ? {} : _ref2$style,
49
- virtualRef = _ref2.virtualRef,
50
- onScroll = _ref2.onScroll,
51
- rowRenderer = _ref2.rowRenderer,
52
- autoHideScroll = _ref2.autoHideScroll,
53
- overscanRowCount = _ref2.overscanRowCount,
54
- rowCountChangeScrollTop = _ref2.rowCountChangeScrollTop;
55
- // 渲染区间
56
- var _useState = useState([0, overscanRowCount - 1]),
57
- _useState2 = _slicedToArray(_useState, 2),
58
- ids = _useState2[0],
59
- setIds = _useState2[1];
60
- var ref = useRef(null);
61
- useImperativeHandle(virtualRef, function () {
62
- return {
63
- scrollTop: function scrollTop(top) {
64
- if (ref.current) ref.current.scrollTop = top;
65
- }
66
- };
67
- });
68
- useScroll(ref, function (position) {
69
- var top = position.top;
70
- var addRowNumber = overscanRowCount - 1;
71
- var start = Math.trunc((top < 0 ? 0 : top) / rowHeight);
72
- var end = start + addRowNumber;
73
- if (ids[0] !== start && ids[1] !== end) {
74
- setIds([start, end]);
75
- }
76
- if (onScroll) {
77
- onScroll(position);
78
- }
79
- return false;
80
- });
81
- var onScrollUpdate = function onScrollUpdate(position) {
82
- var scrollTop = position.scrollTop;
83
- var addRowNumber = overscanRowCount - 1;
84
- var start = Math.trunc((scrollTop < 0 ? 0 : scrollTop) / rowHeight);
85
- var end = start + addRowNumber;
86
- if (ids[0] !== start && ids[1] !== end) {
87
- setIds([start, end]);
88
- }
89
- if (onScroll) {
90
- onScroll(position);
91
- }
92
- };
93
- useEffect(function () {
94
- if (rowCount > 0 && rowCountChangeScrollTop && ref.current) {
95
- ref.current.scrollTo({
96
- top: 0,
97
- behavior: 'smooth'
98
- });
99
- }
100
- }, [rowCount]);
101
- return rowCount === 0 ? /*#__PURE__*/_jsx(_Fragment, {
102
- children: "\u6309\u9700\u52A0\u8F7D\u6D4B\u8BD5tttttt-tttt11--tt"
103
- }) : /*#__PURE__*/_jsx("div", {
104
- className: className,
105
- style: _objectSpread({
106
- height: height || '100%'
107
- }, style),
108
- ref: ref,
109
- children: /*#__PURE__*/_jsx(Scrollbars, {
110
- autoHide: autoHideScroll !== false,
111
- onUpdate: onScrollUpdate,
112
- style: {
113
- flex: '1 1 auto'
114
- },
115
- children: /*#__PURE__*/_jsx("div", {
116
- style: {
117
- position: 'relative',
118
- height: rowHeight * rowCount,
119
- overflow: 'hidden'
120
- },
121
- children: getArrayIdsNew(ids[0], ids[1] >= rowCount ? rowCount - 1 : ids[1]).map(function (i) {
122
- return /*#__PURE__*/_jsx(VirtualListItem, {
123
- rowHeight: rowHeight,
124
- rowRenderer: rowRenderer,
125
- index: i
126
- }, i);
127
- })
128
- })
129
- })
130
- });
131
- };
132
- export default VirtualList;