hs-admin-ui 16.0.3 → 16.0.5

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.
@@ -0,0 +1,4 @@
1
+ import { _ as f } from "./index-D95ZOlEa.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-Duct_dXL.js");exports.default=e._sfc_main;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BNZPT0nM.js");exports.default=e._sfc_main;
package/dist/h5.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./_plugin-vue_export-helper-DU3rAEJM.js"),e=require("vue"),h={class:"upload-wrapper"},v={class:"upload-wrapper-inner"},w=e.defineComponent({__name:"Upload",props:{action:{type:String,default:""},headers:{type:Object,default:()=>({})},limit:{type:Number,default:100}},emits:["success"],setup(i,{emit:l}){const s=i,d=l,r=e.shallowRef(),o=e.reactive({loading:!1,headers:s.headers,fileList:[{name:"food.jpeg",url:"https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100"}]});e.watch(()=>o.fileList.length,n=>{setTimeout(()=>{const t=document.querySelector(".upload-wrapper .el-upload--picture-card");t&&(t.style.display=n>=s.limit&&n>0?"none":"inline-flex")},100)},{immediate:!0});async function u(){r.value.submit()}function p(n,t,a){d("success",{result:n,file:t,files:a})}return(n,t)=>{const a=e.resolveComponent("el-upload"),f=e.resolveComponent("el-button"),m=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("div",v,[e.createVNode(a,{ref_key:"uploadRef",ref:r,"file-list":o.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>o.fileList=g),"list-type":"picture-card",accept:"image/*",name:"file",action:i.action,headers:o.headers,limit:i.limit,"auto-upload":!1,"on-success":p},{default:e.withCtx(()=>[...t[1]||(t[1]=[e.createElementVNode("svg",{width:"34",height:"34",viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{x:"45",y:"20",width:"10",height:"60",rx:"2",fill:"#1677ff"}),e.createElementVNode("rect",{x:"20",y:"45",width:"60",height:"10",rx:"2",fill:"#1677ff"})],-1)])]),_:1},8,["file-list","action","headers","limit"])]),e.createVNode(f,{size:"large",type:"primary",onClick:u},{default:e.withCtx(()=>[...t[2]||(t[2]=[e.createTextVNode("上传",-1)])]),_:1})])),[[m,o.loading]])}}}),y=c._export_sfc(w,[["__scopeId","data-v-63137847"]]),_={Upload:y};function x(i){for(const[l,s]of Object.entries(_))i.component(`H${l}`,s)}function b(i){i.directive("loading",c.ElLoading.directive),i.use(x)}exports.useHsAdminUi=b;
package/dist/h5.mjs ADDED
@@ -0,0 +1,122 @@
1
+ import { az as y, aA as _ } from "./_plugin-vue_export-helper-Dgg0dZKM.mjs";
2
+ import { defineComponent as v, shallowRef as x, reactive as b, watch as L, resolveComponent as r, resolveDirective as j, withDirectives as k, createElementBlock as C, openBlock as U, createElementVNode as n, createVNode as d, withCtx as p, createTextVNode as B } from "vue";
3
+ const N = { class: "upload-wrapper" }, E = { class: "upload-wrapper-inner" }, H = /* @__PURE__ */ v({
4
+ __name: "Upload",
5
+ props: {
6
+ action: {
7
+ type: String,
8
+ default: ""
9
+ },
10
+ headers: {
11
+ type: Object,
12
+ default: () => ({})
13
+ },
14
+ limit: {
15
+ type: Number,
16
+ default: 100
17
+ }
18
+ },
19
+ emits: ["success"],
20
+ setup(t, { emit: l }) {
21
+ const s = t, u = l, c = x(), i = b({
22
+ loading: !1,
23
+ headers: s.headers,
24
+ fileList: [
25
+ {
26
+ name: "food.jpeg",
27
+ url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100"
28
+ }
29
+ ]
30
+ });
31
+ L(
32
+ () => i.fileList.length,
33
+ (o) => {
34
+ setTimeout(() => {
35
+ const e = document.querySelector(".upload-wrapper .el-upload--picture-card");
36
+ e && (e.style.display = o >= s.limit && o > 0 ? "none" : "inline-flex");
37
+ }, 100);
38
+ },
39
+ {
40
+ immediate: !0
41
+ }
42
+ );
43
+ async function f() {
44
+ c.value.submit();
45
+ }
46
+ function m(o, e, a) {
47
+ u("success", { result: o, file: e, files: a });
48
+ }
49
+ return (o, e) => {
50
+ const a = r("el-upload"), g = r("el-button"), h = j("loading");
51
+ return k((U(), C("div", N, [
52
+ n("div", E, [
53
+ d(a, {
54
+ ref_key: "uploadRef",
55
+ ref: c,
56
+ "file-list": i.fileList,
57
+ "onUpdate:fileList": e[0] || (e[0] = (w) => i.fileList = w),
58
+ "list-type": "picture-card",
59
+ accept: "image/*",
60
+ name: "file",
61
+ action: t.action,
62
+ headers: i.headers,
63
+ limit: t.limit,
64
+ "auto-upload": !1,
65
+ "on-success": m
66
+ }, {
67
+ default: p(() => [...e[1] || (e[1] = [
68
+ n("svg", {
69
+ width: "34",
70
+ height: "34",
71
+ viewBox: "0 0 100 100",
72
+ xmlns: "http://www.w3.org/2000/svg"
73
+ }, [
74
+ n("rect", {
75
+ x: "45",
76
+ y: "20",
77
+ width: "10",
78
+ height: "60",
79
+ rx: "2",
80
+ fill: "#1677ff"
81
+ }),
82
+ n("rect", {
83
+ x: "20",
84
+ y: "45",
85
+ width: "60",
86
+ height: "10",
87
+ rx: "2",
88
+ fill: "#1677ff"
89
+ })
90
+ ], -1)
91
+ ])]),
92
+ _: 1
93
+ }, 8, ["file-list", "action", "headers", "limit"])
94
+ ]),
95
+ d(g, {
96
+ size: "large",
97
+ type: "primary",
98
+ onClick: f
99
+ }, {
100
+ default: p(() => [...e[2] || (e[2] = [
101
+ B("上传", -1)
102
+ ])]),
103
+ _: 1
104
+ })
105
+ ])), [
106
+ [h, i.loading]
107
+ ]);
108
+ };
109
+ }
110
+ }), R = /* @__PURE__ */ y(H, [["__scopeId", "data-v-63137847"]]), S = {
111
+ Upload: R
112
+ };
113
+ function V(t) {
114
+ for (const [l, s] of Object.entries(S))
115
+ t.component(`H${l}`, s);
116
+ }
117
+ function A(t) {
118
+ t.directive("loading", _.directive), t.use(V);
119
+ }
120
+ export {
121
+ A as useHsAdminUi
122
+ };