react-kui 3.2.1 → 3.3.0
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/ai/kui-components.json +819 -162
- package/es/_virtual/_rolldown/runtime.js +2 -3
- package/es/affix/index.js +73 -185
- package/es/alert/index.js +3 -4
- package/es/anchor/anchor-context.js +2 -3
- package/es/anchor/anchor-link.js +3 -4
- package/es/anchor/anchor.js +195 -398
- package/es/auto-complete/index.js +160 -561
- package/es/avatar/avatar-group-context.js +2 -3
- package/es/avatar/avatar-group.js +32 -124
- package/es/avatar/avatar.js +58 -159
- package/es/back-top/index.js +66 -201
- package/es/badge/index.js +4 -5
- package/es/base/teleport.js +22 -54
- package/es/base/transition-props.js +2 -3
- package/es/base/transition.js +2 -3
- package/es/breadcrumb/breadcrumb-context.js +2 -3
- package/es/breadcrumb/breadcrumb-item.js +19 -102
- package/es/breadcrumb/breadcrumb.js +10 -59
- package/es/button/button-group-context.js +2 -3
- package/es/button/button-group.js +15 -75
- package/es/button/button.js +4 -5
- package/es/calendar/index.js +4 -5
- package/es/card/index.js +4 -5
- package/es/carousel/carousel-context.js +2 -3
- package/es/carousel/carousel-item.js +3 -4
- package/es/carousel/carousel.js +281 -628
- package/es/carousel/drag.js +2 -3
- package/es/cascader/index.js +7 -8
- package/es/check-card/check-card-group.js +53 -179
- package/es/check-card/check-card.js +100 -293
- package/es/check-card/context.js +2 -3
- package/es/checkbox/checkbox-group-context.js +2 -3
- package/es/checkbox/checkbox-group.js +34 -138
- package/es/checkbox/checkbox.js +4 -5
- package/es/checkbox/index.js +2 -3
- package/es/collapse/collapse-panel.js +84 -206
- package/es/collapse/collapse.js +38 -170
- package/es/color-picker/alpha.js +44 -125
- package/es/color-picker/hue.js +39 -108
- package/es/color-picker/index.js +7 -6
- package/es/color-picker/mode.js +76 -159
- package/es/color-picker/paint.js +66 -163
- package/es/color-picker/presets.js +12 -44
- package/es/components.js +37 -32
- package/es/config/config-context.js +2 -3
- package/es/config/context.js +2 -3
- package/es/config/index.js +3 -4
- package/es/config/popup-host.js +3 -4
- package/es/config/size-context.js +2 -3
- package/es/config/use-config-appearance.js +3 -4
- package/es/const/var.js +2 -3
- package/es/date-picker/index.js +8 -9
- package/es/descriptions/descriptions-item.js +3 -4
- package/es/descriptions/descriptions.js +53 -144
- package/es/divider/index.js +2 -3
- package/es/drawer/index.js +171 -465
- package/es/dropdown/dropdown-button.js +25 -128
- package/es/dropdown/dropdown-context.js +2 -3
- package/es/dropdown/dropdown.js +56 -207
- package/es/dropdown/trigger.js +37 -125
- package/es/empty/index.js +34 -111
- package/es/feature-card/index.js +2 -3
- package/es/feedback-panel/index.js +30 -155
- package/es/flame-wrap/index.js +3 -4
- package/es/flame-wrap/types.js +2 -3
- package/es/flex/index.js +2 -3
- package/es/form/field-context.js +3 -4
- package/es/form/form-context.js +2 -3
- package/es/form/form-item.js +4 -5
- package/es/form/form.js +108 -279
- package/es/form/utils.js +2 -3
- package/es/gradient-picker/corners.js +55 -0
- package/es/gradient-picker/index.js +191 -0
- package/es/gradient-picker/stops.js +219 -0
- package/es/gradient-picker/types.js +147 -0
- package/es/grid/grid-item.js +25 -116
- package/es/grid/grid.js +40 -151
- package/es/grid/useBreakpoint.js +3 -4
- package/es/icon/index.js +24 -126
- package/es/image/group.js +3 -4
- package/es/image/image-group-context.js +2 -3
- package/es/image/image.js +5 -6
- package/es/image/instance.js +2 -3
- package/es/image/preview.js +4 -5
- package/es/image/utils.js +2 -3
- package/es/index.js +5 -4
- package/es/input/index.js +2 -3
- package/es/input/input-base.js +4 -5
- package/es/input/input-box.js +2 -3
- package/es/input/input-group.js +4 -5
- package/es/input/input.js +3 -4
- package/es/input/textarea.js +3 -4
- package/es/input-number/drag.js +63 -0
- package/es/input-number/index.js +41 -11
- package/es/input-otp/index.js +3 -4
- package/es/input-tag/index.js +5 -6
- package/es/kanban/index.js +31 -168
- package/es/layout/index.js +43 -215
- package/es/layout/layout-context.js +2 -3
- package/es/list-panel/index.js +47 -185
- package/es/loading/index.js +2 -3
- package/es/loading/loading-bar.js +54 -114
- package/es/locale/de.js +2 -3
- package/es/locale/el.js +2 -3
- package/es/locale/en.js +2 -3
- package/es/locale/fr.js +2 -3
- package/es/locale/it.js +2 -3
- package/es/locale/ja.js +2 -3
- package/es/locale/ko.js +2 -3
- package/es/locale/ru.js +2 -3
- package/es/locale/th.js +2 -3
- package/es/locale/uk.js +2 -3
- package/es/locale/vi.js +2 -3
- package/es/locale/zh-CN.js +2 -3
- package/es/locale/zh-TW.js +2 -3
- package/es/mentions/index.js +214 -581
- package/es/menu/menu-context.js +2 -3
- package/es/menu/menu-divider.js +3 -4
- package/es/menu/menu-group.js +3 -4
- package/es/menu/menu-item.js +2 -3
- package/es/menu/menu-keyboard.js +2 -3
- package/es/menu/menu.js +184 -442
- package/es/menu/recursive-menu.js +3 -4
- package/es/menu/sub-menu.js +5 -6
- package/es/message/index.js +2 -3
- package/es/modal/api.js +2 -3
- package/es/modal/modal.js +263 -599
- package/es/modal/toast.js +63 -179
- package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +2 -3
- package/es/notice/container.js +2 -3
- package/es/notice/content.js +4 -5
- package/es/notice/index.js +2 -3
- package/es/notice/instance.js +2 -3
- package/es/page/index.js +4 -5
- package/es/page/responsive.js +2 -3
- package/es/page-header/index.js +3 -4
- package/es/popconfirm/index.js +24 -70
- package/es/poptip/index.js +29 -88
- package/es/popup/index.js +8 -6
- package/es/popup/layers.js +2 -3
- package/es/progress/index.js +95 -229
- package/es/qrcode/index.js +3 -4
- package/es/radio/radio-button.js +37 -131
- package/es/radio/radio-group-context.js +2 -3
- package/es/radio/radio-group.js +69 -223
- package/es/radio/radio.js +3 -4
- package/es/rate/index.js +68 -226
- package/es/rate/star.js +38 -129
- package/es/result/index.js +35 -127
- package/es/ripple/index.js +3 -4
- package/es/ripple/types.js +2 -3
- package/es/row-col/col.js +59 -149
- package/es/row-col/row.js +2 -3
- package/es/segmented/index.js +66 -210
- package/es/select/option.js +23 -116
- package/es/select/select.js +9 -10
- package/es/skeleton/skeleton-avatar.js +2 -3
- package/es/skeleton/skeleton-button.js +2 -3
- package/es/skeleton/skeleton-image.js +28 -108
- package/es/skeleton/skeleton-text.js +17 -93
- package/es/skeleton/skeleton.js +46 -133
- package/es/skeleton/use-skeleton-loading.js +3 -4
- package/es/slider/index.js +92 -286
- package/es/slider/thumb.js +43 -133
- package/es/space/index.js +3 -4
- package/es/spin/index.js +2 -3
- package/es/splitter/splitter-panel.js +3 -4
- package/es/splitter/splitter.js +77 -219
- package/es/stat-card/countup.js +46 -141
- package/es/stat-card/rollup.js +27 -105
- package/es/stat-card/stat-card.js +3 -4
- package/es/stat-card/stat-number.js +26 -113
- package/es/stat-card/utils/countup.js +2 -3
- package/es/stat-card/utils/odometer.js +2 -3
- package/es/stat-card/utils/stat-item-key.js +2 -3
- package/es/steps/index.js +45 -123
- package/es/switch/index.js +4 -5
- package/es/table/column-setting.js +43 -139
- package/es/table/index.js +8 -9
- package/es/table/utils.js +2 -3
- package/es/tabs/tab-panel.js +19 -71
- package/es/tabs/tabs.js +6 -7
- package/es/tag/index.js +4 -5
- package/es/time-line/timeline-item.js +3 -4
- package/es/time-line/timeline.js +8 -44
- package/es/tooltip/index.js +41 -142
- package/es/tour/index.js +138 -356
- package/es/transfer/index.js +184 -487
- package/es/tree/index.js +8 -9
- package/es/tree/utils.js +2 -3
- package/es/tree-select/index.js +8 -9
- package/es/typography/index.js +75 -306
- package/es/upload/file-list.js +95 -119
- package/es/upload/index.js +8 -9
- package/es/upload/picture-sort.js +2 -3
- package/es/upload/selector.js +63 -193
- package/es/utils/checked.js +2 -3
- package/es/utils/color.js +2 -3
- package/es/utils/css.js +2 -3
- package/es/utils/focus.js +2 -3
- package/es/utils/number.js +2 -3
- package/es/utils/overlay-order.js +2 -3
- package/es/utils/overlay-stack.js +3 -4
- package/es/utils/placement.js +16 -4
- package/es/utils/popup-arrow.js +45 -0
- package/es/utils/popup.js +2 -3
- package/es/utils/promise.js +2 -3
- package/es/utils/react-node.js +2 -3
- package/es/utils/selection-tags.js +2 -3
- package/es/utils/share.js +2 -3
- package/es/utils/theme.js +2 -3
- package/es/utils/transition.js +2 -3
- package/es/utils/use-value.js +3 -4
- package/es/virtual-list/index.js +49 -187
- package/es/virtual-list/range.js +2 -3
- package/es/watermark/index.js +149 -289
- package/lib/index.cjs +2 -2
- package/lib/locale/de.cjs +1 -1
- package/lib/locale/el.cjs +1 -1
- package/lib/locale/en.cjs +1 -1
- package/lib/locale/fr.cjs +1 -1
- package/lib/locale/it.cjs +1 -1
- package/lib/locale/ja.cjs +1 -1
- package/lib/locale/ko.cjs +1 -1
- package/lib/locale/ru.cjs +1 -1
- package/lib/locale/th.cjs +1 -1
- package/lib/locale/uk.cjs +1 -1
- package/lib/locale/vi.cjs +1 -1
- package/lib/locale/zh-CN.cjs +1 -1
- package/lib/locale/zh-TW.cjs +1 -1
- package/package.json +24 -24
- package/style/base.css +1 -1
- package/style/components.css +2 -2
- package/style/index.css +2 -2
- package/style/theme.css +1 -1
- package/types/affix/index.d.cts +1 -1
- package/types/affix/index.d.ts +1 -1
- package/types/anchor/anchor-link.d.cts +1 -1
- package/types/anchor/anchor-link.d.ts +1 -1
- package/types/anchor/anchor.d.cts +1 -1
- package/types/anchor/anchor.d.ts +1 -1
- package/types/back-top/index.d.cts +1 -1
- package/types/back-top/index.d.ts +1 -1
- package/types/carousel/carousel-item.d.cts +1 -1
- package/types/carousel/carousel-item.d.ts +1 -1
- package/types/cascader/index.d.cts +1 -1
- package/types/cascader/index.d.ts +1 -1
- package/types/color-picker/alpha.d.cts +1 -1
- package/types/color-picker/alpha.d.ts +1 -1
- package/types/color-picker/hue.d.cts +1 -1
- package/types/color-picker/hue.d.ts +1 -1
- package/types/color-picker/index.d.cts +3 -2
- package/types/color-picker/index.d.ts +3 -2
- package/types/color-picker/mode.d.cts +1 -1
- package/types/color-picker/mode.d.ts +1 -1
- package/types/color-picker/paint.d.cts +1 -1
- package/types/color-picker/paint.d.ts +1 -1
- package/types/color-picker/presets.d.cts +1 -1
- package/types/color-picker/presets.d.ts +1 -1
- package/types/components.d.cts +3 -0
- package/types/components.d.ts +3 -0
- package/types/date-picker/index.d.cts +2 -2
- package/types/date-picker/index.d.ts +2 -2
- package/types/feature-card/index.d.cts +1 -1
- package/types/feature-card/index.d.ts +1 -1
- package/types/feedback-panel/index.d.cts +1 -1
- package/types/feedback-panel/index.d.ts +1 -1
- package/types/flame-wrap/index.d.cts +1 -1
- package/types/flame-wrap/index.d.ts +1 -1
- package/types/form/form-item.d.cts +1 -1
- package/types/form/form-item.d.ts +1 -1
- package/types/gradient-picker/corners.d.cts +8 -0
- package/types/gradient-picker/corners.d.ts +8 -0
- package/types/gradient-picker/index.d.cts +25 -0
- package/types/gradient-picker/index.d.ts +25 -0
- package/types/gradient-picker/stops.d.cts +12 -0
- package/types/gradient-picker/stops.d.ts +12 -0
- package/types/gradient-picker/types.d.cts +34 -0
- package/types/gradient-picker/types.d.ts +34 -0
- package/types/grid/grid-item.d.cts +1 -1
- package/types/grid/grid-item.d.ts +1 -1
- package/types/grid/grid.d.cts +1 -1
- package/types/grid/grid.d.ts +1 -1
- package/types/image/group.d.cts +1 -1
- package/types/image/group.d.ts +1 -1
- package/types/input-number/drag.d.cts +9 -0
- package/types/input-number/drag.d.ts +9 -0
- package/types/input-number/index.d.cts +1 -0
- package/types/input-number/index.d.ts +1 -0
- package/types/kanban/index.d.cts +1 -1
- package/types/kanban/index.d.ts +1 -1
- package/types/list-panel/index.d.cts +1 -1
- package/types/list-panel/index.d.ts +1 -1
- package/types/loading/loading-bar.d.cts +1 -1
- package/types/loading/loading-bar.d.ts +1 -1
- package/types/modal/toast.d.cts +1 -1
- package/types/modal/toast.d.ts +1 -1
- package/types/notice/content.d.cts +2 -2
- package/types/notice/content.d.ts +2 -2
- package/types/page-header/index.d.cts +1 -1
- package/types/page-header/index.d.ts +1 -1
- package/types/popconfirm/index.d.cts +1 -0
- package/types/popconfirm/index.d.ts +1 -0
- package/types/poptip/index.d.cts +1 -0
- package/types/poptip/index.d.ts +1 -0
- package/types/popup/index.d.cts +1 -0
- package/types/popup/index.d.ts +1 -0
- package/types/result/index.d.cts +1 -1
- package/types/result/index.d.ts +1 -1
- package/types/ripple/index.d.cts +1 -1
- package/types/ripple/index.d.ts +1 -1
- package/types/slider/index.d.cts +1 -1
- package/types/slider/index.d.ts +1 -1
- package/types/splitter/splitter-panel.d.cts +1 -1
- package/types/splitter/splitter-panel.d.ts +1 -1
- package/types/splitter/splitter.d.cts +1 -1
- package/types/splitter/splitter.d.ts +1 -1
- package/types/stat-card/countup.d.cts +1 -1
- package/types/stat-card/countup.d.ts +1 -1
- package/types/stat-card/rollup.d.cts +1 -1
- package/types/stat-card/rollup.d.ts +1 -1
- package/types/stat-card/stat-card.d.cts +1 -1
- package/types/stat-card/stat-card.d.ts +1 -1
- package/types/stat-card/stat-number.d.cts +1 -1
- package/types/stat-card/stat-number.d.ts +1 -1
- package/types/table/column-setting.d.cts +1 -1
- package/types/table/column-setting.d.ts +1 -1
- package/types/table/index.d.cts +1 -1
- package/types/table/index.d.ts +1 -1
- package/types/time-line/timeline-item.d.cts +1 -1
- package/types/time-line/timeline-item.d.ts +1 -1
- package/types/time-line/timeline.d.cts +1 -1
- package/types/time-line/timeline.d.ts +1 -1
- package/types/tooltip/index.d.cts +1 -0
- package/types/tooltip/index.d.ts +1 -0
- package/types/transfer/index.d.cts +1 -1
- package/types/transfer/index.d.ts +1 -1
- package/types/tree-select/index.d.cts +1 -1
- package/types/tree-select/index.d.ts +1 -1
- package/types/upload/file-list.d.cts +1 -1
- package/types/upload/file-list.d.ts +1 -1
- package/types/upload/selector.d.cts +1 -1
- package/types/upload/selector.d.ts +1 -1
- package/types/utils/placement.d.cts +2 -1
- package/types/utils/placement.d.ts +2 -1
- package/types/utils/popup-arrow.d.cts +5 -0
- package/types/utils/popup-arrow.d.ts +5 -0
- package/types/utils/selection-tags.d.cts +1 -1
- package/types/utils/selection-tags.d.ts +1 -1
- package/types/watermark/index.d.cts +1 -1
- package/types/watermark/index.d.ts +1 -1
package/es/color-picker/paint.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.3.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -7,187 +7,90 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { clamp } from "../utils/share.js";
|
|
10
|
-
import { c } from "react/compiler-runtime";
|
|
11
10
|
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
12
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
12
|
import Color from "color";
|
|
14
|
-
|
|
15
|
-
function Paint(
|
|
16
|
-
const $ = c(29);
|
|
17
|
-
const { disabled: t1, hue: t2, value, onUpdateRGB } = t0;
|
|
18
|
-
const disabled = t1 === void 0 ? false : t1;
|
|
19
|
-
const hue = t2 === void 0 ? 0 : t2;
|
|
13
|
+
// components/color-picker/paint.tsx
|
|
14
|
+
function Paint({ disabled = false, hue = 0, value, onUpdateRGB }) {
|
|
20
15
|
const canvasRef = useRef(null);
|
|
21
|
-
const dragCleanupRef = useRef(
|
|
16
|
+
const dragCleanupRef = useRef(() => void 0);
|
|
22
17
|
const draggingRef = useRef(false);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
const hsv = Color(value).hsv().object();
|
|
19
|
+
const [dotPosition, setDotPosition] = useState(() => ({
|
|
20
|
+
x: hsv.s / 100 * 234 - 7,
|
|
21
|
+
y: (1 - hsv.v / 100) * 136 - 7
|
|
22
|
+
}));
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const canvas = canvasRef.current, context = canvas?.getContext("2d");
|
|
25
|
+
if (!canvas || !context) return;
|
|
26
|
+
context.fillStyle = `hsl(${hue},100%,50%)`;
|
|
27
|
+
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
28
|
+
const white = context.createLinearGradient(0, 0, canvas.width, 0);
|
|
29
|
+
white.addColorStop(0, "#fff");
|
|
30
|
+
white.addColorStop(1, "rgba(255,255,255,0)");
|
|
31
|
+
context.fillStyle = white;
|
|
32
|
+
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
33
|
+
const black = context.createLinearGradient(0, 0, 0, canvas.height);
|
|
34
|
+
black.addColorStop(0, "rgba(0,0,0,0)");
|
|
35
|
+
black.addColorStop(1, "#000");
|
|
36
|
+
context.fillStyle = black;
|
|
37
|
+
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
38
|
+
}, [hue]);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (draggingRef.current) return;
|
|
41
|
+
const rect = canvasRef.current?.getBoundingClientRect();
|
|
42
|
+
if (!rect) return;
|
|
43
|
+
setDotPosition({
|
|
44
|
+
x: hsv.s / 100 * rect.width - 7,
|
|
45
|
+
y: (1 - hsv.v / 100) * rect.height - 7
|
|
35
46
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const white = context.createLinearGradient(0, 0, canvas.width, 0);
|
|
51
|
-
white.addColorStop(0, "#fff");
|
|
52
|
-
white.addColorStop(1, "rgba(255,255,255,0)");
|
|
53
|
-
context.fillStyle = white;
|
|
54
|
-
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
55
|
-
const black = context.createLinearGradient(0, 0, 0, canvas.height);
|
|
56
|
-
black.addColorStop(0, "rgba(0,0,0,0)");
|
|
57
|
-
black.addColorStop(1, "#000");
|
|
58
|
-
context.fillStyle = black;
|
|
59
|
-
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
60
|
-
};
|
|
61
|
-
t6 = [hue];
|
|
62
|
-
$[5] = hue;
|
|
63
|
-
$[6] = t5;
|
|
64
|
-
$[7] = t6;
|
|
65
|
-
} else {
|
|
66
|
-
t5 = $[6];
|
|
67
|
-
t6 = $[7];
|
|
68
|
-
}
|
|
69
|
-
useEffect(t5, t6);
|
|
70
|
-
let t7;
|
|
71
|
-
let t8;
|
|
72
|
-
if ($[8] !== hsv.s || $[9] !== hsv.v) {
|
|
73
|
-
t7 = () => {
|
|
74
|
-
if (draggingRef.current) return;
|
|
75
|
-
const rect = canvasRef.current?.getBoundingClientRect();
|
|
76
|
-
if (!rect) return;
|
|
47
|
+
}, [hsv.s, hsv.v]);
|
|
48
|
+
useEffect(() => () => dragCleanupRef.current(), []);
|
|
49
|
+
useLayoutEffect(() => {
|
|
50
|
+
if (disabled) dragCleanupRef.current();
|
|
51
|
+
}, [disabled]);
|
|
52
|
+
const start = (event) => {
|
|
53
|
+
if (disabled) return;
|
|
54
|
+
draggingRef.current = true;
|
|
55
|
+
const move = (x, y) => {
|
|
56
|
+
const rect_0 = canvasRef.current.getBoundingClientRect();
|
|
57
|
+
const localX = clamp(x - rect_0.left, 0, rect_0.width);
|
|
58
|
+
const localY = clamp(y - rect_0.top, 0, rect_0.height);
|
|
59
|
+
const saturation = localX / rect_0.width * 100;
|
|
60
|
+
const brightness = (1 - localY / rect_0.height) * 100;
|
|
77
61
|
setDotPosition({
|
|
78
|
-
x:
|
|
79
|
-
y:
|
|
62
|
+
x: localX - 7,
|
|
63
|
+
y: localY - 7
|
|
80
64
|
});
|
|
65
|
+
onUpdateRGB?.(Color().hsv(hue, saturation, brightness).rgb().object());
|
|
81
66
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
t8 = $[11];
|
|
90
|
-
}
|
|
91
|
-
useEffect(t7, t8);
|
|
92
|
-
let t10;
|
|
93
|
-
let t9;
|
|
94
|
-
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
95
|
-
t9 = () => () => dragCleanupRef.current();
|
|
96
|
-
t10 = [];
|
|
97
|
-
$[12] = t10;
|
|
98
|
-
$[13] = t9;
|
|
99
|
-
} else {
|
|
100
|
-
t10 = $[12];
|
|
101
|
-
t9 = $[13];
|
|
102
|
-
}
|
|
103
|
-
useEffect(t9, t10);
|
|
104
|
-
let t11;
|
|
105
|
-
let t12;
|
|
106
|
-
if ($[14] !== disabled) {
|
|
107
|
-
t11 = () => {
|
|
108
|
-
if (disabled) dragCleanupRef.current();
|
|
109
|
-
};
|
|
110
|
-
t12 = [disabled];
|
|
111
|
-
$[14] = disabled;
|
|
112
|
-
$[15] = t11;
|
|
113
|
-
$[16] = t12;
|
|
114
|
-
} else {
|
|
115
|
-
t11 = $[15];
|
|
116
|
-
t12 = $[16];
|
|
117
|
-
}
|
|
118
|
-
useLayoutEffect(t11, t12);
|
|
119
|
-
let t13;
|
|
120
|
-
if ($[17] !== disabled || $[18] !== hue || $[19] !== onUpdateRGB) {
|
|
121
|
-
t13 = (event) => {
|
|
122
|
-
if (disabled) return;
|
|
123
|
-
draggingRef.current = true;
|
|
124
|
-
const move = (x, y) => {
|
|
125
|
-
const rect_0 = canvasRef.current.getBoundingClientRect();
|
|
126
|
-
const localX = clamp(x - rect_0.left, 0, rect_0.width);
|
|
127
|
-
const localY = clamp(y - rect_0.top, 0, rect_0.height);
|
|
128
|
-
const saturation = localX / rect_0.width * 100;
|
|
129
|
-
const brightness = (1 - localY / rect_0.height) * 100;
|
|
130
|
-
setDotPosition({
|
|
131
|
-
x: localX - 7,
|
|
132
|
-
y: localY - 7
|
|
133
|
-
});
|
|
134
|
-
onUpdateRGB?.(Color().hsv(hue, saturation, brightness).rgb().object());
|
|
135
|
-
};
|
|
136
|
-
move(event.clientX, event.clientY);
|
|
137
|
-
const mousemove = (item) => move(item.clientX, item.clientY);
|
|
138
|
-
dragCleanupRef.current();
|
|
139
|
-
const up = () => {
|
|
140
|
-
draggingRef.current = false;
|
|
141
|
-
document.removeEventListener("mousemove", mousemove);
|
|
142
|
-
document.removeEventListener("mouseup", up);
|
|
143
|
-
};
|
|
144
|
-
dragCleanupRef.current = up;
|
|
145
|
-
document.addEventListener("mousemove", mousemove);
|
|
146
|
-
document.addEventListener("mouseup", up);
|
|
67
|
+
move(event.clientX, event.clientY);
|
|
68
|
+
const mousemove = (item) => move(item.clientX, item.clientY);
|
|
69
|
+
dragCleanupRef.current();
|
|
70
|
+
const up = () => {
|
|
71
|
+
draggingRef.current = false;
|
|
72
|
+
document.removeEventListener("mousemove", mousemove);
|
|
73
|
+
document.removeEventListener("mouseup", up);
|
|
147
74
|
};
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
if ($[21] !== start) {
|
|
156
|
-
t14 = /* @__PURE__ */ jsx("canvas", {
|
|
75
|
+
dragCleanupRef.current = up;
|
|
76
|
+
document.addEventListener("mousemove", mousemove);
|
|
77
|
+
document.addEventListener("mouseup", up);
|
|
78
|
+
};
|
|
79
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
80
|
+
className: "k-color-picker-paint-container",
|
|
81
|
+
children: [/* @__PURE__ */ jsx("canvas", {
|
|
157
82
|
className: "k-color-picker-paint",
|
|
158
83
|
width: 234,
|
|
159
84
|
height: 136,
|
|
160
85
|
ref: canvasRef,
|
|
161
86
|
onMouseDown: start
|
|
162
|
-
})
|
|
163
|
-
$[21] = start;
|
|
164
|
-
$[22] = t14;
|
|
165
|
-
} else t14 = $[22];
|
|
166
|
-
let t15;
|
|
167
|
-
if ($[23] !== dotPosition.x || $[24] !== dotPosition.y) {
|
|
168
|
-
t15 = /* @__PURE__ */ jsx("span", {
|
|
87
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
169
88
|
className: "k-color-picker-paint-dot",
|
|
170
89
|
style: {
|
|
171
90
|
left: dotPosition.x,
|
|
172
91
|
top: dotPosition.y
|
|
173
92
|
}
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
$[24] = dotPosition.y;
|
|
177
|
-
$[25] = t15;
|
|
178
|
-
} else t15 = $[25];
|
|
179
|
-
let t16;
|
|
180
|
-
if ($[26] !== t14 || $[27] !== t15) {
|
|
181
|
-
t16 = /* @__PURE__ */ jsxs("div", {
|
|
182
|
-
className: "k-color-picker-paint-container",
|
|
183
|
-
children: [t14, t15]
|
|
184
|
-
});
|
|
185
|
-
$[26] = t14;
|
|
186
|
-
$[27] = t15;
|
|
187
|
-
$[28] = t16;
|
|
188
|
-
} else t16 = $[28];
|
|
189
|
-
return t16;
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
190
95
|
}
|
|
191
|
-
function _temp() {}
|
|
192
|
-
//#endregion
|
|
193
96
|
export { Paint as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.3.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
import { Check } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
10
10
|
import Icon from "../icon/index.js";
|
|
11
|
-
import { c } from "react/compiler-runtime";
|
|
12
11
|
import { jsx } from "react/jsx-runtime";
|
|
13
12
|
import Color from "color";
|
|
14
|
-
|
|
13
|
+
// components/color-picker/presets.tsx
|
|
15
14
|
var defaults = [
|
|
16
15
|
"#f44336",
|
|
17
16
|
"#e91e63",
|
|
@@ -34,47 +33,16 @@ var defaults = [
|
|
|
34
33
|
"#607d8b",
|
|
35
34
|
"#000"
|
|
36
35
|
];
|
|
37
|
-
function Presets(
|
|
38
|
-
const $ = c(11);
|
|
39
|
-
const { color, presets: t1, onUpdateColor } = t0;
|
|
40
|
-
const presets = t1 === void 0 ? defaults : t1;
|
|
36
|
+
function Presets({ color, presets = defaults, onUpdateColor }) {
|
|
41
37
|
if (!presets.length) return null;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
let t4;
|
|
52
|
-
if ($[6] !== active || $[7] !== onUpdateColor) {
|
|
53
|
-
t4 = (hex) => /* @__PURE__ */ jsx("span", {
|
|
54
|
-
style: { backgroundColor: hex },
|
|
55
|
-
onClick: () => onUpdateColor?.(Color(hex)),
|
|
56
|
-
children: active === Color(hex).hex() && /* @__PURE__ */ jsx(Icon, { type: Check })
|
|
57
|
-
}, hex);
|
|
58
|
-
$[6] = active;
|
|
59
|
-
$[7] = onUpdateColor;
|
|
60
|
-
$[8] = t4;
|
|
61
|
-
} else t4 = $[8];
|
|
62
|
-
t3 = presets.map(t4);
|
|
63
|
-
$[2] = active;
|
|
64
|
-
$[3] = onUpdateColor;
|
|
65
|
-
$[4] = presets;
|
|
66
|
-
$[5] = t3;
|
|
67
|
-
} else t3 = $[5];
|
|
68
|
-
let t4;
|
|
69
|
-
if ($[9] !== t3) {
|
|
70
|
-
t4 = /* @__PURE__ */ jsx("div", {
|
|
71
|
-
className: "k-color-picker-presets",
|
|
72
|
-
children: t3
|
|
73
|
-
});
|
|
74
|
-
$[9] = t3;
|
|
75
|
-
$[10] = t4;
|
|
76
|
-
} else t4 = $[10];
|
|
77
|
-
return t4;
|
|
38
|
+
const active = Color(color).hex();
|
|
39
|
+
return /* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: "k-color-picker-presets",
|
|
41
|
+
children: presets.map((hex) => /* @__PURE__ */ jsx("span", {
|
|
42
|
+
style: { backgroundColor: hex },
|
|
43
|
+
onClick: () => onUpdateColor?.(Color(hex)),
|
|
44
|
+
children: active === Color(hex).hex() && /* @__PURE__ */ jsx(Icon, { type: Check })
|
|
45
|
+
}, hex))
|
|
46
|
+
});
|
|
78
47
|
}
|
|
79
|
-
//#endregion
|
|
80
48
|
export { Presets as default };
|
package/es/components.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.3.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -9,27 +9,22 @@
|
|
|
9
9
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
10
10
|
import Affix from "./affix/index.js";
|
|
11
11
|
import Popup from "./popup/index.js";
|
|
12
|
-
import Icon from "./icon/index.js";
|
|
13
12
|
import Alert from "./alert/index.js";
|
|
14
|
-
import Button from "./button/button.js";
|
|
15
|
-
import ButtonGroup from "./button/button-group.js";
|
|
16
13
|
import Calendar from "./calendar/index.js";
|
|
17
|
-
import Empty from "./empty/index.js";
|
|
18
14
|
import Kanban from "./kanban/index.js";
|
|
19
|
-
import Avatar from "./avatar/avatar.js";
|
|
20
|
-
import AvatarGroup from "./avatar/avatar-group.js";
|
|
21
|
-
import Card, { CardMeta } from "./card/index.js";
|
|
22
15
|
import ListPanel from "./list-panel/index.js";
|
|
23
|
-
import input_group_default from "./input/input-group.js";
|
|
24
|
-
import input_default from "./input/input.js";
|
|
25
|
-
import textarea_default from "./input/textarea.js";
|
|
26
16
|
import auto_complete_default from "./auto-complete/index.js";
|
|
27
17
|
import Anchor from "./anchor/anchor.js";
|
|
28
18
|
import AnchorLink from "./anchor/anchor-link.js";
|
|
19
|
+
import Avatar from "./avatar/avatar.js";
|
|
20
|
+
import AvatarGroup from "./avatar/avatar-group.js";
|
|
29
21
|
import Breadcrumb from "./breadcrumb/breadcrumb.js";
|
|
30
22
|
import BreadcrumbItem from "./breadcrumb/breadcrumb-item.js";
|
|
31
23
|
import BackTop from "./back-top/index.js";
|
|
32
24
|
import Badge from "./badge/index.js";
|
|
25
|
+
import Button from "./button/button.js";
|
|
26
|
+
import ButtonGroup from "./button/button-group.js";
|
|
27
|
+
import Card, { CardMeta } from "./card/index.js";
|
|
33
28
|
import Carousel from "./carousel/carousel.js";
|
|
34
29
|
import CarouselItem from "./carousel/carousel-item.js";
|
|
35
30
|
import checkbox_default from "./checkbox/checkbox.js";
|
|
@@ -38,15 +33,9 @@ import check_card_default from "./check-card/check-card.js";
|
|
|
38
33
|
import check_card_group_default from "./check-card/check-card-group.js";
|
|
39
34
|
import Collapse from "./collapse/collapse.js";
|
|
40
35
|
import CollapsePanel from "./collapse/collapse-panel.js";
|
|
41
|
-
import input_number_default from "./input-number/index.js";
|
|
42
|
-
import Option from "./select/option.js";
|
|
43
|
-
import Space from "./space/index.js";
|
|
44
|
-
import Tag from "./tag/index.js";
|
|
45
|
-
import Tooltip, { TooltipPanel } from "./tooltip/index.js";
|
|
46
|
-
import { getVirtualRange } from "./virtual-list/range.js";
|
|
47
|
-
import VirtualList from "./virtual-list/index.js";
|
|
48
|
-
import select_default from "./select/select.js";
|
|
49
36
|
import color_picker_default, { ColorPickerPanel } from "./color-picker/index.js";
|
|
37
|
+
import gradient_picker_default from "./gradient-picker/index.js";
|
|
38
|
+
import { createCornerGradient, createLinearGradient, formatGradient } from "./gradient-picker/types.js";
|
|
50
39
|
import date_picker_default, { DatePickerPanel } from "./date-picker/index.js";
|
|
51
40
|
import Descriptions from "./descriptions/descriptions.js";
|
|
52
41
|
import DescriptionsItem from "./descriptions/descriptions-item.js";
|
|
@@ -54,9 +43,8 @@ import Drawer from "./drawer/index.js";
|
|
|
54
43
|
import Dropdown from "./dropdown/dropdown.js";
|
|
55
44
|
import DropdownButton from "./dropdown/dropdown-button.js";
|
|
56
45
|
import Divider from "./divider/index.js";
|
|
46
|
+
import Empty from "./empty/index.js";
|
|
57
47
|
import Form from "./form/form.js";
|
|
58
|
-
import Col from "./row-col/col.js";
|
|
59
|
-
import Row from "./row-col/row.js";
|
|
60
48
|
import FormItem from "./form/form-item.js";
|
|
61
49
|
import Flex from "./flex/index.js";
|
|
62
50
|
import FeatureCard from "./feature-card/index.js";
|
|
@@ -64,23 +52,27 @@ import { FlameWrap } from "./flame-wrap/index.js";
|
|
|
64
52
|
import FeedbackPanel from "./feedback-panel/index.js";
|
|
65
53
|
import Grid from "./grid/grid.js";
|
|
66
54
|
import GridItem from "./grid/grid-item.js";
|
|
67
|
-
import slider_default from "./slider/index.js";
|
|
68
55
|
import ImageGroup from "./image/group.js";
|
|
69
56
|
import KImage from "./image/image.js";
|
|
57
|
+
import Icon from "./icon/index.js";
|
|
58
|
+
import input_default from "./input/input.js";
|
|
59
|
+
import input_group_default from "./input/input-group.js";
|
|
60
|
+
import textarea_default from "./input/textarea.js";
|
|
70
61
|
import input_tag_default from "./input-tag/index.js";
|
|
62
|
+
import input_number_default from "./input-number/index.js";
|
|
71
63
|
import input_otp_default from "./input-otp/index.js";
|
|
72
64
|
import { Content, Footer, Header, Layout, Sider } from "./layout/index.js";
|
|
73
65
|
import loading from "./loading/index.js";
|
|
74
|
-
import { MenuItem } from "./menu/menu-item.js";
|
|
75
|
-
import { SubMenu } from "./menu/sub-menu.js";
|
|
76
66
|
import { Menu } from "./menu/menu.js";
|
|
77
67
|
import { MenuDivider } from "./menu/menu-divider.js";
|
|
78
68
|
import { MenuGroup } from "./menu/menu-group.js";
|
|
79
|
-
import {
|
|
69
|
+
import { MenuItem } from "./menu/menu-item.js";
|
|
70
|
+
import { SubMenu } from "./menu/sub-menu.js";
|
|
80
71
|
import message from "./message/index.js";
|
|
81
72
|
import mentions_default from "./mentions/index.js";
|
|
82
|
-
import
|
|
73
|
+
import { MessagePanel, NoticePanel } from "./notice/content.js";
|
|
83
74
|
import { modal } from "./modal/api.js";
|
|
75
|
+
import Modal, { ModalPanel } from "./modal/modal.js";
|
|
84
76
|
import notice from "./notice/index.js";
|
|
85
77
|
import Page from "./page/index.js";
|
|
86
78
|
import PageHeader from "./page-header/index.js";
|
|
@@ -88,7 +80,6 @@ import Poptip, { PoptipPanel } from "./poptip/index.js";
|
|
|
88
80
|
import Popconfirm, { PopconfirmPanel } from "./popconfirm/index.js";
|
|
89
81
|
import Progress from "./progress/index.js";
|
|
90
82
|
import { Ripple } from "./ripple/index.js";
|
|
91
|
-
import Spin from "./spin/index.js";
|
|
92
83
|
import QRCode from "./qrcode/index.js";
|
|
93
84
|
import radio_default from "./radio/radio.js";
|
|
94
85
|
import radio_button_default from "./radio/radio-button.js";
|
|
@@ -96,34 +87,45 @@ import radio_group_default from "./radio/radio-group.js";
|
|
|
96
87
|
import segmented_default from "./segmented/index.js";
|
|
97
88
|
import rate_default from "./rate/index.js";
|
|
98
89
|
import Result from "./result/index.js";
|
|
90
|
+
import Option from "./select/option.js";
|
|
91
|
+
import select_default from "./select/select.js";
|
|
99
92
|
import ConfigProvider from "./config/index.js";
|
|
100
93
|
import Skeleton from "./skeleton/skeleton.js";
|
|
101
94
|
import SkeletonAvatar from "./skeleton/skeleton-avatar.js";
|
|
102
95
|
import SkeletonButton from "./skeleton/skeleton-button.js";
|
|
103
96
|
import SkeletonImage from "./skeleton/skeleton-image.js";
|
|
104
97
|
import SkeletonText from "./skeleton/skeleton-text.js";
|
|
105
|
-
import StatNumber from "./stat-card/stat-number.js";
|
|
106
98
|
import StatCard from "./stat-card/stat-card.js";
|
|
99
|
+
import StatNumber from "./stat-card/stat-number.js";
|
|
100
|
+
import slider_default from "./slider/index.js";
|
|
101
|
+
import Space from "./space/index.js";
|
|
102
|
+
import Spin from "./spin/index.js";
|
|
107
103
|
import Steps, { Step } from "./steps/index.js";
|
|
108
104
|
import switch_default from "./switch/index.js";
|
|
109
105
|
import { Splitter } from "./splitter/splitter.js";
|
|
110
106
|
import { SplitterPanel } from "./splitter/splitter-panel.js";
|
|
111
|
-
import { TableColumnSetting } from "./table/column-setting.js";
|
|
112
107
|
import Table from "./table/index.js";
|
|
108
|
+
import Tooltip, { TooltipPanel } from "./tooltip/index.js";
|
|
113
109
|
import Tour from "./tour/index.js";
|
|
114
110
|
import TabPanel from "./tabs/tab-panel.js";
|
|
115
111
|
import Tabs from "./tabs/tabs.js";
|
|
116
112
|
import TimeLine from "./time-line/timeline.js";
|
|
113
|
+
import { TableColumnSetting } from "./table/column-setting.js";
|
|
117
114
|
import TimeLineItem from "./time-line/timeline-item.js";
|
|
118
115
|
import Tree from "./tree/index.js";
|
|
119
116
|
import tree_select_default from "./tree-select/index.js";
|
|
120
117
|
import cascader_default from "./cascader/index.js";
|
|
118
|
+
import Tag from "./tag/index.js";
|
|
119
|
+
import Col from "./row-col/col.js";
|
|
120
|
+
import Row from "./row-col/row.js";
|
|
121
121
|
import upload_default from "./upload/index.js";
|
|
122
122
|
import Watermark from "./watermark/index.js";
|
|
123
123
|
import Theme from "./utils/theme.js";
|
|
124
|
+
import VirtualList from "./virtual-list/index.js";
|
|
125
|
+
import { getVirtualRange } from "./virtual-list/range.js";
|
|
124
126
|
import transfer_default from "./transfer/index.js";
|
|
125
127
|
import Typography, { TypographyParagraph, TypographyText, TypographyTitle } from "./typography/index.js";
|
|
126
|
-
|
|
128
|
+
// components/components.ts
|
|
127
129
|
var components_exports = /* @__PURE__ */ __exportAll({
|
|
128
130
|
Affix: () => Affix,
|
|
129
131
|
Alert: () => Alert,
|
|
@@ -171,6 +173,7 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
171
173
|
Footer: () => Footer,
|
|
172
174
|
Form: () => Form,
|
|
173
175
|
FormItem: () => FormItem,
|
|
176
|
+
GradientPicker: () => gradient_picker_default,
|
|
174
177
|
Grid: () => Grid,
|
|
175
178
|
GridItem: () => GridItem,
|
|
176
179
|
Header: () => Header,
|
|
@@ -251,6 +254,9 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
251
254
|
Upload: () => upload_default,
|
|
252
255
|
VirtualList: () => VirtualList,
|
|
253
256
|
Watermark: () => Watermark,
|
|
257
|
+
createCornerGradient: () => createCornerGradient,
|
|
258
|
+
createLinearGradient: () => createLinearGradient,
|
|
259
|
+
formatGradient: () => formatGradient,
|
|
254
260
|
getVirtualRange: () => getVirtualRange,
|
|
255
261
|
loading: () => loading,
|
|
256
262
|
message: () => message,
|
|
@@ -258,5 +264,4 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
258
264
|
notice: () => notice,
|
|
259
265
|
theme: () => Theme
|
|
260
266
|
});
|
|
261
|
-
|
|
262
|
-
export { Affix, Alert, Anchor, AnchorLink, auto_complete_default as AutoComplete, Avatar, AvatarGroup, BackTop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, Calendar, Card, CardMeta, Carousel, CarouselItem, cascader_default as Cascader, check_card_default as CheckCard, check_card_group_default as CheckCardGroup, checkbox_default as Checkbox, checkbox_group_default as CheckboxGroup, Col, Collapse, CollapsePanel, color_picker_default as ColorPicker, ColorPickerPanel, ConfigProvider, Content, date_picker_default as DatePicker, DatePickerPanel, Descriptions, DescriptionsItem, Divider, Drawer, Dropdown, DropdownButton, Empty, FeatureCard, FeedbackPanel, FlameWrap, Flex, Footer, Form, FormItem, Grid, GridItem, Header, Icon, ImageGroup, input_default as Input, input_group_default as InputGroup, input_number_default as InputNumber, input_otp_default as InputOTP, input_tag_default as InputTag, KImage, Kanban, Layout, ListPanel, mentions_default as Mentions, Menu, MenuDivider, MenuGroup, MenuItem, MessagePanel, Modal, ModalPanel, NoticePanel, Option, Page, PageHeader, Popconfirm, PopconfirmPanel, Poptip, PoptipPanel, Popup, Progress, QRCode, radio_default as Radio, radio_button_default as RadioButton, radio_group_default as RadioGroup, rate_default as Rate, Result, Ripple, Row, segmented_default as Segmented, select_default as Select, Sider, Skeleton, SkeletonAvatar, SkeletonButton, SkeletonImage, SkeletonText, slider_default as Slider, Space, Spin, Splitter, SplitterPanel, StatCard, StatNumber, Step, Steps, SubMenu, switch_default as Switch, TabPanel, Table, TableColumnSetting, Tabs, Tag, textarea_default as TextArea, TimeLine, TimeLineItem, Tooltip, TooltipPanel, Tour, transfer_default as Transfer, Tree, tree_select_default as TreeSelect, Typography, TypographyParagraph, TypographyText, TypographyTitle, upload_default as Upload, VirtualList, Watermark, components_exports, getVirtualRange, loading, message, modal, notice, Theme as theme };
|
|
267
|
+
export { Affix, Alert, Anchor, AnchorLink, auto_complete_default as AutoComplete, Avatar, AvatarGroup, BackTop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, Calendar, Card, CardMeta, Carousel, CarouselItem, cascader_default as Cascader, check_card_default as CheckCard, check_card_group_default as CheckCardGroup, checkbox_default as Checkbox, checkbox_group_default as CheckboxGroup, Col, Collapse, CollapsePanel, color_picker_default as ColorPicker, ColorPickerPanel, ConfigProvider, Content, date_picker_default as DatePicker, DatePickerPanel, Descriptions, DescriptionsItem, Divider, Drawer, Dropdown, DropdownButton, Empty, FeatureCard, FeedbackPanel, FlameWrap, Flex, Footer, Form, FormItem, gradient_picker_default as GradientPicker, Grid, GridItem, Header, Icon, ImageGroup, input_default as Input, input_group_default as InputGroup, input_number_default as InputNumber, input_otp_default as InputOTP, input_tag_default as InputTag, KImage, Kanban, Layout, ListPanel, mentions_default as Mentions, Menu, MenuDivider, MenuGroup, MenuItem, MessagePanel, Modal, ModalPanel, NoticePanel, Option, Page, PageHeader, Popconfirm, PopconfirmPanel, Poptip, PoptipPanel, Popup, Progress, QRCode, radio_default as Radio, radio_button_default as RadioButton, radio_group_default as RadioGroup, rate_default as Rate, Result, Ripple, Row, segmented_default as Segmented, select_default as Select, Sider, Skeleton, SkeletonAvatar, SkeletonButton, SkeletonImage, SkeletonText, slider_default as Slider, Space, Spin, Splitter, SplitterPanel, StatCard, StatNumber, Step, Steps, SubMenu, switch_default as Switch, TabPanel, Table, TableColumnSetting, Tabs, Tag, textarea_default as TextArea, TimeLine, TimeLineItem, Tooltip, TooltipPanel, Tour, transfer_default as Transfer, Tree, tree_select_default as TreeSelect, Typography, TypographyParagraph, TypographyText, TypographyTitle, upload_default as Upload, VirtualList, Watermark, components_exports, createCornerGradient, createLinearGradient, formatGradient, getVirtualRange, loading, message, modal, notice, Theme as theme };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.3.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import en_default from "../locale/en.js";
|
|
10
10
|
import { createContext } from "react";
|
|
11
|
-
|
|
11
|
+
// components/config/config-context.ts
|
|
12
12
|
/**
|
|
13
13
|
* 没有 ConfigProvider 兜底时用的语言。
|
|
14
14
|
* 默认值只有这一个出处,组件里不许再各自写 `|| zhCN` 之类的兜底;要改库级默认就改这里。
|
|
@@ -22,5 +22,4 @@ var DEFAULT_LOCALE = en_default;
|
|
|
22
22
|
*/
|
|
23
23
|
var EMPTY_CONFIG = { locale: null };
|
|
24
24
|
var ConfigContext = createContext(EMPTY_CONFIG);
|
|
25
|
-
//#endregion
|
|
26
25
|
export { ConfigContext, DEFAULT_LOCALE, EMPTY_CONFIG };
|
package/es/config/context.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.3.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
6
6
|
* Author: Qiu / https://chuchur.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// components/config/context.ts
|
|
10
10
|
var __mousePoint = null;
|
|
11
11
|
var recordMousePoint = () => {
|
|
12
12
|
if (typeof window !== "undefined") document.addEventListener("mousedown", (e) => {
|
|
@@ -49,5 +49,4 @@ var subscribeConfig = (listener) => {
|
|
|
49
49
|
listeners.delete(listener);
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
-
//#endregion
|
|
53
52
|
export { currentConfig, getMousePoint, pushConfig, recordMousePoint, subscribeConfig };
|
package/es/config/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.3.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
import { ConfigContext, EMPTY_CONFIG } from "./config-context.js";
|
|
10
10
|
import { pushConfig } from "./context.js";
|
|
11
|
-
import { c } from "react/compiler-runtime";
|
|
12
11
|
import { useContext, useEffect } from "react";
|
|
13
12
|
import { jsx } from "react/jsx-runtime";
|
|
14
|
-
|
|
13
|
+
import { c } from "react/compiler-runtime";
|
|
14
|
+
// components/config/index.tsx
|
|
15
15
|
var ConfigProvider = (t0) => {
|
|
16
16
|
const $ = c(13);
|
|
17
17
|
const { locale, getPopupContainer, size, shape, theme, children } = t0;
|
|
@@ -67,5 +67,4 @@ var ConfigProvider = (t0) => {
|
|
|
67
67
|
} else t9 = $[12];
|
|
68
68
|
return t9;
|
|
69
69
|
};
|
|
70
|
-
//#endregion
|
|
71
70
|
export { ConfigProvider as default };
|
package/es/config/popup-host.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.3.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
6
6
|
* Author: Qiu / https://chuchur.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { c } from "react/compiler-runtime";
|
|
10
9
|
import { createContext, useContext, useEffect, useRef } from "react";
|
|
11
|
-
|
|
10
|
+
import { c } from "react/compiler-runtime";
|
|
11
|
+
// components/config/popup-host.ts
|
|
12
12
|
/**
|
|
13
13
|
* Modal / Drawer 用它给自己圈一个浮层作用域:挂在里面的 Popup(下拉、气泡、子菜单……)
|
|
14
14
|
* 把关闭方法登记进来,宿主窗口关的时候一起关掉——否则窗口都没了,teleported 的下拉还悬在 body 上。
|
|
@@ -102,5 +102,4 @@ function usePopupHost(close) {
|
|
|
102
102
|
}
|
|
103
103
|
useEffect(t1, t2);
|
|
104
104
|
}
|
|
105
|
-
//#endregion
|
|
106
105
|
export { PopupHostContext, usePopupHost, usePopupHostScope };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.3.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React from "react";
|
|
10
|
-
|
|
10
|
+
// components/config/size-context.ts
|
|
11
11
|
var SizeContext = React.createContext(void 0);
|
|
12
|
-
//#endregion
|
|
13
12
|
export { SizeContext };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.3.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
import { ConfigContext } from "./config-context.js";
|
|
10
10
|
import { FormContext } from "../form/form-context.js";
|
|
11
|
-
import { c } from "react/compiler-runtime";
|
|
12
11
|
import { useContext } from "react";
|
|
13
|
-
|
|
12
|
+
import { c } from "react/compiler-runtime";
|
|
13
|
+
// components/config/use-config-appearance.ts
|
|
14
14
|
/**
|
|
15
15
|
* What a `ConfigProvider` says about everything under it. Form is deliberately absent: `Form`'s `size`,
|
|
16
16
|
* `shape` and `theme` are documented as the appearance of its *child controls*, and a Card, Table or Alert
|
|
@@ -95,5 +95,4 @@ var SURFACE_THEMES = [
|
|
|
95
95
|
"solid",
|
|
96
96
|
"dashed"
|
|
97
97
|
];
|
|
98
|
-
//#endregion
|
|
99
98
|
export { SURFACE_THEMES, normalizeSurfaceShape, resolvePaintedTheme, resolveTheme, useConfigAppearance, useFormAppearance };
|