prlg-ui 1.8.78 → 1.8.80
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.
- package/dist/Image-Be4KWSej.cjs +1 -0
- package/dist/{Image-Dg-dDZPv.js → Image-wxPggg1a.js} +21 -23
- package/dist/blocks/index.cjs.js +1 -1
- package/dist/blocks/index.es.js +1 -1
- package/dist/eventBus.util-DHau4P1p.cjs +1 -0
- package/dist/{eventBus.util-Bl8G4ISe.js → eventBus.util-DqT24MxP.js} +8 -8
- package/dist/index.d.ts +1 -2
- package/dist/prlg-ui.cjs.js +1 -1
- package/dist/prlg-ui.css +1 -1
- package/dist/prlg-ui.es.js +4 -4
- package/dist/utils/index.cjs.js +1 -1
- package/dist/utils/index.es.js +1 -1
- package/dist/utils/useBodyScroll.util.ts +6 -6
- package/package.json +1 -1
- package/dist/Image-BCwUQuQH.cjs +0 -1
- package/dist/eventBus.util-D6hW1PTE.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),d=require("./FileIcon-BE4ItwkK.cjs"),g=require("./parseFileSize.util-Bg1rLRLQ.cjs");function y(t){return t.startsWith("image/")?"image":t==="application/pdf"?"pdf":t==="application/msword"||t==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"?"word":t==="application/vnd.ms-excel"||t==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?"excel":"other"}const B={key:1,class:"file__title"},I={key:2,class:"file__info"},E={key:0,class:"file__type"},z={key:1,class:"file__info-separator"},V={key:2,class:"file__size"},C=e.defineComponent({__name:"File",props:{file:{},viewName:{type:Boolean,default:!1},outlined:{type:Boolean,default:!0},removable:{type:Boolean}},emits:["remove"],setup(t,{emit:a}){const l=a,s=e.useId(),o=e.ref(null);async function i(r,c="image"){const m=await(await fetch(r)).blob(),v=m.type.split("/")[1]||"",h=v?`${c}.${v}`:c;return new File([m],h,{type:m.type})}const n=e.computed(()=>o.value&&o.value.mime?y(o.value.mime):null),u=e.computed(()=>{switch(n.value){case"pdf":return d.PdfIcon;case"word":return d.WordIcon;case"excel":return d.ExcelIcon;case"other":default:return d.FileIcon}});return e.onMounted(async()=>{if(typeof t.file=="string"){const r=await i(t.file);o.value={id:s,url:t.file,name:r.name,mime:r.type,size:r.size}}else o.value=t.file}),(r,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["file",{"file--outlined":r.outlined}])},[r.removable&&typeof r.file!="string"?(e.openBlock(),e.createElementBlock("button",{key:0,class:"file__remove",onClick:c[0]||(c[0]=f=>l("remove",r.file))},[e.createVNode(e.unref(d.CloseIcon))])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value),{class:"file__icon"})),o.value&&o.value.name&&r.viewName?(e.openBlock(),e.createElementBlock("div",B,e.toDisplayString(o.value?o.value.name.split(".")[0]:"unknown"),1)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",I,[o.value.mime?(e.openBlock(),e.createElementBlock("div",E,e.toDisplayString(n.value),1)):e.createCommentVNode("",!0),o.value.mime&&o.value.size?(e.openBlock(),e.createElementBlock("div",z)):e.createCommentVNode("",!0),o.value.size?(e.openBlock(),e.createElementBlock("div",V,e.toDisplayString(o.value?e.unref(g.formatFileSize)(o.value.size):"0 Б"),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),N=d._export_sfc(C,[["__scopeId","data-v-9dee864d"]]);class w{stack=[];baseZIndex={confirm:1400,modal:1300,drawer:1200,popover:1100,tooltip:1e3};step=10;childStep=1;idCounter=0;listeners=new Set;subscribe(a){return this.listeners.add(a),()=>this.listeners.delete(a)}notify(){this.listeners.forEach(a=>a())}register(a,l){const s=++this.idCounter,o=l?this.stack.find(u=>u.id===l):void 0;let i;if(o)i=o.zIndex+this.childStep;else{const u=this.stack.filter(c=>c.type===a&&!c.parentId);i=(u.length?Math.max(...u.map(c=>c.zIndex)):this.baseZIndex[a])+this.step}const n={id:s,type:a,parentId:l??null,zIndex:i};return this.stack.push(n),this.notify(),n}unregister(a){this.stack=this.stack.filter(l=>l.id!==a),this.notify()}getTop(){return this.stack.length?this.stack[this.stack.length-1]:null}isTop(a){return this.getTop()?.id===a}getStack(){return[...this.stack]}}const p=new w,k=Symbol("OVERLAY_PARENT");function _(t){const a=e.inject(k,null),l=e.ref(null);return e.onMounted(()=>{l.value=p.register(t,a??null),l.value&&e.provide(k,l.value.id)}),e.onUnmounted(()=>{l.value&&p.unregister(l.value.id)}),{zIndex:l,isTop:()=>l.value?p.isTop(l.value.id):!1}}const F={class:"image-full-modal__wrapper"},b={class:"image-full-modal__header"},S={class:"image-full-modal__main"},$=["src","alt"],x=e.defineComponent({__name:"ImageFullModal",props:{src:{},alt:{}},setup(t,{expose:a}){const l=e.ref(!1),{zIndex:s}=_("modal");return a({open:()=>{l.value=!0},close:()=>{l.value=!1}}),(o,i)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"image-full-modal",style:e.normalizeStyle({zIndex:e.unref(s)?.zIndex})},[e.createElementVNode("div",{class:"image-full-modal__overlay",onClick:i[0]||(i[0]=n=>l.value=!1)}),e.createElementVNode("div",F,[e.createElementVNode("div",b,[e.createElementVNode("button",{class:"image-full-modal__close",onClick:i[1]||(i[1]=n=>l.value=!1)},[e.createVNode(e.unref(d.CloseIcon))])]),e.createElementVNode("div",S,[e.createElementVNode("img",{src:o.src,alt:o.alt},null,8,$)]),i[2]||(i[2]=e.createElementVNode("div",{class:"image-full-modal__footer"},null,-1))])],4)):e.createCommentVNode("",!0)]),_:1})]))}}),M=d._export_sfc(x,[["__scopeId","data-v-b9bc03dd"]]),O=["src","alt"],T={key:1,class:"image__info"},R={key:0,class:"image__size"},D=e.defineComponent({__name:"Image",props:{file:{},alt:{},size:{default:"medium"},fullScreen:{type:Boolean},viewInfo:{type:Boolean,default:!1}},setup(t){const a=e.useId(),l=e.useTemplateRef("imageFullModal"),s=e.ref(null);async function o(n,u="image"){const c=await(await fetch(n)).blob(),f=c.type.split("/")[1]||"",m=f?`${u}.${f}`:u;return new File([c],m,{type:c.type})}const i=e.computed(()=>typeof t.file=="string"?t.file:t.file.url);return e.onMounted(async()=>{if(t.viewInfo)if(typeof t.file=="string"){const n=await o(t.file);s.value={id:a,url:t.file,name:n.name,mime:n.type,size:n.size}}else s.value=t.file}),(n,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["image",`image--${n.size}`,{"image--full-screen":n.fullScreen}])},[n.fullScreen?(e.openBlock(),e.createElementBlock("div",{key:0,class:"image__overlay",onClick:u[0]||(u[0]=r=>l.value?.open())},[e.createVNode(e.unref(d.EyeIcon))])):e.createCommentVNode("",!0),e.createElementVNode("img",{src:i.value,alt:n.alt},null,8,O),n.viewInfo&&s.value&&(s.value.mime||s.value.size)&&n.size==="large"?(e.openBlock(),e.createElementBlock("div",T,[s.value.size?(e.openBlock(),e.createElementBlock("div",R,e.toDisplayString(s.value?e.unref(g.formatFileSize)(s.value.size):"0 Б"),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2),n.fullScreen?(e.openBlock(),e.createBlock(M,{key:0,ref:"imageFullModal",src:i.value,alt:n.alt},null,8,["src","alt"])):e.createCommentVNode("",!0)],64))}}),A=d._export_sfc(D,[["__scopeId","data-v-cc14d604"]]);exports.File=N;exports.Image=A;exports.getFileTypeByMime=y;exports.useOverlay=_;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as z, useId as
|
|
1
|
+
import { defineComponent as z, useId as C, ref as h, computed as I, onMounted as w, createElementBlock as d, openBlock as n, normalizeClass as x, createCommentVNode as f, createBlock as b, createVNode as _, unref as v, resolveDynamicComponent as O, toDisplayString as y, inject as T, provide as V, onUnmounted as R, Teleport as N, Transition as A, withCtx as P, normalizeStyle as Z, createElementVNode as m, useTemplateRef as j, Fragment as W } from "vue";
|
|
2
2
|
import { F as Y, E as D, W as L, P as K, C as E, _ as F, a as U } from "./FileIcon-maHE2Nhr.js";
|
|
3
3
|
import { f as M } from "./parseFileSize.util-CxVk4CvB.js";
|
|
4
4
|
function q(e) {
|
|
@@ -29,12 +29,12 @@ const G = {
|
|
|
29
29
|
},
|
|
30
30
|
emits: ["remove"],
|
|
31
31
|
setup(e, { emit: a }) {
|
|
32
|
-
const t = a, o =
|
|
32
|
+
const t = a, o = C(), l = h(null);
|
|
33
33
|
async function i(r, u = "image") {
|
|
34
34
|
const p = await (await fetch(r)).blob(), $ = p.type.split("/")[1] || "", B = $ ? `${u}.${$}` : u;
|
|
35
35
|
return new File([p], B, { type: p.type });
|
|
36
36
|
}
|
|
37
|
-
const s =
|
|
37
|
+
const s = I(() => l.value && l.value.mime ? q(l.value.mime) : null), c = I(() => {
|
|
38
38
|
switch (s.value) {
|
|
39
39
|
case "pdf":
|
|
40
40
|
return K;
|
|
@@ -60,7 +60,7 @@ const G = {
|
|
|
60
60
|
} else
|
|
61
61
|
l.value = e.file;
|
|
62
62
|
}), (r, u) => (n(), d("div", {
|
|
63
|
-
class:
|
|
63
|
+
class: x(["file", { "file--outlined": r.outlined }])
|
|
64
64
|
}, [
|
|
65
65
|
r.removable && typeof r.file != "string" ? (n(), d("button", {
|
|
66
66
|
key: 0,
|
|
@@ -69,7 +69,7 @@ const G = {
|
|
|
69
69
|
}, [
|
|
70
70
|
_(v(E))
|
|
71
71
|
])) : f("", !0),
|
|
72
|
-
(n(), b(
|
|
72
|
+
(n(), b(O(c.value), { class: "file__icon" })),
|
|
73
73
|
l.value && l.value.name && r.viewName ? (n(), d("div", G, y(l.value ? l.value.name.split(".")[0] : "unknown"), 1)) : f("", !0),
|
|
74
74
|
l.value ? (n(), d("div", H, [
|
|
75
75
|
l.value.mime ? (n(), d("div", J, y(s.value), 1)) : f("", !0),
|
|
@@ -125,16 +125,16 @@ class te {
|
|
|
125
125
|
return [...this.stack];
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
const
|
|
128
|
+
const k = new te(), S = Symbol("OVERLAY_PARENT");
|
|
129
129
|
function le(e) {
|
|
130
|
-
const a =
|
|
130
|
+
const a = T(S, null), t = h(null);
|
|
131
131
|
return w(() => {
|
|
132
|
-
t.value =
|
|
133
|
-
}),
|
|
134
|
-
t.value &&
|
|
132
|
+
t.value = k.register(e, a ?? null), t.value && V(S, t.value.id);
|
|
133
|
+
}), R(() => {
|
|
134
|
+
t.value && k.unregister(t.value.id);
|
|
135
135
|
}), {
|
|
136
136
|
zIndex: t,
|
|
137
|
-
isTop: () => t.value ?
|
|
137
|
+
isTop: () => t.value ? k.isTop(t.value.id) : !1
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
const se = { class: "image-full-modal__wrapper" }, ae = { class: "image-full-modal__header" }, ie = { class: "image-full-modal__main" }, ne = ["src", "alt"], oe = /* @__PURE__ */ z({
|
|
@@ -152,9 +152,9 @@ const se = { class: "image-full-modal__wrapper" }, ae = { class: "image-full-mod
|
|
|
152
152
|
close: () => {
|
|
153
153
|
t.value = !1;
|
|
154
154
|
}
|
|
155
|
-
}), (l, i) => (n(), b(
|
|
156
|
-
_(
|
|
157
|
-
default:
|
|
155
|
+
}), (l, i) => (n(), b(N, { to: "body" }, [
|
|
156
|
+
_(A, { name: "fade" }, {
|
|
157
|
+
default: P(() => [
|
|
158
158
|
t.value ? (n(), d("div", {
|
|
159
159
|
key: 0,
|
|
160
160
|
class: "image-full-modal",
|
|
@@ -200,16 +200,15 @@ const se = { class: "image-full-modal__wrapper" }, ae = { class: "image-full-mod
|
|
|
200
200
|
alt: {},
|
|
201
201
|
size: { default: "medium" },
|
|
202
202
|
fullScreen: { type: Boolean },
|
|
203
|
-
viewInfo: { type: Boolean, default: !1 }
|
|
204
|
-
zIndexPreview: { default: 1002 }
|
|
203
|
+
viewInfo: { type: Boolean, default: !1 }
|
|
205
204
|
},
|
|
206
205
|
setup(e) {
|
|
207
|
-
const a =
|
|
206
|
+
const a = C(), t = j("imageFullModal"), o = h(null);
|
|
208
207
|
async function l(s, c = "image") {
|
|
209
208
|
const u = await (await fetch(s)).blob(), g = u.type.split("/")[1] || "", p = g ? `${c}.${g}` : c;
|
|
210
209
|
return new File([u], p, { type: u.type });
|
|
211
210
|
}
|
|
212
|
-
const i =
|
|
211
|
+
const i = I(() => typeof e.file == "string" ? e.file : e.file.url);
|
|
213
212
|
return w(async () => {
|
|
214
213
|
if (e.viewInfo)
|
|
215
214
|
if (typeof e.file == "string") {
|
|
@@ -225,7 +224,7 @@ const se = { class: "image-full-modal__wrapper" }, ae = { class: "image-full-mod
|
|
|
225
224
|
o.value = e.file;
|
|
226
225
|
}), (s, c) => (n(), d(W, null, [
|
|
227
226
|
m("div", {
|
|
228
|
-
class:
|
|
227
|
+
class: x(["image", `image--${s.size}`, { "image--full-screen": s.fullScreen }])
|
|
229
228
|
}, [
|
|
230
229
|
s.fullScreen ? (n(), d("div", {
|
|
231
230
|
key: 0,
|
|
@@ -246,12 +245,11 @@ const se = { class: "image-full-modal__wrapper" }, ae = { class: "image-full-mod
|
|
|
246
245
|
key: 0,
|
|
247
246
|
ref: "imageFullModal",
|
|
248
247
|
src: i.value,
|
|
249
|
-
alt: s.alt
|
|
250
|
-
|
|
251
|
-
}, null, 8, ["src", "alt", "zIndexPreview"])) : f("", !0)
|
|
248
|
+
alt: s.alt
|
|
249
|
+
}, null, 8, ["src", "alt"])) : f("", !0)
|
|
252
250
|
], 64));
|
|
253
251
|
}
|
|
254
|
-
}), ye = /* @__PURE__ */ F(fe, [["__scopeId", "data-v-
|
|
252
|
+
}), ye = /* @__PURE__ */ F(fe, [["__scopeId", "data-v-cc14d604"]]);
|
|
255
253
|
export {
|
|
256
254
|
ge as F,
|
|
257
255
|
ye as I,
|
package/dist/blocks/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("../Image-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("../Image-Be4KWSej.cjs"),f=require("../FileIcon-BE4ItwkK.cjs"),m=require("../SendIcon-CH6S0QWh.cjs"),p=require("../parseFileSize.util-Bg1rLRLQ.cjs"),_=require("../uploadFile.util-DCFkx3w3.cjs"),v={class:"chat-file__content"},h=e.defineComponent({__name:"ChatFile",props:{file:{}},emits:["deleteFile"],setup(s,{emit:n}){const i=n,r=e.computed(()=>URL.createObjectURL(s.file));return(t,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["chat-file",{"chat-file--image":e.unref(u.getFileTypeByMime)(t.file.type)==="image"}])},[e.createElementVNode("button",{class:"chat-file__delete",onClick:c[0]||(c[0]=l=>i("deleteFile",t.file))},[e.createVNode(e.unref(f.CloseIcon))]),e.createElementVNode("div",v,[e.unref(u.getFileTypeByMime)(t.file.type)==="image"?(e.openBlock(),e.createBlock(e.unref(u.Image),{key:0,file:r.value,size:"large",fullScreen:""},null,8,["file"])):(e.openBlock(),e.createBlock(e.unref(u.File),{key:1,file:r.value,outlined:!1},null,8,["file"]))])],2))}}),k=f._export_sfc(h,[["__scopeId","data-v-25ab2b0f"]]),g={class:"chat-field-actions"},B={ref:"overlay",class:"chat-field-actions__overlay"},y=["onClick"],b={class:"chat-field-actions__overlay-item__label"},C=["disabled"],V=e.defineComponent({__name:"ChatFieldActions",props:e.mergeModels({actions:{},disabled:{type:Boolean,default:!1},multiple:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(s){const n=e.useModel(s,"modelValue"),i=e.useTemplateRef("button"),r=e.useTemplateRef("overlay"),t=e.ref(!1),c=e.reactive({image:{icon:e.shallowRef(m.ImageIcon),label:"Добавить изображение"},file:{icon:e.shallowRef(f.FileIcon),label:"Добавить файл"}}),l=a=>{_.openFileDialog({accept:a==="image"?["image"]:["pdf","excel","word"],maxFileSize:"5mb",maxFiles:1}).then(o=>{n.value?n.value=s.multiple?[...n.value,...o]:o:n.value=[...o],t.value=!1})};return e.onMounted(()=>{p.onClickOutside(r.value,()=>{t.value=!1},{ignore:[i.value]})}),(a,o)=>(e.openBlock(),e.createElementBlock("div",g,[e.createVNode(e.Transition,{name:"slide-up"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",B,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.actions,d=>(e.openBlock(),e.createElementBlock("div",{class:"chat-field-actions__overlay-item",key:d,onClick:D=>l(d)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c[d].icon),{class:"chat-field-actions__overlay-item__icon"})),e.createElementVNode("span",b,e.toDisplayString(c[d].label),1)],8,y))),128))],512),[[e.vShow,t.value]])]),_:1}),e.createElementVNode("button",{ref:"button",onClick:o[0]||(o[0]=d=>t.value=!t.value),class:e.normalizeClass(["chat-field-actions__button",{"chat-field-actions__button--active":t.value}]),disabled:a.disabled},[e.createVNode(e.unref(m.PlusRoundedIcon))],10,C)]))}}),F=f._export_sfc(V,[["__scopeId","data-v-e64085d6"]]),E={class:"chat-field"},N={key:0,class:"chat-field__files"},M={class:"chat-field__wrapper"},T=["maxlength","placeholder"],S={key:1,class:"chat-field__footer"},$={key:1,class:"chat-field__char-count"},I=e.defineComponent({__name:"ChatField",props:e.mergeModels({viewActions:{type:Boolean,default:!1},actions:{default:()=>["file","image"]},placeholder:{default:"Введите сообщение"},maxLength:{},smallText:{},error:{type:Boolean},errorText:{},disabled:{type:Boolean,default:!1}},{message:{required:!0},messageModifiers:{},files:{},filesModifiers:{}}),emits:e.mergeModels(["sendMessage"],["update:message","update:files"]),setup(s,{emit:n}){const i=n,r=e.useModel(s,"message"),t=e.useModel(s,"files"),c=l=>{t.value&&(t.value=t.value.filter(a=>a.name!==l.name))};return(l,a)=>(e.openBlock(),e.createElementBlock("div",E,[t.value&&t.value.length>0?(e.openBlock(),e.createElementBlock("div",N,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,o=>(e.openBlock(),e.createBlock(k,{key:o.name,file:o,onDeleteFile:c},null,8,["file"]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",M,[l.viewActions&&l.actions.length>0?(e.openBlock(),e.createBlock(F,{key:0,modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=o=>t.value=o),actions:l.actions,disabled:l.disabled},null,8,["modelValue","actions","disabled"])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":a[1]||(a[1]=o=>r.value=o),class:"chat-field__input",maxlength:l.maxLength,placeholder:l.placeholder},null,8,T),[[e.vModelText,r.value]]),e.createElementVNode("button",{class:"chat-field__button",onClick:a[2]||(a[2]=o=>i("sendMessage"))},[e.createVNode(e.unref(m.SendIcon))])]),l.smallText||l.error&&l.errorText||l.maxLength?(e.openBlock(),e.createElementBlock("div",S,[l.smallText||l.error&&l.errorText?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["chat-field__small",{"chat-field__small--error":l.error}])},e.toDisplayString(l.error?l.errorText:l.smallText),3)):e.createCommentVNode("",!0),l.maxLength?(e.openBlock(),e.createElementBlock("div",$,e.toDisplayString(r.value.length)+" / "+e.toDisplayString(l.maxLength),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))}}),w={class:"bonus-summary"},L=e.defineComponent({__name:"BonusSummary",setup(s){return(n,i)=>(e.openBlock(),e.createElementBlock("div",w,[e.createVNode(e.unref(m.BonusIcon),{class:"bonus-summary__icon"}),i[0]||(i[0]=e.createElementVNode("div",{class:"bonus-summary__number"},"123",-1))]))}});exports.BonusSummary=L;exports.ChatField=I;
|
package/dist/blocks/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as g, computed as V, createElementBlock as o, openBlock as a, normalizeClass as C, unref as c, createElementVNode as n, createVNode as v, createBlock as p, mergeModels as y, useModel as b, useTemplateRef as F, ref as L, reactive as w, shallowRef as k, onMounted as S, Transition as R, withCtx as D, withDirectives as B, Fragment as I, renderList as T, resolveDynamicComponent as U, toDisplayString as h, vShow as z, createCommentVNode as _, vModelText as N } from "vue";
|
|
2
|
-
import { g as $, I as O, F as x } from "../Image-
|
|
2
|
+
import { g as $, I as O, F as x } from "../Image-wxPggg1a.js";
|
|
3
3
|
import { C as A, _ as M, F as E } from "../FileIcon-maHE2Nhr.js";
|
|
4
4
|
import { I as P, P as j, S as q, B as H } from "../SendIcon-Cqdt2QWN.js";
|
|
5
5
|
import { o as G } from "../parseFileSize.util-CxVk4CvB.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("vue");let r=null;function a(){const o=window.scrollY;return document.body.style.position="fixed",document.body.style.top=`-${o}px`,()=>{document.body.style.position="",document.body.style.top="",window.scrollTo(0,o)}}const c=()=>{r||(r=a())},d=()=>{console.log("allowScroll"),r&&(r(),r=null)},u=()=>({unlockScroll:d,lockScroll:c}),i=["data-layer"],p=l.defineComponent({__name:"Portal",props:{overlayType:{default:"modal"},teleport:{type:Boolean,default:!0},target:{default:"body"},zIndex:{},show:{type:Boolean,default:!0},parentId:{}},setup(o){const t=o,n=l.computed(()=>{if(t.zIndex)return t.zIndex});return(e,s)=>e.show?(l.openBlock(),l.createBlock(l.Teleport,{key:0,to:e.target,disabled:!e.teleport},[l.createElementVNode("div",{style:l.normalizeStyle({zIndex:n.value,position:"relative",isolation:"isolate"}),"data-layer":e.overlayType},[l.renderSlot(e.$slots,"default")],12,i)],8,["to","disabled"])):l.createCommentVNode("",!0)}});function f(){const o=new Map;return{on(t,n){const e=o.get(t)||[];e.push(n),o.set(t,e)},off(t,n){const e=o.get(t);e&&o.set(t,e.filter(s=>s!==n))},emit(t,n){const e=o.get(t);e&&e.forEach(s=>s(n))},clear(){o.clear()}}}exports.EventBus=f;exports._sfc_main=p;exports.useBodyScroll=u;
|
|
@@ -9,11 +9,11 @@ function m() {
|
|
|
9
9
|
const S = () => {
|
|
10
10
|
n || (n = m());
|
|
11
11
|
}, h = () => {
|
|
12
|
-
n && (n(), n = null);
|
|
13
|
-
},
|
|
12
|
+
console.log("allowScroll"), n && (n(), n = null);
|
|
13
|
+
}, v = () => ({
|
|
14
14
|
unlockScroll: h,
|
|
15
15
|
lockScroll: S
|
|
16
|
-
}),
|
|
16
|
+
}), w = ["data-layer"], g = /* @__PURE__ */ s({
|
|
17
17
|
__name: "Portal",
|
|
18
18
|
props: {
|
|
19
19
|
overlayType: { default: "modal" },
|
|
@@ -41,11 +41,11 @@ const S = () => {
|
|
|
41
41
|
"data-layer": e.overlayType
|
|
42
42
|
}, [
|
|
43
43
|
y(e.$slots, "default")
|
|
44
|
-
], 12,
|
|
44
|
+
], 12, w)
|
|
45
45
|
], 8, ["to", "disabled"])) : c("", !0);
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
function
|
|
48
|
+
function B() {
|
|
49
49
|
const o = /* @__PURE__ */ new Map();
|
|
50
50
|
return {
|
|
51
51
|
on(t, l) {
|
|
@@ -69,7 +69,7 @@ function I() {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
B as E,
|
|
73
|
+
g as _,
|
|
74
|
+
v as u
|
|
75
75
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -365,10 +365,9 @@ declare type __VLS_Props_17 = {
|
|
|
365
365
|
declare type __VLS_Props_18 = {
|
|
366
366
|
file: string | IFile_2;
|
|
367
367
|
alt?: string;
|
|
368
|
-
size?:
|
|
368
|
+
size?: "small" | "medium" | "large" | "full";
|
|
369
369
|
fullScreen?: boolean;
|
|
370
370
|
viewInfo?: boolean;
|
|
371
|
-
zIndexPreview?: number;
|
|
372
371
|
};
|
|
373
372
|
|
|
374
373
|
declare type __VLS_Props_19 = {
|