@smartos-lib/components 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/.eslintrc-auto-import.json +1 -0
  2. package/dist/smart-docx-editor/index.js +21 -21
  3. package/dist/smart-file-preview/index.js +7 -7
  4. package/dist/smart-upload/index.js +1 -1
  5. package/package.json +4 -5
  6. package/scripts/components.vite.config.ts +1 -1
  7. package/src/composables/useElementStyle.ts +1 -3
  8. package/src/composables/useSmart.ts +1 -3
  9. package/src/pages/frame/index.vue +1 -1
  10. package/src/pages/index/type.ts +4 -4
  11. package/src/pages/index/utils/index.ts +2 -2
  12. package/src/shared/components.ts +5 -5
  13. package/src/shared/env.ts +1 -1
  14. package/src/shared/unocss.theme.ts +1 -1
  15. package/src/types.ts +3 -3
  16. package/src/utils/deepCloneESModule.ts +1 -1
  17. package/src/utils/formatComponentsGlob.ts +1 -1
  18. package/src/web-components/smart-docx-drive-page/apis/doc.ts +5 -5
  19. package/src/web-components/smart-docx-drive-page/apis/file.ts +24 -24
  20. package/src/web-components/smart-docx-drive-page/apis/folder.ts +7 -7
  21. package/src/web-components/smart-docx-drive-page/components/DocxDir.vue +7 -7
  22. package/src/web-components/smart-docx-drive-page/components/DocxDoc.vue +2 -2
  23. package/src/web-components/smart-docx-drive-page/components/DocxFileList.vue +11 -1
  24. package/src/web-components/smart-docx-drive-page/components-private/Header.vue +5 -5
  25. package/src/web-components/smart-docx-drive-page/components-private/Menu.vue +4 -3
  26. package/src/web-components/smart-docx-drive-page/types.ts +16 -16
  27. package/src/web-components/smart-docx-drive-page/utils/file-actions.ts +1 -2
  28. package/src/web-components/smart-docx-editor/App.vue +1 -1
  29. package/src/web-components/smart-docx-editor/MarkdownShortcuts/components/Markdown.vue +4 -4
  30. package/src/web-components/smart-docx-editor/MarkdownShortcuts/components/types.ts +1 -1
  31. package/src/web-components/smart-docx-editor/MarkdownShortcuts/components-react/Markdown.tsx +6 -5
  32. package/src/web-components/smart-docx-editor/MarkdownShortcuts/components-react/types/custom-types.d.ts +42 -42
  33. package/src/web-components/smart-docx-editor/MarkdownShortcuts/shared/const.ts +1 -1
  34. package/src/web-components/smart-docx-editor/demo.vue +1 -1
  35. package/src/web-components/smart-docx-editor/index.md +1 -1
  36. package/src/web-components/smart-file-preview/category/Code.vue +2 -2
  37. package/src/web-components/smart-file-preview/index.md +1 -1
  38. package/src/web-components/smart-file-preview/index.ts +1 -1
  39. package/src/web-components/smart-file-preview/index.vue +1 -1
  40. package/src/web-components/smart-file-preview/types.ts +1 -1
  41. package/src/web-components/smart-upload/index.ts +4 -4
  42. package/src/web-components/smart-upload/types.ts +27 -27
  43. package/types/auto-imports.d.ts +3 -0
  44. package/types/components.d.ts +1 -1
  45. package/types/env.d.ts +2 -2
  46. package/types/shims.d.ts +1 -0
  47. package/vite.config.ts +1 -0
@@ -1 +1 @@
1
- var M,_,R;(function(f,g,O){"use strict";function w(e){return Object.prototype.toString.call(e)==="[object Object]"}function C(e,a){return Math.floor(Math.random()*(a-e+1)+e)}function B(){return String.fromCharCode(C(97,122))}function z(){return String.fromCharCode(C(65,90))}function U(e=12,a={}){const{lowercase:n=!0,uppercase:t=!1,number:r=!1}=a,o=[];let u;if(n&&o.push("l"),t&&o.push("u"),r&&o.push("n"),!(u=o.length))throw new Error("???");let c="";for(;e-- >0;){const p=u>1?C(0,u-1):0,b=o[p];b==="l"?c+=B():b==="u"?c+=z():b==="n"&&(c+=C(0,9))}return c}function I(){return U(1,{uppercase:!0})+U(17,{uppercase:!0,number:!0})}function A(e,a,n){n.set(a,e);for(const[t,r]of Object.entries(a)){let o=!1;if(w(r)||(o=Array.isArray(r))){let u;if(n.has(r))u=n.get(r);else{let c;u=o?Array.isArray(c=e[t])?c:[]:w(c=e[t])?c:{},A(u,r,n)}e[t]=u}else r!==void 0&&(e[t]=r)}}function L(e,...a){if(!w(e)&&!Array.isArray(e)||!a.length)return e;const n=new WeakMap;n.set(e,e);for(let t=0;t<a.length;){const r=a[t];if(w(r)||Array.isArray(r)){n.set(r,e),t++;continue}a.splice(t,1)}for(const t of a)A(e,t,n);return e}const V=typeof window<"u",i={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",rose:{1:"#ffe4e6",2:"#fecdd3",3:"#fda4af",4:"#fb7185",5:"#f43f5e",6:"#e11d48",7:"#be123c",8:"#9f1239",9:"#881337",50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519",DEFAULT:"#fb7185"},pink:{1:"#fce7f3",2:"#fbcfe8",3:"#f9a8d4",4:"#f472b6",5:"#ec4899",6:"#db2777",7:"#be185d",8:"#9d174d",9:"#831843",50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724",DEFAULT:"#f472b6"},fuchsia:{1:"#fae8ff",2:"#f5d0fe",3:"#f0abfc",4:"#e879f9",5:"#d946ef",6:"#c026d3",7:"#a21caf",8:"#86198f",9:"#701a75",50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e",DEFAULT:"#e879f9"},purple:{1:"#f3e8ff",2:"#e9d5ff",3:"#d8b4fe",4:"#c084fc",5:"#a855f7",6:"#9333ea",7:"#7e22ce",8:"#6b21a8",9:"#581c87",50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764",DEFAULT:"#c084fc"},violet:{1:"#ede9fe",2:"#ddd6fe",3:"#c4b5fd",4:"#a78bfa",5:"#8b5cf6",6:"#7c3aed",7:"#6d28d9",8:"#5b21b6",9:"#4c1d95",50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065",DEFAULT:"#a78bfa"},indigo:{1:"#e0e7ff",2:"#c7d2fe",3:"#a5b4fc",4:"#818cf8",5:"#6366f1",6:"#4f46e5",7:"#4338ca",8:"#3730a3",9:"#312e81",50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b",DEFAULT:"#818cf8"},blue:{1:"#dbeafe",2:"#bfdbfe",3:"#93c5fd",4:"#60a5fa",5:"#3b82f6",6:"#2563eb",7:"#1d4ed8",8:"#1e40af",9:"#1e3a8a",50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554",DEFAULT:"#60a5fa"},sky:{1:"#e0f2fe",2:"#bae6fd",3:"#7dd3fc",4:"#38bdf8",5:"#0ea5e9",6:"#0284c7",7:"#0369a1",8:"#075985",9:"#0c4a6e",50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49",DEFAULT:"#38bdf8"},cyan:{1:"#cffafe",2:"#a5f3fc",3:"#67e8f9",4:"#22d3ee",5:"#06b6d4",6:"#0891b2",7:"#0e7490",8:"#155e75",9:"#164e63",50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344",DEFAULT:"#22d3ee"},teal:{1:"#ccfbf1",2:"#99f6e4",3:"#5eead4",4:"#2dd4bf",5:"#14b8a6",6:"#0d9488",7:"#0f766e",8:"#115e59",9:"#134e4a",50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e",DEFAULT:"#2dd4bf"},emerald:{1:"#d1fae5",2:"#a7f3d0",3:"#6ee7b7",4:"#34d399",5:"#10b981",6:"#059669",7:"#047857",8:"#065f46",9:"#064e3b",50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22",DEFAULT:"#34d399"},green:{1:"#dcfce7",2:"#bbf7d0",3:"#86efac",4:"#4ade80",5:"#22c55e",6:"#16a34a",7:"#15803d",8:"#166534",9:"#14532d",50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16",DEFAULT:"#4ade80"},lime:{1:"#ecfccb",2:"#d9f99d",3:"#bef264",4:"#a3e635",5:"#84cc16",6:"#65a30d",7:"#4d7c0f",8:"#3f6212",9:"#365314",50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05",DEFAULT:"#a3e635"},yellow:{1:"#fef9c3",2:"#fef08a",3:"#fde047",4:"#facc15",5:"#eab308",6:"#ca8a04",7:"#a16207",8:"#854d0e",9:"#713f12",50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006",DEFAULT:"#facc15"},amber:{1:"#fef3c7",2:"#fde68a",3:"#fcd34d",4:"#fbbf24",5:"#f59e0b",6:"#d97706",7:"#b45309",8:"#92400e",9:"#78350f",50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03",DEFAULT:"#fbbf24"},orange:{1:"#ffedd5",2:"#fed7aa",3:"#fdba74",4:"#fb923c",5:"#f97316",6:"#ea580c",7:"#c2410c",8:"#9a3412",9:"#7c2d12",50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407",DEFAULT:"#fb923c"},red:{1:"#fee2e2",2:"#fecaca",3:"#fca5a5",4:"#f87171",5:"#ef4444",6:"#dc2626",7:"#b91c1c",8:"#991b1b",9:"#7f1d1d",50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a",DEFAULT:"#f87171"},gray:{1:"#f3f4f6",2:"#e5e7eb",3:"#d1d5db",4:"#9ca3af",5:"#6b7280",6:"#4b5563",7:"#374151",8:"#1f2937",9:"#111827",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712",DEFAULT:"#9ca3af"},slate:{1:"#f1f5f9",2:"#e2e8f0",3:"#cbd5e1",4:"#94a3b8",5:"#64748b",6:"#475569",7:"#334155",8:"#1e293b",9:"#0f172a",50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617",DEFAULT:"#94a3b8"},zinc:{1:"#f4f4f5",2:"#e4e4e7",3:"#d4d4d8",4:"#a1a1aa",5:"#71717a",6:"#52525b",7:"#3f3f46",8:"#27272a",9:"#18181b",50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b",DEFAULT:"#a1a1aa"},neutral:{1:"#f5f5f5",2:"#e5e5e5",3:"#d4d4d4",4:"#a3a3a3",5:"#737373",6:"#525252",7:"#404040",8:"#262626",9:"#171717",50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a",DEFAULT:"#a3a3a3"},stone:{1:"#f5f5f4",2:"#e7e5e4",3:"#d6d3d1",4:"#a8a29e",5:"#78716c",6:"#57534e",7:"#44403c",8:"#292524",9:"#1c1917",50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09",DEFAULT:"#a8a29e"},light:{1:"#fcfcfc",2:"#fafafa",3:"#f8f9fa",4:"#f6f6f6",5:"#f2f2f2",6:"#f1f3f5",7:"#e9ecef",8:"#dee2e6",9:"#dde1e3",50:"#fdfdfd",100:"#fcfcfc",200:"#fafafa",300:"#f8f9fa",400:"#f6f6f6",500:"#f2f2f2",600:"#f1f3f5",700:"#e9ecef",800:"#dee2e6",900:"#dde1e3",950:"#d8dcdf",DEFAULT:"#f6f6f6"},dark:{1:"#3c3c3c",2:"#323232",3:"#2d2d2d",4:"#222222",5:"#1f1f1f",6:"#1c1c1e",7:"#1b1b1b",8:"#181818",9:"#0f0f0f",50:"#4a4a4a",100:"#3c3c3c",200:"#323232",300:"#2d2d2d",400:"#222222",500:"#1f1f1f",600:"#1c1c1e",700:"#1b1b1b",800:"#181818",900:"#0f0f0f",950:"#080808",DEFAULT:"#222222"},lightblue:{1:"#e0f2fe",2:"#bae6fd",3:"#7dd3fc",4:"#38bdf8",5:"#0ea5e9",6:"#0284c7",7:"#0369a1",8:"#075985",9:"#0c4a6e",50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49",DEFAULT:"#38bdf8"},lightBlue:{1:"#e0f2fe",2:"#bae6fd",3:"#7dd3fc",4:"#38bdf8",5:"#0ea5e9",6:"#0284c7",7:"#0369a1",8:"#075985",9:"#0c4a6e",50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49",DEFAULT:"#38bdf8"},warmgray:{1:"#f5f5f4",2:"#e7e5e4",3:"#d6d3d1",4:"#a8a29e",5:"#78716c",6:"#57534e",7:"#44403c",8:"#292524",9:"#1c1917",50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09",DEFAULT:"#a8a29e"},warmGray:{1:"#f5f5f4",2:"#e7e5e4",3:"#d6d3d1",4:"#a8a29e",5:"#78716c",6:"#57534e",7:"#44403c",8:"#292524",9:"#1c1917",50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09",DEFAULT:"#a8a29e"},truegray:{1:"#f5f5f5",2:"#e5e5e5",3:"#d4d4d4",4:"#a3a3a3",5:"#737373",6:"#525252",7:"#404040",8:"#262626",9:"#171717",50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a",DEFAULT:"#a3a3a3"},trueGray:{1:"#f5f5f5",2:"#e5e5e5",3:"#d4d4d4",4:"#a3a3a3",5:"#737373",6:"#525252",7:"#404040",8:"#262626",9:"#171717",50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a",DEFAULT:"#a3a3a3"},coolgray:{1:"#f3f4f6",2:"#e5e7eb",3:"#d1d5db",4:"#9ca3af",5:"#6b7280",6:"#4b5563",7:"#374151",8:"#1f2937",9:"#111827",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712",DEFAULT:"#9ca3af"},coolGray:{1:"#f3f4f6",2:"#e5e7eb",3:"#d1d5db",4:"#9ca3af",5:"#6b7280",6:"#4b5563",7:"#374151",8:"#1f2937",9:"#111827",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712",DEFAULT:"#9ca3af"},bluegray:{1:"#f1f5f9",2:"#e2e8f0",3:"#cbd5e1",4:"#94a3b8",5:"#64748b",6:"#475569",7:"#334155",8:"#1e293b",9:"#0f172a",50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617",DEFAULT:"#94a3b8"},blueGray:{1:"#f1f5f9",2:"#e2e8f0",3:"#cbd5e1",4:"#94a3b8",5:"#64748b",6:"#475569",7:"#334155",8:"#1e293b",9:"#0f172a",50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617",DEFAULT:"#94a3b8"},primary:"#2080f0","primary-hover":"#4098fc","primary-active":"#1060c9",info:"#909399","info-hover":"#a6a9ad","info-active":"#82848a",success:"#18a058","success-hover":"#36ad6a","success-active":"#0c7a43",warning:"#f0a020","warning-hover":"#fcb040","warning-active":"#c97c10",error:"#d03050","error-hover":"#de576d","error-active":"#ab1f3f"},x={sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"',serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif',mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},F={common:{fontFamily:x.sans,fontFamilyMono:x.mono,primaryColor:i.primary,primaryColorHover:i["primary-hover"],primaryColorPressed:i["primary-active"],primaryColorSuppl:i.primary,infoColor:i.info,infoColorHover:i["info-hover"],infoColorPressed:i["info-active"],infoColorSuppl:i.info,successColor:i.success,successColorHover:i["success-hover"],successColorPressed:i["success-active"],successColorSuppl:i.success,warningColor:i.warning,warningColorHover:i["warning-hover"],warningColorPressed:i["warning-active"],warningColorSuppl:i.warning,errorColor:i.error,errorColorHover:i["error-hover"],errorColorPressed:i["error-active"],errorColorSuppl:i.error}};L({},F,{}),L({},F,{Button:{textColorPrimary:"#FFF",textColorHoverPrimary:"#FFF",textColorPressedPrimary:"#FFF",textColorFocusPrimary:"#FFF",textColorDisabledPrimary:"#FFF"}});const G="2.0.2";function q(e,a){let n,t,r;const o=f.ref(!0),u=()=>{o.value=!0,r()};f.watch(e,u,{flush:"sync"});const c=typeof a=="function"?a:a.get,p=typeof a=="function"?void 0:a.set,b=f.customRef((d,s)=>(t=d,r=s,{get(){return o.value&&(n=c(),o.value=!1),t(),n},set(l){p==null||p(l)}}));return Object.isExtensible(b)&&(b.trigger=u),b}function H(e){return f.getCurrentScope()?(f.onScopeDispose(e),!0):!1}function E(e){return typeof e=="function"?e():f.unref(e)}function j(e){if(!f.isRef(e))return f.reactive(e);const a=new Proxy({},{get(n,t,r){return f.unref(Reflect.get(e.value,t,r))},set(n,t,r){return f.isRef(e.value[t])&&!f.isRef(r)?e.value[t].value=r:e.value[t]=r,!0},deleteProperty(n,t){return Reflect.deleteProperty(e.value,t)},has(n,t){return Reflect.has(e.value,t)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return f.reactive(a)}function W(e){return j(f.computed(e))}function $(e,...a){const n=a.flat(),t=n[0];return W(()=>Object.fromEntries(typeof t=="function"?Object.entries(f.toRefs(e)).filter(([r,o])=>!t(E(o),r)):Object.entries(f.toRefs(e)).filter(r=>!n.includes(r[0]))))}const K=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const J=e=>e!=null;function Q(e,a,n){return f.watch(e,a,{...n,deep:!0})}function T(e){var a;const n=E(e);return(a=n==null?void 0:n.$el)!=null?a:n}const X=K?window:void 0;function Y(){const e=f.ref(!1),a=f.getCurrentInstance();return a&&f.onMounted(()=>{e.value=!0},a),e}function Z(e){const a=Y();return f.computed(()=>(a.value,!!e()))}function ee(e,a,n={}){const{window:t=X,...r}=n;let o;const u=Z(()=>t&&"MutationObserver"in t),c=()=>{o&&(o.disconnect(),o=void 0)},p=f.computed(()=>{const l=E(e),y=(Array.isArray(l)?l:[l]).map(T).filter(J);return new Set(y)}),b=f.watch(()=>p.value,l=>{c(),u.value&&t&&l.size&&(o=new MutationObserver(a),l.forEach(y=>o.observe(y,r)))},{immediate:!0,flush:"post"}),d=()=>o==null?void 0:o.takeRecords(),s=()=>{c(),b()};return H(s),{isSupported:u,stop:s,takeRecords:d}}function k(e){const a=f.getCurrentInstance(),n=q(()=>null,()=>e?T(e):a.proxy.$el);return f.onUpdated(n.trigger),f.onMounted(n.trigger),n}function fe(e=I()){const a=k(),n=`style[cssr-id^="${e}-"]`;return f.onMounted(()=>{function t(){const r=a.value.parentNode;r.querySelectorAll(n).forEach(o=>{r.removeChild(o)}),Array.from(document.querySelectorAll(n)).forEach(o=>{r.appendChild(o.cloneNode()).textContent=o.textContent})}ee(document.head,t,{childList:!0}),t()}),e}function ae(){const e=k();return f.onMounted(()=>{var r;const a=e.value.parentNode,{tailwindResetStyle:n,elementPlusStyle:t}=((r=globalThis.SmartCore)==null?void 0:r[G])??{};if(n&&(a.appendChild(document.createElement("style")).textContent=n),t){const o=document.createElement("style");o.setAttribute("namespace","smart"),a.appendChild(o).textContent=t,document.querySelector('style[namespace="smart"]')||(document.head.appendChild(o.cloneNode()).textContent=t)}}),{classPrefix:fe()}}const te=((e,a)=>{const n=e.__vccOpts||e;for(const[t,r]of a)n[t]=r;return n})(f.defineComponent({__name:"index",props:f.mergeModels({beforeUpload:{type:Function},accept:{type:null},defaultFileList:{type:null},defaultUpload:{type:null},disabled:{type:null},directory:{type:null},directoryDnd:{type:null},fileListClass:{type:null},fileListStyle:{type:null},imageGroupProps:{type:null},inputProps:{type:null},listType:{type:null},max:{type:null},multiple:{type:null},renderIcon:{type:null},shouldUseThumbnailUrl:{type:null},showCancelButton:{type:null},showDownloadButton:{type:null},showRemoveButton:{type:null},showRetryButton:{type:null},showFileList:{type:null},showPreviewButton:{type:null},showTrigger:{type:null},triggerClass:{type:null},triggerStyle:{type:null},onError:{type:null},onFinish:{type:null}},{fileList:{default:()=>[]},fileListModifiers:{}}),emits:["update:fileList"],setup(e,{expose:a}){const n=e,t=f.useModel(e,"fileList"),r=f.ref(),{classPrefix:o}=ae(),u=$(n,["beforeUpload"]),c=f.ref(t.value.map(({fileName:d})=>({id:d,name:d,url:d,status:"finished"})));function p({file:d,onFinish:s,onError:l,onProgress:y}){const N=d.file,oe=n.beforeUpload??(h=>h),P=new FormData;P.set("file",N);const ce=oe({method:"post",url:"/admin/sys-file/upload",data:P,headers:{"Content-Type":"multipart/form-data"},onUploadProgress({loaded:h,total:m}){y({percent:m?Math.ceil(h/m*100):0})}});O.getConfigProvider("request")(ce).then(h=>{const m=h.data.data;d.url=m.url,d.status="finished",n.defaultUpload||c.value.splice(c.value.findIndex(({id:v})=>v===d.id),1,d),t.value.find(({fileName:v})=>v===m.url)||t.value.push({fileName:m.url,originalFileName:N.name}),s()}).catch(h=>{d.status="error",n.defaultUpload||c.value.splice(c.value.findIndex(({id:m})=>m===d.id),1,d),l(),console.error(h)})}function b(){setTimeout(()=>{for(let d=0;d<t.value.length;){const s=t.value[d].fileName;c.value.some(l=>l.url===s)?d++:t.value.splice(d,1)}},10)}return Q(t,d=>{d.forEach(({fileName:s})=>{c.value.some(l=>l.url===s)||c.value.push({id:s,name:s,url:s,status:"finished"})});for(let s=0;s<c.value.length;){const l=c.value[s];l.status==="finished"&&l.url&&!d.some(({fileName:y})=>y===l.url)?c.value.splice(s,1):s++}}),a({uploadRef:r,fileList:c}),(d,s)=>(f.openBlock(),f.createBlock(f.unref(g.NConfigProvider),{"cls-prefix":f.unref(o),"theme-overrides":f.unref(F),locale:f.unref(g.zhCN),abstract:""},{default:f.withCtx(()=>[f.createVNode(f.unref(g.NUpload),f.mergeProps({ref_key:"uploadRef",ref:r},f.unref(u),{"file-list":f.unref(c),"onUpdate:fileList":s[0]||(s[0]=l=>f.isRef(c)?c.value=l:null),"custom-request":p,onRemove:b}),{default:f.withCtx(()=>[f.renderSlot(d.$slots,"default",{},()=>[[void 0,"image"].includes(d.listType)?(f.openBlock(),f.createBlock(f.unref(g.NButton),{key:0},{default:f.withCtx(()=>[f.createTextVNode("选择文件")]),_:1})):f.createCommentVNode("v-if",!0)],!0)]),_:3},16,["file-list"])]),_:3},8,["cls-prefix","theme-overrides","locale"]))}}),[["styles",["*[data-v-da18f512],[data-v-da18f512]:before,[data-v-da18f512]:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }[data-v-da18f512]::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }"]],["__scopeId","data-v-da18f512"]]),ne="smart-upload";function re(e,a){var n;V&&!customElements.get(e)&&customElements.define(e,(n=a.prototype)!=null&&n.connectedCallback?a:f.defineCustomElement(a))}function D(e,a){return e._instance.exposed[a]}const S=f.defineCustomElement(te);Object.assign(S.prototype,{getUploadRef(){return D(this,"uploadRef").value},getFileList(){return D(this,"fileList").value},submit(){return this.getUploadRef().submit()},clear(){return this.getUploadRef().clear()}}),re(ne,S)})((M=SmartCore["2.0.2"])==null?void 0:M.Vue,(_=SmartCore["2.0.2"])==null?void 0:_.NaiveUI,(R=SmartCore["2.0.2"])==null?void 0:R.SmartCore);
1
+ var P,M,_;(function(f,g,R){"use strict";function C(e){return Object.prototype.toString.call(e)==="[object Object]"}function w(e,a){return Math.floor(Math.random()*(a-e+1)+e)}function O(){return String.fromCharCode(w(97,122))}function B(){return String.fromCharCode(w(65,90))}function U(e=12,a={}){const{lowercase:n=!0,uppercase:t=!1,number:r=!1}=a,o=[];let u;if(n&&o.push("l"),t&&o.push("u"),r&&o.push("n"),!(u=o.length))throw new Error("???");let c="";for(;e-- >0;){const p=u>1?w(0,u-1):0,b=o[p];b==="l"?c+=O():b==="u"?c+=B():b==="n"&&(c+=w(0,9))}return c}function z(){return U(1,{uppercase:!0})+U(17,{uppercase:!0,number:!0})}function A(e,a,n){n.set(a,e);for(const[t,r]of Object.entries(a)){let o=!1;if(C(r)||(o=Array.isArray(r))){let u;if(n.has(r))u=n.get(r);else{let c;u=o?Array.isArray(c=e[t])?c:[]:C(c=e[t])?c:{},A(u,r,n)}e[t]=u}else r!==void 0&&(e[t]=r)}}function L(e,...a){if(!C(e)&&!Array.isArray(e)||!a.length)return e;const n=new WeakMap;n.set(e,e);for(let t=0;t<a.length;){const r=a[t];if(C(r)||Array.isArray(r)){n.set(r,e),t++;continue}a.splice(t,1)}for(const t of a)A(e,t,n);return e}const I=typeof window<"u",i={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",rose:{1:"#ffe4e6",2:"#fecdd3",3:"#fda4af",4:"#fb7185",5:"#f43f5e",6:"#e11d48",7:"#be123c",8:"#9f1239",9:"#881337",50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519",DEFAULT:"#fb7185"},pink:{1:"#fce7f3",2:"#fbcfe8",3:"#f9a8d4",4:"#f472b6",5:"#ec4899",6:"#db2777",7:"#be185d",8:"#9d174d",9:"#831843",50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724",DEFAULT:"#f472b6"},fuchsia:{1:"#fae8ff",2:"#f5d0fe",3:"#f0abfc",4:"#e879f9",5:"#d946ef",6:"#c026d3",7:"#a21caf",8:"#86198f",9:"#701a75",50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e",DEFAULT:"#e879f9"},purple:{1:"#f3e8ff",2:"#e9d5ff",3:"#d8b4fe",4:"#c084fc",5:"#a855f7",6:"#9333ea",7:"#7e22ce",8:"#6b21a8",9:"#581c87",50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764",DEFAULT:"#c084fc"},violet:{1:"#ede9fe",2:"#ddd6fe",3:"#c4b5fd",4:"#a78bfa",5:"#8b5cf6",6:"#7c3aed",7:"#6d28d9",8:"#5b21b6",9:"#4c1d95",50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065",DEFAULT:"#a78bfa"},indigo:{1:"#e0e7ff",2:"#c7d2fe",3:"#a5b4fc",4:"#818cf8",5:"#6366f1",6:"#4f46e5",7:"#4338ca",8:"#3730a3",9:"#312e81",50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b",DEFAULT:"#818cf8"},blue:{1:"#dbeafe",2:"#bfdbfe",3:"#93c5fd",4:"#60a5fa",5:"#3b82f6",6:"#2563eb",7:"#1d4ed8",8:"#1e40af",9:"#1e3a8a",50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554",DEFAULT:"#60a5fa"},sky:{1:"#e0f2fe",2:"#bae6fd",3:"#7dd3fc",4:"#38bdf8",5:"#0ea5e9",6:"#0284c7",7:"#0369a1",8:"#075985",9:"#0c4a6e",50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49",DEFAULT:"#38bdf8"},cyan:{1:"#cffafe",2:"#a5f3fc",3:"#67e8f9",4:"#22d3ee",5:"#06b6d4",6:"#0891b2",7:"#0e7490",8:"#155e75",9:"#164e63",50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344",DEFAULT:"#22d3ee"},teal:{1:"#ccfbf1",2:"#99f6e4",3:"#5eead4",4:"#2dd4bf",5:"#14b8a6",6:"#0d9488",7:"#0f766e",8:"#115e59",9:"#134e4a",50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e",DEFAULT:"#2dd4bf"},emerald:{1:"#d1fae5",2:"#a7f3d0",3:"#6ee7b7",4:"#34d399",5:"#10b981",6:"#059669",7:"#047857",8:"#065f46",9:"#064e3b",50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22",DEFAULT:"#34d399"},green:{1:"#dcfce7",2:"#bbf7d0",3:"#86efac",4:"#4ade80",5:"#22c55e",6:"#16a34a",7:"#15803d",8:"#166534",9:"#14532d",50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16",DEFAULT:"#4ade80"},lime:{1:"#ecfccb",2:"#d9f99d",3:"#bef264",4:"#a3e635",5:"#84cc16",6:"#65a30d",7:"#4d7c0f",8:"#3f6212",9:"#365314",50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05",DEFAULT:"#a3e635"},yellow:{1:"#fef9c3",2:"#fef08a",3:"#fde047",4:"#facc15",5:"#eab308",6:"#ca8a04",7:"#a16207",8:"#854d0e",9:"#713f12",50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006",DEFAULT:"#facc15"},amber:{1:"#fef3c7",2:"#fde68a",3:"#fcd34d",4:"#fbbf24",5:"#f59e0b",6:"#d97706",7:"#b45309",8:"#92400e",9:"#78350f",50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03",DEFAULT:"#fbbf24"},orange:{1:"#ffedd5",2:"#fed7aa",3:"#fdba74",4:"#fb923c",5:"#f97316",6:"#ea580c",7:"#c2410c",8:"#9a3412",9:"#7c2d12",50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407",DEFAULT:"#fb923c"},red:{1:"#fee2e2",2:"#fecaca",3:"#fca5a5",4:"#f87171",5:"#ef4444",6:"#dc2626",7:"#b91c1c",8:"#991b1b",9:"#7f1d1d",50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a",DEFAULT:"#f87171"},gray:{1:"#f3f4f6",2:"#e5e7eb",3:"#d1d5db",4:"#9ca3af",5:"#6b7280",6:"#4b5563",7:"#374151",8:"#1f2937",9:"#111827",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712",DEFAULT:"#9ca3af"},slate:{1:"#f1f5f9",2:"#e2e8f0",3:"#cbd5e1",4:"#94a3b8",5:"#64748b",6:"#475569",7:"#334155",8:"#1e293b",9:"#0f172a",50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617",DEFAULT:"#94a3b8"},zinc:{1:"#f4f4f5",2:"#e4e4e7",3:"#d4d4d8",4:"#a1a1aa",5:"#71717a",6:"#52525b",7:"#3f3f46",8:"#27272a",9:"#18181b",50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b",DEFAULT:"#a1a1aa"},neutral:{1:"#f5f5f5",2:"#e5e5e5",3:"#d4d4d4",4:"#a3a3a3",5:"#737373",6:"#525252",7:"#404040",8:"#262626",9:"#171717",50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a",DEFAULT:"#a3a3a3"},stone:{1:"#f5f5f4",2:"#e7e5e4",3:"#d6d3d1",4:"#a8a29e",5:"#78716c",6:"#57534e",7:"#44403c",8:"#292524",9:"#1c1917",50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09",DEFAULT:"#a8a29e"},light:{1:"#fcfcfc",2:"#fafafa",3:"#f8f9fa",4:"#f6f6f6",5:"#f2f2f2",6:"#f1f3f5",7:"#e9ecef",8:"#dee2e6",9:"#dde1e3",50:"#fdfdfd",100:"#fcfcfc",200:"#fafafa",300:"#f8f9fa",400:"#f6f6f6",500:"#f2f2f2",600:"#f1f3f5",700:"#e9ecef",800:"#dee2e6",900:"#dde1e3",950:"#d8dcdf",DEFAULT:"#f6f6f6"},dark:{1:"#3c3c3c",2:"#323232",3:"#2d2d2d",4:"#222222",5:"#1f1f1f",6:"#1c1c1e",7:"#1b1b1b",8:"#181818",9:"#0f0f0f",50:"#4a4a4a",100:"#3c3c3c",200:"#323232",300:"#2d2d2d",400:"#222222",500:"#1f1f1f",600:"#1c1c1e",700:"#1b1b1b",800:"#181818",900:"#0f0f0f",950:"#080808",DEFAULT:"#222222"},lightblue:{1:"#e0f2fe",2:"#bae6fd",3:"#7dd3fc",4:"#38bdf8",5:"#0ea5e9",6:"#0284c7",7:"#0369a1",8:"#075985",9:"#0c4a6e",50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49",DEFAULT:"#38bdf8"},lightBlue:{1:"#e0f2fe",2:"#bae6fd",3:"#7dd3fc",4:"#38bdf8",5:"#0ea5e9",6:"#0284c7",7:"#0369a1",8:"#075985",9:"#0c4a6e",50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49",DEFAULT:"#38bdf8"},warmgray:{1:"#f5f5f4",2:"#e7e5e4",3:"#d6d3d1",4:"#a8a29e",5:"#78716c",6:"#57534e",7:"#44403c",8:"#292524",9:"#1c1917",50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09",DEFAULT:"#a8a29e"},warmGray:{1:"#f5f5f4",2:"#e7e5e4",3:"#d6d3d1",4:"#a8a29e",5:"#78716c",6:"#57534e",7:"#44403c",8:"#292524",9:"#1c1917",50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09",DEFAULT:"#a8a29e"},truegray:{1:"#f5f5f5",2:"#e5e5e5",3:"#d4d4d4",4:"#a3a3a3",5:"#737373",6:"#525252",7:"#404040",8:"#262626",9:"#171717",50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a",DEFAULT:"#a3a3a3"},trueGray:{1:"#f5f5f5",2:"#e5e5e5",3:"#d4d4d4",4:"#a3a3a3",5:"#737373",6:"#525252",7:"#404040",8:"#262626",9:"#171717",50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a",DEFAULT:"#a3a3a3"},coolgray:{1:"#f3f4f6",2:"#e5e7eb",3:"#d1d5db",4:"#9ca3af",5:"#6b7280",6:"#4b5563",7:"#374151",8:"#1f2937",9:"#111827",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712",DEFAULT:"#9ca3af"},coolGray:{1:"#f3f4f6",2:"#e5e7eb",3:"#d1d5db",4:"#9ca3af",5:"#6b7280",6:"#4b5563",7:"#374151",8:"#1f2937",9:"#111827",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712",DEFAULT:"#9ca3af"},bluegray:{1:"#f1f5f9",2:"#e2e8f0",3:"#cbd5e1",4:"#94a3b8",5:"#64748b",6:"#475569",7:"#334155",8:"#1e293b",9:"#0f172a",50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617",DEFAULT:"#94a3b8"},blueGray:{1:"#f1f5f9",2:"#e2e8f0",3:"#cbd5e1",4:"#94a3b8",5:"#64748b",6:"#475569",7:"#334155",8:"#1e293b",9:"#0f172a",50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617",DEFAULT:"#94a3b8"},primary:"#2080f0","primary-hover":"#4098fc","primary-active":"#1060c9",info:"#909399","info-hover":"#a6a9ad","info-active":"#82848a",success:"#18a058","success-hover":"#36ad6a","success-active":"#0c7a43",warning:"#f0a020","warning-hover":"#fcb040","warning-active":"#c97c10",error:"#d03050","error-hover":"#de576d","error-active":"#ab1f3f"},x={sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"',serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif',mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},F={common:{fontFamily:x.sans,fontFamilyMono:x.mono,primaryColor:i.primary,primaryColorHover:i["primary-hover"],primaryColorPressed:i["primary-active"],primaryColorSuppl:i.primary,infoColor:i.info,infoColorHover:i["info-hover"],infoColorPressed:i["info-active"],infoColorSuppl:i.info,successColor:i.success,successColorHover:i["success-hover"],successColorPressed:i["success-active"],successColorSuppl:i.success,warningColor:i.warning,warningColorHover:i["warning-hover"],warningColorPressed:i["warning-active"],warningColorSuppl:i.warning,errorColor:i.error,errorColorHover:i["error-hover"],errorColorPressed:i["error-active"],errorColorSuppl:i.error}};L({},F,{}),L({},F,{Button:{textColorPrimary:"#FFF",textColorHoverPrimary:"#FFF",textColorPressedPrimary:"#FFF",textColorFocusPrimary:"#FFF",textColorDisabledPrimary:"#FFF"}});const V="2.0.3";function G(e,a){let n,t,r;const o=f.ref(!0),u=()=>{o.value=!0,r()};f.watch(e,u,{flush:"sync"});const c=typeof a=="function"?a:a.get,p=typeof a=="function"?void 0:a.set,b=f.customRef((d,s)=>(t=d,r=s,{get(){return o.value&&(n=c(),o.value=!1),t(),n},set(l){p==null||p(l)}}));return Object.isExtensible(b)&&(b.trigger=u),b}function q(e){return f.getCurrentScope()?(f.onScopeDispose(e),!0):!1}function E(e){return typeof e=="function"?e():f.unref(e)}function H(e){if(!f.isRef(e))return f.reactive(e);const a=new Proxy({},{get(n,t,r){return f.unref(Reflect.get(e.value,t,r))},set(n,t,r){return f.isRef(e.value[t])&&!f.isRef(r)?e.value[t].value=r:e.value[t]=r,!0},deleteProperty(n,t){return Reflect.deleteProperty(e.value,t)},has(n,t){return Reflect.has(e.value,t)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return f.reactive(a)}function j(e){return H(f.computed(e))}function W(e,...a){const n=a.flat(),t=n[0];return j(()=>Object.fromEntries(typeof t=="function"?Object.entries(f.toRefs(e)).filter(([r,o])=>!t(E(o),r)):Object.entries(f.toRefs(e)).filter(r=>!n.includes(r[0]))))}const $=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const K=e=>e!=null;function J(e,a,n){return f.watch(e,a,{...n,deep:!0})}function Q(e){var a;const n=E(e);return(a=n==null?void 0:n.$el)!=null?a:n}const X=$?window:void 0;function Y(){const e=f.ref(!1),a=f.getCurrentInstance();return a&&f.onMounted(()=>{e.value=!0},a),e}function Z(e){const a=Y();return f.computed(()=>(a.value,!!e()))}function ee(e,a,n={}){const{window:t=X,...r}=n;let o;const u=Z(()=>t&&"MutationObserver"in t),c=()=>{o&&(o.disconnect(),o=void 0)},p=f.computed(()=>{const l=E(e),y=(Array.isArray(l)?l:[l]).map(Q).filter(K);return new Set(y)}),b=f.watch(()=>p.value,l=>{c(),u.value&&t&&l.size&&(o=new MutationObserver(a),l.forEach(y=>o.observe(y,r)))},{immediate:!0,flush:"post"}),d=()=>o==null?void 0:o.takeRecords(),s=()=>{c(),b()};return q(s),{isSupported:u,stop:s,takeRecords:d}}function T(e){const a=f.getCurrentInstance(),n=G(()=>null,()=>a.proxy.$el);return f.onUpdated(n.trigger),f.onMounted(n.trigger),n}function fe(e=z()){const a=T(),n=`style[cssr-id^="${e}-"]`;return f.onMounted(()=>{function t(){const r=a.value.parentNode;r.querySelectorAll(n).forEach(o=>{r.removeChild(o)}),Array.from(document.querySelectorAll(n)).forEach(o=>{r.appendChild(o.cloneNode()).textContent=o.textContent})}ee(document.head,t,{childList:!0}),t()}),e}function ae(){const e=T();return f.onMounted(()=>{var r;const a=e.value.parentNode,{tailwindResetStyle:n,elementPlusStyle:t}=((r=globalThis.SmartCore)==null?void 0:r[V])??{};if(n&&(a.appendChild(document.createElement("style")).textContent=n),t){const o=document.createElement("style");o.setAttribute("namespace","smart"),a.appendChild(o).textContent=t,document.querySelector('style[namespace="smart"]')||(document.head.appendChild(o.cloneNode()).textContent=t)}}),{classPrefix:fe()}}const te=((e,a)=>{const n=e.__vccOpts||e;for(const[t,r]of a)n[t]=r;return n})(f.defineComponent({__name:"index",props:f.mergeModels({beforeUpload:{type:Function},accept:{type:null},defaultFileList:{type:null},defaultUpload:{type:null},disabled:{type:null},directory:{type:null},directoryDnd:{type:null},fileListClass:{type:null},fileListStyle:{type:null},imageGroupProps:{type:null},inputProps:{type:null},listType:{type:null},max:{type:null},multiple:{type:null},renderIcon:{type:null},shouldUseThumbnailUrl:{type:null},showCancelButton:{type:null},showDownloadButton:{type:null},showRemoveButton:{type:null},showRetryButton:{type:null},showFileList:{type:null},showPreviewButton:{type:null},showTrigger:{type:null},triggerClass:{type:null},triggerStyle:{type:null},onError:{type:null},onFinish:{type:null}},{fileList:{default:()=>[]},fileListModifiers:{}}),emits:["update:fileList"],setup(e,{expose:a}){const n=e,t=f.useModel(e,"fileList"),r=f.ref(),{classPrefix:o}=ae(),u=W(n,["beforeUpload"]),c=f.ref(t.value.map(({fileName:d})=>({id:d,name:d,url:d,status:"finished"})));function p({file:d,onFinish:s,onError:l,onProgress:y}){const S=d.file,oe=n.beforeUpload??(h=>h),N=new FormData;N.set("file",S);const ce=oe({method:"post",url:"/admin/sys-file/upload",data:N,headers:{"Content-Type":"multipart/form-data"},onUploadProgress({loaded:h,total:m}){y({percent:m?Math.ceil(h/m*100):0})}});R.getConfigProvider("request")(ce).then(h=>{const m=h.data.data;d.url=m.url,d.status="finished",n.defaultUpload||c.value.splice(c.value.findIndex(({id:v})=>v===d.id),1,d),t.value.find(({fileName:v})=>v===m.url)||t.value.push({fileName:m.url,originalFileName:S.name}),s()}).catch(h=>{d.status="error",n.defaultUpload||c.value.splice(c.value.findIndex(({id:m})=>m===d.id),1,d),l(),console.error(h)})}function b(){setTimeout(()=>{for(let d=0;d<t.value.length;){const s=t.value[d].fileName;c.value.some(l=>l.url===s)?d++:t.value.splice(d,1)}},10)}return J(t,d=>{d.forEach(({fileName:s})=>{c.value.some(l=>l.url===s)||c.value.push({id:s,name:s,url:s,status:"finished"})});for(let s=0;s<c.value.length;){const l=c.value[s];l.status==="finished"&&l.url&&!d.some(({fileName:y})=>y===l.url)?c.value.splice(s,1):s++}}),a({uploadRef:r,fileList:c}),(d,s)=>(f.openBlock(),f.createBlock(f.unref(g.NConfigProvider),{"cls-prefix":f.unref(o),"theme-overrides":f.unref(F),locale:f.unref(g.zhCN),abstract:""},{default:f.withCtx(()=>[f.createVNode(f.unref(g.NUpload),f.mergeProps({ref_key:"uploadRef",ref:r},f.unref(u),{"file-list":f.unref(c),"onUpdate:fileList":s[0]||(s[0]=l=>f.isRef(c)?c.value=l:null),"custom-request":p,onRemove:b}),{default:f.withCtx(()=>[f.renderSlot(d.$slots,"default",{},()=>[[void 0,"image"].includes(d.listType)?(f.openBlock(),f.createBlock(f.unref(g.NButton),{key:0},{default:f.withCtx(()=>[f.createTextVNode("选择文件")]),_:1})):f.createCommentVNode("v-if",!0)],!0)]),_:3},16,["file-list"])]),_:3},8,["cls-prefix","theme-overrides","locale"]))}}),[["styles",["[data-v-da18f512],[data-v-da18f512]:before,[data-v-da18f512]:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }[data-v-da18f512]::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }"]],["__scopeId","data-v-da18f512"]]),ne="smart-upload";function re(e,a){var n;I&&!customElements.get(e)&&customElements.define(e,(n=a.prototype)!=null&&n.connectedCallback?a:f.defineCustomElement(a))}function k(e,a){return e._instance.exposed[a]}const D=f.defineCustomElement(te);Object.assign(D.prototype,{getUploadRef(){return k(this,"uploadRef").value},getFileList(){return k(this,"fileList").value},submit(){return this.getUploadRef().submit()},clear(){return this.getUploadRef().clear()}}),re(ne,D)})((P=SmartCore["2.0.3"])==null?void 0:P.Vue,(M=SmartCore["2.0.3"])==null?void 0:M.NaiveUI,(_=SmartCore["2.0.3"])==null?void 0:_.SmartCore);
package/package.json CHANGED
@@ -1,18 +1,17 @@
1
1
  {
2
2
  "name": "@smartos-lib/components",
3
3
  "type": "module",
4
- "version": "2.0.2",
5
- "packageManager": "pnpm@8.15.4",
4
+ "version": "2.0.3",
6
5
  "author": "Wei Zhang <https://github.com/Zhang-Wei-666>",
7
6
  "devDependencies": {
8
7
  "@rollup/pluginutils": "^5.1.0",
9
8
  "@types/prompts": "^2.4.9",
10
9
  "pinia": "^2.1.7",
11
10
  "prompts": "^2.4.2",
12
- "vite-plugin-inspect": "^0.8.3",
13
- "vite-plugin-pages": "^0.32.0",
11
+ "vite-plugin-inspect": "^0.8.4",
12
+ "vite-plugin-pages": "^0.32.1",
14
13
  "vite-plugin-vue-layouts": "^0.11.0",
15
- "vue-router": "^4.3.0"
14
+ "vue-router": "^4.3.2"
16
15
  },
17
16
  "scripts": {
18
17
  "dev": "pnpm install && vite --host",
@@ -92,5 +92,5 @@ export default (options: CreateViteBaseConfigOptions = {}) => {
92
92
 
93
93
  interface CreateViteBaseConfigOptions {
94
94
  /** 需要额外插入的 vite 插件 */
95
- plugins?: UserConfig['plugins']
95
+ plugins?: UserConfig['plugins'];
96
96
  }
@@ -1,5 +1,3 @@
1
- /* eslint-disable @typescript-eslint/indent */
2
-
3
1
  import elementPlusStyle from 'element-plus/theme-chalk/src/index.scss?inline';
4
2
 
5
3
  /**
@@ -11,7 +9,7 @@ export function useElementStyle() {
11
9
  onMounted(() => {
12
10
  const shadowRoot = el.value!.parentNode!;
13
11
  const style = document.createElement('style');
14
- style.setAttribute('namespace', 'smart');
12
+ style.setAttribute('namespace', 'smart');
15
13
 
16
14
  // 添加 element-plus 的样式到组件中
17
15
  shadowRoot.appendChild(style).textContent = elementPlusStyle;
@@ -1,5 +1,3 @@
1
- /* eslint-disable @typescript-eslint/indent */
2
-
3
1
  import { version } from '@@/package.json';
4
2
 
5
3
  /**
@@ -19,7 +17,7 @@ export function useSmart() {
19
17
  // 挂载 Element Plus UI 的样式
20
18
  if (elementPlusStyle) {
21
19
  const style = document.createElement('style');
22
- style.setAttribute('namespace', 'smart');
20
+ style.setAttribute('namespace', 'smart');
23
21
 
24
22
  // 添加 element-plus 的样式到组件中
25
23
  shadowRoot.appendChild(style).textContent = elementPlusStyle;
@@ -17,7 +17,7 @@
17
17
 
18
18
  interface Props {
19
19
  /** 指定渲染的组件名称 */
20
- component?: string
20
+ component?: string;
21
21
  }
22
22
 
23
23
  const props = defineProps<Props>();
@@ -3,11 +3,11 @@
3
3
  */
4
4
  export interface Tab {
5
5
  /** ID */
6
- id?: string
6
+ id?: string;
7
7
  /** 选项卡内的组件 */
8
- component: string
8
+ component: string;
9
9
  /** 当前选中的测试数据 */
10
- data?: string
10
+ data?: string;
11
11
  /** 重载数据使用 */
12
- dataReloadCount?: number
12
+ dataReloadCount?: number;
13
13
  }
@@ -1,5 +1,5 @@
1
- import { type Ref, type VNodeChild } from 'vue';
2
- import { type SelectOption } from 'naive-ui';
1
+ import type { Ref, VNodeChild } from 'vue';
2
+ import type { SelectOption } from 'naive-ui';
3
3
  import { components } from '@/shared/components';
4
4
 
5
5
  // @unocss-include
@@ -7,18 +7,18 @@ type ComponentsIndex = () => Promise<any>;
7
7
  /** 组件信息 */
8
8
  interface ComponentsInfo {
9
9
  /** 组件名称 */
10
- name: string
10
+ name: string;
11
11
  /** 组件标签名 */
12
- tag: string
12
+ tag: string;
13
13
  }
14
14
 
15
15
  type Components = Record<string, {
16
16
  /** 组件信息 */
17
- info: ComponentsInfo
17
+ info: ComponentsInfo;
18
18
  /** 组件注册文件引用 */
19
- index: ComponentsIndex
19
+ index: ComponentsIndex;
20
20
  /** 组件测试数据 */
21
- data: any
21
+ data: any;
22
22
  }>;
23
23
 
24
24
  /** 所有组件注册文件引用 */
package/src/shared/env.ts CHANGED
@@ -2,7 +2,7 @@ import type { LoadingBarProviderInst } from 'naive-ui';
2
2
 
3
3
  interface App {
4
4
  /** 当前应用的加载条模块 */
5
- loadingBar?: LoadingBarProviderInst
5
+ loadingBar?: LoadingBarProviderInst;
6
6
  }
7
7
 
8
8
  /** 当前应用的一些环境变量 */
@@ -1247,7 +1247,7 @@ export const duration = {
1247
1247
  colors: "300ms"
1248
1248
  };
1249
1249
  export const ringWidth = {
1250
- DEFAULT: "1px",
1250
+ DEFAULT: "3px",
1251
1251
  none: "0"
1252
1252
  };
1253
1253
  export const preflightBase = {
package/src/types.ts CHANGED
@@ -2,8 +2,8 @@ import type { App } from 'vue';
2
2
  import type { Router } from 'vue-router';
3
3
 
4
4
  interface UserModuleContext {
5
- app: App<Element>
6
- router: Router
5
+ app: App<Element>;
6
+ router: Router;
7
7
  }
8
8
 
9
9
  /**
@@ -16,5 +16,5 @@ export type UserModule = (ctx: UserModuleContext) => void;
16
16
  */
17
17
  export interface Settings {
18
18
  /** 项目名称 */
19
- name: string
19
+ name: string;
20
20
  }
@@ -2,7 +2,7 @@ import { deepClone } from 'mixte';
2
2
 
3
3
  /**
4
4
  * 深拷贝 ES Module
5
- */
5
+ */
6
6
  export function deepCloneESModule<T>(value: T): T {
7
7
  if (value)
8
8
  return deepClone(Object.fromEntries(Object.entries(value))) as any;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 格式化导入文件的信息
3
- */
3
+ */
4
4
  export function formatComponentsGlob(files: Record<string, any> | string[]) {
5
5
  if (Array.isArray(files)) {
6
6
  return Object.fromEntries(
@@ -11,17 +11,17 @@ const { meActiveMenuInfo } = menuStore();
11
11
  /** 创建在线文档接口传参 */
12
12
  export interface CreateOnlineDocxParams {
13
13
  /** 文档标题 */
14
- fileName?: string
14
+ fileName?: string;
15
15
  /** 文档内容 */
16
16
  docContext?: {
17
- value?: Descendant[]
18
- }
17
+ value?: Descendant[];
18
+ };
19
19
  }
20
20
 
21
21
  /** 创建在线文档 */
22
22
  export function createOnlineDocx(params?: CreateOnlineDocxParams, options?: UseRequestOptions) {
23
23
  return useRequestReactive<{
24
- data: ResponseData<string>
24
+ data: ResponseData<string>;
25
25
  }>(
26
26
  (overlapParams?: CreateOnlineDocxParams) => {
27
27
  const docContext: NonNullable<CreateOnlineDocxParams['docContext']> = overlapParams?.docContext ?? params?.docContext ?? {};
@@ -41,7 +41,7 @@ export function createOnlineDocx(params?: CreateOnlineDocxParams, options?: UseR
41
41
 
42
42
  /** 修改在线文档接口传参 */
43
43
  export interface UpdateOnlineDocxParams extends Partial<CreateOnlineDocxParams> {
44
- userFileId: string
44
+ userFileId: string;
45
45
  }
46
46
 
47
47
  /** 修改在线文档 */
@@ -15,42 +15,42 @@ const { meActiveMenuInfo } = menuStore();
15
15
  /** 文件信息 */
16
16
  export interface FileInfo {
17
17
  /** 文件 ID */
18
- fileId: string
18
+ fileId: string;
19
19
  /** 用户文件 ID */
20
- userFileId: string
20
+ userFileId: string;
21
21
  /** 文件所在路径 */
22
- filePath: string
22
+ filePath: string;
23
23
  /** 文件名 */
24
- fileName: string
24
+ fileName: string;
25
25
  /** 文件后缀 */
26
- extendName: string
26
+ extendName: string;
27
27
  /** 文件大小 */
28
- fileSize: number
28
+ fileSize: number;
29
29
  /**
30
30
  * 是否是文件夹
31
31
  * - 0: 否 ( 是文件 )
32
32
  * - 1: 是 ( 是文件夹 )
33
33
  */
34
- isDir: 0 | 1
34
+ isDir: 0 | 1;
35
35
  /**
36
36
  * 文件类型
37
37
  * - 1: 普通文件
38
38
  * - 2: 在线文档
39
39
  */
40
- fileType: 1 | 2
40
+ fileType: 1 | 2;
41
41
  /** 所有者 */
42
- userId: string
42
+ userId: string;
43
43
  /** 上传时间 */
44
- uploadTime: string
44
+ uploadTime: string;
45
45
 
46
46
  /** 文件名 + 文件后缀 - 扩展字段 */
47
- fileFullName: string
47
+ fileFullName: string;
48
48
  /** 下载请求 - 扩展字段 */
49
- download: ReturnType<typeof downloadFile>
49
+ download: ReturnType<typeof downloadFile>;
50
50
  /** 下载进度 - 扩展字段 */
51
- downloadProgress: Ref<number>
51
+ downloadProgress: Ref<number>;
52
52
  /** 图片预览 - 扩展字段 */
53
- imagePreview?: ReturnType<typeof getPreviewFile>
53
+ imagePreview?: ReturnType<typeof getPreviewFile>;
54
54
  }
55
55
 
56
56
  /**
@@ -112,11 +112,11 @@ export function uploadFile(fileItem: Ref<FileItem | undefined>) {
112
112
  /** 获取文件列表接口传参 */
113
113
  export interface GetFileListParams {
114
114
  /** 当前页码 @default 1 */
115
- currentPage?: number
115
+ currentPage?: number;
116
116
  /** 每页条数 @default 10 */
117
- pageCount?: number
117
+ pageCount?: number;
118
118
  /** 文件路径 @default '/' */
119
- filePath?: string
119
+ filePath?: string;
120
120
  /**
121
121
  * 文件类型
122
122
  * - 0: 全部
@@ -124,20 +124,20 @@ export interface GetFileListParams {
124
124
  * - 2: 图片
125
125
  * @default '0'
126
126
  */
127
- fileType?: '0' | '1' | '2'
127
+ fileType?: '0' | '1' | '2';
128
128
  /**
129
129
  * 是否是文件夹
130
130
  * - 0: 否 ( 是文件 )
131
131
  * - 1: 是 ( 是文件夹 )
132
132
  */
133
- isDir?: 0 | 1
133
+ isDir?: 0 | 1;
134
134
  }
135
135
  /**
136
136
  * 获取文件列表 ( 不包含文件夹 )
137
137
  */
138
138
  export function getFileList(params?: MaybeRefOrGetter<GetFileListParams>, options?: UseRequestOptions) {
139
139
  const result = useRequestReactive<{
140
- data: ResponseData<ResponseListData<FileInfo>>
140
+ data: ResponseData<ResponseListData<FileInfo>>;
141
141
  }>(
142
142
  (overlapParams?: MaybeRefOrGetter<GetFileListParams>) => {
143
143
  return getConfigProvider('request')!({
@@ -192,9 +192,9 @@ export function getFileList(params?: MaybeRefOrGetter<GetFileListParams>, option
192
192
  /** 获取预览文件接口传参 */
193
193
  export interface GetPreviewFileParams {
194
194
  /** 文件 ID */
195
- userFileId: string
195
+ userFileId: string;
196
196
  /** 是否是小尺寸图片 */
197
- isMin?: boolean
197
+ isMin?: boolean;
198
198
  }
199
199
  /**
200
200
  * 获取预览文件
@@ -216,9 +216,9 @@ export function getPreviewFile(params?: MaybeRefOrGetter<GetPreviewFileParams>,
216
216
  /** 获取预览文件接口选项 */
217
217
  export interface DownloadFileOptions {
218
218
  /** 下载进度 */
219
- progress?: Ref<number>
219
+ progress?: Ref<number>;
220
220
  /** 取消请求 */
221
- cancelToken?: CancelToken
221
+ cancelToken?: CancelToken;
222
222
  }
223
223
  /** 下载文件 */
224
224
  export function downloadFile(params?: MaybeRefOrGetter<{ userFileId: string }>, options?: DownloadFileOptions, requestOptions?: UseRequestOptions) {
@@ -16,19 +16,19 @@ Promise.resolve().then(() => {
16
16
  /** 文件夹信息 */
17
17
  export interface DirInfo {
18
18
  /** 文件夹 ID */
19
- id: string
19
+ id: string;
20
20
  /** 文件夹名称 */
21
- label: string
21
+ label: string;
22
22
  /** 文件夹路径 */
23
- filePath: string
23
+ filePath: string;
24
24
  /** 子文件夹 */
25
- children: DirInfo[]
25
+ children: DirInfo[];
26
26
  }
27
27
 
28
28
  /** 获取目录树 */
29
29
  export function getDirTree(options?: UseRequestOptions) {
30
30
  return useRequestReactive<{
31
- data: ResponseData<DirInfo>
31
+ data: ResponseData<DirInfo>;
32
32
  }>(
33
33
  () => getConfigProvider('request')!({ url: '/de/file/getfiletree', method: 'get' }),
34
34
  options,
@@ -40,7 +40,7 @@ export function getDirTree(options?: UseRequestOptions) {
40
40
  */
41
41
  export function getFolderList(params?: MaybeRefOrGetter<GetFileListParams>, options?: UseRequestOptions) {
42
42
  return useRequestReactive<{
43
- data: ResponseData<ResponseListData<FileInfo>>
43
+ data: ResponseData<ResponseListData<FileInfo>>;
44
44
  }>(
45
45
  (overlapParams?: MaybeRefOrGetter<GetFileListParams>) => {
46
46
  return getConfigProvider('request')!({
@@ -56,7 +56,7 @@ export function getFolderList(params?: MaybeRefOrGetter<GetFileListParams>, opti
56
56
  /** 创建文件夹 */
57
57
  export function createDir(params?: { fileName: string }, options?: UseRequestOptions) {
58
58
  return useRequestReactive<{
59
- data: ResponseData<DirInfo>
59
+ data: ResponseData<DirInfo>;
60
60
  }>(
61
61
  (overlapParams?: { fileName: string }) => getConfigProvider('request')!({
62
62
  url: '/de/file/createFold',
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
 
14
14
  <div class="munu-item-icon">
15
- <slot v-if="slots.icon" name="icon" :isActive="isActive" />
15
+ <slot v-if="slots.icon" name="icon" :is-active="isActive" />
16
16
  <i-ph-folder-fill v-else-if="isActive" class="size-5" />
17
17
  <i-ph-folder v-else class="size-5" />
18
18
  </div>
@@ -43,11 +43,11 @@
43
43
  import CustomPopover from './CustomPopover.vue';
44
44
 
45
45
  interface Props {
46
- name?: string
47
- info?: DirInfo
48
- showOpen?: boolean
49
- level?: number
50
- hiddenActions?: boolean
46
+ name?: string;
47
+ info?: DirInfo;
48
+ showOpen?: boolean;
49
+ level?: number;
50
+ hiddenActions?: boolean;
51
51
  }
52
52
 
53
53
  const props = withDefaults(defineProps<Props>(), {
@@ -55,7 +55,7 @@
55
55
  level: 1,
56
56
  });
57
57
  const slots = defineSlots<{
58
- icon?: (props: { isActive: boolean }) => any
58
+ icon?: (props: { isActive: boolean }) => any;
59
59
  }>();
60
60
 
61
61
  const attrs = useAttrs();
@@ -21,7 +21,7 @@
21
21
  @paste.prevent="removeNewlines"
22
22
  />
23
23
  <!-- 文档内容 -->
24
- <smart-docx-editor v-if="visible" ref="docxEditorRef" .initialValue="content" />
24
+ <smart-docx-editor v-if="visible" ref="docxEditorRef" .initial-value="content" />
25
25
  </div>
26
26
  </el-scrollbar>
27
27
  </ElDialog>
@@ -60,7 +60,7 @@
60
60
 
61
61
  /** 禁止粘贴换行 */
62
62
  function removeNewlines(event: ClipboardEvent) {
63
- const text = event.clipboardData?.getData('text/plain').replace(/(\r\n|\n|\r)/gm, "") ?? '';
63
+ const text = event.clipboardData?.getData('text/plain').replace(/(\r\n|\n|\r)/gm, '') ?? '';
64
64
  const selection = window.getSelection();
65
65
 
66
66
  if (selection?.getRangeAt && selection.rangeCount) {
@@ -115,7 +115,17 @@
115
115
  }
116
116
 
117
117
  previewMessage = message.loading( // @ts-expect-error
118
- () => <div>正在加载预览文件: <NText type="primary">{ file.fileFullName }</NText> <NText code>{previewProgress.value}%</NText></div>,
118
+ () => (
119
+ <div>
120
+ 正在加载预览文件:
121
+ <NText type="primary">{ file.fileFullName }</NText>
122
+ {' '}
123
+ <NText code>
124
+ {previewProgress.value}
125
+ %
126
+ </NText>
127
+ </div>
128
+ ),
119
129
  { duration: 0 },
120
130
  );
121
131
 
@@ -27,7 +27,7 @@
27
27
  </div>
28
28
 
29
29
  <!-- 文件上传相关 -->
30
- <DocxUpload ref="uploadRef" @success="emit('upload-success')" />
30
+ <DocxUpload ref="uploadRef" @success="emit('uploadSuccess')" />
31
31
  <!-- 云文档 -->
32
32
  <DocxDoc ref="createDocRef" />
33
33
  </template>
@@ -41,14 +41,14 @@
41
41
  import { colors } from '@/shared/unocss.theme';
42
42
 
43
43
  interface Props {
44
- title?: string
44
+ title?: string;
45
45
  }
46
46
 
47
47
  defineProps<Props>();
48
48
 
49
- const emit = defineEmits(['upload-success']);
49
+ const emit = defineEmits(['uploadSuccess']);
50
50
  const slots = defineSlots<{
51
- title?: () => any
51
+ title?: () => any;
52
52
  }>();
53
53
 
54
54
  const attrs = useAttrs();
@@ -59,7 +59,7 @@
59
59
  function toCreateDir() {
60
60
  usePrompt('', '新建文件夹', async (instance) => {
61
61
  await createDir({ fileName: instance.inputValue }).execute();
62
- emit('upload-success');
62
+ emit('uploadSuccess');
63
63
  });
64
64
  }
65
65
  </script>