@pantograph/vue 0.32.4 → 0.32.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 (67) hide show
  1. package/dist/Accordion/index.js +169 -190
  2. package/dist/Accordion/index.umd.cjs +1 -1
  3. package/dist/AlertDialog/AlertDialog.d.ts +230 -30
  4. package/dist/AlertDialog/ConfirmDialog.d.ts +30 -0
  5. package/dist/AlertDialog/_index.d.ts +1 -0
  6. package/dist/AlertDialog/useAlertDialog.d.ts +21 -0
  7. package/dist/ColorPicker/index.js +2 -2
  8. package/dist/ColorPicker/index.umd.cjs +1 -1
  9. package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-BEfDYfnf.js → ColorPicker.vue_vue_type_style_index_0_lang-BrT753B_.js} +1 -1
  10. package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-I6QN70qq.js → ColorPicker.vue_vue_type_style_index_0_lang-ngeRTae-.js} +1 -1
  11. package/dist/ColorSwatchGroup/index.js +1 -1
  12. package/dist/ColorSwatchGroup/index.umd.cjs +1 -1
  13. package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-T7Ym5IRz.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-B4PdDPjL.js} +1 -1
  14. package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-DDy2ee2d.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-_pCAmZ53.js} +1 -1
  15. package/dist/Combobox/Combobox.d.ts +3 -2
  16. package/dist/Combobox/index.js +245 -239
  17. package/dist/Combobox/index.umd.cjs +1 -1
  18. package/dist/Combobox/types.d.ts +1 -1
  19. package/dist/Comment/CommentMention.d.ts +10 -4
  20. package/dist/Comment/index.js +31 -27
  21. package/dist/Comment/index.umd.cjs +1 -1
  22. package/dist/ConfigProvider/ConfigProvider.d.ts +1 -0
  23. package/dist/ConfigProvider/index.js +2 -1
  24. package/dist/ConfigProvider/index.umd.cjs +1 -1
  25. package/dist/ConfigProvider/utils.d.ts +3 -3
  26. package/dist/DataTable/DataTable.d.ts +1 -1
  27. package/dist/Dialog/Dialog.d.ts +877 -147
  28. package/dist/Dialog/index.js +201 -188
  29. package/dist/Dialog/index.umd.cjs +1 -1
  30. package/dist/Drawer/Drawer.d.ts +32 -10
  31. package/dist/Drawer/index.js +17 -14
  32. package/dist/Drawer/index.umd.cjs +1 -1
  33. package/dist/GOPicker/index.js +1 -1
  34. package/dist/GOPicker/index.umd.cjs +1 -1
  35. package/dist/HoverCard/HoverCard.d.ts +2 -0
  36. package/dist/HoverCard/index.d.ts +5 -1
  37. package/dist/HoverCard/index.js +54 -36
  38. package/dist/HoverCard/index.umd.cjs +1 -1
  39. package/dist/Image/Image.d.ts +1 -1
  40. package/dist/Modal/Modal.d.ts +31 -10
  41. package/dist/Modal/index.js +23 -20
  42. package/dist/Modal/index.umd.cjs +1 -1
  43. package/dist/Popover/Popover.d.ts +2 -0
  44. package/dist/Popover/index.d.ts +2 -1
  45. package/dist/Popover/index.js +55 -37
  46. package/dist/Popover/index.umd.cjs +1 -1
  47. package/dist/Popover/type.d.ts +16 -4
  48. package/dist/Popover/utils.d.ts +2 -1
  49. package/dist/Progress/ProgressCirclePath.d.ts +1 -1
  50. package/dist/Select/Select.d.ts +1 -0
  51. package/dist/Select/index.d.ts +1 -1
  52. package/dist/Select/index.js +10 -9
  53. package/dist/Select/index.umd.cjs +1 -1
  54. package/dist/Select/types.d.ts +5 -0
  55. package/dist/{Select.vue_vue_type_style_index_0_lang-79nCnnn0.js → Select.vue_vue_type_style_index_0_lang-BLHjk2Iy.js} +1 -1
  56. package/dist/{Select.vue_vue_type_style_index_0_lang-DjdX0Ab4.js → Select.vue_vue_type_style_index_0_lang-BmCg9S_L.js} +24 -20
  57. package/dist/index.js +4 -4
  58. package/dist/index.umd.cjs +1 -1
  59. package/dist/style/index.css +1 -1
  60. package/dist/use/index.js +5 -5
  61. package/dist/use/index.umd.cjs +1 -1
  62. package/dist/utils/popupContext.d.ts +8 -0
  63. package/dist/utils-CCymYPFY.js +1 -0
  64. package/dist/utils-ktMrldiH.js +214 -0
  65. package/package.json +2 -2
  66. package/dist/utils-BurtTDf8.js +0 -1
  67. package/dist/utils-FYU7FkmA.js +0 -200
@@ -1,44 +1,45 @@
1
- import { defineComponent as oe, useSlots as ne, createBlock as N, openBlock as P, h as s, mergeDefaults as Te, useAttrs as Fe, ref as Y, computed as k, unref as r, withCtx as O, createVNode as w, normalizeProps as Me, guardReactiveProps as He, Transition as Ne, createCommentVNode as I, mergeProps as je, withDirectives as Ie, createElementVNode as ze, normalizeStyle as q, normalizeClass as M, createElementBlock as Ee, vShow as Ve } from "vue";
2
- import { cva as J } from "class-variance-authority";
3
- import { DialogTitle as We, DialogRoot as Re, DialogPortal as Le, Primitive as Ue, DialogContent as $e, DialogTrigger as Ke, DialogDescription as Ge } from "reka-ui";
4
- import { isEmptyElement as f, useVModel as Q, installComponent as re } from "@pantograph/utils-vue";
5
- import { getComponentOptions as ie, normCls as u, getBemElement as p, getBemBlock as Ye, generateVariantClassList as C, getValidNumber as qe, getPxSize as y, getBemModifier as H, getStyleObject as z, getComponentName as ae } from "@pantograph/utils";
1
+ import { defineComponent as ne, useSlots as re, createBlock as N, openBlock as k, h as c, mergeDefaults as Ie, useAttrs as Ne, ref as j, computed as w, unref as r, withCtx as O, createVNode as C, normalizeProps as je, guardReactiveProps as Ee, Transition as ze, createCommentVNode as E, mergeProps as Ve, withDirectives as We, createElementVNode as Le, normalizeStyle as J, normalizeClass as H, createElementBlock as Re, vShow as Ue } from "vue";
2
+ import { cva as Q } from "class-variance-authority";
3
+ import { DialogTitle as $e, DialogRoot as Ke, DialogPortal as Ge, Primitive as Ye, DialogContent as qe, DialogTrigger as Je, DialogDescription as Qe } from "reka-ui";
4
+ import { isEmptyElement as m, useVModel as X, installComponent as ie } from "@pantograph/utils-vue";
5
+ import { getComponentOptions as ae, normCls as u, getBemElement as d, getBemBlock as Xe, generateVariantClassList as v, getValidNumber as Ze, getPxSize as y, getBemModifier as I, getStyleObject as z, getComponentName as le } from "@pantograph/utils";
6
6
  import "clsx";
7
- import { g as Je } from "../utils-FYU7FkmA.js";
8
- import { _ as X } from "../IconButton.vue_vue_type_script_setup_true_lang-BWakPloG.js";
7
+ import { g as _e, p as et } from "../utils-ktMrldiH.js";
8
+ import { _ as Z } from "../IconButton.vue_vue_type_script_setup_true_lang-BWakPloG.js";
9
9
  import "../Blanket/index.js";
10
- import { isString as Z, isFunction as Qe } from "es-toolkit";
11
- import { _ } from "../index-BQAmXDSs.js";
12
- import { usePointerSwipe as Xe } from "@vueuse/core";
13
- import { _ as ee } from "../Button.vue_vue_type_script_setup_true_lang-Be-JRcnm.js";
14
- import { _ as Ze } from "../Blanket.vue_vue_type_style_index_0_lang-DSXcWX6s.js";
15
- const le = /* @__PURE__ */ oe({
16
- ...ie("DialogTitle"),
10
+ import { isString as _, isFunction as tt } from "es-toolkit";
11
+ import { _ as ee } from "../index-BQAmXDSs.js";
12
+ import { usePointerSwipe as ot } from "@vueuse/core";
13
+ import { _ as te } from "../Button.vue_vue_type_script_setup_true_lang-Be-JRcnm.js";
14
+ import { _ as nt } from "../Blanket.vue_vue_type_style_index_0_lang-DSXcWX6s.js";
15
+ const se = /* @__PURE__ */ ne({
16
+ ...ae("DialogTitle"),
17
17
  __name: "DialogTitle",
18
18
  props: {
19
19
  class: { type: [Array, Object, String, Number, null, Boolean] },
20
20
  title: {}
21
21
  },
22
22
  setup(i) {
23
- const S = ne(), c = i, e = () => {
24
- var v;
25
- const n = (v = S.default) == null ? void 0 : v.call(S, {}), D = !f(n);
26
- if (D || c.title)
27
- return s(
28
- We,
29
- { class: u(p(a, "title"), c.class) },
30
- () => D ? n : c.title
23
+ const S = re(), s = i, e = () => {
24
+ var B;
25
+ const n = (B = S.default) == null ? void 0 : B.call(S, {}), D = !m(n);
26
+ if (D || s.title)
27
+ return c(
28
+ $e,
29
+ { class: u(d(a, "title"), s.class) },
30
+ () => D ? n : s.title
31
31
  );
32
32
  };
33
- return (n, D) => (P(), N(e));
33
+ return (n, D) => (k(), N(e));
34
34
  }
35
- }), te = ["sm", "md", "lg"], _e = ["modal", "drawer"], et = ["start", "top", "end", "bottom"], tt = ["data-screen"], se = {
35
+ }), oe = ["sm", "md", "lg"], rt = ["modal", "drawer"], it = ["start", "top", "end", "bottom"], at = ["data-screen"], ce = {
36
36
  text: "Submit"
37
- }, ce = {
37
+ }, ue = {
38
38
  text: "Cancel",
39
39
  type: "ghost",
40
40
  color: "neutral"
41
- }, ot = {
41
+ }, lt = {
42
+ renderPopupsInContent: !0,
42
43
  keyboard: !0,
43
44
  openAutoFocus: !1,
44
45
  trapFocus: !1,
@@ -67,12 +68,12 @@ const le = /* @__PURE__ */ oe({
67
68
  footerCls: void 0,
68
69
  swipeTriggerCls: void 0,
69
70
  swipeTrigger: void 0,
70
- okProps: () => se,
71
- cancelProps: () => ce
72
- }, a = Ye("dialog"), nt = /* @__PURE__ */ oe({
73
- ...ie("Dialog", !1),
71
+ okProps: () => ce,
72
+ cancelProps: () => ue
73
+ }, a = Xe("dialog"), st = /* @__PURE__ */ ne({
74
+ ...ae("Dialog", !1),
74
75
  __name: "Dialog",
75
- props: /* @__PURE__ */ Te({
76
+ props: /* @__PURE__ */ Ie({
76
77
  wrapperStyle: { type: [Boolean, null, String, Object, Array] },
77
78
  style: { type: [Boolean, null, String, Object, Array] },
78
79
  contentStyle: { type: [Boolean, null, String, Object, Array] },
@@ -124,20 +125,23 @@ const le = /* @__PURE__ */ oe({
124
125
  swipeTriggerCls: { type: [Array, Object, String, Number, null, Boolean] },
125
126
  screen: { type: Boolean },
126
127
  swipeTrigger: { type: Boolean },
128
+ renderPopupsInContent: { type: Boolean },
129
+ renderPopupsInTo: { type: Boolean },
130
+ ignoreParentTo: { type: Boolean },
127
131
  disabled: { type: Boolean },
128
132
  defer: { type: Boolean },
129
133
  forceMount: { type: Boolean },
130
134
  disableOutsidePointerEvents: { type: Boolean }
131
- }, ot),
132
- emits: ["update:open", "pointerDownOutside", "escapeKeyDown", "focusOutside", "update:fullScreen", "ok", "cancel", "close", "openChange"],
135
+ }, lt),
136
+ emits: ["update:open", "pointerDownOutside", "escapeKeyDown", "focusOutside", "update:fullScreen", "ok", "cancel", "close", "openChange", "afterClose", "afterOpen"],
133
137
  setup(i, { emit: S }) {
134
- const c = S, e = i, n = ne(), D = Fe(), v = Y(), j = Je({ triggerRef: v, props: e }), A = Q(e, "open", c, {
138
+ const s = S, e = i, n = re(), D = Ne(), B = j(), A = _e({ triggerRef: B, props: e }), T = X(e, "open", s, {
135
139
  passive: e.open === void 0,
136
140
  onChange(t) {
137
- t || c("close"), c("openChange", t);
141
+ t || s("close"), s("openChange", t);
138
142
  }
139
143
  }), x = async (t) => {
140
- if (!t && Qe(e.beforeClose))
144
+ if (!t && tt(e.beforeClose))
141
145
  try {
142
146
  const o = await e.beforeClose();
143
147
  if (e.beforeCloseDebugger && console.info("beforeClose response", o), !o)
@@ -146,30 +150,30 @@ const le = /* @__PURE__ */ oe({
146
150
  e.beforeCloseDebugger && console.error("beforeClose error", o);
147
151
  return;
148
152
  }
149
- A.value = t;
150
- }, h = Q(e, "fullScreen", c, {}), ue = () => {
153
+ T.value = t;
154
+ }, h = X(e, "fullScreen", s, {}), pe = () => {
151
155
  e.canFullScreen && (h.value = !h.value);
152
156
  }, de = (t) => {
153
- c("ok", t);
154
- }, pe = (t) => {
155
- c("cancel", t);
157
+ s("ok", t);
158
+ }, fe = (t) => {
159
+ s("cancel", t);
156
160
  }, me = () => {
157
161
  e.maskClosable && x(!1);
158
- }, fe = J(a, {
162
+ }, ge = Q(a, {
159
163
  variants: {
160
- frameless: C("frameless", a),
161
- fullscreen: C("fullscreen", a),
162
- width: C([...te, "custom"], a),
163
- type: C(_e, a),
164
- side: C(et, a)
164
+ frameless: v("frameless", a),
165
+ fullscreen: v("fullscreen", a),
166
+ width: v([...oe, "custom"], a),
167
+ type: v(rt, a),
168
+ side: v(it, a)
165
169
  }
166
- }), E = p(a, "content"), ge = J(E, {
170
+ }), V = d(a, "content"), ye = Q(V, {
167
171
  variants: {
168
- swiping: C("swiping", E)
172
+ swiping: v("swiping", V)
169
173
  }
170
- }), m = k(() => {
171
- let t = qe(e.width);
172
- return t !== void 0 ? t = `${t}px` : Z(e.width) && !te.includes(e.width) && (t = e.width), {
174
+ }), f = w(() => {
175
+ let t = Ze(e.width);
176
+ return t !== void 0 ? t = `${t}px` : _(e.width) && !oe.includes(e.width) && (t = e.width), {
173
177
  widthVariant: t ? "custom" : e.width,
174
178
  minWidth: y(e.minWidth, !0),
175
179
  width: t,
@@ -181,64 +185,64 @@ const le = /* @__PURE__ */ oe({
181
185
  mobileDrawerHeight: y(e.mobileDrawerHeight, !0),
182
186
  mobileDrawerMaxHeight: y(e.mobileDrawerMaxHeight, !0)
183
187
  };
184
- }), ye = () => {
188
+ }), he = () => {
185
189
  var o;
186
190
  const t = (o = n.trigger) == null ? void 0 : o.call(n, {});
187
- if (!f(t))
188
- return s(
189
- Ke,
191
+ if (!m(t))
192
+ return c(
193
+ Je,
190
194
  {
191
195
  asChild: !0,
192
- ref: v
196
+ ref: B
193
197
  },
194
198
  () => t
195
199
  );
196
- }, he = () => {
200
+ }, be = () => {
197
201
  var o;
198
202
  const t = (o = n.beforeTitle) == null ? void 0 : o.call(n, {});
199
- if (!f(t)) return t;
200
- }, be = () => {
203
+ if (!m(t)) return t;
204
+ }, we = () => {
201
205
  const t = () => {
202
206
  var g;
203
- const d = (g = n.beforeActions) == null ? void 0 : g.call(n, {});
204
- if (!f(d)) return d;
207
+ const p = (g = n.beforeActions) == null ? void 0 : g.call(n, {});
208
+ if (!m(p)) return p;
205
209
  }, o = () => {
206
- const d = [];
207
- if (e.canFullScreen && d.push(
208
- s(X, {
210
+ const p = [];
211
+ if (e.canFullScreen && p.push(
212
+ c(Z, {
209
213
  icon: h.value ? "tabler:arrows-minimize" : "tabler:arrows-maximize",
210
214
  type: "ghost",
211
215
  color: "neutral",
212
- onClick: ue
216
+ onClick: pe
213
217
  })
214
- ), e.closeable && d.push(
215
- s(X, {
218
+ ), e.closeable && p.push(
219
+ c(Z, {
216
220
  icon: "tabler:x",
217
221
  type: "ghost",
218
222
  color: "neutral",
219
223
  onClick: () => x(!1)
220
224
  })
221
- ), d.length) return s(_, { gap: "sm" }, () => d);
225
+ ), p.length) return c(ee, { gap: "sm" }, () => p);
222
226
  }, l = t(), b = o();
223
227
  if (l || b)
224
- return s("div", { class: u(p(a, "actions"), e.actionsCls) }, [
228
+ return c("div", { class: u(d(a, "actions"), e.actionsCls) }, [
225
229
  l,
226
230
  b
227
231
  ]);
228
- }, we = () => {
232
+ }, Ce = () => {
229
233
  var l;
230
- const t = (l = n.title) == null ? void 0 : l.call(n, {}), o = !f(t);
234
+ const t = (l = n.title) == null ? void 0 : l.call(n, {}), o = !m(t);
231
235
  if (e.title || o)
232
- return s(le, { class: e.titleCls }, () => o ? t : e.title);
233
- }, Ce = () => {
236
+ return c(se, { class: e.titleCls }, () => o ? t : e.title);
237
+ }, ve = () => {
234
238
  var l;
235
- const t = (l = n.description) == null ? void 0 : l.call(n, {}), o = !f(t);
239
+ const t = (l = n.description) == null ? void 0 : l.call(n, {}), o = !m(t);
236
240
  if (e.description || o)
237
- return s(
238
- Ge,
241
+ return c(
242
+ Qe,
239
243
  {
240
244
  class: u(
241
- p(a, "description"),
245
+ d(a, "description"),
242
246
  "paragraph",
243
247
  e.descriptionCls
244
248
  )
@@ -246,39 +250,39 @@ const le = /* @__PURE__ */ oe({
246
250
  () => o ? t : e.description
247
251
  );
248
252
  }, Se = () => {
249
- const t = be(), o = he();
253
+ const t = we(), o = be();
250
254
  if (e.frameless) return t;
251
255
  const l = () => {
252
- const g = we();
256
+ const g = Ce();
253
257
  if (g || t || o)
254
- return s(
258
+ return c(
255
259
  "div",
256
- { class: u(p(a, "title_wrapper"), e.titleWrapperCls) },
260
+ { class: u(d(a, "title_wrapper"), e.titleWrapperCls) },
257
261
  [o, g, t]
258
262
  );
259
- }, b = Ce(), d = l();
260
- if (d || b)
261
- return s(
263
+ }, b = ve(), p = l();
264
+ if (p || b)
265
+ return c(
262
266
  "div",
263
267
  {
264
- class: u(p(a, "header"), e.headerCls)
268
+ class: u(d(a, "header"), e.headerCls)
265
269
  },
266
- [d, b]
270
+ [p, b]
267
271
  );
268
272
  }, De = () => {
269
- var U, $;
270
- const t = (U = n.footer) == null ? void 0 : U.call(n, {}), o = !f(t), l = ($ = n.beforeFooterActions) == null ? void 0 : $.call(n, {}), b = !f(l);
273
+ var K, G;
274
+ const t = (K = n.footer) == null ? void 0 : K.call(n, {}), o = !m(t), l = (G = n.beforeFooterActions) == null ? void 0 : G.call(n, {}), b = !m(l);
271
275
  if (e.footer !== void 0 && !e.footer) return null;
272
276
  const g = o ? t : (() => {
273
- var K, G;
274
- const T = [];
275
- (K = e.cancelProps) != null && K.hide || T.push(
276
- s(
277
- ee,
277
+ var Y, q;
278
+ const F = [];
279
+ (Y = e.cancelProps) != null && Y.hide || F.push(
280
+ c(
281
+ te,
278
282
  {
279
- ...ce,
283
+ ...ue,
280
284
  ...e.cancelProps ?? {},
281
- onClick: pe
285
+ onClick: fe
282
286
  },
283
287
  {
284
288
  default: n.cancel,
@@ -286,11 +290,11 @@ const le = /* @__PURE__ */ oe({
286
290
  postIcon: n.cancelPostIcon
287
291
  }
288
292
  )
289
- ), (G = e.okProps) != null && G.hide || T.push(
290
- s(
291
- ee,
293
+ ), (q = e.okProps) != null && q.hide || F.push(
294
+ c(
295
+ te,
292
296
  {
293
- ...se,
297
+ ...ce,
294
298
  ...e.okProps ?? {},
295
299
  onClick: de
296
300
  },
@@ -301,38 +305,38 @@ const le = /* @__PURE__ */ oe({
301
305
  }
302
306
  )
303
307
  );
304
- const F = [];
305
- if (b && F.push(l), T.length && F.push(s(_, { gap: "sm" }, () => T)), F.length) return F;
308
+ const M = [];
309
+ if (b && M.push(l), F.length && M.push(c(ee, { gap: "sm" }, () => F)), M.length) return M;
306
310
  })();
307
311
  if (g)
308
- return s(
312
+ return c(
309
313
  "div",
310
- { class: u(p(a, "footer"), e.footerCls) },
314
+ { class: u(d(a, "footer"), e.footerCls) },
311
315
  g
312
316
  );
313
- }, ve = () => {
317
+ }, Be = () => {
314
318
  var o;
315
319
  const t = (o = n.default) == null ? void 0 : o.call(n, {});
316
- if (!f(t))
317
- return e.noBody ? t : s(
320
+ if (!m(t))
321
+ return e.noBody ? t : c(
318
322
  "div",
319
323
  {
320
- class: u(p(a, "body"), e.bodyCls)
324
+ class: u(d(a, "body"), e.bodyCls)
321
325
  },
322
326
  t
323
327
  );
324
- }, Be = k(() => {
325
- if (e.animated && Z(e.animated)) return e.animated;
326
- if (e.type === "modal") return H(a, "fade");
328
+ }, Pe = w(() => {
329
+ if (e.animated && _(e.animated)) return e.animated;
330
+ if (e.type === "modal") return I(a, "fade");
327
331
  switch (e.side) {
328
332
  case "start":
329
333
  case "end":
330
- return H(a, "side-x");
334
+ return I(a, "side-x");
331
335
  case "bottom":
332
336
  case "top":
333
- return H(a, "side-y");
337
+ return I(a, "side-y");
334
338
  }
335
- }), ke = k(() => {
339
+ }), Oe = w(() => {
336
340
  switch (e.side) {
337
341
  case "start":
338
342
  case "top":
@@ -341,131 +345,140 @@ const le = /* @__PURE__ */ oe({
341
345
  case "end":
342
346
  return 1;
343
347
  }
344
- }), B = k(
345
- () => !h.value && m.value.widthVariant !== "custom" && !(e.type === "drawer" && ["top", "bottom"].includes(e.side))
346
- ), V = Y(), { isSwiping: W, direction: R, distanceY: L } = Xe(V, {
348
+ }), P = w(
349
+ () => !h.value && f.value.widthVariant !== "custom" && !(e.type === "drawer" && ["top", "bottom"].includes(e.side))
350
+ ), W = j(), { isSwiping: L, direction: R, distanceY: U } = ot(W, {
347
351
  disableTextSelect: !0,
348
352
  threshold: 50,
349
353
  onSwipeEnd() {
350
354
  e.type === "drawer" && e.closeable && (e.side === "bottom" && R.value === "down" || e.side === "top" && R.value === "up") && x(!1);
351
355
  }
352
- }), Oe = k(() => {
353
- if (!W.value || e.type !== "drawer" || !["top", "bottom"].includes(e.side))
356
+ }), ke = w(() => {
357
+ if (!L.value || e.type !== "drawer" || !["top", "bottom"].includes(e.side))
354
358
  return;
355
- const t = Math.min(Math.abs(L.value) / 100, 1);
356
- let o = -L.value * t * 0.6;
359
+ const t = Math.min(Math.abs(U.value) / 100, 1);
360
+ let o = -U.value * t * 0.6;
357
361
  return e.side === "top" ? o = Math.min(0, o) : o = Math.max(0, o), o;
358
- }), Pe = (t) => {
359
- (!e.keyboard || !e.open) && (t.preventDefault(), t.stopPropagation()), e.open && c("escapeKeyDown", t);
360
- }, Ae = (t) => {
362
+ }), Ae = w(() => e.animated ? e.type === "drawer" ? 250 : 200 : 0), Te = () => s("afterClose"), xe = () => s("afterOpen"), Fe = (t) => {
363
+ (!e.keyboard || !e.open) && (t.preventDefault(), t.stopPropagation()), e.open && s("escapeKeyDown", t);
364
+ }, Me = (t) => {
361
365
  e.openAutoFocus || (t.preventDefault(), t.stopPropagation());
362
- }, xe = (t) => {
366
+ }, He = (t) => {
363
367
  (!e.closeOnClickOutside || !e.open) && (t.preventDefault(), t.stopPropagation());
364
- };
365
- return (t, o) => (P(), N(r(Re), {
366
- open: r(A),
368
+ }, $ = j();
369
+ return (e.renderPopupsInContent || e.renderPopupsInTo) && et({
370
+ to: w(() => {
371
+ if (e.renderPopupsInContent) return $.value;
372
+ if (e.renderPopupsInTo) return A.value.to;
373
+ })
374
+ }), (t, o) => (k(), N(r(Ke), {
375
+ open: r(T),
367
376
  "onUpdate:open": x,
368
377
  modal: i.trapFocus
369
378
  }, {
370
379
  default: O(() => [
371
- w(ye),
372
- w(r(Le), Me(He(r(j))), {
380
+ C(he),
381
+ C(r(Ge), je(Ee(r(A))), {
373
382
  default: O(() => [
374
- w(Ne, {
375
- name: Be.value,
383
+ C(ze, {
384
+ name: Pe.value,
376
385
  css: !!i.animated,
377
- duration: i.type === "drawer" ? 250 : 200
386
+ duration: Ae.value,
387
+ onAfterEnter: xe,
388
+ onAfterLeave: Te
378
389
  }, {
379
390
  default: O(() => [
380
- r(j).forceMount || r(A) ? (P(), N(r(Ue), je({
381
- "as-child": !B.value || !i.screen,
382
- key: String(!B.value || !i.screen),
391
+ r(A).forceMount || r(T) ? (k(), N(r(Ye), Ve({
392
+ "as-child": !P.value || !i.screen,
393
+ key: String(!P.value || !i.screen),
383
394
  class: {
384
- [r(u)("pc_grid", r(p)(r(a), "wrapper"), i.wrapperCls)]: B.value && i.screen,
385
- [r(H)(r(a), "as-drawer-in-mobile")]: e.type === "modal" && i.asDrawerInMobile
395
+ [r(u)("pc_grid", r(d)(r(a), "wrapper"), i.wrapperCls)]: P.value && i.screen,
396
+ [r(I)(r(a), "as-drawer-in-mobile")]: e.type === "modal" && i.asDrawerInMobile
386
397
  }
387
398
  }, r(D), {
388
399
  style: {
389
400
  zIndex: i.zIndex,
390
401
  "--ptc-dialog-transform": i.fullScreen || i.type === "modal" ? "20px" : "100%",
391
- "--ptc-dialog-transform-ratio": ke.value,
392
- ...r(z)(B.value && i.screen ? i.wrapperStyle : {})
402
+ "--ptc-dialog-transform-ratio": Oe.value,
403
+ ...r(z)(P.value && i.screen ? i.wrapperStyle : {})
393
404
  }
394
405
  }), {
395
406
  default: O(() => [
396
- Ie(ze("div", {
407
+ We(Le("div", {
408
+ ref_key: "content",
409
+ ref: $,
397
410
  "data-screen": i.screen ? "" : void 0,
398
- class: M(
411
+ class: H(
399
412
  r(u)(
400
413
  {
401
- pc_grid__container: B.value
414
+ pc_grid__container: P.value
402
415
  },
403
- r(fe)({
416
+ r(ge)({
404
417
  frameless: i.frameless,
405
418
  fullscreen: r(h),
406
- width: m.value.widthVariant,
419
+ width: f.value.widthVariant,
407
420
  type: i.type,
408
421
  side: i.side
409
422
  }),
410
423
  e.class
411
424
  )
412
425
  ),
413
- style: q({
414
- "--ptc-dialog-w": m.value.width,
415
- "--ptc-dialog-min-h": m.value.minHeight,
416
- "--ptc-dialog-h": m.value.height,
417
- "--ptc-dialog-max-h": m.value.maxHeight,
418
- "--ptc-dialog-mobile-drawer-min-h": m.value.mobileDrawerMinHeight,
419
- "--ptc-dialog-mobile-drawer-h": m.value.mobileDrawerHeight,
420
- "--ptc-dialog-mobile-drawer-max-h": m.value.mobileDrawerMaxHeight,
426
+ style: J({
427
+ "--ptc-dialog-w": f.value.width,
428
+ "--ptc-dialog-min-h": f.value.minHeight,
429
+ "--ptc-dialog-h": f.value.height,
430
+ "--ptc-dialog-max-h": f.value.maxHeight,
431
+ "--ptc-dialog-mobile-drawer-min-h": f.value.mobileDrawerMinHeight,
432
+ "--ptc-dialog-mobile-drawer-h": f.value.mobileDrawerHeight,
433
+ "--ptc-dialog-mobile-drawer-max-h": f.value.mobileDrawerMaxHeight,
421
434
  ...r(z)(i.style)
422
435
  })
423
436
  }, [
424
- !r(h) && i.mask ? (P(), N(r(Ze), {
437
+ !r(h) && i.mask ? (k(), N(r(nt), {
425
438
  key: 0,
426
439
  onClick: me,
427
- class: M(r(u)(r(p)(r(a), "blanket"), i.blanketCls)),
440
+ class: H(r(u)(r(d)(r(a), "blanket"), i.blanketCls)),
428
441
  screen: !1
429
- }, null, 8, ["class"])) : I("", !0),
430
- w(r($e), {
431
- forceMount: r(j).forceMount,
432
- onInteractOutside: xe,
433
- onOpenAutoFocus: Ae,
434
- onEscapeKeyDown: Pe,
435
- onPointerDownOutside: o[0] || (o[0] = (l) => c("pointerDownOutside", l)),
436
- onFocusOutside: o[1] || (o[1] = (l) => c("focusOutside", l)),
437
- class: M(
442
+ }, null, 8, ["class"])) : E("", !0),
443
+ C(r(qe), {
444
+ forceMount: r(A).forceMount,
445
+ onInteractOutside: He,
446
+ onOpenAutoFocus: Me,
447
+ onEscapeKeyDown: Fe,
448
+ onPointerDownOutside: o[0] || (o[0] = (l) => s("pointerDownOutside", l)),
449
+ onFocusOutside: o[1] || (o[1] = (l) => s("focusOutside", l)),
450
+ class: H(
438
451
  r(u)(
439
- r(ge)({
440
- swiping: r(W)
452
+ r(ye)({
453
+ swiping: r(L)
441
454
  }),
442
455
  i.contentCls
443
456
  )
444
457
  ),
445
- style: q({
446
- "--ptc-dialog-swipe-transform": Oe.value,
458
+ style: J({
459
+ "--ptc-dialog-swipe-transform": ke.value,
447
460
  ...r(z)(i.contentStyle)
448
461
  })
449
462
  }, {
450
463
  default: O(() => [
451
- w(Se),
452
- w(ve),
453
- w(De),
454
- e.swipeTrigger && i.type === "drawer" && ["top", "bottom"].includes(e.side) && !r(h) ? (P(), Ee("div", {
464
+ C(Se),
465
+ C(Be),
466
+ C(De),
467
+ e.swipeTrigger && i.type === "drawer" && ["top", "bottom"].includes(e.side) && !r(h) ? (k(), Re("div", {
455
468
  key: 0,
456
469
  ref_key: "swipeTrigger",
457
- ref: V,
458
- class: M(r(u)(r(p)(r(a), "swipe_trigger"), i.swipeTriggerCls))
459
- }, null, 2)) : I("", !0)
470
+ ref: W,
471
+ class: H(r(u)(r(d)(r(a), "swipe_trigger"), i.swipeTriggerCls))
472
+ }, null, 2)) : E("", !0)
460
473
  ]),
461
474
  _: 1
462
475
  }, 8, ["forceMount", "class", "style"])
463
- ], 14, tt), [
464
- [Ve, r(A)]
476
+ ], 14, at), [
477
+ [Ue, r(T)]
465
478
  ])
466
479
  ]),
467
480
  _: 1
468
- }, 16, ["as-child", "class", "style"])) : I("", !0)
481
+ }, 16, ["as-child", "class", "style"])) : E("", !0)
469
482
  ]),
470
483
  _: 1
471
484
  }, 8, ["name", "css", "duration"])
@@ -476,15 +489,15 @@ const le = /* @__PURE__ */ oe({
476
489
  _: 1
477
490
  }, 8, ["open", "modal"]));
478
491
  }
479
- }), bt = re(nt, ae("Dialog")), wt = re(le, ae("DialogTitle"));
492
+ }), Dt = ie(st, le("Dialog")), Bt = ie(se, le("DialogTitle"));
480
493
  export {
481
- ot as DIALOG_DEFAULT_PROPS,
482
- nt as Dialog,
483
- et as DialogDrawerSides,
484
- bt as DialogPlugin,
485
- te as DialogSizes,
486
- le as DialogTitle,
487
- wt as DialogTitlePlugin,
488
- _e as DialogTypes,
489
- nt as default
494
+ lt as DIALOG_DEFAULT_PROPS,
495
+ st as Dialog,
496
+ it as DialogDrawerSides,
497
+ Dt as DialogPlugin,
498
+ oe as DialogSizes,
499
+ se as DialogTitle,
500
+ Bt as DialogTitlePlugin,
501
+ rt as DialogTypes,
502
+ st as default
490
503
  };