prlg-ui 1.8.132 → 1.8.133

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 (71) hide show
  1. package/dist/FileIcon-BE4ItwkK.cjs +1 -0
  2. package/dist/FileIcon-maHE2Nhr.js +101 -0
  3. package/dist/Image-BHDBSn7B.cjs +1 -0
  4. package/dist/Image-CAGIshx9.js +259 -0
  5. package/dist/QuestionIcon-DptFSXX2.cjs +1 -0
  6. package/dist/QuestionIcon-tK1kUB_h.js +340 -0
  7. package/dist/SendIcon-CH6S0QWh.cjs +1 -0
  8. package/dist/SendIcon-Cqdt2QWN.js +88 -0
  9. package/dist/blocks/index.cjs.js +1 -0
  10. package/dist/blocks/index.es.js +186 -0
  11. package/dist/blocks.d.ts +35 -0
  12. package/dist/eventBus.util-K9Yq6hZm.cjs +1 -0
  13. package/dist/eventBus.util-msbJpg6N.js +75 -0
  14. package/dist/fonts/Roboto/Roboto-Black.woff +0 -0
  15. package/dist/fonts/Roboto/Roboto-Black.woff2 +0 -0
  16. package/dist/fonts/Roboto/Roboto-Bold.woff +0 -0
  17. package/dist/fonts/Roboto/Roboto-Bold.woff2 +0 -0
  18. package/dist/fonts/Roboto/Roboto-ExtraBold.woff +0 -0
  19. package/dist/fonts/Roboto/Roboto-ExtraBold.woff2 +0 -0
  20. package/dist/fonts/Roboto/Roboto-ExtraLight.woff +0 -0
  21. package/dist/fonts/Roboto/Roboto-ExtraLight.woff2 +0 -0
  22. package/dist/fonts/Roboto/Roboto-Light.woff +0 -0
  23. package/dist/fonts/Roboto/Roboto-Light.woff2 +0 -0
  24. package/dist/fonts/Roboto/Roboto-Medium.woff +0 -0
  25. package/dist/fonts/Roboto/Roboto-Medium.woff2 +0 -0
  26. package/dist/fonts/Roboto/Roboto-Regular.woff +0 -0
  27. package/dist/fonts/Roboto/Roboto-Regular.woff2 +0 -0
  28. package/dist/fonts/Roboto/Roboto-SemiBold.woff +0 -0
  29. package/dist/fonts/Roboto/Roboto-SemiBold.woff2 +0 -0
  30. package/dist/fonts/Roboto/Roboto-Thin.woff +0 -0
  31. package/dist/fonts/Roboto/Roboto-Thin.woff2 +0 -0
  32. package/dist/icons/index.cjs.js +1 -0
  33. package/dist/icons/index.es.js +1487 -0
  34. package/dist/icons.d.ts +220 -0
  35. package/dist/index.d.ts +2096 -0
  36. package/dist/parseFileSize.util-Bg1rLRLQ.cjs +1 -0
  37. package/dist/parseFileSize.util-CxVk4CvB.js +785 -0
  38. package/dist/prlg-ui.cjs.js +1 -0
  39. package/dist/prlg-ui.css +1 -0
  40. package/dist/prlg-ui.es.js +6227 -0
  41. package/dist/scss/animations.scss +30 -0
  42. package/dist/scss/colors.scss +135 -0
  43. package/dist/scss/fonts.scss +3 -0
  44. package/dist/scss/main.scss +36 -0
  45. package/dist/scss/mixins.scss +177 -0
  46. package/dist/scss/reset.scss +51 -0
  47. package/dist/scss/root-vars.scss +12 -0
  48. package/dist/types/index.cjs.js +1 -0
  49. package/dist/types/index.es.js +1 -0
  50. package/dist/types.d.ts +14 -0
  51. package/dist/uploadFile.util-DCFkx3w3.cjs +1 -0
  52. package/dist/uploadFile.util-DhavPrlY.js +37 -0
  53. package/dist/utils/date.util.ts +30 -0
  54. package/dist/utils/dayjs.util.ts +32 -0
  55. package/dist/utils/eventBus.util.ts +43 -0
  56. package/dist/utils/index.cjs.js +1 -0
  57. package/dist/utils/index.es.js +1891 -0
  58. package/dist/utils/index.ts +3 -0
  59. package/dist/utils/isClient.util.ts +3 -0
  60. package/dist/utils/mask.util.test.ts +170 -0
  61. package/dist/utils/mask.util.ts +217 -0
  62. package/dist/utils/onClickOutside.util.ts +78 -0
  63. package/dist/utils/parseDate.util.ts +41 -0
  64. package/dist/utils/parseFileSize.util.ts +38 -0
  65. package/dist/utils/price.util.ts +28 -0
  66. package/dist/utils/typeFile.util.ts +32 -0
  67. package/dist/utils/uploadFile.util.ts +94 -0
  68. package/dist/utils/useBodyScroll.util.ts +41 -0
  69. package/dist/utils.d.ts +141 -0
  70. package/dist/vite.svg +1 -0
  71. package/package.json +1 -1
@@ -0,0 +1,186 @@
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-CAGIshx9.js";
3
+ import { C as A, _ as M, F as E } from "../FileIcon-maHE2Nhr.js";
4
+ import { I as P, P as j, S as q, B as H } from "../SendIcon-Cqdt2QWN.js";
5
+ import { o as G } from "../parseFileSize.util-CxVk4CvB.js";
6
+ import { o as J } from "../uploadFile.util-DhavPrlY.js";
7
+ const K = { class: "chat-file__content" }, Q = /* @__PURE__ */ g({
8
+ __name: "ChatFile",
9
+ props: {
10
+ file: {}
11
+ },
12
+ emits: ["deleteFile"],
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
+ }, [
18
+ n("button", {
19
+ class: "chat-file__delete",
20
+ onClick: m[0] || (m[0] = (e) => d("deleteFile", l.file))
21
+ }, [
22
+ v(c(A))
23
+ ]),
24
+ n("div", K, [
25
+ c($)(l.file.type) === "image" ? (a(), p(c(O), {
26
+ key: 0,
27
+ file: u.value,
28
+ size: "large",
29
+ fullScreen: ""
30
+ }, null, 8, ["file"])) : (a(), p(c(x), {
31
+ key: 1,
32
+ file: u.value,
33
+ outlined: !1
34
+ }, null, 8, ["file"]))
35
+ ])
36
+ ], 2));
37
+ }
38
+ }), W = /* @__PURE__ */ M(Q, [["__scopeId", "data-v-25ab2b0f"]]), X = { class: "chat-field-actions" }, Y = {
39
+ ref: "overlay",
40
+ class: "chat-field-actions__overlay"
41
+ }, Z = ["onClick"], ee = { class: "chat-field-actions__overlay-item__label" }, le = ["disabled"], ae = /* @__PURE__ */ g({
42
+ __name: "ChatFieldActions",
43
+ props: /* @__PURE__ */ y({
44
+ actions: {},
45
+ disabled: { type: Boolean, default: !1 },
46
+ multiple: { type: Boolean, default: !0 }
47
+ }, {
48
+ modelValue: {},
49
+ modelModifiers: {}
50
+ }),
51
+ emits: ["update:modelValue"],
52
+ setup(r) {
53
+ const i = b(r, "modelValue"), d = F("button"), u = F("overlay"), l = L(!1), m = w({
54
+ image: {
55
+ icon: k(P),
56
+ label: "Добавить изображение"
57
+ },
58
+ file: {
59
+ icon: k(E),
60
+ label: "Добавить файл"
61
+ }
62
+ }), e = (s) => {
63
+ J({
64
+ accept: s === "image" ? ["image"] : ["pdf", "excel", "word"],
65
+ maxFileSize: "5mb",
66
+ maxFiles: 1
67
+ }).then((t) => {
68
+ i.value ? i.value = r.multiple ? [...i.value, ...t] : t : i.value = [...t], l.value = !1;
69
+ });
70
+ };
71
+ return S(() => {
72
+ G(u.value, () => {
73
+ l.value = !1;
74
+ }, { ignore: [d.value] });
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
+ class: "chat-field-actions__overlay-item",
81
+ key: f,
82
+ onClick: (ce) => e(f)
83
+ }, [
84
+ (a(), p(U(m[f].icon), { class: "chat-field-actions__overlay-item__icon" })),
85
+ n("span", ee, h(m[f].label), 1)
86
+ ], 8, Z))), 128))
87
+ ], 512), [
88
+ [z, l.value]
89
+ ])
90
+ ]),
91
+ _: 1
92
+ }),
93
+ n("button", {
94
+ ref: "button",
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
+ }, [
99
+ v(c(j))
100
+ ], 10, le)
101
+ ]));
102
+ }
103
+ }), te = /* @__PURE__ */ M(ae, [["__scopeId", "data-v-e64085d6"]]), se = { class: "chat-field" }, oe = {
104
+ key: 0,
105
+ class: "chat-field__files"
106
+ }, ie = { class: "chat-field__wrapper" }, ne = ["maxlength", "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({
113
+ __name: "ChatField",
114
+ props: /* @__PURE__ */ y({
115
+ viewActions: { type: Boolean, default: !1 },
116
+ actions: { default: () => ["file", "image"] },
117
+ placeholder: { default: "Введите сообщение" },
118
+ maxLength: {},
119
+ smallText: {},
120
+ error: { type: Boolean },
121
+ errorText: {},
122
+ disabled: { type: Boolean, default: !1 }
123
+ }, {
124
+ message: { required: !0 },
125
+ messageModifiers: {},
126
+ files: {},
127
+ filesModifiers: {}
128
+ }),
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));
133
+ };
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,
139
+ onDeleteFile: m
140
+ }, null, 8, ["file"]))), 128))
141
+ ])) : _("", !0),
142
+ n("div", ie, [
143
+ e.viewActions && e.actions.length > 0 ? (a(), p(te, {
144
+ key: 0,
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),
152
+ class: "chat-field__input",
153
+ maxlength: e.maxLength,
154
+ placeholder: e.placeholder
155
+ }, null, 8, ne), [
156
+ [N, u.value]
157
+ ]),
158
+ n("button", {
159
+ class: "chat-field__button",
160
+ onClick: s[2] || (s[2] = (t) => d("sendMessage"))
161
+ }, [
162
+ v(c(q))
163
+ ])
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)
172
+ ]));
173
+ }
174
+ }), ue = { class: "bonus-summary" }, ye = /* @__PURE__ */ g({
175
+ __name: "BonusSummary",
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))
180
+ ]));
181
+ }
182
+ });
183
+ export {
184
+ ye as BonusSummary,
185
+ ge as ChatField
186
+ };
@@ -0,0 +1,35 @@
1
+ import { ComponentOptionsMixin } from 'vue';
2
+ import { ComponentProvideOptions } from 'vue';
3
+ import { DefineComponent } from 'vue';
4
+ import { PublicProps } from 'vue';
5
+
6
+ declare type __VLS_Props = {
7
+ viewActions?: boolean;
8
+ actions?: Array<'file' | 'image'>;
9
+ placeholder?: string;
10
+ maxLength?: number;
11
+ smallText?: string;
12
+ error?: boolean;
13
+ errorText?: string;
14
+ disabled?: boolean;
15
+ };
16
+
17
+ declare type __VLS_PublicProps = {
18
+ 'message': string;
19
+ 'files'?: File[];
20
+ } & __VLS_Props;
21
+
22
+ export declare const BonusSummary: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
23
+
24
+ export declare const ChatField: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
25
+ "update:message": (value: string) => any;
26
+ "update:files": (value: File[]) => any;
27
+ } & {
28
+ sendMessage: () => any;
29
+ }, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
30
+ onSendMessage?: (() => any) | undefined;
31
+ "onUpdate:message"?: ((value: string) => any) | undefined;
32
+ "onUpdate:files"?: ((value: File[]) => any) | undefined;
33
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
34
+
35
+ export { }
@@ -0,0 +1 @@
1
+ "use strict";const l=require("vue");let r=null,s=0;function c(){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 d=()=>{s++,s===1&&!r&&(r=c())},u=()=>{s>0&&s--,s===0&&r&&(r(),r=null)},i=()=>({unlockScroll:u,lockScroll:d}),p=["data-layer"],f=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,a)=>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,p)],8,["to","disabled"])):l.createCommentVNode("",!0)}});function y(){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(a=>a!==n))},emit(t,n){const e=o.get(t);e&&e.forEach(a=>a(n))},clear(){o.clear()}}}exports.EventBus=y;exports._sfc_main=f;exports.useBodyScroll=i;
@@ -0,0 +1,75 @@
1
+ import { defineComponent as a, computed as d, createBlock as c, createCommentVNode as i, openBlock as u, Teleport as p, createElementVNode as f, normalizeStyle as y, renderSlot as m } from "vue";
2
+ let n = null, r = 0;
3
+ function S() {
4
+ const o = window.scrollY;
5
+ return document.body.style.position = "fixed", document.body.style.top = `-${o}px`, () => {
6
+ document.body.style.position = "", document.body.style.top = "", window.scrollTo(0, o);
7
+ };
8
+ }
9
+ const h = () => {
10
+ r++, r === 1 && !n && (n = S());
11
+ }, b = () => {
12
+ r > 0 && r--, r === 0 && n && (n(), n = null);
13
+ }, k = () => ({
14
+ unlockScroll: b,
15
+ lockScroll: h
16
+ }), v = ["data-layer"], B = /* @__PURE__ */ a({
17
+ __name: "Portal",
18
+ props: {
19
+ overlayType: { default: "modal" },
20
+ teleport: { type: Boolean, default: !0 },
21
+ target: { default: "body" },
22
+ zIndex: {},
23
+ show: { type: Boolean, default: !0 },
24
+ parentId: {}
25
+ },
26
+ setup(o) {
27
+ const t = o, l = d(() => {
28
+ if (t.zIndex) return t.zIndex;
29
+ });
30
+ return (e, s) => e.show ? (u(), c(p, {
31
+ key: 0,
32
+ to: e.target,
33
+ disabled: !e.teleport
34
+ }, [
35
+ f("div", {
36
+ style: y({
37
+ zIndex: l.value,
38
+ position: "relative",
39
+ isolation: "isolate"
40
+ }),
41
+ "data-layer": e.overlayType
42
+ }, [
43
+ m(e.$slots, "default")
44
+ ], 12, v)
45
+ ], 8, ["to", "disabled"])) : i("", !0);
46
+ }
47
+ });
48
+ function I() {
49
+ const o = /* @__PURE__ */ new Map();
50
+ return {
51
+ on(t, l) {
52
+ const e = o.get(t) || [];
53
+ e.push(l), o.set(t, e);
54
+ },
55
+ off(t, l) {
56
+ const e = o.get(t);
57
+ e && o.set(
58
+ t,
59
+ e.filter((s) => s !== l)
60
+ );
61
+ },
62
+ emit(t, l) {
63
+ const e = o.get(t);
64
+ e && e.forEach((s) => s(l));
65
+ },
66
+ clear() {
67
+ o.clear();
68
+ }
69
+ };
70
+ }
71
+ export {
72
+ I as E,
73
+ B as _,
74
+ k as u
75
+ };