prlg-ui 1.7.45 → 1.7.47
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/blocks/index.cjs.js +1 -1
- package/dist/blocks/index.es.js +97 -79
- package/dist/blocks.d.ts +4 -0
- package/dist/icons/index.cjs.js +1 -1
- package/dist/icons/index.es.js +283 -270
- package/dist/icons.d.ts +2 -0
- package/dist/prlg-ui.css +1 -1
- package/package.json +1 -1
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-DIcd8Rr2.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,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("../Image-DIcd8Rr2.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=["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:"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,35 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { g as
|
|
3
|
-
import { C as
|
|
4
|
-
import { I as
|
|
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-CHlS9buq.js";
|
|
3
|
+
import { C as A, _ as M, F as E } from "../FileIcon-DkEbi-bi.js";
|
|
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";
|
|
6
6
|
import { o as J } from "../uploadFile.util-CorOn5lO.js";
|
|
7
|
-
const K = { class: "chat-file__content" }, Q = /* @__PURE__ */
|
|
7
|
+
const K = { class: "chat-file__content" }, Q = /* @__PURE__ */ g({
|
|
8
8
|
__name: "ChatFile",
|
|
9
9
|
props: {
|
|
10
10
|
file: {}
|
|
11
11
|
},
|
|
12
12
|
emits: ["deleteFile"],
|
|
13
|
-
setup(
|
|
14
|
-
const d =
|
|
15
|
-
return (
|
|
16
|
-
class:
|
|
13
|
+
setup(r, { emit: i }) {
|
|
14
|
+
const d = i, u = V(() => URL.createObjectURL(r.file));
|
|
15
|
+
return (l, m) => (a(), o("div", {
|
|
16
|
+
class: C(["chat-file", { "chat-file--image": c($)(l.file.type) === "image" }])
|
|
17
17
|
}, [
|
|
18
|
-
|
|
18
|
+
n("button", {
|
|
19
19
|
class: "chat-file__delete",
|
|
20
|
-
onClick: m[0] || (m[0] = (
|
|
20
|
+
onClick: m[0] || (m[0] = (e) => d("deleteFile", l.file))
|
|
21
21
|
}, [
|
|
22
|
-
|
|
22
|
+
v(c(A))
|
|
23
23
|
]),
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
n("div", K, [
|
|
25
|
+
c($)(l.file.type) === "image" ? (a(), p(c(O), {
|
|
26
26
|
key: 0,
|
|
27
|
-
file:
|
|
27
|
+
file: u.value,
|
|
28
28
|
size: "large",
|
|
29
29
|
fullScreen: ""
|
|
30
|
-
}, null, 8, ["file"])) : (a(),
|
|
30
|
+
}, null, 8, ["file"])) : (a(), p(c(x), {
|
|
31
31
|
key: 1,
|
|
32
|
-
file:
|
|
32
|
+
file: u.value,
|
|
33
33
|
outlined: !1
|
|
34
34
|
}, null, 8, ["file"]))
|
|
35
35
|
])
|
|
@@ -38,9 +38,9 @@ const K = { class: "chat-file__content" }, Q = /* @__PURE__ */ p({
|
|
|
38
38
|
}), W = /* @__PURE__ */ M(Q, [["__scopeId", "data-v-25ab2b0f"]]), X = { class: "chat-field-actions" }, Y = {
|
|
39
39
|
ref: "overlay",
|
|
40
40
|
class: "chat-field-actions__overlay"
|
|
41
|
-
}, Z = ["onClick"], ee = { class: "chat-field-actions__overlay-item__label" }, le = ["disabled"],
|
|
41
|
+
}, Z = ["onClick"], ee = { class: "chat-field-actions__overlay-item__label" }, le = ["disabled"], ae = /* @__PURE__ */ g({
|
|
42
42
|
__name: "ChatFieldActions",
|
|
43
|
-
props: /* @__PURE__ */
|
|
43
|
+
props: /* @__PURE__ */ y({
|
|
44
44
|
actions: {},
|
|
45
45
|
disabled: { type: Boolean, default: !1 },
|
|
46
46
|
multiple: { type: Boolean, default: !0 }
|
|
@@ -49,66 +49,76 @@ const K = { class: "chat-file__content" }, Q = /* @__PURE__ */ p({
|
|
|
49
49
|
modelModifiers: {}
|
|
50
50
|
}),
|
|
51
51
|
emits: ["update:modelValue"],
|
|
52
|
-
setup(
|
|
53
|
-
const
|
|
52
|
+
setup(r) {
|
|
53
|
+
const i = b(r, "modelValue"), d = F("button"), u = F("overlay"), l = L(!1), m = w({
|
|
54
54
|
image: {
|
|
55
|
-
icon:
|
|
55
|
+
icon: k(P),
|
|
56
56
|
label: "Добавить изображение"
|
|
57
57
|
},
|
|
58
58
|
file: {
|
|
59
|
-
icon:
|
|
59
|
+
icon: k(E),
|
|
60
60
|
label: "Добавить файл"
|
|
61
61
|
}
|
|
62
|
-
}),
|
|
62
|
+
}), e = (s) => {
|
|
63
63
|
J({
|
|
64
|
-
accept:
|
|
64
|
+
accept: s === "image" ? ["image"] : ["pdf", "excel", "word"],
|
|
65
65
|
maxFileSize: "5mb",
|
|
66
66
|
maxFiles: 1
|
|
67
|
-
}).then((
|
|
68
|
-
|
|
67
|
+
}).then((t) => {
|
|
68
|
+
i.value ? i.value = r.multiple ? [...i.value, ...t] : t : i.value = [...t], l.value = !1;
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
|
-
return
|
|
72
|
-
G(
|
|
73
|
-
|
|
71
|
+
return S(() => {
|
|
72
|
+
G(u.value, () => {
|
|
73
|
+
l.value = !1;
|
|
74
74
|
}, { ignore: [d.value] });
|
|
75
|
-
}), (
|
|
76
|
-
|
|
77
|
-
default:
|
|
78
|
-
|
|
79
|
-
(a(!0),
|
|
75
|
+
}), (s, t) => (a(), o("div", X, [
|
|
76
|
+
v(R, { name: "slide-up" }, {
|
|
77
|
+
default: D(() => [
|
|
78
|
+
B(n("div", Y, [
|
|
79
|
+
(a(!0), o(I, null, T(s.actions, (f) => (a(), o("div", {
|
|
80
80
|
class: "chat-field-actions__overlay-item",
|
|
81
81
|
key: f,
|
|
82
|
-
onClick: (
|
|
82
|
+
onClick: (ce) => e(f)
|
|
83
83
|
}, [
|
|
84
|
-
(a(),
|
|
85
|
-
|
|
84
|
+
(a(), p(U(m[f].icon), { class: "chat-field-actions__overlay-item__icon" })),
|
|
85
|
+
n("span", ee, h(m[f].label), 1)
|
|
86
86
|
], 8, Z))), 128))
|
|
87
87
|
], 512), [
|
|
88
|
-
[z,
|
|
88
|
+
[z, l.value]
|
|
89
89
|
])
|
|
90
90
|
]),
|
|
91
91
|
_: 1
|
|
92
92
|
}),
|
|
93
|
-
|
|
93
|
+
n("button", {
|
|
94
94
|
ref: "button",
|
|
95
|
-
onClick:
|
|
96
|
-
class:
|
|
97
|
-
disabled:
|
|
95
|
+
onClick: t[0] || (t[0] = (f) => l.value = !l.value),
|
|
96
|
+
class: C(["chat-field-actions__button", { "chat-field-actions__button--active": l.value }]),
|
|
97
|
+
disabled: s.disabled
|
|
98
98
|
}, [
|
|
99
|
-
|
|
99
|
+
v(c(j))
|
|
100
100
|
], 10, le)
|
|
101
101
|
]));
|
|
102
102
|
}
|
|
103
|
-
}),
|
|
103
|
+
}), te = /* @__PURE__ */ M(ae, [["__scopeId", "data-v-e64085d6"]]), se = { class: "chat-field" }, oe = {
|
|
104
104
|
key: 0,
|
|
105
105
|
class: "chat-field__files"
|
|
106
|
-
}, ie = { class: "chat-field__wrapper" }, ne = ["placeholder"],
|
|
106
|
+
}, ie = { class: "chat-field__wrapper" }, ne = ["placeholder"], re = {
|
|
107
|
+
key: 1,
|
|
108
|
+
class: "chat-field__footer"
|
|
109
|
+
}, de = {
|
|
110
|
+
key: 1,
|
|
111
|
+
class: "chat-field__char-count"
|
|
112
|
+
}, ge = /* @__PURE__ */ g({
|
|
107
113
|
__name: "ChatField",
|
|
108
|
-
props: /* @__PURE__ */
|
|
114
|
+
props: /* @__PURE__ */ y({
|
|
109
115
|
viewActions: { type: Boolean, default: !1 },
|
|
110
116
|
actions: { default: () => ["file", "image"] },
|
|
111
117
|
placeholder: { default: "Введите сообщение" },
|
|
118
|
+
maxLength: {},
|
|
119
|
+
smallText: {},
|
|
120
|
+
error: { type: Boolean },
|
|
121
|
+
errorText: {},
|
|
112
122
|
disabled: { type: Boolean, default: !1 }
|
|
113
123
|
}, {
|
|
114
124
|
message: { required: !0 },
|
|
@@ -116,53 +126,61 @@ const K = { class: "chat-file__content" }, Q = /* @__PURE__ */ p({
|
|
|
116
126
|
files: {},
|
|
117
127
|
filesModifiers: {}
|
|
118
128
|
}),
|
|
119
|
-
emits: /* @__PURE__ */
|
|
120
|
-
setup(
|
|
121
|
-
const d =
|
|
122
|
-
|
|
129
|
+
emits: /* @__PURE__ */ y(["sendMessage"], ["update:message", "update:files"]),
|
|
130
|
+
setup(r, { emit: i }) {
|
|
131
|
+
const d = i, u = b(r, "message"), l = b(r, "files"), m = (e) => {
|
|
132
|
+
l.value && (l.value = l.value.filter((s) => s.name !== e.name));
|
|
123
133
|
};
|
|
124
|
-
return (
|
|
125
|
-
|
|
126
|
-
(a(!0),
|
|
127
|
-
key:
|
|
128
|
-
file:
|
|
134
|
+
return (e, s) => (a(), o("div", se, [
|
|
135
|
+
l.value && l.value.length > 0 ? (a(), o("div", oe, [
|
|
136
|
+
(a(!0), o(I, null, T(l.value, (t) => (a(), p(W, {
|
|
137
|
+
key: t.name,
|
|
138
|
+
file: t,
|
|
129
139
|
onDeleteFile: m
|
|
130
140
|
}, null, 8, ["file"]))), 128))
|
|
131
|
-
])) :
|
|
132
|
-
|
|
133
|
-
|
|
141
|
+
])) : _("", !0),
|
|
142
|
+
n("div", ie, [
|
|
143
|
+
e.viewActions && e.actions.length > 0 ? (a(), p(te, {
|
|
134
144
|
key: 0,
|
|
135
|
-
modelValue:
|
|
136
|
-
"onUpdate:modelValue":
|
|
137
|
-
actions:
|
|
138
|
-
disabled:
|
|
139
|
-
}, null, 8, ["modelValue", "actions", "disabled"])) :
|
|
140
|
-
|
|
141
|
-
"onUpdate:modelValue":
|
|
145
|
+
modelValue: l.value,
|
|
146
|
+
"onUpdate:modelValue": s[0] || (s[0] = (t) => l.value = t),
|
|
147
|
+
actions: e.actions,
|
|
148
|
+
disabled: e.disabled
|
|
149
|
+
}, null, 8, ["modelValue", "actions", "disabled"])) : _("", !0),
|
|
150
|
+
B(n("input", {
|
|
151
|
+
"onUpdate:modelValue": s[1] || (s[1] = (t) => u.value = t),
|
|
142
152
|
class: "chat-field__input",
|
|
143
|
-
|
|
153
|
+
maxlength: "maxLength",
|
|
154
|
+
placeholder: e.placeholder
|
|
144
155
|
}, null, 8, ne), [
|
|
145
|
-
[N,
|
|
156
|
+
[N, u.value]
|
|
146
157
|
]),
|
|
147
|
-
|
|
158
|
+
n("button", {
|
|
148
159
|
class: "chat-field__button",
|
|
149
|
-
onClick:
|
|
160
|
+
onClick: s[2] || (s[2] = (t) => d("sendMessage"))
|
|
150
161
|
}, [
|
|
151
|
-
|
|
162
|
+
v(c(q))
|
|
152
163
|
])
|
|
153
|
-
])
|
|
164
|
+
]),
|
|
165
|
+
e.smallText || e.error && e.errorText || e.maxLength ? (a(), o("div", re, [
|
|
166
|
+
e.smallText || e.error && e.errorText ? (a(), o("div", {
|
|
167
|
+
key: 0,
|
|
168
|
+
class: C(["chat-field__small", { "chat-field__small--error": e.error }])
|
|
169
|
+
}, h(e.error ? e.errorText : e.smallText), 3)) : _("", !0),
|
|
170
|
+
e.maxLength ? (a(), o("div", de, h(u.value.length) + " / " + h(e.maxLength), 1)) : _("", !0)
|
|
171
|
+
])) : _("", !0)
|
|
154
172
|
]));
|
|
155
173
|
}
|
|
156
|
-
}),
|
|
174
|
+
}), ue = { class: "bonus-summary" }, ye = /* @__PURE__ */ g({
|
|
157
175
|
__name: "BonusSummary",
|
|
158
|
-
setup(
|
|
159
|
-
return (
|
|
160
|
-
|
|
161
|
-
d[0] || (d[0] =
|
|
176
|
+
setup(r) {
|
|
177
|
+
return (i, d) => (a(), o("div", ue, [
|
|
178
|
+
v(c(H), { class: "bonus-summary__icon" }),
|
|
179
|
+
d[0] || (d[0] = n("div", { class: "bonus-summary__number" }, "123", -1))
|
|
162
180
|
]));
|
|
163
181
|
}
|
|
164
182
|
});
|
|
165
183
|
export {
|
|
166
|
-
|
|
167
|
-
|
|
184
|
+
ye as BonusSummary,
|
|
185
|
+
ge as ChatField
|
|
168
186
|
};
|
package/dist/blocks.d.ts
CHANGED