prlg-ui 1.7.59 → 1.7.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,201 @@
1
+ import { defineComponent as I, useId as b, ref as z, computed as w, onMounted as h, createElementBlock as n, openBlock as t, normalizeClass as C, createCommentVNode as o, createBlock as F, createVNode as _, unref as p, resolveDynamicComponent as M, toDisplayString as y, Teleport as x, Transition as E, withCtx as V, normalizeStyle as N, createElementVNode as c, useTemplateRef as O, Fragment as W } from "vue";
2
+ import { F as j, E as D, W as R, P as q, C as B, _ as k, a as A } from "./FileIcon-DkEbi-bi.js";
3
+ import { f as S } from "./parseFileSize.util-BoDbFdVW.js";
4
+ function G(l) {
5
+ return l.startsWith("image/") ? "image" : l === "application/pdf" ? "pdf" : l === "application/msword" || l === "application/vnd.openxmlformats-officedocument.wordprocessingml.document" ? "word" : l === "application/vnd.ms-excel" || l === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ? "excel" : "other";
6
+ }
7
+ const H = {
8
+ key: 1,
9
+ class: "file__title"
10
+ }, J = {
11
+ key: 2,
12
+ class: "file__info"
13
+ }, K = {
14
+ key: 0,
15
+ class: "file__type"
16
+ }, L = {
17
+ key: 1,
18
+ class: "file__info-separator"
19
+ }, Q = {
20
+ key: 2,
21
+ class: "file__size"
22
+ }, U = /* @__PURE__ */ I({
23
+ __name: "File",
24
+ props: {
25
+ file: {},
26
+ viewName: { type: Boolean, default: !1 },
27
+ outlined: { type: Boolean, default: !0 },
28
+ removable: { type: Boolean }
29
+ },
30
+ emits: ["remove"],
31
+ setup(l, { emit: d }) {
32
+ const r = d, i = b(), e = z(null);
33
+ async function m(s, u = "image") {
34
+ const v = await (await fetch(s)).blob(), $ = v.type.split("/")[1] || "", P = $ ? `${u}.${$}` : u;
35
+ return new File([v], P, { type: v.type });
36
+ }
37
+ const a = w(() => e.value && e.value.mime ? G(e.value.mime) : null), f = w(() => {
38
+ switch (a.value) {
39
+ case "pdf":
40
+ return q;
41
+ case "word":
42
+ return R;
43
+ case "excel":
44
+ return D;
45
+ case "other":
46
+ default:
47
+ return j;
48
+ }
49
+ });
50
+ return h(async () => {
51
+ if (typeof l.file == "string") {
52
+ const s = await m(l.file);
53
+ e.value = {
54
+ id: i,
55
+ url: l.file,
56
+ name: s.name,
57
+ mime: s.type,
58
+ size: s.size
59
+ };
60
+ } else
61
+ e.value = l.file;
62
+ }), (s, u) => (t(), n("div", {
63
+ class: C(["file", { "file--outlined": s.outlined }])
64
+ }, [
65
+ s.removable && typeof s.file != "string" ? (t(), n("button", {
66
+ key: 0,
67
+ class: "file__remove",
68
+ onClick: u[0] || (u[0] = (g) => r("remove", s.file))
69
+ }, [
70
+ _(p(B))
71
+ ])) : o("", !0),
72
+ (t(), F(M(f.value), { class: "file__icon" })),
73
+ e.value && e.value.name && s.viewName ? (t(), n("div", H, y(e.value ? e.value.name.split(".")[0] : "unknown"), 1)) : o("", !0),
74
+ e.value ? (t(), n("div", J, [
75
+ e.value.mime ? (t(), n("div", K, y(a.value), 1)) : o("", !0),
76
+ e.value.mime && e.value.size ? (t(), n("div", L)) : o("", !0),
77
+ e.value.size ? (t(), n("div", Q, y(e.value ? p(S)(e.value.size) : "0 Б"), 1)) : o("", !0)
78
+ ])) : o("", !0)
79
+ ], 2));
80
+ }
81
+ }), ue = /* @__PURE__ */ k(U, [["__scopeId", "data-v-9dee864d"]]), X = { class: "image-full-modal__wrapper" }, Y = { class: "image-full-modal__header" }, Z = { class: "image-full-modal__main" }, T = ["src", "alt"], ee = /* @__PURE__ */ I({
82
+ __name: "ImageFullModal",
83
+ props: {
84
+ src: {},
85
+ alt: {},
86
+ zIndexPreview: {}
87
+ },
88
+ setup(l, { expose: d }) {
89
+ const r = z(!1);
90
+ return d({
91
+ open: () => {
92
+ r.value = !0;
93
+ },
94
+ close: () => {
95
+ r.value = !1;
96
+ }
97
+ }), (i, e) => (t(), F(x, { to: "body" }, [
98
+ _(E, { name: "fade" }, {
99
+ default: V(() => [
100
+ r.value ? (t(), n("div", {
101
+ key: 0,
102
+ class: "image-full-modal",
103
+ style: N({ zIndex: i.zIndexPreview })
104
+ }, [
105
+ c("div", {
106
+ class: "image-full-modal__overlay",
107
+ onClick: e[0] || (e[0] = (m) => r.value = !1)
108
+ }),
109
+ c("div", X, [
110
+ c("div", Y, [
111
+ c("button", {
112
+ class: "image-full-modal__close",
113
+ onClick: e[1] || (e[1] = (m) => r.value = !1)
114
+ }, [
115
+ _(p(B))
116
+ ])
117
+ ]),
118
+ c("div", Z, [
119
+ c("img", {
120
+ src: i.src,
121
+ alt: i.alt
122
+ }, null, 8, T)
123
+ ]),
124
+ e[2] || (e[2] = c("div", { class: "image-full-modal__footer" }, null, -1))
125
+ ])
126
+ ], 4)) : o("", !0)
127
+ ]),
128
+ _: 1
129
+ })
130
+ ]));
131
+ }
132
+ }), le = /* @__PURE__ */ k(ee, [["__scopeId", "data-v-1ff3e050"]]), ae = ["src", "alt"], te = {
133
+ key: 1,
134
+ class: "image__info"
135
+ }, ie = {
136
+ key: 0,
137
+ class: "image__size"
138
+ }, se = /* @__PURE__ */ I({
139
+ __name: "Image",
140
+ props: {
141
+ file: {},
142
+ alt: {},
143
+ size: { default: "medium" },
144
+ fullScreen: { type: Boolean },
145
+ viewInfo: { type: Boolean, default: !1 },
146
+ zIndexPreview: { default: 1002 }
147
+ },
148
+ setup(l) {
149
+ const d = b(), r = O("imageFullModal"), i = z(null);
150
+ async function e(a, f = "image") {
151
+ const u = await (await fetch(a)).blob(), g = u.type.split("/")[1] || "", v = g ? `${f}.${g}` : f;
152
+ return new File([u], v, { type: u.type });
153
+ }
154
+ const m = w(() => typeof l.file == "string" ? l.file : l.file.url);
155
+ return h(async () => {
156
+ if (l.viewInfo)
157
+ if (typeof l.file == "string") {
158
+ const a = await e(l.file);
159
+ i.value = {
160
+ id: d,
161
+ url: l.file,
162
+ name: a.name,
163
+ mime: a.type,
164
+ size: a.size
165
+ };
166
+ } else
167
+ i.value = l.file;
168
+ }), (a, f) => (t(), n(W, null, [
169
+ c("div", {
170
+ class: C(["image", `image--${a.size}`, { "image--full-screen": a.fullScreen }])
171
+ }, [
172
+ a.fullScreen ? (t(), n("div", {
173
+ key: 0,
174
+ class: "image__overlay",
175
+ onClick: f[0] || (f[0] = (s) => r.value?.open())
176
+ }, [
177
+ _(p(A))
178
+ ])) : o("", !0),
179
+ c("img", {
180
+ src: m.value,
181
+ alt: a.alt
182
+ }, null, 8, ae),
183
+ a.viewInfo && i.value && (i.value.mime || i.value.size) && a.size === "large" ? (t(), n("div", te, [
184
+ i.value.size ? (t(), n("div", ie, y(i.value ? p(S)(i.value.size) : "0 Б"), 1)) : o("", !0)
185
+ ])) : o("", !0)
186
+ ], 2),
187
+ a.fullScreen ? (t(), F(le, {
188
+ key: 0,
189
+ ref: "imageFullModal",
190
+ src: m.value,
191
+ alt: a.alt,
192
+ zIndexPreview: a.zIndexPreview
193
+ }, null, 8, ["src", "alt", "zIndexPreview"])) : o("", !0)
194
+ ], 64));
195
+ }
196
+ }), ce = /* @__PURE__ */ k(se, [["__scopeId", "data-v-1f4b3241"]]);
197
+ export {
198
+ ue as F,
199
+ ce as I,
200
+ G as g
201
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),i=require("./FileIcon-sxADkCIe.cjs"),p=require("./parseFileSize.util-BTDZr2sf.cjs");function k(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 g={key:1,class:"file__title"},_={key:2,class:"file__info"},B={key:0,class:"file__type"},I={key:1,class:"file__info-separator"},z={key:2,class:"file__size"},w=e.defineComponent({__name:"File",props:{file:{},viewName:{type:Boolean,default:!1},outlined:{type:Boolean,default:!0},removable:{type:Boolean}},emits:["remove"],setup(t,{emit:u}){const s=u,n=e.useId(),l=e.ref(null);async function m(a,c="image"){const d=await(await fetch(a)).blob(),v=d.type.split("/")[1]||"",y=v?`${c}.${v}`:c;return new File([d],y,{type:d.type})}const o=e.computed(()=>l.value&&l.value.mime?k(l.value.mime):null),r=e.computed(()=>{switch(o.value){case"pdf":return i.PdfIcon;case"word":return i.WordIcon;case"excel":return i.ExcelIcon;case"other":default:return i.FileIcon}});return e.onMounted(async()=>{if(typeof t.file=="string"){const a=await m(t.file);l.value={id:n,url:t.file,name:a.name,mime:a.type,size:a.size}}else l.value=t.file}),(a,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["file",{"file--outlined":a.outlined}])},[a.removable&&typeof a.file!="string"?(e.openBlock(),e.createElementBlock("button",{key:0,class:"file__remove",onClick:c[0]||(c[0]=f=>s("remove",a.file))},[e.createVNode(e.unref(i.CloseIcon))])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{class:"file__icon"})),l.value&&l.value.name&&a.viewName?(e.openBlock(),e.createElementBlock("div",g,e.toDisplayString(l.value?l.value.name.split(".")[0]:"unknown"),1)):e.createCommentVNode("",!0),l.value?(e.openBlock(),e.createElementBlock("div",_,[l.value.mime?(e.openBlock(),e.createElementBlock("div",B,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0),l.value.mime&&l.value.size?(e.openBlock(),e.createElementBlock("div",I)):e.createCommentVNode("",!0),l.value.size?(e.openBlock(),e.createElementBlock("div",z,e.toDisplayString(l.value?e.unref(p.formatFileSize)(l.value.size):"0 Б"),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),V=i._export_sfc(w,[["__scopeId","data-v-9dee864d"]]),C={class:"image-full-modal__wrapper"},N={class:"image-full-modal__header"},E={class:"image-full-modal__main"},F=["src","alt"],$=e.defineComponent({__name:"ImageFullModal",props:{src:{},alt:{},zIndexPreview:{}},setup(t,{expose:u}){const s=e.ref(!1);return u({open:()=>{s.value=!0},close:()=>{s.value=!1}}),(n,l)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"image-full-modal",style:e.normalizeStyle({zIndex:n.zIndexPreview})},[e.createElementVNode("div",{class:"image-full-modal__overlay",onClick:l[0]||(l[0]=m=>s.value=!1)}),e.createElementVNode("div",C,[e.createElementVNode("div",N,[e.createElementVNode("button",{class:"image-full-modal__close",onClick:l[1]||(l[1]=m=>s.value=!1)},[e.createVNode(e.unref(i.CloseIcon))])]),e.createElementVNode("div",E,[e.createElementVNode("img",{src:n.src,alt:n.alt},null,8,F)]),l[2]||(l[2]=e.createElementVNode("div",{class:"image-full-modal__footer"},null,-1))])],4)):e.createCommentVNode("",!0)]),_:1})]))}}),b=i._export_sfc($,[["__scopeId","data-v-1ff3e050"]]),h=["src","alt"],S={key:1,class:"image__info"},M={key:0,class:"image__size"},P=e.defineComponent({__name:"Image",props:{file:{},alt:{},size:{default:"medium"},fullScreen:{type:Boolean},viewInfo:{type:Boolean,default:!1},zIndexPreview:{default:1002}},setup(t){const u=e.useId(),s=e.useTemplateRef("imageFullModal"),n=e.ref(null);async function l(o,r="image"){const c=await(await fetch(o)).blob(),f=c.type.split("/")[1]||"",d=f?`${r}.${f}`:r;return new File([c],d,{type:c.type})}const m=e.computed(()=>typeof t.file=="string"?t.file:t.file.url);return e.onMounted(async()=>{if(t.viewInfo)if(typeof t.file=="string"){const o=await l(t.file);n.value={id:u,url:t.file,name:o.name,mime:o.type,size:o.size}}else n.value=t.file}),(o,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["image",`image--${o.size}`,{"image--full-screen":o.fullScreen}])},[o.fullScreen?(e.openBlock(),e.createElementBlock("div",{key:0,class:"image__overlay",onClick:r[0]||(r[0]=a=>s.value?.open())},[e.createVNode(e.unref(i.EyeIcon))])):e.createCommentVNode("",!0),e.createElementVNode("img",{src:m.value,alt:o.alt},null,8,h),o.viewInfo&&n.value&&(n.value.mime||n.value.size)&&o.size==="large"?(e.openBlock(),e.createElementBlock("div",S,[n.value.size?(e.openBlock(),e.createElementBlock("div",M,e.toDisplayString(n.value?e.unref(p.formatFileSize)(n.value.size):"0 Б"),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2),o.fullScreen?(e.openBlock(),e.createBlock(b,{key:0,ref:"imageFullModal",src:m.value,alt:o.alt,zIndexPreview:o.zIndexPreview},null,8,["src","alt","zIndexPreview"])):e.createCommentVNode("",!0)],64))}}),x=i._export_sfc(P,[["__scopeId","data-v-1f4b3241"]]);exports.File=V;exports.Image=x;exports.getFileTypeByMime=k;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("../Image-Bb2-xPzv.cjs"),f=require("../FileIcon-sxADkCIe.cjs"),m=require("../SendIcon-_UxV_dOO.cjs"),p=require("../parseFileSize.util-BTDZr2sf.cjs"),_=require("../uploadFile.util-Du5cumgy.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("../Image-CqM7NFLO.cjs"),f=require("../FileIcon-sxADkCIe.cjs"),m=require("../SendIcon-_UxV_dOO.cjs"),p=require("../parseFileSize.util-BTDZr2sf.cjs"),_=require("../uploadFile.util-Du5cumgy.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;
@@ -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-CFurBS6J.js";
2
+ import { g as $, I as O, F as x } from "../Image-2-mgHdPj.js";
3
3
  import { C as A, _ as M, F as E } from "../FileIcon-DkEbi-bi.js";
4
4
  import { I as P, P as j, S as q, B as H } from "../SendIcon-BGGNLlmf.js";
5
5
  import { o as G } from "../parseFileSize.util-BoDbFdVW.js";
package/dist/index.d.ts CHANGED
@@ -252,6 +252,7 @@ declare type __VLS_Props_15 = {
252
252
  size?: 'small' | 'medium' | 'large' | 'full';
253
253
  fullScreen?: boolean;
254
254
  viewInfo?: boolean;
255
+ zIndexPreview?: number;
255
256
  };
256
257
 
257
258
  declare type __VLS_Props_16 = {
@@ -1051,6 +1052,7 @@ declare const Image_2: DefineComponent<__VLS_Props_15, {}, {}, {}, {}, Component
1051
1052
  imageFullModal: CreateComponentPublicInstanceWithMixins<Readonly<{
1052
1053
  src: string;
1053
1054
  alt?: string;
1055
+ zIndexPreview?: number;
1054
1056
  }> & Readonly<{}>, {
1055
1057
  open: () => void;
1056
1058
  close: () => void;
@@ -1064,6 +1066,7 @@ Defaults: {};
1064
1066
  }, Readonly<{
1065
1067
  src: string;
1066
1068
  alt?: string;
1069
+ zIndexPreview?: number;
1067
1070
  }> & Readonly<{}>, {
1068
1071
  open: () => void;
1069
1072
  close: () => void;