@easyv/biz-components 1.0.21 → 1.0.22
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/components/ai-model-select/ai-model-select-panel.es.js +152 -0
- package/dist/components/ai-model-select/ai-model-select-panel.es.js.map +1 -0
- package/dist/components/ai-model-select/iconBtn.es.js +21 -0
- package/dist/components/ai-model-select/iconBtn.es.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.es.js +2 -0
- package/dist/index.es.js.map +1 -1
- package/dist/node_modules/.pnpm/@easyv_react-icons@6.3.0/node_modules/@easyv/react-icons/dist/index.esm.es.js +54 -4
- package/dist/node_modules/.pnpm/@easyv_react-icons@6.3.0/node_modules/@easyv/react-icons/dist/index.esm.es.js.map +1 -1
- package/dist/node_modules/.pnpm/immer@10.1.1/node_modules/immer/dist/immer.es.js +680 -0
- package/dist/node_modules/.pnpm/immer@10.1.1/node_modules/immer/dist/immer.es.js.map +1 -0
- package/dist/stats.html +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { PlusOutlined, EditOutlined } from "../../node_modules/.pnpm/@easyv_react-icons@6.3.0/node_modules/@easyv/react-icons/dist/index.esm.es.js";
|
|
4
|
+
import classNames from "../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js";
|
|
5
|
+
import { produce } from "../../node_modules/.pnpm/immer@10.1.1/node_modules/immer/dist/immer.es.js";
|
|
6
|
+
import { EasyvInput } from "../../ant-components/input/input.es.js";
|
|
7
|
+
import { IconBtn } from "./iconBtn.es.js";
|
|
8
|
+
const AiModelSelectPanel = (props) => {
|
|
9
|
+
const {
|
|
10
|
+
className = "",
|
|
11
|
+
modelServiceProviderList,
|
|
12
|
+
onSelect,
|
|
13
|
+
style,
|
|
14
|
+
titleClassName,
|
|
15
|
+
itemClassName
|
|
16
|
+
} = props;
|
|
17
|
+
const [customModelServiceProviderList, setCustomModelServiceProviderList] = useState(
|
|
18
|
+
modelServiceProviderList.filter((item) => item.isCustom)
|
|
19
|
+
);
|
|
20
|
+
const [showInputProviderId, setShowInputProviderId] = useState("");
|
|
21
|
+
const [inputValue, setInputValue] = useState("");
|
|
22
|
+
const otherModelServiceProviderList = modelServiceProviderList.filter((item) => !item.isCustom);
|
|
23
|
+
const handleSelect = (modelProvider, model) => {
|
|
24
|
+
onSelect == null ? void 0 : onSelect(modelProvider, model);
|
|
25
|
+
};
|
|
26
|
+
const renderTitle = (modelProvider) => {
|
|
27
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: classNames(
|
|
31
|
+
"biz-h-6 biz-text-text-3 biz-px-3 biz-pt-1 biz-w-full",
|
|
32
|
+
"biz-flex biz-items-center biz-box-border biz-gap-2.5 biz-text-[14px]",
|
|
33
|
+
titleClassName
|
|
34
|
+
),
|
|
35
|
+
title: modelProvider.name,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "biz-w-0 biz-flex-1 biz-truncate", children: modelProvider.name }),
|
|
38
|
+
modelProvider.isCustom && modelProvider.modelList.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39
|
+
IconBtn,
|
|
40
|
+
{
|
|
41
|
+
onClick: () => {
|
|
42
|
+
setShowInputProviderId(modelProvider.id);
|
|
43
|
+
},
|
|
44
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(PlusOutlined, { className: "biz-w-3 biz-h-3 biz-text-text-2 hover:biz-text-text-1 biz-flex-center" })
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
const renderItem = (modelProvider, model) => {
|
|
52
|
+
var _a;
|
|
53
|
+
if (modelProvider.isCustom) {
|
|
54
|
+
if (modelProvider.id !== showInputProviderId && !((_a = modelProvider.modelList) == null ? void 0 : _a.length)) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const normalContent = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
59
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: modelProvider.iconSrc, className: "biz-w-4 biz-h-4" }),
|
|
60
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "biz-truncate biz-w-0 biz-flex-1 biz-text-[14px]", title: model == null ? void 0 : model.name, children: model == null ? void 0 : model.name }),
|
|
61
|
+
modelProvider.isCustom && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
62
|
+
IconBtn,
|
|
63
|
+
{
|
|
64
|
+
onClick: () => {
|
|
65
|
+
setShowInputProviderId(modelProvider.id);
|
|
66
|
+
setInputValue((model == null ? void 0 : model.name) || "");
|
|
67
|
+
},
|
|
68
|
+
className: "biz-hidden group-hover:!biz-flex",
|
|
69
|
+
style: { display: "none" },
|
|
70
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditOutlined, { className: "biz-w-3 biz-h-3 biz-text-text-2 hover:biz-text-text-1 biz-flex-center" })
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] });
|
|
74
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: classNames(
|
|
78
|
+
"biz-px-3 biz-py-[3px] biz-flex biz-items-center biz-gap-2",
|
|
79
|
+
"biz-text-text-2 biz-h-8 biz-w-full biz-box-border",
|
|
80
|
+
"hover:biz-bg-bg-white biz-cursor-pointer biz-group",
|
|
81
|
+
itemClassName
|
|
82
|
+
),
|
|
83
|
+
onClick: () => {
|
|
84
|
+
if (model && !showInputProviderId) {
|
|
85
|
+
handleSelect(modelProvider, model);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
children: showInputProviderId === modelProvider.id ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
89
|
+
EasyvInput,
|
|
90
|
+
{
|
|
91
|
+
className: "biz-w-0 biz-flex-1 biz-rounded-[4px] biz-text-[12px] !biz-px-2",
|
|
92
|
+
value: inputValue,
|
|
93
|
+
onChange: (e) => setInputValue(e.target.value),
|
|
94
|
+
placeholder: "输入后,回车创建",
|
|
95
|
+
onPressEnter: () => {
|
|
96
|
+
setCustomModelServiceProviderList(
|
|
97
|
+
produce(customModelServiceProviderList, (draft) => {
|
|
98
|
+
const index = draft.findIndex((i) => i.id === modelProvider.id);
|
|
99
|
+
if (index !== -1) {
|
|
100
|
+
draft[index].modelList = [{ id: inputValue, name: inputValue }];
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
);
|
|
104
|
+
setShowInputProviderId("");
|
|
105
|
+
setInputValue("");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
) }) : normalContent
|
|
109
|
+
},
|
|
110
|
+
model == null ? void 0 : model.id
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
style,
|
|
117
|
+
className: classNames(
|
|
118
|
+
"biz-bg-[#181B22] biz-border-one biz-rounded-[4px] biz-py-1",
|
|
119
|
+
"biz-flex biz-flex-col gap-1 biz-w-[160px] biz-max-h-[450px] biz-overflow-auto",
|
|
120
|
+
className
|
|
121
|
+
),
|
|
122
|
+
children: [
|
|
123
|
+
otherModelServiceProviderList.map((provider) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
className: "biz-flex biz-flex-col biz-gap-1 biz-w-full biz-box-border",
|
|
127
|
+
children: [
|
|
128
|
+
renderTitle(provider),
|
|
129
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "biz-flex biz-flex-col gap-1 biz-w-full", children: provider.modelList.map((model) => renderItem(provider, model)) })
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
provider.id
|
|
133
|
+
)),
|
|
134
|
+
customModelServiceProviderList.map((provider) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
135
|
+
"div",
|
|
136
|
+
{
|
|
137
|
+
className: "biz-flex biz-flex-col biz-gap-1 biz-w-full biz-box-border",
|
|
138
|
+
children: [
|
|
139
|
+
renderTitle(provider),
|
|
140
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "biz-flex biz-flex-col gap-1 biz-w-full", children: renderItem(provider, provider.modelList[0]) })
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
provider.id
|
|
144
|
+
))
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
export {
|
|
150
|
+
AiModelSelectPanel
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=ai-model-select-panel.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-model-select-panel.es.js","sources":["../../../src/components/ai-model-select/ai-model-select-panel.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { EditOutlined, PlusOutlined } from '@easyv/react-icons';\nimport classNames from 'classnames';\nimport { produce } from 'immer';\nimport { EasyvInput } from '@/ant-components/input/input';\nimport { IconBtn } from './iconBtn';\nimport { AiModel, AiModelServiceProvider } from './types';\n\nexport interface AiModelSelectPanelProps {\n className?: string;\n modelServiceProviderList: AiModelServiceProvider[];\n onSelect?: (AiModelServiceProvider: AiModelServiceProvider, model: AiModel) => void;\n style?: React.CSSProperties;\n titleClassName?: string;\n itemClassName?: string;\n}\n\nexport const AiModelSelectPanel = (props: AiModelSelectPanelProps) => {\n const {\n className = '',\n modelServiceProviderList,\n onSelect,\n style,\n titleClassName,\n itemClassName,\n } = props;\n\n const [customModelServiceProviderList, setCustomModelServiceProviderList] = useState(\n modelServiceProviderList.filter((item) => item.isCustom),\n );\n const [showInputProviderId, setShowInputProviderId] = useState<string>('');\n const [inputValue, setInputValue] = useState<string>('');\n\n const otherModelServiceProviderList = modelServiceProviderList.filter((item) => !item.isCustom);\n\n const handleSelect = (modelProvider: AiModelServiceProvider, model: AiModel) => {\n onSelect?.(modelProvider, model);\n };\n\n const renderTitle = (modelProvider: AiModelServiceProvider) => {\n return (\n <div\n className={classNames(\n 'biz-h-6 biz-text-text-3 biz-px-3 biz-pt-1 biz-w-full',\n 'biz-flex biz-items-center biz-box-border biz-gap-2.5 biz-text-[14px]',\n titleClassName,\n )}\n title={modelProvider.name}\n >\n <div className='biz-w-0 biz-flex-1 biz-truncate'>{modelProvider.name}</div>\n {modelProvider.isCustom && modelProvider.modelList.length === 0 && (\n <IconBtn\n onClick={() => {\n setShowInputProviderId(modelProvider.id);\n }}\n icon={\n <PlusOutlined className='biz-w-3 biz-h-3 biz-text-text-2 hover:biz-text-text-1 biz-flex-center' />\n }\n />\n )}\n </div>\n );\n };\n\n const renderItem = (modelProvider: AiModelServiceProvider, model?: AiModel) => {\n if (modelProvider.isCustom) {\n if (modelProvider.id !== showInputProviderId && !modelProvider.modelList?.length) {\n return null;\n }\n }\n const normalContent = (\n <>\n <img src={modelProvider.iconSrc} className='biz-w-4 biz-h-4' />\n <div className='biz-truncate biz-w-0 biz-flex-1 biz-text-[14px]' title={model?.name}>\n {model?.name}\n </div>\n {modelProvider.isCustom && (\n <IconBtn\n onClick={() => {\n setShowInputProviderId(modelProvider.id);\n setInputValue(model?.name || '');\n }}\n className='biz-hidden group-hover:!biz-flex'\n style={{ display: 'none' }}\n icon={\n <EditOutlined className='biz-w-3 biz-h-3 biz-text-text-2 hover:biz-text-text-1 biz-flex-center' />\n }\n />\n )}\n </>\n );\n return (\n <div\n key={model?.id}\n className={classNames(\n 'biz-px-3 biz-py-[3px] biz-flex biz-items-center biz-gap-2',\n 'biz-text-text-2 biz-h-8 biz-w-full biz-box-border',\n 'hover:biz-bg-bg-white biz-cursor-pointer biz-group',\n itemClassName,\n )}\n onClick={() => {\n if (model && !showInputProviderId) {\n handleSelect(modelProvider, model);\n }\n }}\n >\n {showInputProviderId === modelProvider.id ? (\n <>\n <EasyvInput\n className='biz-w-0 biz-flex-1 biz-rounded-[4px] biz-text-[12px] !biz-px-2'\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n placeholder='输入后,回车创建'\n onPressEnter={() => {\n setCustomModelServiceProviderList(\n produce(customModelServiceProviderList, (draft) => {\n const index = draft.findIndex((i) => i.id === modelProvider.id);\n if (index !== -1) {\n draft[index].modelList = [{ id: inputValue, name: inputValue }];\n }\n }),\n );\n setShowInputProviderId('');\n setInputValue('');\n }}\n />\n </>\n ) : (\n normalContent\n )}\n </div>\n );\n };\n\n return (\n <div\n style={style}\n className={classNames(\n 'biz-bg-[#181B22] biz-border-one biz-rounded-[4px] biz-py-1',\n 'biz-flex biz-flex-col gap-1 biz-w-[160px] biz-max-h-[450px] biz-overflow-auto',\n className,\n )}\n >\n {otherModelServiceProviderList.map((provider) => (\n <div\n key={provider.id}\n className='biz-flex biz-flex-col biz-gap-1 biz-w-full biz-box-border'\n >\n {renderTitle(provider)}\n <div className='biz-flex biz-flex-col gap-1 biz-w-full'>\n {provider.modelList.map((model) => renderItem(provider, model))}\n </div>\n </div>\n ))}\n {customModelServiceProviderList.map((provider) => (\n <div\n key={provider.id}\n className='biz-flex biz-flex-col biz-gap-1 biz-w-full biz-box-border'\n >\n {renderTitle(provider)}\n <div className='biz-flex biz-flex-col gap-1 biz-w-full'>\n {renderItem(provider, provider.modelList[0])}\n </div>\n </div>\n ))}\n </div>\n );\n};\n"],"names":["jsxs","jsx","Fragment"],"mappings":";;;;;;;AAiBa,MAAA,qBAAqB,CAAC,UAAmC;AAC9D,QAAA;AAAA,IACJ,YA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AAAA,MAnCG,+BAAO;AAAA,IAqCd;AAAA,EAEJ;AAGE,SAAAD,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEC,UAAA;AAAA,QAA8B,8BAAA,IAAI,CAAC,aAClCA,kCAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YAET,UAAA;AAAA,cAAA,YAAY,QAAQ;AAAA,cACpBC,kCAAAA,IAAA,OAAA,EAAI,WAAU,0CACZ,UAAS,SAAA,UAAU,IAAI,CAAC,UAAU,WAAW,UAAU,KAAK,CAAC,EAChE,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UANK,SAAS;AAAA,QAAA,CAQjB;AAAA,QACA,+BAA+B,IAAI,CAAC,aACnCD,kCAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YAET,UAAA;AAAA,cAAA,YAAY,QAAQ;AAAA,cACrBC,kCAAAA,IAAC,OAAI,EAAA,WAAU,0CACZ,UAAA,WAAW,UAAU,SAAS,UAAU,CAAC,CAAC,EAC7C,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UANK,SAAS;AAAA,QAQjB,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import classNames from "../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js";
|
|
3
|
+
const IconBtn = (props) => {
|
|
4
|
+
const { className = "", icon, ...restProps } = props;
|
|
5
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
className: classNames(
|
|
9
|
+
"biz-bg-bg-white biz-w-5 biz-h-5 biz-rounded-[4px] biz-flex-center",
|
|
10
|
+
"biz-cursor-pointer",
|
|
11
|
+
className
|
|
12
|
+
),
|
|
13
|
+
...restProps,
|
|
14
|
+
children: icon
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
IconBtn
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=iconBtn.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iconBtn.es.js","sources":["../../../src/components/ai-model-select/iconBtn.tsx"],"sourcesContent":["import React, { HTMLProps } from 'react';\nimport classNames from 'classnames';\n\nexport interface IconBtnProps extends HTMLProps<HTMLDivElement> {\n icon: React.ReactNode;\n}\n\nexport const IconBtn = (props: IconBtnProps) => {\n const { className = '', icon, ...restProps } = props;\n return (\n <div\n className={classNames(\n 'biz-bg-bg-white biz-w-5 biz-h-5 biz-rounded-[4px] biz-flex-center',\n 'biz-cursor-pointer',\n className,\n )}\n {...restProps}\n >\n {icon}\n </div>\n );\n};\n"],"names":["jsx"],"mappings":";;AAOa,MAAA,UAAU,CAAC,UAAwB;AAC9C,QAAM,EAAE,YAAY,IAAI,MAAM,GAAG,UAAc,IAAA;AAE7C,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH,UAAA;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
package/dist/index.es.js
CHANGED
|
@@ -8,6 +8,7 @@ import { EchartsRender } from "./components/echarts-render/echarts-render.es.js"
|
|
|
8
8
|
import { CodeEditor } from "./components/code-editor/code-editor.es.js";
|
|
9
9
|
import { EasyvMonacoEditor } from "./components/easyv-monaco-editor/easyv-monaco-editor.es.js";
|
|
10
10
|
import { ErrorBoundary } from "./components/error-boundary/error-boundary.es.js";
|
|
11
|
+
import { AiModelSelectPanel } from "./components/ai-model-select/ai-model-select-panel.es.js";
|
|
11
12
|
import { useDivAutoScroll } from "./hooks/use-div-auto-scroll.es.js";
|
|
12
13
|
import { useXunFeiSteamVoiceManager } from "./hooks/use-xun-fei-steam-voice-manager.es.js";
|
|
13
14
|
import { useInitialized } from "./hooks/use-initialized.es.js";
|
|
@@ -24,6 +25,7 @@ import { EasyvInput } from "./ant-components/input/input.es.js";
|
|
|
24
25
|
export {
|
|
25
26
|
AiAgentMessageType,
|
|
26
27
|
AiMessageRender,
|
|
28
|
+
AiModelSelectPanel,
|
|
27
29
|
AudioManager,
|
|
28
30
|
CodeEditor,
|
|
29
31
|
EXPLICIT_DISCONNECT_REASON,
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -901,11 +901,34 @@ function _toPropertyKey(t) {
|
|
|
901
901
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
902
902
|
spin: PropTypes.bool
|
|
903
903
|
});
|
|
904
|
-
|
|
904
|
+
var _excluded$2w = ["color", "size", "className", "spin", "style"];
|
|
905
|
+
var EditOutlined = function EditOutlined2(props) {
|
|
906
|
+
var color = props.color, size = props.size, className = props.className, spin = props.spin, _props$style = props.style, style = _props$style === void 0 ? {} : _props$style, otherProps = _objectWithoutProperties(props, _excluded$2w);
|
|
907
|
+
var config = useConfig();
|
|
908
|
+
var _ref = config || {}, cls = _ref.cls;
|
|
909
|
+
return /* @__PURE__ */ React__default.createElement("span", _extends({
|
|
910
|
+
className: classnames("easyv-icon", {
|
|
911
|
+
"easyv-icon-loading": spin
|
|
912
|
+
}, cls, className),
|
|
913
|
+
style: _objectSpread2({
|
|
914
|
+
color,
|
|
915
|
+
fontSize: size
|
|
916
|
+
}, style)
|
|
917
|
+
}, otherProps), /* @__PURE__ */ React__default.createElement("svg", {
|
|
918
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
919
|
+
width: "1em",
|
|
920
|
+
height: "1em",
|
|
921
|
+
viewBox: "0 0 24 24",
|
|
922
|
+
fill: "currentColor"
|
|
923
|
+
}, /* @__PURE__ */ React__default.createElement("path", {
|
|
924
|
+
d: "M6.035 17.62a.953.953 0 00.14-.012l3.943-.691a.23.23 0 00.124-.066l9.935-9.935a.233.233 0 000-.33l-3.895-3.898a.232.232 0 00-.167-.068.232.232 0 00-.166.068l-9.935 9.935a.238.238 0 00-.066.124l-.691 3.942a.785.785 0 00.22.699c.155.15.35.232.558.232zm1.58-4.088l8.5-8.498 1.718 1.718-8.5 8.499-2.084.367.366-2.085zM20.62 19.59H3.37a.75.75 0 00-.75.75v.844c0 .103.084.187.188.187h18.375a.188.188 0 00.187-.188v-.843a.75.75 0 00-.75-.75z"
|
|
925
|
+
})));
|
|
926
|
+
};
|
|
927
|
+
EditOutlined.propTypes = {
|
|
905
928
|
color: PropTypes.string,
|
|
906
929
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
907
930
|
spin: PropTypes.bool
|
|
908
|
-
}
|
|
931
|
+
};
|
|
909
932
|
({
|
|
910
933
|
color: PropTypes.string,
|
|
911
934
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
@@ -2546,11 +2569,36 @@ function _toPropertyKey(t) {
|
|
|
2546
2569
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
2547
2570
|
spin: PropTypes.bool
|
|
2548
2571
|
});
|
|
2549
|
-
|
|
2572
|
+
var _excluded$7F = ["color", "size", "className", "spin", "style"];
|
|
2573
|
+
var PlusOutlined = function PlusOutlined2(props) {
|
|
2574
|
+
var color = props.color, size = props.size, className = props.className, spin = props.spin, _props$style = props.style, style = _props$style === void 0 ? {} : _props$style, otherProps = _objectWithoutProperties(props, _excluded$7F);
|
|
2575
|
+
var config = useConfig();
|
|
2576
|
+
var _ref = config || {}, cls = _ref.cls;
|
|
2577
|
+
return /* @__PURE__ */ React__default.createElement("span", _extends({
|
|
2578
|
+
className: classnames("easyv-icon", {
|
|
2579
|
+
"easyv-icon-loading": spin
|
|
2580
|
+
}, cls, className),
|
|
2581
|
+
style: _objectSpread2({
|
|
2582
|
+
color,
|
|
2583
|
+
fontSize: size
|
|
2584
|
+
}, style)
|
|
2585
|
+
}, otherProps), /* @__PURE__ */ React__default.createElement("svg", {
|
|
2586
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2587
|
+
width: "1em",
|
|
2588
|
+
height: "1em",
|
|
2589
|
+
viewBox: "0 0 24 24",
|
|
2590
|
+
fill: "currentColor"
|
|
2591
|
+
}, /* @__PURE__ */ React__default.createElement("path", {
|
|
2592
|
+
fillRule: "evenodd",
|
|
2593
|
+
clipRule: "evenodd",
|
|
2594
|
+
d: "M3.52 12.65c0 .221.18.4.4.4h7.1v7.1c0 .221.18.4.4.4h1.4a.4.4 0 00.4-.4v-7.1h6.9a.4.4 0 00.4-.4v-1.4a.4.4 0 00-.4-.4h-6.9v-6.9a.4.4 0 00-.4-.4h-1.4a.4.4 0 00-.4.4v6.9h-7.1a.4.4 0 00-.4.4v1.4z"
|
|
2595
|
+
})));
|
|
2596
|
+
};
|
|
2597
|
+
PlusOutlined.propTypes = {
|
|
2550
2598
|
color: PropTypes.string,
|
|
2551
2599
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
2552
2600
|
spin: PropTypes.bool
|
|
2553
|
-
}
|
|
2601
|
+
};
|
|
2554
2602
|
({
|
|
2555
2603
|
color: PropTypes.string,
|
|
2556
2604
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
@@ -5148,6 +5196,8 @@ CopyCircleOutlined.propTypes = {
|
|
|
5148
5196
|
});
|
|
5149
5197
|
export {
|
|
5150
5198
|
CopyCircleOutlined,
|
|
5199
|
+
EditOutlined,
|
|
5200
|
+
PlusOutlined,
|
|
5151
5201
|
useConfig
|
|
5152
5202
|
};
|
|
5153
5203
|
//# sourceMappingURL=index.esm.es.js.map
|