@validol4ik/uikit 0.9.12 → 0.10.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@validol4ik/uikit",
3
- "version": "0.9.12",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "main": "./dist/uikit.cjs",
6
6
  "module": "./dist/uikit.es.js",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("./QDialog-CziV1T1R.cjs"),d=require("./index-ip8uMcJF.cjs"),P={key:0,class:"bottom-sheet__title"},C={class:"bottom-sheet__body"},M={key:0,class:"bottom-sheet__loading"},N=12,E=e.defineComponent({__name:"BottomSheet",props:e.mergeModels({modelValue:{type:Boolean},title:{},loading:{type:Boolean},persistent:{type:Boolean},maxHeight:{default:"95vh"},glass:{type:Boolean},splitContent:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["hide","beforeShow"],["update:modelValue"]),setup(u,{emit:f}){const g=u,a=e.useModel(u,"modelValue"),c=f,i=e.ref(null),l=e.ref(!1),n=e.ref(0);let m=0,s=null;const b=e.computed(()=>({maxHeight:`${g.maxHeight} !important`,transform:n.value?`translateY(${n.value}px)`:void 0})),y=e.computed(()=>{var o;const t=((o=i.value)==null?void 0:o.offsetHeight)??0;return t?Math.min(1,n.value/t):0}),_=e.computed(()=>({"--bs-backdrop-blur":`${N*(1-y.value)}px`,"--bs-backdrop-blur-dur":l.value?"0s":"0.32s"})),p=()=>a.value=!1,B=t=>{if(t.target.closest(".bottom-sheet__close"))return;s=t.pointerId,m=t.clientY,l.value=!0;const o=t.currentTarget;typeof o.setPointerCapture=="function"&&o.setPointerCapture(t.pointerId)},V=t=>{!l.value||t.pointerId!==s||(n.value=Math.max(0,t.clientY-m))},v=t=>{var h;if(!l.value||t.pointerId!==s)return;l.value=!1,s=null;const o=((h=i.value)==null?void 0:h.offsetHeight)??0,r=Math.min(120,o*.25||120);if(n.value>r){p();return}n.value=0,c("hide")},S=()=>{l.value=!1,s=null,n.value=0};return(t,o)=>(e.openBlock(),e.createBlock(e.unref(k.QDialog),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=r=>a.value=r),position:"bottom",persistent:t.persistent,class:"bottom-sheet-dialog",style:e.normalizeStyle(_.value),onHide:S,onBeforeShow:o[1]||(o[1]=r=>c("beforeShow"))},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"sheetRef",ref:i,class:e.normalizeClass(["bottom-sheet",{"bottom-sheet_dragging":l.value,"bottom-sheet_glass":t.glass,"bottom-sheet_splited":t.splitContent}]),style:e.normalizeStyle(b.value)},[e.createElementVNode("div",{class:"bottom-sheet__header",onPointerdown:B,onPointermove:V,onPointerup:v,onPointercancel:v},[o[2]||(o[2]=e.createElementVNode("div",{class:"bottom-sheet__grabber"},null,-1)),e.createElementVNode("div",null,[e.renderSlot(t.$slots,"header",{},void 0,!0)]),t.title?(e.openBlock(),e.createElementBlock("div",P,[e.createTextVNode(e.toDisplayString(t.title),1),e.renderSlot(t.$slots,"title",{},void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(d.CloseButton,{class:"bottom-sheet__close",size:"xl",onClick:p})],32),e.createElementVNode("div",C,[t.loading?(e.openBlock(),e.createElementBlock("div",M,[e.createVNode(e.unref(d.QSpinner),{size:"55px",thickness:3,color:"grey-5"})])):e.renderSlot(t.$slots,"default",{key:1},void 0,!0)])],6)]),_:3},8,["modelValue","persistent","style"]))}}),$=d._export_sfc(E,[["__scopeId","data-v-18590a01"]]);exports.default=$;
@@ -1,118 +0,0 @@
1
- import { defineComponent as Y, useModel as x, ref as d, computed as u, openBlock as m, createBlock as z, unref as y, normalizeStyle as _, withCtx as N, createElementVNode as n, normalizeClass as D, renderSlot as p, createElementBlock as B, createTextVNode as Q, toDisplayString as R, createCommentVNode as U, createVNode as V, mergeModels as k } from "vue";
2
- import { Q as E } from "./QDialog-DRuDkGSu.js";
3
- import { F as T, b as A, _ as F } from "./index-BBj7ruz2.js";
4
- const L = {
5
- key: 0,
6
- class: "bottom-sheet__title"
7
- }, X = { class: "bottom-sheet__body" }, j = {
8
- key: 0,
9
- class: "bottom-sheet__loading"
10
- }, q = 12, G = /* @__PURE__ */ Y({
11
- __name: "BottomSheet",
12
- props: /* @__PURE__ */ k({
13
- modelValue: { type: Boolean },
14
- title: {},
15
- loading: { type: Boolean },
16
- persistent: { type: Boolean },
17
- maxHeight: { default: "95vh" },
18
- glass: { type: Boolean },
19
- splitContent: { type: Boolean }
20
- }, {
21
- modelValue: { type: Boolean },
22
- modelModifiers: {}
23
- }),
24
- emits: /* @__PURE__ */ k(["hide", "beforeShow"], ["update:modelValue"]),
25
- setup(c, { emit: P }) {
26
- const S = c, r = x(c, "modelValue"), h = P, i = d(null), o = d(!1), s = d(0);
27
- let v = 0, l = null;
28
- const C = u(() => ({
29
- // `!important` beats Quasar's `.q-ios-padding` max-height rule
30
- maxHeight: `${S.maxHeight} !important`,
31
- transform: s.value ? `translateY(${s.value}px)` : void 0
32
- })), M = u(() => {
33
- var t;
34
- const e = ((t = i.value) == null ? void 0 : t.offsetHeight) ?? 0;
35
- return e ? Math.min(1, s.value / e) : 0;
36
- }), $ = u(() => ({
37
- "--bs-backdrop-blur": `${q * (1 - M.value)}px`,
38
- "--bs-backdrop-blur-dur": o.value ? "0s" : "0.32s"
39
- })), f = () => r.value = !1, w = (e) => {
40
- if (e.target.closest(".bottom-sheet__close")) return;
41
- l = e.pointerId, v = e.clientY, o.value = !0;
42
- const t = e.currentTarget;
43
- typeof t.setPointerCapture == "function" && t.setPointerCapture(e.pointerId);
44
- }, H = (e) => {
45
- !o.value || e.pointerId !== l || (s.value = Math.max(0, e.clientY - v));
46
- }, g = (e) => {
47
- var b;
48
- if (!o.value || e.pointerId !== l) return;
49
- o.value = !1, l = null;
50
- const t = ((b = i.value) == null ? void 0 : b.offsetHeight) ?? 0, a = Math.min(120, t * 0.25 || 120);
51
- if (s.value > a) {
52
- f();
53
- return;
54
- }
55
- s.value = 0, h("hide");
56
- }, I = () => {
57
- o.value = !1, l = null, s.value = 0;
58
- };
59
- return (e, t) => (m(), z(y(E), {
60
- modelValue: r.value,
61
- "onUpdate:modelValue": t[0] || (t[0] = (a) => r.value = a),
62
- position: "bottom",
63
- persistent: e.persistent,
64
- class: "bottom-sheet-dialog",
65
- style: _($.value),
66
- onHide: I,
67
- onBeforeShow: t[1] || (t[1] = (a) => h("beforeShow"))
68
- }, {
69
- default: N(() => [
70
- n("div", {
71
- ref_key: "sheetRef",
72
- ref: i,
73
- class: D(["bottom-sheet", {
74
- "bottom-sheet_dragging": o.value,
75
- "bottom-sheet_glass": e.glass,
76
- "bottom-sheet_splited": e.splitContent
77
- }]),
78
- style: _(C.value)
79
- }, [
80
- n("div", {
81
- class: "bottom-sheet__header",
82
- onPointerdown: w,
83
- onPointermove: H,
84
- onPointerup: g,
85
- onPointercancel: g
86
- }, [
87
- t[2] || (t[2] = n("div", { class: "bottom-sheet__grabber" }, null, -1)),
88
- n("div", null, [
89
- p(e.$slots, "header", {}, void 0, !0)
90
- ]),
91
- e.title ? (m(), B("div", L, [
92
- Q(R(e.title), 1),
93
- p(e.$slots, "title", {}, void 0, !0)
94
- ])) : U("", !0),
95
- V(T, {
96
- class: "bottom-sheet__close",
97
- size: "xl",
98
- onClick: f
99
- })
100
- ], 32),
101
- n("div", X, [
102
- e.loading ? (m(), B("div", j, [
103
- V(y(A), {
104
- size: "55px",
105
- thickness: 3,
106
- color: "grey-5"
107
- })
108
- ])) : p(e.$slots, "default", { key: 1 }, void 0, !0)
109
- ])
110
- ], 6)
111
- ]),
112
- _: 3
113
- }, 8, ["modelValue", "persistent", "style"]));
114
- }
115
- }), W = /* @__PURE__ */ F(G, [["__scopeId", "data-v-18590a01"]]);
116
- export {
117
- W as default
118
- };