@unicom-cloud/ui 0.8.94 → 0.8.96

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 (46) hide show
  1. package/Tooltip.js +1 -1
  2. package/alert/index.js +50 -49
  3. package/badge/index.js +11 -11
  4. package/color-picker/InputHex.js +1 -1
  5. package/color-picker/InputRgb.js +1 -1
  6. package/color-picker/Palette.js +1 -1
  7. package/color-picker/Panel.js +1 -1
  8. package/color-picker/colors.js +1 -1
  9. package/color-picker/hooks/useColorPicker.js +1 -1
  10. package/color-picker/utils.js +1 -1
  11. package/components/common/empty/index.js +33 -13
  12. package/components/common/hooks/useForceUpdate.js +6 -2
  13. package/components/common/hooks/useId.js +8 -8
  14. package/components/common/space/index.js +1 -1
  15. package/components/common/utils/setPrimaryColor.js +21 -21
  16. package/components/common/utils/setTheme.js +23 -23
  17. package/details/index.js +32 -31
  18. package/dist/tinycolor/chunk/{DGZSWe7E.js → BOzCVdr0.js} +43 -43
  19. package/dist/tinycolor/customize/index.js +1 -1
  20. package/hooks/index.js +50 -52
  21. package/index.js +674 -680
  22. package/package.json +1 -1
  23. package/rate/index.js +1 -1
  24. package/slider/index.js +1 -1
  25. package/slider/util.js +1 -1
  26. package/style.css +1 -1
  27. package/table/Table.js +145 -145
  28. package/tag/index.js +24 -24
  29. package/tooltip/index.js +1 -1
  30. package/types/common/utils/math.d.ts +1 -1
  31. package/types/pc/alert/interface.d.ts +2 -2
  32. package/types/pc/badge/interface.d.ts +1 -1
  33. package/types/pc/details/interface.d.ts +2 -2
  34. package/types/pc/hooks/index.d.ts +0 -1
  35. package/types/pc/menu/context.d.ts +1 -1
  36. package/types/pc/utils/math.d.ts +1 -1
  37. package/typography/Ellipsis.js +1 -1
  38. package/utils/color.js +1 -1
  39. package/utils/index.js +174 -178
  40. package/utils/math.js +7 -11
  41. package/utils/tinycolor.js +1 -1
  42. package/version/index.js +1 -1
  43. package/components/common/hooks/useComputedState.js +0 -11
  44. package/hooks/useComputedState.js +0 -4
  45. package/types/common/hooks/useComputedState.d.ts +0 -4
  46. package/types/pc/hooks/useComputedState.d.ts +0 -1
package/tag/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsx as s, jsxs as _, Fragment as J } from "react/jsx-runtime";
2
2
  import Q from "@unicom-cloud/icons/IconUiClose";
3
3
  import W from "@unicom-cloud/icons/IconUiLoading";
4
- import v from "lodash/isPlainObject";
5
- import { forwardRef as X, useContext as Y, useState as N } from "react";
4
+ import N from "lodash/isPlainObject";
5
+ import { forwardRef as X, useContext as Y, useState as b } from "react";
6
6
  import "../config-provider/ConfigProvider.js";
7
7
  import Z from "../components/common/hooks/useKeyboardEvent.js";
8
8
  import S from "../components/common/hooks/useMergeProps.js";
@@ -20,7 +20,7 @@ const te = [
20
20
  "green",
21
21
  "cyan",
22
22
  "blue",
23
- "pqbblue",
23
+ "primary",
24
24
  "purple",
25
25
  "magenta",
26
26
  "gray"
@@ -29,31 +29,31 @@ const te = [
29
29
  };
30
30
  function se(j, z) {
31
31
  var T;
32
- const { getPrefixCls: d, componentConfig: l, rtl: H } = Y(re), L = Z(), r = S(
32
+ const { getPrefixCls: d, componentConfig: p, rtl: H } = Y(re), L = Z(), r = S(
33
33
  j,
34
34
  ce,
35
- l == null ? void 0 : l.Tag
35
+ p == null ? void 0 : p.Tag
36
36
  ), {
37
37
  className: w,
38
38
  style: K,
39
39
  children: x,
40
40
  color: t,
41
41
  closable: e,
42
- checkable: p,
42
+ checkable: l,
43
43
  defaultChecked: R,
44
44
  size: I,
45
45
  onClose: f,
46
46
  onCheck: h,
47
47
  icon: O,
48
- closeIcon: u,
48
+ closeIcon: g,
49
49
  bordered: U,
50
50
  __closeIconProps: V,
51
- ...q
52
- } = r, o = d == null ? void 0 : d("tag"), [F, P] = N(
51
+ ...F
52
+ } = r, o = d == null ? void 0 : d("tag"), [M, P] = b(
53
53
  "visible" in r ? r.visible : !0
54
- ), [M, A] = N(
54
+ ), [q, A] = b(
55
55
  "checked" in r ? r.checked : R
56
- ), [g, k] = N(), y = "checked" in r ? r.checked : M, B = "visible" in r ? r.visible : F;
56
+ ), [u, k] = b(), y = "checked" in r ? r.checked : q, B = "visible" in r ? r.visible : M;
57
57
  function C(n) {
58
58
  const i = f == null ? void 0 : f(n);
59
59
  i && i.then ? (k(!0), i.then(() => {
@@ -66,13 +66,13 @@ function se(j, z) {
66
66
  const n = !y;
67
67
  "checked" in r || A(n), h == null || h(n);
68
68
  }
69
- const m = t && te.indexOf(t) !== -1 ? t : "", $ = p ? y : !0, G = ne(
69
+ const m = t && te.indexOf(t) !== -1 ? t : "", $ = l ? y : !0, G = ne(
70
70
  o,
71
71
  {
72
- [`${o}-loading`]: g,
72
+ [`${o}-loading`]: u,
73
73
  [`${o}-hide`]: !B,
74
74
  [`${o}-${m}`]: m,
75
- [`${o}-checkable`]: p,
75
+ [`${o}-checkable`]: l,
76
76
  [`${o}-checked`]: $,
77
77
  [`${o}-size-${I}`]: I,
78
78
  [`${o}-bordered`]: U,
@@ -84,29 +84,29 @@ function se(j, z) {
84
84
  ...K
85
85
  };
86
86
  t && !m && $ && (c.backgroundColor || (c.backgroundColor = t), c.borderColor || (c.borderColor = t));
87
- const E = ie(q, ["visible"]);
88
- p && (E.onClick = D);
89
- let b = /* @__PURE__ */ s(
87
+ const E = ie(F, ["visible"]);
88
+ l && (E.onClick = D);
89
+ let v = /* @__PURE__ */ s(
90
90
  ee,
91
91
  {
92
92
  prefix: o,
93
93
  className: `${o}-close-btn`,
94
94
  onClick: (n) => {
95
- v(e == null ? void 0 : e.popconfirm) || C(n);
95
+ N(e == null ? void 0 : e.popconfirm) || C(n);
96
96
  },
97
97
  role: "button",
98
98
  tabIndex: 0,
99
99
  ...L({
100
100
  onPressEnter(n) {
101
- v(e == null ? void 0 : e.popconfirm) || C(n);
101
+ N(e == null ? void 0 : e.popconfirm) || C(n);
102
102
  }
103
103
  }),
104
104
  "aria-label": "Close",
105
105
  ...V,
106
- children: u !== void 0 ? u : /* @__PURE__ */ s(Q, {})
106
+ children: g !== void 0 ? g : /* @__PURE__ */ s(Q, {})
107
107
  }
108
108
  );
109
- return v(e == null ? void 0 : e.popconfirm) && (b = /* @__PURE__ */ s(
109
+ return N(e == null ? void 0 : e.popconfirm) && (v = /* @__PURE__ */ s(
110
110
  oe,
111
111
  {
112
112
  ...e == null ? void 0 : e.popconfirm,
@@ -122,13 +122,13 @@ function se(j, z) {
122
122
  var i, a;
123
123
  C(n), (a = (i = e == null ? void 0 : e.popconfirm) == null ? void 0 : i.onOk) == null || a.call(i, n);
124
124
  },
125
- children: b
125
+ children: v
126
126
  }
127
127
  )), /* @__PURE__ */ _("div", { ref: z, style: c, className: G, ...E, children: [
128
128
  O && /* @__PURE__ */ s("span", { className: `${o}-icon`, children: O }),
129
129
  /* @__PURE__ */ s("span", { className: `${o}-content`, children: x }),
130
- !!e && !g && u !== null && b,
131
- g && /* @__PURE__ */ s("span", { className: `${o}-loading-icon`, children: /* @__PURE__ */ s(W, {}) })
130
+ !!e && !u && g !== null && v,
131
+ u && /* @__PURE__ */ s("span", { className: `${o}-loading-icon`, children: /* @__PURE__ */ s(W, {}) })
132
132
  ] });
133
133
  }
134
134
  const ae = X(se);
package/tooltip/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
- import "../dist/tinycolor/chunk/DGZSWe7E.js";
2
+ import "../dist/tinycolor/chunk/BOzCVdr0.js";
3
3
  import { TinyColor as I } from "../dist/tinycolor/src/index.js";
4
4
  import S from "lodash/isFunction";
5
5
  import { forwardRef as j, useContext as z, useRef as B, useImperativeHandle as W, useMemo as q } from "react";
@@ -1 +1 @@
1
- export { add, default, div, divide, default as math, minus, multiply, plus, subtract, times, } from '@unicom-cloud/utils/math';
1
+ export { default, div, default as math, minus, plus, times, } from '@unicom-cloud/utils/math';
@@ -29,9 +29,9 @@ export interface AlertProps {
29
29
  /**
30
30
  * @zh 警告的类型
31
31
  * @en Type of Alert
32
- * @defaultValue info
32
+ * @defaultValue default
33
33
  */
34
- type?: 'info' | 'success' | 'warning' | 'error';
34
+ type?: 'default' | 'info' | 'success' | 'warning' | 'error';
35
35
  /**
36
36
  * @zh 标题
37
37
  * @en Alert title
@@ -56,7 +56,7 @@ export interface BadgeProps extends Omit<HTMLAttributes<HTMLElement>, 'className
56
56
  * @zh 内置的一些颜色
57
57
  * @en Customize dot color
58
58
  */
59
- color?: 'red' | 'orangered' | 'orange' | 'gold' | 'lime' | 'green' | 'cyan' | 'pqbblue' | 'purple' | 'magenta' | 'gray' | string;
59
+ color?: 'red' | 'orangered' | 'orange' | 'gold' | 'lime' | 'green' | 'cyan' | 'primary' | 'purple' | 'magenta' | 'gray' | string;
60
60
  /**
61
61
  * @zh 徽标的状态类型
62
62
  * @en Set badge as a status dot
@@ -8,9 +8,9 @@ export interface DetailsProps {
8
8
  /**
9
9
  * @zh 警告的类型
10
10
  * @en Type of Details
11
- * @defaultValue info
11
+ * @defaultValue default
12
12
  */
13
- type?: 'info' | 'success' | 'warning' | 'error';
13
+ type?: 'default' | 'info' | 'success' | 'warning' | 'error';
14
14
  /**
15
15
  * @zh 标题
16
16
  * @en Details title
@@ -1,6 +1,5 @@
1
1
  export { default as useVerificationCode } from "./use-verification-code";
2
2
  export { default as useWatermark } from "./use-watermark";
3
- export { default as useComputedState } from "./useComputedState";
4
3
  export { default as useCreate } from "./useCreate";
5
4
  export { default as useForceUpdate } from "./useForceUpdate";
6
5
  export { default as useId } from "./useId";
@@ -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, "theme" | "collapse" | "mode" | "icons" | "triggerProps" | "inDropdown" | "tooltipProps" | "levelIndent" | "selectedKeys" | "openKeys" | "autoScrollIntoView" | "scrollConfig"> & {
8
+ declare const MenuContext: import("react").Context<Pick<MenuProps, "theme" | "mode" | "collapse" | "icons" | "triggerProps" | "inDropdown" | "tooltipProps" | "levelIndent" | "selectedKeys" | "openKeys" | "autoScrollIntoView" | "scrollConfig"> & {
9
9
  id?: string;
10
10
  prefixCls?: string;
11
11
  onClickMenuItem?: (key: string, e: any) => void;
@@ -1 +1 @@
1
- export { add, default, div, divide, default as math, minus, multiply, plus, subtract, times, } from '@unicom-cloud/utils/math';
1
+ export { default, div, default as math, minus, plus, times, } from '@unicom-cloud/utils/math';
@@ -15,7 +15,7 @@ import "@unicom-cloud/utils/constant";
15
15
  import "lodash/debounce";
16
16
  import "@unicom-cloud/utils/case-name";
17
17
  import p from "@unicom-cloud/utils/class-name";
18
- import "../dist/tinycolor/chunk/DGZSWe7E.js";
18
+ import "../dist/tinycolor/chunk/BOzCVdr0.js";
19
19
  import "@unicom-cloud/utils/constant/ui";
20
20
  import "../utils/contextHolder.js";
21
21
  import "@unicom-cloud/utils/clipboard-copy";
package/utils/color.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a } from "../dist/tinycolor/chunk/DGZSWe7E.js";
1
+ import { a } from "../dist/tinycolor/chunk/BOzCVdr0.js";
2
2
  export {
3
3
  a as color
4
4
  };