@baishuyun/ui-base 2.1.0 → 2.2.2
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/dist/Card/{Card-CXULQNHa.js → Card-DHOMkrEE.js} +2 -2
- package/dist/Card/index.js +1 -1
- package/dist/CheckBox/{CheckBox-Bu40TO29.js → CheckBox-VlP6u_-s.js} +2 -2
- package/dist/CheckBox/index.js +19 -17
- package/dist/ColorPicker/ColorPicker-049kyJn6.js +205 -0
- package/dist/ColorPicker/index.js +1 -1
- package/dist/DropDown/DropDown-BkTY-3y0.js +166 -0
- package/dist/DropDown/index.js +4 -0
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +4 -0
- package/dist/Editor/constants/index.js +20 -0
- package/dist/Editor/index-C0MY9j94.js +832 -0
- package/dist/Editor/index.js +581 -0
- package/dist/Icon/Icon-CkHAU1fA.js +24 -0
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/InputTag-S9hHXsyQ.js +137 -0
- package/dist/InputTag/index.js +2 -135
- package/dist/Loading/Loading-CEB4PLUE.js +9 -0
- package/dist/Loading/index.js +4 -0
- package/dist/Modal/{Modal-BZTEGGa0.js → Modal-oRJ-Almn.js} +1 -1
- package/dist/Modal/index.js +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/Select/Select-7KGHOKs6.js +820 -0
- package/dist/Select/SelectInputSearch-DigfTvpo.js +34 -0
- package/dist/Select/index.js +1 -1
- package/dist/Tabs/TabSelect-bKB0Qe9F.js +445 -0
- package/dist/Tabs/index.js +7 -0
- package/dist/Tree/index.js +1 -1
- package/dist/Tree/utils/index.js +1 -1
- package/dist/components/CheckBox/Group.d.ts +4 -0
- package/dist/components/DropDown/DropDown.d.ts +3 -0
- package/dist/components/DropDown/MenuItem/MenuItem.d.ts +8 -0
- package/dist/components/DropDown/MenuList/MenuList.d.ts +9 -0
- package/dist/components/DropDown/index.d.ts +1 -0
- package/dist/components/Editor/Editor.d.ts +4 -0
- package/dist/components/Editor/EditorCore.d.ts +4 -0
- package/dist/components/Editor/ToolbarPlugin/BaseButton/BaseButton.d.ts +29 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/AlignButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/BoldButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/FillButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/FontColorButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/FontSizeButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/ItalicButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/LinkButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/PictureButton/LinkInput.d.ts +5 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/PictureButton/PictureButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/PictureButton/UploadImage.d.ts +8 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/UnLinkButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/UnderLineButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/index.d.ts +14 -0
- package/dist/components/Editor/ToolbarPlugin/ToolbarPlugin.d.ts +3 -0
- package/dist/components/Editor/ToolbarPlugin/context/TextFormatProvider.d.ts +3 -0
- package/dist/components/Editor/ToolbarPlugin/context/TextFormatsContext.d.ts +17 -0
- package/dist/components/Editor/ToolbarPlugin/context/useTextFormatsContext.d.ts +1 -0
- package/dist/components/Editor/ToolbarPlugin/interface.d.ts +32 -0
- package/dist/components/Editor/commands/ImageCommands.d.ts +8 -0
- package/dist/components/Editor/constants/index.d.ts +41 -0
- package/dist/components/Editor/hooks/useTextFormatsState.d.ts +2 -0
- package/dist/components/Editor/index.d.ts +2 -0
- package/dist/components/Editor/interface.d.ts +62 -0
- package/dist/components/Editor/nodes/ExtendedTextNode.d.ts +11 -0
- package/dist/components/Editor/nodes/ImageComponent.d.ts +11 -0
- package/dist/components/Editor/nodes/ImageNode.d.ts +50 -0
- package/dist/components/Editor/plugins/EnterKeyPlugin.d.ts +1 -0
- package/dist/components/Editor/plugins/ImagePlugin.d.ts +1 -0
- package/dist/components/Loading/Loading.d.ts +5 -0
- package/dist/components/Loading/index.d.ts +1 -0
- package/dist/components/Select/context/SelectContext.d.ts +12 -0
- package/dist/components/Tabs/Tab/Tab.d.ts +10 -0
- package/dist/components/Tabs/TabList/TabList.d.ts +4 -0
- package/dist/components/Tabs/TabList/useTabIndicator.d.ts +19 -0
- package/dist/components/Tabs/TabList/useTabScroll.d.ts +16 -0
- package/dist/components/Tabs/TabPanel/TabPanel.d.ts +9 -0
- package/dist/components/Tabs/TabSelect/TabSelect.d.ts +3 -0
- package/dist/components/Tabs/TabSelect/interface.d.ts +26 -0
- package/dist/components/Tabs/Tabs.d.ts +3 -0
- package/dist/components/Tabs/constants.d.ts +9 -0
- package/dist/components/Tabs/context/TabContext.d.ts +7 -0
- package/dist/components/Tabs/index.d.ts +4 -0
- package/dist/components/Tabs/interface.d.ts +61 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/index.js +41 -30
- package/dist/style.css +1 -1
- package/dist/vendors/{Tree-CCY2gtpG.js → Tree-C-8x1jXV.js} +4 -4
- package/dist/vendors/color-VzwvCPhF.js +21 -0
- package/dist/vendors/index-MTmG1Ezy.js +15 -0
- package/dist/vendors/lexical-DdSmj_Kv.js +5891 -0
- package/dist/vendors/{lodash-es-CZfJRWhO.js → lodash-es-DFpaJB4Y.js} +2 -2
- package/dist/vendors/{simplebar-react-Bf9Zq-21.js → simplebar-react-D68KzE44.js} +1 -1
- package/dist/vendors/useFloatingPortal-9VUFOAOG.js +45 -0
- package/dist/vendors/{index-ByQkttKA.js → useLocale-DgqW9M3h.js} +35 -47
- package/package.json +9 -7
- package/dist/ColorPicker/ColorPicker-CwFsihkL.js +0 -207
- package/dist/Icon/Icon-BlkVlKDd.js +0 -24
- package/dist/Select/Select-C3abXG27.js +0 -855
- package/dist/vendors/lexical-Bz4mqKs6.js +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as f from "react";
|
|
2
|
-
import { t as j, d as M } from "./lodash-es-
|
|
2
|
+
import { t as j, d as M } from "./lodash-es-DFpaJB4Y.js";
|
|
3
3
|
var w = function() {
|
|
4
4
|
return w = Object.assign || function(t) {
|
|
5
5
|
for (var i, e = 1, r = arguments.length; e < r; e++) {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useFloating as w, flip as y, shift as M, offset as k, size as z, autoUpdate as I, useClick as F, useDismiss as O, useInteractions as b } from "@floating-ui/react";
|
|
2
|
+
import { useMemo as v } from "react";
|
|
3
|
+
const S = (r) => {
|
|
4
|
+
const { isOpen: t, close: a, showMask: o, zIndex: c, zIndexMask: s, offset: e, popupMinWidth: l } = r, { refs: d, floatingStyles: p, context: i } = w({
|
|
5
|
+
open: t,
|
|
6
|
+
onOpenChange: (n) => {
|
|
7
|
+
n || a();
|
|
8
|
+
},
|
|
9
|
+
placement: "bottom-start",
|
|
10
|
+
whileElementsMounted: I,
|
|
11
|
+
middleware: [
|
|
12
|
+
y(),
|
|
13
|
+
M({ padding: 8 }),
|
|
14
|
+
k({
|
|
15
|
+
mainAxis: (e == null ? void 0 : e.y) || 0,
|
|
16
|
+
crossAxis: (e == null ? void 0 : e.x) || 0
|
|
17
|
+
}),
|
|
18
|
+
z({
|
|
19
|
+
apply({ rects: n, elements: h }) {
|
|
20
|
+
Object.assign(h.floating.style, {
|
|
21
|
+
minWidth: l,
|
|
22
|
+
width: `${n.reference.width}px`,
|
|
23
|
+
zIndex: c
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
}), u = F(i), m = O(i, {
|
|
29
|
+
outsidePress: !0
|
|
30
|
+
}), { getReferenceProps: f, getFloatingProps: g } = b([u, m]), x = v(() => o && t && s !== void 0 ? {
|
|
31
|
+
zIndex: s + 1,
|
|
32
|
+
position: "relative"
|
|
33
|
+
} : {}, [o, t, s]);
|
|
34
|
+
return {
|
|
35
|
+
refs: d,
|
|
36
|
+
floatingStyles: p,
|
|
37
|
+
context: i,
|
|
38
|
+
getReferenceProps: f,
|
|
39
|
+
getFloatingProps: g,
|
|
40
|
+
referenceStyle: x
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
S as u
|
|
45
|
+
};
|
|
@@ -1,59 +1,47 @@
|
|
|
1
1
|
import { createContext as a, useContext as c } from "react";
|
|
2
|
-
const
|
|
3
|
-
select:
|
|
4
|
-
search:
|
|
5
|
-
noFindData:
|
|
6
|
-
allSelect:
|
|
7
|
-
context:
|
|
8
|
-
noData:
|
|
2
|
+
const l = "请选择", s = "搜索", r = "未搜索到任何数据", i = "全选", g = "请输入内容", d = "没有可选择的数据", m = "未搜索到任何数据", p = "数据搜索中...", u = "搜索结果全选", U = "左对齐", L = "居中对齐", I = "右对齐", f = "下划线", h = "链接", R = "超链接", k = "显示文本", y = "链接地址", C = "在新页面打开", x = "确认", A = "取消", S = "取消链接", F = "预设颜色", N = { linkTip: "支持https://链接 或者@表单别名", bold: "加粗", italic: "倾斜", fontSize: "字号", fontColor: "颜色", fill: "填充", alignment: "对齐方式", centerAlign: "居中对齐", rightAlign: "右对齐", uploadImage: "上传图片", imageUrl: "图片URL", imageUrlPlaceholder: "请输入图片URL", imageUrlRequired: "请输入图片URL", imageUrlInvalid: "请输入有效的图片URL", imageUrlNote: "注:输入图片URL即可插入图片", inputImageUrl: "输入图片URL", uploadImageNote: "注:单个图片大小不能超过1MB", uploadImageText: "点击或拖拽上传图片", previewImage: "预览图片", underline: "下划线", imageFormatOnly: "只支持图片格式", imageSizeNote: "注:图片大小不能超过 1MB", uploadImageFirst: "请先上传图片", imageAddSuccess: "图片添加成功", operationFailed: "操作失败", onlyImageFormatsSupported: "仅支持图片格式", pleaseUploadImageFirst: "请先上传图片", clickOrDragToUpload: "点击或拖拽上传图片", enterImageUrl: "输入图片URL", pleaseEnterImageUrl: "请输入图片URL", pleaseEnterValidImageUrl: "请输入有效的图片URL", linkAddressEmpty: "链接地址不能为空" }, z = "图片", T = "添加图片", D = "自定义颜色", w = {
|
|
3
|
+
select: l,
|
|
4
|
+
search: s,
|
|
5
|
+
noFindData: r,
|
|
6
|
+
allSelect: i,
|
|
7
|
+
context: g,
|
|
8
|
+
noData: d,
|
|
9
9
|
noDataFound: m,
|
|
10
10
|
dataSearching: p,
|
|
11
11
|
allSelectedBySearch: u,
|
|
12
12
|
leftAlign: U,
|
|
13
|
-
centerAlign:
|
|
14
|
-
rightAlign:
|
|
15
|
-
underline:
|
|
16
|
-
link:
|
|
17
|
-
hyperLink:
|
|
18
|
-
showContent:
|
|
19
|
-
linkAddress:
|
|
20
|
-
openInNewTab:
|
|
21
|
-
confirm:
|
|
22
|
-
cancel:
|
|
23
|
-
cancelLink:
|
|
24
|
-
presetColors:
|
|
25
|
-
editor:
|
|
26
|
-
picture:
|
|
27
|
-
addPicture:
|
|
28
|
-
customColor:
|
|
29
|
-
},
|
|
30
|
-
const n =
|
|
31
|
-
let
|
|
13
|
+
centerAlign: L,
|
|
14
|
+
rightAlign: I,
|
|
15
|
+
underline: f,
|
|
16
|
+
link: h,
|
|
17
|
+
hyperLink: R,
|
|
18
|
+
showContent: k,
|
|
19
|
+
linkAddress: y,
|
|
20
|
+
openInNewTab: C,
|
|
21
|
+
confirm: x,
|
|
22
|
+
cancel: A,
|
|
23
|
+
cancelLink: S,
|
|
24
|
+
presetColors: F,
|
|
25
|
+
editor: N,
|
|
26
|
+
picture: z,
|
|
27
|
+
addPicture: T,
|
|
28
|
+
customColor: D
|
|
29
|
+
}, B = (e) => {
|
|
30
|
+
const n = e.split(".");
|
|
31
|
+
let t = w;
|
|
32
32
|
try {
|
|
33
33
|
for (const o of n)
|
|
34
|
-
|
|
35
|
-
return typeof
|
|
34
|
+
t = t[o];
|
|
35
|
+
return typeof t == "string" ? t : e;
|
|
36
36
|
} catch {
|
|
37
|
-
return
|
|
37
|
+
return e;
|
|
38
38
|
}
|
|
39
|
-
},
|
|
39
|
+
}, E = a({
|
|
40
40
|
locale: "zh-CN",
|
|
41
|
-
t:
|
|
42
|
-
}),
|
|
43
|
-
initial: { opacity: 0, scale: 0.95, y: -4 },
|
|
44
|
-
animate: { opacity: 1, scale: 1, y: 0 },
|
|
45
|
-
exit: { opacity: 0, scale: 0.95, y: -4 },
|
|
46
|
-
transition: { duration: 0.2, ease: "easeOut" }
|
|
47
|
-
}, b = {
|
|
48
|
-
initial: { opacity: 0, scale: 0.8 },
|
|
49
|
-
animate: { opacity: 1, scale: 1 },
|
|
50
|
-
exit: { opacity: 0, scale: 0.8 },
|
|
51
|
-
transition: { duration: 0.2 }
|
|
52
|
-
};
|
|
41
|
+
t: B
|
|
42
|
+
}), v = () => c(E);
|
|
53
43
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
w as u,
|
|
58
|
-
D as z
|
|
44
|
+
E as L,
|
|
45
|
+
v as u,
|
|
46
|
+
w as z
|
|
59
47
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/ui-base",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "百数云低代码平台通用组件库",
|
|
6
6
|
"author": "bsy-fe team",
|
|
@@ -52,6 +52,8 @@
|
|
|
52
52
|
"@lexical/link": "^0.33.1",
|
|
53
53
|
"@lexical/react": "^0.33.1",
|
|
54
54
|
"@lexical/rich-text": "^0.33.1",
|
|
55
|
+
"@lexical/selection": "^0.33.1",
|
|
56
|
+
"@lexical/utils": "^0.33.1",
|
|
55
57
|
"clsx": "^2.1.1",
|
|
56
58
|
"fuse.js": "^7.1.0",
|
|
57
59
|
"lexical": "^0.33.1",
|
|
@@ -74,8 +76,8 @@
|
|
|
74
76
|
"immer": "^10.1.1",
|
|
75
77
|
"motion": "^11.18.2",
|
|
76
78
|
"postcss": "^8.5.3",
|
|
77
|
-
"react": "^
|
|
78
|
-
"react-dom": "^
|
|
79
|
+
"react": "^18.3.1",
|
|
80
|
+
"react-dom": "^18.3.1",
|
|
79
81
|
"react-router-dom": "^7.6.2",
|
|
80
82
|
"sass": "^1.89.2",
|
|
81
83
|
"tailwindcss": "^3.0.0",
|
|
@@ -86,17 +88,17 @@
|
|
|
86
88
|
},
|
|
87
89
|
"project": {
|
|
88
90
|
"iconfont": {
|
|
89
|
-
"scriptUrl": "https://at.alicdn.com/t/c/
|
|
91
|
+
"scriptUrl": "https://at.alicdn.com/t/c/font_4786625_c3hfvyi874p.js"
|
|
90
92
|
}
|
|
91
93
|
},
|
|
92
94
|
"scripts": {
|
|
93
95
|
"build": "vite build",
|
|
94
96
|
"build:debug": "vite build --mode debug",
|
|
95
|
-
"build:watch": "vite build --watch",
|
|
96
|
-
"dev": "vite build --watch",
|
|
97
|
+
"build:watch": "vite build --watch --mode debug",
|
|
98
|
+
"dev": "vite build --watch --mode debug",
|
|
97
99
|
"type-check": "tsc --noEmit",
|
|
98
100
|
"lint": "eslint . --ext .ts,.tsx",
|
|
99
101
|
"lint:fix": "eslint . --ext .ts,.tsx --fix",
|
|
100
|
-
"clean": "
|
|
102
|
+
"clean": "rm -rf dist"
|
|
101
103
|
}
|
|
102
104
|
}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { jsx as r, jsxs as b, Fragment as S } from "react/jsx-runtime";
|
|
2
|
-
import { ColorPicker as O } from "antd";
|
|
3
|
-
import { AnimatePresence as R, motion as w } from "motion/react";
|
|
4
|
-
import { useFloating as A, offset as F, flip as I, shift as x, useClick as E, useDismiss as L, useInteractions as T, FloatingPortal as V } from "@floating-ui/react";
|
|
5
|
-
import { useState as p, isValidElement as j, cloneElement as B, useRef as D } from "react";
|
|
6
|
-
import { useControllableValue as G } from "ahooks";
|
|
7
|
-
import { I as u } from "../Icon/Icon-BlkVlKDd.js";
|
|
8
|
-
import { u as y, P as M } from "../vendors/index-ByQkttKA.js";
|
|
9
|
-
import { c as $ } from "../vendors/clsx-OuTLNxxd.js";
|
|
10
|
-
import { t as k } from "../vendors/tinycolor2-Begv3Jc8.js";
|
|
11
|
-
import { b as d, c as q } from "../vendors/lodash-es-CZfJRWhO.js";
|
|
12
|
-
const z = [
|
|
13
|
-
"rgba(240, 102, 72, 1)",
|
|
14
|
-
// #F06648
|
|
15
|
-
"rgba(255, 197, 2, 1)",
|
|
16
|
-
// #FFC502
|
|
17
|
-
"rgba(74, 204, 140, 1)",
|
|
18
|
-
// #4ACC8C
|
|
19
|
-
"rgba(74, 192, 236, 1)",
|
|
20
|
-
// #4AC0EC
|
|
21
|
-
"rgba(255, 153, 33, 1)",
|
|
22
|
-
// #ff9921
|
|
23
|
-
"rgba(101, 101, 101, 1)",
|
|
24
|
-
// #656565
|
|
25
|
-
"rgba(255, 156, 136, 1)",
|
|
26
|
-
// #ff9c88
|
|
27
|
-
"rgba(98, 98, 206, 1)",
|
|
28
|
-
// #6262ce
|
|
29
|
-
"rgba(241, 104, 182, 1)",
|
|
30
|
-
// #f168b6
|
|
31
|
-
"rgba(55, 103, 241, 1)",
|
|
32
|
-
// #3767f1
|
|
33
|
-
"rgba(162, 206, 30, 1)",
|
|
34
|
-
// #a2ce1e
|
|
35
|
-
"rgba(179, 179, 179, 1)",
|
|
36
|
-
// #b3b3b3
|
|
37
|
-
"rgba(0, 0, 0, 1)",
|
|
38
|
-
// #000000
|
|
39
|
-
"rgba(102, 102, 102, 1)",
|
|
40
|
-
// #666
|
|
41
|
-
"rgba(153, 153, 153, 1)",
|
|
42
|
-
// #999
|
|
43
|
-
"rgba(194, 194, 194, 1)",
|
|
44
|
-
// #c2c2c2
|
|
45
|
-
"rgba(224, 224, 224, 1)",
|
|
46
|
-
// #e0e0e0
|
|
47
|
-
"rgba(77, 96, 159, 1)"
|
|
48
|
-
// #4d609f
|
|
49
|
-
], H = (e = "bottom-start") => {
|
|
50
|
-
const [o, t] = p(!1), { refs: i, floatingStyles: c, context: a } = A({
|
|
51
|
-
open: o,
|
|
52
|
-
onOpenChange: t,
|
|
53
|
-
placement: e,
|
|
54
|
-
middleware: [
|
|
55
|
-
F(4),
|
|
56
|
-
// 浮层与触发器间距
|
|
57
|
-
I(),
|
|
58
|
-
// 超出边界时自动翻转
|
|
59
|
-
x({ padding: 8 })
|
|
60
|
-
// 自动避开边界
|
|
61
|
-
]
|
|
62
|
-
}), n = E(a), _ = L(a), { getReferenceProps: l, getFloatingProps: m } = T([n, _]);
|
|
63
|
-
return {
|
|
64
|
-
isOpen: o,
|
|
65
|
-
refs: i,
|
|
66
|
-
floatingStyles: c,
|
|
67
|
-
getReferenceProps: l,
|
|
68
|
-
getFloatingProps: m,
|
|
69
|
-
setIsOpen: t
|
|
70
|
-
};
|
|
71
|
-
}, s = {
|
|
72
|
-
"bsy-color-picker__floating": "_bsy-color-picker__floating_1kfi6_1",
|
|
73
|
-
"bsy-color-picker__content": "_bsy-color-picker__content_1kfi6_4",
|
|
74
|
-
"bsy-color-picker__grid": "_bsy-color-picker__grid_1kfi6_11",
|
|
75
|
-
"bsy-color-picker__preset-colors-title": "_bsy-color-picker__preset-colors-title_1kfi6_15",
|
|
76
|
-
"bsy-color-picker__preset-colors-grid": "_bsy-color-picker__preset-colors-grid_1kfi6_19",
|
|
77
|
-
"bsy-color-picker__preset-colors-item": "_bsy-color-picker__preset-colors-item_1kfi6_24",
|
|
78
|
-
"bsy-color-picker__custom-color-title": "_bsy-color-picker__custom-color-title_1kfi6_47",
|
|
79
|
-
"bsy-color-picker__custom-color-btn": "_bsy-color-picker__custom-color-btn_1kfi6_51",
|
|
80
|
-
"bsy-color-picker__custom-color-btn--active": "_bsy-color-picker__custom-color-btn--active_1kfi6_61",
|
|
81
|
-
"bsy-color-picker__custom-color-btn--preview": "_bsy-color-picker__custom-color-btn--preview_1kfi6_65",
|
|
82
|
-
"bsy-color-picker__custom-color-content": "_bsy-color-picker__custom-color-content_1kfi6_68",
|
|
83
|
-
"bsy-color-picker__check-icon": "_bsy-color-picker__check-icon_1kfi6_72"
|
|
84
|
-
}, f = (e, o) => {
|
|
85
|
-
if (d(e) || d(o))
|
|
86
|
-
return !1;
|
|
87
|
-
const t = k(e).toRgbString(), i = k(o).toRgbString();
|
|
88
|
-
return t === i;
|
|
89
|
-
}, C = ({
|
|
90
|
-
currentColor: e,
|
|
91
|
-
onColorSelect: o,
|
|
92
|
-
options: t,
|
|
93
|
-
style: i
|
|
94
|
-
}) => /* @__PURE__ */ r("div", { className: s["bsy-color-picker__preset-colors-grid"], style: i, children: t.map((c) => /* @__PURE__ */ r(
|
|
95
|
-
"div",
|
|
96
|
-
{
|
|
97
|
-
className: s["bsy-color-picker__preset-colors-item"],
|
|
98
|
-
style: {
|
|
99
|
-
backgroundColor: c,
|
|
100
|
-
"--hover-color": k(c).setAlpha(0.5).toRgbString()
|
|
101
|
-
},
|
|
102
|
-
onClick: () => o(c),
|
|
103
|
-
children: f(e, c) && /* @__PURE__ */ r(u, { name: "checkthebox", className: s["bsy-color-picker__check-icon"] })
|
|
104
|
-
},
|
|
105
|
-
c
|
|
106
|
-
)) }), J = (e) => {
|
|
107
|
-
const { children: o, placement: t = "bottom-start", disabled: i = !1, presetColors: c } = e, { t: a } = y(), [n, _] = G(e, {
|
|
108
|
-
defaultValue: e.value
|
|
109
|
-
}), { isOpen: l, refs: m, floatingStyles: h, getReferenceProps: v, getFloatingProps: P } = H(t), N = j(o) ? B(o, {
|
|
110
|
-
...v(),
|
|
111
|
-
// @ts-ignore
|
|
112
|
-
ref: m.setReference,
|
|
113
|
-
disabled: i
|
|
114
|
-
}) : o, g = q(c) && c.length ? c : z;
|
|
115
|
-
return /* @__PURE__ */ b(S, { children: [
|
|
116
|
-
N,
|
|
117
|
-
/* @__PURE__ */ r(V, { children: /* @__PURE__ */ r(R, { children: l && /* @__PURE__ */ r(
|
|
118
|
-
"div",
|
|
119
|
-
{
|
|
120
|
-
ref: m.setFloating,
|
|
121
|
-
style: h,
|
|
122
|
-
...P(),
|
|
123
|
-
className: s["bsy-color-picker__floating"],
|
|
124
|
-
children: /* @__PURE__ */ r(w.div, { ...M, children: /* @__PURE__ */ r("div", { className: s["bsy-color-picker__content"], children: /* @__PURE__ */ b("div", { className: s["bsy-color-picker__grid"], children: [
|
|
125
|
-
/* @__PURE__ */ b("div", { className: s["bsy-color-picker__preset-colors"], children: [
|
|
126
|
-
/* @__PURE__ */ r("div", { className: s["bsy-color-picker__preset-colors-title"], children: a("presetColors") }),
|
|
127
|
-
/* @__PURE__ */ r(
|
|
128
|
-
C,
|
|
129
|
-
{
|
|
130
|
-
currentColor: n,
|
|
131
|
-
onColorSelect: _,
|
|
132
|
-
options: g
|
|
133
|
-
}
|
|
134
|
-
)
|
|
135
|
-
] }),
|
|
136
|
-
/* @__PURE__ */ r(
|
|
137
|
-
K,
|
|
138
|
-
{
|
|
139
|
-
value: n,
|
|
140
|
-
onChange: _,
|
|
141
|
-
options: g
|
|
142
|
-
}
|
|
143
|
-
)
|
|
144
|
-
] }) }) })
|
|
145
|
-
}
|
|
146
|
-
) }) })
|
|
147
|
-
] });
|
|
148
|
-
}, K = (e) => {
|
|
149
|
-
const [o, t] = p(), [i, c] = p(!1), a = e.options.some((l) => f(l, e.value)), n = D(a ? [] : [e.value]), { t: _ } = y();
|
|
150
|
-
return /* @__PURE__ */ b("div", { className: s["bsy-color-picker__custom-color"], children: [
|
|
151
|
-
/* @__PURE__ */ r("div", { className: s["bsy-color-picker__custom-color-title"], children: _("customColor") }),
|
|
152
|
-
/* @__PURE__ */ b("div", { className: s["bsy-color-picker__custom-color-content"], children: [
|
|
153
|
-
/* @__PURE__ */ r(
|
|
154
|
-
O,
|
|
155
|
-
{
|
|
156
|
-
value: o,
|
|
157
|
-
onChange: (l) => t(l.toRgbString()),
|
|
158
|
-
open: i,
|
|
159
|
-
onOpenChange: (l) => {
|
|
160
|
-
c(l), !l && o && (n.current.includes(o) || n.current.unshift(o), e.onChange(o), t(void 0));
|
|
161
|
-
},
|
|
162
|
-
children: /* @__PURE__ */ r(
|
|
163
|
-
"div",
|
|
164
|
-
{
|
|
165
|
-
className: $(s["bsy-color-picker__custom-color-btn"], {
|
|
166
|
-
[s["bsy-color-picker__custom-color-btn--active"]]: i && !o,
|
|
167
|
-
[s["bsy-color-picker__custom-color-btn--preview"]]: !!o
|
|
168
|
-
}),
|
|
169
|
-
role: "button",
|
|
170
|
-
style: {
|
|
171
|
-
backgroundColor: o || void 0
|
|
172
|
-
},
|
|
173
|
-
onClick: () => {
|
|
174
|
-
c(!0);
|
|
175
|
-
},
|
|
176
|
-
children: /* @__PURE__ */ r(
|
|
177
|
-
u,
|
|
178
|
-
{
|
|
179
|
-
name: "add",
|
|
180
|
-
style: {
|
|
181
|
-
visibility: o ? "hidden" : "visible"
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
)
|
|
185
|
-
}
|
|
186
|
-
)
|
|
187
|
-
}
|
|
188
|
-
),
|
|
189
|
-
/* @__PURE__ */ r(
|
|
190
|
-
C,
|
|
191
|
-
{
|
|
192
|
-
currentColor: e.value,
|
|
193
|
-
onColorSelect: e.onChange,
|
|
194
|
-
options: n.current.slice(0, 5),
|
|
195
|
-
style: {
|
|
196
|
-
gridTemplateColumns: "repeat(5, 1fr)"
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
)
|
|
200
|
-
] })
|
|
201
|
-
] });
|
|
202
|
-
};
|
|
203
|
-
J.displayName = "BsyColorPicker";
|
|
204
|
-
export {
|
|
205
|
-
J as C,
|
|
206
|
-
z as a
|
|
207
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { createFromIconfontCN as e } from "@ant-design/icons";
|
|
3
|
-
import { a } from "../vendors/lodash-es-CZfJRWhO.js";
|
|
4
|
-
const f = e({
|
|
5
|
-
scriptUrl: "https://at.alicdn.com/t/c/font_4786625_jgu2jvbpehp.js"
|
|
6
|
-
}), I = ({ name: o, style: n, className: r, onClick: c, color: s, size: t = 16 }) => {
|
|
7
|
-
const m = {
|
|
8
|
-
color: s,
|
|
9
|
-
fontSize: a(t) ? `${t}px` : t,
|
|
10
|
-
...n
|
|
11
|
-
};
|
|
12
|
-
return /* @__PURE__ */ p(
|
|
13
|
-
f,
|
|
14
|
-
{
|
|
15
|
-
onClick: c,
|
|
16
|
-
type: `icon-${o}`,
|
|
17
|
-
style: m,
|
|
18
|
-
className: `${r || ""}`
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
I
|
|
24
|
-
};
|