@profitliga/ui 2.0.12 → 2.0.13

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 +1 @@
1
- .sheet-trigger[data-v-89da4791]{display:contents}.sheet-layer[data-v-89da4791]{position:relative}.sheet-overlay[data-v-89da4791]{pointer-events:auto;cursor:pointer}.sheet-content[data-v-89da4791]{background-color:var(--theme-neutral-0);z-index:1002;border-radius:12px 12px 0 0;flex-direction:column;width:100%;max-height:calc(100vh - 40px);display:flex;position:fixed;bottom:0;left:0;right:0;overflow:visible;box-shadow:0 2px 5px #3a3a3a40}.sheet-content[data-state=open][data-v-89da4791]{animation:slideBottomIn var(--animation-duration) ease-in-out}.sheet-content[data-state=closed][data-v-89da4791]{animation:slideBottomOut var(--animation-duration) ease-in-out}.sheet-content__handle[data-v-89da4791]{cursor:grab;touch-action:none;flex-shrink:0;justify-content:center;align-items:flex-end;width:100%;height:24px;padding-bottom:12px;display:flex}.sheet-content__handle[data-v-89da4791]:active{cursor:grabbing}.sheet-content__handle-dot[data-v-89da4791]{background-color:var(--theme-neutral-icon-primary);border-radius:2px;width:48px;height:4px}.sheet-content__body[data-v-89da4791]{box-sizing:content-box;scrollbar-width:thin;scrollbar-color:var(--theme-neutral-icon-primary) var(--theme-neutral-surface-icon);flex:auto;width:100%;min-height:0;overflow-y:auto}.sheet-content__body[data-v-89da4791]::-webkit-scrollbar{width:8px;height:0}.sheet-content__body[data-v-89da4791]::-webkit-scrollbar-thumb{background-color:var(--theme-neutral-icon-primary);background-clip:padding-box;border:1px solid #0000;border-radius:999px}.sheet-content__body[data-v-89da4791]::-webkit-scrollbar-track{background:var(--theme-neutral-surface-icon);border-radius:4px}.sheet-content__body[data-v-89da4791]::-webkit-scrollbar-corner{background:0 0}.sheet-overlay--drag-closing[data-v-89da4791]{visibility:hidden}
1
+ .sheet-trigger[data-v-0ccbb8c3]{display:contents}.sheet-layer[data-v-0ccbb8c3]{position:relative}.sheet-overlay[data-v-0ccbb8c3]{pointer-events:auto;cursor:pointer}.sheet-content[data-v-0ccbb8c3]{background-color:var(--theme-neutral-0);z-index:1002;border-radius:12px 12px 0 0;flex-direction:column;width:100%;max-height:calc(100vh - 40px);display:flex;position:fixed;bottom:0;left:0;right:0;overflow:visible;box-shadow:0 2px 5px #3a3a3a40}.sheet-content[data-state=open][data-v-0ccbb8c3]{animation:slideBottomIn var(--animation-duration) ease-in-out}.sheet-content[data-state=closed][data-v-0ccbb8c3]{animation:slideBottomOut var(--animation-duration) ease-in-out}.sheet-content__handle[data-v-0ccbb8c3]{cursor:grab;touch-action:none;flex-shrink:0;justify-content:center;align-items:flex-end;width:100%;height:24px;padding-bottom:12px;display:flex}.sheet-content__handle[data-v-0ccbb8c3]:active{cursor:grabbing}.sheet-content__handle-dot[data-v-0ccbb8c3]{background-color:var(--theme-neutral-icon-primary);border-radius:2px;width:48px;height:4px}.sheet-content__body[data-v-0ccbb8c3]{box-sizing:content-box;scrollbar-width:thin;scrollbar-color:var(--theme-neutral-icon-primary) var(--theme-neutral-surface-icon);flex:auto;width:100%;min-height:0;overflow-y:auto}.sheet-content__body[data-v-0ccbb8c3]::-webkit-scrollbar{width:8px;height:0}.sheet-content__body[data-v-0ccbb8c3]::-webkit-scrollbar-thumb{background-color:var(--theme-neutral-icon-primary);background-clip:padding-box;border:1px solid #0000;border-radius:999px}.sheet-content__body[data-v-0ccbb8c3]::-webkit-scrollbar-track{background:var(--theme-neutral-surface-icon);border-radius:4px}.sheet-content__body[data-v-0ccbb8c3]::-webkit-scrollbar-corner{background:0 0}.sheet-overlay--drag-closing[data-v-0ccbb8c3]{visibility:hidden}
@@ -2,7 +2,7 @@ import './BottomSheet.css';
2
2
  import o from "./BottomSheet.vue2.js";
3
3
  /* empty css */
4
4
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
5
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-89da4791"]]);
5
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0ccbb8c3"]]);
6
6
  export {
7
7
  e as default
8
8
  };
@@ -1,15 +1,15 @@
1
- import { defineComponent as F, useModel as K, useId as U, computed as k, ref as Z, useTemplateRef as w, watch as E, onBeforeUnmount as q, openBlock as m, createElementBlock as D, Fragment as H, mergeProps as u, unref as t, renderSlot as B, createCommentVNode as I, createBlock as Y, withCtx as j, createElementVNode as f, normalizeStyle as G, withModifiers as J, mergeModels as M, nextTick as Q } from "vue";
2
- import { onClickOutside as W } from "../../../utils/onClickOutside.util.js";
3
- import { useBodyScroll as X } from "../../../utils/useBodyScroll.util.js";
4
- import { useFocusTrap as _ } from "../../../utils/useFocusTrap.util.js";
5
- import { useSwipeToClose as ee } from "../../../utils/useSwipeToClose.util.js";
1
+ import { defineComponent as V, useModel as F, useId as K, computed as k, ref as Z, useTemplateRef as w, watch as E, onUnmounted as q, onBeforeUnmount as H, openBlock as p, createElementBlock as D, Fragment as Y, mergeProps as u, unref as t, renderSlot as B, createCommentVNode as I, createBlock as j, withCtx as G, createElementVNode as f, normalizeStyle as J, withModifiers as Q, mergeModels as M, nextTick as W } from "vue";
2
+ import { onClickOutside as X } from "../../../utils/onClickOutside.util.js";
3
+ import { useBodyScroll as _ } from "../../../utils/useBodyScroll.util.js";
4
+ import { useFocusTrap as ee } from "../../../utils/useFocusTrap.util.js";
5
+ import { useSwipeToClose as te } from "../../../utils/useSwipeToClose.util.js";
6
6
  import { ANIMATION_DURATION_MS as R } from "../shared/animation.const.js";
7
- import te from "../shared/Portal.vue.js";
8
- import { useDelayedVisibility as oe } from "../shared/useDelayedVisibility.util.js";
9
- import { useLayerZIndex as ae } from "../shared/useLayerZIndex.util.js";
10
- import { useTestId as ne } from "../shared/useTestId.util.js";
11
- import { useTriggerAria as le } from "../shared/useTriggerAria.util.js";
12
- const se = ["data-state"], re = ["aria-label", "aria-labelledby", "data-state"], ke = /* @__PURE__ */ F({
7
+ import oe from "../shared/Portal.vue.js";
8
+ import { useDelayedVisibility as ae } from "../shared/useDelayedVisibility.util.js";
9
+ import { useLayerZIndex as ne } from "../shared/useLayerZIndex.util.js";
10
+ import { useTestId as le } from "../shared/useTestId.util.js";
11
+ import { useTriggerAria as se } from "../shared/useTriggerAria.util.js";
12
+ const re = ["data-state"], ie = ["aria-label", "aria-labelledby", "data-state"], we = /* @__PURE__ */ V({
13
13
  inheritAttrs: !1,
14
14
  __name: "BottomSheet",
15
15
  props: /* @__PURE__ */ M({
@@ -25,43 +25,43 @@ const se = ["data-state"], re = ["aria-label", "aria-labelledby", "data-state"],
25
25
  }),
26
26
  emits: /* @__PURE__ */ M(["escapeKeyDown", "pointerDownOutside"], ["update:open"]),
27
27
  setup(l, { emit: x }) {
28
- const c = l, S = x, s = K(l, "open"), p = `sheet-content-${U()}`, r = ne(() => c.testId), $ = k(() => ({
28
+ const c = l, S = x, s = F(l, "open"), g = `sheet-content-${K()}`, r = le(() => c.testId), $ = k(() => ({
29
29
  "aria-haspopup": "dialog",
30
30
  "aria-expanded": s.value,
31
- "aria-controls": s.value ? p : void 0
31
+ "aria-controls": s.value ? g : void 0
32
32
  })), i = Z(!1), C = w("triggerRef"), v = w("contentRef"), O = w("layerRef");
33
- le({
33
+ se({
34
34
  host: () => C.value,
35
35
  isOpen: () => s.value,
36
- contentId: () => p,
36
+ contentId: () => g,
37
37
  hasPopup: () => "dialog"
38
38
  });
39
- const { lockScroll: P, unlockScroll: z } = X(), g = _(() => v.value), d = ae(), A = k(
39
+ const { lockScroll: P, unlockScroll: z } = _(), y = ee(() => v.value), d = ne(), A = k(
40
40
  () => c.zIndex === "auto" ? d.zIndex.value : c.zIndex
41
41
  );
42
- function y() {
42
+ function h() {
43
43
  s.value = !1;
44
44
  }
45
- const o = ee({
45
+ const o = te({
46
46
  onClose: () => {
47
- i.value = !0, y();
47
+ i.value = !0, h();
48
48
  }
49
49
  });
50
- function h(e) {
51
- e.key === "Escape" && (S("escapeKeyDown", e), e.defaultPrevented || y());
50
+ function b(e) {
51
+ e.key === "Escape" && (S("escapeKeyDown", e), e.defaultPrevented || h());
52
52
  }
53
53
  function N(e) {
54
- S("pointerDownOutside", e), !c.disableOutsidePointerEvents && !e.defaultPrevented && y();
54
+ S("pointerDownOutside", e), !c.disableOutsidePointerEvents && !e.defaultPrevented && h();
55
55
  }
56
- const { visible: L, dataState: T } = oe(
56
+ const { visible: L, dataState: T } = ae(
57
57
  s,
58
58
  () => i.value ? 0 : R,
59
59
  {
60
60
  onOpen: () => {
61
- i.value = !1, o.reset(), d.acquire(), P(), g.activate({ focusDelayMs: R }), document.addEventListener("keydown", h), Q(() => o.measureContentHeight(v.value));
61
+ i.value = !1, o.reset(), d.acquire(), P(), y.activate({ focusDelayMs: R }), document.addEventListener("keydown", b), W(() => o.measureContentHeight(v.value));
62
62
  },
63
63
  onCloseStart: () => {
64
- g.deactivate(), document.removeEventListener("keydown", h);
64
+ y.deactivate(), document.removeEventListener("keydown", b);
65
65
  },
66
66
  onCloseEnd: () => {
67
67
  z(), d.release();
@@ -69,19 +69,21 @@ const se = ["data-state"], re = ["aria-label", "aria-labelledby", "data-state"],
69
69
  }
70
70
  );
71
71
  E(O, (e) => d.registerElement(e));
72
- let b;
72
+ let m;
73
73
  E(v, (e) => {
74
- b?.(), b = e ? W(e, N, { ignore: () => d.elementsAbove() }) : void 0;
74
+ m?.(), m = e ? X(e, N, { ignore: () => d.elementsAbove() }) : void 0;
75
75
  }), q(() => {
76
- b?.(), document.removeEventListener("keydown", h), g.deactivate();
76
+ m?.();
77
+ }), H(() => {
78
+ m?.(), document.removeEventListener("keydown", b), y.deactivate();
77
79
  });
78
- const V = k(() => ({
80
+ const U = k(() => ({
79
81
  transform: o.dragOffset.value > 0 ? `translateY(${o.dragOffset.value}px)` : void 0,
80
82
  transition: o.isDragging.value ? "none" : "transform 0.2s ease-out",
81
83
  animation: i.value ? "none" : void 0
82
84
  }));
83
- return (e, a) => (m(), D(H, null, [
84
- e.$slots.trigger ? (m(), D("span", u({
85
+ return (e, a) => (p(), D(Y, null, [
86
+ e.$slots.trigger ? (p(), D("span", u({
85
87
  key: 0,
86
88
  ref_key: "triggerRef",
87
89
  ref: C,
@@ -91,20 +93,20 @@ const se = ["data-state"], re = ["aria-label", "aria-labelledby", "data-state"],
91
93
  }), [
92
94
  B(e.$slots, "trigger", { props: $.value }, void 0, !0)
93
95
  ], 16)) : I("", !0),
94
- t(L) ? (m(), Y(te, { key: 1 }, {
95
- default: j(() => [
96
+ t(L) ? (p(), j(oe, { key: 1 }, {
97
+ default: G(() => [
96
98
  f("div", {
97
99
  ref_key: "layerRef",
98
100
  ref: O,
99
101
  class: "sheet-layer",
100
- style: G({ zIndex: A.value })
102
+ style: J({ zIndex: A.value })
101
103
  }, [
102
104
  f("div", u({
103
105
  class: ["overlay sheet-overlay dialog-overlay", { "sheet-overlay--drag-closing": i.value }],
104
106
  "data-state": t(T)
105
- }, t(r)("overlay")), null, 16, se),
107
+ }, t(r)("overlay")), null, 16, re),
106
108
  f("div", u({
107
- id: p,
109
+ id: g,
108
110
  ref_key: "contentRef",
109
111
  ref: v,
110
112
  role: "dialog",
@@ -113,9 +115,9 @@ const se = ["data-state"], re = ["aria-label", "aria-labelledby", "data-state"],
113
115
  "aria-labelledby": l.labelledBy,
114
116
  class: "sheet-content",
115
117
  "data-state": t(T),
116
- style: V.value
118
+ style: U.value
117
119
  }, { ...e.$attrs, ...t(r)("content") }), [
118
- l.disableSwipeToClose ? I("", !0) : (m(), D("div", u({
120
+ l.disableSwipeToClose ? I("", !0) : (p(), D("div", u({
119
121
  key: 0,
120
122
  class: "sheet-content__handle",
121
123
  "aria-hidden": "true",
@@ -123,7 +125,7 @@ const se = ["data-state"], re = ["aria-label", "aria-labelledby", "data-state"],
123
125
  }, t(r)("handle"), {
124
126
  onTouchstart: a[1] || (a[1] = //@ts-ignore
125
127
  (...n) => t(o).handleDragStart && t(o).handleDragStart(...n)),
126
- onTouchmove: a[2] || (a[2] = J(
128
+ onTouchmove: a[2] || (a[2] = Q(
127
129
  //@ts-ignore
128
130
  (...n) => t(o).handleDragMove && t(o).handleDragMove(...n),
129
131
  ["prevent"]
@@ -138,7 +140,7 @@ const se = ["data-state"], re = ["aria-label", "aria-labelledby", "data-state"],
138
140
  f("div", u({ class: "sheet-content__body" }, t(r)("body")), [
139
141
  B(e.$slots, "default", {}, void 0, !0)
140
142
  ], 16)
141
- ], 16, re)
143
+ ], 16, ie)
142
144
  ], 4)
143
145
  ]),
144
146
  _: 3
@@ -147,5 +149,5 @@ const se = ["data-state"], re = ["aria-label", "aria-labelledby", "data-state"],
147
149
  }
148
150
  });
149
151
  export {
150
- ke as default
152
+ we as default
151
153
  };
@@ -1,36 +1,37 @@
1
1
  import { toValue as p, unref as g } from "vue";
2
- const s = /* @__PURE__ */ new WeakMap();
2
+ const c = /* @__PURE__ */ new WeakMap();
3
3
  let i = 0;
4
4
  const E = 500;
5
5
  function m(r) {
6
6
  const o = g(r);
7
7
  return o?.$el ?? o;
8
8
  }
9
- function h(r) {
9
+ function C(r) {
10
10
  return typeof r == "string" ? document.querySelector(r) : m(r);
11
11
  }
12
- function L(r, o, f = {}) {
13
- const n = h(r);
14
- if (!n) return () => {
12
+ function y(r, o, d = {}) {
13
+ const t = C(r);
14
+ if (!t) return () => {
15
15
  };
16
- const a = s.get(n);
17
- a && (a(), s.delete(n));
16
+ console.log("%c[onClickOutside] REGISTER", "color: lime", t);
17
+ const a = c.get(t);
18
+ a && (a(), c.delete(t));
18
19
  const u = (e) => {
19
20
  if (e.type === "touchstart")
20
21
  i = e.timeStamp;
21
22
  else if (i > 0 && e.timeStamp - i < E)
22
23
  return;
23
- const c = e.target instanceof Node ? e.target : null;
24
- if (!c) return;
25
- const d = (p(f.ignore) ?? []).map((t) => typeof t == "string" ? document.querySelector(t) : m(t)).filter((t) => t != null);
26
- n.contains(c) || d.some((t) => t.contains(c)) || (o(e), e.type === "touchstart" && e.cancelable && console.log("would prevent default here", e.target));
24
+ const s = e.target instanceof Node ? e.target : null;
25
+ if (!s) return;
26
+ const f = (p(d.ignore) ?? []).map((n) => typeof n == "string" ? document.querySelector(n) : m(n)).filter((n) => n != null);
27
+ t.contains(s) || f.some((n) => n.contains(s)) || (o(e), e.type === "touchstart" && e.cancelable && e.preventDefault());
27
28
  };
28
29
  document.addEventListener("mousedown", u, { capture: !0 }), document.addEventListener("touchstart", u, { capture: !0, passive: !1 });
29
30
  const l = () => {
30
- document.removeEventListener("mousedown", u, { capture: !0 }), document.removeEventListener("touchstart", u, { capture: !0 }), s.delete(n);
31
+ console.log("%c[onClickOutside] CLEANUP", "color: red", t), document.removeEventListener("mousedown", u, { capture: !0 }), document.removeEventListener("touchstart", u, { capture: !0 }), c.delete(t);
31
32
  };
32
- return s.set(n, l), l;
33
+ return c.set(t, l), l;
33
34
  }
34
35
  export {
35
- L as onClickOutside
36
+ y as onClickOutside
36
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profitliga/ui",
3
- "version": "2.0.12",
3
+ "version": "2.0.13",
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",