@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.
- package/dist/Accordion/index.js +169 -190
- package/dist/Accordion/index.umd.cjs +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts +230 -30
- package/dist/AlertDialog/ConfirmDialog.d.ts +30 -0
- package/dist/AlertDialog/_index.d.ts +1 -0
- package/dist/AlertDialog/useAlertDialog.d.ts +21 -0
- package/dist/ColorPicker/index.js +2 -2
- package/dist/ColorPicker/index.umd.cjs +1 -1
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-BEfDYfnf.js → ColorPicker.vue_vue_type_style_index_0_lang-BrT753B_.js} +1 -1
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-I6QN70qq.js → ColorPicker.vue_vue_type_style_index_0_lang-ngeRTae-.js} +1 -1
- package/dist/ColorSwatchGroup/index.js +1 -1
- package/dist/ColorSwatchGroup/index.umd.cjs +1 -1
- package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-T7Ym5IRz.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-B4PdDPjL.js} +1 -1
- package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-DDy2ee2d.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-_pCAmZ53.js} +1 -1
- package/dist/Combobox/Combobox.d.ts +3 -2
- package/dist/Combobox/index.js +245 -239
- package/dist/Combobox/index.umd.cjs +1 -1
- package/dist/Combobox/types.d.ts +1 -1
- package/dist/Comment/CommentMention.d.ts +10 -4
- package/dist/Comment/index.js +31 -27
- package/dist/Comment/index.umd.cjs +1 -1
- package/dist/ConfigProvider/ConfigProvider.d.ts +1 -0
- package/dist/ConfigProvider/index.js +2 -1
- package/dist/ConfigProvider/index.umd.cjs +1 -1
- package/dist/ConfigProvider/utils.d.ts +3 -3
- package/dist/DataTable/DataTable.d.ts +1 -1
- package/dist/Dialog/Dialog.d.ts +877 -147
- package/dist/Dialog/index.js +201 -188
- package/dist/Dialog/index.umd.cjs +1 -1
- package/dist/Drawer/Drawer.d.ts +32 -10
- package/dist/Drawer/index.js +17 -14
- package/dist/Drawer/index.umd.cjs +1 -1
- package/dist/GOPicker/index.js +1 -1
- package/dist/GOPicker/index.umd.cjs +1 -1
- package/dist/HoverCard/HoverCard.d.ts +2 -0
- package/dist/HoverCard/index.d.ts +5 -1
- package/dist/HoverCard/index.js +54 -36
- package/dist/HoverCard/index.umd.cjs +1 -1
- package/dist/Image/Image.d.ts +1 -1
- package/dist/Modal/Modal.d.ts +31 -10
- package/dist/Modal/index.js +23 -20
- package/dist/Modal/index.umd.cjs +1 -1
- package/dist/Popover/Popover.d.ts +2 -0
- package/dist/Popover/index.d.ts +2 -1
- package/dist/Popover/index.js +55 -37
- package/dist/Popover/index.umd.cjs +1 -1
- package/dist/Popover/type.d.ts +16 -4
- package/dist/Popover/utils.d.ts +2 -1
- package/dist/Progress/ProgressCirclePath.d.ts +1 -1
- package/dist/Select/Select.d.ts +1 -0
- package/dist/Select/index.d.ts +1 -1
- package/dist/Select/index.js +10 -9
- package/dist/Select/index.umd.cjs +1 -1
- package/dist/Select/types.d.ts +5 -0
- package/dist/{Select.vue_vue_type_style_index_0_lang-79nCnnn0.js → Select.vue_vue_type_style_index_0_lang-BLHjk2Iy.js} +1 -1
- 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
- package/dist/index.js +4 -4
- package/dist/index.umd.cjs +1 -1
- package/dist/style/index.css +1 -1
- package/dist/use/index.js +5 -5
- package/dist/use/index.umd.cjs +1 -1
- package/dist/utils/popupContext.d.ts +8 -0
- package/dist/utils-CCymYPFY.js +1 -0
- package/dist/utils-ktMrldiH.js +214 -0
- package/package.json +2 -2
- package/dist/utils-BurtTDf8.js +0 -1
- package/dist/utils-FYU7FkmA.js +0 -200
package/dist/Dialog/index.js
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cva as
|
|
3
|
-
import { DialogTitle as
|
|
4
|
-
import { isEmptyElement as
|
|
5
|
-
import { getComponentOptions as
|
|
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
|
|
8
|
-
import { _ as
|
|
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
|
|
11
|
-
import { _ } from "../index-BQAmXDSs.js";
|
|
12
|
-
import { usePointerSwipe as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { _ as
|
|
15
|
-
const
|
|
16
|
-
...
|
|
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 =
|
|
24
|
-
var
|
|
25
|
-
const n = (
|
|
26
|
-
if (D ||
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
{ class: u(
|
|
30
|
-
() => D ? n :
|
|
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) => (
|
|
33
|
+
return (n, D) => (k(), N(e));
|
|
34
34
|
}
|
|
35
|
-
}),
|
|
35
|
+
}), oe = ["sm", "md", "lg"], rt = ["modal", "drawer"], it = ["start", "top", "end", "bottom"], at = ["data-screen"], ce = {
|
|
36
36
|
text: "Submit"
|
|
37
|
-
},
|
|
37
|
+
}, ue = {
|
|
38
38
|
text: "Cancel",
|
|
39
39
|
type: "ghost",
|
|
40
40
|
color: "neutral"
|
|
41
|
-
},
|
|
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: () =>
|
|
71
|
-
cancelProps: () =>
|
|
72
|
-
}, a =
|
|
73
|
-
...
|
|
71
|
+
okProps: () => ce,
|
|
72
|
+
cancelProps: () => ue
|
|
73
|
+
}, a = Xe("dialog"), st = /* @__PURE__ */ ne({
|
|
74
|
+
...ae("Dialog", !1),
|
|
74
75
|
__name: "Dialog",
|
|
75
|
-
props: /* @__PURE__ */
|
|
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
|
-
},
|
|
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
|
|
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 ||
|
|
141
|
+
t || s("close"), s("openChange", t);
|
|
138
142
|
}
|
|
139
143
|
}), x = async (t) => {
|
|
140
|
-
if (!t &&
|
|
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
|
-
|
|
150
|
-
}, h =
|
|
153
|
+
T.value = t;
|
|
154
|
+
}, h = X(e, "fullScreen", s, {}), pe = () => {
|
|
151
155
|
e.canFullScreen && (h.value = !h.value);
|
|
152
156
|
}, de = (t) => {
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
|
|
157
|
+
s("ok", t);
|
|
158
|
+
}, fe = (t) => {
|
|
159
|
+
s("cancel", t);
|
|
156
160
|
}, me = () => {
|
|
157
161
|
e.maskClosable && x(!1);
|
|
158
|
-
},
|
|
162
|
+
}, ge = Q(a, {
|
|
159
163
|
variants: {
|
|
160
|
-
frameless:
|
|
161
|
-
fullscreen:
|
|
162
|
-
width:
|
|
163
|
-
type:
|
|
164
|
-
side:
|
|
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
|
-
}),
|
|
170
|
+
}), V = d(a, "content"), ye = Q(V, {
|
|
167
171
|
variants: {
|
|
168
|
-
swiping:
|
|
172
|
+
swiping: v("swiping", V)
|
|
169
173
|
}
|
|
170
|
-
}),
|
|
171
|
-
let t =
|
|
172
|
-
return t !== void 0 ? t = `${t}px` :
|
|
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
|
-
}),
|
|
188
|
+
}), he = () => {
|
|
185
189
|
var o;
|
|
186
190
|
const t = (o = n.trigger) == null ? void 0 : o.call(n, {});
|
|
187
|
-
if (!
|
|
188
|
-
return
|
|
189
|
-
|
|
191
|
+
if (!m(t))
|
|
192
|
+
return c(
|
|
193
|
+
Je,
|
|
190
194
|
{
|
|
191
195
|
asChild: !0,
|
|
192
|
-
ref:
|
|
196
|
+
ref: B
|
|
193
197
|
},
|
|
194
198
|
() => t
|
|
195
199
|
);
|
|
196
|
-
},
|
|
200
|
+
}, be = () => {
|
|
197
201
|
var o;
|
|
198
202
|
const t = (o = n.beforeTitle) == null ? void 0 : o.call(n, {});
|
|
199
|
-
if (!
|
|
200
|
-
},
|
|
203
|
+
if (!m(t)) return t;
|
|
204
|
+
}, we = () => {
|
|
201
205
|
const t = () => {
|
|
202
206
|
var g;
|
|
203
|
-
const
|
|
204
|
-
if (!
|
|
207
|
+
const p = (g = n.beforeActions) == null ? void 0 : g.call(n, {});
|
|
208
|
+
if (!m(p)) return p;
|
|
205
209
|
}, o = () => {
|
|
206
|
-
const
|
|
207
|
-
if (e.canFullScreen &&
|
|
208
|
-
|
|
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:
|
|
216
|
+
onClick: pe
|
|
213
217
|
})
|
|
214
|
-
), e.closeable &&
|
|
215
|
-
|
|
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
|
-
),
|
|
225
|
+
), p.length) return c(ee, { gap: "sm" }, () => p);
|
|
222
226
|
}, l = t(), b = o();
|
|
223
227
|
if (l || b)
|
|
224
|
-
return
|
|
228
|
+
return c("div", { class: u(d(a, "actions"), e.actionsCls) }, [
|
|
225
229
|
l,
|
|
226
230
|
b
|
|
227
231
|
]);
|
|
228
|
-
},
|
|
232
|
+
}, Ce = () => {
|
|
229
233
|
var l;
|
|
230
|
-
const t = (l = n.title) == null ? void 0 : l.call(n, {}), o = !
|
|
234
|
+
const t = (l = n.title) == null ? void 0 : l.call(n, {}), o = !m(t);
|
|
231
235
|
if (e.title || o)
|
|
232
|
-
return
|
|
233
|
-
},
|
|
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 = !
|
|
239
|
+
const t = (l = n.description) == null ? void 0 : l.call(n, {}), o = !m(t);
|
|
236
240
|
if (e.description || o)
|
|
237
|
-
return
|
|
238
|
-
|
|
241
|
+
return c(
|
|
242
|
+
Qe,
|
|
239
243
|
{
|
|
240
244
|
class: u(
|
|
241
|
-
|
|
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 =
|
|
253
|
+
const t = we(), o = be();
|
|
250
254
|
if (e.frameless) return t;
|
|
251
255
|
const l = () => {
|
|
252
|
-
const g =
|
|
256
|
+
const g = Ce();
|
|
253
257
|
if (g || t || o)
|
|
254
|
-
return
|
|
258
|
+
return c(
|
|
255
259
|
"div",
|
|
256
|
-
{ class: u(
|
|
260
|
+
{ class: u(d(a, "title_wrapper"), e.titleWrapperCls) },
|
|
257
261
|
[o, g, t]
|
|
258
262
|
);
|
|
259
|
-
}, b =
|
|
260
|
-
if (
|
|
261
|
-
return
|
|
263
|
+
}, b = ve(), p = l();
|
|
264
|
+
if (p || b)
|
|
265
|
+
return c(
|
|
262
266
|
"div",
|
|
263
267
|
{
|
|
264
|
-
class: u(
|
|
268
|
+
class: u(d(a, "header"), e.headerCls)
|
|
265
269
|
},
|
|
266
|
-
[
|
|
270
|
+
[p, b]
|
|
267
271
|
);
|
|
268
272
|
}, De = () => {
|
|
269
|
-
var
|
|
270
|
-
const t = (
|
|
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
|
|
274
|
-
const
|
|
275
|
-
(
|
|
276
|
-
|
|
277
|
-
|
|
277
|
+
var Y, q;
|
|
278
|
+
const F = [];
|
|
279
|
+
(Y = e.cancelProps) != null && Y.hide || F.push(
|
|
280
|
+
c(
|
|
281
|
+
te,
|
|
278
282
|
{
|
|
279
|
-
...
|
|
283
|
+
...ue,
|
|
280
284
|
...e.cancelProps ?? {},
|
|
281
|
-
onClick:
|
|
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
|
-
), (
|
|
290
|
-
|
|
291
|
-
|
|
293
|
+
), (q = e.okProps) != null && q.hide || F.push(
|
|
294
|
+
c(
|
|
295
|
+
te,
|
|
292
296
|
{
|
|
293
|
-
...
|
|
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
|
|
305
|
-
if (b &&
|
|
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
|
|
312
|
+
return c(
|
|
309
313
|
"div",
|
|
310
|
-
{ class: u(
|
|
314
|
+
{ class: u(d(a, "footer"), e.footerCls) },
|
|
311
315
|
g
|
|
312
316
|
);
|
|
313
|
-
},
|
|
317
|
+
}, Be = () => {
|
|
314
318
|
var o;
|
|
315
319
|
const t = (o = n.default) == null ? void 0 : o.call(n, {});
|
|
316
|
-
if (!
|
|
317
|
-
return e.noBody ? t :
|
|
320
|
+
if (!m(t))
|
|
321
|
+
return e.noBody ? t : c(
|
|
318
322
|
"div",
|
|
319
323
|
{
|
|
320
|
-
class: u(
|
|
324
|
+
class: u(d(a, "body"), e.bodyCls)
|
|
321
325
|
},
|
|
322
326
|
t
|
|
323
327
|
);
|
|
324
|
-
},
|
|
325
|
-
if (e.animated &&
|
|
326
|
-
if (e.type === "modal") return
|
|
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
|
|
334
|
+
return I(a, "side-x");
|
|
331
335
|
case "bottom":
|
|
332
336
|
case "top":
|
|
333
|
-
return
|
|
337
|
+
return I(a, "side-y");
|
|
334
338
|
}
|
|
335
|
-
}),
|
|
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
|
-
}),
|
|
345
|
-
() => !h.value &&
|
|
346
|
-
),
|
|
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
|
-
}),
|
|
353
|
-
if (!
|
|
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(
|
|
356
|
-
let o = -
|
|
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
|
-
}),
|
|
359
|
-
(!e.keyboard || !e.open) && (t.preventDefault(), t.stopPropagation()), e.open &&
|
|
360
|
-
},
|
|
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
|
-
},
|
|
366
|
+
}, He = (t) => {
|
|
363
367
|
(!e.closeOnClickOutside || !e.open) && (t.preventDefault(), t.stopPropagation());
|
|
364
|
-
};
|
|
365
|
-
return (
|
|
366
|
-
|
|
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
|
-
|
|
372
|
-
|
|
380
|
+
C(he),
|
|
381
|
+
C(r(Ge), je(Ee(r(A))), {
|
|
373
382
|
default: O(() => [
|
|
374
|
-
|
|
375
|
-
name:
|
|
383
|
+
C(ze, {
|
|
384
|
+
name: Pe.value,
|
|
376
385
|
css: !!i.animated,
|
|
377
|
-
duration:
|
|
386
|
+
duration: Ae.value,
|
|
387
|
+
onAfterEnter: xe,
|
|
388
|
+
onAfterLeave: Te
|
|
378
389
|
}, {
|
|
379
390
|
default: O(() => [
|
|
380
|
-
r(
|
|
381
|
-
"as-child": !
|
|
382
|
-
key: String(!
|
|
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(
|
|
385
|
-
[r(
|
|
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":
|
|
392
|
-
...r(z)(
|
|
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
|
-
|
|
407
|
+
We(Le("div", {
|
|
408
|
+
ref_key: "content",
|
|
409
|
+
ref: $,
|
|
397
410
|
"data-screen": i.screen ? "" : void 0,
|
|
398
|
-
class:
|
|
411
|
+
class: H(
|
|
399
412
|
r(u)(
|
|
400
413
|
{
|
|
401
|
-
pc_grid__container:
|
|
414
|
+
pc_grid__container: P.value
|
|
402
415
|
},
|
|
403
|
-
r(
|
|
416
|
+
r(ge)({
|
|
404
417
|
frameless: i.frameless,
|
|
405
418
|
fullscreen: r(h),
|
|
406
|
-
width:
|
|
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:
|
|
414
|
-
"--ptc-dialog-w":
|
|
415
|
-
"--ptc-dialog-min-h":
|
|
416
|
-
"--ptc-dialog-h":
|
|
417
|
-
"--ptc-dialog-max-h":
|
|
418
|
-
"--ptc-dialog-mobile-drawer-min-h":
|
|
419
|
-
"--ptc-dialog-mobile-drawer-h":
|
|
420
|
-
"--ptc-dialog-mobile-drawer-max-h":
|
|
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 ? (
|
|
437
|
+
!r(h) && i.mask ? (k(), N(r(nt), {
|
|
425
438
|
key: 0,
|
|
426
439
|
onClick: me,
|
|
427
|
-
class:
|
|
440
|
+
class: H(r(u)(r(d)(r(a), "blanket"), i.blanketCls)),
|
|
428
441
|
screen: !1
|
|
429
|
-
}, null, 8, ["class"])) :
|
|
430
|
-
|
|
431
|
-
forceMount: r(
|
|
432
|
-
onInteractOutside:
|
|
433
|
-
onOpenAutoFocus:
|
|
434
|
-
onEscapeKeyDown:
|
|
435
|
-
onPointerDownOutside: o[0] || (o[0] = (l) =>
|
|
436
|
-
onFocusOutside: o[1] || (o[1] = (l) =>
|
|
437
|
-
class:
|
|
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(
|
|
440
|
-
swiping: r(
|
|
452
|
+
r(ye)({
|
|
453
|
+
swiping: r(L)
|
|
441
454
|
}),
|
|
442
455
|
i.contentCls
|
|
443
456
|
)
|
|
444
457
|
),
|
|
445
|
-
style:
|
|
446
|
-
"--ptc-dialog-swipe-transform":
|
|
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
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
e.swipeTrigger && i.type === "drawer" && ["top", "bottom"].includes(e.side) && !r(h) ? (
|
|
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:
|
|
458
|
-
class:
|
|
459
|
-
}, null, 2)) :
|
|
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,
|
|
464
|
-
[
|
|
476
|
+
], 14, at), [
|
|
477
|
+
[Ue, r(T)]
|
|
465
478
|
])
|
|
466
479
|
]),
|
|
467
480
|
_: 1
|
|
468
|
-
}, 16, ["as-child", "class", "style"])) :
|
|
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
|
-
}),
|
|
492
|
+
}), Dt = ie(st, le("Dialog")), Bt = ie(se, le("DialogTitle"));
|
|
480
493
|
export {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
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
|
};
|