@hkyhy/marsun-components-core 0.1.45 → 0.1.47
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/File/FilePreview/FilePreviewContent.js +108 -58
- package/dist/components/File/FilePreview/FilePreviewContent.js.map +1 -1
- package/dist/components/Form/index.d.ts +1 -1
- package/dist/components/Form/kneFormInfo.d.ts +2 -0
- package/dist/components/Form/kneFormInfo.js +18 -17
- package/dist/components/Form/kneFormInfo.js.map +1 -1
- package/dist/components/OrgTree/OrgTree.js +52 -43
- package/dist/components/OrgTree/OrgTree.js.map +1 -1
- package/dist/components/OrgTree/style.module.scss.js +5 -5
- package/dist/components/PermissionBindPanel/PermissionBindPanel.d.ts +4 -1
- package/dist/components/PermissionBindPanel/PermissionBindPanel.js +121 -117
- package/dist/components/PermissionBindPanel/PermissionBindPanel.js.map +1 -1
- package/dist/components/Stat/StatCard/index.d.ts +4 -0
- package/dist/components/Stat/StatCard/index.js +45 -29
- package/dist/components/Stat/StatCard/index.js.map +1 -1
- package/dist/components/Stat/StatCardList.d.ts +0 -2
- package/dist/components/Stat/StatCardList.js.map +1 -1
- package/dist/components/TooltipInfo/TooltipInfo.js +14 -8
- package/dist/components/TooltipInfo/TooltipInfo.js.map +1 -1
- package/dist/components/Upload/index.d.ts +6 -23
- package/dist/components/Upload/index.js +254 -141
- package/dist/components/Upload/index.js.map +1 -1
- package/dist/components/Upload/style.module.scss.js +22 -15
- package/dist/components/Upload/style.module.scss.js.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +132 -131
- package/dist/marsun-components-core.css +1 -1
- package/dist/styles/global.css +1 -1
- package/package.json +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Upload/index.tsx"],"sourcesContent":["import { Trash2, File, Inbox, Upload as UploadIcon } from '@/components/Icons';\nimport { Button, message, Tag, Typography, Upload } from 'antd';\nimport type { UploadFile } from 'antd/es/upload/interface';\nimport React from 'react';\nimport styles from './style.module.scss';\nimport classNames from 'classnames';\n\n/* ---------- types ---------- */\n\n/** 上传变体 */\nexport type UploadVariant = 'panel' | 'button';\n\nexport interface CommonUploadProps {\n /* ---- antd Form.Item 兼容属性 ---- */\n value?: UploadFile[];\n onChange?: (value: UploadFile[]) => void;\n\n /* ---- 容器/样式 ---- */\n className?: string;\n\n /* ---- 上传配置 ---- */\n /** 单文件大小限制(字节),默认 500MB */\n fileSize?: number;\n /** 最大上传数量 */\n maxLength?: number;\n multiple?: boolean;\n /** 目录上传模式(webkitdirectory),选中整个文件夹并保留 webkitRelativePath */\n directory?: boolean;\n size?: 'small' | 'middle' | 'large';\n accept?: string;\n\n /* ---- UI 变体 ---- */\n /** panel = 拖拽面板(Dragger 样式),button = 按钮(默认) */\n variant?: UploadVariant;\n children?: React.ReactNode;\n renderTips?: () => React.ReactNode;\n\n /* ---- 文件列表展示 ---- */\n /** 是否展示已上传文件列表,默认 true(tips 下方) */\n showFileList?: boolean;\n\n /* ---- 回调 ---- */\n onSave?: (fileList: UploadFile[]) => void;\n ossUpload?: boolean;\n onUpload?: (options: {\n file: File;\n onSuccess: (url?: string) => void;\n onError: (err: Error) => void;\n }) => Promise<void> | void;\n getPermission?: (file: File) => boolean;\n concurrentCount?: number;\n}\n\nexport type CommonUploadRef = {\n upload: () => void;\n uploading: boolean;\n};\n\n/* ---------- utils ---------- */\n\nconst formatSize = (bytes: number): string => {\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)}KB`;\n if (bytes < 1024 ** 3) return `${(bytes / 1024 / 1024).toFixed(0)}M`;\n return `${(bytes / 1024 ** 3).toFixed(1)}G`;\n};\n\nfunction buildTips(accept?: string, fileSize?: number, maxLength?: number): React.ReactNode {\n const parts: string[] = [];\n if (accept) {\n const exts = accept\n .split(',')\n .map((s) => s.trim().replace(/^\\./, ''))\n .filter(Boolean);\n if (exts.length) parts.push(`支持扩展名${exts.join(',')}`);\n }\n if (fileSize) parts.push(`单个文件大小不超过${formatSize(fileSize)}`);\n if (maxLength) parts.push(`最多上传${maxLength}个附件`);\n return parts.length ? (\n <Typography.Text type=\"secondary\" className={classNames('upload-item', styles['upload-item'])}>\n {parts.join(',')}\n </Typography.Text>\n ) : null;\n}\n\nfunction getExt(filename: string): string {\n const idx = filename.lastIndexOf('.');\n return idx >= 0 ? filename.slice(idx + 1).toUpperCase() : '';\n}\n\n/* ---------- 子组件:已上传文件列表 ---------- */\n\ninterface UploadedFilesProps {\n fileList: UploadFile[];\n onRemove: (uid: string) => void;\n}\n\nconst UploadedFiles: React.FC<UploadedFilesProps> = ({ fileList, onRemove }) => {\n if (!fileList.length) return null;\n\n return (\n <div className={classNames('upload-link', styles['upload-link'])}>\n {fileList.map((file) => (\n <div\n key={file.uid}\n className={classNames(\n classNames('upload-file-row', styles['upload-file-row']),\n file.status === 'error' &&\n classNames('upload-file-row-error', styles['upload-file-row-error']),\n )}\n >\n <div className={classNames('upload-label', styles['upload-label'])}>\n <File className={classNames('upload-value', styles['upload-value'])} />\n <span className={classNames('upload-meta', styles['upload-meta'])}>{file.name}</span>\n <Tag color=\"processing\" className={classNames('upload-icon', styles['upload-icon'])}>\n {getExt(file.name)}\n </Tag>\n {file.size && (\n <Typography.Text\n type=\"secondary\"\n className={classNames('upload-title', styles['upload-title'])}\n >\n {formatSize(file.size)}\n </Typography.Text>\n )}\n </div>\n <Button\n type=\"text\"\n danger\n size=\"small\"\n icon={<Trash2 />}\n onClick={() => onRemove(file.uid)}\n className={classNames('upload-desc', styles['upload-desc'])}\n />\n </div>\n ))}\n </div>\n );\n};\n\n/* ---------- 主组件 ---------- */\n\n/**\n * CommonUpload — 通用上传组件\n *\n * - 在 antd `<Form.Item>` 内使用时,通过 `value`/`onChange` 自动接入表单\n * - 独立使用时,通过 `onSave` 获取文件列表\n *\n * ## 两种变体\n *\n * - **`variant=\"button\"`(默认)** — 虚线边框按钮 + 底部提示文案 + 已传文件列表\n * - **`variant=\"panel\"`** — Dragger 拖拽面板 + 底部已传文件列表\n *\n * @example\n * ```tsx\n * // 在 Form.Item 中使用\n * <Form.Item name=\"files\" label=\"简历附件\" rules={[{ required: true, message: '请上传文件' }]}>\n * <CommonUpload accept=\".pdf,.jpg,.png\" maxLength={10} />\n * </Form.Item>\n *\n * // 独立使用(Modal 内、非表单场景)\n * <CommonUpload variant=\"panel\" accept=\".doc,.pdf\" onSave={(list) => setFiles(list)} />\n *\n * // ref 手动触发上传\n * const ref = useRef<CommonUploadRef>(null);\n * <CommonUpload ref={ref} onUpload={...} />;\n * ref.current?.upload();\n * ```\n */\nconst CommonUpload = React.forwardRef<CommonUploadRef, CommonUploadProps>(\n (\n {\n value,\n onChange,\n className,\n variant,\n size,\n children,\n renderTips,\n showFileList = true,\n fileSize,\n maxLength,\n multiple,\n directory,\n accept,\n onUpload,\n onSave,\n getPermission,\n concurrentCount,\n },\n ref,\n ) => {\n const [innerFileList, setInnerFileList] = React.useState<UploadFile[]>([]);\n const [uploading, setUploading] = React.useState(false);\n\n // 受控模式:value 优先;非受控:内部状态\n const fileList = value ?? innerFileList;\n const setFileList = React.useCallback(\n (next: UploadFile[] | ((prev: UploadFile[]) => UploadFile[])) => {\n const resolved = typeof next === 'function' ? next(fileList) : next;\n onChange?.(resolved);\n setInnerFileList(resolved);\n onSave?.(resolved);\n },\n [fileList, onChange, onSave],\n );\n\n const effectiveFileSize = fileSize ?? 500 * 1024 * 1024;\n const concurrent = concurrentCount ?? 3;\n\n const beforeUploadFn = React.useCallback(\n (file: File) => {\n if (getPermission && !getPermission(file)) {\n message.error('无权限上传此文件');\n return Upload.LIST_IGNORE;\n }\n if (file.size > effectiveFileSize) {\n message.error(`文件超出 ${formatSize(effectiveFileSize)} 限制`);\n return Upload.LIST_IGNORE;\n }\n return true;\n },\n [effectiveFileSize, getPermission],\n );\n\n const triggerUpload = React.useCallback(async () => {\n if (!onUpload || !fileList.length) return;\n setUploading(true);\n try {\n const pending = [...fileList];\n const pool: Promise<void>[] = [];\n while (pending.length) {\n const item = pending.shift();\n if (!item?.originFileObj) continue;\n const rawFile = item.originFileObj;\n pool.push(\n new Promise<void>((resolve) => {\n onUpload({\n file: rawFile,\n onSuccess: (url?) => {\n setFileList((prev) =>\n prev.map((f) =>\n f.uid === item.uid ? { ...f, status: 'done' as const, url: url ?? f.url } : f,\n ),\n );\n resolve();\n },\n onError: (_err: Error) => {\n message.error(`${item.name} 上传失败`);\n setFileList((prev) =>\n prev.map((f) => (f.uid === item.uid ? { ...f, status: 'error' as const } : f)),\n );\n resolve();\n },\n });\n }),\n );\n if (pool.length >= concurrent) await Promise.race(pool);\n }\n await Promise.allSettled(pool);\n onSave?.(fileList);\n } finally {\n setUploading(false);\n }\n }, [fileList, onUpload, concurrent, onSave, setFileList]);\n\n React.useImperativeHandle(ref, () => ({ upload: triggerUpload, uploading }), [\n triggerUpload,\n uploading,\n ]);\n\n const tips = renderTips?.() ?? buildTips(accept, fileSize, maxLength);\n\n if (variant === 'panel') {\n return (\n <div className={className}>\n <Upload.Dragger\n fileList={fileList}\n beforeUpload={beforeUploadFn}\n onChange={(info) => setFileList(info.fileList)}\n multiple={multiple}\n directory={directory}\n accept={accept}\n showUploadList={false}\n customRequest={({ onSuccess }) => onSuccess?.({})}\n >\n <p className={classNames('upload-drag-icon', styles['upload-drag-icon'])}>\n <Inbox />\n </p>\n <p className=\"ant-upload-text\">点击或拖拽文件到此区域上传</p>\n <p>{tips}</p>\n </Upload.Dragger>\n {showFileList && (\n <UploadedFiles\n fileList={fileList}\n onRemove={(uid) => setFileList((prev) => prev.filter((f) => f.uid !== uid))}\n />\n )}\n </div>\n );\n }\n\n // button mode (default)\n return (\n <div className={className}>\n <Upload\n fileList={fileList}\n beforeUpload={beforeUploadFn}\n onChange={(info) => setFileList(info.fileList)}\n multiple={multiple}\n directory={directory}\n accept={accept}\n showUploadList={false}\n customRequest={({ onSuccess }) => onSuccess?.({})}\n >\n {children ?? (\n <Button\n size={size}\n icon={<UploadIcon />}\n className={classNames('upload-toolbar', styles['upload-toolbar'])}\n >\n 点击上传\n </Button>\n )}\n </Upload>\n <div className={classNames('upload-list', styles['upload-list'])}>{tips}</div>\n {showFileList && (\n <UploadedFiles\n fileList={fileList}\n onRemove={(uid) => setFileList((prev) => prev.filter((f) => f.uid !== uid))}\n />\n )}\n </div>\n );\n },\n);\n\nCommonUpload.displayName = 'CommonUpload';\n\nexport default CommonUpload;\n"],"names":["formatSize","bytes","buildTips","accept","fileSize","maxLength","parts","exts","s","jsx","Typography","classNames","styles","getExt","filename","idx","UploadedFiles","fileList","onRemove","file","jsxs","File","Tag","Button","Trash2","CommonUpload","React","value","onChange","className","variant","size","children","renderTips","showFileList","multiple","directory","onUpload","onSave","getPermission","concurrentCount","ref","innerFileList","setInnerFileList","uploading","setUploading","setFileList","next","resolved","effectiveFileSize","concurrent","beforeUploadFn","message","Upload","triggerUpload","pending","pool","item","rawFile","resolve","url","prev","f","_err","tips","info","onSuccess","Inbox","uid","UploadIcon"],"mappings":";;;;;;AA4DA,MAAMA,IAAa,CAACC,MACdA,IAAQ,OAAO,OAAa,IAAIA,IAAQ,MAAM,QAAQ,CAAC,CAAC,OACxDA,IAAQ,QAAQ,IAAU,IAAIA,IAAQ,OAAO,MAAM,QAAQ,CAAC,CAAC,MAC1D,IAAIA,IAAQ,QAAQ,GAAG,QAAQ,CAAC,CAAC;AAG1C,SAASC,EAAUC,GAAiBC,GAAmBC,GAAqC;AAC1F,QAAMC,IAAkB,CAAA;AACxB,MAAIH,GAAQ;AACV,UAAMI,IAAOJ,EACV,MAAM,GAAG,EACT,IAAI,CAACK,MAAMA,EAAE,KAAA,EAAO,QAAQ,OAAO,EAAE,CAAC,EACtC,OAAO,OAAO;AACjB,IAAID,EAAK,UAAQD,EAAM,KAAK,QAAQC,EAAK,KAAK,GAAG,CAAC,EAAE;AAAA,EACtD;AACA,SAAIH,KAAUE,EAAM,KAAK,YAAYN,EAAWI,CAAQ,CAAC,EAAE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Y,CAACe,MAASA,EAAK,OAAO,CAACC,MAAMA,EAAE,QAAQM,CAAG,CAAC;AAAA,QAAA;AAAA,MAAA;AAAA,IAC5E,GAEJ,IAMF,gBAAAhD,EAAC,SAAI,WAAAS,GACH,UAAA;AAAA,MAAA,gBAAApB;AAAA,QAAC4C;AAAA,QAAA;AAAA,UACC,UAAApC;AAAA,UACA,cAAckC;AAAA,UACd,UAAU,CAACc,MAASnB,EAAYmB,EAAK,QAAQ;AAAA,UAC7C,UAAA9B;AAAA,UACA,WAAAC;AAAA,UACA,QAAAjC;AAAA,UACA,gBAAgB;AAAA,UAChB,eAAe,CAAC,EAAE,WAAA+D,QAAgBA,KAAA,gBAAAA,EAAY,CAAA;AAAA,UAE7C,UAAAlC,KACC,gBAAAvB;AAAA,YAACc;AAAA,YAAA;AAAA,cACC,MAAAQ;AAAA,cACA,wBAAOsC,GAAA,EAAW;AAAA,cAClB,WAAW1D,EAAW,kBAAkBC,EAAO,gBAAgB,CAAC;AAAA,cACjE,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAED;AAAA,MAAA;AAAA,MAGJ,gBAAAH,EAAC,SAAI,WAAWE,EAAW,eAAeC,EAAO,aAAa,CAAC,GAAI,UAAAoD,EAAA,CAAK;AAAA,MACvE9B,KACC,gBAAAzB;AAAA,QAACO;AAAA,QAAA;AAAA,UACC,UAAAC;AAAA,UACA,UAAU,CAACmD,MAAQtB,EAAY,CAACe,MAASA,EAAK,OAAO,CAACC,MAAMA,EAAE,QAAQM,CAAG,CAAC;AAAA,QAAA;AAAA,MAAA;AAAA,IAC5E,GAEJ;AAAA,EAEJ;AACF;AAEA3C,GAAa,cAAc;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Upload/index.tsx"],"sourcesContent":["import { Trash2, File, Inbox, Plus, Upload as UploadIcon } from '@/components/Icons';\nimport { SEMANTIC_COLORS, SemanticTag } from '@/components/Tag';\nimport { Button, Image, message, Typography, Upload } from 'antd';\nimport type { UploadFile } from 'antd/es/upload/interface';\nimport React from 'react';\nimport styles from './style.module.scss';\nimport classNames from 'classnames';\n\n/* ---------- types ---------- */\n\n/** 上传变体 */\nexport type UploadVariant = 'panel' | 'button';\n\n/** 已选文件列表样式:text=行列表;picture-card=图片卡片(含预览) */\nexport type UploadListType = 'text' | 'picture-card';\n\nexport interface CommonUploadProps {\n /* ---- antd Form.Item 兼容属性 ---- */\n value?: UploadFile[];\n onChange?: (value: UploadFile[]) => void;\n\n /* ---- 容器/样式 ---- */\n className?: string;\n\n /* ---- 上传配置 ---- */\n /** 单文件大小限制(字节),默认 500MB */\n fileSize?: number;\n /** 最大上传数量 */\n maxLength?: number;\n multiple?: boolean;\n /** 目录上传模式(webkitdirectory),选中整个文件夹并保留 webkitRelativePath */\n directory?: boolean;\n size?: 'small' | 'middle' | 'large';\n accept?: string;\n\n /* ---- UI 变体 ---- */\n /** panel = 拖拽面板(Dragger 样式),button = 按钮(默认) */\n variant?: UploadVariant;\n /** 列表展现;图片场景用 picture-card(预览+缩略图) */\n listType?: UploadListType;\n children?: React.ReactNode;\n renderTips?: () => React.ReactNode;\n\n /* ---- 文件列表展示 ---- */\n /** 是否展示已上传文件列表,默认 true(tips 下方) */\n showFileList?: boolean;\n\n /* ---- 回调 ---- */\n onSave?: (fileList: UploadFile[]) => void;\n ossUpload?: boolean;\n onUpload?: (options: {\n file: File;\n onSuccess: (url?: string) => void;\n onError: (err: Error) => void;\n }) => Promise<void> | void;\n getPermission?: (file: File) => boolean;\n concurrentCount?: number;\n}\n\nexport type CommonUploadRef = {\n upload: () => void;\n uploading: boolean;\n};\n\n/* ---------- utils ---------- */\n\nconst formatSize = (bytes: number): string => {\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)}KB`;\n if (bytes < 1024 ** 3) return `${(bytes / 1024 / 1024).toFixed(0)}M`;\n return `${(bytes / 1024 ** 3).toFixed(1)}G`;\n};\n\nfunction buildTips(accept?: string, fileSize?: number, maxLength?: number): React.ReactNode {\n const parts: string[] = [];\n if (accept) {\n const exts = accept\n .split(',')\n .map((s) => s.trim().replace(/^\\./, ''))\n .filter(Boolean);\n if (exts.length) parts.push(`支持扩展名${exts.join(',')}`);\n }\n if (fileSize) parts.push(`单个文件大小不超过${formatSize(fileSize)}`);\n if (maxLength) parts.push(`最多上传${maxLength}个附件`);\n return parts.length ? (\n <Typography.Text type=\"secondary\" className={classNames('upload-item', styles['upload-item'])}>\n {parts.join(',')}\n </Typography.Text>\n ) : null;\n}\n\nfunction getExt(filename: string): string {\n const idx = filename.lastIndexOf('.');\n return idx >= 0 ? filename.slice(idx + 1).toUpperCase() : '';\n}\n\nfunction resolvePreviewUrl(file: UploadFile): string {\n if (file.url) return file.url;\n if (file.thumbUrl) return file.thumbUrl;\n if (file.originFileObj) return URL.createObjectURL(file.originFileObj);\n return '';\n}\n\n/* ---------- 子组件:文本行列表 ---------- */\n\ninterface UploadedFilesProps {\n fileList: UploadFile[];\n onRemove: (uid: string) => void;\n onPreview?: (file: UploadFile) => void;\n}\n\nconst UploadedFiles: React.FC<UploadedFilesProps> = ({ fileList, onRemove, onPreview }) => {\n if (!fileList.length) return null;\n\n return (\n <div className={classNames('upload-link', styles['upload-link'])}>\n {fileList.map((file) => {\n const previewable = Boolean(\n file.url || file.thumbUrl || file.originFileObj?.type?.startsWith('image/'),\n );\n return (\n <div\n key={file.uid}\n className={classNames(\n classNames('upload-file-row', styles['upload-file-row']),\n file.status === 'error' &&\n classNames('upload-file-row-error', styles['upload-file-row-error']),\n )}\n >\n <div className={classNames('upload-label', styles['upload-label'])}>\n {file.thumbUrl || (file.url && file.type?.startsWith('image/')) ? (\n <button\n type=\"button\"\n className={classNames('upload-thumb-btn', styles['upload-thumb-btn'])}\n onClick={() => onPreview?.(file)}\n title=\"预览\"\n >\n <img\n className={classNames('upload-thumb', styles['upload-thumb'])}\n src={file.thumbUrl || file.url}\n alt={file.name}\n />\n </button>\n ) : (\n <File className={classNames('upload-value', styles['upload-value'])} />\n )}\n <span className={classNames('upload-meta', styles['upload-meta'])}>{file.name}</span>\n <SemanticTag\n color={SEMANTIC_COLORS.INFO}\n className={classNames('upload-icon', styles['upload-icon'])}\n >\n {getExt(file.name)}\n </SemanticTag>\n {file.size ? (\n <Typography.Text\n type=\"secondary\"\n className={classNames('upload-title', styles['upload-title'])}\n >\n {formatSize(file.size)}\n </Typography.Text>\n ) : null}\n </div>\n <div className={classNames('upload-row-actions', styles['upload-row-actions'])}>\n {previewable && onPreview ? (\n <Button type=\"link\" size=\"small\" onClick={() => onPreview(file)}>\n 预览\n </Button>\n ) : null}\n <Button\n type=\"text\"\n danger\n size=\"small\"\n icon={<Trash2 />}\n onClick={() => onRemove(file.uid)}\n className={classNames('upload-desc', styles['upload-desc'])}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\n/* ---------- 主组件 ---------- */\n\n/**\n * CommonUpload — 通用上传组件\n *\n * - `listType=\"text\"`(默认):行列表;图片有缩略图时可「预览」\n * - `listType=\"picture-card\"`:antd 图片卡片(内置预览/删除图标)\n */\nconst CommonUpload = React.forwardRef<CommonUploadRef, CommonUploadProps>(\n (\n {\n value,\n onChange,\n className,\n variant,\n listType = 'text',\n size,\n children,\n renderTips,\n showFileList = true,\n fileSize,\n maxLength,\n multiple,\n directory,\n accept,\n onUpload,\n onSave,\n getPermission,\n concurrentCount,\n },\n ref,\n ) => {\n const [innerFileList, setInnerFileList] = React.useState<UploadFile[]>([]);\n const [uploading, setUploading] = React.useState(false);\n const [preview, setPreview] = React.useState<{ open: boolean; url: string; title: string }>({\n open: false,\n url: '',\n title: '',\n });\n const blobUrlsRef = React.useRef<string[]>([]);\n\n // 受控模式:value 优先;非受控:内部状态\n const fileList = value ?? innerFileList;\n const setFileList = React.useCallback(\n (next: UploadFile[] | ((prev: UploadFile[]) => UploadFile[])) => {\n const resolved = typeof next === 'function' ? next(fileList) : next;\n onChange?.(resolved);\n setInnerFileList(resolved);\n onSave?.(resolved);\n },\n [fileList, onChange, onSave],\n );\n\n const effectiveFileSize = fileSize ?? 500 * 1024 * 1024;\n const concurrent = concurrentCount ?? 3;\n\n const beforeUploadFn = React.useCallback(\n (file: File) => {\n if (getPermission && !getPermission(file)) {\n message.error('无权限上传此文件');\n return Upload.LIST_IGNORE;\n }\n if (file.size > effectiveFileSize) {\n message.error(`文件超出 ${formatSize(effectiveFileSize)} 限制`);\n return Upload.LIST_IGNORE;\n }\n return true;\n },\n [effectiveFileSize, getPermission],\n );\n\n const triggerUpload = React.useCallback(async () => {\n if (!onUpload || !fileList.length) return;\n setUploading(true);\n try {\n const pending = [...fileList];\n const pool: Promise<void>[] = [];\n while (pending.length) {\n const item = pending.shift();\n if (!item?.originFileObj) continue;\n const rawFile = item.originFileObj;\n pool.push(\n new Promise<void>((resolve) => {\n onUpload({\n file: rawFile,\n onSuccess: (url?) => {\n setFileList((prev) =>\n prev.map((f) =>\n f.uid === item.uid ? { ...f, status: 'done' as const, url: url ?? f.url } : f,\n ),\n );\n resolve();\n },\n onError: (_err: Error) => {\n message.error(`${item.name} 上传失败`);\n setFileList((prev) =>\n prev.map((f) => (f.uid === item.uid ? { ...f, status: 'error' as const } : f)),\n );\n resolve();\n },\n });\n }),\n );\n if (pool.length >= concurrent) await Promise.race(pool);\n }\n await Promise.allSettled(pool);\n onSave?.(fileList);\n } finally {\n setUploading(false);\n }\n }, [fileList, onUpload, concurrent, onSave, setFileList]);\n\n React.useImperativeHandle(ref, () => ({ upload: triggerUpload, uploading }), [\n triggerUpload,\n uploading,\n ]);\n\n const openPreview = React.useCallback((file: UploadFile) => {\n const url = resolvePreviewUrl(file);\n if (!url) {\n message.warning('暂无法预览该文件');\n return;\n }\n if (url.startsWith('blob:')) {\n blobUrlsRef.current.push(url);\n }\n setPreview({ open: true, url, title: file.name || '预览' });\n }, []);\n\n React.useEffect(\n () => () => {\n blobUrlsRef.current.forEach((u) => URL.revokeObjectURL(u));\n blobUrlsRef.current = [];\n },\n [],\n );\n\n const tips = renderTips?.() ?? buildTips(accept, fileSize, maxLength);\n const canAddMore = !maxLength || fileList.length < maxLength;\n\n const previewNode = (\n <Image\n alt={preview.title}\n style={{ display: 'none' }}\n src={preview.url}\n preview={{\n visible: preview.open,\n src: preview.url,\n onVisibleChange: (visible) => setPreview((prev) => ({ ...prev, open: visible })),\n }}\n />\n );\n\n if (listType === 'picture-card') {\n return (\n <div\n className={classNames('upload-picture-root', styles['upload-picture-root'], className)}\n >\n <Upload\n listType=\"picture-card\"\n fileList={fileList}\n beforeUpload={beforeUploadFn}\n onChange={(info) => setFileList(info.fileList)}\n onPreview={openPreview}\n multiple={multiple}\n directory={directory}\n accept={accept}\n showUploadList={{ showPreviewIcon: true, showRemoveIcon: true }}\n customRequest={({ onSuccess }) => onSuccess?.({})}\n className={classNames('upload-picture-card', styles['upload-picture-card'])}\n >\n {canAddMore ? (\n <div\n className={classNames('upload-picture-trigger', styles['upload-picture-trigger'])}\n >\n <Plus size={20} />\n <div\n className={classNames(\n 'upload-picture-trigger-text',\n styles['upload-picture-trigger-text'],\n )}\n >\n 上传图片\n </div>\n </div>\n ) : null}\n </Upload>\n {tips ? (\n <div className={classNames('upload-list', styles['upload-list'])}>{tips}</div>\n ) : null}\n {previewNode}\n </div>\n );\n }\n\n if (variant === 'panel') {\n return (\n <div className={className}>\n <Upload.Dragger\n fileList={fileList}\n beforeUpload={beforeUploadFn}\n onChange={(info) => setFileList(info.fileList)}\n multiple={multiple}\n directory={directory}\n accept={accept}\n showUploadList={false}\n customRequest={({ onSuccess }) => onSuccess?.({})}\n >\n <p className={classNames('upload-drag-icon', styles['upload-drag-icon'])}>\n <Inbox />\n </p>\n <p className=\"ant-upload-text\">点击或拖拽文件到此区域上传</p>\n <p>{tips}</p>\n </Upload.Dragger>\n {showFileList && (\n <UploadedFiles\n fileList={fileList}\n onRemove={(uid) => setFileList((prev) => prev.filter((f) => f.uid !== uid))}\n onPreview={openPreview}\n />\n )}\n {previewNode}\n </div>\n );\n }\n\n // button mode (default) + text list\n return (\n <div className={className}>\n <Upload\n fileList={fileList}\n beforeUpload={beforeUploadFn}\n onChange={(info) => setFileList(info.fileList)}\n multiple={multiple}\n directory={directory}\n accept={accept}\n showUploadList={false}\n customRequest={({ onSuccess }) => onSuccess?.({})}\n >\n {children ?? (\n <Button\n size={size}\n icon={<UploadIcon />}\n className={classNames('upload-toolbar', styles['upload-toolbar'])}\n >\n 点击上传\n </Button>\n )}\n </Upload>\n <div className={classNames('upload-list', styles['upload-list'])}>{tips}</div>\n {showFileList && (\n <UploadedFiles\n fileList={fileList}\n onRemove={(uid) => setFileList((prev) => prev.filter((f) => f.uid !== uid))}\n onPreview={openPreview}\n />\n )}\n {previewNode}\n </div>\n );\n },\n);\n\nCommonUpload.displayName = 'CommonUpload';\n\nexport default CommonUpload;\n"],"names":["formatSize","bytes","buildTips","accept","fileSize","maxLength","parts","exts","s","jsx","Typography","classNames","styles","getExt","filename","idx","resolvePreviewUrl","file","UploadedFiles","fileList","onRemove","onPreview","previewable","_b","_a","jsxs","_c","File","SemanticTag","SEMANTIC_COLORS","Button","Trash2","CommonUpload","React","value","onChange","className","variant","listType","size","children","renderTips","showFileList","multiple","directory","onUpload","onSave","getPermission","concurrentCount","ref","innerFileList","setInnerFileList","uploading","setUploading","preview","setPreview","blobUrlsRef","setFileList","next","resolved","effectiveFileSize","concurrent","beforeUploadFn","message","Upload","triggerUpload","pending","pool","item","rawFile","resolve","url","prev","f","_err","openPreview","u","tips","canAddMore","previewNode","Image","visible","info","onSuccess","Plus","Inbox","uid","UploadIcon"],"mappings":";;;;;;;AAkEA,MAAMA,IAAa,CAACC,MACdA,IAAQ,OAAO,OAAa,IAAIA,IAAQ,MAAM,QAAQ,CAAC,CAAC,OACxDA,IAAQ,QAAQ,IAAU,IAAIA,IAAQ,OAAO,MAAM,QAAQ,CAAC,CAAC,MAC1D,IAAIA,IAAQ,QAAQ,GAAG,QAAQ,CAAC,CAAC;AAG1C,SAASC,GAAUC,GAAiBC,GAAmBC,GAAqC;AAC1F,QAAMC,IAAk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upload-
|
|
10
|
-
"upload-
|
|
11
|
-
"upload-
|
|
12
|
-
"upload-
|
|
13
|
-
"upload-
|
|
14
|
-
"upload-
|
|
1
|
+
const p = {
|
|
2
|
+
"upload-item": "_upload-item_1xwph_67",
|
|
3
|
+
"upload-link": "_upload-link_1xwph_73",
|
|
4
|
+
"upload-label": "_upload-label_1xwph_80",
|
|
5
|
+
"upload-thumb-btn": "_upload-thumb-btn_1xwph_87",
|
|
6
|
+
"upload-thumb": "_upload-thumb_1xwph_87",
|
|
7
|
+
"upload-row-actions": "_upload-row-actions_1xwph_107",
|
|
8
|
+
"upload-picture-root": "_upload-picture-root_1xwph_114",
|
|
9
|
+
"upload-picture-card": "_upload-picture-card_1xwph_119",
|
|
10
|
+
"upload-picture-trigger": "_upload-picture-trigger_1xwph_125",
|
|
11
|
+
"upload-picture-trigger-text": "_upload-picture-trigger-text_1xwph_134",
|
|
12
|
+
"upload-value": "_upload-value_1xwph_139",
|
|
13
|
+
"upload-meta": "_upload-meta_1xwph_144",
|
|
14
|
+
"upload-icon": "_upload-icon_1xwph_150",
|
|
15
|
+
"upload-title": "_upload-title_1xwph_155",
|
|
16
|
+
"upload-desc": "_upload-desc_1xwph_161",
|
|
17
|
+
"upload-toolbar": "_upload-toolbar_1xwph_170",
|
|
18
|
+
"upload-list": "_upload-list_1xwph_180",
|
|
19
|
+
"upload-file-row": "_upload-file-row_1xwph_184",
|
|
20
|
+
"upload-file-row-error": "_upload-file-row-error_1xwph_195",
|
|
21
|
+
"upload-drag-icon": "_upload-drag-icon_1xwph_200"
|
|
15
22
|
};
|
|
16
23
|
export {
|
|
17
|
-
|
|
24
|
+
p as default
|
|
18
25
|
};
|
|
19
26
|
//# sourceMappingURL=style.module.scss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -16,7 +16,7 @@ export * from './Tag';
|
|
|
16
16
|
export * from './TooltipInfo';
|
|
17
17
|
export * from './Tour';
|
|
18
18
|
export { default as CommonUpload } from './Upload';
|
|
19
|
-
export type { CommonUploadProps, CommonUploadRef, UploadVariant } from './Upload';
|
|
19
|
+
export type { CommonUploadProps, CommonUploadRef, UploadListType, UploadVariant } from './Upload';
|
|
20
20
|
export * from './VirtualScrollbar';
|
|
21
21
|
export * from './Icons';
|
|
22
22
|
export * from './Sparkline';
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export * from './components/Tag';
|
|
|
42
42
|
export * from './components/TooltipInfo';
|
|
43
43
|
export * from './components/Tour';
|
|
44
44
|
export { default as CommonUpload } from './components/Upload';
|
|
45
|
-
export type { CommonUploadProps, CommonUploadRef, UploadVariant } from './components/Upload';
|
|
45
|
+
export type { CommonUploadProps, CommonUploadRef, UploadListType, UploadVariant, } from './components/Upload';
|
|
46
46
|
export * from './components/VirtualScrollbar';
|
|
47
47
|
export * from './components/Icons';
|
|
48
48
|
export * from './components/Sparkline';
|
package/dist/index.js
CHANGED
|
@@ -132,39 +132,39 @@ import { default as hl } from "./components/ReactFilter/withFilterValue.js";
|
|
|
132
132
|
import { CHUNK_METHOD_OPTIONS as Dl, EMBEDDING_MODEL_OPTIONS as Ml, PARSE_STATUS_CONFIG as Ll } from "./components/AgentHub/KnowledgeBase/constants/types.js";
|
|
133
133
|
import { CITATION_LINK_PREFIX as Al, citationDisplayNumber as Ol, citationIdToIndex as _l, countUniqueCitedSources as bl, detectCitationIdBase as yl, extractCitationIdsFromContent as vl, extractCitationTitle as wl, formatCitationDocBasename as Bl, formatCitationMeta as Ul, formatCitationPositions as kl, injectCitationMarkdownLinks as Nl, normalizeCitation as Hl, parseCitationLinkHref as Vl, prepareCitationContent as Kl, resolveCitationTitle as zl, sanitizeCitationHtml as Gl, stripCitationFrontmatter as Yl } from "./components/AgentHub/Chat/utils/citationContent.js";
|
|
134
134
|
import { COLUMN_CONFIG_COL_KEY as Xl, FLEX_SPACER_COL_KEY as ql, applyColumnConfig as Zl, columnsToConfig as jl, hideColumnAtPath as Jl, isInternalColumnKey as Ql } from "./components/Table/columnConfigUtils.js";
|
|
135
|
-
import { CancelButton as ei, Form as ti, FormInfo as ri, FormModal as oi, FormSteps as ai, FormStepsModal as si, Input as li, InputNumber as ii, List as mi, MultiField as fi, RadioGroup as pi, ResetButton as ni, Select as di, SubmitButton as ui, Switch as xi, TableList as ci, TextArea as Fi } from "./components/Form/kneFormInfo.js";
|
|
136
|
-
import { FILTER_CLASS as
|
|
137
|
-
import { FileItem as
|
|
138
|
-
import { FilterProvider as
|
|
139
|
-
import { GroupList as
|
|
140
|
-
import { MODAL_SIZE_BODY_HEIGHT as
|
|
135
|
+
import { CancelButton as ei, Form as ti, FormInfo as ri, FormModal as oi, FormSteps as ai, FormStepsModal as si, Input as li, InputNumber as ii, List as mi, MultiField as fi, RadioGroup as pi, ResetButton as ni, Select as di, SubmitButton as ui, Switch as xi, TableList as ci, TextArea as Fi, TreeSelect as Si } from "./components/Form/kneFormInfo.js";
|
|
136
|
+
import { FILTER_CLASS as Pi } from "./components/ReactFilter/filterClassNames.js";
|
|
137
|
+
import { FileItem as Ti } from "./components/File/FileItem/index.js";
|
|
138
|
+
import { FilterProvider as hi, useFilterDeps as Ri, useFilterFieldBridge as Di, useFilterRegister as Mi, useFilterState as Li } from "./components/Filter/useFilterState.js";
|
|
139
|
+
import { GroupList as Ai, RULES as Oi, default as _i, compileErrMsg as bi, computedFieldValueFromFormData as yi, computedFormDataFormState as vi, filterEmpty as wi, findField as Bi, formUtils as Ui, interceptors as ki, isEmpty as Ni, isNotEmpty as Hi, matchFields as Vi, preset as Ki, stateToError as zi, stateToIsPass as Gi, useField as Yi, useFormApi as Wi, useFormContext as Xi, useGroup as qi, useReset as Zi, useSubmit as ji } from "@kne/react-form";
|
|
140
|
+
import { MODAL_SIZE_BODY_HEIGHT as Qi, MODAL_SIZE_WIDTH as $i, resolveModalSizeAnchor as em, resolveModalWidth as tm } from "./components/Modal/utils/resolveModalSize.js";
|
|
141
141
|
import * as r from "./components/ReactFilter/fields/index.js";
|
|
142
|
-
import { NumberRangeFilterItem as
|
|
143
|
-
import { PageShellProvider as
|
|
144
|
-
import { SelectCascader as
|
|
145
|
-
import { default as
|
|
146
|
-
import { animateScrollFromTopToBottom as
|
|
147
|
-
import { applyHiddenRows as
|
|
148
|
-
import { buildDepsKey as
|
|
149
|
-
import { downloadFileItem as
|
|
150
|
-
import { emptyTablePrefs as
|
|
151
|
-
import { extractCitations as
|
|
152
|
-
import { default as
|
|
153
|
-
import { formatLlmTextToHtml as
|
|
154
|
-
import { getFileExtension as
|
|
155
|
-
import { hasCitationMarkers as
|
|
156
|
-
import { hasPermission as
|
|
157
|
-
import { sanitizeMermaidChart as
|
|
158
|
-
import { useAutoScrollToBottom as
|
|
159
|
-
import { useChat as
|
|
160
|
-
import { useChatSessions as
|
|
161
|
-
import { useCitationPanel as
|
|
162
|
-
import { useKBDocuments as
|
|
163
|
-
import { useKnowledgeBase as
|
|
164
|
-
import { useMarsunAuth as
|
|
165
|
-
import { useContext as
|
|
166
|
-
import { useSSECompletion as
|
|
167
|
-
import { useTypewriter as
|
|
142
|
+
import { NumberRangeFilterItem as om, InputFilterItem as am, SelectAddressFilterItem as sm, SelectCascaderFilterItem as lm, SelectFunctionFilterItem as im, SelectIndustryFilterItem as mm, SelectTableListFilterItem as fm, SuperSelectFilterItem as pm } from "./components/ReactFilter/fields/index.js";
|
|
143
|
+
import { PageShellProvider as dm, usePageShell as um, usePageShellLoading as xm } from "./components/Layout/PageShell/PageShellContext.js";
|
|
144
|
+
import { SelectCascader as Fm } from "@kne/super-select";
|
|
145
|
+
import { default as Cm } from "./components/ReactFilter/fields/SelectTreeFilterItem.js";
|
|
146
|
+
import { animateScrollFromTopToBottom as Im, animateScrollTo as Tm, getScrollBottom as gm } from "./components/AgentHub/Chat/utils/smoothScroll.js";
|
|
147
|
+
import { applyHiddenRows as Rm, mergeTablePrefs as Dm, normalizeHiddenRowKeys as Mm, parseTablePrefs as Lm, serializeTablePrefs as Em } from "./components/Table/tablePrefsUtils.js";
|
|
148
|
+
import { buildDepsKey as Om, normalizeDependsOn as _m, resolveFilterLabel as bm, resolveFilterVisible as ym, resolveHidden as vm } from "./components/Filter/types.js";
|
|
149
|
+
import { downloadFileItem as Bm, getFileDownloadAuthHeaders as Um, getFileDownloadUrl as km } from "./components/File/utils/download.js";
|
|
150
|
+
import { emptyTablePrefs as Hm } from "./components/Table/tablePrefsTypes.js";
|
|
151
|
+
import { extractCitations as Km, formatSessionTime as zm, getSessionDisplayName as Gm, isWelcomeOnlyMessages as Ym, parseSessionMessages as Wm, toDisplayMessages as Xm } from "./components/AgentHub/Chat/utils/sessionMessages.js";
|
|
152
|
+
import { default as Zm, multiSelectInterceptor as jm, singleSelectInterceptor as Jm } from "./components/ReactFilter/filterInterceptors.js";
|
|
153
|
+
import { formatLlmTextToHtml as $m, parseLlmText as ef } from "./components/LlmFormattedText/parseLlmText.js";
|
|
154
|
+
import { getFileExtension as rf, getFileIcon as of, getFileTypeName as af, normalizeExtension as sf, normalizeFileDisplayItem as lf, parseFileNameFromUrl as mf } from "./components/File/fileDisplay.js";
|
|
155
|
+
import { hasCitationMarkers as pf, normalizeAssistantMarkdown as nf, normalizeDisplayText as df, parseAssistantContent as uf } from "./components/AgentHub/Chat/utils/messageContent.js";
|
|
156
|
+
import { hasPermission as cf } from "./components/Auth/hasPermission.js";
|
|
157
|
+
import { sanitizeMermaidChart as Sf, stripProseFromMermaid as Cf } from "./components/AgentHub/Chat/utils/sanitizeMermaidChart.js";
|
|
158
|
+
import { useAutoScrollToBottom as If } from "./components/AgentHub/Chat/hooks/useAutoScrollToBottom.js";
|
|
159
|
+
import { useChat as gf } from "./components/AgentHub/Chat/hooks/useChat.js";
|
|
160
|
+
import { useChatSessions as Rf } from "./components/AgentHub/Chat/hooks/useChatSessions.js";
|
|
161
|
+
import { useCitationPanel as Mf } from "./components/AgentHub/Chat/hooks/useCitationPanel.js";
|
|
162
|
+
import { useKBDocuments as Ef } from "./components/AgentHub/KnowledgeBase/hooks/useKBDocuments.js";
|
|
163
|
+
import { useKnowledgeBase as Of } from "./components/AgentHub/KnowledgeBase/hooks/useKnowledgeBase.js";
|
|
164
|
+
import { useMarsunAuth as bf, useMarsunCore as yf, useMarsunFetch as vf } from "./provider/context.js";
|
|
165
|
+
import { useContext as Bf } from "./components/ReactFilter/context.js";
|
|
166
|
+
import { useSSECompletion as kf } from "./components/AgentHub/Chat/hooks/useSSECompletion.js";
|
|
167
|
+
import { useTypewriter as Hf } from "./components/AgentHub/Chat/hooks/useTypewriter.js";
|
|
168
168
|
export {
|
|
169
169
|
Sr as AdvancedFilter,
|
|
170
170
|
Pr as AgentAppShell,
|
|
@@ -232,14 +232,14 @@ export {
|
|
|
232
232
|
xo as Empty,
|
|
233
233
|
ft as Eye,
|
|
234
234
|
pt as EyeOff,
|
|
235
|
-
|
|
235
|
+
Pi as FILTER_CLASS,
|
|
236
236
|
ql as FLEX_SPACER_COL_KEY,
|
|
237
237
|
Fo as FetchSelect,
|
|
238
238
|
Co as FetchTreeSelect,
|
|
239
239
|
nt as File,
|
|
240
240
|
dt as FileArchive,
|
|
241
241
|
ut as FileImage,
|
|
242
|
-
|
|
242
|
+
Ti as FileItemView,
|
|
243
243
|
Io as FileLink,
|
|
244
244
|
go as FilePreview,
|
|
245
245
|
Ro as FilePreviewLink,
|
|
@@ -258,7 +258,7 @@ export {
|
|
|
258
258
|
Xo as FilterOuter,
|
|
259
259
|
Zo as FilterPanel,
|
|
260
260
|
Jo as FilterPopover,
|
|
261
|
-
|
|
261
|
+
hi as FilterProvider,
|
|
262
262
|
$o as FilterSelect,
|
|
263
263
|
ta as FilterTreeSelect,
|
|
264
264
|
oa as FilterTrigger,
|
|
@@ -273,7 +273,7 @@ export {
|
|
|
273
273
|
oi as FormModal,
|
|
274
274
|
ai as FormSteps,
|
|
275
275
|
si as FormStepsModal,
|
|
276
|
-
|
|
276
|
+
Ai as GroupList,
|
|
277
277
|
It as Hash,
|
|
278
278
|
Tt as House,
|
|
279
279
|
gt as ICON_NAMES,
|
|
@@ -297,8 +297,8 @@ export {
|
|
|
297
297
|
Ot as Loader2,
|
|
298
298
|
_t as Lock,
|
|
299
299
|
bt as LogOut,
|
|
300
|
-
|
|
301
|
-
|
|
300
|
+
Qi as MODAL_SIZE_BODY_HEIGHT,
|
|
301
|
+
$i as MODAL_SIZE_WIDTH,
|
|
302
302
|
Ta as ManageActionButtons,
|
|
303
303
|
ha as MarsunCoreProvider,
|
|
304
304
|
yt as Maximize2,
|
|
@@ -312,14 +312,14 @@ export {
|
|
|
312
312
|
ya as Modal,
|
|
313
313
|
wa as ModulePageShell,
|
|
314
314
|
fi as MultiField,
|
|
315
|
-
|
|
315
|
+
om as NumberRangeFilterItem,
|
|
316
316
|
Ua as OrgTree,
|
|
317
317
|
n as PALETTE,
|
|
318
318
|
Ll as PARSE_STATUS_CONFIG,
|
|
319
319
|
Y as PERMISSIONS_STORAGE_KEY,
|
|
320
320
|
W as PERMISSION_DEFINITIONS_KEY,
|
|
321
321
|
Na as PageHeaderLayout,
|
|
322
|
-
|
|
322
|
+
dm as PageShellProvider,
|
|
323
323
|
Va as PageSpin,
|
|
324
324
|
Ut as PanelLeftClose,
|
|
325
325
|
kt as PanelLeftOpen,
|
|
@@ -335,15 +335,15 @@ export {
|
|
|
335
335
|
Kt as Presentation,
|
|
336
336
|
as as ProtectedRoute,
|
|
337
337
|
y as REDIRECT_URL_PARAM,
|
|
338
|
-
|
|
338
|
+
Oi as RULES,
|
|
339
339
|
pi as RadioGroup,
|
|
340
340
|
ls as ReactDatePickerFilterItem,
|
|
341
341
|
ms as ReactDateRangePickerFilterItem,
|
|
342
342
|
ps as ReactFilterItem,
|
|
343
343
|
ds as ReactFilterProvider,
|
|
344
344
|
xs as ReactFilterSearchInput,
|
|
345
|
-
|
|
346
|
-
|
|
345
|
+
_i as ReactForm,
|
|
346
|
+
am as ReactInputFilterItem,
|
|
347
347
|
zt as RefreshCw,
|
|
348
348
|
Fs as ReportArchiveModal,
|
|
349
349
|
Cs as ReportExportLayout,
|
|
@@ -356,13 +356,13 @@ export {
|
|
|
356
356
|
Gt as RotateCw,
|
|
357
357
|
Os as SEMANTIC_COLORS,
|
|
358
358
|
di as Select,
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
359
|
+
sm as SelectAddressFilterItem,
|
|
360
|
+
Fm as SelectCascader,
|
|
361
|
+
lm as SelectCascaderFilterItem,
|
|
362
|
+
im as SelectFunctionFilterItem,
|
|
363
|
+
mm as SelectIndustryFilterItem,
|
|
364
|
+
fm as SelectTableListFilterItem,
|
|
365
|
+
Cm as SelectTreeFilterItem,
|
|
366
366
|
_s as SemanticTag,
|
|
367
367
|
Yt as Send,
|
|
368
368
|
ys as SessionActionButtons,
|
|
@@ -381,7 +381,7 @@ export {
|
|
|
381
381
|
Xs as StepForm,
|
|
382
382
|
Zs as StepModal,
|
|
383
383
|
ui as SubmitButton,
|
|
384
|
-
|
|
384
|
+
pm as SuperSelectFilterItem,
|
|
385
385
|
xi as Switch,
|
|
386
386
|
Js as Table,
|
|
387
387
|
ci as TableList,
|
|
@@ -392,6 +392,7 @@ export {
|
|
|
392
392
|
$t as ThumbsUp,
|
|
393
393
|
ol as TooltipInfo,
|
|
394
394
|
er as Trash2,
|
|
395
|
+
Si as TreeSelect,
|
|
395
396
|
tr as Trophy,
|
|
396
397
|
sl as TypeDateRangePickerField,
|
|
397
398
|
il as TypeDateRangePickerFilterItem,
|
|
@@ -405,17 +406,17 @@ export {
|
|
|
405
406
|
ir as Users,
|
|
406
407
|
nl as VirtualScrollbar,
|
|
407
408
|
mr as X,
|
|
408
|
-
|
|
409
|
-
|
|
409
|
+
Im as animateScrollFromTopToBottom,
|
|
410
|
+
Tm as animateScrollTo,
|
|
410
411
|
Zl as applyColumnConfig,
|
|
411
412
|
s as applyCssTokenOverrides,
|
|
412
|
-
|
|
413
|
+
Rm as applyHiddenRows,
|
|
413
414
|
l as applyThemeToCssVariables,
|
|
414
415
|
v as buildAbsoluteLocationRedirectUrl,
|
|
415
416
|
oe as buildDepartmentPathMapFromFlat,
|
|
416
417
|
ae as buildDepartmentPathMapFromTree,
|
|
417
418
|
se as buildDepartmentPathMaps,
|
|
418
|
-
|
|
419
|
+
Om as buildDepsKey,
|
|
419
420
|
le as buildLeafDepartmentPathMap,
|
|
420
421
|
w as buildLocationRedirectUrl,
|
|
421
422
|
B as buildLoginPath,
|
|
@@ -425,9 +426,9 @@ export {
|
|
|
425
426
|
V as clearLastActivity,
|
|
426
427
|
ne as collectDepartmentIds,
|
|
427
428
|
jl as columnsToConfig,
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
429
|
+
bi as compileErrMsg,
|
|
430
|
+
yi as computedFieldValueFromFormData,
|
|
431
|
+
vi as computedFormDataFormState,
|
|
431
432
|
ja as computedIsPass,
|
|
432
433
|
bl as countUniqueCitedSources,
|
|
433
434
|
ul as createFilterValueMapper,
|
|
@@ -435,146 +436,146 @@ export {
|
|
|
435
436
|
te as createMarsunRequest,
|
|
436
437
|
De as createPersonSelectFilter,
|
|
437
438
|
yl as detectCitationIdBase,
|
|
438
|
-
|
|
439
|
+
Bm as downloadFileItem,
|
|
439
440
|
Te as employeeIdFormatRule,
|
|
440
|
-
|
|
441
|
+
Hm as emptyTablePrefs,
|
|
441
442
|
vl as extractCitationIdsFromContent,
|
|
442
443
|
wl as extractCitationTitle,
|
|
443
|
-
|
|
444
|
+
Km as extractCitations,
|
|
444
445
|
de as extractDepartmentSubtree,
|
|
445
446
|
u as fetchWithTimeout,
|
|
446
|
-
|
|
447
|
-
|
|
447
|
+
wi as filterEmpty,
|
|
448
|
+
Zm as filterInterceptors,
|
|
448
449
|
ue as findDepartmentRootId,
|
|
449
|
-
|
|
450
|
+
Bi as findField,
|
|
450
451
|
xe as flattenDepartments,
|
|
451
|
-
|
|
452
|
+
Ui as formUtils,
|
|
452
453
|
Bl as formatCitationDocBasename,
|
|
453
454
|
Ul as formatCitationMeta,
|
|
454
455
|
kl as formatCitationPositions,
|
|
455
456
|
T as formatDateTimeDisplay,
|
|
456
457
|
P as formatFileSize,
|
|
457
|
-
|
|
458
|
+
$m as formatLlmTextToHtml,
|
|
458
459
|
Me as formatPersonValueLabel,
|
|
459
460
|
A as formatPickerValue,
|
|
460
|
-
|
|
461
|
+
zm as formatSessionTime,
|
|
461
462
|
i as generateTheme,
|
|
462
463
|
ie as getDepartmentPath,
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
464
|
+
Um as getFileDownloadAuthHeaders,
|
|
465
|
+
km as getFileDownloadUrl,
|
|
466
|
+
rf as getFileExtension,
|
|
467
|
+
of as getFileIcon,
|
|
468
|
+
af as getFileTypeName,
|
|
468
469
|
cl as getFilterValue,
|
|
469
470
|
K as getLastActivityTime,
|
|
470
471
|
ce as getNormalUserAccessibleDepartmentIds,
|
|
471
472
|
Fe as getNormalUserDepartmentTree,
|
|
472
|
-
|
|
473
|
-
|
|
473
|
+
gm as getScrollBottom,
|
|
474
|
+
Gm as getSessionDisplayName,
|
|
474
475
|
q as getStoredPermissionMap,
|
|
475
476
|
Z as getStoredUserPermissions,
|
|
476
|
-
|
|
477
|
-
|
|
477
|
+
pf as hasCitationMarkers,
|
|
478
|
+
cf as hasPermission,
|
|
478
479
|
Jl as hideColumnAtPath,
|
|
479
480
|
Nl as injectCitationMarkdownLinks,
|
|
480
|
-
|
|
481
|
+
ki as interceptors,
|
|
481
482
|
Se as intersectDepartmentIds,
|
|
482
|
-
|
|
483
|
+
Ni as isEmpty,
|
|
483
484
|
Ql as isInternalColumnKey,
|
|
484
|
-
|
|
485
|
+
Hi as isNotEmpty,
|
|
485
486
|
ge as isValidEmployeeIdFormat,
|
|
486
487
|
O as isValidPickerValue,
|
|
487
|
-
|
|
488
|
+
Ym as isWelcomeOnlyMessages,
|
|
488
489
|
j as loadPermissionDefinitions,
|
|
489
490
|
J as loadUserRolePermissions,
|
|
490
|
-
|
|
491
|
+
Vi as matchFields,
|
|
491
492
|
Le as matchPersonOptionSearch,
|
|
492
493
|
me as mergeDepartmentPathMaps,
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
494
|
+
Dm as mergeTablePrefs,
|
|
495
|
+
jm as multiSelectInterceptor,
|
|
496
|
+
nf as normalizeAssistantMarkdown,
|
|
496
497
|
Hl as normalizeCitation,
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
498
|
+
_m as normalizeDependsOn,
|
|
499
|
+
df as normalizeDisplayText,
|
|
500
|
+
sf as normalizeExtension,
|
|
501
|
+
lf as normalizeFileDisplayItem,
|
|
502
|
+
Mm as normalizeHiddenRowKeys,
|
|
502
503
|
Ee as normalizePersonDtos,
|
|
503
504
|
Ae as normalizeRawPersonList,
|
|
504
|
-
|
|
505
|
+
uf as parseAssistantContent,
|
|
505
506
|
Vl as parseCitationLinkHref,
|
|
506
|
-
|
|
507
|
-
|
|
507
|
+
mf as parseFileNameFromUrl,
|
|
508
|
+
ef as parseLlmText,
|
|
508
509
|
_ as parsePickerValue,
|
|
509
|
-
|
|
510
|
-
|
|
510
|
+
Wm as parseSessionMessages,
|
|
511
|
+
Lm as parseTablePrefs,
|
|
511
512
|
Sl as pickSelectValues,
|
|
512
513
|
Kl as prepareCitationContent,
|
|
513
|
-
|
|
514
|
+
Ki as preset,
|
|
514
515
|
r as reactFilterFields,
|
|
515
516
|
U as readRedirectUrlFromSearch,
|
|
516
517
|
g as recentDayRange,
|
|
517
518
|
h as recentDayRangeStrings,
|
|
518
519
|
R as recentYearRange,
|
|
519
520
|
zl as resolveCitationTitle,
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
521
|
+
bm as resolveFilterLabel,
|
|
522
|
+
ym as resolveFilterVisible,
|
|
523
|
+
vm as resolveHidden,
|
|
523
524
|
F as resolveMaybeFn,
|
|
524
|
-
|
|
525
|
-
|
|
525
|
+
em as resolveModalSizeAnchor,
|
|
526
|
+
tm as resolveModalWidth,
|
|
526
527
|
Oe as resolvePersonDepartmentName,
|
|
527
528
|
k as resolveRedirectUrl,
|
|
528
529
|
_e as resolveSelectPersonOption,
|
|
529
530
|
S as resolveVisible,
|
|
530
531
|
Gl as sanitizeCitationHtml,
|
|
531
|
-
|
|
532
|
+
Sf as sanitizeMermaidChart,
|
|
532
533
|
Q as savePermissionDefinitions,
|
|
533
534
|
$ as saveUserRolePermissions,
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
535
|
+
Em as serializeTablePrefs,
|
|
536
|
+
Jm as singleSelectInterceptor,
|
|
537
|
+
zi as stateToError,
|
|
538
|
+
Gi as stateToIsPass,
|
|
538
539
|
Yl as stripCitationFrontmatter,
|
|
539
|
-
|
|
540
|
+
Cf as stripProseFromMermaid,
|
|
540
541
|
D as toApiStartEnd,
|
|
541
542
|
M as toDateRange,
|
|
542
543
|
L as toDateTimeRange,
|
|
543
544
|
fe as toDepartmentPathMaps,
|
|
544
|
-
|
|
545
|
+
Xm as toDisplayMessages,
|
|
545
546
|
be as toPersonOptions,
|
|
546
547
|
ye as toPersonSelectOptions,
|
|
547
548
|
ve as toReviewerPersonOptions,
|
|
548
549
|
z as touchLastActivity,
|
|
549
550
|
yo as treeToCascaderOptions,
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
551
|
+
If as useAutoScrollToBottom,
|
|
552
|
+
gf as useChat,
|
|
553
|
+
Rf as useChatSessions,
|
|
554
|
+
Mf as useCitationPanel,
|
|
554
555
|
x as useFetchData,
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
556
|
+
Yi as useField,
|
|
557
|
+
Ri as useFilterDeps,
|
|
558
|
+
Di as useFilterFieldBridge,
|
|
559
|
+
Mi as useFilterRegister,
|
|
560
|
+
Li as useFilterState,
|
|
561
|
+
Wi as useFormApi,
|
|
562
|
+
Xi as useFormContext,
|
|
563
|
+
qi as useGroup,
|
|
564
|
+
Ef as useKBDocuments,
|
|
565
|
+
Of as useKnowledgeBase,
|
|
566
|
+
bf as useMarsunAuth,
|
|
567
|
+
yf as useMarsunCore,
|
|
568
|
+
vf as useMarsunFetch,
|
|
569
|
+
um as usePageShell,
|
|
570
|
+
xm as usePageShellLoading,
|
|
570
571
|
Ja as usePermissions,
|
|
571
572
|
Qa as usePermissionsPass,
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
573
|
+
Bf as useReactFilter,
|
|
574
|
+
Zi as useReset,
|
|
575
|
+
kf as useSSECompletion,
|
|
575
576
|
Pl as useSearchParamsValue,
|
|
576
|
-
|
|
577
|
-
|
|
577
|
+
ji as useSubmit,
|
|
578
|
+
Hf as useTypewriter,
|
|
578
579
|
Tl as withFieldItem,
|
|
579
580
|
hl as withFilterValue
|
|
580
581
|
};
|