prlg-ui 1.7.72 → 1.7.74
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-2-mgHdPj.js → Image-BsSn6o0I.js} +1 -1
- package/dist/{Image-CqM7NFLO.cjs → Image-CjfBGj9v.cjs} +1 -1
- package/dist/blocks/index.cjs.js +1 -1
- package/dist/blocks/index.es.js +3 -3
- package/dist/icons/index.cjs.js +1 -1
- package/dist/icons/index.es.js +327 -314
- package/dist/icons.d.ts +2 -0
- package/dist/{parseFileSize.util-BTDZr2sf.cjs → parseFileSize.util-7Ku5i6Tm.cjs} +1 -1
- package/dist/{parseFileSize.util-BoDbFdVW.js → parseFileSize.util-DOIlswb-.js} +1 -1
- package/dist/prlg-ui.cjs.js +1 -1
- package/dist/prlg-ui.es.js +2 -2
- package/dist/{uploadFile.util-BdyZLaWj.cjs → uploadFile.util-68_41dVg.cjs} +1 -1
- package/dist/{uploadFile.util-C81sqTPq.js → uploadFile.util-DjmeAGuX.js} +1 -1
- package/dist/utils/index.cjs.js +1 -1
- package/dist/utils/index.es.js +2 -2
- package/dist/utils/parseFileSize.util.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
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
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-
|
|
3
|
+
import { f as S } from "./parseFileSize.util-DOIlswb-.js";
|
|
4
4
|
function G(l) {
|
|
5
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
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),i=require("./FileIcon-sxADkCIe.cjs"),p=require("./parseFileSize.util-
|
|
1
|
+
"use strict";const e=require("vue"),i=require("./FileIcon-sxADkCIe.cjs"),p=require("./parseFileSize.util-7Ku5i6Tm.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;
|
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-CjfBGj9v.cjs"),f=require("../FileIcon-sxADkCIe.cjs"),m=require("../SendIcon-_UxV_dOO.cjs"),p=require("../parseFileSize.util-7Ku5i6Tm.cjs"),_=require("../uploadFile.util-68_41dVg.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,9 +1,9 @@
|
|
|
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-BsSn6o0I.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
|
-
import { o as G } from "../parseFileSize.util-
|
|
6
|
-
import { o as J } from "../uploadFile.util-
|
|
5
|
+
import { o as G } from "../parseFileSize.util-DOIlswb-.js";
|
|
6
|
+
import { o as J } from "../uploadFile.util-DjmeAGuX.js";
|
|
7
7
|
const K = { class: "chat-file__content" }, Q = /* @__PURE__ */ g({
|
|
8
8
|
__name: "ChatFile",
|
|
9
9
|
props: {
|