@validol4ik/uikit 0.9.5 → 0.9.6

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 (35) hide show
  1. package/dist/{AppButtonCopy-CBOiSOFe.js → AppButtonCopy-4SswxN9E.js} +1 -1
  2. package/dist/{AppButtonCopy-CJq8F3gr.cjs → AppButtonCopy-C-ztdhMo.cjs} +1 -1
  3. package/dist/AppSelect-BmeBIImq.cjs +1 -0
  4. package/dist/AppSelect-BnjDEXM-.js +1985 -0
  5. package/dist/BottomSheet-DSqcRbL0.cjs +1 -0
  6. package/dist/BottomSheet-qodpM1oq.js +103 -0
  7. package/dist/DropdownButton-0caxYIDd.cjs +1 -0
  8. package/dist/{DropdownButton-C37a5e17.js → DropdownButton-CmUx9BXY.js} +8 -7
  9. package/dist/QDialog-Pw0XBuWk.js +264 -0
  10. package/dist/QDialog-f6QBtGnd.cjs +1 -0
  11. package/dist/QMenu-BEJJgJal.js +536 -0
  12. package/dist/QMenu-xk1k4IZT.cjs +1 -0
  13. package/dist/escape-key-BmiNyljw.cjs +1 -0
  14. package/dist/escape-key-DphMa6bO.js +281 -0
  15. package/dist/index-ChHy5BBm.cjs +1 -0
  16. package/dist/index-jCxpgc08.js +1838 -0
  17. package/dist/style.css +1 -1
  18. package/dist/types/components/buttons/CloseButton/CloseButton.vue.d.ts +5 -0
  19. package/dist/types/components/buttons/CloseButton/types.d.ts +4 -0
  20. package/dist/types/components/menu/BottomSheet/BottomSheet.vue.d.ts +38 -0
  21. package/dist/types/components/menu/BottomSheet/types.d.ts +11 -0
  22. package/dist/types/components/menu/MenuItem/MenuItem.vue.d.ts +29 -0
  23. package/dist/types/components/menu/MenuItem/types.d.ts +21 -0
  24. package/dist/types/components/menu/SystemMenu.vue.d.ts +17 -0
  25. package/dist/types/index.d.ts +58 -1
  26. package/dist/uikit.cjs +1 -1
  27. package/dist/uikit.es.js +10 -6
  28. package/package.json +1 -1
  29. package/dist/AppSelect-BOROROsn.cjs +0 -1
  30. package/dist/AppSelect-CZfoTaTG.js +0 -2304
  31. package/dist/DropdownButton-BQrXTfDg.cjs +0 -1
  32. package/dist/QMenu-Ci2SWpGp.js +0 -808
  33. package/dist/QMenu-DGfnSFI-.cjs +0 -1
  34. package/dist/index-CTeqfCv_.js +0 -1674
  35. package/dist/index-Cekw313Q.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=require("./QDialog-f6QBtGnd.cjs"),i=require("./index-ChHy5BBm.cjs"),S={key:0,class:"bottom-sheet__title"},k={class:"bottom-sheet__body"},P={key:0,class:"bottom-sheet__loading"},N=e.defineComponent({__name:"BottomSheet",props:e.mergeModels({modelValue:{type:Boolean},title:{},loading:{type:Boolean},persistent:{type:Boolean},maxHeight:{default:"95vh"}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["hide","beforeShow"],["update:modelValue"]),setup(d,{emit:h}){const g=d,a=e.useModel(d,"modelValue"),u=h,c=e.ref(null),l=e.ref(!1),n=e.ref(0);let m=0,r=null;const b=e.computed(()=>({maxHeight:g.maxHeight,transform:n.value?`translateY(${n.value}px)`:void 0})),p=()=>a.value=!1,_=t=>{if(t.target.closest(".bottom-sheet__close"))return;r=t.pointerId,m=t.clientY,l.value=!0;const o=t.currentTarget;typeof o.setPointerCapture=="function"&&o.setPointerCapture(t.pointerId)},y=t=>{!l.value||t.pointerId!==r||(n.value=Math.max(0,t.clientY-m))},f=t=>{var v;if(!l.value||t.pointerId!==r)return;l.value=!1,r=null;const o=((v=c.value)==null?void 0:v.offsetHeight)??0,s=Math.min(120,o*.25||120);if(n.value>s){p();return}n.value=0,u("hide")},V=()=>{l.value=!1,r=null,n.value=0};return(t,o)=>(e.openBlock(),e.createBlock(e.unref(B.QDialog),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=s=>a.value=s),position:"bottom",persistent:t.persistent,class:"bottom-sheet-dialog","backdrop-filter":"blur(10px)",onHide:V,onBeforeShow:o[1]||(o[1]=s=>u("beforeShow"))},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"sheetRef",ref:c,class:e.normalizeClass(["bottom-sheet",{"bottom-sheet_dragging":l.value}]),style:e.normalizeStyle(b.value)},[e.createElementVNode("div",{class:"bottom-sheet__header",onPointerdown:_,onPointermove:y,onPointerup:f,onPointercancel:f},[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",S,[e.createTextVNode(e.toDisplayString(t.title),1),e.renderSlot(t.$slots,"title",{},void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(i.CloseButton,{class:"bottom-sheet__close",size:"xl",onClick:p})],32),e.createElementVNode("div",k,[t.loading?(e.openBlock(),e.createElementBlock("div",P,[e.createVNode(e.unref(i.QSpinner),{size:"40px",color:"primary"})])):e.renderSlot(t.$slots,"default",{key:1},void 0,!0)])],6)]),_:3},8,["modelValue","persistent"]))}}),C=i._export_sfc(N,[["__scopeId","data-v-ec9c1a7b"]]);exports.default=C;
@@ -0,0 +1,103 @@
1
+ import { defineComponent as x, useModel as M, ref as i, computed as H, openBlock as d, createBlock as I, unref as b, withCtx as Y, createElementVNode as n, normalizeStyle as $, normalizeClass as z, renderSlot as u, createElementBlock as _, createTextVNode as N, toDisplayString as D, createCommentVNode as Q, createVNode as y, mergeModels as V } from "vue";
2
+ import { Q as E } from "./QDialog-Pw0XBuWk.js";
3
+ import { F as R, b as T, _ as U } from "./index-jCxpgc08.js";
4
+ const F = {
5
+ key: 0,
6
+ class: "bottom-sheet__title"
7
+ }, j = { class: "bottom-sheet__body" }, q = {
8
+ key: 0,
9
+ class: "bottom-sheet__loading"
10
+ }, A = /* @__PURE__ */ x({
11
+ __name: "BottomSheet",
12
+ props: /* @__PURE__ */ V({
13
+ modelValue: { type: Boolean },
14
+ title: {},
15
+ loading: { type: Boolean },
16
+ persistent: { type: Boolean },
17
+ maxHeight: { default: "95vh" }
18
+ }, {
19
+ modelValue: { type: Boolean },
20
+ modelModifiers: {}
21
+ }),
22
+ emits: /* @__PURE__ */ V(["hide", "beforeShow"], ["update:modelValue"]),
23
+ setup(m, { emit: B }) {
24
+ const P = m, r = M(m, "modelValue"), c = B, p = i(null), o = i(!1), l = i(0);
25
+ let f = 0, s = null;
26
+ const S = H(() => ({
27
+ maxHeight: P.maxHeight,
28
+ transform: l.value ? `translateY(${l.value}px)` : void 0
29
+ })), v = () => r.value = !1, k = (e) => {
30
+ if (e.target.closest(".bottom-sheet__close")) return;
31
+ s = e.pointerId, f = e.clientY, o.value = !0;
32
+ const t = e.currentTarget;
33
+ typeof t.setPointerCapture == "function" && t.setPointerCapture(e.pointerId);
34
+ }, C = (e) => {
35
+ !o.value || e.pointerId !== s || (l.value = Math.max(0, e.clientY - f));
36
+ }, h = (e) => {
37
+ var g;
38
+ if (!o.value || e.pointerId !== s) return;
39
+ o.value = !1, s = null;
40
+ const t = ((g = p.value) == null ? void 0 : g.offsetHeight) ?? 0, a = Math.min(120, t * 0.25 || 120);
41
+ if (l.value > a) {
42
+ v();
43
+ return;
44
+ }
45
+ l.value = 0, c("hide");
46
+ }, w = () => {
47
+ o.value = !1, s = null, l.value = 0;
48
+ };
49
+ return (e, t) => (d(), I(b(E), {
50
+ modelValue: r.value,
51
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => r.value = a),
52
+ position: "bottom",
53
+ persistent: e.persistent,
54
+ class: "bottom-sheet-dialog",
55
+ "backdrop-filter": "blur(10px)",
56
+ onHide: w,
57
+ onBeforeShow: t[1] || (t[1] = (a) => c("beforeShow"))
58
+ }, {
59
+ default: Y(() => [
60
+ n("div", {
61
+ ref_key: "sheetRef",
62
+ ref: p,
63
+ class: z(["bottom-sheet", { "bottom-sheet_dragging": o.value }]),
64
+ style: $(S.value)
65
+ }, [
66
+ n("div", {
67
+ class: "bottom-sheet__header",
68
+ onPointerdown: k,
69
+ onPointermove: C,
70
+ onPointerup: h,
71
+ onPointercancel: h
72
+ }, [
73
+ t[2] || (t[2] = n("div", { class: "bottom-sheet__grabber" }, null, -1)),
74
+ n("div", null, [
75
+ u(e.$slots, "header", {}, void 0, !0)
76
+ ]),
77
+ e.title ? (d(), _("div", F, [
78
+ N(D(e.title), 1),
79
+ u(e.$slots, "title", {}, void 0, !0)
80
+ ])) : Q("", !0),
81
+ y(R, {
82
+ class: "bottom-sheet__close",
83
+ size: "xl",
84
+ onClick: v
85
+ })
86
+ ], 32),
87
+ n("div", j, [
88
+ e.loading ? (d(), _("div", q, [
89
+ y(b(T), {
90
+ size: "40px",
91
+ color: "primary"
92
+ })
93
+ ])) : u(e.$slots, "default", { key: 1 }, void 0, !0)
94
+ ])
95
+ ], 6)
96
+ ]),
97
+ _: 3
98
+ }, 8, ["modelValue", "persistent"]));
99
+ }
100
+ }), L = /* @__PURE__ */ U(A, [["__scopeId", "data-v-ec9c1a7b"]]);
101
+ export {
102
+ L as default
103
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),l=require("./index-ChHy5BBm.cjs"),h=require("./QMenu-xk1k4IZT.cjs"),q=require("./escape-key-BmiNyljw.cjs"),k={[l.SIZES.SM]:"3px 9px",[l.SIZES.MD]:"5px 12px",[l.SIZES.LG]:"6px 15px",[l.SIZES.XL]:"9px 20px"},M=l.createComponent({name:"QBtnGroup",props:{unelevated:Boolean,outline:Boolean,flat:Boolean,rounded:Boolean,square:Boolean,push:Boolean,stretch:Boolean,glossy:Boolean,spread:Boolean},setup(e,{slots:r}){const t=n.computed(()=>{const u=["unelevated","outline","flat","rounded","square","push","stretch","glossy"].filter(d=>e[d]===!0).map(d=>`q-btn-group--${d}`).join(" ");return`q-btn-group row no-wrap${u.length!==0?" "+u:""}`+(e.spread===!0?" q-btn-group--spread":" inline")});return()=>n.h("div",{class:t.value},l.hSlot(r.default))}}),I=Object.keys(l.nonRoundBtnProps);function A(e){return I.reduce((r,t)=>{const u=e[t];return u!==void 0&&(r[t]=u),r},{})}const L=l.createComponent({name:"QBtnDropdown",props:{...l.nonRoundBtnProps,...q.useTransitionProps,modelValue:Boolean,split:Boolean,dropdownIcon:String,contentClass:[Array,String,Object],contentStyle:[Array,String,Object],cover:Boolean,persistent:Boolean,noEscDismiss:Boolean,noRouteDismiss:Boolean,autoClose:Boolean,noRefocus:Boolean,noFocus:Boolean,menuAnchor:{type:String,default:"bottom end"},menuSelf:{type:String,default:"top end"},menuOffset:Array,disableMainBtn:Boolean,disableDropdown:Boolean,noIconAnimation:Boolean,toggleAriaLabel:String},emits:["update:modelValue","click","beforeShow","show","beforeHide","hide"],setup(e,{slots:r,emit:t}){const{proxy:u}=n.getCurrentInstance(),d=n.ref(e.modelValue),i=n.ref(null),c=h.useId(),f=n.computed(()=>{const o={"aria-expanded":d.value===!0?"true":"false","aria-haspopup":"true","aria-controls":c.value,"aria-label":e.toggleAriaLabel||u.$q.lang.label[d.value===!0?"collapse":"expand"](e.label)};return(e.disable===!0||e.split===!1&&e.disableMainBtn===!0||e.disableDropdown===!0)&&(o["aria-disabled"]="true"),o}),a=n.computed(()=>"q-btn-dropdown__arrow"+(d.value===!0&&e.noIconAnimation===!1?" rotate-180":"")+(e.split===!1?" q-btn-dropdown__arrow-container":"")),b=n.computed(()=>l.getBtnDesignAttr(e)),m=n.computed(()=>A(e));n.watch(()=>e.modelValue,o=>{var s;(s=i.value)==null||s[o?"show":"hide"]()}),n.watch(()=>e.split,w);function g(o){d.value=!0,t("beforeShow",o)}function p(o){t("show",o),t("update:modelValue",!0)}function S(o){d.value=!1,t("beforeHide",o)}function v(o){t("hide",o),t("update:modelValue",!1)}function y(o){t("click",o)}function C(o){l.stop(o),w(),t("click",o)}function D(o){var s;(s=i.value)==null||s.toggle(o)}function B(o){var s;(s=i.value)==null||s.show(o)}function w(o){var s;(s=i.value)==null||s.hide(o)}return Object.assign(u,{show:B,hide:w,toggle:D}),n.onMounted(()=>{e.modelValue===!0&&B()}),()=>{const o=[n.h(l.QIcon,{class:a.value,name:e.dropdownIcon||u.$q.iconSet.arrow.dropdown})];return e.disableDropdown!==!0&&o.push(n.h(h.QMenu,{ref:i,id:c.value,class:e.contentClass,style:e.contentStyle,cover:e.cover,fit:!0,persistent:e.persistent,noEscDismiss:e.noEscDismiss,noRouteDismiss:e.noRouteDismiss,autoClose:e.autoClose,noFocus:e.noFocus,noRefocus:e.noRefocus,anchor:e.menuAnchor,self:e.menuSelf,offset:e.menuOffset,separateClosePopup:!0,transitionShow:e.transitionShow,transitionHide:e.transitionHide,transitionDuration:e.transitionDuration,onBeforeShow:g,onShow:p,onBeforeHide:S,onHide:v},r.default)),e.split===!1?n.h(l.QBtn,{class:"q-btn-dropdown q-btn-dropdown--simple",...m.value,...f.value,disable:e.disable===!0||e.disableMainBtn===!0,noWrap:!0,round:!1,onClick:y},{default:()=>l.hSlot(r.label,[]).concat(o),loading:r.loading}):n.h(M,{class:"q-btn-dropdown q-btn-dropdown--split no-wrap q-btn-item",rounded:e.rounded,square:e.square,...b.value,glossy:e.glossy,stretch:e.stretch},()=>[n.h(l.QBtn,{class:"q-btn-dropdown--current",...m.value,disable:e.disable===!0||e.disableMainBtn===!0,noWrap:!0,round:!1,onClick:C},{default:r.label,loading:r.loading}),n.h(l.QBtn,{class:"q-btn-dropdown__arrow-container q-anchor--skip",...f.value,...b.value,disable:e.disable===!0||e.disableDropdown===!0,rounded:e.rounded,color:e.color,textColor:e.textColor,dense:e.dense,size:e.size,padding:e.padding,ripple:e.ripple},()=>o)])}}}),R={key:1,class:"dropdown-btn__label"},V=n.defineComponent({__name:"DropdownButton",props:{size:{default:l.SIZES.MD},transparent:{type:Boolean},flat:{type:Boolean},rounded:{type:Boolean},color:{default:l.COLORS.PRIMARY},iconLeft:{},iconMiddle:{},hideDropIcon:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},ariaLabel:{},label:{},menuOffset:{},menuAnchor:{},menuSelf:{},menuClass:{},glass:{type:Boolean}},emits:["menuShown","menuHidden"],setup(e,{emit:r}){const t=e,u=r,d=n.ref(!1),i=n.computed(()=>["dropdown-btn",{"dropdown-btn_default":!t.transparent&&!t.flat,"dropdown-btn_trans":t.transparent,"dropdown-btn_flat":t.flat,"dropdown-btn_rounded":t.rounded,"dropdown-btn_icon-left":t.iconLeft,"dropdown-btn_icon-middle":t.iconMiddle,"dropdown-btn_no-drop":t.hideDropIcon},`dropdown-btn_${t.size}`,`dropdown-btn_${t.color}`]),c=()=>{d.value=!0,u("menuShown")},f=()=>{d.value=!1,u("menuHidden")};return(a,b)=>(n.openBlock(),n.createBlock(n.unref(L),{"no-caps":"",unelevated:"",modelValue:d.value,"onUpdate:modelValue":b[0]||(b[0]=m=>d.value=m),class:n.normalizeClass(i.value),padding:n.unref(k)[a.size||n.unref(l.SIZES).MD],loading:a.loading,disable:a.disabled||void 0,"aria-label":a.ariaLabel,"menu-offset":a.menuOffset,"menu-anchor":a.menuAnchor,"menu-self":a.menuSelf,"content-class":["kl-menu dropdown-menu",{"glass-menu":a.glass},a.menuClass],"dropdown-icon":"icon-kl icon-kl-arrow-down",onBeforeShow:c,onBeforeHide:f},{label:n.withCtx(()=>[a.iconLeft||a.iconMiddle?(n.openBlock(),n.createElementBlock("i",{key:0,class:n.normalizeClass(["icon-kl",a.iconLeft?"icon-kl_left":"icon-kl_middle",`icon-kl-${a.iconLeft||a.iconMiddle}`,a.transparent||a.flat?`text-${a.color}`:"text-secondary"])},null,2)):n.createCommentVNode("",!0),a.label?(n.openBlock(),n.createElementBlock("span",R,n.toDisplayString(a.label),1)):n.createCommentVNode("",!0),n.renderSlot(a.$slots,"label",{},void 0,!0)]),default:n.withCtx(()=>[n.renderSlot(a.$slots,"default",{},void 0,!0),n.renderSlot(a.$slots,"options",{hideMenu:f,showMenu:c},void 0,!0)]),_:3},8,["modelValue","class","padding","loading","disable","aria-label","menu-offset","menu-anchor","menu-self","content-class"]))}}),E=l._export_sfc(V,[["__scopeId","data-v-9ad6865d"]]);exports.default=E;
@@ -1,6 +1,7 @@
1
1
  import { computed as u, h as i, getCurrentInstance as P, ref as S, watch as D, onMounted as z, defineComponent as j, openBlock as g, createBlock as E, unref as h, normalizeClass as C, withCtx as k, renderSlot as p, createElementBlock as q, createCommentVNode as M, toDisplayString as F } from "vue";
2
- import { S as c, c as A, h as L, y as I, z as G, Q as U, B as v, w as W, C as N, _ as T } from "./index-CTeqfCv_.js";
3
- import { d as X, u as Y, Q as Z } from "./QMenu-Ci2SWpGp.js";
2
+ import { S as c, c as A, h as L, r as I, t as G, Q as U, v, l as W, C as N, _ as T } from "./index-jCxpgc08.js";
3
+ import { u as X, Q as Y } from "./QMenu-BEJJgJal.js";
4
+ import { u as Z } from "./escape-key-DphMa6bO.js";
4
5
  const J = {
5
6
  [c.SM]: "3px 9px",
6
7
  [c.MD]: "5px 12px",
@@ -37,7 +38,7 @@ const ne = A({
37
38
  name: "QBtnDropdown",
38
39
  props: {
39
40
  ...I,
40
- ...X,
41
+ ...Z,
41
42
  modelValue: Boolean,
42
43
  split: Boolean,
43
44
  dropdownIcon: String,
@@ -66,7 +67,7 @@ const ne = A({
66
67
  },
67
68
  emits: ["update:modelValue", "click", "beforeShow", "show", "beforeHide", "hide"],
68
69
  setup(e, { slots: l, emit: o }) {
69
- const { proxy: s } = P(), a = S(e.modelValue), r = S(null), f = Y(), b = u(() => {
70
+ const { proxy: s } = P(), a = S(e.modelValue), r = S(null), f = X(), b = u(() => {
70
71
  const n = {
71
72
  "aria-expanded": a.value === !0 ? "true" : "false",
72
73
  "aria-haspopup": "true",
@@ -125,7 +126,7 @@ const ne = A({
125
126
  })
126
127
  ];
127
128
  return e.disableDropdown !== !0 && n.push(
128
- i(Z, {
129
+ i(Y, {
129
130
  ref: r,
130
131
  id: f.value,
131
132
  class: e.contentClass,
@@ -285,7 +286,7 @@ const ne = A({
285
286
  _: 3
286
287
  }, 8, ["modelValue", "class", "padding", "loading", "disable", "aria-label", "menu-offset", "menu-anchor", "menu-self", "content-class"]));
287
288
  }
288
- }), de = /* @__PURE__ */ T(te, [["__scopeId", "data-v-9ad6865d"]]);
289
+ }), re = /* @__PURE__ */ T(te, [["__scopeId", "data-v-9ad6865d"]]);
289
290
  export {
290
- de as default
291
+ re as default
291
292
  };
@@ -0,0 +1,264 @@
1
+ import { onBeforeUnmount as te, getCurrentInstance as ge, ref as F, computed as m, watch as Y, h as w, Transition as j } from "vue";
2
+ import { c as v, r as I, a as we } from "./focusout-DjvPXP_b.js";
3
+ import { y as d, s as ye, G as pe, c as be, h as xe, E as Te } from "./index-jCxpgc08.js";
4
+ import { m as qe, n as Se, o as ke, b as Ee, u as Ce, c as Be, e as Le, d as Pe, f as _e, i as He, h as Fe, j as Q, a as ze, l as Me } from "./escape-key-DphMa6bO.js";
5
+ function De(e, t, s) {
6
+ function n() {
7
+ }
8
+ return te(() => {
9
+ e.value === !0 && void 0;
10
+ }), {
11
+ removeFromHistory: n,
12
+ addToHistory() {
13
+ }
14
+ };
15
+ }
16
+ let y = 0, z, M, p, D = !1, U, G, J, f = null;
17
+ function Re(e) {
18
+ Ve(e) && ye(e);
19
+ }
20
+ function Ve(e) {
21
+ if (e.target === document.body || e.target.classList.contains("q-layout__backdrop"))
22
+ return !0;
23
+ const t = pe(e), s = e.shiftKey && !e.deltaX, n = !s && Math.abs(e.deltaX) <= Math.abs(e.deltaY), r = s || n ? e.deltaY : e.deltaX;
24
+ for (let a = 0; a < t.length; a++) {
25
+ const i = t[a];
26
+ if (ke(i, n))
27
+ return n ? r < 0 && i.scrollTop === 0 ? !0 : r > 0 && i.scrollTop + i.clientHeight === i.scrollHeight : r < 0 && i.scrollLeft === 0 ? !0 : r > 0 && i.scrollLeft + i.clientWidth === i.scrollWidth;
28
+ }
29
+ return !0;
30
+ }
31
+ function N(e) {
32
+ e.target === document && (document.scrollingElement.scrollTop = document.scrollingElement.scrollTop);
33
+ }
34
+ function q(e) {
35
+ D !== !0 && (D = !0, requestAnimationFrame(() => {
36
+ D = !1;
37
+ const { height: t } = e.target, { clientHeight: s, scrollTop: n } = document.scrollingElement;
38
+ (p === void 0 || t !== window.innerHeight) && (p = s - t, document.scrollingElement.scrollTop = n), n > p && (document.scrollingElement.scrollTop -= Math.ceil((n - p) / 8));
39
+ }));
40
+ }
41
+ function Z(e) {
42
+ const t = document.body, s = window.visualViewport !== void 0;
43
+ if (e === "add") {
44
+ const { overflowY: n, overflowX: r } = window.getComputedStyle(t);
45
+ z = qe(window), M = Se(window), U = t.style.left, G = t.style.top, J = window.location.href, t.style.left = `-${z}px`, t.style.top = `-${M}px`, r !== "hidden" && (r === "scroll" || t.scrollWidth > window.innerWidth) && t.classList.add("q-body--force-scrollbar-x"), n !== "hidden" && (n === "scroll" || t.scrollHeight > window.innerHeight) && t.classList.add("q-body--force-scrollbar-y"), t.classList.add("q-body--prevent-scroll"), document.qScrollPrevented = !0, v.is.ios === !0 && (s === !0 ? (window.scrollTo(0, 0), window.visualViewport.addEventListener("resize", q, d.passiveCapture), window.visualViewport.addEventListener("scroll", q, d.passiveCapture), window.scrollTo(0, 0)) : window.addEventListener("scroll", N, d.passiveCapture));
46
+ }
47
+ v.is.desktop === !0 && v.is.mac === !0 && window[`${e}EventListener`]("wheel", Re, d.notPassive), e === "remove" && (v.is.ios === !0 && (s === !0 ? (window.visualViewport.removeEventListener("resize", q, d.passiveCapture), window.visualViewport.removeEventListener("scroll", q, d.passiveCapture)) : window.removeEventListener("scroll", N, d.passiveCapture)), t.classList.remove("q-body--prevent-scroll"), t.classList.remove("q-body--force-scrollbar-x"), t.classList.remove("q-body--force-scrollbar-y"), document.qScrollPrevented = !1, t.style.left = U, t.style.top = G, window.location.href === J && window.scrollTo(z, M), p = void 0);
48
+ }
49
+ function $e(e) {
50
+ let t = "add";
51
+ if (e === !0) {
52
+ if (y++, f !== null) {
53
+ clearTimeout(f), f = null;
54
+ return;
55
+ }
56
+ if (y > 1) return;
57
+ } else {
58
+ if (y === 0 || (y--, y > 0)) return;
59
+ if (t = "remove", v.is.ios === !0 && v.is.nativeMobile === !0) {
60
+ f !== null && clearTimeout(f), f = setTimeout(() => {
61
+ Z(t), f = null;
62
+ }, 100);
63
+ return;
64
+ }
65
+ }
66
+ Z(t);
67
+ }
68
+ function Ae() {
69
+ let e;
70
+ return {
71
+ preventBodyScroll(t) {
72
+ t !== e && (e !== void 0 || t === !0) && (e = t, $e(t));
73
+ }
74
+ };
75
+ }
76
+ let S = 0;
77
+ const Oe = {
78
+ standard: "fixed-full flex-center",
79
+ top: "fixed-top justify-center",
80
+ bottom: "fixed-bottom justify-center",
81
+ right: "fixed-right items-center",
82
+ left: "fixed-left items-center"
83
+ }, ee = {
84
+ standard: ["scale", "scale"],
85
+ top: ["slide-down", "slide-up"],
86
+ bottom: ["slide-up", "slide-down"],
87
+ right: ["slide-left", "slide-right"],
88
+ left: ["slide-right", "slide-left"]
89
+ }, je = be({
90
+ name: "QDialog",
91
+ inheritAttrs: !1,
92
+ props: {
93
+ ...Be,
94
+ ...Ce,
95
+ transitionShow: String,
96
+ // override useTransitionProps
97
+ transitionHide: String,
98
+ // override useTransitionProps
99
+ persistent: Boolean,
100
+ autoClose: Boolean,
101
+ allowFocusOutside: Boolean,
102
+ noEscDismiss: Boolean,
103
+ noBackdropDismiss: Boolean,
104
+ noRouteDismiss: Boolean,
105
+ noRefocus: Boolean,
106
+ noFocus: Boolean,
107
+ noShake: Boolean,
108
+ seamless: Boolean,
109
+ maximized: Boolean,
110
+ fullWidth: Boolean,
111
+ fullHeight: Boolean,
112
+ square: Boolean,
113
+ backdropFilter: String,
114
+ position: {
115
+ type: String,
116
+ default: "standard",
117
+ validator: (e) => ["standard", "top", "bottom", "left", "right"].includes(e)
118
+ }
119
+ },
120
+ emits: [
121
+ ...Ee,
122
+ "shake",
123
+ "click",
124
+ "escapeKey"
125
+ ],
126
+ setup(e, { slots: t, emit: s, attrs: n }) {
127
+ const r = ge(), a = F(null), i = F(!1), h = F(!1);
128
+ let u = null, c = null, b, k;
129
+ const oe = m(
130
+ () => e.persistent !== !0 && e.noRouteDismiss !== !0 && e.seamless !== !0
131
+ ), { preventBodyScroll: R } = Ae(), { registerTimeout: V } = Le(), { registerTick: le, removeTick: $ } = Pe(), { transitionProps: ie, transitionStyle: A } = _e(
132
+ e,
133
+ () => ee[e.position][0],
134
+ () => ee[e.position][1]
135
+ ), ne = m(() => A.value + (e.backdropFilter !== void 0 ? `;backdrop-filter:${e.backdropFilter};-webkit-backdrop-filter:${e.backdropFilter}` : "")), { showPortal: O, hidePortal: W, portalIsAccessible: se, renderPortal: re } = He(
136
+ r,
137
+ a,
138
+ he,
139
+ "dialog"
140
+ ), { hide: E } = Fe({
141
+ showing: i,
142
+ hideOnRouteChange: oe,
143
+ handleShow: de,
144
+ handleHide: fe,
145
+ processOnMount: !0
146
+ });
147
+ De(i);
148
+ const ae = m(
149
+ () => `q-dialog__inner flex no-pointer-events q-dialog__inner--${e.maximized === !0 ? "maximized" : "minimized"} q-dialog__inner--${e.position} ${Oe[e.position]}` + (h.value === !0 ? " q-dialog__inner--animating" : "") + (e.fullWidth === !0 ? " q-dialog__inner--fullwidth" : "") + (e.fullHeight === !0 ? " q-dialog__inner--fullheight" : "") + (e.square === !0 ? " q-dialog__inner--square" : "")
150
+ ), x = m(() => i.value === !0 && e.seamless !== !0), ue = m(() => e.autoClose === !0 ? { onClick: me } : {}), ce = m(() => [
151
+ `q-dialog fullscreen no-pointer-events q-dialog--${x.value === !0 ? "modal" : "seamless"}`,
152
+ n.class
153
+ ]);
154
+ Y(() => e.maximized, (o) => {
155
+ i.value === !0 && L(o);
156
+ }), Y(x, (o) => {
157
+ R(o), o === !0 ? (we(P), Me(B)) : (I(P), Q(B));
158
+ });
159
+ function de(o) {
160
+ var l;
161
+ c = e.noRefocus === !1 && document.activeElement !== null ? document.activeElement : null, L(e.maximized), O(), h.value = !0, e.noFocus !== !0 ? ((l = document.activeElement) == null || l.blur(), le(g)) : $(), V(() => {
162
+ if (r.proxy.$q.platform.is.ios === !0) {
163
+ if (e.seamless !== !0 && document.activeElement) {
164
+ const { top: T, bottom: _ } = document.activeElement.getBoundingClientRect(), { innerHeight: X } = window, H = window.visualViewport !== void 0 ? window.visualViewport.height : X;
165
+ T > 0 && _ > H / 2 && (document.scrollingElement.scrollTop = Math.min(
166
+ document.scrollingElement.scrollHeight - H,
167
+ _ >= X ? 1 / 0 : Math.ceil(document.scrollingElement.scrollTop + _ - H / 2)
168
+ )), document.activeElement.scrollIntoView();
169
+ }
170
+ k = !0, a.value.click(), k = !1;
171
+ }
172
+ O(!0), h.value = !1, s("show", o);
173
+ }, e.transitionDuration);
174
+ }
175
+ function fe(o) {
176
+ $(), K(!0), h.value = !0, W(), c !== null && ((((o == null ? void 0 : o.type.indexOf("key")) === 0 ? c.closest('[tabindex]:not([tabindex^="-"])') : void 0) || c).focus(), c = null), V(() => {
177
+ W(!0), h.value = !1, s("hide", o);
178
+ }, e.transitionDuration);
179
+ }
180
+ function g(o) {
181
+ ze(() => {
182
+ let l = a.value;
183
+ if (l !== null) {
184
+ if (o !== void 0) {
185
+ const T = l.querySelector(o);
186
+ if (T !== null) {
187
+ T.focus({ preventScroll: !0 });
188
+ return;
189
+ }
190
+ }
191
+ l.contains(document.activeElement) !== !0 && (l = l.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]") || l.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]") || l.querySelector("[autofocus], [data-autofocus]") || l, l.focus({ preventScroll: !0 }));
192
+ }
193
+ });
194
+ }
195
+ function C(o) {
196
+ o && typeof o.focus == "function" ? o.focus({ preventScroll: !0 }) : g(), s("shake");
197
+ const l = a.value;
198
+ l !== null && (l.classList.remove("q-animate--scale"), l.classList.add("q-animate--scale"), u !== null && clearTimeout(u), u = setTimeout(() => {
199
+ u = null, a.value !== null && (l.classList.remove("q-animate--scale"), g());
200
+ }, 170));
201
+ }
202
+ function B() {
203
+ e.seamless !== !0 && (e.persistent === !0 || e.noEscDismiss === !0 ? e.maximized !== !0 && e.noShake !== !0 && C() : (s("escapeKey"), E()));
204
+ }
205
+ function K(o) {
206
+ u !== null && (clearTimeout(u), u = null), (o === !0 || i.value === !0) && (L(!1), e.seamless !== !0 && (R(!1), I(P), Q(B))), o !== !0 && (c = null);
207
+ }
208
+ function L(o) {
209
+ o === !0 ? b !== !0 && (S < 1 && document.body.classList.add("q-body--dialog"), S++, b = !0) : b === !0 && (S < 2 && document.body.classList.remove("q-body--dialog"), S--, b = !1);
210
+ }
211
+ function me(o) {
212
+ k !== !0 && (E(o), s("click", o));
213
+ }
214
+ function ve(o) {
215
+ e.persistent !== !0 && e.noBackdropDismiss !== !0 ? E(o) : e.noShake !== !0 && C();
216
+ }
217
+ function P(o) {
218
+ e.allowFocusOutside !== !0 && se.value === !0 && Te(a.value, o.target) !== !0 && g('[tabindex]:not([tabindex="-1"])');
219
+ }
220
+ Object.assign(r.proxy, {
221
+ // expose public methods
222
+ focus: g,
223
+ shake: C,
224
+ // private but needed by QSelect
225
+ __updateRefocusTarget(o) {
226
+ c = o || null;
227
+ }
228
+ }), te(K);
229
+ function he() {
230
+ return w("div", {
231
+ role: "dialog",
232
+ "aria-modal": x.value === !0 ? "true" : "false",
233
+ ...n,
234
+ class: ce.value
235
+ }, [
236
+ w(j, {
237
+ name: "q-transition--fade",
238
+ appear: !0
239
+ }, () => x.value === !0 ? w("div", {
240
+ class: "q-dialog__backdrop fixed-full",
241
+ style: ne.value,
242
+ "aria-hidden": "true",
243
+ tabindex: -1,
244
+ onClick: ve
245
+ }) : null),
246
+ w(
247
+ j,
248
+ ie.value,
249
+ () => i.value === !0 ? w("div", {
250
+ ref: a,
251
+ class: ae.value,
252
+ style: A.value,
253
+ tabindex: -1,
254
+ ...ue.value
255
+ }, xe(t.default)) : null
256
+ )
257
+ ]);
258
+ }
259
+ return re;
260
+ }
261
+ });
262
+ export {
263
+ je as Q
264
+ };
@@ -0,0 +1 @@
1
+ "use strict";const i=require("vue"),f=require("./focusout-DzWGke-4.cjs"),u=require("./index-ChHy5BBm.cjs"),r=require("./escape-key-BmiNyljw.cjs");function ce(e,t,a){function s(){}return i.onBeforeUnmount(()=>{e.value===!0&&void 0}),{removeFromHistory:s,addToHistory(){}}}let p=0,H,z,y,O=!1,X,Y,I,h=null;function de(e){fe(e)&&u.stopAndPrevent(e)}function fe(e){if(e.target===document.body||e.target.classList.contains("q-layout__backdrop"))return!0;const t=u.getEventPath(e),a=e.shiftKey&&!e.deltaX,s=!a&&Math.abs(e.deltaX)<=Math.abs(e.deltaY),c=a||s?e.deltaY:e.deltaX;for(let d=0;d<t.length;d++){const n=t[d];if(r.hasScrollbar(n,s))return s?c<0&&n.scrollTop===0?!0:c>0&&n.scrollTop+n.clientHeight===n.scrollHeight:c<0&&n.scrollLeft===0?!0:c>0&&n.scrollLeft+n.clientWidth===n.scrollWidth}return!0}function j(e){e.target===document&&(document.scrollingElement.scrollTop=document.scrollingElement.scrollTop)}function T(e){O!==!0&&(O=!0,requestAnimationFrame(()=>{O=!1;const{height:t}=e.target,{clientHeight:a,scrollTop:s}=document.scrollingElement;(y===void 0||t!==window.innerHeight)&&(y=a-t,document.scrollingElement.scrollTop=s),s>y&&(document.scrollingElement.scrollTop-=Math.ceil((s-y)/8))}))}function Q(e){const t=document.body,a=window.visualViewport!==void 0;if(e==="add"){const{overflowY:s,overflowX:c}=window.getComputedStyle(t);H=r.getHorizontalScrollPosition(window),z=r.getVerticalScrollPosition(window),X=t.style.left,Y=t.style.top,I=window.location.href,t.style.left=`-${H}px`,t.style.top=`-${z}px`,c!=="hidden"&&(c==="scroll"||t.scrollWidth>window.innerWidth)&&t.classList.add("q-body--force-scrollbar-x"),s!=="hidden"&&(s==="scroll"||t.scrollHeight>window.innerHeight)&&t.classList.add("q-body--force-scrollbar-y"),t.classList.add("q-body--prevent-scroll"),document.qScrollPrevented=!0,f.client.is.ios===!0&&(a===!0?(window.scrollTo(0,0),window.visualViewport.addEventListener("resize",T,u.listenOpts.passiveCapture),window.visualViewport.addEventListener("scroll",T,u.listenOpts.passiveCapture),window.scrollTo(0,0)):window.addEventListener("scroll",j,u.listenOpts.passiveCapture))}f.client.is.desktop===!0&&f.client.is.mac===!0&&window[`${e}EventListener`]("wheel",de,u.listenOpts.notPassive),e==="remove"&&(f.client.is.ios===!0&&(a===!0?(window.visualViewport.removeEventListener("resize",T,u.listenOpts.passiveCapture),window.visualViewport.removeEventListener("scroll",T,u.listenOpts.passiveCapture)):window.removeEventListener("scroll",j,u.listenOpts.passiveCapture)),t.classList.remove("q-body--prevent-scroll"),t.classList.remove("q-body--force-scrollbar-x"),t.classList.remove("q-body--force-scrollbar-y"),document.qScrollPrevented=!1,t.style.left=X,t.style.top=Y,window.location.href===I&&window.scrollTo(H,z),y=void 0)}function me(e){let t="add";if(e===!0){if(p++,h!==null){clearTimeout(h),h=null;return}if(p>1)return}else{if(p===0||(p--,p>0))return;if(t="remove",f.client.is.ios===!0&&f.client.is.nativeMobile===!0){h!==null&&clearTimeout(h),h=setTimeout(()=>{Q(t),h=null},100);return}}Q(t)}function ve(){let e;return{preventBodyScroll(t){t!==e&&(e!==void 0||t===!0)&&(e=t,me(t))}}}let S=0;const he={standard:"fixed-full flex-center",top:"fixed-top justify-center",bottom:"fixed-bottom justify-center",right:"fixed-right items-center",left:"fixed-left items-center"},U={standard:["scale","scale"],top:["slide-down","slide-up"],bottom:["slide-up","slide-down"],right:["slide-left","slide-right"],left:["slide-right","slide-left"]},ge=u.createComponent({name:"QDialog",inheritAttrs:!1,props:{...r.useModelToggleProps,...r.useTransitionProps,transitionShow:String,transitionHide:String,persistent:Boolean,autoClose:Boolean,allowFocusOutside:Boolean,noEscDismiss:Boolean,noBackdropDismiss:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,noShake:Boolean,seamless:Boolean,maximized:Boolean,fullWidth:Boolean,fullHeight:Boolean,square:Boolean,backdropFilter:String,position:{type:String,default:"standard",validator:e=>["standard","top","bottom","left","right"].includes(e)}},emits:[...r.useModelToggleEmits,"shake","click","escapeKey"],setup(e,{slots:t,emit:a,attrs:s}){const c=i.getCurrentInstance(),d=i.ref(null),n=i.ref(!1),g=i.ref(!1);let m=null,v=null,b,k;const G=i.computed(()=>e.persistent!==!0&&e.noRouteDismiss!==!0&&e.seamless!==!0),{preventBodyScroll:M}=ve(),{registerTimeout:D}=r.useTimeout(),{registerTick:J,removeTick:R}=r.useTick(),{transitionProps:N,transitionStyle:V}=r.useTransition(e,()=>U[e.position][0],()=>U[e.position][1]),Z=i.computed(()=>V.value+(e.backdropFilter!==void 0?`;backdrop-filter:${e.backdropFilter};-webkit-backdrop-filter:${e.backdropFilter}`:"")),{showPortal:$,hidePortal:A,portalIsAccessible:ee,renderPortal:te}=r.usePortal(c,d,ue,"dialog"),{hide:E}=r.useModelToggle({showing:n,hideOnRouteChange:G,handleShow:ne,handleHide:se,processOnMount:!0});ce(n);const oe=i.computed(()=>`q-dialog__inner flex no-pointer-events q-dialog__inner--${e.maximized===!0?"maximized":"minimized"} q-dialog__inner--${e.position} ${he[e.position]}`+(g.value===!0?" q-dialog__inner--animating":"")+(e.fullWidth===!0?" q-dialog__inner--fullwidth":"")+(e.fullHeight===!0?" q-dialog__inner--fullheight":"")+(e.square===!0?" q-dialog__inner--square":"")),q=i.computed(()=>n.value===!0&&e.seamless!==!0),ie=i.computed(()=>e.autoClose===!0?{onClick:re}:{}),le=i.computed(()=>[`q-dialog fullscreen no-pointer-events q-dialog--${q.value===!0?"modal":"seamless"}`,s.class]);i.watch(()=>e.maximized,o=>{n.value===!0&&L(o)}),i.watch(q,o=>{M(o),o===!0?(f.addFocusout(P),r.addEscapeKey(C)):(f.removeFocusout(P),r.removeEscapeKey(C))});function ne(o){var l;v=e.noRefocus===!1&&document.activeElement!==null?document.activeElement:null,L(e.maximized),$(),g.value=!0,e.noFocus!==!0?((l=document.activeElement)==null||l.blur(),J(w)):R(),D(()=>{if(c.proxy.$q.platform.is.ios===!0){if(e.seamless!==!0&&document.activeElement){const{top:x,bottom:_}=document.activeElement.getBoundingClientRect(),{innerHeight:W}=window,F=window.visualViewport!==void 0?window.visualViewport.height:W;x>0&&_>F/2&&(document.scrollingElement.scrollTop=Math.min(document.scrollingElement.scrollHeight-F,_>=W?1/0:Math.ceil(document.scrollingElement.scrollTop+_-F/2))),document.activeElement.scrollIntoView()}k=!0,d.value.click(),k=!1}$(!0),g.value=!1,a("show",o)},e.transitionDuration)}function se(o){R(),K(!0),g.value=!0,A(),v!==null&&((((o==null?void 0:o.type.indexOf("key"))===0?v.closest('[tabindex]:not([tabindex^="-"])'):void 0)||v).focus(),v=null),D(()=>{A(!0),g.value=!1,a("hide",o)},e.transitionDuration)}function w(o){r.addFocusFn(()=>{let l=d.value;if(l!==null){if(o!==void 0){const x=l.querySelector(o);if(x!==null){x.focus({preventScroll:!0});return}}l.contains(document.activeElement)!==!0&&(l=l.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]")||l.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]")||l.querySelector("[autofocus], [data-autofocus]")||l,l.focus({preventScroll:!0}))}})}function B(o){o&&typeof o.focus=="function"?o.focus({preventScroll:!0}):w(),a("shake");const l=d.value;l!==null&&(l.classList.remove("q-animate--scale"),l.classList.add("q-animate--scale"),m!==null&&clearTimeout(m),m=setTimeout(()=>{m=null,d.value!==null&&(l.classList.remove("q-animate--scale"),w())},170))}function C(){e.seamless!==!0&&(e.persistent===!0||e.noEscDismiss===!0?e.maximized!==!0&&e.noShake!==!0&&B():(a("escapeKey"),E()))}function K(o){m!==null&&(clearTimeout(m),m=null),(o===!0||n.value===!0)&&(L(!1),e.seamless!==!0&&(M(!1),f.removeFocusout(P),r.removeEscapeKey(C))),o!==!0&&(v=null)}function L(o){o===!0?b!==!0&&(S<1&&document.body.classList.add("q-body--dialog"),S++,b=!0):b===!0&&(S<2&&document.body.classList.remove("q-body--dialog"),S--,b=!1)}function re(o){k!==!0&&(E(o),a("click",o))}function ae(o){e.persistent!==!0&&e.noBackdropDismiss!==!0?E(o):e.noShake!==!0&&B()}function P(o){e.allowFocusOutside!==!0&&ee.value===!0&&u.childHasFocus(d.value,o.target)!==!0&&w('[tabindex]:not([tabindex="-1"])')}Object.assign(c.proxy,{focus:w,shake:B,__updateRefocusTarget(o){v=o||null}}),i.onBeforeUnmount(K);function ue(){return i.h("div",{role:"dialog","aria-modal":q.value===!0?"true":"false",...s,class:le.value},[i.h(i.Transition,{name:"q-transition--fade",appear:!0},()=>q.value===!0?i.h("div",{class:"q-dialog__backdrop fixed-full",style:Z.value,"aria-hidden":"true",tabindex:-1,onClick:ae}):null),i.h(i.Transition,N.value,()=>n.value===!0?i.h("div",{ref:d,class:oe.value,style:V.value,tabindex:-1,...ie.value},u.hSlot(t.default)):null)])}return te}});exports.QDialog=ge;