@easyv/biz-components 1.0.22 → 1.0.23

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.
@@ -1,5 +1,5 @@
1
- import { default as Input } from 'antd/es/input';
2
1
  import { ComponentProps } from 'react';
2
+ import { default as Input } from 'antd/es/input';
3
3
 
4
4
  export interface EasyvInputProps {
5
5
  className?: string;
@@ -1,11 +1,10 @@
1
1
  import { j as jsxRuntimeExports } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
2
2
  import Input from "../../node_modules/.pnpm/antd@4.24.1_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/antd/es/input/index.es.js";
3
3
  import classNames from "../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js";
4
- /* empty css */
5
4
  import styles from "./input.module.less.es.js";
6
5
  const EasyvInput = (props) => {
7
6
  const { className = "", ...rest } = props;
8
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles["easyv-input"], children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { className: classNames("biz-bg-bg-white", className), ...rest }) });
7
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles["easyv-input-wrapper"], children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { className: classNames("biz-bg-bg-white", className), ...rest }) });
9
8
  };
10
9
  export {
11
10
  EasyvInput
@@ -1 +1 @@
1
- {"version":3,"file":"input.es.js","sources":["../../../src/ant-components/input/input.tsx"],"sourcesContent":["import Input from 'antd/es/input';\nimport classNames from 'classnames';\nimport 'antd/es/input/style/index.css';\nimport { ComponentProps } from 'react';\nimport styles from './input.module.less';\n\nexport interface EasyvInputProps {\n className?: string;\n}\n\ntype inputProps = ComponentProps<typeof Input>;\n\nexport const EasyvInput = (props: inputProps) => {\n const { className = '', ...rest } = props;\n\n return (\n <div className={styles['easyv-input']}>\n <Input className={classNames('biz-bg-bg-white', className)} {...rest} />\n </div>\n );\n};\n"],"names":["jsx"],"mappings":";;;;;AAYa,MAAA,aAAa,CAAC,UAAsB;AAC/C,QAAM,EAAE,YAAY,IAAI,GAAG,KAAS,IAAA;AAEpC,SACGA,kCAAAA,IAAA,OAAA,EAAI,WAAW,OAAO,aAAa,GAClC,UAAAA,kCAAA,IAAC,OAAM,EAAA,WAAW,WAAW,mBAAmB,SAAS,GAAI,GAAG,KAAM,CAAA,GACxE;AAEJ;"}
1
+ {"version":3,"file":"input.es.js","sources":["../../../src/ant-components/input/input.tsx"],"sourcesContent":["// import 'antd/es/input/style/index.css';\nimport { ComponentProps } from 'react';\nimport Input from 'antd/es/input';\nimport classNames from 'classnames';\nimport styles from './input.module.less';\n\nexport interface EasyvInputProps {\n className?: string;\n}\n\ntype inputProps = ComponentProps<typeof Input>;\n\nexport const EasyvInput = (props: inputProps) => {\n const { className = '', ...rest } = props;\n\n return (\n <div className={styles['easyv-input-wrapper']}>\n <Input className={classNames('biz-bg-bg-white', className)} {...rest} />\n </div>\n );\n};\n"],"names":["jsx"],"mappings":";;;;AAYa,MAAA,aAAa,CAAC,UAAsB;AAC/C,QAAM,EAAE,YAAY,IAAI,GAAG,KAAS,IAAA;AAEpC,SACGA,kCAAAA,IAAA,OAAA,EAAI,WAAW,OAAO,qBAAqB,GAC1C,UAAAA,kCAAA,IAAC,OAAM,EAAA,WAAW,WAAW,mBAAmB,SAAS,GAAI,GAAG,KAAM,CAAA,GACxE;AAEJ;"}
@@ -1,5 +1,5 @@
1
1
  const styles = {
2
- "easyv-input": "input-module__easyv-input___nz1XS"
2
+ "easyv-input-wrapper": "input-module__easyv-input-wrapper___yZNjZ"
3
3
  };
4
4
  export {
5
5
  styles as default
@@ -7,5 +7,11 @@ export interface AiModelSelectPanelProps {
7
7
  style?: React.CSSProperties;
8
8
  titleClassName?: string;
9
9
  itemClassName?: string;
10
+ renderInput: (props: {
11
+ value: string;
12
+ onChange: (value: string) => void;
13
+ onPressEnter: () => void;
14
+ onBlur: () => void;
15
+ }) => React.ReactNode;
10
16
  }
11
17
  export declare const AiModelSelectPanel: (props: AiModelSelectPanelProps) => JSX.Element;
@@ -3,7 +3,6 @@ import { useState } from "react";
3
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
4
  import classNames from "../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js";
5
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
6
  import { IconBtn } from "./iconBtn.es.js";
8
7
  const AiModelSelectPanel = (props) => {
9
8
  const {
@@ -12,7 +11,8 @@ const AiModelSelectPanel = (props) => {
12
11
  onSelect,
13
12
  style,
14
13
  titleClassName,
15
- itemClassName
14
+ itemClassName,
15
+ renderInput
16
16
  } = props;
17
17
  const [customModelServiceProviderList, setCustomModelServiceProviderList] = useState(
18
18
  modelServiceProviderList.filter((item) => item.isCustom)
@@ -71,6 +71,20 @@ const AiModelSelectPanel = (props) => {
71
71
  }
72
72
  )
73
73
  ] });
74
+ const handlePressEnter = () => {
75
+ if (inputValue) {
76
+ setCustomModelServiceProviderList(
77
+ produce(customModelServiceProviderList, (draft) => {
78
+ const index = draft.findIndex((i) => i.id === modelProvider.id);
79
+ if (index !== -1) {
80
+ draft[index].modelList = [{ id: inputValue, name: inputValue }];
81
+ }
82
+ })
83
+ );
84
+ setShowInputProviderId("");
85
+ setInputValue("");
86
+ }
87
+ };
74
88
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
75
89
  "div",
76
90
  {
@@ -85,27 +99,12 @@ const AiModelSelectPanel = (props) => {
85
99
  handleSelect(modelProvider, model);
86
100
  }
87
101
  },
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
102
+ children: showInputProviderId === modelProvider.id ? renderInput({
103
+ value: inputValue,
104
+ onChange: (value) => setInputValue(value),
105
+ onPressEnter: handlePressEnter,
106
+ onBlur: handlePressEnter
107
+ }) : normalContent
109
108
  },
110
109
  model == null ? void 0 : model.id
111
110
  );
@@ -1 +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,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE;AAEE,QAAA,CAAC,gCAAgC,iCAAiC,IAAI;AAAA,IAC1E,yBAAyB,OAAO,CAAC,SAAS,KAAK,QAAQ;AAAA,EACzD;AACA,QAAM,CAAC,qBAAqB,sBAAsB,IAAI,S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AAA;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;"}
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 { 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 renderInput: (props: {\n value: string;\n onChange: (value: string) => void;\n onPressEnter: () => void;\n onBlur: () => void;\n }) => React.ReactNode;\n}\n\nexport const AiModelSelectPanel = (props: AiModelSelectPanelProps) => {\n const {\n className = '',\n modelServiceProviderList,\n onSelect,\n style,\n titleClassName,\n itemClassName,\n renderInput,\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\n const handlePressEnter = () => {\n if (inputValue) {\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 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 ? renderInput({\n value: inputValue,\n onChange: (value) => setInputValue(value),\n onPressEnter: handlePressEnter,\n onBlur: handlePressEnter,\n })\n : normalContent}\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":";;;;;;AAsBa,MAAA,qBAAqB,CAAC,UAAmC;AAC9D,QAAA;AAAA,IACJ,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE;AAEE,QAAA,CAAC,gCAAgC,iCAAiC,IAAI;AAA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