@unicom-cloud/ui 0.8.100 → 0.8.102
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/Badge.js +7 -54
- package/Copy.js +5 -4
- package/Details.js +13 -2
- package/Divider.js +3 -2
- package/Flex.js +14 -4
- package/LiquidFill.js +5 -4
- package/List.js +1 -1
- package/Loading.js +16 -3
- package/Marquee.js +5 -4
- package/QrCode.js +5 -4
- package/Space.js +3 -3
- package/Splitter.js +4 -3
- package/SuspenseFallbackTest.js +2 -4
- package/Tooltip.js +3 -4
- package/Tour.js +5 -4
- package/alert/index.js +60 -62
- package/anchor/Anchor.js +12 -12
- package/anchor/util.js +10 -10
- package/back-top/index.js +33 -34
- package/badge/index.js +109 -162
- package/calendar/index.js +85 -84
- package/card/index.js +63 -43
- package/color-picker/InputHex.js +3 -4
- package/color-picker/InputRgb.js +7 -8
- package/color-picker/Palette.js +3 -4
- package/color-picker/Panel.js +3 -4
- package/color-picker/colors.js +5 -5
- package/color-picker/hooks/useColorPicker.js +3 -4
- package/color-picker/utils.js +14 -15
- package/components/common/development/index.js +44 -29
- package/components/common/empty/index.js +35 -23
- package/components/common/flex/index.js +64 -0
- package/components/common/flex/interface.js +9 -0
- package/components/common/higher-order/with-speech-synthesis/index.js +79 -55
- package/components/common/space/index.js +71 -91
- package/components/common/suspense-fallback-test/index.js +16 -0
- package/components/common/utils/PqbCSSTransition.js +1 -1
- package/components/common/utils/constant.js +6 -3
- package/components/common/utils/reactDOM.js +6 -4
- package/components/common/utils/{scrollIntoView.js → scrollIntoViewIfNeeded.js} +1 -1
- package/components/common/utils/setPrimaryColor.js +18 -18
- package/components/common/utils/setTheme.js +8 -9
- package/components/common/utils/toArray.js +12 -0
- package/copy/index.js +3 -2
- package/details/index.js +102 -62
- package/dist/scroll-into-view-if-needed/compute/index.js +126 -0
- package/dist/scroll-into-view-if-needed/smooth/index.js +70 -0
- package/dist/scroll-into-view-if-needed/src/index.js +19 -19
- package/divider/index.js +27 -21
- package/empty/index.js +13 -13
- package/flex/index.js +43 -55
- package/flex/interface.js +1 -34
- package/form/FormItem.js +69 -65
- package/form/context.js +6 -7
- package/grid/Col-.js +86 -0
- package/grid/Col.js +156 -73
- package/grid/Grid.js +71 -67
- package/grid/Row.js +3 -3
- package/grid/index.js +13 -13
- package/icon/interface.js +1 -0
- package/icon-hover/interface.js +1 -0
- package/index.js +641 -663
- package/input/Textarea.js +1 -1
- package/input/autoSizeTextAreaHeight.js +7 -7
- package/liquid-fill/index.js +5 -4
- package/list/index.js +1 -1
- package/loading/index.js +72 -53
- package/loading/interface.js +1 -0
- package/marquee/index.js +5 -4
- package/menu/Item.js +9 -9
- package/modal/Modal.js +73 -74
- package/package.json +1 -1
- package/portal/interface.js +1 -0
- package/qr-code/index.js +5 -4
- package/segmented/index.js +47 -47
- package/space/index.js +41 -35
- package/speech-synthesis/interface.js +1 -0
- package/splitter/SplitBar.js +81 -79
- package/splitter/Splitter.js +92 -104
- package/splitter/hooks/useItems.js +1 -1
- package/splitter/hooks/useResizable.js +9 -18
- package/splitter/hooks/useResize.js +10 -10
- package/splitter/hooks/useSizes.js +28 -28
- package/splitter/index.js +5 -4
- package/statistic/index.js +10 -10
- package/style.css +1 -1
- package/suspense-fallback-test/index.js +2 -11
- package/suspense-fallback-test/interface.js +1 -0
- package/table/Table.js +376 -377
- package/table/hook/useThResizable.js +5 -4
- package/table/th-resizable/index.js +12 -11
- package/time-picker/util.js +8 -8
- package/tooltip/index.js +1 -2
- package/tour/index.js +5 -4
- package/tree/NodeList.js +1 -1
- package/trigger/index.js +67 -70
- package/types/common/development/index.d.ts +7 -1
- package/types/common/development/interface.d.ts +22 -0
- package/types/common/empty/index.d.ts +2 -1
- package/types/common/flex/index.d.ts +14 -0
- package/types/common/flex/interface.d.ts +62 -0
- package/types/common/higher-order/with-speech-synthesis/index.d.ts +6 -1
- package/types/common/higher-order/with-speech-synthesis/interface.d.ts +13 -0
- package/types/common/space/index.d.ts +4 -4
- package/types/common/space/interface.d.ts +10 -18
- package/types/common/suspense-fallback-test/index.d.ts +7 -0
- package/types/common/suspense-fallback-test/interface.d.ts +1 -0
- package/types/common/utils/PqbCSSTransition.d.ts +1 -1
- package/types/common/utils/constant.d.ts +1 -0
- package/types/common/utils/scrollIntoViewIfNeeded.d.ts +4 -0
- package/types/common/utils/toArray.d.ts +13 -0
- package/types/common/utils/tree.d.ts +1 -0
- package/types/common/utils/tween.d.ts +1 -0
- package/types/pc/alert/index.d.ts +2 -1
- package/types/pc/alert/interface.d.ts +7 -1
- package/types/pc/anchor/util.d.ts +1 -1
- package/types/pc/badge/Count.d.ts +1 -1
- package/types/pc/badge/interface.d.ts +2 -0
- package/types/pc/breadcrumb/Item.d.ts +1 -1
- package/types/pc/calendar/Month.d.ts +1 -1
- package/types/pc/calendar/WeekList.d.ts +1 -1
- package/types/pc/calendar/Year.d.ts +1 -1
- package/types/pc/calendar/header/Panel.d.ts +1 -1
- package/types/pc/calendar/header/index.d.ts +1 -1
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/calendar/interface.d.ts +2 -1
- package/types/pc/card/interface.d.ts +8 -0
- package/types/pc/cascader/interface.d.ts +1 -1
- package/types/pc/cascader/panel/List.d.ts +1 -1
- package/types/pc/cascader/panel/Option.d.ts +1 -1
- package/types/pc/cascader/panel/Search.d.ts +1 -1
- package/types/pc/checkbox/Group.d.ts +2 -2
- package/types/pc/checkbox/GroupBlock.d.ts +1 -1
- package/types/pc/checkbox/IconCheck.d.ts +1 -1
- package/types/pc/color-picker/InputRgb.d.ts +1 -1
- package/types/pc/color-picker/Palette.d.ts +1 -1
- package/types/pc/color-picker/hooks/useColorPicker.d.ts +7 -2
- package/types/pc/color-picker/utils.d.ts +6 -1
- package/types/pc/config-provider/ConfigProvider.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +4 -0
- package/types/pc/copy/index.d.ts +1 -1
- package/types/pc/date-picker/panel/Body.d.ts +1 -1
- package/types/pc/date-picker/panel/Footer.d.ts +1 -1
- package/types/pc/date-picker/panel/Header.d.ts +1 -1
- package/types/pc/date-picker/panel/WeekList.d.ts +1 -1
- package/types/pc/date-picker/panel/date/index.d.ts +1 -1
- package/types/pc/date-picker/panel/month/index.d.ts +1 -1
- package/types/pc/date-picker/panel/quarter/index.d.ts +1 -1
- package/types/pc/date-picker/panel/range/index.d.ts +1 -1
- package/types/pc/date-picker/panel/week/index.d.ts +1 -1
- package/types/pc/date-picker/panel/year/index.d.ts +1 -1
- package/types/pc/descriptions/index.d.ts +1 -1
- package/types/pc/details/index.d.ts +3 -2
- package/types/pc/details/interface.d.ts +16 -0
- package/types/pc/development/index.d.ts +2 -1
- package/types/pc/development/interface.d.ts +15 -0
- package/types/pc/divider/index.d.ts +7 -2
- package/types/pc/draggable/Item.d.ts +1 -1
- package/types/pc/draggable/index.d.ts +1 -1
- package/types/pc/flex/index.d.ts +4 -4
- package/types/pc/flex/interface.d.ts +8 -53
- package/types/pc/form/Control.d.ts +1 -1
- package/types/pc/form/FormItem.d.ts +1 -1
- package/types/pc/form/FormList.d.ts +1 -1
- package/types/pc/form/IconSymbol.d.ts +1 -1
- package/types/pc/grid/Col-.d.ts +4 -0
- package/types/pc/grid/Col.d.ts +3 -2
- package/types/pc/grid/Grid.d.ts +2 -2
- package/types/pc/grid/Item.d.ts +3 -3
- package/types/pc/grid/Row.d.ts +2 -2
- package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
- package/types/pc/grid/interface.d.ts +13 -7
- package/types/pc/icon/addFromIconFontCn.d.ts +1 -7
- package/types/pc/icon/index.d.ts +2 -7
- package/types/pc/icon/interface.d.ts +13 -0
- package/types/pc/icon-hover/index.d.ts +2 -8
- package/types/pc/icon-hover/interface.d.ts +8 -0
- package/types/pc/image/ImageFooter.d.ts +1 -1
- package/types/pc/image/ImagePreviewArrow.d.ts +1 -1
- package/types/pc/image/TriggerForToolbar.d.ts +1 -1
- package/types/pc/index.d.ts +60 -51
- package/types/pc/loading/index.d.ts +4 -3
- package/types/pc/loading/interface.d.ts +6 -0
- package/types/pc/menu/Indent.d.ts +1 -1
- package/types/pc/menu/OverflowWrap.d.ts +1 -1
- package/types/pc/menu/sub-menu/Inline.d.ts +1 -1
- package/types/pc/menu/sub-menu/Pop.d.ts +1 -1
- package/types/pc/overflow-ellipsis/OverflowItem.d.ts +1 -1
- package/types/pc/overflow-ellipsis/index.d.ts +1 -1
- package/types/pc/pagination/PageItem.d.ts +3 -3
- package/types/pc/pagination/PageJumper.d.ts +1 -1
- package/types/pc/pagination/PageOption.d.ts +1 -1
- package/types/pc/portal/Portal.d.ts +2 -6
- package/types/pc/portal/index.d.ts +2 -9
- package/types/pc/portal/interface.d.ts +14 -0
- package/types/pc/progress/CircleProgress.d.ts +1 -1
- package/types/pc/progress/LineProgess.d.ts +1 -1
- package/types/pc/progress/StepProgress.d.ts +1 -1
- package/types/pc/radio/Group.d.ts +2 -2
- package/types/pc/radio/GroupBlock.d.ts +1 -1
- package/types/pc/radio/Radio.d.ts +1 -1
- package/types/pc/resize-box/ResizeTrigger.d.ts +1 -1
- package/types/pc/result/403.d.ts +1 -1
- package/types/pc/result/404.d.ts +1 -1
- package/types/pc/result/500.d.ts +1 -1
- package/types/pc/segmented/interface.d.ts +6 -6
- package/types/pc/skeleton/Image.d.ts +1 -1
- package/types/pc/skeleton/Text.d.ts +2 -1
- package/types/pc/slider/Button.d.ts +1 -1
- package/types/pc/slider/Input.d.ts +1 -1
- package/types/pc/slider/Tick.d.ts +1 -1
- package/types/pc/space/index.d.ts +6 -5
- package/types/pc/speech-synthesis/index.d.ts +3 -1
- package/types/pc/speech-synthesis/interface.d.ts +7 -0
- package/types/pc/spin/DotLoading.d.ts +1 -1
- package/types/pc/splitter/SplitBar.d.ts +0 -1
- package/types/pc/splitter/hooks/useResizable.d.ts +0 -1
- package/types/pc/splitter/hooks/useResize.d.ts +1 -2
- package/types/pc/splitter/index.d.ts +5 -4
- package/types/pc/splitter/interface.d.ts +16 -24
- package/types/pc/suspense-fallback-test/index.d.ts +2 -3
- package/types/pc/suspense-fallback-test/interface.d.ts +2 -0
- package/types/pc/table/ColGroup.d.ts +1 -1
- package/types/pc/table/summary/Cell.d.ts +1 -1
- package/types/pc/table/summary/Row.d.ts +1 -1
- package/types/pc/table/tbody/Td.d.ts +1 -1
- package/types/pc/table/tbody/index.d.ts +1 -1
- package/types/pc/table/tfoot/index.d.ts +1 -1
- package/types/pc/table/th-resizable/index.d.ts +1 -1
- package/types/pc/table/thead/Column.d.ts +1 -1
- package/types/pc/table/thead/index.d.ts +1 -1
- package/types/pc/tabs/TabContent.d.ts +1 -1
- package/types/pc/tabs/tab-header/DropdownIcon.d.ts +1 -1
- package/types/pc/tabs/tab-header/TabInk.d.ts +1 -1
- package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
- package/types/pc/time-picker/Picker.d.ts +1 -1
- package/types/pc/time-picker/RangePicker.d.ts +1 -1
- package/types/pc/time-picker/TimeColumn.d.ts +1 -1
- package/types/pc/time-picker/TimePicker.d.ts +1 -1
- package/types/pc/time-picker/index.d.ts +1 -1
- package/types/pc/tour/index.d.ts +1 -1
- package/types/pc/transfer/Item.d.ts +1 -1
- package/types/pc/transfer/List.d.ts +1 -1
- package/types/pc/tree/Animation.d.ts +1 -1
- package/types/pc/typography/Operations.d.ts +1 -1
- package/types/pc/upload/interface.d.ts +1 -0
- package/types/pc/upload/list/index.d.ts +1 -1
- package/types/pc/utils/constant.d.ts +1 -2
- package/types/pc/utils/dayjs.d.ts +2 -1
- package/types/pc/utils/index.d.ts +2 -5
- package/types/pc/utils/scrollIntoViewIfNeeded.d.ts +3 -0
- package/types/pc/utils/toArray.d.ts +1 -5
- package/types/pc/utils/tree.d.ts +2 -1
- package/types/pc/utils/tween.d.ts +1 -1
- package/types/pc/verification-code/VerificationCode.d.ts +1 -1
- package/types/pc/virtual-list/VirtualList.d.ts +2 -38
- package/types/pc/virtual-list/index.d.ts +2 -1
- package/types/pc/virtual-list/interface.d.ts +56 -0
- package/types/pc/watermark/Watermark.d.ts +1 -1
- package/typography/Ellipsis.js +5 -4
- package/typography/Operations.js +5 -4
- package/upload/request.js +12 -13
- package/upload/request_.js +2 -3
- package/utils/constant.js +5 -5
- package/utils/dayjs.js +13 -12
- package/utils/index.js +261 -284
- package/utils/scrollIntoViewIfNeeded.js +12 -0
- package/utils/toArray.js +3 -10
- package/utils/tree.js +11 -9
- package/utils/tween.js +5 -5
- package/version/index.js +1 -1
- package/virtual-list/interface.js +1 -0
- package/components/common/space/toArray.js +0 -11
- package/components/common/utils/convertToDurationBasedOnTimeUnits.js +0 -6
- package/dist/compute-scroll-into-view/src/index.js +0 -126
- package/dist/tinycolor/chunk/BOzCVdr0.js +0 -182
- package/dist/tinycolor/customize/index.js +0 -12
- package/dist/tinycolor/src/conversion.js +0 -143
- package/dist/tinycolor/src/css-color-names.js +0 -153
- package/dist/tinycolor/src/format-input.js +0 -77
- package/dist/tinycolor/src/index.js +0 -388
- package/dist/tinycolor/src/util.js +0 -32
- package/flex/utils.js +0 -13
- package/loading/style/index.module.less.js +0 -4
- package/types/common/space/toArray.d.ts +0 -3
- package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
- package/types/common/utils/scrollIntoView.d.ts +0 -4
- package/types/common/utils/tinycolor.d.ts +0 -1
- package/types/pc/flex/utils.d.ts +0 -9
- package/types/pc/suspense-fallback-test/style/index.d.ts +0 -1
- package/types/pc/utils/color.d.ts +0 -1
- package/types/pc/utils/computeScrollIntoView.d.ts +0 -1
- package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
- package/types/pc/utils/scrollIntoView.d.ts +0 -3
- package/types/pc/utils/tinycolor.d.ts +0 -1
- package/utils/color.js +0 -4
- package/utils/computeScrollIntoView.js +0 -6
- package/utils/convertToDurationBasedOnTimeUnits.js +0 -6
- package/utils/scrollIntoView.js +0 -6
- package/utils/tinycolor.js +0 -29
- /package/{suspense-fallback-test/style/index.less.js → development/interface.js} +0 -0
package/calendar/index.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useContext as
|
|
1
|
+
import { jsxs as ne, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import re from "lodash/merge";
|
|
3
|
+
import { useContext as se, useState as M, useMemo as le } from "react";
|
|
4
4
|
import "../config-provider/ConfigProvider.js";
|
|
5
|
-
import
|
|
5
|
+
import de from "../components/common/hooks/useMergeProps.js";
|
|
6
6
|
import me from "@unicom-cloud/utils/class-name";
|
|
7
|
-
import { getDayjsValue as u, getNow as
|
|
8
|
-
import { pickDataAttributes as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
function
|
|
15
|
-
return
|
|
7
|
+
import { getDayjsValue as u, getNow as A, methods as g } from "../components/common/utils/dayjs.js";
|
|
8
|
+
import { pickDataAttributes as ce } from "../components/common/utils/pick.js";
|
|
9
|
+
import ie, { getAllDaysByTime as pe } from "./Month.js";
|
|
10
|
+
import fe from "./Year.js";
|
|
11
|
+
import he from "./header/index.js";
|
|
12
|
+
import ue from "./header/Panel.js";
|
|
13
|
+
import ge from "../config-provider/context.js";
|
|
14
|
+
function ye(m, y) {
|
|
15
|
+
return m === "month" || m === "year" && !y ? "YYYY-MM-DD" : "YYYY-MM";
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const Ce = {
|
|
18
18
|
dayStartOfWeek: 0,
|
|
19
19
|
panelWidth: 265,
|
|
20
20
|
defaultMode: "month",
|
|
21
21
|
headerType: "button",
|
|
22
22
|
modes: ["month", "year"]
|
|
23
23
|
};
|
|
24
|
-
function
|
|
24
|
+
function De(m) {
|
|
25
25
|
const {
|
|
26
26
|
getPrefixCls: y,
|
|
27
|
-
locale:
|
|
28
|
-
componentConfig:
|
|
29
|
-
rtl:
|
|
30
|
-
} =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
locale: k,
|
|
28
|
+
componentConfig: H,
|
|
29
|
+
rtl: L
|
|
30
|
+
} = se(ge), s = de(
|
|
31
|
+
m,
|
|
32
|
+
Ce,
|
|
33
|
+
H?.Calendar
|
|
34
34
|
), {
|
|
35
|
-
style:
|
|
36
|
-
className:
|
|
37
|
-
dayStartOfWeek:
|
|
38
|
-
panel:
|
|
39
|
-
locale:
|
|
40
|
-
panelWidth:
|
|
41
|
-
panelTodayBtn:
|
|
42
|
-
defaultPageShowDate:
|
|
35
|
+
style: O,
|
|
36
|
+
className: T,
|
|
37
|
+
dayStartOfWeek: W,
|
|
38
|
+
panel: d,
|
|
39
|
+
locale: j,
|
|
40
|
+
panelWidth: B,
|
|
41
|
+
panelTodayBtn: E,
|
|
42
|
+
defaultPageShowDate: F,
|
|
43
43
|
value: w,
|
|
44
|
-
pageShowDate:
|
|
45
|
-
defaultValue:
|
|
44
|
+
pageShowDate: R,
|
|
45
|
+
defaultValue: _,
|
|
46
46
|
mode: S,
|
|
47
|
-
defaultMode:
|
|
48
|
-
onChange:
|
|
47
|
+
defaultMode: q,
|
|
48
|
+
onChange: z,
|
|
49
49
|
onPanelChange: c,
|
|
50
50
|
headerRender: P,
|
|
51
|
-
headerType:
|
|
52
|
-
modes:
|
|
53
|
-
panelOperations:
|
|
54
|
-
} = s, l =
|
|
55
|
-
S ||
|
|
56
|
-
), a = S ||
|
|
57
|
-
u(w ||
|
|
58
|
-
), [
|
|
59
|
-
u(
|
|
60
|
-
), t = u(
|
|
51
|
+
headerType: G,
|
|
52
|
+
modes: I,
|
|
53
|
+
panelOperations: J
|
|
54
|
+
} = s, l = re(k.Calendar, j), o = y?.("calendar"), [K, Q] = M(
|
|
55
|
+
S || q
|
|
56
|
+
), a = S || K, i = ye(a, d), [Y, U] = M(
|
|
57
|
+
u(w || _, i)
|
|
58
|
+
), [X, p] = M(
|
|
59
|
+
u(F, i) || Y || A()
|
|
60
|
+
), t = u(R, i) || X, C = "value" in s ? u(w, i) : Y, N = le(() => pe(s, t), [t.toString(), a, W]);
|
|
61
61
|
function f(e) {
|
|
62
|
-
|
|
62
|
+
U(e), z?.(e), v(e);
|
|
63
63
|
}
|
|
64
64
|
function v(e) {
|
|
65
65
|
p(e), c?.(e);
|
|
@@ -69,66 +69,67 @@ function Ce(d) {
|
|
|
69
69
|
}
|
|
70
70
|
let D = "";
|
|
71
71
|
a === "month" ? D = l.formatMonth : a === "year" && (D = l.formatYear);
|
|
72
|
-
function
|
|
72
|
+
function Z(e, n) {
|
|
73
73
|
let h;
|
|
74
74
|
e === "prev" && (h = g.subtract(t, 1, n)), e === "next" && (h = g.add(t, 1, n)), p(h), c?.(h);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function ee(e) {
|
|
77
77
|
const n = g.set(t, "year", e);
|
|
78
78
|
p(n), c?.(n);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function ae(e) {
|
|
81
81
|
const n = g.set(t, "month", e - 1);
|
|
82
82
|
p(n), c?.(n);
|
|
83
83
|
}
|
|
84
84
|
function x(e) {
|
|
85
|
-
|
|
85
|
+
Q(e);
|
|
86
86
|
}
|
|
87
|
-
const
|
|
87
|
+
const oe = me(
|
|
88
88
|
o,
|
|
89
89
|
a === "month" ? `${o}-mode-month` : `${o}-mode-year`,
|
|
90
90
|
{
|
|
91
|
-
[`${o}-panel`]:
|
|
92
|
-
[`${o}-rtl`]:
|
|
91
|
+
[`${o}-panel`]: d && (a === "month" || a === "year"),
|
|
92
|
+
[`${o}-rtl`]: L
|
|
93
93
|
},
|
|
94
|
-
|
|
95
|
-
),
|
|
94
|
+
T
|
|
95
|
+
), te = d ? { width: B } : {}, V = {
|
|
96
96
|
prefixCls: o,
|
|
97
|
-
changePageShowDate:
|
|
97
|
+
changePageShowDate: Z,
|
|
98
98
|
headerValueFormat: D,
|
|
99
99
|
mergedPageShowDate: t,
|
|
100
|
-
modes:
|
|
100
|
+
modes: I,
|
|
101
101
|
innerMode: a,
|
|
102
|
-
panelOperations:
|
|
103
|
-
}
|
|
104
|
-
|
|
102
|
+
panelOperations: J
|
|
103
|
+
}, $ = d ? /* @__PURE__ */ r(ue, { ...V }) : /* @__PURE__ */ r(
|
|
104
|
+
he,
|
|
105
|
+
{
|
|
106
|
+
...V,
|
|
107
|
+
CALENDAR_LOCALE: l,
|
|
108
|
+
move: f,
|
|
109
|
+
innerMode: a,
|
|
110
|
+
changeMode: x,
|
|
111
|
+
onChangeYear: ee,
|
|
112
|
+
onChangeMonth: ae,
|
|
113
|
+
headerType: G
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
return /* @__PURE__ */ ne(
|
|
105
117
|
"div",
|
|
106
118
|
{
|
|
107
|
-
className:
|
|
108
|
-
style: { ...
|
|
109
|
-
...
|
|
119
|
+
className: oe,
|
|
120
|
+
style: { ...O, ...te },
|
|
121
|
+
...ce(s),
|
|
110
122
|
children: [
|
|
111
123
|
typeof P == "function" ? P({
|
|
112
124
|
value: C,
|
|
113
125
|
pageShowDate: t,
|
|
114
126
|
onChangeMode: x,
|
|
115
127
|
onChange: f,
|
|
116
|
-
onChangePageDate: v
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
{
|
|
120
|
-
...V,
|
|
121
|
-
CALENDAR_LOCALE: l,
|
|
122
|
-
move: f,
|
|
123
|
-
innerMode: a,
|
|
124
|
-
changeMode: x,
|
|
125
|
-
onChangeYear: Z,
|
|
126
|
-
onChangeMonth: ee,
|
|
127
|
-
headerType: z
|
|
128
|
-
}
|
|
129
|
-
),
|
|
128
|
+
onChangePageDate: v,
|
|
129
|
+
header: $
|
|
130
|
+
}) : $,
|
|
130
131
|
a === "month" && /* @__PURE__ */ r("div", { className: `${o}-body`, children: /* @__PURE__ */ r(
|
|
131
|
-
|
|
132
|
+
ie,
|
|
132
133
|
{
|
|
133
134
|
...s,
|
|
134
135
|
prefixCls: o,
|
|
@@ -141,7 +142,7 @@ function Ce(d) {
|
|
|
141
142
|
}
|
|
142
143
|
) }),
|
|
143
144
|
a === "year" && /* @__PURE__ */ r("div", { className: `${o}-body`, children: /* @__PURE__ */ r(
|
|
144
|
-
|
|
145
|
+
fe,
|
|
145
146
|
{
|
|
146
147
|
...s,
|
|
147
148
|
prefixCls: o,
|
|
@@ -153,11 +154,11 @@ function Ce(d) {
|
|
|
153
154
|
CALENDAR_LOCALE: l
|
|
154
155
|
}
|
|
155
156
|
) }),
|
|
156
|
-
|
|
157
|
+
E && d && /* @__PURE__ */ r(
|
|
157
158
|
"div",
|
|
158
159
|
{
|
|
159
160
|
className: `${o}-footer-btn-wrapper`,
|
|
160
|
-
onClick: () => f(
|
|
161
|
+
onClick: () => f(A()),
|
|
161
162
|
children: l.today
|
|
162
163
|
}
|
|
163
164
|
)
|
|
@@ -165,9 +166,9 @@ function Ce(d) {
|
|
|
165
166
|
}
|
|
166
167
|
);
|
|
167
168
|
}
|
|
168
|
-
|
|
169
|
+
De.displayName = "Calendar";
|
|
169
170
|
export {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
ie as CalendarMonth,
|
|
172
|
+
fe as CalendarYear,
|
|
173
|
+
De as default
|
|
173
174
|
};
|
package/card/index.js
CHANGED
|
@@ -1,102 +1,122 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as a, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import d, { useContext as q } from "react";
|
|
3
3
|
import "../config-provider/ConfigProvider.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import A from "../components/common/hooks/useMergeProps.js";
|
|
5
|
+
import B from "../spin/index.js";
|
|
6
|
+
import n from "@unicom-cloud/utils/class-name";
|
|
7
|
+
import h from "./Grid.js";
|
|
8
8
|
import $ from "./Meta.js";
|
|
9
|
-
import
|
|
10
|
-
const
|
|
9
|
+
import D from "../config-provider/context.js";
|
|
10
|
+
const H = {
|
|
11
11
|
size: "default",
|
|
12
12
|
bordered: !0
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
const { getPrefixCls: v, loadingElement:
|
|
14
|
+
function I(u, N) {
|
|
15
|
+
const { getPrefixCls: v, loadingElement: y, componentConfig: g, rtl: x } = q(D), b = A(
|
|
16
16
|
u,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
H,
|
|
18
|
+
g?.Card
|
|
19
19
|
), {
|
|
20
20
|
className: M,
|
|
21
21
|
children: z,
|
|
22
22
|
bordered: G,
|
|
23
|
-
loading:
|
|
23
|
+
loading: c,
|
|
24
24
|
hoverable: P,
|
|
25
25
|
size: R,
|
|
26
26
|
title: t,
|
|
27
27
|
extra: o,
|
|
28
|
-
cover:
|
|
29
|
-
actions:
|
|
28
|
+
cover: m,
|
|
29
|
+
actions: s,
|
|
30
30
|
headerStyle: S,
|
|
31
31
|
bodyStyle: j,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
headerClassName: w,
|
|
33
|
+
// 潘启宝添加
|
|
34
|
+
bodyClassName: E,
|
|
35
|
+
// 潘启宝添加
|
|
36
|
+
...F
|
|
37
|
+
} = b, e = v?.("card"), p = s && s.length ? /* @__PURE__ */ a("div", { className: `${e}-actions`, children: /* @__PURE__ */ a("div", { className: `${e}-actions-right`, children: s.map((r, k) => /* @__PURE__ */ a(
|
|
34
38
|
"span",
|
|
35
39
|
{
|
|
36
40
|
className: `${e}-actions-item`,
|
|
37
41
|
children: r
|
|
38
42
|
},
|
|
39
|
-
`action-${
|
|
43
|
+
`action-${k}`
|
|
40
44
|
)) }) }) : null;
|
|
41
|
-
let
|
|
42
|
-
const
|
|
45
|
+
let f = !1, C = !1;
|
|
46
|
+
const L = d.Children.map(
|
|
43
47
|
z,
|
|
44
48
|
(r) => {
|
|
45
49
|
if (r && r.type) {
|
|
46
|
-
if (r.type ===
|
|
47
|
-
|
|
50
|
+
if (r.type === h)
|
|
51
|
+
f = !0;
|
|
48
52
|
else if (r.type === $)
|
|
49
|
-
return
|
|
53
|
+
return C = !0, d.cloneElement(r, { actionList: p });
|
|
50
54
|
}
|
|
51
55
|
return r;
|
|
52
56
|
}
|
|
53
57
|
);
|
|
54
|
-
return /* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */ i(
|
|
55
59
|
"div",
|
|
56
60
|
{
|
|
57
|
-
...
|
|
61
|
+
...F,
|
|
58
62
|
ref: N,
|
|
59
|
-
className:
|
|
63
|
+
className: n(
|
|
60
64
|
e,
|
|
61
65
|
`${e}-size-${R}`,
|
|
62
66
|
{
|
|
63
|
-
[`${e}-loading`]:
|
|
67
|
+
[`${e}-loading`]: c,
|
|
64
68
|
[`${e}-bordered`]: G,
|
|
65
69
|
[`${e}-hoverable`]: P,
|
|
66
|
-
[`${e}-contain-grid`]:
|
|
70
|
+
[`${e}-contain-grid`]: f,
|
|
67
71
|
[`${e}-rtl`]: x
|
|
68
72
|
},
|
|
69
73
|
M
|
|
70
74
|
),
|
|
71
75
|
children: [
|
|
72
|
-
t || o ? /* @__PURE__ */
|
|
76
|
+
t || o ? /* @__PURE__ */ i(
|
|
73
77
|
"div",
|
|
74
78
|
{
|
|
75
|
-
className: h(`${e}-header`, {
|
|
76
|
-
[`${e}-header-no-title`]: !t
|
|
77
|
-
}),
|
|
78
79
|
style: S,
|
|
80
|
+
className: n(
|
|
81
|
+
`${e}-header`,
|
|
82
|
+
{
|
|
83
|
+
[`${e}-header-no-title`]: !t
|
|
84
|
+
},
|
|
85
|
+
w
|
|
86
|
+
// 潘启宝添加
|
|
87
|
+
),
|
|
79
88
|
children: [
|
|
80
89
|
t && /* @__PURE__ */ a("div", { className: `${e}-header-title`, children: t }),
|
|
81
90
|
o && /* @__PURE__ */ a("div", { className: `${e}-header-extra`, children: o })
|
|
82
91
|
]
|
|
83
92
|
}
|
|
84
93
|
) : null,
|
|
85
|
-
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
m ? /* @__PURE__ */ a("div", { className: `${e}-cover`, children: m }) : null,
|
|
95
|
+
/* @__PURE__ */ i(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
style: j,
|
|
99
|
+
className: n(
|
|
100
|
+
`${e}-body`,
|
|
101
|
+
E
|
|
102
|
+
// 潘启宝添加
|
|
103
|
+
),
|
|
104
|
+
children: [
|
|
105
|
+
c ? y || /* @__PURE__ */ a(B, {}) : L,
|
|
106
|
+
C ? null : p
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
)
|
|
90
110
|
]
|
|
91
111
|
}
|
|
92
112
|
);
|
|
93
113
|
}
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
114
|
+
const J = d.forwardRef(I), l = J;
|
|
115
|
+
l.Meta = $;
|
|
116
|
+
l.Grid = h;
|
|
117
|
+
l.displayName = "Card";
|
|
98
118
|
export {
|
|
99
|
-
|
|
119
|
+
h as CardGrid,
|
|
100
120
|
$ as CardMeta,
|
|
101
|
-
|
|
121
|
+
l as default
|
|
102
122
|
};
|
package/color-picker/InputHex.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsxs as C, jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import { TinyColor as m } from "../dist/tinycolor/src/index.js";
|
|
2
|
+
import m from "@unicom-cloud/utils/tinycolor";
|
|
4
3
|
import { useContext as v, useState as I, useEffect as j } from "react";
|
|
5
4
|
import "../config-provider/ConfigProvider.js";
|
|
6
5
|
import c from "../input/Input.js";
|
|
7
6
|
import { InputAlpha as D } from "./InputAlpha.js";
|
|
8
7
|
import H from "../config-provider/context.js";
|
|
9
|
-
const
|
|
8
|
+
const N = ({
|
|
10
9
|
color: o,
|
|
11
10
|
alpha: f,
|
|
12
11
|
onHsvChange: u,
|
|
@@ -52,5 +51,5 @@ const T = ({
|
|
|
52
51
|
] });
|
|
53
52
|
};
|
|
54
53
|
export {
|
|
55
|
-
|
|
54
|
+
N as InputHex
|
|
56
55
|
};
|
package/color-picker/InputRgb.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { jsxs as h, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import { TinyColor as f } from "../dist/tinycolor/src/index.js";
|
|
2
|
+
import f from "@unicom-cloud/utils/tinycolor";
|
|
4
3
|
import { useContext as x } from "react";
|
|
5
4
|
import "../config-provider/ConfigProvider.js";
|
|
6
5
|
import b from "../input/Input.js";
|
|
7
6
|
import m from "../input-number/index.js";
|
|
8
7
|
import { InputAlpha as I } from "./InputAlpha.js";
|
|
9
8
|
import d from "../config-provider/context.js";
|
|
10
|
-
const
|
|
9
|
+
const H = ({
|
|
11
10
|
color: p,
|
|
12
11
|
alpha: s,
|
|
13
12
|
onHsvChange: u,
|
|
14
|
-
onAlphaChange:
|
|
15
|
-
disabledAlpha:
|
|
13
|
+
onAlphaChange: c,
|
|
14
|
+
disabledAlpha: C
|
|
16
15
|
}) => {
|
|
17
|
-
const { getPrefixCls:
|
|
16
|
+
const { getPrefixCls: a } = x(d), g = a?.("color-picker"), r = (o) => {
|
|
18
17
|
const l = new f({
|
|
19
18
|
r: o.r,
|
|
20
19
|
g: o.g,
|
|
@@ -56,9 +55,9 @@ const P = ({
|
|
|
56
55
|
onChange: (o) => r({ r: t, g: e, b: o })
|
|
57
56
|
}
|
|
58
57
|
),
|
|
59
|
-
!
|
|
58
|
+
!C && /* @__PURE__ */ n(I, { value: s, onChange: c })
|
|
60
59
|
] });
|
|
61
60
|
};
|
|
62
61
|
export {
|
|
63
|
-
|
|
62
|
+
H as InputRgb
|
|
64
63
|
};
|
package/color-picker/Palette.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import { TinyColor as u } from "../dist/tinycolor/src/index.js";
|
|
2
|
+
import u from "@unicom-cloud/utils/tinycolor";
|
|
4
3
|
import { useContext as d, useMemo as h } from "react";
|
|
5
4
|
import "../config-provider/ConfigProvider.js";
|
|
6
5
|
import { useControlBlock as g } from "./hooks/useControlBlock.js";
|
|
7
6
|
import x from "../config-provider/context.js";
|
|
8
|
-
const
|
|
7
|
+
const w = ({ color: l, onChange: c }) => {
|
|
9
8
|
const { getPrefixCls: i } = d(x), e = i?.("color-picker"), { h: r, s: t, v: n } = l.hsv, { blockRef: m, handlerRef: f, onMouseDown: a } = g({
|
|
10
9
|
value: [t, 1 - n],
|
|
11
10
|
onChange: (o) => c(o[0], 1 - o[1])
|
|
@@ -32,5 +31,5 @@ const M = ({ color: l, onChange: c }) => {
|
|
|
32
31
|
);
|
|
33
32
|
};
|
|
34
33
|
export {
|
|
35
|
-
|
|
34
|
+
w as Palette
|
|
36
35
|
};
|
package/color-picker/Panel.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import { TinyColor as d } from "../dist/tinycolor/src/index.js";
|
|
2
|
+
import d from "@unicom-cloud/utils/tinycolor";
|
|
4
3
|
import { useContext as cr, useState as ar, useMemo as sr } from "react";
|
|
5
4
|
import "../config-provider/ConfigProvider.js";
|
|
6
5
|
import k from "../radio/Radio.js";
|
|
@@ -16,7 +15,7 @@ import { isMultiMode as X, isGradientMode as _ } from "./Mode.js";
|
|
|
16
15
|
import { Palette as gr } from "./Palette.js";
|
|
17
16
|
import { renderBackground as br, sortGradientColors as D, getColorByGradients as fr } from "./utils.js";
|
|
18
17
|
import vr from "../config-provider/context.js";
|
|
19
|
-
const hr = k.Group,
|
|
18
|
+
const hr = k.Group, qr = ({
|
|
20
19
|
value: F,
|
|
21
20
|
mode: y,
|
|
22
21
|
activeMode: h,
|
|
@@ -264,5 +263,5 @@ const hr = k.Group, Er = ({
|
|
|
264
263
|
] });
|
|
265
264
|
};
|
|
266
265
|
export {
|
|
267
|
-
|
|
266
|
+
qr as Panel
|
|
268
267
|
};
|
package/color-picker/colors.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
new
|
|
1
|
+
import t from "@unicom-cloud/utils/tinycolor";
|
|
2
|
+
import * as e from "@unicom-cloud/utils/ui-color";
|
|
3
|
+
new t("#eee");
|
|
4
4
|
const i = [
|
|
5
|
-
e.colors.map((o, r,
|
|
6
|
-
e.colors.map((o, r,
|
|
5
|
+
e.colors.map((o, r, l) => e.palette({ color: o.value, level: 4 }).toHexString()),
|
|
6
|
+
e.colors.map((o, r, l) => o.value)
|
|
7
7
|
// '#00B42A',
|
|
8
8
|
// '#3C7EFF',
|
|
9
9
|
// '#FF7D00',
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import { TinyColor as P } from "../../dist/tinycolor/src/index.js";
|
|
1
|
+
import P from "@unicom-cloud/utils/tinycolor";
|
|
3
2
|
import { useState as C, useRef as k, useMemo as G, useCallback as F, useEffect as M } from "react";
|
|
4
3
|
import Z from "../../components/common/hooks/useIsFirstRender.js";
|
|
5
4
|
import q from "../../components/common/hooks/useMergeValue.js";
|
|
6
5
|
import { ColorPickerMode as y } from "../interface.js";
|
|
7
6
|
import { getModeByValue as $, isGradientMode as H, isSingleMode as w } from "../Mode.js";
|
|
8
7
|
import { mapValueToGradientColor as ee, getColorFromHsv as E, formatRgba as oe, formatHex as te, isEqualsColors as re, equalsHsv as ne, getRandomId as T } from "../utils.js";
|
|
9
|
-
const
|
|
8
|
+
const ge = (s) => {
|
|
10
9
|
const {
|
|
11
10
|
mode: B = y.Single,
|
|
12
11
|
defaultValue: j,
|
|
@@ -121,5 +120,5 @@ const Ce = (s) => {
|
|
|
121
120
|
};
|
|
122
121
|
};
|
|
123
122
|
export {
|
|
124
|
-
|
|
123
|
+
ge as useColorPicker
|
|
125
124
|
};
|
package/color-picker/utils.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import "
|
|
2
|
-
|
|
3
|
-
const G = (t) => t.sort((r, n) => r.percent - n.percent), H = (t, r, n) => Object.keys(t).reduce(
|
|
1
|
+
import s from "@unicom-cloud/utils/tinycolor";
|
|
2
|
+
const R = (t) => t.sort((r, n) => r.percent - n.percent), H = (t, r, n) => Object.keys(t).reduce(
|
|
4
3
|
(e, o) => ({
|
|
5
4
|
...e,
|
|
6
5
|
[o]: t[o] + (r[o] - t[o]) * n
|
|
7
6
|
}),
|
|
8
7
|
{ ...t }
|
|
9
|
-
), b = (t) => t.map(({ color: r, percent: n }) => `${r} ${n}%`).join(", "), w = (t) => `linear-gradient(to right, ${b(t)})`,
|
|
8
|
+
), b = (t) => t.map(({ color: r, percent: n }) => `${r} ${n}%`).join(", "), w = (t) => `linear-gradient(to right, ${b(t)})`, G = (t) => Array.isArray(t) ? w(t) : t, k = (t, r, n, e) => e < 1 ? `rgba(${t}, ${r}, ${n}, ${e.toFixed(2)})` : `rgb(${t}, ${r}, ${n})`, q = (t, r, n, e) => e < 1 ? new s({ r: t, g: r, b: n, a: e }).toHexString() : new s({ r: t, g: r, b: n }).toHexString(), p = (t) => {
|
|
10
9
|
const r = new s({
|
|
11
10
|
h: t.h * 360,
|
|
12
11
|
s: t.s * 100,
|
|
@@ -17,7 +16,7 @@ const G = (t) => t.sort((r, n) => r.percent - n.percent), H = (t, r, n) => Objec
|
|
|
17
16
|
rgb: n,
|
|
18
17
|
hex: e
|
|
19
18
|
};
|
|
20
|
-
}, c = () => Math.random().toFixed(10).slice(2),
|
|
19
|
+
}, c = () => Math.random().toFixed(10).slice(2), A = (t, r) => t.map((n) => {
|
|
21
20
|
const e = new s(n.color).toHsv_();
|
|
22
21
|
return {
|
|
23
22
|
id: c(),
|
|
@@ -25,7 +24,7 @@ const G = (t) => t.sort((r, n) => r.percent - n.percent), H = (t, r, n) => Objec
|
|
|
25
24
|
alpha: r ? 100 : e.a,
|
|
26
25
|
percent: n.percent
|
|
27
26
|
};
|
|
28
|
-
}),
|
|
27
|
+
}), F = (t, r, n) => {
|
|
29
28
|
const e = t.findIndex((a) => a.percent === r);
|
|
30
29
|
if (e !== -1)
|
|
31
30
|
return {
|
|
@@ -65,7 +64,7 @@ const G = (t) => t.sort((r, n) => r.percent - n.percent), H = (t, r, n) => Objec
|
|
|
65
64
|
alpha: v,
|
|
66
65
|
percent: r
|
|
67
66
|
};
|
|
68
|
-
},
|
|
67
|
+
}, S = (t, r) => t.h === r.h && t.s === r.s && t.v === r.v, C = (t, r) => t.r === r.r && t.g === r.g && t.b === r.b && t.a === r.a, j = (t, r) => typeof t == "string" && typeof r == "string" ? t === r : Array.isArray(t) && Array.isArray(r) ? t.length === r.length && t.every((n, e) => {
|
|
69
68
|
const o = r[e];
|
|
70
69
|
return C(
|
|
71
70
|
new s(n.color).toRgba(),
|
|
@@ -73,18 +72,18 @@ const G = (t) => t.sort((r, n) => r.percent - n.percent), H = (t, r, n) => Objec
|
|
|
73
72
|
) && n.percent === o.percent;
|
|
74
73
|
}) : !1;
|
|
75
74
|
export {
|
|
76
|
-
|
|
75
|
+
S as equalsHsv,
|
|
77
76
|
C as equalsRgba,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
q as formatHex,
|
|
78
|
+
k as formatRgba,
|
|
79
|
+
F as getColorByGradients,
|
|
81
80
|
p as getColorFromHsv,
|
|
82
81
|
b as getGradientString,
|
|
83
82
|
c as getRandomId,
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
j as isEqualsColors,
|
|
84
|
+
A as mapValueToGradientColor,
|
|
86
85
|
H as mix,
|
|
87
|
-
|
|
86
|
+
G as renderBackground,
|
|
88
87
|
w as renderGradientBackground,
|
|
89
|
-
|
|
88
|
+
R as sortGradientColors
|
|
90
89
|
};
|