el-plus 0.0.30 → 0.0.33

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 (109) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/index.full.js +283 -49
  3. package/dist/index.full.min.js +1 -1
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +1 -1
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +280 -47
  8. package/es/components/attachment/index.d.ts +174 -0
  9. package/es/components/attachment/index.mjs +8 -0
  10. package/es/components/attachment/index.mjs.map +1 -0
  11. package/es/components/attachment/src/attachment.d.ts +23 -0
  12. package/es/components/attachment/src/attachment.mjs +31 -0
  13. package/es/components/attachment/src/attachment.mjs.map +1 -0
  14. package/es/components/attachment/src/attachment.vue.d.ts +71 -0
  15. package/es/components/attachment/src/attachment.vue.mjs +6 -0
  16. package/es/components/attachment/src/attachment.vue.mjs.map +1 -0
  17. package/es/components/attachment/src/attachment.vue2.mjs +65 -0
  18. package/es/components/attachment/src/attachment.vue2.mjs.map +1 -0
  19. package/es/components/attachment/src/use-attachment.d.ts +212 -0
  20. package/es/components/attachment/src/use-attachment.mjs +80 -0
  21. package/es/components/attachment/src/use-attachment.mjs.map +1 -0
  22. package/es/components/attachment/style/css.d.ts +2 -0
  23. package/es/components/attachment/style/css.mjs +5 -0
  24. package/es/components/attachment/style/css.mjs.map +1 -0
  25. package/es/components/attachment/style/index.d.ts +2 -0
  26. package/es/components/attachment/style/index.mjs +5 -0
  27. package/es/components/attachment/style/index.mjs.map +1 -0
  28. package/es/components/form/src/hooks/use-form-item.mjs +9 -12
  29. package/es/components/form/src/hooks/use-form-item.mjs.map +1 -1
  30. package/es/components/index.d.ts +1 -0
  31. package/es/components/index.mjs +2 -0
  32. package/es/components/index.mjs.map +1 -1
  33. package/es/components/search-list-page/index.d.ts +213 -192
  34. package/es/components/search-list-page/src/search-list-page.d.ts +1 -1
  35. package/es/components/search-list-page/src/search-list-page.vue.d.ts +54 -49
  36. package/es/components/search-list-page/src/use-search-list-page.d.ts +52 -47
  37. package/es/components/table/index.d.ts +51 -46
  38. package/es/components/table/src/table.d.ts +1 -1
  39. package/es/components/table/src/table.mjs.map +1 -1
  40. package/es/components/table/src/table.vue.d.ts +12 -11
  41. package/es/components/table/src/table.vue2.mjs +1 -2
  42. package/es/components/table/src/table.vue2.mjs.map +1 -1
  43. package/es/components/table/src/use-table.d.ts +1 -71
  44. package/es/components/table/src/use-table.mjs +7 -9
  45. package/es/components/table/src/use-table.mjs.map +1 -1
  46. package/es/components.mjs +3 -1
  47. package/es/components.mjs.map +1 -1
  48. package/es/index.mjs +2 -0
  49. package/es/index.mjs.map +1 -1
  50. package/es/package.json.mjs +1 -1
  51. package/es/utils/env.d.ts +2 -1
  52. package/es/utils/env.mjs +9 -1
  53. package/es/utils/env.mjs.map +1 -1
  54. package/es/utils/file.d.ts +2 -0
  55. package/es/utils/file.mjs +13 -3
  56. package/es/utils/file.mjs.map +1 -1
  57. package/es/utils/index.mjs +1 -1
  58. package/lib/components/attachment/index.d.ts +174 -0
  59. package/lib/components/attachment/index.js +14 -0
  60. package/lib/components/attachment/index.js.map +1 -0
  61. package/lib/components/attachment/src/attachment.d.ts +23 -0
  62. package/lib/components/attachment/src/attachment.js +33 -0
  63. package/lib/components/attachment/src/attachment.js.map +1 -0
  64. package/lib/components/attachment/src/attachment.vue.d.ts +71 -0
  65. package/lib/components/attachment/src/attachment.vue.js +10 -0
  66. package/lib/components/attachment/src/attachment.vue.js.map +1 -0
  67. package/lib/components/attachment/src/attachment.vue2.js +69 -0
  68. package/lib/components/attachment/src/attachment.vue2.js.map +1 -0
  69. package/lib/components/attachment/src/use-attachment.d.ts +212 -0
  70. package/lib/components/attachment/src/use-attachment.js +82 -0
  71. package/lib/components/attachment/src/use-attachment.js.map +1 -0
  72. package/lib/components/attachment/style/css.d.ts +2 -0
  73. package/lib/components/attachment/style/css.js +7 -0
  74. package/lib/components/attachment/style/css.js.map +1 -0
  75. package/lib/components/attachment/style/index.d.ts +2 -0
  76. package/lib/components/attachment/style/index.js +7 -0
  77. package/lib/components/attachment/style/index.js.map +1 -0
  78. package/lib/components/form/src/hooks/use-form-item.js +9 -12
  79. package/lib/components/form/src/hooks/use-form-item.js.map +1 -1
  80. package/lib/components/index.d.ts +1 -0
  81. package/lib/components/index.js +4 -0
  82. package/lib/components/index.js.map +1 -1
  83. package/lib/components/search-list-page/index.d.ts +213 -192
  84. package/lib/components/search-list-page/src/search-list-page.d.ts +1 -1
  85. package/lib/components/search-list-page/src/search-list-page.vue.d.ts +54 -49
  86. package/lib/components/search-list-page/src/use-search-list-page.d.ts +52 -47
  87. package/lib/components/table/index.d.ts +51 -46
  88. package/lib/components/table/src/table.d.ts +1 -1
  89. package/lib/components/table/src/table.js.map +1 -1
  90. package/lib/components/table/src/table.vue.d.ts +12 -11
  91. package/lib/components/table/src/table.vue2.js +1 -2
  92. package/lib/components/table/src/table.vue2.js.map +1 -1
  93. package/lib/components/table/src/use-table.d.ts +1 -71
  94. package/lib/components/table/src/use-table.js +7 -9
  95. package/lib/components/table/src/use-table.js.map +1 -1
  96. package/lib/components.js +3 -1
  97. package/lib/components.js.map +1 -1
  98. package/lib/index.js +10 -6
  99. package/lib/index.js.map +1 -1
  100. package/lib/package.json.js +1 -1
  101. package/lib/utils/env.d.ts +2 -1
  102. package/lib/utils/env.js +9 -0
  103. package/lib/utils/env.js.map +1 -1
  104. package/lib/utils/file.d.ts +2 -0
  105. package/lib/utils/file.js +13 -1
  106. package/lib/utils/file.js.map +1 -1
  107. package/lib/utils/index.js +1 -0
  108. package/lib/utils/index.js.map +1 -1
  109. package/package.json +1 -1
@@ -0,0 +1,80 @@
1
+ import { computed, ref } from 'vue';
2
+ import { useNavigation } from '../../../hooks/use-navigation.mjs';
3
+ import { downloadFile, previewFile } from '../../../utils/file.mjs';
4
+
5
+ const useAttachment = (props, { data }) => {
6
+ const { mode: defaultMode } = useNavigation();
7
+ const mode = computed(() => {
8
+ return props.mode || defaultMode.value;
9
+ });
10
+ const columns = ref([
11
+ {
12
+ type: "EpButtons",
13
+ label: "\u64CD\u4F5C",
14
+ width: "120px",
15
+ props: {
16
+ type: "text",
17
+ list: [
18
+ {
19
+ name: "\u4E0B\u8F7D",
20
+ onClick({ row }) {
21
+ downloadFile({
22
+ src: row.filePath,
23
+ fileName: row.originalFilename || row.originalFileName
24
+ });
25
+ }
26
+ },
27
+ {
28
+ name: "\u5220\u9664",
29
+ disabled: () => {
30
+ return mode.value === "browse";
31
+ },
32
+ onClick: ({ $index }) => {
33
+ data.value.splice($index, 1);
34
+ }
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ {
40
+ label: "\u9644\u4EF6\u7C7B\u578B",
41
+ prop: "type",
42
+ type: "EpSelect",
43
+ required: true,
44
+ show: () => props.isType,
45
+ props: {
46
+ desc: ({ row }) => {
47
+ return row.typeDesc;
48
+ }
49
+ }
50
+ },
51
+ {
52
+ label: "\u6587\u4EF6\u540D\u79F0",
53
+ prop: "originalFilename",
54
+ type: "EpLink",
55
+ onClick({ row }) {
56
+ previewFile(row.filePath);
57
+ }
58
+ },
59
+ {
60
+ label: "\u521B\u5EFA\u4EBA",
61
+ prop: "createBy"
62
+ },
63
+ {
64
+ label: "\u521B\u5EFA\u65F6\u95F4",
65
+ prop: "createTime"
66
+ },
67
+ {
68
+ label: "\u8BF4\u660E",
69
+ prop: "note",
70
+ type: "EpInput",
71
+ show: () => props.isNote
72
+ }
73
+ ]);
74
+ return {
75
+ columns
76
+ };
77
+ };
78
+
79
+ export { useAttachment };
80
+ //# sourceMappingURL=use-attachment.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-attachment.mjs","sources":["../../../../../../packages/components/attachment/src/use-attachment.ts"],"sourcesContent":["import { ref, computed } from 'vue'\nimport { useNavigation } from '@el-plus/hooks/use-navigation'\nimport { downloadFile, previewFile } from '@el-plus/utils/file'\nexport const useAttachment = (props, { data }) => {\n const { mode: defaultMode } = useNavigation()\n const mode = computed(() => {\n return props.mode || defaultMode.value\n })\n\n const columns = ref([\n {\n type: 'EpButtons',\n label: '操作',\n width: '120px',\n props: {\n type: 'text',\n list: [\n {\n name: '下载',\n onClick({ row }) {\n downloadFile({\n src: row.filePath,\n fileName: row.originalFilename || row.originalFileName,\n })\n },\n },\n {\n name: '删除',\n disabled: () => {\n return mode.value === 'browse'\n },\n onClick: ({ $index }) => {\n data.value.splice($index, 1)\n },\n },\n ],\n },\n },\n {\n label: '附件类型',\n prop: 'type',\n type: 'EpSelect',\n required: true,\n show: () => props.isType,\n props: {\n desc: ({ row }) => {\n return row.typeDesc\n },\n },\n },\n {\n label: '文件名称',\n prop: 'originalFilename',\n type: 'EpLink',\n onClick({ row }) {\n previewFile(row.filePath)\n },\n },\n {\n label: '创建人',\n prop: 'createBy',\n },\n {\n label: '创建时间',\n prop: 'createTime',\n },\n {\n label: '说明',\n prop: 'note',\n type: 'EpInput',\n show: () => props.isNote,\n },\n ])\n return {\n columns,\n }\n}\n"],"names":[],"mappings":";;;;AAGO,MAAM,aAAA,GAAgB,CAAC,KAAA,EAAO,EAAE,MAAK,KAAM;AAChD,EAAA,MAAM,EAAE,IAAA,EAAM,WAAA,EAAY,GAAI,aAAA,EAAc;AAC5C,EAAA,MAAM,IAAA,GAAO,SAAS,MAAM;AAC1B,IAAA,OAAO,KAAA,CAAM,QAAQ,WAAA,CAAY,KAAA;AAAA,EACnC,CAAC,CAAA;AAED,EAAA,MAAM,UAAU,GAAA,CAAI;AAAA,IAClB;AAAA,MACE,IAAA,EAAM,WAAA;AAAA,MACN,KAAA,EAAO,cAAA;AAAA,MACP,KAAA,EAAO,OAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,IAAA,EAAM,MAAA;AAAA,QACN,IAAA,EAAM;AAAA,UACJ;AAAA,YACE,IAAA,EAAM,cAAA;AAAA,YACN,OAAA,CAAQ,EAAE,GAAA,EAAI,EAAG;AACf,cAAA,YAAA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AM,KAAA,CAAM;AAAA;AACpB,GACD,CAAA;AACD,EAAA,OAAO;AAAA,IACL;AAAA,GACF;AACF;;;;"}
@@ -0,0 +1,2 @@
1
+ import 'el-plus/es/components/base/style/css';
2
+ import 'el-plus/es/theme-chalk/attachment.css';
@@ -0,0 +1,5 @@
1
+ import '../../base/style/css.mjs';
2
+ import 'el-plus/theme-chalk/attachment.css';
3
+
4
+ "use strict";
5
+ //# sourceMappingURL=css.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,2 @@
1
+ import 'el-plus/es/components/base/style';
2
+ import 'el-plus/es/theme-chalk/src/attachment.scss';
@@ -0,0 +1,5 @@
1
+ import '../../base/style/index.mjs';
2
+ import 'el-plus/theme-chalk/src/attachment.scss';
3
+
4
+ "use strict";
5
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -8,17 +8,10 @@ const useFormItem = () => {
8
8
  const useFormItemSlots = (props) => {
9
9
  const attrs = useAttrs();
10
10
  const {
11
- type,
12
- label,
13
11
  render,
14
- required,
15
12
  labelRender
16
13
  } = props;
17
14
  const prop = props.tableProp || props.prop;
18
- const {
19
- scopedSlots: renderScopedSlots,
20
- ...renderProps
21
- } = props.props || {};
22
15
  const events = {};
23
16
  for (const key in attrs) {
24
17
  if (key.startsWith("on")) {
@@ -33,11 +26,15 @@ const useFormItemSlots = (props) => {
33
26
  };
34
27
  const scopedSlots = {
35
28
  default: () => {
29
+ const {
30
+ scopedSlots: renderScopedSlots,
31
+ ...renderProps
32
+ } = props.props || {};
36
33
  let disabled = props.disabled;
37
34
  if (typeof props.disabled === "function") {
38
35
  disabled = props.disabled(formData);
39
36
  }
40
- return type ? h(resolveComponent(type), {
37
+ return props.type ? h(resolveComponent(props.type), {
41
38
  modelValue: formData[prop],
42
39
  "onUpdate:modelValue": (value) => {
43
40
  formData[prop] = value;
@@ -52,21 +49,21 @@ const useFormItemSlots = (props) => {
52
49
  return createVNode(ElTooltip, {
53
50
  "placement": "top",
54
51
  "effect": "dark",
55
- "content": label,
52
+ "content": props.label,
56
53
  "disabled": !props.isShowLabel || isTipDisabled.value
57
54
  }, {
58
55
  default: () => [createVNode("span", {
59
56
  "onMouseenter": checkOverflow,
60
57
  "style": "display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"
61
- }, [!props.hideRequiredAsterisk && required ? createVNode("span", {
58
+ }, [!props.hideRequiredAsterisk && props.required ? createVNode("span", {
62
59
  "style": "color: var(--el-color-danger);"
63
- }, [createTextVNode("*")]) : null, props.isShowLabel ? createVNode("span", null, [label]) : ""])]
60
+ }, [createTextVNode("*")]) : null, props.isShowLabel ? createVNode("span", null, [props.label]) : ""])]
64
61
  });
65
62
  }
66
63
  };
67
64
  if (labelRender) {
68
65
  scopedSlots.label = () => labelRender({
69
- label
66
+ label: props.label
70
67
  });
71
68
  }
72
69
  if (render) {
@@ -1 +1 @@
1
- {"version":3,"file":"use-form-item.mjs","sources":["../../../../../../../packages/components/form/src/hooks/use-form-item.tsx"],"sourcesContent":["import { h, resolveComponent, useAttrs, ref } from 'vue'\nimport type { FormItemProps } from '../form-item'\nimport type { FormItemRule } from 'element-plus'\nimport { ElTooltip } from 'element-plus'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nexport const useFormItem = () => {\n return {}\n}\nexport const useFormItemSlots = (props: FormItemProps) => {\n const attrs = useAttrs()\n const { type, label, render, required, labelRender } = props\n const prop = props.tableProp || props.prop\n const { scopedSlots: renderScopedSlots, ...renderProps } = props.props || {}\n const events: Record<string, (...args: any[]) => void> = {}\n for (const key in attrs) {\n if (key.startsWith('on')) {\n events[key] = attrs[key] as (...args: any[]) => void\n }\n }\n\n const formData = attrs['form-data'] as Record<string, unknown>\n const isTipDisabled = ref(true) // 默认禁用提示\n const checkOverflow = (e: MouseEvent) => {\n const el = e.currentTarget as HTMLElement\n isTipDisabled.value = el.scrollWidth <= el.clientWidth\n }\n const scopedSlots = {\n default: () => {\n let disabled = props.disabled\n if (typeof props.disabled === 'function') {\n disabled = props.disabled(formData)\n }\n return type\n ? h(\n resolveComponent(type),\n {\n modelValue: formData[prop as string],\n 'onUpdate:modelValue': (value: unknown) => {\n formData[prop as string] = value\n },\n disabled,\n clearable: true,\n ...renderProps,\n ...events,\n },\n renderScopedSlots,\n )\n : formData[prop as string]\n },\n label: () => {\n return (\n <ElTooltip\n placement=\"top\"\n effect=\"dark\"\n content={label}\n disabled={!props.isShowLabel || isTipDisabled.value}\n >\n <span\n onMouseenter={checkOverflow}\n style=\"display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;\"\n >\n {!props.hideRequiredAsterisk && required ? (\n <span style=\"color: var(--el-color-danger);\">*</span>\n ) : null}\n {props.isShowLabel ? <span>{label}</span> : ''}\n </span>\n </ElTooltip>\n )\n },\n }\n\n if (labelRender) {\n scopedSlots.label = () => labelRender({ label })\n }\n if (render) {\n scopedSlots.default = () => {\n return render(attrs['table-scope'])\n }\n }\n return {\n scopedSlots,\n }\n}\nexport const useFormItemRules = (props: FormItemProps) => {\n const { t } = useLocale()\n const { required, rules, label } = props\n let mergeRules: FormItemRule[] = []\n if (required) {\n const requiredDefault = { required: true }\n mergeRules.push(requiredDefault)\n }\n if (rules) {\n if (Array.isArray(rules)) {\n mergeRules = mergeRules.concat(rules)\n }\n\n if (Object.prototype.toString.call(rules) === '[object Object]') {\n mergeRules.push(rules as FormItemRule)\n }\n }\n\n if (mergeRules) {\n mergeRules.forEach((r) => {\n if (r.required && typeof r.message === 'undefined') {\n r.message = `${label || ''}${t('ep.formItem.required')}`\n }\n })\n }\n return { rules: mergeRules }\n}\n"],"names":["useFormItem","useFormItemSlots","props","attrs","useAttrs","type","label","render","required","labelRender","prop","tableProp","scopedSlots","renderScopedSlots","renderProps","events","key","startsWith","formData","isTipDisabled","ref","checkOverflow","e","el","currentTarget","value","scrollWidth","clientWidth","default","disabled","h","resolveComponent","modelValue","clearable","_createVNode","ElTooltip","isShowLabel","hideRequiredAsterisk","_createTextVNode","useFormItemRules","t","useLocale","rules","mergeRules","requiredDefault","push","Array","isArray","concat","Object","prototype","toString","call","forEach","r","message"],"mappings":";;;;AAKO,MAAMA,cAAcA,MAAM;AAC/B,EAAA,OAAO,EAAC;AACV;AACO,MAAMC,mBAAoBC,CAAAA,KAAAA,KAAyB;AACxD,EAAA,MAAMC,QAAQC,QAAAA,EAAS;AACvB,EAAA,MAAM;AAAA,IAAEC,IAAAA;AAAAA,IAAMC,KAAAA;AAAAA,IAAOC,MAAAA;AAAAA,IAAQC,QAAAA;AAAAA,IAAUC;AAAAA,GAAY,GAAIP,KAAAA;AACvD,EAAA,MAAMQ,IAAAA,GAAOR,KAAAA,CAAMS,SAAAA,IAAaT,KAAAA,CAAMQ,IAAAA;AACtC,EAAA,MAAM;AAAA,IAAEE,WAAAA,EAAaC,iBAAAA;AAAAA,IAAmB,GAAGC;AAAAA,GAAY,GAAIZ,KAAAA,CAAMA,KAAAA,IAAS,EAAC;AAC3E,EAAA,MAAMa,SAAmD,EAAC;AAC1D,EAAA,KAAA,MAAWC,OAAOb,KAAAA,EAAO;AACvB,IAAA,IAAIa,GAAAA,CAAIC,UAAAA,CAAW,IAAI,CAAA,EAAG;AACxBF,MAAAA,MAAAA,CAAOC,GAAG,CAAA,GAAIb,KAAAA,CAAMa,GAAG,CAAA;AAAA,IACzB;AAAA,EACF;AAEA,EAAA,MAAME,QAAAA,GAAWf,MAAM,WAAW,CAAA;AAClC,EAAA,MAAMgB,aAAAA,GAAgBC,IAAI,IAAI,CAAA;AAC9B,EAAA,MAAMC,gBAAiBC,CAAAA,CAAAA,KAAkB;AACvC,IAAA,MAAMC,KAAKD,CAAAA,CAAEE,aAAAA;AACbL,IAAAA,aAAAA,CAAcM,KAAAA,GAAQF,EAAAA,CAAGG,WAAAA,IAAeH,EAAAA,CAAGI,WAAAA;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WE,KAAKH,KAAqB,CAAA;AAAA,IACvC;AAAA,EACF;AAEA,EAAA,IAAIC,UAAAA,EAAY;AACdA,IAAAA,UAAAA,CAAWU,QAASC,CAAAA,CAAAA,KAAM;AACxB,MAAA,IAAIA,CAAAA,CAAE9C,QAAAA,IAAY,OAAO8C,CAAAA,CAAEC,YAAY,WAAA,EAAa;AAClDD,QAAAA,CAAAA,CAAEC,UAAU,CAAA,EAAGjD,KAAAA,IAAS,EAAE,CAAA,EAAGkC,CAAAA,CAAE,sBAAsB,CAAC,CAAA,CAAA;AAAA,MACxD;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACA,EAAA,OAAO;AAAA,IAAEE,KAAAA,EAAOC;AAAAA,GAAW;AAC7B;;;;"}
1
+ {"version":3,"file":"use-form-item.mjs","sources":["../../../../../../../packages/components/form/src/hooks/use-form-item.tsx"],"sourcesContent":["import { h, resolveComponent, useAttrs, ref } from 'vue'\nimport type { FormItemProps } from '../form-item'\nimport type { FormItemRule } from 'element-plus'\nimport { ElTooltip } from 'element-plus'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nexport const useFormItem = () => {\n return {}\n}\nexport const useFormItemSlots = (props: FormItemProps) => {\n const attrs = useAttrs()\n const { render, labelRender } = props\n const prop = props.tableProp || props.prop\n const events: Record<string, (...args: any[]) => void> = {}\n for (const key in attrs) {\n if (key.startsWith('on')) {\n events[key] = attrs[key] as (...args: any[]) => void\n }\n }\n const formData = attrs['form-data'] as Record<string, unknown>\n const isTipDisabled = ref(true) // 默认禁用提示\n const checkOverflow = (e: MouseEvent) => {\n const el = e.currentTarget as HTMLElement\n isTipDisabled.value = el.scrollWidth <= el.clientWidth\n }\n const scopedSlots = {\n default: () => {\n const { scopedSlots: renderScopedSlots, ...renderProps } =\n props.props || {}\n let disabled = props.disabled\n if (typeof props.disabled === 'function') {\n disabled = props.disabled(formData)\n }\n return props.type\n ? h(\n resolveComponent(props.type),\n {\n modelValue: formData[prop as string],\n 'onUpdate:modelValue': (value: unknown) => {\n formData[prop as string] = value\n },\n disabled,\n clearable: true,\n ...renderProps,\n ...events,\n },\n renderScopedSlots,\n )\n : formData[prop as string]\n },\n label: () => {\n return (\n <ElTooltip\n placement=\"top\"\n effect=\"dark\"\n content={props.label}\n disabled={!props.isShowLabel || isTipDisabled.value}\n >\n <span\n onMouseenter={checkOverflow}\n style=\"display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;\"\n >\n {!props.hideRequiredAsterisk && props.required ? (\n <span style=\"color: var(--el-color-danger);\">*</span>\n ) : null}\n {props.isShowLabel ? <span>{props.label}</span> : ''}\n </span>\n </ElTooltip>\n )\n },\n }\n\n if (labelRender) {\n scopedSlots.label = () => labelRender({ label: props.label })\n }\n if (render) {\n scopedSlots.default = () => {\n return render(attrs['table-scope'])\n }\n }\n return {\n scopedSlots,\n }\n}\nexport const useFormItemRules = (props: FormItemProps) => {\n const { t } = useLocale()\n const { required, rules, label } = props\n let mergeRules: FormItemRule[] = []\n if (required) {\n const requiredDefault = { required: true }\n mergeRules.push(requiredDefault)\n }\n if (rules) {\n if (Array.isArray(rules)) {\n mergeRules = mergeRules.concat(rules)\n }\n\n if (Object.prototype.toString.call(rules) === '[object Object]') {\n mergeRules.push(rules as FormItemRule)\n }\n }\n\n if (mergeRules) {\n mergeRules.forEach((r) => {\n if (r.required && typeof r.message === 'undefined') {\n r.message = `${label || ''}${t('ep.formItem.required')}`\n }\n })\n }\n return { rules: mergeRules }\n}\n"],"names":["useFormItem","useFormItemSlots","props","attrs","useAttrs","render","labelRender","prop","tableProp","events","key","startsWith","formData","isTipDisabled","ref","checkOverflow","e","el","currentTarget","value","scrollWidth","clientWidth","scopedSlots","default","renderScopedSlots","renderProps","disabled","type","h","resolveComponent","modelValue","clearable","label","_createVNode","ElTooltip","isShowLabel","hideRequiredAsterisk","required","_createTextVNode","useFormItemRules","t","useLocale","rules","mergeRules","requiredDefault","push","Array","isArray","concat","Object","prototype","toString","call","forEach","r","message"],"mappings":";;;;AAKO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AA,IAAY,OAAOiB,CAAAA,CAAEC,YAAY,WAAA,EAAa;AAClDD,QAAAA,CAAAA,CAAEC,UAAU,CAAA,EAAGvB,KAAAA,IAAS,EAAE,CAAA,EAAGQ,CAAAA,CAAE,sBAAsB,CAAC,CAAA,CAAA;AAAA,MACxD;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACA,EAAA,OAAO;AAAA,IAAEE,KAAAA,EAAOC;AAAAA,GAAW;AAC7B;;;;"}
@@ -9,3 +9,4 @@ export * from './header';
9
9
  export * from './date-picker-range';
10
10
  export * from './custom-column';
11
11
  export * from './link';
12
+ export * from './attachment';
@@ -9,6 +9,7 @@ export { EpHeader } from './header/index.mjs';
9
9
  export { EpDatePickerRange } from './date-picker-range/index.mjs';
10
10
  export { EpCustomColumn } from './custom-column/index.mjs';
11
11
  export { EpLink } from './link/index.mjs';
12
+ export { EpAttachment } from './attachment/index.mjs';
12
13
  export { buttonsProps } from './buttons/src/buttons.mjs';
13
14
  export { expandFormPropsKeys, formEmits, formEmitsKeys, formProps } from './form/src/form.mjs';
14
15
  export { expandFormItemPropsKeys, formItemProps } from './form/src/form-item.mjs';
@@ -22,4 +23,5 @@ export { headerEmits, headerProps } from './header/src/header.mjs';
22
23
  export { datePickerRangeEmits, datePickerRangeProps } from './date-picker-range/src/date-picker-range.mjs';
23
24
  export { customColumnEmits, customColumnProps } from './custom-column/src/custom-column.mjs';
24
25
  export { linkProps } from './link/src/link.mjs';
26
+ export { attachmentProps } from './attachment/src/attachment.mjs';
25
27
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}