@unicom-cloud/ui 0.8.97 → 0.8.99

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 (72) hide show
  1. package/Badge.js +53 -7
  2. package/LiquidFill.js +59 -2
  3. package/Marquee.js +61 -0
  4. package/QrCode.js +13 -9
  5. package/Segmented.js +11 -0
  6. package/Space.js +14 -6
  7. package/Splitter.js +7 -0
  8. package/Tour.js +13 -9
  9. package/badge/index.js +177 -84
  10. package/collapse/Collapse.js +54 -48
  11. package/components/common/space/index.js +90 -106
  12. package/index.js +356 -353
  13. package/liquid-fill/index.js +255 -2
  14. package/marquee/index.js +282 -0
  15. package/menu/Item.js +17 -16
  16. package/package.json +1 -1
  17. package/qr-code/index.js +53 -36
  18. package/rate/index.js +8 -8
  19. package/segmented/index.js +217 -0
  20. package/space/index.js +28 -29
  21. package/splitter/index.js +117 -0
  22. package/style.css +1 -1
  23. package/tour/index.js +110 -88
  24. package/types/common/hooks/useMergeProps.d.ts +1 -1
  25. package/types/common/space/index.d.ts +6 -5
  26. package/types/common/space/interface.d.ts +29 -16
  27. package/types/pc/badge/index.d.ts +4 -4
  28. package/types/pc/badge/interface.d.ts +26 -0
  29. package/types/pc/collapse/interface.d.ts +4 -0
  30. package/types/pc/config-provider/interface.d.ts +12 -0
  31. package/types/pc/date-picker/RangePicker.d.ts +1 -1
  32. package/types/pc/index.d.ts +10 -4
  33. package/types/pc/liquid-fill/index.d.ts +114 -3
  34. package/types/pc/marquee/index.d.ts +61 -0
  35. package/types/pc/menu/context.d.ts +1 -1
  36. package/types/pc/qr-code/index.d.ts +1 -1
  37. package/types/pc/rate/index.d.ts +2 -2
  38. package/types/pc/segmented/index.d.ts +8 -0
  39. package/types/pc/segmented/interface.d.ts +88 -0
  40. package/types/pc/space/index.d.ts +3 -1
  41. package/types/pc/space/interface.d.ts +6 -10
  42. package/types/pc/splitter/index.d.ts +4 -0
  43. package/types/pc/splitter/interface.d.ts +70 -0
  44. package/types/pc/tour/index.d.ts +8 -3
  45. package/types/pc/utils/names.d.ts +18 -0
  46. package/typography/Ellipsis.js +1 -1
  47. package/utils/names.js +12 -0
  48. package/version/index.js +1 -1
  49. package/_virtual/_commonjsHelpers.js +0 -6
  50. package/_virtual/index.js +0 -7
  51. package/_virtual/index2.js +0 -4
  52. package/liquid-fill/LiquidFill.js +0 -189
  53. package/liquid-fill/LiquidFill2.js +0 -3
  54. package/space-/index.js +0 -93
  55. package/types/common/utils/color.d.ts +0 -1
  56. package/types/common/utils/computeScrollIntoView.d.ts +0 -1
  57. package/types/common/utils/index.d.ts +0 -45
  58. package/types/common/utils/math.d.ts +0 -1
  59. package/types/common/utils/reactTransitionGroup.d.ts +0 -1
  60. package/types/common/utils/tree.d.ts +0 -1
  61. package/types/common/utils/tween.d.ts +0 -1
  62. package/types/common/utils/uuid.d.ts +0 -1
  63. package/types/common/utils/validate.d.ts +0 -1
  64. package/types/pc/liquid-fill/LiquidFill.d.ts +0 -30
  65. package/types/pc/liquid-fill/LiquidFill2.d.ts +0 -1
  66. package/types/pc/liquid-fill/interface.d.ts +0 -0
  67. package/types/pc/space-/index.d.ts +0 -6
  68. package/types/pc/space-/interface.d.ts +0 -38
  69. /package/{space- → components/common/space}/toArray.js +0 -0
  70. /package/{liquid-fill → segmented}/interface.js +0 -0
  71. /package/{space- → splitter}/interface.js +0 -0
  72. /package/types/{pc/space- → common/space}/toArray.d.ts +0 -0
@@ -1,189 +0,0 @@
1
- import { jsxs as x, jsx as e } from "react/jsx-runtime";
2
- import { useRef as p, useState as I, useEffect as F } from "react";
3
- import "@unicom-cloud/utils/case-name";
4
- import K from "@unicom-cloud/utils/class-name";
5
- import "../dist/tinycolor/chunk/BOzCVdr0.js";
6
- import "@unicom-cloud/utils/constant/ui";
7
- import "../utils/contextHolder.js";
8
- import "@unicom-cloud/utils/dayjs";
9
- import "@unicom-cloud/utils/clipboard-copy";
10
- import "../components/common/utils/dayjs.js";
11
- import "../components/common/utils/dom.js";
12
- import "@unicom-cloud/utils/file/fileToURL";
13
- import "lodash/escapeRegExp";
14
- import "lodash/isArray";
15
- import "lodash/isNumber";
16
- import "lodash/isString";
17
- import "lodash/isFunction";
18
- import "lodash/throttle";
19
- import "../components/common/utils/is.js";
20
- import "lodash/camelCase";
21
- import "lodash/capitalize";
22
- import "lodash/cloneDeep";
23
- import "lodash/debounce";
24
- import "lodash/get";
25
- import "lodash/has";
26
- import "lodash/kebabCase";
27
- import "lodash/merge";
28
- import "lodash/mergeWith";
29
- import "lodash/set";
30
- import "lodash/setWith";
31
- import "lodash/snakeCase";
32
- import "lodash/startCase";
33
- import "lodash/uniq";
34
- import "lodash/upperFirst";
35
- import "@unicom-cloud/utils/math";
36
- import "lodash/isPlainObject";
37
- import "../dist/react-transition-group/src/CSSTransition.js";
38
- import "../dist/react-transition-group/src/ReplaceTransition.js";
39
- import "../dist/react-transition-group/src/SwitchTransition.js";
40
- import "../dist/react-transition-group/chunk/CPfP7aNL.js";
41
- import "../dist/react-transition-group/src/TransitionGroup.js";
42
- import "../components/common/utils/reactDOM.js";
43
- import "@unicom-cloud/utils/file/saveAs";
44
- import "@unicom-cloud/utils/screenfull";
45
- import "@unicom-cloud/utils/constant/ui.js";
46
- import "@unicom-cloud/utils/tree";
47
- import { isArray as L } from "@unicom-cloud/utils/is";
48
- import { v4 as N } from "uuid";
49
- import "../dist/validate/src/index.js";
50
- import "@unicom-cloud/utils/constant/keyboardCode";
51
- const Vr = ({
52
- style: O,
53
- className: W,
54
- value: q = 0.5,
55
- size: r = 200,
56
- waveColor: s = "rgb(var(--pqb-data-3))",
57
- backgroundColor: b = "var(--pqb-color-neutral-1)",
58
- textColor: B = "var(--pqb-color-neutral-8)",
59
- showPercent: D = !0,
60
- duration: g = 2e3,
61
- waveCount: i = 3,
62
- waveAmplitude: E = 10,
63
- borderColor: H = "var(--pqb-color-neutral-4)",
64
- borderWidth: a = 2
65
- }) => {
66
- const M = p(N()), $ = p(N()), R = p(null), l = p(), u = p(), h = p(0), [v, _] = I(0), [T, P] = I([]);
67
- let S;
68
- L(s) && (S = /* @__PURE__ */ x(
69
- "linearGradient",
70
- {
71
- id: $.current,
72
- x1: "0%",
73
- y1: "0%",
74
- x2: "0%",
75
- y2: "100%",
76
- children: [
77
- /* @__PURE__ */ e("stop", { offset: "0%", stopColor: s[0] }),
78
- /* @__PURE__ */ e("stop", { offset: "100%", stopColor: s[1] })
79
- ]
80
- }
81
- ));
82
- const A = (r - a) / 2, m = r / 2, V = (A - a) * 2 * (1 - v) + 1;
83
- F(() => {
84
- P(Array.from({ length: i }, (n, t) => t * Math.PI));
85
- }, [i]);
86
- const Y = (n, t, o) => {
87
- const c = [];
88
- for (let f = 0; f <= 30; f++) {
89
- const d = f / 30 * r, y = Math.min(
90
- V + n * Math.sin(d * t + o),
91
- r - a
92
- );
93
- c.push([d, y]);
94
- }
95
- return c.push([r, r]), c.push([0, r]), c.map(([f, d], y) => `${y === 0 ? "M" : "L"}${f} ${d}`).join(" ");
96
- }, G = () => {
97
- P(
98
- (n) => n.map((t, o) => t + 0.02 * (o + 1))
99
- ), u.current = requestAnimationFrame(G);
100
- }, j = (n) => {
101
- h.current || (h.current = n);
102
- const t = n - h.current, o = Math.min(t / g, 1) * q;
103
- _(o), t < g ? l.current = requestAnimationFrame(j) : cancelAnimationFrame(l.current);
104
- };
105
- F(() => (h.current = 0, l.current = requestAnimationFrame(j), u.current = requestAnimationFrame(G), () => {
106
- cancelAnimationFrame(l.current), cancelAnimationFrame(u.current);
107
- }), [q, g, i]), F(() => () => {
108
- cancelAnimationFrame(l.current), cancelAnimationFrame(u.current);
109
- }, []);
110
- const J = () => Array.from({ length: i }).map((n, t) => {
111
- const o = E * (i - t) / i, c = 0.02 * (t + 1), k = T[t] || 0;
112
- return /* @__PURE__ */ e(
113
- "path",
114
- {
115
- d: Y(o, c, k),
116
- fill: L(s) ? `url(#${$.current})` : s,
117
- fillOpacity: 0.3 + 0.7 / i * t
118
- },
119
- t
120
- );
121
- });
122
- return /* @__PURE__ */ e(
123
- "div",
124
- {
125
- className: K(W),
126
- style: {
127
- width: r,
128
- height: r,
129
- display: "inline-block",
130
- lineHeight: 0,
131
- ...O
132
- },
133
- children: /* @__PURE__ */ x(
134
- "svg",
135
- {
136
- ref: R,
137
- width: r,
138
- height: r,
139
- viewBox: `0 0 ${r} ${r}`,
140
- preserveAspectRatio: "xMidYMid meet",
141
- children: [
142
- /* @__PURE__ */ e(
143
- "circle",
144
- {
145
- cx: m,
146
- cy: m,
147
- r: A,
148
- fill: b,
149
- stroke: H,
150
- strokeWidth: a
151
- }
152
- ),
153
- /* @__PURE__ */ x("defs", { children: [
154
- /* @__PURE__ */ e("clipPath", { id: M.current, children: /* @__PURE__ */ e(
155
- "circle",
156
- {
157
- cx: m,
158
- cy: m,
159
- r: A - a / 2
160
- }
161
- ) }),
162
- S
163
- ] }),
164
- /* @__PURE__ */ e("g", { clipPath: `url(#${M.current})`, children: J() }),
165
- D && /* @__PURE__ */ e(
166
- "text",
167
- {
168
- x: m,
169
- y: m,
170
- fill: B,
171
- fontSize: r * 0.15,
172
- textAnchor: "middle",
173
- dominantBaseline: "middle",
174
- style: {
175
- userSelect: "none",
176
- pointerEvents: "none"
177
- },
178
- children: `${Math.round(v * 100)}%`
179
- }
180
- )
181
- ]
182
- }
183
- )
184
- }
185
- );
186
- };
187
- export {
188
- Vr as default
189
- };
@@ -1,3 +0,0 @@
1
- import "react/jsx-runtime";
2
- import r from "../_virtual/index.js";
3
- r.number, r.number, r.number, r.oneOf(["circle", "rect"]), r.number, r.number, r.string, r.string, r.string, r.number, r.string, r.number, r.number;
package/space-/index.js DELETED
@@ -1,93 +0,0 @@
1
- import { jsx as c, jsxs as M } from "react/jsx-runtime";
2
- import P from "lodash/isArray";
3
- import R from "lodash/isNumber";
4
- import { forwardRef as $, useContext as V, Fragment as b } from "react";
5
- import "../config-provider/ConfigProvider.js";
6
- import j from "../components/common/hooks/useMergeProps.js";
7
- import k from "@unicom-cloud/utils/class-name";
8
- import D from "./toArray.js";
9
- import F from "../config-provider/context.js";
10
- const H = {
11
- size: "small",
12
- direction: "horizontal"
13
- };
14
- function O(s, m) {
15
- const { getPrefixCls: N, componentConfig: C, rtl: g } = V(F), v = j(
16
- s,
17
- H,
18
- C?.Space
19
- ), {
20
- className: S,
21
- style: x,
22
- children: w,
23
- size: i,
24
- direction: a,
25
- align: B,
26
- wrap: l,
27
- split: p,
28
- ...z
29
- } = v, e = N?.("space-"), d = B || (a === "horizontal" ? "center" : ""), A = k(
30
- e,
31
- {
32
- [`${e}-${a}`]: a,
33
- [`${e}-align-${d}`]: d,
34
- [`${e}-wrap`]: l,
35
- [`${e}-rtl`]: g
36
- },
37
- S
38
- );
39
- function f(t) {
40
- if (R(t))
41
- return t;
42
- switch (t) {
43
- case "mini":
44
- return 4;
45
- case "small":
46
- return 8;
47
- case "medium":
48
- return 16;
49
- case "large":
50
- return 24;
51
- default:
52
- return 8;
53
- }
54
- }
55
- const h = D(w);
56
- function L(t) {
57
- const n = h.length === t + 1, o = g ? "marginLeft" : "marginRight";
58
- if (typeof i == "string" || typeof i == "number") {
59
- const r = f(i);
60
- return l ? n ? { marginBottom: r } : {
61
- [`${o}`]: r,
62
- marginBottom: r
63
- } : n ? {} : {
64
- [a === "vertical" ? "marginBottom" : o]: r
65
- };
66
- }
67
- if (P(i)) {
68
- const r = f(i[0]), u = f(i[1]);
69
- return l ? n ? { marginBottom: u } : {
70
- [`${o}`]: r,
71
- marginBottom: u
72
- } : a === "vertical" ? { marginBottom: u } : { [`${o}`]: r };
73
- }
74
- }
75
- return /* @__PURE__ */ c("div", { ref: m, className: A, style: x, ...z, children: h.map((t, n) => {
76
- const o = t?.key || n, r = p != null && n > 0;
77
- return /* @__PURE__ */ M(b, { children: [
78
- r && /* @__PURE__ */ c("div", { className: `${e}-item-split`, children: p }),
79
- /* @__PURE__ */ c("div", { className: `${e}-item`, style: L(n), children: t })
80
- ] }, o);
81
- }) });
82
- }
83
- const y = $(O);
84
- y.displayName = "Space-";
85
- function q(s, m) {
86
- return /* @__PURE__ */ c(y, { ref: m, ...s, direction: "vertical", children: s.children });
87
- }
88
- const E = $(q);
89
- E.displayName = "SpaceVertical-";
90
- export {
91
- E as SpaceVertical,
92
- y as default
93
- };
@@ -1 +0,0 @@
1
- export { uiColor as color } from "@unicom-cloud/tinycolor";
@@ -1 +0,0 @@
1
- export { compute, default as computeScrollIntoView, default, } from '@unicom-cloud/compute-scroll-into-view';
@@ -1,45 +0,0 @@
1
- export * from './caseName';
2
- export * from './className';
3
- export * from './color';
4
- export * from './computeScrollIntoView';
5
- export * from './constant';
6
- export * from './convertToDurationBasedOnTimeUnits';
7
- export * from './copy';
8
- export * from './dayjs';
9
- export * from './dom';
10
- export * from './fileToURL';
11
- export * from './fillNBSP';
12
- export * from './findScrollParent';
13
- export * from './getHighlightText';
14
- export * from './getHotkeyHandler';
15
- export * from './getStringLength';
16
- export * from './include';
17
- export * from './intersectionObserver';
18
- export * from './is';
19
- export * from './lodash';
20
- export * from './math';
21
- export * from './mergedToString';
22
- export * from './mergeProps';
23
- export * from './mutationObserver';
24
- export * from './omit';
25
- export * from './pad';
26
- export * from './pick';
27
- export * from './PqbCSSTransition';
28
- export * from './reactDOM';
29
- export * from './reactTransitionGroup';
30
- export * from './resizeObserver';
31
- export * from './saveAs';
32
- export * from './screenfull';
33
- export * from './scrollIntoView';
34
- export * from './setDarkTheme';
35
- export * from './setPrimaryColor';
36
- export * from './style';
37
- export * from './throttleByRaf';
38
- export * from './tinycolor';
39
- export * from './tree';
40
- export * from './tween';
41
- export * from './type';
42
- export * from './uuid';
43
- export * from './validate';
44
- export * from './warning';
45
- export { keyboardCode } from './keyboardCode';
@@ -1 +0,0 @@
1
- export { default, div, default as math, minus, plus, times, } from '@unicom-cloud/utils/math';
@@ -1 +0,0 @@
1
- export { CSSTransition, default, default as reactTransitionGroup, ReplaceTransition, SwitchTransition, Transition, TransitionGroup, } from '@unicom-cloud/react-transition-group';
@@ -1 +0,0 @@
1
- export { default, findNodeBy, getChildWithParentBy, getItemBy, getItemBy2, getItemBy3, getItemByID, getLabelFromDictionaryByValue, default as tree, } from '@unicom-cloud/utils/tree';
@@ -1 +0,0 @@
1
- export { default, easing, default as tween } from '@unicom-cloud/tween';
@@ -1 +0,0 @@
1
- export { v4 as uuid, v4 as uuidv4 } from 'uuid';
@@ -1 +0,0 @@
1
- export { DefaultValidateMessage, Schema, default as validate, } from '@unicom-cloud/validate';
@@ -1,30 +0,0 @@
1
- import React, { type CSSProperties } from 'react';
2
- interface LiquidFillProps {
3
- style?: CSSProperties;
4
- /** 自定义类名 */
5
- className?: string | string[];
6
- /** 当前填充比例 (0-1) */
7
- value: number;
8
- /** 组件尺寸 (像素) 默认200 */
9
- size?: number;
10
- /** 波浪颜色 默认'rgb(var(--pqb-data-3))' */
11
- waveColor?: string | string[];
12
- /** 背景颜色 默认'var(--pqb-color-neutral-1)' */
13
- backgroundColor?: string;
14
- /** 文字颜色 默认'var(--pqb-color-neutral-8)' */
15
- textColor?: string;
16
- /** 是否显示百分比 默认true */
17
- showPercent?: boolean;
18
- /** 动画持续时间(毫秒) 默认2000 */
19
- duration?: number;
20
- /** 波浪数量 默认3 */
21
- waveCount?: number;
22
- /** 波浪振幅 默认10 */
23
- waveAmplitude?: number;
24
- /** 边框颜色 默认'var(--pqb-color-neutral-4)' */
25
- borderColor?: string;
26
- /** 边框宽度 默认2 */
27
- borderWidth?: number;
28
- }
29
- declare const LiquidFill: React.FC<LiquidFillProps>;
30
- export default LiquidFill;
@@ -1 +0,0 @@
1
- export {};
File without changes
@@ -1,6 +0,0 @@
1
- import { SpaceProps, SpaceSize } from './interface';
2
- declare const Space: import("react").ForwardRefExoticComponent<SpaceProps & import("react").RefAttributes<unknown>>;
3
- declare const SpaceVertical: import("react").ForwardRefExoticComponent<SpaceProps & import("react").RefAttributes<unknown>>;
4
- export { SpaceVertical };
5
- export default Space;
6
- export type { SpaceProps, SpaceSize };
@@ -1,38 +0,0 @@
1
- import { CSSProperties, ReactNode } from 'react';
2
- export type SpaceSize = 'mini' | 'small' | 'medium' | 'large' | number;
3
- /**
4
- * @title Space
5
- */
6
- export interface SpaceProps {
7
- style?: CSSProperties;
8
- className?: string | string[];
9
- /**
10
- * @zh 对齐方式
11
- * @en Alignment of items
12
- */
13
- align?: 'start' | 'end' | 'center' | 'baseline';
14
- /**
15
- * @zh 间距方向
16
- * @en The space direction
17
- * @defaultValue horizontal
18
- */
19
- direction?: 'vertical' | 'horizontal';
20
- /**
21
- * @zh 尺寸。( `2.15.0` 开始支持数组形式 )
22
- * @en The space size. ( Array format add in `2.15.0` )
23
- * @defaultValue small
24
- */
25
- size?: SpaceSize | SpaceSize[];
26
- /**
27
- * @zh 环绕类型的间距,用于折行的场景。
28
- * @en Whether to wrap line automatic
29
- */
30
- wrap?: boolean;
31
- /**
32
- * @zh 设置分隔符
33
- * @en Set separator
34
- * @version 2.22.0
35
- */
36
- split?: ReactNode;
37
- children?: ReactNode;
38
- }
File without changes
File without changes
File without changes
File without changes