@qxs-bns/components 0.0.1 → 0.0.3

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 (38) hide show
  1. package/dist/hooks/src/use-namespace/index.cjs +1 -0
  2. package/dist/hooks/src/use-namespace/index.js +49 -0
  3. package/package.json +3 -3
  4. package/package.json.cjs +1 -1
  5. package/package.json.js +1 -1
  6. package/src/file-upload/src/file-upload.vue.cjs +1 -1
  7. package/src/file-upload/src/file-upload.vue.js +3 -3
  8. package/src/fixed-action-bar/src/fixed-action-bar.vue.cjs +1 -1
  9. package/src/fixed-action-bar/src/fixed-action-bar.vue.js +8 -8
  10. package/src/image-upload/src/image-upload.vue.cjs +1 -1
  11. package/src/image-upload/src/image-upload.vue.js +24 -24
  12. package/src/photo-crop-tool/src/photo-crop-tool.vue.cjs +1 -1
  13. package/src/photo-crop-tool/src/photo-crop-tool.vue.js +10 -10
  14. package/types/index.d.ts +6 -1
  15. package/types/src/base/style/css.d.ts +0 -0
  16. package/types/src/base/style/index.d.ts +1 -0
  17. package/types/src/components.d.ts +4 -0
  18. package/types/src/defaults.d.ts +5 -0
  19. package/types/src/file-upload/index.d.ts +36 -0
  20. package/types/src/file-upload/src/file-upload.vue.d.ts +158 -0
  21. package/types/src/file-upload/style/index.d.ts +1 -0
  22. package/types/src/fixed-action-bar/index.d.ts +40 -0
  23. package/types/src/fixed-action-bar/src/fixed-action-bar.vue.d.ts +23 -0
  24. package/types/src/fixed-action-bar/style/index.d.ts +1 -0
  25. package/types/src/image-upload/index.d.ts +46 -0
  26. package/types/src/image-upload/src/image-upload.vue.d.ts +47 -0
  27. package/types/src/image-upload/style/index.d.ts +1 -0
  28. package/types/src/make-installer.d.ts +9 -0
  29. package/types/src/photo-crop-tool/index.d.ts +54 -0
  30. package/types/src/photo-crop-tool/src/composables.d.ts +6 -0
  31. package/types/src/photo-crop-tool/src/photo-crop-tool.vue.d.ts +65 -0
  32. package/types/src/photo-crop-tool/style/index.d.ts +1 -0
  33. package/types/src/rich-editor/index.d.ts +3 -0
  34. package/types/src/rich-editor/src/rich-editor.vue.d.ts +2 -0
  35. package/types/src/rich-editor/style/index.d.ts +1 -0
  36. package/types/src/withInstall.d.ts +4 -0
  37. package/packages/hooks/src/use-namespace/index.cjs +0 -1
  38. package/packages/hooks/src/use-namespace/index.js +0 -49
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),l="qxs",$="is-";function c(u,o,r,e,t){let a=`${u}-${o}`;return r&&(a+=`-${r}`),e&&(a+=`__${e}`),t&&(a+=`--${t}`),a}const s=Symbol("namespaceContextKey");function m(u){const o=n.getCurrentInstance()?n.inject(s,n.ref(l)):n.ref(l);return n.computed(()=>n.unref(o)||l)}function i(u,o){const r=m();return{namespace:r,b:(e="")=>c(r.value,u,e,"",""),e:e=>e?c(r.value,u,"",e,""):"",m:e=>e?c(r.value,u,"","",e):"",be:(e,t)=>e&&t?c(r.value,u,e,t,""):"",em:(e,t)=>e&&t?c(r.value,u,"",e,t):"",bm:(e,t)=>e&&t?c(r.value,u,e,"",t):"",bem:(e,t,a)=>e&&t&&a?c(r.value,u,e,t,a):"",is:(e,...t)=>{const a=t.length>=1?t[0]:!0;return e&&a?`${$}${e}`:""},cssVar:e=>{const t={};for(const a in e)e[a]&&(t[`--${r.value}-${a}`]=e[a]);return t},cssVarName:e=>`--${r.value}-${e}`,cssVarBlock:e=>{const t={};for(const a in e)e[a]&&(t[`--${r.value}-${u}-${a}`]=e[a]);return t},cssVarBlockName:e=>`--${r.value}-${u}-${e}`}}exports.defaultNamespace=l;exports.namespaceContextKey=s;exports.useGetDerivedNamespace=m;exports.useNamespace=i;
@@ -0,0 +1,49 @@
1
+ import { getCurrentInstance as l, inject as m, ref as s, computed as $, unref as v } from "vue";
2
+ const o = "qxs", i = "is-";
3
+ function n(r, u, c, e, a) {
4
+ let t = `${r}-${u}`;
5
+ return c && (t += `-${c}`), e && (t += `__${e}`), a && (t += `--${a}`), t;
6
+ }
7
+ const f = Symbol("namespaceContextKey");
8
+ function p(r) {
9
+ const u = l() ? m(f, s(o)) : s(o);
10
+ return $(() => v(u) || o);
11
+ }
12
+ function N(r, u) {
13
+ const c = p();
14
+ return {
15
+ namespace: c,
16
+ b: (e = "") => n(c.value, r, e, "", ""),
17
+ e: (e) => e ? n(c.value, r, "", e, "") : "",
18
+ m: (e) => e ? n(c.value, r, "", "", e) : "",
19
+ be: (e, a) => e && a ? n(c.value, r, e, a, "") : "",
20
+ em: (e, a) => e && a ? n(c.value, r, "", e, a) : "",
21
+ bm: (e, a) => e && a ? n(c.value, r, e, "", a) : "",
22
+ bem: (e, a, t) => e && a && t ? n(c.value, r, e, a, t) : "",
23
+ is: (e, ...a) => {
24
+ const t = a.length >= 1 ? a[0] : !0;
25
+ return e && t ? `${i}${e}` : "";
26
+ },
27
+ // css
28
+ cssVar: (e) => {
29
+ const a = {};
30
+ for (const t in e)
31
+ e[t] && (a[`--${c.value}-${t}`] = e[t]);
32
+ return a;
33
+ },
34
+ cssVarName: (e) => `--${c.value}-${e}`,
35
+ cssVarBlock: (e) => {
36
+ const a = {};
37
+ for (const t in e)
38
+ e[t] && (a[`--${c.value}-${r}-${t}`] = e[t]);
39
+ return a;
40
+ },
41
+ cssVarBlockName: (e) => `--${c.value}-${r}-${e}`
42
+ };
43
+ }
44
+ export {
45
+ o as defaultNamespace,
46
+ f as namespaceContextKey,
47
+ p as useGetDerivedNamespace,
48
+ N as useNamespace
49
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qxs-bns/components",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Vue 3 Component Library",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -38,7 +38,7 @@
38
38
  "@element-plus/icons-vue": "^2.0.0"
39
39
  },
40
40
  "dependencies": {
41
- "@qxs-bns/hooks": "0.0.1",
42
- "@qxs-bns/utils": "0.0.1"
41
+ "@qxs-bns/hooks": "0.0.3",
42
+ "@qxs-bns/utils": "0.0.3"
43
43
  }
44
44
  }
package/package.json.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.1";exports.version=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.3";exports.version=e;
package/package.json.js CHANGED
@@ -1,4 +1,4 @@
1
- const o = "0.0.1";
1
+ const o = "0.0.3";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),N=require("../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.12_typescript@5.6.3_/node_modules/@element-plus/icons-vue/dist/index.cjs"),h=require("../../../packages/hooks/src/use-namespace/index.cjs"),c=require("../../../node_modules/.pnpm/element-plus@2.8.7_vue@3.5.12_typescript@5.6.3_/node_modules/element-plus/es/components/message/index.cjs"),E={class:"slot"},x={key:0,class:"el-upload__tip"},C={style:{display:"inline-block"}},V=e.defineComponent({name:"QxsFileUpload",__name:"file-upload",props:{action:{},headers:{},data:{},name:{default:"file"},size:{default:20},max:{default:3},accept:{default:"zip,rar"},files:{default:()=>[]},notip:{type:Boolean,default:!1},ext:{}},emits:["onSuccess"],setup(d,{emit:u}){const a=d,p=u,m=h.useNamespace("file-upload"),i=e.computed(()=>a.accept.split(",").map(t=>t.split("/").pop())),f=t=>{var r;const l=(r=t.name.split(".").at(-1))!=null?r:"",s=i.value.includes(l),n=t.size/1024/1024<a.size;return s||c.ElMessage.error(`上传文件只支持 ${i.value.join(" / ")} 格式!`),n||c.ElMessage.error(`上传文件大小不能超过 ${a.size}MB!`),s&&n},_=()=>{c.ElMessage.warning("文件上传超过限制")},v=(t,o,l)=>{p("onSuccess",t,o,l)};return(t,o)=>{const l=e.resolveComponent("el-icon"),s=e.resolveComponent("el-alert"),n=e.resolveComponent("el-upload");return e.openBlock(),e.createBlock(n,{headers:t.headers,action:t.action,data:t.data,name:t.name,"before-upload":f,"on-exceed":_,"on-success":v,"file-list":t.files,limit:t.max,drag:"",class:e.normalizeClass(e.unref(m).e("control"))},{tip:e.withCtx(()=>[t.notip?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",x,[e.createElementVNode("div",C,[e.createVNode(s,{title:`上传文件支持 ${i.value.join(" / ")} 格式,单个文件大小不超过 ${t.size}MB,且文件数量不超过 ${t.max} 个`,type:"info","show-icon":"",closable:!1},null,8,["title"])])]))]),default:e.withCtx(()=>[e.createElementVNode("div",E,[e.createVNode(l,{class:"el-icon--upload"},{default:e.withCtx(()=>[e.createVNode(e.unref(N.UploadFilled))]),_:1}),o[0]||(o[0]=e.createElementVNode("div",{class:"el-upload__text"},[e.createTextVNode(" 将文件拖到此处,或"),e.createElementVNode("em",null,"点击上传")],-1))])]),_:1},8,["headers","action","data","name","file-list","limit","class"])}}});exports.default=V;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),N=require("../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.12_typescript@5.6.3_/node_modules/@element-plus/icons-vue/dist/index.cjs"),h=require("../../../dist/hooks/src/use-namespace/index.cjs"),c=require("../../../node_modules/.pnpm/element-plus@2.8.7_vue@3.5.12_typescript@5.6.3_/node_modules/element-plus/es/components/message/index.cjs"),E={class:"slot"},x={key:0,class:"el-upload__tip"},C={style:{display:"inline-block"}},V=e.defineComponent({name:"QxsFileUpload",__name:"file-upload",props:{action:{},headers:{},data:{},name:{default:"file"},size:{default:20},max:{default:3},accept:{default:"zip,rar"},files:{default:()=>[]},notip:{type:Boolean,default:!1},ext:{}},emits:["onSuccess"],setup(d,{emit:u}){const a=d,p=u,m=h.useNamespace("file-upload"),i=e.computed(()=>a.accept.split(",").map(t=>t.split("/").pop())),f=t=>{var r;const l=(r=t.name.split(".").at(-1))!=null?r:"",s=i.value.includes(l),n=t.size/1024/1024<a.size;return s||c.ElMessage.error(`上传文件只支持 ${i.value.join(" / ")} 格式!`),n||c.ElMessage.error(`上传文件大小不能超过 ${a.size}MB!`),s&&n},_=()=>{c.ElMessage.warning("文件上传超过限制")},v=(t,o,l)=>{p("onSuccess",t,o,l)};return(t,o)=>{const l=e.resolveComponent("el-icon"),s=e.resolveComponent("el-alert"),n=e.resolveComponent("el-upload");return e.openBlock(),e.createBlock(n,{headers:t.headers,action:t.action,data:t.data,name:t.name,"before-upload":f,"on-exceed":_,"on-success":v,"file-list":t.files,limit:t.max,drag:"",class:e.normalizeClass(e.unref(m).e("control"))},{tip:e.withCtx(()=>[t.notip?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",x,[e.createElementVNode("div",C,[e.createVNode(s,{title:`上传文件支持 ${i.value.join(" / ")} 格式,单个文件大小不超过 ${t.size}MB,且文件数量不超过 ${t.max} 个`,type:"info","show-icon":"",closable:!1},null,8,["title"])])]))]),default:e.withCtx(()=>[e.createElementVNode("div",E,[e.createVNode(l,{class:"el-icon--upload"},{default:e.withCtx(()=>[e.createVNode(e.unref(N.UploadFilled))]),_:1}),o[0]||(o[0]=e.createElementVNode("div",{class:"el-upload__text"},[e.createTextVNode(" 将文件拖到此处,或"),e.createElementVNode("em",null,"点击上传")],-1))])]),_:1},8,["headers","action","data","name","file-list","limit","class"])}}});exports.default=V;
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as B, computed as x, resolveComponent as c, openBlock as u, createBlock as C, normalizeClass as E, unref as f, withCtx as d, createElementBlock as $, createElementVNode as s, createVNode as r, createCommentVNode as b, createTextVNode as S } from "vue";
2
2
  import { UploadFilled as V } from "../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.12_typescript@5.6.3_/node_modules/@element-plus/icons-vue/dist/index.js";
3
- import { useNamespace as g } from "../../../packages/hooks/src/use-namespace/index.js";
3
+ import { useNamespace as g } from "../../../dist/hooks/src/use-namespace/index.js";
4
4
  import { ElMessage as p } from "../../../node_modules/.pnpm/element-plus@2.8.7_vue@3.5.12_typescript@5.6.3_/node_modules/element-plus/es/components/message/index.js";
5
5
  const w = { class: "slot" }, M = {
6
6
  key: 0,
7
7
  class: "el-upload__tip"
8
- }, U = { style: { display: "inline-block" } }, Q = /* @__PURE__ */ B({
8
+ }, U = { style: { display: "inline-block" } }, I = /* @__PURE__ */ B({
9
9
  name: "QxsFileUpload",
10
10
  __name: "file-upload",
11
11
  props: {
@@ -78,5 +78,5 @@ const w = { class: "slot" }, M = {
78
78
  }
79
79
  });
80
80
  export {
81
- Q as default
81
+ I as default
82
82
  };
@@ -1 +1 @@
1
- "use strict";var E=Object.defineProperty;var f=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var p=(o,n,t)=>n in o?E(o,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[n]=t,h=(o,n)=>{for(var t in n||(n={}))S.call(n,t)&&p(o,t,n[t]);if(f)for(var t of f(n))y.call(n,t)&&p(o,t,n[t]);return o};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("../../../packages/hooks/src/use-namespace/index.cjs"),l=require("../../../node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.12_typescript@5.6.3_/node_modules/@vueuse/core/index.cjs"),$=e.defineComponent({name:"QxsFixedActionBar",inheritAttrs:!1,__name:"fixed-action-bar",props:{padding:{type:String,default:"8px"}},setup(o){const n=o,t=_.useNamespace("fixed-action-bar"),b=e.useAttrs(),s=e.ref(!1),a=e.ref(null),i=e.ref(null),d=l.useParentElement(i),{height:g}=l.useElementSize(a,void 0,{box:"border-box"}),{left:w}=l.useElementBounding(d),{width:x}=l.useElementSize(d,void 0,{box:"border-box"});function r(){const c=window.scrollY||document.documentElement.scrollTop,m=window.innerHeight||document.documentElement.clientHeight,v=document.documentElement.scrollHeight;s.value=Math.ceil(c+m)>=v}e.onMounted(()=>{r(),window.addEventListener("scroll",r)}),e.onUnmounted(()=>{window.removeEventListener("scroll",r)});const u=e.computed(()=>h({width:`${x||0}px`,left:`${w}px`,class:`${s.value?"":t.is("shadow")} ${b.class||""}`},t.cssVarBlock({"actionbar-padding":`${n.padding}`})));return(c,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"placeholderRef",ref:i,style:e.normalizeStyle(`width: 100%; height: ${e.unref(g)}px`)},null,4),e.createElementVNode("div",{ref_key:"actionbar",ref:a,style:e.normalizeStyle(u.value),class:e.normalizeClass([u.value.class,e.unref(t).e("actionbar")]),"data-fixed-calc-width":""},[e.renderSlot(c.$slots,"default")],6)],64))}});exports.default=$;
1
+ "use strict";var E=Object.defineProperty;var f=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var p=(o,n,t)=>n in o?E(o,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[n]=t,h=(o,n)=>{for(var t in n||(n={}))S.call(n,t)&&p(o,t,n[t]);if(f)for(var t of f(n))y.call(n,t)&&p(o,t,n[t]);return o};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("../../../dist/hooks/src/use-namespace/index.cjs"),l=require("../../../node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.12_typescript@5.6.3_/node_modules/@vueuse/core/index.cjs"),$=e.defineComponent({name:"QxsFixedActionBar",inheritAttrs:!1,__name:"fixed-action-bar",props:{padding:{type:String,default:"8px"}},setup(o){const n=o,t=_.useNamespace("fixed-action-bar"),b=e.useAttrs(),s=e.ref(!1),a=e.ref(null),i=e.ref(null),d=l.useParentElement(i),{height:g}=l.useElementSize(a,void 0,{box:"border-box"}),{left:w}=l.useElementBounding(d),{width:x}=l.useElementSize(d,void 0,{box:"border-box"});function r(){const c=window.scrollY||document.documentElement.scrollTop,m=window.innerHeight||document.documentElement.clientHeight,v=document.documentElement.scrollHeight;s.value=Math.ceil(c+m)>=v}e.onMounted(()=>{r(),window.addEventListener("scroll",r)}),e.onUnmounted(()=>{window.removeEventListener("scroll",r)});const u=e.computed(()=>h({width:`${x||0}px`,left:`${w}px`,class:`${s.value?"":t.is("shadow")} ${b.class||""}`},t.cssVarBlock({"actionbar-padding":`${n.padding}`})));return(c,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"placeholderRef",ref:i,style:e.normalizeStyle(`width: 100%; height: ${e.unref(g)}px`)},null,4),e.createElementVNode("div",{ref_key:"actionbar",ref:a,style:e.normalizeStyle(u.value),class:e.normalizeClass([u.value.class,e.unref(t).e("actionbar")]),"data-fixed-calc-width":""},[e.renderSlot(c.$slots,"default")],6)],64))}});exports.default=$;
@@ -9,10 +9,10 @@ var p = (o, t, e) => t in o ? $(o, t, { enumerable: !0, configurable: !0, writab
9
9
  S.call(t, e) && p(o, e, t[e]);
10
10
  return o;
11
11
  };
12
- import { defineComponent as k, useAttrs as H, ref as c, onMounted as z, onUnmounted as A, computed as L, openBlock as C, createElementBlock as F, Fragment as M, createElementVNode as h, normalizeStyle as w, unref as x, normalizeClass as N, renderSlot as P } from "vue";
13
- import { useNamespace as R } from "../../../packages/hooks/src/use-namespace/index.js";
12
+ import { defineComponent as k, useAttrs as H, ref as a, onMounted as z, onUnmounted as A, computed as L, openBlock as C, createElementBlock as F, Fragment as M, createElementVNode as h, normalizeStyle as w, unref as x, normalizeClass as N, renderSlot as P } from "vue";
13
+ import { useNamespace as R } from "../../../dist/hooks/src/use-namespace/index.js";
14
14
  import { useParentElement as T, useElementSize as b, useElementBounding as V } from "../../../node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.12_typescript@5.6.3_/node_modules/@vueuse/core/index.js";
15
- const Y = /* @__PURE__ */ k({
15
+ const W = /* @__PURE__ */ k({
16
16
  name: "QxsFixedActionBar",
17
17
  inheritAttrs: !1,
18
18
  __name: "fixed-action-bar",
@@ -23,10 +23,10 @@ const Y = /* @__PURE__ */ k({
23
23
  }
24
24
  },
25
25
  setup(o) {
26
- const t = o, e = R("fixed-action-bar"), g = H(), r = c(!1), a = c(null), s = c(null), i = T(s), { height: v } = b(a, void 0, { box: "border-box" }), { left: E } = V(i), { width: y } = b(i, void 0, { box: "border-box" });
26
+ const t = o, e = R("fixed-action-bar"), g = H(), c = a(!1), r = a(null), s = a(null), i = T(s), { height: v } = b(r, void 0, { box: "border-box" }), { left: E } = V(i), { width: y } = b(i, void 0, { box: "border-box" });
27
27
  function n() {
28
28
  const l = window.scrollY || document.documentElement.scrollTop, m = window.innerHeight || document.documentElement.clientHeight, _ = document.documentElement.scrollHeight;
29
- r.value = Math.ceil(l + m) >= _;
29
+ c.value = Math.ceil(l + m) >= _;
30
30
  }
31
31
  z(() => {
32
32
  n(), window.addEventListener("scroll", n);
@@ -36,7 +36,7 @@ const Y = /* @__PURE__ */ k({
36
36
  const d = L(() => f({
37
37
  width: `${y || 0}px`,
38
38
  left: `${E}px`,
39
- class: `${r.value ? "" : e.is("shadow")} ${g.class || ""}`
39
+ class: `${c.value ? "" : e.is("shadow")} ${g.class || ""}`
40
40
  }, e.cssVarBlock({
41
41
  "actionbar-padding": `${t.padding}`
42
42
  })));
@@ -48,7 +48,7 @@ const Y = /* @__PURE__ */ k({
48
48
  }, null, 4),
49
49
  h("div", {
50
50
  ref_key: "actionbar",
51
- ref: a,
51
+ ref: r,
52
52
  style: w(d.value),
53
53
  class: N([d.value.class, x(e).e("actionbar")]),
54
54
  "data-fixed-calc-width": ""
@@ -59,5 +59,5 @@ const Y = /* @__PURE__ */ k({
59
59
  }
60
60
  });
61
61
  export {
62
- Y as default
62
+ W as default
63
63
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.12_typescript@5.6.3_/node_modules/@element-plus/icons-vue/dist/index.cjs"),C=require("../../../packages/hooks/src/use-namespace/index.cjs"),u=require("../../../node_modules/.pnpm/element-plus@2.8.7_vue@3.5.12_typescript@5.6.3_/node_modules/element-plus/es/components/message/index.cjs"),$={key:1,class:"image"},B={class:"mask"},E={class:"actions"},S={key:0,class:"el-upload__tip-text"},z={style:{display:"inline-block"}},b=e.defineComponent({name:"QxsImageUpload",__name:"image-upload",props:{action:{},headers:{},data:{},name:{default:"file"},url:{default:""},size:{default:20},width:{default:160},accept:{default:"image/jpeg,image/jpg,image/png,image/gif"},height:{default:90},placeholder:{default:"点击上传图片"},notip:{type:Boolean,default:!1},tipText:{},beforeUpload:{}},emits:["update:url","onSuccess"],setup(m,{emit:h}){const s=m,c=h,d=C.useNamespace("image-upload"),l=e.ref({imageViewerVisible:!1,progress:{preview:"",percent:0}}),n=e.computed(()=>s.accept.split(",").map(t=>t.split("/").pop()));function g(){l.value.imageViewerVisible=!0}function f(){l.value.imageViewerVisible=!1}function v(){c("update:url","")}const w=t=>{var r;const i=(r=t.name.split(".").at(-1))!=null?r:"",o=n.value.includes(i),a=t.size/1024/1024<s.size;return o?a?l.value.progress.preview=URL.createObjectURL(t):u.ElMessage.error(`上传图片大小不能超过 ${s.size}MB!`):u.ElMessage.error(`上传图片只支持${n.value.join(" / ")}格式!`),o&&a&&(!s.beforeUpload||s.beforeUpload(t))},V=t=>{l.value.progress.percent=~~t.percent},y=(...t)=>{l.value.progress.preview="",l.value.progress.percent=0,c("onSuccess",...t)};return(t,N)=>{const i=e.resolveComponent("el-icon"),o=e.resolveComponent("el-image"),a=e.resolveComponent("el-progress"),r=e.resolveComponent("el-upload"),k=e.resolveComponent("el-image-viewer");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(d).e("upload-container"))},[e.createVNode(r,{"show-file-list":!1,headers:t.headers,action:t.action,data:t.data,name:t.name,"before-upload":w,"on-progress":V,"on-success":y,drag:"",accept:t.accept,class:e.normalizeClass(e.unref(d).e("image-upload"))},{default:e.withCtx(()=>[t.url===""?(e.openBlock(),e.createBlock(o,{key:0,src:t.url===""?t.placeholder:t.url,style:e.normalizeStyle(`width:${t.width}px;height:${t.height}px;`),fit:"fill"},{error:e.withCtx(()=>[e.createElementVNode("div",{class:"image-slot",style:e.normalizeStyle(`width:${t.width}px;height:${t.height}px;`)},[e.createVNode(i,null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.Plus))]),_:1}),e.createElementVNode("p",null,e.toDisplayString(t.placeholder),1)],4)]),_:1},8,["src","style"])):(e.openBlock(),e.createElementBlock("div",$,[e.createVNode(o,{src:t.url,style:e.normalizeStyle(`width:${t.width}px;height:${t.height}px;`),fit:"fill"},null,8,["src","style"]),e.createElementVNode("div",B,[e.createElementVNode("div",E,[e.createElementVNode("span",{title:"预览",onClick:e.withModifiers(g,["stop"])},[e.createVNode(i,null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.ZoomIn))]),_:1})]),e.createElementVNode("span",{title:"移除",onClick:e.withModifiers(v,["stop"])},[e.createVNode(i,null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.Delete))]),_:1})])])])])),e.withDirectives(e.createElementVNode("div",{class:"progress",style:e.normalizeStyle(`width:${t.width}px;height:${t.height}px;`)},[e.createVNode(o,{src:l.value.progress.preview,style:e.normalizeStyle(`width:${t.width}px;height:${t.height}px;`),fit:"fill"},null,8,["src","style"]),e.createVNode(a,{type:"circle",width:Math.min(t.width,t.height)*.8,percentage:l.value.progress.percent},null,8,["width","percentage"])],4),[[e.vShow,t.url===""&&l.value.progress.percent]])]),_:1},8,["headers","action","data","name","accept","class"]),t.notip?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("div",z,e.toDisplayString(t.tipText||`上传图片支持 ${n.value.join(" / ")} 格式,且图片大小不超过 ${t.size}MB,建议图片尺寸为 ${t.width}*${t.height}`),1)])),l.value.imageViewerVisible?(e.openBlock(),e.createBlock(k,{key:1,"url-list":[t.url],teleported:"",onClose:f},null,8,["url-list"])):e.createCommentVNode("",!0)],2)}}});exports.default=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.12_typescript@5.6.3_/node_modules/@element-plus/icons-vue/dist/index.cjs"),C=require("../../../dist/hooks/src/use-namespace/index.cjs"),u=require("../../../node_modules/.pnpm/element-plus@2.8.7_vue@3.5.12_typescript@5.6.3_/node_modules/element-plus/es/components/message/index.cjs"),$={key:1,class:"image"},B={class:"mask"},E={class:"actions"},S={key:0,class:"el-upload__tip-text"},z={style:{display:"inline-block"}},b=e.defineComponent({name:"QxsImageUpload",__name:"image-upload",props:{action:{},headers:{},data:{},name:{default:"file"},url:{default:""},size:{default:20},width:{default:160},accept:{default:"image/jpeg,image/jpg,image/png,image/gif"},height:{default:90},placeholder:{default:"点击上传图片"},notip:{type:Boolean,default:!1},tipText:{},beforeUpload:{}},emits:["update:url","onSuccess"],setup(m,{emit:h}){const s=m,c=h,d=C.useNamespace("image-upload"),l=e.ref({imageViewerVisible:!1,progress:{preview:"",percent:0}}),n=e.computed(()=>s.accept.split(",").map(t=>t.split("/").pop()));function g(){l.value.imageViewerVisible=!0}function f(){l.value.imageViewerVisible=!1}function v(){c("update:url","")}const w=t=>{var r;const i=(r=t.name.split(".").at(-1))!=null?r:"",o=n.value.includes(i),a=t.size/1024/1024<s.size;return o?a?l.value.progress.preview=URL.createObjectURL(t):u.ElMessage.error(`上传图片大小不能超过 ${s.size}MB!`):u.ElMessage.error(`上传图片只支持${n.value.join(" / ")}格式!`),o&&a&&(!s.beforeUpload||s.beforeUpload(t))},V=t=>{l.value.progress.percent=~~t.percent},y=(...t)=>{l.value.progress.preview="",l.value.progress.percent=0,c("onSuccess",...t)};return(t,N)=>{const i=e.resolveComponent("el-icon"),o=e.resolveComponent("el-image"),a=e.resolveComponent("el-progress"),r=e.resolveComponent("el-upload"),k=e.resolveComponent("el-image-viewer");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(d).e("upload-container"))},[e.createVNode(r,{"show-file-list":!1,headers:t.headers,action:t.action,data:t.data,name:t.name,"before-upload":w,"on-progress":V,"on-success":y,drag:"",accept:t.accept,class:e.normalizeClass(e.unref(d).e("image-upload"))},{default:e.withCtx(()=>[t.url===""?(e.openBlock(),e.createBlock(o,{key:0,src:t.url===""?t.placeholder:t.url,style:e.normalizeStyle(`width:${t.width}px;height:${t.height}px;`),fit:"fill"},{error:e.withCtx(()=>[e.createElementVNode("div",{class:"image-slot",style:e.normalizeStyle(`width:${t.width}px;height:${t.height}px;`)},[e.createVNode(i,null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.Plus))]),_:1}),e.createElementVNode("p",null,e.toDisplayString(t.placeholder),1)],4)]),_:1},8,["src","style"])):(e.openBlock(),e.createElementBlock("div",$,[e.createVNode(o,{src:t.url,style:e.normalizeStyle(`width:${t.width}px;height:${t.height}px;`),fit:"fill"},null,8,["src","style"]),e.createElementVNode("div",B,[e.createElementVNode("div",E,[e.createElementVNode("span",{title:"预览",onClick:e.withModifiers(g,["stop"])},[e.createVNode(i,null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.ZoomIn))]),_:1})]),e.createElementVNode("span",{title:"移除",onClick:e.withModifiers(v,["stop"])},[e.createVNode(i,null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.Delete))]),_:1})])])])])),e.withDirectives(e.createElementVNode("div",{class:"progress",style:e.normalizeStyle(`width:${t.width}px;height:${t.height}px;`)},[e.createVNode(o,{src:l.value.progress.preview,style:e.normalizeStyle(`width:${t.width}px;height:${t.height}px;`),fit:"fill"},null,8,["src","style"]),e.createVNode(a,{type:"circle",width:Math.min(t.width,t.height)*.8,percentage:l.value.progress.percent},null,8,["width","percentage"])],4),[[e.vShow,t.url===""&&l.value.progress.percent]])]),_:1},8,["headers","action","data","name","accept","class"]),t.notip?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("div",z,e.toDisplayString(t.tipText||`上传图片支持 ${n.value.join(" / ")} 格式,且图片大小不超过 ${t.size}MB,建议图片尺寸为 ${t.width}*${t.height}`),1)])),l.value.imageViewerVisible?(e.openBlock(),e.createBlock(k,{key:1,"url-list":[t.url],teleported:"",onClose:f},null,8,["url-list"])):e.createCommentVNode("",!0)],2)}}});exports.default=b;
@@ -1,6 +1,6 @@
1
- import { defineComponent as E, ref as O, computed as T, resolveComponent as r, openBlock as n, createElementBlock as g, normalizeClass as w, unref as p, createVNode as s, withCtx as d, createBlock as y, normalizeStyle as u, createElementVNode as t, toDisplayString as $, withModifiers as k, withDirectives as I, vShow as L, createCommentVNode as _ } from "vue";
1
+ import { defineComponent as E, ref as I, computed as O, resolveComponent as r, openBlock as n, createElementBlock as g, normalizeClass as w, unref as p, createVNode as l, withCtx as d, createBlock as y, normalizeStyle as u, createElementVNode as t, toDisplayString as $, withModifiers as k, withDirectives as T, vShow as L, createCommentVNode as _ } from "vue";
2
2
  import { Plus as P, ZoomIn as R, Delete as Q } from "../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.12_typescript@5.6.3_/node_modules/@element-plus/icons-vue/dist/index.js";
3
- import { useNamespace as Z } from "../../../packages/hooks/src/use-namespace/index.js";
3
+ import { useNamespace as Z } from "../../../dist/hooks/src/use-namespace/index.js";
4
4
  import { ElMessage as V } from "../../../node_modules/.pnpm/element-plus@2.8.7_vue@3.5.12_typescript@5.6.3_/node_modules/element-plus/es/components/message/index.js";
5
5
  const q = {
6
6
  key: 1,
@@ -28,18 +28,18 @@ const q = {
28
28
  },
29
29
  emits: ["update:url", "onSuccess"],
30
30
  setup(b, { emit: z }) {
31
- const o = b, f = z, v = Z("image-upload"), l = O({
31
+ const o = b, f = z, v = Z("image-upload"), s = I({
32
32
  imageViewerVisible: !1,
33
33
  progress: {
34
34
  preview: "",
35
35
  percent: 0
36
36
  }
37
- }), m = T(() => o.accept.split(",").map((e) => e.split("/").pop()));
37
+ }), m = O(() => o.accept.split(",").map((e) => e.split("/").pop()));
38
38
  function C() {
39
- l.value.imageViewerVisible = !0;
39
+ s.value.imageViewerVisible = !0;
40
40
  }
41
41
  function B() {
42
- l.value.imageViewerVisible = !1;
42
+ s.value.imageViewerVisible = !1;
43
43
  }
44
44
  function S() {
45
45
  f("update:url", "");
@@ -47,18 +47,18 @@ const q = {
47
47
  const U = (e) => {
48
48
  var h;
49
49
  const a = (h = e.name.split(".").at(-1)) != null ? h : "", i = m.value.includes(a), c = e.size / 1024 / 1024 < o.size;
50
- return i ? c ? l.value.progress.preview = URL.createObjectURL(e) : V.error(`上传图片大小不能超过 ${o.size}MB!`) : V.error(`上传图片只支持${m.value.join(" / ")}格式!`), i && c && (!o.beforeUpload || o.beforeUpload(e));
50
+ return i ? c ? s.value.progress.preview = URL.createObjectURL(e) : V.error(`上传图片大小不能超过 ${o.size}MB!`) : V.error(`上传图片只支持${m.value.join(" / ")}格式!`), i && c && (!o.beforeUpload || o.beforeUpload(e));
51
51
  }, N = (e) => {
52
- l.value.progress.percent = ~~e.percent;
52
+ s.value.progress.percent = ~~e.percent;
53
53
  }, j = (...e) => {
54
- l.value.progress.preview = "", l.value.progress.percent = 0, f("onSuccess", ...e);
54
+ s.value.progress.preview = "", s.value.progress.percent = 0, f("onSuccess", ...e);
55
55
  };
56
56
  return (e, M) => {
57
57
  const a = r("el-icon"), i = r("el-image"), c = r("el-progress"), h = r("el-upload"), D = r("el-image-viewer");
58
58
  return n(), g("div", {
59
59
  class: w(p(v).e("upload-container"))
60
60
  }, [
61
- s(h, {
61
+ l(h, {
62
62
  "show-file-list": !1,
63
63
  headers: e.headers,
64
64
  action: e.action,
@@ -83,9 +83,9 @@ const q = {
83
83
  class: "image-slot",
84
84
  style: u(`width:${e.width}px;height:${e.height}px;`)
85
85
  }, [
86
- s(a, null, {
86
+ l(a, null, {
87
87
  default: d(() => [
88
- s(p(P))
88
+ l(p(P))
89
89
  ]),
90
90
  _: 1
91
91
  }),
@@ -94,7 +94,7 @@ const q = {
94
94
  ]),
95
95
  _: 1
96
96
  }, 8, ["src", "style"])) : (n(), g("div", q, [
97
- s(i, {
97
+ l(i, {
98
98
  src: e.url,
99
99
  style: u(`width:${e.width}px;height:${e.height}px;`),
100
100
  fit: "fill"
@@ -105,9 +105,9 @@ const q = {
105
105
  title: "预览",
106
106
  onClick: k(C, ["stop"])
107
107
  }, [
108
- s(a, null, {
108
+ l(a, null, {
109
109
  default: d(() => [
110
- s(p(R))
110
+ l(p(R))
111
111
  ]),
112
112
  _: 1
113
113
  })
@@ -116,9 +116,9 @@ const q = {
116
116
  title: "移除",
117
117
  onClick: k(S, ["stop"])
118
118
  }, [
119
- s(a, null, {
119
+ l(a, null, {
120
120
  default: d(() => [
121
- s(p(Q))
121
+ l(p(Q))
122
122
  ]),
123
123
  _: 1
124
124
  })
@@ -126,22 +126,22 @@ const q = {
126
126
  ])
127
127
  ])
128
128
  ])),
129
- I(t("div", {
129
+ T(t("div", {
130
130
  class: "progress",
131
131
  style: u(`width:${e.width}px;height:${e.height}px;`)
132
132
  }, [
133
- s(i, {
134
- src: l.value.progress.preview,
133
+ l(i, {
134
+ src: s.value.progress.preview,
135
135
  style: u(`width:${e.width}px;height:${e.height}px;`),
136
136
  fit: "fill"
137
137
  }, null, 8, ["src", "style"]),
138
- s(c, {
138
+ l(c, {
139
139
  type: "circle",
140
140
  width: Math.min(e.width, e.height) * 0.8,
141
- percentage: l.value.progress.percent
141
+ percentage: s.value.progress.percent
142
142
  }, null, 8, ["width", "percentage"])
143
143
  ], 4), [
144
- [L, e.url === "" && l.value.progress.percent]
144
+ [L, e.url === "" && s.value.progress.percent]
145
145
  ])
146
146
  ]),
147
147
  _: 1
@@ -149,7 +149,7 @@ const q = {
149
149
  e.notip ? _("", !0) : (n(), g("div", G, [
150
150
  t("div", H, $(e.tipText || `上传图片支持 ${m.value.join(" / ")} 格式,且图片大小不超过 ${e.size}MB,建议图片尺寸为 ${e.width}*${e.height}`), 1)
151
151
  ])),
152
- l.value.imageViewerVisible ? (n(), y(D, {
152
+ s.value.imageViewerVisible ? (n(), y(D, {
153
153
  key: 1,
154
154
  "url-list": [e.url],
155
155
  teleported: "",
@@ -1 +1 @@
1
- "use strict";var P=(M,S,a)=>new Promise((T,E)=>{var f=v=>{try{h(a.next(v))}catch(u){E(u)}},x=v=>{try{h(a.throw(v))}catch(u){E(u)}},h=v=>v.done?T(v.value):Promise.resolve(v.value).then(f,x);h((a=a.apply(M,S)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),J=require("../../../packages/hooks/src/use-namespace/index.cjs"),$=require("../../../node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.12_typescript@5.6.3_/node_modules/@vueuse/core/index.cjs"),K=require("./composables.cjs"),Z=["src"],ee=e.defineComponent({name:"QxsPhotoCropTool",__name:"photo-crop-tool",props:{imgFile:{type:Object,default:()=>null},aspectRatio:{type:String,default:()=>"16 / 9"},defaultWidth:{type:Number,default:()=>320},defaultHeight:{type:Number,default:()=>180},zoomType:{type:String,default:()=>"fixed"}},setup(M,{expose:S}){const a=M;let T=0,E=0,f=0,x=0;const h=J.useNamespace("photo-crop-tool"),v=e.ref(null),u=e.ref(null),B=e.ref(null),F=e.ref(""),c=e.ref(""),L=e.ref({x:0,y:0}),t=e.ref({width:a.defaultWidth,height:a.defaultHeight,x:0,y:0}),{width:k,height:N}=$.useElementSize(v),{width:X}=$.useElementSize(B),{x:m,y:g,style:Y}=$.useDraggable(v,{containerElement:u,draggingElement:v,disabled:e.computed(()=>!!c.value),exact:!0,initialValue:L}),V=e.computed(()=>a.imgFile?URL.createObjectURL(a.imgFile):"");e.watch(()=>a.imgFile,l=>{l&&!l.type.startsWith("image/")?F.value="文件类型错误":F.value=""});const D=e.computed(()=>{var l;return(((l=B.value)==null?void 0:l.naturalWidth)||0)/X.value}),p=e.computed(()=>{const l={left:0,top:0};return c.value==="bottom-right"?(l.left=t.value.x,l.top=t.value.y):c.value==="top-left"?(l.left=t.value.x-k.value,l.top=t.value.y-N.value):c.value==="top-right"?(l.top=t.value.y-N.value,l.left=t.value.x):c.value==="bottom-left"&&(l.left=t.value.x-k.value,l.top=t.value.y),l}),Q=e.computed(()=>{const{aspectRatio:l}=a,i={width:`${t.value.width||a.defaultWidth}`,height:`${t.value.height||a.defaultHeight}`,"aspect-ratio":l,top:`${p.value.top}px`,left:`${p.value.left}px`};return a.zoomType==="free"?delete i["aspect-ratio"]:a.zoomType==="fixed"&&delete i.height,h.cssVarBlock(i)});function y(l){return l*D.value}function A(){return P(this,arguments,function*(l=B.value){var W,C;let i="transparent";u.value&&(i=window.getComputedStyle(u.value).backgroundColor);const n=document.createElement("canvas");n.width=y(((W=u.value)==null?void 0:W.clientWidth)||0),n.height=y(((C=u.value)==null?void 0:C.clientHeight)||0);const{drawImage:H,cropCanvas:b,drawColor:z}=K.useCanvas(n);return z(0,0,n.width,n.height,i),H(l,y(l.offsetLeft),y(l.offsetTop),l.naturalWidth,l.naturalHeight),yield b(y(m.value),y(g.value),y(k.value),y(N.value))})}function w(l,i){var b,z;const n=((b=u.value)==null?void 0:b.clientWidth)||1/0,H=((z=u.value)==null?void 0:z.clientHeight)||1/0;return{width:Math.min(Math.max(l,0),n),height:Math.min(Math.max(i,0),H)}}function U(l){var H,b,z,W,C,j,q,O;const i=l.clientX-T,n=l.clientY-E;if(c.value==="bottom-right"){if(a.zoomType==="free"){const{width:s,height:o}=w(f+i,x+n);t.value.width=s,t.value.height=o}else if(a.zoomType==="fixed"){const s=Number.parseFloat(a.aspectRatio.split(" / ")[0])/Number.parseFloat(a.aspectRatio.split(" / ")[1]);let o=f+i,r=o/s;const{width:R,height:d}=w(o,r);d>(((H=u.value)==null?void 0:H.clientHeight)||1/0)&&(r=((b=u.value)==null?void 0:b.clientHeight)||1/0,o=r*s),t.value.width=R,t.value.height=d}}else if(c.value==="top-left"){if(a.zoomType==="free"){const{width:s,height:o}=w(f-i,x-n);t.value.width=s,t.value.height=o}else if(a.zoomType==="fixed"){const s=Number.parseFloat(a.aspectRatio.split(" / ")[0])/Number.parseFloat(a.aspectRatio.split(" / ")[1]);let o=f-i,r=o/s;const{width:R,height:d}=w(o,r);d>(((z=u.value)==null?void 0:z.clientHeight)||1/0)&&(r=((W=u.value)==null?void 0:W.clientHeight)||1/0,o=r*s),t.value.width=R,t.value.height=d}m.value=p.value.left,g.value=p.value.top}else if(c.value==="top-right"){if(a.zoomType==="free"){const{width:s,height:o}=w(f+i,x-n);t.value.width=s,t.value.height=o}else if(a.zoomType==="fixed"){const s=Number.parseFloat(a.aspectRatio.split(" / ")[0])/Number.parseFloat(a.aspectRatio.split(" / ")[1]);let o=f+i,r=o/s;const{width:R,height:d}=w(o,r);d>(((C=u.value)==null?void 0:C.clientHeight)||1/0)&&(r=((j=u.value)==null?void 0:j.clientHeight)||1/0,o=r*s),t.value.width=R,t.value.height=d}m.value=p.value.left,g.value=p.value.top}else if(c.value==="bottom-left"){if(a.zoomType==="free"){const{width:s,height:o}=w(f-i,x+n);t.value.width=s,t.value.height=o}else if(a.zoomType==="fixed"){const s=Number.parseFloat(a.aspectRatio.split(" / ")[0])/Number.parseFloat(a.aspectRatio.split(" / ")[1]);let o=f-i,r=o/s;const{width:R,height:d}=w(o,r);d>(((q=u.value)==null?void 0:q.clientHeight)||1/0)&&(r=((O=u.value)==null?void 0:O.clientHeight)||1/0,o=r*s),t.value.width=R,t.value.height=d}m.value=p.value.left,g.value=p.value.top}l.preventDefault(),l.stopPropagation()}function I(l,i){c.value=i,T=l.clientX,E=l.clientY,f=t.value.width,x=t.value.height,i==="bottom-right"?(t.value.x=m.value,t.value.y=g.value):i==="top-left"?(t.value.x=m.value+k.value,t.value.y=g.value+N.value):i==="top-right"?(t.value.x=m.value,t.value.y=g.value+N.value):i==="bottom-left"&&(t.value.x=m.value+k.value,t.value.y=g.value)}function _(){c.value=""}function G(){t.value.width=a.defaultWidth,t.value.height=a.defaultHeight,m.value=0,g.value=0}return document.addEventListener("mouseup",_),document.addEventListener("mousemove",U),e.onMounted(()=>{e.nextTick(()=>{var l,i;L.value.x=(((l=u.value)==null?void 0:l.offsetWidth)||0)/2-t.value.width/2,L.value.y=(((i=u.value)==null?void 0:i.offsetHeight)||0)/2-t.value.height/2})}),e.onUnmounted(()=>{V.value&&URL.revokeObjectURL(V.value),document.removeEventListener("mouseup",_),document.removeEventListener("mousemove",U)}),S({crop:A,resize:G}),(l,i)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerBoxRef",ref:u,class:e.normalizeClass([e.unref(h).e("img-box")])},[F.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(h).e("error-message")])},e.toDisplayString(F.value),3)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("img",{ref_key:"imgRef",ref:B,class:e.normalizeClass([e.unref(h).e("image")]),src:V.value},null,10,Z),e.createElementVNode("div",{ref_key:"cropBoxRef",ref:v,class:e.normalizeClass([e.unref(h).e("crop-tool-box")]),style:e.normalizeStyle([Q.value,c.value?`left: ${p.value.left}px;top: ${p.value.top}px`:e.unref(Y)])},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(h).e("top-left")]),onMousedown:i[0]||(i[0]=n=>I(n,"top-left"))},null,34),e.createElementVNode("div",{class:e.normalizeClass([e.unref(h).e("top-right")]),onMousedown:i[1]||(i[1]=n=>I(n,"top-right"))},null,34),e.createElementVNode("div",{class:e.normalizeClass([e.unref(h).e("bottom-right")]),onMousedown:i[2]||(i[2]=n=>I(n,"bottom-right"))},null,34),e.createElementVNode("div",{class:e.normalizeClass([e.unref(h).e("bottom-left")]),onMousedown:i[3]||(i[3]=n=>I(n,"bottom-left"))},null,34)],6)],64))],2))}});exports.default=ee;
1
+ "use strict";var P=(M,S,a)=>new Promise((T,E)=>{var f=v=>{try{h(a.next(v))}catch(u){E(u)}},x=v=>{try{h(a.throw(v))}catch(u){E(u)}},h=v=>v.done?T(v.value):Promise.resolve(v.value).then(f,x);h((a=a.apply(M,S)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),J=require("../../../dist/hooks/src/use-namespace/index.cjs"),$=require("../../../node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.12_typescript@5.6.3_/node_modules/@vueuse/core/index.cjs"),K=require("./composables.cjs"),Z=["src"],ee=e.defineComponent({name:"QxsPhotoCropTool",__name:"photo-crop-tool",props:{imgFile:{type:Object,default:()=>null},aspectRatio:{type:String,default:()=>"16 / 9"},defaultWidth:{type:Number,default:()=>320},defaultHeight:{type:Number,default:()=>180},zoomType:{type:String,default:()=>"fixed"}},setup(M,{expose:S}){const a=M;let T=0,E=0,f=0,x=0;const h=J.useNamespace("photo-crop-tool"),v=e.ref(null),u=e.ref(null),B=e.ref(null),F=e.ref(""),c=e.ref(""),L=e.ref({x:0,y:0}),t=e.ref({width:a.defaultWidth,height:a.defaultHeight,x:0,y:0}),{width:k,height:N}=$.useElementSize(v),{width:X}=$.useElementSize(B),{x:m,y:g,style:Y}=$.useDraggable(v,{containerElement:u,draggingElement:v,disabled:e.computed(()=>!!c.value),exact:!0,initialValue:L}),V=e.computed(()=>a.imgFile?URL.createObjectURL(a.imgFile):"");e.watch(()=>a.imgFile,l=>{l&&!l.type.startsWith("image/")?F.value="文件类型错误":F.value=""});const D=e.computed(()=>{var l;return(((l=B.value)==null?void 0:l.naturalWidth)||0)/X.value}),p=e.computed(()=>{const l={left:0,top:0};return c.value==="bottom-right"?(l.left=t.value.x,l.top=t.value.y):c.value==="top-left"?(l.left=t.value.x-k.value,l.top=t.value.y-N.value):c.value==="top-right"?(l.top=t.value.y-N.value,l.left=t.value.x):c.value==="bottom-left"&&(l.left=t.value.x-k.value,l.top=t.value.y),l}),Q=e.computed(()=>{const{aspectRatio:l}=a,i={width:`${t.value.width||a.defaultWidth}`,height:`${t.value.height||a.defaultHeight}`,"aspect-ratio":l,top:`${p.value.top}px`,left:`${p.value.left}px`};return a.zoomType==="free"?delete i["aspect-ratio"]:a.zoomType==="fixed"&&delete i.height,h.cssVarBlock(i)});function y(l){return l*D.value}function A(){return P(this,arguments,function*(l=B.value){var W,C;let i="transparent";u.value&&(i=window.getComputedStyle(u.value).backgroundColor);const n=document.createElement("canvas");n.width=y(((W=u.value)==null?void 0:W.clientWidth)||0),n.height=y(((C=u.value)==null?void 0:C.clientHeight)||0);const{drawImage:H,cropCanvas:b,drawColor:z}=K.useCanvas(n);return z(0,0,n.width,n.height,i),H(l,y(l.offsetLeft),y(l.offsetTop),l.naturalWidth,l.naturalHeight),yield b(y(m.value),y(g.value),y(k.value),y(N.value))})}function w(l,i){var b,z;const n=((b=u.value)==null?void 0:b.clientWidth)||1/0,H=((z=u.value)==null?void 0:z.clientHeight)||1/0;return{width:Math.min(Math.max(l,0),n),height:Math.min(Math.max(i,0),H)}}function U(l){var H,b,z,W,C,j,q,O;const i=l.clientX-T,n=l.clientY-E;if(c.value==="bottom-right"){if(a.zoomType==="free"){const{width:s,height:o}=w(f+i,x+n);t.value.width=s,t.value.height=o}else if(a.zoomType==="fixed"){const s=Number.parseFloat(a.aspectRatio.split(" / ")[0])/Number.parseFloat(a.aspectRatio.split(" / ")[1]);let o=f+i,r=o/s;const{width:R,height:d}=w(o,r);d>(((H=u.value)==null?void 0:H.clientHeight)||1/0)&&(r=((b=u.value)==null?void 0:b.clientHeight)||1/0,o=r*s),t.value.width=R,t.value.height=d}}else if(c.value==="top-left"){if(a.zoomType==="free"){const{width:s,height:o}=w(f-i,x-n);t.value.width=s,t.value.height=o}else if(a.zoomType==="fixed"){const s=Number.parseFloat(a.aspectRatio.split(" / ")[0])/Number.parseFloat(a.aspectRatio.split(" / ")[1]);let o=f-i,r=o/s;const{width:R,height:d}=w(o,r);d>(((z=u.value)==null?void 0:z.clientHeight)||1/0)&&(r=((W=u.value)==null?void 0:W.clientHeight)||1/0,o=r*s),t.value.width=R,t.value.height=d}m.value=p.value.left,g.value=p.value.top}else if(c.value==="top-right"){if(a.zoomType==="free"){const{width:s,height:o}=w(f+i,x-n);t.value.width=s,t.value.height=o}else if(a.zoomType==="fixed"){const s=Number.parseFloat(a.aspectRatio.split(" / ")[0])/Number.parseFloat(a.aspectRatio.split(" / ")[1]);let o=f+i,r=o/s;const{width:R,height:d}=w(o,r);d>(((C=u.value)==null?void 0:C.clientHeight)||1/0)&&(r=((j=u.value)==null?void 0:j.clientHeight)||1/0,o=r*s),t.value.width=R,t.value.height=d}m.value=p.value.left,g.value=p.value.top}else if(c.value==="bottom-left"){if(a.zoomType==="free"){const{width:s,height:o}=w(f-i,x+n);t.value.width=s,t.value.height=o}else if(a.zoomType==="fixed"){const s=Number.parseFloat(a.aspectRatio.split(" / ")[0])/Number.parseFloat(a.aspectRatio.split(" / ")[1]);let o=f-i,r=o/s;const{width:R,height:d}=w(o,r);d>(((q=u.value)==null?void 0:q.clientHeight)||1/0)&&(r=((O=u.value)==null?void 0:O.clientHeight)||1/0,o=r*s),t.value.width=R,t.value.height=d}m.value=p.value.left,g.value=p.value.top}l.preventDefault(),l.stopPropagation()}function I(l,i){c.value=i,T=l.clientX,E=l.clientY,f=t.value.width,x=t.value.height,i==="bottom-right"?(t.value.x=m.value,t.value.y=g.value):i==="top-left"?(t.value.x=m.value+k.value,t.value.y=g.value+N.value):i==="top-right"?(t.value.x=m.value,t.value.y=g.value+N.value):i==="bottom-left"&&(t.value.x=m.value+k.value,t.value.y=g.value)}function _(){c.value=""}function G(){t.value.width=a.defaultWidth,t.value.height=a.defaultHeight,m.value=0,g.value=0}return document.addEventListener("mouseup",_),document.addEventListener("mousemove",U),e.onMounted(()=>{e.nextTick(()=>{var l,i;L.value.x=(((l=u.value)==null?void 0:l.offsetWidth)||0)/2-t.value.width/2,L.value.y=(((i=u.value)==null?void 0:i.offsetHeight)||0)/2-t.value.height/2})}),e.onUnmounted(()=>{V.value&&URL.revokeObjectURL(V.value),document.removeEventListener("mouseup",_),document.removeEventListener("mousemove",U)}),S({crop:A,resize:G}),(l,i)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerBoxRef",ref:u,class:e.normalizeClass([e.unref(h).e("img-box")])},[F.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(h).e("error-message")])},e.toDisplayString(F.value),3)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("img",{ref_key:"imgRef",ref:B,class:e.normalizeClass([e.unref(h).e("image")]),src:V.value},null,10,Z),e.createElementVNode("div",{ref_key:"cropBoxRef",ref:v,class:e.normalizeClass([e.unref(h).e("crop-tool-box")]),style:e.normalizeStyle([Q.value,c.value?`left: ${p.value.left}px;top: ${p.value.top}px`:e.unref(Y)])},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(h).e("top-left")]),onMousedown:i[0]||(i[0]=n=>I(n,"top-left"))},null,34),e.createElementVNode("div",{class:e.normalizeClass([e.unref(h).e("top-right")]),onMousedown:i[1]||(i[1]=n=>I(n,"top-right"))},null,34),e.createElementVNode("div",{class:e.normalizeClass([e.unref(h).e("bottom-right")]),onMousedown:i[2]||(i[2]=n=>I(n,"bottom-right"))},null,34),e.createElementVNode("div",{class:e.normalizeClass([e.unref(h).e("bottom-left")]),onMousedown:i[3]||(i[3]=n=>I(n,"bottom-left"))},null,34)],6)],64))],2))}});exports.default=ee;
@@ -1,21 +1,21 @@
1
- var A = ($, X, i) => new Promise((L, F) => {
1
+ var A = ($, X, i) => new Promise((L, I) => {
2
2
  var f = (v) => {
3
3
  try {
4
4
  h(i.next(v));
5
5
  } catch (o) {
6
- F(o);
6
+ I(o);
7
7
  }
8
8
  }, b = (v) => {
9
9
  try {
10
10
  h(i.throw(v));
11
11
  } catch (o) {
12
- F(o);
12
+ I(o);
13
13
  }
14
14
  }, h = (v) => v.done ? L(v.value) : Promise.resolve(v.value).then(f, b);
15
15
  h((i = i.apply($, X)).next());
16
16
  });
17
17
  import { defineComponent as ie, ref as W, computed as C, watch as ae, onMounted as oe, nextTick as ue, onUnmounted as ne, openBlock as D, createElementBlock as O, normalizeClass as x, unref as m, toDisplayString as se, Fragment as he, createElementVNode as k, normalizeStyle as ve } from "vue";
18
- import { useNamespace as re } from "../../../packages/hooks/src/use-namespace/index.js";
18
+ import { useNamespace as re } from "../../../dist/hooks/src/use-namespace/index.js";
19
19
  import { useElementSize as G, useDraggable as fe } from "../../../node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.12_typescript@5.6.3_/node_modules/@vueuse/core/index.js";
20
20
  import { useCanvas as ce } from "./composables.js";
21
21
  const de = ["src"], xe = /* @__PURE__ */ ie({
@@ -49,7 +49,7 @@ const de = ["src"], xe = /* @__PURE__ */ ie({
49
49
  },
50
50
  setup($, { expose: X }) {
51
51
  const i = $;
52
- let L = 0, F = 0, f = 0, b = 0;
52
+ let L = 0, I = 0, f = 0, b = 0;
53
53
  const h = re("photo-crop-tool"), v = W(null), o = W(null), B = W(null), S = W(""), r = W(""), Y = W({
54
54
  x: 0,
55
55
  y: 0
@@ -58,7 +58,7 @@ const de = ["src"], xe = /* @__PURE__ */ ie({
58
58
  height: i.defaultHeight,
59
59
  x: 0,
60
60
  y: 0
61
- }), { width: I, height: N } = G(v), { width: J } = G(B), { x: p, y: g, style: K } = fe(v, {
61
+ }), { width: F, height: N } = G(v), { width: J } = G(B), { x: p, y: g, style: K } = fe(v, {
62
62
  containerElement: o,
63
63
  draggingElement: v,
64
64
  disabled: C(() => !!r.value),
@@ -76,7 +76,7 @@ const de = ["src"], xe = /* @__PURE__ */ ie({
76
76
  left: 0,
77
77
  top: 0
78
78
  };
79
- return r.value === "bottom-right" ? (t.left = e.value.x, t.top = e.value.y) : r.value === "top-left" ? (t.left = e.value.x - I.value, t.top = e.value.y - N.value) : r.value === "top-right" ? (t.top = e.value.y - N.value, t.left = e.value.x) : r.value === "bottom-left" && (t.left = e.value.x - I.value, t.top = e.value.y), t;
79
+ return r.value === "bottom-right" ? (t.left = e.value.x, t.top = e.value.y) : r.value === "top-left" ? (t.left = e.value.x - F.value, t.top = e.value.y - N.value) : r.value === "top-right" ? (t.top = e.value.y - N.value, t.left = e.value.x) : r.value === "bottom-left" && (t.left = e.value.x - F.value, t.top = e.value.y), t;
80
80
  }), ee = C(() => {
81
81
  const { aspectRatio: t } = i, l = {
82
82
  width: `${e.value.width || i.defaultWidth}`,
@@ -98,7 +98,7 @@ const de = ["src"], xe = /* @__PURE__ */ ie({
98
98
  const u = document.createElement("canvas");
99
99
  u.width = w(((E = o.value) == null ? void 0 : E.clientWidth) || 0), u.height = w(((M = o.value) == null ? void 0 : M.clientHeight) || 0);
100
100
  const { drawImage: T, cropCanvas: R, drawColor: H } = ce(u);
101
- return H(0, 0, u.width, u.height, l), T(t, w(t.offsetLeft), w(t.offsetTop), t.naturalWidth, t.naturalHeight), yield R(w(p.value), w(g.value), w(I.value), w(N.value));
101
+ return H(0, 0, u.width, u.height, l), T(t, w(t.offsetLeft), w(t.offsetTop), t.naturalWidth, t.naturalHeight), yield R(w(p.value), w(g.value), w(F.value), w(N.value));
102
102
  });
103
103
  }
104
104
  function y(t, l) {
@@ -111,7 +111,7 @@ const de = ["src"], xe = /* @__PURE__ */ ie({
111
111
  }
112
112
  function P(t) {
113
113
  var T, R, H, E, M, _, Q, q;
114
- const l = t.clientX - L, u = t.clientY - F;
114
+ const l = t.clientX - L, u = t.clientY - I;
115
115
  if (r.value === "bottom-right") {
116
116
  if (i.zoomType === "free") {
117
117
  const { width: n, height: a } = y(f + l, b + u);
@@ -159,7 +159,7 @@ const de = ["src"], xe = /* @__PURE__ */ ie({
159
159
  t.preventDefault(), t.stopPropagation();
160
160
  }
161
161
  function U(t, l) {
162
- r.value = l, L = t.clientX, F = t.clientY, f = e.value.width, b = e.value.height, l === "bottom-right" ? (e.value.x = p.value, e.value.y = g.value) : l === "top-left" ? (e.value.x = p.value + I.value, e.value.y = g.value + N.value) : l === "top-right" ? (e.value.x = p.value, e.value.y = g.value + N.value) : l === "bottom-left" && (e.value.x = p.value + I.value, e.value.y = g.value);
162
+ r.value = l, L = t.clientX, I = t.clientY, f = e.value.width, b = e.value.height, l === "bottom-right" ? (e.value.x = p.value, e.value.y = g.value) : l === "top-left" ? (e.value.x = p.value + F.value, e.value.y = g.value + N.value) : l === "top-right" ? (e.value.x = p.value, e.value.y = g.value + N.value) : l === "bottom-left" && (e.value.x = p.value + F.value, e.value.y = g.value);
163
163
  }
164
164
  function V() {
165
165
  r.value = "";
package/types/index.d.ts CHANGED
@@ -1 +1,6 @@
1
- export * from './index'
1
+ import { default as installer } from './src/defaults';
2
+
3
+ export * from './src/components';
4
+ export declare const install: (app: any) => void;
5
+ export declare const version: string;
6
+ export default installer;
File without changes
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,4 @@
1
+ export * from './file-upload/index';
2
+ export * from './fixed-action-bar/index';
3
+ export * from './image-upload/index';
4
+ export * from './photo-crop-tool/index';
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ version: string;
3
+ install: (app: any) => void;
4
+ };
5
+ export default _default;
@@ -0,0 +1,36 @@
1
+ declare const QxsFileUpload: import('../withInstall').SFCWithInstall<import('vue').DefineComponent<{
2
+ action: import('element-plus').UploadProps["action"];
3
+ headers?: import('element-plus').UploadProps["headers"];
4
+ data?: import('element-plus').UploadProps["data"];
5
+ name?: import('element-plus').UploadProps["name"];
6
+ size?: number;
7
+ max?: number;
8
+ accept?: string;
9
+ files?: import('element-plus').UploadUserFile[];
10
+ notip?: boolean;
11
+ ext?: string[];
12
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
+ onSuccess: (...args: any[]) => void;
14
+ }, string, import('vue').PublicProps, Readonly<{
15
+ action: import('element-plus').UploadProps["action"];
16
+ headers?: import('element-plus').UploadProps["headers"];
17
+ data?: import('element-plus').UploadProps["data"];
18
+ name?: import('element-plus').UploadProps["name"];
19
+ size?: number;
20
+ max?: number;
21
+ accept?: string;
22
+ files?: import('element-plus').UploadUserFile[];
23
+ notip?: boolean;
24
+ ext?: string[];
25
+ }> & Readonly<{
26
+ onOnSuccess?: (...args: any[]) => any;
27
+ }>, {
28
+ size: number;
29
+ name: import('element-plus').UploadProps["name"];
30
+ accept: string;
31
+ max: number;
32
+ files: import('element-plus').UploadUserFile[];
33
+ notip: boolean;
34
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>> & Record<string, any>;
35
+ export { QxsFileUpload, };
36
+ export default QxsFileUpload;
@@ -0,0 +1,158 @@
1
+ import { UploadProps, UploadUserFile } from 'element-plus';
2
+
3
+ declare const _default: import('vue').DefineComponent<{
4
+ action: UploadProps["action"];
5
+ headers?: UploadProps["headers"];
6
+ data?: UploadProps["data"];
7
+ name?: UploadProps["name"];
8
+ size?: number;
9
+ max?: number;
10
+ accept?: string;
11
+ files?: UploadUserFile[];
12
+ notip?: boolean;
13
+ ext?: string[];
14
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
15
+ onSuccess: (...args: any[]) => void;
16
+ }, string, import('vue').PublicProps, Readonly<{
17
+ action: UploadProps["action"];
18
+ headers?: UploadProps["headers"];
19
+ data?: UploadProps["data"];
20
+ name?: UploadProps["name"];
21
+ size?: number;
22
+ max?: number;
23
+ accept?: string;
24
+ files?: UploadUserFile[];
25
+ notip?: boolean;
26
+ ext?: string[];
27
+ }> & Readonly<{
28
+ onOnSuccess?: (...args: any[]) => any;
29
+ }>, {
30
+ size: number;
31
+ name: UploadProps["name"];
32
+ accept: string;
33
+ max: number;
34
+ files: UploadUserFile[];
35
+ notip: boolean;
36
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
37
+ export default _default;
38
+ export declare const __VLS_globalTypesStart: {};
39
+ declare global {
40
+ type __VLS_IntrinsicElements = __VLS_PickNotAny<import('vue/jsx-runtime').JSX.IntrinsicElements, __VLS_PickNotAny<globalThis.JSX.IntrinsicElements, Record<string, any>>>;
41
+ type __VLS_Element = __VLS_PickNotAny<import('vue/jsx-runtime').JSX.Element, globalThis.JSX.Element>;
42
+ type __VLS_GlobalComponents = __VLS_PickNotAny<import('vue').GlobalComponents, {}> & __VLS_PickNotAny<import('@vue/runtime-core').GlobalComponents, {}> & __VLS_PickNotAny<import('@vue/runtime-dom').GlobalComponents, {}> & Pick<typeof import('vue'), 'Transition' | 'TransitionGroup' | 'KeepAlive' | 'Suspense' | 'Teleport'>;
43
+ type __VLS_BuiltInPublicProps = __VLS_PickNotAny<import('vue').VNodeProps, {}> & __VLS_PickNotAny<import('vue').AllowedComponentProps, {}> & __VLS_PickNotAny<import('vue').ComponentCustomProps, {}>;
44
+ type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
45
+ type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
46
+ const __VLS_intrinsicElements: __VLS_IntrinsicElements;
47
+ function __VLS_getVForSourceType(source: number): [number, number, number][];
48
+ function __VLS_getVForSourceType(source: string): [string, number, number][];
49
+ function __VLS_getVForSourceType<T extends any[]>(source: T): [
50
+ item: T[number],
51
+ key: number,
52
+ index: number
53
+ ][];
54
+ function __VLS_getVForSourceType<T extends {
55
+ [Symbol.iterator](): Iterator<any>;
56
+ }>(source: T): [
57
+ item: T extends {
58
+ [Symbol.iterator](): Iterator<infer T1>;
59
+ } ? T1 : never,
60
+ key: number,
61
+ index: undefined
62
+ ][];
63
+ function __VLS_getVForSourceType<T extends number | {
64
+ [Symbol.iterator](): Iterator<any>;
65
+ }>(source: T): [
66
+ item: number | (Exclude<T, number> extends {
67
+ [Symbol.iterator](): Iterator<infer T1>;
68
+ } ? T1 : never),
69
+ key: number,
70
+ index: undefined
71
+ ][];
72
+ function __VLS_getVForSourceType<T>(source: T): [
73
+ item: T[keyof T],
74
+ key: keyof T,
75
+ index: number
76
+ ][];
77
+ function __VLS_getSlotParams<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>;
78
+ function __VLS_getSlotParam<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>[0];
79
+ function __VLS_directiveFunction<T>(dir: T): T extends import('vue').ObjectDirective<infer E, infer V> | import('vue').FunctionDirective<infer E, infer V> ? (value: V) => void : T;
80
+ function __VLS_withScope<T, K>(ctx: T, scope: K): ctx is T & K;
81
+ function __VLS_makeOptional<T>(t: T): {
82
+ [K in keyof T]?: T[K];
83
+ };
84
+ type __VLS_SelfComponent<N, C> = string extends N ? {} : N extends string ? {
85
+ [P in N]: C;
86
+ } : {};
87
+ type __VLS_WithComponent<N0 extends string, LocalComponents, N1 extends string, N2 extends string, N3 extends string> = N1 extends keyof LocalComponents ? N1 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
88
+ [K in N0]: LocalComponents[N1];
89
+ } : N2 extends keyof LocalComponents ? N2 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
90
+ [K in N0]: LocalComponents[N2];
91
+ } : N3 extends keyof LocalComponents ? N3 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
92
+ [K in N0]: LocalComponents[N3];
93
+ } : N1 extends keyof __VLS_GlobalComponents ? N1 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
94
+ [K in N0]: __VLS_GlobalComponents[N1];
95
+ } : N2 extends keyof __VLS_GlobalComponents ? N2 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
96
+ [K in N0]: __VLS_GlobalComponents[N2];
97
+ } : N3 extends keyof __VLS_GlobalComponents ? N3 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
98
+ [K in N0]: __VLS_GlobalComponents[N3];
99
+ } : {
100
+ [K in N0]: unknown;
101
+ };
102
+ function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K): T extends new (...args: any) => any ? (props: (K extends {
103
+ $props: infer Props;
104
+ } ? Props : any) & Record<string, unknown>, ctx?: any) => __VLS_Element & {
105
+ __ctx?: {
106
+ attrs?: any;
107
+ slots?: K extends {
108
+ $slots: infer Slots;
109
+ } ? Slots : any;
110
+ emit?: K extends {
111
+ $emit: infer Emit;
112
+ } ? Emit : any;
113
+ } & {
114
+ props?: (K extends {
115
+ $props: infer Props;
116
+ } ? Props : any) & Record<string, unknown>;
117
+ expose?(exposed: K): void;
118
+ };
119
+ } : T extends () => any ? (props: {}, ctx?: any) => ReturnType<T> : T extends (...args: any) => any ? T : (_: {} & Record<string, unknown>, ctx?: any) => {
120
+ __ctx?: {
121
+ attrs?: any;
122
+ expose?: any;
123
+ slots?: any;
124
+ emit?: any;
125
+ props?: {} & Record<string, unknown>;
126
+ };
127
+ };
128
+ function __VLS_elementAsFunction<T>(tag: T, endTag?: T): (_: T & Record<string, unknown>) => void;
129
+ function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): Parameters<T>['length'] extends 2 ? [any] : [];
130
+ function __VLS_pickFunctionalComponentCtx<T, K>(comp: T, compInstance: K): __VLS_PickNotAny<'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends {
131
+ __ctx?: infer Ctx;
132
+ } ? Ctx : never : any, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any>;
133
+ type __VLS_FunctionalComponentProps<T, K> = '__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends {
134
+ __ctx?: {
135
+ props?: infer P;
136
+ };
137
+ } ? NonNullable<P> : never : T extends (props: infer P, ...args: any) => any ? P : {};
138
+ type __VLS_AsFunctionOrAny<F> = unknown extends F ? any : ((...args: any) => any) extends F ? F : any;
139
+ function __VLS_normalizeSlot<S>(s: S): S extends () => infer R ? (props: {}) => R : S;
140
+ /**
141
+ * emit
142
+ */
143
+ type __VLS_UnionToIntersection<U> = (U extends unknown ? (arg: U) => unknown : never) extends ((arg: infer P) => unknown) ? P : never;
144
+ type __VLS_OverloadUnionInner<T, U = unknown> = U & T extends (...args: infer A) => infer R ? U extends T ? never : __VLS_OverloadUnionInner<T, Pick<T, keyof T> & U & ((...args: A) => R)> | ((...args: A) => R) : never;
145
+ type __VLS_OverloadUnion<T> = Exclude<__VLS_OverloadUnionInner<(() => never) & T>, T extends () => never ? never : () => never>;
146
+ type __VLS_ConstructorOverloads<T> = __VLS_OverloadUnion<T> extends infer F ? F extends (event: infer E, ...args: infer A) => any ? {
147
+ [K in E & string]: (...args: A) => void;
148
+ } : never : never;
149
+ type __VLS_NormalizeEmits<T> = __VLS_PrettifyGlobal<__VLS_UnionToIntersection<__VLS_ConstructorOverloads<T> & {
150
+ [K in keyof T]: T[K] extends any[] ? {
151
+ (...args: T[K]): void;
152
+ } : never;
153
+ }>>;
154
+ type __VLS_PrettifyGlobal<T> = {
155
+ [K in keyof T]: T[K];
156
+ } & {};
157
+ }
158
+ export declare const __VLS_globalTypesEnd: {};
@@ -0,0 +1,40 @@
1
+ declare const QxsFixedActionBar: import('../withInstall').SFCWithInstall<{
2
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
3
+ padding: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
8
+ padding: string;
9
+ }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
10
+ P: {};
11
+ B: {};
12
+ D: {};
13
+ C: {};
14
+ M: {};
15
+ Defaults: {};
16
+ }, Readonly<import('vue').ExtractPropTypes<{
17
+ padding: {
18
+ type: StringConstructor;
19
+ default: string;
20
+ };
21
+ }>> & Readonly<{}>, {}, {}, {}, {}, {
22
+ padding: string;
23
+ }>;
24
+ __isFragment?: never;
25
+ __isTeleport?: never;
26
+ __isSuspense?: never;
27
+ } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
28
+ padding: {
29
+ type: StringConstructor;
30
+ default: string;
31
+ };
32
+ }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
33
+ padding: string;
34
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
35
+ $slots: {
36
+ default?(_: {}): any;
37
+ };
38
+ })> & Record<string, any>;
39
+ export { QxsFixedActionBar, };
40
+ export default QxsFixedActionBar;
@@ -0,0 +1,23 @@
1
+ declare function __VLS_template(): {
2
+ default?(_: {}): any;
3
+ };
4
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
5
+ padding: {
6
+ type: StringConstructor;
7
+ default: string;
8
+ };
9
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
10
+ padding: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
14
+ }>> & Readonly<{}>, {
15
+ padding: string;
16
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
17
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
18
+ export default _default;
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,46 @@
1
+ declare const QxsImageUpload: import('../withInstall').SFCWithInstall<import('vue').DefineComponent<{
2
+ action: import('element-plus').UploadProps["action"];
3
+ headers?: import('element-plus').UploadProps["headers"];
4
+ data?: import('element-plus').UploadProps["data"];
5
+ name?: import('element-plus').UploadProps["name"];
6
+ url?: string;
7
+ size?: number;
8
+ width?: number;
9
+ accept?: string;
10
+ height?: number;
11
+ placeholder?: string;
12
+ notip?: boolean;
13
+ tipText?: string;
14
+ beforeUpload?: import('element-plus').UploadProps["beforeUpload"];
15
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
16
+ onSuccess: (res: any, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
17
+ "update:url": (url: string) => void;
18
+ }, string, import('vue').PublicProps, Readonly<{
19
+ action: import('element-plus').UploadProps["action"];
20
+ headers?: import('element-plus').UploadProps["headers"];
21
+ data?: import('element-plus').UploadProps["data"];
22
+ name?: import('element-plus').UploadProps["name"];
23
+ url?: string;
24
+ size?: number;
25
+ width?: number;
26
+ accept?: string;
27
+ height?: number;
28
+ placeholder?: string;
29
+ notip?: boolean;
30
+ tipText?: string;
31
+ beforeUpload?: import('element-plus').UploadProps["beforeUpload"];
32
+ }> & Readonly<{
33
+ onOnSuccess?: (res: any, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => any;
34
+ "onUpdate:url"?: (url: string) => any;
35
+ }>, {
36
+ size: number;
37
+ name: import('element-plus').UploadProps["name"];
38
+ accept: string;
39
+ url: string;
40
+ notip: boolean;
41
+ height: number;
42
+ width: number;
43
+ placeholder: string;
44
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>> & Record<string, any>;
45
+ export { QxsImageUpload, };
46
+ export default QxsImageUpload;
@@ -0,0 +1,47 @@
1
+ import { UploadFile, UploadFiles, UploadProps } from 'element-plus';
2
+
3
+ declare const _default: import('vue').DefineComponent<{
4
+ action: UploadProps["action"];
5
+ headers?: UploadProps["headers"];
6
+ data?: UploadProps["data"];
7
+ name?: UploadProps["name"];
8
+ url?: string;
9
+ size?: number;
10
+ width?: number;
11
+ accept?: string;
12
+ height?: number;
13
+ placeholder?: string;
14
+ notip?: boolean;
15
+ tipText?: string;
16
+ beforeUpload?: UploadProps["beforeUpload"];
17
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
18
+ onSuccess: (res: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;
19
+ "update:url": (url: string) => void;
20
+ }, string, import('vue').PublicProps, Readonly<{
21
+ action: UploadProps["action"];
22
+ headers?: UploadProps["headers"];
23
+ data?: UploadProps["data"];
24
+ name?: UploadProps["name"];
25
+ url?: string;
26
+ size?: number;
27
+ width?: number;
28
+ accept?: string;
29
+ height?: number;
30
+ placeholder?: string;
31
+ notip?: boolean;
32
+ tipText?: string;
33
+ beforeUpload?: UploadProps["beforeUpload"];
34
+ }> & Readonly<{
35
+ onOnSuccess?: (res: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => any;
36
+ "onUpdate:url"?: (url: string) => any;
37
+ }>, {
38
+ size: number;
39
+ name: UploadProps["name"];
40
+ accept: string;
41
+ url: string;
42
+ notip: boolean;
43
+ height: number;
44
+ width: number;
45
+ placeholder: string;
46
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
47
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { Plugin } from 'vue';
2
+
3
+ declare function makeInstaller(components: {
4
+ [key: number]: Plugin;
5
+ }): {
6
+ version: string;
7
+ install: (app: any) => void;
8
+ };
9
+ export { makeInstaller };
@@ -0,0 +1,54 @@
1
+ declare const QxsPhotoCropTool: import('../withInstall').SFCWithInstall<import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
+ imgFile: {
3
+ type: import('vue').PropType<File>;
4
+ default: () => any;
5
+ };
6
+ aspectRatio: {
7
+ type: StringConstructor;
8
+ default: () => string;
9
+ };
10
+ defaultWidth: {
11
+ type: NumberConstructor;
12
+ default: () => number;
13
+ };
14
+ defaultHeight: {
15
+ type: NumberConstructor;
16
+ default: () => number;
17
+ };
18
+ zoomType: {
19
+ type: StringConstructor;
20
+ default: () => string;
21
+ };
22
+ }>, {
23
+ crop: (img?: HTMLImageElement) => Promise<File>;
24
+ resize: () => void;
25
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
26
+ imgFile: {
27
+ type: import('vue').PropType<File>;
28
+ default: () => any;
29
+ };
30
+ aspectRatio: {
31
+ type: StringConstructor;
32
+ default: () => string;
33
+ };
34
+ defaultWidth: {
35
+ type: NumberConstructor;
36
+ default: () => number;
37
+ };
38
+ defaultHeight: {
39
+ type: NumberConstructor;
40
+ default: () => number;
41
+ };
42
+ zoomType: {
43
+ type: StringConstructor;
44
+ default: () => string;
45
+ };
46
+ }>> & Readonly<{}>, {
47
+ imgFile: File;
48
+ aspectRatio: string;
49
+ defaultWidth: number;
50
+ defaultHeight: number;
51
+ zoomType: string;
52
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>> & Record<string, any>;
53
+ export { QxsPhotoCropTool, };
54
+ export default QxsPhotoCropTool;
@@ -0,0 +1,6 @@
1
+ export declare function useCanvas(canvasElement: HTMLCanvasElement): {
2
+ clearCanvas: () => void;
3
+ drawColor: (x: number, y: number, width: number, height: number, color: string) => void;
4
+ drawImage: (image: HTMLImageElement, x: number, y: number, width: number, height: number) => void;
5
+ cropCanvas: (x: number, y: number, width: number, height: number) => Promise<File | null>;
6
+ };
@@ -0,0 +1,65 @@
1
+ import { PropType } from 'vue';
2
+
3
+ declare function crop(img?: HTMLImageElement): Promise<File>;
4
+ declare function resize(): void;
5
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
6
+ imgFile: {
7
+ type: PropType<File>;
8
+ default: () => any;
9
+ };
10
+ aspectRatio: {
11
+ type: StringConstructor;
12
+ default: () => string;
13
+ };
14
+ defaultWidth: {
15
+ type: NumberConstructor;
16
+ default: () => number;
17
+ };
18
+ defaultHeight: {
19
+ type: NumberConstructor;
20
+ default: () => number;
21
+ };
22
+ /**
23
+ * free 自由缩放
24
+ * fixed 固定比例缩放
25
+ */
26
+ zoomType: {
27
+ type: StringConstructor;
28
+ default: () => string;
29
+ };
30
+ }>, {
31
+ crop: typeof crop;
32
+ resize: typeof resize;
33
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
34
+ imgFile: {
35
+ type: PropType<File>;
36
+ default: () => any;
37
+ };
38
+ aspectRatio: {
39
+ type: StringConstructor;
40
+ default: () => string;
41
+ };
42
+ defaultWidth: {
43
+ type: NumberConstructor;
44
+ default: () => number;
45
+ };
46
+ defaultHeight: {
47
+ type: NumberConstructor;
48
+ default: () => number;
49
+ };
50
+ /**
51
+ * free 自由缩放
52
+ * fixed 固定比例缩放
53
+ */
54
+ zoomType: {
55
+ type: StringConstructor;
56
+ default: () => string;
57
+ };
58
+ }>> & Readonly<{}>, {
59
+ imgFile: File;
60
+ aspectRatio: string;
61
+ defaultWidth: number;
62
+ defaultHeight: number;
63
+ zoomType: string;
64
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
65
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const QxsRichEditor: import('../withInstall').SFCWithInstall<import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>> & Record<string, any>;
2
+ export { QxsRichEditor, };
3
+ export default QxsRichEditor;
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { Plugin } from 'vue';
2
+
3
+ export type SFCWithInstall<T> = T & Plugin;
4
+ export declare function withInstall<T, E extends Record<string, any>>(main: T, extra?: E): SFCWithInstall<T> & E;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),m="qxs",i="is-";function c(t,o,a,v,p){let u=`${t}-${o}`;return a&&(u+=`-${a}`),v&&(u+=`__${v}`),p&&(u+=`--${p}`),u}const $=Symbol("namespaceContextKey");function N(t){const o=r.getCurrentInstance()?r.inject($,r.ref(m)):r.ref(m);return r.computed(()=>r.unref(o)||m)}function y(t,o){const a=N();return{namespace:a,b:(e="")=>c(a.value,t,e,"",""),e:e=>e?c(a.value,t,"",e,""):"",m:e=>e?c(a.value,t,"","",e):"",be:(e,s)=>e&&s?c(a.value,t,e,s,""):"",em:(e,s)=>e&&s?c(a.value,t,"",e,s):"",bm:(e,s)=>e&&s?c(a.value,t,e,"",s):"",bem:(e,s,n)=>e&&s&&n?c(a.value,t,e,s,n):"",is:(e,...s)=>{const n=s.length>=1?s[0]:!0;return e&&n?`${i}${e}`:""},cssVar:e=>{const s={};for(const n in e)e[n]&&(s[`--${a.value}-${n}`]=e[n]);return s},cssVarName:e=>`--${a.value}-${e}`,cssVarBlock:e=>{const s={};for(const n in e)e[n]&&(s[`--${a.value}-${t}-${n}`]=e[n]);return s},cssVarBlockName:e=>`--${a.value}-${t}-${e}`}}exports.defaultNamespace=m;exports.namespaceContextKey=$;exports.useGetDerivedNamespace=N;exports.useNamespace=y;
@@ -1,49 +0,0 @@
1
- import { getCurrentInstance as p, inject as N, ref as v, computed as V, unref as y } from "vue";
2
- const $ = "qxs", i = "is-";
3
- function c(n, u, a, o, m) {
4
- let r = `${n}-${u}`;
5
- return a && (r += `-${a}`), o && (r += `__${o}`), m && (r += `--${m}`), r;
6
- }
7
- const l = Symbol("namespaceContextKey");
8
- function B(n) {
9
- const u = p() ? N(l, v($)) : v($);
10
- return V(() => y(u) || $);
11
- }
12
- function D(n, u) {
13
- const a = B();
14
- return {
15
- namespace: a,
16
- b: (s = "") => c(a.value, n, s, "", ""),
17
- e: (s) => s ? c(a.value, n, "", s, "") : "",
18
- m: (s) => s ? c(a.value, n, "", "", s) : "",
19
- be: (s, e) => s && e ? c(a.value, n, s, e, "") : "",
20
- em: (s, e) => s && e ? c(a.value, n, "", s, e) : "",
21
- bm: (s, e) => s && e ? c(a.value, n, s, "", e) : "",
22
- bem: (s, e, t) => s && e && t ? c(a.value, n, s, e, t) : "",
23
- is: (s, ...e) => {
24
- const t = e.length >= 1 ? e[0] : !0;
25
- return s && t ? `${i}${s}` : "";
26
- },
27
- // css
28
- cssVar: (s) => {
29
- const e = {};
30
- for (const t in s)
31
- s[t] && (e[`--${a.value}-${t}`] = s[t]);
32
- return e;
33
- },
34
- cssVarName: (s) => `--${a.value}-${s}`,
35
- cssVarBlock: (s) => {
36
- const e = {};
37
- for (const t in s)
38
- s[t] && (e[`--${a.value}-${n}-${t}`] = s[t]);
39
- return e;
40
- },
41
- cssVarBlockName: (s) => `--${a.value}-${n}-${s}`
42
- };
43
- }
44
- export {
45
- $ as defaultNamespace,
46
- l as namespaceContextKey,
47
- B as useGetDerivedNamespace,
48
- D as useNamespace
49
- };