@unicom-cloud/ui 0.8.96 → 0.8.98
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.
- package/Affix.js +1 -1
- package/Carousel.js +1 -1
- package/LiquidFill.js +4 -0
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/QrCode.js +57 -0
- package/Tour.js +63 -0
- package/Trigger.js +1 -1
- package/_virtual/_commonjsHelpers.js +6 -0
- package/_virtual/index.js +7 -0
- package/_virtual/index2.js +4 -0
- package/affix/index.js +70 -72
- package/alert/index.js +56 -56
- package/anchor/Anchor.js +55 -55
- package/anchor/Link.js +34 -34
- package/anchor/util.js +5 -5
- package/auto-complete/index.js +116 -122
- package/avatar/Avatar.js +33 -33
- package/avatar/Group.js +26 -26
- package/back-top/index.js +58 -61
- package/badge/index.js +46 -46
- package/breadcrumb/Item.js +42 -43
- package/breadcrumb/index.js +47 -47
- package/button/Group.js +6 -6
- package/button/index.js +91 -91
- package/calendar/Month.js +75 -75
- package/calendar/Year.js +35 -35
- package/calendar/header/index.js +25 -25
- package/calendar/index.js +103 -103
- package/card/Grid.js +8 -8
- package/card/Meta.js +16 -16
- package/card/index.js +49 -49
- package/carousel/Arrow.js +19 -19
- package/carousel/Indicator.js +26 -26
- package/carousel/index.js +108 -108
- package/cascader/Cascader.js +178 -191
- package/cascader/base/node.js +133 -136
- package/cascader/base/store.js +82 -85
- package/cascader/panel/List.js +125 -129
- package/cascader/panel/Search.js +79 -81
- package/cascader/util.js +13 -13
- package/checkbox/Checkbox.js +94 -96
- package/checkbox/Group.js +54 -56
- package/checkbox/GroupBlock.js +28 -29
- package/collapse/Collapse.js +45 -45
- package/collapse/Item.js +53 -55
- package/color-picker/ControlBar.js +43 -43
- package/color-picker/InputAlpha.js +12 -12
- package/color-picker/InputHex.js +30 -31
- package/color-picker/InputRgb.js +24 -24
- package/color-picker/Palette.js +18 -18
- package/color-picker/Panel.js +122 -125
- package/color-picker/hooks/useColorPicker.js +85 -88
- package/color-picker/hooks/useControlBlock.js +38 -40
- package/color-picker/index.js +47 -47
- package/comment/index.js +29 -29
- package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
- package/components/common/hooks/useId.js +8 -8
- package/components/common/hooks/useInView.js +16 -16
- package/components/common/hooks/useIntersectionObserver.js +1 -1
- package/components/common/hooks/useKeyboardEvent.js +9 -10
- package/components/common/hooks/useOverflowHidden.js +1 -4
- package/components/common/hooks/usePersistCallback.js +7 -7
- package/components/common/hooks/useStateCallback.js +9 -10
- package/components/common/hooks/useWindowSize.js +8 -8
- package/components/common/space/index.js +9 -7
- package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/components/common/utils/dom.js +27 -29
- package/components/common/utils/findScrollParent.js +17 -0
- package/components/common/utils/intersectionObserver.js +21 -0
- package/components/common/utils/is.js +99 -109
- package/components/common/utils/mutationObserver.js +19 -0
- package/components/common/utils/reactDOM.js +34 -34
- package/components/common/utils/resizeObserver.js +21 -0
- package/copy/index.js +38 -40
- package/date-picker/Picker.js +290 -295
- package/date-picker/RangePicker.js +367 -372
- package/date-picker/index.js +33 -35
- package/date-picker/panel/Body.js +46 -47
- package/date-picker/panel/Header.js +33 -33
- package/date-picker/panel/Shortcut.js +31 -31
- package/date-picker/panel/date/index.js +85 -85
- package/date-picker/panel/month/index.js +59 -59
- package/date-picker/panel/quarter/index.js +67 -70
- package/date-picker/panel/range/index.js +101 -101
- package/date-picker/panel/year/index.js +39 -39
- package/date-picker/util.js +17 -18
- package/descriptions/index.js +62 -62
- package/details/index.js +53 -55
- package/development/index.js +9 -9
- package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
- package/dist/validate/src/index.js +5 -5
- package/dist/validate/src/util.js +1 -1
- package/divider/index.js +21 -21
- package/draggable/Item.js +35 -35
- package/draggable/index.js +22 -22
- package/drawer/Drawer.js +142 -147
- package/dropdown/Button.js +48 -48
- package/dropdown/index.js +88 -92
- package/empty/index.js +16 -16
- package/form/Control.js +211 -225
- package/form/Form.js +109 -113
- package/form/FormItem.js +118 -120
- package/form/FormList.js +60 -66
- package/form/FormProvider.js +31 -34
- package/form/hook/useContext.js +17 -19
- package/form/hook/useState.js +22 -23
- package/form/hook/useWatch.js +26 -27
- package/form/promisify.js +14 -18
- package/form/store.js +304 -316
- package/form/util.js +14 -15
- package/grid/Col.js +64 -64
- package/grid/Grid.js +51 -51
- package/grid/GridItem.js +48 -48
- package/grid/Row.js +39 -39
- package/hooks/useVerificationCode.js +41 -43
- package/hooks/useWatermark.js +89 -92
- package/icon/index.js +23 -24
- package/icon-hover/index.js +16 -16
- package/icons/file.js +11 -11
- package/image/Image.js +140 -141
- package/image/ImagePreview.js +252 -255
- package/image/ImagePreviewArrow.js +25 -25
- package/image/ImagePreviewGroup.js +62 -62
- package/image/util/getScale.js +25 -28
- package/index.js +684 -675
- package/input/Button.js +48 -50
- package/input/Group.js +9 -9
- package/input/Input.js +145 -154
- package/input/InputElement.js +108 -115
- package/input/Password.js +38 -38
- package/input/Search.js +51 -55
- package/input/Textarea.js +80 -81
- package/input/useComposition.js +23 -23
- package/input-number/decimal.js +59 -62
- package/input-number/index.js +139 -141
- package/input-tag/InputTag.js +222 -230
- package/layout/Content.js +6 -6
- package/layout/Footer.js +8 -8
- package/layout/Header.js +7 -7
- package/layout/Sider.js +88 -90
- package/layout/index.js +30 -30
- package/link/index.js +45 -46
- package/liquid-fill/LiquidFill.js +226 -0
- package/liquid-fill/LiquidFill2.js +3 -0
- package/liquid-fill/index.js +4 -0
- package/list/Item.js +28 -28
- package/list/Meta.js +12 -12
- package/list/index.js +146 -148
- package/mentions/index.js +75 -76
- package/menu/Item.js +58 -58
- package/menu/Menu.js +125 -127
- package/menu/OverflowWrap.js +39 -40
- package/menu/sub-menu/Inline.js +45 -45
- package/menu/util.js +26 -28
- package/message/index.js +96 -99
- package/message/useMessage.js +26 -27
- package/modal/Confirm.js +47 -49
- package/modal/Modal.js +250 -257
- package/modal/use-modal/Hook.js +26 -28
- package/modal/use-modal/index.js +46 -49
- package/notice/index.js +89 -90
- package/notification/index.js +60 -65
- package/notification/withNotification.js +35 -35
- package/overflow-ellipsis/OverflowItem.js +19 -20
- package/overflow-ellipsis/index.js +45 -46
- package/package.json +1 -1
- package/page-header/index.js +45 -45
- package/pagination/PageItem.js +87 -91
- package/pagination/PageJumper.js +40 -41
- package/pagination/PageOption.js +31 -35
- package/pagination/Pagination.js +162 -163
- package/picker/Input.js +90 -96
- package/picker/InputRange.js +115 -122
- package/popconfirm/index.js +98 -100
- package/popover/index.js +28 -28
- package/portal/Portal.js +10 -11
- package/progress/index.js +36 -36
- package/qr-code/index.js +99 -0
- package/qr-code/interface.js +1 -0
- package/radio/Group.js +48 -48
- package/radio/GroupBlock.js +32 -33
- package/radio/Radio.js +62 -64
- package/rate/index.js +88 -88
- package/resize-box/ResizeTrigger.js +39 -39
- package/resize-box/Split.js +92 -96
- package/resize-box/SplitGroup.js +116 -122
- package/resize-box/index.js +112 -115
- package/result/index.js +44 -44
- package/select/Option.js +53 -56
- package/select/Select.js +365 -381
- package/select/util.js +95 -99
- package/select-view/Core.js +159 -160
- package/skeleton/index.js +23 -23
- package/slider/Button.js +84 -92
- package/slider/Input.js +47 -49
- package/slider/Tick.js +28 -31
- package/slider/index.js +107 -107
- package/space/index.js +26 -26
- package/space-/index.js +51 -51
- package/spin/DotLoading.js +8 -8
- package/spin/index.js +47 -47
- package/statistic/Countdown.js +37 -37
- package/statistic/index.js +58 -58
- package/steps/Step.js +42 -42
- package/steps/index.js +54 -54
- package/style.css +1 -1
- package/switch/index.js +77 -78
- package/table/ColGroup.js +36 -37
- package/table/Table.js +447 -450
- package/table/hook/useExpand.js +24 -24
- package/table/hook/useRowSelection.js +62 -62
- package/table/summary/Row.js +16 -17
- package/table/tbody/Td.js +119 -118
- package/table/tbody/Tr.js +119 -121
- package/table/tbody/index.js +62 -63
- package/table/th-resizable/index.js +30 -30
- package/table/thead/Column.js +148 -148
- package/table/thead/index.js +87 -88
- package/tabs/Tab.js +55 -55
- package/tabs/TabContent.js +8 -8
- package/tabs/TabPane.js +15 -15
- package/tabs/hook/useHeaderScroll.js +36 -36
- package/tabs/tab-header/TabInk.js +31 -33
- package/tabs/tab-header/TabNavIcon.js +34 -35
- package/tabs/tab-header/index.js +192 -195
- package/tag/index.js +94 -97
- package/time-picker/Picker.js +167 -172
- package/time-picker/RangePicker.js +28 -28
- package/time-picker/TimePicker.js +146 -146
- package/timeline/Item.js +46 -46
- package/timeline/Timeline.js +52 -52
- package/tooltip/index.js +89 -95
- package/tour/index.js +289 -0
- package/transfer/Item.js +54 -54
- package/transfer/List.js +134 -136
- package/transfer/index.js +91 -91
- package/tree/Animation.js +49 -52
- package/tree/Node.js +114 -122
- package/tree/NodeList.js +51 -51
- package/tree/Tree.js +386 -393
- package/tree-select/List.js +71 -72
- package/tree-select/Select.js +135 -143
- package/tree-select/hook/useKeyCache.js +39 -39
- package/tree-select/hook/useStateValue.js +12 -12
- package/trigger/getPopupStyle.js +60 -61
- package/trigger/index.js +337 -346
- package/types/common/space/interface.d.ts +1 -1
- package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/common/utils/findScrollParent.d.ts +2 -0
- package/types/common/utils/index.d.ts +5 -0
- package/types/common/utils/intersectionObserver.d.ts +2 -0
- package/types/common/utils/mutationObserver.d.ts +2 -0
- package/types/common/utils/resizeObserver.d.ts +2 -0
- package/types/pc/config-provider/interface.d.ts +6 -0
- package/types/pc/index.d.ts +3 -0
- package/types/pc/liquid-fill/LiquidFill.d.ts +115 -0
- package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
- package/types/pc/liquid-fill/index.d.ts +2 -0
- package/types/pc/qr-code/index.d.ts +34 -0
- package/types/pc/qr-code/interface.d.ts +39 -0
- package/types/pc/table/interface.d.ts +2 -2
- package/types/pc/tour/index.d.ts +42 -0
- package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/pc/utils/findScrollParent.d.ts +2 -0
- package/types/pc/utils/index.d.ts +5 -0
- package/types/pc/utils/intersectionObserver.d.ts +2 -0
- package/types/pc/utils/mutationObserver.d.ts +2 -0
- package/types/pc/utils/names.d.ts +18 -0
- package/types/pc/utils/resizeObserver.d.ts +2 -0
- package/typography/Base.js +79 -81
- package/typography/EditContent.js +30 -33
- package/typography/Ellipsis.js +77 -73
- package/typography/Operations.js +50 -52
- package/typography/Paragraph.js +7 -7
- package/typography/Typography.js +7 -7
- package/typography/useEllipsis.js +105 -106
- package/upload/TriggerNode.js +69 -76
- package/upload/Upload.js +84 -87
- package/upload/Uploader.js +115 -118
- package/upload/list/PictureItem.js +61 -71
- package/upload/list/TextItem.js +61 -67
- package/upload/list/UploadProgress.js +42 -49
- package/upload/list/index.js +48 -49
- package/upload/request_.js +37 -38
- package/upload/util.js +39 -39
- package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/utils/findScrollParent.js +4 -0
- package/utils/index.js +281 -278
- package/utils/intersectionObserver.js +4 -0
- package/utils/mutationObserver.js +4 -0
- package/utils/names.js +12 -0
- package/utils/resizeObserver.js +4 -0
- package/verification-code/VerificationCode.js +50 -51
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +243 -244
- package/virtual-list/util/item.js +3 -4
- package/watermark/Watermark.js +27 -31
- package/components/common/utils/resizeObserverEffect.js +0 -23
- package/types/common/utils/resizeObserverEffect.d.ts +0 -2
- package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
- package/utils/resizeObserverEffect.js +0 -4
|
@@ -1,58 +1,56 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
function
|
|
3
|
-
value:
|
|
4
|
-
multiple:
|
|
5
|
-
onActive:
|
|
6
|
-
onAdd:
|
|
7
|
-
onChange:
|
|
1
|
+
import { useState as y, useRef as w, useEffect as h } from "react";
|
|
2
|
+
function b({
|
|
3
|
+
value: s,
|
|
4
|
+
multiple: r = !1,
|
|
5
|
+
onActive: m,
|
|
6
|
+
onAdd: g,
|
|
7
|
+
onChange: l
|
|
8
8
|
}) {
|
|
9
|
-
const [
|
|
10
|
-
function
|
|
9
|
+
const [v, u] = y(!1), i = w(), E = w();
|
|
10
|
+
function c(e, t) {
|
|
11
11
|
return e < 0 ? 0 : e > t ? 1 : e / t;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
w(r - n.y, n.height)
|
|
13
|
+
function f(e) {
|
|
14
|
+
const { clientX: t, clientY: p } = e, o = i.current?.getBoundingClientRect?.();
|
|
15
|
+
return o ? [
|
|
16
|
+
c(t - o.x, o.width),
|
|
17
|
+
c(p - o.y, o.height)
|
|
19
18
|
] : [0, 0];
|
|
20
19
|
}
|
|
21
|
-
function
|
|
22
|
-
const t =
|
|
23
|
-
(
|
|
20
|
+
function d(e) {
|
|
21
|
+
const t = f(e);
|
|
22
|
+
(r || !r && (t[0] !== s[0] || t[1] !== s[1])) && l?.(t);
|
|
24
23
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
24
|
+
function n() {
|
|
25
|
+
u(!1), window.removeEventListener("mousemove", a), window.removeEventListener("mouseup", n), window.removeEventListener("contextmenu", n);
|
|
27
26
|
}
|
|
28
|
-
function
|
|
29
|
-
window.addEventListener("mousemove",
|
|
27
|
+
function L() {
|
|
28
|
+
window.addEventListener("mousemove", a), window.addEventListener("mouseup", n), window.addEventListener("contextmenu", n);
|
|
30
29
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
L(n);
|
|
30
|
+
function k(e) {
|
|
31
|
+
if (e.preventDefault(), u(!0), r) {
|
|
32
|
+
if (e.target === i.current)
|
|
33
|
+
g(f(e));
|
|
34
|
+
else if (typeof e.target?.dataset?.key < "u") {
|
|
35
|
+
const t = e.target.dataset.key;
|
|
36
|
+
m(t);
|
|
39
37
|
}
|
|
40
38
|
return;
|
|
41
39
|
}
|
|
42
|
-
|
|
40
|
+
d(e), L();
|
|
43
41
|
}
|
|
44
|
-
function
|
|
45
|
-
e.preventDefault(), e.buttons > 0 ?
|
|
42
|
+
function a(e) {
|
|
43
|
+
e.preventDefault(), e.buttons > 0 ? d(e) : n();
|
|
46
44
|
}
|
|
47
|
-
return
|
|
48
|
-
|
|
45
|
+
return h(() => () => {
|
|
46
|
+
n();
|
|
49
47
|
}, []), {
|
|
50
|
-
active:
|
|
51
|
-
blockRef:
|
|
52
|
-
handlerRef:
|
|
53
|
-
onMouseDown:
|
|
48
|
+
active: v,
|
|
49
|
+
blockRef: i,
|
|
50
|
+
handlerRef: E,
|
|
51
|
+
onMouseDown: k
|
|
54
52
|
};
|
|
55
53
|
}
|
|
56
54
|
export {
|
|
57
|
-
|
|
55
|
+
b as useControlBlock
|
|
58
56
|
};
|
package/color-picker/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import G from "lodash/isFunction";
|
|
3
3
|
import S from "lodash/isNil";
|
|
4
4
|
import D, { useContext as q } from "react";
|
|
@@ -8,32 +8,32 @@ import K from "../components/common/hooks/useMergeProps.js";
|
|
|
8
8
|
import L from "../trigger/index.js";
|
|
9
9
|
import Q from "@unicom-cloud/utils/class-name";
|
|
10
10
|
import { colors as U } from "./colors.js";
|
|
11
|
-
import { ControlBar as
|
|
11
|
+
import { ControlBar as vo } from "./ControlBar.js";
|
|
12
12
|
import { useColorPicker as W } from "./hooks/useColorPicker.js";
|
|
13
|
-
import { InputAlpha as
|
|
14
|
-
import { InputHex as
|
|
15
|
-
import { InputRgb as
|
|
16
|
-
import { Palette as
|
|
13
|
+
import { InputAlpha as Io } from "./InputAlpha.js";
|
|
14
|
+
import { InputHex as Ao } from "./InputHex.js";
|
|
15
|
+
import { InputRgb as $o } from "./InputRgb.js";
|
|
16
|
+
import { Palette as wo } from "./Palette.js";
|
|
17
17
|
import { Panel as X } from "./Panel.js";
|
|
18
18
|
import { getGradientString as Y, renderBackground as Z } from "./utils.js";
|
|
19
19
|
import _ from "../config-provider/context.js";
|
|
20
|
-
const
|
|
20
|
+
const c = {
|
|
21
21
|
size: "default",
|
|
22
22
|
presetColors: U
|
|
23
23
|
};
|
|
24
|
-
function
|
|
24
|
+
function oo(t, m) {
|
|
25
25
|
const {
|
|
26
|
-
getPrefixCls:
|
|
27
|
-
componentConfig:
|
|
28
|
-
size:
|
|
29
|
-
} = q(_),
|
|
26
|
+
getPrefixCls: d,
|
|
27
|
+
componentConfig: g,
|
|
28
|
+
size: u
|
|
29
|
+
} = q(_), n = K(
|
|
30
30
|
t,
|
|
31
|
-
{ ...
|
|
32
|
-
|
|
31
|
+
{ ...c, size: u || c.size },
|
|
32
|
+
g?.ColorPicker
|
|
33
33
|
), {
|
|
34
34
|
style: C,
|
|
35
35
|
className: f,
|
|
36
|
-
size:
|
|
36
|
+
size: l,
|
|
37
37
|
mode: h,
|
|
38
38
|
disabled: i,
|
|
39
39
|
disabledAlpha: x = !1,
|
|
@@ -45,8 +45,8 @@ function rr(t, u) {
|
|
|
45
45
|
showHistory: N,
|
|
46
46
|
showPreset: A,
|
|
47
47
|
renderFooter: b
|
|
48
|
-
} =
|
|
49
|
-
value:
|
|
48
|
+
} = n, r = d?.("color-picker"), {
|
|
49
|
+
value: o,
|
|
50
50
|
activeMode: $,
|
|
51
51
|
gradientColors: z,
|
|
52
52
|
activeColorId: w,
|
|
@@ -60,14 +60,14 @@ function rr(t, u) {
|
|
|
60
60
|
onActiveModeChange: V,
|
|
61
61
|
onGradientColorsChange: j,
|
|
62
62
|
onActiveColorIdChange: F
|
|
63
|
-
} = W(
|
|
63
|
+
} = W(n);
|
|
64
64
|
return /* @__PURE__ */ e(
|
|
65
65
|
L,
|
|
66
66
|
{
|
|
67
67
|
popup: () => /* @__PURE__ */ e(
|
|
68
68
|
X,
|
|
69
69
|
{
|
|
70
|
-
value:
|
|
70
|
+
value: o,
|
|
71
71
|
mode: h,
|
|
72
72
|
activeMode: $,
|
|
73
73
|
gradientColors: z,
|
|
@@ -103,43 +103,43 @@ function rr(t, u) {
|
|
|
103
103
|
...P,
|
|
104
104
|
onVisibleChange: T,
|
|
105
105
|
children: (() => {
|
|
106
|
-
const
|
|
107
|
-
if (!S(
|
|
108
|
-
return
|
|
109
|
-
const
|
|
110
|
-
return /* @__PURE__ */
|
|
106
|
+
const a = G(t.triggerElement) ? t.triggerElement({ value: o }) : t.triggerElement;
|
|
107
|
+
if (!S(a))
|
|
108
|
+
return a;
|
|
109
|
+
const s = typeof o == "string" ? o : Y(o);
|
|
110
|
+
return /* @__PURE__ */ p(
|
|
111
111
|
"div",
|
|
112
112
|
{
|
|
113
|
-
className: Q(
|
|
114
|
-
[`${
|
|
115
|
-
[`${
|
|
113
|
+
className: Q(r, f, {
|
|
114
|
+
[`${r}-size-${l}`]: l,
|
|
115
|
+
[`${r}-disabled`]: i
|
|
116
116
|
}),
|
|
117
117
|
style: C,
|
|
118
|
-
ref:
|
|
118
|
+
ref: m,
|
|
119
119
|
children: [
|
|
120
120
|
/* @__PURE__ */ e(
|
|
121
121
|
"div",
|
|
122
122
|
{
|
|
123
|
-
className: `${
|
|
124
|
-
style: Array.isArray(
|
|
125
|
-
background: Z(
|
|
126
|
-
} : { backgroundColor:
|
|
123
|
+
className: `${r}-preview`,
|
|
124
|
+
style: Array.isArray(o) ? {
|
|
125
|
+
background: Z(o)
|
|
126
|
+
} : { backgroundColor: o }
|
|
127
127
|
}
|
|
128
128
|
),
|
|
129
|
-
!!v && /* @__PURE__ */
|
|
130
|
-
|
|
131
|
-
!i && /* @__PURE__ */ e(J, { text:
|
|
129
|
+
!!v && /* @__PURE__ */ p("div", { className: `${r}-value`, children: [
|
|
130
|
+
s,
|
|
131
|
+
!i && /* @__PURE__ */ e(J, { text: s, className: `${r}-copy` })
|
|
132
132
|
] }),
|
|
133
133
|
/* @__PURE__ */ e(
|
|
134
134
|
"input",
|
|
135
135
|
{
|
|
136
|
-
className: `${
|
|
137
|
-
value:
|
|
136
|
+
className: `${r}-input`,
|
|
137
|
+
value: s,
|
|
138
138
|
disabled: i,
|
|
139
139
|
readOnly: !0
|
|
140
140
|
}
|
|
141
141
|
),
|
|
142
|
-
|
|
142
|
+
n.extra
|
|
143
143
|
]
|
|
144
144
|
}
|
|
145
145
|
);
|
|
@@ -147,16 +147,16 @@ function rr(t, u) {
|
|
|
147
147
|
}
|
|
148
148
|
);
|
|
149
149
|
}
|
|
150
|
-
const
|
|
151
|
-
|
|
150
|
+
const ro = D.forwardRef(
|
|
151
|
+
oo
|
|
152
152
|
);
|
|
153
|
-
|
|
153
|
+
ro.displayName = "ColorPicker";
|
|
154
154
|
export {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
vo as ColorPickerControlBar,
|
|
156
|
+
Io as ColorPickerInputAlpha,
|
|
157
|
+
Ao as ColorPickerInputHex,
|
|
158
|
+
$o as ColorPickerInputRgb,
|
|
159
|
+
wo as ColorPickerPalette,
|
|
160
160
|
X as ColorPickerPanel,
|
|
161
|
-
|
|
161
|
+
ro as default
|
|
162
162
|
};
|
package/comment/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { jsxs as n, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import h from "lodash/isPlainObject";
|
|
3
|
+
import N from "lodash/isString";
|
|
4
4
|
import { forwardRef as v, useContext as u } from "react";
|
|
5
5
|
import "../config-provider/ConfigProvider.js";
|
|
6
6
|
import C from "../components/common/hooks/useMergeProps.js";
|
|
7
|
-
import
|
|
7
|
+
import c from "@unicom-cloud/utils/class-name";
|
|
8
8
|
import { pickDataAttributes as x } from "../components/common/utils/pick.js";
|
|
9
|
-
import
|
|
10
|
-
const
|
|
9
|
+
import P from "../config-provider/context.js";
|
|
10
|
+
const j = {
|
|
11
11
|
datetime: "left",
|
|
12
12
|
actions: "left"
|
|
13
|
-
},
|
|
13
|
+
}, y = {
|
|
14
14
|
align: "left"
|
|
15
15
|
};
|
|
16
|
-
function
|
|
17
|
-
const { getPrefixCls:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
), t =
|
|
22
|
-
...
|
|
23
|
-
...
|
|
16
|
+
function b(d, f) {
|
|
17
|
+
const { getPrefixCls: p, componentConfig: g, rtl: $ } = u(P), e = C(
|
|
18
|
+
d,
|
|
19
|
+
y,
|
|
20
|
+
g?.Comment
|
|
21
|
+
), t = p?.("comment"), { actions: r, author: s, avatar: i, content: m, datetime: o } = e, l = {
|
|
22
|
+
...j,
|
|
23
|
+
...h(e.align) ? e.align : {
|
|
24
24
|
datetime: e.align,
|
|
25
25
|
actions: e.align
|
|
26
26
|
}
|
|
@@ -28,34 +28,34 @@ function A(p, $) {
|
|
|
28
28
|
return /* @__PURE__ */ n(
|
|
29
29
|
"div",
|
|
30
30
|
{
|
|
31
|
-
ref:
|
|
32
|
-
className:
|
|
31
|
+
ref: f,
|
|
32
|
+
className: c(
|
|
33
33
|
`${t}`,
|
|
34
|
-
{ [`${t}-rtl`]:
|
|
34
|
+
{ [`${t}-rtl`]: $ },
|
|
35
35
|
e.className
|
|
36
36
|
),
|
|
37
37
|
style: e.style,
|
|
38
38
|
...x(e),
|
|
39
39
|
children: [
|
|
40
|
-
i && /* @__PURE__ */ a("div", { className:
|
|
40
|
+
i && /* @__PURE__ */ a("div", { className: c(`${t}-avatar`), children: N(i) ? /* @__PURE__ */ a("img", { src: i, alt: "comment-avatar" }) : i }),
|
|
41
41
|
/* @__PURE__ */ n("div", { className: `${t}-inner`, children: [
|
|
42
42
|
/* @__PURE__ */ n("div", { className: `${t}-inner-content`, children: [
|
|
43
|
-
(
|
|
43
|
+
(s || o) && /* @__PURE__ */ n(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
|
-
className: `${t}-title ${t}-title-align-${
|
|
46
|
+
className: `${t}-title ${t}-title-align-${l.datetime}`,
|
|
47
47
|
children: [
|
|
48
|
-
|
|
48
|
+
s && /* @__PURE__ */ a("span", { className: `${t}-author`, children: s }),
|
|
49
49
|
o && /* @__PURE__ */ a("span", { className: `${t}-datetime`, children: o })
|
|
50
50
|
]
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
m && /* @__PURE__ */ a("div", { className: `${t}-content`, children: m }),
|
|
54
|
+
r && /* @__PURE__ */ a(
|
|
55
55
|
"div",
|
|
56
56
|
{
|
|
57
|
-
className: `${t}-actions ${t}-actions-align-${
|
|
58
|
-
children:
|
|
57
|
+
className: `${t}-actions ${t}-actions-align-${l.actions}`,
|
|
58
|
+
children: r
|
|
59
59
|
}
|
|
60
60
|
)
|
|
61
61
|
] }),
|
|
@@ -65,10 +65,10 @@ function A(p, $) {
|
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
|
-
const
|
|
69
|
-
|
|
68
|
+
const A = v(
|
|
69
|
+
b
|
|
70
70
|
);
|
|
71
|
-
|
|
71
|
+
A.displayName = "Comment";
|
|
72
72
|
export {
|
|
73
|
-
|
|
73
|
+
A as default
|
|
74
74
|
};
|
|
@@ -1,61 +1,58 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { memo as
|
|
7
|
-
function
|
|
8
|
-
function
|
|
9
|
-
const { useButton:
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
(e = (n = window.speechSynthesis) == null ? void 0 : n.cancel) == null || e.call(n);
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import w from "@unicom-cloud/icons/IconUiMute";
|
|
3
|
+
import y from "@unicom-cloud/icons/IconUiPauseCircleFill";
|
|
4
|
+
import I from "@unicom-cloud/icons/IconUiPlayCircleFill";
|
|
5
|
+
import x from "@unicom-cloud/icons/IconUiSound";
|
|
6
|
+
import { memo as C, forwardRef as P, useState as U, useEffect as g, useImperativeHandle as b } from "react";
|
|
7
|
+
function B(u) {
|
|
8
|
+
function p(f, m) {
|
|
9
|
+
const { useButton: h = !0, buttonProps: c, ...o } = f ?? {}, [s, t] = U(!1);
|
|
10
|
+
function l() {
|
|
11
|
+
window.speechSynthesis?.cancel?.();
|
|
13
12
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
let n = ((c = i.getText) == null ? void 0 : c.call(i)) || i.text, e = new SpeechSynthesisUtterance(n);
|
|
13
|
+
function S() {
|
|
14
|
+
let n = o.getText?.() || o.text, e = new SpeechSynthesisUtterance(n);
|
|
17
15
|
e.onstart = function() {
|
|
18
|
-
|
|
16
|
+
t(!0);
|
|
19
17
|
}, e.onerror = () => {
|
|
20
|
-
|
|
18
|
+
t(!1);
|
|
21
19
|
}, e.onmark = () => {
|
|
22
20
|
}, e.onpause = () => {
|
|
23
|
-
|
|
21
|
+
t(!1);
|
|
24
22
|
}, e.onresume = () => {
|
|
25
|
-
|
|
23
|
+
t(!0);
|
|
26
24
|
}, e.onboundary = () => {
|
|
27
25
|
}, e.onend = () => {
|
|
28
|
-
|
|
29
|
-
},
|
|
26
|
+
t(!1);
|
|
27
|
+
}, window.speechSynthesis?.speak?.(e);
|
|
30
28
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
f(), l || w(), (e = t == null ? void 0 : t.onClick) == null || e.call(t, n);
|
|
29
|
+
function a(n) {
|
|
30
|
+
l(), s || S(), c?.onClick?.(n);
|
|
34
31
|
}
|
|
35
|
-
let
|
|
32
|
+
let r;
|
|
36
33
|
if (window.speechSynthesis && window.SpeechSynthesisUtterance)
|
|
37
|
-
if (
|
|
38
|
-
let { label: n, text: e, children:
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
if (h) {
|
|
35
|
+
let { label: n, text: e, children: d, ...k } = c ?? {};
|
|
36
|
+
r = /* @__PURE__ */ i(
|
|
37
|
+
u,
|
|
41
38
|
{
|
|
42
|
-
...
|
|
39
|
+
...o,
|
|
43
40
|
type: "text",
|
|
44
41
|
size: "mini",
|
|
45
|
-
icon:
|
|
46
|
-
...
|
|
47
|
-
onClick:
|
|
48
|
-
children: n || e ||
|
|
42
|
+
icon: s ? /* @__PURE__ */ i(w, {}) : /* @__PURE__ */ i(x, {}),
|
|
43
|
+
...k,
|
|
44
|
+
onClick: a,
|
|
45
|
+
children: n || e || d
|
|
49
46
|
}
|
|
50
47
|
);
|
|
51
48
|
} else
|
|
52
|
-
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
}, []),
|
|
49
|
+
r = /* @__PURE__ */ i(s ? y : I, { ...o.iconProps, onClick: a });
|
|
50
|
+
return g(() => () => {
|
|
51
|
+
l();
|
|
52
|
+
}, []), b(m, () => ({})), r;
|
|
56
53
|
}
|
|
57
|
-
return
|
|
54
|
+
return C(P(p));
|
|
58
55
|
}
|
|
59
56
|
export {
|
|
60
|
-
|
|
57
|
+
B as default
|
|
61
58
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const [
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
}, []), typeof
|
|
1
|
+
import { useState as s, useEffect as u } from "react";
|
|
2
|
+
const e = {};
|
|
3
|
+
function d(t) {
|
|
4
|
+
const [o, n] = s();
|
|
5
|
+
return u(() => {
|
|
6
|
+
e[t] ??= 0, n(e[t]), e[t] += 1;
|
|
7
|
+
}, []), typeof o == "number" ? `${t}${o}` : void 0;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
d as default
|
|
11
11
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { useState as
|
|
1
|
+
import { useState as I, useCallback as w, useEffect as m } from "react";
|
|
2
2
|
import p, { supportIntersectionObserver as O } from "./useIntersectionObserver.js";
|
|
3
|
-
function
|
|
3
|
+
function k(u) {
|
|
4
4
|
const {
|
|
5
|
-
defaultInView:
|
|
5
|
+
defaultInView: t,
|
|
6
6
|
unobserverOnEnter: r = !0,
|
|
7
|
-
onChange:
|
|
8
|
-
target:
|
|
7
|
+
onChange: o,
|
|
8
|
+
target: s,
|
|
9
9
|
...a
|
|
10
|
-
} = u, [f, l] =
|
|
11
|
-
O ?
|
|
12
|
-
), b =
|
|
10
|
+
} = u, [f, l] = I(
|
|
11
|
+
O ? t : !0
|
|
12
|
+
), b = w(
|
|
13
13
|
([e], c) => {
|
|
14
|
-
const
|
|
15
|
-
(
|
|
14
|
+
const n = c.thresholds.some(
|
|
15
|
+
(v) => e.intersectionRatio >= v
|
|
16
16
|
) && e.isIntersecting;
|
|
17
|
-
l(
|
|
17
|
+
l(n), o?.(n, e), n && r && c.unobserve(e.target);
|
|
18
18
|
},
|
|
19
|
-
[
|
|
20
|
-
), { cor: d, dor: i, observer:
|
|
19
|
+
[o, r]
|
|
20
|
+
), { cor: d, dor: i, observer: h } = p(
|
|
21
21
|
b,
|
|
22
22
|
a
|
|
23
23
|
);
|
|
24
|
-
return m(() => (
|
|
24
|
+
return m(() => (t && r ? i() : s && d(s), i), [s, t, r]), {
|
|
25
25
|
inView: f,
|
|
26
|
-
observer:
|
|
26
|
+
observer: h
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
k as default
|
|
31
31
|
};
|
|
@@ -2,7 +2,7 @@ import { useRef as c } from "react";
|
|
|
2
2
|
import { isServerRendering as i } from "../utils/dom.js";
|
|
3
3
|
import "../utils/is.js";
|
|
4
4
|
import { isUndefined as u } from "@unicom-cloud/utils/is";
|
|
5
|
-
const f = !i && !u(window
|
|
5
|
+
const f = !i && !u(window?.IntersectionObserver);
|
|
6
6
|
function O(t, o = {}) {
|
|
7
7
|
const r = c(), e = () => {
|
|
8
8
|
r.current && (r.current.disconnect(), r.current = null);
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
import { Enter as
|
|
3
|
-
function
|
|
4
|
-
return
|
|
5
|
-
(
|
|
6
|
-
onKeyDown(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
t === E.key && ((o = e.onPressEnter) == null || o.call(e, n)), t === g.key && ((i = e.onArrowDown) == null || i.call(e, n)), t === m.key && ((w = e.onArrowLeft) == null || w.call(e, n)), t === D.key && ((f = e.onArrowRight) == null || f.call(e, n)), t === L.key && ((y = e.onArrowUp) == null || y.call(e, n)), (A = r == null ? void 0 : r.onKeyDown) == null || A.call(r, n);
|
|
1
|
+
import { useCallback as t } from "react";
|
|
2
|
+
import { Enter as i, ArrowDown as w, ArrowLeft as f, ArrowRight as y, ArrowUp as A } from "@unicom-cloud/utils/constant/keyboardCode";
|
|
3
|
+
function E(n) {
|
|
4
|
+
return t(
|
|
5
|
+
(o) => ({
|
|
6
|
+
onKeyDown(r) {
|
|
7
|
+
const e = r.key;
|
|
8
|
+
e === i.key && o.onPressEnter?.(r), e === w.key && o.onArrowDown?.(r), e === f.key && o.onArrowLeft?.(r), e === y.key && o.onArrowRight?.(r), e === A.key && o.onArrowUp?.(r), n?.onKeyDown?.(r);
|
|
10
9
|
}
|
|
11
10
|
}),
|
|
12
11
|
[]
|
|
13
12
|
);
|
|
14
13
|
}
|
|
15
14
|
export {
|
|
16
|
-
|
|
15
|
+
E as default
|
|
17
16
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { useRef as d, useEffect as f } from "react";
|
|
2
2
|
function a(o, { hidden: s }) {
|
|
3
|
-
const c = d(!1), r = d({}), u = (t) => {
|
|
4
|
-
var e, n;
|
|
5
|
-
return t === document.body || ((n = (e = t.tagName) == null ? void 0 : e.toLowerCase) == null ? void 0 : n.call(e)) === "body" ? window.innerWidth - (document.body.clientWidth || document.documentElement.clientWidth) : t.offsetWidth - t.clientWidth;
|
|
6
|
-
}, l = () => {
|
|
3
|
+
const c = d(!1), r = d({}), u = (t) => t === document.body || t.tagName?.toLowerCase?.() === "body" ? window.innerWidth - (document.body.clientWidth || document.documentElement.clientWidth) : t.offsetWidth - t.clientWidth, l = () => {
|
|
7
4
|
const t = o();
|
|
8
5
|
if (t && t.style.overflow !== "hidden") {
|
|
9
6
|
const e = t.style;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
function a(
|
|
3
|
-
const r =
|
|
4
|
-
return r.current =
|
|
5
|
-
(...
|
|
6
|
-
const
|
|
7
|
-
return
|
|
1
|
+
import { useRef as u, useCallback as c } from "react";
|
|
2
|
+
function a(e) {
|
|
3
|
+
const r = u();
|
|
4
|
+
return r.current = e, c(
|
|
5
|
+
(...t) => {
|
|
6
|
+
const n = r.current;
|
|
7
|
+
return n?.(...t);
|
|
8
8
|
},
|
|
9
9
|
[r.current]
|
|
10
10
|
);
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
function
|
|
3
|
-
const [
|
|
4
|
-
(
|
|
5
|
-
|
|
1
|
+
import { useState as n, useRef as f, useCallback as l, useEffect as o } from "react";
|
|
2
|
+
function b(a) {
|
|
3
|
+
const [t, s] = n(a), e = f(), c = l(
|
|
4
|
+
(u, r) => {
|
|
5
|
+
e.current = r, s(u);
|
|
6
6
|
},
|
|
7
7
|
[]
|
|
8
8
|
);
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, [s]), [s, r];
|
|
9
|
+
return o(() => {
|
|
10
|
+
e.current?.(t);
|
|
11
|
+
}, [t]), [t, c];
|
|
13
12
|
}
|
|
14
13
|
export {
|
|
15
|
-
|
|
14
|
+
b as default
|
|
16
15
|
};
|