@unicom-cloud/ui 0.8.75 → 0.8.77

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 (286) hide show
  1. package/Affix.js +1 -1
  2. package/Alert.js +1 -1
  3. package/AutoComplete.js +3 -5
  4. package/BackTop.js +1 -1
  5. package/Badge.js +1 -1
  6. package/Breadcrumb.js +2 -2
  7. package/Button.js +1 -1
  8. package/Calendar.js +3 -3
  9. package/Card.js +1 -1
  10. package/Carousel.js +1 -1
  11. package/Cascader.js +1 -1
  12. package/Checkbox.js +6 -2
  13. package/Collapse.js +1 -1
  14. package/ColorPicker.js +3 -4
  15. package/Comment.js +1 -1
  16. package/ConfigProvider.js +2 -3
  17. package/Copy.js +1 -1
  18. package/DatePicker.js +1 -1
  19. package/Descriptions.js +1 -1
  20. package/Divider.js +1 -1
  21. package/Draggable.js +1 -1
  22. package/Dropdown.js +1 -1
  23. package/Empty.js +1 -1
  24. package/Icon.js +1 -1
  25. package/IconHover.js +1 -1
  26. package/Image.js +1 -1
  27. package/InputNumber.js +1 -1
  28. package/Layout.js +1 -1
  29. package/Link.js +1 -1
  30. package/List.js +5 -6
  31. package/Mentions.js +3 -4
  32. package/Menu.js +1 -1
  33. package/Message.js +1 -1
  34. package/Modal.js +1 -1
  35. package/Notice.js +1 -1
  36. package/Notification.js +1 -1
  37. package/OverflowEllipsis.js +1 -1
  38. package/PageHeader.js +1 -1
  39. package/Pagination.js +2 -2
  40. package/Popconfirm.js +1 -1
  41. package/Popover.js +1 -1
  42. package/Progress.js +1 -1
  43. package/Radio.js +5 -4
  44. package/Rate.js +1 -1
  45. package/ResizeBox.js +1 -1
  46. package/Result.js +1 -1
  47. package/Select.js +5 -6
  48. package/Skeleton.js +1 -1
  49. package/Slider.js +1 -1
  50. package/Space.js +1 -1
  51. package/SpeechSynthesis.js +4 -3
  52. package/Spin.js +1 -1
  53. package/Statistic.js +1 -1
  54. package/Steps.js +1 -1
  55. package/Switch.js +1 -1
  56. package/Table.js +15 -16
  57. package/Tabs.js +1 -1
  58. package/Tag.js +1 -1
  59. package/Tooltip.js +2 -2
  60. package/Transfer.js +3 -4
  61. package/Tree.js +2 -3
  62. package/TreeSelect.js +3 -3
  63. package/Trigger.js +1 -1
  64. package/Typography.js +3 -3
  65. package/affix/index.js +86 -82
  66. package/alert/index.js +1 -1
  67. package/anchor/Anchor.js +1 -1
  68. package/anchor/Link.js +1 -1
  69. package/auto-complete/index.js +13 -147
  70. package/avatar/Avatar.js +1 -1
  71. package/avatar/Group.js +1 -1
  72. package/back-top/index.js +1 -1
  73. package/badge/index.js +1 -1
  74. package/breadcrumb/index.js +2 -2
  75. package/button/Group.js +1 -1
  76. package/button/index.js +1 -1
  77. package/calendar/index.js +12 -318
  78. package/card/Grid.js +1 -1
  79. package/card/Meta.js +1 -1
  80. package/card/index.js +1 -1
  81. package/carousel/Arrow.js +1 -1
  82. package/carousel/Indicator.js +1 -1
  83. package/carousel/index.js +1 -1
  84. package/cascader/Cascader.js +4 -4
  85. package/cascader/index.js +1 -1
  86. package/cascader/util.js +8 -8
  87. package/checkbox/Checkbox.js +7 -4
  88. package/checkbox/Group.js +5 -5
  89. package/checkbox/GroupBlock.js +8 -0
  90. package/checkbox/index.js +7 -2
  91. package/chunk/{BbqvFW5R.js → 9TSjT7x_.js} +112 -112
  92. package/chunk/ATwvJ8j2.js +6 -0
  93. package/chunk/{Dv6USvVF.js → BC5fEyWK.js} +2 -1
  94. package/chunk/{WVoGhvMI.js → BPQXH_5i.js} +32 -31
  95. package/chunk/{BPD5iNdA.js → CB4jGw4K.js} +22 -18
  96. package/chunk/{B8hkFIar.js → CBgu99gQ.js} +1 -1
  97. package/chunk/CBzE-PUr.js +23 -0
  98. package/chunk/CNcLypMY.js +723 -0
  99. package/chunk/{CPlPBkN7.js → C_4I3haT.js} +1 -1
  100. package/chunk/{0mWCmQHr.js → CjqvxJml.js} +2 -2
  101. package/chunk/Cwm8LL5p.js +7818 -0
  102. package/chunk/D0ZWT7db.js +5 -0
  103. package/chunk/{CWlklVfi.js → tpmioyz1.js} +1 -1
  104. package/collapse/Collapse.js +2 -2
  105. package/collapse/Item.js +2 -2
  106. package/collapse/index.js +1 -1
  107. package/color-picker/ControlBar.js +1 -1
  108. package/color-picker/InputAlpha.js +1 -1
  109. package/color-picker/InputHex.js +2 -2
  110. package/color-picker/InputRgb.js +2 -2
  111. package/color-picker/Palette.js +2 -2
  112. package/color-picker/Panel.js +15 -266
  113. package/color-picker/colors.js +4 -4
  114. package/color-picker/index.js +13 -268
  115. package/color-picker/utils.js +1 -1
  116. package/comment/index.js +1 -1
  117. package/config-provider/ConfigProvider.js +4 -6
  118. package/config-provider/context.js +3 -2
  119. package/config-provider/index.js +4 -5
  120. package/copy/index.js +1 -1
  121. package/date-picker/Picker.js +1 -1
  122. package/date-picker/PickerRange.js +2 -2
  123. package/date-picker/index.js +1 -1
  124. package/descriptions/index.js +1 -1
  125. package/divider/index.js +1 -1
  126. package/draggable/index.js +1 -1
  127. package/drawer/Drawer.js +30 -21
  128. package/dropdown/Button.js +1 -1
  129. package/dropdown/index.js +1 -1
  130. package/empty/index.js +1 -1
  131. package/form/Form.js +10 -10
  132. package/form/FormItem.js +1 -1
  133. package/form/context.js +1 -1
  134. package/grid/Col.js +1 -1
  135. package/grid/Row.js +1 -1
  136. package/grid/grid-item.js +1 -1
  137. package/grid/grid.js +1 -1
  138. package/hooks/index.js +1 -1
  139. package/hooks/useWindowSize.js +1 -1
  140. package/icon/index.js +1 -1
  141. package/icon-hover/index.js +1 -1
  142. package/image/Image.js +2 -2
  143. package/image/ImagePreview.js +2 -2
  144. package/image/ImagePreviewArrow.js +1 -1
  145. package/image/ImagePreviewGroup.js +1 -1
  146. package/image/index.js +1 -1
  147. package/index.js +453 -463
  148. package/input/Group.js +1 -1
  149. package/input/Input.js +1 -1
  150. package/input/InputElement.js +1 -1
  151. package/input/Password.js +1 -1
  152. package/input/Search.js +1 -1
  153. package/input/Textarea.js +1 -1
  154. package/input-number/index.js +1 -1
  155. package/input-tag/InputTag.js +1 -1
  156. package/layout/Content.js +1 -1
  157. package/layout/Footer.js +1 -1
  158. package/layout/Header.js +1 -1
  159. package/layout/Sider.js +1 -1
  160. package/layout/index.js +1 -1
  161. package/link/index.js +1 -1
  162. package/list/Item.js +1 -1
  163. package/list/Meta.js +1 -1
  164. package/list/index.js +17 -267
  165. package/mentions/index.js +11 -144
  166. package/menu/Menu.js +2 -2
  167. package/menu/OverflowWrap.js +1 -1
  168. package/menu/index.js +2 -2
  169. package/message/index.js +1 -1
  170. package/message/useMessage.js +1 -1
  171. package/modal/Confirm.js +2 -2
  172. package/modal/Modal.js +2 -2
  173. package/modal/index.js +1 -1
  174. package/notice/index.js +1 -1
  175. package/notification/index.js +1 -1
  176. package/notification/useNotification.js +1 -1
  177. package/overflow-ellipsis/OverflowItem.js +1 -1
  178. package/overflow-ellipsis/index.js +1 -1
  179. package/package.json +1 -1
  180. package/page-header/index.js +1 -1
  181. package/pagination/PageItem.js +1 -1
  182. package/pagination/PageJumper.js +1 -1
  183. package/pagination/PageOption.js +5 -45
  184. package/pagination/Pagination.js +11 -243
  185. package/pagination/index.js +2 -2
  186. package/picker/Input.js +1 -1
  187. package/picker/InputRange.js +1 -1
  188. package/popconfirm/index.js +1 -1
  189. package/popover/index.js +1 -1
  190. package/progress/index.js +1 -1
  191. package/radio/Group.js +5 -5
  192. package/radio/GroupBlock.js +9 -0
  193. package/radio/Radio.js +6 -5
  194. package/radio/index.js +4 -3
  195. package/rate/index.js +1 -1
  196. package/resize-box/ResizeTrigger.js +1 -1
  197. package/resize-box/Split.js +1 -1
  198. package/resize-box/SplitGroup.js +1 -1
  199. package/resize-box/index.js +1 -1
  200. package/result/index.js +1 -1
  201. package/select/Option.js +6 -93
  202. package/select/Select.js +23 -546
  203. package/select/index.js +3 -3
  204. package/select/util.js +18 -139
  205. package/select-view/Core.js +1 -1
  206. package/skeleton/index.js +1 -1
  207. package/slider/Button.js +1 -1
  208. package/slider/index.js +1 -1
  209. package/space/index.js +1 -1
  210. package/speech-synthesis/index.js +4 -3
  211. package/spin/DotLoading.js +1 -1
  212. package/spin/index.js +1 -1
  213. package/statistic/Countdown.js +1 -1
  214. package/statistic/index.js +1 -1
  215. package/steps/index.js +1 -1
  216. package/style/variables.less +0 -484
  217. package/style.css +1 -1
  218. package/switch/index.js +1 -1
  219. package/table/Table.js +2 -3
  220. package/table/index.js +15 -109
  221. package/tabs/Tab.js +2 -2
  222. package/tabs/TabContent.js +2 -2
  223. package/tabs/TabPane.js +1 -1
  224. package/tabs/index.js +2 -2
  225. package/tag/index.js +1 -1
  226. package/time-picker/Picker.js +1 -1
  227. package/time-picker/TimePicker.js +1 -1
  228. package/timeline/Item.js +1 -1
  229. package/timeline/Timeline.js +1 -1
  230. package/tooltip/index.js +2 -2
  231. package/transfer/Item.js +9 -104
  232. package/transfer/List.js +13 -184
  233. package/transfer/index.js +13 -180
  234. package/tree/Animation.js +2 -2
  235. package/tree/Node.js +3 -4
  236. package/tree/NodeList.js +6 -80
  237. package/tree/Tree.js +17 -578
  238. package/tree/index.js +2 -3
  239. package/tree-select/List.js +6 -122
  240. package/tree-select/Select.js +22 -392
  241. package/tree-select/index.js +3 -3
  242. package/trigger/index.js +1 -1
  243. package/types/checkbox/Checkbox.d.ts +5 -2
  244. package/types/checkbox/GroupBlock.d.ts +7 -0
  245. package/types/checkbox/index.d.ts +2 -1
  246. package/types/config-provider/ConfigProvider.d.ts +0 -27
  247. package/types/config-provider/interface.d.ts +3 -1
  248. package/types/index.d.ts +2 -2
  249. package/types/menu/context.d.ts +1 -1
  250. package/types/radio/GroupBlock.d.ts +7 -0
  251. package/types/radio/Radio.d.ts +5 -3
  252. package/types/utils/constant.d.ts +2 -1
  253. package/types/utils/index.d.ts +1 -0
  254. package/types/utils/setDarkTheme.d.ts +2 -3
  255. package/types/utils/setPrimaryColor.d.ts +2 -0
  256. package/typography/Base.js +1 -1
  257. package/typography/Ellipsis.js +9 -22
  258. package/typography/Paragraph.js +1 -1
  259. package/typography/Typography.js +1 -1
  260. package/typography/index.js +10 -276
  261. package/upload/TriggerNode.js +1 -1
  262. package/upload/Upload.js +1 -1
  263. package/upload/Uploader.js +43 -44
  264. package/upload/request.js +1 -1
  265. package/upload/request_.js +1 -1
  266. package/utils/caseName.js +1 -1
  267. package/utils/color.js +1 -1
  268. package/utils/constant.js +7 -5
  269. package/utils/contextHolder.js +1 -1
  270. package/utils/dom.js +1 -1
  271. package/utils/index.js +199 -195
  272. package/utils/setDarkTheme.js +34 -5
  273. package/utils/setPrimaryColor.js +26 -0
  274. package/utils/tinycolor.js +1 -1
  275. package/verification-code/VerificationCode.js +1 -1
  276. package/version/index.js +1 -1
  277. package/watermark/Watermark.js +1 -1
  278. package/chunk/BViFMHr-.js +0 -1820
  279. package/chunk/BsWphzcT.js +0 -20
  280. package/chunk/BxZ39GzB.js +0 -209
  281. package/chunk/C9XYyypq.js +0 -713
  282. package/chunk/CIkPwQlq.js +0 -6
  283. package/chunk/DFcz9ZPP.js +0 -1020
  284. package/chunk/DeCsZrXb.js +0 -310
  285. package/chunk/DskaI8QL.js +0 -25
  286. package/chunk/EL5Jmjgr.js +0 -170
@@ -1,124 +1,8 @@
1
- import { jsxs as j, jsx as x } from "react/jsx-runtime";
2
- import z from "lodash/isFunction";
3
- import I from "lodash/isString";
4
- import { forwardRef as K, useRef as $, useCallback as u, useMemo as y, useImperativeHandle as F } from "react";
5
- import H from "../tree/Tree.js";
6
- function O(r, S) {
7
- const {
8
- value: c,
9
- multiple: d,
10
- loadMore: k,
11
- treeCheckedStrategy: _,
12
- treeCheckStrictly: w,
13
- treeData: M,
14
- treeProps: b,
15
- prefixCls: m,
16
- treeCheckable: R
17
- } = r, C = b && b.renderTitle, h = $(), p = u(
18
- (t, { checkedNodes: e, checked: a, node: l }) => {
19
- const i = t.map((n) => {
20
- const o = e.find((s) => s && s.props._key === n);
21
- return o ? {
22
- label: o.props.title,
23
- value: o.props._key,
24
- disabled: o.props.disabled
25
- } : c.find((f) => f.value === n) || {
26
- label: n,
27
- value: n
28
- };
29
- });
30
- r.onChange(i, {
31
- checked: a,
32
- trigger: l == null ? void 0 : l.props
33
- });
34
- },
35
- [r.onChange, c]
36
- ), g = u(
37
- (t, { node: e, selected: a }) => {
38
- let l = [
39
- {
40
- value: e.props._key,
41
- label: e.props.title
42
- }
43
- ];
44
- if (d) {
45
- l = [...c];
46
- const i = l.findIndex((n) => n.value === e.props._key);
47
- i > -1 ? l.splice(i, 1) : l.push({
48
- value: e.props._key,
49
- label: e.props.title
50
- });
51
- }
52
- r.onChange(l, { trigger: e == null ? void 0 : e.props, selected: a });
53
- },
54
- [r.onChange, c, d]
55
- ), v = u((t, { node: e, e: a }) => {
56
- var s, f;
57
- const { checked: l, checkable: i, disabled: n, disableCheckbox: o } = e.props;
58
- h.current && !o && !n && i !== !1 && ((f = (s = h.current) == null ? void 0 : s.handleCheck) == null || f.call(s, !l, e.props._key, a));
59
- }, []), L = u(
60
- (t) => {
61
- if (z(k)) {
62
- const e = t.props.dataRef;
63
- return k(t, e);
64
- }
65
- return [];
66
- },
67
- [k]
68
- ), N = u(
69
- (t) => {
70
- if (C)
71
- return C(t);
72
- const e = r.inputValue, { title: a } = t;
73
- if (e && I(a)) {
74
- const l = a.toLowerCase().indexOf(e.toLowerCase());
75
- if (l === -1)
76
- return a;
77
- const i = a.substring(0, l + 1), n = a.substring(l + e.length);
78
- return /* @__PURE__ */ j("span", { children: [
79
- i,
80
- /* @__PURE__ */ x("span", { className: `${m}-highlight`, children: a.substring(l, e.length + 1) }),
81
- n
82
- ] });
83
- }
84
- return a;
85
- },
86
- [m, r.inputValue, C]
87
- ), V = y(() => r.treeCheckable ? {
88
- onCheck: p,
89
- checkedKeys: c.map((t) => t.value)
90
- } : {}, [p, c, r.treeCheckable]), T = y(() => r.treeCheckable ? [] : c.map((t) => t.value), [r.treeCheckable, c]), D = u(
91
- (t, e) => {
92
- r.treeCheckable ? v(t, e) : g(t, e);
93
- },
94
- [r.treeCheckable, v, g]
95
- );
96
- return F(S, () => h.current, []), /* @__PURE__ */ x(
97
- H,
98
- {
99
- ref: h,
100
- size: r.size,
101
- blockNode: !0,
102
- filterNode: r.filterNode,
103
- ...b,
104
- checkable: R,
105
- multiple: d,
106
- loadMore: r.loadMore ? L : void 0,
107
- checkedStrategy: _,
108
- checkStrictly: w,
109
- onMouseDown: (t) => {
110
- t.preventDefault();
111
- },
112
- ...V,
113
- treeData: M,
114
- fieldNames: r.fieldNames,
115
- renderTitle: N,
116
- onSelect: D,
117
- selectedKeys: T
118
- }
119
- );
120
- }
121
- const G = K(O);
1
+ import "react/jsx-runtime";
2
+ import "lodash/isFunction";
3
+ import "lodash/isString";
4
+ import "react";
5
+ import { aa as i } from "../chunk/Cwm8LL5p.js";
122
6
  export {
123
- G as default
7
+ i as default
124
8
  };
@@ -1,395 +1,25 @@
1
- import { jsx as D } from "react/jsx-runtime";
2
- import { g as be, y as ye, S as Ce } from "../chunk/C0pRaDCf.js";
3
- import ke from "lodash/debounce";
4
- import q from "lodash/isArray";
5
- import R from "lodash/isFunction";
6
- import Se from "lodash/isNil";
7
- import { useContext as ce, useRef as P, useState as J, useCallback as T, forwardRef as Ve, useEffect as re, useMemo as ve, useImperativeHandle as Pe } from "react";
8
- import { a as se } from "../chunk/C9XYyypq.js";
9
- import { u as Ie } from "../chunk/B4YRLi8r.js";
10
- import { u as Ke } from "../chunk/oopARUrq.js";
11
- import { u as Oe } from "../chunk/BFTV6myl.js";
12
- import { u as ne } from "../chunk/DeV0v__J.js";
13
- import Te from "../select-view/index.js";
14
- import V from "../tree/Tree.js";
15
- import { getCheckedKeysByInitKeys as _e, getTreeDataFromTreeChildren as He, getAllCheckedKeysByCheck as De } from "../tree/util.js";
16
- import Re from "../trigger/index.js";
17
- import { p as z } from "../chunk/CUFsOxJ2.js";
1
+ import "react/jsx-runtime";
2
+ import "../chunk/C0pRaDCf.js";
3
+ import "lodash/debounce";
4
+ import "lodash/isArray";
5
+ import "lodash/isFunction";
6
+ import "lodash/isNil";
7
+ import "react";
8
+ import "../chunk/CNcLypMY.js";
9
+ import "../chunk/B4YRLi8r.js";
10
+ import "../chunk/oopARUrq.js";
11
+ import "../chunk/BFTV6myl.js";
12
+ import "../chunk/DeV0v__J.js";
13
+ import "../select-view/index.js";
14
+ import { v as j, t as k } from "../chunk/Cwm8LL5p.js";
15
+ import "../tree/util.js";
16
+ import "../trigger/index.js";
17
+ import "../chunk/CUFsOxJ2.js";
18
18
  import "../chunk/DAAff-FT.js";
19
- import we from "./List.js";
20
- import v from "lodash/get";
21
- import { u as Le } from "../chunk/CQ_WOOmf.js";
22
- import { u as G } from "../chunk/a3hR6zLw.js";
23
- import { DefaultFieldNames as ue } from "./interface.js";
24
- import le from "lodash/isEqualWith";
25
- import Ne from "lodash/isPlainObject";
26
- import Ee from "lodash/isUndefined";
27
- import { normalizeValueToArray as W } from "./util.js";
28
- import { u as Fe } from "../chunk/VSe_Wq1g.js";
29
- import oe from "lodash/isPlainObject.js";
30
- const ie = (r, u, o) => {
31
- const a = {};
32
- let f = 0;
33
- const i = (e, c) => {
34
- const p = e.length;
35
- return e.map((n, y) => {
36
- const g = v(n, o.children) || n[o.children], m = v(n, o.key) || n[o.key] || `${(c == null ? void 0 : c._key) || ""}-${y}`, s = {
37
- ...n,
38
- title: v(n, o.title) || n[o.title],
39
- selectable: v(n, o.selectable) || n[o.selectable],
40
- disabled: v(n, o.disabled) || n[o.disabled],
41
- disableCheckbox: v(n, o.disableCheckbox) || n[o.disableCheckbox],
42
- checkable: v(n, o.checkable) || n[o.checkable],
43
- isLeaf: v(n, o.isLeaf) || n[o.isLeaf],
44
- key: m,
45
- children: g,
46
- _key: m,
47
- parentKey: c ? c._key : void 0,
48
- pathParentKeys: c && c.pathParentKeys || [],
49
- _level: c._level || 0,
50
- _index: f++
51
- };
52
- return p === y + 1 && (s.className = z(
53
- `${u}-node-is-tail`,
54
- s.className
55
- )), a[m] = s, g && g.length && (a[m].children = i(g, {
56
- _key: m,
57
- _level: s._level + 1,
58
- pathParentKeys: [...(c == null ? void 0 : c.pathParentKeys) || [], m]
59
- })), s;
60
- });
61
- };
62
- return i(r || [], {}), a;
63
- }, We = (r, u) => {
64
- const { getPrefixCls: o } = ce(se), a = {
65
- ...ue,
66
- ...u
67
- }, f = Le(), i = o("tree"), e = P(
68
- ie(r, i, a)
69
- );
70
- return G(() => {
71
- e.current = ie(r, i, a), f();
72
- }, [r]), e.current;
73
- }, x = (r, u, o) => r == null ? [] : (q(r) ? r : [r]).map((f) => {
74
- let i = Ne(f) ? { ...f } : { value: f, label: void 0 };
75
- const e = u[i.value];
76
- if (e)
77
- i.label = i.label || e.title, i.disabled = e.disabled;
78
- else if (q(o)) {
79
- const c = o.find((p) => p.value === i.value);
80
- i = {
81
- ...i,
82
- ...c
83
- };
84
- }
85
- return Ee(i.label) && (i.label = i.value), i;
86
- }), xe = (r, u, o, a) => {
87
- if (!a.treeCheckStrictly) {
88
- const { checkedKeys: f, indeterminateKeys: i } = _e(r, u);
89
- let e = f;
90
- return o.current = i, a.treeCheckedStrategy === V.SHOW_PARENT ? e = e.filter((c) => {
91
- const p = u[c];
92
- if (!p || e.indexOf(p.parentKey) === -1)
93
- return !0;
94
- }) : a.treeCheckedStrategy === V.SHOW_CHILD && (e = e.filter((c) => {
95
- const p = u[c];
96
- if (!p || !p.children || !p.children.length)
97
- return !0;
98
- })), e;
99
- }
100
- return o.current = [], r;
101
- }, Ae = (r, u, o) => {
102
- const a = P([]), f = () => {
103
- const n = r.value || r.defaultValue || [];
104
- if (r.treeCheckable) {
105
- const y = xe(
106
- W(n),
107
- u,
108
- o,
109
- r
110
- ), g = x(
111
- n,
112
- u,
113
- a.current
114
- );
115
- return x(
116
- y,
117
- u,
118
- g
119
- );
120
- }
121
- return x(n, u);
122
- }, [i, e] = J(f), c = (n) => {
123
- a.current = n, e(n);
124
- };
125
- G(() => {
126
- const n = f();
127
- "value" in r && (r.labelInValue ? le(
128
- W(i),
129
- W(n)
130
- ) || c(n) : le(i, n) || c(n));
131
- }, [
132
- r.treeCheckedStrategy,
133
- r.treeCheckStrictly,
134
- r.treeCheckable,
135
- r.value,
136
- u
137
- ]);
138
- const p = T(
139
- (n, y) => {
140
- const { onChange: g, labelInValue: m } = r, s = r.multiple || r.treeCheckable;
141
- "value" in r || c(n);
142
- let I;
143
- s ? I = n.map((_) => m ? { label: _.label, value: _.value } : _.value) : I = m ? n[0] : n[0] && n[0].value, g == null || g(I, y);
144
- },
145
- [
146
- r.onChange,
147
- r.labelInValue,
148
- r.multiple,
149
- r.treeCheckable,
150
- r.value
151
- ]
152
- );
153
- return [i, p];
154
- };
155
- function $e(r) {
156
- const u = Fe(r) || {}, o = () => r.treeData || He(r.children), [a, f] = J(o());
157
- return G(() => {
158
- (r.treeData !== u.treeData || r.children !== u.children) && f(o());
159
- }, [r]), [a];
160
- }
161
- const Me = {
162
- bordered: !0,
163
- treeCheckedStrategy: V.SHOW_CHILD,
164
- fieldNames: ue
165
- }, Ue = { bottom: 4 }, je = (r, u) => {
166
- const { getPrefixCls: o, renderEmpty: a, componentConfig: f, rtl: i } = ce(se), e = Oe(
167
- r,
168
- Me,
169
- f == null ? void 0 : f.TreeSelect
170
- ), c = Ke(), p = P(), n = P(null), y = P(null), g = P([]), [m] = $e(e), s = We(m, e.fieldNames), [I, _] = J(), [K, ae] = ne(!1, {
171
- value: e.popupVisible
172
- }), [b, fe] = ne(
173
- void 0,
174
- // Compatible with previous behavior 'undefined as default'
175
- {
176
- value: "inputValue" in e ? e.inputValue || "" : void 0
177
- }
178
- ), L = P(b), Q = P(null), { onInputValueChange: A } = e, [C, $] = Ae(
179
- e,
180
- s,
181
- g
182
- ), H = e.multiple || e.treeCheckable, O = o("tree-select"), M = b && !R(e.onSearch), X = Ie(`${O}-popup-`), Y = (t) => {
183
- var l;
184
- t !== K && (ae(t), (l = e.onVisibleChange) == null || l.call(e, t));
185
- }, U = (t, l) => {
186
- (t !== L.current || l !== Q.current) && (fe(t), L.current = t, Q.current = l, A == null || A(t, l));
187
- }, de = T(
188
- (t) => ke(async (d) => {
189
- if (R(e.onSearch)) {
190
- await e.onSearch(d);
191
- return;
192
- }
193
- if (!d)
194
- return m;
195
- const h = /* @__PURE__ */ new Set();
196
- Object.keys(s).forEach((k) => {
197
- const S = s[k];
198
- let E = !1;
199
- if (R(e.filterTreeNode))
200
- e.filterTreeNode(d, /* @__PURE__ */ D(V.Node, { ...S })) && (E = !0);
201
- else {
202
- const F = S.value || S._key;
203
- F && F.indexOf(d) > -1 && (E = !0);
204
- }
205
- E && h.add(S.key);
206
- }), _(h);
207
- }, 100)(t),
208
- [e.onSearch, m, s, e.filterTreeNode]
209
- ), Z = T(() => {
210
- let t = !0;
211
- oe(e.showSearch) && (t = e.showSearch.retainInputValueWhileSelect !== !1), e.multiple && !t && b !== void 0 && U("", "optionChecked");
212
- }, [b, e.multiple, JSON.stringify(e.showSearch)]), N = T(
213
- (t, l) => {
214
- $(t, l), Z(), H || Y(!1);
215
- },
216
- [$, Z, K]
217
- ), me = (t, l, d) => {
218
- if (d.stopPropagation(), t.disabled)
219
- return;
220
- const h = oe(t.value) ? t.value.value : t.value;
221
- if (!e.treeCheckable || e.treeCheckStrictly || !s[h]) {
222
- const S = C.filter((E, F) => F !== l);
223
- N(S, {
224
- trigger: s[h] || t,
225
- checked: !1,
226
- selected: !1
227
- });
228
- return;
229
- }
230
- const k = De(
231
- h,
232
- !1,
233
- W(C),
234
- s,
235
- g.current
236
- );
237
- g.current = k.indeterminateKeys, N(x(k.checkedKeys, s, C), {
238
- trigger: s[h],
239
- checked: !1,
240
- selected: !1
241
- });
242
- };
243
- function j(t) {
244
- return be(t) || ye(t) || Ce(t);
245
- }
246
- re(() => {
247
- b !== void 0 && de(b), b !== L.current && (L.current = b);
248
- }, [b]);
249
- const B = ve(() => {
250
- let t = [];
251
- if (b)
252
- for (const l in s) {
253
- const h = [...s[l].pathParentKeys, l];
254
- h.some((k) => I && I.has(k)) && (t = t.concat(h));
255
- }
256
- return Array.from(new Set(t));
257
- }, [b, s, I]);
258
- re(() => {
259
- K ? setTimeout(() => {
260
- const t = C[0];
261
- n.current && t && n.current.scrollIntoView(t.value);
262
- }) : c || b && U("", "optionListHide");
263
- }, [K]), Pe(u, () => ({
264
- focus() {
265
- y.current && y.current.focus();
266
- },
267
- blur() {
268
- y.current && y.current.blur();
269
- },
270
- getRootDOMNode: () => {
271
- var t, l;
272
- return (l = (t = y.current) == null ? void 0 : t.getRootDOMNode) == null ? void 0 : l.call(t);
273
- }
274
- }));
275
- const he = T(
276
- (t) => M ? B.indexOf(t._key) > -1 : !0,
277
- [M, B]
278
- ), pe = T(
279
- (t) => {
280
- const { disabled: l, value: d } = t || {};
281
- let h = t == null ? void 0 : t.label;
282
- return R(e.renderFormat) && (h = e.renderFormat(
283
- s[d] || null,
284
- e.labelInValue ? t : d
285
- )), { text: h || d || "", disabled: l };
286
- },
287
- [e.renderFormat, e.labelInValue, s]
288
- ), ge = (t) => {
289
- $(t, {});
290
- }, ee = (t) => /* @__PURE__ */ D(
291
- Re,
292
- {
293
- autoAlignPopupWidth: !1,
294
- autoAlignPopupMinWidth: !0,
295
- ref: p,
296
- classNames: "slideDynamicOrigin",
297
- trigger: "click",
298
- position: "bl",
299
- getPopupContainer: e.getPopupContainer,
300
- popupAlign: Ue,
301
- unmountOnExit: e.unmountOnExit,
302
- ...e.triggerProps,
303
- className: z(
304
- `${O}-trigger`,
305
- e.triggerProps && e.triggerProps.className
306
- ),
307
- popup: () => {
308
- var h, k, S;
309
- const l = e.dropdownRender, d = M && j(B) || j(m) ? e.notFoundContent || (a == null ? void 0 : a("TreeSelect")) : /* @__PURE__ */ D(
310
- we,
311
- {
312
- prefixCls: O,
313
- ref: n,
314
- ...e,
315
- inputValue: b,
316
- filterNode: he,
317
- value: C,
318
- onChange: N,
319
- multiple: H,
320
- treeData: m
321
- }
322
- );
323
- return /* @__PURE__ */ D(
324
- "div",
325
- {
326
- id: X,
327
- className: z(`${O}-popup`, {
328
- [`${O}-rtl-popup`]: i
329
- }),
330
- style: {
331
- maxHeight: (h = e.treeProps) != null && h.height || (S = (k = e.treeProps) == null ? void 0 : k.virtualListProps) != null && S.height ? "unset" : "",
332
- ...e.dropdownMenuStyle
333
- },
334
- children: R(l) ? l(d) : d
335
- }
336
- );
337
- },
338
- disabled: e.disabled,
339
- onVisibleChange: (l) => {
340
- Y(l);
341
- },
342
- popupVisible: K,
343
- children: t
344
- }
345
- ), te = typeof e.triggerElement == "function" ? (() => {
346
- var l;
347
- let t;
348
- return H ? t = C.map(
349
- (d) => e.labelInValue ? { label: d.label, value: d.value } : d.value
350
- ) : t = e.labelInValue ? C[0] : (l = C[0]) == null ? void 0 : l.value, e.triggerElement({ value: t });
351
- })() : e.triggerElement;
352
- return Se(te) ? /* @__PURE__ */ D(
353
- Te,
354
- {
355
- ref: y,
356
- rtl: i,
357
- ariaControls: X,
358
- ...e,
359
- popupVisible: K,
360
- value: !H && q(C) ? C[0] : C,
361
- inputValue: b,
362
- isEmptyValue: j(C),
363
- prefixCls: O,
364
- isMultiple: H,
365
- renderText: pe,
366
- onSort: ge,
367
- onRemoveCheckedItem: me,
368
- onClear: (t) => {
369
- var l;
370
- t.stopPropagation(), N([], {}), (l = e.onClear) == null || l.call(e, !!K);
371
- },
372
- onKeyDown: (t) => {
373
- var l;
374
- t.stopPropagation(), (l = e.onKeyDown) == null || l.call(e, t);
375
- },
376
- onFocus: (t) => {
377
- t && t.stopPropagation();
378
- },
379
- onChangeInputValue: (t) => {
380
- U(t, "manual");
381
- },
382
- renderView: ee
383
- }
384
- ) : ee(te);
385
- }, Be = Ve(je), w = Be;
386
- w.displayName = "TreeSelect";
387
- w.Node = V.Node;
388
- w.SHOW_ALL = V.SHOW_ALL;
389
- w.SHOW_PARENT = V.SHOW_PARENT;
390
- w.SHOW_CHILD = V.SHOW_CHILD;
391
- const St = V.Node;
19
+ import "./interface.js";
20
+ import "./util.js";
21
+ import "lodash/isPlainObject.js";
392
22
  export {
393
- St as TreeSelectTreeNode,
394
- w as default
23
+ j as TreeSelectTreeNode,
24
+ k as default
395
25
  };
@@ -1,6 +1,6 @@
1
- import o from "./Select.js";
2
- import { TreeSelectTreeNode as m } from "./Select.js";
1
+ import { t as o } from "../chunk/Cwm8LL5p.js";
2
+ import { v as a } from "../chunk/Cwm8LL5p.js";
3
3
  export {
4
- m as TreeSelectTreeNode,
4
+ a as TreeSelectTreeNode,
5
5
  o as default
6
6
  };
package/trigger/index.js CHANGED
@@ -4,7 +4,7 @@ import ct from "lodash/isArray";
4
4
  import M from "lodash/isFunction";
5
5
  import { forwardRef as lt, useContext as pt, useRef as R, useState as at, Children as He, useCallback as be, cloneElement as Ie, useImperativeHandle as ft, useLayoutEffect as dt, useEffect as g, Fragment as mt } from "react";
6
6
  import { createPortal as gt } from "react-dom";
7
- import { a as yt } from "../chunk/C9XYyypq.js";
7
+ import { a as yt } from "../chunk/CNcLypMY.js";
8
8
  import { p as te } from "../chunk/CUFsOxJ2.js";
9
9
  import { on as oe, off as ne, getScrollElements as Tt, isScrollElement as Ct, contains as Le } from "../utils/dom.js";
10
10
  import { s as ht } from "../chunk/DAAff-FT.js";
@@ -1,14 +1,17 @@
1
1
  import React from 'react';
2
- import Group from './Group';
2
+ import CheckboxGroup from './Group';
3
+ import CheckboxGroupBlock from './GroupBlock';
3
4
  import type { CheckboxProps } from './interface';
4
5
  import useCheckbox from './useCheckbox';
5
6
  interface ForwardRefCheckboxType extends React.ForwardRefExoticComponent<React.PropsWithoutRef<CheckboxProps> & React.RefAttributes<unknown>> {
6
7
  <T extends React.ReactText = any>(props: React.PropsWithChildren<CheckboxProps<T>> & {
7
8
  ref?: React.Ref<unknown>;
8
9
  }): React.ReactElement;
9
- Group: typeof Group;
10
+ Group: typeof CheckboxGroup;
11
+ GroupBlock: typeof CheckboxGroupBlock;
10
12
  useCheckbox: typeof useCheckbox;
11
13
  }
12
14
  declare const CheckboxComponent: ForwardRefCheckboxType;
15
+ export { CheckboxGroup, CheckboxGroupBlock, useCheckbox };
13
16
  export default CheckboxComponent;
14
17
  export type { CheckboxProps };
@@ -0,0 +1,7 @@
1
+ import type { CheckboxGroupProps } from './interface';
2
+ declare function CheckboxGroupBlock(props: any): import("react/jsx-dev-runtime").JSX.Element;
3
+ declare namespace CheckboxGroupBlock {
4
+ var displayName: string;
5
+ }
6
+ export default CheckboxGroupBlock;
7
+ export type { CheckboxGroupProps };
@@ -1,4 +1,5 @@
1
1
  import Checkbox from './Checkbox';
2
- export default Checkbox;
2
+ export * from './Checkbox';
3
3
  export type { ClearCheckboxGroupContext } from './Group';
4
4
  export type { CheckboxProps } from './interface';
5
+ export default Checkbox;
@@ -1,32 +1,5 @@
1
1
  import ConfigContext from './context';
2
2
  import type { ConfigProviderProps } from './interface';
3
- export declare const colors: {
4
- primaryColor: {
5
- default: string;
6
- hover: string;
7
- active: string;
8
- };
9
- successColor: {
10
- default: string;
11
- hover: string;
12
- active: string;
13
- };
14
- infoColor: {
15
- default: string;
16
- hover: string;
17
- active: string;
18
- };
19
- warningColor: {
20
- default: string;
21
- hover: string;
22
- active: string;
23
- };
24
- dangerColor: {
25
- default: string;
26
- hover: string;
27
- active: string;
28
- };
29
- };
30
3
  declare function ConfigProvider(baseProps: ConfigProviderProps): import("react/jsx-dev-runtime").JSX.Element;
31
4
  declare namespace ConfigProvider {
32
5
  var ConfigContext: import("react").Context<ConfigProviderProps>;
@@ -148,7 +148,6 @@ export type ComponentConfig = {
148
148
  Upload?: UploadProps;
149
149
  };
150
150
  export interface ConfigProviderProps {
151
- toAuthor: false;
152
151
  autoInsertSpaceInButton?: boolean;
153
152
  componentConfig?: ComponentConfig;
154
153
  locale?: Locale;
@@ -163,6 +162,9 @@ export interface ConfigProviderProps {
163
162
  rtl?: boolean;
164
163
  effectGlobalNotice?: boolean;
165
164
  effectGlobalModal?: boolean;
165
+ keepConfig?: boolean;
166
+ isRootConfig?: boolean;
167
+ childrenName?: string;
166
168
  zIndex?: number;
167
169
  children?: ReactNode;
168
170
  }
package/types/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export { default as Calendar } from './calendar';
13
13
  export { default as Card } from './card';
14
14
  export { default as Carousel } from './carousel';
15
15
  export { default as Cascader } from './cascader';
16
- export { default as Checkbox } from './checkbox';
16
+ export { default as Checkbox, CheckboxGroup, CheckboxGroupBlock, } from './checkbox';
17
17
  export { default as Collapse } from './collapse';
18
18
  export { default as Comment } from './comment';
19
19
  export { ConfigConsumer, ConfigContext, default as ConfigProvider, } from './config-provider';
@@ -91,7 +91,7 @@ export type { PaginationProps } from './pagination/interface';
91
91
  export type { PopconfirmProps } from './popconfirm/interface';
92
92
  export type { PopoverProps } from './popover/interface';
93
93
  export type { ProgressProps } from './progress/interface';
94
- export { default as Radio, RadioGroup, RadioGroupContext } from './radio';
94
+ export { default as Radio, RadioGroup, RadioGroupBlock, RadioGroupContext, } from './radio';
95
95
  export type { RadioGroupProps, RadioProps } from './radio/interface';
96
96
  export { default as Rate } from './rate';
97
97
  export type { RateProps } from './rate/interface';
@@ -5,7 +5,7 @@ export type HotkeyInfo = {
5
5
  type: 'sibling' | 'generation' | 'enter';
6
6
  };
7
7
  export type ResetHotkeyInfo = (activeKey?: string) => void;
8
- declare const MenuContext: import("react").Context<Pick<MenuProps, "mode" | "collapse" | "icons" | "triggerProps" | "inDropdown" | "theme" | "levelIndent" | "selectedKeys" | "openKeys" | "tooltipProps" | "autoScrollIntoView" | "scrollConfig"> & {
8
+ declare const MenuContext: import("react").Context<Pick<MenuProps, "mode" | "collapse" | "icons" | "triggerProps" | "inDropdown" | "tooltipProps" | "theme" | "levelIndent" | "selectedKeys" | "openKeys" | "autoScrollIntoView" | "scrollConfig"> & {
9
9
  id?: string;
10
10
  prefixCls?: string;
11
11
  onClickMenuItem?: (key: string, e: any) => void;