@unicom-cloud/ui 0.8.106 → 0.8.108

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 (197) hide show
  1. package/App.js +7 -0
  2. package/BackTop.js +2 -4
  3. package/Calendar.js +2 -2
  4. package/ColorPicker.js +15 -14
  5. package/Constant.js +4 -0
  6. package/Copy.js +4 -3
  7. package/Countdown.js +25 -0
  8. package/Grid.js +8 -10
  9. package/LiquidFill.js +4 -3
  10. package/List.js +7 -6
  11. package/Marquee.js +4 -3
  12. package/Modal.js +4 -2
  13. package/PageHeader.js +3 -2
  14. package/QrCode.js +4 -3
  15. package/RowCol.js +8 -0
  16. package/Segmented.js +14 -4
  17. package/Statistic.js +5 -4
  18. package/Tour.js +4 -3
  19. package/Transfer.js +4 -2
  20. package/anchor/Link.js +1 -1
  21. package/app/App.js +26 -0
  22. package/app/context.js +9 -0
  23. package/app/index.js +9 -0
  24. package/app/interface.js +1 -0
  25. package/app/useApp.js +8 -0
  26. package/avatar/Group.js +1 -1
  27. package/back-top/index.js +44 -56
  28. package/button/index.js +52 -51
  29. package/calendar/Lunar.js +71 -0
  30. package/calendar/index.js +11 -11
  31. package/cascader/base/node.js +22 -20
  32. package/cascader/base/store.js +10 -10
  33. package/cascader/util.js +29 -27
  34. package/color-picker/Mode.js +8 -7
  35. package/color-picker/hooks/useColorPicker.js +56 -55
  36. package/color-picker/index.js +49 -48
  37. package/color-picker/utils.js +58 -57
  38. package/components/common/empty/index.js +2 -2
  39. package/components/common/flex/index.js +64 -55
  40. package/components/common/flex/interface.js +6 -6
  41. package/components/common/hooks/useInterval.js +6 -6
  42. package/components/common/icons/file/index.js +13 -11
  43. package/components/common/space/index.js +53 -53
  44. package/components/common/utils/dayjs.js +114 -126
  45. package/components/common/utils/is.js +98 -104
  46. package/components/common/utils/setDir.js +12 -0
  47. package/components/common/utils/setTheme.js +13 -13
  48. package/components/common/utils/toArray.js +7 -5
  49. package/config-provider/ConfigProvider.js +32 -30
  50. package/constant/index.js +4 -0
  51. package/copy/index.js +2 -1
  52. package/countdown/index.js +113 -0
  53. package/countdown/interface.js +1 -0
  54. package/countdown/util.js +29 -0
  55. package/descriptions/index.js +45 -45
  56. package/divider/index.js +28 -20
  57. package/dropdown/Button.js +1 -1
  58. package/empty/index.js +1 -1
  59. package/flex/index.js +30 -29
  60. package/form/FormItem.js +126 -122
  61. package/grid/Grid.js +56 -90
  62. package/grid/Item.js +44 -65
  63. package/grid/context.js +2 -6
  64. package/grid/index.js +6 -8
  65. package/grid/util.js +6 -44
  66. package/hooks/useResponsiveState.js +54 -0
  67. package/index.js +614 -605
  68. package/input/Button.js +12 -12
  69. package/input/Group.js +11 -12
  70. package/input/Input.js +112 -102
  71. package/input/InputElement.js +25 -24
  72. package/input/Search.js +24 -24
  73. package/layout/Sider.js +1 -1
  74. package/liquid-fill/index.js +4 -3
  75. package/list/Item.js +21 -21
  76. package/list/index.js +53 -52
  77. package/marquee/index.js +20 -19
  78. package/marquee-/index.js +4 -3
  79. package/mentions/util.js +9 -8
  80. package/modal/Confirm.js +17 -17
  81. package/modal/Modal.js +247 -237
  82. package/modal/index.js +4 -2
  83. package/modal/use-modal/index.js +2 -2
  84. package/package.json +1 -1
  85. package/page-header/index.js +57 -56
  86. package/pagination/Pagination.js +89 -92
  87. package/qr-code/index.js +4 -3
  88. package/radio/Group.js +1 -1
  89. package/row-col/Col-.js +88 -0
  90. package/row-col/Col.js +159 -0
  91. package/row-col/Row.js +73 -0
  92. package/row-col/context.js +5 -0
  93. package/row-col/index.js +11 -0
  94. package/row-col/interface.js +1 -0
  95. package/segmented/index.js +257 -206
  96. package/select/Select.js +191 -191
  97. package/select/util.js +50 -50
  98. package/select-view/Core.js +31 -28
  99. package/space/index.js +15 -13
  100. package/splitter/SplitBar.js +44 -46
  101. package/statistic/index.js +56 -55
  102. package/statistic/interface.js +4 -1
  103. package/style.css +1 -1
  104. package/table/Table.js +198 -210
  105. package/table/hook/useColumns.js +27 -26
  106. package/table/hook/useStickyClassNames.js +9 -8
  107. package/table/hook/useThResizable.js +4 -3
  108. package/table/th-resizable/index.js +2 -2
  109. package/table/thead/index.js +18 -16
  110. package/time-picker/util.js +20 -30
  111. package/timeline/Item.js +1 -1
  112. package/tour/index.js +4 -3
  113. package/transfer/index.js +93 -91
  114. package/trigger/index.js +66 -66
  115. package/types/common/development/interface.d.ts +3 -3
  116. package/types/common/flex/index.d.ts +3 -9
  117. package/types/common/flex/interface.d.ts +15 -4
  118. package/types/common/space/index.d.ts +3 -5
  119. package/types/common/space/interface.d.ts +2 -0
  120. package/types/common/utils/dayjs.d.ts +3 -1
  121. package/types/common/utils/is.d.ts +3 -4
  122. package/types/common/utils/setDir.d.ts +2 -0
  123. package/types/pc/app/App.d.ts +6 -0
  124. package/types/pc/app/context.d.ts +4 -0
  125. package/types/pc/app/index.d.ts +5 -0
  126. package/types/pc/app/interface.d.ts +17 -0
  127. package/types/pc/app/useApp.d.ts +3 -0
  128. package/types/pc/back-top/interface.d.ts +4 -17
  129. package/types/pc/button/interface.d.ts +2 -2
  130. package/types/pc/calendar/Lunar.d.ts +17 -0
  131. package/types/pc/calendar/index.d.ts +1 -1
  132. package/types/pc/config-provider/interface.d.ts +17 -12
  133. package/types/pc/constant/index.d.ts +1 -0
  134. package/types/pc/countdown/interface.d.ts +65 -0
  135. package/types/pc/countdown/util.d.ts +7 -0
  136. package/types/pc/divider/interface.d.ts +1 -0
  137. package/types/pc/flex/index.d.ts +8 -6
  138. package/types/pc/flex/interface.d.ts +3 -10
  139. package/types/pc/form/FormItem.d.ts +1 -1
  140. package/types/pc/form/interface.d.ts +1 -1
  141. package/types/pc/grid/Grid.d.ts +2 -4
  142. package/types/pc/grid/Item.d.ts +1 -5
  143. package/types/pc/grid/context.d.ts +4 -15
  144. package/types/pc/grid/index.d.ts +4 -6
  145. package/types/pc/grid/interface.d.ts +14 -142
  146. package/types/pc/grid/util.d.ts +1 -10
  147. package/types/pc/hooks/useResponsiveState.d.ts +3 -0
  148. package/types/pc/index.d.ts +10 -4
  149. package/types/pc/input/Button.d.ts +2 -2
  150. package/types/pc/list/interface.d.ts +2 -1
  151. package/types/pc/message/index.d.ts +1 -9
  152. package/types/pc/message/interface.d.ts +8 -0
  153. package/types/pc/message/useMessage.d.ts +1 -2
  154. package/types/pc/modal/Modal.d.ts +1 -0
  155. package/types/pc/modal/config.d.ts +1 -2
  156. package/types/pc/modal/index.d.ts +2 -1
  157. package/types/pc/modal/interface.d.ts +17 -5
  158. package/types/pc/notification/index.d.ts +2 -9
  159. package/types/pc/notification/interface.d.ts +7 -0
  160. package/types/pc/notification/useNotification.d.ts +1 -2
  161. package/types/pc/pagination/PageOption.d.ts +0 -1
  162. package/types/pc/pagination/interface.d.ts +5 -6
  163. package/types/pc/{grid → row-col}/Col-.d.ts +1 -1
  164. package/types/pc/{grid → row-col}/Col.d.ts +1 -2
  165. package/types/pc/{grid → row-col}/Row.d.ts +1 -2
  166. package/types/pc/row-col/context.d.ts +6 -0
  167. package/types/pc/row-col/index.d.ts +7 -0
  168. package/types/pc/row-col/interface.d.ts +112 -0
  169. package/types/pc/segmented/index.d.ts +3 -7
  170. package/types/pc/segmented/interface.d.ts +38 -5
  171. package/types/pc/select-view/Core.d.ts +1 -8
  172. package/types/pc/select-view/index.d.ts +1 -8
  173. package/types/pc/select-view/interface.d.ts +9 -2
  174. package/types/pc/space/index.d.ts +5 -7
  175. package/types/pc/space/interface.d.ts +3 -10
  176. package/types/pc/statistic/index.d.ts +1 -1
  177. package/types/pc/statistic/interface.d.ts +1 -49
  178. package/types/pc/utils/is.d.ts +1 -1
  179. package/types/pc/utils/names.d.ts +422 -111
  180. package/types/pc/utils/responsiveObserve.d.ts +8 -8
  181. package/typography/Ellipsis.js +5 -4
  182. package/typography/Operations.js +4 -3
  183. package/utils/dayjs.js +13 -11
  184. package/utils/index.js +245 -244
  185. package/utils/is.js +65 -66
  186. package/utils/names.js +309 -150
  187. package/utils/responsiveObserve.js +43 -36
  188. package/version/index.js +1 -1
  189. package/grid/Col-.js +0 -86
  190. package/grid/Col.js +0 -169
  191. package/grid/Row.js +0 -96
  192. package/grid/hook/useResponsiveState.js +0 -38
  193. package/statistic/Countdown.js +0 -56
  194. package/statistic/util.js +0 -33
  195. package/types/pc/grid/hook/useResponsiveState.d.ts +0 -2
  196. package/types/pc/statistic/util.d.ts +0 -1
  197. /package/types/pc/{statistic/Countdown.d.ts → countdown/index.d.ts} +0 -0
package/transfer/index.js CHANGED
@@ -1,88 +1,90 @@
1
- import { jsxs as Q, jsx as h } from "react/jsx-runtime";
2
- import X from "@unicom-cloud/icons/IconUiLeft";
3
- import Y from "@unicom-cloud/icons/IconUiRight";
4
- import Z from "lodash/isPlainObject";
5
- import ee, { useContext as te, useMemo as D } from "react";
6
- import se from "../button/index.js";
1
+ import { jsxs as X, jsx as m } from "react/jsx-runtime";
2
+ import Y from "@unicom-cloud/icons/IconUiLeft";
3
+ import Z from "@unicom-cloud/icons/IconUiRight";
4
+ import ee from "lodash/isPlainObject";
5
+ import te, { useContext as se, useMemo as V } from "react";
6
+ import re from "../button/index.js";
7
7
  import "../config-provider/ConfigProvider.js";
8
- import re from "../components/common/hooks/useMergeProps.js";
9
- import P from "../components/common/hooks/useMergeValue.js";
10
- import V from "@unicom-cloud/utils/class-name";
8
+ import oe from "../components/common/hooks/useMergeProps.js";
9
+ import w from "../components/common/hooks/useMergeValue.js";
10
+ import A from "@unicom-cloud/utils/class-name";
11
+ import "../components/common/utils/is.js";
11
12
  import { pickDataAttributes as ae } from "../components/common/utils/pick.js";
12
- import oe from "./List.js";
13
- import ne from "../config-provider/context.js";
14
- const ce = {
13
+ import ne from "./List.js";
14
+ import ce from "../config-provider/context.js";
15
+ import { isArray as b } from "@unicom-cloud/utils/is";
16
+ const le = {
15
17
  titleTexts: ["Source", "Target"],
16
18
  defaultSelectedKeys: [],
17
19
  defaultTargetKeys: [],
18
20
  dataSource: [],
19
- filterOption: (m, p) => typeof p?.value == "string" && p.value.indexOf(m) !== -1
21
+ filterOption: (h, p) => typeof p?.value == "string" && p.value.indexOf(h) !== -1
20
22
  };
21
- function le(m, p) {
22
- const { getPrefixCls: w, componentConfig: N, rtl: L } = te(ne), b = re(
23
- m,
24
- ce,
25
- N?.Transfer
23
+ function de(h, p) {
24
+ const { getPrefixCls: N, componentConfig: L, rtl: R } = se(ce), C = oe(
25
+ h,
26
+ le,
27
+ L?.Transfer
26
28
  ), {
27
- prefixCls: R,
28
- style: j,
29
- className: k,
30
- children: B,
29
+ prefixCls: j,
30
+ style: k,
31
+ className: B,
32
+ children: E,
31
33
  dataSource: d,
32
- defaultTargetKeys: C,
33
- defaultSelectedKeys: O,
34
- targetKeys: E,
35
- selectedKeys: M,
36
- oneWay: U,
34
+ defaultTargetKeys: O,
35
+ defaultSelectedKeys: $,
36
+ targetKeys: M,
37
+ selectedKeys: U,
38
+ oneWay: W,
37
39
  simple: n,
38
40
  disabled: y,
39
- titleTexts: W,
41
+ titleTexts: z,
40
42
  operationTexts: K,
41
- operationStyle: z,
42
- onSearch: F,
43
- onChange: H,
44
- onSelectChange: A,
45
- ..._
46
- } = b, c = R || w?.("transfer"), S = !!(n || U), [i, q] = P([], {
47
- value: E,
48
- defaultValue: n ? C.concat(O) : C
49
- }), [$, x] = P([], {
43
+ operationStyle: F,
44
+ onSearch: H,
45
+ onChange: _,
46
+ onSelectChange: I,
47
+ ...q
48
+ } = C, c = j || N?.("transfer"), S = !!(n || W), [i, G] = w([], {
50
49
  value: M,
51
- defaultValue: n ? [] : O
52
- }), [I, T] = D(
50
+ defaultValue: n ? O.concat($) : O
51
+ }), [T, x] = w([], {
52
+ value: U,
53
+ defaultValue: n ? [] : $
54
+ }), [v, D] = V(
53
55
  () => [[], []],
54
56
  [d, i]
55
- ), [l, f] = D(() => {
56
- I.length = 0, T.length = 0;
57
+ ), [l, f] = V(() => {
58
+ v.length = 0, D.length = 0;
57
59
  const e = {
58
- dataSource: I,
60
+ dataSource: v,
59
61
  selectedKeys: [],
60
62
  validKeys: [],
61
63
  selectedValidKeys: [],
62
64
  selectedDisabledKeys: []
63
- }, a = {
64
- dataSource: T,
65
+ }, o = {
66
+ dataSource: D,
65
67
  selectedKeys: [],
66
68
  validKeys: [],
67
69
  selectedValidKeys: [],
68
70
  selectedDisabledKeys: []
69
71
  };
70
72
  return d.forEach((t) => {
71
- const s = i.indexOf(t.key) > -1 ? a : e;
72
- t.disabled || s.validKeys.push(t.key), $.indexOf(t.key) > -1 && (s.selectedKeys.push(t.key), t.disabled ? s.selectedDisabledKeys.push(t.key) : s.selectedValidKeys.push(t.key)), s.dataSource.push(t);
73
- }), Z(n) && n.retainSelectedItems && (Object.entries(e).forEach(([t, s]) => {
74
- Array.isArray(s) && (e[t] = s.concat(a[t]));
75
- }), e.dataSource = d.slice(), e.selectedKeys = i.slice()), [e, a];
76
- }, [d, i, $, n]), g = (e, a = null) => {
77
- if (Array.isArray(a) && a.length === 0)
73
+ const s = i.indexOf(t.key) > -1 ? o : e;
74
+ t.disabled || s.validKeys.push(t.key), T.indexOf(t.key) > -1 && (s.selectedKeys.push(t.key), t.disabled ? s.selectedDisabledKeys.push(t.key) : s.selectedValidKeys.push(t.key)), s.dataSource.push(t);
75
+ }), ee(n) && n.retainSelectedItems && (Object.entries(e).forEach(([t, s]) => {
76
+ b(s) && (e[t] = s.concat(o[t]));
77
+ }), e.dataSource = d.slice(), e.selectedKeys = i.slice()), [e, o];
78
+ }, [d, i, T, n]), g = (e, o = null) => {
79
+ if (b(o) && o.length === 0)
78
80
  return;
79
- a = a || (e === "target" ? l.selectedValidKeys : f.selectedValidKeys);
80
- const t = e === "target" ? i.concat(a).sort((s, r) => d.findIndex(({ key: o }) => o === s) - d.findIndex(({ key: o }) => o === r)) : i.filter((s) => a.indexOf(s) === -1);
81
+ o = o || (e === "target" ? l.selectedValidKeys : f.selectedValidKeys);
82
+ const t = e === "target" ? i.concat(o).sort((s, r) => d.findIndex(({ key: a }) => a === s) - d.findIndex(({ key: a }) => a === r)) : i.filter((s) => o.indexOf(s) === -1);
81
83
  x(
82
84
  l.selectedDisabledKeys.concat(f.selectedDisabledKeys)
83
- ), q(t), H?.(t, e, a);
84
- }, G = (e, a) => {
85
- if (a === "source")
85
+ ), G(t), _?.(t, e, o);
86
+ }, J = (e, o) => {
87
+ if (o === "source")
86
88
  if (n) {
87
89
  const t = e.filter(
88
90
  (r) => l.selectedKeys.indexOf(r) === -1
@@ -91,22 +93,22 @@ function le(m, p) {
91
93
  );
92
94
  g("target", t), g("source", s);
93
95
  } else
94
- x(e.concat(f.selectedKeys)), A?.(e, f.selectedKeys);
96
+ x(e.concat(f.selectedKeys)), I?.(e, f.selectedKeys);
95
97
  else
96
- x(l.selectedKeys.concat(e)), A?.(l.selectedKeys, e);
97
- }, J = () => {
98
- const e = f.selectedKeys.length > 0, a = l.selectedKeys.length > 0, t = S ? ["target"] : ["target", "source"];
99
- return n ? null : /* @__PURE__ */ h(
98
+ x(l.selectedKeys.concat(e)), I?.(l.selectedKeys, e);
99
+ }, Q = () => {
100
+ const e = f.selectedKeys.length > 0, o = l.selectedKeys.length > 0, t = S ? ["target"] : ["target", "source"];
101
+ return n ? null : /* @__PURE__ */ m(
100
102
  "div",
101
103
  {
102
- style: z,
103
- className: V(`${c}-operations`, {
104
+ style: F,
105
+ className: A(`${c}-operations`, {
104
106
  [`${c}-operations-words`]: K
105
107
  }),
106
108
  children: t.map((s, r) => {
107
- let o, u;
108
- return s === "source" ? (o = X, u = y || !e) : (o = Y, u = y || !a), /* @__PURE__ */ h(
109
- se,
109
+ let a, u;
110
+ return s === "source" ? (a = Y, u = y || !e) : (a = Z, u = y || !o), /* @__PURE__ */ m(
111
+ re,
110
112
  {
111
113
  tabIndex: u ? -1 : void 0,
112
114
  "aria-label": `move selected ${s === "target" ? "right" : "left"}`,
@@ -115,7 +117,7 @@ function le(m, p) {
115
117
  shape: "round",
116
118
  disabled: u,
117
119
  onClick: () => g(s),
118
- icon: /* @__PURE__ */ h(o, {}),
120
+ icon: /* @__PURE__ */ m(a, {}),
119
121
  children: K && K[r]
120
122
  },
121
123
  r
@@ -123,61 +125,61 @@ function le(m, p) {
123
125
  })
124
126
  }
125
127
  );
126
- }, v = (e) => {
127
- const a = e === "source" ? l : f, t = e === "target", s = { ..._ };
128
- return Object.entries(s).forEach(([r, o]) => {
128
+ }, P = (e) => {
129
+ const o = e === "source" ? l : f, t = e === "target", s = { ...q };
130
+ return Object.entries(s).forEach(([r, a]) => {
129
131
  [
130
132
  "searchPlaceholder",
131
133
  "showSearch",
132
134
  "showFooter",
133
135
  "pagination",
134
136
  "listStyle"
135
- ].indexOf(r) > -1 && (s[r] = Array.isArray(o) ? o[e === "source" ? 0 : 1] : o);
136
- }), /* @__PURE__ */ h(
137
- oe,
137
+ ].indexOf(r) > -1 && (s[r] = b(a) ? a[e === "source" ? 0 : 1] : a);
138
+ }), /* @__PURE__ */ m(
139
+ ne,
138
140
  {
139
- ...a,
141
+ ...o,
140
142
  ...s,
141
143
  style: s.listStyle,
142
144
  prefixCls: c,
143
145
  className: `${c}-view-${e}`,
144
146
  listType: e,
145
- title: W[t ? 1 : 0],
147
+ title: z[t ? 1 : 0],
146
148
  disabled: y,
147
149
  allowClear: t && S,
148
- renderList: B,
149
- handleSelect: (r) => G(r, e),
150
+ renderList: E,
151
+ handleSelect: (r) => J(r, e),
150
152
  handleRemove: (r) => g(t ? "source" : "target", r),
151
- onSearch: (r) => F?.(r, e),
152
- renderHeaderUnit: (r, o) => `${S ? "" : `${r} / `}${o}`
153
+ onSearch: (r) => H?.(r, e),
154
+ renderHeaderUnit: (r, a) => `${S ? "" : `${r} / `}${a}`
153
155
  }
154
156
  );
155
157
  };
156
- return /* @__PURE__ */ Q(
158
+ return /* @__PURE__ */ X(
157
159
  "div",
158
160
  {
159
- ...ae(b),
161
+ ...ae(C),
160
162
  ref: p,
161
- className: V(
163
+ className: A(
162
164
  c,
163
165
  {
164
166
  [`${c}-simple`]: n,
165
167
  [`${c}-disabled`]: y,
166
- [`${c}-rtl`]: L
168
+ [`${c}-rtl`]: R
167
169
  },
168
- k
170
+ B
169
171
  ),
170
- style: j,
172
+ style: k,
171
173
  children: [
172
- v("source"),
173
- J(),
174
- v("target")
174
+ P("source"),
175
+ Q(),
176
+ P("target")
175
177
  ]
176
178
  }
177
179
  );
178
180
  }
179
- const de = ee.forwardRef(le);
180
- de.displayName = "Transfer";
181
+ const ie = te.forwardRef(de);
182
+ ie.displayName = "Transfer";
181
183
  export {
182
- de as default
184
+ ie as default
183
185
  };
package/trigger/index.js CHANGED
@@ -1,35 +1,35 @@
1
1
  import { jsx as P, jsxs as De } from "react/jsx-runtime";
2
- import no from "../dist/react-transition-group/src/CSSTransition.js";
2
+ import ro from "../dist/react-transition-group/src/CSSTransition.js";
3
3
  import "../dist/react-transition-group/src/ReplaceTransition.js";
4
4
  import "../dist/react-transition-group/src/SwitchTransition.js";
5
5
  import "../dist/react-transition-group/chunk/CPfP7aNL.js";
6
6
  import "../dist/react-transition-group/src/TransitionGroup.js";
7
- import ro from "lodash/isArray";
7
+ import xe from "lodash/isArray";
8
8
  import D from "lodash/isFunction";
9
- import { forwardRef as io, useContext as so, useRef as L, useState as uo, Children as xe, useCallback as Me, cloneElement as Se, useImperativeHandle as co, useLayoutEffect as lo, useEffect as g, Fragment as po } from "react";
9
+ import { forwardRef as io, useContext as so, useRef as L, useState as uo, Children as Me, useCallback as Se, cloneElement as Oe, useImperativeHandle as co, useLayoutEffect as lo, useEffect as g, Fragment as po } from "react";
10
10
  import { createPortal as ao } from "react-dom";
11
11
  import "../config-provider/ConfigProvider.js";
12
12
  import R from "@unicom-cloud/utils/class-name";
13
- import { on as G, off as J, getScrollElements as fo, isScrollElement as mo, contains as Oe } from "../components/common/utils/dom.js";
13
+ import { on as G, off as J, getScrollElements as fo, isScrollElement as mo, contains as ve } from "../components/common/utils/dom.js";
14
14
  import { supportRef as go } from "../components/common/utils/is.js";
15
- import { Esc as ve } from "@unicom-cloud/utils/constant/keyboardCode";
15
+ import { Esc as be } from "@unicom-cloud/utils/constant/keyboardCode";
16
16
  import { mergeProps as yo } from "../components/common/utils/mergeProps.js";
17
17
  import { pickDataAttributes as To } from "../components/common/utils/pick.js";
18
18
  import { callbackOriginRef as Co, findDOMNode_ as Po } from "../components/common/utils/reactDOM.js";
19
19
  import { resizeObserver as Z } from "../components/common/utils/resizeObserver.js";
20
- import { throttleByRaf as be } from "../components/common/utils/throttleByRaf.js";
20
+ import { throttleByRaf as Ne } from "../components/common/utils/throttleByRaf.js";
21
21
  import ho, { getBoundingClientRect as Eo } from "./getPopupStyle.js";
22
22
  import wo from "../config-provider/context.js";
23
23
  import { isPlainObject as ee } from "@unicom-cloud/utils/is";
24
24
  function Do(d, $) {
25
25
  if (!d)
26
26
  return {};
27
- const { width: y, height: x, left: T, right: A } = Eo(d, $);
27
+ const { width: y, height: x, left: T, right: z } = Eo(d, $);
28
28
  return {
29
29
  width: y,
30
30
  height: x,
31
31
  left: T,
32
- right: A
32
+ right: z
33
33
  };
34
34
  }
35
35
  const Go = [
@@ -70,24 +70,24 @@ const Mo = {
70
70
  updateOnScroll: !0
71
71
  };
72
72
  function So(d, $) {
73
- const y = so(wo), { getPrefixCls: x, zIndex: T, rtl: A } = y, i = u(d), {
73
+ const y = so(wo), { getPrefixCls: x, zIndex: T, rtl: z } = y, i = u(d), {
74
74
  children: oe,
75
75
  style: te,
76
- className: Ne,
76
+ className: $e,
77
77
  arrowProps: _,
78
78
  disabled: M,
79
- popup: $e,
80
- classNames: z,
81
- duration: ke,
79
+ popup: ke,
80
+ classNames: A,
81
+ duration: He,
82
82
  unmountOnExit: ne,
83
- alignPoint: He,
84
- autoAlignPopupWidth: Ie,
85
- position: Le,
83
+ alignPoint: Ie,
84
+ autoAlignPopupWidth: Le,
85
+ position: _e,
86
86
  childrenPrefix: h,
87
- showArrow: _e,
87
+ showArrow: Be,
88
88
  popupStyle: re,
89
- __onExit: Be,
90
- __onExited: Ve
89
+ __onExit: Ve,
90
+ __onExited: Fe
91
91
  } = i, ie = oe || oe === 0, a = L(null), S = L(null), se = L(null), ue = L(null), t = L({
92
92
  rootElement: void 0,
93
93
  triggerDestoried: !1,
@@ -109,22 +109,22 @@ function So(d, $) {
109
109
  // 保存当前节点到弹出容器间的所有滚动元素
110
110
  delayTimeoutID: -1,
111
111
  updatePositionTimeoutID: -1
112
- }), [Y, O] = uo({ popupVisible: !1, popupStyle: {} }), K = i.popupVisible, Fe = Y.popupVisible, s = K ?? Fe, l = {}, Q = {
112
+ }), [Y, O] = uo({ popupVisible: !1, popupStyle: {} }), K = i.popupVisible, Re = Y.popupVisible, s = K ?? Re, l = {}, Q = {
113
113
  onMouseDown() {
114
114
  t.current.hasPopupMouseDown = !0, setTimeout(() => {
115
115
  t.current.hasPopupMouseDown = !1;
116
116
  }, 0);
117
117
  }
118
118
  };
119
- I() && !M ? (l.onMouseEnter = We, l.onMouseLeave = ge, U() && (l.onClick = ye), He && (l.onMouseMove = Xe), ze() || (Q.onMouseEnter = Ue, Q.onMouseLeave = je)) : (l.onMouseEnter = w("onMouseEnter"), l.onMouseLeave = w("onMouseLeave")), le() && !M ? (l.onContextMenu = qe, l.onClick = ye) : l.onContextMenu = w("onContextMenu"), ce() && !M ? l.onClick = Ge : l.onClick = l.onClick || w("onClick"), X() && !M ? (l.onFocus = Je, pe() && (l.onBlur = Ze)) : (l.onFocus = w("onFocus"), l.onBlur = w("onBlur")), M ? l.onKeyDown = w("onKeyDown") : l.onKeyDown = Ke;
120
- const k = V(), H = xe.only($e?.());
119
+ I() && !M ? (l.onMouseEnter = Xe, l.onMouseLeave = ge, U() && (l.onClick = ye), Ie && (l.onMouseMove = Ue), Ye() || (Q.onMouseEnter = je, Q.onMouseLeave = qe)) : (l.onMouseEnter = w("onMouseEnter"), l.onMouseLeave = w("onMouseLeave")), le() && !M ? (l.onContextMenu = Ge, l.onClick = ye) : l.onContextMenu = w("onContextMenu"), ce() && !M ? l.onClick = Je : l.onClick = l.onClick || w("onClick"), X() && !M ? (l.onFocus = Ze, pe() && (l.onBlur = eo)) : (l.onFocus = w("onFocus"), l.onBlur = w("onBlur")), M ? l.onKeyDown = w("onKeyDown") : l.onKeyDown = Qe;
120
+ const k = V(), H = Me.only(ke?.());
121
121
  k.props.className && (l.className = k.props.className), h && s && (l.className = R(l.className, `${h}-open`)), X() && (l.tabIndex = M ? -1 : 0);
122
- const v = x?.("trigger"), Re = R(
122
+ const v = x?.("trigger"), ze = R(
123
123
  v,
124
124
  h,
125
- `${v}-position-${Le}`,
126
- { [`${v}-rtl`]: A },
127
- Ne
125
+ `${v}-position-${_e}`,
126
+ { [`${v}-rtl`]: z },
127
+ $e
128
128
  );
129
129
  function u(e) {
130
130
  const { componentConfig: o } = y ?? {};
@@ -132,7 +132,7 @@ function So(d, $) {
132
132
  ee(e) ? e : d,
133
133
  Mo,
134
134
  o?.Trigger ?? {},
135
- ro(e) ? e : void 0
135
+ xe(e) ? e : void 0
136
136
  );
137
137
  }
138
138
  function b() {
@@ -141,8 +141,8 @@ function So(d, $) {
141
141
  );
142
142
  return t.current.rootElement = e, e;
143
143
  }
144
- const W = Me(
145
- be(() => {
144
+ const W = Se(
145
+ Ne(() => {
146
146
  N();
147
147
  }),
148
148
  [s]
@@ -166,7 +166,7 @@ function So(d, $) {
166
166
  function Ae() {
167
167
  return I() && u(["mouseLeaveToClose"]).mouseLeaveToClose;
168
168
  }
169
- function ze() {
169
+ function Ye() {
170
170
  return I() && !u(["popupHoverStay"]).popupHoverStay;
171
171
  }
172
172
  function U() {
@@ -179,7 +179,7 @@ function So(d, $) {
179
179
  function pe() {
180
180
  return X() && u(["blurToHide"]).blurToHide;
181
181
  }
182
- function Ye() {
182
+ function Ke() {
183
183
  t.current.updatePositionTimeoutID && (t.current.updatePositionTimeoutID.cancel ? t.current.updatePositionTimeoutID.cancel() : (clearTimeout(t.current.updatePositionTimeoutID), t.current.updatePositionTimeoutID = null)), E();
184
184
  }
185
185
  function ae(e) {
@@ -263,7 +263,7 @@ function So(d, $) {
263
263
  e();
264
264
  }, 0);
265
265
  }
266
- const B = Me(be(C), [
266
+ const B = Se(Ne(C), [
267
267
  s
268
268
  ]);
269
269
  function N(e = 0, o) {
@@ -306,32 +306,32 @@ function So(d, $) {
306
306
  }
307
307
  function me(e) {
308
308
  const o = u(["onClickOutside", "clickOutsideToClose"]);
309
- let n = Oe(a.current, e.target);
310
- n ||= Oe(b(), e.target), n ||= !!t.current.hasPopupMouseDown, n || (o.onClickOutside?.(), o.clickOutsideToClose && (pe() || I() || f(!1)));
309
+ let n = ve(a.current, e.target);
310
+ n ||= ve(b(), e.target), n ||= !!t.current.hasPopupMouseDown, n || (o.onClickOutside?.(), o.clickOutsideToClose && (pe() || I() || f(!1)));
311
311
  }
312
- function Ke(e) {
312
+ function Qe(e) {
313
313
  const o = e.key;
314
- m("onKeyDown", e), o === ve.key && Qe(e);
314
+ m("onKeyDown", e), o === be.key && We(e);
315
315
  }
316
- function Qe(e) {
316
+ function We(e) {
317
317
  const { escToClose: o } = u(["escToClose"]);
318
- o && e && e.key === ve.key && s && f(!1);
318
+ o && e && e.key === be.key && s && f(!1);
319
319
  }
320
- function We(e) {
320
+ function Xe(e) {
321
321
  const { mouseEnterDelay: o } = u(["mouseEnterDelay"]);
322
322
  m("onMouseEnter", e), E(), f(!0, o || 0);
323
323
  }
324
- function Xe(e) {
324
+ function Ue(e) {
325
325
  m("onMouseMove", e), q(e), s && B();
326
326
  }
327
327
  function ge(e) {
328
328
  const { mouseLeaveDelay: o } = u(["mouseLeaveDelay"]);
329
329
  E(), m("onMouseLeave", e), Ae() && s && f(!1, o || 0);
330
330
  }
331
- function Ue() {
331
+ function je() {
332
332
  E();
333
333
  }
334
- function je(e) {
334
+ function qe(e) {
335
335
  ge(e);
336
336
  }
337
337
  function q(e) {
@@ -340,22 +340,22 @@ function So(d, $) {
340
340
  clientY: e.clientY
341
341
  });
342
342
  }
343
- function qe(e) {
343
+ function Ge(e) {
344
344
  e.preventDefault(), m("onContextMenu", e), q(e), s ? u(["alignPoint"]).alignPoint && B() : f(!0, 0);
345
345
  }
346
346
  function ye(e) {
347
347
  s && (t.current.mousedownToHide = !0), m("onClick", e), U() && s && f(!s, 0);
348
348
  }
349
- function Ge(e) {
349
+ function Je(e) {
350
350
  s && (t.current.mousedownToHide = !0), m("onClick", e), q(e), !(!U() && s) && f(!s, 0);
351
351
  }
352
- function Je(e) {
352
+ function Ze(e) {
353
353
  const { focusDelay: o } = u(["focusDelay"]), n = () => {
354
354
  m("onFocus", e);
355
355
  };
356
356
  E(), t.current.mousedownToHide || (s ? n?.() : f(!0, o || 0, n)), t.current.mousedownToHide = !1;
357
357
  }
358
- function Ze(e) {
358
+ function eo(e) {
359
359
  f(!1, 200, () => m("onBlur", e));
360
360
  }
361
361
  function Te() {
@@ -364,7 +364,7 @@ function So(d, $) {
364
364
  function V() {
365
365
  const { children: e } = i, o = e, n = o && typeof o != "string" && o.type;
366
366
  let r = e;
367
- if (["string", "number"].indexOf(typeof e) > -1 || xe.count(e) > 1)
367
+ if (["string", "number"].indexOf(typeof e) > -1 || Me.count(e) > 1)
368
368
  r = /* @__PURE__ */ P("span", { children: e });
369
369
  else if (o && n && (n.__PQB_BUTTON === !0 || n.__PQB_CHECKBOX === !0 || n.__PQB_SWITCH === !0 || n.__PQB_RADIO === !0 || n === "button") && o.props.disabled) {
370
370
  const { picked: c, omitted: p } = xo(o.props.style, [
@@ -382,7 +382,7 @@ function So(d, $) {
382
382
  {
383
383
  className: o.props?.className,
384
384
  style: { display: "inline-block", ...c, cursor: "not-allowed" },
385
- children: Se(o, {
385
+ children: Oe(o, {
386
386
  style: {
387
387
  ...p,
388
388
  pointerEvents: "none"
@@ -408,11 +408,11 @@ function So(d, $) {
408
408
  const e = u(["containerScrollToClose", "updateOnScroll"]);
409
409
  e.containerScrollToClose ? f(!1) : e.updateOnScroll && N();
410
410
  }
411
- function eo() {
411
+ function oo() {
412
412
  t.current.scrollElements || (t.current.scrollElements = fo(
413
413
  b()
414
414
  // refPopupContainer.current.parentNode as HTMLElement,
415
- ), Array.isArray(t.current.scrollElements) && (i.containerScrollToClose && S.current?.parentNode === document.body && t.current.scrollElements.indexOf(document.body) === -1 && mo(document.documentElement) && t.current.scrollElements.push(window), t.current.scrollElements.forEach((e) => {
415
+ ), xe(t.current.scrollElements) && (i.containerScrollToClose && S.current?.parentNode === document.body && t.current.scrollElements.indexOf(document.body) === -1 && mo(document.documentElement) && t.current.scrollElements.push(window), t.current.scrollElements.forEach((e) => {
416
416
  G(e, "scroll", Ce);
417
417
  })));
418
418
  }
@@ -471,7 +471,7 @@ function So(d, $) {
471
471
  i.alignPoint,
472
472
  i.boundaryDistance,
473
473
  i.position
474
- ]), g(() => (s && (i.updateOnScroll || i.containerScrollToClose ? eo() : (N(), Pe())), () => {
474
+ ]), g(() => (s && (i.updateOnScroll || i.containerScrollToClose ? oo() : (N(), Pe())), () => {
475
475
  Pe();
476
476
  }), [
477
477
  s,
@@ -499,30 +499,30 @@ function So(d, $) {
499
499
  return o.popupVisible = !!K, o;
500
500
  }), () => {
501
501
  }), [K]), g(() => () => {
502
- Ye();
502
+ Ke();
503
503
  }, []);
504
- const oo = ie && Se(k, {
504
+ const to = ie && Oe(k, {
505
505
  ...l,
506
506
  ref: go(k) ? (e) => {
507
507
  t.current.child = e, Co(k, e);
508
508
  } : void 0
509
- }), to = /* @__PURE__ */ P(
510
- no,
509
+ }), no = /* @__PURE__ */ P(
510
+ ro,
511
511
  {
512
512
  in: !!s,
513
- timeout: ke,
514
- classNames: z,
513
+ timeout: He,
514
+ classNames: A,
515
515
  unmountOnExit: ne,
516
516
  appear: !0,
517
517
  mountOnEnter: !0,
518
518
  onEnter: () => {
519
519
  t.current.triggerDestoried = !1;
520
520
  const e = a.current;
521
- e && (e.style.display = "initial", e.style.pointerEvents = "none", z === "slideDynamicOrigin" && (e.style.transform = fe()), C());
521
+ e && (e.style.display = "initial", e.style.pointerEvents = "none", A === "slideDynamicOrigin" && (e.style.transform = fe()), C());
522
522
  },
523
523
  onEntering: () => {
524
524
  const e = a.current;
525
- e && (z === "slideDynamicOrigin" && (e.style.transform = ""), C());
525
+ e && (A === "slideDynamicOrigin" && (e.style.transform = ""), C());
526
526
  },
527
527
  onEntered: () => {
528
528
  const e = a.current;
@@ -530,14 +530,14 @@ function So(d, $) {
530
530
  },
531
531
  onExit: () => {
532
532
  const e = a.current;
533
- e && (e.style.pointerEvents = "none", Be?.(e));
533
+ e && (e.style.pointerEvents = "none", Ve?.(e));
534
534
  },
535
535
  onExited: () => {
536
536
  const e = a.current;
537
537
  e && (e.style.display = "none", ne && (t.current.triggerDestoried = !0), O((o) => {
538
538
  const n = { ...o };
539
539
  return n.popupStyle = {}, n;
540
- }), Ve?.(e));
540
+ }), Fe?.(e));
541
541
  },
542
542
  nodeRef: a,
543
543
  children: /* @__PURE__ */ De(
@@ -547,7 +547,7 @@ function So(d, $) {
547
547
  "trigger-placement": t.current.realPosition,
548
548
  ...To(i),
549
549
  style: {
550
- width: Ie && te?.width === void 0 ? t.current.childrenDomSize?.width : "",
550
+ width: Le && te?.width === void 0 ? t.current.childrenDomSize?.width : "",
551
551
  ...Y.popupStyle,
552
552
  position: "absolute",
553
553
  zIndex: T || "",
@@ -555,7 +555,7 @@ function So(d, $) {
555
555
  // display
556
556
  },
557
557
  ...Q,
558
- className: Re,
558
+ className: ze,
559
559
  children: [
560
560
  ee(re) ? /* @__PURE__ */ P(
561
561
  H.type,
@@ -565,7 +565,7 @@ function So(d, $) {
565
565
  style: { ...H.props.style, ...re }
566
566
  }
567
567
  ) : H,
568
- (_e || _) && /* @__PURE__ */ P(
568
+ (Be || _) && /* @__PURE__ */ P(
569
569
  "div",
570
570
  {
571
571
  ref: se,
@@ -600,14 +600,14 @@ function So(d, $) {
600
600
  if (D(e)) {
601
601
  const o = e(b());
602
602
  o && (F = ao(
603
- /* @__PURE__ */ P("div", { ref: S, className: `${v}-container`, children: to }),
603
+ /* @__PURE__ */ P("div", { ref: S, className: `${v}-container`, children: no }),
604
604
  o
605
605
  // popupVisible ? 1 : 0,
606
606
  ));
607
607
  }
608
608
  }
609
609
  return ie && (F = /* @__PURE__ */ De(po, { children: [
610
- oo,
610
+ to,
611
611
  F
612
612
  ] })), F;
613
613
  }
@@ -1,8 +1,8 @@
1
- import React from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  /**
3
3
  * Development 组件的属性类型定义
4
4
  * @property {string} [url] - 图片 URL,如果有则显示图片而不是图标
5
- * @property {React.ReactNode} [icon] - 自定义图标,会覆盖默认的等待图标
5
+ * @property {ReactNode} [icon] - 自定义图标,会覆盖默认的等待图标
6
6
  * @property {string} [label] - 提示文字,默认为"等待开发"
7
7
  * @property {string} [tip] - 提示文字别名,优先级低于 label
8
8
  * @property {string} [className] - 根节点类名
@@ -12,7 +12,7 @@ import React from 'react';
12
12
  */
13
13
  export interface DevelopmentProps {
14
14
  url?: string;
15
- icon?: React.ReactNode;
15
+ icon?: ReactNode;
16
16
  label?: string;
17
17
  tip?: string;
18
18
  className?: string;