react-kui 3.2.0 → 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 +825 -168
- 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 +72 -196
- 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 +25 -15
- package/es/table/utils.js +3 -5
- 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/segmented/index.d.cts +2 -1
- package/types/segmented/index.d.ts +2 -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/alpha.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,143 +7,62 @@
|
|
|
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 } from "react";
|
|
12
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
12
|
import Color from "color";
|
|
14
|
-
|
|
15
|
-
function Alpha(
|
|
16
|
-
const $ = c(23);
|
|
17
|
-
const { disabled: t1, value, onUpdateAlpha } = t0;
|
|
18
|
-
const disabled = t1 === void 0 ? false : t1;
|
|
13
|
+
// components/color-picker/alpha.tsx
|
|
14
|
+
function Alpha({ disabled = false, value, onUpdateAlpha }) {
|
|
19
15
|
const canvasRef = useRef(null);
|
|
20
|
-
const dragCleanupRef = useRef(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
16
|
+
const dragCleanupRef = useRef(() => void 0);
|
|
17
|
+
const color = Color(value);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const canvas = canvasRef.current;
|
|
20
|
+
const context = canvas?.getContext("2d");
|
|
21
|
+
if (!canvas || !context) return;
|
|
22
|
+
const rgb = color.rgb().object();
|
|
23
|
+
const gradient = context.createLinearGradient(0, 0, canvas.width, 0);
|
|
24
|
+
gradient.addColorStop(0, `rgba(${rgb.r},${rgb.g},${rgb.b},0)`);
|
|
25
|
+
gradient.addColorStop(1, `rgba(${rgb.r},${rgb.g},${rgb.b},1)`);
|
|
26
|
+
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
27
|
+
context.fillStyle = gradient;
|
|
28
|
+
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
29
|
+
}, [color]);
|
|
30
|
+
useEffect(() => () => dragCleanupRef.current(), []);
|
|
31
|
+
useLayoutEffect(() => {
|
|
32
|
+
if (disabled) dragCleanupRef.current();
|
|
33
|
+
}, [disabled]);
|
|
34
|
+
const start = (event) => {
|
|
35
|
+
if (disabled) return;
|
|
36
|
+
const move = (x) => {
|
|
37
|
+
const rect = canvasRef.current.getBoundingClientRect();
|
|
38
|
+
onUpdateAlpha?.(Number((clamp(x - rect.left, 0, rect.width) / rect.width).toFixed(2)));
|
|
42
39
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
t4 = $[4];
|
|
50
|
-
}
|
|
51
|
-
useEffect(t3, t4);
|
|
52
|
-
let t5;
|
|
53
|
-
let t6;
|
|
54
|
-
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
55
|
-
t5 = () => () => dragCleanupRef.current();
|
|
56
|
-
t6 = [];
|
|
57
|
-
$[5] = t5;
|
|
58
|
-
$[6] = t6;
|
|
59
|
-
} else {
|
|
60
|
-
t5 = $[5];
|
|
61
|
-
t6 = $[6];
|
|
62
|
-
}
|
|
63
|
-
useEffect(t5, t6);
|
|
64
|
-
let t7;
|
|
65
|
-
let t8;
|
|
66
|
-
if ($[7] !== disabled) {
|
|
67
|
-
t7 = () => {
|
|
68
|
-
if (disabled) dragCleanupRef.current();
|
|
40
|
+
move(event.clientX);
|
|
41
|
+
const mousemove = (item) => move(item.clientX);
|
|
42
|
+
dragCleanupRef.current();
|
|
43
|
+
const up = () => {
|
|
44
|
+
document.removeEventListener("mousemove", mousemove);
|
|
45
|
+
document.removeEventListener("mouseup", up);
|
|
69
46
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
useLayoutEffect(t7, t8);
|
|
79
|
-
let t9;
|
|
80
|
-
if ($[10] !== disabled || $[11] !== onUpdateAlpha) {
|
|
81
|
-
t9 = (event) => {
|
|
82
|
-
if (disabled) return;
|
|
83
|
-
const move = (x) => {
|
|
84
|
-
const rect = canvasRef.current.getBoundingClientRect();
|
|
85
|
-
onUpdateAlpha?.(Number((clamp(x - rect.left, 0, rect.width) / rect.width).toFixed(2)));
|
|
86
|
-
};
|
|
87
|
-
move(event.clientX);
|
|
88
|
-
const mousemove = (item) => move(item.clientX);
|
|
89
|
-
dragCleanupRef.current();
|
|
90
|
-
const up = () => {
|
|
91
|
-
document.removeEventListener("mousemove", mousemove);
|
|
92
|
-
document.removeEventListener("mouseup", up);
|
|
93
|
-
};
|
|
94
|
-
dragCleanupRef.current = up;
|
|
95
|
-
document.addEventListener("mousemove", mousemove);
|
|
96
|
-
document.addEventListener("mouseup", up);
|
|
97
|
-
};
|
|
98
|
-
$[10] = disabled;
|
|
99
|
-
$[11] = onUpdateAlpha;
|
|
100
|
-
$[12] = t9;
|
|
101
|
-
} else t9 = $[12];
|
|
102
|
-
const start = t9;
|
|
103
|
-
let t10;
|
|
104
|
-
if ($[13] !== start) {
|
|
105
|
-
t10 = /* @__PURE__ */ jsx("canvas", {
|
|
47
|
+
dragCleanupRef.current = up;
|
|
48
|
+
document.addEventListener("mousemove", mousemove);
|
|
49
|
+
document.addEventListener("mouseup", up);
|
|
50
|
+
};
|
|
51
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
52
|
+
className: "k-color-picker-alpha-box",
|
|
53
|
+
children: [/* @__PURE__ */ jsx("canvas", {
|
|
106
54
|
className: "k-color-picker-alpha",
|
|
107
55
|
width: 190,
|
|
108
56
|
height: 8,
|
|
109
57
|
ref: canvasRef,
|
|
110
58
|
onMouseDown: start
|
|
111
|
-
})
|
|
112
|
-
$[13] = start;
|
|
113
|
-
$[14] = t10;
|
|
114
|
-
} else t10 = $[14];
|
|
115
|
-
const t11 = color.alpha() * 190 - 7;
|
|
116
|
-
let t12;
|
|
117
|
-
if ($[15] !== color) {
|
|
118
|
-
t12 = color.string();
|
|
119
|
-
$[15] = color;
|
|
120
|
-
$[16] = t12;
|
|
121
|
-
} else t12 = $[16];
|
|
122
|
-
let t13;
|
|
123
|
-
if ($[17] !== t11 || $[18] !== t12) {
|
|
124
|
-
t13 = /* @__PURE__ */ jsx("span", {
|
|
59
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
125
60
|
className: "k-color-picker-alpha-dot",
|
|
126
61
|
style: {
|
|
127
|
-
left:
|
|
128
|
-
backgroundColor:
|
|
62
|
+
left: color.alpha() * 190 - 7,
|
|
63
|
+
backgroundColor: color.string()
|
|
129
64
|
}
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
$[18] = t12;
|
|
133
|
-
$[19] = t13;
|
|
134
|
-
} else t13 = $[19];
|
|
135
|
-
let t14;
|
|
136
|
-
if ($[20] !== t10 || $[21] !== t13) {
|
|
137
|
-
t14 = /* @__PURE__ */ jsxs("div", {
|
|
138
|
-
className: "k-color-picker-alpha-box",
|
|
139
|
-
children: [t10, t13]
|
|
140
|
-
});
|
|
141
|
-
$[20] = t10;
|
|
142
|
-
$[21] = t13;
|
|
143
|
-
$[22] = t14;
|
|
144
|
-
} else t14 = $[22];
|
|
145
|
-
return t14;
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
146
67
|
}
|
|
147
|
-
function _temp() {}
|
|
148
|
-
//#endregion
|
|
149
68
|
export { Alpha as default };
|
package/es/color-picker/hue.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,123 +7,54 @@
|
|
|
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 } from "react";
|
|
12
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
|
|
14
|
-
function Hue(
|
|
15
|
-
const $ = c(17);
|
|
16
|
-
const { disabled: t1, hue: t2, onUpdateHue } = t0;
|
|
17
|
-
const disabled = t1 === void 0 ? false : t1;
|
|
18
|
-
const hue = t2 === void 0 ? 0 : t2;
|
|
12
|
+
// components/color-picker/hue.tsx
|
|
13
|
+
function Hue({ disabled = false, hue = 0, onUpdateHue }) {
|
|
19
14
|
const canvasRef = useRef(null);
|
|
20
|
-
const dragCleanupRef = useRef(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
const dragCleanupRef = useRef(() => void 0);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const canvas = canvasRef.current, context = canvas?.getContext("2d");
|
|
18
|
+
if (!canvas || !context) return;
|
|
19
|
+
const gradient = context.createLinearGradient(0, 0, canvas.width, 0);
|
|
20
|
+
for (let value = 0; value <= 360; value += 10) gradient.addColorStop(value / 360, `hsl(${value},100%,50%)`);
|
|
21
|
+
context.fillStyle = gradient;
|
|
22
|
+
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
23
|
+
}, []);
|
|
24
|
+
useEffect(() => () => dragCleanupRef.current(), []);
|
|
25
|
+
useLayoutEffect(() => {
|
|
26
|
+
if (disabled) dragCleanupRef.current();
|
|
27
|
+
}, [disabled]);
|
|
28
|
+
const start = (event) => {
|
|
29
|
+
if (disabled) return;
|
|
30
|
+
const move = (clientX) => {
|
|
31
|
+
const rect = canvasRef.current.getBoundingClientRect();
|
|
32
|
+
onUpdateHue?.(Math.round(clamp(clientX - rect.left, 0, rect.width) / rect.width * 360));
|
|
32
33
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
useEffect(t3, t4);
|
|
41
|
-
let t5;
|
|
42
|
-
let t6;
|
|
43
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
44
|
-
t5 = () => () => dragCleanupRef.current();
|
|
45
|
-
t6 = [];
|
|
46
|
-
$[2] = t5;
|
|
47
|
-
$[3] = t6;
|
|
48
|
-
} else {
|
|
49
|
-
t5 = $[2];
|
|
50
|
-
t6 = $[3];
|
|
51
|
-
}
|
|
52
|
-
useEffect(t5, t6);
|
|
53
|
-
let t7;
|
|
54
|
-
let t8;
|
|
55
|
-
if ($[4] !== disabled) {
|
|
56
|
-
t7 = () => {
|
|
57
|
-
if (disabled) dragCleanupRef.current();
|
|
34
|
+
move(event.clientX);
|
|
35
|
+
const mousemove = (item) => move(item.clientX);
|
|
36
|
+
dragCleanupRef.current();
|
|
37
|
+
const up = () => {
|
|
38
|
+
document.removeEventListener("mousemove", mousemove);
|
|
39
|
+
document.removeEventListener("mouseup", up);
|
|
58
40
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
useLayoutEffect(t7, t8);
|
|
68
|
-
let t9;
|
|
69
|
-
if ($[7] !== disabled || $[8] !== onUpdateHue) {
|
|
70
|
-
t9 = (event) => {
|
|
71
|
-
if (disabled) return;
|
|
72
|
-
const move = (clientX) => {
|
|
73
|
-
const rect = canvasRef.current.getBoundingClientRect();
|
|
74
|
-
onUpdateHue?.(Math.round(clamp(clientX - rect.left, 0, rect.width) / rect.width * 360));
|
|
75
|
-
};
|
|
76
|
-
move(event.clientX);
|
|
77
|
-
const mousemove = (item) => move(item.clientX);
|
|
78
|
-
dragCleanupRef.current();
|
|
79
|
-
const up = () => {
|
|
80
|
-
document.removeEventListener("mousemove", mousemove);
|
|
81
|
-
document.removeEventListener("mouseup", up);
|
|
82
|
-
};
|
|
83
|
-
dragCleanupRef.current = up;
|
|
84
|
-
document.addEventListener("mousemove", mousemove);
|
|
85
|
-
document.addEventListener("mouseup", up);
|
|
86
|
-
event.preventDefault();
|
|
87
|
-
};
|
|
88
|
-
$[7] = disabled;
|
|
89
|
-
$[8] = onUpdateHue;
|
|
90
|
-
$[9] = t9;
|
|
91
|
-
} else t9 = $[9];
|
|
92
|
-
const start = t9;
|
|
93
|
-
let t10;
|
|
94
|
-
if ($[10] !== start) {
|
|
95
|
-
t10 = /* @__PURE__ */ jsx("canvas", {
|
|
41
|
+
dragCleanupRef.current = up;
|
|
42
|
+
document.addEventListener("mousemove", mousemove);
|
|
43
|
+
document.addEventListener("mouseup", up);
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
};
|
|
46
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
47
|
+
className: "k-color-picker-slider-hue",
|
|
48
|
+
children: [/* @__PURE__ */ jsx("canvas", {
|
|
96
49
|
className: "k-color-picker-hue",
|
|
97
50
|
width: 190,
|
|
98
51
|
height: 8,
|
|
99
52
|
ref: canvasRef,
|
|
100
53
|
onMouseDown: start
|
|
101
|
-
})
|
|
102
|
-
$[10] = start;
|
|
103
|
-
$[11] = t10;
|
|
104
|
-
} else t10 = $[11];
|
|
105
|
-
const t11 = hue / 360 * 190 - 7;
|
|
106
|
-
let t12;
|
|
107
|
-
if ($[12] !== t11) {
|
|
108
|
-
t12 = /* @__PURE__ */ jsx("span", {
|
|
54
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
109
55
|
className: "k-color-picker-hue-dot",
|
|
110
|
-
style: { left:
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
$[13] = t12;
|
|
114
|
-
} else t12 = $[13];
|
|
115
|
-
let t13;
|
|
116
|
-
if ($[14] !== t10 || $[15] !== t12) {
|
|
117
|
-
t13 = /* @__PURE__ */ jsxs("div", {
|
|
118
|
-
className: "k-color-picker-slider-hue",
|
|
119
|
-
children: [t10, t12]
|
|
120
|
-
});
|
|
121
|
-
$[14] = t10;
|
|
122
|
-
$[15] = t12;
|
|
123
|
-
$[16] = t13;
|
|
124
|
-
} else t13 = $[16];
|
|
125
|
-
return t13;
|
|
56
|
+
style: { left: hue / 360 * 190 - 7 }
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
126
59
|
}
|
|
127
|
-
function _temp() {}
|
|
128
|
-
//#endregion
|
|
129
60
|
export { Hue as default };
|
package/es/color-picker/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,20 +8,20 @@
|
|
|
8
8
|
|
|
9
9
|
import Popup from "../popup/index.js";
|
|
10
10
|
import { resolveTheme, useFormAppearance } from "../config/use-config-appearance.js";
|
|
11
|
-
import { useValue } from "../utils/use-value.js";
|
|
12
11
|
import { createFormFieldComponent } from "../form/field-context.js";
|
|
12
|
+
import { useValue } from "../utils/use-value.js";
|
|
13
13
|
import Alpha from "./alpha.js";
|
|
14
14
|
import Hue from "./hue.js";
|
|
15
15
|
import Mode from "./mode.js";
|
|
16
16
|
import Paint from "./paint.js";
|
|
17
17
|
import Presets from "./presets.js";
|
|
18
|
-
import { c } from "react/compiler-runtime";
|
|
19
18
|
import clsx from "clsx";
|
|
20
19
|
import { isValidElement, useCallback, useRef, useState } from "react";
|
|
21
20
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { c } from "react/compiler-runtime";
|
|
22
22
|
import Color from "color";
|
|
23
|
-
|
|
24
|
-
function ColorPicker({ value, open: openProp, disabled = false, readOnly = false, disabledAlpha = false, showText = false, placement = "bottom-left", destroyOnClose = true, trigger = "click", size: sizeProp, theme: themeProp, shape: shapeProp, mode: modeProp, presets, onChange, onUpdateMode, onOpenChange, className, children, panelOnly = false, ...rest }) {
|
|
23
|
+
// components/color-picker/index.tsx
|
|
24
|
+
function ColorPicker({ value, open: openProp, disabled = false, readOnly = false, disabledAlpha = false, showText = false, placement = "bottom-left", arrowPointAtCenter = false, destroyOnClose = true, trigger = "click", size: sizeProp, theme: themeProp, shape: shapeProp, mode: modeProp, presets, onChange, onUpdateMode, onOpenChange, className, children, panelOnly = false, ...rest }) {
|
|
25
25
|
const inheritedAppearance = useFormAppearance();
|
|
26
26
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
27
27
|
const theme = resolveTheme(themeProp ?? inheritedAppearance.theme, "fill");
|
|
@@ -230,6 +230,7 @@ function ColorPicker({ value, open: openProp, disabled = false, readOnly = false
|
|
|
230
230
|
]
|
|
231
231
|
}), !panelOnly && /* @__PURE__ */ jsx("div", {
|
|
232
232
|
className: "k-color-picker-arrow",
|
|
233
|
+
"data-popup-arrow": "",
|
|
233
234
|
children: /* @__PURE__ */ jsxs("svg", {
|
|
234
235
|
style: { fill: "currentcolor" },
|
|
235
236
|
viewBox: "0 0 24 8",
|
|
@@ -251,6 +252,7 @@ function ColorPicker({ value, open: openProp, disabled = false, readOnly = false
|
|
|
251
252
|
target: triggerRef,
|
|
252
253
|
trigger: "manual",
|
|
253
254
|
placement,
|
|
255
|
+
arrowPointAtCenter,
|
|
254
256
|
prefixCls: "k-color-picker-dropdown",
|
|
255
257
|
transitionName: "k-color-picker",
|
|
256
258
|
transitionDuration: 200,
|
|
@@ -276,5 +278,4 @@ function ColorPickerPanel(props) {
|
|
|
276
278
|
return t0;
|
|
277
279
|
}
|
|
278
280
|
var color_picker_default = createFormFieldComponent(ColorPicker);
|
|
279
|
-
//#endregion
|
|
280
281
|
export { ColorPickerPanel, color_picker_default as default };
|
package/es/color-picker/mode.js
CHANGED
|
@@ -1,178 +1,95 @@
|
|
|
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 { isColor } from "../utils/color.js";
|
|
10
9
|
import input_default from "../input/input.js";
|
|
11
10
|
import input_number_default from "../input-number/index.js";
|
|
12
11
|
import select_default from "../select/select.js";
|
|
13
|
-
import {
|
|
12
|
+
import { isColor } from "../utils/color.js";
|
|
14
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
14
|
import Color from "color";
|
|
16
|
-
|
|
17
|
-
function Mode(
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
size: "small",
|
|
63
|
-
min: 0,
|
|
64
|
-
max: index_0 ? 100 : 359,
|
|
65
|
-
value: Math.round(item_0),
|
|
66
|
-
formatter: index_0 ? _temp : void 0,
|
|
67
|
-
parser: index_0 ? _temp2 : void 0,
|
|
68
|
-
onChange: (number_2) => change(number_2, [
|
|
69
|
-
"h",
|
|
70
|
-
"s",
|
|
71
|
-
"l"
|
|
72
|
-
][index_0])
|
|
73
|
-
}, index_0));
|
|
74
|
-
$[0] = mode;
|
|
75
|
-
$[1] = onUpdateColorValue;
|
|
76
|
-
$[2] = value;
|
|
77
|
-
$[3] = alpha;
|
|
78
|
-
$[4] = change;
|
|
79
|
-
$[5] = t2;
|
|
80
|
-
} else {
|
|
81
|
-
alpha = $[3];
|
|
82
|
-
change = $[4];
|
|
83
|
-
t2 = $[5];
|
|
84
|
-
}
|
|
85
|
-
const inputs = t2;
|
|
86
|
-
const t3 = `k-color-picker-mode k-color-picker-${mode}`;
|
|
87
|
-
let t4;
|
|
88
|
-
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
89
|
-
t4 = [
|
|
90
|
-
{
|
|
91
|
-
label: "HEX",
|
|
92
|
-
value: "hex"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
label: "RGB",
|
|
96
|
-
value: "rgb"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
label: "HSL",
|
|
100
|
-
value: "hsl"
|
|
101
|
-
}
|
|
102
|
-
];
|
|
103
|
-
$[9] = t4;
|
|
104
|
-
} else t4 = $[9];
|
|
105
|
-
let t5;
|
|
106
|
-
if ($[10] !== onUpdateMode) {
|
|
107
|
-
t5 = (next_0) => onUpdateMode?.(next_0);
|
|
108
|
-
$[10] = onUpdateMode;
|
|
109
|
-
$[11] = t5;
|
|
110
|
-
} else t5 = $[11];
|
|
111
|
-
let t6;
|
|
112
|
-
if ($[12] !== mode || $[13] !== t5) {
|
|
113
|
-
t6 = /* @__PURE__ */ jsx(select_default, {
|
|
15
|
+
// components/color-picker/mode.tsx
|
|
16
|
+
function Mode({ value, mode = "hex", disabledAlpha, onUpdateMode, onUpdateColorValue }) {
|
|
17
|
+
const color = Color(value), alpha = color.alpha();
|
|
18
|
+
const change = (number, channel) => {
|
|
19
|
+
if (number == null) return;
|
|
20
|
+
let next = Color(value);
|
|
21
|
+
if (channel === "r") next = next.red(number);
|
|
22
|
+
else if (channel === "g") next = next.green(number);
|
|
23
|
+
else if (channel === "b") next = next.blue(number);
|
|
24
|
+
else if (channel === "a") next = next.alpha(number / 100);
|
|
25
|
+
else if (channel === "h") next = next.hue(number);
|
|
26
|
+
else if (channel === "s") next = next.saturationl(number);
|
|
27
|
+
else next = next.lightness(number);
|
|
28
|
+
onUpdateColorValue?.(next);
|
|
29
|
+
};
|
|
30
|
+
const inputs = mode === "hex" ? /* @__PURE__ */ jsx(input_default, {
|
|
31
|
+
prefix: "#",
|
|
32
|
+
size: "small",
|
|
33
|
+
value: color.hex().slice(1),
|
|
34
|
+
onChange: (hex) => isColor(`#${hex}`) && onUpdateColorValue?.(Color(`#${hex}`).alpha(alpha))
|
|
35
|
+
}) : mode === "rgb" ? color.rgb().array().slice(0, 3).map((item, index) => /* @__PURE__ */ jsx(input_number_default, {
|
|
36
|
+
size: "small",
|
|
37
|
+
min: 0,
|
|
38
|
+
max: 255,
|
|
39
|
+
value: Math.round(item),
|
|
40
|
+
onChange: (number_0) => change(number_0, [
|
|
41
|
+
"r",
|
|
42
|
+
"g",
|
|
43
|
+
"b"
|
|
44
|
+
][index])
|
|
45
|
+
}, index)) : color.hsl().array().slice(0, 3).map((item_0, index_0) => /* @__PURE__ */ jsx(input_number_default, {
|
|
46
|
+
size: "small",
|
|
47
|
+
min: 0,
|
|
48
|
+
max: index_0 ? 100 : 359,
|
|
49
|
+
value: Math.round(item_0),
|
|
50
|
+
formatter: index_0 ? (number_1) => `${number_1}%` : void 0,
|
|
51
|
+
parser: index_0 ? (text) => text.replace("%", "") : void 0,
|
|
52
|
+
onChange: (number_2) => change(number_2, [
|
|
53
|
+
"h",
|
|
54
|
+
"s",
|
|
55
|
+
"l"
|
|
56
|
+
][index_0])
|
|
57
|
+
}, index_0));
|
|
58
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
59
|
+
className: `k-color-picker-mode k-color-picker-${mode}`,
|
|
60
|
+
children: [/* @__PURE__ */ jsx(select_default, {
|
|
114
61
|
clearable: false,
|
|
115
62
|
bordered: false,
|
|
116
63
|
size: "small",
|
|
117
64
|
value: mode,
|
|
118
|
-
options:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
parser: _temp4,
|
|
135
|
-
onChange: (number_4) => change(number_4, "a")
|
|
136
|
-
});
|
|
137
|
-
$[15] = alpha;
|
|
138
|
-
$[16] = change;
|
|
139
|
-
$[17] = disabledAlpha;
|
|
140
|
-
$[18] = t7;
|
|
141
|
-
} else t7 = $[18];
|
|
142
|
-
let t8;
|
|
143
|
-
if ($[19] !== inputs || $[20] !== t7) {
|
|
144
|
-
t8 = /* @__PURE__ */ jsxs("div", {
|
|
65
|
+
options: [
|
|
66
|
+
{
|
|
67
|
+
label: "HEX",
|
|
68
|
+
value: "hex"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: "RGB",
|
|
72
|
+
value: "rgb"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: "HSL",
|
|
76
|
+
value: "hsl"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
onChange: (next_0) => onUpdateMode?.(next_0)
|
|
80
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
145
81
|
className: "k-color-picker-val",
|
|
146
|
-
children: [inputs,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
$[22] = t3;
|
|
159
|
-
$[23] = t6;
|
|
160
|
-
$[24] = t8;
|
|
161
|
-
$[25] = t9;
|
|
162
|
-
} else t9 = $[25];
|
|
163
|
-
return t9;
|
|
164
|
-
}
|
|
165
|
-
function _temp4(text_0) {
|
|
166
|
-
return text_0.replace("%", "");
|
|
167
|
-
}
|
|
168
|
-
function _temp3(number_3) {
|
|
169
|
-
return `${number_3}%`;
|
|
170
|
-
}
|
|
171
|
-
function _temp2(text) {
|
|
172
|
-
return text.replace("%", "");
|
|
173
|
-
}
|
|
174
|
-
function _temp(number_1) {
|
|
175
|
-
return `${number_1}%`;
|
|
82
|
+
children: [inputs, !disabledAlpha && /* @__PURE__ */ jsx(input_number_default, {
|
|
83
|
+
className: "k-color-picker-alpha-input",
|
|
84
|
+
value: Math.round(alpha * 100),
|
|
85
|
+
size: "small",
|
|
86
|
+
min: 0,
|
|
87
|
+
max: 100,
|
|
88
|
+
formatter: (number_3) => `${number_3}%`,
|
|
89
|
+
parser: (text_0) => text_0.replace("%", ""),
|
|
90
|
+
onChange: (number_4) => change(number_4, "a")
|
|
91
|
+
})]
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
176
94
|
}
|
|
177
|
-
//#endregion
|
|
178
95
|
export { Mode as default };
|