@profitliga/ui 1.1.12 → 1.1.14

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.
@@ -1,7 +1,7 @@
1
1
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
2
  type __VLS_Props = {
3
3
  value: any;
4
- label: any;
4
+ label?: any;
5
5
  id?: string;
6
6
  border?: boolean;
7
7
  };
@@ -1740,7 +1740,7 @@ function v2(s, C) {
1740
1740
  }, null, -1),
1741
1741
  A("path", {
1742
1742
  d: "M8.99934 7.74869C8.9008 7.74915 8.80316 7.72993 8.71215 7.69215C8.62113 7.65438 8.53858 7.5988 8.46934 7.52869L5.46934 4.52869C5.32889 4.38806 5.25 4.19744 5.25 3.99869C5.25 3.79994 5.32889 3.60931 5.46934 3.46869L8.46934 0.468689C8.538 0.395002 8.6208 0.3359 8.7128 0.294908C8.8048 0.253916 8.90412 0.231874 9.00482 0.230097C9.10552 0.22832 9.20555 0.246845 9.29894 0.284566C9.39233 0.322287 9.47716 0.378432 9.54838 0.44965C9.6196 0.520869 9.67574 0.605703 9.71346 0.699091C9.75118 0.79248 9.76971 0.892509 9.76793 0.993211C9.76616 1.09391 9.74411 1.19323 9.70312 1.28523C9.66213 1.37723 9.60303 1.46003 9.52934 1.52869L7.05934 3.99869L9.52934 6.46869C9.66979 6.60931 9.74868 6.79994 9.74868 6.99869C9.74868 7.19744 9.66979 7.38806 9.52934 7.52869C9.4601 7.5988 9.37755 7.65438 9.28653 7.69215C9.19552 7.72993 9.09788 7.74915 8.99934 7.74869Z",
1743
- fill: "black"
1743
+ fill: "currentColor"
1744
1744
  }, null, -1),
1745
1745
  A("path", {
1746
1746
  d: "M17 1L1 17",
@@ -4,6 +4,9 @@ export interface TypedEventBus<Events extends EventMap> {
4
4
  on<K extends keyof Events>(type: K, handler: Handler<Events[K]>): void;
5
5
  off<K extends keyof Events>(type: K, handler: Handler<Events[K]>): void;
6
6
  emit<K extends keyof Events>(type: K, evt?: Events[K]): void;
7
+ listeners<K extends keyof Events>(type: K): Array<Handler<Events[K]>>;
8
+ listenerCount<K extends keyof Events>(type: K): number;
9
+ eventNames(): Array<keyof Events>;
7
10
  clear(): void;
8
11
  }
9
12
  export declare function EventBus<Events extends EventMap>(): TypedEventBus<Events>;
@@ -1,28 +1,40 @@
1
- import { toValue as x, unref as S, h as p } from "vue";
2
- import { p as h } from "../breakpoints.util-FHc0ZUGk.js";
1
+ import { toValue as x, unref as h, h as p } from "vue";
2
+ import { p as S } from "../breakpoints.util-FHc0ZUGk.js";
3
3
  import { b as R } from "../breakpoints.util-FHc0ZUGk.js";
4
4
  export * from "@internationalized/date";
5
5
  import { default as q } from "dayjs";
6
- function k() {
6
+ function z() {
7
7
  const e = /* @__PURE__ */ new Map();
8
8
  return {
9
- on(n, t) {
10
- const r = e.get(n) ?? [];
11
- r.push(t), e.set(n, r);
9
+ on(r, t) {
10
+ const n = e.get(r) ?? [];
11
+ n.push(t), e.set(r, n);
12
12
  },
13
- off(n, t) {
14
- const r = e.get(n);
15
- r && e.set(
16
- n,
17
- r.filter((l) => l !== t)
13
+ off(r, t) {
14
+ const n = e.get(r);
15
+ n && e.set(
16
+ r,
17
+ n.filter((l) => l !== t)
18
18
  );
19
19
  },
20
- emit(n, t) {
21
- const r = e.get(n);
22
- r && r.forEach(
20
+ emit(r, t) {
21
+ const n = e.get(r);
22
+ n && n.forEach(
23
23
  (l) => l(t)
24
24
  );
25
25
  },
26
+ listeners(r) {
27
+ const t = e.get(r);
28
+ return t ? [...t] : [];
29
+ },
30
+ // Количество слушателей для события
31
+ listenerCount(r) {
32
+ return e.get(r)?.length ?? 0;
33
+ },
34
+ // Список всех типов событий с зарегистрированными слушателями
35
+ eventNames() {
36
+ return Array.from(e.keys());
37
+ },
26
38
  clear() {
27
39
  e.clear();
28
40
  }
@@ -30,61 +42,61 @@ function k() {
30
42
  }
31
43
  const d = /* @__PURE__ */ new WeakMap();
32
44
  function g(e) {
33
- const n = S(e);
34
- return n?.$el ?? n;
45
+ const r = h(e);
46
+ return r?.$el ?? r;
35
47
  }
36
- function w(e) {
48
+ function v(e) {
37
49
  return typeof e == "string" ? document.querySelector(e) : g(e);
38
50
  }
39
- function P(e, n, t = {}) {
40
- const r = w(e);
41
- if (!r) return () => {
51
+ function P(e, r, t = {}) {
52
+ const n = v(e);
53
+ if (!n) return () => {
42
54
  };
43
- const l = d.get(r);
44
- l && (l(), d.delete(r));
55
+ const l = d.get(n);
56
+ l && (l(), d.delete(n));
45
57
  const i = (c) => {
46
58
  const a = c.target instanceof Node ? c.target : null;
47
59
  if (!a) return;
48
60
  const y = (x(t.ignore) ?? []).map((s) => typeof s == "string" ? document.querySelector(s) : g(s)).filter((s) => s != null);
49
- r.contains(a) || y.some((s) => s.contains(a)) || n(c);
61
+ n.contains(a) || y.some((s) => s.contains(a)) || r(c);
50
62
  };
51
63
  document.addEventListener("mousedown", i, { capture: !0 }), document.addEventListener("touchstart", i, { capture: !0 });
52
64
  const o = () => {
53
- document.removeEventListener("mousedown", i, { capture: !0 }), document.removeEventListener("touchstart", i, { capture: !0 }), d.delete(r);
65
+ document.removeEventListener("mousedown", i, { capture: !0 }), document.removeEventListener("touchstart", i, { capture: !0 }), d.delete(n);
54
66
  };
55
- return d.set(r, o), o;
67
+ return d.set(n, o), o;
56
68
  }
57
- function $(e, n = "₽", t = 2) {
69
+ function $(e, r = "₽", t = 2) {
58
70
  return `${e.toLocaleString("en-US", {
59
71
  minimumFractionDigits: t,
60
72
  maximumFractionDigits: t
61
- }).replace(/,/g, " ")} ${n}`;
73
+ }).replace(/,/g, " ")} ${r}`;
62
74
  }
63
- function M(e) {
64
- return e.reduce((n, t) => n + t, 0);
75
+ function C(e) {
76
+ return e.reduce((r, t) => r + t, 0);
65
77
  }
66
- function U(e) {
67
- const n = e.replace(/[^\d.,]/g, "").replace(",", ".");
68
- return parseFloat(n) || 0;
78
+ function M(e) {
79
+ const r = e.replace(/[^\d.,]/g, "").replace(",", ".");
80
+ return parseFloat(r) || 0;
69
81
  }
70
82
  let u = null, m = 0;
71
- function v() {
83
+ function w() {
72
84
  const e = window.scrollY;
73
85
  return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, () => {
74
86
  document.body.style.position = "", document.body.style.top = "", window.scrollTo(0, e);
75
87
  };
76
88
  }
77
89
  const F = () => {
78
- m++, m === 1 && !u && (u = v());
90
+ m++, m === 1 && !u && (u = w());
79
91
  }, b = () => {
80
92
  m > 0 && m--, m === 0 && u && (u(), u = null);
81
- }, C = () => ({
93
+ }, U = () => ({
82
94
  unlockScroll: b,
83
95
  lockScroll: F
84
96
  });
85
97
  function E(e) {
86
98
  if (!e) return;
87
- const n = Array.isArray(e) ? e : [e], t = {
99
+ const r = Array.isArray(e) ? e : [e], t = {
88
100
  image: ["image/*"],
89
101
  pdf: ["application/pdf"],
90
102
  excel: [
@@ -97,22 +109,22 @@ function E(e) {
97
109
  ],
98
110
  all: ["*/*"]
99
111
  };
100
- return n.flatMap((r) => t[r] || []).join(",");
112
+ return r.flatMap((n) => t[n] || []).join(",");
101
113
  }
102
114
  function A(e = {}) {
103
- return new Promise((n) => {
115
+ return new Promise((r) => {
104
116
  const t = document.createElement("input");
105
117
  t.type = "file", t.style.display = "none", e.multiple && e.maxFiles && e.maxFiles > 1 && (t.multiple = !0);
106
- const r = E(e.accept);
107
- r && (t.accept = r), t.addEventListener("change", (l) => {
118
+ const n = E(e.accept);
119
+ n && (t.accept = n), t.addEventListener("change", (l) => {
108
120
  const i = l.target;
109
121
  let o = [];
110
122
  if (i.files && i.files.length > 0 && (o = Array.from(i.files), e.maxFiles && o.length > e.maxFiles && (o = o.slice(0, e.maxFiles)), e.maxFileSize)) {
111
- const a = h(e.maxFileSize);
123
+ const a = S(e.maxFileSize);
112
124
  o = o.filter((f) => f.size <= a);
113
125
  }
114
126
  if (document.body.removeChild(t), e.returnType === "raw") {
115
- n(o);
127
+ r(o);
116
128
  return;
117
129
  }
118
130
  const c = o.map((a) => ({
@@ -122,30 +134,30 @@ function A(e = {}) {
122
134
  mime: a.type,
123
135
  size: a.size
124
136
  }));
125
- n(c);
137
+ r(c);
126
138
  }), document.body.appendChild(t), t.click();
127
139
  });
128
140
  }
129
- const D = (e, n = !0) => {
141
+ const N = (e, r = !0) => {
130
142
  const t = typeof e == "string" ? parseFloat(e) : e;
131
143
  if (isNaN(t))
132
144
  return "<span>0.<small>00</small>₽</span>";
133
- const r = Math.floor(t), l = Math.round((t - r) * 100), i = r.toLocaleString("ru-RU"), o = l.toString().padStart(2, "0");
134
- return n ? `<span class="price-number">${i}.<small style="margin-right: 4px">${o}</small>₽</span>` : p("span", { class: "price-number" }, [
145
+ const n = Math.floor(t), l = Math.round((t - n) * 100), i = n.toLocaleString("ru-RU"), o = l.toString().padStart(2, "0");
146
+ return r ? `<span class="price-number">${i}.<small style="margin-right: 4px">${o}</small>₽</span>` : p("span", { class: "price-number" }, [
135
147
  `${i}.`,
136
148
  p("small", { style: { marginRight: "4px" } }, o),
137
149
  "₽"
138
150
  ]);
139
151
  };
140
152
  export {
141
- k as EventBus,
153
+ z as EventBus,
142
154
  R as breakpoints,
143
155
  q as dayjs,
144
156
  $ as formatPrice,
145
157
  P as onClickOutside,
146
158
  A as openFileDialog,
147
- U as parsePrice,
148
- D as priceFormat,
149
- M as sumPrices,
150
- C as useBodyScroll
159
+ M as parsePrice,
160
+ N as priceFormat,
161
+ C as sumPrices,
162
+ U as useBodyScroll
151
163
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profitliga/ui",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "author": "Profit League<dev@pr-lg.ru>",
5
5
  "license": "MIT",
6
6
  "description": "Vue 3 UI component library with TypeScript and SCSS",