@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.
Files changed (30) hide show
  1. package/dist/components/File/FilePreview/FilePreviewContent.js +108 -58
  2. package/dist/components/File/FilePreview/FilePreviewContent.js.map +1 -1
  3. package/dist/components/Form/index.d.ts +1 -1
  4. package/dist/components/Form/kneFormInfo.d.ts +2 -0
  5. package/dist/components/Form/kneFormInfo.js +18 -17
  6. package/dist/components/Form/kneFormInfo.js.map +1 -1
  7. package/dist/components/OrgTree/OrgTree.js +52 -43
  8. package/dist/components/OrgTree/OrgTree.js.map +1 -1
  9. package/dist/components/OrgTree/style.module.scss.js +5 -5
  10. package/dist/components/PermissionBindPanel/PermissionBindPanel.d.ts +4 -1
  11. package/dist/components/PermissionBindPanel/PermissionBindPanel.js +121 -117
  12. package/dist/components/PermissionBindPanel/PermissionBindPanel.js.map +1 -1
  13. package/dist/components/Stat/StatCard/index.d.ts +4 -0
  14. package/dist/components/Stat/StatCard/index.js +45 -29
  15. package/dist/components/Stat/StatCard/index.js.map +1 -1
  16. package/dist/components/Stat/StatCardList.d.ts +0 -2
  17. package/dist/components/Stat/StatCardList.js.map +1 -1
  18. package/dist/components/TooltipInfo/TooltipInfo.js +14 -8
  19. package/dist/components/TooltipInfo/TooltipInfo.js.map +1 -1
  20. package/dist/components/Upload/index.d.ts +6 -23
  21. package/dist/components/Upload/index.js +254 -141
  22. package/dist/components/Upload/index.js.map +1 -1
  23. package/dist/components/Upload/style.module.scss.js +22 -15
  24. package/dist/components/Upload/style.module.scss.js.map +1 -1
  25. package/dist/components/index.d.ts +1 -1
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.js +132 -131
  28. package/dist/marsun-components-core.css +1 -1
  29. package/dist/styles/global.css +1 -1
  30. package/package.json +7 -6
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Stat/StatCard/index.tsx"],"sourcesContent":["import { Card, Statistic } from 'antd';\nimport React from 'react';\nimport styles from './style.module.scss';\nimport classNames from 'classnames';\n\nexport interface StatCardProps {\n /** 标题 */\n title: string;\n /** 数值 */\n value: number;\n /** 前缀图标 */\n prefix?: React.ReactNode;\n /** 数值颜色 */\n color?: string;\n /** 点击回调 */\n onClick?: () => void;\n /** 是否内联模式(不使用 Card 包裹) */\n inline?: boolean;\n /** 内联模式下的字体大小 */\n fontSize?: number;\n /** 自定义样式 */\n style?: React.CSSProperties;\n}\n\n/** 可点击的统计卡片 */\nconst StatCard: React.FC<StatCardProps> = ({\n title,\n value,\n prefix,\n color = '#1677ff',\n onClick,\n inline = false,\n fontSize,\n style,\n}) => {\n if (inline) {\n return (\n <div className={onClick ? classNames('stat-card-clickable', styles['stat-card-clickable']) : undefined} onClick={onClick} style={style}>\n <Statistic\n title={title}\n value={value}\n prefix={prefix}\n valueStyle={{ color, ...(fontSize ? { fontSize } : {}) }}\n />\n </div>\n );\n }\n\n return (\n <Card\n hoverable={!!onClick}\n onClick={onClick}\n className={onClick ? classNames('stat-card-clickable', styles['stat-card-clickable']) : undefined}\n >\n <Statistic title={title} value={value} prefix={prefix} valueStyle={{ color }} />\n </Card>\n );\n};\n\nexport default StatCard;\n"],"names":["StatCard","title","value","prefix","color","onClick","inline","fontSize","style","jsx","classNames","styles","Statistic","Card"],"mappings":";;;;AAyBA,MAAMA,IAAoC,CAAC;AAAA,EACzC,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,SAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,OAAAC;AACF,MACMF,IAEA,gBAAAG,EAAC,OAAA,EAAI,WAAWJ,IAAUK,EAAW,uBAAuBC,EAAO,qBAAqB,CAAC,IAAI,QAAW,SAAAN,GAAkB,OAAAG,GACxH,UAAA,gBAAAC;AAAA,EAACG;AAAA,EAAA;AAAA,IACC,OAAAX;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAY,EAAE,OAAAC,GAAO,GAAIG,IAAW,EAAE,UAAAA,EAAA,IAAa,CAAA,EAAC;AAAA,EAAG;AAAA,GAE3D,IAKF,gBAAAE;AAAA,EAACI;AAAA,EAAA;AAAA,IACC,WAAW,CAAC,CAACR;AAAA,IACb,SAAAA;AAAA,IACA,WAAWA,IAAUK,EAAW,uBAAuBC,EAAO,qBAAqB,CAAC,IAAI;AAAA,IAExF,UAAA,gBAAAF,EAACG,KAAU,OAAAX,GAAc,OAAAC,GAAc,QAAAC,GAAgB,YAAY,EAAE,OAAAC,IAAM,CAAG;AAAA,EAAA;AAAA;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Stat/StatCard/index.tsx"],"sourcesContent":["import { Card, Statistic } from 'antd';\nimport React from 'react';\nimport styles from './style.module.scss';\nimport classNames from 'classnames';\n\nexport interface StatCardProps {\n /** 标题 */\n title: string;\n /** 数值 */\n value: number;\n /** 前缀图标 */\n prefix?: React.ReactNode;\n /** 后缀(如 %、单位) */\n suffix?: React.ReactNode;\n /** 小数精度 */\n precision?: number;\n /** 数值颜色 */\n color?: string;\n /** 点击回调 */\n onClick?: () => void;\n /** 是否内联模式(不使用 Card 包裹) */\n inline?: boolean;\n /** 内联模式下的字体大小 */\n fontSize?: number;\n /** 自定义样式 */\n style?: React.CSSProperties;\n}\n\n/** 可点击的统计卡片 */\nconst StatCard: React.FC<StatCardProps> = ({\n title,\n value,\n prefix,\n suffix,\n precision,\n color = '#1677ff',\n onClick,\n inline = false,\n fontSize,\n style,\n}) => {\n const statistic = (\n <Statistic\n title={title}\n value={value}\n prefix={prefix}\n suffix={suffix}\n precision={precision}\n valueStyle={{ color, ...(fontSize ? { fontSize } : {}) }}\n />\n );\n\n if (inline) {\n return (\n <div\n className={\n onClick ? classNames('stat-card-clickable', styles['stat-card-clickable']) : undefined\n }\n onClick={onClick}\n style={style}\n >\n {statistic}\n </div>\n );\n }\n\n return (\n <Card\n hoverable={!!onClick}\n onClick={onClick}\n className={\n onClick ? classNames('stat-card-clickable', styles['stat-card-clickable']) : undefined\n }\n style={style}\n >\n {statistic}\n </Card>\n );\n};\n\nexport default StatCard;\n"],"names":["StatCard","title","value","prefix","suffix","precision","color","onClick","inline","fontSize","style","statistic","jsx","Statistic","classNames","styles","Card"],"mappings":";;;;AA6BA,MAAMA,IAAoC,CAAC;AAAA,EACzC,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,SAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,OAAAC;AACF,MAAM;AACJ,QAAMC,IACJ,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAAZ;AAAA,MACA,OAAAC;AAAA,MACA,QAAAC;AAAA,MACA,QAAAC;AAAA,MACA,WAAAC;AAAA,MACA,YAAY,EAAE,OAAAC,GAAO,GAAIG,IAAW,EAAE,UAAAA,EAAA,IAAa,CAAA,EAAC;AAAA,IAAG;AAAA,EAAA;AAI3D,SAAID,IAEA,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WACEL,IAAUO,EAAW,uBAAuBC,EAAO,qBAAqB,CAAC,IAAI;AAAA,MAE/E,SAAAR;AAAA,MACA,OAAAG;AAAA,MAEC,UAAAC;AAAA,IAAA;AAAA,EAAA,IAML,gBAAAC;AAAA,IAACI;AAAA,IAAA;AAAA,MACC,WAAW,CAAC,CAACT;AAAA,MACb,SAAAA;AAAA,MACA,WACEA,IAAUO,EAAW,uBAAuBC,EAAO,qBAAqB,CAAC,IAAI;AAAA,MAE/E,OAAAL;AAAA,MAEC,UAAAC;AAAA,IAAA;AAAA,EAAA;AAGP;"}
@@ -6,8 +6,6 @@ export interface StatItem extends Omit<StatCardProps, 'inline' | 'fontSize'> {
6
6
  colProps?: ColProps;
7
7
  /** 是否隐藏,为 true 时不渲染 */
8
8
  hidden?: boolean;
9
- /** 后缀 */
10
- suffix?: React.ReactNode;
11
9
  }
12
10
  export interface StatCardListProps {
13
11
  /** 统计项列表 */
@@ -1 +1 @@
1
- {"version":3,"file":"StatCardList.js","sources":["../../../src/components/Stat/StatCardList.tsx"],"sourcesContent":["import { Col, Row } from 'antd';\nimport type { ColProps } from 'antd/es/grid';\nimport React from 'react';\nimport type { StatCardProps } from './StatCard';\nimport StatCard from './StatCard';\n\nexport interface StatItem extends Omit<StatCardProps, 'inline' | 'fontSize'> {\n /** 卡片占列配置,不传则根据总 items 数自动计算 */\n colProps?: ColProps;\n /** 是否隐藏,为 true 时不渲染 */\n hidden?: boolean;\n /** 后缀 */\n suffix?: React.ReactNode;\n}\n\nexport interface StatCardListProps {\n /** 统计项列表 */\n items: StatItem[];\n /** 行间距 */\n gutter?: [number, number];\n /** 容器 className */\n className?: string;\n /** 是否内联模式 */\n inline?: boolean;\n /** 内联模式字体大小 */\n fontSize?: number;\n}\n\n/** 根据项数自动计算默认列宽 */\nconst getDefaultCol = (total: number): ColProps => {\n if (total <= 2) return { xs: 12, sm: 12, lg: 12 };\n if (total <= 3) return { xs: 12, sm: 8, lg: 8 };\n if (total <= 4) return { xs: 12, sm: 12, lg: 6 };\n return { xs: 12, sm: 8, lg: 4 };\n};\n\n/** 统计卡片列表 */\nconst StatCardList: React.FC<StatCardListProps> = ({\n items,\n gutter = [16, 16],\n className,\n inline = false,\n fontSize,\n}) => {\n const visibleItems = items.filter((item) => !item.hidden);\n const defaultCol = getDefaultCol(visibleItems.length);\n\n return (\n <Row gutter={gutter} className={className}>\n {visibleItems.map((item, idx) => {\n const { colProps, hidden, ...cardProps } = item;\n return (\n <Col key={idx} {...(colProps ?? defaultCol)}>\n <StatCard {...cardProps} inline={inline} fontSize={fontSize} />\n </Col>\n );\n })}\n </Row>\n );\n};\n\nexport default StatCardList;\n"],"names":["getDefaultCol","total","StatCardList","items","gutter","className","inline","fontSize","visibleItems","item","defaultCol","jsx","Row","idx","colProps","hidden","cardProps","Col","StatCard"],"mappings":";;;AA6BA,MAAMA,IAAgB,CAACC,MACjBA,KAAS,IAAU,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,GAAA,IACzCA,KAAS,IAAU,EAAE,IAAI,IAAI,IAAI,GAAG,IAAI,EAAA,IACxCA,KAAS,IAAU,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,EAAA,IACtC,EAAE,IAAI,IAAI,IAAI,GAAG,IAAI,EAAA,GAIxBC,IAA4C,CAAC;AAAA,EACjD,OAAAC;AAAA,EACA,QAAAC,IAAS,CAAC,IAAI,EAAE;AAAA,EAChB,WAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,UAAAC;AACF,MAAM;AACJ,QAAMC,IAAeL,EAAM,OAAO,CAACM,MAAS,CAACA,EAAK,MAAM,GAClDC,IAAaV,EAAcQ,EAAa,MAAM;AAEpD,SACE,gBAAAG,EAACC,KAAI,QAAAR,GAAgB,WAAAC,GAClB,YAAa,IAAI,CAACI,GAAMI,MAAQ;AAC/B,UAAM,EAAE,UAAAC,GAAU,QAAAC,GAAQ,GAAGC,MAAcP;AAC3C,WACE,gBAAAE,EAACM,GAAA,EAAe,GAAIH,KAAYJ,GAC9B,UAAA,gBAAAC,EAACO,GAAA,EAAU,GAAGF,GAAW,QAAAV,GAAgB,UAAAC,EAAA,CAAoB,EAAA,GADrDM,CAEV;AAAA,EAEJ,CAAC,EAAA,CACH;AAEJ;"}
1
+ {"version":3,"file":"StatCardList.js","sources":["../../../src/components/Stat/StatCardList.tsx"],"sourcesContent":["import { Col, Row } from 'antd';\nimport type { ColProps } from 'antd/es/grid';\nimport React from 'react';\nimport type { StatCardProps } from './StatCard';\nimport StatCard from './StatCard';\n\nexport interface StatItem extends Omit<StatCardProps, 'inline' | 'fontSize'> {\n /** 卡片占列配置,不传则根据总 items 数自动计算 */\n colProps?: ColProps;\n /** 是否隐藏,为 true 时不渲染 */\n hidden?: boolean;\n}\n\nexport interface StatCardListProps {\n /** 统计项列表 */\n items: StatItem[];\n /** 行间距 */\n gutter?: [number, number];\n /** 容器 className */\n className?: string;\n /** 是否内联模式 */\n inline?: boolean;\n /** 内联模式字体大小 */\n fontSize?: number;\n}\n\n/** 根据项数自动计算默认列宽 */\nconst getDefaultCol = (total: number): ColProps => {\n if (total <= 2) return { xs: 12, sm: 12, lg: 12 };\n if (total <= 3) return { xs: 12, sm: 8, lg: 8 };\n if (total <= 4) return { xs: 12, sm: 12, lg: 6 };\n return { xs: 12, sm: 8, lg: 4 };\n};\n\n/** 统计卡片列表 */\nconst StatCardList: React.FC<StatCardListProps> = ({\n items,\n gutter = [16, 16],\n className,\n inline = false,\n fontSize,\n}) => {\n const visibleItems = items.filter((item) => !item.hidden);\n const defaultCol = getDefaultCol(visibleItems.length);\n\n return (\n <Row gutter={gutter} className={className}>\n {visibleItems.map((item, idx) => {\n const { colProps, hidden, ...cardProps } = item;\n return (\n <Col key={idx} {...(colProps ?? defaultCol)}>\n <StatCard {...cardProps} inline={inline} fontSize={fontSize} />\n </Col>\n );\n })}\n </Row>\n );\n};\n\nexport default StatCardList;\n"],"names":["getDefaultCol","total","StatCardList","items","gutter","className","inline","fontSize","visibleItems","item","defaultCol","jsx","Row","idx","colProps","hidden","cardProps","Col","StatCard"],"mappings":";;;AA2BA,MAAMA,IAAgB,CAACC,MACjBA,KAAS,IAAU,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,GAAA,IACzCA,KAAS,IAAU,EAAE,IAAI,IAAI,IAAI,GAAG,IAAI,EAAA,IACxCA,KAAS,IAAU,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,EAAA,IACtC,EAAE,IAAI,IAAI,IAAI,GAAG,IAAI,EAAA,GAIxBC,IAA4C,CAAC;AAAA,EACjD,OAAAC;AAAA,EACA,QAAAC,IAAS,CAAC,IAAI,EAAE;AAAA,EAChB,WAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,UAAAC;AACF,MAAM;AACJ,QAAMC,IAAeL,EAAM,OAAO,CAACM,MAAS,CAACA,EAAK,MAAM,GAClDC,IAAaV,EAAcQ,EAAa,MAAM;AAEpD,SACE,gBAAAG,EAACC,KAAI,QAAAR,GAAgB,WAAAC,GAClB,YAAa,IAAI,CAACI,GAAMI,MAAQ;AAC/B,UAAM,EAAE,UAAAC,GAAU,QAAAC,GAAQ,GAAGC,MAAcP;AAC3C,WACE,gBAAAE,EAACM,GAAA,EAAe,GAAIH,KAAYJ,GAC9B,UAAA,gBAAAC,EAACO,GAAA,EAAU,GAAGF,GAAW,QAAAV,GAAgB,UAAAC,EAAA,CAAoB,EAAA,GADrDM,CAEV;AAAA,EAEJ,CAAC,EAAA,CACH;AAEJ;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as o, Fragment as m } from "react/jsx-runtime";
2
- import { Tooltip as s } from "antd";
3
- import d from "../Descriptions/CommonDescriptions.js";
4
- const b = ({
2
+ import { Tooltip as d } from "antd";
3
+ import s from "../Descriptions/CommonDescriptions.js";
4
+ const c = ({
5
5
  content: t,
6
6
  children: r,
7
7
  column: i = 1,
@@ -12,30 +12,36 @@ const b = ({
12
12
  mouseEnterDelay: l = 0.3,
13
13
  ...f
14
14
  }) => a || t.length === 0 ? /* @__PURE__ */ o(m, { children: r }) : /* @__PURE__ */ o(
15
- s,
15
+ d,
16
16
  {
17
17
  placement: e,
18
18
  mouseEnterDelay: l,
19
19
  destroyOnHidden: !0,
20
20
  classNames: { root: ["tooltip-info-overlay", n].filter(Boolean).join(" ") },
21
21
  styles: {
22
+ root: {
23
+ maxWidth: 320
24
+ },
22
25
  container: {
26
+ boxSizing: "border-box",
23
27
  minWidth: 220,
24
- maxWidth: 360,
28
+ width: "100%",
25
29
  padding: "8px 12px",
26
30
  background: "var(--tooltip-info-bg, var(--bg-color-white, #ffffff))",
27
31
  color: "var(--tooltip-info-color, var(--font-color, #222222))",
28
32
  boxShadow: "0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12)",
29
- ...p
33
+ ...p,
34
+ // 硬上限:避免 Descriptions 长文把气泡横向撑爆
35
+ maxWidth: 320
30
36
  }
31
37
  },
32
38
  getPopupContainer: () => document.body,
33
- title: /* @__PURE__ */ o(d, { content: t, column: i, size: "small" }),
39
+ title: /* @__PURE__ */ o(s, { content: t, column: i, size: "small" }),
34
40
  ...f,
35
41
  children: r
36
42
  }
37
43
  );
38
44
  export {
39
- b as default
45
+ c as default
40
46
  };
41
47
  //# sourceMappingURL=TooltipInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TooltipInfo.js","sources":["../../../src/components/TooltipInfo/TooltipInfo.tsx"],"sourcesContent":["import type { TooltipProps } from 'antd';\nimport { Tooltip } from 'antd';\nimport React from 'react';\nimport type { DescriptionItem } from '../Descriptions/CommonDescriptions';\nimport CommonDescriptions from '../Descriptions/CommonDescriptions';\nimport './style.module.scss';\n\nexport interface TooltipInfoProps extends Pick<\n TooltipProps,\n 'placement' | 'mouseEnterDelay' | 'mouseLeaveDelay'\n> {\n /** 详情描述项,内部使用 CommonDescriptions 渲染 */\n content: DescriptionItem[];\n children: React.ReactNode;\n /** CommonDescriptions 列数,默认 1 */\n column?: number;\n /** 为 true 或 content 为空时不展示 Tooltip */\n hidden?: boolean;\n /** @deprecated 使用 classNames.root */\n overlayClassName?: string;\n /** @deprecated 使用 styles.root */\n overlayStyle?: React.CSSProperties;\n}\n\n/** Tooltip 详情展示,内部统一使用 CommonDescriptions */\nconst TooltipInfo: React.FC<TooltipInfoProps> = ({\n content,\n children,\n column = 1,\n hidden = false,\n placement = 'top',\n overlayClassName,\n overlayStyle,\n mouseEnterDelay = 0.3,\n ...rest\n}) => {\n if (hidden || content.length === 0) {\n return <>{children}</>;\n }\n\n return (\n <Tooltip\n placement={placement}\n mouseEnterDelay={mouseEnterDelay}\n destroyOnHidden\n classNames={{ root: ['tooltip-info-overlay', overlayClassName].filter(Boolean).join(' ') }}\n styles={{\n container: {\n minWidth: 220,\n maxWidth: 360,\n padding: '8px 12px',\n background: 'var(--tooltip-info-bg, var(--bg-color-white, #ffffff))',\n color: 'var(--tooltip-info-color, var(--font-color, #222222))',\n boxShadow: '0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12)',\n ...overlayStyle,\n },\n }}\n getPopupContainer={() => document.body}\n title={<CommonDescriptions content={content} column={column} size=\"small\" />}\n {...rest}\n >\n {children}\n </Tooltip>\n );\n};\n\nexport default TooltipInfo;\n"],"names":["TooltipInfo","content","children","column","hidden","placement","overlayClassName","overlayStyle","mouseEnterDelay","rest","jsx","Tooltip","CommonDescriptions"],"mappings":";;;AAyBA,MAAMA,IAA0C,CAAC;AAAA,EAC/C,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,GAAGC;AACL,MACML,KAAUH,EAAQ,WAAW,2BACrB,UAAAC,GAAS,IAInB,gBAAAQ;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,WAAAN;AAAA,IACA,iBAAAG;AAAA,IACA,iBAAe;AAAA,IACf,YAAY,EAAE,MAAM,CAAC,wBAAwBF,CAAgB,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAAA;AAAA,IACvF,QAAQ;AAAA,MACN,WAAW;AAAA,QACT,UAAU;AAAA,QACV,UAAU;AAAA,QACV,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,QACP,WAAW;AAAA,QACX,GAAGC;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,mBAAmB,MAAM,SAAS;AAAA,IAClC,OAAO,gBAAAG,EAACE,GAAA,EAAmB,SAAAX,GAAkB,QAAAE,GAAgB,MAAK,SAAQ;AAAA,IACzE,GAAGM;AAAA,IAEH,UAAAP;AAAA,EAAA;AAAA;"}
1
+ {"version":3,"file":"TooltipInfo.js","sources":["../../../src/components/TooltipInfo/TooltipInfo.tsx"],"sourcesContent":["import type { TooltipProps } from 'antd';\nimport { Tooltip } from 'antd';\nimport React from 'react';\nimport type { DescriptionItem } from '../Descriptions/CommonDescriptions';\nimport CommonDescriptions from '../Descriptions/CommonDescriptions';\nimport './style.module.scss';\n\nexport interface TooltipInfoProps extends Pick<\n TooltipProps,\n 'placement' | 'mouseEnterDelay' | 'mouseLeaveDelay'\n> {\n /** 详情描述项,内部使用 CommonDescriptions 渲染 */\n content: DescriptionItem[];\n children: React.ReactNode;\n /** CommonDescriptions 列数,默认 1 */\n column?: number;\n /** 为 true 或 content 为空时不展示 Tooltip */\n hidden?: boolean;\n /** @deprecated 使用 classNames.root */\n overlayClassName?: string;\n /** @deprecated 使用 styles.root */\n overlayStyle?: React.CSSProperties;\n}\n\n/** Tooltip 详情展示,内部统一使用 CommonDescriptions */\nconst TooltipInfo: React.FC<TooltipInfoProps> = ({\n content,\n children,\n column = 1,\n hidden = false,\n placement = 'top',\n overlayClassName,\n overlayStyle,\n mouseEnterDelay = 0.3,\n ...rest\n}) => {\n if (hidden || content.length === 0) {\n return <>{children}</>;\n }\n\n return (\n <Tooltip\n placement={placement}\n mouseEnterDelay={mouseEnterDelay}\n destroyOnHidden\n classNames={{ root: ['tooltip-info-overlay', overlayClassName].filter(Boolean).join(' ') }}\n styles={{\n root: {\n maxWidth: 320,\n },\n container: {\n boxSizing: 'border-box',\n minWidth: 220,\n width: '100%',\n padding: '8px 12px',\n background: 'var(--tooltip-info-bg, var(--bg-color-white, #ffffff))',\n color: 'var(--tooltip-info-color, var(--font-color, #222222))',\n boxShadow: '0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12)',\n ...overlayStyle,\n // 硬上限:避免 Descriptions 长文把气泡横向撑爆\n maxWidth: 320,\n },\n }}\n getPopupContainer={() => document.body}\n title={<CommonDescriptions content={content} column={column} size=\"small\" />}\n {...rest}\n >\n {children}\n </Tooltip>\n );\n};\n\nexport default TooltipInfo;\n"],"names":["TooltipInfo","content","children","column","hidden","placement","overlayClassName","overlayStyle","mouseEnterDelay","rest","jsx","Tooltip","CommonDescriptions"],"mappings":";;;AAyBA,MAAMA,IAA0C,CAAC;AAAA,EAC/C,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,GAAGC;AACL,MACML,KAAUH,EAAQ,WAAW,2BACrB,UAAAC,GAAS,IAInB,gBAAAQ;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,WAAAN;AAAA,IACA,iBAAAG;AAAA,IACA,iBAAe;AAAA,IACf,YAAY,EAAE,MAAM,CAAC,wBAAwBF,CAAgB,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAAA;AAAA,IACvF,QAAQ;AAAA,MACN,MAAM;AAAA,QACJ,UAAU;AAAA,MAAA;AAAA,MAEZ,WAAW;AAAA,QACT,WAAW;AAAA,QACX,UAAU;AAAA,QACV,OAAO;AAAA,QACP,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,QACP,WAAW;AAAA,QACX,GAAGC;AAAA;AAAA,QAEH,UAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IAEF,mBAAmB,MAAM,SAAS;AAAA,IAClC,OAAO,gBAAAG,EAACE,GAAA,EAAmB,SAAAX,GAAkB,QAAAE,GAAgB,MAAK,SAAQ;AAAA,IACzE,GAAGM;AAAA,IAEH,UAAAP;AAAA,EAAA;AAAA;"}
@@ -2,6 +2,8 @@ import { UploadFile } from 'antd/es/upload/interface';
2
2
  import { default as React } from 'react';
3
3
  /** 上传变体 */
4
4
  export type UploadVariant = 'panel' | 'button';
5
+ /** 已选文件列表样式:text=行列表;picture-card=图片卡片(含预览) */
6
+ export type UploadListType = 'text' | 'picture-card';
5
7
  export interface CommonUploadProps {
6
8
  value?: UploadFile[];
7
9
  onChange?: (value: UploadFile[]) => void;
@@ -17,6 +19,8 @@ export interface CommonUploadProps {
17
19
  accept?: string;
18
20
  /** panel = 拖拽面板(Dragger 样式),button = 按钮(默认) */
19
21
  variant?: UploadVariant;
22
+ /** 列表展现;图片场景用 picture-card(预览+缩略图) */
23
+ listType?: UploadListType;
20
24
  children?: React.ReactNode;
21
25
  renderTips?: () => React.ReactNode;
22
26
  /** 是否展示已上传文件列表,默认 true(tips 下方) */
@@ -38,29 +42,8 @@ export type CommonUploadRef = {
38
42
  /**
39
43
  * CommonUpload — 通用上传组件
40
44
  *
41
- * - 在 antd `<Form.Item>` 内使用时,通过 `value`/`onChange` 自动接入表单
42
- * - 独立使用时,通过 `onSave` 获取文件列表
43
- *
44
- * ## 两种变体
45
- *
46
- * - **`variant="button"`(默认)** — 虚线边框按钮 + 底部提示文案 + 已传文件列表
47
- * - **`variant="panel"`** — Dragger 拖拽面板 + 底部已传文件列表
48
- *
49
- * @example
50
- * ```tsx
51
- * // 在 Form.Item 中使用
52
- * <Form.Item name="files" label="简历附件" rules={[{ required: true, message: '请上传文件' }]}>
53
- * <CommonUpload accept=".pdf,.jpg,.png" maxLength={10} />
54
- * </Form.Item>
55
- *
56
- * // 独立使用(Modal 内、非表单场景)
57
- * <CommonUpload variant="panel" accept=".doc,.pdf" onSave={(list) => setFiles(list)} />
58
- *
59
- * // ref 手动触发上传
60
- * const ref = useRef<CommonUploadRef>(null);
61
- * <CommonUpload ref={ref} onUpload={...} />;
62
- * ref.current?.upload();
63
- * ```
45
+ * - `listType="text"`(默认):行列表;图片有缩略图时可「预览」
46
+ * - `listType="picture-card"`:antd 图片卡片(内置预览/删除图标)
64
47
  */
65
48
  declare const CommonUpload: React.ForwardRefExoticComponent<CommonUploadProps & React.RefAttributes<CommonUploadRef>>;
66
49
  export default CommonUpload;
@@ -1,188 +1,301 @@
1
- import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
- import { Inbox as V, Upload as W, File as X, Trash2 as Y } from "../Icons/index.js";
3
- import { message as I, Upload as N, Button as D, Typography as H, Tag as Z } from "antd";
4
- import f from "react";
5
- import a from "./style.module.scss.js";
6
- import o from "classnames";
7
- const R = (r) => r < 1024 * 1024 ? `${(r / 1024).toFixed(0)}KB` : r < 1024 ** 3 ? `${(r / 1024 / 1024).toFixed(0)}M` : `${(r / 1024 ** 3).toFixed(1)}G`;
8
- function S(r, i, t) {
9
- const c = [];
10
- if (r) {
11
- const g = r.split(",").map((x) => x.trim().replace(/^\./, "")).filter(Boolean);
12
- g.length && c.push(`支持扩展名${g.join(",")}`);
1
+ import { jsx as t, jsxs as b } from "react/jsx-runtime";
2
+ import { Plus as re, Inbox as te, Upload as le, File as ae, Trash2 as oe } from "../Icons/index.js";
3
+ import { message as y, Upload as U, Image as ie, Button as _, Typography as J } from "antd";
4
+ import p from "react";
5
+ import o from "./style.module.scss.js";
6
+ import a from "classnames";
7
+ import ue, { SEMANTIC_COLORS as se } from "../Tag/SemanticTag.js";
8
+ const B = (l) => l < 1024 * 1024 ? `${(l / 1024).toFixed(0)}KB` : l < 1024 ** 3 ? `${(l / 1024 / 1024).toFixed(0)}M` : `${(l / 1024 ** 3).toFixed(1)}G`;
9
+ function ne(l, u, s) {
10
+ const r = [];
11
+ if (l) {
12
+ const f = l.split(",").map((g) => g.trim().replace(/^\./, "")).filter(Boolean);
13
+ f.length && r.push(`支持扩展名${f.join(",")}`);
13
14
  }
14
- return i && c.push(`单个文件大小不超过${R(i)}`), t && c.push(`最多上传${t}个附件`), c.length ? /* @__PURE__ */ e(H.Text, { type: "secondary", className: o("upload-item", a["upload-item"]), children: c.join(",") }) : null;
15
+ return u && r.push(`单个文件大小不超过${B(u)}`), s && r.push(`最多上传${s}个附件`), r.length ? /* @__PURE__ */ t(J.Text, { type: "secondary", className: a("upload-item", o["upload-item"]), children: r.join(",") }) : null;
15
16
  }
16
- function ll(r) {
17
- const i = r.lastIndexOf(".");
18
- return i >= 0 ? r.slice(i + 1).toUpperCase() : "";
17
+ function de(l) {
18
+ const u = l.lastIndexOf(".");
19
+ return u >= 0 ? l.slice(u + 1).toUpperCase() : "";
19
20
  }
20
- const v = ({ fileList: r, onRemove: i }) => r.length ? /* @__PURE__ */ e("div", { className: o("upload-link", a["upload-link"]), children: r.map((t) => /* @__PURE__ */ h(
21
- "div",
22
- {
23
- className: o(
24
- o("upload-file-row", a["upload-file-row"]),
25
- t.status === "error" && o("upload-file-row-error", a["upload-file-row-error"])
26
- ),
27
- children: [
28
- /* @__PURE__ */ h("div", { className: o("upload-label", a["upload-label"]), children: [
29
- /* @__PURE__ */ e(X, { className: o("upload-value", a["upload-value"]) }),
30
- /* @__PURE__ */ e("span", { className: o("upload-meta", a["upload-meta"]), children: t.name }),
31
- /* @__PURE__ */ e(Z, { color: "processing", className: o("upload-icon", a["upload-icon"]), children: ll(t.name) }),
32
- t.size && /* @__PURE__ */ e(
33
- H.Text,
34
- {
35
- type: "secondary",
36
- className: o("upload-title", a["upload-title"]),
37
- children: R(t.size)
38
- }
39
- )
40
- ] }),
41
- /* @__PURE__ */ e(
42
- D,
43
- {
44
- type: "text",
45
- danger: !0,
46
- size: "small",
47
- icon: /* @__PURE__ */ e(Y, {}),
48
- onClick: () => i(t.uid),
49
- className: o("upload-desc", a["upload-desc"])
50
- }
51
- )
52
- ]
53
- },
54
- t.uid
55
- )) }) : null, el = f.forwardRef(
21
+ function pe(l) {
22
+ return l.url ? l.url : l.thumbUrl ? l.thumbUrl : l.originFileObj ? URL.createObjectURL(l.originFileObj) : "";
23
+ }
24
+ const V = ({ fileList: l, onRemove: u, onPreview: s }) => l.length ? /* @__PURE__ */ t("div", { className: a("upload-link", o["upload-link"]), children: l.map((r) => {
25
+ var g, w, N;
26
+ const f = !!(r.url || r.thumbUrl || (w = (g = r.originFileObj) == null ? void 0 : g.type) != null && w.startsWith("image/"));
27
+ return /* @__PURE__ */ b(
28
+ "div",
29
+ {
30
+ className: a(
31
+ a("upload-file-row", o["upload-file-row"]),
32
+ r.status === "error" && a("upload-file-row-error", o["upload-file-row-error"])
33
+ ),
34
+ children: [
35
+ /* @__PURE__ */ b("div", { className: a("upload-label", o["upload-label"]), children: [
36
+ r.thumbUrl || r.url && ((N = r.type) != null && N.startsWith("image/")) ? /* @__PURE__ */ t(
37
+ "button",
38
+ {
39
+ type: "button",
40
+ className: a("upload-thumb-btn", o["upload-thumb-btn"]),
41
+ onClick: () => s == null ? void 0 : s(r),
42
+ title: "预览",
43
+ children: /* @__PURE__ */ t(
44
+ "img",
45
+ {
46
+ className: a("upload-thumb", o["upload-thumb"]),
47
+ src: r.thumbUrl || r.url,
48
+ alt: r.name
49
+ }
50
+ )
51
+ }
52
+ ) : /* @__PURE__ */ t(ae, { className: a("upload-value", o["upload-value"]) }),
53
+ /* @__PURE__ */ t("span", { className: a("upload-meta", o["upload-meta"]), children: r.name }),
54
+ /* @__PURE__ */ t(
55
+ ue,
56
+ {
57
+ color: se.INFO,
58
+ className: a("upload-icon", o["upload-icon"]),
59
+ children: de(r.name)
60
+ }
61
+ ),
62
+ r.size ? /* @__PURE__ */ t(
63
+ J.Text,
64
+ {
65
+ type: "secondary",
66
+ className: a("upload-title", o["upload-title"]),
67
+ children: B(r.size)
68
+ }
69
+ ) : null
70
+ ] }),
71
+ /* @__PURE__ */ b("div", { className: a("upload-row-actions", o["upload-row-actions"]), children: [
72
+ f && s ? /* @__PURE__ */ t(_, { type: "link", size: "small", onClick: () => s(r), children: "预览" }) : null,
73
+ /* @__PURE__ */ t(
74
+ _,
75
+ {
76
+ type: "text",
77
+ danger: !0,
78
+ size: "small",
79
+ icon: /* @__PURE__ */ t(oe, {}),
80
+ onClick: () => u(r.uid),
81
+ className: a("upload-desc", o["upload-desc"])
82
+ }
83
+ )
84
+ ] })
85
+ ]
86
+ },
87
+ r.uid
88
+ );
89
+ }) }) : null, ce = p.forwardRef(
56
90
  ({
57
- value: r,
58
- onChange: i,
59
- className: t,
60
- variant: c,
91
+ value: l,
92
+ onChange: u,
93
+ className: s,
94
+ variant: r,
95
+ listType: f = "text",
61
96
  size: g,
62
- children: x,
63
- renderTips: F,
64
- showFileList: L = !0,
65
- fileSize: j,
66
- maxLength: K,
67
- multiple: k,
97
+ children: w,
98
+ renderTips: N,
99
+ showFileList: q = !0,
100
+ fileSize: G,
101
+ maxLength: x,
102
+ multiple: I,
68
103
  directory: O,
69
- accept: U,
70
- onUpload: w,
71
- onSave: n,
72
- getPermission: b,
73
- concurrentCount: M
74
- }, P) => {
75
- const [A, J] = f.useState([]), [_, z] = f.useState(!1), u = r ?? A, m = f.useCallback(
76
- (l) => {
77
- const s = typeof l == "function" ? l(u) : l;
78
- i == null || i(s), J(s), n == null || n(s);
104
+ accept: R,
105
+ onUpload: L,
106
+ onSave: c,
107
+ getPermission: j,
108
+ concurrentCount: Q
109
+ }, X) => {
110
+ const [Y, Z] = p.useState([]), [M, P] = p.useState(!1), [F, W] = p.useState({
111
+ open: !1,
112
+ url: "",
113
+ title: ""
114
+ }), k = p.useRef([]), n = l ?? Y, m = p.useCallback(
115
+ (e) => {
116
+ const i = typeof e == "function" ? e(n) : e;
117
+ u == null || u(i), Z(i), c == null || c(i);
79
118
  },
80
- [u, i, n]
81
- ), $ = j ?? 500 * 1024 * 1024, C = M ?? 3, E = f.useCallback(
82
- (l) => b && !b(l) ? (I.error("无权限上传此文件"), N.LIST_IGNORE) : l.size > $ ? (I.error(`文件超出 ${R($)} 限制`), N.LIST_IGNORE) : !0,
83
- [$, b]
84
- ), T = f.useCallback(async () => {
85
- if (!(!w || !u.length)) {
86
- z(!0);
119
+ [n, u, c]
120
+ ), C = G ?? 500 * 1024 * 1024, A = Q ?? 3, $ = p.useCallback(
121
+ (e) => j && !j(e) ? (y.error("无权限上传此文件"), U.LIST_IGNORE) : e.size > C ? (y.error(`文件超出 ${B(C)} 限制`), U.LIST_IGNORE) : !0,
122
+ [C, j]
123
+ ), D = p.useCallback(async () => {
124
+ if (!(!L || !n.length)) {
125
+ P(!0);
87
126
  try {
88
- const l = [...u], s = [];
89
- for (; l.length; ) {
90
- const d = l.shift();
127
+ const e = [...n], i = [];
128
+ for (; e.length; ) {
129
+ const d = e.shift();
91
130
  if (!(d != null && d.originFileObj)) continue;
92
- const Q = d.originFileObj;
93
- s.push(
94
- new Promise((G) => {
95
- w({
96
- file: Q,
97
- onSuccess: (q) => {
131
+ const ee = d.originFileObj;
132
+ i.push(
133
+ new Promise((H) => {
134
+ L({
135
+ file: ee,
136
+ onSuccess: (K) => {
98
137
  m(
99
- (y) => y.map(
100
- (p) => p.uid === d.uid ? { ...p, status: "done", url: q ?? p.url } : p
138
+ (T) => T.map(
139
+ (h) => h.uid === d.uid ? { ...h, status: "done", url: K ?? h.url } : h
101
140
  )
102
- ), G();
141
+ ), H();
103
142
  },
104
- onError: (q) => {
105
- I.error(`${d.name} 上传失败`), m(
106
- (y) => y.map((p) => p.uid === d.uid ? { ...p, status: "error" } : p)
107
- ), G();
143
+ onError: (K) => {
144
+ y.error(`${d.name} 上传失败`), m(
145
+ (T) => T.map((h) => h.uid === d.uid ? { ...h, status: "error" } : h)
146
+ ), H();
108
147
  }
109
148
  });
110
149
  })
111
- ), s.length >= C && await Promise.race(s);
150
+ ), i.length >= A && await Promise.race(i);
112
151
  }
113
- await Promise.allSettled(s), n == null || n(u);
152
+ await Promise.allSettled(i), c == null || c(n);
114
153
  } finally {
115
- z(!1);
154
+ P(!1);
116
155
  }
117
156
  }
118
- }, [u, w, C, n, m]);
119
- f.useImperativeHandle(P, () => ({ upload: T, uploading: _ }), [
120
- T,
121
- _
157
+ }, [n, L, A, c, m]);
158
+ p.useImperativeHandle(X, () => ({ upload: D, uploading: M }), [
159
+ D,
160
+ M
122
161
  ]);
123
- const B = (F == null ? void 0 : F()) ?? S(U, j, K);
124
- return c === "panel" ? /* @__PURE__ */ h("div", { className: t, children: [
125
- /* @__PURE__ */ h(
126
- N.Dragger,
162
+ const E = p.useCallback((e) => {
163
+ const i = pe(e);
164
+ if (!i) {
165
+ y.warning("暂无法预览该文件");
166
+ return;
167
+ }
168
+ i.startsWith("blob:") && k.current.push(i), W({ open: !0, url: i, title: e.name || "预览" });
169
+ }, []);
170
+ p.useEffect(
171
+ () => () => {
172
+ k.current.forEach((e) => URL.revokeObjectURL(e)), k.current = [];
173
+ },
174
+ []
175
+ );
176
+ const v = (N == null ? void 0 : N()) ?? ne(R, G, x), S = !x || n.length < x, z = /* @__PURE__ */ t(
177
+ ie,
178
+ {
179
+ alt: F.title,
180
+ style: { display: "none" },
181
+ src: F.url,
182
+ preview: {
183
+ visible: F.open,
184
+ src: F.url,
185
+ onVisibleChange: (e) => W((i) => ({ ...i, open: e }))
186
+ }
187
+ }
188
+ );
189
+ return f === "picture-card" ? /* @__PURE__ */ b(
190
+ "div",
191
+ {
192
+ className: a("upload-picture-root", o["upload-picture-root"], s),
193
+ children: [
194
+ /* @__PURE__ */ t(
195
+ U,
196
+ {
197
+ listType: "picture-card",
198
+ fileList: n,
199
+ beforeUpload: $,
200
+ onChange: (e) => m(e.fileList),
201
+ onPreview: E,
202
+ multiple: I,
203
+ directory: O,
204
+ accept: R,
205
+ showUploadList: { showPreviewIcon: !0, showRemoveIcon: !0 },
206
+ customRequest: ({ onSuccess: e }) => e == null ? void 0 : e({}),
207
+ className: a("upload-picture-card", o["upload-picture-card"]),
208
+ children: S ? /* @__PURE__ */ b(
209
+ "div",
210
+ {
211
+ className: a("upload-picture-trigger", o["upload-picture-trigger"]),
212
+ children: [
213
+ /* @__PURE__ */ t(re, { size: 20 }),
214
+ /* @__PURE__ */ t(
215
+ "div",
216
+ {
217
+ className: a(
218
+ "upload-picture-trigger-text",
219
+ o["upload-picture-trigger-text"]
220
+ ),
221
+ children: "上传图片"
222
+ }
223
+ )
224
+ ]
225
+ }
226
+ ) : null
227
+ }
228
+ ),
229
+ v ? /* @__PURE__ */ t("div", { className: a("upload-list", o["upload-list"]), children: v }) : null,
230
+ z
231
+ ]
232
+ }
233
+ ) : r === "panel" ? /* @__PURE__ */ b("div", { className: s, children: [
234
+ /* @__PURE__ */ b(
235
+ U.Dragger,
127
236
  {
128
- fileList: u,
129
- beforeUpload: E,
130
- onChange: (l) => m(l.fileList),
131
- multiple: k,
237
+ fileList: n,
238
+ beforeUpload: $,
239
+ onChange: (e) => m(e.fileList),
240
+ multiple: I,
132
241
  directory: O,
133
- accept: U,
242
+ accept: R,
134
243
  showUploadList: !1,
135
- customRequest: ({ onSuccess: l }) => l == null ? void 0 : l({}),
244
+ customRequest: ({ onSuccess: e }) => e == null ? void 0 : e({}),
136
245
  children: [
137
- /* @__PURE__ */ e("p", { className: o("upload-drag-icon", a["upload-drag-icon"]), children: /* @__PURE__ */ e(V, {}) }),
138
- /* @__PURE__ */ e("p", { className: "ant-upload-text", children: "点击或拖拽文件到此区域上传" }),
139
- /* @__PURE__ */ e("p", { children: B })
246
+ /* @__PURE__ */ t("p", { className: a("upload-drag-icon", o["upload-drag-icon"]), children: /* @__PURE__ */ t(te, {}) }),
247
+ /* @__PURE__ */ t("p", { className: "ant-upload-text", children: "点击或拖拽文件到此区域上传" }),
248
+ /* @__PURE__ */ t("p", { children: v })
140
249
  ]
141
250
  }
142
251
  ),
143
- L && /* @__PURE__ */ e(
144
- v,
252
+ q && /* @__PURE__ */ t(
253
+ V,
145
254
  {
146
- fileList: u,
147
- onRemove: (l) => m((s) => s.filter((d) => d.uid !== l))
255
+ fileList: n,
256
+ onRemove: (e) => m((i) => i.filter((d) => d.uid !== e)),
257
+ onPreview: E
148
258
  }
149
- )
150
- ] }) : /* @__PURE__ */ h("div", { className: t, children: [
151
- /* @__PURE__ */ e(
152
- N,
259
+ ),
260
+ z
261
+ ] }) : /* @__PURE__ */ b("div", { className: s, children: [
262
+ /* @__PURE__ */ t(
263
+ U,
153
264
  {
154
- fileList: u,
155
- beforeUpload: E,
156
- onChange: (l) => m(l.fileList),
157
- multiple: k,
265
+ fileList: n,
266
+ beforeUpload: $,
267
+ onChange: (e) => m(e.fileList),
268
+ multiple: I,
158
269
  directory: O,
159
- accept: U,
270
+ accept: R,
160
271
  showUploadList: !1,
161
- customRequest: ({ onSuccess: l }) => l == null ? void 0 : l({}),
162
- children: x ?? /* @__PURE__ */ e(
163
- D,
272
+ customRequest: ({ onSuccess: e }) => e == null ? void 0 : e({}),
273
+ children: w ?? /* @__PURE__ */ t(
274
+ _,
164
275
  {
165
276
  size: g,
166
- icon: /* @__PURE__ */ e(W, {}),
167
- className: o("upload-toolbar", a["upload-toolbar"]),
277
+ icon: /* @__PURE__ */ t(le, {}),
278
+ className: a("upload-toolbar", o["upload-toolbar"]),
168
279
  children: "点击上传"
169
280
  }
170
281
  )
171
282
  }
172
283
  ),
173
- /* @__PURE__ */ e("div", { className: o("upload-list", a["upload-list"]), children: B }),
174
- L && /* @__PURE__ */ e(
175
- v,
284
+ /* @__PURE__ */ t("div", { className: a("upload-list", o["upload-list"]), children: v }),
285
+ q && /* @__PURE__ */ t(
286
+ V,
176
287
  {
177
- fileList: u,
178
- onRemove: (l) => m((s) => s.filter((d) => d.uid !== l))
288
+ fileList: n,
289
+ onRemove: (e) => m((i) => i.filter((d) => d.uid !== e)),
290
+ onPreview: E
179
291
  }
180
- )
292
+ ),
293
+ z
181
294
  ] });
182
295
  }
183
296
  );
184
- el.displayName = "CommonUpload";
297
+ ce.displayName = "CommonUpload";
185
298
  export {
186
- el as default
299
+ ce as default
187
300
  };
188
301
  //# sourceMappingURL=index.js.map